@spotlightjs/spotlight 4.7.0 → 4.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/_virtual/_sentry-release-injection-file.js +2 -2
  2. package/dist/run.js +1 -0
  3. package/dist/sentry-config.js +4 -3
  4. package/dist/sentry-config.js.map +1 -1
  5. package/dist/server/cli/mcp.js.map +1 -1
  6. package/dist/server/cli/run.js +2 -2
  7. package/dist/server/cli.js +2 -2
  8. package/dist/server/mcp/mcp.js +2 -2
  9. package/dist/server/routes/stream/index.js +7 -4
  10. package/dist/server/routes/stream/index.js.map +1 -1
  11. package/dist/server/sdk.d.ts +1 -1
  12. package/dist/server/sdk.js.map +1 -1
  13. package/dist/server/utils/docker-compose.js +2 -2
  14. package/dist/ui/assets/instrumentation.js +15 -15
  15. package/dist/ui/assets/instrumentation.js.map +1 -1
  16. package/dist/ui/assets/main.js +1 -1
  17. package/package.json +2 -2
  18. package/dist/_virtual/re.js +0 -13
  19. package/dist/_virtual/re.js.map +0 -1
  20. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js +0 -132
  21. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js.map +0 -1
  22. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js +0 -397
  23. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js.map +0 -1
  24. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js +0 -286
  25. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js.map +0 -1
  26. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js +0 -20
  27. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js.map +0 -1
  28. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js +0 -62
  29. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js.map +0 -1
  30. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js +0 -55
  31. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js.map +0 -1
  32. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js +0 -21
  33. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js.map +0 -1
  34. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js +0 -17
  35. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js.map +0 -1
  36. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js +0 -17
  37. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js.map +0 -1
  38. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js +0 -51
  39. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js.map +0 -1
  40. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js +0 -17
  41. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js.map +0 -1
  42. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js +0 -17
  43. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js.map +0 -1
  44. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js +0 -17
  45. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js.map +0 -1
  46. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js +0 -31
  47. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js.map +0 -1
  48. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js +0 -17
  49. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js.map +0 -1
  50. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js +0 -17
  51. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js.map +0 -1
  52. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js +0 -17
  53. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js.map +0 -1
  54. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js +0 -17
  55. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js.map +0 -1
  56. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js +0 -17
  57. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js.map +0 -1
  58. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js +0 -29
  59. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js.map +0 -1
  60. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js +0 -17
  61. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js.map +0 -1
  62. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js +0 -20
  63. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js.map +0 -1
  64. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js +0 -17
  65. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js.map +0 -1
  66. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js +0 -17
  67. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js.map +0 -1
  68. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js +0 -24
  69. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js.map +0 -1
  70. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js +0 -17
  71. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js.map +0 -1
  72. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js +0 -20
  73. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js.map +0 -1
  74. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js +0 -143
  75. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js.map +0 -1
  76. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js +0 -38
  77. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js.map +0 -1
  78. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js +0 -16
  79. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js.map +0 -1
  80. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js +0 -31
  81. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js.map +0 -1
  82. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js +0 -44
  83. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js.map +0 -1
  84. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js +0 -25
  85. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js.map +0 -1
  86. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js +0 -100
  87. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js.map +0 -1
  88. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js +0 -17
  89. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js.map +0 -1
  90. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js +0 -21
  91. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js.map +0 -1
  92. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js +0 -17
  93. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js.map +0 -1
  94. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js +0 -37
  95. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js.map +0 -1
  96. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js +0 -37
  97. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js.map +0 -1
  98. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js +0 -66
  99. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js.map +0 -1
  100. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js +0 -83
  101. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js.map +0 -1
  102. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js +0 -58
  103. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js.map +0 -1
  104. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js +0 -172
  105. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js.map +0 -1
  106. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js +0 -17
  107. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js.map +0 -1
  108. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js +0 -23
  109. package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js.map +0 -1
@@ -1,25 +1,25 @@
1
- import"./main.js";import{r as va,g as _l,m as Sl,c as yl,u as El,a as bl}from"./serverTimingMeta.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7b1dfe4f-2430-4315-87bb-97f68c4c3d0c",e._sentryDebugIdIdentifier="sentry-dbid-7b1dfe4f-2430-4315-87bb-97f68c4c3d0c")}catch{}})();const v=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,L=globalThis,_t="10.26.0";function Rt(){return vn(L),L}function vn(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||_t,t[_t]=t[_t]||{}}function Jt(e,t,n=L){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[_t]=r[_t]||{};return s[e]||(s[e]=t())}const Ia=["debug","info","warn","error","log","assert","trace"],Tl="Sentry Logger ",ar={};function at(e){if(!("console"in L))return e();const t=L.console,n={},r=Object.keys(ar);r.forEach(s=>{const i=ar[s];n[s]=t[s],t[s]=i});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function vl(){qs().enabled=!0}function Il(){qs().enabled=!1}function wa(){return qs().enabled}function wl(...e){js("log",...e)}function kl(...e){js("warn",...e)}function Rl(...e){js("error",...e)}function js(e,...t){v&&wa()&&at(()=>{L.console[e](`${Tl}[${e}]:`,...t)})}function qs(){return v?Jt("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const m={enable:vl,disable:Il,isEnabled:wa,log:wl,warn:kl,error:Rl},ka=50,Tt="?",Ui=/\(error: (.*)\)/,Hi=/captureMessage|captureException/;function Ra(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const i=[],o=n.split(`
2
- `);for(let c=r;c<o.length;c++){let a=o[c];a.length>1024&&(a=a.slice(0,1024));const u=Ui.test(a)?a.replace(Ui,"$1"):a;if(!u.match(/\S*Error: /)){for(const d of t){const l=d(u);if(l){i.push(l);break}}if(i.length>=ka+s)break}}return Ml(i.slice(s))}}function Cl(e){return Array.isArray(e)?Ra(...e):e}function Ml(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test($n(t).function||"")&&t.pop(),t.reverse(),Hi.test($n(t).function||"")&&(t.pop(),Hi.test($n(t).function||"")&&t.pop()),t.slice(0,ka).map(n=>({...n,filename:n.filename||$n(t).filename,function:n.function||Tt}))}function $n(e){return e[e.length-1]||{}}const Gr="<anonymous>";function Ke(e){try{return!e||typeof e!="function"?Gr:e.name||Gr}catch{return Gr}}function Wi(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 Ca(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const Jn={},zi={};function ct(e,t){Jn[e]=Jn[e]||[],Jn[e].push(t)}function ut(e,t){if(!zi[e]){zi[e]=!0;try{t()}catch(n){v&&m.error(`Error while instrumenting ${e}`,n)}}}function Ae(e,t){const n=e&&Jn[e];if(n)for(const r of n)try{r(t)}catch(s){v&&m.error(`Error while triggering instrumentation handler.
1
+ import"./main.js";import{r as Ia,g as Sl,m as yl,c as El,u as bl,a as Tl}from"./serverTimingMeta.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a38f39bf-f9fa-4248-96f7-c56a606da249",e._sentryDebugIdIdentifier="sentry-dbid-a38f39bf-f9fa-4248-96f7-c56a606da249")}catch{}})();const v=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,L=globalThis,_t="10.26.0";function Rt(){return vn(L),L}function vn(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||_t,t[_t]=t[_t]||{}}function Jt(e,t,n=L){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[_t]=r[_t]||{};return s[e]||(s[e]=t())}const wa=["debug","info","warn","error","log","assert","trace"],vl="Sentry Logger ",ar={};function at(e){if(!("console"in L))return e();const t=L.console,n={},r=Object.keys(ar);r.forEach(s=>{const i=ar[s];n[s]=t[s],t[s]=i});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function Il(){qs().enabled=!0}function wl(){qs().enabled=!1}function ka(){return qs().enabled}function kl(...e){js("log",...e)}function Rl(...e){js("warn",...e)}function Cl(...e){js("error",...e)}function js(e,...t){v&&ka()&&at(()=>{L.console[e](`${vl}[${e}]:`,...t)})}function qs(){return v?Jt("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const m={enable:Il,disable:wl,isEnabled:ka,log:kl,warn:Rl,error:Cl},Ra=50,Tt="?",Ui=/\(error: (.*)\)/,Hi=/captureMessage|captureException/;function Ca(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const i=[],o=n.split(`
2
+ `);for(let c=r;c<o.length;c++){let a=o[c];a.length>1024&&(a=a.slice(0,1024));const u=Ui.test(a)?a.replace(Ui,"$1"):a;if(!u.match(/\S*Error: /)){for(const d of t){const l=d(u);if(l){i.push(l);break}}if(i.length>=Ra+s)break}}return xl(i.slice(s))}}function Ml(e){return Array.isArray(e)?Ca(...e):e}function xl(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test($n(t).function||"")&&t.pop(),t.reverse(),Hi.test($n(t).function||"")&&(t.pop(),Hi.test($n(t).function||"")&&t.pop()),t.slice(0,Ra).map(n=>({...n,filename:n.filename||$n(t).filename,function:n.function||Tt}))}function $n(e){return e[e.length-1]||{}}const Gr="<anonymous>";function Ke(e){try{return!e||typeof e!="function"?Gr:e.name||Gr}catch{return Gr}}function Wi(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 Ma(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const Jn={},zi={};function ct(e,t){Jn[e]=Jn[e]||[],Jn[e].push(t)}function ut(e,t){if(!zi[e]){zi[e]=!0;try{t()}catch(n){v&&m.error(`Error while instrumenting ${e}`,n)}}}function Ae(e,t){const n=e&&Jn[e];if(n)for(const r of n)try{r(t)}catch(s){v&&m.error(`Error while triggering instrumentation handler.
3
3
  Type: ${e}
4
4
  Name: ${Ke(r)}
5
- Error:`,s)}}let Yr=null;function Ma(e){const t="error";ct(t,e),ut(t,xl)}function xl(){Yr=L.onerror,L.onerror=function(e,t,n,r,s){return Ae("error",{column:r,error:s,line:n,msg:e,url:t}),Yr?Yr.apply(this,arguments):!1},L.onerror.__SENTRY_INSTRUMENTED__=!0}let Kr=null;function xa(e){const t="unhandledrejection";ct(t,e),ut(t,Al)}function Al(){Kr=L.onunhandledrejection,L.onunhandledrejection=function(e){return Ae("unhandledrejection",e),Kr?Kr.apply(this,arguments):!0},L.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Aa=Object.prototype.toString;function Vs(e){switch(Aa.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Xe(e,Error)}}function Qt(e,t){return Aa.call(e)===`[object ${t}]`}function Na(e){return Qt(e,"ErrorEvent")}function ji(e){return Qt(e,"DOMError")}function Nl(e){return Qt(e,"DOMException")}function qe(e){return Qt(e,"String")}function Cr(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function vt(e){return e===null||Cr(e)||typeof e!="object"&&typeof e!="function"}function pn(e){return Qt(e,"Object")}function Mr(e){return typeof Event<"u"&&Xe(e,Event)}function Ol(e){return typeof Element<"u"&&Xe(e,Element)}function Pl(e){return Qt(e,"RegExp")}function Zt(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function Ll(e){return pn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Xe(e,t){try{return e instanceof t}catch{return!1}}function Oa(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Pa(e){return typeof Request<"u"&&Xe(e,Request)}const Gs=L,Dl=80;function Ee(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const c=" > ",a=c.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||Dl;for(;n&&i++<r&&(u=Fl(n,d),!(u==="html"||i>1&&o+s.length*a+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(c)}catch{return"<unknown>"}}function Fl(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if(Gs.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t!=null&&t.length?t.filter(o=>n.getAttribute(o)).map(o=>[o,n.getAttribute(o)]):null;if(s!=null&&s.length)s.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const o=n.className;if(o&&qe(o)){const c=o.split(/\s+/);for(const a of c)r.push(`.${a}`)}}const i=["aria-label","type","name","title","alt"];for(const o of i){const c=n.getAttribute(o);c&&r.push(`[${o}="${c}"]`)}return r.join("")}function en(){try{return Gs.document.location.href}catch{return""}}function La(e){if(!Gs.HTMLElement)return null;let t=e;const n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function ye(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&Da(s,r);try{e[t]=s}catch{v&&m.log(`Failed to replace method "${t}" in object`,e)}}function Ie(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{v&&m.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Da(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Ie(e,"__sentry_original__",t)}catch{}}function Ys(e){return e.__sentry_original__}function Fa(e){if(Vs(e))return{message:e.message,name:e.name,stack:e.stack,...Vi(e)};if(Mr(e)){const t={type:e.type,target:qi(e.target),currentTarget:qi(e.currentTarget),...Vi(e)};return typeof CustomEvent<"u"&&Xe(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function qi(e){try{return Ol(e)?Ee(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Vi(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function Bl(e){const t=Object.keys(Fa(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}function Ba(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Gi(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const s=e[r];try{Oa(s)?n.push(Ca(s)):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Qn(e,t,n=!1){return qe(e)?Pl(t)?t.test(e):qe(t)?n?e===t:e.includes(t):!1:!1}function Ve(e,t=[],n=!1){return t.some(r=>Qn(e,r,n))}function $l(){const e=L;return e.crypto||e.msCrypto}let Xr;function Ul(){return Math.random()*16}function fe(e=$l()){try{if(e!=null&&e.randomUUID)return e.randomUUID().replace(/-/g,"")}catch{}return Xr||(Xr="10000000100040008000"+1e11),Xr.replace(/[018]/g,t=>(t^(Ul()&15)>>t/4).toString(16))}function $a(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function pt(e){const{message:t,event_id:n}=e;if(t)return t;const r=$a(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function hs(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function Wt(e,t){const n=$a(e);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){const i={...s==null?void 0:s.data,...t.data};n.mechanism.data=i}}function Yi(e){if(Hl(e))return!0;try{Ie(e,"__sentry_captured__",!0)}catch{}return!1}function Hl(e){try{return e.__sentry_captured__}catch{}}const Ua=1e3;function Ct(){return Date.now()/Ua}function Wl(){const{performance:e}=L;if(!(e!=null&&e.now)||!e.timeOrigin)return Ct;const t=e.timeOrigin;return()=>(t+e.now())/Ua}let Ki;function ie(){return(Ki??(Ki=Wl()))()}let Jr;function zl(){var d;const{performance:e}=L;if(!(e!=null&&e.now))return[void 0,"none"];const t=3600*1e3,n=e.now(),r=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=s<t,o=(d=e.timing)==null?void 0:d.navigationStart,a=typeof o=="number"?Math.abs(o+n-r):t,u=a<t;return i||u?s<=a?[e.timeOrigin,"timeOrigin"]:[o,"navigationStart"]:[r,"dateNow"]}function he(){return Jr||(Jr=zl()),Jr[0]}function jl(e){const t=ie(),n={sid:fe(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Vl(n)};return e&&zt(n,e),n}function zt(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||ie(),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:fe()),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 ql(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),zt(e,n)}function Vl(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 In(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 s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=In(r[s],t[s],n-1));return r}function Je(){return fe()}function Ge(){return fe().substring(16)}const ms="_sentrySpan";function jt(e,t){t?Ie(e,ms,t):delete e[ms]}function hn(e){return e[ms]}const Gl=100;class $e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Je(),sampleRand:Math.random()}}clone(){const t=new $e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},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,jt(t,hn(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&&zt(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}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 $e?n.getScopeData():pn(n)?t:void 0,{tags:s,extra:i,user:o,contexts:c,level:a,fingerprint:u=[],propagationContext:d}=r||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},o&&Object.keys(o).length&&(this._user=o),a&&(this._level=a),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,jt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Je(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var i;const r=typeof n=="number"?n:Gl;if(r<=0)return this;const s={timestamp:Ct(),...t,message:t.message?Ba(t.message,2048):t.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(i=this._client)==null||i.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,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:hn(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=In(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)||fe();if(!this._client)return v&&m.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureMessage(t,n,r){const s=(r==null?void 0:r.event_id)||fe();if(!this._client)return v&&m.warn("No client configured on scope - will not capture message!"),s;const i=(r==null?void 0:r.syntheticException)??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:s},this),s}captureEvent(t,n){const r=(n==null?void 0:n.event_id)||fe();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(v&&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 Yl(){return Jt("defaultCurrentScope",()=>new $e)}function Kl(){return Jt("defaultIsolationScope",()=>new $e)}class Xl{constructor(t,n){let r;t?r=t:r=new $e;let s;n?s=n:s=new $e,this._stack=[{scope:r}],this._isolationScope=s}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(s){throw this._popScope(),s}return Zt(r)?r.then(s=>(this._popScope(),s),s=>{throw this._popScope(),s}):(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 qt(){const e=Rt(),t=vn(e);return t.stack=t.stack||new Xl(Yl(),Kl())}function Jl(e){return qt().withScope(e)}function Ql(e,t){const n=qt();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Xi(e){return qt().withScope(()=>e(qt().getIsolationScope()))}function Zl(){return{withIsolationScope:Xi,withScope:Jl,withSetScope:Ql,withSetIsolationScope:(e,t)=>Xi(t),getCurrentScope:()=>qt().getScope(),getIsolationScope:()=>qt().getIsolationScope()}}function tn(e){const t=vn(e);return t.acs?t.acs:Zl()}function G(){const e=Rt();return tn(e).getCurrentScope()}function De(){const e=Rt();return tn(e).getIsolationScope()}function cr(){return Jt("globalScope",()=>new $e)}function wn(...e){const t=Rt(),n=tn(t);if(e.length===2){const[r,s]=e;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(e[0])}function H(){return G().getClient()}function Ha(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=t,i={trace_id:n,span_id:s||Ge()};return r&&(i.parent_span_id=r),i}const xe="sentry.source",Ks="sentry.sample_rate",Wa="sentry.previous_trace_sample_rate",Ue="sentry.op",ae="sentry.origin",mn="sentry.idle_span_finish_reason",kn="sentry.measurement_unit",Rn="sentry.measurement_value",Ji="sentry.custom_span_name",Xs="sentry.profile_id",nn="sentry.exclusive_time",ed="sentry.link.type",td=0,Js=1,de=2;function nd(e){if(e<400&&e>=100)return{code:Js};if(e>=400&&e<500)switch(e){case 401:return{code:de,message:"unauthenticated"};case 403:return{code:de,message:"permission_denied"};case 404:return{code:de,message:"not_found"};case 409:return{code:de,message:"already_exists"};case 413:return{code:de,message:"failed_precondition"};case 429:return{code:de,message:"resource_exhausted"};case 499:return{code:de,message:"cancelled"};default:return{code:de,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:de,message:"unimplemented"};case 503:return{code:de,message:"unavailable"};case 504:return{code:de,message:"deadline_exceeded"};default:return{code:de,message:"internal_error"}}return{code:de,message:"internal_error"}}function za(e,t){e.setAttribute("http.response.status_code",t);const n=nd(t);n.message!=="unknown_error"&&e.setStatus(n)}const ja="_sentryScope",qa="_sentryIsolationScope";function rd(e){try{const t=L.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function sd(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function id(e,t,n){e&&(Ie(e,qa,rd(n)),Ie(e,ja,t))}function ur(e){const t=e;return{scope:t[ja],isolationScope:sd(t[qa])}}const Qs="sentry-",od=/^sentry-/,ad=8192;function Va(e){const t=ud(e);if(!t)return;const n=Object.entries(t).reduce((r,[s,i])=>{if(s.match(od)){const o=s.slice(Qs.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function cd(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,s])=>(s&&(n[`${Qs}${r}`]=s),n),{});return ld(t)}function ud(e){if(!(!e||!qe(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=Qi(n);return Object.entries(r).forEach(([s,i])=>{t[s]=i}),t},{}):Qi(e)}function Qi(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),s=t.slice(n+1);return[r,s].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function ld(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],s)=>{const i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${t},${i}`;return o.length>ad?(v&&m.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):o},"")}const dd=/^o(\d+)\./,fd=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function pd(e){return e==="http"||e==="https"}function Mt(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:c,publicKey:a}=e;return`${c}://${a}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function hd(e){const t=fd.exec(e);if(!t){at(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",i="",o="",c=""]=t.slice(1);let a="",u=c;const d=u.split("/");if(d.length>1&&(a=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Ga({host:i,pass:s,path:a,projectId:u,port:o,protocol:n,publicKey:r})}function Ga(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function md(e){if(!v)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(m.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?pd(r)?t&&isNaN(parseInt(t,10))?(m.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(m.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(m.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function gd(e){const t=e.match(dd);return t==null?void 0:t[1]}function _d(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=gd(n)),r}function Sd(e){const t=typeof e=="string"?hd(e):Ga(e);if(!(!t||!md(t)))return t}function It(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 Ya=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function yd(e){if(!e)return;const t=e.match(Ya);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 Ed(e,t){const n=yd(e),r=Va(t);if(!(n!=null&&n.traceId))return{traceId:Je(),sampleRand:Math.random()};const s=bd(n,r);r&&(r.sample_rand=s.toString());const{traceId:i,parentSpanId:o,parentSampled:c}=n;return{traceId:i,parentSpanId:o,sampled:c,dsc:r||{},sampleRand:s}}function Ka(e=Je(),t=Ge(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Xa(e=Je(),t=Ge(),n){return`00-${e}-${t}-${n?"01":"00"}`}function bd(e,t){const n=It(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=It(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?Math.random()*r:r+Math.random()*(1-r):Math.random()}const Ja=0,Zs=1;let Zi=!1;function Td(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:c,links:a}=U(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:s,status:o,origin:c,links:a}}function Qa(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:U(e).parent_span_id,i=ur(e).scope,o=r?(i==null?void 0:i.getPropagationContext().propagationSpanId)||Ge():t;return{parent_span_id:s,span_id:o,trace_id:n}}function vd(e){const{traceId:t,spanId:n}=e.spanContext(),r=lt(e);return Ka(t,n,r)}function Id(e){const{traceId:t,spanId:n}=e.spanContext(),r=lt(e);return Xa(t,n,r)}function Za(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...s},attributes:i})=>({span_id:t,trace_id:n,sampled:r===Zs,attributes:i,...s}))}function St(e){return typeof e=="number"?eo(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?eo(e.getTime()):ie()}function eo(e){return e>9999999999?e/1e3:e}function U(e){var r;if(kd(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(wd(e)){const{attributes:s,startTime:i,name:o,endTime:c,status:a,links:u}=e,d="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(r=e.parentSpanContext)==null?void 0:r.spanId:void 0;return{span_id:t,trace_id:n,data:s,description:o,parent_span_id:d,start_timestamp:St(i),timestamp:St(c)||void 0,status:ec(a),op:s[Ue],origin:s[ae],links:Za(u)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function wd(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function kd(e){return typeof e.getSpanJSON=="function"}function lt(e){const{traceFlags:t}=e.spanContext();return t===Zs}function ec(e){if(!(!e||e.code===td))return e.code===Js?"ok":e.message||"internal_error"}const yt="_sentryChildSpans",gs="_sentryRootSpan";function tc(e,t){const n=e[gs]||e;Ie(t,gs,n),e[yt]?e[yt].add(t):Ie(e,yt,new Set([t]))}function Rd(e,t){e[yt]&&e[yt].delete(t)}function Zn(e){const t=new Set;function n(r){if(!t.has(r)&&lt(r)){t.add(r);const s=r[yt]?Array.from(r[yt]):[];for(const i of s)n(i)}}return n(e),Array.from(t)}function le(e){return e[gs]||e}function pe(){const e=Rt(),t=tn(e);return t.getActiveSpan?t.getActiveSpan():hn(G())}function _s(){Zi||(at(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Zi=!0)}let to=!1;function Cd(){if(to)return;function e(){const t=pe(),n=t&&le(t);if(n){const r="internal_error";v&&m.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:de,message:r})}}e.tag="sentry_tracingErrorCallback",to=!0,Ma(e),xa(e)}function Ne(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=H())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function no(e){m.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function lr(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(xd(n)){if(Qn(e.description,n))return v&&no(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?Qn(e.description,n.name):!0,s=n.op?e.op&&Qn(e.op,n.op):!0;if(r&&s)return v&&no(e),!0}return!1}function Md(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const s of e)s.parent_span_id===r&&(s.parent_span_id=n)}function xd(e){return typeof e=="string"||e instanceof RegExp}const xr="production",nc="_frozenDsc";function er(e,t){Ie(e,nc,t)}function rc(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||xr,release:n.release,public_key:r,trace_id:e,org_id:_d(t)};return t.emit("createDsc",s),s}function ei(e,t){const n=t.getPropagationContext();return n.dsc||rc(n.traceId,e)}function He(e){var h;const t=H();if(!t)return{};const n=le(e),r=U(n),s=r.data,i=n.spanContext().traceState,o=(i==null?void 0:i.get("sentry.sample_rate"))??s[Ks]??s[Wa];function c(g){return(typeof o=="number"||typeof o=="string")&&(g.sample_rate=`${o}`),g}const a=n[nc];if(a)return c(a);const u=i==null?void 0:i.get("sentry.dsc"),d=u&&Va(u);if(d)return c(d);const l=rc(e.spanContext().traceId,t),f=s[xe],p=r.description;return f!=="url"&&p&&(l.transaction=p),Ne()&&(l.sampled=String(lt(n)),l.sample_rand=(i==null?void 0:i.get("sentry.sample_rand"))??((h=ur(n).scope)==null?void 0:h.getPropagationContext().sampleRand.toString())),c(l),t.emit("createDsc",l,n),l}class st{constructor(t={}){this._traceId=t.traceId||Je(),this._spanId=t.spanId||Ge()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Ja}}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 Ce(e,t=100,n=1/0){try{return Ss("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function sc(e,t=3,n=100*1024){const r=Ce(e,t);return Pd(r)>n?sc(e,t-1,n):r}function Ss(e,t,n=1/0,r=1/0,s=Ld()){const[i,o]=s;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const c=Ad(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;const a=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(a===0)return c.replace("object ","");if(i(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const p=u.toJSON();return Ss("",p,a-1,r,s)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const f=Fa(t);for(const p in f){if(!Object.prototype.hasOwnProperty.call(f,p))continue;if(l>=r){d[p]="[MaxProperties ~]";break}const h=f[p];d[p]=Ss(p,h,a-1,r,s),l++}return o(t),d}function Ad(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Oa(t))return Ca(t);if(Ll(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Ke(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=Nd(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Nd(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function Od(e){return~-encodeURI(e).split(/%..|./).length}function Pd(e){return Od(JSON.stringify(e))}function Ld(){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 Qe(e,t=[]){return[e,t]}function Dd(e,t){const[n,r]=e;return[n,[...r,t]]}function dr(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function ro(e,t){return dr(e,(n,r)=>t.includes(r))}function fr(e){const t=vn(L);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Fd(e){const t=vn(L);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function pr(e){const[t,n]=e;let r=JSON.stringify(t);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[fr(r),i]:r.push(typeof i=="string"?fr(i):i)}for(const i of n){const[o,c]=i;if(s(`
5
+ Error:`,s)}}let Yr=null;function xa(e){const t="error";ct(t,e),ut(t,Al)}function Al(){Yr=L.onerror,L.onerror=function(e,t,n,r,s){return Ae("error",{column:r,error:s,line:n,msg:e,url:t}),Yr?Yr.apply(this,arguments):!1},L.onerror.__SENTRY_INSTRUMENTED__=!0}let Kr=null;function Aa(e){const t="unhandledrejection";ct(t,e),ut(t,Nl)}function Nl(){Kr=L.onunhandledrejection,L.onunhandledrejection=function(e){return Ae("unhandledrejection",e),Kr?Kr.apply(this,arguments):!0},L.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Na=Object.prototype.toString;function Vs(e){switch(Na.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Xe(e,Error)}}function Qt(e,t){return Na.call(e)===`[object ${t}]`}function Oa(e){return Qt(e,"ErrorEvent")}function ji(e){return Qt(e,"DOMError")}function Ol(e){return Qt(e,"DOMException")}function qe(e){return Qt(e,"String")}function Cr(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function vt(e){return e===null||Cr(e)||typeof e!="object"&&typeof e!="function"}function pn(e){return Qt(e,"Object")}function Mr(e){return typeof Event<"u"&&Xe(e,Event)}function Pl(e){return typeof Element<"u"&&Xe(e,Element)}function Ll(e){return Qt(e,"RegExp")}function Zt(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function Dl(e){return pn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Xe(e,t){try{return e instanceof t}catch{return!1}}function Pa(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function La(e){return typeof Request<"u"&&Xe(e,Request)}const Gs=L,Fl=80;function Ee(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const c=" > ",a=c.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||Fl;for(;n&&i++<r&&(u=Bl(n,d),!(u==="html"||i>1&&o+s.length*a+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(c)}catch{return"<unknown>"}}function Bl(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if(Gs.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t!=null&&t.length?t.filter(o=>n.getAttribute(o)).map(o=>[o,n.getAttribute(o)]):null;if(s!=null&&s.length)s.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const o=n.className;if(o&&qe(o)){const c=o.split(/\s+/);for(const a of c)r.push(`.${a}`)}}const i=["aria-label","type","name","title","alt"];for(const o of i){const c=n.getAttribute(o);c&&r.push(`[${o}="${c}"]`)}return r.join("")}function en(){try{return Gs.document.location.href}catch{return""}}function Da(e){if(!Gs.HTMLElement)return null;let t=e;const n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function ye(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&Fa(s,r);try{e[t]=s}catch{v&&m.log(`Failed to replace method "${t}" in object`,e)}}function Ie(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{v&&m.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Fa(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Ie(e,"__sentry_original__",t)}catch{}}function Ys(e){return e.__sentry_original__}function Ba(e){if(Vs(e))return{message:e.message,name:e.name,stack:e.stack,...Vi(e)};if(Mr(e)){const t={type:e.type,target:qi(e.target),currentTarget:qi(e.currentTarget),...Vi(e)};return typeof CustomEvent<"u"&&Xe(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function qi(e){try{return Pl(e)?Ee(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Vi(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function $l(e){const t=Object.keys(Ba(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}function $a(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Gi(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const s=e[r];try{Pa(s)?n.push(Ma(s)):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Qn(e,t,n=!1){return qe(e)?Ll(t)?t.test(e):qe(t)?n?e===t:e.includes(t):!1:!1}function Ve(e,t=[],n=!1){return t.some(r=>Qn(e,r,n))}function Ul(){const e=L;return e.crypto||e.msCrypto}let Xr;function Hl(){return Math.random()*16}function fe(e=Ul()){try{if(e!=null&&e.randomUUID)return e.randomUUID().replace(/-/g,"")}catch{}return Xr||(Xr="10000000100040008000"+1e11),Xr.replace(/[018]/g,t=>(t^(Hl()&15)>>t/4).toString(16))}function Ua(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function pt(e){const{message:t,event_id:n}=e;if(t)return t;const r=Ua(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function hs(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function Wt(e,t){const n=Ua(e);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){const i={...s==null?void 0:s.data,...t.data};n.mechanism.data=i}}function Yi(e){if(Wl(e))return!0;try{Ie(e,"__sentry_captured__",!0)}catch{}return!1}function Wl(e){try{return e.__sentry_captured__}catch{}}const Ha=1e3;function Ct(){return Date.now()/Ha}function zl(){const{performance:e}=L;if(!(e!=null&&e.now)||!e.timeOrigin)return Ct;const t=e.timeOrigin;return()=>(t+e.now())/Ha}let Ki;function ie(){return(Ki??(Ki=zl()))()}let Jr;function jl(){var d;const{performance:e}=L;if(!(e!=null&&e.now))return[void 0,"none"];const t=3600*1e3,n=e.now(),r=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=s<t,o=(d=e.timing)==null?void 0:d.navigationStart,a=typeof o=="number"?Math.abs(o+n-r):t,u=a<t;return i||u?s<=a?[e.timeOrigin,"timeOrigin"]:[o,"navigationStart"]:[r,"dateNow"]}function he(){return Jr||(Jr=jl()),Jr[0]}function ql(e){const t=ie(),n={sid:fe(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Gl(n)};return e&&zt(n,e),n}function zt(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||ie(),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:fe()),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 Vl(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),zt(e,n)}function Gl(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 In(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 s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=In(r[s],t[s],n-1));return r}function Je(){return fe()}function Ge(){return fe().substring(16)}const ms="_sentrySpan";function jt(e,t){t?Ie(e,ms,t):delete e[ms]}function hn(e){return e[ms]}const Yl=100;class $e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Je(),sampleRand:Math.random()}}clone(){const t=new $e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},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,jt(t,hn(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&&zt(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}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 $e?n.getScopeData():pn(n)?t:void 0,{tags:s,extra:i,user:o,contexts:c,level:a,fingerprint:u=[],propagationContext:d}=r||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},o&&Object.keys(o).length&&(this._user=o),a&&(this._level=a),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,jt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Je(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var i;const r=typeof n=="number"?n:Yl;if(r<=0)return this;const s={timestamp:Ct(),...t,message:t.message?$a(t.message,2048):t.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(i=this._client)==null||i.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,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:hn(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=In(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)||fe();if(!this._client)return v&&m.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureMessage(t,n,r){const s=(r==null?void 0:r.event_id)||fe();if(!this._client)return v&&m.warn("No client configured on scope - will not capture message!"),s;const i=(r==null?void 0:r.syntheticException)??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:s},this),s}captureEvent(t,n){const r=(n==null?void 0:n.event_id)||fe();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(v&&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 Kl(){return Jt("defaultCurrentScope",()=>new $e)}function Xl(){return Jt("defaultIsolationScope",()=>new $e)}class Jl{constructor(t,n){let r;t?r=t:r=new $e;let s;n?s=n:s=new $e,this._stack=[{scope:r}],this._isolationScope=s}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(s){throw this._popScope(),s}return Zt(r)?r.then(s=>(this._popScope(),s),s=>{throw this._popScope(),s}):(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 qt(){const e=Rt(),t=vn(e);return t.stack=t.stack||new Jl(Kl(),Xl())}function Ql(e){return qt().withScope(e)}function Zl(e,t){const n=qt();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Xi(e){return qt().withScope(()=>e(qt().getIsolationScope()))}function ed(){return{withIsolationScope:Xi,withScope:Ql,withSetScope:Zl,withSetIsolationScope:(e,t)=>Xi(t),getCurrentScope:()=>qt().getScope(),getIsolationScope:()=>qt().getIsolationScope()}}function tn(e){const t=vn(e);return t.acs?t.acs:ed()}function G(){const e=Rt();return tn(e).getCurrentScope()}function De(){const e=Rt();return tn(e).getIsolationScope()}function cr(){return Jt("globalScope",()=>new $e)}function wn(...e){const t=Rt(),n=tn(t);if(e.length===2){const[r,s]=e;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(e[0])}function H(){return G().getClient()}function Wa(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=t,i={trace_id:n,span_id:s||Ge()};return r&&(i.parent_span_id=r),i}const xe="sentry.source",Ks="sentry.sample_rate",za="sentry.previous_trace_sample_rate",Ue="sentry.op",ae="sentry.origin",mn="sentry.idle_span_finish_reason",kn="sentry.measurement_unit",Rn="sentry.measurement_value",Ji="sentry.custom_span_name",Xs="sentry.profile_id",nn="sentry.exclusive_time",td="sentry.link.type",nd=0,Js=1,de=2;function rd(e){if(e<400&&e>=100)return{code:Js};if(e>=400&&e<500)switch(e){case 401:return{code:de,message:"unauthenticated"};case 403:return{code:de,message:"permission_denied"};case 404:return{code:de,message:"not_found"};case 409:return{code:de,message:"already_exists"};case 413:return{code:de,message:"failed_precondition"};case 429:return{code:de,message:"resource_exhausted"};case 499:return{code:de,message:"cancelled"};default:return{code:de,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:de,message:"unimplemented"};case 503:return{code:de,message:"unavailable"};case 504:return{code:de,message:"deadline_exceeded"};default:return{code:de,message:"internal_error"}}return{code:de,message:"internal_error"}}function ja(e,t){e.setAttribute("http.response.status_code",t);const n=rd(t);n.message!=="unknown_error"&&e.setStatus(n)}const qa="_sentryScope",Va="_sentryIsolationScope";function sd(e){try{const t=L.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function id(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function od(e,t,n){e&&(Ie(e,Va,sd(n)),Ie(e,qa,t))}function ur(e){const t=e;return{scope:t[qa],isolationScope:id(t[Va])}}const Qs="sentry-",ad=/^sentry-/,cd=8192;function Ga(e){const t=ld(e);if(!t)return;const n=Object.entries(t).reduce((r,[s,i])=>{if(s.match(ad)){const o=s.slice(Qs.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function ud(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,s])=>(s&&(n[`${Qs}${r}`]=s),n),{});return dd(t)}function ld(e){if(!(!e||!qe(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=Qi(n);return Object.entries(r).forEach(([s,i])=>{t[s]=i}),t},{}):Qi(e)}function Qi(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),s=t.slice(n+1);return[r,s].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function dd(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],s)=>{const i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${t},${i}`;return o.length>cd?(v&&m.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):o},"")}const fd=/^o(\d+)\./,pd=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function hd(e){return e==="http"||e==="https"}function Mt(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:c,publicKey:a}=e;return`${c}://${a}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function md(e){const t=pd.exec(e);if(!t){at(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",i="",o="",c=""]=t.slice(1);let a="",u=c;const d=u.split("/");if(d.length>1&&(a=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Ya({host:i,pass:s,path:a,projectId:u,port:o,protocol:n,publicKey:r})}function Ya(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function gd(e){if(!v)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(m.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?hd(r)?t&&isNaN(parseInt(t,10))?(m.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(m.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(m.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function _d(e){const t=e.match(fd);return t==null?void 0:t[1]}function Sd(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=_d(n)),r}function yd(e){const t=typeof e=="string"?md(e):Ya(e);if(!(!t||!gd(t)))return t}function It(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 Ka=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Ed(e){if(!e)return;const t=e.match(Ka);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 bd(e,t){const n=Ed(e),r=Ga(t);if(!(n!=null&&n.traceId))return{traceId:Je(),sampleRand:Math.random()};const s=Td(n,r);r&&(r.sample_rand=s.toString());const{traceId:i,parentSpanId:o,parentSampled:c}=n;return{traceId:i,parentSpanId:o,sampled:c,dsc:r||{},sampleRand:s}}function Xa(e=Je(),t=Ge(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Ja(e=Je(),t=Ge(),n){return`00-${e}-${t}-${n?"01":"00"}`}function Td(e,t){const n=It(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=It(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?Math.random()*r:r+Math.random()*(1-r):Math.random()}const Qa=0,Zs=1;let Zi=!1;function vd(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:c,links:a}=U(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:s,status:o,origin:c,links:a}}function Za(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:U(e).parent_span_id,i=ur(e).scope,o=r?(i==null?void 0:i.getPropagationContext().propagationSpanId)||Ge():t;return{parent_span_id:s,span_id:o,trace_id:n}}function Id(e){const{traceId:t,spanId:n}=e.spanContext(),r=lt(e);return Xa(t,n,r)}function wd(e){const{traceId:t,spanId:n}=e.spanContext(),r=lt(e);return Ja(t,n,r)}function ec(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...s},attributes:i})=>({span_id:t,trace_id:n,sampled:r===Zs,attributes:i,...s}))}function St(e){return typeof e=="number"?eo(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?eo(e.getTime()):ie()}function eo(e){return e>9999999999?e/1e3:e}function U(e){var r;if(Rd(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(kd(e)){const{attributes:s,startTime:i,name:o,endTime:c,status:a,links:u}=e,d="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(r=e.parentSpanContext)==null?void 0:r.spanId:void 0;return{span_id:t,trace_id:n,data:s,description:o,parent_span_id:d,start_timestamp:St(i),timestamp:St(c)||void 0,status:tc(a),op:s[Ue],origin:s[ae],links:ec(u)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function kd(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Rd(e){return typeof e.getSpanJSON=="function"}function lt(e){const{traceFlags:t}=e.spanContext();return t===Zs}function tc(e){if(!(!e||e.code===nd))return e.code===Js?"ok":e.message||"internal_error"}const yt="_sentryChildSpans",gs="_sentryRootSpan";function nc(e,t){const n=e[gs]||e;Ie(t,gs,n),e[yt]?e[yt].add(t):Ie(e,yt,new Set([t]))}function Cd(e,t){e[yt]&&e[yt].delete(t)}function Zn(e){const t=new Set;function n(r){if(!t.has(r)&&lt(r)){t.add(r);const s=r[yt]?Array.from(r[yt]):[];for(const i of s)n(i)}}return n(e),Array.from(t)}function le(e){return e[gs]||e}function pe(){const e=Rt(),t=tn(e);return t.getActiveSpan?t.getActiveSpan():hn(G())}function _s(){Zi||(at(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Zi=!0)}let to=!1;function Md(){if(to)return;function e(){const t=pe(),n=t&&le(t);if(n){const r="internal_error";v&&m.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:de,message:r})}}e.tag="sentry_tracingErrorCallback",to=!0,xa(e),Aa(e)}function Ne(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=H())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function no(e){m.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function lr(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(Ad(n)){if(Qn(e.description,n))return v&&no(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?Qn(e.description,n.name):!0,s=n.op?e.op&&Qn(e.op,n.op):!0;if(r&&s)return v&&no(e),!0}return!1}function xd(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const s of e)s.parent_span_id===r&&(s.parent_span_id=n)}function Ad(e){return typeof e=="string"||e instanceof RegExp}const xr="production",rc="_frozenDsc";function er(e,t){Ie(e,rc,t)}function sc(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||xr,release:n.release,public_key:r,trace_id:e,org_id:Sd(t)};return t.emit("createDsc",s),s}function ei(e,t){const n=t.getPropagationContext();return n.dsc||sc(n.traceId,e)}function He(e){var h;const t=H();if(!t)return{};const n=le(e),r=U(n),s=r.data,i=n.spanContext().traceState,o=(i==null?void 0:i.get("sentry.sample_rate"))??s[Ks]??s[za];function c(g){return(typeof o=="number"||typeof o=="string")&&(g.sample_rate=`${o}`),g}const a=n[rc];if(a)return c(a);const u=i==null?void 0:i.get("sentry.dsc"),d=u&&Ga(u);if(d)return c(d);const l=sc(e.spanContext().traceId,t),f=s[xe],p=r.description;return f!=="url"&&p&&(l.transaction=p),Ne()&&(l.sampled=String(lt(n)),l.sample_rand=(i==null?void 0:i.get("sentry.sample_rand"))??((h=ur(n).scope)==null?void 0:h.getPropagationContext().sampleRand.toString())),c(l),t.emit("createDsc",l,n),l}class st{constructor(t={}){this._traceId=t.traceId||Je(),this._spanId=t.spanId||Ge()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Qa}}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 Ce(e,t=100,n=1/0){try{return Ss("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ic(e,t=3,n=100*1024){const r=Ce(e,t);return Ld(r)>n?ic(e,t-1,n):r}function Ss(e,t,n=1/0,r=1/0,s=Dd()){const[i,o]=s;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const c=Nd(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;const a=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(a===0)return c.replace("object ","");if(i(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const p=u.toJSON();return Ss("",p,a-1,r,s)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const f=Ba(t);for(const p in f){if(!Object.prototype.hasOwnProperty.call(f,p))continue;if(l>=r){d[p]="[MaxProperties ~]";break}const h=f[p];d[p]=Ss(p,h,a-1,r,s),l++}return o(t),d}function Nd(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Pa(t))return Ma(t);if(Dl(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Ke(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=Od(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Od(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function Pd(e){return~-encodeURI(e).split(/%..|./).length}function Ld(e){return Pd(JSON.stringify(e))}function Dd(){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 Qe(e,t=[]){return[e,t]}function Fd(e,t){const[n,r]=e;return[n,[...r,t]]}function dr(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function ro(e,t){return dr(e,(n,r)=>t.includes(r))}function fr(e){const t=vn(L);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Bd(e){const t=vn(L);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function pr(e){const[t,n]=e;let r=JSON.stringify(t);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[fr(r),i]:r.push(typeof i=="string"?fr(i):i)}for(const i of n){const[o,c]=i;if(s(`
6
6
  ${JSON.stringify(o)}
7
- `),typeof c=="string"||c instanceof Uint8Array)s(c);else{let a;try{a=JSON.stringify(c)}catch{a=JSON.stringify(Ce(c))}s(a)}}return typeof r=="string"?r:Bd(r)}function Bd(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function $d(e){let t=typeof e=="string"?fr(e):e;function n(o){const c=t.subarray(0,o);return t=t.subarray(o+1),c}function r(){let o=t.indexOf(10);return o<0&&(o=t.length),JSON.parse(Fd(n(o)))}const s=r(),i=[];for(;t.length;){const o=r(),c=typeof o.length=="number"?o.length:void 0;i.push([o,c?n(c):r()])}return[s,i]}function Ud(e){return[{type:"span"},e]}function Hd(e){const t=typeof e.data=="string"?fr(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Wd={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function so(e){return Wd[e]}function Ar(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function ic(e,t,n,r){var i;const s=(i=e.sdkProcessingMetadata)==null?void 0:i.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Mt(r)},...s&&{trace:s}}}function zd(e,t){var r,s,i,o;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:[...((s=e.sdk)==null?void 0:s.packages)||[],...t.packages||[]],settings:(i=e.sdk)!=null&&i.settings||t.settings?{...(o=e.sdk)==null?void 0:o.settings,...t.settings}:void 0},e}function jd(e,t,n,r){const s=Ar(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:Mt(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Qe(i,[o])}function qd(e,t,n,r){const s=Ar(n),i=e.type&&e.type!=="replay_event"?e.type:"event";zd(e,n==null?void 0:n.sdk);const o=ic(e,s,r,t);return delete e.sdkProcessingMetadata,Qe(o,[[{type:i},e]])}function Vd(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=He(e[0]),s=t==null?void 0:t.getDsn(),i=t==null?void 0:t.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&s&&{dsn:Mt(s)}},{beforeSendSpan:c,ignoreSpans:a}=(t==null?void 0:t.getOptions())||{},u=a!=null&&a.length?e.filter(p=>!lr(U(p),a)):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const l=c?p=>{const h=U(p),g=c(h);return g||(_s(),h)}:U,f=[];for(const p of u){const h=l(p);h&&f.push(Ud(h))}return Qe(o,f)}function Gd(e){if(!v)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=U(e),{spanId:s}=e.spanContext(),i=lt(e),o=le(e),c=o===e,a=`[Tracing] Starting ${i?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${s}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:d,description:l}=U(o);u.push(`root ID: ${o.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}m.log(`${a}
7
+ `),typeof c=="string"||c instanceof Uint8Array)s(c);else{let a;try{a=JSON.stringify(c)}catch{a=JSON.stringify(Ce(c))}s(a)}}return typeof r=="string"?r:$d(r)}function $d(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Ud(e){let t=typeof e=="string"?fr(e):e;function n(o){const c=t.subarray(0,o);return t=t.subarray(o+1),c}function r(){let o=t.indexOf(10);return o<0&&(o=t.length),JSON.parse(Bd(n(o)))}const s=r(),i=[];for(;t.length;){const o=r(),c=typeof o.length=="number"?o.length:void 0;i.push([o,c?n(c):r()])}return[s,i]}function Hd(e){return[{type:"span"},e]}function Wd(e){const t=typeof e.data=="string"?fr(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const zd={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function so(e){return zd[e]}function Ar(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function oc(e,t,n,r){var i;const s=(i=e.sdkProcessingMetadata)==null?void 0:i.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Mt(r)},...s&&{trace:s}}}function jd(e,t){var r,s,i,o;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:[...((s=e.sdk)==null?void 0:s.packages)||[],...t.packages||[]],settings:(i=e.sdk)!=null&&i.settings||t.settings?{...(o=e.sdk)==null?void 0:o.settings,...t.settings}:void 0},e}function qd(e,t,n,r){const s=Ar(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:Mt(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Qe(i,[o])}function Vd(e,t,n,r){const s=Ar(n),i=e.type&&e.type!=="replay_event"?e.type:"event";jd(e,n==null?void 0:n.sdk);const o=oc(e,s,r,t);return delete e.sdkProcessingMetadata,Qe(o,[[{type:i},e]])}function Gd(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=He(e[0]),s=t==null?void 0:t.getDsn(),i=t==null?void 0:t.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&s&&{dsn:Mt(s)}},{beforeSendSpan:c,ignoreSpans:a}=(t==null?void 0:t.getOptions())||{},u=a!=null&&a.length?e.filter(p=>!lr(U(p),a)):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const l=c?p=>{const h=U(p),g=c(h);return g||(_s(),h)}:U,f=[];for(const p of u){const h=l(p);h&&f.push(Hd(h))}return Qe(o,f)}function Yd(e){if(!v)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=U(e),{spanId:s}=e.spanContext(),i=lt(e),o=le(e),c=o===e,a=`[Tracing] Starting ${i?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${s}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:d,description:l}=U(o);u.push(`root ID: ${o.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}m.log(`${a}
8
8
  ${u.join(`
9
- `)}`)}function Yd(e){if(!v)return;const{description:t="< unknown name >",op:n="< unknown op >"}=U(e),{spanId:r}=e.spanContext(),i=le(e)===e,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;m.log(o)}function Kd(e,t,n,r=pe()){const s=r&&le(r);s&&(v&&m.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),s.addEvent(e,{[Rn]:t,[kn]:n}))}function io(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},s=r[kn],i=r[Rn];typeof s=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:s})}),t}const oo=1e3;class Nr{constructor(t={}){this._traceId=t.traceId||Je(),this._spanId=t.spanId||Ge(),this._startTime=t.startTimestamp||ie(),this._links=t.links,this._attributes={},this.setAttributes({[ae]:"manual",[Ue]: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?Zs:Ja}}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=St(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(xe,"custom"),this}end(t){this._endTime||(this._endTime=St(t),Yd(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Ue],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:ec(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ae],profile_id:this._attributes[Xs],exclusive_time:this._attributes[nn],measurements:io(this._events),is_segment:this._isStandaloneSpan&&le(this)===this||void 0,segment_id:this._isStandaloneSpan?le(this).spanContext().spanId:void 0,links:Za(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){v&&m.log("[Tracing] Adding an event to span:",t);const s=ao(n)?n:r||ie(),i=ao(n)?{}:n||{},o={name:t,time:St(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=H();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===le(this)))return;if(this._isStandaloneSpan){this._sampled?Jd(Vd([this],t)):(v&&m.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const r=this._convertSpanToTransaction();r&&(ur(this).scope||G()).captureEvent(r)}_convertSpanToTransaction(){var d;if(!co(U(this)))return;this._name||(v&&m.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=ur(this),r=(d=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;const i=Zn(this).filter(l=>l!==this&&!Xd(l)).map(l=>U(l)).filter(co),o=this._attributes[xe];delete this._attributes[Ji],i.forEach(l=>{delete l.data[Ji]});const c={contexts:{trace:Td(this)},spans:i.length>oo?i.sort((l,f)=>l.start_timestamp-f.start_timestamp).slice(0,oo):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:He(this)},request:r,...o&&{transaction_info:{source:o}}},a=io(this._events);return a&&Object.keys(a).length&&(v&&m.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),c.measurements=a),c}}function ao(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function co(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Xd(e){return e instanceof Nr&&e.isStandaloneSpan()}function Jd(e){const t=H();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function Qd(e,t,n=()=>{},r=()=>{}){let s;try{s=e()}catch(i){throw t(i),n(),i}return Zd(s,t,n,r)}function Zd(e,t,n,r){return Zt(e)?e.then(s=>(n(),r(s),s),s=>{throw t(s),n(),s}):(n(),r(e),e)}function ef(e,t,n){if(!Ne(e))return[!1];let r,s;typeof e.tracesSampler=="function"?(s=e.tracesSampler({...t,inheritOrSampleWith:c=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):c}),r=!0):t.parentSampled!==void 0?s=t.parentSampled:typeof e.tracesSampleRate<"u"&&(s=e.tracesSampleRate,r=!0);const i=It(s);if(i===void 0)return v&&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(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!i)return v&&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,i,r];const o=n<i;return o||v&&m.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[o,i,r]}const oc="__SENTRY_SUPPRESS_TRACING__";function tf(e,t){const n=ni();if(n.startSpan)return n.startSpan(e,t);const r=cc(e),{forceTransaction:s,parentSpan:i,scope:o}=e,c=o==null?void 0:o.clone();return wn(c,()=>rf(i)(()=>{const u=G(),d=uc(u,i),f=e.onlyIfParent&&!d?new st:ac({parentSpan:d,spanArguments:r,forceTransaction:s,scope:u});return jt(u,f),Qd(()=>t(f),()=>{const{status:p}=U(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:de,message:"internal_error"})},()=>{f.end()})}))}function rn(e){const t=ni();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=cc(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?o=>wn(e.scope,o):s!==void 0?o=>ti(s,o):o=>o())(()=>{const o=G(),c=uc(o,s);return e.onlyIfParent&&!c?new st:ac({parentSpan:c,spanArguments:n,forceTransaction:r,scope:o})})}function ti(e,t){const n=ni();return n.withActiveSpan?n.withActiveSpan(e,t):wn(r=>(jt(r,e||void 0),t(r)))}function ac({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Ne()){const o=new st;if(n||!e){const c={sampled:"false",sample_rate:"0",transaction:t.name,...He(o)};er(o,c)}return o}const s=De();let i;if(e&&!n)i=nf(e,r,t),tc(e,i);else if(e){const o=He(e),{traceId:c,spanId:a}=e.spanContext(),u=lt(e);i=uo({traceId:c,parentSpanId:a,...t},r,u),er(i,o)}else{const{traceId:o,dsc:c,parentSpanId:a,sampled:u}={...s.getPropagationContext(),...r.getPropagationContext()};i=uo({traceId:o,parentSpanId:a,...t},r,u),c&&er(i,c)}return Gd(i),id(i,r,s),i}function cc(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=St(e.startTime),delete r.startTime,r}return n}function ni(){const e=Rt();return tn(e)}function uo(e,t,n){var h;const r=H(),s=(r==null?void 0:r.getOptions())||{},{name:i=""}=e,o={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r==null||r.emit("beforeSampling",o,{decision:!1});const c=o.parentSampled??n,a=o.spanAttributes,u=t.getPropagationContext(),[d,l,f]=t.getScopeData().sdkProcessingMetadata[oc]?[!1]:ef(s,{name:i,parentSampled:c,attributes:a,parentSampleRate:It((h=u.dsc)==null?void 0:h.sample_rate)},u.sampleRand),p=new Nr({...e,attributes:{[xe]:"custom",[Ks]:l!==void 0&&f?l:void 0,...a},sampled:d});return!d&&r&&(v&&m.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",p),p}function nf(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),i=t.getScopeData().sdkProcessingMetadata[oc]?!1:lt(e),o=i?new Nr({...n,parentSpanId:r,traceId:s,sampled:i}):new st({traceId:s});tc(e,o);const c=H();return c&&(c.emit("spanStart",o),n.endTimestamp&&c.emit("spanEnd",o)),o}function uc(e,t){if(t)return t;if(t===null)return;const n=hn(e);if(!n)return;const r=H();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?le(n):n}function rf(e){return e!==void 0?t=>ti(e,t):t=>t()}const tr={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},sf="heartbeatFailed",of="idleTimeout",af="finalTimeout",cf="externalFinish";function lc(e,t={}){const n=new Map;let r=!1,s,i=cf,o=!t.disableAutoFinish;const c=[],{idleTimeout:a=tr.idleTimeout,finalTimeout:u=tr.finalTimeout,childSpanTimeout:d=tr.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:f=!0}=t,p=H();if(!p||!Ne()){const S=new st,k={sample_rate:"0",sampled:"false",...He(S)};return er(S,k),S}const h=G(),g=pe(),_=uf(e);_.end=new Proxy(_.end,{apply(S,k,J){if(l&&l(_),k instanceof st)return;const[y,...w]=J,P=y||ie(),j=St(P),O=Zn(_).filter(R=>R!==_),ce=U(_);if(!O.length||!f)return N(j),Reflect.apply(S,k,[j,...w]);const Q=p.getOptions().ignoreSpans,ne=O==null?void 0:O.reduce((R,K)=>{const Z=U(K);return!Z.timestamp||Q&&lr(Z,Q)?R:R?Math.max(R,Z.timestamp):Z.timestamp},void 0),b=ce.start_timestamp,Y=Math.min(b?b+u/1e3:1/0,Math.max(b||-1/0,Math.min(j,ne||1/0)));return N(Y),Reflect.apply(S,k,[Y,...w])}});function E(){s&&(clearTimeout(s),s=void 0)}function T(S){E(),s=setTimeout(()=>{!r&&n.size===0&&o&&(i=of,_.end(S))},a)}function F(S){s=setTimeout(()=>{!r&&o&&(i=sf,_.end(S))},d)}function B(S){E(),n.set(S,!0);const k=ie();F(k+d/1e3)}function q(S){if(n.has(S)&&n.delete(S),n.size===0){const k=ie();T(k+a/1e3)}}function N(S){r=!0,n.clear(),c.forEach(O=>O()),jt(h,g);const k=U(_),{start_timestamp:J}=k;if(!J)return;k.data[mn]||_.setAttribute(mn,i);const w=k.status;(!w||w==="unknown")&&_.setStatus({code:Js}),m.log(`[Tracing] Idle span "${k.op}" finished`);const P=Zn(_).filter(O=>O!==_);let j=0;P.forEach(O=>{O.isRecording()&&(O.setStatus({code:de,message:"cancelled"}),O.end(S),v&&m.log("[Tracing] Cancelling span since span ended early",JSON.stringify(O,void 0,2)));const ce=U(O),{timestamp:Q=0,start_timestamp:ne=0}=ce,b=ne<=S,Y=(u+a)/1e3,R=Q-ne<=Y;if(v){const K=JSON.stringify(O,void 0,2);b?R||m.log("[Tracing] Discarding span since it finished after idle span final timeout",K):m.log("[Tracing] Discarding span since it happened after idle span was finished",K)}(!R||!b)&&(Rd(_,O),j++)}),j>0&&_.setAttribute("sentry.idle_span_discarded_spans",j)}return c.push(p.on("spanStart",S=>{if(r||S===_||U(S).timestamp||S instanceof Nr&&S.isStandaloneSpan())return;Zn(_).includes(S)&&B(S.spanContext().spanId)})),c.push(p.on("spanEnd",S=>{r||q(S.spanContext().spanId)})),c.push(p.on("idleSpanEnableAutoFinish",S=>{S===_&&(o=!0,T(),n.size&&F())})),t.disableAutoFinish||T(),setTimeout(()=>{r||(_.setStatus({code:de,message:"deadline_exceeded"}),i=af,_.end())},u),_}function uf(e){const t=rn(e);return jt(G(),t),v&&m.log("[Tracing] Started span is an idle span"),t}const Qr=0,lo=1,fo=2;function Or(e){return new gn(t=>{t(e)})}function ri(e){return new gn((t,n)=>{n(e)})}class gn{constructor(t){this._state=Qr,this._handlers=[],this._runExecutor(t)}then(t,n){return new gn((r,s)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new gn((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,t&&t()},o=>{i=!0,s=o,t&&t()}).then(()=>{if(i){r(s);return}n(s)})})}_executeHandlers(){if(this._state===Qr)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===lo&&n[1](this._value),this._state===fo&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(i,o)=>{if(this._state===Qr){if(Zt(o)){o.then(r,s);return}this._state=i,this._value=o,this._executeHandlers()}},r=i=>{n(lo,i)},s=i=>{n(fo,i)};try{t(r,s)}catch(i){s(i)}}}function lf(e,t,n,r=0){try{const s=ys(t,n,e,r);return Zt(s)?s:Or(s)}catch(s){return ri(s)}}function ys(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return v&&i===null&&m.log(`Event processor "${s.id||"?"}" dropped event`),Zt(i)?i.then(o=>ys(o,t,n,r+1)):ys(i,t,n,r+1)}function df(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;ff(e,t),r&&mf(e,r),gf(e,n),pf(e,s),hf(e,i)}function hr(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,sdkProcessingMetadata:c,breadcrumbs:a,fingerprint:u,eventProcessors:d,attachments:l,propagationContext:f,transactionName:p,span:h}=t;Un(e,"extra",n),Un(e,"tags",r),Un(e,"user",s),Un(e,"contexts",i),e.sdkProcessingMetadata=In(e.sdkProcessingMetadata,c,2),o&&(e.level=o),p&&(e.transactionName=p),h&&(e.span=h),a.length&&(e.breadcrumbs=[...e.breadcrumbs,...a]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),l.length&&(e.attachments=[...e.attachments,...l]),e.propagationContext={...e.propagationContext,...f}}function Un(e,t,n){e[t]=In(e[t],n,1)}function ff(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:c}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),c&&e.type!=="transaction"&&(e.transaction=c)}function pf(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function hf(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function mf(e,t){e.contexts={trace:Qa(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:He(t),...e.sdkProcessingMetadata};const n=le(t),r=U(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function gf(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}let ze,po,ho,Ze;function dc(e){const t=L._sentryDebugIds,n=L._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(Ze&&r.length===po&&s.length===ho)return Ze;po=r.length,ho=s.length,Ze={},ze||(ze={});const i=(o,c)=>{for(const a of o){const u=c[a],d=ze==null?void 0:ze[a];if(d&&Ze&&u)Ze[d[0]]=u,ze&&(ze[a]=[d[0],u]);else if(u){const l=e(a);for(let f=l.length-1;f>=0;f--){const p=l[f],h=p==null?void 0:p.filename;if(h&&Ze&&ze){Ze[h]=u,ze[a]=[h,u];break}}}}};return t&&i(r,t),n&&i(s,n),Ze}function _f(e,t){const n=dc(e);if(!n)return[];const r=[];for(const s of t)s&&n[s]&&r.push({type:"sourcemap",code_file:s,debug_id:n[s]});return r}function fc(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:c=1e3}=e,a={...t,event_id:t.event_id||n.event_id||fe(),timestamp:t.timestamp||Ct()},u=n.integrations||e.integrations.map(_=>_.name);Sf(a,e),bf(a,u),s&&s.emit("applyFrameMetadata",t),t.type===void 0&&yf(a,e.stackParser);const d=vf(r,n.captureContext);n.mechanism&&Wt(a,n.mechanism);const l=s?s.getEventProcessors():[],f=cr().getScopeData();if(i){const _=i.getScopeData();hr(f,_)}if(d){const _=d.getScopeData();hr(f,_)}const p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),df(a,f);const h=[...l,...f.eventProcessors];return lf(h,a,n).then(_=>(_&&Ef(_),typeof o=="number"&&o>0?Tf(_,o,c):_))}function Sf(e,t){const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||xr,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;o!=null&&o.url&&(o.url=i?Ba(o.url,i):o.url)}function yf(e,t){var r,s;const n=dc(t);(s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.filename&&(a.debug_id=n[a.filename])})})}function Ef(e){var r,s;const t={};if((s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.debug_id&&(a.abs_path?t[a.abs_path]=a.debug_id:a.filename&&(t[a.filename]=a.debug_id),delete a.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(([i,o])=>{n.push({type:"sourcemap",code_file:i,debug_id:o})})}function bf(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Tf(e,t,n){var s,i;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Ce(o.data,t,n)}}))},...e.user&&{user:Ce(e.user,t,n)},...e.contexts&&{contexts:Ce(e.contexts,t,n)},...e.extra&&{extra:Ce(e.extra,t,n)}};return(s=e.contexts)!=null&&s.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Ce(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Ce(o.data,t,n)}}))),(i=e.contexts)!=null&&i.flags&&r.contexts&&(r.contexts.flags=Ce(e.contexts.flags,3,n)),r}function vf(e,t){if(!t)return e;const n=e?e.clone():new $e;return n.update(t),n}function If(e){if(e)return wf(e)?{captureContext:e}:Rf(e)?{captureContext:e}:e}function wf(e){return e instanceof $e||typeof e=="function"}const kf=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Rf(e){return Object.keys(e).some(t=>kf.includes(t))}function pc(e,t){return G().captureException(e,If(t))}function hc(e,t){return G().captureEvent(e,t)}function mc(e,t){De().setContext(e,t)}function Cf(){const e=H();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function Mf(e){De().addEventProcessor(e)}function mo(e){const t=De(),n=G(),{userAgent:r}=L.navigator||{},s=jl({user:n.getUser()||t.getUser(),...r&&{userAgent:r},...e}),i=t.getSession();return(i==null?void 0:i.status)==="ok"&&zt(i,{status:"exited"}),gc(),t.setSession(s),s}function gc(){const e=De(),n=G().getSession()||e.getSession();n&&ql(n),_c(),e.setSession()}function _c(){const e=De(),t=H(),n=e.getSession();n&&t&&t.captureSession(n)}function go(e=!1){if(e){gc();return}_c()}const xf="7";function Af(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Nf(e){return`${Af(e)}${e.projectId}/envelope/`}function Of(e,t){const n={sentry_version:xf};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Pf(e,t,n){return t||`${Nf(e)}?${Of(e,n)}`}const _o=[];function Lf(e){const t={};return e.forEach(n=>{const{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Df(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const s=n(t);r=Array.isArray(s)?s:[s]}else r=t;return Lf(r)}function Ff(e,t){const n={};return t.forEach(r=>{r&&Sc(e,r,n)}),n}function So(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function Sc(e,t,n){if(n[t.name]){v&&m.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!_o.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),_o.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",(s,i)=>r(s,i,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((i,o)=>r(i,o,e),{id:t.name});e.addEventProcessor(s)}v&&m.log(`Integration installed: ${t.name}`)}function Bf(e,t){return t?wn(t,()=>{const n=pe(),r=n?Qa(n):Ha(t);return[n?He(n):ei(e,t),r]}):[void 0,void 0]}const $f={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function Uf(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Hf(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Mt(r)),Qe(s,[Uf(e)])}const Wf=100;function zf(e){switch(typeof e){case"number":return Number.isInteger(e)?{value:e,type:"integer"}:{value:e,type:"double"};case"boolean":return{value:e,type:"boolean"};case"string":return{value:e,type:"string"};default:{let t="";try{t=JSON.stringify(e)??""}catch{}return{value:t,type:"string"}}}}function Fe(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function jf(e,t){const n=ii(),r=yc(e);r===void 0?n.set(e,[t]):r.length>=Wf?(si(e,r),n.set(e,[t])):n.set(e,[...r,t])}function yo(e,t=G(),n=jf){var y;const r=(t==null?void 0:t.getClient())??H();if(!r){v&&m.warn("No client available to capture log.");return}const{release:s,environment:i,enableLogs:o=!1,beforeSendLog:c}=r.getOptions();if(!o){v&&m.warn("logging option not enabled, log will not be captured.");return}const[,a]=Bf(r,t),u={...e.attributes},{user:{id:d,email:l,username:f}}=qf(t);Fe(u,"user.id",d,!1),Fe(u,"user.email",l,!1),Fe(u,"user.name",f,!1),Fe(u,"sentry.release",s),Fe(u,"sentry.environment",i);const{name:p,version:h}=((y=r.getSdkMetadata())==null?void 0:y.sdk)??{};Fe(u,"sentry.sdk.name",p),Fe(u,"sentry.sdk.version",h);const g=r.getIntegrationByName("Replay"),_=g==null?void 0:g.getReplayId(!0);Fe(u,"sentry.replay_id",_),_&&(g==null?void 0:g.getRecordingMode())==="buffer"&&Fe(u,"sentry._internal.replay_is_buffering",!0);const E=e.message;if(Cr(E)){const{__sentry_template_string__:w,__sentry_template_values__:P=[]}=E;P!=null&&P.length&&(u["sentry.message.template"]=w),P.forEach((j,O)=>{u[`sentry.message.parameter.${O}`]=j})}const T=hn(t);Fe(u,"sentry.trace.parent_span_id",T==null?void 0:T.spanContext().spanId);const F={...e,attributes:u};r.emit("beforeCaptureLog",F);const B=c?at(()=>c(F)):F;if(!B){r.recordDroppedEvent("before_send","log_item",1),v&&m.warn("beforeSendLog returned null, log will not be captured.");return}const{level:q,message:N,attributes:S={},severityNumber:k}=B,J={timestamp:ie(),level:q,body:N,trace_id:a==null?void 0:a.trace_id,severity_number:k??$f[q],attributes:Object.keys(S).reduce((w,P)=>(w[P]=zf(S[P]),w),{})};n(r,J),r.emit("afterCaptureLog",B)}function si(e,t){const n=t??yc(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Hf(n,r._metadata,r.tunnel,e.getDsn());ii().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function yc(e){return ii().get(e)}function qf(e){const t=cr().getScopeData();return hr(t,De().getScopeData()),hr(t,e.getScopeData()),t}function ii(){return Jt("clientToLogBufferMap",()=>new WeakMap)}function Vf(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function Gf(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Mt(r)),Qe(s,[Vf(e)])}function Ec(e,t){const n=t??Yf(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Gf(n,r._metadata,r.tunnel,e.getDsn());bc().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Yf(e){return bc().get(e)}function bc(){return Jt("clientToMetricBufferMap",()=>new WeakMap)}function Kf(e,t,n){const r=[{type:"client_report"},{timestamp:Ct(),discarded_events:e}];return Qe(t?{dsn:t}:{},[r])}function Tc(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 Xf(e){var a;const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:c}=((a=e.contexts)==null?void 0:a.trace)??{};return{data:o??{},description:e.transaction,op:c,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o==null?void 0:o[Xs],exclusive_time:o==null?void 0:o[nn],measurements:e.measurements,is_segment:!0}}function Jf(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&&{[Xs]:e.profile_id},...e.exclusive_time&&{[nn]:e.exclusive_time}}}},measurements:e.measurements}}const Eo="Not capturing exception because it's already been captured.",bo="Discarded session because of missing or non-string release",vc=Symbol.for("SentryInternalError"),Ic=Symbol.for("SentryDoNotSendEventError"),Qf=5e3;function nr(e){return{message:e,[vc]:!0}}function Zr(e){return{message:e,[Ic]:!0}}function To(e){return!!e&&typeof e=="object"&&vc in e}function vo(e){return!!e&&typeof e=="object"&&Ic in e}function Io(e,t,n,r,s){let i=0,o,c=!1;e.on(n,()=>{i=0,clearTimeout(o),c=!1}),e.on(t,a=>{i+=r(a),i>=8e5?s(e):c||(c=!0,o=setTimeout(()=>{s(e)},Qf))}),e.on("flush",()=>{s(e)})}class Zf{constructor(t){var r;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=Sd(t.dsn):v&&m.warn("No DSN provided, client will not send events."),this._dsn){const s=Pf(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:s})}this._options.enableLogs&&Io(this,"afterCaptureLog","flushLogs",rp,si),(this._options.enableMetrics??((r=this._options._experiments)==null?void 0:r.enableMetrics)??!0)&&Io(this,"afterCaptureMetric","flushMetrics",np,Ec)}captureException(t,n,r){const s=fe();if(Yi(t))return v&&m.log(Eo),s;const i={event_id:s,...n};return this._process(this.eventFromException(t,i).then(o=>this._captureEvent(o,i,r))),i.event_id}captureMessage(t,n,r,s){const i={event_id:fe(),...r},o=Cr(t)?t:String(t),c=vt(t)?this.eventFromMessage(o,n,i):this.eventFromException(t,i);return this._process(c.then(a=>this._captureEvent(a,i,s))),i.event_id}captureEvent(t,n,r){const s=fe();if(n!=null&&n.originalException&&Yi(n.originalException))return v&&m.log(Eo),s;const i={event_id:s,...n},o=t.sdkProcessingMetadata||{},c=o.capturedSpanScope,a=o.capturedSpanIsolationScope;return this._process(this._captureEvent(t,i,c||r,a)),i.event_id}captureSession(t){this.sendSession(t),zt(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),s=await n.flush(t);return r&&s}async close(t){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]}addIntegration(t){const n=this._integrations[t.name];Sc(this,t,this._integrations),n||So(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=qd(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Dd(r,Hd(s));this.sendEnvelope(r).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=xr}=this._options;if("aggregates"in t){const i=t.attrs||{};if(!i.release&&!n){v&&m.warn(bo);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){v&&m.warn(bo);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const s=jd(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const s=`${t}:${n}`;v&&m.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,s=(...i)=>n(...i);return r.add(s),()=>{r.delete(s)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(s=>s(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return v&&m.error("Error while sending envelope:",n),{}}return v&&m.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=Ff(this,t),So(this,t)}_updateSessionFromEvent(t,n){var a,u;let r=n.level==="fatal",s=!1;const i=(a=n.exception)==null?void 0:a.values;if(i){s=!0,r=!1;for(const d of i)if(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&r)&&(zt(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||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,s){const i=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&(o!=null&&o.length)&&(n.integrations=o),this.emit("preprocessEvent",t,n),t.type||s.setLastEventId(t.event_id||n.event_id),fc(i,t,n,r,this,s).then(c=>{if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:Ha(r),...c.contexts};const a=ei(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=G(),s=De()){return v&&Es(t)&&m.log(`Captured error event \`${Tc(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,s).then(i=>i.event_id,i=>{v&&(vo(i)?m.log(i.message):To(i)?m.warn(i.message):m.warn(i))})}_processEvent(t,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,c=wc(t),a=Es(t),u=t.type||"error",d=`before send for type \`${u}\``,l=typeof o>"u"?void 0:It(o);if(a&&typeof l=="number"&&Math.random()>l)return this.recordDroppedEvent("sample_rate","error"),ri(Zr(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=u==="replay_event"?"replay":u;return this._prepareEvent(t,n,r,s).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",f),Zr("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return p;const g=tp(this,i,p,n);return ep(g,d)}).then(p=>{var _;if(p===null){if(this.recordDroppedEvent("before_send",f),c){const T=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",T)}throw Zr(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||s.getSession();if(a&&h&&this._updateSessionFromEvent(h,p),c){const E=((_=p.sdkProcessingMetadata)==null?void 0:_.spanCountBeforeProcessing)||0,T=p.spans?p.spans.length:0,F=E-T;F>0&&this.recordDroppedEvent("before_send","span",F)}const g=p.transaction_info;if(c&&g&&p.transaction!==t.transaction){const E="custom";p.transaction_info={...g,source:E}}return this.sendEvent(p,n),p}).then(null,p=>{throw vo(p)||To(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),nr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
10
- Reason: ${p}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[s,i]=n.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){v&&m.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){v&&m.log("No outcomes to send");return}if(!this._dsn){v&&m.log("No dsn provided, will not send outcomes");return}v&&m.log("Sending outcomes:",t);const n=Kf(t,this._options.tunnel&&Mt(this._dsn));this.sendEnvelope(n)}}function ep(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Zt(e))return e.then(r=>{if(!pn(r)&&r!==null)throw nr(n);return r},r=>{throw nr(`${t} rejected with ${r}`)});if(!pn(e)&&e!==null)throw nr(n);return e}function tp(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,beforeSendSpan:o,ignoreSpans:c}=t;let a=n;if(Es(a)&&s)return s(a,r);if(wc(a)){if(o||c){const u=Xf(a);if(c!=null&&c.length&&lr(u,c))return null;if(o){const d=o(u);d?a=In(n,Jf(d)):_s()}if(a.spans){const d=[],l=a.spans;for(const p of l){if(c!=null&&c.length&&lr(p,c)){Md(l,p);continue}if(o){const h=o(p);h?d.push(h):(_s(),d.push(p))}else d.push(p)}const f=a.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),a.spans=d}}if(i){if(a.spans){const u=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(a,r)}}return a}function Es(e){return e.type===void 0}function wc(e){return e.type==="transaction"}function np(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+kc(e.attributes)}function rp(e){let t=0;return e.message&&(t+=e.message.length*2),t+kc(e.attributes)}function kc(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*wo(n[0]):vt(n)?t+=wo(n):t+=100}),t}function wo(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function sp(e,t){t.debug===!0&&(v?m.enable():at(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),G().update(t.initialScope);const r=new e(t);return ip(r),r.init(),r}function ip(e){G().setClient(e)}const Rc=Symbol.for("SentryBufferFullError");function Cc(e=100){const t=new Set;function n(){return t.size<e}function r(o){t.delete(o)}function s(o){if(!n())return ri(Rc);const c=o();return t.add(c),c.then(()=>r(c),()=>r(c)),c}function i(o){if(!t.size)return Or(!0);const c=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return c;const a=[c,new Promise(u=>setTimeout(()=>u(!1),o))];return Promise.race(a)}return{get $(){return Array.from(t)},add:s,drain:i}}const op=60*1e3;function Mc(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?op:r-t}function ap(e,t){return e[t]||e.all||0}function xc(e,t,n=Date.now()){return ap(e,t)>n}function Ac(e,{statusCode:t,headers:n},r=Date.now()){const s={...e},i=n==null?void 0:n["x-sentry-rate-limits"],o=n==null?void 0:n["retry-after"];if(i)for(const c of i.trim().split(",")){const[a,u,,,d]=c.split(":",5),l=parseInt(a,10),f=(isNaN(l)?60:l)*1e3;if(!u)s.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(s[p]=r+f):s[p]=r+f}else o?s.all=r+Mc(o,r):t===429&&(s.all=r+60*1e3);return s}const cp=64;function up(e,t,n=Cc(e.bufferSize||cp)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(dr(o,(l,f)=>{const p=so(f);xc(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):c.push(l)}),c.length===0)return Promise.resolve({});const a=Qe(o[0],c),u=l=>{dr(a,(f,p)=>{e.recordDroppedEvent(l,so(p))})},d=()=>t({body:pr(a)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&v&&m.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Ac(r,l),l),l=>{throw u("network_error"),v&&m.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===Rc)return v&&m.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:i,flush:s}}const es=100,ts=5e3,lp=36e5;function dp(e){function t(...n){v&&m.log("[Offline]:",...n)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const s=n.createStore(n);let i=ts,o;function c(l,f,p){return ro(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,f,p):!0}function a(l){o&&clearTimeout(o),o=setTimeout(async()=>{o=void 0;const f=await s.shift();f&&(t("Attempting to send previously queued event"),f[0].sent_at=new Date().toISOString(),d(f,!0).catch(p=>{t("Failed to retry sending",p)}))},l),typeof o!="number"&&o.unref&&o.unref()}function u(){o||(a(i),i=Math.min(i*2,lp))}async function d(l,f=!1){var p,h;if(!f&&ro(l,["replay_event","replay_recording"]))return await s.push(l),a(es),{};try{if(n.shouldSend&&await n.shouldSend(l)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");const g=await r.send(l);let _=es;if(g){if((p=g.headers)!=null&&p["retry-after"])_=Mc(g.headers["retry-after"]);else if((h=g.headers)!=null&&h["x-sentry-rate-limits"])_=6e4;else if((g.statusCode||0)>=400)return g}return a(_),i=ts,g}catch(g){if(await c(l,g,i))return f?await s.unshift(l):await s.push(l),u(),t("Error sending. Event queued.",g),{};throw g}}return n.flushAtStartup&&u(),{send:d,flush:l=>(l===void 0&&(i=ts,a(es)),r.flush(l))}}}const fp="thismessage:/";function oi(e){return"isRelative"in e}function ai(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?fp:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const s=new URL(e,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch{}}function pp(e){if(oi(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 Et(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 hp(e){return e.split(/[?#]/,1)[0]}function mp(e,t){const n=t==null?void 0:t.getDsn(),r=t==null?void 0:t.getOptions().tunnel;return _p(e,n)||gp(e,r)}function gp(e,t){return t?ko(e)===ko(t):!1}function _p(e,t){const n=ai(e);return!n||oi(n)?!1:t?n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search):!1}function ko(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Sp(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 Nc(e,t,n=[t],r="npm"){const s=e._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${t}`,packages:n.map(i=>({name:`${r}:@sentry/${i}`,version:_t})),version:_t}),e._metadata=s}function Oc(e={}){const t=e.client||H();if(!Cf()||!t)return{};const n=Rt(),r=tn(n);if(r.getTraceData)return r.getTraceData(e);const s=e.scope||G(),i=e.span||pe(),o=i?vd(i):yp(s),c=i?He(i):ei(t,s),a=cd(c);if(!Ya.test(o))return m.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":o,baggage:a};if(e.propagateTraceparent){const l=i?Id(i):Ep(s);l&&(d.traceparent=l)}return d}function yp(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ka(t,r,n)}function Ep(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Xa(t,r,n)}function bp(e,t,n){let r,s,i;const o=n!=null&&n.maxWait?Math.max(n.maxWait,t):0,c=(n==null?void 0:n.setTimeoutImpl)||setTimeout;function a(){return u(),r=e(),r}function u(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function d(){return s!==void 0||i!==void 0?a():r}function l(){return s&&clearTimeout(s),s=c(a,t),o&&i===void 0&&(i=c(a,o)),r}return l.cancel=u,l.flush=d,l}const Tp=100;function it(e,t){const n=H(),r=De();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=Tp}=n.getOptions();if(i<=0)return;const c={timestamp:Ct(),...e},a=s?at(()=>s(c,t)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}let Ro;const vp="FunctionToString",Co=new WeakMap,Ip=()=>({name:vp,setupOnce(){Ro=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Ys(this),n=Co.has(H())&&t!==void 0?t:this;return Ro.apply(n,e)}}catch{}},setup(e){Co.set(e,!0)}}),wp=Ip,kp=[/^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. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],Rp="EventFilters",Cp=(e={})=>{let t;return{name:Rp,setup(n){const r=n.getOptions();t=Mo(e,r)},processEvent(n,r,s){if(!t){const i=s.getOptions();t=Mo(e,i)}return xp(n,t)?null:n}}},Mp=(e={})=>({...Cp(e),name:"InboundFilters"});function Mo(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:kp],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function xp(e,t){if(e.type){if(e.type==="transaction"&&Np(e,t.ignoreTransactions))return v&&m.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
11
- Event: ${pt(e)}`),!0}else{if(Ap(e,t.ignoreErrors))return v&&m.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
12
- Event: ${pt(e)}`),!0;if(Dp(e))return v&&m.warn(`Event dropped due to not having an error message, error type or stacktrace.
13
- Event: ${pt(e)}`),!0;if(Op(e,t.denyUrls))return v&&m.warn(`Event dropped due to being matched by \`denyUrls\` option.
9
+ `)}`)}function Kd(e){if(!v)return;const{description:t="< unknown name >",op:n="< unknown op >"}=U(e),{spanId:r}=e.spanContext(),i=le(e)===e,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;m.log(o)}function Xd(e,t,n,r=pe()){const s=r&&le(r);s&&(v&&m.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),s.addEvent(e,{[Rn]:t,[kn]:n}))}function io(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},s=r[kn],i=r[Rn];typeof s=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:s})}),t}const oo=1e3;class Nr{constructor(t={}){this._traceId=t.traceId||Je(),this._spanId=t.spanId||Ge(),this._startTime=t.startTimestamp||ie(),this._links=t.links,this._attributes={},this.setAttributes({[ae]:"manual",[Ue]: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?Zs:Qa}}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=St(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(xe,"custom"),this}end(t){this._endTime||(this._endTime=St(t),Kd(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Ue],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:tc(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ae],profile_id:this._attributes[Xs],exclusive_time:this._attributes[nn],measurements:io(this._events),is_segment:this._isStandaloneSpan&&le(this)===this||void 0,segment_id:this._isStandaloneSpan?le(this).spanContext().spanId:void 0,links:ec(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){v&&m.log("[Tracing] Adding an event to span:",t);const s=ao(n)?n:r||ie(),i=ao(n)?{}:n||{},o={name:t,time:St(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=H();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===le(this)))return;if(this._isStandaloneSpan){this._sampled?Qd(Gd([this],t)):(v&&m.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const r=this._convertSpanToTransaction();r&&(ur(this).scope||G()).captureEvent(r)}_convertSpanToTransaction(){var d;if(!co(U(this)))return;this._name||(v&&m.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=ur(this),r=(d=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;const i=Zn(this).filter(l=>l!==this&&!Jd(l)).map(l=>U(l)).filter(co),o=this._attributes[xe];delete this._attributes[Ji],i.forEach(l=>{delete l.data[Ji]});const c={contexts:{trace:vd(this)},spans:i.length>oo?i.sort((l,f)=>l.start_timestamp-f.start_timestamp).slice(0,oo):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:He(this)},request:r,...o&&{transaction_info:{source:o}}},a=io(this._events);return a&&Object.keys(a).length&&(v&&m.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),c.measurements=a),c}}function ao(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function co(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Jd(e){return e instanceof Nr&&e.isStandaloneSpan()}function Qd(e){const t=H();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function Zd(e,t,n=()=>{},r=()=>{}){let s;try{s=e()}catch(i){throw t(i),n(),i}return ef(s,t,n,r)}function ef(e,t,n,r){return Zt(e)?e.then(s=>(n(),r(s),s),s=>{throw t(s),n(),s}):(n(),r(e),e)}function tf(e,t,n){if(!Ne(e))return[!1];let r,s;typeof e.tracesSampler=="function"?(s=e.tracesSampler({...t,inheritOrSampleWith:c=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):c}),r=!0):t.parentSampled!==void 0?s=t.parentSampled:typeof e.tracesSampleRate<"u"&&(s=e.tracesSampleRate,r=!0);const i=It(s);if(i===void 0)return v&&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(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!i)return v&&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,i,r];const o=n<i;return o||v&&m.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[o,i,r]}const ac="__SENTRY_SUPPRESS_TRACING__";function nf(e,t){const n=ni();if(n.startSpan)return n.startSpan(e,t);const r=uc(e),{forceTransaction:s,parentSpan:i,scope:o}=e,c=o==null?void 0:o.clone();return wn(c,()=>sf(i)(()=>{const u=G(),d=lc(u,i),f=e.onlyIfParent&&!d?new st:cc({parentSpan:d,spanArguments:r,forceTransaction:s,scope:u});return jt(u,f),Zd(()=>t(f),()=>{const{status:p}=U(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:de,message:"internal_error"})},()=>{f.end()})}))}function rn(e){const t=ni();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=uc(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?o=>wn(e.scope,o):s!==void 0?o=>ti(s,o):o=>o())(()=>{const o=G(),c=lc(o,s);return e.onlyIfParent&&!c?new st:cc({parentSpan:c,spanArguments:n,forceTransaction:r,scope:o})})}function ti(e,t){const n=ni();return n.withActiveSpan?n.withActiveSpan(e,t):wn(r=>(jt(r,e||void 0),t(r)))}function cc({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Ne()){const o=new st;if(n||!e){const c={sampled:"false",sample_rate:"0",transaction:t.name,...He(o)};er(o,c)}return o}const s=De();let i;if(e&&!n)i=rf(e,r,t),nc(e,i);else if(e){const o=He(e),{traceId:c,spanId:a}=e.spanContext(),u=lt(e);i=uo({traceId:c,parentSpanId:a,...t},r,u),er(i,o)}else{const{traceId:o,dsc:c,parentSpanId:a,sampled:u}={...s.getPropagationContext(),...r.getPropagationContext()};i=uo({traceId:o,parentSpanId:a,...t},r,u),c&&er(i,c)}return Yd(i),od(i,r,s),i}function uc(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=St(e.startTime),delete r.startTime,r}return n}function ni(){const e=Rt();return tn(e)}function uo(e,t,n){var h;const r=H(),s=(r==null?void 0:r.getOptions())||{},{name:i=""}=e,o={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r==null||r.emit("beforeSampling",o,{decision:!1});const c=o.parentSampled??n,a=o.spanAttributes,u=t.getPropagationContext(),[d,l,f]=t.getScopeData().sdkProcessingMetadata[ac]?[!1]:tf(s,{name:i,parentSampled:c,attributes:a,parentSampleRate:It((h=u.dsc)==null?void 0:h.sample_rate)},u.sampleRand),p=new Nr({...e,attributes:{[xe]:"custom",[Ks]:l!==void 0&&f?l:void 0,...a},sampled:d});return!d&&r&&(v&&m.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",p),p}function rf(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),i=t.getScopeData().sdkProcessingMetadata[ac]?!1:lt(e),o=i?new Nr({...n,parentSpanId:r,traceId:s,sampled:i}):new st({traceId:s});nc(e,o);const c=H();return c&&(c.emit("spanStart",o),n.endTimestamp&&c.emit("spanEnd",o)),o}function lc(e,t){if(t)return t;if(t===null)return;const n=hn(e);if(!n)return;const r=H();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?le(n):n}function sf(e){return e!==void 0?t=>ti(e,t):t=>t()}const tr={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},of="heartbeatFailed",af="idleTimeout",cf="finalTimeout",uf="externalFinish";function dc(e,t={}){const n=new Map;let r=!1,s,i=uf,o=!t.disableAutoFinish;const c=[],{idleTimeout:a=tr.idleTimeout,finalTimeout:u=tr.finalTimeout,childSpanTimeout:d=tr.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:f=!0}=t,p=H();if(!p||!Ne()){const S=new st,k={sample_rate:"0",sampled:"false",...He(S)};return er(S,k),S}const h=G(),g=pe(),_=lf(e);_.end=new Proxy(_.end,{apply(S,k,J){if(l&&l(_),k instanceof st)return;const[y,...w]=J,P=y||ie(),j=St(P),O=Zn(_).filter(R=>R!==_),ce=U(_);if(!O.length||!f)return N(j),Reflect.apply(S,k,[j,...w]);const Q=p.getOptions().ignoreSpans,ne=O==null?void 0:O.reduce((R,K)=>{const Z=U(K);return!Z.timestamp||Q&&lr(Z,Q)?R:R?Math.max(R,Z.timestamp):Z.timestamp},void 0),b=ce.start_timestamp,Y=Math.min(b?b+u/1e3:1/0,Math.max(b||-1/0,Math.min(j,ne||1/0)));return N(Y),Reflect.apply(S,k,[Y,...w])}});function E(){s&&(clearTimeout(s),s=void 0)}function T(S){E(),s=setTimeout(()=>{!r&&n.size===0&&o&&(i=af,_.end(S))},a)}function F(S){s=setTimeout(()=>{!r&&o&&(i=of,_.end(S))},d)}function B(S){E(),n.set(S,!0);const k=ie();F(k+d/1e3)}function q(S){if(n.has(S)&&n.delete(S),n.size===0){const k=ie();T(k+a/1e3)}}function N(S){r=!0,n.clear(),c.forEach(O=>O()),jt(h,g);const k=U(_),{start_timestamp:J}=k;if(!J)return;k.data[mn]||_.setAttribute(mn,i);const w=k.status;(!w||w==="unknown")&&_.setStatus({code:Js}),m.log(`[Tracing] Idle span "${k.op}" finished`);const P=Zn(_).filter(O=>O!==_);let j=0;P.forEach(O=>{O.isRecording()&&(O.setStatus({code:de,message:"cancelled"}),O.end(S),v&&m.log("[Tracing] Cancelling span since span ended early",JSON.stringify(O,void 0,2)));const ce=U(O),{timestamp:Q=0,start_timestamp:ne=0}=ce,b=ne<=S,Y=(u+a)/1e3,R=Q-ne<=Y;if(v){const K=JSON.stringify(O,void 0,2);b?R||m.log("[Tracing] Discarding span since it finished after idle span final timeout",K):m.log("[Tracing] Discarding span since it happened after idle span was finished",K)}(!R||!b)&&(Cd(_,O),j++)}),j>0&&_.setAttribute("sentry.idle_span_discarded_spans",j)}return c.push(p.on("spanStart",S=>{if(r||S===_||U(S).timestamp||S instanceof Nr&&S.isStandaloneSpan())return;Zn(_).includes(S)&&B(S.spanContext().spanId)})),c.push(p.on("spanEnd",S=>{r||q(S.spanContext().spanId)})),c.push(p.on("idleSpanEnableAutoFinish",S=>{S===_&&(o=!0,T(),n.size&&F())})),t.disableAutoFinish||T(),setTimeout(()=>{r||(_.setStatus({code:de,message:"deadline_exceeded"}),i=cf,_.end())},u),_}function lf(e){const t=rn(e);return jt(G(),t),v&&m.log("[Tracing] Started span is an idle span"),t}const Qr=0,lo=1,fo=2;function Or(e){return new gn(t=>{t(e)})}function ri(e){return new gn((t,n)=>{n(e)})}class gn{constructor(t){this._state=Qr,this._handlers=[],this._runExecutor(t)}then(t,n){return new gn((r,s)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new gn((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,t&&t()},o=>{i=!0,s=o,t&&t()}).then(()=>{if(i){r(s);return}n(s)})})}_executeHandlers(){if(this._state===Qr)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===lo&&n[1](this._value),this._state===fo&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(i,o)=>{if(this._state===Qr){if(Zt(o)){o.then(r,s);return}this._state=i,this._value=o,this._executeHandlers()}},r=i=>{n(lo,i)},s=i=>{n(fo,i)};try{t(r,s)}catch(i){s(i)}}}function df(e,t,n,r=0){try{const s=ys(t,n,e,r);return Zt(s)?s:Or(s)}catch(s){return ri(s)}}function ys(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return v&&i===null&&m.log(`Event processor "${s.id||"?"}" dropped event`),Zt(i)?i.then(o=>ys(o,t,n,r+1)):ys(i,t,n,r+1)}function ff(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;pf(e,t),r&&gf(e,r),_f(e,n),hf(e,s),mf(e,i)}function hr(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,sdkProcessingMetadata:c,breadcrumbs:a,fingerprint:u,eventProcessors:d,attachments:l,propagationContext:f,transactionName:p,span:h}=t;Un(e,"extra",n),Un(e,"tags",r),Un(e,"user",s),Un(e,"contexts",i),e.sdkProcessingMetadata=In(e.sdkProcessingMetadata,c,2),o&&(e.level=o),p&&(e.transactionName=p),h&&(e.span=h),a.length&&(e.breadcrumbs=[...e.breadcrumbs,...a]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),l.length&&(e.attachments=[...e.attachments,...l]),e.propagationContext={...e.propagationContext,...f}}function Un(e,t,n){e[t]=In(e[t],n,1)}function pf(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:c}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),c&&e.type!=="transaction"&&(e.transaction=c)}function hf(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function mf(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function gf(e,t){e.contexts={trace:Za(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:He(t),...e.sdkProcessingMetadata};const n=le(t),r=U(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function _f(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}let ze,po,ho,Ze;function fc(e){const t=L._sentryDebugIds,n=L._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(Ze&&r.length===po&&s.length===ho)return Ze;po=r.length,ho=s.length,Ze={},ze||(ze={});const i=(o,c)=>{for(const a of o){const u=c[a],d=ze==null?void 0:ze[a];if(d&&Ze&&u)Ze[d[0]]=u,ze&&(ze[a]=[d[0],u]);else if(u){const l=e(a);for(let f=l.length-1;f>=0;f--){const p=l[f],h=p==null?void 0:p.filename;if(h&&Ze&&ze){Ze[h]=u,ze[a]=[h,u];break}}}}};return t&&i(r,t),n&&i(s,n),Ze}function Sf(e,t){const n=fc(e);if(!n)return[];const r=[];for(const s of t)s&&n[s]&&r.push({type:"sourcemap",code_file:s,debug_id:n[s]});return r}function pc(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:c=1e3}=e,a={...t,event_id:t.event_id||n.event_id||fe(),timestamp:t.timestamp||Ct()},u=n.integrations||e.integrations.map(_=>_.name);yf(a,e),Tf(a,u),s&&s.emit("applyFrameMetadata",t),t.type===void 0&&Ef(a,e.stackParser);const d=If(r,n.captureContext);n.mechanism&&Wt(a,n.mechanism);const l=s?s.getEventProcessors():[],f=cr().getScopeData();if(i){const _=i.getScopeData();hr(f,_)}if(d){const _=d.getScopeData();hr(f,_)}const p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),ff(a,f);const h=[...l,...f.eventProcessors];return df(h,a,n).then(_=>(_&&bf(_),typeof o=="number"&&o>0?vf(_,o,c):_))}function yf(e,t){const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||xr,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;o!=null&&o.url&&(o.url=i?$a(o.url,i):o.url)}function Ef(e,t){var r,s;const n=fc(t);(s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.filename&&(a.debug_id=n[a.filename])})})}function bf(e){var r,s;const t={};if((s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.debug_id&&(a.abs_path?t[a.abs_path]=a.debug_id:a.filename&&(t[a.filename]=a.debug_id),delete a.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(([i,o])=>{n.push({type:"sourcemap",code_file:i,debug_id:o})})}function Tf(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function vf(e,t,n){var s,i;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Ce(o.data,t,n)}}))},...e.user&&{user:Ce(e.user,t,n)},...e.contexts&&{contexts:Ce(e.contexts,t,n)},...e.extra&&{extra:Ce(e.extra,t,n)}};return(s=e.contexts)!=null&&s.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Ce(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Ce(o.data,t,n)}}))),(i=e.contexts)!=null&&i.flags&&r.contexts&&(r.contexts.flags=Ce(e.contexts.flags,3,n)),r}function If(e,t){if(!t)return e;const n=e?e.clone():new $e;return n.update(t),n}function wf(e){if(e)return kf(e)?{captureContext:e}:Cf(e)?{captureContext:e}:e}function kf(e){return e instanceof $e||typeof e=="function"}const Rf=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Cf(e){return Object.keys(e).some(t=>Rf.includes(t))}function hc(e,t){return G().captureException(e,wf(t))}function mc(e,t){return G().captureEvent(e,t)}function gc(e,t){De().setContext(e,t)}function Mf(){const e=H();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function xf(e){De().addEventProcessor(e)}function mo(e){const t=De(),n=G(),{userAgent:r}=L.navigator||{},s=ql({user:n.getUser()||t.getUser(),...r&&{userAgent:r},...e}),i=t.getSession();return(i==null?void 0:i.status)==="ok"&&zt(i,{status:"exited"}),_c(),t.setSession(s),s}function _c(){const e=De(),n=G().getSession()||e.getSession();n&&Vl(n),Sc(),e.setSession()}function Sc(){const e=De(),t=H(),n=e.getSession();n&&t&&t.captureSession(n)}function go(e=!1){if(e){_c();return}Sc()}const Af="7";function Nf(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Of(e){return`${Nf(e)}${e.projectId}/envelope/`}function Pf(e,t){const n={sentry_version:Af};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Lf(e,t,n){return t||`${Of(e)}?${Pf(e,n)}`}const _o=[];function Df(e){const t={};return e.forEach(n=>{const{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Ff(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const s=n(t);r=Array.isArray(s)?s:[s]}else r=t;return Df(r)}function Bf(e,t){const n={};return t.forEach(r=>{r&&yc(e,r,n)}),n}function So(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function yc(e,t,n){if(n[t.name]){v&&m.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!_o.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),_o.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",(s,i)=>r(s,i,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((i,o)=>r(i,o,e),{id:t.name});e.addEventProcessor(s)}v&&m.log(`Integration installed: ${t.name}`)}function $f(e,t){return t?wn(t,()=>{const n=pe(),r=n?Za(n):Wa(t);return[n?He(n):ei(e,t),r]}):[void 0,void 0]}const Uf={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function Hf(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Wf(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Mt(r)),Qe(s,[Hf(e)])}const zf=100;function jf(e){switch(typeof e){case"number":return Number.isInteger(e)?{value:e,type:"integer"}:{value:e,type:"double"};case"boolean":return{value:e,type:"boolean"};case"string":return{value:e,type:"string"};default:{let t="";try{t=JSON.stringify(e)??""}catch{}return{value:t,type:"string"}}}}function Fe(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function qf(e,t){const n=ii(),r=Ec(e);r===void 0?n.set(e,[t]):r.length>=zf?(si(e,r),n.set(e,[t])):n.set(e,[...r,t])}function yo(e,t=G(),n=qf){var y;const r=(t==null?void 0:t.getClient())??H();if(!r){v&&m.warn("No client available to capture log.");return}const{release:s,environment:i,enableLogs:o=!1,beforeSendLog:c}=r.getOptions();if(!o){v&&m.warn("logging option not enabled, log will not be captured.");return}const[,a]=$f(r,t),u={...e.attributes},{user:{id:d,email:l,username:f}}=Vf(t);Fe(u,"user.id",d,!1),Fe(u,"user.email",l,!1),Fe(u,"user.name",f,!1),Fe(u,"sentry.release",s),Fe(u,"sentry.environment",i);const{name:p,version:h}=((y=r.getSdkMetadata())==null?void 0:y.sdk)??{};Fe(u,"sentry.sdk.name",p),Fe(u,"sentry.sdk.version",h);const g=r.getIntegrationByName("Replay"),_=g==null?void 0:g.getReplayId(!0);Fe(u,"sentry.replay_id",_),_&&(g==null?void 0:g.getRecordingMode())==="buffer"&&Fe(u,"sentry._internal.replay_is_buffering",!0);const E=e.message;if(Cr(E)){const{__sentry_template_string__:w,__sentry_template_values__:P=[]}=E;P!=null&&P.length&&(u["sentry.message.template"]=w),P.forEach((j,O)=>{u[`sentry.message.parameter.${O}`]=j})}const T=hn(t);Fe(u,"sentry.trace.parent_span_id",T==null?void 0:T.spanContext().spanId);const F={...e,attributes:u};r.emit("beforeCaptureLog",F);const B=c?at(()=>c(F)):F;if(!B){r.recordDroppedEvent("before_send","log_item",1),v&&m.warn("beforeSendLog returned null, log will not be captured.");return}const{level:q,message:N,attributes:S={},severityNumber:k}=B,J={timestamp:ie(),level:q,body:N,trace_id:a==null?void 0:a.trace_id,severity_number:k??Uf[q],attributes:Object.keys(S).reduce((w,P)=>(w[P]=jf(S[P]),w),{})};n(r,J),r.emit("afterCaptureLog",B)}function si(e,t){const n=t??Ec(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Wf(n,r._metadata,r.tunnel,e.getDsn());ii().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function Ec(e){return ii().get(e)}function Vf(e){const t=cr().getScopeData();return hr(t,De().getScopeData()),hr(t,e.getScopeData()),t}function ii(){return Jt("clientToLogBufferMap",()=>new WeakMap)}function Gf(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function Yf(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Mt(r)),Qe(s,[Gf(e)])}function bc(e,t){const n=t??Kf(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Yf(n,r._metadata,r.tunnel,e.getDsn());Tc().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Kf(e){return Tc().get(e)}function Tc(){return Jt("clientToMetricBufferMap",()=>new WeakMap)}function Xf(e,t,n){const r=[{type:"client_report"},{timestamp:Ct(),discarded_events:e}];return Qe(t?{dsn:t}:{},[r])}function vc(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 Jf(e){var a;const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:c}=((a=e.contexts)==null?void 0:a.trace)??{};return{data:o??{},description:e.transaction,op:c,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o==null?void 0:o[Xs],exclusive_time:o==null?void 0:o[nn],measurements:e.measurements,is_segment:!0}}function Qf(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&&{[Xs]:e.profile_id},...e.exclusive_time&&{[nn]:e.exclusive_time}}}},measurements:e.measurements}}const Eo="Not capturing exception because it's already been captured.",bo="Discarded session because of missing or non-string release",Ic=Symbol.for("SentryInternalError"),wc=Symbol.for("SentryDoNotSendEventError"),Zf=5e3;function nr(e){return{message:e,[Ic]:!0}}function Zr(e){return{message:e,[wc]:!0}}function To(e){return!!e&&typeof e=="object"&&Ic in e}function vo(e){return!!e&&typeof e=="object"&&wc in e}function Io(e,t,n,r,s){let i=0,o,c=!1;e.on(n,()=>{i=0,clearTimeout(o),c=!1}),e.on(t,a=>{i+=r(a),i>=8e5?s(e):c||(c=!0,o=setTimeout(()=>{s(e)},Zf))}),e.on("flush",()=>{s(e)})}class ep{constructor(t){var r;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=yd(t.dsn):v&&m.warn("No DSN provided, client will not send events."),this._dsn){const s=Lf(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:s})}this._options.enableLogs&&Io(this,"afterCaptureLog","flushLogs",sp,si),(this._options.enableMetrics??((r=this._options._experiments)==null?void 0:r.enableMetrics)??!0)&&Io(this,"afterCaptureMetric","flushMetrics",rp,bc)}captureException(t,n,r){const s=fe();if(Yi(t))return v&&m.log(Eo),s;const i={event_id:s,...n};return this._process(this.eventFromException(t,i).then(o=>this._captureEvent(o,i,r))),i.event_id}captureMessage(t,n,r,s){const i={event_id:fe(),...r},o=Cr(t)?t:String(t),c=vt(t)?this.eventFromMessage(o,n,i):this.eventFromException(t,i);return this._process(c.then(a=>this._captureEvent(a,i,s))),i.event_id}captureEvent(t,n,r){const s=fe();if(n!=null&&n.originalException&&Yi(n.originalException))return v&&m.log(Eo),s;const i={event_id:s,...n},o=t.sdkProcessingMetadata||{},c=o.capturedSpanScope,a=o.capturedSpanIsolationScope;return this._process(this._captureEvent(t,i,c||r,a)),i.event_id}captureSession(t){this.sendSession(t),zt(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),s=await n.flush(t);return r&&s}async close(t){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]}addIntegration(t){const n=this._integrations[t.name];yc(this,t,this._integrations),n||So(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Vd(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Fd(r,Wd(s));this.sendEnvelope(r).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=xr}=this._options;if("aggregates"in t){const i=t.attrs||{};if(!i.release&&!n){v&&m.warn(bo);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){v&&m.warn(bo);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const s=qd(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const s=`${t}:${n}`;v&&m.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,s=(...i)=>n(...i);return r.add(s),()=>{r.delete(s)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(s=>s(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return v&&m.error("Error while sending envelope:",n),{}}return v&&m.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=Bf(this,t),So(this,t)}_updateSessionFromEvent(t,n){var a,u;let r=n.level==="fatal",s=!1;const i=(a=n.exception)==null?void 0:a.values;if(i){s=!0,r=!1;for(const d of i)if(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&r)&&(zt(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||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,s){const i=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&(o!=null&&o.length)&&(n.integrations=o),this.emit("preprocessEvent",t,n),t.type||s.setLastEventId(t.event_id||n.event_id),pc(i,t,n,r,this,s).then(c=>{if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:Wa(r),...c.contexts};const a=ei(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=G(),s=De()){return v&&Es(t)&&m.log(`Captured error event \`${vc(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,s).then(i=>i.event_id,i=>{v&&(vo(i)?m.log(i.message):To(i)?m.warn(i.message):m.warn(i))})}_processEvent(t,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,c=kc(t),a=Es(t),u=t.type||"error",d=`before send for type \`${u}\``,l=typeof o>"u"?void 0:It(o);if(a&&typeof l=="number"&&Math.random()>l)return this.recordDroppedEvent("sample_rate","error"),ri(Zr(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=u==="replay_event"?"replay":u;return this._prepareEvent(t,n,r,s).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",f),Zr("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return p;const g=np(this,i,p,n);return tp(g,d)}).then(p=>{var _;if(p===null){if(this.recordDroppedEvent("before_send",f),c){const T=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",T)}throw Zr(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||s.getSession();if(a&&h&&this._updateSessionFromEvent(h,p),c){const E=((_=p.sdkProcessingMetadata)==null?void 0:_.spanCountBeforeProcessing)||0,T=p.spans?p.spans.length:0,F=E-T;F>0&&this.recordDroppedEvent("before_send","span",F)}const g=p.transaction_info;if(c&&g&&p.transaction!==t.transaction){const E="custom";p.transaction_info={...g,source:E}}return this.sendEvent(p,n),p}).then(null,p=>{throw vo(p)||To(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),nr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
10
+ Reason: ${p}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[s,i]=n.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){v&&m.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){v&&m.log("No outcomes to send");return}if(!this._dsn){v&&m.log("No dsn provided, will not send outcomes");return}v&&m.log("Sending outcomes:",t);const n=Xf(t,this._options.tunnel&&Mt(this._dsn));this.sendEnvelope(n)}}function tp(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Zt(e))return e.then(r=>{if(!pn(r)&&r!==null)throw nr(n);return r},r=>{throw nr(`${t} rejected with ${r}`)});if(!pn(e)&&e!==null)throw nr(n);return e}function np(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,beforeSendSpan:o,ignoreSpans:c}=t;let a=n;if(Es(a)&&s)return s(a,r);if(kc(a)){if(o||c){const u=Jf(a);if(c!=null&&c.length&&lr(u,c))return null;if(o){const d=o(u);d?a=In(n,Qf(d)):_s()}if(a.spans){const d=[],l=a.spans;for(const p of l){if(c!=null&&c.length&&lr(p,c)){xd(l,p);continue}if(o){const h=o(p);h?d.push(h):(_s(),d.push(p))}else d.push(p)}const f=a.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),a.spans=d}}if(i){if(a.spans){const u=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(a,r)}}return a}function Es(e){return e.type===void 0}function kc(e){return e.type==="transaction"}function rp(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Rc(e.attributes)}function sp(e){let t=0;return e.message&&(t+=e.message.length*2),t+Rc(e.attributes)}function Rc(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*wo(n[0]):vt(n)?t+=wo(n):t+=100}),t}function wo(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function ip(e,t){t.debug===!0&&(v?m.enable():at(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),G().update(t.initialScope);const r=new e(t);return op(r),r.init(),r}function op(e){G().setClient(e)}const Cc=Symbol.for("SentryBufferFullError");function Mc(e=100){const t=new Set;function n(){return t.size<e}function r(o){t.delete(o)}function s(o){if(!n())return ri(Cc);const c=o();return t.add(c),c.then(()=>r(c),()=>r(c)),c}function i(o){if(!t.size)return Or(!0);const c=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return c;const a=[c,new Promise(u=>setTimeout(()=>u(!1),o))];return Promise.race(a)}return{get $(){return Array.from(t)},add:s,drain:i}}const ap=60*1e3;function xc(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?ap:r-t}function cp(e,t){return e[t]||e.all||0}function Ac(e,t,n=Date.now()){return cp(e,t)>n}function Nc(e,{statusCode:t,headers:n},r=Date.now()){const s={...e},i=n==null?void 0:n["x-sentry-rate-limits"],o=n==null?void 0:n["retry-after"];if(i)for(const c of i.trim().split(",")){const[a,u,,,d]=c.split(":",5),l=parseInt(a,10),f=(isNaN(l)?60:l)*1e3;if(!u)s.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(s[p]=r+f):s[p]=r+f}else o?s.all=r+xc(o,r):t===429&&(s.all=r+60*1e3);return s}const up=64;function lp(e,t,n=Mc(e.bufferSize||up)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(dr(o,(l,f)=>{const p=so(f);Ac(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):c.push(l)}),c.length===0)return Promise.resolve({});const a=Qe(o[0],c),u=l=>{dr(a,(f,p)=>{e.recordDroppedEvent(l,so(p))})},d=()=>t({body:pr(a)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&v&&m.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Nc(r,l),l),l=>{throw u("network_error"),v&&m.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===Cc)return v&&m.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:i,flush:s}}const es=100,ts=5e3,dp=36e5;function fp(e){function t(...n){v&&m.log("[Offline]:",...n)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const s=n.createStore(n);let i=ts,o;function c(l,f,p){return ro(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,f,p):!0}function a(l){o&&clearTimeout(o),o=setTimeout(async()=>{o=void 0;const f=await s.shift();f&&(t("Attempting to send previously queued event"),f[0].sent_at=new Date().toISOString(),d(f,!0).catch(p=>{t("Failed to retry sending",p)}))},l),typeof o!="number"&&o.unref&&o.unref()}function u(){o||(a(i),i=Math.min(i*2,dp))}async function d(l,f=!1){var p,h;if(!f&&ro(l,["replay_event","replay_recording"]))return await s.push(l),a(es),{};try{if(n.shouldSend&&await n.shouldSend(l)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");const g=await r.send(l);let _=es;if(g){if((p=g.headers)!=null&&p["retry-after"])_=xc(g.headers["retry-after"]);else if((h=g.headers)!=null&&h["x-sentry-rate-limits"])_=6e4;else if((g.statusCode||0)>=400)return g}return a(_),i=ts,g}catch(g){if(await c(l,g,i))return f?await s.unshift(l):await s.push(l),u(),t("Error sending. Event queued.",g),{};throw g}}return n.flushAtStartup&&u(),{send:d,flush:l=>(l===void 0&&(i=ts,a(es)),r.flush(l))}}}const pp="thismessage:/";function oi(e){return"isRelative"in e}function ai(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?pp:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const s=new URL(e,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch{}}function hp(e){if(oi(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 Et(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 mp(e){return e.split(/[?#]/,1)[0]}function gp(e,t){const n=t==null?void 0:t.getDsn(),r=t==null?void 0:t.getOptions().tunnel;return Sp(e,n)||_p(e,r)}function _p(e,t){return t?ko(e)===ko(t):!1}function Sp(e,t){const n=ai(e);return!n||oi(n)?!1:t?n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search):!1}function ko(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function yp(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 Oc(e,t,n=[t],r="npm"){const s=e._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${t}`,packages:n.map(i=>({name:`${r}:@sentry/${i}`,version:_t})),version:_t}),e._metadata=s}function Pc(e={}){const t=e.client||H();if(!Mf()||!t)return{};const n=Rt(),r=tn(n);if(r.getTraceData)return r.getTraceData(e);const s=e.scope||G(),i=e.span||pe(),o=i?Id(i):Ep(s),c=i?He(i):ei(t,s),a=ud(c);if(!Ka.test(o))return m.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":o,baggage:a};if(e.propagateTraceparent){const l=i?wd(i):bp(s);l&&(d.traceparent=l)}return d}function Ep(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Xa(t,r,n)}function bp(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ja(t,r,n)}function Tp(e,t,n){let r,s,i;const o=n!=null&&n.maxWait?Math.max(n.maxWait,t):0,c=(n==null?void 0:n.setTimeoutImpl)||setTimeout;function a(){return u(),r=e(),r}function u(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function d(){return s!==void 0||i!==void 0?a():r}function l(){return s&&clearTimeout(s),s=c(a,t),o&&i===void 0&&(i=c(a,o)),r}return l.cancel=u,l.flush=d,l}const vp=100;function it(e,t){const n=H(),r=De();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=vp}=n.getOptions();if(i<=0)return;const c={timestamp:Ct(),...e},a=s?at(()=>s(c,t)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}let Ro;const Ip="FunctionToString",Co=new WeakMap,wp=()=>({name:Ip,setupOnce(){Ro=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Ys(this),n=Co.has(H())&&t!==void 0?t:this;return Ro.apply(n,e)}}catch{}},setup(e){Co.set(e,!0)}}),kp=wp,Rp=[/^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. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],Cp="EventFilters",Mp=(e={})=>{let t;return{name:Cp,setup(n){const r=n.getOptions();t=Mo(e,r)},processEvent(n,r,s){if(!t){const i=s.getOptions();t=Mo(e,i)}return Ap(n,t)?null:n}}},xp=(e={})=>({...Mp(e),name:"InboundFilters"});function Mo(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Rp],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Ap(e,t){if(e.type){if(e.type==="transaction"&&Op(e,t.ignoreTransactions))return v&&m.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
11
+ Event: ${pt(e)}`),!0}else{if(Np(e,t.ignoreErrors))return v&&m.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
12
+ Event: ${pt(e)}`),!0;if(Fp(e))return v&&m.warn(`Event dropped due to not having an error message, error type or stacktrace.
13
+ Event: ${pt(e)}`),!0;if(Pp(e,t.denyUrls))return v&&m.warn(`Event dropped due to being matched by \`denyUrls\` option.
14
14
  Event: ${pt(e)}.
15
- Url: ${mr(e)}`),!0;if(!Pp(e,t.allowUrls))return v&&m.warn(`Event dropped due to not being matched by \`allowUrls\` option.
15
+ Url: ${mr(e)}`),!0;if(!Lp(e,t.allowUrls))return v&&m.warn(`Event dropped due to not being matched by \`allowUrls\` option.
16
16
  Event: ${pt(e)}.
17
- Url: ${mr(e)}`),!0}return!1}function Ap(e,t){return t!=null&&t.length?Tc(e).some(n=>Ve(n,t)):!1}function Np(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?Ve(n,t):!1}function Op(e,t){if(!(t!=null&&t.length))return!1;const n=mr(e);return n?Ve(n,t):!1}function Pp(e,t){if(!(t!=null&&t.length))return!0;const n=mr(e);return n?Ve(n,t):!0}function Lp(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 mr(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(i=>{var o,c,a;return((o=i.mechanism)==null?void 0:o.parent_id)===void 0&&((a=(c=i.stacktrace)==null?void 0:c.frames)==null?void 0:a.length)}),s=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return s?Lp(s):null}catch{return v&&m.error(`Cannot extract url for event ${pt(e)}`),null}}function Dp(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 Fp(e,t,n,r,s,i){var c;if(!((c=s.exception)!=null&&c.values)||!i||!Xe(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=bs(e,t,r,i.originalException,n,s.exception.values,o,0))}function bs(e,t,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if(Xe(r[s],Error)){xo(o,c);const u=e(t,r[s]),d=a.length;Ao(u,s,d,c),a=bs(e,t,n,r[s],s,[u,...a],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Xe(u,Error)){xo(o,c);const l=e(t,u),f=a.length;Ao(l,`errors[${d}]`,f,c),a=bs(e,t,n,u,s,[l,...a],l,f)}}),a}function xo(e,t){e.mechanism={handled:!0,type:"auto.core.linked_errors",...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function Ao(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Pc(e){const t="console";ct(t,e),ut(t,Bp)}function Bp(){"console"in L&&Ia.forEach(function(e){e in L.console&&ye(L.console,e,function(t){return ar[e]=t,function(...n){Ae("console",{args:n,level:e});const s=ar[e];s==null||s.apply(L.console,n)}})})}function Lc(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const $p="Dedupe",Up=()=>{let e;return{name:$p,processEvent(t){if(t.type)return t;try{if(Wp(t,e))return v&&m.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Hp=Up;function Wp(e,t){return t?!!(zp(e,t)||jp(e,t)):!1}function zp(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Fc(e,t)||!Dc(e,t))}function jp(e,t){const n=No(t),r=No(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Fc(e,t)||!Dc(e,t))}function Dc(e,t){let n=Wi(e),r=Wi(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const i=r[s],o=n[s];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function Fc(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 No(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function qp(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,c=Ne()&&t(o);if(e.endTimestamp&&c){const p=e.fetchData.__span;if(!p)return;const h=r[p];h&&(Yp(h,e),Vp(h,e,s),delete r[p]);return}const{spanOrigin:a="auto.http.browser",propagateTraceparent:u=!1}=typeof s=="object"?s:{spanOrigin:s},d=!!pe(),l=c&&d?rn(Xp(o,i,a)):new st;if(e.fetchData.__span=l.spanContext().spanId,r[l.spanContext().spanId]=l,n(e.fetchData.url)){const p=e.args[0],h=e.args[1]||{},g=Gp(p,h,Ne()&&d?l:void 0,u);g&&(e.args[1]=h,h.headers=g)}const f=H();if(f){const p={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",l,p)}return l}function Vp(e,t,n){var s;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(s=t.response)==null?void 0:s.headers,error:t.error})}function Gp(e,t,n,r){const s=Oc({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=t.headers||(Pa(e)?e.headers:void 0);if(a)if(Kp(a)){const u=new Headers(a);if(u.get("sentry-trace")||u.set("sentry-trace",i),r&&c&&!u.get("traceparent")&&u.set("traceparent",c),o){const d=u.get("baggage");d?Hn(d)||u.set("baggage",`${d},${o}`):u.set("baggage",o)}return u}else if(Array.isArray(a)){const u=[...a];a.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&c&&!a.find(l=>l[0]==="traceparent")&&u.push(["traceparent",c]);const d=a.find(l=>l[0]==="baggage"&&Hn(l[1]));return o&&!d&&u.push(["baggage",o]),u}else{const u="sentry-trace"in a?a["sentry-trace"]:void 0,d="traceparent"in a?a.traceparent:void 0,l="baggage"in a?a.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(g=>Hn(g)):Hn(l));o&&!p&&f.push(o);const h={...a,"sentry-trace":u??i,baggage:f.length>0?f.join(","):void 0};return r&&c&&!d&&(h.traceparent=c),h}else return{...s}}function Yp(e,t){var n,r;if(t.response){za(e,t.response.status);const s=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(s){const i=parseInt(s);i>0&&e.setAttribute("http.response_content_length",i)}}else t.error&&e.setStatus({code:de,message:"internal_error"});e.end()}function Hn(e){return e.split(",").some(t=>t.trim().startsWith(Qs))}function Kp(e){return typeof Headers<"u"&&Xe(e,Headers)}function Xp(e,t,n){const r=ai(e);return{name:r?`${t} ${pp(r)}`:t,attributes:Jp(e,r,t,n)}}function Jp(e,t,n,r){const s={url:e,type:"fetch","http.method":n,[ae]:r,[Ue]:"http.client"};return t&&(oi(t)||(s["http.url"]=t.href,s["server.address"]=t.host),t.search&&(s["http.query"]=t.search),t.hash&&(s["http.fragment"]=t.hash)),s}function Oo(e,t,n){return"util"in L&&typeof L.util.format=="function"?L.util.format(...e):Qp(e,t,n)}function Qp(e,t,n){return e.map(r=>vt(r)?String(r):JSON.stringify(Ce(r,t,n))).join(" ")}function Zp(e){return/%[sdifocO]/.test(e)}function eh(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((s,i)=>{n[`sentry.message.parameter.${i}`]=s}),n}const th="ConsoleLogs",Po={[ae]:"auto.log.console"},nh=(e={})=>{const t=e.levels||Ia;return{name:th,setup(n){const{enableLogs:r,normalizeDepth:s=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){v&&m.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}Pc(({args:o,level:c})=>{if(H()!==n||!t.includes(c))return;const a=o[0],u=o.slice(1);if(c==="assert"){if(!a){const p=u.length>0?`Assertion failed: ${Oo(u,s,i)}`:"Assertion failed";yo({level:"error",message:p,attributes:Po})}return}const d=c==="log",l=o.length>1&&typeof o[0]=="string"&&!Zp(o[0]),f={...Po,...l?eh(a,u):{}};yo({level:d?"info":c,message:Oo(o,s,i),severityNumber:d?10:void 0,attributes:f})})}}},rh=nh;function Bc(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const _n=L;function sh(){return"history"in _n&&!!_n.history}function ih(){if(!("fetch"in _n))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Ts(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function oh(){var n;if(typeof EdgeRuntime=="string")return!0;if(!ih())return!1;if(Ts(_n.fetch))return!0;let e=!1;const t=_n.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=Ts(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){v&&m.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function $c(e,t){const n="fetch";ct(n,e),ut(n,()=>Uc(void 0,t))}function ah(e){const t="fetch-body-resolved";ct(t,e),ut(t,()=>Uc(uh))}function Uc(e,t=!1){t&&!oh()||ye(L,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=lh(r),c={args:r,fetchData:{method:i,url:o},startTimestamp:ie()*1e3,virtualError:s,headers:dh(r)};return e||Ae("fetch",{...c}),n.apply(L,r).then(async a=>(e?e(a):Ae("fetch",{...c,endTimestamp:ie()*1e3,response:a}),a),a=>{if(Ae("fetch",{...c,endTimestamp:ie()*1e3,error:a}),Vs(a)&&a.stack===void 0&&(a.stack=s.stack,Ie(a,"framesToPop",1)),a instanceof TypeError&&(a.message==="Failed to fetch"||a.message==="Load failed"||a.message==="NetworkError when attempting to fetch resource."))try{const u=new URL(c.fetchData.url);a.message=`${a.message} (${u.host})`}catch{}throw a})}})}async function ch(e,t){if(e!=null&&e.body){const n=e.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let i=!0;for(;i;){let o;try{o=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:c}=await r.read();clearTimeout(o),c&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(o)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function uh(e){let t;try{t=e.clone()}catch{return}ch(t,()=>{Ae("fetch-body-resolved",{endTimestamp:ie()*1e3,response:e})})}function vs(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Lo(e){return typeof e=="string"?e:e?vs(e,"url")?e.url:e.toString?e.toString():"":""}function lh(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Lo(n),method:vs(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:Lo(t),method:vs(t,"method")?String(t.method).toUpperCase():"GET"}}function dh(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Pa(t))return new Headers(t.headers)}catch{}}function fh(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function ph(){return"npm"}function hh(){return!fh()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Is(){return typeof window<"u"&&(!hh()||mh())}function mh(){const e=L.process;return(e==null?void 0:e.type)==="renderer"}const D=L;let ws=0;function Hc(){return ws>0}function gh(){ws++,setTimeout(()=>{ws--})}function Vt(e,t={}){function n(s){return typeof s=="function"}if(!n(e))return e;try{const s=e.__sentry_wrapped__;if(s)return typeof s=="function"?s:e;if(Ys(e))return e}catch{return e}const r=function(...s){try{const i=s.map(o=>Vt(o,t));return e.apply(this,i)}catch(i){throw gh(),wn(o=>{o.addEventProcessor(c=>(t.mechanism&&(hs(c,void 0),Wt(c,t.mechanism)),c.extra={...c.extra,arguments:s},c)),pc(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}Da(r,e),Ie(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function ci(){const e=en(),{referrer:t}=D.document||{},{userAgent:n}=D.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function ui(e,t){const n=li(e,t),r={type:bh(t),value:Th(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function _h(e,t,n,r){const s=H(),i=s==null?void 0:s.getOptions().normalizeDepth,o=Rh(t),c={__serialized__:sc(t,i)};if(o)return{exception:{values:[ui(e,o)]},extra:c};const a={exception:{values:[{type:Mr(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:wh(t,{isUnhandledRejection:r})}]},extra:c};if(n){const u=li(e,n);u.length&&(a.exception.values[0].stacktrace={frames:u})}return a}function ns(e,t){return{exception:{values:[ui(e,t)]}}}function li(e,t){const n=t.stacktrace||t.stack||"",r=yh(t),s=Eh(t);try{return e(n,r,s)}catch{}return[]}const Sh=/Minified React error #\d+;/i;function yh(e){return e&&Sh.test(e.message)?1:0}function Eh(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Wc(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function bh(e){const t=e==null?void 0:e.name;return!t&&Wc(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function Th(e){const t=e==null?void 0:e.message;return Wc(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function vh(e,t,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,i=di(e,t,s,r);return Wt(i),i.level="error",n!=null&&n.event_id&&(i.event_id=n.event_id),Or(i)}function Ih(e,t,n="info",r,s){const i=(r==null?void 0:r.syntheticException)||void 0,o=ks(e,t,i,s);return o.level=n,r!=null&&r.event_id&&(o.event_id=r.event_id),Or(o)}function di(e,t,n,r,s){let i;if(Na(t)&&t.error)return ns(e,t.error);if(ji(t)||Nl(t)){const o=t;if("stack"in t)i=ns(e,t);else{const c=o.name||(ji(o)?"DOMError":"DOMException"),a=o.message?`${c}: ${o.message}`:c;i=ks(e,a,n,r),hs(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return Vs(t)?ns(e,t):pn(t)||Mr(t)?(i=_h(e,t,n,s),Wt(i,{synthetic:!0}),i):(i=ks(e,t,n,r),hs(i,`${t}`),Wt(i,{synthetic:!0}),i)}function ks(e,t,n,r){const s={};if(r&&n){const i=li(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),Wt(s,{synthetic:!0})}if(Cr(t)){const{__sentry_template_string__:i,__sentry_template_values__:o}=t;return s.logentry={message:i,params:o},s}return s.message=t,s}function wh(e,{isUnhandledRejection:t}){const n=Bl(e),r=t?"promise rejection":"exception";return Na(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Mr(e)?`Event \`${kh(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function kh(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Rh(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class Ch extends Zf{constructor(t){var d;const n=Mh(t),r=D.SENTRY_SDK_SOURCE||ph();Nc(n,"browser",["browser"],r),(d=n._metadata)!=null&&d.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:s,sendClientReports:i,enableLogs:o,_experiments:c,enableMetrics:a}=this._options,u=a??(c==null?void 0:c.enableMetrics)??!0;D.document&&(i||o||u)&&D.document.addEventListener("visibilitychange",()=>{D.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),o&&si(this),u&&Ec(this))}),s&&this.on("beforeSendSession",Sp)}eventFromException(t,n){return vh(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Ih(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,s){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,s)}}function Mh(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=D.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const wt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,x=L,xh=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Cn=(e,t,n,r)=>{let s,i;return o=>{t.value>=0&&(o||r)&&(i=t.value-(s??0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=xh(t.value,n),e(t)))}},Mn=(e=!0)=>{var n,r;const t=(r=(n=x.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},sn=()=>{const e=Mn();return(e==null?void 0:e.activationStart)??0};function bt(e,t,n){x.document&&x.addEventListener(e,t,n)}function fi(e,t,n){x.document&&x.removeEventListener(e,t,n)}let Ht=-1;const zc=new Set,Ah=()=>{var e,t;return((e=x.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=x.document)!=null&&t.prerendering)?0:1/0},rr=e=>{if(Nh(e)&&Ht>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of zc)t();isFinite(Ht)||(Ht=e.type==="visibilitychange"?e.timeStamp:0,fi("prerenderingchange",rr,!0))}},xn=()=>{var e;if(x.document&&Ht<0){const t=sn();Ht=(x.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??Ah(),bt("visibilitychange",rr,!0),bt("pagehide",rr,!0),bt("prerenderingchange",rr,!0)}return{get firstHiddenTime(){return Ht},onHidden(t){zc.add(t)}}};function Nh(e){var t;return e.type==="pagehide"||((t=x.document)==null?void 0:t.visibilityState)==="hidden"}const Oh=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,An=(e,t=-1)=>{var i,o;const n=Mn();let r="navigate";return n&&((i=x.document)!=null&&i.prerendering||sn()>0?r="prerender":(o=x.document)!=null&&o.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:Oh(),navigationType:r}},rs=new WeakMap;function pi(e,t){return rs.get(e)||rs.set(e,new t),rs.get(e)}class gr{constructor(){gr.prototype.__init.call(this),gr.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var s;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]),(s=this._onAfterProcessingUnexpectedShift)==null||s.call(this,t)}}const on=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{t(s.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},hi=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Pr=e=>{var t;(t=x.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Ph=[1800,3e3],Lh=(e,t={})=>{Pr(()=>{const n=xn(),r=An("FCP");let s;const o=on("paint",c=>{for(const a of c)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<n.firstHiddenTime&&(r.value=Math.max(a.startTime-sn(),0),r.entries.push(a),s(!0)))});o&&(s=Cn(e,r,Ph,t.reportAllChanges))})},Dh=[.1,.25],Fh=(e,t={})=>{Lh(hi(()=>{var a;const n=An("CLS",0);let r;const s=xn(),i=pi(t,gr),o=u=>{for(const d of u)i._processEntry(d);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},c=on("layout-shift",o);c&&(r=Cn(e,n,Dh,t.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),(a=x==null?void 0:x.setTimeout)==null||a.call(x,r))}))};let jc=0,ss=1/0,Wn=0;const Bh=e=>{e.forEach(t=>{t.interactionId&&(ss=Math.min(ss,t.interactionId),Wn=Math.max(Wn,t.interactionId),jc=Wn?(Wn-ss)/7+1:0)})};let Rs;const qc=()=>Rs?jc:performance.interactionCount||0,$h=()=>{"interactionCount"in performance||Rs||(Rs=on("event",Bh,{type:"event",buffered:!0,durationThreshold:0}))},is=10;let Vc=0;const Uh=()=>qc()-Vc;class _r{constructor(){_r.prototype.__init.call(this),_r.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Vc=qc(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(Uh()/50));return this._longestInteractionList[t]}_processEntry(t){var s,i;if((s=this._onBeforeProcessingEntry)==null||s.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<is||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((o,c)=>c._latency-o._latency),this._longestInteractionList.length>is){const o=this._longestInteractionList.splice(is);for(const c of o)this._longestInteractionMap.delete(c.id)}(i=this._onAfterProcessingINPCandidate)==null||i.call(this,r)}}}const Gc=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=x.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};bt("visibilitychange",t,!0),bt("pagehide",t,!0)},Yc=e=>{var n;const t=x.requestIdleCallback||x.setTimeout;((n=x.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=hi(e),bt("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),fi("visibilitychange",e,{capture:!0})}),Gc(e))},Hh=[200,500],Wh=40,zh=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=xn();Pr(()=>{$h();const r=An("INP");let s;const i=pi(t,_r),o=a=>{Yc(()=>{for(const d of a)i._processEntry(d);const u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,s())})},c=on("event",o,{durationThreshold:t.durationThreshold??Wh});s=Cn(e,r,Hh,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(c.takeRecords()),s(!0)}))})};class jh{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const qh=[2500,4e3],Vh=(e,t={})=>{Pr(()=>{const n=xn(),r=An("LCP");let s;const i=pi(t,jh),o=a=>{t.reportAllChanges||(a=a.slice(-1));for(const u of a)i._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-sn(),0),r.entries=[u],s())},c=on("largest-contentful-paint",o);if(c){s=Cn(e,r,qh,t.reportAllChanges);const a=hi(()=>{o(c.takeRecords()),c.disconnect(),s(!0)}),u=d=>{d.isTrusted&&(Yc(a),fi(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])bt(d,u,{capture:!0})}})},Gh=[800,1800],Cs=e=>{var t,n;(t=x.document)!=null&&t.prerendering?Pr(()=>Cs(e)):((n=x.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>Cs(e),!0):setTimeout(e)},Yh=(e,t={})=>{const n=An("TTFB"),r=Cn(e,n,Gh,t.reportAllChanges);Cs(()=>{const s=Mn();s&&(n.value=Math.max(s.responseStart-sn(),0),n.entries=[s],r(!0))})},un={},Sr={};let Kc,Xc,Jc,Qc;function mi(e,t=!1){return Lr("cls",e,Xh,Kc,t)}function gi(e,t=!1){return Lr("lcp",e,Jh,Xc,t)}function Kh(e){return Lr("ttfb",e,Qh,Jc)}function Zc(e){return Lr("inp",e,Zh,Qc)}function kt(e,t){return eu(e,t),Sr[e]||(em(e),Sr[e]=!0),tu(e,t)}function Nn(e,t){const n=un[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(s){wt&&m.error(`Error while triggering instrumentation handler.
17
+ Url: ${mr(e)}`),!0}return!1}function Np(e,t){return t!=null&&t.length?vc(e).some(n=>Ve(n,t)):!1}function Op(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?Ve(n,t):!1}function Pp(e,t){if(!(t!=null&&t.length))return!1;const n=mr(e);return n?Ve(n,t):!1}function Lp(e,t){if(!(t!=null&&t.length))return!0;const n=mr(e);return n?Ve(n,t):!0}function Dp(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 mr(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(i=>{var o,c,a;return((o=i.mechanism)==null?void 0:o.parent_id)===void 0&&((a=(c=i.stacktrace)==null?void 0:c.frames)==null?void 0:a.length)}),s=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return s?Dp(s):null}catch{return v&&m.error(`Cannot extract url for event ${pt(e)}`),null}}function Fp(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 Bp(e,t,n,r,s,i){var c;if(!((c=s.exception)!=null&&c.values)||!i||!Xe(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=bs(e,t,r,i.originalException,n,s.exception.values,o,0))}function bs(e,t,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if(Xe(r[s],Error)){xo(o,c);const u=e(t,r[s]),d=a.length;Ao(u,s,d,c),a=bs(e,t,n,r[s],s,[u,...a],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Xe(u,Error)){xo(o,c);const l=e(t,u),f=a.length;Ao(l,`errors[${d}]`,f,c),a=bs(e,t,n,u,s,[l,...a],l,f)}}),a}function xo(e,t){e.mechanism={handled:!0,type:"auto.core.linked_errors",...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function Ao(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Lc(e){const t="console";ct(t,e),ut(t,$p)}function $p(){"console"in L&&wa.forEach(function(e){e in L.console&&ye(L.console,e,function(t){return ar[e]=t,function(...n){Ae("console",{args:n,level:e});const s=ar[e];s==null||s.apply(L.console,n)}})})}function Dc(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Up="Dedupe",Hp=()=>{let e;return{name:Up,processEvent(t){if(t.type)return t;try{if(zp(t,e))return v&&m.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Wp=Hp;function zp(e,t){return t?!!(jp(e,t)||qp(e,t)):!1}function jp(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Bc(e,t)||!Fc(e,t))}function qp(e,t){const n=No(t),r=No(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Bc(e,t)||!Fc(e,t))}function Fc(e,t){let n=Wi(e),r=Wi(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const i=r[s],o=n[s];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function Bc(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 No(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Vp(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,c=Ne()&&t(o);if(e.endTimestamp&&c){const p=e.fetchData.__span;if(!p)return;const h=r[p];h&&(Kp(h,e),Gp(h,e,s),delete r[p]);return}const{spanOrigin:a="auto.http.browser",propagateTraceparent:u=!1}=typeof s=="object"?s:{spanOrigin:s},d=!!pe(),l=c&&d?rn(Jp(o,i,a)):new st;if(e.fetchData.__span=l.spanContext().spanId,r[l.spanContext().spanId]=l,n(e.fetchData.url)){const p=e.args[0],h=e.args[1]||{},g=Yp(p,h,Ne()&&d?l:void 0,u);g&&(e.args[1]=h,h.headers=g)}const f=H();if(f){const p={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",l,p)}return l}function Gp(e,t,n){var s;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(s=t.response)==null?void 0:s.headers,error:t.error})}function Yp(e,t,n,r){const s=Pc({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=t.headers||(La(e)?e.headers:void 0);if(a)if(Xp(a)){const u=new Headers(a);if(u.get("sentry-trace")||u.set("sentry-trace",i),r&&c&&!u.get("traceparent")&&u.set("traceparent",c),o){const d=u.get("baggage");d?Hn(d)||u.set("baggage",`${d},${o}`):u.set("baggage",o)}return u}else if(Array.isArray(a)){const u=[...a];a.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&c&&!a.find(l=>l[0]==="traceparent")&&u.push(["traceparent",c]);const d=a.find(l=>l[0]==="baggage"&&Hn(l[1]));return o&&!d&&u.push(["baggage",o]),u}else{const u="sentry-trace"in a?a["sentry-trace"]:void 0,d="traceparent"in a?a.traceparent:void 0,l="baggage"in a?a.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(g=>Hn(g)):Hn(l));o&&!p&&f.push(o);const h={...a,"sentry-trace":u??i,baggage:f.length>0?f.join(","):void 0};return r&&c&&!d&&(h.traceparent=c),h}else return{...s}}function Kp(e,t){var n,r;if(t.response){ja(e,t.response.status);const s=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(s){const i=parseInt(s);i>0&&e.setAttribute("http.response_content_length",i)}}else t.error&&e.setStatus({code:de,message:"internal_error"});e.end()}function Hn(e){return e.split(",").some(t=>t.trim().startsWith(Qs))}function Xp(e){return typeof Headers<"u"&&Xe(e,Headers)}function Jp(e,t,n){const r=ai(e);return{name:r?`${t} ${hp(r)}`:t,attributes:Qp(e,r,t,n)}}function Qp(e,t,n,r){const s={url:e,type:"fetch","http.method":n,[ae]:r,[Ue]:"http.client"};return t&&(oi(t)||(s["http.url"]=t.href,s["server.address"]=t.host),t.search&&(s["http.query"]=t.search),t.hash&&(s["http.fragment"]=t.hash)),s}function Oo(e,t,n){return"util"in L&&typeof L.util.format=="function"?L.util.format(...e):Zp(e,t,n)}function Zp(e,t,n){return e.map(r=>vt(r)?String(r):JSON.stringify(Ce(r,t,n))).join(" ")}function eh(e){return/%[sdifocO]/.test(e)}function th(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((s,i)=>{n[`sentry.message.parameter.${i}`]=s}),n}const nh="ConsoleLogs",Po={[ae]:"auto.log.console"},rh=(e={})=>{const t=e.levels||wa;return{name:nh,setup(n){const{enableLogs:r,normalizeDepth:s=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){v&&m.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}Lc(({args:o,level:c})=>{if(H()!==n||!t.includes(c))return;const a=o[0],u=o.slice(1);if(c==="assert"){if(!a){const p=u.length>0?`Assertion failed: ${Oo(u,s,i)}`:"Assertion failed";yo({level:"error",message:p,attributes:Po})}return}const d=c==="log",l=o.length>1&&typeof o[0]=="string"&&!eh(o[0]),f={...Po,...l?th(a,u):{}};yo({level:d?"info":c,message:Oo(o,s,i),severityNumber:d?10:void 0,attributes:f})})}}},sh=rh;function $c(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const _n=L;function ih(){return"history"in _n&&!!_n.history}function oh(){if(!("fetch"in _n))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Ts(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ah(){var n;if(typeof EdgeRuntime=="string")return!0;if(!oh())return!1;if(Ts(_n.fetch))return!0;let e=!1;const t=_n.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=Ts(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){v&&m.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function Uc(e,t){const n="fetch";ct(n,e),ut(n,()=>Hc(void 0,t))}function ch(e){const t="fetch-body-resolved";ct(t,e),ut(t,()=>Hc(lh))}function Hc(e,t=!1){t&&!ah()||ye(L,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=dh(r),c={args:r,fetchData:{method:i,url:o},startTimestamp:ie()*1e3,virtualError:s,headers:fh(r)};return e||Ae("fetch",{...c}),n.apply(L,r).then(async a=>(e?e(a):Ae("fetch",{...c,endTimestamp:ie()*1e3,response:a}),a),a=>{if(Ae("fetch",{...c,endTimestamp:ie()*1e3,error:a}),Vs(a)&&a.stack===void 0&&(a.stack=s.stack,Ie(a,"framesToPop",1)),a instanceof TypeError&&(a.message==="Failed to fetch"||a.message==="Load failed"||a.message==="NetworkError when attempting to fetch resource."))try{const u=new URL(c.fetchData.url);a.message=`${a.message} (${u.host})`}catch{}throw a})}})}async function uh(e,t){if(e!=null&&e.body){const n=e.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let i=!0;for(;i;){let o;try{o=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:c}=await r.read();clearTimeout(o),c&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(o)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function lh(e){let t;try{t=e.clone()}catch{return}uh(t,()=>{Ae("fetch-body-resolved",{endTimestamp:ie()*1e3,response:e})})}function vs(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Lo(e){return typeof e=="string"?e:e?vs(e,"url")?e.url:e.toString?e.toString():"":""}function dh(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Lo(n),method:vs(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:Lo(t),method:vs(t,"method")?String(t.method).toUpperCase():"GET"}}function fh(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(La(t))return new Headers(t.headers)}catch{}}function ph(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function hh(){return"npm"}function mh(){return!ph()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Is(){return typeof window<"u"&&(!mh()||gh())}function gh(){const e=L.process;return(e==null?void 0:e.type)==="renderer"}const D=L;let ws=0;function Wc(){return ws>0}function _h(){ws++,setTimeout(()=>{ws--})}function Vt(e,t={}){function n(s){return typeof s=="function"}if(!n(e))return e;try{const s=e.__sentry_wrapped__;if(s)return typeof s=="function"?s:e;if(Ys(e))return e}catch{return e}const r=function(...s){try{const i=s.map(o=>Vt(o,t));return e.apply(this,i)}catch(i){throw _h(),wn(o=>{o.addEventProcessor(c=>(t.mechanism&&(hs(c,void 0),Wt(c,t.mechanism)),c.extra={...c.extra,arguments:s},c)),hc(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}Fa(r,e),Ie(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function ci(){const e=en(),{referrer:t}=D.document||{},{userAgent:n}=D.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function ui(e,t){const n=li(e,t),r={type:Th(t),value:vh(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Sh(e,t,n,r){const s=H(),i=s==null?void 0:s.getOptions().normalizeDepth,o=Ch(t),c={__serialized__:ic(t,i)};if(o)return{exception:{values:[ui(e,o)]},extra:c};const a={exception:{values:[{type:Mr(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:kh(t,{isUnhandledRejection:r})}]},extra:c};if(n){const u=li(e,n);u.length&&(a.exception.values[0].stacktrace={frames:u})}return a}function ns(e,t){return{exception:{values:[ui(e,t)]}}}function li(e,t){const n=t.stacktrace||t.stack||"",r=Eh(t),s=bh(t);try{return e(n,r,s)}catch{}return[]}const yh=/Minified React error #\d+;/i;function Eh(e){return e&&yh.test(e.message)?1:0}function bh(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function zc(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function Th(e){const t=e==null?void 0:e.name;return!t&&zc(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function vh(e){const t=e==null?void 0:e.message;return zc(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function Ih(e,t,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,i=di(e,t,s,r);return Wt(i),i.level="error",n!=null&&n.event_id&&(i.event_id=n.event_id),Or(i)}function wh(e,t,n="info",r,s){const i=(r==null?void 0:r.syntheticException)||void 0,o=ks(e,t,i,s);return o.level=n,r!=null&&r.event_id&&(o.event_id=r.event_id),Or(o)}function di(e,t,n,r,s){let i;if(Oa(t)&&t.error)return ns(e,t.error);if(ji(t)||Ol(t)){const o=t;if("stack"in t)i=ns(e,t);else{const c=o.name||(ji(o)?"DOMError":"DOMException"),a=o.message?`${c}: ${o.message}`:c;i=ks(e,a,n,r),hs(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return Vs(t)?ns(e,t):pn(t)||Mr(t)?(i=Sh(e,t,n,s),Wt(i,{synthetic:!0}),i):(i=ks(e,t,n,r),hs(i,`${t}`),Wt(i,{synthetic:!0}),i)}function ks(e,t,n,r){const s={};if(r&&n){const i=li(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),Wt(s,{synthetic:!0})}if(Cr(t)){const{__sentry_template_string__:i,__sentry_template_values__:o}=t;return s.logentry={message:i,params:o},s}return s.message=t,s}function kh(e,{isUnhandledRejection:t}){const n=$l(e),r=t?"promise rejection":"exception";return Oa(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Mr(e)?`Event \`${Rh(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Rh(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Ch(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class Mh extends ep{constructor(t){var d;const n=xh(t),r=D.SENTRY_SDK_SOURCE||hh();Oc(n,"browser",["browser"],r),(d=n._metadata)!=null&&d.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:s,sendClientReports:i,enableLogs:o,_experiments:c,enableMetrics:a}=this._options,u=a??(c==null?void 0:c.enableMetrics)??!0;D.document&&(i||o||u)&&D.document.addEventListener("visibilitychange",()=>{D.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),o&&si(this),u&&bc(this))}),s&&this.on("beforeSendSession",yp)}eventFromException(t,n){return Ih(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return wh(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,s){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,s)}}function xh(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=D.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const wt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,x=L,Ah=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Cn=(e,t,n,r)=>{let s,i;return o=>{t.value>=0&&(o||r)&&(i=t.value-(s??0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=Ah(t.value,n),e(t)))}},Mn=(e=!0)=>{var n,r;const t=(r=(n=x.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},sn=()=>{const e=Mn();return(e==null?void 0:e.activationStart)??0};function bt(e,t,n){x.document&&x.addEventListener(e,t,n)}function fi(e,t,n){x.document&&x.removeEventListener(e,t,n)}let Ht=-1;const jc=new Set,Nh=()=>{var e,t;return((e=x.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=x.document)!=null&&t.prerendering)?0:1/0},rr=e=>{if(Oh(e)&&Ht>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of jc)t();isFinite(Ht)||(Ht=e.type==="visibilitychange"?e.timeStamp:0,fi("prerenderingchange",rr,!0))}},xn=()=>{var e;if(x.document&&Ht<0){const t=sn();Ht=(x.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??Nh(),bt("visibilitychange",rr,!0),bt("pagehide",rr,!0),bt("prerenderingchange",rr,!0)}return{get firstHiddenTime(){return Ht},onHidden(t){jc.add(t)}}};function Oh(e){var t;return e.type==="pagehide"||((t=x.document)==null?void 0:t.visibilityState)==="hidden"}const Ph=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,An=(e,t=-1)=>{var i,o;const n=Mn();let r="navigate";return n&&((i=x.document)!=null&&i.prerendering||sn()>0?r="prerender":(o=x.document)!=null&&o.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:Ph(),navigationType:r}},rs=new WeakMap;function pi(e,t){return rs.get(e)||rs.set(e,new t),rs.get(e)}class gr{constructor(){gr.prototype.__init.call(this),gr.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var s;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]),(s=this._onAfterProcessingUnexpectedShift)==null||s.call(this,t)}}const on=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{t(s.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},hi=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Pr=e=>{var t;(t=x.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Lh=[1800,3e3],Dh=(e,t={})=>{Pr(()=>{const n=xn(),r=An("FCP");let s;const o=on("paint",c=>{for(const a of c)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<n.firstHiddenTime&&(r.value=Math.max(a.startTime-sn(),0),r.entries.push(a),s(!0)))});o&&(s=Cn(e,r,Lh,t.reportAllChanges))})},Fh=[.1,.25],Bh=(e,t={})=>{Dh(hi(()=>{var a;const n=An("CLS",0);let r;const s=xn(),i=pi(t,gr),o=u=>{for(const d of u)i._processEntry(d);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},c=on("layout-shift",o);c&&(r=Cn(e,n,Fh,t.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),(a=x==null?void 0:x.setTimeout)==null||a.call(x,r))}))};let qc=0,ss=1/0,Wn=0;const $h=e=>{e.forEach(t=>{t.interactionId&&(ss=Math.min(ss,t.interactionId),Wn=Math.max(Wn,t.interactionId),qc=Wn?(Wn-ss)/7+1:0)})};let Rs;const Vc=()=>Rs?qc:performance.interactionCount||0,Uh=()=>{"interactionCount"in performance||Rs||(Rs=on("event",$h,{type:"event",buffered:!0,durationThreshold:0}))},is=10;let Gc=0;const Hh=()=>Vc()-Gc;class _r{constructor(){_r.prototype.__init.call(this),_r.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Gc=Vc(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(Hh()/50));return this._longestInteractionList[t]}_processEntry(t){var s,i;if((s=this._onBeforeProcessingEntry)==null||s.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<is||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((o,c)=>c._latency-o._latency),this._longestInteractionList.length>is){const o=this._longestInteractionList.splice(is);for(const c of o)this._longestInteractionMap.delete(c.id)}(i=this._onAfterProcessingINPCandidate)==null||i.call(this,r)}}}const Yc=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=x.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};bt("visibilitychange",t,!0),bt("pagehide",t,!0)},Kc=e=>{var n;const t=x.requestIdleCallback||x.setTimeout;((n=x.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=hi(e),bt("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),fi("visibilitychange",e,{capture:!0})}),Yc(e))},Wh=[200,500],zh=40,jh=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=xn();Pr(()=>{Uh();const r=An("INP");let s;const i=pi(t,_r),o=a=>{Kc(()=>{for(const d of a)i._processEntry(d);const u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,s())})},c=on("event",o,{durationThreshold:t.durationThreshold??zh});s=Cn(e,r,Wh,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(c.takeRecords()),s(!0)}))})};class qh{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const Vh=[2500,4e3],Gh=(e,t={})=>{Pr(()=>{const n=xn(),r=An("LCP");let s;const i=pi(t,qh),o=a=>{t.reportAllChanges||(a=a.slice(-1));for(const u of a)i._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-sn(),0),r.entries=[u],s())},c=on("largest-contentful-paint",o);if(c){s=Cn(e,r,Vh,t.reportAllChanges);const a=hi(()=>{o(c.takeRecords()),c.disconnect(),s(!0)}),u=d=>{d.isTrusted&&(Kc(a),fi(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])bt(d,u,{capture:!0})}})},Yh=[800,1800],Cs=e=>{var t,n;(t=x.document)!=null&&t.prerendering?Pr(()=>Cs(e)):((n=x.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>Cs(e),!0):setTimeout(e)},Kh=(e,t={})=>{const n=An("TTFB"),r=Cn(e,n,Yh,t.reportAllChanges);Cs(()=>{const s=Mn();s&&(n.value=Math.max(s.responseStart-sn(),0),n.entries=[s],r(!0))})},un={},Sr={};let Xc,Jc,Qc,Zc;function mi(e,t=!1){return Lr("cls",e,Jh,Xc,t)}function gi(e,t=!1){return Lr("lcp",e,Qh,Jc,t)}function Xh(e){return Lr("ttfb",e,Zh,Qc)}function eu(e){return Lr("inp",e,em,Zc)}function kt(e,t){return tu(e,t),Sr[e]||(tm(e),Sr[e]=!0),nu(e,t)}function Nn(e,t){const n=un[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(s){wt&&m.error(`Error while triggering instrumentation handler.
18
18
  Type: ${e}
19
19
  Name: ${Ke(r)}
20
- Error:`,s)}}function Xh(){return Fh(e=>{Nn("cls",{metric:e}),Kc=e},{reportAllChanges:!0})}function Jh(){return Vh(e=>{Nn("lcp",{metric:e}),Xc=e},{reportAllChanges:!0})}function Qh(){return Yh(e=>{Nn("ttfb",{metric:e}),Jc=e})}function Zh(){return zh(e=>{Nn("inp",{metric:e}),Qc=e})}function Lr(e,t,n,r,s=!1){eu(e,t);let i;return Sr[e]||(i=n(),Sr[e]=!0),r&&t({metric:r}),tu(e,t,s?i:void 0)}function em(e){const t={};e==="event"&&(t.durationThreshold=0),on(e,n=>{Nn(e,{entries:n})},t)}function eu(e,t){un[e]=un[e]||[],un[e].push(t)}function tu(e,t,n){return()=>{n&&n();const r=un[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function tm(e){return"duration"in e}function os(e){return typeof e=="number"&&isFinite(e)}function ot(e,t,n,{...r}){const s=U(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),ti(e,()=>{const i=rn({startTime:t,...r});return i&&i.end(n),i})}function _i(e){var _;const t=H();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:c,sendDefaultPii:a}=t.getOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),l=G(),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 g={release:o,environment:c,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(_=x.navigator)==null?void 0:_.userAgent,"client.address":a?"{{auto}}":void 0,...s};return rn({name:n,attributes:g,startTime:i,experimental:{standalone:!0}})}function On(){return x.addEventListener&&x.performance}function oe(e){return e/1e3}function nm(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function nu(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function ru(e,t){let n,r=!1;function s(c){!r&&n&&t(c,n),r=!0}Gc(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(c,a)=>{a!=null&&a.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",c=>{n=c.spanContext().spanId,o()})}function rm(e){let t=0,n;if(!nu("layout-shift"))return;const r=mi(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);ru(e,(s,i)=>{sm(t,n,i,s),r()})}function sm(e,t,n,r){var u;wt&&m.log(`Sending CLS span (${e})`);const s=t?oe((he()||0)+t.startTime):ie(),i=G().getScopeData().transactionName,o=t?Ee((u=t.sources[0])==null?void 0:u.node):"Layout shift",c={[ae]:"auto.http.browser.cls",[Ue]:"ui.webvital.cls",[nn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,l)=>{c[`cls.source.${l+1}`]=Ee(d.node)});const a=_i({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("cls",{[kn]:"",[Rn]:e}),a.end(s))}function im(e){let t=0,n;if(!nu("largest-contentful-paint"))return;const r=gi(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);ru(e,(s,i)=>{om(t,n,i,s),r()})}function om(e,t,n,r){wt&&m.log(`Sending LCP span (${e})`);const s=oe((he()||0)+((t==null?void 0:t.startTime)||0)),i=G().getScopeData().transactionName,o=t?Ee(t.element):"Largest contentful paint",c={[ae]:"auto.http.browser.lcp",[Ue]:"ui.webvital.lcp",[nn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=Ee(t.element)),t.id&&(c["lcp.id"]=t.id),t.url&&(c["lcp.url"]=t.url),t.loadTime!=null&&(c["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(c["lcp.renderTime"]=t.renderTime),t.size!=null&&(c["lcp.size"]=t.size));const a=_i({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("lcp",{[kn]:"millisecond",[Rn]:e}),a.end(s))}function ke(e){return e&&((he()||performance.timeOrigin)+e)/1e3}function su(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:s}=nm(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=r}return he()||(n=On())!=null&&n.timeOrigin?am({...t,"http.request.redirect_start":ke(e.redirectStart),"http.request.redirect_end":ke(e.redirectEnd),"http.request.worker_start":ke(e.workerStart),"http.request.fetch_start":ke(e.fetchStart),"http.request.domain_lookup_start":ke(e.domainLookupStart),"http.request.domain_lookup_end":ke(e.domainLookupEnd),"http.request.connect_start":ke(e.connectStart),"http.request.secure_connection_start":ke(e.secureConnectionStart),"http.request.connection_end":ke(e.connectEnd),"http.request.request_start":ke(e.requestStart),"http.request.response_start":ke(e.responseStart),"http.request.response_end":ke(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function am(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const cm=2147483647;let Do=0,Le={},Se,Dt;function um({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=On();if(r&&he()){r.mark&&x.performance.mark("sentry-tracing-init");const s=t?im(n):hm(),i=mm(),o=e?rm(n):pm();return()=>{s==null||s(),i(),o==null||o()}}return()=>{}}function lm(){kt("longtask",({entries:e})=>{const t=pe();if(!t)return;const{op:n,start_timestamp:r}=U(t);for(const s of e){const i=oe(he()+s.startTime),o=oe(s.duration);n==="navigation"&&r&&i<r||ot(t,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[ae]:"auto.ui.browser.metrics"}})}})}function dm(){new PerformanceObserver(t=>{const n=pe();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=oe(he()+r.startTime),{start_timestamp:i,op:o}=U(n);if(o==="navigation"&&i&&s<i)continue;const c=oe(r.duration),a={[ae]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:l,sourceURL:f,sourceFunctionName:p,sourceCharPosition:h}=u;a["browser.script.invoker"]=d,a["browser.script.invoker_type"]=l,f&&(a["code.filepath"]=f),p&&(a["code.function"]=p),h!==-1&&(a["browser.script.source_char_position"]=h),ot(n,s,s+c,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:a})}}).observe({type:"long-animation-frame",buffered:!0})}function fm(){kt("event",({entries:e})=>{const t=pe();if(t){for(const n of e)if(n.name==="click"){const r=oe(he()+n.startTime),s=oe(n.duration),i={name:Ee(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[ae]:"auto.ui.browser.metrics"}},o=La(n.target);o&&(i.attributes["ui.component_name"]=o),ot(t,r,r+s,i)}}})}function pm(){return mi(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Le.cls={value:e.value,unit:""},Dt=t)},!0)}function hm(){return gi(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Le.lcp={value:e.value,unit:"millisecond"},Se=t)},!0)}function mm(){return Kh(({metric:e})=>{e.entries[e.entries.length-1]&&(Le.ttfb={value:e.value,unit:"millisecond"})})}function gm(e,t){const n=On(),r=he();if(!(n!=null&&n.getEntries)||!r)return;const s=oe(r),i=n.getEntries(),{op:o,start_timestamp:c}=U(e);i.slice(Do).forEach(a=>{const u=oe(a.startTime),d=oe(Math.max(0,a.duration));if(!(o==="navigation"&&c&&s+u<c))switch(a.entryType){case"navigation":{Em(e,a,s);break}case"mark":case"paint":case"measure":{Sm(e,a,u,d,s,t.ignorePerformanceApiSpans);const l=xn(),f=a.startTime<l.firstHiddenTime;a.name==="first-paint"&&f&&(Le.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&f&&(Le.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{vm(e,a,a.name,u,d,s,t.ignoreResourceSpans);break}}}),Do=Math.max(i.length-1,0),Im(e),o==="pageload"&&(Rm(Le),t.recordClsOnPageloadSpan||delete Le.cls,t.recordLcpOnPageloadSpan||delete Le.lcp,Object.entries(Le).forEach(([a,u])=>{Kd(a,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",s),e.setAttribute("performance.activationStart",sn()),wm(e,t)),Se=void 0,Dt=void 0,Le={}}function _m(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Sm(e,t,n,r,s,i){if(_m(t)||["mark","measure"].includes(t.entryType)&&Ve(t.name,i))return;const o=Mn(!1),c=oe(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,d=u+r,l={[ae]:"auto.resource.browser.metrics"};a!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=a),ym(l,t),a<=d&&ot(e,a,d,{name:t.name,op:t.entryType,attributes:l})}function ym(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&vt(s))e[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(vt(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Em(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{zn(e,t,r,n)}),zn(e,t,"secureConnection",n,"TLS/SSL"),zn(e,t,"fetch",n,"cache"),zn(e,t,"domainLookup",n,"DNS"),Tm(e,t,n)}function zn(e,t,n,r,s=n){const i=bm(n),o=t[i],c=t[`${n}Start`];!c||!o||ot(e,r+oe(c),r+oe(o),{op:`browser.${s}`,name:t.name,attributes:{[ae]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function bm(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Tm(e,t,n){const r=n+oe(t.requestStart),s=n+oe(t.responseEnd),i=n+oe(t.responseStart);t.responseEnd&&(ot(e,r,s,{op:"browser.request",name:t.name,attributes:{[ae]:"auto.ui.browser.metrics"}}),ot(e,i,s,{op:"browser.response",name:t.name,attributes:{[ae]:"auto.ui.browser.metrics"}}))}function vm(e,t,n,r,s,i,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const c=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o!=null&&o.includes(c))return;const a={[ae]:"auto.resource.browser.metrics"},u=Et(n);u.protocol&&(a["url.scheme"]=u.protocol.split(":").pop()),u.host&&(a["server.address"]=u.host),a["url.same_origin"]=n.includes(x.location.origin),km(t,a,[["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={...a,...su(t)},l=i+r,f=l+s;ot(e,l,f,{name:n.replace(x.location.origin,""),op:c,attributes:d})}function Im(e){const t=x.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),os(n.rtt)&&(Le["connection.rtt"]={value:n.rtt,unit:"millisecond"})),os(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),os(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function wm(e,t){Se&&t.recordLcpOnPageloadSpan&&(Se.element&&e.setAttribute("lcp.element",Ee(Se.element)),Se.id&&e.setAttribute("lcp.id",Se.id),Se.url&&e.setAttribute("lcp.url",Se.url.trim().slice(0,200)),Se.loadTime!=null&&e.setAttribute("lcp.loadTime",Se.loadTime),Se.renderTime!=null&&e.setAttribute("lcp.renderTime",Se.renderTime),e.setAttribute("lcp.size",Se.size)),Dt!=null&&Dt.sources&&t.recordClsOnPageloadSpan&&Dt.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ee(n.node)))}function km(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i<cm||typeof i=="string")&&(t[s]=i)})}function Rm(e){const t=Mn(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function Cm(){return On()&&he()?kt("element",Mm):()=>{}}const Mm=({entries:e})=>{const t=pe(),n=t?le(t):void 0,r=n?U(n).description:G().getScopeData().transactionName;e.forEach(s=>{var p,h;const i=s;if(!i.identifier)return;const o=i.name,c=i.renderTime,a=i.loadTime,[u,d]=a?[oe(a),"load-time"]:c?[oe(c),"render-time"]:[ie(),"entry-emission"],l=o==="image-paint"?oe(Math.max(0,(c??0)-(a??0))):0,f={[ae]:"auto.ui.browser.elementtiming",[Ue]:"ui.elementtiming",[xe]:"component","sentry.span_start_time_source":d,"sentry.transaction_name":r,"element.id":i.id,"element.type":((h=(p=i.element)==null?void 0:p.tagName)==null?void 0:h.toLowerCase())||"unknown","element.size":i.naturalWidth&&i.naturalHeight?`${i.naturalWidth}x${i.naturalHeight}`:void 0,"element.render_time":c,"element.load_time":a,"element.url":i.url||void 0,"element.identifier":i.identifier,"element.paint_type":o};tf({name:`element[${i.identifier}]`,attributes:f,startTime:u,onlyIfParent:!0},g=>{g.end(u+l)})})},xm=1e3;let Fo,Ms,xs;function iu(e){const t="dom";ct(t,e),ut(t,Am)}function Am(){if(!x.document)return;const e=Ae.bind(null,"dom"),t=Bo(e,!0);x.document.addEventListener("click",t,!1),x.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var i,o;const s=(i=x[n])==null?void 0:i.prototype;(o=s==null?void 0:s.hasOwnProperty)!=null&&o.call(s,"addEventListener")&&(ye(s,"addEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=l[a]=l[a]||{refCount:0};if(!f.handler){const p=Bo(e);f.handler=p,c.call(this,a,p,d)}f.refCount++}catch{}return c.call(this,a,u,d)}}),ye(s,"removeEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},f=l[a];f&&(f.refCount--,f.refCount<=0&&(c.call(this,a,f.handler,d),f.handler=void 0,delete l[a]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return c.call(this,a,u,d)}}))})}function Nm(e){if(e.type!==Ms)return!1;try{if(!e.target||e.target._sentryId!==xs)return!1}catch{}return!0}function Om(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Bo(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Pm(n);if(Om(n.type,r))return;Ie(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ie(r,"_sentryId",fe());const s=n.type==="keypress"?"input":n.type;Nm(n)||(e({event:n,name:s,global:t}),Ms=n.type,xs=r?r._sentryId:void 0),clearTimeout(Fo),Fo=x.setTimeout(()=>{xs=void 0,Ms=void 0},xm)}}function Pm(e){try{return e.target}catch{return null}}let jn;function Dr(e){const t="history";ct(t,e),ut(t,Lm)}function Lm(){if(x.addEventListener("popstate",()=>{const t=x.location.href,n=jn;if(jn=t,n===t)return;Ae("history",{from:n,to:t})}),!sh())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=jn,i=Dm(String(r));if(jn=i,s===i)return t.apply(this,n);Ae("history",{from:s,to:i})}return t.apply(this,n)}}ye(x.history,"pushState",e),ye(x.history,"replaceState",e)}function Dm(e){try{return new URL(e,x.location.origin).toString()}catch{return e}}const sr={};function Si(e){const t=sr[e];if(t)return t;let n=x[e];if(Ts(n))return sr[e]=n.bind(x);const r=x.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i!=null&&i[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){wt&&m.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(sr[e]=n.bind(x))}function Fm(e){sr[e]=void 0}function Pn(...e){return Si("setTimeout")(...e)}const ht="__sentry_xhr_v3__";function ou(e){const t="xhr";ct(t,e),ut(t,Bm)}function Bm(){if(!x.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=ie()*1e3,o=qe(r[0])?r[0].toUpperCase():void 0,c=$m(r[1]);if(!o||!c)return t.apply(n,r);n[ht]={method:o,url:c,request_headers:{}},o==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const u=n[ht];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:ie()*1e3,startTimestamp:i,xhr:n,virtualError:s};Ae("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return a(),u.apply(d,l)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[ht];return h&&qe(f)&&qe(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 s=n[ht];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:ie()*1e3,xhr:n};return Ae("xhr",i),t.apply(n,r)}})}function $m(e){if(qe(e))return e;try{return e.toString()}catch{}}function au(e){return new URLSearchParams(e).toString()}function cu(e,t=m){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[au(e)];if(!e)return[void 0]}catch(n){return wt&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return wt&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function uu(e=[]){if(!(e.length!==2||typeof e[1]!="object"))return e[1].body}function lu(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return wt&&m.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
21
- `).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const as=[],ir=new Map,Nt=new Map,Um=60;function Hm(){if(On()&&he()){const t=Wm();return()=>{t()}}return()=>{}}const As={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 Wm(){return Zc(zm)}const zm=({metric:e})=>{if(e.value==null)return;const t=oe(e.value);if(t>Um)return;const n=e.entries.find(h=>h.duration===e.value&&As[h.name]);if(!n)return;const{interactionId:r}=n,s=As[n.name],i=oe(he()+n.startTime),o=pe(),c=o?le(o):void 0,a=r!=null?ir.get(r):void 0,u=(a==null?void 0:a.span)||c,d=u?U(u).description:G().getScopeData().transactionName,l=(a==null?void 0:a.elementName)||Ee(n.target),f={[ae]:"auto.http.browser.inp",[Ue]:`ui.interaction.${s}`,[nn]:n.duration},p=_i({name:l,transaction:d,attributes:f,startTime:i});p&&(p.addEvent("inp",{[kn]:"millisecond",[Rn]:e.value}),p.end(i+t))};function jm(){const e=Object.keys(As);Is()&&e.forEach(s=>{x.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=Ee(i),c=Math.round(s.timeStamp);if(Nt.set(c,o),Nt.size>50){const a=Nt.keys().next().value;a!==void 0&&Nt.delete(a)}}function n(s){const i=Math.round(s.startTime);let o=Nt.get(i);if(!o)for(let c=-5;c<=5;c++){const a=Nt.get(i+c);if(a){o=a;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=pe(),o=i&&le(i);s.forEach(c=>{if(!tm(c))return;const a=c.interactionId;if(a==null||ir.has(a))return;const u=c.target?Ee(c.target):n(c);if(as.length>10){const d=as.shift();ir.delete(d)}as.push(a),ir.set(a,{span:o,elementName:u})})};kt("event",r),kt("first-input",r)}const qm=40;function yi(e,t=Si("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const c={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const a=await t(e.url,c);return{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}}catch(a){throw Fm("fetch"),a}finally{n-=o,r--}}return up(e,s,Cc(e.bufferSize||qm))}const Vm=30,Gm=50;function Ns(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?Tt:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const Ym=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Km=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Xm=/\((\S*)(?::(\d+))(?::(\d+))\)/,Jm=/at (.+?) ?\(data:(.+?),/,Qm=e=>{const t=e.match(Jm);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=Ym.exec(e);if(n){const[,s,i,o]=n;return Ns(s,Tt,+i,+o)}const r=Km.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const c=Xm.exec(r[2]);c&&(r[2]=c[1],r[3]=c[2],r[4]=c[3])}const[i,o]=du(r[1]||Tt,r[2]);return Ns(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Zm=[Vm,Qm],eg=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tg=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ng=e=>{const t=eg.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=tg.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||Tt;return[s,r]=du(s,r),Ns(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},rg=[Gm,ng],sg=[Zm,rg],ig=Ra(...sg),du=(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]:Tt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},I=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,qn=1024,og="Breadcrumbs",ag=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:og,setup(n){t.console&&Pc(dg(n)),t.dom&&iu(lg(n,t.dom)),t.xhr&&ou(fg(n)),t.fetch&&$c(pg(n)),t.history&&Dr(hg(n)),t.sentry&&n.on("beforeSendEvent",ug(n))}}},cg=ag;function ug(e){return function(n){H()===e&&it({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:pt(n)},{event:n})}}function lg(e,t){return function(r){if(H()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,c=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;c&&c>qn&&(I&&m.warn(`\`dom.maxStringLength\` cannot exceed ${qn}, but a value of ${c} was configured. Sentry will use ${qn} instead.`),c=qn),typeof o=="string"&&(o=[o]);try{const u=r.event,d=mg(u)?u.target:u;s=Ee(d,{keyAttrs:o,maxStringLength:c}),i=La(d)}catch{s="<unknown>"}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};i&&(a.data={"ui.component_name":i}),it(a,{event:r.event,name:r.name,global:r.global})}}function dg(e){return function(n){if(H()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Lc(n.level),message:Gi(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Gi(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;it(r,{input:n.args,level:n.level})}}function fg(e){return function(n){if(H()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[ht];if(!r||!s||!i)return;const{method:o,url:c,status_code:a,body:u}=i,d={method:o,url:c,status_code:a},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:Bc(a)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),it(f,l)}}function pg(e){return function(n){if(H()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const i=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:i,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",c,o),it(c,o)}else{const i=n.response,o={...n.fetchData,status_code:i==null?void 0:i.status};n.fetchData.request_body_size,n.fetchData.response_body_size,i==null||i.status;const c={input:n.args,response:i,startTimestamp:r,endTimestamp:s},a={category:"fetch",data:o,type:"http",level:Bc(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,c),it(a,c)}}}function hg(e){return function(n){if(H()!==e)return;let r=n.from,s=n.to;const i=Et(D.location.href);let o=r?Et(r):void 0;const c=Et(s);o!=null&&o.path||(o=i),i.protocol===c.protocol&&i.host===c.host&&(s=c.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),it({category:"navigation",data:{from:r,to:s}})}}function mg(e){return!!e&&!!e.target}const gg=["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"],_g="BrowserApiErrors",Sg=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:_g,setupOnce(){t.setTimeout&&ye(D,"setTimeout",$o),t.setInterval&&ye(D,"setInterval",$o),t.requestAnimationFrame&&ye(D,"requestAnimationFrame",Eg),t.XMLHttpRequest&&"XMLHttpRequest"in D&&ye(XMLHttpRequest.prototype,"send",bg);const n=t.eventTarget;n&&(Array.isArray(n)?n:gg).forEach(s=>Tg(s,t))}}},yg=Sg;function $o(e){return function(...t){const n=t[0];return t[0]=Vt(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Ke(e)}`}}),e.apply(this,t)}}function Eg(e){return function(t){return e.apply(this,[Vt(t,{mechanism:{data:{handler:Ke(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function bg(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&ye(n,s,function(i){const o={mechanism:{data:{handler:Ke(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=Ys(i);return c&&(o.mechanism.data.handler=Ke(c)),Vt(i,o)})}),e.apply(this,t)}}function Tg(e,t){var s,i;const r=(s=D[e])==null?void 0:s.prototype;(i=r==null?void 0:r.hasOwnProperty)!=null&&i.call(r,"addEventListener")&&(ye(r,"addEventListener",function(o){return function(c,a,u){try{vg(a)&&(a.handleEvent=Vt(a.handleEvent,{mechanism:{data:{handler:Ke(a),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&Ig(this,c,a),o.apply(this,[c,Vt(a,{mechanism:{data:{handler:Ke(a),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),ye(r,"removeEventListener",function(o){return function(c,a,u){try{const d=a.__sentry_wrapped__;d&&o.call(this,c,d,u)}catch{}return o.call(this,c,a,u)}}))}function vg(e){return typeof e.handleEvent=="function"}function Ig(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const wg=()=>({name:"BrowserSession",setupOnce(){if(typeof D.document>"u"){I&&m.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}mo({ignoreDuration:!0}),go(),Dr(({from:e,to:t})=>{e!==void 0&&e!==t&&(mo({ignoreDuration:!0}),go())})}}),kg="GlobalHandlers",Rg=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:kg,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(Mg(n),Uo("onerror")),t.onunhandledrejection&&(xg(n),Uo("onunhandledrejection"))}}},Cg=Rg;function Mg(e){Ma(t=>{const{stackParser:n,attachStacktrace:r}=fu();if(H()!==e||Hc())return;const{msg:s,url:i,line:o,column:c,error:a}=t,u=Og(di(n,a||s,void 0,r,!1),i,o,c);u.level="error",hc(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function xg(e){xa(t=>{const{stackParser:n,attachStacktrace:r}=fu();if(H()!==e||Hc())return;const s=Ag(t),i=vt(s)?Ng(s):di(n,s,void 0,r,!0);i.level="error",hc(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Ag(e){if(vt(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 Ng(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Og(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},c=o.stacktrace=o.stacktrace||{},a=c.frames=c.frames||[],u=r,d=n,l=Pg(t)??en();return a.length===0&&a.push({colno:u,filename:l,function:Tt,in_app:!0,lineno:d}),e}function Uo(e){I&&m.log(`Global Handler attached: ${e}`)}function fu(){const e=H();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function Pg(e){if(!(!qe(e)||e.length===0)){if(e.startsWith("data:")){const t=e.match(/^data:([^;]+)/),n=t?t[1]:"text/javascript",r=e.includes("base64,");return`<data:${n}${r?",base64":""}>`}return e}}const Lg=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!D.navigator&&!D.location&&!D.document)return;const t=ci(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),Dg="cause",Fg=5,Bg="LinkedErrors",$g=(e={})=>{const t=e.limit||Fg,n=e.key||Dg;return{name:Bg,preprocessEvent(r,s,i){const o=i.getOptions();Fp(ui,o.stackParser,n,t,r,s)}}},Ug=$g,Hg="SpotlightBrowser",Wg=(e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:Hg,setup:()=>{I&&m.log("Using Sidecar URL",t)},processEvent:n=>qg(n)?null:n,afterAllSetup:n=>{zg(n,t)}}};function zg(e,t){const n=Si("fetch");let r=0;e.on("beforeEnvelope",s=>{if(r>3){m.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:pr(s),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,m.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}const jg=Wg;function qg(e){var t;return!!(e.type==="transaction"&&e.spans&&((t=e.contexts)!=null&&t.trace)&&e.contexts.trace.op==="ui.action.click"&&e.spans.some(({description:n})=>n==null?void 0:n.includes("#sentry-spotlight")))}function Vg(){return Gg()?(I&&at(()=>{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 Gg(){var i;if(typeof D.window>"u")return!1;const e=D;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((i=t==null?void 0:t.runtime)!=null&&i.id))return!1;const n=en(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(D===D.top&&r.some(o=>n.startsWith(`${o}://`)))}function Yg(e){return[Mp(),wp(),yg(),cg(),Cg(),Ug(),Hp(),Lg(),wg()]}function Kg(e={}){const t=!e.skipBrowserExtensionCheck&&Vg();let n=e.defaultIntegrations==null?Yg():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Cl(e.stackParser||ig),integrations:Df({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||yi};return sp(Ch,r)}const te=L,Ei="sentryReplaySession",Xg="replay_event",bi="Unable to send Replay",Jg=3e5,Qg=9e5,Zg=5e3,e_=5500,t_=6e4,n_=5e3,r_=3,Ho=15e4,Vn=5e3,s_=3e3,i_=300,Ti=2e7,o_=4999,a_=5e4,Wo=36e5;var c_=Object.defineProperty,u_=(e,t,n)=>t in e?c_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zo=(e,t,n)=>u_(e,typeof t!="symbol"?t+"":t,n),ue=(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))(ue||{});function l_(e){return e.nodeType===e.ELEMENT_NODE}function ln(e){const t=e==null?void 0:e.host;return(t==null?void 0:t.shadowRoot)===e}function dn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function d_(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 f_(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 yr(e){try{const t=e.rules||e.cssRules;return t?d_(Array.from(t,pu).join("")):null}catch{return null}}function p_(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],i=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function pu(e){let t;if(m_(e))try{t=yr(e.styleSheet)||f_(e)}catch{}else if(g_(e)){let n=e.cssText;const r=e.selectorText.includes(":"),s=typeof e.style.all=="string"&&e.style.all;if(s&&(n=p_(e)),r&&(n=h_(n)),r||s)return n}return t||e.cssText}function h_(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function m_(e){return"styleSheet"in e}function g_(e){return"selectorText"in e}class hu{constructor(){zo(this,"idNodeMap",new Map),zo(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 s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function __(){return new hu}function Fr({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 Sn({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function Gt(e){return e.toLowerCase()}function Os(e){return e.toUpperCase()}const jo="__rrweb_original__";function S_(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let s=0;s<e.height;s+=n){const i=t.getImageData,o=jo in i?i[jo]:i;if(new Uint32Array(o.call(t,r,s,Math.min(n,e.width-r),Math.min(n,e.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function vi(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Gt(t):null}function Er(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function mu(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return(s==null?void 0:s[1])??null}const qo={};function gu(e){const t=qo[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return qo[e]=r.bind(window)}function Ps(...e){return gu("setTimeout")(...e)}function _u(...e){return gu("clearTimeout")(...e)}function Su(e){try{return e.contentDocument}catch{}}let y_=1;const E_=new RegExp("[^a-z0-9-_:]"),yn=-2;function Ii(){return y_++}function b_(e){if(e instanceof HTMLFormElement)return"form";const t=Gt(e.tagName);return E_.test(t)?"div":t}function T_(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let Ot,Vo;const v_=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,I_=/^(?:[a-z+]+:)?\/\//i,w_=/^www\..*/i,k_=/^(data:)([^,]*),(.*)/i;function R_(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let s of n){if(s=s.trim(),!s)continue;const i=s.indexOf(":");if(i===-1){r.push(s);continue}const o=s.slice(0,i).trim();t.has(o)||r.push(s)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function br(e,t){return(e||"").replace(v_,(n,r,s,i,o,c)=>{const a=s||o||c,u=r||i||"";if(!a)return n;if(I_.test(a)||w_.test(a))return`url(${u}${a}${u})`;if(k_.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${T_(t)+a}${u})`;const d=t.split("/"),l=a.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const C_=/^[^ \t\n\r\u000c]+/,M_=/^[, \t\n\r\u000c]+/;function x_(e,t){if(t.trim()==="")return t;let n=0;function r(i){let o;const c=i.exec(t.substring(n));return c?(o=c[0],n+=o.length,o):""}const s=[];for(;r(M_),!(n>=t.length);){let i=r(C_);if(i.slice(-1)===",")i=Ft(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=Ft(e,i);let c=!1;for(;;){const a=t.charAt(n);if(a===""){s.push((i+o).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){n+=1,s.push((i+o).trim());break}else a==="("&&(c=!0);o+=a,n+=1}}}return s.join(", ")}const Go=new WeakMap;function Ft(e,t){return!t||t.trim()===""?t:Br(e,t)}function A_(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Br(e,t){let n=Go.get(e);if(n||(n=e.createElement("a"),Go.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function yu(e,t,n,r,s,i,o){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Ft(e,r);if(n==="xlink:href"&&r[0]!=="#")return Ft(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Ft(e,r);if(n==="srcset")return x_(e,r);if(n==="style"){let c=br(r,Br(e));return o&&o.size>0&&(c=R_(c,o)),c}else if(t==="object"&&n==="data")return Ft(e,r);return typeof i=="function"?i(n,r,s):r}function Eu(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function N_(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 s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function O_(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function mt(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:mt(e.parentNode,t,n,r+1)}function Bt(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(O_(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Yt(e,t,n,r,s,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let c=-1,a=-1;if(i){if(a=mt(o,Bt(r,s)),a<0)return!0;c=mt(o,Bt(t,n),a>=0?a:1/0)}else{if(c=mt(o,Bt(t,n)),c<0)return!1;a=mt(o,Bt(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function P_(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const c=Ps(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{_u(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return Ps(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function L_(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=Ps(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{_u(i),r=!0,t()})}function D_(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:g,maskInputFn:_,dataURLOptions:E={},inlineImages:T,recordCanvas:F,keepIframeSrcFn:B,newlyAddedElement:q=!1,ignoreCSSAttributes:N}=t,S=F_(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ue.Document,childNodes:[],compatMode:e.compatMode}:{type:ue.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ue.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return $_(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:h,maskInputFn:_,dataURLOptions:E,inlineImages:T,recordCanvas:F,keepIframeSrcFn:B,newlyAddedElement:q,rootId:S,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:N});case e.TEXT_NODE:return B_(e,{doc:n,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:g,maskInputOptions:h,maskInputFn:_,rootId:S});case e.CDATA_SECTION_NODE:return{type:ue.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:ue.Comment,textContent:e.textContent||"",rootId:S};default:return!1}}function F_(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function B_(e,t){var E;const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,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,g=l==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||(E=e.parentNode.sheet)!=null&&E.cssRules&&(f=yr(e.parentNode.sheet))}catch(T){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${T}`,e)}f=br(f,Br(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const _=Yt(e,r,i,s,o,n);if(!p&&!h&&!g&&f&&_&&(f=c?c(f,e.parentElement):f.replace(/[\S]/g,"*")),g&&f&&(a.textarea||_)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),l==="OPTION"&&f){const T=Fr({type:null,tagName:l,maskInputOptions:a});f=Sn({isMasked:Yt(e,r,i,s,o,T),element:e,value:f,maskInputFn:u})}return{type:ue.Text,textContent:f||"",isStyle:p,rootId:d}}function $_(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:g,maskTextClass:_,unmaskTextClass:E,maskTextSelector:T,unmaskTextSelector:F,ignoreCSSAttributes:B}=t,q=N_(e,r,s,i),N=b_(e);let S={};const k=e.attributes.length;for(let y=0;y<k;y++){const w=e.attributes[y];w.name&&!Eu(N,w.name,w.value)&&(S[w.name]=yu(n,N,Gt(w.name),w.value,e,a,B))}if(N==="link"&&o){const y=Array.from(n.styleSheets).find(P=>P.href===e.href);let w=null;y&&(w=yr(y)),w&&(S.rel=null,S.href=null,S.crossorigin=null,S._cssText=br(w,y.href))}if(N==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const y=yr(e.sheet);y&&(S._cssText=br(y,Br(n)))}if(N==="input"||N==="textarea"||N==="select"||N==="option"){const y=e,w=vi(y),P=Er(y,Os(N),w),j=y.checked;if(w!=="submit"&&w!=="button"&&P){const O=Yt(y,_,T,E,F,Fr({type:w,tagName:Os(N),maskInputOptions:c}));S.value=Sn({isMasked:O,element:y,value:P,maskInputFn:u})}j&&(S.checked=j)}if(N==="option"&&(e.selected&&!c.select?S.selected=!0:delete S.selected),N==="canvas"&&f){if(e.__context==="2d")S_(e)||(S.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const y=e.toDataURL(d.type,d.quality),w=n.createElement("canvas");w.width=e.width,w.height=e.height;const P=w.toDataURL(d.type,d.quality);y!==P&&(S.rr_dataURL=y)}}if(N==="img"&&l){Ot||(Ot=n.createElement("canvas"),Vo=Ot.getContext("2d"));const y=e,w=y.currentSrc||y.getAttribute("src")||"<unknown-src>",P=y.crossOrigin,j=()=>{y.removeEventListener("load",j);try{Ot.width=y.naturalWidth,Ot.height=y.naturalHeight,Vo.drawImage(y,0,0),S.rr_dataURL=Ot.toDataURL(d.type,d.quality)}catch(O){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?j():y.addEventListener("load",j);return}else console.warn(`Cannot inline img src=${w}! Error: ${O}`)}y.crossOrigin==="anonymous"&&(P?S.crossOrigin=P:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?j():y.addEventListener("load",j)}if((N==="audio"||N==="video")&&(S.rr_mediaState=e.paused?"paused":"played",S.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop)),q){const{width:y,height:w}=e.getBoundingClientRect();S={class:S.class,rr_width:`${y}px`,rr_height:`${w}px`}}N==="iframe"&&!p(S.src)&&(!q&&!Su(e)&&(S.rr_src=S.src),delete S.src);let J;try{customElements.get(N)&&(J=!0)}catch{}return{type:ue.Element,tagName:N,attributes:S,childNodes:[],isSVG:A_(e)||void 0,needBlock:q,rootId:g,isCustom:J}}function ee(e){return e==null?"":e.toLowerCase()}function U_(e,t){if(t.comment&&e.type===ue.Comment)return!0;if(e.type===ue.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"&&mu(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ee(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ee(e.attributes.name)==="application-name"||ee(e.attributes.rel)==="icon"||ee(e.attributes.rel)==="apple-touch-icon"||ee(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ee(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ee(e.attributes.property).match(/^(og|twitter|fb):/)||ee(e.attributes.name).match(/^(og|twitter):/)||ee(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ee(e.attributes.name)==="robots"||ee(e.attributes.name)==="googlebot"||ee(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ee(e.attributes.name)==="author"||ee(e.attributes.name)==="generator"||ee(e.attributes.name)==="framework"||ee(e.attributes.name)==="publisher"||ee(e.attributes.name)==="progid"||ee(e.attributes.property).match(/^article:/)||ee(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ee(e.attributes.name)==="google-site-verification"||ee(e.attributes.name)==="yandex-verification"||ee(e.attributes.name)==="csrf-token"||ee(e.attributes.name)==="p:domain_verify"||ee(e.attributes.name)==="verify-v1"||ee(e.attributes.name)==="verification"||ee(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function $t(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:g,maskTextFn:_,maskInputFn:E,slimDOMOptions:T,dataURLOptions:F={},inlineImages:B=!1,recordCanvas:q=!1,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:k=5e3,onBlockedImageLoad:J,onStylesheetLoad:y,stylesheetLoadTimeout:w=5e3,keepIframeSrcFn:P=()=>!1,newlyAddedElement:j=!1,ignoreCSSAttributes:O}=t;let{preserveWhiteSpace:ce=!0}=t;const Q=D_(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:E,dataURLOptions:F,inlineImages:B,recordCanvas:q,keepIframeSrcFn:P,newlyAddedElement:j,ignoreCSSAttributes:O});if(!Q)return console.warn(e,"not serialized"),null;let ne;r.hasNode(e)?ne=r.getId(e):U_(Q,T)||!ce&&Q.type===ue.Text&&!Q.isStyle&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?ne=yn:ne=Ii();const b=Object.assign(Q,{id:ne});if(r.add(e,b),ne===yn)return null;N&&N(e);let Y=!f;if(b.type===ue.Element){Y=Y&&!b.needBlock;const R=e.shadowRoot;R&&dn(R)&&(b.isShadowHost=!0)}if((b.type===ue.Document||b.type===ue.Element)&&Y){T.headWhitespace&&b.type===ue.Element&&b.tagName==="head"&&(ce=!1);const R={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:E,slimDOMOptions:T,dataURLOptions:F,inlineImages:B,recordCanvas:q,preserveWhiteSpace:ce,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:k,onBlockedImageLoad:J,onStylesheetLoad:y,stylesheetLoadTimeout:w,keepIframeSrcFn:P,ignoreCSSAttributes:O},K=e.childNodes?Array.from(e.childNodes):[];for(const Z of K){const re=$t(Z,R);re&&b.childNodes.push(re)}if(l_(e)&&e.shadowRoot)for(const Z of Array.from(e.shadowRoot.childNodes)){const re=$t(Z,R);re&&(dn(e.shadowRoot)&&(re.isShadow=!0),b.childNodes.push(re))}}if(e.parentNode&&ln(e.parentNode)&&dn(e.parentNode)&&(b.isShadow=!0),b.type===ue.Element&&b.tagName==="iframe"&&!b.needBlock&&P_(e,()=>{const R=Su(e);if(R&&S){const K=$t(R,{doc:R,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:E,slimDOMOptions:T,dataURLOptions:F,inlineImages:B,recordCanvas:q,preserveWhiteSpace:ce,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:y,stylesheetLoadTimeout:w,keepIframeSrcFn:P,ignoreCSSAttributes:O});K&&S(e,K)}},k),b.type===ue.Element&&b.tagName==="img"&&!e.complete&&b.needBlock){const R=e,K=()=>{if(R.isConnected&&!R.complete&&J)try{const Z=R.getBoundingClientRect();Z.width>0&&Z.height>0&&J(R,b,Z)}catch{}R.removeEventListener("load",K)};R.isConnected&&R.addEventListener("load",K)}return b.type===ue.Element&&b.tagName==="link"&&typeof b.attributes.rel=="string"&&(b.attributes.rel==="stylesheet"||b.attributes.rel==="preload"&&typeof b.attributes.href=="string"&&mu(b.attributes.href)==="css")&&L_(e,()=>{if(y){const R=$t(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:E,slimDOMOptions:T,dataURLOptions:F,inlineImages:B,recordCanvas:q,preserveWhiteSpace:ce,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:y,stylesheetLoadTimeout:w,keepIframeSrcFn:P,ignoreCSSAttributes:O});R&&y(e,R)}},w),b.type===ue.Element&&delete b.needBlock,b}function H_(e,t){const{mirror:n=new hu,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:g,maskTextFn:_,maskInputFn:E,slimDOM:T=!1,dataURLOptions:F,preserveWhiteSpace:B,onSerialize:q,onIframeLoad:N,iframeLoadTimeout:S,onBlockedImageLoad:k,onStylesheetLoad:J,stylesheetLoadTimeout:y,keepIframeSrcFn:w=()=>!1,ignoreCSSAttributes:P=new Set([])}=t||{};return $t(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,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:g,maskTextFn:_,maskInputFn:E,slimDOMOptions:T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:T==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:T===!1?{}:T,dataURLOptions:F,inlineImages:f,recordCanvas:p,preserveWhiteSpace:B,onSerialize:q,onIframeLoad:N,iframeLoadTimeout:S,onBlockedImageLoad:k,onStylesheetLoad:J,stylesheetLoadTimeout:y,keepIframeSrcFn:w,newlyAddedElement:!1,ignoreCSSAttributes:P})}function ge(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Pt=`Please stop import mirror directly. Instead of that,\r
20
+ Error:`,s)}}function Jh(){return Bh(e=>{Nn("cls",{metric:e}),Xc=e},{reportAllChanges:!0})}function Qh(){return Gh(e=>{Nn("lcp",{metric:e}),Jc=e},{reportAllChanges:!0})}function Zh(){return Kh(e=>{Nn("ttfb",{metric:e}),Qc=e})}function em(){return jh(e=>{Nn("inp",{metric:e}),Zc=e})}function Lr(e,t,n,r,s=!1){tu(e,t);let i;return Sr[e]||(i=n(),Sr[e]=!0),r&&t({metric:r}),nu(e,t,s?i:void 0)}function tm(e){const t={};e==="event"&&(t.durationThreshold=0),on(e,n=>{Nn(e,{entries:n})},t)}function tu(e,t){un[e]=un[e]||[],un[e].push(t)}function nu(e,t,n){return()=>{n&&n();const r=un[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function nm(e){return"duration"in e}function os(e){return typeof e=="number"&&isFinite(e)}function ot(e,t,n,{...r}){const s=U(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),ti(e,()=>{const i=rn({startTime:t,...r});return i&&i.end(n),i})}function _i(e){var _;const t=H();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:c,sendDefaultPii:a}=t.getOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),l=G(),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 g={release:o,environment:c,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(_=x.navigator)==null?void 0:_.userAgent,"client.address":a?"{{auto}}":void 0,...s};return rn({name:n,attributes:g,startTime:i,experimental:{standalone:!0}})}function On(){return x.addEventListener&&x.performance}function oe(e){return e/1e3}function rm(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function ru(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function su(e,t){let n,r=!1;function s(c){!r&&n&&t(c,n),r=!0}Yc(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(c,a)=>{a!=null&&a.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",c=>{n=c.spanContext().spanId,o()})}function sm(e){let t=0,n;if(!ru("layout-shift"))return;const r=mi(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);su(e,(s,i)=>{im(t,n,i,s),r()})}function im(e,t,n,r){var u;wt&&m.log(`Sending CLS span (${e})`);const s=t?oe((he()||0)+t.startTime):ie(),i=G().getScopeData().transactionName,o=t?Ee((u=t.sources[0])==null?void 0:u.node):"Layout shift",c={[ae]:"auto.http.browser.cls",[Ue]:"ui.webvital.cls",[nn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,l)=>{c[`cls.source.${l+1}`]=Ee(d.node)});const a=_i({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("cls",{[kn]:"",[Rn]:e}),a.end(s))}function om(e){let t=0,n;if(!ru("largest-contentful-paint"))return;const r=gi(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);su(e,(s,i)=>{am(t,n,i,s),r()})}function am(e,t,n,r){wt&&m.log(`Sending LCP span (${e})`);const s=oe((he()||0)+((t==null?void 0:t.startTime)||0)),i=G().getScopeData().transactionName,o=t?Ee(t.element):"Largest contentful paint",c={[ae]:"auto.http.browser.lcp",[Ue]:"ui.webvital.lcp",[nn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=Ee(t.element)),t.id&&(c["lcp.id"]=t.id),t.url&&(c["lcp.url"]=t.url),t.loadTime!=null&&(c["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(c["lcp.renderTime"]=t.renderTime),t.size!=null&&(c["lcp.size"]=t.size));const a=_i({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("lcp",{[kn]:"millisecond",[Rn]:e}),a.end(s))}function ke(e){return e&&((he()||performance.timeOrigin)+e)/1e3}function iu(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:s}=rm(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=r}return he()||(n=On())!=null&&n.timeOrigin?cm({...t,"http.request.redirect_start":ke(e.redirectStart),"http.request.redirect_end":ke(e.redirectEnd),"http.request.worker_start":ke(e.workerStart),"http.request.fetch_start":ke(e.fetchStart),"http.request.domain_lookup_start":ke(e.domainLookupStart),"http.request.domain_lookup_end":ke(e.domainLookupEnd),"http.request.connect_start":ke(e.connectStart),"http.request.secure_connection_start":ke(e.secureConnectionStart),"http.request.connection_end":ke(e.connectEnd),"http.request.request_start":ke(e.requestStart),"http.request.response_start":ke(e.responseStart),"http.request.response_end":ke(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function cm(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const um=2147483647;let Do=0,Le={},Se,Dt;function lm({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=On();if(r&&he()){r.mark&&x.performance.mark("sentry-tracing-init");const s=t?om(n):mm(),i=gm(),o=e?sm(n):hm();return()=>{s==null||s(),i(),o==null||o()}}return()=>{}}function dm(){kt("longtask",({entries:e})=>{const t=pe();if(!t)return;const{op:n,start_timestamp:r}=U(t);for(const s of e){const i=oe(he()+s.startTime),o=oe(s.duration);n==="navigation"&&r&&i<r||ot(t,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[ae]:"auto.ui.browser.metrics"}})}})}function fm(){new PerformanceObserver(t=>{const n=pe();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=oe(he()+r.startTime),{start_timestamp:i,op:o}=U(n);if(o==="navigation"&&i&&s<i)continue;const c=oe(r.duration),a={[ae]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:l,sourceURL:f,sourceFunctionName:p,sourceCharPosition:h}=u;a["browser.script.invoker"]=d,a["browser.script.invoker_type"]=l,f&&(a["code.filepath"]=f),p&&(a["code.function"]=p),h!==-1&&(a["browser.script.source_char_position"]=h),ot(n,s,s+c,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:a})}}).observe({type:"long-animation-frame",buffered:!0})}function pm(){kt("event",({entries:e})=>{const t=pe();if(t){for(const n of e)if(n.name==="click"){const r=oe(he()+n.startTime),s=oe(n.duration),i={name:Ee(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[ae]:"auto.ui.browser.metrics"}},o=Da(n.target);o&&(i.attributes["ui.component_name"]=o),ot(t,r,r+s,i)}}})}function hm(){return mi(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Le.cls={value:e.value,unit:""},Dt=t)},!0)}function mm(){return gi(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Le.lcp={value:e.value,unit:"millisecond"},Se=t)},!0)}function gm(){return Xh(({metric:e})=>{e.entries[e.entries.length-1]&&(Le.ttfb={value:e.value,unit:"millisecond"})})}function _m(e,t){const n=On(),r=he();if(!(n!=null&&n.getEntries)||!r)return;const s=oe(r),i=n.getEntries(),{op:o,start_timestamp:c}=U(e);i.slice(Do).forEach(a=>{const u=oe(a.startTime),d=oe(Math.max(0,a.duration));if(!(o==="navigation"&&c&&s+u<c))switch(a.entryType){case"navigation":{bm(e,a,s);break}case"mark":case"paint":case"measure":{ym(e,a,u,d,s,t.ignorePerformanceApiSpans);const l=xn(),f=a.startTime<l.firstHiddenTime;a.name==="first-paint"&&f&&(Le.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&f&&(Le.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{Im(e,a,a.name,u,d,s,t.ignoreResourceSpans);break}}}),Do=Math.max(i.length-1,0),wm(e),o==="pageload"&&(Cm(Le),t.recordClsOnPageloadSpan||delete Le.cls,t.recordLcpOnPageloadSpan||delete Le.lcp,Object.entries(Le).forEach(([a,u])=>{Xd(a,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",s),e.setAttribute("performance.activationStart",sn()),km(e,t)),Se=void 0,Dt=void 0,Le={}}function Sm(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function ym(e,t,n,r,s,i){if(Sm(t)||["mark","measure"].includes(t.entryType)&&Ve(t.name,i))return;const o=Mn(!1),c=oe(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,d=u+r,l={[ae]:"auto.resource.browser.metrics"};a!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=a),Em(l,t),a<=d&&ot(e,a,d,{name:t.name,op:t.entryType,attributes:l})}function Em(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&vt(s))e[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(vt(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function bm(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{zn(e,t,r,n)}),zn(e,t,"secureConnection",n,"TLS/SSL"),zn(e,t,"fetch",n,"cache"),zn(e,t,"domainLookup",n,"DNS"),vm(e,t,n)}function zn(e,t,n,r,s=n){const i=Tm(n),o=t[i],c=t[`${n}Start`];!c||!o||ot(e,r+oe(c),r+oe(o),{op:`browser.${s}`,name:t.name,attributes:{[ae]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function Tm(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function vm(e,t,n){const r=n+oe(t.requestStart),s=n+oe(t.responseEnd),i=n+oe(t.responseStart);t.responseEnd&&(ot(e,r,s,{op:"browser.request",name:t.name,attributes:{[ae]:"auto.ui.browser.metrics"}}),ot(e,i,s,{op:"browser.response",name:t.name,attributes:{[ae]:"auto.ui.browser.metrics"}}))}function Im(e,t,n,r,s,i,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const c=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o!=null&&o.includes(c))return;const a={[ae]:"auto.resource.browser.metrics"},u=Et(n);u.protocol&&(a["url.scheme"]=u.protocol.split(":").pop()),u.host&&(a["server.address"]=u.host),a["url.same_origin"]=n.includes(x.location.origin),Rm(t,a,[["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={...a,...iu(t)},l=i+r,f=l+s;ot(e,l,f,{name:n.replace(x.location.origin,""),op:c,attributes:d})}function wm(e){const t=x.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),os(n.rtt)&&(Le["connection.rtt"]={value:n.rtt,unit:"millisecond"})),os(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),os(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function km(e,t){Se&&t.recordLcpOnPageloadSpan&&(Se.element&&e.setAttribute("lcp.element",Ee(Se.element)),Se.id&&e.setAttribute("lcp.id",Se.id),Se.url&&e.setAttribute("lcp.url",Se.url.trim().slice(0,200)),Se.loadTime!=null&&e.setAttribute("lcp.loadTime",Se.loadTime),Se.renderTime!=null&&e.setAttribute("lcp.renderTime",Se.renderTime),e.setAttribute("lcp.size",Se.size)),Dt!=null&&Dt.sources&&t.recordClsOnPageloadSpan&&Dt.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ee(n.node)))}function Rm(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i<um||typeof i=="string")&&(t[s]=i)})}function Cm(e){const t=Mn(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function Mm(){return On()&&he()?kt("element",xm):()=>{}}const xm=({entries:e})=>{const t=pe(),n=t?le(t):void 0,r=n?U(n).description:G().getScopeData().transactionName;e.forEach(s=>{var p,h;const i=s;if(!i.identifier)return;const o=i.name,c=i.renderTime,a=i.loadTime,[u,d]=a?[oe(a),"load-time"]:c?[oe(c),"render-time"]:[ie(),"entry-emission"],l=o==="image-paint"?oe(Math.max(0,(c??0)-(a??0))):0,f={[ae]:"auto.ui.browser.elementtiming",[Ue]:"ui.elementtiming",[xe]:"component","sentry.span_start_time_source":d,"sentry.transaction_name":r,"element.id":i.id,"element.type":((h=(p=i.element)==null?void 0:p.tagName)==null?void 0:h.toLowerCase())||"unknown","element.size":i.naturalWidth&&i.naturalHeight?`${i.naturalWidth}x${i.naturalHeight}`:void 0,"element.render_time":c,"element.load_time":a,"element.url":i.url||void 0,"element.identifier":i.identifier,"element.paint_type":o};nf({name:`element[${i.identifier}]`,attributes:f,startTime:u,onlyIfParent:!0},g=>{g.end(u+l)})})},Am=1e3;let Fo,Ms,xs;function ou(e){const t="dom";ct(t,e),ut(t,Nm)}function Nm(){if(!x.document)return;const e=Ae.bind(null,"dom"),t=Bo(e,!0);x.document.addEventListener("click",t,!1),x.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var i,o;const s=(i=x[n])==null?void 0:i.prototype;(o=s==null?void 0:s.hasOwnProperty)!=null&&o.call(s,"addEventListener")&&(ye(s,"addEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=l[a]=l[a]||{refCount:0};if(!f.handler){const p=Bo(e);f.handler=p,c.call(this,a,p,d)}f.refCount++}catch{}return c.call(this,a,u,d)}}),ye(s,"removeEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},f=l[a];f&&(f.refCount--,f.refCount<=0&&(c.call(this,a,f.handler,d),f.handler=void 0,delete l[a]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return c.call(this,a,u,d)}}))})}function Om(e){if(e.type!==Ms)return!1;try{if(!e.target||e.target._sentryId!==xs)return!1}catch{}return!0}function Pm(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Bo(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Lm(n);if(Pm(n.type,r))return;Ie(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ie(r,"_sentryId",fe());const s=n.type==="keypress"?"input":n.type;Om(n)||(e({event:n,name:s,global:t}),Ms=n.type,xs=r?r._sentryId:void 0),clearTimeout(Fo),Fo=x.setTimeout(()=>{xs=void 0,Ms=void 0},Am)}}function Lm(e){try{return e.target}catch{return null}}let jn;function Dr(e){const t="history";ct(t,e),ut(t,Dm)}function Dm(){if(x.addEventListener("popstate",()=>{const t=x.location.href,n=jn;if(jn=t,n===t)return;Ae("history",{from:n,to:t})}),!ih())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=jn,i=Fm(String(r));if(jn=i,s===i)return t.apply(this,n);Ae("history",{from:s,to:i})}return t.apply(this,n)}}ye(x.history,"pushState",e),ye(x.history,"replaceState",e)}function Fm(e){try{return new URL(e,x.location.origin).toString()}catch{return e}}const sr={};function Si(e){const t=sr[e];if(t)return t;let n=x[e];if(Ts(n))return sr[e]=n.bind(x);const r=x.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i!=null&&i[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){wt&&m.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(sr[e]=n.bind(x))}function Bm(e){sr[e]=void 0}function Pn(...e){return Si("setTimeout")(...e)}const ht="__sentry_xhr_v3__";function au(e){const t="xhr";ct(t,e),ut(t,$m)}function $m(){if(!x.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=ie()*1e3,o=qe(r[0])?r[0].toUpperCase():void 0,c=Um(r[1]);if(!o||!c)return t.apply(n,r);n[ht]={method:o,url:c,request_headers:{}},o==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const u=n[ht];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:ie()*1e3,startTimestamp:i,xhr:n,virtualError:s};Ae("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return a(),u.apply(d,l)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[ht];return h&&qe(f)&&qe(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 s=n[ht];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:ie()*1e3,xhr:n};return Ae("xhr",i),t.apply(n,r)}})}function Um(e){if(qe(e))return e;try{return e.toString()}catch{}}function cu(e){return new URLSearchParams(e).toString()}function uu(e,t=m){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[cu(e)];if(!e)return[void 0]}catch(n){return wt&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return wt&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function lu(e=[]){if(!(e.length!==2||typeof e[1]!="object"))return e[1].body}function du(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return wt&&m.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
21
+ `).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const as=[],ir=new Map,Nt=new Map,Hm=60;function Wm(){if(On()&&he()){const t=zm();return()=>{t()}}return()=>{}}const As={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 zm(){return eu(jm)}const jm=({metric:e})=>{if(e.value==null)return;const t=oe(e.value);if(t>Hm)return;const n=e.entries.find(h=>h.duration===e.value&&As[h.name]);if(!n)return;const{interactionId:r}=n,s=As[n.name],i=oe(he()+n.startTime),o=pe(),c=o?le(o):void 0,a=r!=null?ir.get(r):void 0,u=(a==null?void 0:a.span)||c,d=u?U(u).description:G().getScopeData().transactionName,l=(a==null?void 0:a.elementName)||Ee(n.target),f={[ae]:"auto.http.browser.inp",[Ue]:`ui.interaction.${s}`,[nn]:n.duration},p=_i({name:l,transaction:d,attributes:f,startTime:i});p&&(p.addEvent("inp",{[kn]:"millisecond",[Rn]:e.value}),p.end(i+t))};function qm(){const e=Object.keys(As);Is()&&e.forEach(s=>{x.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=Ee(i),c=Math.round(s.timeStamp);if(Nt.set(c,o),Nt.size>50){const a=Nt.keys().next().value;a!==void 0&&Nt.delete(a)}}function n(s){const i=Math.round(s.startTime);let o=Nt.get(i);if(!o)for(let c=-5;c<=5;c++){const a=Nt.get(i+c);if(a){o=a;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=pe(),o=i&&le(i);s.forEach(c=>{if(!nm(c))return;const a=c.interactionId;if(a==null||ir.has(a))return;const u=c.target?Ee(c.target):n(c);if(as.length>10){const d=as.shift();ir.delete(d)}as.push(a),ir.set(a,{span:o,elementName:u})})};kt("event",r),kt("first-input",r)}const Vm=40;function yi(e,t=Si("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const c={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const a=await t(e.url,c);return{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}}catch(a){throw Bm("fetch"),a}finally{n-=o,r--}}return lp(e,s,Mc(e.bufferSize||Vm))}const Gm=30,Ym=50;function Ns(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?Tt:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const Km=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Xm=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Jm=/\((\S*)(?::(\d+))(?::(\d+))\)/,Qm=/at (.+?) ?\(data:(.+?),/,Zm=e=>{const t=e.match(Qm);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=Km.exec(e);if(n){const[,s,i,o]=n;return Ns(s,Tt,+i,+o)}const r=Xm.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const c=Jm.exec(r[2]);c&&(r[2]=c[1],r[3]=c[2],r[4]=c[3])}const[i,o]=fu(r[1]||Tt,r[2]);return Ns(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},eg=[Gm,Zm],tg=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ng=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,rg=e=>{const t=tg.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=ng.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||Tt;return[s,r]=fu(s,r),Ns(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},sg=[Ym,rg],ig=[eg,sg],og=Ca(...ig),fu=(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]:Tt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},I=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,qn=1024,ag="Breadcrumbs",cg=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:ag,setup(n){t.console&&Lc(fg(n)),t.dom&&ou(dg(n,t.dom)),t.xhr&&au(pg(n)),t.fetch&&Uc(hg(n)),t.history&&Dr(mg(n)),t.sentry&&n.on("beforeSendEvent",lg(n))}}},ug=cg;function lg(e){return function(n){H()===e&&it({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:pt(n)},{event:n})}}function dg(e,t){return function(r){if(H()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,c=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;c&&c>qn&&(I&&m.warn(`\`dom.maxStringLength\` cannot exceed ${qn}, but a value of ${c} was configured. Sentry will use ${qn} instead.`),c=qn),typeof o=="string"&&(o=[o]);try{const u=r.event,d=gg(u)?u.target:u;s=Ee(d,{keyAttrs:o,maxStringLength:c}),i=Da(d)}catch{s="<unknown>"}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};i&&(a.data={"ui.component_name":i}),it(a,{event:r.event,name:r.name,global:r.global})}}function fg(e){return function(n){if(H()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Dc(n.level),message:Gi(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Gi(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;it(r,{input:n.args,level:n.level})}}function pg(e){return function(n){if(H()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[ht];if(!r||!s||!i)return;const{method:o,url:c,status_code:a,body:u}=i,d={method:o,url:c,status_code:a},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:$c(a)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),it(f,l)}}function hg(e){return function(n){if(H()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const i=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:i,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",c,o),it(c,o)}else{const i=n.response,o={...n.fetchData,status_code:i==null?void 0:i.status};n.fetchData.request_body_size,n.fetchData.response_body_size,i==null||i.status;const c={input:n.args,response:i,startTimestamp:r,endTimestamp:s},a={category:"fetch",data:o,type:"http",level:$c(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,c),it(a,c)}}}function mg(e){return function(n){if(H()!==e)return;let r=n.from,s=n.to;const i=Et(D.location.href);let o=r?Et(r):void 0;const c=Et(s);o!=null&&o.path||(o=i),i.protocol===c.protocol&&i.host===c.host&&(s=c.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),it({category:"navigation",data:{from:r,to:s}})}}function gg(e){return!!e&&!!e.target}const _g=["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"],Sg="BrowserApiErrors",yg=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Sg,setupOnce(){t.setTimeout&&ye(D,"setTimeout",$o),t.setInterval&&ye(D,"setInterval",$o),t.requestAnimationFrame&&ye(D,"requestAnimationFrame",bg),t.XMLHttpRequest&&"XMLHttpRequest"in D&&ye(XMLHttpRequest.prototype,"send",Tg);const n=t.eventTarget;n&&(Array.isArray(n)?n:_g).forEach(s=>vg(s,t))}}},Eg=yg;function $o(e){return function(...t){const n=t[0];return t[0]=Vt(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Ke(e)}`}}),e.apply(this,t)}}function bg(e){return function(t){return e.apply(this,[Vt(t,{mechanism:{data:{handler:Ke(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Tg(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&ye(n,s,function(i){const o={mechanism:{data:{handler:Ke(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=Ys(i);return c&&(o.mechanism.data.handler=Ke(c)),Vt(i,o)})}),e.apply(this,t)}}function vg(e,t){var s,i;const r=(s=D[e])==null?void 0:s.prototype;(i=r==null?void 0:r.hasOwnProperty)!=null&&i.call(r,"addEventListener")&&(ye(r,"addEventListener",function(o){return function(c,a,u){try{Ig(a)&&(a.handleEvent=Vt(a.handleEvent,{mechanism:{data:{handler:Ke(a),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&wg(this,c,a),o.apply(this,[c,Vt(a,{mechanism:{data:{handler:Ke(a),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),ye(r,"removeEventListener",function(o){return function(c,a,u){try{const d=a.__sentry_wrapped__;d&&o.call(this,c,d,u)}catch{}return o.call(this,c,a,u)}}))}function Ig(e){return typeof e.handleEvent=="function"}function wg(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const kg=()=>({name:"BrowserSession",setupOnce(){if(typeof D.document>"u"){I&&m.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}mo({ignoreDuration:!0}),go(),Dr(({from:e,to:t})=>{e!==void 0&&e!==t&&(mo({ignoreDuration:!0}),go())})}}),Rg="GlobalHandlers",Cg=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:Rg,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(xg(n),Uo("onerror")),t.onunhandledrejection&&(Ag(n),Uo("onunhandledrejection"))}}},Mg=Cg;function xg(e){xa(t=>{const{stackParser:n,attachStacktrace:r}=pu();if(H()!==e||Wc())return;const{msg:s,url:i,line:o,column:c,error:a}=t,u=Pg(di(n,a||s,void 0,r,!1),i,o,c);u.level="error",mc(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function Ag(e){Aa(t=>{const{stackParser:n,attachStacktrace:r}=pu();if(H()!==e||Wc())return;const s=Ng(t),i=vt(s)?Og(s):di(n,s,void 0,r,!0);i.level="error",mc(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Ng(e){if(vt(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 Og(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Pg(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},c=o.stacktrace=o.stacktrace||{},a=c.frames=c.frames||[],u=r,d=n,l=Lg(t)??en();return a.length===0&&a.push({colno:u,filename:l,function:Tt,in_app:!0,lineno:d}),e}function Uo(e){I&&m.log(`Global Handler attached: ${e}`)}function pu(){const e=H();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function Lg(e){if(!(!qe(e)||e.length===0)){if(e.startsWith("data:")){const t=e.match(/^data:([^;]+)/),n=t?t[1]:"text/javascript",r=e.includes("base64,");return`<data:${n}${r?",base64":""}>`}return e}}const Dg=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!D.navigator&&!D.location&&!D.document)return;const t=ci(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),Fg="cause",Bg=5,$g="LinkedErrors",Ug=(e={})=>{const t=e.limit||Bg,n=e.key||Fg;return{name:$g,preprocessEvent(r,s,i){const o=i.getOptions();Bp(ui,o.stackParser,n,t,r,s)}}},Hg=Ug,Wg="SpotlightBrowser",zg=(e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:Wg,setup:()=>{I&&m.log("Using Sidecar URL",t)},processEvent:n=>Vg(n)?null:n,afterAllSetup:n=>{jg(n,t)}}};function jg(e,t){const n=Si("fetch");let r=0;e.on("beforeEnvelope",s=>{if(r>3){m.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:pr(s),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,m.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}const qg=zg;function Vg(e){var t;return!!(e.type==="transaction"&&e.spans&&((t=e.contexts)!=null&&t.trace)&&e.contexts.trace.op==="ui.action.click"&&e.spans.some(({description:n})=>n==null?void 0:n.includes("#sentry-spotlight")))}function Gg(){return Yg()?(I&&at(()=>{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 Yg(){var i;if(typeof D.window>"u")return!1;const e=D;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((i=t==null?void 0:t.runtime)!=null&&i.id))return!1;const n=en(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(D===D.top&&r.some(o=>n.startsWith(`${o}://`)))}function Kg(e){return[xp(),kp(),Eg(),ug(),Mg(),Hg(),Wp(),Dg(),kg()]}function Xg(e={}){const t=!e.skipBrowserExtensionCheck&&Gg();let n=e.defaultIntegrations==null?Kg():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Ml(e.stackParser||og),integrations:Ff({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||yi};return ip(Mh,r)}const te=L,Ei="sentryReplaySession",Jg="replay_event",bi="Unable to send Replay",Qg=3e5,Zg=9e5,e_=5e3,t_=5500,n_=6e4,r_=5e3,s_=3,Ho=15e4,Vn=5e3,i_=3e3,o_=300,Ti=2e7,a_=4999,c_=5e4,Wo=36e5;var u_=Object.defineProperty,l_=(e,t,n)=>t in e?u_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zo=(e,t,n)=>l_(e,typeof t!="symbol"?t+"":t,n),ue=(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))(ue||{});function d_(e){return e.nodeType===e.ELEMENT_NODE}function ln(e){const t=e==null?void 0:e.host;return(t==null?void 0:t.shadowRoot)===e}function dn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function f_(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 p_(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 yr(e){try{const t=e.rules||e.cssRules;return t?f_(Array.from(t,hu).join("")):null}catch{return null}}function h_(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],i=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function hu(e){let t;if(g_(e))try{t=yr(e.styleSheet)||p_(e)}catch{}else if(__(e)){let n=e.cssText;const r=e.selectorText.includes(":"),s=typeof e.style.all=="string"&&e.style.all;if(s&&(n=h_(e)),r&&(n=m_(n)),r||s)return n}return t||e.cssText}function m_(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function g_(e){return"styleSheet"in e}function __(e){return"selectorText"in e}class mu{constructor(){zo(this,"idNodeMap",new Map),zo(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 s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function S_(){return new mu}function Fr({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 Sn({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function Gt(e){return e.toLowerCase()}function Os(e){return e.toUpperCase()}const jo="__rrweb_original__";function y_(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let s=0;s<e.height;s+=n){const i=t.getImageData,o=jo in i?i[jo]:i;if(new Uint32Array(o.call(t,r,s,Math.min(n,e.width-r),Math.min(n,e.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function vi(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Gt(t):null}function Er(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function gu(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return(s==null?void 0:s[1])??null}const qo={};function _u(e){const t=qo[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return qo[e]=r.bind(window)}function Ps(...e){return _u("setTimeout")(...e)}function Su(...e){return _u("clearTimeout")(...e)}function yu(e){try{return e.contentDocument}catch{}}let E_=1;const b_=new RegExp("[^a-z0-9-_:]"),yn=-2;function Ii(){return E_++}function T_(e){if(e instanceof HTMLFormElement)return"form";const t=Gt(e.tagName);return b_.test(t)?"div":t}function v_(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let Ot,Vo;const I_=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,w_=/^(?:[a-z+]+:)?\/\//i,k_=/^www\..*/i,R_=/^(data:)([^,]*),(.*)/i;function C_(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let s of n){if(s=s.trim(),!s)continue;const i=s.indexOf(":");if(i===-1){r.push(s);continue}const o=s.slice(0,i).trim();t.has(o)||r.push(s)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function br(e,t){return(e||"").replace(I_,(n,r,s,i,o,c)=>{const a=s||o||c,u=r||i||"";if(!a)return n;if(w_.test(a)||k_.test(a))return`url(${u}${a}${u})`;if(R_.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${v_(t)+a}${u})`;const d=t.split("/"),l=a.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const M_=/^[^ \t\n\r\u000c]+/,x_=/^[, \t\n\r\u000c]+/;function A_(e,t){if(t.trim()==="")return t;let n=0;function r(i){let o;const c=i.exec(t.substring(n));return c?(o=c[0],n+=o.length,o):""}const s=[];for(;r(x_),!(n>=t.length);){let i=r(M_);if(i.slice(-1)===",")i=Ft(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=Ft(e,i);let c=!1;for(;;){const a=t.charAt(n);if(a===""){s.push((i+o).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){n+=1,s.push((i+o).trim());break}else a==="("&&(c=!0);o+=a,n+=1}}}return s.join(", ")}const Go=new WeakMap;function Ft(e,t){return!t||t.trim()===""?t:Br(e,t)}function N_(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Br(e,t){let n=Go.get(e);if(n||(n=e.createElement("a"),Go.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function Eu(e,t,n,r,s,i,o){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Ft(e,r);if(n==="xlink:href"&&r[0]!=="#")return Ft(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Ft(e,r);if(n==="srcset")return A_(e,r);if(n==="style"){let c=br(r,Br(e));return o&&o.size>0&&(c=C_(c,o)),c}else if(t==="object"&&n==="data")return Ft(e,r);return typeof i=="function"?i(n,r,s):r}function bu(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function O_(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 s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function P_(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function mt(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:mt(e.parentNode,t,n,r+1)}function Bt(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(P_(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Yt(e,t,n,r,s,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let c=-1,a=-1;if(i){if(a=mt(o,Bt(r,s)),a<0)return!0;c=mt(o,Bt(t,n),a>=0?a:1/0)}else{if(c=mt(o,Bt(t,n)),c<0)return!1;a=mt(o,Bt(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function L_(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const c=Ps(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{Su(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return Ps(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function D_(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=Ps(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{Su(i),r=!0,t()})}function F_(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:g,maskInputFn:_,dataURLOptions:E={},inlineImages:T,recordCanvas:F,keepIframeSrcFn:B,newlyAddedElement:q=!1,ignoreCSSAttributes:N}=t,S=B_(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ue.Document,childNodes:[],compatMode:e.compatMode}:{type:ue.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ue.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return U_(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:h,maskInputFn:_,dataURLOptions:E,inlineImages:T,recordCanvas:F,keepIframeSrcFn:B,newlyAddedElement:q,rootId:S,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:N});case e.TEXT_NODE:return $_(e,{doc:n,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:g,maskInputOptions:h,maskInputFn:_,rootId:S});case e.CDATA_SECTION_NODE:return{type:ue.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:ue.Comment,textContent:e.textContent||"",rootId:S};default:return!1}}function B_(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function $_(e,t){var E;const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,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,g=l==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||(E=e.parentNode.sheet)!=null&&E.cssRules&&(f=yr(e.parentNode.sheet))}catch(T){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${T}`,e)}f=br(f,Br(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const _=Yt(e,r,i,s,o,n);if(!p&&!h&&!g&&f&&_&&(f=c?c(f,e.parentElement):f.replace(/[\S]/g,"*")),g&&f&&(a.textarea||_)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),l==="OPTION"&&f){const T=Fr({type:null,tagName:l,maskInputOptions:a});f=Sn({isMasked:Yt(e,r,i,s,o,T),element:e,value:f,maskInputFn:u})}return{type:ue.Text,textContent:f||"",isStyle:p,rootId:d}}function U_(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:g,maskTextClass:_,unmaskTextClass:E,maskTextSelector:T,unmaskTextSelector:F,ignoreCSSAttributes:B}=t,q=O_(e,r,s,i),N=T_(e);let S={};const k=e.attributes.length;for(let y=0;y<k;y++){const w=e.attributes[y];w.name&&!bu(N,w.name,w.value)&&(S[w.name]=Eu(n,N,Gt(w.name),w.value,e,a,B))}if(N==="link"&&o){const y=Array.from(n.styleSheets).find(P=>P.href===e.href);let w=null;y&&(w=yr(y)),w&&(S.rel=null,S.href=null,S.crossorigin=null,S._cssText=br(w,y.href))}if(N==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const y=yr(e.sheet);y&&(S._cssText=br(y,Br(n)))}if(N==="input"||N==="textarea"||N==="select"||N==="option"){const y=e,w=vi(y),P=Er(y,Os(N),w),j=y.checked;if(w!=="submit"&&w!=="button"&&P){const O=Yt(y,_,T,E,F,Fr({type:w,tagName:Os(N),maskInputOptions:c}));S.value=Sn({isMasked:O,element:y,value:P,maskInputFn:u})}j&&(S.checked=j)}if(N==="option"&&(e.selected&&!c.select?S.selected=!0:delete S.selected),N==="canvas"&&f){if(e.__context==="2d")y_(e)||(S.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const y=e.toDataURL(d.type,d.quality),w=n.createElement("canvas");w.width=e.width,w.height=e.height;const P=w.toDataURL(d.type,d.quality);y!==P&&(S.rr_dataURL=y)}}if(N==="img"&&l){Ot||(Ot=n.createElement("canvas"),Vo=Ot.getContext("2d"));const y=e,w=y.currentSrc||y.getAttribute("src")||"<unknown-src>",P=y.crossOrigin,j=()=>{y.removeEventListener("load",j);try{Ot.width=y.naturalWidth,Ot.height=y.naturalHeight,Vo.drawImage(y,0,0),S.rr_dataURL=Ot.toDataURL(d.type,d.quality)}catch(O){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?j():y.addEventListener("load",j);return}else console.warn(`Cannot inline img src=${w}! Error: ${O}`)}y.crossOrigin==="anonymous"&&(P?S.crossOrigin=P:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?j():y.addEventListener("load",j)}if((N==="audio"||N==="video")&&(S.rr_mediaState=e.paused?"paused":"played",S.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop)),q){const{width:y,height:w}=e.getBoundingClientRect();S={class:S.class,rr_width:`${y}px`,rr_height:`${w}px`}}N==="iframe"&&!p(S.src)&&(!q&&!yu(e)&&(S.rr_src=S.src),delete S.src);let J;try{customElements.get(N)&&(J=!0)}catch{}return{type:ue.Element,tagName:N,attributes:S,childNodes:[],isSVG:N_(e)||void 0,needBlock:q,rootId:g,isCustom:J}}function ee(e){return e==null?"":e.toLowerCase()}function H_(e,t){if(t.comment&&e.type===ue.Comment)return!0;if(e.type===ue.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"&&gu(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ee(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ee(e.attributes.name)==="application-name"||ee(e.attributes.rel)==="icon"||ee(e.attributes.rel)==="apple-touch-icon"||ee(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ee(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ee(e.attributes.property).match(/^(og|twitter|fb):/)||ee(e.attributes.name).match(/^(og|twitter):/)||ee(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ee(e.attributes.name)==="robots"||ee(e.attributes.name)==="googlebot"||ee(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ee(e.attributes.name)==="author"||ee(e.attributes.name)==="generator"||ee(e.attributes.name)==="framework"||ee(e.attributes.name)==="publisher"||ee(e.attributes.name)==="progid"||ee(e.attributes.property).match(/^article:/)||ee(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ee(e.attributes.name)==="google-site-verification"||ee(e.attributes.name)==="yandex-verification"||ee(e.attributes.name)==="csrf-token"||ee(e.attributes.name)==="p:domain_verify"||ee(e.attributes.name)==="verify-v1"||ee(e.attributes.name)==="verification"||ee(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function $t(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:g,maskTextFn:_,maskInputFn:E,slimDOMOptions:T,dataURLOptions:F={},inlineImages:B=!1,recordCanvas:q=!1,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:k=5e3,onBlockedImageLoad:J,onStylesheetLoad:y,stylesheetLoadTimeout:w=5e3,keepIframeSrcFn:P=()=>!1,newlyAddedElement:j=!1,ignoreCSSAttributes:O}=t;let{preserveWhiteSpace:ce=!0}=t;const Q=F_(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:E,dataURLOptions:F,inlineImages:B,recordCanvas:q,keepIframeSrcFn:P,newlyAddedElement:j,ignoreCSSAttributes:O});if(!Q)return console.warn(e,"not serialized"),null;let ne;r.hasNode(e)?ne=r.getId(e):H_(Q,T)||!ce&&Q.type===ue.Text&&!Q.isStyle&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?ne=yn:ne=Ii();const b=Object.assign(Q,{id:ne});if(r.add(e,b),ne===yn)return null;N&&N(e);let Y=!f;if(b.type===ue.Element){Y=Y&&!b.needBlock;const R=e.shadowRoot;R&&dn(R)&&(b.isShadowHost=!0)}if((b.type===ue.Document||b.type===ue.Element)&&Y){T.headWhitespace&&b.type===ue.Element&&b.tagName==="head"&&(ce=!1);const R={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:E,slimDOMOptions:T,dataURLOptions:F,inlineImages:B,recordCanvas:q,preserveWhiteSpace:ce,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:k,onBlockedImageLoad:J,onStylesheetLoad:y,stylesheetLoadTimeout:w,keepIframeSrcFn:P,ignoreCSSAttributes:O},K=e.childNodes?Array.from(e.childNodes):[];for(const Z of K){const re=$t(Z,R);re&&b.childNodes.push(re)}if(d_(e)&&e.shadowRoot)for(const Z of Array.from(e.shadowRoot.childNodes)){const re=$t(Z,R);re&&(dn(e.shadowRoot)&&(re.isShadow=!0),b.childNodes.push(re))}}if(e.parentNode&&ln(e.parentNode)&&dn(e.parentNode)&&(b.isShadow=!0),b.type===ue.Element&&b.tagName==="iframe"&&!b.needBlock&&L_(e,()=>{const R=yu(e);if(R&&S){const K=$t(R,{doc:R,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:E,slimDOMOptions:T,dataURLOptions:F,inlineImages:B,recordCanvas:q,preserveWhiteSpace:ce,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:y,stylesheetLoadTimeout:w,keepIframeSrcFn:P,ignoreCSSAttributes:O});K&&S(e,K)}},k),b.type===ue.Element&&b.tagName==="img"&&!e.complete&&b.needBlock){const R=e,K=()=>{if(R.isConnected&&!R.complete&&J)try{const Z=R.getBoundingClientRect();Z.width>0&&Z.height>0&&J(R,b,Z)}catch{}R.removeEventListener("load",K)};R.isConnected&&R.addEventListener("load",K)}return b.type===ue.Element&&b.tagName==="link"&&typeof b.attributes.rel=="string"&&(b.attributes.rel==="stylesheet"||b.attributes.rel==="preload"&&typeof b.attributes.href=="string"&&gu(b.attributes.href)==="css")&&D_(e,()=>{if(y){const R=$t(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:E,slimDOMOptions:T,dataURLOptions:F,inlineImages:B,recordCanvas:q,preserveWhiteSpace:ce,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:y,stylesheetLoadTimeout:w,keepIframeSrcFn:P,ignoreCSSAttributes:O});R&&y(e,R)}},w),b.type===ue.Element&&delete b.needBlock,b}function W_(e,t){const{mirror:n=new mu,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:g,maskTextFn:_,maskInputFn:E,slimDOM:T=!1,dataURLOptions:F,preserveWhiteSpace:B,onSerialize:q,onIframeLoad:N,iframeLoadTimeout:S,onBlockedImageLoad:k,onStylesheetLoad:J,stylesheetLoadTimeout:y,keepIframeSrcFn:w=()=>!1,ignoreCSSAttributes:P=new Set([])}=t||{};return $t(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,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:g,maskTextFn:_,maskInputFn:E,slimDOMOptions:T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:T==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:T===!1?{}:T,dataURLOptions:F,inlineImages:f,recordCanvas:p,preserveWhiteSpace:B,onSerialize:q,onIframeLoad:N,iframeLoadTimeout:S,onBlockedImageLoad:k,onStylesheetLoad:J,stylesheetLoadTimeout:y,keepIframeSrcFn:w,newlyAddedElement:!1,ignoreCSSAttributes:P})}function ge(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Pt=`Please stop import mirror directly. Instead of that,\r
22
22
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
23
- or you can use record.mirror to access the mirror instance during recording.`;let Yo={map:{},getId(){return console.error(Pt),-1},getNode(){return console.error(Pt),null},removeNodeFromMap(){console.error(Pt)},has(){return console.error(Pt),!1},reset(){console.error(Pt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Yo=new Proxy(Yo,{get(e,t,n){return t==="map"&&console.error(Pt),Reflect.get(e,t,n)}}));function En(e,t,n={}){let r=null,s=0;return function(...i){const o=Date.now();!s&&n.leading===!1&&(s=o);const c=t-(o-s),a=this;c<=0||c>t?(r&&(Y_(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=$r(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function bu(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){$r(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>bu(e,t,i||{},!0)}function wi(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}let Tr=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Tr=()=>new Date().getTime());function Tu(e){var n,r,s,i,o,c;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)||((s=t==null?void 0:t.body)==null?void 0:s.scrollLeft)||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(t==null?void 0:t.documentElement.scrollTop)||((o=(i=t==null?void 0:t.body)==null?void 0:i.parentElement)==null?void 0:o.scrollTop)||((c=t==null?void 0:t.body)==null?void 0:c.scrollTop)||0}}function vu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Iu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function wu(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function ve(e,t,n,r,s){if(!e)return!1;const i=wu(e);if(!i)return!1;const o=Bt(t,n);if(!s){const u=r&&i.matches(r);return o(i)&&!u}const c=mt(i,o);let a=-1;return c<0?!1:(r&&(a=mt(i,Bt(null,r))),c>-1&&a<0?!0:c<a)}function W_(e,t){return t.getId(e)!==-1}function cs(e,t){return t.getId(e)===yn}function ku(e,t){if(ln(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?ku(e.parentNode,t):!0:!0}function Ls(e){return!!e.changedTouches}function z_(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 Ru(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Cu(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ds(e){return!!(e!=null&&e.shadowRoot)}class j_{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 Mu(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 q_(e){let t=e,n;for(;n=Mu(t);)t=n;return t}function V_(e){const t=e.ownerDocument;if(!t)return!1;const n=q_(e);return t.contains(n)}function xu(e){const t=e.ownerDocument;return t?t.contains(e)||V_(e):!1}const Ko={};function ki(e){const t=Ko[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return Ko[e]=r.bind(window)}function G_(...e){return ki("requestAnimationFrame")(...e)}function $r(...e){return ki("setTimeout")(...e)}function Y_(...e){return ki("clearTimeout")(...e)}var $=(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))($||{}),A=(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))(A||{}),me=(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))(me||{}),je=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(je||{}),Lt=(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))(Lt||{});function Ri(e){try{return e.contentDocument}catch{}}function K_(e){try{return e.contentWindow}catch{}}function Xo(e){return"__ln"in e}class X_{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&&Xo(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&&Xo(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 Jo=(e,t)=>`${e}@${t}`;class J_{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 X_,s=a=>{let u=a,d=yn;for(;d===yn;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},i=a=>{if(!a.parentNode||!xu(a))return;const u=ln(a.parentNode)?this.mirror.getId(Mu(a)):this.mirror.getId(a.parentNode),d=s(a);if(u===-1||d===-1)return r.addNode(a);const l=$t(a,{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=>{Ru(f,this.mirror)&&!ve(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),Cu(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Ds(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{ve(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(f,p),f.contentWindow&&this.canvasManager.addWindow(f.contentWindow),this.shadowDomManager.observeAttachShadow(f))},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:g})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${g}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 a of this.movedSet)Qo(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!Zo(this.droppedSet,a)&&!Qo(this.removes,a,this.mirror)||Zo(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const u=this.mirror.getId(o.value.parentNode),d=s(o.value);u!==-1&&d!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(s(d.value)===-1)continue;if(l!==-1){a=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){a=d;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}const c={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const d=JSON.stringify(a.styleDiff),l=JSON.stringify(a._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.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(c))},this.processMutation=t=>{if(!cs(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ve(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Yt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,wu(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if(r==="value"){const o=vi(n),c=n.tagName;s=Er(n,c,o);const a=Fr({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),u=Yt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=Sn({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if(ve(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!Ri(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Eu(n.tagName,r)&&(i.attributes[r]=yu(this.doc,Gt(n.tagName),Gt(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue);for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),u=n.style.getPropertyPriority(c);a!==o.style.getPropertyValue(c)||u!==o.style.getPropertyPriority(c)?u===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,u]:i._unchangedStyles[c]=[a,u]}for(const c of Array.from(o.style))n.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if(ve(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),s=ln(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ve(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||cs(n,this.mirror)||!W_(n,this.mirror)||(this.addedSet.has(n)?(Fs(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||ku(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Jo(r,s)]?Fs(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:ln(t.target)&&dn(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(cs(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[Jo(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ve(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Ds(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]})}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 Fs(e,t){var n;e.delete(t),(n=t.childNodes)==null||n.forEach(r=>Fs(e,r))}function Qo(e,t,n){return e.length===0?!1:Q_(e,t,n)}function Q_(e,t,n){let r=t.parentNode;for(;r;){const s=n.getId(r);if(e.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function Zo(e,t){return e.size===0?!1:Au(e,t)}function Au(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Au(e,n):!1}let fn;function Z_(e){fn=e}function eS(){fn=void 0}const z=e=>fn?(...n)=>{try{return e(...n)}catch(r){if(fn&&fn(r)===!0)return()=>{};throw r}}:e,Ut=[];function Ln(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 Nu(e,t){var o,c;const n=new J_;Ut.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=(c=(o=window==null?void 0:window.Zone)==null?void 0:o.__symbol__)==null?void 0:c.call(o,"MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(z(a=>{e.onMutation&&e.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function tS({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],c;const a=En(z(l=>{const f=Date.now()-c;e(o.map(p=>(p.timeOffset-=f,p)),l),o=[],c=null}),i),u=z(En(z(l=>{const f=Ln(l),{clientX:p,clientY:h}=Ls(l)?l.changedTouches[0]:l;c||(c=Tr()),o.push({x:p,y:h,id:r.getId(f),timeOffset:Tr()-c}),a(typeof DragEvent<"u"&&l instanceof DragEvent?A.Drag:l instanceof MouseEvent?A.MouseMove:A.TouchMove)}),s,{trailing:!1})),d=[ge("mousemove",u,n),ge("touchmove",u,n),ge("drag",u,n)];return z(()=>{d.forEach(l=>l())})}function nS({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const c=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let u=null;const d=l=>f=>{const p=Ln(f);if(ve(p,r,s,i,!0))return;let h=null,g=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=je.Mouse;break;case"touch":h=je.Touch;break;case"pen":h=je.Pen;break}h===je.Touch?me[l]===me.MouseDown?g="TouchStart":me[l]===me.MouseUp&&(g="TouchEnd"):je.Pen}else Ls(f)&&(h=je.Touch);h!==null?(u=h,(g.startsWith("Touch")&&h===je.Touch||g.startsWith("Mouse")&&h===je.Mouse)&&(h=null)):me[l]===me.Click&&(h=u,u=null);const _=Ls(f)?f.changedTouches[0]:f;if(!_)return;const E=n.getId(p),{clientX:T,clientY:F}=_;z(e)({type:me[g],id:E,x:T,y:F,...h!==null&&{pointerType:h}})};return Object.keys(me).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&c[l]!==!1).forEach(l=>{let f=Gt(l);const p=d(l);if(window.PointerEvent)switch(me[l]){case me.MouseDown:case me.MouseUp:f=f.replace("mouse","pointer");break;case me.TouchStart:case me.TouchEnd:return}a.push(ge(f,p,t))}),z(()=>{a.forEach(l=>l())})}function Ou({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=z(En(z(a=>{const u=Ln(a);if(!u||ve(u,r,s,i,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=Tu(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return ge("scroll",c,t)}function rS({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=z(En(z(()=>{const i=vu(),o=Iu();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return ge("resize",s,t)}const sS=["INPUT","TEXTAREA","SELECT"],ea=new WeakMap;function iS({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g}){function _(S){let k=Ln(S);const J=S.isTrusted,y=k&&Os(k.tagName);if(y==="OPTION"&&(k=k.parentElement),!k||!y||sS.indexOf(y)<0||ve(k,r,s,i,!0))return;const w=k;if(w.classList.contains(o)||c&&w.matches(c))return;const P=vi(k);let j=Er(w,y,P),O=!1;const ce=Fr({maskInputOptions:a,tagName:y,type:P}),Q=Yt(k,f,h,p,g,ce);(P==="radio"||P==="checkbox")&&(O=k.checked),j=Sn({isMasked:Q,element:k,value:j,maskInputFn:u}),E(k,l?{text:j,isChecked:O,userTriggered:J}:{text:j,isChecked:O});const ne=k.name;P==="radio"&&ne&&O&&t.querySelectorAll(`input[type="radio"][name="${ne}"]`).forEach(b=>{if(b!==k){const Y=Sn({isMasked:Q,element:b,value:Er(b,y,P),maskInputFn:u});E(b,l?{text:Y,isChecked:!O,userTriggered:!1}:{text:Y,isChecked:!O})}})}function E(S,k){const J=ea.get(S);if(!J||J.text!==k.text||J.isChecked!==k.isChecked){ea.set(S,k);const y=n.getId(S);z(e)({...k,id:y})}}const F=(d.input==="last"?["change"]:["input","change"]).map(S=>ge(S,z(_),t)),B=t.defaultView;if(!B)return()=>{F.forEach(S=>S())};const q=B.Object.getOwnPropertyDescriptor(B.HTMLInputElement.prototype,"value"),N=[[B.HTMLInputElement.prototype,"value"],[B.HTMLInputElement.prototype,"checked"],[B.HTMLSelectElement.prototype,"value"],[B.HTMLTextAreaElement.prototype,"value"],[B.HTMLSelectElement.prototype,"selectedIndex"],[B.HTMLOptionElement.prototype,"selected"]];return q&&q.set&&F.push(...N.map(S=>bu(S[0],S[1],{set(){z(_)({target:this,isTrusted:!1})}},!1,B))),z(()=>{F.forEach(S=>S())})}function vr(e){const t=[];function n(r,s){if(Gn("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Gn("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Gn("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Gn("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(o)}return s}return n(e,t)}function et(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function oS({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:z((d,l,f)=>{const[p,h]=f,{id:g,styleId:_}=et(l,t,n.styleMirror);return(g&&g!==-1||_&&_!==-1)&&e({id:g,styleId:_,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:z((d,l,f)=>{const[p]=f,{id:h,styleId:g}=et(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,removes:[{index:p}]}),d.apply(l,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:z((d,l,f)=>{const[p]=f,{id:h,styleId:g}=et(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replace:p}),d.apply(l,f)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:z((d,l,f)=>{const[p]=f,{id:h,styleId:g}=et(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replaceSync:p}),d.apply(l,f)})}));const a={};Yn("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Yn("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Yn("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Yn("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:z((f,p,h)=>{const[g,_]=h,{id:E,styleId:T}=et(p.parentStyleSheet,t,n.styleMirror);return(E&&E!==-1||T&&T!==-1)&&e({id:E,styleId:T,adds:[{rule:g,index:[...vr(p),_||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:z((f,p,h)=>{const[g]=h,{id:_,styleId:E}=et(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||E&&E!==-1)&&e({id:_,styleId:E,removes:[{index:[...vr(p),g]}]}),f.apply(p,h)})})}),z(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),c&&(r.CSSStyleSheet.prototype.replaceSync=c),Object.entries(a).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function Pu({mirror:e,stylesheetManager:t},n){var o,c,a;let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?(o=n.defaultView)==null?void 0:o.Document:(a=(c=n.ownerDocument)==null?void 0:c.defaultView)==null?void 0:a.ShadowRoot,i=s!=null&&s.prototype?Object.getOwnPropertyDescriptor(s==null?void 0:s.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var u;return(u=i.get)==null?void 0:u.call(this)},set(u){var l;const d=(l=i.set)==null?void 0:l.call(this,u);if(r!==null&&r!==-1)try{t.adoptStyleSheets(u,r)}catch{}return d}}),z(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function aS({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:z((c,a,u)=>{var g;const[d,l,f]=u;if(n.has(d))return i.apply(a,[d,l,f]);const{id:p,styleId:h}=et((g=a.parentRule)==null?void 0:g.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:vr(a.parentRule)}),c.apply(a,u)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:z((c,a,u)=>{var p;const[d]=u;if(n.has(d))return o.apply(a,[d]);const{id:l,styleId:f}=et((p=a.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:vr(a.parentRule)}),c.apply(a,u)})}),z(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function cS({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=z(u=>En(z(d=>{const l=Ln(d);if(!l||ve(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:g}=l;e({type:u,id:s.getId(l),currentTime:f,volume:p,muted:h,playbackRate:g})}),i.media||500)),a=[ge("play",c(Lt.Play),o),ge("pause",c(Lt.Pause),o),ge("seeked",c(Lt.Seeked),o),ge("volumechange",c(Lt.VolumeChange),o),ge("ratechange",c(Lt.RateChange),o)];return z(()=>{a.forEach(u=>u())})}function uS({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,u,d){const l=new i(a,u,d);return s.set(l,{family:a,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const o=wi(t.fonts,"add",function(c){return function(a){return $r(z(()=>{const u=s.get(a);u&&(e(u),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),z(()=>{r.forEach(c=>c())})}function lS(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=z(()=>{const u=t.getSelection();if(!u||c&&(u!=null&&u.isCollapsed))return;c=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f<l;f++){const p=u.getRangeAt(f),{startContainer:h,startOffset:g,endContainer:_,endOffset:E}=p;ve(h,r,s,i,!0)||ve(_,r,s,i,!0)||d.push({start:n.getId(h),startOffset:g,end:n.getId(_),endOffset:E})}o({ranges:d})});return a(),ge("selectionchange",a)}function dS({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:wi(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function fS(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=Nu(e,e.doc));const s=tS(e),i=nS(e),o=Ou(e),c=rS(e,{win:n}),a=iS(e),u=cS(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=oS(e,{win:n}),l=Pu(e,e.doc),f=aS(e,{win:n}),e.collectFonts&&(p=uS(e)));const h=lS(e),g=dS(e),_=[];for(const E of e.plugins)_.push(E.observer(E.callback,n,E.options));return z(()=>{Ut.forEach(E=>E.reset()),r==null||r.disconnect(),s(),i(),o(),c(),a(),u(),d(),l(),f(),p(),h(),g(),_.forEach(E=>E())})}function Gn(e){return typeof window[e]<"u"}function Yn(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Bs{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,s){const i=r||this.getIdToRemoteIdMap(t),o=s||this.getRemoteIdToIdMap(t);let c=i.get(n);return c||(c=this.generateIdFn(),i.set(n,c),o.set(c,n)),c}getIds(t,n){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,s))}getRemoteId(t,n,r){const s=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(s=>this.getRemoteId(t,s,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 pS{constructor(){this.crossOriginIframeMirror=new Bs(Ii),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class hS{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Bs(Ii),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Bs(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),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=t.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t);const r=Ri(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 s=this.crossOriginIframeMap.get(t.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case $.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:$.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case $.Meta:case $.Load:case $.DomContentLoaded:return!1;case $.Plugin:return n;case $.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case $.IncrementalSnapshot:switch(n.data.source){case A.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),n.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case A.Drag:case A.TouchMove:case A.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(n.data,t,["id"]),n;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case A.Font:return n;case A.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),n;case A.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),n}}return!1}replace(t,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));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!==ue.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class mS{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class gS{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(!dn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=Nu({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Ou({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),$r(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Pu({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=Ri(t),r=K_(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(wi(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&xu(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var ta="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_S=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Kn=0;Kn<ta.length;Kn++)_S[ta.charCodeAt(Kn)]=Kn;class na{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class SS{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new j_,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:[]},s=[];for(const i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),s.push({styleId:o,rules:Array.from(i.rules||CSSRule,(c,a)=>({rule:pu(c),index:a}))})),r.styleIds.push(o)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class yS{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.active||(this.active=!0,G_(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let se,Ir;var ba;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((ba=e.contentWindow)==null?void 0:ba.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Pe=__();function Ye(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:c="rr-ignore",ignoreSelector:a=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:g,maskInputOptions:_,slimDOMOptions:E,maskAttributeFn:T,maskInputFn:F,maskTextFn:B,maxCanvasSize:q=null,packFn:N,sampling:S={},dataURLOptions:k={},mousemoveWait:J,recordDOM:y=!0,recordCanvas:w=!1,recordCrossOriginIframes:P=!1,recordAfter:j=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:O=!1,collectFonts:ce=!1,inlineImages:Q=!1,plugins:ne,keepIframeSrcFn:b=()=>!1,ignoreCSSAttributes:Y=new Set([]),errorHandler:R,onMutation:K,getCanvasManager:Z}=e;Z_(R);const re=P?window.parent===window:!0;let be=!1;if(!re)try{window.parent.document&&(be=!1)}catch{be=!0}if(re&&!t)throw new Error("emit function is required");if(!re&&!be)return()=>{};J!==void 0&&S.mousemove===void 0&&(S.mousemove=J),Pe.reset();const Te=g===!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}:_!==void 0?_:{},xt=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:E==="all",headMetaDescKeywords:E==="all"}:E||{};z_();let We,At=0;const Fn=V=>{for(const Oe of ne||[])Oe.eventProcessor&&(V=Oe.eventProcessor(V));return N&&!be&&(V=N(V)),V};se=(V,Oe)=>{var _e;const W=V;if(W.timestamp=Tr(),(_e=Ut[0])!=null&&_e.isFrozen()&&W.type!==$.FullSnapshot&&!(W.type===$.IncrementalSnapshot&&W.data.source===A.Mutation)&&Ut.forEach(we=>we.unfreeze()),re)t==null||t(Fn(W),Oe);else if(be){const we={type:"rrweb",event:Fn(W),origin:window.location.origin,isCheckout:Oe};window.parent.postMessage(we,"*")}if(W.type===$.FullSnapshot)We=W,At=0;else if(W.type===$.IncrementalSnapshot){if(W.data.source===A.Mutation&&W.data.isAttachIframe)return;At++;const we=r&&At>=r,X=n&&We&&W.timestamp-We.timestamp>n;(we||X)&&qr(!0)}};const an=V=>{se({type:$.IncrementalSnapshot,data:{source:A.Mutation,...V}})},$i=V=>se({type:$.IncrementalSnapshot,data:{source:A.Scroll,...V}}),ml=V=>se({type:$.IncrementalSnapshot,data:{source:A.CanvasMutation,...V}}),gl=V=>se({type:$.IncrementalSnapshot,data:{source:A.AdoptedStyleSheet,...V}}),dt=new SS({mutationCb:an,adoptedStyleSheetCb:gl}),ft=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new pS:new hS({mirror:Pe,mutationCb:an,stylesheetManager:dt,recordCrossOriginIframes:P,wrappedEmit:se});for(const V of ne||[])V.getMirror&&V.getMirror({nodeMirror:Pe,crossOriginIframeMirror:ft.crossOriginIframeMirror,crossOriginIframeStyleMirror:ft.crossOriginIframeStyleMirror});const zr=new yS,jr=bS(Z,{mirror:Pe,win:window,mutationCb:V=>se({type:$.IncrementalSnapshot,data:{source:A.CanvasMutation,...V}}),recordCanvas:w,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:q,sampling:S.canvas,dataURLOptions:k,errorHandler:R}),Bn=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new mS:new gS({mutationCb:an,scrollCb:$i,bypassOptions:{onMutation:K,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:Te,dataURLOptions:k,maskAttributeFn:T,maskTextFn:B,maskInputFn:F,recordCanvas:w,inlineImages:Q,sampling:S,slimDOMOptions:xt,iframeManager:ft,stylesheetManager:dt,canvasManager:jr,keepIframeSrcFn:b,processedNodeManager:zr,ignoreCSSAttributes:Y},mirror:Pe}),qr=(V=!1)=>{if(!y)return;se({type:$.Meta,data:{href:window.location.href,width:Iu(),height:vu()}},V),dt.reset(),Bn.init(),Ut.forEach(W=>W.lock());const Oe=H_(document,{mirror:Pe,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:Te,maskAttributeFn:T,maskInputFn:F,maskTextFn:B,slimDOM:xt,dataURLOptions:k,recordCanvas:w,inlineImages:Q,onSerialize:W=>{Ru(W,Pe)&&ft.addIframe(W),Cu(W,Pe)&&dt.trackLinkElement(W),Ds(W)&&Bn.addShadowRoot(W.shadowRoot,document)},onIframeLoad:(W,_e)=>{ft.attachIframe(W,_e),W.contentWindow&&jr.addWindow(W.contentWindow),Bn.observeAttachShadow(W)},onStylesheetLoad:(W,_e)=>{dt.attachLinkElement(W,_e)},onBlockedImageLoad:(W,_e,{width:we,height:X})=>{an({adds:[],removes:[],texts:[],attributes:[{id:_e.id,attributes:{style:{width:`${we}px`,height:`${X}px`}}}]})},keepIframeSrcFn:b,ignoreCSSAttributes:Y});if(!Oe)return console.warn("Failed to snapshot the document");se({type:$.FullSnapshot,data:{node:Oe,initialOffset:Tu(window)}}),Ut.forEach(W=>W.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&dt.adoptStyleSheets(document.adoptedStyleSheets,Pe.getId(document))};Ir=qr;try{const V=[],Oe=_e=>{var we;return z(fS)({onMutation:K,mutationCb:an,mousemoveCb:(X,Vr)=>se({type:$.IncrementalSnapshot,data:{source:Vr,positions:X}}),mouseInteractionCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.MouseInteraction,...X}}),scrollCb:$i,viewportResizeCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.ViewportResize,...X}}),inputCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.Input,...X}}),mediaInteractionCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.MediaInteraction,...X}}),styleSheetRuleCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.StyleSheetRule,...X}}),styleDeclarationCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.StyleDeclaration,...X}}),canvasMutationCb:ml,fontCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.Font,...X}}),selectionCb:X=>{se({type:$.IncrementalSnapshot,data:{source:A.Selection,...X}})},customElementCb:X=>{se({type:$.IncrementalSnapshot,data:{source:A.CustomElement,...X}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:Te,inlineStylesheet:h,sampling:S,recordDOM:y,recordCanvas:w,inlineImages:Q,userTriggeredOnInput:O,collectFonts:ce,doc:_e,maskAttributeFn:T,maskInputFn:F,maskTextFn:B,keepIframeSrcFn:b,blockSelector:i,unblockSelector:o,slimDOMOptions:xt,dataURLOptions:k,mirror:Pe,iframeManager:ft,stylesheetManager:dt,shadowDomManager:Bn,processedNodeManager:zr,canvasManager:jr,ignoreCSSAttributes:Y,plugins:((we=ne==null?void 0:ne.filter(X=>X.observer))==null?void 0:we.map(X=>({observer:X.observer,options:X.options,callback:Vr=>se({type:$.Plugin,data:{plugin:X.name,payload:Vr}})})))||[]},{})};ft.addLoadListener(_e=>{try{V.push(Oe(_e.contentDocument))}catch(we){console.warn(we)}});const W=()=>{qr(),V.push(Oe(document))};return document.readyState==="interactive"||document.readyState==="complete"?W():(V.push(ge("DOMContentLoaded",()=>{se({type:$.DomContentLoaded,data:{}}),j==="DOMContentLoaded"&&W()})),V.push(ge("load",()=>{se({type:$.Load,data:{}}),j==="load"&&W()},window))),()=>{V.forEach(_e=>_e()),zr.destroy(),Ir=void 0,eS()}}catch(V){console.warn(V)}}function ES(e){if(!Ir)throw new Error("please take full snapshot after start recording");Ir(e)}Ye.mirror=Pe;Ye.takeFullSnapshot=ES;function bS(e,t){try{return e?e(t):new na}catch{return console.warn("Unable to initialize CanvasManager"),new na}}var ra;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ra||(ra={}));const TS=3,vS=5;function Ci(e){return e>9999999999?e:e*1e3}function us(e){return e>9999999999?e/1e3:e}function Dn(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:$.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Ce(t,10,1e3)}}),t.category==="console")))}const IS="button,a";function Lu(e){return e.closest(IS)||e}function Du(e){const t=Fu(e);return!t||!(t instanceof Element)?t:Lu(t)}function Fu(e){return wS(e)?e.target:e}function wS(e){return typeof e=="object"&&!!e&&"target"in e}let tt;function kS(e){return tt||(tt=[],RS()),tt.push(e),()=>{const t=tt?tt.indexOf(e):-1;t>-1&&tt.splice(t,1)}}function RS(){ye(te,"open",function(e){return function(...t){if(tt)try{tt.forEach(n=>n())}catch{}return e.apply(te,t)}})}const CS=new Set([A.Mutation,A.StyleSheetRule,A.StyleDeclaration,A.AdoptedStyleSheet,A.CanvasMutation,A.Selection,A.MediaInteraction]);function MS(e,t,n){e.handleClick(t,n)}class xS{constructor(t,n,r=Dn){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=kS(()=>{this._lastMutation=sa()});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(NS(n,this._ignoreSelector)||!OS(t))return;const r={timestamp:us(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=us(t)}registerScroll(t=Date.now()){this._lastScroll=us(t)}registerClick(t){const n=Lu(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=sa();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 s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:o,clickBreadcrumb:c}=t;if(i){const a=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=a<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:{...c.data,url:te.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:u,clickCount:o||1}};this._addBreadcrumbEvent(n,d);return}if(o>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:te.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Pn(()=>this._checkClicks(),1e3)}}const AS=["A","BUTTON","INPUT"];function NS(e,t){return!!(!AS.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 OS(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function sa(){return Date.now()/1e3}function PS(e,t){try{if(!LS(t))return;const{source:n}=t.data;if(CS.has(n)&&e.registerMutation(t.timestamp),n===A.Scroll&&e.registerScroll(t.timestamp),DS(t)){const{type:r,id:s}=t.data,i=Ye.mirror.getNode(s);i instanceof HTMLElement&&r===me.Click&&e.registerClick(i)}}catch{}}function LS(e){return e.type===TS}function DS(e){return e.data.source===A.MouseInteraction}function Be(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Mi=(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))(Mi||{});const FS=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function BS(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(FS.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const $S=e=>t=>{if(!e.isEnabled())return;const n=US(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&(s!=null&&s.target)&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&MS(e.clickDetector,n,Du(t.event)),Dn(e,n)};function Bu(e,t){const n=Ye.mirror.getId(e),r=n&&Ye.mirror.getNode(n),s=r&&Ye.mirror.getMeta(r),i=s&&WS(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===Mi.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:BS(i.attributes)}}:{}}}function US(e){const{target:t,message:n}=HS(e);return Be({category:`ui.${e.name}`,...Bu(t,n)})}function HS(e){const t=e.name==="click";let n,r=null;try{r=t?Du(e.event):Fu(e.event),n=Ee(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function WS(e){return e.type===Mi.Element}function zS(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=jS(t);n&&Dn(e,n)}function jS(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||qS(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const u=Ee(o,{maxStringLength:200})||"<unknown>",d=Bu(o,u);return Be({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function qS(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const VS={resource:JS,paint:KS,navigation:XS};function ls(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function GS(e){return e.map(YS).filter(Boolean)}function YS(e){const t=VS[e.entryType];return t?t(e):null}function Kt(e){return((he()||te.performance.timeOrigin)+e)/1e3}function KS(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=Kt(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function XS(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:g}=e;return s===0?null:{type:`${t}.${g}`,start:Kt(p),end:Kt(i),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:d,loadEventEnd:l,domComplete:i,redirectCount:f}}}function JS(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Kt(i),end:Kt(s),name:r,data:{size:u,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function QS(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.element?[t.element]:void 0;return xi(e,"largest-contentful-paint",n)}function ZS(e){return e.sources!==void 0}function ey(e){const t=[],n=[];for(const r of e.entries)if(ZS(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const o=Ye.mirror.getId(i.node);o&&s.push(o)}t.push({value:r.value,nodeIds:s.length?s:void 0})}return xi(e,"cumulative-layout-shift",n,t)}function ty(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.target?[t.target]:void 0;return xi(e,"interaction-to-next-paint",n)}function xi(e,t,n,r){const s=e.value,i=e.rating,o=Kt(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(c=>Ye.mirror.getId(c)):void 0,attributions:r}}}function ny(e){function t(s){e.performanceEntries.includes(s)||e.performanceEntries.push(s)}function n({entries:s}){s.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(kt(s,n))}),r.push(gi(ls(QS,e)),mi(ls(ey,e)),Zc(ls(ty,e))),()=>{r.forEach(s=>s())}}const C=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ry='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 sy(){const e=new Blob([ry]);return URL.createObjectURL(e)}const ia=["log","warn","error"],or="[Replay] ";function ds(e,t="info"){it({category:"console",data:{logger:"replay"},level:t,message:`${or}${e}`},{level:t})}function iy(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return C?(ia.forEach(r=>{n[r]=(...s)=>{m[r](or,...s),t&&ds(s.join(""),Lc(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),m.error(or,r),e?pc(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&ds(r,"error")},n.infoTick=(...r)=>{m.log(or,...r),t&&setTimeout(()=>ds(r[0]),0)}):ia.forEach(r=>{n[r]=()=>{}}),n}const M=iy();class Ai extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Ti}.`)}}class $u{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>Ti)throw new Ai;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(){const t=this.events.map(n=>n.timestamp).sort()[0];return t?Ci(t):null}}class oy{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){C&&M.log("Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const o=({data:c})=>{const a=c;if(a.method===t&&a.id===r){if(this._worker.removeEventListener("message",o),!a.success){C&&M.error("Error in compression worker: ",a.response),i(new Error("Error in compression worker"));return}s(a.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class ay{constructor(t){this._worker=new oy(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=Ci(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>Ti?Promise.reject(new Ai):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{C&&M.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 cy{constructor(t){this._fallback=new $u,this._compression=new ay(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){C&&M.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,s=[];for(const i of t)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){C&&M.exception(i,"Failed to add events when switching buffers.")}}}function uy({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=ly(t);if(n)return n}return C&&M.log("Using simple buffer"),new $u}function ly(e){try{const t=e||dy();if(!t)return;C&&M.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new cy(n)}catch(t){C&&M.exception(t,"Failed to create compression worker")}}function dy(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?sy():""}function Ni(){try{return"sessionStorage"in te&&!!te.sessionStorage}catch{return!1}}function fy(e){py(),e.session=void 0}function py(){if(Ni())try{te.sessionStorage.removeItem(Ei)}catch{}}function Uu(e){return e===void 0?!1:Math.random()<e}function Ur(e){if(Ni())try{te.sessionStorage.setItem(Ei,JSON.stringify(e))}catch{}}function Hu(e){const t=Date.now(),n=e.id||fe(),r=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,c=e.previousSessionId,a=e.dirty||!1;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c,dirty:a}}function hy(e,t){return Uu(e)?"session":t?"buffer":!1}function oa({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=hy(e,t),i=Hu({sampled:s,previousSessionId:r});return n&&Ur(i),i}function my(){if(!Ni())return null;try{const e=te.sessionStorage.getItem(Ei);if(!e)return null;const t=JSON.parse(e);return C&&M.infoTick("Loading existing session"),Hu(t)}catch{return null}}function $s(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function Wu(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return $s(e.started,t,r)||$s(e.lastActivity,n,r)}function zu(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!Wu(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function fs({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&my();return s?zu(s,{sessionIdleExpire:e,maxReplayDuration:t})?(C&&M.infoTick("Session in sessionStorage is expired, creating new one..."),oa(r,{previousSessionId:s.id})):s:(C&&M.infoTick("Creating new session"),oa(r,{previousSessionId:n}))}function gy(e){return e.type===$.Custom}function Oi(e,t,n){return qu(e,t)?(ju(e,t,n),!0):!1}function _y(e,t,n){return qu(e,t)?ju(e,t,n):Promise.resolve(null)}async function ju(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const s=e.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=e.getOptions(),o=Sy(t,i.beforeAddRecordingEvent);return o?await r.addEvent(o):void 0}catch(i){const o=i&&i instanceof Ai,c=o?"addEventSizeExceeded":"addEvent",a=H();if(a){const u=o?"buffer_overflow":"internal_sdk_error";a.recordDroppedEvent(u,"replay")}if(o&&s)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:c})}}function qu(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Ci(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(C&&M.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function Sy(e,t){try{if(typeof t=="function"&&gy(e))return t(e)}catch(n){return C&&M.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Pi(e){return!e.type}function Us(e){return e.type==="transaction"}function yy(e){return e.type==="replay_event"}function aa(e){return e.type==="feedback"}function Ey(e){return(t,n)=>{if(!e.isEnabled()||!Pi(t)&&!Us(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(Us(t)){by(e,t);return}Ty(e,t)}}}function by(e,t){var r,s;const n=e.getContext();(s=(r=t.contexts)==null?void 0:r.trace)!=null&&s.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function Ty(e,t){const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||Pn(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(s){e.handleException(s)}})}function vy(e){return t=>{!e.isEnabled()||!Pi(t)||Iy(e,t)}}function Iy(e,t){var r,s,i;const n=(i=(s=(r=t.exception)==null?void 0:r.values)==null?void 0:s[0])==null?void 0:i.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 o=Be({category:"replay.hydrate-error",data:{url:en()}});Dn(e,o)}}function wy(e){const t=H();t&&t.on("beforeAddBreadcrumb",n=>ky(e,n))}function ky(e,t){if(!e.isEnabled()||!Vu(t))return;const n=Ry(t);n&&Dn(e,n)}function Ry(e){return!Vu(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?Cy(e):Be(e)}function Cy(e){var s;const t=(s=e.data)==null?void 0:s.arguments;if(!Array.isArray(t)||t.length===0)return Be(e);let n=!1;const r=t.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>Vn?(n=!0,`${i.slice(0,Vn)}…`):i;if(typeof i=="object")try{const o=Ce(i,7);return JSON.stringify(o).length>Vn?(n=!0,`${JSON.stringify(o,null,2).slice(0,Vn)}…`):o}catch{}return i});return Be({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function Vu(e){return!!e.category}function My(e,t){var n,r,s;return e.type||!((r=(n=e.exception)==null?void 0:n.values)!=null&&r.length)?!1:!!((s=t.originalException)!=null&&s.__rrweb__)}function Gu(){const e=G().getPropagationContext().dsc;e&&delete e.replay_id;const t=pe();if(t){const n=He(t);delete n.replay_id}}function xy(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:$.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 Ay(e,t){return e.recordingMode!=="buffer"||t.message===bi||!t.exception||t.type?!1:Uu(e.getOptions().errorSampleRate)}function Ny(e){return Object.assign((t,n)=>{var o;if(!e.isEnabled()||e.isPaused())return t;if(yy(t))return delete t.breadcrumbs,t;if(!Pi(t)&&!Us(t)&&!aa(t))return t;if(!e.checkAndHandleExpiredSession())return Gu(),t;if(aa(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),xy(e,t),t;if(My(t,n)&&!e.getOptions()._experiments.captureExceptions)return C&&M.log("Ignoring error from rrweb internals",t),null;const s=Ay(e,t);if((s||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),s&&e.recordingMode==="buffer"&&((o=e.session)==null?void 0:o.sampled)==="buffer"){const c=e.session;c.dirty=!0,e.getOptions().stickySession&&Ur(c)}return t},{id:"Replay"})}function Hr(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:$.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:s,data:o}}});return typeof c=="string"?Promise.resolve(null):c})}function Oy(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 Py(e){return t=>{if(!e.isEnabled())return;const n=Oy(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Hr(e,[n]),!1)))}}function Ly(e,t){return C&&e.getOptions()._experiments.traceInternals?!1:mp(t,H())}function Yu(e,t){e.isEnabled()&&t!==null&&(Ly(e,t.name)||e.addUpdate(()=>(Hr(e,[t]),!0)))}function Wr(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=au(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function Ku(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function wr(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 Xu(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:c,response:a}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:{method:i,statusCode:o,request:c,response:a}}}function bn(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function nt(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:s,warnings:i}=Dy(n);return r.body=s,i!=null&&i.length&&(r._meta={warnings:i}),r}function Hs(e,t){return Object.entries(e).reduce((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n},{})}function Dy(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Ho,n=Fy(e);if(t){const r=e.slice(0,Ho);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 Fy(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function kr(e,t){const n=By(e);return Ve(n,t)}function By(e,t=te.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(te.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 $y(e,t,n){try{const r=await Hy(e,t,n),s=Xu("resource.fetch",r);Yu(n.replay,s)}catch(r){C&&M.exception(r,"Failed to capture fetch breadcrumb")}}function Uy(e,t){const{input:n,response:r}=t,s=n?uu(n):void 0,i=Wr(s),o=r?Ku(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}async function Hy(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:o,method:c,status_code:a=0,request_body_size:u,response_body_size:d}=e.data,l=kr(o,n.networkDetailAllowUrls)&&!kr(o,n.networkDetailDenyUrls),f=l?Wy(n,t.input,u):bn(u),p=await zy(l,n,t.response,d);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:p}}function Wy({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?Vy(n,t):{};if(!e)return nt(s,r,void 0);const i=uu(n),[o,c]=cu(i,M),a=nt(s,r,o);return c?wr(a,c):a}async function zy(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return bn(s);const i=r?Ju(r.headers,n):{};if(!r||!t&&s!==void 0)return nt(i,s,void 0);const[o,c]=await qy(r),a=jy(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return c?wr(a,c):a}function jy(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e!=null&&e.length&&n===void 0?Wr(e):n;return r?t?nt(s,i,e):nt(s,i,void 0):bn(i)}catch(i){return C&&M.exception(i,"Failed to serialize response body"),nt(s,n,void 0)}}async function qy(e){const t=Gy(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await Yy(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(C&&M.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(C&&M.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function Ju(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function Vy(e,t){return e.length===1&&typeof e[0]!="string"?ca(e[0],t):e.length===2?ca(e[1],t):{}}function ca(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?Ju(n,t):Array.isArray(n)?{}:Hs(n,t):{}}function Gy(e){try{return e.clone()}catch(t){C&&M.exception(t,"Failed to clone response body")}}function Yy(e){return new Promise((t,n)=>{const r=Pn(()=>n(new Error("Timeout while trying to read response body")),500);Ky(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function Ky(e){return await e.text()}async function Xy(e,t,n){try{const r=Qy(e,t,n),s=Xu("resource.xhr",r);Yu(n.replay,s)}catch(r){C&&M.exception(r,"Failed to capture xhr breadcrumb")}}function Jy(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=Wr(r),i=n.getResponseHeader("content-length")?Ku(n.getResponseHeader("content-length")):tE(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function Qy(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!a)return null;if(!c||!kr(a,n.networkDetailAllowUrls)||kr(a,n.networkDetailDenyUrls)){const N=bn(l),S=bn(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:N,response:S}}const p=c[ht],h=p?Hs(p.request_headers,n.networkRequestHeaders):{},g=Hs(lu(c),n.networkResponseHeaders),[_,E]=n.networkCaptureBodies?cu(o,M):[void 0],[T,F]=n.networkCaptureBodies?Zy(c):[void 0],B=nt(h,l,_),q=nt(g,f,T);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:E?wr(B,E):B,response:F?wr(q,F):q}}function Zy(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return eE(e.response,e.responseType)}catch(n){t.push(n)}return C&&M.warn("Failed to get xhr response body",...t),[void 0]}function eE(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 C&&M.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return C&&M.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function tE(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return Wr(n)}catch{return}}function nE(e){const t=H();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=e.getOptions(),c={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(a,u)=>rE(c,a,u))}catch{}}function rE(e,t,n){if(t.data)try{sE(t)&&oE(n)&&(Jy(t,n),Xy(t,n,e)),iE(t)&&aE(n)&&(Uy(t,n),$y(t,n,e))}catch(r){C&&M.exception(r,"Error when enriching network breadcrumb")}}function sE(e){return e.category==="xhr"}function iE(e){return e.category==="fetch"}function oE(e){return e==null?void 0:e.xhr}function aE(e){return e==null?void 0:e.response}function cE(e){const t=H();iu($S(e)),Dr(Py(e)),wy(e),nE(e);const n=Ny(e);Mf(n),t&&(t.on("beforeSendEvent",vy(e)),t.on("afterSendEvent",Ey(e)),t.on("createDsc",r=>{const s=e.getSessionId();s&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=s)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,s)=>{var o;const i=e.getSessionId();s!=null&&s.includeReplay&&e.isEnabled()&&i&&((o=r.contexts)!=null&&o.feedback)&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function uE(e){try{return Promise.all(Hr(e,[lE(te.performance.memory)]))}catch{return[]}}function lE(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function dE(e,t,n){return bp(e,t,{...n,setTimeoutImpl:Pn})}const Re=L.navigator;function fE(){return/iPhone|iPad|iPod/i.test((Re==null?void 0:Re.userAgent)??"")||/Macintosh/i.test((Re==null?void 0:Re.userAgent)??"")&&(Re!=null&&Re.maxTouchPoints)&&(Re==null?void 0:Re.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function pE(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){C&&M.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&PS(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Oi(e,n,s))return!0;if(!s)return!1;const i=e.session;if(mE(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){const o=e.eventBuffer.getEarliestTimestamp();o&&(C&&M.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&Ur(i))}return i!=null&&i.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function hE(e){const t=e.getOptions();return{type:$.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 mE(e,t){!t||!e.session||e.session.segmentId!==0||Oi(e,hE(e),!1)}function gE(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function _E(e,t,n,r){return Qe(ic(e,Ar(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function SE({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}
24
- `;if(typeof e=="string")n=`${r}${e}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function yE({client:e,scope:t,replayId:n,event:r}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:s};e.emit("preprocessEvent",r,i);const o=await fc(e.getOptions(),r,i,t,e,De());if(!o)return null;e.emit("postprocessEvent",o,i),o.platform=o.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:u,settings:d}=(c==null?void 0:c.sdk)||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},o}async function EE({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=SE({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:u,initialTimestamp:d}=r,l=H(),f=G(),p=l==null?void 0:l.getTransport(),h=l==null?void 0:l.getDsn();if(!l||!p||!h||!i.sampled)return Promise.resolve({});const g={type:Xg,replay_start_timestamp:d/1e3,timestamp:s/1e3,error_ids:a,trace_ids:u,urls:c,replay_id:t,segment_id:n,replay_type:i.sampled},_=await yE({scope:f,client:l,replayId:t,event:g});if(!_)return l.recordDroppedEvent("event_processor","replay"),C&&M.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete _.sdkProcessingMetadata;const E=_E(_,o,h,l.getOptions().tunnel);let T;try{T=await p.send(E)}catch(B){const q=new Error(bi);try{q.cause=B}catch{}throw q}if(typeof T.statusCode=="number"&&(T.statusCode<200||T.statusCode>=300))throw new Qu(T.statusCode);const F=Ac({},T);if(xc(F,"replay"))throw new Li(F);return T}class Qu extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Li extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function Zu(e,t={count:0,interval:n_}){const{recordingData:n,onError:r}=e;if(n.length)try{return await EE(e),!0}catch(s){if(s instanceof Qu||s instanceof Li)throw s;if(mc("Replays",{_retryCount:t.count}),r&&r(s),t.count>=r_){const i=new Error(`${bi} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{Pn(async()=>{try{await Zu(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const el="__THROTTLED",bE="__SKIPPED";function TE(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((u,d)=>{d<a&&r.delete(d)})},i=()=>[...r.values()].reduce((c,a)=>c+a,0);let o=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),i()>=t){const d=o;return o=!0,d?bE:el}o=!1;const u=r.get(a)||0;return r.set(a,u+1),e(...c)}}class vE{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:Jg,sessionIdleExpire:Qg},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=dE(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=TE((o,c)=>_y(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(s_,r),timeout:r,scrollTimeout:i_,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new xS(this,i)),C){const o=t._experiments;M.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{te.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=Be({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=Be({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{zS(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){C&&M.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(t),!this.session){C&&M.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",C&&M.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){C&&M.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){C&&M.log("Buffering is in progress, call `flush()` to save the replay");return}C&&M.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=fs({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){C&&M.log("Buffering is in progress, call `flush()` to save the replay");return}C&&M.infoTick("Starting replay in buffer mode");const t=fs({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=Ye({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:t_}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:pE(this),...fE(),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 r;if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{C&&M.log(`Stopping Replay${n?` triggered by ${n}`:""}`),Gu(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),(r=this.eventBuffer)==null||r.destroy(),this.eventBuffer=null,fy(this)}catch(s){this.handleException(s)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),C&&M.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),C&&M.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();C&&M.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()),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(){if(this._lastActivity&&$s(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${te.location.pathname}${te.location.hash}${te.location.search}`,n=`${te.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===el){const s=Be({category:"replay.throttled"});this.addUpdate(()=>!Oi(this,{type:vS,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||pe(),n=t&&le(t),s=(n&&U(n).data||{})[xe];if(!(!n||!s||!["route","custom"].includes(s)))return U(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=uy({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=fs({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 zu(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{te.document.addEventListener("visibilitychange",this._handleVisibilityChange),te.addEventListener("blur",this._handleWindowBlur),te.addEventListener("focus",this._handleWindowFocus),te.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(cE(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=ny(this)}_removeListeners(){try{te.document.removeEventListener("visibilitychange",this._handleVisibilityChange),te.removeEventListener("blur",this._handleWindowBlur),te.removeEventListener("focus",this._handleWindowFocus),te.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||Wu(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){C&&M.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:$.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=GS(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(Hr(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){C&&M.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!((n=this.eventBuffer)!=null&&n.hasEvents)&&(await uE(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const s=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const o=await this.eventBuffer.finish();await Zu({replayId:t,recordingData:o,segmentId:i,eventContext:s,session:this.session,timestamp:r,onError:c=>this.handleException(c)})}catch(r){this.handleException(r),this.stop({reason:"sendReplay"});const s=H();if(s){const i=r instanceof Li?"ratelimit_backoff":"send_error";s.recordDroppedEvent(i,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){C&&M.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,s=Date.now()-n;this._debouncedFlush.cancel();const i=s<this._options.minReplayDuration,o=s>this._options.maxReplayDuration+5e3;if(i||o){C&&M.log(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const c=this.eventBuffer;c&&this.session.segmentId===0&&!c.hasCheckout&&C&&M.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Ur(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n!=null&&n.length&&t.some(c=>{const a=gE(c.target),u=n.join(",");return a==null?void 0:a.matches(u)}))return!1;const r=t.length,s=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,o=s&&r>s;if(r>i||o){const c=Be({category:"replay.mutations",data:{count:r,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function cn(e,t){return[...e,...t].join(",")}function IE({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=cn(e,[".sentry-mask","[data-sentry-mask]"]),c=cn(t,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:cn(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:cn(r,[]),ignoreSelector:cn(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function wE({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const ua='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',kE=["content-length","content-type","accept"];let la=!1;const RE=e=>new CE(e);class CE{constructor({flushMinDelay:t=Zg,flushMaxDelay:n=e_,minReplayDuration:r=o_,maxReplayDuration:s=Wo,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:E=[],networkCaptureBodies:T=!0,networkRequestHeaders:F=[],networkResponseHeaders:B=[],mask:q=[],maskAttributes:N=["title","placeholder","aria-label"],unmask:S=[],block:k=[],unblock:J=[],ignore:y=[],maskFn:w,beforeAddRecordingEvent:P,beforeErrorSampling:j,onError:O}={}){this.name="Replay";const ce=IE({mask:q,unmask:S,block:k,unblock:J,ignore:y});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:w,maskInputFn:w,maskAttributeFn:(Q,ne,b)=>wE({maskAttributes:N,maskAllText:u,privacyOptions:ce,key:Q,value:ne,el:b}),...ce,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:Q=>{try{Q.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!a.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,a_),maxReplayDuration:Math.min(s,Wo),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:g,networkDetailAllowUrls:_,networkDetailDenyUrls:E,networkCaptureBodies:T,networkRequestHeaders:da(F),networkResponseHeaders:da(B),beforeAddRecordingEvent:P,beforeErrorSampling:j,onError:O,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${ua}`:ua,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Is())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return la}set _isInitialized(t){la=t}afterAllSetup(t){!Is()||this._replay||(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"}):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}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=ME(this._initialOptions,t);this._replay=new vE({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function ME(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=It(n.replaysSessionSampleRate),i=It(n.replaysOnErrorSampleRate);return s==null&&i==null&&at(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function da(e){return[...kE,...e.map(t=>t.toLowerCase())]}function xE(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function tl(e){try{return new URL(e,D.location.origin).href}catch{return}}function AE(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function nl(e){try{return new Headers(e)}catch{return}}const fa=new WeakMap,ps=new Map,rl={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function NE(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:c,onRequestSpanStart:a,onRequestSpanEnd:u}={...rl,...t},d=typeof i=="function"?i:h=>!0,l=h=>OE(h,c),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(g=>{if(g.op==="http.client"){const _=ps.get(g.span_id);_&&(g.timestamp=_/1e3,ps.delete(g.span_id))}}),h)),s&&ah(h=>{if(h.response){const g=fa.get(h.response);g&&h.endTimestamp&&ps.set(g,h.endTimestamp)}}),$c(h=>{const g=qp(h,d,l,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&fa.set(h.response,h.fetchData.__span),g){const _=tl(h.fetchData.url),E=_?Et(_).host:void 0;g.setAttributes({"http.url":_,"server.address":E}),o&&pa(g),a==null||a(g,{headers:h.headers})}})),r&&ou(h=>{var _;const g=PE(h,d,l,f,p,u);g&&(o&&pa(g),a==null||a(g,{headers:nl((_=h.xhr.__sentry_xhr_v3__)==null?void 0:_.request_headers)}))})}function pa(e){const{url:t}=U(e).data;if(!t||typeof t!="string")return;const n=kt("resource",({entries:r})=>{r.forEach(s=>{AE(s)&&s.name.endsWith(t)&&(e.setAttributes(su(s)),setTimeout(n))})})}function OE(e,t){const n=en();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Ve(r.toString(),t)||i&&Ve(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Ve(e,t):r}}function PE(e,t,n,r,s,i){const o=e.xhr,c=o==null?void 0:o[ht];if(!o||o.__sentry_own_request__||!c)return;const{url:a,method:u}=c,d=Ne()&&t(a);if(e.endTimestamp&&d){const E=o.__sentry_xhr_span_id__;if(!E)return;const T=r[E];T&&c.status_code!==void 0&&(za(T,c.status_code),T.end(),i==null||i(T,{headers:nl(lu(o)),error:e.error}),delete r[E]);return}const l=tl(a),f=Et(l||a),p=hp(a),h=!!pe(),g=d&&h?rn({name:`${u} ${p}`,attributes:{url:a,type:"xhr","http.method":u,"http.url":l,"server.address":f==null?void 0:f.host,[ae]:"auto.http.browser",[Ue]:"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 st;o.__sentry_xhr_span_id__=g.spanContext().spanId,r[o.__sentry_xhr_span_id__]=g,n(a)&&LE(o,Ne()&&h?g:void 0,s);const _=H();return _&&_.emit("beforeOutgoingRequestSpan",g,e),g}function LE(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=Oc({span:t,propagateTraceparent:n});r&&DE(e,r,s,i)}function DE(e,t,n,r){var i;const s=(i=e.__sentry_xhr_v3__)==null?void 0:i.request_headers;if(!(s!=null&&s["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(s!=null&&s.traceparent)&&e.setRequestHeader("traceparent",r),n){const o=s==null?void 0:s.baggage;(!o||!xE(o))&&e.setRequestHeader("baggage",n)}}catch{}}function FE(){D.document?D.document.addEventListener("visibilitychange",()=>{const e=pe();if(!e)return;const t=le(e);if(D.document.hidden&&t){const n="cancelled",{op:r,status:s}=U(t);I&&m.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:de,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):I&&m.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const BE=3600,sl="sentry_previous_trace",$E="sentry.previous_trace";function UE(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?zE():void 0;e.on("spanStart",o=>{if(le(o)!==o)return;const c=G().getPropagationContext();s=HE(s,o,c),r&&WE(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const c=G(),a=c.getPropagationContext();if(i&&a.parentSpanId){i=!1;return}c.setPropagationContext({...a,dsc:{...a.dsc,sample_rate:String(s.sampleRate),sampled:String(Ws(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=Ws(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[Wa]:s.sampleRate}})}function HE(e,t,n){const r=U(t);function s(){var c,a;try{return Number((c=n.dsc)==null?void 0:c.sample_rate)??Number((a=r.data)==null?void 0:a[Ks])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=BE&&(I&&m.log(`Adding previous_trace ${o} link to span ${{op:r.op,...t.spanContext()}}`),t.addLink({context:o,attributes:{[ed]:"previous_trace"}}),t.setAttribute($E,`${o.traceId}-${o.spanId}-${Ws(o)?1:0}`)),i)}function WE(e){try{D.sessionStorage.setItem(sl,JSON.stringify(e))}catch(t){I&&m.warn("Could not store previous trace in sessionStorage",t)}}function zE(){var e;try{const t=(e=D.sessionStorage)==null?void 0:e.getItem(sl);return JSON.parse(t)}catch{return}}function Ws(e){return e.traceFlags===1}const jE="BrowserTracing",qE={...tr,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...rl},VE=(e={})=>{const t={name:void 0,source:void 0},n=D.document,{enableInp:r,enableElementTiming:s,enableLongTask:i,enableLongAnimationFrame:o,_experiments:{enableInteractions:c,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:u},beforeStartSpan:d,idleTimeout:l,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:g,traceXHR:_,trackFetchStreamPerformance:E,shouldCreateSpanForRequest:T,enableHTTPTimings:F,ignoreResourceSpans:B,ignorePerformanceApiSpans:q,instrumentPageLoad:N,instrumentNavigation:S,detectRedirects:k,linkPreviousTrace:J,consistentTraceSampling:y,enableReportPageLoaded:w,onRequestSpanStart:P,onRequestSpanEnd:j}={...qE,...e};let O,ce,Q;function ne(b,Y,R=!0){const K=Y.op==="pageload",Z=Y.name,re=d?d(Y):Y,be=re.attributes||{};if(Z!==re.name&&(be[xe]="custom",re.attributes=be),!R){const We=Ct();rn({...re,startTime:We}).end(We);return}t.name=re.name,t.source=be[xe];const Te=lc(re,{idleTimeout:l,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:K,beforeSpanEnd:We=>{O==null||O(),gm(We,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!u,ignoreResourceSpans:B,ignorePerformanceApiSpans:q}),ma(b,void 0);const At=G(),Fn=At.getPropagationContext();At.setPropagationContext({...Fn,traceId:Te.spanContext().traceId,sampled:lt(Te),dsc:He(We)}),K&&(Q=void 0)},trimIdleSpanEndTimestamp:!w});K&&w&&(Q=Te),ma(b,Te);function xt(){n&&["interactive","complete"].includes(n.readyState)&&b.emit("idleSpanEnableAutoFinish",Te)}K&&!w&&n&&(n.addEventListener("readystatechange",()=>{xt()}),xt())}return{name:jE,setup(b){if(Cd(),O=um({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:u||!1,client:b}),r&&Hm(),s&&Cm(),o&&L.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?dm():i&&lm(),c&&fm(),k&&n){const R=()=>{ce=ie()};addEventListener("click",R,{capture:!0}),addEventListener("keydown",R,{capture:!0,passive:!0})}function Y(){const R=Tn(b);R&&!U(R).timestamp&&(I&&m.log(`[Tracing] Finishing current active span with op: ${U(R).op}`),R.setAttribute(mn,"cancelled"),R.end())}b.on("startNavigationSpan",(R,K)=>{if(H()!==b)return;if(K!=null&&K.isRedirect){I&&m.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ne(b,{op:"navigation.redirect",...R},!1);return}ce=void 0,Y(),De().setPropagationContext({traceId:Je(),sampleRand:Math.random(),propagationSpanId:Ne()?void 0:Ge()});const Z=G();Z.setPropagationContext({traceId:Je(),sampleRand:Math.random(),propagationSpanId:Ne()?void 0:Ge()}),Z.setSDKProcessingMetadata({normalizedRequest:void 0}),ne(b,{op:"navigation",...R,parentSpan:null,forceTransaction:!0})}),b.on("startPageLoadSpan",(R,K={})=>{if(H()!==b)return;Y();const Z=K.sentryTrace||ha("sentry-trace"),re=K.baggage||ha("baggage"),be=Ed(Z,re),Te=G();Te.setPropagationContext(be),Ne()||(Te.getPropagationContext().propagationSpanId=Ge()),Te.setSDKProcessingMetadata({normalizedRequest:ci()}),ne(b,{op:"pageload",...R})}),b.on("endPageloadSpan",()=>{w&&Q&&(Q.setAttribute(mn,"reportPageLoaded"),Q.end())})},afterAllSetup(b){let Y=en();if(J!=="off"&&UE(b,{linkPreviousTrace:J,consistentTraceSampling:y}),D.location){if(N){const R=he();Di(b,{name:D.location.pathname,startTime:R?R/1e3:void 0,attributes:{[xe]:"url",[ae]:"auto.pageload.browser"}})}S&&Dr(({to:R,from:K})=>{if(K===void 0&&(Y==null?void 0:Y.indexOf(R))!==-1){Y=void 0;return}Y=void 0;const Z=ai(R),re=Tn(b),be=re&&k&&KE(re,ce);GE(b,{name:(Z==null?void 0:Z.pathname)||D.location.pathname,attributes:{[xe]:"url",[ae]:"auto.navigation.browser"}},{url:R,isRedirect:be})})}h&&FE(),c&&YE(b,l,f,p,t),r&&jm(),NE(b,{traceFetch:g,traceXHR:_,trackFetchStreamPerformance:E,tracePropagationTargets:b.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:T,enableHTTPTimings:F,onRequestSpanStart:P,onRequestSpanEnd:j})}}};function Di(e,t,n){e.emit("startPageLoadSpan",t,n),G().setTransactionName(t.name);const r=Tn(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function GE(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=G();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...ci(),url:r}}),Tn(e)}function ha(e){const t=D.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function YE(e,t,n,r,s){const i=D.document;let o;const c=()=>{const a="ui.action.click",u=Tn(e);if(u){const d=U(u).op;if(["navigation","pageload"].includes(d)){I&&m.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(mn,"interactionInterrupted"),o.end(),o=void 0),!s.name){I&&m.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=lc({name:s.name,op:a,attributes:{[xe]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const il="_sentry_idleSpan";function Tn(e){return e[il]}function ma(e,t){Ie(e,il,t)}const ga=1.5;function KE(e,t){const n=U(e),r=Ct(),s=n.start_timestamp;return!(r-s>ga||t&&r-t<=ga)}function Xt(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function XE(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=Xt(n);return s=>r.then(i=>s(i.transaction(t,"readwrite").objectStore(t)))}function Fi(e){return Xt(e.getAllKeys())}function JE(e,t,n){return e(r=>Fi(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.max(...s,0)+1),Xt(r.transaction)}))}function QE(e,t,n){return e(r=>Fi(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.min(...s,0)-1),Xt(r.transaction)}))}function ZE(e){return e(t=>Fi(t).then(n=>{const r=n[0];if(r!=null)return Xt(t.get(r)).then(s=>(t.delete(r),Xt(t.transaction).then(()=>s)))}))}function eb(e){let t;function n(){return t==null&&(t=XE(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const s=await pr(r);await JE(n(),s,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const s=await pr(r);await QE(n(),s,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await ZE(n());if(r)return $d(r)}catch{}}}}function tb(e){return t=>{const n=e({...t,createStore:eb});return D.addEventListener("online",async r=>{await n.flush()}),n}}function nb(e=yi){return tb(dp(e))}const _a=1e6,rb="window"in L&&L.window===L&&typeof importScripts>"u",rt=String(0),Rr=rb?"main":"worker",Me=D.navigator;let ol="",al="",cl="",zs=(Me==null?void 0:Me.userAgent)||"",ul="";var Ta;const sb=(Me==null?void 0:Me.language)||((Ta=Me==null?void 0:Me.languages)==null?void 0:Ta[0])||"";function ib(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const Sa=Me==null?void 0:Me.userAgentData;ib(Sa)&&Sa.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{var t;if(ol=e.platform||"",cl=e.architecture||"",ul=e.model||"",al=e.platformVersion||"",(t=e.fullVersionList)!=null&&t.length){const n=e.fullVersionList[e.fullVersionList.length-1];zs=`${n.brand} ${n.version}`}}).catch(e=>{});function ob(e){return!("thread_metadata"in e)}function ab(e){return ob(e)?pb(e):e}function cb(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&&I&&m.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function ub(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 s=cb(r),i=ab(n),o=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:ie()*1e3),c=typeof r.timestamp=="number"?r.timestamp*1e3:ie()*1e3;return{event_id:e,timestamp:new Date(o).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||xr,runtime:{name:"javascript",version:D.navigator.userAgent},os:{name:ol,version:al,build_number:zs},device:{locale:sb,model:ul,manufacturer:zs,architecture:cl,is_emulator:!1},debug_meta:{images:dl(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||fe(),trace_id:s,active_thread_id:rt,relative_start_ns:"0",relative_end_ns:((c-o)*1e6).toFixed(0)}]}}function lb(e,t,n){var o,c;if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const r=fb(e),s=t.getOptions(),i=(c=(o=t.getSdkMetadata)==null?void 0:o.call(t))==null?void 0:c.sdk;return{chunk_id:fe(),client_sdk:{name:(i==null?void 0:i.name)??"sentry.javascript.browser",version:(i==null?void 0:i.version)??"0.0.0"},profiler_id:n||fe(),platform:"javascript",version:"2",release:s.release??"",environment:s.environment??"production",debug_meta:{images:dl(e.resources)},profile:r}}function db(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 fb(e){const t=[];for(let c=0;c<e.frames.length;c++){const a=e.frames[c];a&&(t[c]={function:a.name,abs_path:typeof a.resourceId=="number"?e.resources[a.resourceId]:void 0,lineno:a.line,colno:a.column})}const n=[];for(let c=0;c<e.stacks.length;c++){const a=e.stacks[c];if(!a)continue;const u=[];let d=a;for(;d;)u.push(d.frameId),d=d.parentId===void 0?void 0:e.stacks[d.parentId];n[c]=u}const r=he(),s=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,i=s-(r||s),o=[];for(let c=0;c<e.samples.length;c++){const a=e.samples[c];if(!a)continue;const u=(s+(a.timestamp-i))/1e3;o[c]={stack_id:a.stackId??0,thread_id:rt,timestamp:u}}return{frames:t,stacks:n,samples:o,thread_metadata:{[rt]:{name:Rr}}}}function ll(e){return U(e).op==="pageload"}function pb(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[rt]:{name:Rr}}},s=e.samples[0];if(!s)return r;const i=s.timestamp,o=he(),c=typeof performance.timeOrigin=="number"?performance.timeOrigin:o||0,a=c-(o||c);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+a-i)*_a).toFixed(0),stack_id:t,thread_id:rt};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+a-i)*_a).toFixed(0),stack_id:n,thread_id:rt};r.stacks[n]=f,r.samples[d]=p,n++}),r}function hb(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function mb(e){const t=[];return dr(e,(n,r)=>{var s,i;if(r==="transaction")for(let o=1;o<n.length;o++){const c=n[o];(i=(s=c==null?void 0:c.contexts)==null?void 0:s.profile)!=null&&i.profile_id&&t.push(n[o])}}),t}function dl(e){const t=H(),n=t==null?void 0:t.getOptions(),r=n==null?void 0:n.stackParser;return r?_f(r,e):[]}function fl(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(I&&m.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?(I&&m.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function gb(e){return e.samples.length<2?(I&&m.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(I&&m.log("[Profiling] Discarding profile because it contains no frames"),!1)}let Bi=!1;const pl=3e4;function _b(e){return typeof e=="function"}function hl(){const e=D.Profiler;if(!_b(e)){I&&m.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const t=10,n=Math.floor(pl/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{I&&(m.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),m.log("[Profiling] Disabling profiling for current user session.")),Bi=!0}}function ya(e){if(Bi)return I&&m.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return I&&m.log("[Profiling] Discarding profile because root span was not sampled."),!1;const t=H(),n=t==null?void 0:t.getOptions();if(!n)return I&&m.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return fl(r)?r?(r===!0?!0:Math.random()<r)?!0:(I&&m.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(I&&m.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(I&&m.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function Sb(e){if(Bi)return I&&m.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(e.profileLifecycle!=="trace")return!1;const t=e.profileSessionSampleRate;return fl(t)?t?Math.random()<=t:(I&&m.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(I&&m.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function Xn(e){return typeof e.profilesSampleRate<"u"}function yb(e,t,n,r){return gb(n)?ub(e,t,n,r):null}const gt=new Map;function Eb(){return gt.size}function bb(e){const t=gt.get(e);return t&&gt.delete(e),t}function Tb(e,t){if(gt.set(e,t),gt.size>30){const n=gt.keys().next().value;n!==void 0&&gt.delete(n)}}function vb(e){var t,n,r,s,i;return!((t=e==null?void 0:e.contexts)!=null&&t.profile)||!e.contexts||(e.contexts.trace={...((n=e.contexts)==null?void 0:n.trace)??{},data:{...((s=(r=e.contexts)==null?void 0:r.trace)==null?void 0:s.data)??{},"thread.id":rt,"thread.name":Rr}},(i=e.spans)==null||i.forEach(o=>{o.data={...o.data||{},"thread.id":rt,"thread.name":Rr}})),e}function Ea(e){let t;ll(e)&&(t=ie()*1e3);const n=hl();if(!n)return;I&&m.log(`[Profiling] started profiling span: ${U(e).description}`);const r=fe();let s=null;G().setContext("profile",{profile_id:r,start_timestamp:t});async function i(){if(e&&n){if(s){I&&m.log("[Profiling] profile for:",U(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(o&&(D.clearTimeout(o),o=void 0),I&&m.log(`[Profiling] stopped profiling of span: ${U(e).description}`),!u){I&&m.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}s=u,Tb(r,u)}).catch(u=>{I&&m.log("[Profiling] error while stopping profiler:",u)})}}let o=D.setTimeout(()=>{I&&m.log("[Profiling] max profile duration elapsed, stopping profiling for:",U(e).description),i()},pl);const c=e.end.bind(e);function a(){return e?(i().then(()=>{c()},()=>{c()}),e):c()}e.end=a}const Ib=6e4,wb=3e5;class kb{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1}initialize(t,n){this._profilerId=fe(),I&&m.log("[Profiling] Initializing profiler (lifecycle='trace')."),this._client=t,this._sessionSampled=n,this._setupTraceLifecycleListeners(t)}notifyRootSpanActive(t){if(!this._sessionSampled)return;const n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._activeRootSpanIds.add(n);const r=this._activeRootSpanIds.size;r===1&&(I&&m.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this.start())}start(){if(!this._isRunning){if(this._isRunning=!0,I&&m.log("[Profiling] Started profiling with profile ID:",this._profilerId),cr().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){I&&m.log("[Profiling] Stopping trace lifecycle profiling."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}stop(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(t=>{I&&m.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){I&&m.log("[Profiling] Session not sampled because of negative sampling decision.");return}if(n!==le(n))return;if(!n.isRecording()){I&&m.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 s=this._activeRootSpanIds.size;s===1&&(I&&m.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${s}).`),this.start())}),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 s=this._activeRootSpanIds.size;I&&m.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${s}).`),s===0&&(this._collectCurrentChunk().catch(i=>{I&&m.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",i)}),this.stop())})}_resetProfilerInfo(){this._isRunning=!1,cr().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);const n=setTimeout(()=>this._onRootSpanTimeout(t),wb);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){var n;if(((n=this._profiler)==null?void 0:n.stopped)===!1)return;const t=hl();if(!t){I&&m.log("[Profiling] Failed to start JS Profiler in trace lifecycle.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{I&&m.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},Ib))}_onRootSpanTimeout(t){if(!this._rootSpanTimeouts.has(t)||(this._rootSpanTimeouts.delete(t),!this._activeRootSpanIds.has(t)))return;I&&m.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.stop()}async _collectCurrentChunk(){const t=this._profiler;if(this._profiler=void 0,!!t)try{const n=await t.stop(),r=lb(n,this._client,this._profilerId),s=db(r);if("reason"in s){I&&m.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",s.reason);return}this._sendProfileChunk(r),I&&m.log("[Profiling] Collected browser profile chunk.")}catch(n){I&&m.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(t){var c;const n=this._client,r=Ar((c=n.getSdkMetadata)==null?void 0:c.call(n)),s=n.getDsn(),i=n.getOptions().tunnel,o=Qe({event_id:fe(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&s&&{dsn:Mt(s)}},[[{type:"profile_chunk"},t]]);n.sendEnvelope(o).then(null,a=>{I&&m.error("Error while sending profile chunk envelope:",a)})}}const Rb="BrowserProfiling",Cb=()=>({name:Rb,setup(e){const t=e.getOptions();if(!Xn(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),Xn(t)&&!t.profilesSampleRate){I&&m.log("[Profiling] Profiling disabled, no profiling options found.");return}const n=pe(),r=n&&le(n);if(Xn(t)&&t.profileSessionSampleRate!==void 0&&I&&m.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),Xn(t))r&&ll(r)&&ya(r)&&Ea(r),e.on("spanStart",s=>{s===le(s)&&ya(s)&&Ea(s)}),e.on("beforeEnvelope",s=>{var c,a;if(!Eb())return;const i=mb(s);if(!i.length)return;const o=[];for(const u of i){const d=u==null?void 0:u.contexts,l=(c=d==null?void 0:d.profile)==null?void 0:c.profile_id,f=(a=d==null?void 0:d.profile)==null?void 0:a.start_timestamp;if(typeof l!="string"){I&&m.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!l){I&&m.log("[Profiling] cannot find profile for a span without a profile context");continue}d!=null&&d.profile&&delete d.profile;const p=bb(l);if(!p){I&&m.log(`[Profiling] Could not retrieve profile for span: ${l}`);continue}const h=yb(l,f,p,u);h&&o.push(h)}hb(s,o)});else{const s=Sb(t);if(s||I&&m.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),t.profileLifecycle==="trace"){if(!Ne(t)){I&&m.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}const o=new kb;o.initialize(e,s),r&&o.notifyRootSpanActive(r),D.setTimeout(()=>{const c=pe(),a=c&&le(c);a&&o.notifyRootSpanActive(a)},0)}}},processEvent(e){return vb(e)}}),Mb=Cb;function xb(e){const t={...e};return Nc(t,"react"),mc("react",{version:va.version}),Kg(t)}const Ab=new WeakSet;function Nb(e,t){const n=VE({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:s,useNavigationType:i,createRoutesFromChildren:o,matchRoutes:c,stripBasename:a,enableAsyncRouteHandlers:u=!1,instrumentPageLoad:d=!0,instrumentNavigation:l=!0}=e;return{...n,setup(f){n.setup(f)},afterAllSetup(f){var h;n.afterAllSetup(f);const p=(h=D.location)==null?void 0:h.pathname;d&&p&&Di(f,{name:p,attributes:{[xe]:"url",[Ue]:"pageload",[ae]:`auto.pageload.react.reactrouter_v${t}`}}),l&&Ab.add(f)}}}function Ob(e){return Nb(e,"6")}const Pb={enabled:!0,environment:"production",release:"spotlight@4.7.0",tracesSampleRate:1,enableLogs:!0},Lb=["sentryTrace","baggage"];function Db(e=!0){const t=[Ob({instrumentPageLoad:e,useEffect:va.useEffect,useLocation:bl,useNavigationType:El,createRoutesFromChildren:yl,matchRoutes:Sl}),RE(),Mb(),rh({levels:["log","info","warn","error","debug"]})],n=document.location.hash.slice(1);if(n.startsWith("spotlight")){const r=n.indexOf("="),s=r>-1?decodeURIComponent(n.slice(r+1)):void 0;t.push(jg({sidecarUrl:s}))}return t}function $b(){const e=Lb.map(s=>[s,_l(s)]),t=e.every(([,s])=>!!s),n=Db(!t),r=xb({...Pb,transport:nb(yi),dsn:"https://51bcd92dba1128934afd1c5726c84442@o1.ingest.us.sentry.io/4508404727283713",integrations:n,tracePropagationTargets:[/^\//,document.location.origin],profilesSampleRate:1,replaysSessionSampleRate:.01,replaysOnErrorSampleRate:1});t&&r&&Di(r,{name:"pageload"},Object.fromEntries(e))}export{$b as default,Db as getIntegrations};
23
+ or you can use record.mirror to access the mirror instance during recording.`;let Yo={map:{},getId(){return console.error(Pt),-1},getNode(){return console.error(Pt),null},removeNodeFromMap(){console.error(Pt)},has(){return console.error(Pt),!1},reset(){console.error(Pt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Yo=new Proxy(Yo,{get(e,t,n){return t==="map"&&console.error(Pt),Reflect.get(e,t,n)}}));function En(e,t,n={}){let r=null,s=0;return function(...i){const o=Date.now();!s&&n.leading===!1&&(s=o);const c=t-(o-s),a=this;c<=0||c>t?(r&&(K_(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=$r(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function Tu(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){$r(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>Tu(e,t,i||{},!0)}function wi(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}let Tr=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Tr=()=>new Date().getTime());function vu(e){var n,r,s,i,o,c;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)||((s=t==null?void 0:t.body)==null?void 0:s.scrollLeft)||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(t==null?void 0:t.documentElement.scrollTop)||((o=(i=t==null?void 0:t.body)==null?void 0:i.parentElement)==null?void 0:o.scrollTop)||((c=t==null?void 0:t.body)==null?void 0:c.scrollTop)||0}}function Iu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function wu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ku(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function ve(e,t,n,r,s){if(!e)return!1;const i=ku(e);if(!i)return!1;const o=Bt(t,n);if(!s){const u=r&&i.matches(r);return o(i)&&!u}const c=mt(i,o);let a=-1;return c<0?!1:(r&&(a=mt(i,Bt(null,r))),c>-1&&a<0?!0:c<a)}function z_(e,t){return t.getId(e)!==-1}function cs(e,t){return t.getId(e)===yn}function Ru(e,t){if(ln(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Ru(e.parentNode,t):!0:!0}function Ls(e){return!!e.changedTouches}function j_(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 Cu(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Mu(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ds(e){return!!(e!=null&&e.shadowRoot)}class q_{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 xu(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 V_(e){let t=e,n;for(;n=xu(t);)t=n;return t}function G_(e){const t=e.ownerDocument;if(!t)return!1;const n=V_(e);return t.contains(n)}function Au(e){const t=e.ownerDocument;return t?t.contains(e)||G_(e):!1}const Ko={};function ki(e){const t=Ko[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return Ko[e]=r.bind(window)}function Y_(...e){return ki("requestAnimationFrame")(...e)}function $r(...e){return ki("setTimeout")(...e)}function K_(...e){return ki("clearTimeout")(...e)}var $=(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))($||{}),A=(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))(A||{}),me=(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))(me||{}),je=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(je||{}),Lt=(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))(Lt||{});function Ri(e){try{return e.contentDocument}catch{}}function X_(e){try{return e.contentWindow}catch{}}function Xo(e){return"__ln"in e}class J_{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&&Xo(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&&Xo(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 Jo=(e,t)=>`${e}@${t}`;class Q_{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 J_,s=a=>{let u=a,d=yn;for(;d===yn;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},i=a=>{if(!a.parentNode||!Au(a))return;const u=ln(a.parentNode)?this.mirror.getId(xu(a)):this.mirror.getId(a.parentNode),d=s(a);if(u===-1||d===-1)return r.addNode(a);const l=$t(a,{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=>{Cu(f,this.mirror)&&!ve(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),Mu(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Ds(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{ve(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(f,p),f.contentWindow&&this.canvasManager.addWindow(f.contentWindow),this.shadowDomManager.observeAttachShadow(f))},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:g})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${g}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 a of this.movedSet)Qo(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!Zo(this.droppedSet,a)&&!Qo(this.removes,a,this.mirror)||Zo(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const u=this.mirror.getId(o.value.parentNode),d=s(o.value);u!==-1&&d!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(s(d.value)===-1)continue;if(l!==-1){a=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){a=d;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}const c={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const d=JSON.stringify(a.styleDiff),l=JSON.stringify(a._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.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(c))},this.processMutation=t=>{if(!cs(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ve(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Yt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,ku(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if(r==="value"){const o=vi(n),c=n.tagName;s=Er(n,c,o);const a=Fr({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),u=Yt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=Sn({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if(ve(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!Ri(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!bu(n.tagName,r)&&(i.attributes[r]=Eu(this.doc,Gt(n.tagName),Gt(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue);for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),u=n.style.getPropertyPriority(c);a!==o.style.getPropertyValue(c)||u!==o.style.getPropertyPriority(c)?u===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,u]:i._unchangedStyles[c]=[a,u]}for(const c of Array.from(o.style))n.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if(ve(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),s=ln(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ve(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||cs(n,this.mirror)||!z_(n,this.mirror)||(this.addedSet.has(n)?(Fs(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Ru(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Jo(r,s)]?Fs(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:ln(t.target)&&dn(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(cs(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[Jo(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ve(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Ds(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]})}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 Fs(e,t){var n;e.delete(t),(n=t.childNodes)==null||n.forEach(r=>Fs(e,r))}function Qo(e,t,n){return e.length===0?!1:Z_(e,t,n)}function Z_(e,t,n){let r=t.parentNode;for(;r;){const s=n.getId(r);if(e.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function Zo(e,t){return e.size===0?!1:Nu(e,t)}function Nu(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Nu(e,n):!1}let fn;function eS(e){fn=e}function tS(){fn=void 0}const z=e=>fn?(...n)=>{try{return e(...n)}catch(r){if(fn&&fn(r)===!0)return()=>{};throw r}}:e,Ut=[];function Ln(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 Ou(e,t){var o,c;const n=new Q_;Ut.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=(c=(o=window==null?void 0:window.Zone)==null?void 0:o.__symbol__)==null?void 0:c.call(o,"MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(z(a=>{e.onMutation&&e.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function nS({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],c;const a=En(z(l=>{const f=Date.now()-c;e(o.map(p=>(p.timeOffset-=f,p)),l),o=[],c=null}),i),u=z(En(z(l=>{const f=Ln(l),{clientX:p,clientY:h}=Ls(l)?l.changedTouches[0]:l;c||(c=Tr()),o.push({x:p,y:h,id:r.getId(f),timeOffset:Tr()-c}),a(typeof DragEvent<"u"&&l instanceof DragEvent?A.Drag:l instanceof MouseEvent?A.MouseMove:A.TouchMove)}),s,{trailing:!1})),d=[ge("mousemove",u,n),ge("touchmove",u,n),ge("drag",u,n)];return z(()=>{d.forEach(l=>l())})}function rS({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const c=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let u=null;const d=l=>f=>{const p=Ln(f);if(ve(p,r,s,i,!0))return;let h=null,g=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=je.Mouse;break;case"touch":h=je.Touch;break;case"pen":h=je.Pen;break}h===je.Touch?me[l]===me.MouseDown?g="TouchStart":me[l]===me.MouseUp&&(g="TouchEnd"):je.Pen}else Ls(f)&&(h=je.Touch);h!==null?(u=h,(g.startsWith("Touch")&&h===je.Touch||g.startsWith("Mouse")&&h===je.Mouse)&&(h=null)):me[l]===me.Click&&(h=u,u=null);const _=Ls(f)?f.changedTouches[0]:f;if(!_)return;const E=n.getId(p),{clientX:T,clientY:F}=_;z(e)({type:me[g],id:E,x:T,y:F,...h!==null&&{pointerType:h}})};return Object.keys(me).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&c[l]!==!1).forEach(l=>{let f=Gt(l);const p=d(l);if(window.PointerEvent)switch(me[l]){case me.MouseDown:case me.MouseUp:f=f.replace("mouse","pointer");break;case me.TouchStart:case me.TouchEnd:return}a.push(ge(f,p,t))}),z(()=>{a.forEach(l=>l())})}function Pu({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=z(En(z(a=>{const u=Ln(a);if(!u||ve(u,r,s,i,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=vu(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return ge("scroll",c,t)}function sS({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=z(En(z(()=>{const i=Iu(),o=wu();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return ge("resize",s,t)}const iS=["INPUT","TEXTAREA","SELECT"],ea=new WeakMap;function oS({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g}){function _(S){let k=Ln(S);const J=S.isTrusted,y=k&&Os(k.tagName);if(y==="OPTION"&&(k=k.parentElement),!k||!y||iS.indexOf(y)<0||ve(k,r,s,i,!0))return;const w=k;if(w.classList.contains(o)||c&&w.matches(c))return;const P=vi(k);let j=Er(w,y,P),O=!1;const ce=Fr({maskInputOptions:a,tagName:y,type:P}),Q=Yt(k,f,h,p,g,ce);(P==="radio"||P==="checkbox")&&(O=k.checked),j=Sn({isMasked:Q,element:k,value:j,maskInputFn:u}),E(k,l?{text:j,isChecked:O,userTriggered:J}:{text:j,isChecked:O});const ne=k.name;P==="radio"&&ne&&O&&t.querySelectorAll(`input[type="radio"][name="${ne}"]`).forEach(b=>{if(b!==k){const Y=Sn({isMasked:Q,element:b,value:Er(b,y,P),maskInputFn:u});E(b,l?{text:Y,isChecked:!O,userTriggered:!1}:{text:Y,isChecked:!O})}})}function E(S,k){const J=ea.get(S);if(!J||J.text!==k.text||J.isChecked!==k.isChecked){ea.set(S,k);const y=n.getId(S);z(e)({...k,id:y})}}const F=(d.input==="last"?["change"]:["input","change"]).map(S=>ge(S,z(_),t)),B=t.defaultView;if(!B)return()=>{F.forEach(S=>S())};const q=B.Object.getOwnPropertyDescriptor(B.HTMLInputElement.prototype,"value"),N=[[B.HTMLInputElement.prototype,"value"],[B.HTMLInputElement.prototype,"checked"],[B.HTMLSelectElement.prototype,"value"],[B.HTMLTextAreaElement.prototype,"value"],[B.HTMLSelectElement.prototype,"selectedIndex"],[B.HTMLOptionElement.prototype,"selected"]];return q&&q.set&&F.push(...N.map(S=>Tu(S[0],S[1],{set(){z(_)({target:this,isTrusted:!1})}},!1,B))),z(()=>{F.forEach(S=>S())})}function vr(e){const t=[];function n(r,s){if(Gn("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Gn("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Gn("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Gn("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(o)}return s}return n(e,t)}function et(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function aS({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:z((d,l,f)=>{const[p,h]=f,{id:g,styleId:_}=et(l,t,n.styleMirror);return(g&&g!==-1||_&&_!==-1)&&e({id:g,styleId:_,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:z((d,l,f)=>{const[p]=f,{id:h,styleId:g}=et(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,removes:[{index:p}]}),d.apply(l,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:z((d,l,f)=>{const[p]=f,{id:h,styleId:g}=et(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replace:p}),d.apply(l,f)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:z((d,l,f)=>{const[p]=f,{id:h,styleId:g}=et(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replaceSync:p}),d.apply(l,f)})}));const a={};Yn("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Yn("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Yn("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Yn("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:z((f,p,h)=>{const[g,_]=h,{id:E,styleId:T}=et(p.parentStyleSheet,t,n.styleMirror);return(E&&E!==-1||T&&T!==-1)&&e({id:E,styleId:T,adds:[{rule:g,index:[...vr(p),_||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:z((f,p,h)=>{const[g]=h,{id:_,styleId:E}=et(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||E&&E!==-1)&&e({id:_,styleId:E,removes:[{index:[...vr(p),g]}]}),f.apply(p,h)})})}),z(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),c&&(r.CSSStyleSheet.prototype.replaceSync=c),Object.entries(a).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function Lu({mirror:e,stylesheetManager:t},n){var o,c,a;let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?(o=n.defaultView)==null?void 0:o.Document:(a=(c=n.ownerDocument)==null?void 0:c.defaultView)==null?void 0:a.ShadowRoot,i=s!=null&&s.prototype?Object.getOwnPropertyDescriptor(s==null?void 0:s.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var u;return(u=i.get)==null?void 0:u.call(this)},set(u){var l;const d=(l=i.set)==null?void 0:l.call(this,u);if(r!==null&&r!==-1)try{t.adoptStyleSheets(u,r)}catch{}return d}}),z(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function cS({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:z((c,a,u)=>{var g;const[d,l,f]=u;if(n.has(d))return i.apply(a,[d,l,f]);const{id:p,styleId:h}=et((g=a.parentRule)==null?void 0:g.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:vr(a.parentRule)}),c.apply(a,u)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:z((c,a,u)=>{var p;const[d]=u;if(n.has(d))return o.apply(a,[d]);const{id:l,styleId:f}=et((p=a.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:vr(a.parentRule)}),c.apply(a,u)})}),z(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function uS({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=z(u=>En(z(d=>{const l=Ln(d);if(!l||ve(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:g}=l;e({type:u,id:s.getId(l),currentTime:f,volume:p,muted:h,playbackRate:g})}),i.media||500)),a=[ge("play",c(Lt.Play),o),ge("pause",c(Lt.Pause),o),ge("seeked",c(Lt.Seeked),o),ge("volumechange",c(Lt.VolumeChange),o),ge("ratechange",c(Lt.RateChange),o)];return z(()=>{a.forEach(u=>u())})}function lS({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,u,d){const l=new i(a,u,d);return s.set(l,{family:a,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const o=wi(t.fonts,"add",function(c){return function(a){return $r(z(()=>{const u=s.get(a);u&&(e(u),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),z(()=>{r.forEach(c=>c())})}function dS(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=z(()=>{const u=t.getSelection();if(!u||c&&(u!=null&&u.isCollapsed))return;c=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f<l;f++){const p=u.getRangeAt(f),{startContainer:h,startOffset:g,endContainer:_,endOffset:E}=p;ve(h,r,s,i,!0)||ve(_,r,s,i,!0)||d.push({start:n.getId(h),startOffset:g,end:n.getId(_),endOffset:E})}o({ranges:d})});return a(),ge("selectionchange",a)}function fS({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:wi(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function pS(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=Ou(e,e.doc));const s=nS(e),i=rS(e),o=Pu(e),c=sS(e,{win:n}),a=oS(e),u=uS(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=aS(e,{win:n}),l=Lu(e,e.doc),f=cS(e,{win:n}),e.collectFonts&&(p=lS(e)));const h=dS(e),g=fS(e),_=[];for(const E of e.plugins)_.push(E.observer(E.callback,n,E.options));return z(()=>{Ut.forEach(E=>E.reset()),r==null||r.disconnect(),s(),i(),o(),c(),a(),u(),d(),l(),f(),p(),h(),g(),_.forEach(E=>E())})}function Gn(e){return typeof window[e]<"u"}function Yn(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Bs{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,s){const i=r||this.getIdToRemoteIdMap(t),o=s||this.getRemoteIdToIdMap(t);let c=i.get(n);return c||(c=this.generateIdFn(),i.set(n,c),o.set(c,n)),c}getIds(t,n){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,s))}getRemoteId(t,n,r){const s=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(s=>this.getRemoteId(t,s,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 hS{constructor(){this.crossOriginIframeMirror=new Bs(Ii),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class mS{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Bs(Ii),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Bs(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),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=t.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t);const r=Ri(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 s=this.crossOriginIframeMap.get(t.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case $.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:$.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case $.Meta:case $.Load:case $.DomContentLoaded:return!1;case $.Plugin:return n;case $.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case $.IncrementalSnapshot:switch(n.data.source){case A.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),n.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case A.Drag:case A.TouchMove:case A.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(n.data,t,["id"]),n;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case A.Font:return n;case A.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),n;case A.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),n}}return!1}replace(t,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));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!==ue.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class gS{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class _S{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(!dn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=Ou({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Pu({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),$r(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Lu({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=Ri(t),r=X_(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(wi(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&Au(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var ta="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",SS=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Kn=0;Kn<ta.length;Kn++)SS[ta.charCodeAt(Kn)]=Kn;class na{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class yS{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new q_,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:[]},s=[];for(const i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),s.push({styleId:o,rules:Array.from(i.rules||CSSRule,(c,a)=>({rule:hu(c),index:a}))})),r.styleIds.push(o)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class ES{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.active||(this.active=!0,Y_(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let se,Ir;var Ta;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Ta=e.contentWindow)==null?void 0:Ta.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Pe=S_();function Ye(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:c="rr-ignore",ignoreSelector:a=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:g,maskInputOptions:_,slimDOMOptions:E,maskAttributeFn:T,maskInputFn:F,maskTextFn:B,maxCanvasSize:q=null,packFn:N,sampling:S={},dataURLOptions:k={},mousemoveWait:J,recordDOM:y=!0,recordCanvas:w=!1,recordCrossOriginIframes:P=!1,recordAfter:j=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:O=!1,collectFonts:ce=!1,inlineImages:Q=!1,plugins:ne,keepIframeSrcFn:b=()=>!1,ignoreCSSAttributes:Y=new Set([]),errorHandler:R,onMutation:K,getCanvasManager:Z}=e;eS(R);const re=P?window.parent===window:!0;let be=!1;if(!re)try{window.parent.document&&(be=!1)}catch{be=!0}if(re&&!t)throw new Error("emit function is required");if(!re&&!be)return()=>{};J!==void 0&&S.mousemove===void 0&&(S.mousemove=J),Pe.reset();const Te=g===!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}:_!==void 0?_:{},xt=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:E==="all",headMetaDescKeywords:E==="all"}:E||{};j_();let We,At=0;const Fn=V=>{for(const Oe of ne||[])Oe.eventProcessor&&(V=Oe.eventProcessor(V));return N&&!be&&(V=N(V)),V};se=(V,Oe)=>{var _e;const W=V;if(W.timestamp=Tr(),(_e=Ut[0])!=null&&_e.isFrozen()&&W.type!==$.FullSnapshot&&!(W.type===$.IncrementalSnapshot&&W.data.source===A.Mutation)&&Ut.forEach(we=>we.unfreeze()),re)t==null||t(Fn(W),Oe);else if(be){const we={type:"rrweb",event:Fn(W),origin:window.location.origin,isCheckout:Oe};window.parent.postMessage(we,"*")}if(W.type===$.FullSnapshot)We=W,At=0;else if(W.type===$.IncrementalSnapshot){if(W.data.source===A.Mutation&&W.data.isAttachIframe)return;At++;const we=r&&At>=r,X=n&&We&&W.timestamp-We.timestamp>n;(we||X)&&qr(!0)}};const an=V=>{se({type:$.IncrementalSnapshot,data:{source:A.Mutation,...V}})},$i=V=>se({type:$.IncrementalSnapshot,data:{source:A.Scroll,...V}}),gl=V=>se({type:$.IncrementalSnapshot,data:{source:A.CanvasMutation,...V}}),_l=V=>se({type:$.IncrementalSnapshot,data:{source:A.AdoptedStyleSheet,...V}}),dt=new yS({mutationCb:an,adoptedStyleSheetCb:_l}),ft=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new hS:new mS({mirror:Pe,mutationCb:an,stylesheetManager:dt,recordCrossOriginIframes:P,wrappedEmit:se});for(const V of ne||[])V.getMirror&&V.getMirror({nodeMirror:Pe,crossOriginIframeMirror:ft.crossOriginIframeMirror,crossOriginIframeStyleMirror:ft.crossOriginIframeStyleMirror});const zr=new ES,jr=TS(Z,{mirror:Pe,win:window,mutationCb:V=>se({type:$.IncrementalSnapshot,data:{source:A.CanvasMutation,...V}}),recordCanvas:w,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:q,sampling:S.canvas,dataURLOptions:k,errorHandler:R}),Bn=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new gS:new _S({mutationCb:an,scrollCb:$i,bypassOptions:{onMutation:K,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:Te,dataURLOptions:k,maskAttributeFn:T,maskTextFn:B,maskInputFn:F,recordCanvas:w,inlineImages:Q,sampling:S,slimDOMOptions:xt,iframeManager:ft,stylesheetManager:dt,canvasManager:jr,keepIframeSrcFn:b,processedNodeManager:zr,ignoreCSSAttributes:Y},mirror:Pe}),qr=(V=!1)=>{if(!y)return;se({type:$.Meta,data:{href:window.location.href,width:wu(),height:Iu()}},V),dt.reset(),Bn.init(),Ut.forEach(W=>W.lock());const Oe=W_(document,{mirror:Pe,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:Te,maskAttributeFn:T,maskInputFn:F,maskTextFn:B,slimDOM:xt,dataURLOptions:k,recordCanvas:w,inlineImages:Q,onSerialize:W=>{Cu(W,Pe)&&ft.addIframe(W),Mu(W,Pe)&&dt.trackLinkElement(W),Ds(W)&&Bn.addShadowRoot(W.shadowRoot,document)},onIframeLoad:(W,_e)=>{ft.attachIframe(W,_e),W.contentWindow&&jr.addWindow(W.contentWindow),Bn.observeAttachShadow(W)},onStylesheetLoad:(W,_e)=>{dt.attachLinkElement(W,_e)},onBlockedImageLoad:(W,_e,{width:we,height:X})=>{an({adds:[],removes:[],texts:[],attributes:[{id:_e.id,attributes:{style:{width:`${we}px`,height:`${X}px`}}}]})},keepIframeSrcFn:b,ignoreCSSAttributes:Y});if(!Oe)return console.warn("Failed to snapshot the document");se({type:$.FullSnapshot,data:{node:Oe,initialOffset:vu(window)}}),Ut.forEach(W=>W.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&dt.adoptStyleSheets(document.adoptedStyleSheets,Pe.getId(document))};Ir=qr;try{const V=[],Oe=_e=>{var we;return z(pS)({onMutation:K,mutationCb:an,mousemoveCb:(X,Vr)=>se({type:$.IncrementalSnapshot,data:{source:Vr,positions:X}}),mouseInteractionCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.MouseInteraction,...X}}),scrollCb:$i,viewportResizeCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.ViewportResize,...X}}),inputCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.Input,...X}}),mediaInteractionCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.MediaInteraction,...X}}),styleSheetRuleCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.StyleSheetRule,...X}}),styleDeclarationCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.StyleDeclaration,...X}}),canvasMutationCb:gl,fontCb:X=>se({type:$.IncrementalSnapshot,data:{source:A.Font,...X}}),selectionCb:X=>{se({type:$.IncrementalSnapshot,data:{source:A.Selection,...X}})},customElementCb:X=>{se({type:$.IncrementalSnapshot,data:{source:A.CustomElement,...X}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:Te,inlineStylesheet:h,sampling:S,recordDOM:y,recordCanvas:w,inlineImages:Q,userTriggeredOnInput:O,collectFonts:ce,doc:_e,maskAttributeFn:T,maskInputFn:F,maskTextFn:B,keepIframeSrcFn:b,blockSelector:i,unblockSelector:o,slimDOMOptions:xt,dataURLOptions:k,mirror:Pe,iframeManager:ft,stylesheetManager:dt,shadowDomManager:Bn,processedNodeManager:zr,canvasManager:jr,ignoreCSSAttributes:Y,plugins:((we=ne==null?void 0:ne.filter(X=>X.observer))==null?void 0:we.map(X=>({observer:X.observer,options:X.options,callback:Vr=>se({type:$.Plugin,data:{plugin:X.name,payload:Vr}})})))||[]},{})};ft.addLoadListener(_e=>{try{V.push(Oe(_e.contentDocument))}catch(we){console.warn(we)}});const W=()=>{qr(),V.push(Oe(document))};return document.readyState==="interactive"||document.readyState==="complete"?W():(V.push(ge("DOMContentLoaded",()=>{se({type:$.DomContentLoaded,data:{}}),j==="DOMContentLoaded"&&W()})),V.push(ge("load",()=>{se({type:$.Load,data:{}}),j==="load"&&W()},window))),()=>{V.forEach(_e=>_e()),zr.destroy(),Ir=void 0,tS()}}catch(V){console.warn(V)}}function bS(e){if(!Ir)throw new Error("please take full snapshot after start recording");Ir(e)}Ye.mirror=Pe;Ye.takeFullSnapshot=bS;function TS(e,t){try{return e?e(t):new na}catch{return console.warn("Unable to initialize CanvasManager"),new na}}var ra;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ra||(ra={}));const vS=3,IS=5;function Ci(e){return e>9999999999?e:e*1e3}function us(e){return e>9999999999?e/1e3:e}function Dn(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:$.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Ce(t,10,1e3)}}),t.category==="console")))}const wS="button,a";function Du(e){return e.closest(wS)||e}function Fu(e){const t=Bu(e);return!t||!(t instanceof Element)?t:Du(t)}function Bu(e){return kS(e)?e.target:e}function kS(e){return typeof e=="object"&&!!e&&"target"in e}let tt;function RS(e){return tt||(tt=[],CS()),tt.push(e),()=>{const t=tt?tt.indexOf(e):-1;t>-1&&tt.splice(t,1)}}function CS(){ye(te,"open",function(e){return function(...t){if(tt)try{tt.forEach(n=>n())}catch{}return e.apply(te,t)}})}const MS=new Set([A.Mutation,A.StyleSheetRule,A.StyleDeclaration,A.AdoptedStyleSheet,A.CanvasMutation,A.Selection,A.MediaInteraction]);function xS(e,t,n){e.handleClick(t,n)}class AS{constructor(t,n,r=Dn){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=RS(()=>{this._lastMutation=sa()});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(OS(n,this._ignoreSelector)||!PS(t))return;const r={timestamp:us(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=us(t)}registerScroll(t=Date.now()){this._lastScroll=us(t)}registerClick(t){const n=Du(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=sa();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 s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:o,clickBreadcrumb:c}=t;if(i){const a=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=a<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:{...c.data,url:te.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:u,clickCount:o||1}};this._addBreadcrumbEvent(n,d);return}if(o>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:te.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Pn(()=>this._checkClicks(),1e3)}}const NS=["A","BUTTON","INPUT"];function OS(e,t){return!!(!NS.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 PS(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function sa(){return Date.now()/1e3}function LS(e,t){try{if(!DS(t))return;const{source:n}=t.data;if(MS.has(n)&&e.registerMutation(t.timestamp),n===A.Scroll&&e.registerScroll(t.timestamp),FS(t)){const{type:r,id:s}=t.data,i=Ye.mirror.getNode(s);i instanceof HTMLElement&&r===me.Click&&e.registerClick(i)}}catch{}}function DS(e){return e.type===vS}function FS(e){return e.data.source===A.MouseInteraction}function Be(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Mi=(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))(Mi||{});const BS=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function $S(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(BS.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const US=e=>t=>{if(!e.isEnabled())return;const n=HS(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&(s!=null&&s.target)&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&xS(e.clickDetector,n,Fu(t.event)),Dn(e,n)};function $u(e,t){const n=Ye.mirror.getId(e),r=n&&Ye.mirror.getNode(n),s=r&&Ye.mirror.getMeta(r),i=s&&zS(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===Mi.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:$S(i.attributes)}}:{}}}function HS(e){const{target:t,message:n}=WS(e);return Be({category:`ui.${e.name}`,...$u(t,n)})}function WS(e){const t=e.name==="click";let n,r=null;try{r=t?Fu(e.event):Bu(e.event),n=Ee(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function zS(e){return e.type===Mi.Element}function jS(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=qS(t);n&&Dn(e,n)}function qS(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||VS(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const u=Ee(o,{maxStringLength:200})||"<unknown>",d=$u(o,u);return Be({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function VS(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const GS={resource:QS,paint:XS,navigation:JS};function ls(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function YS(e){return e.map(KS).filter(Boolean)}function KS(e){const t=GS[e.entryType];return t?t(e):null}function Kt(e){return((he()||te.performance.timeOrigin)+e)/1e3}function XS(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=Kt(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function JS(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:g}=e;return s===0?null:{type:`${t}.${g}`,start:Kt(p),end:Kt(i),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:d,loadEventEnd:l,domComplete:i,redirectCount:f}}}function QS(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Kt(i),end:Kt(s),name:r,data:{size:u,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function ZS(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.element?[t.element]:void 0;return xi(e,"largest-contentful-paint",n)}function ey(e){return e.sources!==void 0}function ty(e){const t=[],n=[];for(const r of e.entries)if(ey(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const o=Ye.mirror.getId(i.node);o&&s.push(o)}t.push({value:r.value,nodeIds:s.length?s:void 0})}return xi(e,"cumulative-layout-shift",n,t)}function ny(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.target?[t.target]:void 0;return xi(e,"interaction-to-next-paint",n)}function xi(e,t,n,r){const s=e.value,i=e.rating,o=Kt(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(c=>Ye.mirror.getId(c)):void 0,attributions:r}}}function ry(e){function t(s){e.performanceEntries.includes(s)||e.performanceEntries.push(s)}function n({entries:s}){s.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(kt(s,n))}),r.push(gi(ls(ZS,e)),mi(ls(ty,e)),eu(ls(ny,e))),()=>{r.forEach(s=>s())}}const C=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,sy='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 iy(){const e=new Blob([sy]);return URL.createObjectURL(e)}const ia=["log","warn","error"],or="[Replay] ";function ds(e,t="info"){it({category:"console",data:{logger:"replay"},level:t,message:`${or}${e}`},{level:t})}function oy(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return C?(ia.forEach(r=>{n[r]=(...s)=>{m[r](or,...s),t&&ds(s.join(""),Dc(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),m.error(or,r),e?hc(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&ds(r,"error")},n.infoTick=(...r)=>{m.log(or,...r),t&&setTimeout(()=>ds(r[0]),0)}):ia.forEach(r=>{n[r]=()=>{}}),n}const M=oy();class Ai extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Ti}.`)}}class Uu{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>Ti)throw new Ai;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(){const t=this.events.map(n=>n.timestamp).sort()[0];return t?Ci(t):null}}class ay{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){C&&M.log("Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const o=({data:c})=>{const a=c;if(a.method===t&&a.id===r){if(this._worker.removeEventListener("message",o),!a.success){C&&M.error("Error in compression worker: ",a.response),i(new Error("Error in compression worker"));return}s(a.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class cy{constructor(t){this._worker=new ay(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=Ci(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>Ti?Promise.reject(new Ai):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{C&&M.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 uy{constructor(t){this._fallback=new Uu,this._compression=new cy(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){C&&M.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,s=[];for(const i of t)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){C&&M.exception(i,"Failed to add events when switching buffers.")}}}function ly({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=dy(t);if(n)return n}return C&&M.log("Using simple buffer"),new Uu}function dy(e){try{const t=e||fy();if(!t)return;C&&M.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new uy(n)}catch(t){C&&M.exception(t,"Failed to create compression worker")}}function fy(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?iy():""}function Ni(){try{return"sessionStorage"in te&&!!te.sessionStorage}catch{return!1}}function py(e){hy(),e.session=void 0}function hy(){if(Ni())try{te.sessionStorage.removeItem(Ei)}catch{}}function Hu(e){return e===void 0?!1:Math.random()<e}function Ur(e){if(Ni())try{te.sessionStorage.setItem(Ei,JSON.stringify(e))}catch{}}function Wu(e){const t=Date.now(),n=e.id||fe(),r=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,c=e.previousSessionId,a=e.dirty||!1;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c,dirty:a}}function my(e,t){return Hu(e)?"session":t?"buffer":!1}function oa({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=my(e,t),i=Wu({sampled:s,previousSessionId:r});return n&&Ur(i),i}function gy(){if(!Ni())return null;try{const e=te.sessionStorage.getItem(Ei);if(!e)return null;const t=JSON.parse(e);return C&&M.infoTick("Loading existing session"),Wu(t)}catch{return null}}function $s(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function zu(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return $s(e.started,t,r)||$s(e.lastActivity,n,r)}function ju(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!zu(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function fs({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&gy();return s?ju(s,{sessionIdleExpire:e,maxReplayDuration:t})?(C&&M.infoTick("Session in sessionStorage is expired, creating new one..."),oa(r,{previousSessionId:s.id})):s:(C&&M.infoTick("Creating new session"),oa(r,{previousSessionId:n}))}function _y(e){return e.type===$.Custom}function Oi(e,t,n){return Vu(e,t)?(qu(e,t,n),!0):!1}function Sy(e,t,n){return Vu(e,t)?qu(e,t,n):Promise.resolve(null)}async function qu(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const s=e.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=e.getOptions(),o=yy(t,i.beforeAddRecordingEvent);return o?await r.addEvent(o):void 0}catch(i){const o=i&&i instanceof Ai,c=o?"addEventSizeExceeded":"addEvent",a=H();if(a){const u=o?"buffer_overflow":"internal_sdk_error";a.recordDroppedEvent(u,"replay")}if(o&&s)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:c})}}function Vu(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Ci(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(C&&M.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function yy(e,t){try{if(typeof t=="function"&&_y(e))return t(e)}catch(n){return C&&M.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Pi(e){return!e.type}function Us(e){return e.type==="transaction"}function Ey(e){return e.type==="replay_event"}function aa(e){return e.type==="feedback"}function by(e){return(t,n)=>{if(!e.isEnabled()||!Pi(t)&&!Us(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(Us(t)){Ty(e,t);return}vy(e,t)}}}function Ty(e,t){var r,s;const n=e.getContext();(s=(r=t.contexts)==null?void 0:r.trace)!=null&&s.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function vy(e,t){const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||Pn(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(s){e.handleException(s)}})}function Iy(e){return t=>{!e.isEnabled()||!Pi(t)||wy(e,t)}}function wy(e,t){var r,s,i;const n=(i=(s=(r=t.exception)==null?void 0:r.values)==null?void 0:s[0])==null?void 0:i.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 o=Be({category:"replay.hydrate-error",data:{url:en()}});Dn(e,o)}}function ky(e){const t=H();t&&t.on("beforeAddBreadcrumb",n=>Ry(e,n))}function Ry(e,t){if(!e.isEnabled()||!Gu(t))return;const n=Cy(t);n&&Dn(e,n)}function Cy(e){return!Gu(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?My(e):Be(e)}function My(e){var s;const t=(s=e.data)==null?void 0:s.arguments;if(!Array.isArray(t)||t.length===0)return Be(e);let n=!1;const r=t.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>Vn?(n=!0,`${i.slice(0,Vn)}…`):i;if(typeof i=="object")try{const o=Ce(i,7);return JSON.stringify(o).length>Vn?(n=!0,`${JSON.stringify(o,null,2).slice(0,Vn)}…`):o}catch{}return i});return Be({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function Gu(e){return!!e.category}function xy(e,t){var n,r,s;return e.type||!((r=(n=e.exception)==null?void 0:n.values)!=null&&r.length)?!1:!!((s=t.originalException)!=null&&s.__rrweb__)}function Yu(){const e=G().getPropagationContext().dsc;e&&delete e.replay_id;const t=pe();if(t){const n=He(t);delete n.replay_id}}function Ay(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:$.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 Ny(e,t){return e.recordingMode!=="buffer"||t.message===bi||!t.exception||t.type?!1:Hu(e.getOptions().errorSampleRate)}function Oy(e){return Object.assign((t,n)=>{var o;if(!e.isEnabled()||e.isPaused())return t;if(Ey(t))return delete t.breadcrumbs,t;if(!Pi(t)&&!Us(t)&&!aa(t))return t;if(!e.checkAndHandleExpiredSession())return Yu(),t;if(aa(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),Ay(e,t),t;if(xy(t,n)&&!e.getOptions()._experiments.captureExceptions)return C&&M.log("Ignoring error from rrweb internals",t),null;const s=Ny(e,t);if((s||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),s&&e.recordingMode==="buffer"&&((o=e.session)==null?void 0:o.sampled)==="buffer"){const c=e.session;c.dirty=!0,e.getOptions().stickySession&&Ur(c)}return t},{id:"Replay"})}function Hr(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:$.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:s,data:o}}});return typeof c=="string"?Promise.resolve(null):c})}function Py(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 Ly(e){return t=>{if(!e.isEnabled())return;const n=Py(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Hr(e,[n]),!1)))}}function Dy(e,t){return C&&e.getOptions()._experiments.traceInternals?!1:gp(t,H())}function Ku(e,t){e.isEnabled()&&t!==null&&(Dy(e,t.name)||e.addUpdate(()=>(Hr(e,[t]),!0)))}function Wr(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=cu(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function Xu(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function wr(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 Ju(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:c,response:a}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:{method:i,statusCode:o,request:c,response:a}}}function bn(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function nt(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:s,warnings:i}=Fy(n);return r.body=s,i!=null&&i.length&&(r._meta={warnings:i}),r}function Hs(e,t){return Object.entries(e).reduce((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n},{})}function Fy(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Ho,n=By(e);if(t){const r=e.slice(0,Ho);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 By(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function kr(e,t){const n=$y(e);return Ve(n,t)}function $y(e,t=te.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(te.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 Uy(e,t,n){try{const r=await Wy(e,t,n),s=Ju("resource.fetch",r);Ku(n.replay,s)}catch(r){C&&M.exception(r,"Failed to capture fetch breadcrumb")}}function Hy(e,t){const{input:n,response:r}=t,s=n?lu(n):void 0,i=Wr(s),o=r?Xu(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}async function Wy(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:o,method:c,status_code:a=0,request_body_size:u,response_body_size:d}=e.data,l=kr(o,n.networkDetailAllowUrls)&&!kr(o,n.networkDetailDenyUrls),f=l?zy(n,t.input,u):bn(u),p=await jy(l,n,t.response,d);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:p}}function zy({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?Gy(n,t):{};if(!e)return nt(s,r,void 0);const i=lu(n),[o,c]=uu(i,M),a=nt(s,r,o);return c?wr(a,c):a}async function jy(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return bn(s);const i=r?Qu(r.headers,n):{};if(!r||!t&&s!==void 0)return nt(i,s,void 0);const[o,c]=await Vy(r),a=qy(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return c?wr(a,c):a}function qy(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e!=null&&e.length&&n===void 0?Wr(e):n;return r?t?nt(s,i,e):nt(s,i,void 0):bn(i)}catch(i){return C&&M.exception(i,"Failed to serialize response body"),nt(s,n,void 0)}}async function Vy(e){const t=Yy(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await Ky(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(C&&M.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(C&&M.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function Qu(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function Gy(e,t){return e.length===1&&typeof e[0]!="string"?ca(e[0],t):e.length===2?ca(e[1],t):{}}function ca(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?Qu(n,t):Array.isArray(n)?{}:Hs(n,t):{}}function Yy(e){try{return e.clone()}catch(t){C&&M.exception(t,"Failed to clone response body")}}function Ky(e){return new Promise((t,n)=>{const r=Pn(()=>n(new Error("Timeout while trying to read response body")),500);Xy(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function Xy(e){return await e.text()}async function Jy(e,t,n){try{const r=Zy(e,t,n),s=Ju("resource.xhr",r);Ku(n.replay,s)}catch(r){C&&M.exception(r,"Failed to capture xhr breadcrumb")}}function Qy(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=Wr(r),i=n.getResponseHeader("content-length")?Xu(n.getResponseHeader("content-length")):nE(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function Zy(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!a)return null;if(!c||!kr(a,n.networkDetailAllowUrls)||kr(a,n.networkDetailDenyUrls)){const N=bn(l),S=bn(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:N,response:S}}const p=c[ht],h=p?Hs(p.request_headers,n.networkRequestHeaders):{},g=Hs(du(c),n.networkResponseHeaders),[_,E]=n.networkCaptureBodies?uu(o,M):[void 0],[T,F]=n.networkCaptureBodies?eE(c):[void 0],B=nt(h,l,_),q=nt(g,f,T);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:E?wr(B,E):B,response:F?wr(q,F):q}}function eE(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return tE(e.response,e.responseType)}catch(n){t.push(n)}return C&&M.warn("Failed to get xhr response body",...t),[void 0]}function tE(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 C&&M.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return C&&M.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function nE(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return Wr(n)}catch{return}}function rE(e){const t=H();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=e.getOptions(),c={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(a,u)=>sE(c,a,u))}catch{}}function sE(e,t,n){if(t.data)try{iE(t)&&aE(n)&&(Qy(t,n),Jy(t,n,e)),oE(t)&&cE(n)&&(Hy(t,n),Uy(t,n,e))}catch(r){C&&M.exception(r,"Error when enriching network breadcrumb")}}function iE(e){return e.category==="xhr"}function oE(e){return e.category==="fetch"}function aE(e){return e==null?void 0:e.xhr}function cE(e){return e==null?void 0:e.response}function uE(e){const t=H();ou(US(e)),Dr(Ly(e)),ky(e),rE(e);const n=Oy(e);xf(n),t&&(t.on("beforeSendEvent",Iy(e)),t.on("afterSendEvent",by(e)),t.on("createDsc",r=>{const s=e.getSessionId();s&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=s)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,s)=>{var o;const i=e.getSessionId();s!=null&&s.includeReplay&&e.isEnabled()&&i&&((o=r.contexts)!=null&&o.feedback)&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function lE(e){try{return Promise.all(Hr(e,[dE(te.performance.memory)]))}catch{return[]}}function dE(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function fE(e,t,n){return Tp(e,t,{...n,setTimeoutImpl:Pn})}const Re=L.navigator;function pE(){return/iPhone|iPad|iPod/i.test((Re==null?void 0:Re.userAgent)??"")||/Macintosh/i.test((Re==null?void 0:Re.userAgent)??"")&&(Re!=null&&Re.maxTouchPoints)&&(Re==null?void 0:Re.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function hE(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){C&&M.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&LS(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Oi(e,n,s))return!0;if(!s)return!1;const i=e.session;if(gE(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){const o=e.eventBuffer.getEarliestTimestamp();o&&(C&&M.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&Ur(i))}return i!=null&&i.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function mE(e){const t=e.getOptions();return{type:$.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 gE(e,t){!t||!e.session||e.session.segmentId!==0||Oi(e,mE(e),!1)}function _E(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function SE(e,t,n,r){return Qe(oc(e,Ar(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function yE({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}
24
+ `;if(typeof e=="string")n=`${r}${e}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function EE({client:e,scope:t,replayId:n,event:r}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:s};e.emit("preprocessEvent",r,i);const o=await pc(e.getOptions(),r,i,t,e,De());if(!o)return null;e.emit("postprocessEvent",o,i),o.platform=o.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:u,settings:d}=(c==null?void 0:c.sdk)||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},o}async function bE({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=yE({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:u,initialTimestamp:d}=r,l=H(),f=G(),p=l==null?void 0:l.getTransport(),h=l==null?void 0:l.getDsn();if(!l||!p||!h||!i.sampled)return Promise.resolve({});const g={type:Jg,replay_start_timestamp:d/1e3,timestamp:s/1e3,error_ids:a,trace_ids:u,urls:c,replay_id:t,segment_id:n,replay_type:i.sampled},_=await EE({scope:f,client:l,replayId:t,event:g});if(!_)return l.recordDroppedEvent("event_processor","replay"),C&&M.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete _.sdkProcessingMetadata;const E=SE(_,o,h,l.getOptions().tunnel);let T;try{T=await p.send(E)}catch(B){const q=new Error(bi);try{q.cause=B}catch{}throw q}if(typeof T.statusCode=="number"&&(T.statusCode<200||T.statusCode>=300))throw new Zu(T.statusCode);const F=Nc({},T);if(Ac(F,"replay"))throw new Li(F);return T}class Zu extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Li extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function el(e,t={count:0,interval:r_}){const{recordingData:n,onError:r}=e;if(n.length)try{return await bE(e),!0}catch(s){if(s instanceof Zu||s instanceof Li)throw s;if(gc("Replays",{_retryCount:t.count}),r&&r(s),t.count>=s_){const i=new Error(`${bi} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{Pn(async()=>{try{await el(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const tl="__THROTTLED",TE="__SKIPPED";function vE(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((u,d)=>{d<a&&r.delete(d)})},i=()=>[...r.values()].reduce((c,a)=>c+a,0);let o=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),i()>=t){const d=o;return o=!0,d?TE:tl}o=!1;const u=r.get(a)||0;return r.set(a,u+1),e(...c)}}class IE{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:Qg,sessionIdleExpire:Zg},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=fE(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=vE((o,c)=>Sy(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(i_,r),timeout:r,scrollTimeout:o_,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new AS(this,i)),C){const o=t._experiments;M.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{te.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=Be({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=Be({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{jS(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){C&&M.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(t),!this.session){C&&M.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",C&&M.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){C&&M.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){C&&M.log("Buffering is in progress, call `flush()` to save the replay");return}C&&M.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=fs({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){C&&M.log("Buffering is in progress, call `flush()` to save the replay");return}C&&M.infoTick("Starting replay in buffer mode");const t=fs({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=Ye({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:n_}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:hE(this),...pE(),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 r;if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{C&&M.log(`Stopping Replay${n?` triggered by ${n}`:""}`),Yu(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),(r=this.eventBuffer)==null||r.destroy(),this.eventBuffer=null,py(this)}catch(s){this.handleException(s)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),C&&M.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),C&&M.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();C&&M.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()),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(){if(this._lastActivity&&$s(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${te.location.pathname}${te.location.hash}${te.location.search}`,n=`${te.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===tl){const s=Be({category:"replay.throttled"});this.addUpdate(()=>!Oi(this,{type:IS,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||pe(),n=t&&le(t),s=(n&&U(n).data||{})[xe];if(!(!n||!s||!["route","custom"].includes(s)))return U(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=ly({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=fs({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 ju(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{te.document.addEventListener("visibilitychange",this._handleVisibilityChange),te.addEventListener("blur",this._handleWindowBlur),te.addEventListener("focus",this._handleWindowFocus),te.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(uE(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=ry(this)}_removeListeners(){try{te.document.removeEventListener("visibilitychange",this._handleVisibilityChange),te.removeEventListener("blur",this._handleWindowBlur),te.removeEventListener("focus",this._handleWindowFocus),te.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||zu(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){C&&M.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:$.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=YS(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(Hr(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){C&&M.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!((n=this.eventBuffer)!=null&&n.hasEvents)&&(await lE(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const s=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const o=await this.eventBuffer.finish();await el({replayId:t,recordingData:o,segmentId:i,eventContext:s,session:this.session,timestamp:r,onError:c=>this.handleException(c)})}catch(r){this.handleException(r),this.stop({reason:"sendReplay"});const s=H();if(s){const i=r instanceof Li?"ratelimit_backoff":"send_error";s.recordDroppedEvent(i,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){C&&M.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,s=Date.now()-n;this._debouncedFlush.cancel();const i=s<this._options.minReplayDuration,o=s>this._options.maxReplayDuration+5e3;if(i||o){C&&M.log(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const c=this.eventBuffer;c&&this.session.segmentId===0&&!c.hasCheckout&&C&&M.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Ur(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n!=null&&n.length&&t.some(c=>{const a=_E(c.target),u=n.join(",");return a==null?void 0:a.matches(u)}))return!1;const r=t.length,s=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,o=s&&r>s;if(r>i||o){const c=Be({category:"replay.mutations",data:{count:r,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function cn(e,t){return[...e,...t].join(",")}function wE({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=cn(e,[".sentry-mask","[data-sentry-mask]"]),c=cn(t,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:cn(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:cn(r,[]),ignoreSelector:cn(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function kE({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const ua='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',RE=["content-length","content-type","accept"];let la=!1;const CE=e=>new ME(e);class ME{constructor({flushMinDelay:t=e_,flushMaxDelay:n=t_,minReplayDuration:r=a_,maxReplayDuration:s=Wo,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:E=[],networkCaptureBodies:T=!0,networkRequestHeaders:F=[],networkResponseHeaders:B=[],mask:q=[],maskAttributes:N=["title","placeholder","aria-label"],unmask:S=[],block:k=[],unblock:J=[],ignore:y=[],maskFn:w,beforeAddRecordingEvent:P,beforeErrorSampling:j,onError:O}={}){this.name="Replay";const ce=wE({mask:q,unmask:S,block:k,unblock:J,ignore:y});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:w,maskInputFn:w,maskAttributeFn:(Q,ne,b)=>kE({maskAttributes:N,maskAllText:u,privacyOptions:ce,key:Q,value:ne,el:b}),...ce,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:Q=>{try{Q.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!a.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,c_),maxReplayDuration:Math.min(s,Wo),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:g,networkDetailAllowUrls:_,networkDetailDenyUrls:E,networkCaptureBodies:T,networkRequestHeaders:da(F),networkResponseHeaders:da(B),beforeAddRecordingEvent:P,beforeErrorSampling:j,onError:O,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${ua}`:ua,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Is())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return la}set _isInitialized(t){la=t}afterAllSetup(t){!Is()||this._replay||(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"}):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}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=xE(this._initialOptions,t);this._replay=new IE({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function xE(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=It(n.replaysSessionSampleRate),i=It(n.replaysOnErrorSampleRate);return s==null&&i==null&&at(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function da(e){return[...RE,...e.map(t=>t.toLowerCase())]}function AE(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function nl(e){try{return new URL(e,D.location.origin).href}catch{return}}function NE(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function rl(e){try{return new Headers(e)}catch{return}}const fa=new WeakMap,ps=new Map,sl={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function OE(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:c,onRequestSpanStart:a,onRequestSpanEnd:u}={...sl,...t},d=typeof i=="function"?i:h=>!0,l=h=>PE(h,c),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(g=>{if(g.op==="http.client"){const _=ps.get(g.span_id);_&&(g.timestamp=_/1e3,ps.delete(g.span_id))}}),h)),s&&ch(h=>{if(h.response){const g=fa.get(h.response);g&&h.endTimestamp&&ps.set(g,h.endTimestamp)}}),Uc(h=>{const g=Vp(h,d,l,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&fa.set(h.response,h.fetchData.__span),g){const _=nl(h.fetchData.url),E=_?Et(_).host:void 0;g.setAttributes({"http.url":_,"server.address":E}),o&&pa(g),a==null||a(g,{headers:h.headers})}})),r&&au(h=>{var _;const g=LE(h,d,l,f,p,u);g&&(o&&pa(g),a==null||a(g,{headers:rl((_=h.xhr.__sentry_xhr_v3__)==null?void 0:_.request_headers)}))})}function pa(e){const{url:t}=U(e).data;if(!t||typeof t!="string")return;const n=kt("resource",({entries:r})=>{r.forEach(s=>{NE(s)&&s.name.endsWith(t)&&(e.setAttributes(iu(s)),setTimeout(n))})})}function PE(e,t){const n=en();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Ve(r.toString(),t)||i&&Ve(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Ve(e,t):r}}function LE(e,t,n,r,s,i){const o=e.xhr,c=o==null?void 0:o[ht];if(!o||o.__sentry_own_request__||!c)return;const{url:a,method:u}=c,d=Ne()&&t(a);if(e.endTimestamp&&d){const E=o.__sentry_xhr_span_id__;if(!E)return;const T=r[E];T&&c.status_code!==void 0&&(ja(T,c.status_code),T.end(),i==null||i(T,{headers:rl(du(o)),error:e.error}),delete r[E]);return}const l=nl(a),f=Et(l||a),p=mp(a),h=!!pe(),g=d&&h?rn({name:`${u} ${p}`,attributes:{url:a,type:"xhr","http.method":u,"http.url":l,"server.address":f==null?void 0:f.host,[ae]:"auto.http.browser",[Ue]:"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 st;o.__sentry_xhr_span_id__=g.spanContext().spanId,r[o.__sentry_xhr_span_id__]=g,n(a)&&DE(o,Ne()&&h?g:void 0,s);const _=H();return _&&_.emit("beforeOutgoingRequestSpan",g,e),g}function DE(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=Pc({span:t,propagateTraceparent:n});r&&FE(e,r,s,i)}function FE(e,t,n,r){var i;const s=(i=e.__sentry_xhr_v3__)==null?void 0:i.request_headers;if(!(s!=null&&s["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(s!=null&&s.traceparent)&&e.setRequestHeader("traceparent",r),n){const o=s==null?void 0:s.baggage;(!o||!AE(o))&&e.setRequestHeader("baggage",n)}}catch{}}function BE(){D.document?D.document.addEventListener("visibilitychange",()=>{const e=pe();if(!e)return;const t=le(e);if(D.document.hidden&&t){const n="cancelled",{op:r,status:s}=U(t);I&&m.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:de,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):I&&m.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const $E=3600,il="sentry_previous_trace",UE="sentry.previous_trace";function HE(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?jE():void 0;e.on("spanStart",o=>{if(le(o)!==o)return;const c=G().getPropagationContext();s=WE(s,o,c),r&&zE(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const c=G(),a=c.getPropagationContext();if(i&&a.parentSpanId){i=!1;return}c.setPropagationContext({...a,dsc:{...a.dsc,sample_rate:String(s.sampleRate),sampled:String(Ws(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=Ws(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[za]:s.sampleRate}})}function WE(e,t,n){const r=U(t);function s(){var c,a;try{return Number((c=n.dsc)==null?void 0:c.sample_rate)??Number((a=r.data)==null?void 0:a[Ks])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=$E&&(I&&m.log(`Adding previous_trace ${o} link to span ${{op:r.op,...t.spanContext()}}`),t.addLink({context:o,attributes:{[td]:"previous_trace"}}),t.setAttribute(UE,`${o.traceId}-${o.spanId}-${Ws(o)?1:0}`)),i)}function zE(e){try{D.sessionStorage.setItem(il,JSON.stringify(e))}catch(t){I&&m.warn("Could not store previous trace in sessionStorage",t)}}function jE(){var e;try{const t=(e=D.sessionStorage)==null?void 0:e.getItem(il);return JSON.parse(t)}catch{return}}function Ws(e){return e.traceFlags===1}const qE="BrowserTracing",VE={...tr,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...sl},GE=(e={})=>{const t={name:void 0,source:void 0},n=D.document,{enableInp:r,enableElementTiming:s,enableLongTask:i,enableLongAnimationFrame:o,_experiments:{enableInteractions:c,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:u},beforeStartSpan:d,idleTimeout:l,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:g,traceXHR:_,trackFetchStreamPerformance:E,shouldCreateSpanForRequest:T,enableHTTPTimings:F,ignoreResourceSpans:B,ignorePerformanceApiSpans:q,instrumentPageLoad:N,instrumentNavigation:S,detectRedirects:k,linkPreviousTrace:J,consistentTraceSampling:y,enableReportPageLoaded:w,onRequestSpanStart:P,onRequestSpanEnd:j}={...VE,...e};let O,ce,Q;function ne(b,Y,R=!0){const K=Y.op==="pageload",Z=Y.name,re=d?d(Y):Y,be=re.attributes||{};if(Z!==re.name&&(be[xe]="custom",re.attributes=be),!R){const We=Ct();rn({...re,startTime:We}).end(We);return}t.name=re.name,t.source=be[xe];const Te=dc(re,{idleTimeout:l,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:K,beforeSpanEnd:We=>{O==null||O(),_m(We,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!u,ignoreResourceSpans:B,ignorePerformanceApiSpans:q}),ma(b,void 0);const At=G(),Fn=At.getPropagationContext();At.setPropagationContext({...Fn,traceId:Te.spanContext().traceId,sampled:lt(Te),dsc:He(We)}),K&&(Q=void 0)},trimIdleSpanEndTimestamp:!w});K&&w&&(Q=Te),ma(b,Te);function xt(){n&&["interactive","complete"].includes(n.readyState)&&b.emit("idleSpanEnableAutoFinish",Te)}K&&!w&&n&&(n.addEventListener("readystatechange",()=>{xt()}),xt())}return{name:qE,setup(b){if(Md(),O=lm({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:u||!1,client:b}),r&&Wm(),s&&Mm(),o&&L.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?fm():i&&dm(),c&&pm(),k&&n){const R=()=>{ce=ie()};addEventListener("click",R,{capture:!0}),addEventListener("keydown",R,{capture:!0,passive:!0})}function Y(){const R=Tn(b);R&&!U(R).timestamp&&(I&&m.log(`[Tracing] Finishing current active span with op: ${U(R).op}`),R.setAttribute(mn,"cancelled"),R.end())}b.on("startNavigationSpan",(R,K)=>{if(H()!==b)return;if(K!=null&&K.isRedirect){I&&m.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ne(b,{op:"navigation.redirect",...R},!1);return}ce=void 0,Y(),De().setPropagationContext({traceId:Je(),sampleRand:Math.random(),propagationSpanId:Ne()?void 0:Ge()});const Z=G();Z.setPropagationContext({traceId:Je(),sampleRand:Math.random(),propagationSpanId:Ne()?void 0:Ge()}),Z.setSDKProcessingMetadata({normalizedRequest:void 0}),ne(b,{op:"navigation",...R,parentSpan:null,forceTransaction:!0})}),b.on("startPageLoadSpan",(R,K={})=>{if(H()!==b)return;Y();const Z=K.sentryTrace||ha("sentry-trace"),re=K.baggage||ha("baggage"),be=bd(Z,re),Te=G();Te.setPropagationContext(be),Ne()||(Te.getPropagationContext().propagationSpanId=Ge()),Te.setSDKProcessingMetadata({normalizedRequest:ci()}),ne(b,{op:"pageload",...R})}),b.on("endPageloadSpan",()=>{w&&Q&&(Q.setAttribute(mn,"reportPageLoaded"),Q.end())})},afterAllSetup(b){let Y=en();if(J!=="off"&&HE(b,{linkPreviousTrace:J,consistentTraceSampling:y}),D.location){if(N){const R=he();Di(b,{name:D.location.pathname,startTime:R?R/1e3:void 0,attributes:{[xe]:"url",[ae]:"auto.pageload.browser"}})}S&&Dr(({to:R,from:K})=>{if(K===void 0&&(Y==null?void 0:Y.indexOf(R))!==-1){Y=void 0;return}Y=void 0;const Z=ai(R),re=Tn(b),be=re&&k&&XE(re,ce);YE(b,{name:(Z==null?void 0:Z.pathname)||D.location.pathname,attributes:{[xe]:"url",[ae]:"auto.navigation.browser"}},{url:R,isRedirect:be})})}h&&BE(),c&&KE(b,l,f,p,t),r&&qm(),OE(b,{traceFetch:g,traceXHR:_,trackFetchStreamPerformance:E,tracePropagationTargets:b.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:T,enableHTTPTimings:F,onRequestSpanStart:P,onRequestSpanEnd:j})}}};function Di(e,t,n){e.emit("startPageLoadSpan",t,n),G().setTransactionName(t.name);const r=Tn(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function YE(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=G();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...ci(),url:r}}),Tn(e)}function ha(e){const t=D.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function KE(e,t,n,r,s){const i=D.document;let o;const c=()=>{const a="ui.action.click",u=Tn(e);if(u){const d=U(u).op;if(["navigation","pageload"].includes(d)){I&&m.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(mn,"interactionInterrupted"),o.end(),o=void 0),!s.name){I&&m.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=dc({name:s.name,op:a,attributes:{[xe]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const ol="_sentry_idleSpan";function Tn(e){return e[ol]}function ma(e,t){Ie(e,ol,t)}const ga=1.5;function XE(e,t){const n=U(e),r=Ct(),s=n.start_timestamp;return!(r-s>ga||t&&r-t<=ga)}function Xt(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function JE(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=Xt(n);return s=>r.then(i=>s(i.transaction(t,"readwrite").objectStore(t)))}function Fi(e){return Xt(e.getAllKeys())}function QE(e,t,n){return e(r=>Fi(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.max(...s,0)+1),Xt(r.transaction)}))}function ZE(e,t,n){return e(r=>Fi(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.min(...s,0)-1),Xt(r.transaction)}))}function eb(e){return e(t=>Fi(t).then(n=>{const r=n[0];if(r!=null)return Xt(t.get(r)).then(s=>(t.delete(r),Xt(t.transaction).then(()=>s)))}))}function tb(e){let t;function n(){return t==null&&(t=JE(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const s=await pr(r);await QE(n(),s,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const s=await pr(r);await ZE(n(),s,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await eb(n());if(r)return Ud(r)}catch{}}}}function nb(e){return t=>{const n=e({...t,createStore:tb});return D.addEventListener("online",async r=>{await n.flush()}),n}}function rb(e=yi){return nb(fp(e))}const _a=1e6,sb="window"in L&&L.window===L&&typeof importScripts>"u",rt=String(0),Rr=sb?"main":"worker",Me=D.navigator;let al="",cl="",ul="",zs=(Me==null?void 0:Me.userAgent)||"",ll="";var va;const ib=(Me==null?void 0:Me.language)||((va=Me==null?void 0:Me.languages)==null?void 0:va[0])||"";function ob(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const Sa=Me==null?void 0:Me.userAgentData;ob(Sa)&&Sa.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{var t;if(al=e.platform||"",ul=e.architecture||"",ll=e.model||"",cl=e.platformVersion||"",(t=e.fullVersionList)!=null&&t.length){const n=e.fullVersionList[e.fullVersionList.length-1];zs=`${n.brand} ${n.version}`}}).catch(e=>{});function ab(e){return!("thread_metadata"in e)}function cb(e){return ab(e)?hb(e):e}function ub(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&&I&&m.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function lb(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 s=ub(r),i=cb(n),o=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:ie()*1e3),c=typeof r.timestamp=="number"?r.timestamp*1e3:ie()*1e3;return{event_id:e,timestamp:new Date(o).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||xr,runtime:{name:"javascript",version:D.navigator.userAgent},os:{name:al,version:cl,build_number:zs},device:{locale:ib,model:ll,manufacturer:zs,architecture:ul,is_emulator:!1},debug_meta:{images:fl(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||fe(),trace_id:s,active_thread_id:rt,relative_start_ns:"0",relative_end_ns:((c-o)*1e6).toFixed(0)}]}}function db(e,t,n){var o,c;if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const r=pb(e),s=t.getOptions(),i=(c=(o=t.getSdkMetadata)==null?void 0:o.call(t))==null?void 0:c.sdk;return{chunk_id:fe(),client_sdk:{name:(i==null?void 0:i.name)??"sentry.javascript.browser",version:(i==null?void 0:i.version)??"0.0.0"},profiler_id:n||fe(),platform:"javascript",version:"2",release:s.release??"",environment:s.environment??"production",debug_meta:{images:fl(e.resources)},profile:r}}function fb(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 pb(e){const t=[];for(let c=0;c<e.frames.length;c++){const a=e.frames[c];a&&(t[c]={function:a.name,abs_path:typeof a.resourceId=="number"?e.resources[a.resourceId]:void 0,lineno:a.line,colno:a.column})}const n=[];for(let c=0;c<e.stacks.length;c++){const a=e.stacks[c];if(!a)continue;const u=[];let d=a;for(;d;)u.push(d.frameId),d=d.parentId===void 0?void 0:e.stacks[d.parentId];n[c]=u}const r=he(),s=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,i=s-(r||s),o=[];for(let c=0;c<e.samples.length;c++){const a=e.samples[c];if(!a)continue;const u=(s+(a.timestamp-i))/1e3;o[c]={stack_id:a.stackId??0,thread_id:rt,timestamp:u}}return{frames:t,stacks:n,samples:o,thread_metadata:{[rt]:{name:Rr}}}}function dl(e){return U(e).op==="pageload"}function hb(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[rt]:{name:Rr}}},s=e.samples[0];if(!s)return r;const i=s.timestamp,o=he(),c=typeof performance.timeOrigin=="number"?performance.timeOrigin:o||0,a=c-(o||c);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+a-i)*_a).toFixed(0),stack_id:t,thread_id:rt};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+a-i)*_a).toFixed(0),stack_id:n,thread_id:rt};r.stacks[n]=f,r.samples[d]=p,n++}),r}function mb(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function gb(e){const t=[];return dr(e,(n,r)=>{var s,i;if(r==="transaction")for(let o=1;o<n.length;o++){const c=n[o];(i=(s=c==null?void 0:c.contexts)==null?void 0:s.profile)!=null&&i.profile_id&&t.push(n[o])}}),t}function fl(e){const t=H(),n=t==null?void 0:t.getOptions(),r=n==null?void 0:n.stackParser;return r?Sf(r,e):[]}function pl(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(I&&m.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?(I&&m.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function _b(e){return e.samples.length<2?(I&&m.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(I&&m.log("[Profiling] Discarding profile because it contains no frames"),!1)}let Bi=!1;const hl=3e4;function Sb(e){return typeof e=="function"}function ml(){const e=D.Profiler;if(!Sb(e)){I&&m.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const t=10,n=Math.floor(hl/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{I&&(m.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),m.log("[Profiling] Disabling profiling for current user session.")),Bi=!0}}function ya(e){if(Bi)return I&&m.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return I&&m.log("[Profiling] Discarding profile because root span was not sampled."),!1;const t=H(),n=t==null?void 0:t.getOptions();if(!n)return I&&m.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return pl(r)?r?(r===!0?!0:Math.random()<r)?!0:(I&&m.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(I&&m.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(I&&m.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function yb(e){if(Bi)return I&&m.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(e.profileLifecycle!=="trace")return!1;const t=e.profileSessionSampleRate;return pl(t)?t?Math.random()<=t:(I&&m.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(I&&m.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function Xn(e){return typeof e.profilesSampleRate<"u"}function Eb(e,t,n,r){return _b(n)?lb(e,t,n,r):null}const gt=new Map;function bb(){return gt.size}function Tb(e){const t=gt.get(e);return t&&gt.delete(e),t}function vb(e,t){if(gt.set(e,t),gt.size>30){const n=gt.keys().next().value;n!==void 0&&gt.delete(n)}}function Ib(e){var t,n,r,s,i;return!((t=e==null?void 0:e.contexts)!=null&&t.profile)||!e.contexts||(e.contexts.trace={...((n=e.contexts)==null?void 0:n.trace)??{},data:{...((s=(r=e.contexts)==null?void 0:r.trace)==null?void 0:s.data)??{},"thread.id":rt,"thread.name":Rr}},(i=e.spans)==null||i.forEach(o=>{o.data={...o.data||{},"thread.id":rt,"thread.name":Rr}})),e}function Ea(e){let t;dl(e)&&(t=ie()*1e3);const n=ml();if(!n)return;I&&m.log(`[Profiling] started profiling span: ${U(e).description}`);const r=fe();let s=null;G().setContext("profile",{profile_id:r,start_timestamp:t});async function i(){if(e&&n){if(s){I&&m.log("[Profiling] profile for:",U(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(o&&(D.clearTimeout(o),o=void 0),I&&m.log(`[Profiling] stopped profiling of span: ${U(e).description}`),!u){I&&m.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}s=u,vb(r,u)}).catch(u=>{I&&m.log("[Profiling] error while stopping profiler:",u)})}}let o=D.setTimeout(()=>{I&&m.log("[Profiling] max profile duration elapsed, stopping profiling for:",U(e).description),i()},hl);const c=e.end.bind(e);function a(){return e?(i().then(()=>{c()},()=>{c()}),e):c()}e.end=a}const wb=6e4,kb=3e5;class Rb{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1}initialize(t,n){this._profilerId=fe(),I&&m.log("[Profiling] Initializing profiler (lifecycle='trace')."),this._client=t,this._sessionSampled=n,this._setupTraceLifecycleListeners(t)}notifyRootSpanActive(t){if(!this._sessionSampled)return;const n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._activeRootSpanIds.add(n);const r=this._activeRootSpanIds.size;r===1&&(I&&m.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this.start())}start(){if(!this._isRunning){if(this._isRunning=!0,I&&m.log("[Profiling] Started profiling with profile ID:",this._profilerId),cr().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){I&&m.log("[Profiling] Stopping trace lifecycle profiling."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}stop(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(t=>{I&&m.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){I&&m.log("[Profiling] Session not sampled because of negative sampling decision.");return}if(n!==le(n))return;if(!n.isRecording()){I&&m.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 s=this._activeRootSpanIds.size;s===1&&(I&&m.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${s}).`),this.start())}),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 s=this._activeRootSpanIds.size;I&&m.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${s}).`),s===0&&(this._collectCurrentChunk().catch(i=>{I&&m.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",i)}),this.stop())})}_resetProfilerInfo(){this._isRunning=!1,cr().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);const n=setTimeout(()=>this._onRootSpanTimeout(t),kb);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){var n;if(((n=this._profiler)==null?void 0:n.stopped)===!1)return;const t=ml();if(!t){I&&m.log("[Profiling] Failed to start JS Profiler in trace lifecycle.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{I&&m.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},wb))}_onRootSpanTimeout(t){if(!this._rootSpanTimeouts.has(t)||(this._rootSpanTimeouts.delete(t),!this._activeRootSpanIds.has(t)))return;I&&m.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.stop()}async _collectCurrentChunk(){const t=this._profiler;if(this._profiler=void 0,!!t)try{const n=await t.stop(),r=db(n,this._client,this._profilerId),s=fb(r);if("reason"in s){I&&m.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",s.reason);return}this._sendProfileChunk(r),I&&m.log("[Profiling] Collected browser profile chunk.")}catch(n){I&&m.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(t){var c;const n=this._client,r=Ar((c=n.getSdkMetadata)==null?void 0:c.call(n)),s=n.getDsn(),i=n.getOptions().tunnel,o=Qe({event_id:fe(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&s&&{dsn:Mt(s)}},[[{type:"profile_chunk"},t]]);n.sendEnvelope(o).then(null,a=>{I&&m.error("Error while sending profile chunk envelope:",a)})}}const Cb="BrowserProfiling",Mb=()=>({name:Cb,setup(e){const t=e.getOptions();if(!Xn(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),Xn(t)&&!t.profilesSampleRate){I&&m.log("[Profiling] Profiling disabled, no profiling options found.");return}const n=pe(),r=n&&le(n);if(Xn(t)&&t.profileSessionSampleRate!==void 0&&I&&m.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),Xn(t))r&&dl(r)&&ya(r)&&Ea(r),e.on("spanStart",s=>{s===le(s)&&ya(s)&&Ea(s)}),e.on("beforeEnvelope",s=>{var c,a;if(!bb())return;const i=gb(s);if(!i.length)return;const o=[];for(const u of i){const d=u==null?void 0:u.contexts,l=(c=d==null?void 0:d.profile)==null?void 0:c.profile_id,f=(a=d==null?void 0:d.profile)==null?void 0:a.start_timestamp;if(typeof l!="string"){I&&m.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!l){I&&m.log("[Profiling] cannot find profile for a span without a profile context");continue}d!=null&&d.profile&&delete d.profile;const p=Tb(l);if(!p){I&&m.log(`[Profiling] Could not retrieve profile for span: ${l}`);continue}const h=Eb(l,f,p,u);h&&o.push(h)}mb(s,o)});else{const s=yb(t);if(s||I&&m.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),t.profileLifecycle==="trace"){if(!Ne(t)){I&&m.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}const o=new Rb;o.initialize(e,s),r&&o.notifyRootSpanActive(r),D.setTimeout(()=>{const c=pe(),a=c&&le(c);a&&o.notifyRootSpanActive(a)},0)}}},processEvent(e){return Ib(e)}}),xb=Mb;function Ab(e){const t={...e};return Oc(t,"react"),gc("react",{version:Ia.version}),Xg(t)}const Nb=new WeakSet;function Ob(e,t){const n=GE({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:s,useNavigationType:i,createRoutesFromChildren:o,matchRoutes:c,stripBasename:a,enableAsyncRouteHandlers:u=!1,instrumentPageLoad:d=!0,instrumentNavigation:l=!0}=e;return{...n,setup(f){n.setup(f)},afterAllSetup(f){var h;n.afterAllSetup(f);const p=(h=D.location)==null?void 0:h.pathname;d&&p&&Di(f,{name:p,attributes:{[xe]:"url",[Ue]:"pageload",[ae]:`auto.pageload.react.reactrouter_v${t}`}}),l&&Nb.add(f)}}}function Pb(e){return Ob(e,"6")}var ba={};const Lb=ba.CI==="true"||ba.GITHUB_ACTIONS==="true",Db={enabled:!0,environment:Lb?"github-ci":"production",release:"spotlight@4.7.1",tracesSampleRate:1,enableLogs:!0},Fb=["sentryTrace","baggage"];function Bb(e=!0){const t=[Pb({instrumentPageLoad:e,useEffect:Ia.useEffect,useLocation:Tl,useNavigationType:bl,createRoutesFromChildren:El,matchRoutes:yl}),CE(),xb(),sh({levels:["log","info","warn","error","debug"]})],n=document.location.hash.slice(1);if(n.startsWith("spotlight")){const r=n.indexOf("="),s=r>-1?decodeURIComponent(n.slice(r+1)):void 0;t.push(qg({sidecarUrl:s}))}return t}function Hb(){const e=Fb.map(s=>[s,Sl(s)]),t=e.every(([,s])=>!!s),n=Bb(!t),r=Ab({...Db,transport:rb(yi),dsn:"https://51bcd92dba1128934afd1c5726c84442@o1.ingest.us.sentry.io/4508404727283713",integrations:n,tracePropagationTargets:[/^\//,document.location.origin],profilesSampleRate:1,replaysSessionSampleRate:.01,replaysOnErrorSampleRate:1});t&&r&&Di(r,{name:"pageload"},Object.fromEntries(e))}export{Hb as default,Bb as getIntegrations};
25
25
  //# sourceMappingURL=instrumentation.js.map