@epic-web/workshop-app 6.72.0 → 6.72.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 (42) hide show
  1. package/build/client/assets/{_-dWSrc4Ox.js → _-C4AWl_1u.js} +2 -2
  2. package/build/client/assets/{_-dWSrc4Ox.js.map → _-C4AWl_1u.js.map} +1 -1
  3. package/build/client/assets/{_exerciseNumber-FdJ9Amz3.js → _exerciseNumber-DUwXPNgl.js} +2 -2
  4. package/build/client/assets/{_exerciseNumber-FdJ9Amz3.js.map → _exerciseNumber-DUwXPNgl.js.map} +1 -1
  5. package/build/client/assets/{_exerciseNumber_._stepNumber.index-WLW-sVZ0.js → _exerciseNumber_._stepNumber.index-BPqMtmN8.js} +2 -2
  6. package/build/client/assets/{_exerciseNumber_._stepNumber.index-WLW-sVZ0.js.map → _exerciseNumber_._stepNumber.index-BPqMtmN8.js.map} +1 -1
  7. package/build/client/assets/{_exerciseNumber_.finished-Z7QZ9wk-.js → _exerciseNumber_.finished-C4sVkuEq.js} +2 -2
  8. package/build/client/assets/{_exerciseNumber_.finished-Z7QZ9wk-.js.map → _exerciseNumber_.finished-C4sVkuEq.js.map} +1 -1
  9. package/build/client/assets/{_extra-UkIdJCI9.js → _extra-DkiDFYVP.js} +2 -2
  10. package/build/client/assets/{_extra-UkIdJCI9.js.map → _extra-DkiDFYVP.js.map} +1 -1
  11. package/build/client/assets/{_layout-CjWZzKD8.js → _layout-C9vSX5Ti.js} +2 -2
  12. package/build/client/assets/{_layout-CjWZzKD8.js.map → _layout-C9vSX5Ti.js.map} +1 -1
  13. package/build/client/assets/{_layout-DQM0capK.js → _layout-DDTXkx2z.js} +2 -2
  14. package/build/client/assets/{_layout-DQM0capK.js.map → _layout-DDTXkx2z.js.map} +1 -1
  15. package/build/client/assets/{entry.client-DSlySyW6.js → entry.client-DdbTov6T.js} +3 -3
  16. package/build/client/assets/{entry.client-DSlySyW6.js.map → entry.client-DdbTov6T.js.map} +1 -1
  17. package/build/client/assets/{error-boundary-DVp6wKiz.js → error-boundary-DxHqAEHX.js} +3 -3
  18. package/build/client/assets/{error-boundary-DVp6wKiz.js.map → error-boundary-DxHqAEHX.js.map} +1 -1
  19. package/build/client/assets/{finished-PFz2gTpr.js → finished-BW_4ow3n.js} +2 -2
  20. package/build/client/assets/{finished-PFz2gTpr.js.map → finished-BW_4ow3n.js.map} +1 -1
  21. package/build/client/assets/{index-DkDXAMak.js → index-BgExztV_.js} +2 -2
  22. package/build/client/assets/{index-DkDXAMak.js.map → index-BgExztV_.js.map} +1 -1
  23. package/build/client/assets/{index-DuFMeXSm.js → index-DroM8fzS.js} +2 -2
  24. package/build/client/assets/{index-DuFMeXSm.js.map → index-DroM8fzS.js.map} +1 -1
  25. package/build/client/assets/{index-CATk0s1i.js → index-IgBUhsxX.js} +2 -2
  26. package/build/client/assets/{index-CATk0s1i.js.map → index-IgBUhsxX.js.map} +1 -1
  27. package/build/client/assets/{index-DfT8l3cx.js → index-PKjGT1Rp.js} +2 -2
  28. package/build/client/assets/{index-DfT8l3cx.js.map → index-PKjGT1Rp.js.map} +1 -1
  29. package/build/client/assets/index.client-CsIUPfXc.js +500 -0
  30. package/build/client/assets/index.client-CsIUPfXc.js.map +1 -0
  31. package/build/client/assets/{manifest-6451f320.js → manifest-9e0c0428.js} +1 -1
  32. package/build/client/assets/progress-BcA4i0iU.js +2 -0
  33. package/build/client/assets/progress-BcA4i0iU.js.map +1 -0
  34. package/build/client/assets/{root-CB01jtcy.js → root-CKcj2hDc.js} +3 -3
  35. package/build/client/assets/{root-CB01jtcy.js.map → root-CKcj2hDc.js.map} +1 -1
  36. package/build/server/index.js +16 -2
  37. package/build/server/index.js.map +1 -1
  38. package/package.json +9 -9
  39. package/build/client/assets/index.client-B5fbXzJV.js +0 -500
  40. package/build/client/assets/index.client-B5fbXzJV.js.map +0 -1
  41. package/build/client/assets/progress-ILaVQtOO.js +0 -2
  42. package/build/client/assets/progress-ILaVQtOO.js.map +0 -1
@@ -1,500 +0,0 @@
1
- import{r as Ye}from"./index-CqIc3cxq.js";const w=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,L=globalThis,jt="10.35.0";function Nt(){return Lr(L),L}function Lr(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||jt,t[jt]=t[jt]||{}}function er(e,t,n=L){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[jt]=r[jt]||{};return o[e]||(o[e]=t())}const ma=["debug","info","warn","error","log","assert","trace"],nm="Sentry Logger ",Wo={};function yt(e){if(!("console"in L))return e();const t=L.console,n={},r=Object.keys(Wo);r.forEach(o=>{const s=Wo[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function rm(){_a().enabled=!0}function om(){_a().enabled=!1}function gd(){return _a().enabled}function sm(...e){ga("log",...e)}function im(...e){ga("warn",...e)}function am(...e){ga("error",...e)}function ga(e,...t){w&&gd()&&yt(()=>{L.console[e](`${nm}[${e}]:`,...t)})}function _a(){return w?er("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const m={enable:rm,disable:om,isEnabled:gd,log:sm,warn:im,error:am},_d=50,ht="?",Dc=/\(error: (.*)\)/,Fc=/captureMessage|captureException/;function yd(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],i=n.split(`
2
- `);for(let a=r;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));const u=Dc.test(c)?c.replace(Dc,"$1"):c;if(!u.match(/\S*Error: /)){for(const d of t){const l=d(u);if(l){s.push(l);break}}if(s.length>=_d+o)break}}return um(s.slice(o))}}function cm(e){return Array.isArray(e)?yd(...e):e}function um(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(no(t).function||"")&&t.pop(),t.reverse(),Fc.test(no(t).function||"")&&(t.pop(),Fc.test(no(t).function||"")&&t.pop()),t.slice(0,_d).map(n=>({...n,filename:n.filename||no(t).filename,function:n.function||ht}))}function no(e){return e[e.length-1]||{}}const Zs="<anonymous>";function kt(e){try{return!e||typeof e!="function"?Zs:e.name||Zs}catch{return Zs}}function xi(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 Sd(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const To={},$c={};function Kt(e,t){To[e]=To[e]||[],To[e].push(t)}function Xt(e,t){if(!$c[e]){$c[e]=!0;try{t()}catch(n){w&&m.error(`Error while instrumenting ${e}`,n)}}}function Ke(e,t){const n=e&&To[e];if(n)for(const r of n)try{r(t)}catch(o){w&&m.error(`Error while triggering instrumentation handler.
3
- Type: ${e}
4
- Name: ${kt(r)}
5
- Error:`,o)}}let ei=null;function bd(e){const t="error";Kt(t,e),Xt(t,lm)}function lm(){ei=L.onerror,L.onerror=function(e,t,n,r,o){return Ke("error",{column:r,error:o,line:n,msg:e,url:t}),ei?ei.apply(this,arguments):!1},L.onerror.__SENTRY_INSTRUMENTED__=!0}let ti=null;function Ed(e){const t="unhandledrejection";Kt(t,e),Xt(t,dm)}function dm(){ti=L.onunhandledrejection,L.onunhandledrejection=function(e){return Ke("unhandledrejection",e),ti?ti.apply(this,arguments):!0},L.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Td=Object.prototype.toString;function pt(e){switch(Td.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Rt(e,Error)}}function tr(e,t){return Td.call(e)===`[object ${t}]`}function vd(e){return tr(e,"ErrorEvent")}function Bc(e){return tr(e,"DOMError")}function fm(e){return tr(e,"DOMException")}function ot(e){return tr(e,"String")}function Es(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Vt(e){return e===null||Es(e)||typeof e!="object"&&typeof e!="function"}function rt(e){return tr(e,"Object")}function Ts(e){return typeof Event<"u"&&Rt(e,Event)}function pm(e){return typeof Element<"u"&&Rt(e,Element)}function hm(e){return tr(e,"RegExp")}function nr(e){return!!(e?.then&&typeof e.then=="function")}function mm(e){return rt(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Rt(e,t){try{return e instanceof t}catch{return!1}}function Id(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function ya(e){return typeof Request<"u"&&Rt(e,Request)}const Sa=L,gm=80;function Ue(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let s=0,i=0;const a=" > ",c=a.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||gm;for(;n&&s++<r&&(u=_m(n,d),!(u==="html"||s>1&&i+o.length*c+u.length>=l));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function _m(e,t){const n=e,r=[];if(!n?.tagName)return"";if(Sa.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 o=t?.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(o?.length)o.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const i=n.className;if(i&&ot(i)){const a=i.split(/\s+/);for(const c of a)r.push(`.${c}`)}}const s=["aria-label","type","name","title","alt"];for(const i of s){const a=n.getAttribute(i);a&&r.push(`[${i}="${a}"]`)}return r.join("")}function Tn(){try{return Sa.document.location.href}catch{return""}}function wd(e){if(!Sa.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 Re(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const o=n(r);typeof o=="function"&&kd(o,r);try{e[t]=o}catch{w&&m.log(`Failed to replace method "${t}" in object`,e)}}function Le(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{w&&m.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function kd(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Le(e,"__sentry_original__",t)}catch{}}function ba(e){return e.__sentry_original__}function Rd(e){if(pt(e))return{message:e.message,name:e.name,stack:e.stack,...Hc(e)};if(Ts(e)){const t={type:e.type,target:Uc(e.target),currentTarget:Uc(e.currentTarget),...Hc(e)};return typeof CustomEvent<"u"&&Rt(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Uc(e){try{return pm(e)?Ue(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Hc(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 ym(e){const t=Object.keys(Rd(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let kn;function Dr(e){if(kn!==void 0)return kn?kn(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=L;return t in n&&typeof n[t]=="function"?(kn=n[t],kn(e)):(kn=null,e())}function vt(){return Dr(()=>Math.random())}function Fr(){return Dr(()=>Date.now())}function kr(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function ni(e,t){let n=e;const r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function jo(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const o=e[r];try{Id(o)?n.push(Sd(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function vo(e,t,n=!1){return ot(e)?hm(t)?t.test(e):ot(t)?n?e===t:e.includes(t):!1:!1}function st(e,t=[],n=!1){return t.some(r=>vo(e,r,n))}function Sm(){const e=L;return e.crypto||e.msCrypto}let ri;function bm(){return vt()*16}function ve(e=Sm()){try{if(e?.randomUUID)return Dr(()=>e.randomUUID()).replace(/-/g,"")}catch{}return ri||(ri="10000000100040008000"+1e11),ri.replace(/[018]/g,t=>(t^(bm()&15)>>t/4).toString(16))}function Cd(e){return e.exception?.values?.[0]}function on(e){const{message:t,event_id:n}=e;if(t)return t;const r=Cd(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Mi(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function Ct(e,t){const n=Cd(e);if(!n)return;const r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){const s={...o?.data,...t.data};n.mechanism.data=s}}function Em(e,t,n=5){if(t.lineno===void 0)return;const r=e.length,o=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,o-n),o).map(i=>ni(i,0));const s=Math.min(r-1,o);t.context_line=ni(e[s],t.colno||0),t.post_context=e.slice(Math.min(o+1,r),o+1+n).map(i=>ni(i,0))}function Wc(e){if(Tm(e))return!0;try{Le(e,"__sentry_captured__",!0)}catch{}return!1}function Tm(e){try{return e.__sentry_captured__}catch{}}const Ad=1e3;function vn(){return Fr()/Ad}function vm(){const{performance:e}=L;if(!e?.now||!e.timeOrigin)return vn;const t=e.timeOrigin;return()=>(t+Dr(()=>e.now()))/Ad}let jc;function fe(){return(jc??(jc=vm()))()}let oi=null;function Im(){const{performance:e}=L;if(!e?.now)return;const t=3e5,n=Dr(()=>e.now()),r=Fr(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;const s=e.timing?.navigationStart;return typeof s=="number"&&Math.abs(s+n-r)<t?s:r-n}function Ae(){return oi===null&&(oi=Im()),oi}function wm(e){const t=fe(),n={sid:ve(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Rm(n)};return e&&Un(n,e),n}function Un(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||fe(),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:ve()),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 km(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Un(e,n)}function Rm(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 $r(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=$r(r[o],t[o],n-1));return r}function mt(){return ve()}function It(){return ve().substring(16)}const Ni="_sentrySpan";function gt(e,t){t?Le(e,Ni,t):delete e[Ni]}function Hn(e){return e[Ni]}const Cm=100;class _t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:mt(),sampleRand:vt()}}clone(){const t=new _t;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,gt(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&&Un(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})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof _t?n.getScopeData():rt(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:u,fingerprint:d=[],propagationContext:l}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),d.length&&(this._fingerprint=d),l&&(this._propagationContext=l),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,gt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:mt(),sampleRand:vt()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:Cm;if(r<=0)return this;const o={timestamp:vn(),...t,message:t.message?kr(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Hn(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=$r(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n?.event_id||ve();if(!this._client)return w&&m.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){const o=r?.event_id||ve();if(!this._client)return w&&m.warn("No client configured on scope - will not capture message!"),o;const s=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){const r=n?.event_id||ve();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(w&&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 Am(){return er("defaultCurrentScope",()=>new _t)}function xm(){return er("defaultIsolationScope",()=>new _t)}class Mm{constructor(t,n){let r;t?r=t:r=new _t;let o;n?o=n:o=new _t,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return nr(r)?r.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(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 Wn(){const e=Nt(),t=Lr(e);return t.stack=t.stack||new Mm(Am(),xm())}function Nm(e){return Wn().withScope(e)}function Om(e,t){const n=Wn();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function qc(e){return Wn().withScope(()=>e(Wn().getIsolationScope()))}function Pm(){return{withIsolationScope:qc,withScope:Nm,withSetScope:Om,withSetIsolationScope:(e,t)=>qc(t),getCurrentScope:()=>Wn().getScope(),getIsolationScope:()=>Wn().getIsolationScope()}}function Qt(e){const t=Lr(e);return t.acs?t.acs:Pm()}function z(){const e=Nt();return Qt(e).getCurrentScope()}function Ie(){const e=Nt();return Qt(e).getIsolationScope()}function br(){return er("globalScope",()=>new _t)}function Ge(...e){const t=Nt(),n=Qt(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function HA(...e){const t=Nt(),n=Qt(t);if(e.length===2){const[r,o]=e;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(e[0])}function R(){return z().getClient()}function xd(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||It()};return r&&(s.parent_span_id=r),s}const Pe="sentry.source",Ea="sentry.sample_rate",Md="sentry.previous_trace_sample_rate",Te="sentry.op",Y="sentry.origin",Rr="sentry.idle_span_finish_reason",Br="sentry.measurement_unit",Ur="sentry.measurement_value",Oi="sentry.custom_span_name",Ta="sentry.profile_id",rr="sentry.exclusive_time",Lm="http.request.method",Dm="url.full",Fm="sentry.link.type",$m=0,vs=1,Z=2;function Bm(e){if(e<400&&e>=100)return{code:vs};if(e>=400&&e<500)switch(e){case 401:return{code:Z,message:"unauthenticated"};case 403:return{code:Z,message:"permission_denied"};case 404:return{code:Z,message:"not_found"};case 409:return{code:Z,message:"already_exists"};case 413:return{code:Z,message:"failed_precondition"};case 429:return{code:Z,message:"resource_exhausted"};case 499:return{code:Z,message:"cancelled"};default:return{code:Z,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:Z,message:"unimplemented"};case 503:return{code:Z,message:"unavailable"};case 504:return{code:Z,message:"deadline_exceeded"};default:return{code:Z,message:"internal_error"}}return{code:Z,message:"internal_error"}}function qo(e,t){e.setAttribute("http.response.status_code",t);const n=Bm(t);n.message!=="unknown_error"&&e.setStatus(n)}const Nd="_sentryScope",Od="_sentryIsolationScope";function Um(e){try{const t=L.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Hm(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function Wm(e,t,n){e&&(Le(e,Od,Um(n)),Le(e,Nd,t))}function zo(e){const t=e;return{scope:t[Nd],isolationScope:Hm(t[Od])}}const va="sentry-",jm=/^sentry-/,qm=8192;function Ia(e){const t=zm(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.match(jm)){const i=o.slice(va.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function Pd(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${va}${r}`]=o),n),{});return Gm(t)}function zm(e){if(!(!e||!ot(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=zc(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):zc(e)}function zc(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function Gm(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${t},${s}`;return i.length>qm?(w&&m.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):i},"")}const Vm=/^o(\d+)\./,Jm=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Ym(e){return e==="http"||e==="https"}function Ot(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function Ld(e){const t=Jm.exec(e);if(!t){yt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",i="",a=""]=t.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Dd({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function Dd(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Km(e){if(!w)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(m.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?Ym(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 Xm(e){return e.match(Vm)?.[1]}function Fd(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=Xm(n)),r}function $d(e){const t=typeof e=="string"?Ld(e):Dd(e);if(!(!t||!Km(t)))return t}function pn(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 Bd=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Qm(e){if(!e)return;const t=e.match(Bd);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 Ud(e,t){const n=Qm(e),r=Ia(t);if(!n?.traceId)return{traceId:mt(),sampleRand:vt()};const o=Zm(n,r);r&&(r.sample_rand=o.toString());const{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function Hd(e=mt(),t=It(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Wd(e=mt(),t=It(),n){return`00-${e}-${t}-${n?"01":"00"}`}function Zm(e,t){const n=pn(t?.sample_rand);if(n!==void 0)return n;const r=pn(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?vt()*r:r+vt()*(1-r):vt()}function eg(e,t){const n=Fd(e);return t&&n&&t!==n?(m.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):(e.getOptions().strictTraceContinuation||!1)&&(t&&!n||!t&&n)?(m.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}const jd=0,wa=1;let Gc=!1;function tg(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:c}=U(e);return{parent_span_id:s,span_id:t,trace_id:n,data:r,op:o,status:i,origin:a,links:c}}function qd(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:U(e).parent_span_id,s=zo(e).scope,i=r?s?.getPropagationContext().propagationSpanId||It():t;return{parent_span_id:o,span_id:i,trace_id:n}}function ng(e){const{traceId:t,spanId:n}=e.spanContext(),r=Zt(e);return Hd(t,n,r)}function rg(e){const{traceId:t,spanId:n}=e.spanContext(),r=Zt(e);return Wd(t,n,r)}function zd(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===wa,attributes:s,...o}))}function ln(e){return typeof e=="number"?Vc(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Vc(e.getTime()):fe()}function Vc(e){return e>9999999999?e/1e3:e}function U(e){if(sg(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(og(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e,u="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:u,start_timestamp:ln(o),timestamp:ln(i)||void 0,status:Gd(a),op:r[Te],origin:r[Y],links:zd(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function og(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function sg(e){return typeof e.getSpanJSON=="function"}function Zt(e){const{traceFlags:t}=e.spanContext();return t===wa}function Gd(e){if(!(!e||e.code===$m))return e.code===vs?"ok":e.message||"internal_error"}const dn="_sentryChildSpans",Pi="_sentryRootSpan";function Vd(e,t){const n=e[Pi]||e;Le(t,Pi,n),e[dn]?e[dn].add(t):Le(e,dn,new Set([t]))}function ig(e,t){e[dn]&&e[dn].delete(t)}function Io(e){const t=new Set;function n(r){if(!t.has(r)&&Zt(r)){t.add(r);const o=r[dn]?Array.from(r[dn]):[];for(const s of o)n(s)}}return n(e),Array.from(t)}function Se(e){return e[Pi]||e}function be(){const e=Nt(),t=Qt(e);return t.getActiveSpan?t.getActiveSpan():Hn(z())}function Li(){Gc||(yt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Gc=!0)}function WA(e,t){e.updateName(t),e.setAttributes({[Pe]:"custom",[Oi]:t})}let Jc=!1;function ag(){if(Jc)return;function e(){const t=be(),n=t&&Se(t);if(n){const r="internal_error";w&&m.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:Z,message:r})}}e.tag="sentry_tracingErrorCallback",Jc=!0,bd(e),Ed(e)}function Xe(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||R()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Yc(e){m.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Go(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(ug(n)){if(vo(e.description,n))return w&&Yc(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?vo(e.description,n.name):!0,o=n.op?e.op&&vo(e.op,n.op):!0;if(r&&o)return w&&Yc(e),!0}return!1}function cg(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function ug(e){return typeof e=="string"||e instanceof RegExp}const Is="production",Jd="_frozenDsc";function wo(e,t){Le(e,Jd,t)}function Yd(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Is,release:n.release,public_key:r,trace_id:e,org_id:Fd(t)};return t.emit("createDsc",o),o}function ka(e,t){const n=t.getPropagationContext();return n.dsc||Yd(n.traceId,e)}function at(e){const t=R();if(!t)return{};const n=Se(e),r=U(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[Ea]??o[Md];function a(h){return(typeof i=="number"||typeof i=="string")&&(h.sample_rate=`${i}`),h}const c=n[Jd];if(c)return a(c);const u=s?.get("sentry.dsc"),d=u&&Ia(u);if(d)return a(d);const l=Yd(e.spanContext().traceId,t),f=o[Pe],p=r.description;return f!=="url"&&p&&(l.transaction=p),Xe()&&(l.sampled=String(Zt(n)),l.sample_rand=s?.get("sentry.sample_rand")??zo(n).scope?.getPropagationContext().sampleRand.toString()),a(l),t.emit("createDsc",l,n),l}function jA(e){const t=at(e);return Pd(t)}class At{constructor(t={}){this._traceId=t.traceId||mt(),this._spanId=t.spanId||It()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:jd}}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 je(e,t=100,n=1/0){try{return Di("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Kd(e,t=3,n=100*1024){const r=je(e,t);return pg(r)>n?Kd(e,t-1,n):r}function Di(e,t,n=1/0,r=1/0,o=hg()){const[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=lg(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(s(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const p=u.toJSON();return Di("",p,c-1,r,o)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const f=Rd(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]=Di(p,h,c-1,r,o),l++}return i(t),d}function lg(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(Id(t))return Sd(t);if(mm(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${kt(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=dg(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function dg(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function fg(e){return~-encodeURI(e).split(/%..|./).length}function pg(e){return fg(JSON.stringify(e))}function hg(){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 ct(e,t=[]){return[e,t]}function mg(e,t){const[n,r]=e;return[n,[...r,t]]}function hn(e,t){const n=e[1];for(const r of n){const o=r[0].type;if(t(r,o))return!0}return!1}function Fi(e,t){return hn(e,(n,r)=>t.includes(r))}function Vo(e){const t=Lr(L);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function gg(e){const t=Lr(L);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function Jo(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Vo(r),s]:r.push(typeof s=="string"?Vo(s):s)}for(const s of n){const[i,a]=s;if(o(`
6
- ${JSON.stringify(i)}
7
- `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(je(a))}o(c)}}return typeof r=="string"?r:_g(r)}function _g(e){const t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function yg(e){let t=typeof e=="string"?Vo(e):e;function n(i){const a=t.subarray(0,i);return t=t.subarray(i+1),a}function r(){let i=t.indexOf(10);return i<0&&(i=t.length),JSON.parse(gg(n(i)))}const o=r(),s=[];for(;t.length;){const i=r(),a=typeof i.length=="number"?i.length:void 0;s.push([i,a?n(a):r()])}return[o,s]}function Sg(e){return[{type:"span"},e]}function bg(e){const t=typeof e.data=="string"?Vo(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Eg={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 Kc(e){return Eg[e]}function ws(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Xd(e,t,n,r){const o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Ot(r)},...o&&{trace:o}}}function Tg(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function vg(e,t,n,r){const o=ws(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Ot(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ct(s,[i])}function Ig(e,t,n,r){const o=ws(n),s=e.type&&e.type!=="replay_event"?e.type:"event";Tg(e,n?.sdk);const i=Xd(e,o,r,t);return delete e.sdkProcessingMetadata,ct(i,[[{type:s},e]])}function wg(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=at(e[0]),o=t?.getDsn(),s=t?.getOptions().tunnel,i={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!s&&o&&{dsn:Ot(o)}},{beforeSendSpan:a,ignoreSpans:c}=t?.getOptions()||{},u=c?.length?e.filter(p=>!Go(U(p),c)):e,d=e.length-u.length;d&&t?.recordDroppedEvent("before_send","span",d);const l=a?p=>{const h=U(p),g=a(h);return g||(Li(),h)}:U,f=[];for(const p of u){const h=l(p);h&&f.push(Sg(h))}return ct(i,f)}function kg(e){if(!w)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=U(e),{spanId:o}=e.spanContext(),s=Zt(e),i=Se(e),a=i===e,c=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){const{op:d,description:l}=U(i);u.push(`root ID: ${i.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}m.log(`${c}
8
- ${u.join(`
9
- `)}`)}function Rg(e){if(!w)return;const{description:t="< unknown name >",op:n="< unknown op >"}=U(e),{spanId:r}=e.spanContext(),s=Se(e)===e,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${t}" with ID ${r}`;m.log(i)}function Cg(e,t,n,r=be()){const o=r&&Se(r);o&&(w&&m.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[Ur]:t,[Br]:n}))}function Xc(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},o=r[Br],s=r[Ur];typeof o=="string"&&typeof s=="number"&&(t[n.name]={value:s,unit:o})}),t}const Qc=1e3;class ks{constructor(t={}){this._traceId=t.traceId||mt(),this._spanId=t.spanId||It(),this._startTime=t.startTimestamp||fe(),this._links=t.links,this._attributes={},this.setAttributes({[Y]:"manual",[Te]: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?wa:jd}}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=ln(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(Pe,"custom"),this}end(t){this._endTime||(this._endTime=ln(t),Rg(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Te],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Gd(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Y],profile_id:this._attributes[Ta],exclusive_time:this._attributes[rr],measurements:Xc(this._events),is_segment:this._isStandaloneSpan&&Se(this)===this||void 0,segment_id:this._isStandaloneSpan?Se(this).spanContext().spanId:void 0,links:zd(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){w&&m.log("[Tracing] Adding an event to span:",t);const o=Zc(n)?n:r||fe(),s=Zc(n)?{}:n||{},i={name:t,time:ln(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=R();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===Se(this)))return;if(this._isStandaloneSpan){this._sampled?xg(wg([this],t)):(w&&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&&(zo(this).scope||z()).captureEvent(r)}_convertSpanToTransaction(){if(!eu(U(this)))return;this._name||(w&&m.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=zo(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const s=Io(this).filter(d=>d!==this&&!Ag(d)).map(d=>U(d)).filter(eu),i=this._attributes[Pe];delete this._attributes[Oi],s.forEach(d=>{delete d.data[Oi]});const a={contexts:{trace:tg(this)},spans:s.length>Qc?s.sort((d,l)=>d.start_timestamp-l.start_timestamp).slice(0,Qc):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:at(this)},request:r,...i&&{transaction_info:{source:i}}},c=Xc(this._events);return c&&Object.keys(c).length&&(w&&m.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),a.measurements=c),a}}function Zc(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function eu(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Ag(e){return e instanceof ks&&e.isStandaloneSpan()}function xg(e){const t=R();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function Rs(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(s){throw t(s),n(),s}return Mg(o,t,n,r)}function Mg(e,t,n,r){return nr(e)?e.then(o=>(n(),r(o),o),o=>{throw t(o),n(),o}):(n(),r(e),e)}function Ng(e,t,n){if(!Xe(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,r=!0);const s=pn(o);if(s===void 0)return w&&m.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return w&&m.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,s,r];const i=n<s;return i||w&&m.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}const Yo="__SENTRY_SUPPRESS_TRACING__";function en(e,t){const n=Hr();if(n.startSpan)return n.startSpan(e,t);const r=Ca(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i?.clone();return Ge(a,()=>Qd(s)(()=>{const u=z(),d=Aa(u,s),f=e.onlyIfParent&&!d?new At:Ra({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return gt(u,f),Rs(()=>t(f),()=>{const{status:p}=U(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:Z,message:"internal_error"})},()=>{f.end()})}))}function Ht(e,t){const n=Hr();if(n.startSpanManual)return n.startSpanManual(e,t);const r=Ca(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i?.clone();return Ge(a,()=>Qd(s)(()=>{const u=z(),d=Aa(u,s),f=e.onlyIfParent&&!d?new At:Ra({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return gt(u,f),Rs(()=>t(f,()=>f.end()),()=>{const{status:p}=U(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:Z,message:"internal_error"})})}))}function it(e){const t=Hr();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=Ca(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?i=>Ge(e.scope,i):o!==void 0?i=>jn(o,i):i=>i())(()=>{const i=z(),a=Aa(i,o);return e.onlyIfParent&&!a?new At:Ra({parentSpan:a,spanArguments:n,forceTransaction:r,scope:i})})}const qA=(e,t)=>{const n=Nt(),r=Qt(n);if(r.continueTrace)return r.continueTrace(e,t);const{sentryTrace:o,baggage:s}=e,i=R(),a=Ia(s);return i&&!eg(i,a?.org_id)?Pg(t):Ge(c=>{const u=Ud(o,s);return c.setPropagationContext(u),gt(c,void 0),t()})};function jn(e,t){const n=Hr();return n.withActiveSpan?n.withActiveSpan(e,t):Ge(r=>(gt(r,e||void 0),t(r)))}function Og(e){const t=Hr();return t.suppressTracing?t.suppressTracing(e):Ge(n=>{n.setSDKProcessingMetadata({[Yo]:!0});const r=e();return n.setSDKProcessingMetadata({[Yo]:void 0}),r})}function Pg(e){return Ge(t=>(t.setPropagationContext({traceId:mt(),sampleRand:vt()}),w&&m.log(`Starting a new trace with id ${t.getPropagationContext().traceId}`),jn(null,e)))}function Ra({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Xe()){const i=new At;if(n||!e){const a={sampled:"false",sample_rate:"0",transaction:t.name,...at(i)};wo(i,a)}return i}const o=Ie();let s;if(e&&!n)s=Lg(e,r,t),Vd(e,s);else if(e){const i=at(e),{traceId:a,spanId:c}=e.spanContext(),u=Zt(e);s=tu({traceId:a,parentSpanId:c,...t},r,u),wo(s,i)}else{const{traceId:i,dsc:a,parentSpanId:c,sampled:u}={...o.getPropagationContext(),...r.getPropagationContext()};s=tu({traceId:i,parentSpanId:c,...t},r,u),a&&wo(s,a)}return kg(s),Wm(s,r,o),s}function Ca(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=ln(e.startTime),delete r.startTime,r}return n}function Hr(){const e=Nt();return Qt(e)}function tu(e,t,n){const r=R(),o=r?.getOptions()||{},{name:s=""}=e,i={spanAttributes:{...e.attributes},spanName:s,parentSampled:n};r?.emit("beforeSampling",i,{decision:!1});const a=i.parentSampled??n,c=i.spanAttributes,u=t.getPropagationContext(),[d,l,f]=t.getScopeData().sdkProcessingMetadata[Yo]?[!1]:Ng(o,{name:s,parentSampled:a,attributes:c,parentSampleRate:pn(u.dsc?.sample_rate)},u.sampleRand),p=new ks({...e,attributes:{[Pe]:"custom",[Ea]:l!==void 0&&f?l:void 0,...c},sampled:d});return!d&&r&&(w&&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 Lg(e,t,n){const{spanId:r,traceId:o}=e.spanContext(),s=t.getScopeData().sdkProcessingMetadata[Yo]?!1:Zt(e),i=s?new ks({...n,parentSpanId:r,traceId:o,sampled:s}):new At({traceId:o});Vd(e,i);const a=R();return a&&(a.emit("spanStart",i),n.endTimestamp&&a.emit("spanEnd",i)),i}function Aa(e,t){if(t)return t;if(t===null)return;const n=Hn(e);if(!n)return;const r=R();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Se(n):n}function Qd(e){return e!==void 0?t=>jn(e,t):t=>t()}const ko={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Dg="heartbeatFailed",Fg="idleTimeout",$g="finalTimeout",Bg="externalFinish";function Zd(e,t={}){const n=new Map;let r=!1,o,s=Bg,i=!t.disableAutoFinish;const a=[],{idleTimeout:c=ko.idleTimeout,finalTimeout:u=ko.finalTimeout,childSpanTimeout:d=ko.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:f=!0}=t,p=R();if(!p||!Xe()){const S=new At,C={sample_rate:"0",sampled:"false",...at(S)};return wo(S,C),S}const h=z(),g=be(),_=Ug(e);_.end=new Proxy(_.end,{apply(S,C,F){if(l&&l(_),C instanceof At)return;const[E,...x]=F,k=E||fe(),M=ln(k),O=Io(_).filter(I=>I!==_),ee=U(_);if(!O.length||!f)return N(M),Reflect.apply(S,C,[M,...x]);const K=p.getOptions().ignoreSpans,ne=O?.reduce((I,G)=>{const se=U(G);return!se.timestamp||K&&Go(se,K)?I:I?Math.max(I,se.timestamp):se.timestamp},void 0),T=ee.start_timestamp,j=Math.min(T?T+u/1e3:1/0,Math.max(T||-1/0,Math.min(M,ne||1/0)));return N(j),Reflect.apply(S,C,[j,...x])}});function y(){o&&(clearTimeout(o),o=void 0)}function b(S){y(),o=setTimeout(()=>{!r&&n.size===0&&i&&(s=Fg,_.end(S))},c)}function P(S){o=setTimeout(()=>{!r&&i&&(s=Dg,_.end(S))},d)}function A(S){y(),n.set(S,!0);const C=fe();P(C+d/1e3)}function H(S){if(n.has(S)&&n.delete(S),n.size===0){const C=fe();b(C+c/1e3)}}function N(S){r=!0,n.clear(),a.forEach(O=>O()),gt(h,g);const C=U(_),{start_timestamp:F}=C;if(!F)return;C.data[Rr]||_.setAttribute(Rr,s);const x=C.status;(!x||x==="unknown")&&_.setStatus({code:vs}),m.log(`[Tracing] Idle span "${C.op}" finished`);const k=Io(_).filter(O=>O!==_);let M=0;k.forEach(O=>{O.isRecording()&&(O.setStatus({code:Z,message:"cancelled"}),O.end(S),w&&m.log("[Tracing] Cancelling span since span ended early",JSON.stringify(O,void 0,2)));const ee=U(O),{timestamp:K=0,start_timestamp:ne=0}=ee,T=ne<=S,j=(u+c)/1e3,I=K-ne<=j;if(w){const G=JSON.stringify(O,void 0,2);T?I||m.log("[Tracing] Discarding span since it finished after idle span final timeout",G):m.log("[Tracing] Discarding span since it happened after idle span was finished",G)}(!I||!T)&&(ig(_,O),M++)}),M>0&&_.setAttribute("sentry.idle_span_discarded_spans",M)}return a.push(p.on("spanStart",S=>{if(r||S===_||U(S).timestamp||S instanceof ks&&S.isStandaloneSpan())return;Io(_).includes(S)&&A(S.spanContext().spanId)})),a.push(p.on("spanEnd",S=>{r||H(S.spanContext().spanId)})),a.push(p.on("idleSpanEnableAutoFinish",S=>{S===_&&(i=!0,b(),n.size&&P())})),t.disableAutoFinish||b(),setTimeout(()=>{r||(_.setStatus({code:Z,message:"deadline_exceeded"}),s=$g,_.end())},u),_}function Ug(e){const t=it(e);return gt(z(),t),w&&m.log("[Tracing] Started span is an idle span"),t}const si=0,nu=1,ru=2;function Cs(e){return new Cr(t=>{t(e)})}function xa(e){return new Cr((t,n)=>{n(e)})}class Cr{constructor(t){this._state=si,this._handlers=[],this._runExecutor(t)}then(t,n){return new Cr((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Cr((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===si)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===nu&&n[1](this._value),this._state===ru&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,i)=>{if(this._state===si){if(nr(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(nu,s)},o=s=>{n(ru,s)};try{t(r,o)}catch(s){o(s)}}}function Hg(e,t,n,r=0){try{const o=$i(t,n,e,r);return nr(o)?o:Cs(o)}catch(o){return xa(o)}}function $i(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return w&&s===null&&m.log(`Event processor "${o.id||"?"}" dropped event`),nr(s)?s.then(i=>$i(i,t,n,r+1)):$i(s,t,n,r+1)}let nn,ou,su,Ft;function ef(e){const t=L._sentryDebugIds,n=L._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Ft&&r.length===ou&&o.length===su)return Ft;ou=r.length,su=o.length,Ft={},nn||(nn={});const s=(i,a)=>{for(const c of i){const u=a[c],d=nn?.[c];if(d&&Ft&&u)Ft[d[0]]=u,nn&&(nn[c]=[d[0],u]);else if(u){const l=e(c);for(let f=l.length-1;f>=0;f--){const h=l[f]?.filename;if(h&&Ft&&nn){Ft[h]=u,nn[c]=[h,u];break}}}}};return t&&s(r,t),n&&s(o,n),Ft}function Wg(e,t){const n=ef(e);if(!n)return[];const r=[];for(const o of t)o&&n[o]&&r.push({type:"sourcemap",code_file:o,debug_id:n[o]});return r}function jg(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;qg(e,t),r&&Vg(e,r),Jg(e,n),zg(e,o),Gg(e,s)}function iu(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:f,propagationContext:p,transactionName:h,span:g}=t;pr(e,"extra",n),pr(e,"tags",r),pr(e,"attributes",o),pr(e,"user",s),pr(e,"contexts",i),e.sdkProcessingMetadata=$r(e.sdkProcessingMetadata,c,2),a&&(e.level=a),h&&(e.transactionName=h),g&&(e.span=g),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function pr(e,t,n){e[t]=$r(e[t],n,1)}function Ma(e,t){const n=br().getScopeData();return e&&iu(n,e.getScopeData()),t&&iu(n,t.getScopeData()),n}function qg(e,t){const{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function zg(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Gg(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Vg(e,t){e.contexts={trace:qd(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:at(t),...e.sdkProcessingMetadata};const n=Se(t),r=U(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Jg(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function tf(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||ve(),timestamp:t.timestamp||vn()},u=n.integrations||e.integrations.map(_=>_.name);Yg(c,e),Qg(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Kg(c,e.stackParser);const d=e_(r,n.captureContext);n.mechanism&&Ct(c,n.mechanism);const l=o?o.getEventProcessors():[],f=Ma(s,d),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),jg(c,f);const h=[...l,...f.eventProcessors];return Hg(h,c,n).then(_=>(_&&Xg(_),typeof i=="number"&&i>0?Zg(_,i,a):_))}function Yg(e,t){const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||Is,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const i=e.request;i?.url&&s&&(i.url=kr(i.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=kr(a.value,s))})}function Kg(e,t){const n=ef(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function Xg(e){const t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.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(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function Qg(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Zg(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:je(o.data,t,n)}}))},...e.user&&{user:je(e.user,t,n)},...e.contexts&&{contexts:je(e.contexts,t,n)},...e.extra&&{extra:je(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=je(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:je(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=je(e.contexts.flags,3,n)),r}function e_(e,t){if(!t)return e;const n=e?e.clone():new _t;return n.update(t),n}function t_(e){if(e)return n_(e)?{captureContext:e}:o_(e)?{captureContext:e}:e}function n_(e){return e instanceof _t||typeof e=="function"}const r_=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function o_(e){return Object.keys(e).some(t=>r_.includes(t))}function me(e,t){return z().captureException(e,t_(t))}function s_(e,t){const n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return z().captureMessage(e,n,r)}function Wr(e,t){return z().captureEvent(e,t)}function i_(e,t){Ie().setContext(e,t)}function zA(e){Ie().setExtras(e)}function GA(e,t){Ie().setExtra(e,t)}function VA(e){Ie().setTags(e)}function a_(e,t){Ie().setTag(e,t)}function JA(e){Ie().setUser(e)}function c_(){return Ie().lastEventId()}async function YA(e){const t=R();return t?t.flush(e):(w&&m.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function KA(e){const t=R();return t?t.close(e):(w&&m.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function XA(){return!!R()}function u_(){const e=R();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function l_(e){Ie().addEventProcessor(e)}function au(e){const t=Ie(),n=z(),{userAgent:r}=L.navigator||{},o=wm({user:n.getUser()||t.getUser(),...r&&{userAgent:r},...e}),s=t.getSession();return s?.status==="ok"&&Un(s,{status:"exited"}),nf(),t.setSession(o),o}function nf(){const e=Ie(),n=z().getSession()||e.getSession();n&&km(n),rf(),e.setSession()}function rf(){const e=Ie(),t=R(),n=e.getSession();n&&t&&t.captureSession(n)}function cu(e=!1){if(e){nf();return}rf()}const d_="7";function of(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function f_(e){return`${of(e)}${e.projectId}/envelope/`}function p_(e,t){const n={sentry_version:d_};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function sf(e,t,n){return t||`${f_(e)}?${p_(e,n)}`}function h_(e,t){const n=$d(e);if(!n)return"";const r=`${of(n)}embed/error-page/`;let o=`dsn=${Ot(n)}`;for(const s in t)if(s!=="dsn"&&s!=="onClose")if(s==="user"){const i=t.user;if(!i)continue;i.name&&(o+=`&name=${encodeURIComponent(i.name)}`),i.email&&(o+=`&email=${encodeURIComponent(i.email)}`)}else o+=`&${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`;return`${r}?${o}`}const uu=[];function m_(e){const t={};return e.forEach(n=>{const{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function g_(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return m_(r)}function __(e,t){const n={};return t.forEach(r=>{r&&af(e,r,n)}),n}function lu(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function af(e,t,n){if(n[t.name]){w&&m.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!uu.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),uu.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}w&&m.log(`Integration installed: ${t.name}`)}function du(e){const t=R();if(!t){w&&m.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function y_(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function S_(e,t){const{value:n,unit:r}=y_(e)?e:{value:e,unit:void 0},o=b_(n),s=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...s};if(!t||t==="skip-undefined"&&n===void 0)return;let i="";try{i=JSON.stringify(n)??""}catch{}return{value:i,type:"string",...s}}function Ko(e,t=!1){const n={};for(const[r,o]of Object.entries(e??{})){const s=S_(o,t);s&&(n[r]=s)}return n}function b_(e){const t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}function cf(e,t){return t?Ge(t,()=>{const n=be(),r=n?qd(n):xd(t);return[n?at(n):ka(e,t),r]}):[void 0,void 0]}const E_={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function T_(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function v_(e,t,n,r){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=Ot(r)),ct(o,[T_(e)])}const I_=100;function dt(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function w_(e,t){const n=Oa(),r=uf(e);r===void 0?n.set(e,[t]):r.length>=I_?(Na(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Xo(e,t=z(),n=w_){const r=t?.getClient()??R();if(!r){w&&m.warn("No client available to capture log.");return}const{release:o,environment:s,enableLogs:i=!1,beforeSendLog:a}=r.getOptions();if(!i){w&&m.warn("logging option not enabled, log will not be captured.");return}const[,c]=cf(r,t),u={...e.attributes},{user:{id:d,email:l,username:f},attributes:p={}}=Ma(Ie(),t);dt(u,"user.id",d,!1),dt(u,"user.email",l,!1),dt(u,"user.name",f,!1),dt(u,"sentry.release",o),dt(u,"sentry.environment",s);const{name:h,version:g}=r.getSdkMetadata()?.sdk??{};dt(u,"sentry.sdk.name",h),dt(u,"sentry.sdk.version",g);const _=r.getIntegrationByName("Replay"),y=_?.getReplayId(!0);dt(u,"sentry.replay_id",y),y&&_?.getRecordingMode()==="buffer"&&dt(u,"sentry._internal.replay_is_buffering",!0);const b=e.message;if(Es(b)){const{__sentry_template_string__:x,__sentry_template_values__:k=[]}=b;k?.length&&(u["sentry.message.template"]=x),k.forEach((M,O)=>{u[`sentry.message.parameter.${O}`]=M})}const P=Hn(t);dt(u,"sentry.trace.parent_span_id",P?.spanContext().spanId);const A={...e,attributes:u};r.emit("beforeCaptureLog",A);const H=a?yt(()=>a(A)):A;if(!H){r.recordDroppedEvent("before_send","log_item",1),w&&m.warn("beforeSendLog returned null, log will not be captured.");return}const{level:N,message:S,attributes:C={},severityNumber:F}=H,E={timestamp:fe(),level:N,body:S,trace_id:c?.trace_id,severity_number:F??E_[N],attributes:{...Ko(p),...Ko(C,!0)}};n(r,E),r.emit("afterCaptureLog",H)}function Na(e,t){const n=t??uf(e)??[];if(n.length===0)return;const r=e.getOptions(),o=v_(n,r._metadata,r.tunnel,e.getDsn());Oa().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function uf(e){return Oa().get(e)}function Oa(){return er("clientToLogBufferMap",()=>new WeakMap)}function k_(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function R_(e,t,n,r){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=Ot(r)),ct(o,[k_(e)])}const C_=1e3;function bt(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function A_(e,t){const n=La(),r=lf(e);r===void 0?n.set(e,[t]):r.length>=C_?(Pa(e,r),n.set(e,[t])):n.set(e,[...r,t])}function x_(e,t,n){const{release:r,environment:o}=t.getOptions(),s={...e.attributes};bt(s,"user.id",n.id,!1),bt(s,"user.email",n.email,!1),bt(s,"user.name",n.username,!1),bt(s,"sentry.release",r),bt(s,"sentry.environment",o);const{name:i,version:a}=t.getSdkMetadata()?.sdk??{};bt(s,"sentry.sdk.name",i),bt(s,"sentry.sdk.version",a);const c=t.getIntegrationByName("Replay"),u=c?.getReplayId(!0);return bt(s,"sentry.replay_id",u),u&&c?.getRecordingMode()==="buffer"&&bt(s,"sentry._internal.replay_is_buffering",!0),{...e,attributes:s}}function M_(e,t,n,r){const[,o]=cf(t,n),s=Hn(n),i=s?s.spanContext().traceId:o?.trace_id,a=s?s.spanContext().spanId:void 0;return{timestamp:fe(),trace_id:i??"",span_id:a,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...Ko(r),...Ko(e.attributes,"skip-undefined")}}}function N_(e,t){const n=t?.scope??z(),r=t?.captureSerializedMetric??A_,o=n?.getClient()??R();if(!o){w&&m.warn("No client available to capture metric.");return}const{_experiments:s,enableMetrics:i,beforeSendMetric:a}=o.getOptions();if(!(i??s?.enableMetrics??!0)){w&&m.warn("metrics option not enabled, metric will not be captured.");return}const{user:u,attributes:d}=Ma(Ie(),n),l=x_(e,o,u);o.emit("processMetric",l);const f=a||s?.beforeSendMetric,p=f?f(l):l;if(!p){w&&m.log("`beforeSendMetric` returned `null`, will not send metric.");return}const h=M_(p,o,n,d);w&&m.log("[Metric]",h),r(o,h),o.emit("afterCaptureMetric",p)}function Pa(e,t){const n=t??lf(e)??[];if(n.length===0)return;const r=e.getOptions(),o=R_(n,r._metadata,r.tunnel,e.getDsn());La().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function lf(e){return La().get(e)}function La(){return er("clientToMetricBufferMap",()=>new WeakMap)}const Da=Symbol.for("SentryBufferFullError");function Fa(e=100){const t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return xa(Da);const a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return Cs(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;const c=[a,new Promise(u=>setTimeout(()=>u(!1),i))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:s}}const O_=60*1e3;function df(e,t=Fr()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?O_:r-t}function P_(e,t){return e[t]||e.all||0}function ff(e,t,n=Fr()){return P_(e,t)>n}function pf(e,{statusCode:t,headers:n},r=Fr()){const o={...e},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(const a of s.trim().split(",")){const[c,u,,,d]=a.split(":",5),l=parseInt(c,10),f=(isNaN(l)?60:l)*1e3;if(!u)o.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[p]=r+f):o[p]=r+f}else i?o.all=r+df(i,r):t===429&&(o.all=r+60*1e3);return o}const hf=64;function L_(e,t,n=Fa(e.bufferSize||hf)){let r={};const o=i=>n.drain(i);function s(i){const a=[];if(hn(i,(l,f)=>{const p=Kc(f);ff(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):a.push(l)}),a.length===0)return Promise.resolve({});const c=ct(i[0],a),u=l=>{if(Fi(c,["client_report"])){w&&m.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}hn(c,(f,p)=>{e.recordDroppedEvent(l,Kc(p))})},d=()=>t({body:Jo(c)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&w&&m.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=pf(r,l),l),l=>{throw u("network_error"),w&&m.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===Da)return w&&m.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:s,flush:o}}function D_(e,t,n){const r=[{type:"client_report"},{timestamp:vn(),discarded_events:e}];return ct(t?{dsn:t}:{},[r])}function mf(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function F_(e){const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.[Ta],exclusive_time:i?.[rr],measurements:e.measurements,is_segment:!0}}function $_(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&&{[Ta]:e.profile_id},...e.exclusive_time&&{[rr]:e.exclusive_time}}}},measurements:e.measurements}}const fu="Not capturing exception because it's already been captured.",pu="Discarded session because of missing or non-string release",gf=Symbol.for("SentryInternalError"),_f=Symbol.for("SentryDoNotSendEventError"),B_=5e3;function Ro(e){return{message:e,[gf]:!0}}function ii(e){return{message:e,[_f]:!0}}function hu(e){return!!e&&typeof e=="object"&&gf in e}function mu(e){return!!e&&typeof e=="object"&&_f in e}function gu(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,c=>{s+=r(c),s>=8e5?o(e):a||(a=!0,i=setTimeout(()=>{o(e)},B_))}),e.on("flush",()=>{o(e)})}class U_{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Fa(t.transportOptions?.bufferSize??hf),t.dsn?this._dsn=$d(t.dsn):w&&m.warn("No DSN provided, client will not send events."),this._dsn){const r=sf(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:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&gu(this,"afterCaptureLog","flushLogs",q_,Na),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&gu(this,"afterCaptureMetric","flushMetrics",j_,Pa)}captureException(t,n,r){const o=ve();if(Wc(t))return w&&m.log(fu),o;const s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){const s={event_id:ve(),...r},i=Es(t)?t:String(t),a=Vt(t),c=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>c.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=ve();if(n?.originalException&&Wc(n.originalException))return w&&m.log(fu),o;const s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=_u(t.type);return this._process(()=>this._captureEvent(t,s,a||r,c),u),s.event_id}captureSession(t){this.sendSession(t),Un(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),o=await n.flush(t);return r&&o}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];af(this,t,this._integrations),n||lu(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Ig(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=mg(r,bg(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){const{release:n,environment:r=Is}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){w&&m.warn(pu);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){w&&m.warn(pu);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=vg(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const o=`${t}:${n}`;w&&m.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return w&&m.error("Error while sending envelope:",n),{}}return w&&m.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=__(this,t),lu(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1;const s=n.exception?.values;if(s){o=!0,r=!1;for(const c of s)if(c.mechanism?.handled===!1){r=!0;break}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(Un(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){const s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),tf(s,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:xd(r),...a.contexts};const c=ka(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=z(),o=Ie()){return w&&Bi(t)&&m.log(`Captured error event \`${mf(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{w&&(mu(s)?m.log(s.message):hu(s)?m.warn(s.message):m.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:i}=s,a=yf(t),c=Bi(t),d=`before send for type \`${t.type||"error"}\``,l=typeof i>"u"?void 0:pn(i);if(c&&typeof l=="number"&&vt()>l)return this.recordDroppedEvent("sample_rate","error"),xa(ii(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const f=_u(t.type);return this._prepareEvent(t,n,r,o).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",f),ii("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return p;const g=W_(this,s,p,n);return H_(g,d)}).then(p=>{if(p===null){if(this.recordDroppedEvent("before_send",f),a){const y=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw ii(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||o.getSession();if(c&&h&&this._updateSessionFromEvent(h,p),a){const _=p.sdkProcessingMetadata?.spanCountBeforeProcessing||0,y=p.spans?p.spans.length:0,b=_-y;b>0&&this.recordDroppedEvent("before_send","span",b)}const g=p.transaction_info;if(a&&g&&p.transaction!==t.transaction){const _="custom";p.transaction_info={...g,source:_}}return this.sendEvent(p,n),p}).then(null,p=>{throw mu(p)||hu(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),Ro(`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,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Da&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){w&&m.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){w&&m.log("No outcomes to send");return}if(!this._dsn){w&&m.log("No dsn provided, will not send outcomes");return}w&&m.log("Sending outcomes:",t);const n=D_(t,this._options.tunnel&&Ot(this._dsn));this.sendEnvelope(n)}}function _u(e){return e==="replay_event"?"replay":e||"error"}function H_(e,t){const n=`${t} must return \`null\` or a valid event.`;if(nr(e))return e.then(r=>{if(!rt(r)&&r!==null)throw Ro(n);return r},r=>{throw Ro(`${t} rejected with ${r}`)});if(!rt(e)&&e!==null)throw Ro(n);return e}function W_(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,beforeSendSpan:i,ignoreSpans:a}=t;let c=n;if(Bi(c)&&o)return o(c,r);if(yf(c)){if(i||a){const u=F_(c);if(a?.length&&Go(u,a))return null;if(i){const d=i(u);d?c=$r(n,$_(d)):Li()}if(c.spans){const d=[],l=c.spans;for(const p of l){if(a?.length&&Go(p,a)){cg(l,p);continue}if(i){const h=i(p);h?d.push(h):(Li(),d.push(p))}else d.push(p)}const f=c.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),c.spans=d}}if(s){if(c.spans){const u=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return s(c,r)}}return c}function Bi(e){return e.type===void 0}function yf(e){return e.type==="transaction"}function j_(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Sf(e.attributes)}function q_(e){let t=0;return e.message&&(t+=e.message.length*2),t+Sf(e.attributes)}function Sf(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*yu(n[0]):Vt(n)?t+=yu(n):t+=100}),t}function yu(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function z_(e){return pt(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Su(e){return z_(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function G_(e,t){t.debug===!0&&(w?m.enable():yt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),z().update(t.initialScope);const r=new e(t);return V_(r),r.init(),r}function V_(e){z().setClient(e)}const ai=100,ci=5e3,J_=36e5;function Y_(e){function t(...n){w&&m.log("[Offline]:",...n)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const o=n.createStore(n);let s=ci,i;function a(l,f,p){return Fi(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,f,p):!0}function c(l){i&&clearTimeout(i),i=setTimeout(async()=>{i=void 0;const f=await o.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 i!="number"&&i.unref&&i.unref()}function u(){i||(c(s),s=Math.min(s*2,J_))}async function d(l,f=!1){if(!f&&Fi(l,["replay_event","replay_recording"]))return await o.push(l),c(ai),{};try{if(n.shouldSend&&await n.shouldSend(l)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");const p=await r.send(l);let h=ai;if(p){if(p.headers?.["retry-after"])h=df(p.headers["retry-after"]);else if(p.headers?.["x-sentry-rate-limits"])h=6e4;else if((p.statusCode||0)>=400)return p}return c(h),s=ci,p}catch(p){if(await a(l,p,s))return f?await o.unshift(l):await o.push(l),u(),t("Error sending. Event queued.",p),{};throw p}}return n.flushAtStartup&&u(),{send:d,flush:l=>(l===void 0&&(s=ci,c(ai)),r.flush(l))}}}const ui="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function bf(e,t){let n;return hn(e,(r,o)=>(t.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function K_(e,t){return n=>{const r=e(n);return{...r,send:async o=>{const s=bf(o,["event","transaction","profile","replay_event"]);return s&&(s.release=t),r.send(o)}}}}function X_(e,t){return ct(t?{...e[0],dsn:t}:e[0],e[1])}function QA(e,t){return n=>{const r=e(n),o=new Map,s=t||(u=>{const d=u.getEvent();return d?.extra?.[ui]&&Array.isArray(d.extra[ui])?d.extra[ui]:[]});function i(u,d){const l=d?`${u}:${d}`:u;let f=o.get(l);if(!f){const p=Ld(u);if(!p)return;const h=sf(p,n.tunnel);f=d?K_(e,d)({...n,url:h}):e({...n,url:h}),o.set(l,f)}return[u,f]}async function a(u){function d(h){const g=h?.length?h:["event"];return bf(u,g)}const l=s({envelope:u,getEvent:d}).map(h=>typeof h=="string"?i(h,void 0):i(h.dsn,h.release)).filter(h=>!!h),f=l.length?l:[["",r]];return(await Promise.all(f.map(([h,g])=>g.send(X_(u,h)))))[0]}async function c(u){const d=[...o.values(),r];return(await Promise.all(d.map(f=>f.flush(u)))).every(f=>f)}return{send:a,flush:c}}}const Q_="thismessage:/";function $a(e){return"isRelative"in e}function Ba(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?Q_:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function Z_(e){if($a(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 fn(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 Ef(e){return e.split(/[?#]/,1)[0]}function Tf(e,t){const n=t?.getDsn(),r=t?.getOptions().tunnel;return ty(e,n)||ey(e,r)}function ey(e,t){return t?bu(e)===bu(t):!1}function ty(e,t){const n=Ba(e);return!n||$a(n)?!1:t?n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search):!1}function bu(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function ny(e,...t){const n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}const ry=ny;function oy(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function vf(e,t,n=[t],r="npm"){const o=e._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${t}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:jt})),version:jt}),e._metadata=o}function If(e={}){const t=e.client||R();if(!u_()||!t)return{};const n=Nt(),r=Qt(n);if(r.getTraceData)return r.getTraceData(e);const o=e.scope||z(),s=e.span||be(),i=s?ng(s):sy(o),a=s?at(s):ka(t,o),c=Pd(a);if(!Bd.test(i))return m.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":i,baggage:c};return e.propagateTraceparent&&(d.traceparent=s?rg(s):iy(o)),d}function sy(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Hd(t,r,n)}function iy(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Wd(t,r,n)}function ay(e,t,n){let r,o,s;const i=n?.maxWait?Math.max(n.maxWait,t):0,a=n?.setTimeoutImpl||setTimeout;function c(){return u(),r=e(),r}function u(){o!==void 0&&clearTimeout(o),s!==void 0&&clearTimeout(s),o=s=void 0}function d(){return o!==void 0||s!==void 0?c():r}function l(){return o&&clearTimeout(o),o=a(c,t),i&&s===void 0&&(s=a(c,i)),r}return l.cancel=u,l.flush=d,l}const cy=100;function xt(e,t){const n=R(),r=Ie();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=cy}=n.getOptions();if(s<=0)return;const a={timestamp:vn(),...e},c=o?yt(()=>o(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,s))}let Eu;const uy="FunctionToString",Tu=new WeakMap,ly=(()=>({name:uy,setupOnce(){Eu=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=ba(this),n=Tu.has(R())&&t!==void 0?t:this;return Eu.apply(n,e)}}catch{}},setup(e){Tu.set(e,!0)}})),dy=ly,fy=[/^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$/],py="EventFilters",hy=(e={})=>{let t;return{name:py,setup(n){const r=n.getOptions();t=vu(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=vu(e,s)}return gy(n,t)?null:n}}},my=((e={})=>({...hy(e),name:"InboundFilters"}));function vu(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:fy],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function gy(e,t){if(e.type){if(e.type==="transaction"&&yy(e,t.ignoreTransactions))return w&&m.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
11
- Event: ${on(e)}`),!0}else{if(_y(e,t.ignoreErrors))return w&&m.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
12
- Event: ${on(e)}`),!0;if(Ty(e))return w&&m.warn(`Event dropped due to not having an error message, error type or stacktrace.
13
- Event: ${on(e)}`),!0;if(Sy(e,t.denyUrls))return w&&m.warn(`Event dropped due to being matched by \`denyUrls\` option.
14
- Event: ${on(e)}.
15
- Url: ${Qo(e)}`),!0;if(!by(e,t.allowUrls))return w&&m.warn(`Event dropped due to not being matched by \`allowUrls\` option.
16
- Event: ${on(e)}.
17
- Url: ${Qo(e)}`),!0}return!1}function _y(e,t){return t?.length?mf(e).some(n=>st(n,t)):!1}function yy(e,t){if(!t?.length)return!1;const n=e.transaction;return n?st(n,t):!1}function Sy(e,t){if(!t?.length)return!1;const n=Qo(e);return n?st(n,t):!1}function by(e,t){if(!t?.length)return!0;const n=Qo(e);return n?st(n,t):!0}function Ey(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 Qo(e){try{const n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Ey(n):null}catch{return w&&m.error(`Cannot extract url for event ${on(e)}`),null}}function Ty(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function vy(e,t,n,r,o,s){if(!o.exception?.values||!s||!Rt(s.originalException,Error))return;const i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=Ui(e,t,r,s.originalException,n,o.exception.values,i,0))}function Ui(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(Rt(r[o],Error)){Iu(i,a);const u=e(t,r[o]),d=c.length;wu(u,o,d,a),c=Ui(e,t,n,r[o],o,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Rt(u,Error)){Iu(i,a);const l=e(t,u),f=c.length;wu(l,`errors[${d}]`,f,a),c=Ui(e,t,n,u,o,[l,...c],l,f)}}),c}function Iu(e,t){e.mechanism={handled:!0,type:"auto.core.linked_errors",...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function wu(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}const wf=new Map,ku=new Set;function Iy(e){if(L._sentryModuleMetadata)for(const t of Object.keys(L._sentryModuleMetadata)){const n=L._sentryModuleMetadata[t];if(ku.has(t))continue;ku.add(t);const r=e(t);for(const o of r.reverse())if(o.filename){wf.set(o.filename,n);break}}}function wy(e,t){return Iy(e),wf.get(t)}function kf(e,t){t.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(r=>{if(!r.filename||r.module_metadata)return;const o=wy(e,r.filename);o&&(r.module_metadata=o)})})}function Rf(e){e.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(n=>{delete n.module_metadata})})}const ZA=()=>({name:"ModuleMetadata",setup(e){e.on("beforeEnvelope",t=>{hn(t,(n,r)=>{if(r==="event"){const o=Array.isArray(n)?n[1]:void 0;o&&(Rf(o),n[1]=o)}})}),e.on("applyFrameMetadata",t=>{if(t.type)return;const n=e.getOptions().stackParser;kf(n,t)})}});function Ua(e){const t="console";Kt(t,e),Xt(t,ky)}function ky(){"console"in L&&ma.forEach(function(e){e in L.console&&Re(L.console,e,function(t){return Wo[e]=t,function(...n){Ke("console",{args:n,level:e}),Wo[e]?.apply(L.console,n)}})})}function Zo(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Ry="CaptureConsole",Cy=((e={})=>{const t=e.levels||ma,n=e.handled??!0;return{name:Ry,setup(r){"console"in L&&Ua(({args:o,level:s})=>{R()!==r||!t.includes(s)||Ay(o,s,n)})}}}),ex=Cy;function Ay(e,t,n){const r=Zo(t),o=new Error,s={level:Zo(t),extra:{arguments:e}};Ge(i=>{if(i.addEventProcessor(u=>(u.logger="console",Ct(u,{handled:n,type:"auto.core.capture_console"}),u)),t==="assert"){if(!e[0]){const u=`Assertion failed: ${jo(e.slice(1)," ")||"console.assert"}`;i.setExtra("arguments",e.slice(1)),i.captureMessage(u,r,{captureContext:s,syntheticException:o})}return}const a=e.find(u=>u instanceof Error);if(a){me(a,s);return}const c=jo(e," ");i.captureMessage(c,r,{captureContext:s,syntheticException:o})})}const xy="Dedupe",My=(()=>{let e;return{name:xy,processEvent(t){if(t.type)return t;try{if(Oy(t,e))return w&&m.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),Ny=My;function Oy(e,t){return t?!!(Py(e,t)||Ly(e,t)):!1}function Py(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Af(e,t)||!Cf(e,t))}function Ly(e,t){const n=Ru(t),r=Ru(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Af(e,t)||!Cf(e,t))}function Cf(e,t){let n=xi(e),r=xi(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){const s=r[o],i=n[o];if(s.filename!==i.filename||s.lineno!==i.lineno||s.colno!==i.colno||s.function!==i.function)return!1}return!0}function Af(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 Ru(e){return e.exception?.values?.[0]}const Dy="ExtraErrorData",Fy=((e={})=>{const{depth:t=3,captureErrorCause:n=!0}=e;return{name:Dy,processEvent(r,o,s){const{maxValueLength:i}=s.getOptions();return $y(r,o,t,n,i)}}}),tx=Fy;function $y(e,t={},n,r,o){if(!t.originalException||!pt(t.originalException))return e;const s=t.originalException.name||t.originalException.constructor.name,i=xf(t.originalException,r,o);if(i){const a={...e.contexts},c=je(i,n);return rt(c)&&(Le(c,"__sentry_skip_normalization__",!0),a[s]=c),{...e,contexts:a}}return e}function xf(e,t,n){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],o={};for(const s of Object.keys(e)){if(r.indexOf(s)!==-1)continue;const i=e[s];o[s]=pt(i)||typeof i=="string"?n?kr(`${i}`,n):`${i}`:i}if(t&&e.cause!==void 0)if(pt(e.cause)){const s=e.cause.name||e.cause.constructor.name;o.cause={[s]:xf(e.cause,!1,n)}}else o.cause=e.cause;if(typeof e.toJSON=="function"){const s=e.toJSON();for(const i of Object.keys(s)){const a=s[i];o[i]=pt(a)?a.toString():a}}return o}catch(r){w&&m.error("Unable to extract extra data from the Error object:",r)}return null}function By(e,t){let n=0;for(let r=e.length-1;r>=0;r--){const o=e[r];o==="."?e.splice(r,1):o===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}const Uy=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Hy(e){const t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=Uy.exec(t);return n?n.slice(1):[]}function Cu(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){const o=r>=0?e[r]:"/";o&&(t=`${o}/${t}`,n=o.charAt(0)==="/")}return t=By(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function Au(e){let t=0;for(;t<e.length&&e[t]==="";t++);let n=e.length-1;for(;n>=0&&e[n]==="";n--);return t>n?[]:e.slice(t,n-t+1)}function Wy(e,t){e=Cu(e).slice(1),t=Cu(t).slice(1);const n=Au(e.split("/")),r=Au(t.split("/")),o=Math.min(n.length,r.length);let s=o;for(let a=0;a<o;a++)if(n[a]!==r[a]){s=a;break}let i=[];for(let a=s;a<n.length;a++)i.push("..");return i=i.concat(r.slice(s)),i.join("/")}function jy(e,t){return Hy(e)[2]||""}const qy="RewriteFrames",nx=(e={})=>{const t=e.root,n=e.prefix||"app:///",r="window"in L&&!!L.window,o=e.iteratee||zy({isBrowser:r,root:t,prefix:n});function s(a){try{return{...a,exception:{...a.exception,values:a.exception.values.map(c=>({...c,...c.stacktrace&&{stacktrace:i(c.stacktrace)}}))}}}catch{return a}}function i(a){return{...a,frames:a?.frames?.map(c=>o(c))}}return{name:qy,processEvent(a){let c=a;return a.exception&&Array.isArray(a.exception.values)&&(c=s(c)),c}}};function zy({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;const o=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),s=/^\//.test(r.filename);if(e){if(t){const i=r.filename;i.indexOf(t)===0&&(r.filename=i.replace(t,n))}}else if(o||s){const i=o?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,a=t?Wy(t,i):jy(i);r.filename=`${n}${a}`}return r}}const Gy=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],Vy=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],Jy={eq:"eq",neq:"neq",gt:"gt",gte:"gte",lt:"lt",lte:"lte",like:"like","like(all)":"likeAllOf","like(any)":"likeAnyOf",ilike:"ilike","ilike(all)":"ilikeAllOf","ilike(any)":"ilikeAnyOf",is:"is",in:"in",cs:"contains",cd:"containedBy",sr:"rangeGt",nxl:"rangeGte",sl:"rangeLt",nxr:"rangeLte",adj:"rangeAdjacent",ov:"overlaps",fts:"",plfts:"plain",phfts:"phrase",wfts:"websearch",not:"not"},Mf=["select","insert","upsert","update","delete"];function As(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function xs(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function Yy(e,t={}){switch(e){case"GET":return"select";case"POST":return t.Prefer?.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function Ky(e,t){if(t===""||t==="*")return"select(*)";if(e==="select")return`select(${t})`;if(e==="or"||e.endsWith(".or"))return`${e}${t}`;const[n,...r]=t.split(".");let o;return n?.startsWith("fts")?o="textSearch":n?.startsWith("plfts")?o="textSearch[plain]":n?.startsWith("phfts")?o="textSearch[phrase]":n?.startsWith("wfts")?o="textSearch[websearch]":o=n&&Jy[n]||"filter",`${o}(${e}, ${r.join(".")})`}function xu(e,t=!1){return new Proxy(e,{apply(n,r,o){return en({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[Y]:"auto.db.supabase",[Te]:"db","db.system":"postgresql","db.operation":`auth.${t?"admin.":""}${e.name}`}},s=>Reflect.apply(n,r,o).then(i=>(i&&typeof i=="object"&&"error"in i&&i.error?(s.setStatus({code:Z}),me(i.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):s.setStatus({code:vs}),s.end(),i)).catch(i=>{throw s.setStatus({code:Z}),s.end(),me(i,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),i}).then(...o))}})}function Xy(e){const t=e.auth;if(!(!t||xs(e.auth))){for(const n of Gy){const r=t[n];r&&typeof e.auth[n]=="function"&&(e.auth[n]=xu(r))}for(const n of Vy){const r=t.admin[n];r&&typeof e.auth.admin[n]=="function"&&(e.auth.admin[n]=xu(r,!0))}As(e.auth)}}function Qy(e){xs(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(t,n,r){const o=Reflect.apply(t,n,r),s=o.constructor;return eS(s),o}}),As(e.prototype.from))}function Zy(e){xs(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(t,n,r){const o=Mf,s=n,i=Yy(s.method,s.headers);if(!o.includes(i)||!s?.url?.pathname||typeof s.url.pathname!="string")return Reflect.apply(t,n,r);const a=s.url.pathname.split("/"),c=a.length>0?a[a.length-1]:"",u=[];for(const[p,h]of s.url.searchParams.entries())u.push(Ky(p,h));const d=Object.create(null);if(rt(s.body))for(const[p,h]of Object.entries(s.body))d[p]=h;const l=`${i==="select"?"":`${i}${d?"(...) ":""}`}${u.join(" ")} from(${c})`,f={"db.table":c,"db.schema":s.schema,"db.url":s.url.origin,"db.sdk":s.headers["X-Client-Info"],"db.system":"postgresql","db.operation":i,[Y]:"auto.db.supabase",[Te]:"db"};return u.length&&(f["db.query"]=u),Object.keys(d).length&&(f["db.body"]=d),en({name:l,attributes:f},p=>Reflect.apply(t,n,[]).then(h=>{if(p&&(h&&typeof h=="object"&&"status"in h&&qo(p,h.status||500),p.end()),h.error){const y=new Error(h.error.message);h.error.code&&(y.code=h.error.code),h.error.details&&(y.details=h.error.details);const b={};u.length&&(b.query=u),Object.keys(d).length&&(b.body=d),me(y,P=>(P.addEventProcessor(A=>(Ct(A,{handled:!1,type:"auto.db.supabase.postgres"}),A)),P.setContext("supabase",b),P))}const g={type:"supabase",category:`db.${i}`,message:l},_={};return u.length&&(_.query=u),Object.keys(d).length&&(_.body=d),Object.keys(_).length&&(g.data=_),xt(g),h},h=>{throw p&&(qo(p,500),p.end()),h}).then(...r))}}),As(e.prototype.then))}function eS(e){for(const t of Mf)xs(e.prototype[t])||(e.prototype[t]=new Proxy(e.prototype[t],{apply(n,r,o){const s=Reflect.apply(n,r,o),i=s.constructor;return w&&m.log(`Instrumenting ${t} operation's PostgRESTFilterBuilder`),Zy(i),s}}),As(e.prototype[t]))}const tS=e=>{if(!e){w&&m.warn("Supabase integration was not installed because no Supabase client was provided.");return}const t=e.constructor===Function?e:e.constructor;Qy(t),Xy(e)},nS="Supabase",rS=(e=>({setupOnce(){tS(e)},name:nS})),rx=e=>rS(e.supabaseClient),oS=10,sS="ZodErrors";function iS(e){return pt(e)&&e.name==="ZodError"&&Array.isArray(e.issues)}function aS(e){return{...e,path:"path"in e&&Array.isArray(e.path)?e.path.join("."):void 0,keys:"keys"in e?JSON.stringify(e.keys):void 0,unionErrors:"unionErrors"in e?JSON.stringify(e.unionErrors):void 0}}function cS(e){return e.map(t=>typeof t=="number"?"<array>":t).join(".")}function uS(e){const t=new Set;for(const r of e.issues){const o=cS(r.path);o.length>0&&t.add(o)}const n=Array.from(t);if(n.length===0){let r="variable";if(e.issues.length>0){const o=e.issues[0];o!==void 0&&"expected"in o&&typeof o.expected=="string"&&(r=o.expected)}return`Failed to validate ${r}`}return`Failed to validate keys: ${kr(n.join(", "),100)}`}function lS(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!iS(r.originalException)||r.originalException.issues.length===0)return n;try{const s=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(aS);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:s})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:uS(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":s.slice(0,e)}}}catch(o){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:o instanceof Error?`${o.name}: ${o.message}
18
- ${o.stack}`:"unknown"}}}}}const dS=((e={})=>{const t=e.limit??oS;return{name:sS,processEvent(n,r){return lS(t,e.saveZodIssuesAsAttachment,n,r)}}}),ox=dS,sx=e=>({name:"ThirdPartyErrorsFilter",setup(t){t.on("beforeEnvelope",n=>{hn(n,(r,o)=>{if(o==="event"){const s=Array.isArray(r)?r[1]:void 0;s&&(Rf(s),r[1]=s)}})}),t.on("applyFrameMetadata",n=>{if(n.type)return;const r=t.getOptions().stackParser;kf(r,n)})},processEvent(t){const n=pS(t,e.ignoreSentryInternalFrames);if(n){const r=e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="apply-tag-if-contains-third-party-frames"?"some":"every";if(n[r](s=>!s.some(i=>e.filterKeys.includes(i)))){if(e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="drop-error-if-exclusively-contains-third-party-frames")return null;t.tags={...t.tags,third_party_code:!0}}}return t}});function fS(e,t){if(t!==0||!e.context_line||!e.filename||!e.filename.includes("sentry")||!e.filename.includes("helpers")||!e.context_line.includes(mS))return!1;if(e.pre_context){const n=e.pre_context.length;for(let r=0;r<n;r++)if(e.pre_context[r]?.includes(hS))return!0}return!1}function pS(e,t){const n=xi(e);if(n)return n.filter((r,o)=>!r.filename||r.lineno==null&&r.colno==null&&r.instruction_addr==null?!1:!t||!fS(r,o)).map(r=>r.module_metadata?Object.keys(r.module_metadata).filter(o=>o.startsWith(Mu)).map(o=>o.slice(Mu.length)):[])}const Mu="_sentryBundlerPluginAppKey:",hS="Attempt to invoke user-land function",mS="fn.apply(this, wrappedArguments)",gS=100,_S=10,ro="flag.evaluation.";function or(e){const n=z().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...r]}),e}function mn(e,t,n=gS){const r=z().getScopeData().contexts;r.flags||(r.flags={values:[]});const o=r.flags.values;yS(o,e,t,n)}function yS(e,t,n,r){if(typeof n!="boolean")return;if(e.length>r){w&&m.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}const o=e.findIndex(s=>s.flag===t);o!==-1&&e.splice(o,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function gn(e,t,n=_S){if(typeof t!="boolean")return;const r=be();if(!r)return;const o=U(r).data;if(`${ro}${e}`in o){r.setAttribute(`${ro}${e}`,t);return}Object.keys(o).filter(i=>i.startsWith(ro)).length<n&&r.setAttribute(`${ro}${e}`,t)}const ix=()=>({name:"FeatureFlags",processEvent(e,t,n){return or(e)},addFeatureFlag(e,t){mn(e,t),gn(e,t)}}),SS=({growthbookClass:e})=>({name:"GrowthBook",setupOnce(){const t=e.prototype;typeof t.isOn=="function"&&Re(t,"isOn",Nu),typeof t.getFeatureValue=="function"&&Re(t,"getFeatureValue",Nu)},processEvent(t,n,r){return or(t)}});function Nu(e){return function(...t){const n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"&&(mn(n,r),gn(n,r)),r}}function bS(e,t,n,r,o){if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,a=Xe()&&t(i);if(e.endTimestamp&&a){const p=e.fetchData.__span;if(!p)return;const h=r[p];h&&(vS(h,e),ES(h,e,o),delete r[p]);return}const{spanOrigin:c="auto.http.browser",propagateTraceparent:u=!1}=typeof o=="object"?o:{spanOrigin:o},d=!!be(),l=a&&d?it(wS(i,s,c)):new At;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=TS(p,h,Xe()&&d?l:void 0,u);g&&(e.args[1]=h,h.headers=g)}const f=R();if(f){const p={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",l,p)}return l}function ES(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function TS(e,t,n,r){const o=If({span:n,propagateTraceparent:r}),s=o["sentry-trace"],i=o.baggage,a=o.traceparent;if(!s)return;const c=t.headers||(ya(e)?e.headers:void 0);if(c)if(IS(c)){const u=new Headers(c);if(u.get("sentry-trace")||u.set("sentry-trace",s),r&&a&&!u.get("traceparent")&&u.set("traceparent",a),i){const d=u.get("baggage");d?oo(d)||u.set("baggage",`${d},${i}`):u.set("baggage",i)}return u}else if(Array.isArray(c)){const u=[...c];c.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",s]),r&&a&&!c.find(l=>l[0]==="traceparent")&&u.push(["traceparent",a]);const d=c.find(l=>l[0]==="baggage"&&oo(l[1]));return i&&!d&&u.push(["baggage",i]),u}else{const u="sentry-trace"in c?c["sentry-trace"]:void 0,d="traceparent"in c?c.traceparent:void 0,l="baggage"in c?c.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(g=>oo(g)):oo(l));i&&!p&&f.push(i);const h={...c,"sentry-trace":u??s,baggage:f.length>0?f.join(","):void 0};return r&&a&&!d&&(h.traceparent=a),h}else return{...o}}function vS(e,t){if(t.response){qo(e,t.response.status);const n=t.response?.headers?.get("content-length");if(n){const r=parseInt(n);r>0&&e.setAttribute("http.response_content_length",r)}}else t.error&&e.setStatus({code:Z,message:"internal_error"});e.end()}function oo(e){return e.split(",").some(t=>t.trim().startsWith(va))}function IS(e){return typeof Headers<"u"&&Rt(e,Headers)}function wS(e,t,n){const r=Ba(e);return{name:r?`${t} ${Z_(r)}`:t,attributes:kS(e,r,t,n)}}function kS(e,t,n,r){const o={url:e,type:"fetch","http.method":n,[Y]:r,[Te]:"http.client"};return t&&($a(t)||(o["http.url"]=t.href,o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function RS(e,t={},n=z()){const{message:r,name:o,email:s,url:i,source:a,associatedEventId:c,tags:u}=e,d={contexts:{feedback:{contact_email:s,name:o,message:r,url:i,source:a,associated_event_id:c}},type:"feedback",level:"info",tags:u},l=n?.getClient()||R();return l&&l.emit("beforeSendFeedback",d,t),n.captureEvent(d,t)}function sr(e,t,n,r,o){Xo({level:e,message:t,attributes:n,severityNumber:o},r)}function CS(e,t,{scope:n}={}){sr("trace",e,t,n)}function AS(e,t,{scope:n}={}){sr("debug",e,t,n)}function xS(e,t,{scope:n}={}){sr("info",e,t,n)}function MS(e,t,{scope:n}={}){sr("warn",e,t,n)}function NS(e,t,{scope:n}={}){sr("error",e,t,n)}function OS(e,t,{scope:n}={}){sr("fatal",e,t,n)}const ax=Object.freeze(Object.defineProperty({__proto__:null,debug:AS,error:NS,fatal:OS,fmt:ry,info:xS,trace:CS,warn:MS},Symbol.toStringTag,{value:"Module"}));function Hi(e,t,n){return"util"in L&&typeof L.util.format=="function"?L.util.format(...e):PS(e,t,n)}function PS(e,t,n){return e.map(r=>Vt(r)?String(r):JSON.stringify(je(r,t,n))).join(" ")}function LS(e){return/%[sdifocO]/.test(e)}function DS(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((o,s)=>{n[`sentry.message.parameter.${s}`]=o}),n}const FS="ConsoleLogs",Ou={[Y]:"auto.log.console"},$S=((e={})=>{const t=e.levels||ma;return{name:FS,setup(n){const{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=n.getOptions();if(!r){w&&m.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}Ua(({args:i,level:a})=>{if(R()!==n||!t.includes(a))return;const c=i[0],u=i.slice(1);if(a==="assert"){if(!c){const p=u.length>0?`Assertion failed: ${Hi(u,o,s)}`:"Assertion failed";Xo({level:"error",message:p,attributes:Ou})}return}const d=a==="log",l=i.length>1&&typeof i[0]=="string"&&!LS(i[0]),f={...Ou,...l?DS(c,u):{}};Xo({level:d?"info":a,message:Hi(i,o,s),severityNumber:d?10:void 0,attributes:f})})}}}),cx=$S;function Ha(e,t,n,r){N_({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function BS(e,t=1,n){Ha("counter",e,t,n)}function US(e,t,n){Ha("gauge",e,t,n)}function HS(e,t,n){Ha("distribution",e,t,n)}const ux=Object.freeze(Object.defineProperty({__proto__:null,count:BS,distribution:HS,gauge:US},Symbol.toStringTag,{value:"Module"})),WS=["trace","debug","info","warn","error","fatal"];function lx(e={}){const t=new Set(e.levels??WS),n=e.client;return{log(r){const{type:o,level:s,message:i,args:a,tag:c,date:u,...d}=r,l=n||R();if(!l)return;const f=zS(o,s);if(!t.has(f))return;const{normalizeDepth:p=3,normalizeMaxBreadth:h=1e3}=l.getOptions(),g=[];i&&g.push(i),a&&a.length>0&&g.push(Hi(a,p,h));const _=g.join(" ");d["sentry.origin"]="auto.log.consola",c&&(d["consola.tag"]=c),o&&(d["consola.type"]=o),s!=null&&typeof s=="number"&&(d["consola.level"]=s),Xo({level:f,message:_,attributes:d})}}}const jS={silent:"trace",fatal:"fatal",error:"error",warn:"warn",log:"info",info:"info",success:"info",fail:"error",ready:"info",start:"info",box:"info",debug:"debug",trace:"trace",verbose:"debug",critical:"fatal",notice:"info"},qS={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function zS(e,t){if(e==="verbose")return"debug";if(e==="silent")return"trace";if(e){const n=jS[e];if(n)return n}if(typeof t=="number"){const n=qS[t];if(n)return n}return"info"}const GS="gen_ai.prompt",Ms="gen_ai.system",Be="gen_ai.request.model",Wa="gen_ai.request.stream",Ns="gen_ai.request.temperature",ja="gen_ai.request.max_tokens",Os="gen_ai.request.frequency_penalty",qa="gen_ai.request.presence_penalty",Ps="gen_ai.request.top_p",Nf="gen_ai.request.top_k",VS="gen_ai.request.encoding_format",JS="gen_ai.request.dimensions",tn="gen_ai.response.finish_reasons",Pt="gen_ai.response.model",In="gen_ai.response.id",YS="gen_ai.response.stop_reason",_n="gen_ai.usage.input_tokens",yn="gen_ai.usage.output_tokens",Sn="gen_ai.usage.total_tokens",Jt="gen_ai.operation.name",ir="gen_ai.request.messages.original_length",ar="gen_ai.request.messages",Qe="gen_ai.response.text",Ls="gen_ai.request.available_tools",Ds="gen_ai.response.streaming",St="gen_ai.response.tool_calls",Of="gen_ai.agent.name",KS="gen_ai.pipeline.name",za="gen_ai.conversation.id",XS="gen_ai.usage.cache_creation_input_tokens",QS="gen_ai.usage.cache_read_input_tokens",ZS="gen_ai.invoke_agent",Pf="openai.response.id",Lf="openai.response.model",Df="openai.response.timestamp",eb="openai.usage.completion_tokens",tb="openai.usage.prompt_tokens",so={CHAT:"chat",RESPONSES:"responses",EMBEDDINGS:"embeddings",CONVERSATIONS:"conversations"},Pu="anthropic.response.timestamp",Ff=2e4,es=e=>new TextEncoder().encode(e).length,ts=e=>es(JSON.stringify(e));function Ga(e,t){if(es(e)<=t)return e;let n=0,r=e.length,o="";for(;n<=r;){const s=Math.floor((n+r)/2),i=e.slice(0,s);es(i)<=t?(o=i,n=s+1):r=s-1}return o}function nb(e){return typeof e=="string"?e:"text"in e?e.text:""}function Lu(e,t){return typeof e=="string"?t:{...e,text:t}}function rb(e){return e!==null&&typeof e=="object"&&"content"in e&&typeof e.content=="string"}function ob(e){return e!==null&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)}function Er(e){return!e||typeof e!="object"?!1:sb(e)||$f(e)||"media_type"in e&&typeof e.media_type=="string"&&"data"in e||"image_url"in e&&typeof e.image_url=="string"&&e.image_url.startsWith("data:")||"type"in e&&(e.type==="blob"||e.type==="base64")||"b64_json"in e||"type"in e&&"result"in e&&e.type==="image_generation"||"uri"in e&&typeof e.uri=="string"&&e.uri.startsWith("data:")}function sb(e){return"type"in e&&typeof e.type=="string"&&"source"in e&&Er(e.source)}function $f(e){return"inlineData"in e&&!!e.inlineData&&typeof e.inlineData=="object"&&"data"in e.inlineData&&typeof e.inlineData.data=="string"}function Bf(e){return e!==null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function ib(e,t){const n={...e,content:""},r=ts(n),o=t-r;if(o<=0)return[];const s=Ga(e.content,o);return[{...e,content:s}]}function ab(e,t){const{parts:n}=e,r=n.map(a=>Lu(a,"")),o=ts({...e,parts:r});let s=t-o;if(s<=0)return[];const i=[];for(const a of n){const c=nb(a),u=es(c);if(u<=s)i.push(a),s-=u;else if(i.length===0){const d=Ga(c,s);d&&i.push(Lu(a,d));break}else break}return i.length<=0?[]:[{...e,parts:i}]}function cb(e,t){return!e||typeof e!="object"?[]:rb(e)?ib(e,t):Bf(e)?ab(e,t):[]}const Du="[Filtered]",ub=["image_url","data","content","b64_json","result","uri"];function Co(e){const t={...e};Er(t.source)&&(t.source=Co(t.source)),$f(e)&&(t.inlineData={...e.inlineData,data:Du});for(const n of ub)typeof t[n]=="string"&&(t[n]=Du);return t}function Wi(e){return e.map(n=>{let r;return n&&typeof n=="object"&&(ob(n)?r={...n,content:Wi(n.content)}:"content"in n&&Er(n.content)&&(r={...n,content:Co(n.content)}),Bf(n)&&(r={...r??n,parts:Wi(n.parts)}),Er(r)?r=Co(r):Er(n)&&(r=Co(n))),r??n})}function lb(e,t){if(!Array.isArray(e)||e.length===0)return e;const n=Wi(e);if(ts(n)<=t)return n;const o=n.map(ts);let s=0,i=n.length;for(let a=n.length-1;a>=0;a--){const c=o[a];if(c&&s+c>t)break;c&&(s+=c),i=a}if(i===n.length){const a=n[n.length-1];return cb(a,t)}return n.slice(i)}function Fs(e){return lb(e,Ff)}function db(e){return Ga(e,Ff)}function jr(e){return e.includes("messages")?"messages":e.includes("completions")?"completions":e.includes("models")?"models":e.includes("chat")?"chat":e.split(".").pop()||"unknown"}function ns(e){return`gen_ai.${jr(e)}`}function Uf(e,t){return e?`${e}.${t}`:t}function Va(e,t,n,r,o){if(t!==void 0&&e.setAttributes({[_n]:t}),n!==void 0&&e.setAttributes({[yn]:n}),t!==void 0||n!==void 0||r!==void 0||o!==void 0){const s=(t??0)+(n??0)+(r??0)+(o??0);e.setAttributes({[Sn]:s})}}function Hf(e){if(typeof e=="string")return db(e);if(Array.isArray(e)){const t=Fs(e);return JSON.stringify(t)}return JSON.stringify(e)}const fb=["responses.create","chat.completions.create","embeddings.create","conversations.create"],pb=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],hb=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...pb];function Ja(e){return e.includes("chat.completions")?so.CHAT:e.includes("responses")?so.RESPONSES:e.includes("embeddings")?so.EMBEDDINGS:e.includes("conversations")?so.CONVERSATIONS:e.split(".").pop()||"unknown"}function Fu(e){return`gen_ai.${Ja(e)}`}function mb(e){return fb.includes(e)}function gb(e,t){return e?`${e}.${t}`:t}function _b(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="chat.completion"}function yb(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="response"}function Sb(e){if(e===null||typeof e!="object"||!("object"in e))return!1;const t=e;return t.object==="list"&&typeof t.model=="string"&&t.model.toLowerCase().includes("embedding")}function bb(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="conversation"}function Eb(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&e.type.startsWith("response.")}function Tb(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="chat.completion.chunk"}function vb(e,t,n){if(Ya(e,t.id,t.model,t.created),t.usage&&$s(e,t.usage.prompt_tokens,t.usage.completion_tokens,t.usage.total_tokens),Array.isArray(t.choices)){const r=t.choices.map(o=>o.finish_reason).filter(o=>o!==null);if(r.length>0&&e.setAttributes({[tn]:JSON.stringify(r)}),n){const o=t.choices.map(s=>s.message?.tool_calls).filter(s=>Array.isArray(s)&&s.length>0).flat();o.length>0&&e.setAttributes({[St]:JSON.stringify(o)})}}}function Ib(e,t,n){if(Ya(e,t.id,t.model,t.created_at),t.status&&e.setAttributes({[tn]:JSON.stringify([t.status])}),t.usage&&$s(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.total_tokens),n){const r=t;if(Array.isArray(r.output)&&r.output.length>0){const o=r.output.filter(s=>typeof s=="object"&&s!==null&&s.type==="function_call");o.length>0&&e.setAttributes({[St]:JSON.stringify(o)})}}}function wb(e,t){e.setAttributes({[Lf]:t.model,[Pt]:t.model}),t.usage&&$s(e,t.usage.prompt_tokens,void 0,t.usage.total_tokens)}function kb(e,t){const{id:n,created_at:r}=t;e.setAttributes({[Pf]:n,[In]:n,[za]:n}),r&&e.setAttributes({[Df]:new Date(r*1e3).toISOString()})}function $s(e,t,n,r){t!==void 0&&e.setAttributes({[tb]:t,[_n]:t}),n!==void 0&&e.setAttributes({[eb]:n,[yn]:n}),r!==void 0&&e.setAttributes({[Sn]:r})}function Ya(e,t,n,r){e.setAttributes({[Pf]:t,[In]:t}),e.setAttributes({[Lf]:n,[Pt]:n}),e.setAttributes({[Df]:new Date(r*1e3).toISOString()})}function Rb(e){if("conversation"in e&&typeof e.conversation=="string")return e.conversation;if("previous_response_id"in e&&typeof e.previous_response_id=="string")return e.previous_response_id}function Cb(e){const t={[Be]:e.model??"unknown"};"temperature"in e&&(t[Ns]=e.temperature),"top_p"in e&&(t[Ps]=e.top_p),"frequency_penalty"in e&&(t[Os]=e.frequency_penalty),"presence_penalty"in e&&(t[qa]=e.presence_penalty),"stream"in e&&(t[Wa]=e.stream),"encoding_format"in e&&(t[VS]=e.encoding_format),"dimensions"in e&&(t[JS]=e.dimensions);const n=Rb(e);return n&&(t[za]=n),t}function Ab(e,t){for(const n of e){const r=n.index;if(!(r===void 0||!n.function))if(!(r in t.chatCompletionToolCalls))t.chatCompletionToolCalls[r]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}};else{const o=t.chatCompletionToolCalls[r];n.function.arguments&&o?.function&&(o.function.arguments+=n.function.arguments)}}}function xb(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,t.responseTimestamp=e.created??t.responseTimestamp,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(const r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&Ab(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function Mb(e,t,n,r){if(!(e&&typeof e=="object")){t.eventTypes.push("unknown:non-object");return}if(e instanceof Error){r.setStatus({code:Z,message:"internal_error"}),me(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in e))return;const o=e;if(!hb.includes(o.type)){t.eventTypes.push(o.type);return}if(n&&(o.type==="response.output_item.done"&&"item"in o&&t.responsesApiToolCalls.push(o.item),o.type==="response.output_text.delta"&&"delta"in o&&o.delta)){t.responseTexts.push(o.delta);return}if("response"in o){const{response:s}=o;t.responseId=s.id??t.responseId,t.responseModel=s.model??t.responseModel,t.responseTimestamp=s.created_at??t.responseTimestamp,s.usage&&(t.promptTokens=s.usage.input_tokens,t.completionTokens=s.usage.output_tokens,t.totalTokens=s.usage.total_tokens),s.status&&t.finishReasons.push(s.status),n&&s.output_text&&t.responseTexts.push(s.output_text)}}async function*Nb(e,t,n){const r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",responseTimestamp:0,promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(const o of e)Tb(o)?xb(o,r,n):Eb(o)&&Mb(o,r,n,t),yield o}finally{Ya(t,r.responseId,r.responseModel,r.responseTimestamp),$s(t,r.promptTokens,r.completionTokens,r.totalTokens),t.setAttributes({[Ds]:!0}),r.finishReasons.length&&t.setAttributes({[tn]:JSON.stringify(r.finishReasons)}),n&&r.responseTexts.length&&t.setAttributes({[Qe]:r.responseTexts.join("")});const s=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];s.length>0&&t.setAttributes({[St]:JSON.stringify(s)}),t.end()}}function Ob(e){const t=Array.isArray(e.tools)?e.tools:[],r=e.web_search_options&&typeof e.web_search_options=="object"?[{type:"web_search_options",...e.web_search_options}]:[],o=[...t,...r];return o.length>0?JSON.stringify(o):void 0}function Pb(e,t){const n={[Ms]:"openai",[Jt]:Ja(t),[Y]:"auto.ai.openai"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const r=e[0],o=Ob(r);o&&(n[Ls]=o),Object.assign(n,Cb(r))}else n[Be]="unknown";return n}function Lb(e,t,n){if(!t||typeof t!="object")return;const r=t;if(_b(r)){if(vb(e,r,n),n&&r.choices?.length){const o=r.choices.map(s=>s.message?.content||"");e.setAttributes({[Qe]:JSON.stringify(o)})}}else yb(r)?(Ib(e,r,n),n&&r.output_text&&e.setAttributes({[Qe]:r.output_text})):Sb(r)?wb(e,r):bb(r)&&kb(e,r)}function $u(e,t){const n="input"in t?t.input:"messages"in t?t.messages:void 0,r=Array.isArray(n)?n.length:void 0;if(n&&r!==0){const o=Hf(n);e.setAttribute(ar,o),r&&e.setAttribute(ir,r)}}function Db(e,t,n,r){return async function(...s){const i=Pb(s,t),a=i[Be]||"unknown",c=Ja(t),u=s[0];return u&&typeof u=="object"&&u.stream===!0?Ht({name:`${c} ${a} stream-response`,op:Fu(t),attributes:i},async l=>{try{r.recordInputs&&u&&$u(l,u);const f=await e.apply(n,s);return Nb(f,l,r.recordOutputs??!1)}catch(f){throw l.setStatus({code:Z,message:"internal_error"}),me(f,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:t}}}),l.end(),f}}):en({name:`${c} ${a}`,op:Fu(t),attributes:i},async l=>{try{r.recordInputs&&u&&$u(l,u);const f=await e.apply(n,s);return Lb(l,f,r.recordOutputs),f}catch(f){throw me(f,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:t}}}),f}})}}function Wf(e,t="",n){return new Proxy(e,{get(r,o){const s=r[o],i=gb(t,String(o));return typeof s=="function"&&mb(i)?Db(s,i,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?Wf(s,i,n):s}})}function dx(e,t){const n=!!R()?.getOptions().sendDefaultPii,r={recordInputs:n,recordOutputs:n,...t};return Wf(e,"",r)}function Fb(e,t){return"type"in e&&typeof e.type=="string"&&e.type==="error"?(t.setStatus({code:Z,message:e.error?.type??"internal_error"}),me(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function $b(e,t){if(e.type==="message_delta"&&e.usage&&"output_tokens"in e.usage&&typeof e.usage.output_tokens=="number"&&(t.completionTokens=e.usage.output_tokens),e.message){const n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.stop_reason&&t.finishReasons.push(n.stop_reason),n.usage&&(typeof n.usage.input_tokens=="number"&&(t.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens=="number"&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens=="number"&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function Bb(e,t){e.type!=="content_block_start"||typeof e.index!="number"||!e.content_block||(e.content_block.type==="tool_use"||e.content_block.type==="server_tool_use")&&(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]})}function Ub(e,t,n){if(!(e.type!=="content_block_delta"||!e.delta)){if(typeof e.index=="number"&&"partial_json"in e.delta&&typeof e.delta.partial_json=="string"){const r=t.activeToolBlocks[e.index];r&&r.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text=="string"&&t.responseTexts.push(e.delta.text)}}function Hb(e,t){if(e.type!=="content_block_stop"||typeof e.index!="number")return;const n=t.activeToolBlocks[e.index];if(!n)return;const r=n.inputJsonParts.join("");let o;try{o=r?JSON.parse(r):{}}catch{o={__unparsed:r}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete t.activeToolBlocks[e.index]}function jf(e,t,n,r){!(e&&typeof e=="object")||Fb(e,r)||($b(e,t),Bb(e,t),Ub(e,t,n),Hb(e,t))}function Wb(e,t,n){t.isRecording()&&(e.responseId&&t.setAttributes({[In]:e.responseId}),e.responseModel&&t.setAttributes({[Pt]:e.responseModel}),Va(t,e.promptTokens,e.completionTokens,e.cacheCreationInputTokens,e.cacheReadInputTokens),t.setAttributes({[Ds]:!0}),e.finishReasons.length>0&&t.setAttributes({[tn]:JSON.stringify(e.finishReasons)}),n&&e.responseTexts.length>0&&t.setAttributes({[Qe]:e.responseTexts.join("")}),n&&e.toolCalls.length>0&&t.setAttributes({[St]:JSON.stringify(e.toolCalls)}),t.end())}async function*jb(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(const o of e)jf(o,r,n,t),yield o}finally{r.responseId&&t.setAttributes({[In]:r.responseId}),r.responseModel&&t.setAttributes({[Pt]:r.responseModel}),Va(t,r.promptTokens,r.completionTokens,r.cacheCreationInputTokens,r.cacheReadInputTokens),t.setAttributes({[Ds]:!0}),r.finishReasons.length>0&&t.setAttributes({[tn]:JSON.stringify(r.finishReasons)}),n&&r.responseTexts.length>0&&t.setAttributes({[Qe]:r.responseTexts.join("")}),n&&r.toolCalls.length>0&&t.setAttributes({[St]:JSON.stringify(r.toolCalls)}),t.end()}}function qb(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",o=>{jf(o,r,n,t)}),e.on("message",()=>{Wb(r,t,n)}),e.on("error",o=>{me(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:Z,message:"stream_error"}),t.end())}),e}const zb=["messages.create","messages.stream","messages.countTokens","models.get","completions.create","models.retrieve","beta.messages.create"];function Gb(e){return zb.includes(e)}function Vb(e,t){const n=Array.isArray(t)?t.length:void 0;n!==0&&e.setAttributes({[ar]:Hf(t),[ir]:n})}function Jb(e,t){t.error&&(e.setStatus({code:Z,message:t.error.type||"internal_error"}),me(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function Yb(e){const{system:t,messages:n,input:r}=e,o=typeof t=="string"?[{role:"system",content:e.system}]:[],s=Array.isArray(r)?r:r!=null?[r]:void 0,i=Array.isArray(n)?n:n!=null?[n]:[],a=s??i;return[...o,...a]}function Kb(e,t){const n={[Ms]:"anthropic",[Jt]:jr(t),[Y]:"auto.ai.anthropic"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const r=e[0];r.tools&&Array.isArray(r.tools)&&(n[Ls]=JSON.stringify(r.tools)),n[Be]=r.model??"unknown","temperature"in r&&(n[Ns]=r.temperature),"top_p"in r&&(n[Ps]=r.top_p),"stream"in r&&(n[Wa]=r.stream),"top_k"in r&&(n[Nf]=r.top_k),"frequency_penalty"in r&&(n[Os]=r.frequency_penalty),"max_tokens"in r&&(n[ja]=r.max_tokens)}else t==="models.retrieve"||t==="models.get"?n[Be]=e[0]:n[Be]="unknown";return n}function ji(e,t){const n=Yb(t);Vb(e,n),"prompt"in t&&e.setAttributes({[GS]:JSON.stringify(t.prompt)})}function Xb(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[Qe]:t.content.map(r=>r.text).filter(r=>!!r).join("")});const n=[];for(const r of t.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&e.setAttributes({[St]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[Qe]:t.completion}),"input_tokens"in t&&e.setAttributes({[Qe]:JSON.stringify(t.input_tokens)})}function Qb(e,t){"id"in t&&"model"in t&&(e.setAttributes({[In]:t.id,[Pt]:t.model}),"created"in t&&typeof t.created=="number"&&e.setAttributes({[Pu]:new Date(t.created*1e3).toISOString()}),"created_at"in t&&typeof t.created_at=="number"&&e.setAttributes({[Pu]:new Date(t.created_at*1e3).toISOString()}),"usage"in t&&t.usage&&Va(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function Zb(e,t,n){if(!(!t||typeof t!="object")){if("type"in t&&t.type==="error"){Jb(e,t);return}n&&Xb(e,t),Qb(e,t)}}function Bu(e,t,n){throw me(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),t.isRecording()&&(t.setStatus({code:Z,message:"internal_error"}),t.end()),e}function eE(e,t,n,r,o,s,i,a,c,u,d){const l=o[Be]??"unknown",f={name:`${s} ${l} stream-response`,op:ns(i),attributes:o};return u&&!d?Ht(f,async p=>{try{c.recordInputs&&a&&ji(p,a);const h=await e.apply(n,r);return jb(h,p,c.recordOutputs??!1)}catch(h){return Bu(h,p,i)}}):Ht(f,p=>{try{c.recordInputs&&a&&ji(p,a);const h=t.apply(n,r);return qb(h,p,c.recordOutputs??!1)}catch(h){return Bu(h,p,i)}})}function tE(e,t,n,r){return new Proxy(e,{apply(o,s,i){const a=Kb(i,t),c=a[Be]??"unknown",u=jr(t),d=typeof i[0]=="object"?i[0]:void 0,l=!!d?.stream,f=t==="messages.stream";return l||f?eE(e,o,n,i,a,u,t,d,r,l,f):en({name:`${u} ${c}`,op:ns(t),attributes:a},p=>(r.recordInputs&&d&&ji(p,d),Rs(()=>o.apply(n,i),h=>{me(h,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:t}}})},()=>{},h=>Zb(p,h,r.recordOutputs))))}})}function qf(e,t="",n){return new Proxy(e,{get(r,o){const s=r[o],i=Uf(t,String(o));return typeof s=="function"&&Gb(i)?tE(s,i,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?qf(s,i,n):s}})}function fx(e,t){const n=!!R()?.getOptions().sendDefaultPii,r={recordInputs:n,recordOutputs:n,...t};return qf(e,"",r)}const Uu=["models.generateContent","models.generateContentStream","chats.create","sendMessage","sendMessageStream"],nE="google_genai",zf="chats.create",rE="chat";function oE(e,t){const n=e?.promptFeedback;if(n?.blockReason){const r=n.blockReasonMessage??n.blockReason;return t.setStatus({code:Z,message:`Content blocked: ${r}`}),me(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function sE(e,t){typeof e.responseId=="string"&&(t.responseId=e.responseId),typeof e.modelVersion=="string"&&(t.responseModel=e.modelVersion);const n=e.usageMetadata;n&&(typeof n.promptTokenCount=="number"&&(t.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount=="number"&&(t.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount=="number"&&(t.totalTokens=n.totalTokenCount))}function iE(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(const r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(const o of r?.content?.parts??[])n&&o.text&&t.responseTexts.push(o.text),o.functionCall&&t.toolCalls.push({type:"function",id:o.functionCall.id,name:o.functionCall.name,arguments:o.functionCall.args})}}function aE(e,t,n,r){!e||oE(e,r)||(sE(e,t),iE(e,t,n))}async function*cE(e,t,n){const r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(const o of e)aE(o,r,n,t),yield o}finally{const o={[Ds]:!0};r.responseId&&(o[In]=r.responseId),r.responseModel&&(o[Pt]=r.responseModel),r.promptTokens!==void 0&&(o[_n]=r.promptTokens),r.completionTokens!==void 0&&(o[yn]=r.completionTokens),r.totalTokens!==void 0&&(o[Sn]=r.totalTokens),r.finishReasons.length&&(o[tn]=JSON.stringify(r.finishReasons)),n&&r.responseTexts.length&&(o[Qe]=r.responseTexts.join("")),n&&r.toolCalls.length&&(o[St]=JSON.stringify(r.toolCalls)),t.setAttributes(o),t.end()}}function uE(e){if(Uu.includes(e))return!0;const t=e.split(".").pop();return Uu.includes(t)}function lE(e){return e.includes("Stream")}function gr(e,t="user"){return typeof e=="string"?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(n=>gr(n,t)):typeof e!="object"||!e?[]:"role"in e&&typeof e.role=="string"?[e]:"parts"in e?[{...e,role:t}]:[{role:t,content:e}]}function Hu(e,t){if("model"in e&&typeof e.model=="string")return e.model;if(t&&typeof t=="object"){const n=t;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function dE(e){const t={};return"temperature"in e&&typeof e.temperature=="number"&&(t[Ns]=e.temperature),"topP"in e&&typeof e.topP=="number"&&(t[Ps]=e.topP),"topK"in e&&typeof e.topK=="number"&&(t[Nf]=e.topK),"maxOutputTokens"in e&&typeof e.maxOutputTokens=="number"&&(t[ja]=e.maxOutputTokens),"frequencyPenalty"in e&&typeof e.frequencyPenalty=="number"&&(t[Os]=e.frequencyPenalty),"presencePenalty"in e&&typeof e.presencePenalty=="number"&&(t[qa]=e.presencePenalty),t}function fE(e,t,n){const r={[Ms]:nE,[Jt]:jr(e),[Y]:"auto.ai.google_genai"};if(t){if(r[Be]=Hu(t,n),"config"in t&&typeof t.config=="object"&&t.config){const o=t.config;if(Object.assign(r,dE(o)),"tools"in o&&Array.isArray(o.tools)){const s=o.tools.flatMap(i=>i.functionDeclarations);r[Ls]=JSON.stringify(s)}}}else r[Be]=Hu({},n);return r}function Wu(e,t){const n=[];"config"in t&&t.config&&typeof t.config=="object"&&"systemInstruction"in t.config&&t.config.systemInstruction&&n.push(...gr(t.config.systemInstruction,"system")),"history"in t&&n.push(...gr(t.history,"user")),"contents"in t&&n.push(...gr(t.contents,"user")),"message"in t&&n.push(...gr(t.message,"user")),Array.isArray(n)&&n.length&&e.setAttributes({[ir]:n.length,[ar]:JSON.stringify(Fs(n))})}function pE(e,t,n){if(!(!t||typeof t!="object")){if(t.modelVersion&&e.setAttribute(Pt,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata=="object"){const r=t.usageMetadata;typeof r.promptTokenCount=="number"&&e.setAttributes({[_n]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&e.setAttributes({[yn]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&e.setAttributes({[Sn]:r.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){const r=t.candidates.map(o=>o.content?.parts&&Array.isArray(o.content.parts)?o.content.parts.map(s=>typeof s.text=="string"?s.text:"").filter(s=>s.length>0).join(""):"").filter(o=>o.length>0);r.length>0&&e.setAttributes({[Qe]:r.join("")})}if(n&&t.functionCalls){const r=t.functionCalls;Array.isArray(r)&&r.length>0&&e.setAttributes({[St]:JSON.stringify(r)})}}}function ju(e,t,n,r){const o=t===zf;return new Proxy(e,{apply(s,i,a){const c=a[0],u=fE(t,c,n),d=u[Be]??"unknown",l=jr(t);return lE(t)?Ht({name:`${l} ${d} stream-response`,op:ns(t),attributes:u},async f=>{try{r.recordInputs&&c&&Wu(f,c);const p=await s.apply(n,a);return cE(p,f,!!r.recordOutputs)}catch(p){throw f.setStatus({code:Z,message:"internal_error"}),me(p,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}}),f.end(),p}}):en({name:o?`${l} ${d} create`:`${l} ${d}`,op:ns(t),attributes:u},f=>(r.recordInputs&&c&&Wu(f,c),Rs(()=>s.apply(n,a),p=>{me(p,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}})},()=>{},p=>{o||pE(f,p,r.recordOutputs)})))}})}function qi(e,t="",n){return new Proxy(e,{get:(r,o,s)=>{const i=Reflect.get(r,o,s),a=Uf(t,String(o));if(typeof i=="function"&&uE(a)){if(a===zf){const c=ju(i,a,r,n);return function(...d){const l=c(...d);return l&&typeof l=="object"?qi(l,rE,n):l}}return ju(i,a,r,n)}return typeof i=="function"?i.bind(r):i&&typeof i=="object"?qi(i,a,n):i}})}function px(e,t){const n=!!R()?.getOptions().sendDefaultPii,r={recordInputs:n,recordOutputs:n,...t};return qi(e,"",r)}const _r="auto.ai.langchain",hE={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"},tt=(e,t,n)=>{n!=null&&(e[t]=n)},We=(e,t,n)=>{const r=Number(n);Number.isNaN(r)||(e[t]=r)};function $e(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function hr(e){const t=e.toLowerCase();return hE[t]??t}function qu(e){return e.includes("System")?"system":e.includes("Human")?"user":e.includes("AI")||e.includes("Assistant")?"assistant":e.includes("Function")?"function":e.includes("Tool")?"tool":"user"}function zu(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function Ka(e){return e.map(t=>{const n=t._getType;if(typeof n=="function"){const o=n.call(t);return{role:hr(o),content:$e(t.content)}}const r=t.constructor?.name;if(r)return{role:hr(qu(r)),content:$e(t.content)};if(t.type){const o=String(t.type).toLowerCase();return{role:hr(o),content:$e(t.content)}}if(t.role)return{role:hr(String(t.role)),content:$e(t.content)};if(t.lc===1&&t.kwargs){const o=t.id,s=Array.isArray(o)&&o.length>0?o[o.length-1]:"",i=typeof s=="string"?qu(s):"user";return{role:hr(i),content:$e(t.kwargs?.content)}}return{role:"user",content:$e(t.content)}})}function mE(e,t,n){const r={},o="kwargs"in e?e.kwargs:void 0,s=t?.temperature??n?.ls_temperature??o?.temperature;We(r,Ns,s);const i=t?.max_tokens??n?.ls_max_tokens??o?.max_tokens;We(r,ja,i);const a=t?.top_p??o?.top_p;We(r,Ps,a);const c=t?.frequency_penalty;We(r,Os,c);const u=t?.presence_penalty;return We(r,qa,u),t&&"stream"in t&&tt(r,Wa,!!t.stream),r}function Gf(e,t,n,r,o,s){return{[Ms]:$e(e??"langchain"),[Jt]:n,[Be]:$e(t),[Y]:_r,...mE(r,o,s)}}function gE(e,t,n,r,o){const s=o?.ls_provider,i=r?.model??o?.ls_model_name??"unknown",a=Gf(s,i,"pipeline",e,r,o);if(n&&Array.isArray(t)&&t.length>0){tt(a,ir,t.length);const c=t.map(u=>({role:"user",content:u}));tt(a,ar,$e(c))}return a}function _E(e,t,n,r,o){const s=o?.ls_provider??e.id?.[2],i=r?.model??o?.ls_model_name??"unknown",a=Gf(s,i,"chat",e,r,o);if(n&&Array.isArray(t)&&t.length>0){const c=Ka(t.flat());tt(a,ir,c.length);const u=Fs(c);tt(a,ar,$e(u))}return a}function yE(e,t){const n=[],r=e.flat();for(const o of r){const s=o.message?.content;if(Array.isArray(s))for(const i of s){const a=i;a.type==="tool_use"&&n.push(a)}}n.length>0&&tt(t,St,$e(n))}function SE(e,t){if(!e)return;const n=e.tokenUsage,r=e.usage;if(n)We(t,_n,n.promptTokens),We(t,yn,n.completionTokens),We(t,Sn,n.totalTokens);else if(r){We(t,_n,r.input_tokens),We(t,yn,r.output_tokens);const o=Number(r.input_tokens),s=Number(r.output_tokens),i=(Number.isNaN(o)?0:o)+(Number.isNaN(s)?0:s);i>0&&We(t,Sn,i),r.cache_creation_input_tokens!==void 0&&We(t,XS,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&We(t,QS,r.cache_read_input_tokens)}}function bE(e,t){if(!e)return;const n={};if(Array.isArray(e.generations)){const u=e.generations.flat().map(d=>d.generationInfo?.finish_reason?d.generationInfo.finish_reason:d.generation_info?.finish_reason?d.generation_info.finish_reason:null).filter(d=>typeof d=="string");if(u.length>0&&tt(n,tn,$e(u)),yE(e.generations,n),t){const d=e.generations.flat().map(l=>l.text??l.message?.content).filter(l=>typeof l=="string");d.length>0&&tt(n,Qe,$e(d))}}SE(e.llmOutput,n);const r=e.llmOutput,s=e.generations?.[0]?.[0]?.message,i=r?.model_name??r?.model??s?.response_metadata?.model_name;i&&tt(n,Pt,i);const a=r?.id??s?.id;a&&tt(n,In,a);const c=r?.stop_reason??s?.response_metadata?.finish_reason;return c&&tt(n,YS,$e(c)),n}function hx(e={}){const t=e.recordInputs??!1,n=e.recordOutputs??!1,r=new Map,o=i=>{const a=r.get(i);a?.isRecording()&&(a.end(),r.delete(i))},s={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(i,a,c,u,d,l,f,p){const h=zu(l),g=gE(i,a,t,h,f),_=g[Be],y=g[Jt];Ht({name:`${y} ${_}`,op:"gen_ai.pipeline",attributes:{...g,[Te]:"gen_ai.pipeline"}},b=>(r.set(c,b),b))},handleChatModelStart(i,a,c,u,d,l,f,p){const h=zu(l),g=_E(i,a,t,h,f),_=g[Be],y=g[Jt];Ht({name:`${y} ${_}`,op:"gen_ai.chat",attributes:{...g,[Te]:"gen_ai.chat"}},b=>(r.set(c,b),b))},handleLLMEnd(i,a,c,u,d){const l=r.get(a);if(l?.isRecording()){const f=bE(i,n);f&&l.setAttributes(f),o(a)}},handleLLMError(i,a){const c=r.get(a);c?.isRecording()&&(c.setStatus({code:Z,message:"llm_error"}),o(a)),me(i,{mechanism:{handled:!1,type:`${_r}.llm_error_handler`}})},handleChainStart(i,a,c,u){const d=i.name||"unknown_chain",l={[Y]:"auto.ai.langchain","langchain.chain.name":d};t&&(l["langchain.chain.inputs"]=JSON.stringify(a)),Ht({name:`chain ${d}`,op:"gen_ai.invoke_agent",attributes:{...l,[Te]:"gen_ai.invoke_agent"}},f=>(r.set(c,f),f))},handleChainEnd(i,a){const c=r.get(a);c?.isRecording()&&(n&&c.setAttributes({"langchain.chain.outputs":JSON.stringify(i)}),o(a))},handleChainError(i,a){const c=r.get(a);c?.isRecording()&&(c.setStatus({code:Z,message:"chain_error"}),o(a)),me(i,{mechanism:{handled:!1,type:`${_r}.chain_error_handler`}})},handleToolStart(i,a,c,u){const d=i.name||"unknown_tool",l={[Y]:_r,"gen_ai.tool.name":d};t&&(l["gen_ai.tool.input"]=a),Ht({name:`execute_tool ${d}`,op:"gen_ai.execute_tool",attributes:{...l,[Te]:"gen_ai.execute_tool"}},f=>(r.set(c,f),f))},handleToolEnd(i,a){const c=r.get(a);c?.isRecording()&&(n&&c.setAttributes({"gen_ai.tool.output":JSON.stringify(i)}),o(a))},handleToolError(i,a){const c=r.get(a);c?.isRecording()&&(c.setStatus({code:Z,message:"tool_error"}),o(a)),me(i,{mechanism:{handled:!1,type:`${_r}.tool_error_handler`}})},copy(){return s},toJSON(){return{lc:1,type:"not_implemented",id:s.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:s.lc_id}}};return s}const Vf="auto.ai.langgraph";function EE(e){if(!e||e.length===0)return null;const t=[];for(const n of e)if(n&&typeof n=="object"){const r=n.tool_calls;r&&Array.isArray(r)&&t.push(...r)}return t.length>0?t:null}function TE(e){const t=e;let n=0,r=0,o=0;if(t.usage_metadata&&typeof t.usage_metadata=="object"){const s=t.usage_metadata;return typeof s.input_tokens=="number"&&(n=s.input_tokens),typeof s.output_tokens=="number"&&(r=s.output_tokens),typeof s.total_tokens=="number"&&(o=s.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:o}}if(t.response_metadata&&typeof t.response_metadata=="object"){const s=t.response_metadata;if(s.tokenUsage&&typeof s.tokenUsage=="object"){const i=s.tokenUsage;typeof i.promptTokens=="number"&&(n=i.promptTokens),typeof i.completionTokens=="number"&&(r=i.completionTokens),typeof i.totalTokens=="number"&&(o=i.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:o}}function vE(e,t){const n=t;if(n.response_metadata&&typeof n.response_metadata=="object"){const r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&e.setAttribute(Pt,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&e.setAttribute(tn,[r.finish_reason])}}function IE(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;const t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(n=>({name:n.lc_kwargs?.name,description:n.lc_kwargs?.description,schema:n.lc_kwargs?.schema}))}function wE(e,t,n){const o=n?.messages;if(!o||!Array.isArray(o))return;const s=t?.length??0,i=o.length>s?o.slice(s):[];if(i.length===0)return;const a=EE(i);a&&e.setAttribute(St,JSON.stringify(a));const c=Ka(i);e.setAttribute(Qe,JSON.stringify(c));let u=0,d=0,l=0;for(const f of i){const p=TE(f);u+=p.inputTokens,d+=p.outputTokens,l+=p.totalTokens,vE(e,f)}u>0&&e.setAttribute(_n,u),d>0&&e.setAttribute(yn,d),l>0&&e.setAttribute(Sn,l)}function kE(e,t){return new Proxy(e,{apply(n,r,o){return en({op:"gen_ai.create_agent",name:"create_agent",attributes:{[Y]:Vf,[Te]:"gen_ai.create_agent",[Jt]:"create_agent"}},s=>{try{const i=Reflect.apply(n,r,o),a=o.length>0?o[0]:{};a?.name&&typeof a.name=="string"&&(s.setAttribute(Of,a.name),s.updateName(`create_agent ${a.name}`));const c=i.invoke;return c&&typeof c=="function"&&(i.invoke=RE(c.bind(i),i,a,t)),i}catch(i){throw s.setStatus({code:Z,message:"internal_error"}),me(i,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),i}})}})}function RE(e,t,n,r){return new Proxy(e,{apply(o,s,i){return en({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[Y]:Vf,[Te]:ZS,[Jt]:"invoke_agent"}},async a=>{try{const c=n?.name;c&&typeof c=="string"&&(a.setAttribute(KS,c),a.setAttribute(Of,c),a.updateName(`invoke_agent ${c}`));const l=(i.length>1?i[1]:void 0)?.configurable?.thread_id;l&&typeof l=="string"&&a.setAttribute(za,l);const f=IE(t);f&&a.setAttribute(Ls,JSON.stringify(f));const p=r.recordInputs,h=r.recordOutputs,g=i.length>0?i[0].messages??[]:[];if(g&&p){const y=Ka(g),b=Fs(y);a.setAttributes({[ar]:JSON.stringify(b),[ir]:y.length})}const _=await Reflect.apply(o,s,i);return h&&wE(a,g??null,_),_}catch(c){throw a.setStatus({code:Z,message:"internal_error"}),me(c,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),c}})}})}function mx(e,t){const n=t||{};return e.compile=kE(e.compile.bind(e),n),e}function Jf(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const qn=L;function CE(){return"history"in qn&&!!qn.history}function AE(){if(!("fetch"in qn))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function zi(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Yf(){if(typeof EdgeRuntime=="string")return!0;if(!AE())return!1;if(zi(qn.fetch))return!0;let e=!1;const t=qn.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=zi(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){w&&m.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function xE(){return"ReportingObserver"in qn}function Xa(e,t){const n="fetch";Kt(n,e),Xt(n,()=>Kf(void 0,t))}function ME(e){const t="fetch-body-resolved";Kt(t,e),Xt(t,()=>Kf(OE))}function Kf(e,t=!1){t&&!Yf()||Re(L,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:i}=PE(r),a={args:r,fetchData:{method:s,url:i},startTimestamp:fe()*1e3,virtualError:o,headers:LE(r)};return e||Ke("fetch",{...a}),n.apply(L,r).then(async c=>(e?e(c):Ke("fetch",{...a,endTimestamp:fe()*1e3,response:c}),c),c=>{Ke("fetch",{...a,endTimestamp:fe()*1e3,error:c}),pt(c)&&c.stack===void 0&&(c.stack=o.stack,Le(c,"framesToPop",1));const d=R()?.getOptions().enhanceFetchErrorMessages??"always";if(d!==!1&&c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{const p=new URL(a.fetchData.url).host;d==="always"?c.message=`${c.message} (${p})`:Le(c,"__sentry_fetch_url_host__",p)}catch{}throw c})}})}async function NE(e,t){if(e?.body){const n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let s=!0;for(;s;){let i;try{i=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:a}=await r.read();clearTimeout(i),a&&(t(),s=!1)}catch{s=!1}finally{clearTimeout(i)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function OE(e){let t;try{t=e.clone()}catch{return}NE(t,()=>{Ke("fetch-body-resolved",{endTimestamp:fe()*1e3,response:e})})}function Ao(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Gu(e){return typeof e=="string"?e:e?Ao(e,"url")?e.url:e.toString?e.toString():"":""}function PE(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Gu(n),method:Ao(r,"method")?String(r.method).toUpperCase():ya(n)&&Ao(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Gu(t),method:Ao(t,"method")?String(t.method).toUpperCase():"GET"}}function LE(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(ya(t))return new Headers(t.headers)}catch{}}function DE(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function FE(){return"npm"}function $E(){return!DE()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function rs(){return typeof window<"u"&&(!$E()||BE())}function BE(){return L.process?.type==="renderer"}const nt=L,ae=nt.document,yr=nt.navigator,Xf="Report a Bug",UE="Cancel",HE="Send Bug Report",WE="Confirm",jE="Report a Bug",qE="your.email@example.org",zE="Email",GE="What's the bug? What did you expect?",VE="Description",JE="Your Name",YE="Name",KE="Thank you for your report!",XE="(required)",QE="Add a screenshot",ZE="Remove screenshot",eT="Highlight",tT="Hide",nT="Remove",rT="widget",oT="api",sT=5e3,iT=(e,t={includeReplay:!0})=>{if(!e.message)throw new Error("Unable to submit feedback with empty message");const n=R();if(!n)throw new Error("No client setup, cannot send feedback.");e.tags&&Object.keys(e.tags).length&&z().setTags(e.tags);const r=RS({source:oT,url:Tn(),...e},t);return new Promise((o,s)=>{const i=setTimeout(()=>s("Unable to determine if Feedback was correctly sent."),3e4),a=n.on("afterSendEvent",(c,u)=>{if(c.event_id===r)return clearTimeout(i),a(),u?.statusCode&&u.statusCode>=200&&u.statusCode<300?o(r):u?.statusCode===403?s("Unable to send feedback. This could be because this domain is not in your list of allowed domains."):s("Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.")})})},xo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function aT(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(yr.userAgent)||/Macintosh/i.test(yr.userAgent)&&yr.maxTouchPoints&&yr.maxTouchPoints>1||!isSecureContext)}function io(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{t.onFormOpen?.(),e.onFormOpen?.()},onFormClose:()=>{t.onFormClose?.(),e.onFormClose?.()},onSubmitSuccess:(n,r)=>{t.onSubmitSuccess?.(n,r),e.onSubmitSuccess?.(n,r)},onSubmitError:n=>{t.onSubmitError?.(n),e.onSubmitError?.(n)},onFormSubmitted:()=>{t.onFormSubmitted?.(),e.onFormSubmitted?.()},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function cT(e){const t=ae.createElement("style");return t.textContent=`
19
- .widget__actor {
20
- position: fixed;
21
- z-index: var(--z-index);
22
- margin: var(--page-margin);
23
- inset: var(--actor-inset);
24
-
25
- display: flex;
26
- align-items: center;
27
- gap: 8px;
28
- padding: 16px;
29
-
30
- font-family: inherit;
31
- font-size: var(--font-size);
32
- font-weight: 600;
33
- line-height: 1.14em;
34
- text-decoration: none;
35
-
36
- background: var(--actor-background, var(--background));
37
- border-radius: var(--actor-border-radius, 1.7em/50%);
38
- border: var(--actor-border, var(--border));
39
- box-shadow: var(--actor-box-shadow, var(--box-shadow));
40
- color: var(--actor-color, var(--foreground));
41
- fill: var(--actor-color, var(--foreground));
42
- cursor: pointer;
43
- opacity: 1;
44
- transition: transform 0.2s ease-in-out;
45
- transform: translate(0, 0) scale(1);
46
- }
47
- .widget__actor[aria-hidden="true"] {
48
- opacity: 0;
49
- pointer-events: none;
50
- visibility: hidden;
51
- transform: translate(0, 16px) scale(0.98);
52
- }
53
-
54
- .widget__actor:hover {
55
- background: var(--actor-hover-background, var(--background));
56
- filter: var(--interactive-filter);
57
- }
58
-
59
- .widget__actor svg {
60
- width: 1.14em;
61
- height: 1.14em;
62
- }
63
-
64
- @media (max-width: 600px) {
65
- .widget__actor span {
66
- display: none;
67
- }
68
- }
69
- `,e&&t.setAttribute("nonce",e),t}function ze(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}const Rn=20,uT="http://www.w3.org/2000/svg";function lT(){const e=a=>nt.document.createElementNS(uT,a),t=ze(e("svg"),{width:`${Rn}`,height:`${Rn}`,viewBox:`0 0 ${Rn} ${Rn}`,fill:"var(--actor-color, var(--foreground))"}),n=ze(e("g"),{clipPath:"url(#clip0_57_80)"}),r=ze(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});t.appendChild(n).appendChild(r);const o=e("defs"),s=ze(e("clipPath"),{id:"clip0_57_80"}),i=ze(e("rect"),{width:`${Rn}`,height:`${Rn}`,fill:"white"});return s.appendChild(i),o.appendChild(s),t.appendChild(o).appendChild(s).appendChild(i),t}function dT({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const o=ae.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=t||e||Xf,o.appendChild(lT()),e){const i=ae.createElement("span");i.appendChild(ae.createTextNode(e)),o.appendChild(i)}const s=cT(r);return{el:o,appendToDom(){n.appendChild(s),n.appendChild(o)},removeFromDom(){o.remove(),s.remove()},show(){o.ariaHidden="false"},hide(){o.ariaHidden="true"}}}const Qf="rgba(88, 74, 192, 1)",fT={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:Qf,successColor:"#268d75",errorColor:"#df3338",border:"1.5px solid rgba(41, 35, 47, 0.13)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(95%)"},Vu={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:Qf,successColor:"#2da98c",errorColor:"#f55459",border:"1.5px solid rgba(235, 230, 239, 0.15)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(150%)"};function Ju(e){return`
70
- --foreground: ${e.foreground};
71
- --background: ${e.background};
72
- --accent-foreground: ${e.accentForeground};
73
- --accent-background: ${e.accentBackground};
74
- --success-color: ${e.successColor};
75
- --error-color: ${e.errorColor};
76
- --border: ${e.border};
77
- --box-shadow: ${e.boxShadow};
78
- --outline: ${e.outline};
79
- --interactive-filter: ${e.interactiveFilter};
80
- `}function pT({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const o=ae.createElement("style");return o.textContent=`
81
- :host {
82
- --font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
83
- --font-size: 14px;
84
- --z-index: 100000;
85
-
86
- --page-margin: 16px;
87
- --inset: auto 0 0 auto;
88
- --actor-inset: var(--inset);
89
-
90
- font-family: var(--font-family);
91
- font-size: var(--font-size);
92
-
93
- ${e!=="system"?`color-scheme: only ${e};`:""}
94
-
95
- ${Ju(e==="dark"?{...Vu,...t}:{...fT,...n})}
96
- }
97
-
98
- ${e==="system"?`
99
- @media (prefers-color-scheme: dark) {
100
- :host {
101
- color-scheme: only dark;
102
-
103
- ${Ju({...Vu,...t})}
104
- }
105
- }`:""}
106
- `,r&&o.setAttribute("nonce",r),o}const Zf=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>(({id:o="sentry-feedback",autoInject:s=!0,showBranding:i=!0,isEmailRequired:a=!1,isNameRequired:c=!1,showEmail:u=!0,showName:d=!0,enableScreenshot:l=!0,useSentryUser:f={email:"email",name:"username"},tags:p,styleNonce:h,scriptNonce:g,colorScheme:_="system",themeLight:y={},themeDark:b={},addScreenshotButtonLabel:P=QE,cancelButtonLabel:A=UE,confirmButtonLabel:H=WE,emailLabel:N=zE,emailPlaceholder:S=qE,formTitle:C=jE,isRequiredLabel:F=XE,messageLabel:E=VE,messagePlaceholder:x=GE,nameLabel:k=YE,namePlaceholder:M=JE,removeScreenshotButtonLabel:O=ZE,submitButtonLabel:ee=HE,successMessageText:K=KE,triggerLabel:ne=Xf,triggerAriaLabel:T="",highlightToolText:j=eT,hideToolText:I=tT,removeHighlightText:G=nT,onFormOpen:se,onFormClose:re,onSubmitSuccess:ye,onSubmitError:xe,onFormSubmitted:Lt}={})=>{const Me={id:o,autoInject:s,showBranding:i,isEmailRequired:a,isNameRequired:c,showEmail:u,showName:d,enableScreenshot:l,useSentryUser:f,tags:p,styleNonce:h,scriptNonce:g,colorScheme:_,themeDark:b,themeLight:y,triggerLabel:ne,triggerAriaLabel:T,cancelButtonLabel:A,submitButtonLabel:ee,confirmButtonLabel:H,formTitle:C,emailLabel:N,emailPlaceholder:S,messageLabel:E,messagePlaceholder:x,nameLabel:k,namePlaceholder:M,successMessageText:K,isRequiredLabel:F,addScreenshotButtonLabel:P,removeScreenshotButtonLabel:O,highlightToolText:j,hideToolText:I,removeHighlightText:G,onFormClose:re,onFormOpen:se,onSubmitError:xe,onSubmitSuccess:ye,onFormSubmitted:Lt};let De=null,ut=[];const Dt=ie=>{if(!De){const pe=ae.createElement("div");pe.id=String(ie.id),ae.body.appendChild(pe),De=pe.attachShadow({mode:"open"}),De.appendChild(pT(ie))}return De},lr=async ie=>{const pe=ie.enableScreenshot&&aT();let Ve,we;try{Ve=(t?t():await e("feedbackModalIntegration",g))(),du(Ve)}catch{throw xo&&m.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{const lt=pe?n?n():await e("feedbackScreenshotIntegration",g):void 0;lt&&(we=lt(),du(we))}catch{xo&&m.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const Ce=Ve.createDialog({options:{...ie,onFormClose:()=>{Ce?.close(),ie.onFormClose?.()},onFormSubmitted:()=>{Ce?.close(),ie.onFormSubmitted?.()}},screenshotIntegration:we,sendFeedback:iT,shadow:Dt(ie)});return Ce},to=(ie,pe={})=>{const Ve=io(Me,pe),we=typeof ie=="string"?ae.querySelector(ie):typeof ie.addEventListener=="function"?ie:null;if(!we)throw xo&&m.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let Ce=null;const lt=async()=>{Ce||(Ce=await lr({...Ve,onFormSubmitted:()=>{Ce?.removeFromDom(),Ve.onFormSubmitted?.()}})),Ce.appendToDom(),Ce.open()};we.addEventListener("click",lt);const X=()=>{ut=ut.filter(He=>He!==X),Ce?.removeFromDom(),Ce=null,we.removeEventListener("click",lt)};return ut.push(X),X},dr=(ie={})=>{const pe=io(Me,ie),Ve=Dt(pe),we=dT({triggerLabel:pe.triggerLabel,triggerAriaLabel:pe.triggerAriaLabel,shadow:Ve,styleNonce:h});return to(we.el,{...pe,onFormOpen(){we.hide()},onFormClose(){we.show()},onFormSubmitted(){we.show()}}),we};return{name:"Feedback",setupOnce(){!rs()||!Me.autoInject||(ae.readyState==="loading"?ae.addEventListener("DOMContentLoaded",()=>dr().appendToDom()):dr().appendToDom())},attachTo:to,createWidget(ie={}){const pe=dr(io(Me,ie));return pe.appendToDom(),pe},async createForm(ie={}){return lr(io(Me,ie))},remove(){De&&(De.parentElement?.remove(),De=null),ut.forEach(ie=>ie()),ut=[]}}});function gx(){return R()?.getIntegrationByName("Feedback")}var Bs,ue,ep,sn,Yu,tp,Gi,Ar={},Qa=[],hT=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Za=Array.isArray;function Wt(e,t){for(var n in t)e[n]=t[n];return e}function np(e){var t=e.parentNode;t&&t.removeChild(e)}function J(e,t,n){var r,o,s,i={};for(s in t)s=="key"?r=t[s]:s=="ref"?o=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?Bs.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)i[s]===void 0&&(i[s]=e.defaultProps[s]);return Mo(e,i,r,o,null)}function Mo(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++ep,__i:-1,__u:0};return o==null&&ue.vnode!=null&&ue.vnode(s),s}function qr(e){return e.children}function No(e,t){this.props=e,this.context=t}function zn(e,t){if(t==null)return e.__?zn(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?zn(e):null}function mT(e,t,n){var r,o=e.__v,s=o.__e,i=e.__P;if(i)return(r=Wt({},o)).__v=o.__v+1,ue.vnode&&ue.vnode(r),ec(i,r,o,e.__n,i.ownerSVGElement!==void 0,32&o.__u?[s]:null,t,s??zn(o),!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=s&&rp(r),r}function rp(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return rp(e)}}function Ku(e){(!e.__d&&(e.__d=!0)&&sn.push(e)&&!os.__r++||Yu!==ue.debounceRendering)&&((Yu=ue.debounceRendering)||tp)(os)}function os(){var e,t,n,r=[],o=[];for(sn.sort(Gi);e=sn.shift();)e.__d&&(n=sn.length,t=mT(e,r,o)||t,n===0||sn.length>n?(Vi(r,t,o),o.length=r.length=0,t=void 0,sn.sort(Gi)):t&&ue.__c&&ue.__c(t,Qa));t&&Vi(r,t,o),os.__r=0}function op(e,t,n,r,o,s,i,a,c,u,d){var l,f,p,h,g,_=r&&r.__k||Qa,y=t.length;for(n.__d=c,gT(n,t,_),c=n.__d,l=0;l<y;l++)(p=n.__k[l])!=null&&typeof p!="boolean"&&typeof p!="function"&&(f=p.__i===-1?Ar:_[p.__i]||Ar,p.__i=l,ec(e,p,f,o,s,i,a,c,u,d),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&tc(f.ref,null,p),d.push(p.ref,p.__c||h,p)),g==null&&h!=null&&(g=h),65536&p.__u||f.__k===p.__k?c=sp(p,c,e):typeof p.type=="function"&&p.__d!==void 0?c=p.__d:h&&(c=h.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=g}function gT(e,t,n){var r,o,s,i,a,c=t.length,u=n.length,d=u,l=0;for(e.__k=[],r=0;r<c;r++)(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Mo(null,o,null,null,o):Za(o)?Mo(qr,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Mo(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,a=_T(o,n,i=r+l,d),o.__i=a,s=null,a!==-1&&(d--,(s=n[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&l--,typeof o.type!="function"&&(o.__u|=65536)):a!==i&&(a===i+1?l++:a>i?d>c-i?l+=a-i:l--:l=a<i&&a==i-1?a-i:0,a!==r+l&&(o.__u|=65536))):(s=n[r])&&s.key==null&&s.__e&&(s.__e==e.__d&&(e.__d=zn(s)),Ji(s,s,!1),n[r]=null,d--);if(d)for(r=0;r<u;r++)(s=n[r])!=null&&(131072&s.__u)==0&&(s.__e==e.__d&&(e.__d=zn(s)),Ji(s,s))}function sp(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=sp(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function _T(e,t,n,r){var o=e.key,s=e.type,i=n-1,a=n+1,c=t[n];if(c===null||c&&o==c.key&&s===c.type)return n;if(r>(c!=null&&(131072&c.__u)==0?1:0))for(;i>=0||a<t.length;){if(i>=0){if((c=t[i])&&(131072&c.__u)==0&&o==c.key&&s===c.type)return i;i--}if(a<t.length){if((c=t[a])&&(131072&c.__u)==0&&o==c.key&&s===c.type)return a;a++}}return-1}function Xu(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||hT.test(t)?n:n+"px"}function ao(e,t,n,r,o){var s;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Xu(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Xu(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")s=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,s?Zu:Qu,s)):e.removeEventListener(t,s?Zu:Qu,s);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Qu(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(ue.event?ue.event(e):e)}}function Zu(e){if(this.l)return this.l[e.type+!0](ue.event?ue.event(e):e)}function ec(e,t,n,r,o,s,i,a,c,u){var d,l,f,p,h,g,_,y,b,P,A,H,N,S,C,F=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=t.__e=n.__e]),(d=ue.__b)&&d(t);e:if(typeof F=="function")try{if(y=t.props,b=(d=F.contextType)&&r[d.__c],P=d?b?b.props.value:d.__:r,n.__c?_=(l=t.__c=n.__c).__=l.__E:("prototype"in F&&F.prototype.render?t.__c=l=new F(y,P):(t.__c=l=new No(y,P),l.constructor=F,l.render=ST),b&&b.sub(l),l.props=y,l.state||(l.state={}),l.context=P,l.__n=r,f=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),F.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Wt({},l.__s)),Wt(l.__s,F.getDerivedStateFromProps(y,l.__s))),p=l.props,h=l.state,l.__v=t,f)F.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(F.getDerivedStateFromProps==null&&y!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(y,P),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(y,l.__s,P)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=y,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(E){E&&(E.__=t)}),A=0;A<l._sb.length;A++)l.__h.push(l._sb[A]);l._sb=[],l.__h.length&&i.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(y,l.__s,P),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,h,g)})}if(l.context=P,l.props=y,l.__P=e,l.__e=!1,H=ue.__r,N=0,"prototype"in F&&F.prototype.render){for(l.state=l.__s,l.__d=!1,H&&H(t),d=l.render(l.props,l.state,l.context),S=0;S<l._sb.length;S++)l.__h.push(l._sb[S]);l._sb=[]}else do l.__d=!1,H&&H(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++N<25);l.state=l.__s,l.getChildContext!=null&&(r=Wt(Wt({},r),l.getChildContext())),f||l.getSnapshotBeforeUpdate==null||(g=l.getSnapshotBeforeUpdate(p,h)),op(e,Za(C=d!=null&&d.type===qr&&d.key==null?d.props.children:d)?C:[C],t,n,r,o,s,i,a,c,u),l.base=t.__e,t.__u&=-161,l.__h.length&&i.push(l),_&&(l.__E=l.__=null)}catch(E){t.__v=null,c||s!=null?(t.__e=a,t.__u|=c?160:32,s[s.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),ue.__e(E,t,n)}else s==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=yT(n.__e,t,n,r,o,s,i,c,u);(d=ue.diffed)&&d(t)}function Vi(e,t,n){for(var r=0;r<n.length;r++)tc(n[r],n[++r],n[++r]);ue.__c&&ue.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(s){s.call(o)})}catch(s){ue.__e(s,o.__v)}})}function yT(e,t,n,r,o,s,i,a,c){var u,d,l,f,p,h,g,_=n.props,y=t.props,b=t.type;if(b==="svg"&&(o=!0),s!=null){for(u=0;u<s.length;u++)if((p=s[u])&&"setAttribute"in p==!!b&&(b?p.localName===b:p.nodeType===3)){e=p,s[u]=null;break}}if(e==null){if(b===null)return document.createTextNode(y);e=o?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,y.is&&y),s=null,a=!1}if(b===null)_===y||a&&e.data===y||(e.data=y);else{if(s=s&&Bs.call(e.childNodes),_=n.props||Ar,!a&&s!=null)for(_={},u=0;u<e.attributes.length;u++)_[(p=e.attributes[u]).name]=p.value;for(u in _)p=_[u],u=="children"||(u=="dangerouslySetInnerHTML"?l=p:u==="key"||u in y||ao(e,u,null,p,o));for(u in y)p=y[u],u=="children"?f=p:u=="dangerouslySetInnerHTML"?d=p:u=="value"?h=p:u=="checked"?g=p:u==="key"||a&&typeof p!="function"||_[u]===p||ao(e,u,p,_[u],o);if(d)a||l&&(d.__html===l.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(l&&(e.innerHTML=""),op(e,Za(f)?f:[f],t,n,r,o&&b!=="foreignObject",s,i,s?s[0]:n.__k&&zn(n,0),a,c),s!=null)for(u=s.length;u--;)s[u]!=null&&np(s[u]);a||(u="value",h!==void 0&&(h!==e[u]||b==="progress"&&!h||b==="option"&&h!==_[u])&&ao(e,u,h,_[u],!1),u="checked",g!==void 0&&g!==e[u]&&ao(e,u,g,_[u],!1))}return e}function tc(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){ue.__e(r,n)}}function Ji(e,t,n){var r,o;if(ue.unmount&&ue.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||tc(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){ue.__e(s,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Ji(r[o],t,n||typeof e.type!="function");n||e.__e==null||np(e.__e),e.__=e.__e=e.__d=void 0}function ST(e,t,n){return this.constructor(e,n)}function bT(e,t,n){var r,o,s,i;ue.__&&ue.__(e,t),o=(r=!1)?null:t.__k,s=[],i=[],ec(t,e=t.__k=J(qr,null,[e]),o||Ar,Ar,t.ownerSVGElement!==void 0,o?null:t.firstChild?Bs.call(t.childNodes):null,s,o?o.__e:t.firstChild,r,i),e.__d=void 0,Vi(s,e,i)}Bs=Qa.slice,ue={__e:function(e,t,n,r){for(var o,s,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((s=o.constructor)&&s.getDerivedStateFromError!=null&&(o.setState(s.getDerivedStateFromError(e)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(a){e=a}throw e}},ep=0,No.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Wt({},this.state),typeof e=="function"&&(e=e(Wt({},n),this.props)),e&&Wt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ku(this))},No.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ku(this))},No.prototype.render=qr,sn=[],tp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Gi=function(e,t){return e.__v.__b-t.__v.__b},os.__r=0;var Mt,ce,li,el,Gn=0,ip=[],Oo=[],he=ue,tl=he.__b,nl=he.__r,rl=he.diffed,ol=he.__c,sl=he.unmount,il=he.__;function wn(e,t){he.__h&&he.__h(ce,e,Gn||t),Gn=0;var n=ce.__H||(ce.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Oo}),n.__[e]}function an(e){return Gn=1,ap(up,e)}function ap(e,t,n){var r=wn(Mt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):up(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=ce,!ce.u)){var o=function(a,c,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(f){return!!f.__c});if(d.every(function(f){return!f.__N}))return!s||s.call(this,a,c,u);var l=!1;return d.forEach(function(f){if(f.__N){var p=f.__[0];f.__=f.__N,f.__N=void 0,p!==f.__[0]&&(l=!0)}}),!(!l&&r.__c.props===a)&&(!s||s.call(this,a,c,u))};ce.u=!0;var s=ce.shouldComponentUpdate,i=ce.componentWillUpdate;ce.componentWillUpdate=function(a,c,u){if(this.__e){var d=s;s=void 0,o(a,c,u),s=d}i&&i.call(this,a,c,u)},ce.shouldComponentUpdate=o}return r.__N||r.__}function ET(e,t){var n=wn(Mt++,3);!he.__s&&nc(n.__H,t)&&(n.__=e,n.i=t,ce.__H.__h.push(n))}function cp(e,t){var n=wn(Mt++,4);!he.__s&&nc(n.__H,t)&&(n.__=e,n.i=t,ce.__h.push(n))}function TT(e){return Gn=5,zr(function(){return{current:e}},[])}function vT(e,t,n){Gn=6,cp(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function zr(e,t){var n=wn(Mt++,7);return nc(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function $n(e,t){return Gn=8,zr(function(){return e},t)}function IT(e){var t=ce.context[e.__c],n=wn(Mt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(ce)),t.props.value):e.__}function wT(e,t){he.useDebugValue&&he.useDebugValue(t?t(e):e)}function kT(e){var t=wn(Mt++,10),n=an();return t.__=e,ce.componentDidCatch||(ce.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function RT(){var e=wn(Mt++,11);if(!e.__){for(var t=ce.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function CT(){for(var e;e=ip.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Po),e.__H.__h.forEach(Yi),e.__H.__h=[]}catch(t){e.__H.__h=[],he.__e(t,e.__v)}}he.__b=function(e){ce=null,tl&&tl(e)},he.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),il&&il(e,t)},he.__r=function(e){nl&&nl(e),Mt=0;var t=(ce=e.__c).__H;t&&(li===ce?(t.__h=[],ce.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Oo,n.__N=n.i=void 0})):(t.__h.forEach(Po),t.__h.forEach(Yi),t.__h=[],Mt=0)),li=ce},he.diffed=function(e){rl&&rl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ip.push(t)!==1&&el===he.requestAnimationFrame||((el=he.requestAnimationFrame)||AT)(CT)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Oo&&(n.__=n.__V),n.i=void 0,n.__V=Oo})),li=ce=null},he.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Po),n.__h=n.__h.filter(function(r){return!r.__||Yi(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],he.__e(r,n.__v)}}),ol&&ol(e,t)},he.unmount=function(e){sl&&sl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Po(r)}catch(o){t=o}}),n.__H=void 0,t&&he.__e(t,n.__v))};var al=typeof requestAnimationFrame=="function";function AT(e){var t,n=function(){clearTimeout(r),al&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);al&&(t=requestAnimationFrame(n))}function Po(e){var t=ce,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ce=t}function Yi(e){var t=ce;e.__c=e.__(),ce=t}function nc(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function up(e,t){return typeof t=="function"?t(e):t}const xT=Object.defineProperty({__proto__:null,useCallback:$n,useContext:IT,useDebugValue:wT,useEffect:ET,useErrorBoundary:kT,useId:RT,useImperativeHandle:vT,useLayoutEffect:cp,useMemo:zr,useReducer:ap,useRef:TT,useState:an},Symbol.toStringTag,{value:"Module"}),MT="http://www.w3.org/2000/svg";function NT(){const e=r=>ae.createElementNS(MT,r),t=ze(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=ze(e("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});return t.appendChild(n),t}function OT({options:e}){const t=zr(()=>({__html:NT().outerHTML}),[]);return J("h2",{class:"dialog__header"},J("span",{class:"dialog__title"},e.formTitle),e.showBranding?J("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function PT(e,t){const n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}function di(e,t){const n=e.get(t);return typeof n=="string"?n.trim():""}function LT({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:s,onSubmitError:i,showEmail:a,showName:c,screenshotInput:u}){const{tags:d,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:h,emailPlaceholder:g,isEmailRequired:_,isNameRequired:y,messageLabel:b,messagePlaceholder:P,nameLabel:A,namePlaceholder:H,submitButtonLabel:N,isRequiredLabel:S}=e,[C,F]=an(!1),[E,x]=an(null),[k,M]=an(!1),O=u?.input,[ee,K]=an(null),ne=$n(I=>{K(I),M(!1)},[]),T=$n(I=>{const G=PT(I,{emailLabel:h,isEmailRequired:_,isNameRequired:y,messageLabel:b,nameLabel:A});return G.length>0?x(`Please enter in the following required fields: ${G.join(", ")}`):x(null),G.length===0},[h,_,y,b,A]),j=$n(async I=>{F(!0);try{if(I.preventDefault(),!(I.target instanceof HTMLFormElement))return;const G=new FormData(I.target),se=await(u&&k?u.value():void 0),re={name:di(G,"name"),email:di(G,"email"),message:di(G,"message"),attachments:se?[se]:void 0};if(!T(re))return;try{const ye=await o({name:re.name,email:re.email,message:re.message,source:rT,tags:d},{attachments:re.attachments});s(re,ye)}catch(ye){xo&&m.error(ye),x(ye),i(ye)}}finally{F(!1)}},[u&&k,s,i]);return J("form",{class:"form",onSubmit:j},O&&k?J(O,{onError:ne}):null,J("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:C},J("div",{class:"form__top"},E?J("div",{class:"form__error-container"},E):null,c?J("label",{for:"name",class:"form__label"},J(fi,{label:A,isRequiredLabel:S,isRequired:y}),J("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:H,required:y,type:"text"})):J("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),a?J("label",{for:"email",class:"form__label"},J(fi,{label:h,isRequiredLabel:S,isRequired:_}),J("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:g,required:_,type:"email"})):J("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),J("label",{for:"message",class:"form__label"},J(fi,{label:b,isRequiredLabel:S,isRequired:!0}),J("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:P,required:!0,rows:5})),O?J("label",{for:"screenshot",class:"form__label"},J("button",{class:"btn btn--default",disabled:C,type:"button",onClick:()=>{K(null),M(I=>!I)}},k?f:l),ee?J("div",{class:"form__error-container"},ee.message):null):null),J("div",{class:"btn-group"},J("button",{class:"btn btn--primary",disabled:C,type:"submit"},N),J("button",{class:"btn btn--default",disabled:C,type:"button",onClick:r},p))))}function fi({label:e,isRequired:t,isRequiredLabel:n}){return J("span",{class:"form__label__text"},e,t&&J("span",{class:"form__label__text--required"},n))}const co=16,cl=17,DT="http://www.w3.org/2000/svg";function FT(){const e=c=>nt.document.createElementNS(DT,c),t=ze(e("svg"),{width:`${co}`,height:`${cl}`,viewBox:`0 0 ${co} ${cl}`,fill:"inherit"}),n=ze(e("g"),{clipPath:"url(#clip0_57_156)"}),r=ze(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),o=ze(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(o,r);const s=e("defs"),i=ze(e("clipPath"),{id:"clip0_57_156"}),a=ze(e("rect"),{width:`${co}`,height:`${co}`,fill:"white",transform:"translate(0 0.5)"});return i.appendChild(a),s.appendChild(i),t.appendChild(s).appendChild(i).appendChild(a),t}function $T({open:e,onFormSubmitted:t,...n}){const r=n.options,o=zr(()=>({__html:FT().outerHTML}),[]),[s,i]=an(null),a=$n(()=>{s&&(clearTimeout(s),i(null)),t()},[s]),c=$n((u,d)=>{n.onSubmitSuccess(u,d),i(setTimeout(()=>{t(),i(null)},sT))},[t]);return J(qr,null,s?J("div",{class:"success__position",onClick:a},J("div",{class:"success__content"},r.successMessageText,J("span",{class:"success__icon",dangerouslySetInnerHTML:o}))):J("dialog",{class:"dialog",onClick:r.onFormClose,open:e},J("div",{class:"dialog__position"},J("div",{class:"dialog__content",onClick:u=>{u.stopPropagation()}},J(OT,{options:r}),J(LT,{...n,onSubmitSuccess:c})))))}const BT=`
107
- .dialog {
108
- position: fixed;
109
- z-index: var(--z-index);
110
- margin: 0;
111
- inset: 0;
112
-
113
- display: flex;
114
- align-items: center;
115
- justify-content: center;
116
- padding: 0;
117
- height: 100vh;
118
- width: 100vw;
119
-
120
- color: var(--dialog-color, var(--foreground));
121
- fill: var(--dialog-color, var(--foreground));
122
- line-height: 1.75em;
123
-
124
- background-color: rgba(0, 0, 0, 0.05);
125
- border: none;
126
- inset: 0;
127
- opacity: 1;
128
- transition: opacity 0.2s ease-in-out;
129
- }
130
-
131
- .dialog__position {
132
- position: fixed;
133
- z-index: var(--z-index);
134
- inset: var(--dialog-inset);
135
- padding: var(--page-margin);
136
- display: flex;
137
- max-height: calc(100vh - (2 * var(--page-margin)));
138
- }
139
- @media (max-width: 600px) {
140
- .dialog__position {
141
- inset: var(--page-margin);
142
- padding: 0;
143
- }
144
- }
145
-
146
- .dialog__position:has(.editor) {
147
- inset: var(--page-margin);
148
- padding: 0;
149
- }
150
-
151
- .dialog:not([open]) {
152
- opacity: 0;
153
- pointer-events: none;
154
- visibility: hidden;
155
- }
156
- .dialog:not([open]) .dialog__content {
157
- transform: translate(0, -16px) scale(0.98);
158
- }
159
-
160
- .dialog__content {
161
- display: flex;
162
- flex-direction: column;
163
- gap: 16px;
164
- padding: var(--dialog-padding, 24px);
165
- max-width: 100%;
166
- width: 100%;
167
- max-height: 100%;
168
- overflow: auto;
169
-
170
- background: var(--dialog-background, var(--background));
171
- border-radius: var(--dialog-border-radius, 20px);
172
- border: var(--dialog-border, var(--border));
173
- box-shadow: var(--dialog-box-shadow, var(--box-shadow));
174
- transform: translate(0, 0) scale(1);
175
- transition: transform 0.2s ease-in-out;
176
- }
177
-
178
- `,UT=`
179
- .dialog__header {
180
- display: flex;
181
- gap: 4px;
182
- justify-content: space-between;
183
- font-weight: var(--dialog-header-weight, 600);
184
- margin: 0;
185
- }
186
- .dialog__title {
187
- align-self: center;
188
- width: var(--form-width, 272px);
189
- }
190
-
191
- @media (max-width: 600px) {
192
- .dialog__title {
193
- width: auto;
194
- }
195
- }
196
-
197
- .dialog__position:has(.editor) .dialog__title {
198
- width: auto;
199
- }
200
-
201
-
202
- .brand-link {
203
- display: inline-flex;
204
- }
205
- .brand-link:focus-visible {
206
- outline: var(--outline);
207
- }
208
- `,HT=`
209
- .form {
210
- display: flex;
211
- overflow: auto;
212
- flex-direction: row;
213
- gap: 16px;
214
- flex: 1 0;
215
- }
216
-
217
- .form fieldset {
218
- border: none;
219
- margin: 0;
220
- padding: 0;
221
- }
222
-
223
- .form__right {
224
- flex: 0 0 auto;
225
- display: flex;
226
- overflow: auto;
227
- flex-direction: column;
228
- justify-content: space-between;
229
- gap: 20px;
230
- width: var(--form-width, 100%);
231
- }
232
-
233
- .dialog__position:has(.editor) .form__right {
234
- width: var(--form-width, 272px);
235
- }
236
-
237
- .form__top {
238
- display: flex;
239
- flex-direction: column;
240
- gap: 8px;
241
- }
242
-
243
- .form__error-container {
244
- color: var(--error-color);
245
- fill: var(--error-color);
246
- }
247
-
248
- .form__label {
249
- display: flex;
250
- flex-direction: column;
251
- gap: 4px;
252
- margin: 0px;
253
- }
254
-
255
- .form__label__text {
256
- display: flex;
257
- gap: 4px;
258
- align-items: center;
259
- }
260
-
261
- .form__label__text--required {
262
- font-size: 0.85em;
263
- }
264
-
265
- .form__input {
266
- font-family: inherit;
267
- line-height: inherit;
268
- background: transparent;
269
- box-sizing: border-box;
270
- border: var(--input-border, var(--border));
271
- border-radius: var(--input-border-radius, 6px);
272
- color: var(--input-color, inherit);
273
- fill: var(--input-color, inherit);
274
- font-size: var(--input-font-size, inherit);
275
- font-weight: var(--input-font-weight, 500);
276
- padding: 6px 12px;
277
- }
278
-
279
- .form__input::placeholder {
280
- opacity: 0.65;
281
- color: var(--input-placeholder-color, inherit);
282
- filter: var(--interactive-filter);
283
- }
284
-
285
- .form__input:focus-visible {
286
- outline: var(--input-focus-outline, var(--outline));
287
- }
288
-
289
- .form__input--textarea {
290
- font-family: inherit;
291
- resize: vertical;
292
- }
293
-
294
- .error {
295
- color: var(--error-color);
296
- fill: var(--error-color);
297
- }
298
- `,WT=`
299
- .btn-group {
300
- display: grid;
301
- gap: 8px;
302
- }
303
-
304
- .btn {
305
- line-height: inherit;
306
- border: var(--button-border, var(--border));
307
- border-radius: var(--button-border-radius, 6px);
308
- cursor: pointer;
309
- font-family: inherit;
310
- font-size: var(--button-font-size, inherit);
311
- font-weight: var(--button-font-weight, 600);
312
- padding: var(--button-padding, 6px 16px);
313
- }
314
- .btn[disabled] {
315
- opacity: 0.6;
316
- pointer-events: none;
317
- }
318
-
319
- .btn--primary {
320
- color: var(--button-primary-color, var(--accent-foreground));
321
- fill: var(--button-primary-color, var(--accent-foreground));
322
- background: var(--button-primary-background, var(--accent-background));
323
- border: var(--button-primary-border, var(--border));
324
- border-radius: var(--button-primary-border-radius, 6px);
325
- font-weight: var(--button-primary-font-weight, 500);
326
- }
327
- .btn--primary:hover {
328
- color: var(--button-primary-hover-color, var(--accent-foreground));
329
- fill: var(--button-primary-hover-color, var(--accent-foreground));
330
- background: var(--button-primary-hover-background, var(--accent-background));
331
- filter: var(--interactive-filter);
332
- }
333
- .btn--primary:focus-visible {
334
- background: var(--button-primary-hover-background, var(--accent-background));
335
- filter: var(--interactive-filter);
336
- outline: var(--button-primary-focus-outline, var(--outline));
337
- }
338
-
339
- .btn--default {
340
- color: var(--button-color, var(--foreground));
341
- fill: var(--button-color, var(--foreground));
342
- background: var(--button-background, var(--background));
343
- border: var(--button-border, var(--border));
344
- border-radius: var(--button-border-radius, 6px);
345
- font-weight: var(--button-font-weight, 500);
346
- }
347
- .btn--default:hover {
348
- color: var(--button-color, var(--foreground));
349
- fill: var(--button-color, var(--foreground));
350
- background: var(--button-hover-background, var(--background));
351
- filter: var(--interactive-filter);
352
- }
353
- .btn--default:focus-visible {
354
- background: var(--button-hover-background, var(--background));
355
- filter: var(--interactive-filter);
356
- outline: var(--button-focus-outline, var(--outline));
357
- }
358
- `,jT=`
359
- .success__position {
360
- position: fixed;
361
- inset: var(--dialog-inset);
362
- padding: var(--page-margin);
363
- z-index: var(--z-index);
364
- }
365
- .success__content {
366
- background: var(--success-background, var(--background));
367
- border: var(--success-border, var(--border));
368
- border-radius: var(--success-border-radius, 1.7em/50%);
369
- box-shadow: var(--success-box-shadow, var(--box-shadow));
370
- font-weight: var(--success-font-weight, 600);
371
- color: var(--success-color);
372
- fill: var(--success-color);
373
- padding: 12px 24px;
374
- line-height: 1.75em;
375
-
376
- display: grid;
377
- align-items: center;
378
- grid-auto-flow: column;
379
- gap: 6px;
380
- cursor: default;
381
- }
382
-
383
- .success__icon {
384
- display: flex;
385
- }
386
- `;function qT(e){const t=ae.createElement("style");return t.textContent=`
387
- :host {
388
- --dialog-inset: var(--inset);
389
- }
390
-
391
- ${BT}
392
- ${UT}
393
- ${HT}
394
- ${WT}
395
- ${jT}
396
- `,e&&t.setAttribute("nonce",e),t}function zT(){const e=z().getUser(),t=Ie().getUser(),n=br().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}const GT=(()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{const o=r,s=e.useSentryUser,i=zT(),a=ae.createElement("div"),c=qT(e.styleNonce);let u="";const d={get el(){return a},appendToDom(){!o.contains(c)&&!o.contains(a)&&(o.appendChild(c),o.appendChild(a))},removeFromDom(){a.remove(),c.remove(),ae.body.style.overflow=u},open(){f(!0),e.onFormOpen?.(),R()?.emit("openFeedbackWidget"),u=ae.body.style.overflow,ae.body.style.overflow="hidden"},close(){f(!1),ae.body.style.overflow=u}},l=t?.createInput({h:J,hooks:xT,dialog:d,options:e}),f=p=>{bT(J($T,{options:e,screenshotInput:l,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(s&&i?.[s.name]||""),defaultEmail:String(s&&i?.[s.email]||""),onFormClose:()=>{f(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(h,g)=>{f(!1),e.onSubmitSuccess?.(h,g)},onSubmitError:h=>{e.onSubmitError?.(h)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:p}),a)};return d}}));function VT({h:e}){return function(){return e("svg",{"data-test-id":"icon-close",viewBox:"0 0 16 16",fill:"#2B2233",height:"25px",width:"25px"},e("circle",{r:"7",cx:"8",cy:"8",fill:"white"}),e("path",{strokeWidth:"1.5",d:"M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z"}),e("path",{strokeWidth:"1.5",d:"M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z"}),e("path",{strokeWidth:"1.5",d:"M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z"}))}}function JT(e){const t=ae.createElement("style"),n="#1A141F",r="#302735";return t.textContent=`
397
- .editor {
398
- display: flex;
399
- flex-grow: 1;
400
- flex-direction: column;
401
- }
402
-
403
- .editor__image-container {
404
- justify-items: center;
405
- padding: 15px;
406
- position: relative;
407
- height: 100%;
408
- border-radius: var(--menu-border-radius, 6px);
409
-
410
- background-color: ${n};
411
- background-image: repeating-linear-gradient(
412
- -145deg,
413
- transparent,
414
- transparent 8px,
415
- ${n} 8px,
416
- ${n} 11px
417
- ),
418
- repeating-linear-gradient(
419
- -45deg,
420
- transparent,
421
- transparent 15px,
422
- ${r} 15px,
423
- ${r} 16px
424
- );
425
- }
426
-
427
- .editor__canvas-container {
428
- width: 100%;
429
- height: 100%;
430
- position: relative;
431
- display: flex;
432
- align-items: center;
433
- justify-content: center;
434
- }
435
-
436
- .editor__canvas-container > * {
437
- object-fit: contain;
438
- position: absolute;
439
- }
440
-
441
- .editor__tool-container {
442
- padding-top: 8px;
443
- display: flex;
444
- justify-content: center;
445
- }
446
-
447
- .editor__tool-bar {
448
- display: flex;
449
- gap: 8px;
450
- }
451
-
452
- .editor__tool {
453
- display: flex;
454
- padding: 8px 12px;
455
- justify-content: center;
456
- align-items: center;
457
- border: var(--button-border, var(--border));
458
- border-radius: var(--button-border-radius, 6px);
459
- background: var(--button-background, var(--background));
460
- color: var(--button-color, var(--foreground));
461
- }
462
-
463
- .editor__tool--active {
464
- background: var(--button-primary-background, var(--accent-background));
465
- color: var(--button-primary-color, var(--accent-foreground));
466
- }
467
-
468
- .editor__rect {
469
- position: absolute;
470
- z-index: 2;
471
- }
472
-
473
- .editor__rect button {
474
- opacity: 0;
475
- position: absolute;
476
- top: -12px;
477
- right: -12px;
478
- cursor: pointer;
479
- padding: 0;
480
- z-index: 3;
481
- border: none;
482
- background: none;
483
- }
484
-
485
- .editor__rect:hover button {
486
- opacity: 1;
487
- }
488
- `,e&&t.setAttribute("nonce",e),t}function YT({h:e}){return function({action:n,setAction:r,options:o}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:`editor__tool ${n==="highlight"?"editor__tool--active":""}`,onClick:()=>{r(n==="highlight"?"":"highlight")}},o.highlightToolText),e("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},o.hideToolText)))}}function KT({hooks:e}){function t(){const[n,r]=e.useState(nt.devicePixelRatio??1);return e.useEffect(()=>{const o=()=>{r(nt.devicePixelRatio)},s=matchMedia(`(resolution: ${nt.devicePixelRatio}dppx)`);return s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:o,onAfterScreenshot:s,onError:i}){const a=t();e.useEffect(()=>{(async()=>{r();const u=await yr.mediaDevices.getDisplayMedia({video:{width:nt.innerWidth*a,height:nt.innerHeight*a},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=ae.createElement("video");await new Promise((l,f)=>{d.srcObject=u,d.onloadedmetadata=()=>{o(d,a),u.getTracks().forEach(p=>p.stop()),l()},d.play().catch(f)}),s()})().catch(i)},[])}}function XT(e,t,n){switch(e.type){case"highlight":{t.shadowColor="rgba(0, 0, 0, 0.7)",t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break}case"hide":t.fillStyle="rgb(0, 0, 0)",t.fillRect(e.x,e.y,e.w,e.h);break}}function $t(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function pi(e,t){$t(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function hi(e,t,n){$t(e,{alpha:!0},(r,o)=>{n.length&&(o.fillStyle="rgba(0, 0, 0, 0.25)",o.fillRect(0,0,r.width,r.height)),n.forEach(s=>{XT(s,o,t)})})}function QT({h:e,hooks:t,outputBuffer:n,dialog:r,options:o}){const s=KT({hooks:t}),i=YT({h:e}),a=VT({h:e}),c={__html:JT(o.styleNonce).innerText},u=r.el.style,d=({screenshot:l})=>{const[f,p]=t.useState("highlight"),[h,g]=t.useState([]),_=t.useRef(null),y=t.useRef(null),b=t.useRef(null),P=t.useRef(null),[A,H]=t.useState(1),N=t.useMemo(()=>{const k=ae.getElementById(o.id);if(!k)return"white";const M=getComputedStyle(k);return M.getPropertyValue("--button-primary-background")||M.getPropertyValue("--accent-background")},[o.id]);t.useLayoutEffect(()=>{const k=()=>{const M=_.current;M&&($t(l.canvas,{alpha:!1},O=>{const ee=Math.min(M.clientWidth/O.width,M.clientHeight/O.height);H(ee)}),(M.clientHeight===0||M.clientWidth===0)&&setTimeout(k,0))};return k(),nt.addEventListener("resize",k),()=>{nt.removeEventListener("resize",k)}},[l]);const S=t.useCallback((k,M)=>{$t(k,{alpha:!0},(O,ee)=>{ee.scale(M,M),O.width=l.canvas.width,O.height=l.canvas.height})},[l]);t.useEffect(()=>{S(y.current,l.dpi),pi(y.current,l.canvas)},[l]),t.useEffect(()=>{S(b.current,l.dpi),$t(b.current,{alpha:!0},(k,M)=>{M.clearRect(0,0,k.width,k.height)}),hi(b.current,N,h)},[h,N]),t.useEffect(()=>{S(n,l.dpi),pi(n,l.canvas),$t(ae.createElement("canvas"),{alpha:!0},(k,M)=>{M.scale(l.dpi,l.dpi),k.width=l.canvas.width,k.height=l.canvas.height,hi(k,N,h),pi(n,k)})},[h,l,N]);const C=k=>{if(!f||!P.current)return;const M=P.current.getBoundingClientRect(),O={type:f,x:k.offsetX/A,y:k.offsetY/A},ee=(T,j)=>{const I=(j.clientX-M.x)/A,G=(j.clientY-M.y)/A;return{type:T.type,x:Math.min(T.x,I),y:Math.min(T.y,G),w:Math.abs(I-T.x),h:Math.abs(G-T.y)}},K=T=>{$t(b.current,{alpha:!0},(j,I)=>{I.clearRect(0,0,j.width,j.height)}),hi(b.current,N,[...h,ee(O,T)])},ne=T=>{const j=ee(O,T);j.w*A>=1&&j.h*A>=1&&g(I=>[...I,j]),ae.removeEventListener("mousemove",K),ae.removeEventListener("mouseup",ne)};ae.addEventListener("mousemove",K),ae.addEventListener("mouseup",ne)},F=t.useCallback(k=>M=>{M.preventDefault(),M.stopPropagation(),g(O=>{const ee=[...O];return ee.splice(k,1),ee})},[]),E={width:`${l.canvas.width*A}px`,height:`${l.canvas.height*A}px`},x=k=>{k.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:o.styleNonce,dangerouslySetInnerHTML:c}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:_},e("canvas",{ref:y,id:"background",style:E}),e("canvas",{ref:b,id:"foreground",style:E}),e("div",{ref:P,onMouseDown:C,style:E},h.map((k,M)=>e("div",{key:M,class:"editor__rect",style:{top:`${k.y*A}px`,left:`${k.x*A}px`,width:`${k.w*A}px`,height:`${k.h*A}px`}},e("button",{"aria-label":o.removeHighlightText,onClick:F(M),onMouseDown:x,onMouseUp:x,type:"button"},e(a,null))))))),e(i,{options:o,action:f,setAction:p}))};return function({onError:f}){const[p,h]=t.useState();return s({onBeforeScreenshot:t.useCallback(()=>{u.display="none"},[]),onScreenshot:t.useCallback((g,_)=>{$t(ae.createElement("canvas"),{alpha:!1},(y,b)=>{b.scale(_,_),y.width=g.videoWidth,y.height=g.videoHeight,b.drawImage(g,0,0,y.width,y.height),h({canvas:y,dpi:_})}),n.width=g.videoWidth,n.height=g.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{u.display="block"},[]),onError:t.useCallback(g=>{u.display="block",f(g)},[])}),p?e(d,{screenshot:p}):e("div",null)}}const ZT=(()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const o=ae.createElement("canvas");return{input:QT({h:e,hooks:t,outputBuffer:o,dialog:n,options:r}),value:async()=>{const s=await new Promise(i=>{o.toBlob(i,"image/png")});if(s)return{data:new Uint8Array(await s.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}})),D=L;let Ki=0;function lp(){return Ki>0}function ev(){Ki++,setTimeout(()=>{Ki--})}function Vn(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{const o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(ba(e))return e}catch{return e}const r=function(...o){try{const s=o.map(i=>Vn(i,t));return e.apply(this,s)}catch(s){throw ev(),Ge(i=>{i.addEventProcessor(a=>(t.mechanism&&(Mi(a,void 0),Ct(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),me(s)}),s}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}kd(r,e),Le(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function rc(){const e=Tn(),{referrer:t}=D.document||{},{userAgent:n}=D.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}const tv={replayIntegration:"replay",replayCanvasIntegration:"replay-canvas",feedbackIntegration:"feedback",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot",captureConsoleIntegration:"captureconsole",contextLinesIntegration:"contextlines",linkedErrorsIntegration:"linkederrors",dedupeIntegration:"dedupe",extraErrorDataIntegration:"extraerrordata",graphqlClientIntegration:"graphqlclient",httpClientIntegration:"httpclient",reportingObserverIntegration:"reportingobserver",rewriteFramesIntegration:"rewriteframes",browserProfilingIntegration:"browserprofiling",moduleMetadataIntegration:"modulemetadata",instrumentAnthropicAiClient:"instrumentanthropicaiclient",instrumentOpenAiClient:"instrumentopenaiclient",instrumentGoogleGenAIClient:"instrumentgooglegenaiclient",instrumentLangGraph:"instrumentlanggraph",createLangChainCallbackHandler:"createlangchaincallbackhandler"},ul=D;async function nv(e,t){const n=tv[e],r=ul.Sentry=ul.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${e}`);const o=r[e];if(typeof o=="function"&&!("_isShim"in o))return o;const s=rv(n),i=D.document.createElement("script");i.src=s,i.crossOrigin="anonymous",i.referrerPolicy="strict-origin",t&&i.setAttribute("nonce",t);const a=new Promise((l,f)=>{i.addEventListener("load",()=>l()),i.addEventListener("error",f)}),c=D.document.currentScript,u=D.document.body||D.document.head||c?.parentElement;if(u)u.appendChild(i);else throw new Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{await a}catch{throw new Error(`Error when loading integration: ${e}`)}const d=r[e];if(typeof d!="function")throw new Error(`Could not load integration: ${e}`);return d}function rv(e){const n=R()?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${jt}/${e}.min.js`,n).toString()}const _x=Zf({lazyLoadIntegration:nv}),yx=Zf({getModalIntegration:()=>GT,getScreenshotIntegration:()=>ZT});function oc(e,t){const n=sc(e,t),r={type:cv(t),value:uv(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function ov(e,t,n,r){const s=R()?.getOptions().normalizeDepth,i=hv(t),a={__serialized__:Kd(t,s)};if(i)return{exception:{values:[oc(e,i)]},extra:a};const c={exception:{values:[{type:Ts(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:fv(t,{isUnhandledRejection:r})}]},extra:a};if(n){const u=sc(e,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function mi(e,t){return{exception:{values:[oc(e,t)]}}}function sc(e,t){const n=t.stacktrace||t.stack||"",r=iv(t),o=av(t);try{return e(n,r,o)}catch{}return[]}const sv=/Minified React error #\d+;/i;function iv(e){return e&&sv.test(e.message)?1:0}function av(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function dp(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function cv(e){const t=e?.name;return!t&&dp(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function uv(e){const t=e?.message;return dp(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Su(t.error):Su(e):"No error message"}function lv(e,t,n,r){const o=n?.syntheticException||void 0,s=Us(e,t,o,r);return Ct(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),Cs(s)}function dv(e,t,n="info",r,o){const s=r?.syntheticException||void 0,i=Xi(e,t,s,o);return i.level=n,r?.event_id&&(i.event_id=r.event_id),Cs(i)}function Us(e,t,n,r,o){let s;if(vd(t)&&t.error)return mi(e,t.error);if(Bc(t)||fm(t)){const i=t;if("stack"in t)s=mi(e,t);else{const a=i.name||(Bc(i)?"DOMError":"DOMException"),c=i.message?`${a}: ${i.message}`:a;s=Xi(e,c,n,r),Mi(s,c)}return"code"in i&&(s.tags={...s.tags,"DOMException.code":`${i.code}`}),s}return pt(t)?mi(e,t):rt(t)||Ts(t)?(s=ov(e,t,n,o),Ct(s,{synthetic:!0}),s):(s=Xi(e,t,n,r),Mi(s,`${t}`),Ct(s,{synthetic:!0}),s)}function Xi(e,t,n,r){const o={};if(r&&n){const s=sc(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),Ct(o,{synthetic:!0})}if(Es(t)){const{__sentry_template_string__:s,__sentry_template_values__:i}=t;return o.logentry={message:s,params:i},o}return o.message=t,o}function fv(e,{isUnhandledRejection:t}){const n=ym(e),r=t?"promise rejection":"exception";return vd(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Ts(e)?`Event \`${pv(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function pv(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function hv(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class mv extends U_{constructor(t){const n=gv(t),r=D.SENTRY_SDK_SOURCE||FE();vf(n,"browser",["browser"],r),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:o,sendClientReports:s,enableLogs:i,_experiments:a,enableMetrics:c}=this._options,u=c??a?.enableMetrics??!0;D.document&&(s||i||u)&&D.document.addEventListener("visibilitychange",()=>{D.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),i&&Na(this),u&&Pa(this))}),o&&this.on("beforeSendSession",oy)}eventFromException(t,n){return lv(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return dv(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}}function gv(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:D.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const bn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,q=L,_v=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Gr=(e,t,n,r)=>{let o,s;return i=>{t.value>=0&&(i||r)&&(s=t.value-(o??0),(s||o===void 0)&&(o=t.value,t.delta=s,t.rating=_v(t.value,n),e(t)))}},Vr=(e=!0)=>{const t=q.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},cr=()=>Vr()?.activationStart??0;function qt(e,t,n){q.document&&q.addEventListener(e,t,n)}function ss(e,t,n){q.document&&q.removeEventListener(e,t,n)}let Bn=-1;const fp=new Set,yv=()=>q.document?.visibilityState==="hidden"&&!q.document?.prerendering?0:1/0,Lo=e=>{if(Sv(e)&&Bn>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of fp)t();isFinite(Bn)||(Bn=e.type==="visibilitychange"?e.timeStamp:0,ss("prerenderingchange",Lo,!0))}},Jr=()=>{if(q.document&&Bn<0){const e=cr();Bn=(q.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??yv(),qt("visibilitychange",Lo,!0),qt("pagehide",Lo,!0),qt("prerenderingchange",Lo,!0)}return{get firstHiddenTime(){return Bn},onHidden(e){fp.add(e)}}};function Sv(e){return e.type==="pagehide"||q.document?.visibilityState==="hidden"}const bv=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Yr=(e,t=-1)=>{const n=Vr();let r="navigate";return n&&(q.document?.prerendering||cr()>0?r="prerender":q.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:bv(),navigationType:r}},gi=new WeakMap;function ic(e,t){try{return gi.get(e)||gi.set(e,new t),gi.get(e)}catch{return new t}}class is{constructor(){is.prototype.__init.call(this),is.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){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]),this._onAfterProcessingUnexpectedShift?.(t)}}const ur=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},ac=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Hs=e=>{q.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Ev=[1800,3e3],Tv=(e,t={})=>{Hs(()=>{const n=Jr(),r=Yr("FCP");let o;const i=ur("paint",a=>{for(const c of a)c.name==="first-contentful-paint"&&(i.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-cr(),0),r.entries.push(c),o(!0)))});i&&(o=Gr(e,r,Ev,t.reportAllChanges))})},vv=[.1,.25],Iv=(e,t={})=>{Tv(ac(()=>{const n=Yr("CLS",0);let r;const o=Jr(),s=ic(t,is),i=c=>{for(const u of c)s._processEntry(u);s._sessionValue>n.value&&(n.value=s._sessionValue,n.entries=s._sessionEntries,r())},a=ur("layout-shift",i);a&&(r=Gr(e,n,vv,t.reportAllChanges),o.onHidden(()=>{i(a.takeRecords()),r(!0)}),q?.setTimeout?.(r))}))};let pp=0,_i=1/0,uo=0;const wv=e=>{e.forEach(t=>{t.interactionId&&(_i=Math.min(_i,t.interactionId),uo=Math.max(uo,t.interactionId),pp=uo?(uo-_i)/7+1:0)})};let Qi;const hp=()=>Qi?pp:performance.interactionCount||0,kv=()=>{"interactionCount"in performance||Qi||(Qi=ur("event",wv,{type:"event",buffered:!0,durationThreshold:0}))},yi=10;let mp=0;const Rv=()=>hp()-mp;class as{constructor(){as.prototype.__init.call(this),as.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){mp=hp(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(Rv()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(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<yi||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,s)=>s._latency-o._latency),this._longestInteractionList.length>yi){const o=this._longestInteractionList.splice(yi);for(const s of o)this._longestInteractionMap.delete(s.id)}this._onAfterProcessingINPCandidate?.(r)}}}const gp=e=>{const t=q.requestIdleCallback||q.setTimeout;q.document?.visibilityState==="hidden"?e():(e=ac(e),qt("visibilitychange",e,{once:!0,capture:!0}),qt("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),ss("visibilitychange",e,{capture:!0}),ss("pagehide",e,{capture:!0})}))},Cv=[200,500],Av=40,xv=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Jr();Hs(()=>{kv();const r=Yr("INP");let o;const s=ic(t,as),i=c=>{gp(()=>{for(const d of c)s._processEntry(d);const u=s._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,o())})},a=ur("event",i,{durationThreshold:t.durationThreshold??Av});o=Gr(e,r,Cv,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(a.takeRecords()),o(!0)}))})};class Mv{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const Nv=[2500,4e3],Ov=(e,t={})=>{Hs(()=>{const n=Jr(),r=Yr("LCP");let o;const s=ic(t,Mv),i=c=>{t.reportAllChanges||(c=c.slice(-1));for(const u of c)s._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-cr(),0),r.entries=[u],o())},a=ur("largest-contentful-paint",i);if(a){o=Gr(e,r,Nv,t.reportAllChanges);const c=ac(()=>{i(a.takeRecords()),a.disconnect(),o(!0)}),u=d=>{d.isTrusted&&(gp(c),ss(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])qt(d,u,{capture:!0})}})},Pv=[800,1800],Zi=e=>{q.document?.prerendering?Hs(()=>Zi(e)):q.document?.readyState!=="complete"?addEventListener("load",()=>Zi(e),!0):setTimeout(e)},Lv=(e,t={})=>{const n=Yr("TTFB"),r=Gr(e,n,Pv,t.reportAllChanges);Zi(()=>{const o=Vr();o&&(n.value=Math.max(o.responseStart-cr(),0),n.entries=[o],r(!0))})},Tr={},cs={};let _p,yp,Sp,bp;function cc(e,t=!1){return Ws("cls",e,Fv,_p,t)}function uc(e,t=!1){return Ws("lcp",e,$v,yp,t)}function Dv(e){return Ws("ttfb",e,Bv,Sp)}function Ep(e){return Ws("inp",e,Uv,bp)}function En(e,t){return Tp(e,t),cs[e]||(Hv(e),cs[e]=!0),vp(e,t)}function Kr(e,t){const n=Tr[e];if(n?.length)for(const r of n)try{r(t)}catch(o){bn&&m.error(`Error while triggering instrumentation handler.
489
- Type: ${e}
490
- Name: ${kt(r)}
491
- Error:`,o)}}function Fv(){return Iv(e=>{Kr("cls",{metric:e}),_p=e},{reportAllChanges:!0})}function $v(){return Ov(e=>{Kr("lcp",{metric:e}),yp=e},{reportAllChanges:!0})}function Bv(){return Lv(e=>{Kr("ttfb",{metric:e}),Sp=e})}function Uv(){return xv(e=>{Kr("inp",{metric:e}),bp=e})}function Ws(e,t,n,r,o=!1){Tp(e,t);let s;return cs[e]||(s=n(),cs[e]=!0),r&&t({metric:r}),vp(e,t,o?s:void 0)}function Hv(e){const t={};e==="event"&&(t.durationThreshold=0),ur(e,n=>{Kr(e,{entries:n})},t)}function Tp(e,t){Tr[e]=Tr[e]||[],Tr[e].push(t)}function vp(e,t,n){return()=>{n&&n();const r=Tr[e];if(!r)return;const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function Wv(e){return"duration"in e}const jv=e=>{const t=n=>{(n.type==="pagehide"||q.document?.visibilityState==="hidden")&&e(n)};qt("visibilitychange",t,{capture:!0,once:!0}),qt("pagehide",t,{capture:!0,once:!0})};function Si(e){return typeof e=="number"&&isFinite(e)}function Yt(e,t,n,{...r}){const o=U(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),jn(e,()=>{const s=it({startTime:t,...r});return s&&s.end(n),s})}function lc(e){const t=R();if(!t)return;const{name:n,transaction:r,attributes:o,startTime:s}=e,{release:i,environment:a,sendDefaultPii:c}=t.getOptions(),d=t.getIntegrationByName("Replay")?.getReplayId(),l=z(),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:i,environment:a,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":q.navigator?.userAgent,"client.address":c?"{{auto}}":void 0,...o};return it({name:n,attributes:g,startTime:s,experimental:{standalone:!0}})}function Xr(){return q.addEventListener&&q.performance}function _e(e){return e/1e3}function qv(e){let t="unknown",n="unknown",r="";for(const o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function Ip(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function wp(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n),r=!0}jv(()=>{o("pagehide")});const s=e.on("beforeStartNavigationSpan",(a,c)=>{c?.isRedirect||(o("navigation"),s(),i())}),i=e.on("afterStartPageLoadSpan",a=>{n=a.spanContext().spanId,i()})}function zv(e){let t=0,n;if(!Ip("layout-shift"))return;const r=cc(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);wp(e,(o,s)=>{Gv(t,n,s,o),r()})}function Gv(e,t,n,r){bn&&m.log(`Sending CLS span (${e})`);const o=t?_e((Ae()||0)+t.startTime):fe(),s=z().getScopeData().transactionName,i=t?Ue(t.sources[0]?.node):"Layout shift",a={[Y]:"auto.http.browser.cls",[Te]:"ui.webvital.cls",[rr]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((u,d)=>{a[`cls.source.${d+1}`]=Ue(u.node)});const c=lc({name:i,transaction:s,attributes:a,startTime:o});c&&(c.addEvent("cls",{[Br]:"",[Ur]:e}),c.end(o))}function Vv(e){let t=0,n;if(!Ip("largest-contentful-paint"))return;const r=uc(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);wp(e,(o,s)=>{Jv(t,n,s,o),r()})}function Jv(e,t,n,r){bn&&m.log(`Sending LCP span (${e})`);const o=_e((Ae()||0)+(t?.startTime||0)),s=z().getScopeData().transactionName,i=t?Ue(t.element):"Largest contentful paint",a={[Y]:"auto.http.browser.lcp",[Te]:"ui.webvital.lcp",[rr]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Ue(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const c=lc({name:i,transaction:s,attributes:a,startTime:o});c&&(c.addEvent("lcp",{[Br]:"millisecond",[Ur]:e}),c.end(o))}function Je(e){return e&&((Ae()||performance.timeOrigin)+e)/1e3}function kp(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:r}=qv(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return Ae()||Xr()?.timeOrigin?Yv({...t,"http.request.redirect_start":Je(e.redirectStart),"http.request.redirect_end":Je(e.redirectEnd),"http.request.worker_start":Je(e.workerStart),"http.request.fetch_start":Je(e.fetchStart),"http.request.domain_lookup_start":Je(e.domainLookupStart),"http.request.domain_lookup_end":Je(e.domainLookupEnd),"http.request.connect_start":Je(e.connectStart),"http.request.secure_connection_start":Je(e.secureConnectionStart),"http.request.connection_end":Je(e.connectEnd),"http.request.request_start":Je(e.requestStart),"http.request.response_start":Je(e.responseStart),"http.request.response_end":Je(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Yv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Kv=2147483647;let ll=0,et={},Fe,us;function Xv({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=Xr();if(r&&Ae()){r.mark&&q.performance.mark("sentry-tracing-init");const o=t?Vv(n):n0(),s=r0(),i=e?zv(n):t0();return()=>{o?.(),s(),i?.()}}return()=>{}}function Qv(){En("longtask",({entries:e})=>{const t=be();if(!t)return;const{op:n,start_timestamp:r}=U(t);for(const o of e){const s=_e(Ae()+o.startTime),i=_e(o.duration);n==="navigation"&&r&&s<r||Yt(t,s,s+i,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Y]:"auto.ui.browser.metrics"}})}})}function Zv(){new PerformanceObserver(t=>{const n=be();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const o=_e(Ae()+r.startTime),{start_timestamp:s,op:i}=U(n);if(i==="navigation"&&s&&o<s)continue;const a=_e(r.duration),c={[Y]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:l,sourceURL:f,sourceFunctionName:p,sourceCharPosition:h}=u;c["browser.script.invoker"]=d,c["browser.script.invoker_type"]=l,f&&(c["code.filepath"]=f),p&&(c["code.function"]=p),h!==-1&&(c["browser.script.source_char_position"]=h),Yt(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:c})}}).observe({type:"long-animation-frame",buffered:!0})}function e0(){En("event",({entries:e})=>{const t=be();if(t){for(const n of e)if(n.name==="click"){const r=_e(Ae()+n.startTime),o=_e(n.duration),s={name:Ue(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Y]:"auto.ui.browser.metrics"}},i=wd(n.target);i&&(s.attributes["ui.component_name"]=i),Yt(t,r,r+o,s)}}})}function t0(){return cc(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(et.cls={value:e.value,unit:""},us=t)},!0)}function n0(){return uc(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(et.lcp={value:e.value,unit:"millisecond"},Fe=t)},!0)}function r0(){return Dv(({metric:e})=>{e.entries[e.entries.length-1]&&(et.ttfb={value:e.value,unit:"millisecond"})})}function o0(e,t){const n=Xr(),r=Ae();if(!n?.getEntries||!r)return;const o=_e(r),s=n.getEntries(),{op:i,start_timestamp:a}=U(e);s.slice(ll).forEach(c=>{const u=_e(c.startTime),d=_e(Math.max(0,c.duration));if(!(i==="navigation"&&a&&o+u<a))switch(c.entryType){case"navigation":{c0(e,c,o);break}case"mark":case"paint":case"measure":{i0(e,c,u,d,o,t.ignorePerformanceApiSpans);const l=Jr(),f=c.startTime<l.firstHiddenTime;c.name==="first-paint"&&f&&(et.fp={value:c.startTime,unit:"millisecond"}),c.name==="first-contentful-paint"&&f&&(et.fcp={value:c.startTime,unit:"millisecond"});break}case"resource":{d0(e,c,c.name,u,d,o,t.ignoreResourceSpans);break}}}),ll=Math.max(s.length-1,0),f0(e),i==="pageload"&&(m0(et),t.recordClsOnPageloadSpan||delete et.cls,t.recordLcpOnPageloadSpan||delete et.lcp,Object.entries(et).forEach(([c,u])=>{Cg(c,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",o),e.setAttribute("performance.activationStart",cr()),p0(e,t)),Fe=void 0,us=void 0,et={}}function s0(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function i0(e,t,n,r,o,s){if(s0(t)||["mark","measure"].includes(t.entryType)&&st(t.name,s))return;const i=Vr(!1),a=_e(i?i.requestStart:0),c=o+Math.max(n,a),u=o+n,d=u+r,l={[Y]:"auto.resource.browser.metrics"};c!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=c),a0(l,t),c<=d&&Yt(e,c,d,{name:t.name,op:t.entryType,attributes:l})}function a0(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,o]of Object.entries(n))if(o&&Vt(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(Vt(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function c0(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{lo(e,t,r,n)}),lo(e,t,"secureConnection",n,"TLS/SSL"),lo(e,t,"fetch",n,"cache"),lo(e,t,"domainLookup",n,"DNS"),l0(e,t,n)}function lo(e,t,n,r,o=n){const s=u0(n),i=t[s],a=t[`${n}Start`];!a||!i||Yt(e,r+_e(a),r+_e(i),{op:`browser.${o}`,name:t.name,attributes:{[Y]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function u0(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function l0(e,t,n){const r=n+_e(t.requestStart),o=n+_e(t.responseEnd),s=n+_e(t.responseStart);t.responseEnd&&(Yt(e,r,o,{op:"browser.request",name:t.name,attributes:{[Y]:"auto.ui.browser.metrics"}}),Yt(e,s,o,{op:"browser.response",name:t.name,attributes:{[Y]:"auto.ui.browser.metrics"}}))}function d0(e,t,n,r,o,s,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(i?.includes(a))return;const c={[Y]:"auto.resource.browser.metrics"},u=fn(n);u.protocol&&(c["url.scheme"]=u.protocol.split(":").pop()),u.host&&(c["server.address"]=u.host),c["url.same_origin"]=n.includes(q.location.origin),h0(t,c,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...c,...kp(t)},l=s+r,f=l+o;Yt(e,l,f,{name:n.replace(q.location.origin,""),op:a,attributes:d})}function f0(e){const t=q.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Si(n.rtt)&&(et["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Si(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Si(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function p0(e,t){Fe&&t.recordLcpOnPageloadSpan&&(Fe.element&&e.setAttribute("lcp.element",Ue(Fe.element)),Fe.id&&e.setAttribute("lcp.id",Fe.id),Fe.url&&e.setAttribute("lcp.url",Fe.url.trim().slice(0,200)),Fe.loadTime!=null&&e.setAttribute("lcp.loadTime",Fe.loadTime),Fe.renderTime!=null&&e.setAttribute("lcp.renderTime",Fe.renderTime),e.setAttribute("lcp.size",Fe.size)),us?.sources&&t.recordClsOnPageloadSpan&&us.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ue(n.node)))}function h0(e,t,n){n.forEach(([r,o])=>{const s=e[r];s!=null&&(typeof s=="number"&&s<Kv||typeof s=="string")&&(t[o]=s)})}function m0(e){const t=Vr(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function g0(){return Xr()&&Ae()?En("element",_0):()=>{}}const _0=({entries:e})=>{const t=be(),n=t?Se(t):void 0,r=n?U(n).description:z().getScopeData().transactionName;e.forEach(o=>{const s=o;if(!s.identifier)return;const i=s.name,a=s.renderTime,c=s.loadTime,[u,d]=c?[_e(c),"load-time"]:a?[_e(a),"render-time"]:[fe(),"entry-emission"],l=i==="image-paint"?_e(Math.max(0,(a??0)-(c??0))):0,f={[Y]:"auto.ui.browser.elementtiming",[Te]:"ui.elementtiming",[Pe]:"component","sentry.span_start_time_source":d,"sentry.transaction_name":r,"element.id":s.id,"element.type":s.element?.tagName?.toLowerCase()||"unknown","element.size":s.naturalWidth&&s.naturalHeight?`${s.naturalWidth}x${s.naturalHeight}`:void 0,"element.render_time":a,"element.load_time":c,"element.url":s.url||void 0,"element.identifier":s.identifier,"element.paint_type":i};en({name:`element[${s.identifier}]`,attributes:f,startTime:u,onlyIfParent:!0},p=>{p.end(u+l)})})},y0=1e3;let dl,ea,ta;function Rp(e){Kt("dom",e),Xt("dom",S0)}function S0(){if(!q.document)return;const e=Ke.bind(null,"dom"),t=fl(e,!0);q.document.addEventListener("click",t,!1),q.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const o=q[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(Re(o,"addEventListener",function(s){return function(i,a,c){if(i==="click"||i=="keypress")try{const u=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){const l=fl(e);d.handler=l,s.call(this,i,l,c)}d.refCount++}catch{}return s.call(this,i,a,c)}}),Re(o,"removeEventListener",function(s){return function(i,a,c){if(i==="click"||i=="keypress")try{const u=this.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(s.call(this,i,d.handler,c),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,i,a,c)}}))})}function b0(e){if(e.type!==ea)return!1;try{if(!e.target||e.target._sentryId!==ta)return!1}catch{}return!0}function E0(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function fl(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=T0(n);if(E0(n.type,r))return;Le(n,"_sentryCaptured",!0),r&&!r._sentryId&&Le(r,"_sentryId",ve());const o=n.type==="keypress"?"input":n.type;b0(n)||(e({event:n,name:o,global:t}),ea=n.type,ta=r?r._sentryId:void 0),clearTimeout(dl),dl=q.setTimeout(()=>{ta=void 0,ea=void 0},y0)}}function T0(e){try{return e.target}catch{return null}}let fo;function js(e){const t="history";Kt(t,e),Xt(t,v0)}function v0(){if(q.addEventListener("popstate",()=>{const t=q.location.href,n=fo;if(fo=t,n===t)return;Ke("history",{from:n,to:t})}),!CE())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=fo,s=I0(String(r));if(fo=s,o===s)return t.apply(this,n);Ke("history",{from:o,to:s})}return t.apply(this,n)}}Re(q.history,"pushState",e),Re(q.history,"replaceState",e)}function I0(e){try{return new URL(e,q.location.origin).toString()}catch{return e}}const Do={};function dc(e){const t=Do[e];if(t)return t;let n=q[e];if(zi(n))return Do[e]=n.bind(q);const r=q.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(o)}catch(o){bn&&m.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(Do[e]=n.bind(q))}function w0(e){Do[e]=void 0}function Qr(...e){return dc("setTimeout")(...e)}const Tt="__sentry_xhr_v3__";function fc(e){Kt("xhr",e),Xt("xhr",k0)}function k0(){if(!q.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=fe()*1e3,i=ot(r[0])?r[0].toUpperCase():void 0,a=R0(r[1]);if(!i||!a)return t.apply(n,r);n[Tt]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const u=n[Tt];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:fe()*1e3,startTimestamp:s,xhr:n,virtualError:o};Ke("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return c(),u.apply(d,l)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[Tt];return h&&ot(f)&&ot(p)&&(h.request_headers[f.toLowerCase()]=p),u.apply(d,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const o=n[Tt];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:fe()*1e3,xhr:n};return Ke("xhr",s),t.apply(n,r)}})}function R0(e){if(ot(e))return e;try{return e.toString()}catch{}}const C0=Symbol.for("sentry__originalRequestBody");function Cp(e){return new URLSearchParams(e).toString()}function ls(e,t=m){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Cp(e)];if(!e)return[void 0]}catch(n){return bn&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return bn&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function pc(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const n=e[0][C0];return n!==void 0?n:void 0}}function Ap(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return bn&&m.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
492
- `).reduce((n,r)=>{const[o,s]=r.split(": ");return s&&(n[o.toLowerCase()]=s),n},{}):{}}const bi=[],Fo=new Map,Cn=new Map,A0=60;function x0(){if(Xr()&&Ae()){const t=M0();return()=>{t()}}return()=>{}}const na={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 M0(){return Ep(N0)}const N0=({metric:e})=>{if(e.value==null)return;const t=_e(e.value);if(t>A0)return;const n=e.entries.find(h=>h.duration===e.value&&na[h.name]);if(!n)return;const{interactionId:r}=n,o=na[n.name],s=_e(Ae()+n.startTime),i=be(),a=i?Se(i):void 0,c=r!=null?Fo.get(r):void 0,u=c?.span||a,d=u?U(u).description:z().getScopeData().transactionName,l=c?.elementName||Ue(n.target),f={[Y]:"auto.http.browser.inp",[Te]:`ui.interaction.${o}`,[rr]:n.duration},p=lc({name:l,transaction:d,attributes:f,startTime:s});p&&(p.addEvent("inp",{[Br]:"millisecond",[Ur]:e.value}),p.end(s+t))};function O0(){const e=Object.keys(na);rs()&&e.forEach(o=>{q.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){const s=o.target;if(!s)return;const i=Ue(s),a=Math.round(o.timeStamp);if(Cn.set(a,i),Cn.size>50){const c=Cn.keys().next().value;c!==void 0&&Cn.delete(c)}}function n(o){const s=Math.round(o.startTime);let i=Cn.get(s);if(!i)for(let a=-5;a<=5;a++){const c=Cn.get(s+a);if(c){i=c;break}}return i||"<unknown>"}const r=({entries:o})=>{const s=be(),i=s&&Se(s);o.forEach(a=>{if(!Wv(a))return;const c=a.interactionId;if(c==null||Fo.has(c))return;const u=a.target?Ue(a.target):n(a);if(bi.length>10){const d=bi.shift();Fo.delete(d)}bi.push(c),Fo.set(c,{span:i,elementName:u})})};En("event",r),En("first-input",r)}const P0=40;function xp(e,t=dc("fetch")){let n=0,r=0;async function o(s){const i=s.body.length;n+=i,r++;const a={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const c=await t(e.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw w0("fetch"),c}finally{n-=i,r--}}return L_(e,o,Fa(e.bufferSize||P0))}const v=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function L0(){const e=R();if(!e){v&&m.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){v&&m.warn("BrowserProfiling integration is not available");return}e.emit("startUIProfiler")}function D0(){const e=R();if(!e){v&&m.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){v&&m.warn("ProfilingIntegration is not available");return}e.emit("stopUIProfiler")}const Sx={startProfiler:L0,stopProfiler:D0},F0=10,$0=20,B0=30,U0=40,H0=50;function Jn(e,t,n,r){const o={filename:e,function:t==="<anonymous>"?ht:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const W0=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,j0=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,q0=/\((\S*)(?::(\d+))(?::(\d+))\)/,z0=/at (.+?) ?\(data:(.+?),/,G0=e=>{const t=e.match(z0);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=W0.exec(e);if(n){const[,o,s,i]=n;return Jn(o,ht,+s,+i)}const r=j0.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const a=q0.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[s,i]=Mp(r[1]||ht,r[2]);return Jn(i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},V0=[B0,G0],J0=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Y0=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,K0=e=>{const t=J0.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=Y0.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],o=t[1]||ht;return[o,r]=Mp(o,r),Jn(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},X0=[H0,K0],Q0=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Z0=e=>{const t=Q0.exec(e);return t?Jn(t[2],t[1]||ht,+t[3],t[4]?+t[4]:void 0):void 0},bx=[U0,Z0],eI=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,tI=e=>{const t=eI.exec(e);return t?Jn(t[2],t[3]||ht,+t[1]):void 0},Ex=[F0,tI],nI=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,rI=e=>{const t=nI.exec(e);return t?Jn(t[5],t[3]||t[4]||ht,+t[1],+t[2]):void 0},Tx=[$0,rI],oI=[V0,X0],sI=yd(...oI),Mp=(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]:ht,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function vx(e,{metadata:t,tunnel:n,dsn:r}){const o={event_id:e.event_id,sent_at:new Date().toISOString(),...t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:Ot(r)}},s=iI(e);return ct(o,[s])}function iI(e){return[{type:"user_report"},e]}const po=1024,aI="Breadcrumbs",cI=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:aI,setup(n){t.console&&Ua(fI(n)),t.dom&&Rp(dI(n,t.dom)),t.xhr&&fc(pI(n)),t.fetch&&Xa(hI(n)),t.history&&js(mI(n)),t.sentry&&n.on("beforeSendEvent",lI(n))}}}),uI=cI;function lI(e){return function(n){R()===e&&xt({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:on(n)},{event:n})}}function dI(e,t){return function(r){if(R()!==e)return;let o,s,i=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>po&&(v&&m.warn(`\`dom.maxStringLength\` cannot exceed ${po}, but a value of ${a} was configured. Sentry will use ${po} instead.`),a=po),typeof i=="string"&&(i=[i]);try{const u=r.event,d=gI(u)?u.target:u;o=Ue(d,{keyAttrs:i,maxStringLength:a}),s=wd(d)}catch{o="<unknown>"}if(o.length===0)return;const c={category:`ui.${r.name}`,message:o};s&&(c.data={"ui.component_name":s}),xt(c,{event:r.event,name:r.name,global:r.global})}}function fI(e){return function(n){if(R()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Zo(n.level),message:jo(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${jo(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;xt(r,{input:n.args,level:n.level})}}function pI(e){return function(n){if(R()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[Tt];if(!r||!o||!s)return;const{method:i,url:a,status_code:c,body:u}=s,d={method:i,url:a,status_code:c},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},f={category:"xhr",data:d,type:"http",level:Jf(c)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),xt(f,l)}}function hI(e){return function(n){if(R()!==e)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const s=n.fetchData,i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},a={category:"fetch",data:s,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",a,i),xt(a,i)}else{const s=n.response,i={...n.fetchData,status_code:s?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,s?.status;const a={input:n.args,response:s,startTimestamp:r,endTimestamp:o},c={category:"fetch",data:i,type:"http",level:Jf(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),xt(c,a)}}}function mI(e){return function(n){if(R()!==e)return;let r=n.from,o=n.to;const s=fn(D.location.href);let i=r?fn(r):void 0;const a=fn(o);i?.path||(i=s),s.protocol===a.protocol&&s.host===a.host&&(o=a.relative),s.protocol===i.protocol&&s.host===i.host&&(r=i.relative),xt({category:"navigation",data:{from:r,to:o}})}}function gI(e){return!!e&&!!e.target}const _I=["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"],yI="BrowserApiErrors",SI=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:yI,setupOnce(){t.setTimeout&&Re(D,"setTimeout",pl),t.setInterval&&Re(D,"setInterval",pl),t.requestAnimationFrame&&Re(D,"requestAnimationFrame",EI),t.XMLHttpRequest&&"XMLHttpRequest"in D&&Re(XMLHttpRequest.prototype,"send",TI);const n=t.eventTarget;n&&(Array.isArray(n)?n:_I).forEach(o=>vI(o,t))}}}),bI=SI;function pl(e){return function(...t){const n=t[0];return t[0]=Vn(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${kt(e)}`}}),e.apply(this,t)}}function EI(e){return function(t){return e.apply(this,[Vn(t,{mechanism:{data:{handler:kt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function TI(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&Re(n,o,function(s){const i={mechanism:{data:{handler:kt(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=ba(s);return a&&(i.mechanism.data.handler=kt(a)),Vn(s,i)})}),e.apply(this,t)}}function vI(e,t){const r=D[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Re(r,"addEventListener",function(o){return function(s,i,a){try{II(i)&&(i.handleEvent=Vn(i.handleEvent,{mechanism:{data:{handler:kt(i),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&wI(this,s,i),o.apply(this,[s,Vn(i,{mechanism:{data:{handler:kt(i),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),Re(r,"removeEventListener",function(o){return function(s,i,a){try{const c=i.__sentry_wrapped__;c&&o.call(this,s,c,a)}catch{}return o.call(this,s,i,a)}}))}function II(e){return typeof e.handleEvent=="function"}function wI(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const kI=()=>({name:"BrowserSession",setupOnce(){if(typeof D.document>"u"){v&&m.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}au({ignoreDuration:!0}),cu(),js(({from:e,to:t})=>{e!==void 0&&e!==t&&(au({ignoreDuration:!0}),cu())})}}),RI="GlobalHandlers",CI=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:RI,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(xI(n),hl("onerror")),t.onunhandledrejection&&(MI(n),hl("onunhandledrejection"))}}}),AI=CI;function xI(e){bd(t=>{const{stackParser:n,attachStacktrace:r}=Pp();if(R()!==e||lp())return;const{msg:o,url:s,line:i,column:a,error:c}=t,u=NI(Us(n,c||o,void 0,r,!1),s,i,a);u.level="error",Wr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function MI(e){Ed(t=>{const{stackParser:n,attachStacktrace:r}=Pp();if(R()!==e||lp())return;const o=Np(t),s=Vt(o)?Op(o):Us(n,o,void 0,r,!0);s.level="error",Wr(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Np(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 Op(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function NI(e,t,n,r){const o=e.exception=e.exception||{},s=o.values=o.values||[],i=s[0]=s[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[],u=r,d=n,l=OI(t)??Tn();return c.length===0&&c.push({colno:u,filename:l,function:ht,in_app:!0,lineno:d}),e}function hl(e){v&&m.log(`Global Handler attached: ${e}`)}function Pp(){return R()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function OI(e){if(!(!ot(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 PI=()=>({name:"HttpContext",preprocessEvent(e){if(!D.navigator&&!D.location&&!D.document)return;const t=rc(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),LI="cause",DI=5,FI="LinkedErrors",$I=((e={})=>{const t=e.limit||DI,n=e.key||LI;return{name:FI,preprocessEvent(r,o,s){const i=s.getOptions();vy(oc,i.stackParser,n,t,r,o)}}}),BI=$I,UI="SpotlightBrowser",HI=((e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:UI,setup:()=>{v&&m.log("Using Sidecar URL",t)},processEvent:n=>jI(n)?null:n,afterAllSetup:n=>{WI(n,t)}}});function WI(e,t){const n=dc("fetch");let r=0;e.on("beforeEnvelope",o=>{if(r>3){m.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:Jo(o),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(s=>{s.status>=200&&s.status<400&&(r=0)},s=>{r++,m.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",s)})})}const Ix=HI;function jI(e){return!!(e.type==="transaction"&&e.spans&&e.contexts?.trace&&e.contexts.trace.op==="ui.action.click"&&e.spans.some(({description:t})=>t?.includes("#sentry-spotlight")))}function qI(){return zI()?(v&&yt(()=>{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 zI(){if(typeof D.window>"u")return!1;const e=D;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=Tn(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(D===D.top&&r.some(s=>n.startsWith(`${s}://`)))}function GI(e){return[my(),dy(),bI(),uI(),AI(),BI(),Ny(),PI(),kI()]}function VI(e={}){const t=!e.skipBrowserExtensionCheck&&qI();let n=e.defaultIntegrations==null?GI():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:cm(e.stackParser||sI),integrations:g_({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||xp};return G_(mv,r)}function wx(){}function kx(e){e()}function ml(e={}){const t=D.document,n=t?.head||t?.body;if(!n){v&&m.error("[showReportDialog] Global document not defined");return}const r=z(),s=R()?.getDsn();if(!s){v&&m.error("[showReportDialog] DSN not configured");return}const i={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||c_()},a=D.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=h_(s,i);const{onLoad:c,onClose:u}=i;if(c&&(a.onload=c),u){const d=l=>{if(l.data==="__sentry_reportdialog_closed__")try{u()}finally{D.removeEventListener("message",d)}};D.addEventListener("message",d)}n.appendChild(a)}const JI=L,YI="ReportingObserver",gl=new WeakMap,KI=((e={})=>{const t=e.types||["crash","deprecation","intervention"];function n(r){if(gl.has(R()))for(const o of r)Ge(s=>{s.setExtra("url",o.url);const i=`ReportingObserver [${o.type}]`;let a="No details available";if(o.body){const c={};for(const u in o.body)c[u]=o.body[u];if(s.setExtra("body",c),o.type==="crash"){const u=o.body;a=[u.crashId||"",u.reason||""].join(" ").trim()||a}else a=o.body.message||a}s_(`${i}: ${a}`)})}return{name:YI,setupOnce(){if(!xE())return;new JI.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(r){gl.set(r,!0)}}}),Rx=KI,XI="HttpClient",QI=((e={})=>{const t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:XI,setup(n){iw(n,t),aw(n,t)}}}),Cx=QI;function ZI(e,t,n,r,o){if(Dp(e,n.status,n.url)){const s=cw(t,r);let i,a,c,u;$p()&&([i,c]=_l("Cookie",s),[a,u]=_l("Set-Cookie",n));const d=Fp({url:s.url,method:s.method,status:n.status,requestHeaders:i,responseHeaders:a,requestCookies:c,responseCookies:u,error:o,type:"fetch"});Wr(d)}}function _l(e,t){const n=nw(t.headers);let r;try{const o=n[e]||n[e.toLowerCase()]||void 0;o&&(r=Lp(o))}catch{}return[n,r]}function ew(e,t,n,r,o){if(Dp(e,t.status,t.responseURL)){let s,i,a;if($p()){try{const u=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;u&&(i=Lp(u))}catch{}try{a=rw(t)}catch{}s=r}const c=Fp({url:t.responseURL,method:n,status:t.status,requestHeaders:s,responseHeaders:a,responseCookies:i,error:o,type:"xhr"});Wr(c)}}function tw(e){if(e){const t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function Lp(e){return e.split("; ").reduce((t,n)=>{const[r,o]=n.split("=");return r&&o&&(t[r]=o),t},{})}function nw(e){const t={};return e.forEach((n,r)=>{t[r]=n}),t}function rw(e){const t=e.getAllResponseHeaders();return t?t.split(`\r
493
- `).reduce((n,r)=>{const[o,s]=r.split(": ");return o&&s&&(n[o]=s),n},{}):{}}function ow(e,t){return e.some(n=>typeof n=="string"?t.includes(n):n.test(t))}function sw(e,t){return e.some(n=>typeof n=="number"?n===t:t>=n[0]&&t<=n[1])}function iw(e,t){Yf()&&Xa(n=>{if(R()!==e)return;const{response:r,args:o,error:s,virtualError:i}=n,[a,c]=o;r&&ZI(t,a,r,c,s||i)},!1)}function aw(e,t){"XMLHttpRequest"in L&&fc(n=>{if(R()!==e)return;const{error:r,virtualError:o}=n,s=n.xhr,i=s[Tt];if(!i)return;const{method:a,request_headers:c}=i;try{ew(t,s,a,c,r||o)}catch(u){v&&m.warn("Error while extracting response event form XHR response",u)}})}function Dp(e,t,n){return sw(e.failedRequestStatusCodes,t)&&ow(e.failedRequestTargets,n)&&!Tf(n,R())}function Fp(e){const t=R(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,o=`HTTP Client Error with status code: ${e.status}`,s={message:o,exception:{values:[{type:"Error",value:o,stacktrace:r?{frames:r}:void 0}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:tw(e.responseHeaders)}}};return Ct(s,{type:`auto.http.client.${e.type}`,handled:!1}),s}function cw(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function $p(){const e=R();return e?!!e.getOptions().sendDefaultPii:!1}const Ei=L,uw=7,lw="ContextLines",dw=((e={})=>{const t=e.frameContextLines!=null?e.frameContextLines:uw;return{name:lw,processEvent(n){return fw(n,t)}}}),Ax=dw;function fw(e,t){const n=Ei.document,r=Ei.location&&Ef(Ei.location.href);if(!n||!r)return e;const o=e.exception?.values;if(!o?.length)return e;const s=n.documentElement.innerHTML;if(!s)return e;const i=["<!DOCTYPE html>","<html>",...s.split(`
494
- `),"</html>"];return o.forEach(a=>{const c=a.stacktrace;c?.frames&&(c.frames=c.frames.map(u=>pw(u,i,r,t)))}),e}function pw(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||Em(t,e,r),e}const hw="GraphQLClient",mw=(e=>({name:hw,setup(t){gw(t,e),_w(t,e)}}));function gw(e,t){e.on("beforeOutgoingRequestSpan",(n,r)=>{const s=U(n).data||{};if(!(s[Te]==="http.client"))return;const c=s[Dm]||s["http.url"],u=s[Lm]||s["http.method"];if(!ot(c)||!ot(u))return;const{endpoints:d}=t,l=st(c,d),f=Up(r);if(l&&f){const p=Hp(f);if(p){const h=Bp(p);n.updateName(`${u} ${c} (${h})`),qs(p)&&n.setAttribute("graphql.document",p.query),zs(p)&&(n.setAttribute("graphql.persisted_query.hash.sha256",p.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",p.extensions.persistedQuery.version))}}})}function _w(e,t){e.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{const{category:o,type:s,data:i}=n;if(s==="http"&&(o==="fetch"||o==="xhr")){const d=i?.url,{endpoints:l}=t,f=st(d,l),p=Up(r);if(f&&i&&p){const h=Hp(p);if(!i.graphql&&h){const g=Bp(h);i["graphql.operation"]=g,qs(h)&&(i["graphql.document"]=h.query),zs(h)&&(i["graphql.persisted_query.hash.sha256"]=h.extensions.persistedQuery.sha256Hash,i["graphql.persisted_query.version"]=h.extensions.persistedQuery.version)}}}})}function Bp(e){if(zs(e))return`persisted ${e.operationName}`;if(qs(e)){const{query:t,operationName:n}=e,{operationName:r=n,operationType:o}=yw(t);return r?`${o} ${r}`:`${o}`}return"unknown"}function Up(e){const t="xhr"in e;let n;if(t){const r=e.xhr[Tt];n=r&&ls(r.body)[0]}else{const r=pc(e.input);n=ls(r)[0]}return n}function yw(e){const t=/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/,n=/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/,r=e.match(t);if(r)return{operationType:r[1],operationName:r[2]};const o=e.match(n);return o?{operationType:o[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function $o(e){return typeof e=="object"&&e!==null}function qs(e){return $o(e)&&typeof e.query=="string"}function zs(e){return $o(e)&&typeof e.operationName=="string"&&$o(e.extensions)&&$o(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash=="string"&&typeof e.extensions.persistedQuery.version=="number"}function Hp(e){try{const t=JSON.parse(e);return qs(t)||zs(t)?t:void 0}catch{return}}const xx=mw,de=L,hc="sentryReplaySession",Sw="replay_event",mc="Unable to send Replay",bw=3e5,Ew=9e5,Tw=5e3,vw=5500,Iw=6e4,ww=5e3,kw=3,yl=15e4,ho=5e3,Rw=3e3,Cw=300,gc=2e7,Aw=4999,xw=5e4,Sl=36e5;var Mw=Object.defineProperty,Nw=(e,t,n)=>t in e?Mw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bl=(e,t,n)=>Nw(e,typeof t!="symbol"?t+"":t,n),Ee=(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))(Ee||{});function Ow(e){return e.nodeType===e.ELEMENT_NODE}function vr(e){return e?.host?.shadowRoot===e}function Ir(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Pw(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 Lw(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 ds(e){try{const t=e.rules||e.cssRules;return t?Pw(Array.from(t,Wp).join("")):null}catch{return null}}function Dw(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,o=r[n],s=r.getPropertyPriority(o);t+=`${o}:${r.getPropertyValue(o)}${s?" !important":""};`}return`${e.selectorText} { ${t} }`}function Wp(e){let t;if($w(e))try{t=ds(e.styleSheet)||Lw(e)}catch{}else if(Bw(e)){let n=e.cssText;const r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=Dw(e)),r&&(n=Fw(n)),r||o)return n}return t||e.cssText}function Fw(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function $w(e){return"styleSheet"in e}function Bw(e){return"selectorText"in e}let jp=class{constructor(){bl(this,"idNodeMap",new Map),bl(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Uw(){return new jp}function Gs({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 xr({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function Yn(e){return e.toLowerCase()}function ra(e){return e.toUpperCase()}const El="__rrweb_original__";function Hw(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let o=0;o<e.height;o+=n){const s=t.getImageData,i=El in s?s[El]:s;if(new Uint32Array(i.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer).some(c=>c!==0))return!1}return!0}function _c(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Yn(t):null}function fs(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function qp(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}const Tl={};function zp(e){const t=Tl[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch{}return Tl[e]=r.bind(window)}function oa(...e){return zp("setTimeout")(...e)}function Gp(...e){return zp("clearTimeout")(...e)}function Vp(e){try{return e.contentDocument}catch{}}let Ww=1;const jw=new RegExp("[^a-z0-9-_:]"),Mr=-2;function yc(){return Ww++}function qw(e){if(e instanceof HTMLFormElement)return"form";const t=Yn(e.tagName);return jw.test(t)?"div":t}function zw(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let An,vl;const Gw=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Vw=/^(?:[a-z+]+:)?\/\//i,Jw=/^www\..*/i,Yw=/^(data:)([^,]*),(.*)/i;function Kw(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let o of n){if(o=o.trim(),!o)continue;const s=o.indexOf(":");if(s===-1){r.push(o);continue}const i=o.slice(0,s).trim();t.has(i)||r.push(o)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function ps(e,t){return(e||"").replace(Gw,(n,r,o,s,i,a)=>{const c=o||i||a,u=r||s||"";if(!c)return n;if(Vw.test(c)||Jw.test(c))return`url(${u}${c}${u})`;if(Yw.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${zw(t)+c}${u})`;const d=t.split("/"),l=c.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const Xw=/^[^ \t\n\r\u000c]+/,Qw=/^[, \t\n\r\u000c]+/;function Zw(e,t){if(t.trim()==="")return t;let n=0;function r(s){let i;const a=s.exec(t.substring(n));return a?(i=a[0],n+=i.length,i):""}const o=[];for(;r(Qw),!(n>=t.length);){let s=r(Xw);if(s.slice(-1)===",")s=On(e,s.substring(0,s.length-1)),o.push(s);else{let i="";s=On(e,s);let a=!1;for(;;){const c=t.charAt(n);if(c===""){o.push((s+i).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,o.push((s+i).trim());break}else c==="("&&(a=!0);i+=c,n+=1}}}return o.join(", ")}const Il=new WeakMap;function On(e,t){return!t||t.trim()===""?t:Vs(e,t)}function ek(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Vs(e,t){let n=Il.get(e);if(n||(n=e.createElement("a"),Il.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function Jp(e,t,n,r,o,s,i){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return On(e,r);if(n==="xlink:href"&&r[0]!=="#")return On(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return On(e,r);if(n==="srcset")return Zw(e,r);if(n==="style"){let a=ps(r,Vs(e));return i&&i.size>0&&(a=Kw(a,i)),a}else if(t==="object"&&n==="data")return On(e,r);return typeof s=="function"?s(n,r,o):r}function Yp(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function tk(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){const s=e.classList[o];if(t.test(s))return!0}if(n)return e.matches(n)}catch{}return!1}function nk(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function cn(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:cn(e.parentNode,t,n,r+1)}function Pn(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(nk(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Kn(e,t,n,r,o,s){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(i.tagName==="INPUT"){const u=i.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let a=-1,c=-1;if(s){if(c=cn(i,Pn(r,o)),c<0)return!0;a=cn(i,Pn(t,n),c>=0?c:1/0)}else{if(a=cn(i,Pn(t,n)),a<0)return!1;c=cn(i,Pn(r,o),a>=0?a:1/0)}return a>=0?c>=0?a<=c:!0:c>=0?!1:!!s}catch{}return!!s}function rk(e,t,n){const r=e.contentWindow;if(!r)return;let o=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){const a=oa(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{Gp(a),o=!0,t()});return}const i="about:blank";if(r.location.href!==i||e.src===i||e.src==="")return oa(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function ok(e,t,n){let r=!1,o;try{o=e.sheet}catch{return}if(o)return;const s=oa(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{Gp(s),r=!0,t()})}function sk(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:g,maskInputFn:_,dataURLOptions:y={},inlineImages:b,recordCanvas:P,keepIframeSrcFn:A,newlyAddedElement:H=!1,ignoreCSSAttributes:N}=t,S=ik(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Ee.Document,childNodes:[],compatMode:e.compatMode}:{type:Ee.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ee.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return ck(e,{doc:n,blockClass:o,blockSelector:s,unblockSelector:i,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:h,maskInputFn:_,dataURLOptions:y,inlineImages:b,recordCanvas:P,keepIframeSrcFn:A,newlyAddedElement:H,rootId:S,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:N});case e.TEXT_NODE:return ak(e,{doc:n,maskAllText:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:g,maskInputOptions:h,maskInputFn:_,rootId:S});case e.CDATA_SECTION_NODE:return{type:Ee.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:Ee.Comment,textContent:e.textContent||"",rootId:S};default:return!1}}function ik(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function ak(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:s,unmaskTextSelector:i,maskTextFn:a,maskInputOptions:c,maskInputFn:u,rootId:d}=t,l=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=l==="STYLE"?!0:void 0,h=l==="SCRIPT"?!0:void 0,g=l==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(f=ds(e.parentNode.sheet))}catch(y){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${y}`,e)}f=ps(f,Vs(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const _=Kn(e,r,s,o,i,n);if(!p&&!h&&!g&&f&&_&&(f=a?a(f,e.parentElement):f.replace(/[\S]/g,"*")),g&&f&&(c.textarea||_)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),l==="OPTION"&&f){const y=Gs({type:null,tagName:l,maskInputOptions:c});f=xr({isMasked:Kn(e,r,s,o,i,y),element:e,value:f,maskInputFn:u})}return{type:Ee.Text,textContent:f||"",isStyle:p,rootId:d}}function ck(e,t){const{doc:n,blockClass:r,blockSelector:o,unblockSelector:s,inlineStylesheet:i,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:g,maskTextClass:_,unmaskTextClass:y,maskTextSelector:b,unmaskTextSelector:P,ignoreCSSAttributes:A}=t,H=tk(e,r,o,s),N=qw(e);let S={};const C=e.attributes.length;for(let E=0;E<C;E++){const x=e.attributes[E];x.name&&!Yp(N,x.name,x.value)&&(S[x.name]=Jp(n,N,Yn(x.name),x.value,e,c,A))}if(N==="link"&&i){const E=Array.from(n.styleSheets).find(k=>k.href===e.href);let x=null;E&&(x=ds(E)),x&&(S.rel=null,S.href=null,S.crossorigin=null,S._cssText=ps(x,E.href))}if(N==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const E=ds(e.sheet);E&&(S._cssText=ps(E,Vs(n)))}if(N==="input"||N==="textarea"||N==="select"||N==="option"){const E=e,x=_c(E),k=fs(E,ra(N),x),M=E.checked;if(x!=="submit"&&x!=="button"&&k){const O=Kn(E,_,b,y,P,Gs({type:x,tagName:ra(N),maskInputOptions:a}));S.value=xr({isMasked:O,element:E,value:k,maskInputFn:u})}M&&(S.checked=M)}if(N==="option"&&(e.selected&&!a.select?S.selected=!0:delete S.selected),N==="canvas"&&f){if(e.__context==="2d")Hw(e)||(S.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const E=e.toDataURL(d.type,d.quality),x=n.createElement("canvas");x.width=e.width,x.height=e.height;const k=x.toDataURL(d.type,d.quality);E!==k&&(S.rr_dataURL=E)}}if(N==="img"&&l){An||(An=n.createElement("canvas"),vl=An.getContext("2d"));const E=e,x=E.currentSrc||E.getAttribute("src")||"<unknown-src>",k=E.crossOrigin,M=()=>{E.removeEventListener("load",M);try{An.width=E.naturalWidth,An.height=E.naturalHeight,vl.drawImage(E,0,0),S.rr_dataURL=An.toDataURL(d.type,d.quality)}catch(O){if(E.crossOrigin!=="anonymous"){E.crossOrigin="anonymous",E.complete&&E.naturalWidth!==0?M():E.addEventListener("load",M);return}else console.warn(`Cannot inline img src=${x}! Error: ${O}`)}E.crossOrigin==="anonymous"&&(k?S.crossOrigin=k:E.removeAttribute("crossorigin"))};E.complete&&E.naturalWidth!==0?M():E.addEventListener("load",M)}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)),H){const{width:E,height:x}=e.getBoundingClientRect();S={class:S.class,rr_width:`${E}px`,rr_height:`${x}px`}}N==="iframe"&&!p(S.src)&&(!H&&!Vp(e)&&(S.rr_src=S.src),delete S.src);let F;try{customElements.get(N)&&(F=!0)}catch{}return{type:Ee.Element,tagName:N,attributes:S,childNodes:[],isSVG:ek(e)||void 0,needBlock:H,rootId:g,isCustom:F}}function le(e){return e==null?"":e.toLowerCase()}function uk(e,t){if(t.comment&&e.type===Ee.Comment)return!0;if(e.type===Ee.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"&&qp(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(le(e.attributes.name).match(/^msapplication-tile(image|color)$/)||le(e.attributes.name)==="application-name"||le(e.attributes.rel)==="icon"||le(e.attributes.rel)==="apple-touch-icon"||le(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&le(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(le(e.attributes.property).match(/^(og|twitter|fb):/)||le(e.attributes.name).match(/^(og|twitter):/)||le(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(le(e.attributes.name)==="robots"||le(e.attributes.name)==="googlebot"||le(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(le(e.attributes.name)==="author"||le(e.attributes.name)==="generator"||le(e.attributes.name)==="framework"||le(e.attributes.name)==="publisher"||le(e.attributes.name)==="progid"||le(e.attributes.property).match(/^article:/)||le(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(le(e.attributes.name)==="google-site-verification"||le(e.attributes.name)==="yandex-verification"||le(e.attributes.name)==="csrf-token"||le(e.attributes.name)==="p:domain_verify"||le(e.attributes.name)==="verify-v1"||le(e.attributes.name)==="verification"||le(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ln(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:b,dataURLOptions:P={},inlineImages:A=!1,recordCanvas:H=!1,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:C=5e3,onBlockedImageLoad:F,onStylesheetLoad:E,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:k=()=>!1,newlyAddedElement:M=!1,ignoreCSSAttributes:O}=t;let{preserveWhiteSpace:ee=!0}=t;const K=sk(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,dataURLOptions:P,inlineImages:A,recordCanvas:H,keepIframeSrcFn:k,newlyAddedElement:M,ignoreCSSAttributes:O});if(!K)return console.warn(e,"not serialized"),null;let ne;r.hasNode(e)?ne=r.getId(e):uk(K,b)||!ee&&K.type===Ee.Text&&!K.isStyle&&!K.textContent.replace(/^\s+|\s+$/gm,"").length?ne=Mr:ne=yc();const T=Object.assign(K,{id:ne});if(r.add(e,T),ne===Mr)return null;N&&N(e);let j=!f;if(T.type===Ee.Element){j=j&&!T.needBlock;const I=e.shadowRoot;I&&Ir(I)&&(T.isShadowHost=!0)}if((T.type===Ee.Document||T.type===Ee.Element)&&j){b.headWhitespace&&T.type===Ee.Element&&T.tagName==="head"&&(ee=!1);const I={doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:b,dataURLOptions:P,inlineImages:A,recordCanvas:H,preserveWhiteSpace:ee,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:F,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:k,ignoreCSSAttributes:O},G=e.childNodes?Array.from(e.childNodes):[];for(const se of G){const re=Ln(se,I);re&&T.childNodes.push(re)}if(Ow(e)&&e.shadowRoot)for(const se of Array.from(e.shadowRoot.childNodes)){const re=Ln(se,I);re&&(Ir(e.shadowRoot)&&(re.isShadow=!0),T.childNodes.push(re))}}if(e.parentNode&&vr(e.parentNode)&&Ir(e.parentNode)&&(T.isShadow=!0),T.type===Ee.Element&&T.tagName==="iframe"&&!T.needBlock&&rk(e,()=>{const I=Vp(e);if(I&&S){const G=Ln(I,{doc:I,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:b,dataURLOptions:P,inlineImages:A,recordCanvas:H,preserveWhiteSpace:ee,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:C,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:k,ignoreCSSAttributes:O});G&&S(e,G)}},C),T.type===Ee.Element&&T.tagName==="img"&&!e.complete&&T.needBlock){const I=e,G=()=>{if(I.isConnected&&!I.complete&&F)try{const se=I.getBoundingClientRect();se.width>0&&se.height>0&&F(I,T,se)}catch{}I.removeEventListener("load",G)};I.isConnected&&I.addEventListener("load",G)}return T.type===Ee.Element&&T.tagName==="link"&&typeof T.attributes.rel=="string"&&(T.attributes.rel==="stylesheet"||T.attributes.rel==="preload"&&typeof T.attributes.href=="string"&&qp(T.attributes.href)==="css")&&ok(e,()=>{if(E){const I=Ln(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:b,dataURLOptions:P,inlineImages:A,recordCanvas:H,preserveWhiteSpace:ee,onSerialize:N,onIframeLoad:S,iframeLoadTimeout:C,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:k,ignoreCSSAttributes:O});I&&E(e,I)}},x),T.type===Ee.Element&&delete T.needBlock,T}function lk(e,t){const{mirror:n=new jp,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:s=null,maskAllText:i=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOM:b=!1,dataURLOptions:P,preserveWhiteSpace:A,onSerialize:H,onIframeLoad:N,iframeLoadTimeout:S,onBlockedImageLoad:C,onStylesheetLoad:F,stylesheetLoadTimeout:E,keepIframeSrcFn:x=()=>!1,ignoreCSSAttributes:k=new Set([])}=t||{};return Ln(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,maskAllText:i,maskTextClass:a,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:l,maskInputOptions:h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:h===!1?{}:h,maskAttributeFn:g,maskTextFn:_,maskInputFn:y,slimDOMOptions:b===!0||b==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:b==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:b===!1?{}:b,dataURLOptions:P,inlineImages:f,recordCanvas:p,preserveWhiteSpace:A,onSerialize:H,onIframeLoad:N,iframeLoadTimeout:S,onBlockedImageLoad:C,onStylesheetLoad:F,stylesheetLoadTimeout:E,keepIframeSrcFn:x,newlyAddedElement:!1,ignoreCSSAttributes:k})}function Oe(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const xn=`Please stop import mirror directly. Instead of that,\r
495
- now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
496
- or you can use record.mirror to access the mirror instance during recording.`;let wl={map:{},getId(){return console.error(xn),-1},getNode(){return console.error(xn),null},removeNodeFromMap(){console.error(xn)},has(){return console.error(xn),!1},reset(){console.error(xn)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(wl=new Proxy(wl,{get(e,t,n){return t==="map"&&console.error(xn),Reflect.get(e,t,n)}}));function Nr(e,t,n={}){let r=null,o=0;return function(...s){const i=Date.now();!o&&n.leading===!1&&(o=i);const a=t-(i-o),c=this;a<=0||a>t?(r&&(_k(r),r=null),o=i,e.apply(c,s)):!r&&n.trailing!==!1&&(r=Js(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,s)},a))}}function Kp(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(i){Js(()=>{n.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>Kp(e,t,s||{},!0)}function Sc(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}let hs=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(hs=()=>new Date().getTime());function Xp(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function Qp(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Zp(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function eh(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function qe(e,t,n,r,o){if(!e)return!1;const s=eh(e);if(!s)return!1;const i=Pn(t,n);if(!o){const u=r&&s.matches(r);return i(s)&&!u}const a=cn(s,i);let c=-1;return a<0?!1:(r&&(c=cn(s,Pn(null,r))),a>-1&&c<0?!0:a<c)}function dk(e,t){return t.getId(e)!==-1}function Ti(e,t){return t.getId(e)===Mr}function th(e,t){if(vr(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?th(e.parentNode,t):!0:!0}function sa(e){return!!e.changedTouches}function fk(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 nh(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function rh(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ia(e){return!!e?.shadowRoot}class pk{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 oh(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function hk(e){let t=e,n;for(;n=oh(t);)t=n;return t}function mk(e){const t=e.ownerDocument;if(!t)return!1;const n=hk(e);return t.contains(n)}function sh(e){const t=e.ownerDocument;return t?t.contains(e)||mk(e):!1}const kl={};function bc(e){const t=kl[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch{}return kl[e]=r.bind(window)}function gk(...e){return bc("requestAnimationFrame")(...e)}function Js(...e){return bc("setTimeout")(...e)}function _k(...e){return bc("clearTimeout")(...e)}var V=(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))(V||{}),W=(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))(W||{}),Ne=(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))(Ne||{}),Et=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Et||{}),Mn=(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))(Mn||{});function Ec(e){try{return e.contentDocument}catch{}}function yk(e){try{return e.contentWindow}catch{}}function Rl(e){return"__ln"in e}class Sk{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?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Rl(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&&Rl(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 Cl=(e,t)=>`${e}@${t}`;class bk{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 Sk,o=c=>{let u=c,d=Mr;for(;d===Mr;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},s=c=>{if(!c.parentNode||!sh(c))return;const u=vr(c.parentNode)?this.mirror.getId(oh(c)):this.mirror.getId(c.parentNode),d=o(c);if(u===-1||d===-1)return r.addNode(c);const l=Ln(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{nh(f,this.mirror)&&!qe(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),rh(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),ia(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{qe(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 c of this.movedSet)Al(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||s(c);for(const c of this.addedSet)!xl(this.droppedSet,c)&&!Al(this.removes,c,this.mirror)||xl(this.movedSet,c)?s(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const u=this.mirror.getId(i.value.parentNode),d=o(i.value);u!==-1&&d!==-1&&(c=i)}if(!c){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(o(d.value)===-1)continue;if(l!==-1){c=d;break}else{const p=d.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){c=d;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),s(c.value)}const a={texts:this.texts.map(c=>({id:this.mirror.getId(c.node),value:c.value})).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:u}=c;if(typeof u.style=="string"){const d=JSON.stringify(c.styleDiff),l=JSON.stringify(c._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:u}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Ti(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!qe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Kn(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,eh(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,o=t.target.getAttribute(r);if(r==="value"){const i=_c(n),a=n.tagName;o=fs(n,a,i);const c=Gs({maskInputOptions:this.maskInputOptions,tagName:a,type:i}),u=Kn(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);o=xr({isMasked:u,element:n,value:o,maskInputFn:this.maskInputFn})}if(qe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===t.oldValue)return;let s=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!Ec(n))r="rr_src";else return;if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Yp(n.tagName,r)&&(s.attributes[r]=Jp(this.doc,Yn(n.tagName),Yn(r),o,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const i=this.unattachedDoc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue);for(const a of Array.from(n.style)){const c=n.style.getPropertyValue(a),u=n.style.getPropertyPriority(a);c!==i.style.getPropertyValue(a)||u!==i.style.getPropertyPriority(a)?u===""?s.styleDiff[a]=c:s.styleDiff[a]=[c,u]:s._unchangedStyles[a]=[c,u]}for(const a of Array.from(i.style))n.style.getPropertyValue(a)===""&&(s.styleDiff[a]=!1)}break}case"childList":{if(qe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=vr(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);qe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Ti(n,this.mirror)||!dk(n,this.mirror)||(this.addedSet.has(n)?(aa(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||th(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Cl(r,o)]?aa(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:vr(t.target)&&Ir(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(Ti(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[Cl(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);qe(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),ia(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 aa(e,t){e.delete(t),t.childNodes?.forEach(n=>aa(e,n))}function Al(e,t,n){return e.length===0?!1:Ek(e,t,n)}function Ek(e,t,n){let r=t.parentNode;for(;r;){const o=n.getId(r);if(e.some(s=>s.id===o))return!0;r=r.parentNode}return!1}function xl(e,t){return e.size===0?!1:ih(e,t)}function ih(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:ih(e,n):!1}let wr;function Tk(e){wr=e}function vk(){wr=void 0}const te=e=>wr?(...n)=>{try{return e(...n)}catch(r){if(wr&&wr(r)===!0)return()=>{};throw r}}:e,Dn=[];function Zr(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 ah(e,t){const n=new bk;Dn.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);const s=new r(te(i=>{e.onMutation&&e.onMutation(i)===!1||n.processMutations.bind(n)(i)}));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ik({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let i=[],a;const c=Nr(te(l=>{const f=Date.now()-a;e(i.map(p=>(p.timeOffset-=f,p)),l),i=[],a=null}),s),u=te(Nr(te(l=>{const f=Zr(l),{clientX:p,clientY:h}=sa(l)?l.changedTouches[0]:l;a||(a=hs()),i.push({x:p,y:h,id:r.getId(f),timeOffset:hs()-a}),c(typeof DragEvent<"u"&&l instanceof DragEvent?W.Drag:l instanceof MouseEvent?W.MouseMove:W.TouchMove)}),o,{trailing:!1})),d=[Oe("mousemove",u,n),Oe("touchmove",u,n),Oe("drag",u,n)];return te(()=>{d.forEach(l=>l())})}function wk({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,c=[];let u=null;const d=l=>f=>{const p=Zr(f);if(qe(p,r,o,s,!0))return;let h=null,g=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=Et.Mouse;break;case"touch":h=Et.Touch;break;case"pen":h=Et.Pen;break}h===Et.Touch?Ne[l]===Ne.MouseDown?g="TouchStart":Ne[l]===Ne.MouseUp&&(g="TouchEnd"):Et.Pen}else sa(f)&&(h=Et.Touch);h!==null?(u=h,(g.startsWith("Touch")&&h===Et.Touch||g.startsWith("Mouse")&&h===Et.Mouse)&&(h=null)):Ne[l]===Ne.Click&&(h=u,u=null);const _=sa(f)?f.changedTouches[0]:f;if(!_)return;const y=n.getId(p),{clientX:b,clientY:P}=_;te(e)({type:Ne[g],id:y,x:b,y:P,...h!==null&&{pointerType:h}})};return Object.keys(Ne).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let f=Yn(l);const p=d(l);if(window.PointerEvent)switch(Ne[l]){case Ne.MouseDown:case Ne.MouseUp:f=f.replace("mouse","pointer");break;case Ne.TouchStart:case Ne.TouchEnd:return}c.push(Oe(f,p,t))}),te(()=>{c.forEach(l=>l())})}function ch({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){const a=te(Nr(te(c=>{const u=Zr(c);if(!u||qe(u,r,o,s,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=Xp(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),i.scroll||100));return Oe("scroll",a,t)}function kk({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const o=te(Nr(te(()=>{const s=Qp(),i=Zp();(n!==s||r!==i)&&(e({width:Number(i),height:Number(s)}),n=s,r=i)}),200));return Oe("resize",o,t)}const Rk=["INPUT","TEXTAREA","SELECT"],Ml=new WeakMap;function Ck({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,ignoreClass:i,ignoreSelector:a,maskInputOptions:c,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g}){function _(S){let C=Zr(S);const F=S.isTrusted,E=C&&ra(C.tagName);if(E==="OPTION"&&(C=C.parentElement),!C||!E||Rk.indexOf(E)<0||qe(C,r,o,s,!0))return;const x=C;if(x.classList.contains(i)||a&&x.matches(a))return;const k=_c(C);let M=fs(x,E,k),O=!1;const ee=Gs({maskInputOptions:c,tagName:E,type:k}),K=Kn(C,f,h,p,g,ee);(k==="radio"||k==="checkbox")&&(O=C.checked),M=xr({isMasked:K,element:C,value:M,maskInputFn:u}),y(C,l?{text:M,isChecked:O,userTriggered:F}:{text:M,isChecked:O});const ne=C.name;k==="radio"&&ne&&O&&t.querySelectorAll(`input[type="radio"][name="${ne}"]`).forEach(T=>{if(T!==C){const j=xr({isMasked:K,element:T,value:fs(T,E,k),maskInputFn:u});y(T,l?{text:j,isChecked:!O,userTriggered:!1}:{text:j,isChecked:!O})}})}function y(S,C){const F=Ml.get(S);if(!F||F.text!==C.text||F.isChecked!==C.isChecked){Ml.set(S,C);const E=n.getId(S);te(e)({...C,id:E})}}const P=(d.input==="last"?["change"]:["input","change"]).map(S=>Oe(S,te(_),t)),A=t.defaultView;if(!A)return()=>{P.forEach(S=>S())};const H=A.Object.getOwnPropertyDescriptor(A.HTMLInputElement.prototype,"value"),N=[[A.HTMLInputElement.prototype,"value"],[A.HTMLInputElement.prototype,"checked"],[A.HTMLSelectElement.prototype,"value"],[A.HTMLTextAreaElement.prototype,"value"],[A.HTMLSelectElement.prototype,"selectedIndex"],[A.HTMLOptionElement.prototype,"selected"]];return H&&H.set&&P.push(...N.map(S=>Kp(S[0],S[1],{set(){te(_)({target:this,isTrusted:!1})}},!1,A))),te(()=>{P.forEach(S=>S())})}function ms(e){const t=[];function n(r,o){if(mo("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||mo("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||mo("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||mo("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else if(r.parentStyleSheet){const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function Bt(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Ak({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:te((d,l,f)=>{const[p,h]=f,{id:g,styleId:_}=Bt(l,t,n.styleMirror);return(g&&g!==-1||_&&_!==-1)&&e({id:g,styleId:_,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const s=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:te((d,l,f)=>{const[p]=f,{id:h,styleId:g}=Bt(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,removes:[{index:p}]}),d.apply(l,f)})});let i;r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:te((d,l,f)=>{const[p]=f,{id:h,styleId:g}=Bt(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replace:p}),d.apply(l,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:te((d,l,f)=>{const[p]=f,{id:h,styleId:g}=Bt(l,t,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&e({id:h,styleId:g,replaceSync:p}),d.apply(l,f)})}));const c={};go("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(go("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),go("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),go("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(c).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:te((f,p,h)=>{const[g,_]=h,{id:y,styleId:b}=Bt(p.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||b&&b!==-1)&&e({id:y,styleId:b,adds:[{rule:g,index:[...ms(p),_||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:te((f,p,h)=>{const[g]=h,{id:_,styleId:y}=Bt(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||y&&y!==-1)&&e({id:_,styleId:y,removes:[{index:[...ms(p),g]}]}),f.apply(p,h)})})}),te(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function uh({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const o=n.nodeName==="#document"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,s=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!s?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return s.get?.call(this)},set(i){const a=s.set?.call(this,i);if(r!==null&&r!==-1)try{t.adoptStyleSheets(i,r)}catch{}return a}}),te(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function xk({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:te((a,c,u)=>{const[d,l,f]=u;if(n.has(d))return s.apply(c,[d,l,f]);const{id:p,styleId:h}=Bt(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:ms(c.parentRule)}),a.apply(c,u)})});const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:te((a,c,u)=>{const[d]=u;if(n.has(d))return i.apply(c,[d]);const{id:l,styleId:f}=Bt(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||f&&f!==-1)&&e({id:l,styleId:f,remove:{property:d},index:ms(c.parentRule)}),a.apply(c,u)})}),te(()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i})}function Mk({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:s,doc:i}){const a=te(u=>Nr(te(d=>{const l=Zr(d);if(!l||qe(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:g}=l;e({type:u,id:o.getId(l),currentTime:f,volume:p,muted:h,playbackRate:g})}),s.media||500)),c=[Oe("play",a(Mn.Play),i),Oe("pause",a(Mn.Pause),i),Oe("seeked",a(Mn.Seeked),i),Oe("volumechange",a(Mn.VolumeChange),i),Oe("ratechange",a(Mn.RateChange),i)];return te(()=>{c.forEach(u=>u())})}function Nk({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(c,u,d){const l=new s(c,u,d);return o.set(l,{family:c,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const i=Sc(t.fonts,"add",function(a){return function(c){return Js(te(()=>{const u=o.get(c);u&&(e(u),o.delete(c))}),0),a.apply(this,[c])}});return r.push(()=>{n.FontFace=s}),r.push(i),te(()=>{r.forEach(a=>a())})}function Ok(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,selectionCb:i}=e;let a=!0;const c=te(()=>{const u=t.getSelection();if(!u||a&&u?.isCollapsed)return;a=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f<l;f++){const p=u.getRangeAt(f),{startContainer:h,startOffset:g,endContainer:_,endOffset:y}=p;qe(h,r,o,s,!0)||qe(_,r,o,s,!0)||d.push({start:n.getId(h),startOffset:g,end:n.getId(_),endOffset:y})}i({ranges:d})});return c(),Oe("selectionchange",c)}function Pk({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:Sc(n.customElements,"define",function(o){return function(s,i,a){try{t({define:{name:s}})}catch{}return o.apply(this,[s,i,a])}})}function Lk(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=ah(e,e.doc));const o=Ik(e),s=wk(e),i=ch(e),a=kk(e,{win:n}),c=Ck(e),u=Mk(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=Ak(e,{win:n}),l=uh(e,e.doc),f=xk(e,{win:n}),e.collectFonts&&(p=Nk(e)));const h=Ok(e),g=Pk(e),_=[];for(const y of e.plugins)_.push(y.observer(y.callback,n,y.options));return te(()=>{Dn.forEach(y=>y.reset()),r?.disconnect(),o(),s(),i(),a(),c(),u(),d(),l(),f(),p(),h(),g(),_.forEach(y=>y())})}function mo(e){return typeof window[e]<"u"}function go(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ca{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){const s=r||this.getIdToRemoteIdMap(t),i=o||this.getRemoteIdToIdMap(t);let a=s.get(n);return a||(a=this.generateIdFn(),s.set(n,a),i.set(a,n)),a}getIds(t,n){const r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(s=>this.getId(t,s,r,o))}getRemoteId(t,n,r){const o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const s=o.get(n);return s||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}class Dk{constructor(){this.crossOriginIframeMirror=new ca(yc),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Fk{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ca(yc),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ca(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){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&t.contentWindow?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);const r=Ec(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const o=this.crossOriginIframeMap.get(t.source);if(!o)return;const s=this.transformCrossOriginEvent(o,n.data.event);s&&this.wrappedEmit(s,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case V.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:V.IncrementalSnapshot,data:{source:W.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case V.Meta:case V.Load:case V.DomContentLoaded:return!1;case V.Plugin:return n;case V.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case V.IncrementalSnapshot:switch(n.data.source){case W.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case W.Drag:case W.TouchMove:case W.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case W.ViewportResize:return!1;case W.MediaInteraction:case W.MouseInteraction:case W.Scroll:case W.CanvasMutation:case W.Input:return this.replaceIds(n.data,t,["id"]),n;case W.StyleSheetRule:case W.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case W.Font:return n;case W.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case W.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),n}}return!1}replace(t,n,r,o){for(const s of o)!Array.isArray(n[s])&&typeof n[s]!="number"||(Array.isArray(n[s])?n[s]=t.getIds(r,n[s]):n[s]=t.getId(r,n[s]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==Ee.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class $k{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Bk{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(!Ir(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=ah({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(ch({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),Js(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(uh({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=Ec(t),r=yk(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(Sc(t.prototype,"attachShadow",function(o){return function(s){const i=o.call(this,s);return this.shadowRoot&&sh(this)&&r.addShadowRoot(this.shadowRoot,n),i}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var Nl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Uk=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var _o=0;_o<Nl.length;_o++)Uk[Nl.charCodeAt(_o)]=_o;class Ol{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class Hk{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new pk,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},o=[];for(const s of t){let i;this.styleMirror.has(s)?i=this.styleMirror.getId(s):(i=this.styleMirror.add(s),o.push({styleId:i,rules:Array.from(s.rules||CSSRule,(a,c)=>({rule:Wp(a),index:c}))})),r.styleIds.push(i)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Wk{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(o=>o!==n)}add(t,n){this.active||(this.active=!0,gk(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let ge,gs;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Ze=Uw();function wt(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,unblockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:g,maskInputOptions:_,slimDOMOptions:y,maskAttributeFn:b,maskInputFn:P,maskTextFn:A,maxCanvasSize:H=null,packFn:N,sampling:S={},dataURLOptions:C={},mousemoveWait:F,recordDOM:E=!0,recordCanvas:x=!1,recordCrossOriginIframes:k=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:O=!1,collectFonts:ee=!1,inlineImages:K=!1,plugins:ne,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:j=new Set([]),errorHandler:I,onMutation:G,getCanvasManager:se}=e;Tk(I);const re=k?window.parent===window:!0;let ye=!1;if(!re)try{window.parent.document&&(ye=!1)}catch{ye=!0}if(re&&!t)throw new Error("emit function is required");if(!re&&!ye)return()=>{};F!==void 0&&S.mousemove===void 0&&(S.mousemove=F),Ze.reset();const xe=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?_:{},Lt=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};fk();let Me,De=0;const ut=X=>{for(const He of ne||[])He.eventProcessor&&(X=He.eventProcessor(X));return N&&!ye&&(X=N(X)),X};ge=(X,He)=>{const Q=X;if(Q.timestamp=hs(),Dn[0]?.isFrozen()&&Q.type!==V.FullSnapshot&&!(Q.type===V.IncrementalSnapshot&&Q.data.source===W.Mutation)&&Dn.forEach(ke=>ke.unfreeze()),re)t?.(ut(Q),He);else if(ye){const ke={type:"rrweb",event:ut(Q),origin:window.location.origin,isCheckout:He};window.parent.postMessage(ke,"*")}if(Q.type===V.FullSnapshot)Me=Q,De=0;else if(Q.type===V.IncrementalSnapshot){if(Q.data.source===W.Mutation&&Q.data.isAttachIframe)return;De++;const ke=r&&De>=r,oe=n&&Me&&Q.timestamp-Me.timestamp>n;(ke||oe)&&lt(!0)}};const Dt=X=>{ge({type:V.IncrementalSnapshot,data:{source:W.Mutation,...X}})},lr=X=>ge({type:V.IncrementalSnapshot,data:{source:W.Scroll,...X}}),to=X=>ge({type:V.IncrementalSnapshot,data:{source:W.CanvasMutation,...X}}),dr=X=>ge({type:V.IncrementalSnapshot,data:{source:W.AdoptedStyleSheet,...X}}),ie=new Hk({mutationCb:Dt,adoptedStyleSheetCb:dr}),pe=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Dk:new Fk({mirror:Ze,mutationCb:Dt,stylesheetManager:ie,recordCrossOriginIframes:k,wrappedEmit:ge});for(const X of ne||[])X.getMirror&&X.getMirror({nodeMirror:Ze,crossOriginIframeMirror:pe.crossOriginIframeMirror,crossOriginIframeStyleMirror:pe.crossOriginIframeStyleMirror});const Ve=new Wk,we=qk(se,{mirror:Ze,win:window,mutationCb:X=>ge({type:V.IncrementalSnapshot,data:{source:W.CanvasMutation,...X}}),recordCanvas:x,blockClass:o,blockSelector:s,unblockSelector:i,maxCanvasSize:H,sampling:S.canvas,dataURLOptions:C,errorHandler:I}),Ce=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new $k:new Bk({mutationCb:Dt,scrollCb:lr,bypassOptions:{onMutation:G,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:xe,dataURLOptions:C,maskAttributeFn:b,maskTextFn:A,maskInputFn:P,recordCanvas:x,inlineImages:K,sampling:S,slimDOMOptions:Lt,iframeManager:pe,stylesheetManager:ie,canvasManager:we,keepIframeSrcFn:T,processedNodeManager:Ve,ignoreCSSAttributes:j},mirror:Ze}),lt=(X=!1)=>{if(!E)return;ge({type:V.Meta,data:{href:window.location.href,width:Zp(),height:Qp()}},X),ie.reset(),Ce.init(),Dn.forEach(Q=>Q.lock());const He=lk(document,{mirror:Ze,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:xe,maskAttributeFn:b,maskInputFn:P,maskTextFn:A,slimDOM:Lt,dataURLOptions:C,recordCanvas:x,inlineImages:K,onSerialize:Q=>{nh(Q,Ze)&&pe.addIframe(Q),rh(Q,Ze)&&ie.trackLinkElement(Q),ia(Q)&&Ce.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,ke)=>{pe.attachIframe(Q,ke),Q.contentWindow&&we.addWindow(Q.contentWindow),Ce.observeAttachShadow(Q)},onStylesheetLoad:(Q,ke)=>{ie.attachLinkElement(Q,ke)},onBlockedImageLoad:(Q,ke,{width:oe,height:fr})=>{Dt({adds:[],removes:[],texts:[],attributes:[{id:ke.id,attributes:{style:{width:`${oe}px`,height:`${fr}px`}}}]})},keepIframeSrcFn:T,ignoreCSSAttributes:j});if(!He)return console.warn("Failed to snapshot the document");ge({type:V.FullSnapshot,data:{node:He,initialOffset:Xp(window)}}),Dn.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ie.adoptStyleSheets(document.adoptedStyleSheets,Ze.getId(document))};gs=lt;try{const X=[],He=ke=>te(Lk)({onMutation:G,mutationCb:Dt,mousemoveCb:(oe,fr)=>ge({type:V.IncrementalSnapshot,data:{source:fr,positions:oe}}),mouseInteractionCb:oe=>ge({type:V.IncrementalSnapshot,data:{source:W.MouseInteraction,...oe}}),scrollCb:lr,viewportResizeCb:oe=>ge({type:V.IncrementalSnapshot,data:{source:W.ViewportResize,...oe}}),inputCb:oe=>ge({type:V.IncrementalSnapshot,data:{source:W.Input,...oe}}),mediaInteractionCb:oe=>ge({type:V.IncrementalSnapshot,data:{source:W.MediaInteraction,...oe}}),styleSheetRuleCb:oe=>ge({type:V.IncrementalSnapshot,data:{source:W.StyleSheetRule,...oe}}),styleDeclarationCb:oe=>ge({type:V.IncrementalSnapshot,data:{source:W.StyleDeclaration,...oe}}),canvasMutationCb:to,fontCb:oe=>ge({type:V.IncrementalSnapshot,data:{source:W.Font,...oe}}),selectionCb:oe=>{ge({type:V.IncrementalSnapshot,data:{source:W.Selection,...oe}})},customElementCb:oe=>{ge({type:V.IncrementalSnapshot,data:{source:W.CustomElement,...oe}})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:xe,inlineStylesheet:h,sampling:S,recordDOM:E,recordCanvas:x,inlineImages:K,userTriggeredOnInput:O,collectFonts:ee,doc:ke,maskAttributeFn:b,maskInputFn:P,maskTextFn:A,keepIframeSrcFn:T,blockSelector:s,unblockSelector:i,slimDOMOptions:Lt,dataURLOptions:C,mirror:Ze,iframeManager:pe,stylesheetManager:ie,shadowDomManager:Ce,processedNodeManager:Ve,canvasManager:we,ignoreCSSAttributes:j,plugins:ne?.filter(oe=>oe.observer)?.map(oe=>({observer:oe.observer,options:oe.options,callback:fr=>ge({type:V.Plugin,data:{plugin:oe.name,payload:fr}})}))||[]},{});pe.addLoadListener(ke=>{try{X.push(He(ke.contentDocument))}catch(oe){console.warn(oe)}});const Q=()=>{lt(),X.push(He(document))};return document.readyState==="interactive"||document.readyState==="complete"?Q():(X.push(Oe("DOMContentLoaded",()=>{ge({type:V.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&Q()})),X.push(Oe("load",()=>{ge({type:V.Load,data:{}}),M==="load"&&Q()},window))),()=>{X.forEach(ke=>ke()),Ve.destroy(),gs=void 0,vk()}}catch(X){console.warn(X)}}function jk(e){if(!gs)throw new Error("please take full snapshot after start recording");gs(e)}wt.mirror=Ze;wt.takeFullSnapshot=jk;function qk(e,t){try{return e?e(t):new Ol}catch{return console.warn("Unable to initialize CanvasManager"),new Ol}}var Pl;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Pl||(Pl={}));const zk=3,Gk=5;function Tc(e){return e>9999999999?e:e*1e3}function vi(e){return e>9999999999?e/1e3:e}function eo(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:V.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:je(t,10,1e3)}}),t.category==="console")))}const Vk="button,a";function lh(e){return e.closest(Vk)||e}function dh(e){const t=fh(e);return!t||!(t instanceof Element)?t:lh(t)}function fh(e){return Jk(e)?e.target:e}function Jk(e){return typeof e=="object"&&!!e&&"target"in e}let Ut;function Yk(e){return Ut||(Ut=[],Kk()),Ut.push(e),()=>{const t=Ut?Ut.indexOf(e):-1;t>-1&&Ut.splice(t,1)}}function Kk(){Re(de,"open",function(e){return function(...t){if(Ut)try{Ut.forEach(n=>n())}catch{}return e.apply(de,t)}})}const Xk=new Set([W.Mutation,W.StyleSheetRule,W.StyleDeclaration,W.AdoptedStyleSheet,W.CanvasMutation,W.Selection,W.MediaInteraction]);function Qk(e,t,n){e.handleClick(t,n)}class Zk{constructor(t,n,r=eo){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=Yk(()=>{this._lastMutation=Ll()});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(tR(n,this._ignoreSelector)||!nR(t))return;const r={timestamp:vi(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(o=>o.node===r.node&&Math.abs(o.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=vi(t)}registerScroll(t=Date.now()){this._lastScroll=vi(t)}registerClick(t){const n=lh(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=Ll();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(const r of t){const o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,o=t.mutationAfter&&t.mutationAfter<=this._threshold,s=!r&&!o,{clickCount:i,clickBreadcrumb:a}=t;if(s){const c=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=c<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:{...a.data,url:de.location.href,route:n.getCurrentRoute(),timeAfterClickMs:c,endReason:u,clickCount:i||1}};this._addBreadcrumbEvent(n,d);return}if(i>1){const c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:de.location.href,route:n.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Qr(()=>this._checkClicks(),1e3)}}const eR=["A","BUTTON","INPUT"];function tR(e,t){return!!(!eR.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 nR(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function Ll(){return Date.now()/1e3}function rR(e,t){try{if(!oR(t))return;const{source:n}=t.data;if(Xk.has(n)&&e.registerMutation(t.timestamp),n===W.Scroll&&e.registerScroll(t.timestamp),sR(t)){const{type:r,id:o}=t.data,s=wt.mirror.getNode(o);s instanceof HTMLElement&&r===Ne.Click&&e.registerClick(s)}}catch{}}function oR(e){return e.type===zk}function sR(e){return e.data.source===W.MouseInteraction}function ft(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var vc=(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))(vc||{});const iR=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function aR(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(iR.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const cR=e=>t=>{if(!e.isEnabled())return;const n=uR(t);if(!n)return;const r=t.name==="click",o=r?t.event:void 0;r&&e.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&Qk(e.clickDetector,n,dh(t.event)),eo(e,n)};function ph(e,t){const n=wt.mirror.getId(e),r=n&&wt.mirror.getNode(n),o=r&&wt.mirror.getMeta(r),s=o&&dR(o)?o:null;return{message:t,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(i=>i.type===vc.Text&&i.textContent).filter(Boolean).map(i=>i.trim()).join(""),attributes:aR(s.attributes)}}:{}}}function uR(e){const{target:t,message:n}=lR(e);return ft({category:`ui.${e.name}`,...ph(t,n)})}function lR(e){const t=e.name==="click";let n,r=null;try{r=t?dh(e.event):fh(e.event),n=Ue(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function dR(e){return e.type===vc.Element}function fR(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=pR(t);n&&eo(e,n)}function pR(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s,target:i}=e;if(!i||hR(i)||!s)return null;const a=t||r||o,c=s.length===1;if(!a&&c)return null;const u=Ue(i,{maxStringLength:200})||"<unknown>",d=ph(i,u);return ft({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s}})}function hR(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const mR={resource:bR,paint:yR,navigation:SR};function Ii(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function gR(e){return e.map(_R).filter(Boolean)}function _R(e){const t=mR[e.entryType];return t?t(e):null}function Xn(e){return((Ae()||de.performance.timeOrigin)+e)/1e3}function yR(e){const{duration:t,entryType:n,name:r,startTime:o}=e,s=Xn(o);return{type:n,name:r,start:s,end:s+t,data:void 0}}function SR(e){const{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:s,encodedBodySize:i,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:g}=e;return o===0?null:{type:`${t}.${g}`,start:Xn(p),end:Xn(s),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:i,duration:o,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:d,loadEventEnd:l,domComplete:s,redirectCount:f}}}function bR(e){const{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:s,decodedBodySize:i,encodedBodySize:a,responseStatus:c,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Xn(s),end:Xn(o),name:r,data:{size:u,statusCode:c,decodedBodySize:i,encodedBodySize:a}}}function ER(e){const t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return Ic(e,"largest-contentful-paint",n)}function TR(e){return e.sources!==void 0}function vR(e){const t=[],n=[];for(const r of e.entries)if(TR(r)){const o=[];for(const s of r.sources)if(s.node){n.push(s.node);const i=wt.mirror.getId(s.node);i&&o.push(i)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return Ic(e,"cumulative-layout-shift",n,t)}function IR(e){const t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return Ic(e,"interaction-to-next-paint",n)}function Ic(e,t,n,r){const o=e.value,s=e.rating,i=Xn(o);return{type:"web-vital",name:t,start:i,end:i,data:{value:o,size:o,rating:s,nodeIds:n?n.map(a=>wt.mirror.getId(a)):void 0,attributions:r}}}function wR(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function n({entries:o}){o.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(o=>{r.push(En(o,n))}),r.push(uc(Ii(ER,e)),cc(Ii(vR,e)),Ep(Ii(IR,e))),()=>{r.forEach(o=>o())}}const $=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,kR='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 RR(){const e=new Blob([kR]);return URL.createObjectURL(e)}const Dl=["log","warn","error"],Bo="[Replay] ";function wi(e,t="info"){xt({category:"console",data:{logger:"replay"},level:t,message:`${Bo}${e}`},{level:t})}function CR(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return $?(Dl.forEach(r=>{n[r]=(...o)=>{m[r](Bo,...o),t&&wi(o.join(""),Zo(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),m.error(Bo,r),e?me(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&wi(r,"error")},n.infoTick=(...r)=>{m.log(Bo,...r),t&&setTimeout(()=>wi(r[0]),0)}):Dl.forEach(r=>{n[r]=()=>{}}),n}const B=CR();class wc extends Error{constructor(){super(`Event buffer exceeded maximum size of ${gc}.`)}}class hh{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>gc)throw new wc;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?Tc(t):null}}class AR{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(){$&&B.log("Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((o,s)=>{const i=({data:a})=>{const c=a;if(c.method===t&&c.id===r){if(this._worker.removeEventListener("message",i),!c.success){$&&B.error("Error in compression worker: ",c.response),s(new Error("Error in compression worker"));return}o(c.response)}};this._worker.addEventListener("message",i),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class xR{constructor(t){this._worker=new AR(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=Tc(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>gc?Promise.reject(new wc):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{$&&B.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 MR{constructor(t){this._fallback=new hh,this._compression=new xR(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){$&&B.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(const s of t)o.push(this._compression.addEvent(s));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(o),this._fallback.clear()}catch(s){$&&B.exception(s,"Failed to add events when switching buffers.")}}}function NR({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=OR(t);if(n)return n}return $&&B.log("Using simple buffer"),new hh}function OR(e){try{const t=e||PR();if(!t)return;$&&B.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new MR(n)}catch(t){$&&B.exception(t,"Failed to create compression worker")}}function PR(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?RR():""}function kc(){try{return"sessionStorage"in de&&!!de.sessionStorage}catch{return!1}}function LR(e){DR(),e.session=void 0}function DR(){if(kc())try{de.sessionStorage.removeItem(hc)}catch{}}function mh(e){return e===void 0?!1:Math.random()<e}function Ys(e){if(kc())try{de.sessionStorage.setItem(hc,JSON.stringify(e))}catch{}}function gh(e){const t=Date.now(),n=e.id||ve(),r=e.started||t,o=e.lastActivity||t,s=e.segmentId||0,i=e.sampled,a=e.previousSessionId,c=e.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:s,sampled:i,previousSessionId:a,dirty:c}}function FR(e,t){return mh(e)?"session":t?"buffer":!1}function Fl({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const o=FR(e,t),s=gh({sampled:o,previousSessionId:r});return n&&Ys(s),s}function $R(){if(!kc())return null;try{const e=de.sessionStorage.getItem(hc);if(!e)return null;const t=JSON.parse(e);return $&&B.infoTick("Loading existing session"),gh(t)}catch{return null}}function ua(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function _h(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return ua(e.started,t,r)||ua(e.lastActivity,n,r)}function yh(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!_h(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function ki({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const o=r.stickySession&&$R();return o?yh(o,{sessionIdleExpire:e,maxReplayDuration:t})?($&&B.infoTick("Session in sessionStorage is expired, creating new one..."),Fl(r,{previousSessionId:o.id})):o:($&&B.infoTick("Creating new session"),Fl(r,{previousSessionId:n}))}function BR(e){return e.type===V.Custom}function Rc(e,t,n){return bh(e,t)?(Sh(e,t,n),!0):!1}function UR(e,t,n){return bh(e,t)?Sh(e,t,n):Promise.resolve(null)}async function Sh(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const o=e.recordingMode==="buffer";try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const s=e.getOptions(),i=HR(t,s.beforeAddRecordingEvent);return i?await r.addEvent(i):void 0}catch(s){const i=s&&s instanceof wc,a=i?"addEventSizeExceeded":"addEvent",c=R();if(c){const u=i?"buffer_overflow":"internal_sdk_error";c.recordDroppedEvent(u,"replay")}if(i&&o)return r.clear(),r.waitForCheckout=!0,null;e.handleException(s),await e.stop({reason:a})}}function bh(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Tc(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?($&&B.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function HR(e,t){try{if(typeof t=="function"&&BR(e))return t(e)}catch(n){return $&&B.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Cc(e){return!e.type}function la(e){return e.type==="transaction"}function WR(e){return e.type==="replay_event"}function $l(e){return e.type==="feedback"}function jR(e){return(t,n)=>{if(!e.isEnabled()||!Cc(t)&&!la(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(la(t)){qR(e,t);return}zR(e,t)}}}function qR(e,t){const n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function zR(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)||Qr(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function GR(e){return t=>{!e.isEnabled()||!Cc(t)||VR(e,t)}}function VR(e,t){const n=t.exception?.values?.[0]?.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 r=ft({category:"replay.hydrate-error",data:{url:Tn()}});eo(e,r)}}function JR(e){const t=R();t&&t.on("beforeAddBreadcrumb",n=>YR(e,n))}function YR(e,t){if(!e.isEnabled()||!Eh(t))return;const n=KR(t);n&&eo(e,n)}function KR(e){return!Eh(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?XR(e):ft(e)}function XR(e){const t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return ft(e);let n=!1;const r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>ho?(n=!0,`${o.slice(0,ho)}…`):o;if(typeof o=="object")try{const s=je(o,7);return JSON.stringify(s).length>ho?(n=!0,`${JSON.stringify(s,null,2).slice(0,ho)}…`):s}catch{}return o});return ft({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function Eh(e){return!!e.category}function QR(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Th(){const e=z().getPropagationContext().dsc;e&&delete e.replay_id;const t=be();if(t){const n=at(t);delete n.replay_id}}function ZR(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:V.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 eC(e,t){return e.recordingMode!=="buffer"||t.message===mc||!t.exception||t.type?!1:mh(e.getOptions().errorSampleRate)}function tC(e){return Object.assign((t,n)=>{if(!e.isEnabled()||e.isPaused())return t;if(WR(t))return delete t.breadcrumbs,t;if(!Cc(t)&&!la(t)&&!$l(t))return t;if(!e.checkAndHandleExpiredSession())return Th(),t;if($l(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),ZR(e,t),t;if(QR(t,n)&&!e.getOptions()._experiments.captureExceptions)return $&&B.log("Ignoring error from rrweb internals",t),null;const o=eC(e,t);if((o||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),o&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){const i=e.session;i.dirty=!0,e.getOptions().stickySession&&Ys(i)}return t},{id:"Replay"})}function Ks(e,t){return t.map(({type:n,start:r,end:o,name:s,data:i})=>{const a=e.throttledAddEvent({type:V.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:o,data:i}}});return typeof a=="string"?Promise.resolve(null):a})}function nC(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 rC(e){return t=>{if(!e.isEnabled())return;const n=nC(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Ks(e,[n]),!1)))}}function oC(e,t){return $&&e.getOptions()._experiments.traceInternals?!1:Tf(t,R())}function vh(e,t){e.isEnabled()&&t!==null&&(oC(e,t.name)||e.addUpdate(()=>(Ks(e,[t]),!0)))}function Xs(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=Cp(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function Ih(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function _s(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 wh(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:o,method:s,statusCode:i,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:s,statusCode:i,request:a,response:c}}}function Or(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function zt(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:o,warnings:s}=sC(n);return r.body=o,s?.length&&(r._meta={warnings:s}),r}function da(e,t){return Object.entries(e).reduce((n,[r,o])=>{const s=r.toLowerCase();return t.includes(s)&&e[r]&&(n[s]=o),n},{})}function sC(e){if(!e||typeof e!="string")return{body:e};const t=e.length>yl,n=iC(e);if(t){const r=e.slice(0,yl);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 iC(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function ys(e,t){const n=aC(e);return st(n,t)}function aC(e,t=de.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(de.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 cC(e,t,n){try{const r=await lC(e,t,n),o=wh("resource.fetch",r);vh(n.replay,o)}catch(r){$&&B.exception(r,"Failed to capture fetch breadcrumb")}}function uC(e,t){const{input:n,response:r}=t,o=n?pc(n):void 0,s=Xs(o),i=r?Ih(r.headers.get("content-length")):void 0;s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}async function lC(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r}=t,{url:i,method:a,status_code:c=0,request_body_size:u,response_body_size:d}=e.data,l=ys(i,n.networkDetailAllowUrls)&&!ys(i,n.networkDetailDenyUrls),f=l?dC(n,t.input,u):Or(u),p=await fC(l,n,t.response,d);return{startTimestamp:o,endTimestamp:s,url:i,method:a,statusCode:c,request:f,response:p}}function dC({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const o=n?mC(n,t):{};if(!e)return zt(o,r,void 0);const s=pc(n),[i,a]=ls(s,B),c=zt(o,r,i);return a?_s(c,a):c}async function fC(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return Or(o);const s=r?kh(r.headers,n):{};if(!r||!t&&o!==void 0)return zt(s,o,void 0);const[i,a]=await hC(r),c=pC(i,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:s});return a?_s(c,a):c}function pC(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{const s=e?.length&&n===void 0?Xs(e):n;return r?t?zt(o,s,e):zt(o,s,void 0):Or(s)}catch(s){return $&&B.exception(s,"Failed to serialize response body"),zt(o,n,void 0)}}async function hC(e){const t=gC(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await _C(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?($&&B.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):($&&B.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function kh(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function mC(e,t){return e.length===1&&typeof e[0]!="string"?Bl(e[0],t):e.length===2?Bl(e[1],t):{}}function Bl(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?kh(n,t):Array.isArray(n)?{}:da(n,t):{}}function gC(e){try{return e.clone()}catch(t){$&&B.exception(t,"Failed to clone response body")}}function _C(e){return new Promise((t,n)=>{const r=Qr(()=>n(new Error("Timeout while trying to read response body")),500);yC(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function yC(e){return await e.text()}async function SC(e,t,n){try{const r=EC(e,t,n),o=wh("resource.xhr",r);vh(n.replay,o)}catch(r){$&&B.exception(r,"Failed to capture xhr breadcrumb")}}function bC(e,t){const{xhr:n,input:r}=t;if(!n)return;const o=Xs(r),s=n.getResponseHeader("content-length")?Ih(n.getResponseHeader("content-length")):IC(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),s!==void 0&&(e.data.response_body_size=s)}function EC(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r,input:i,xhr:a}=t,{url:c,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!c)return null;if(!a||!ys(c,n.networkDetailAllowUrls)||ys(c,n.networkDetailDenyUrls)){const N=Or(l),S=Or(f);return{startTimestamp:o,endTimestamp:s,url:c,method:u,statusCode:d,request:N,response:S}}const p=a[Tt],h=p?da(p.request_headers,n.networkRequestHeaders):{},g=da(Ap(a),n.networkResponseHeaders),[_,y]=n.networkCaptureBodies?ls(i,B):[void 0],[b,P]=n.networkCaptureBodies?TC(a):[void 0],A=zt(h,l,_),H=zt(g,f,b);return{startTimestamp:o,endTimestamp:s,url:c,method:u,statusCode:d,request:y?_s(A,y):A,response:P?_s(H,P):H}}function TC(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return vC(e.response,e.responseType)}catch(n){t.push(n)}return $&&B.warn("Failed to get xhr response body",...t),[void 0]}function vC(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 $&&B.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return $&&B.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function IC(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return Xs(n)}catch{return}}function wC(e){const t=R();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i};t&&t.on("beforeAddBreadcrumb",(c,u)=>kC(a,c,u))}catch{}}function kC(e,t,n){if(t.data)try{RC(t)&&AC(n)&&(bC(t,n),SC(t,n,e)),CC(t)&&xC(n)&&(uC(t,n),cC(t,n,e))}catch(r){$&&B.exception(r,"Error when enriching network breadcrumb")}}function RC(e){return e.category==="xhr"}function CC(e){return e.category==="fetch"}function AC(e){return e?.xhr}function xC(e){return e?.response}function MC(e){const t=R();Rp(cR(e)),js(rC(e)),JR(e),wC(e);const n=tC(e);l_(n),t&&(t.on("beforeSendEvent",GR(e)),t.on("afterSendEvent",jR(e)),t.on("createDsc",r=>{const o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=o)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,o)=>{const s=e.getSessionId();o?.includeReplay&&e.isEnabled()&&s&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=s)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function NC(e){try{return Promise.all(Ks(e,[OC(de.performance.memory)]))}catch{return[]}}function OC(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function PC(e,t,n){return ay(e,t,{...n,setTimeoutImpl:Qr})}const yo=L.navigator;function LC(){return/iPhone|iPad|iPod/i.test(yo?.userAgent??"")||/Macintosh/i.test(yo?.userAgent??"")&&yo?.maxTouchPoints&&yo?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function DC(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){$&&B.warn("Received replay event after session expired.");return}const o=r||!t;t=!0,e.clickDetector&&rR(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!Rc(e,n,o))return!0;if(!o)return!1;const s=e.session;if($C(e,o),e.recordingMode==="buffer"&&s&&e.eventBuffer&&!s.dirty){const i=e.eventBuffer.getEarliestTimestamp();i&&($&&B.log(`Updating session start time to earliest event in buffer to ${new Date(i)}`),s.started=i,e.getOptions().stickySession&&Ys(s))}return s?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function FC(e){const t=e.getOptions();return{type:V.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 $C(e,t){!t||!e.session||e.session.segmentId!==0||Rc(e,FC(e),!1)}function BC(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function UC(e,t,n,r){return ct(Xd(e,ws(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function HC({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}
497
- `;if(typeof e=="string")n=`${r}${e}`;else{const s=new TextEncoder().encode(r);n=new Uint8Array(s.length+e.length),n.set(s),n.set(e,s.length)}return n}async function WC({client:e,scope:t,replayId:n,event:r}){const o=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,s={event_id:n,integrations:o};e.emit("preprocessEvent",r,s);const i=await tf(e.getOptions(),r,s,t,e,Ie());if(!i)return null;e.emit("postprocessEvent",i,s),i.platform=i.platform||"javascript";const a=e.getSdkMetadata(),{name:c,version:u,settings:d}=a?.sdk||{};return i.sdk={...i.sdk,name:c||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},i}async function jC({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:s}){const i=HC({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:d}=r,l=R(),f=z(),p=l?.getTransport(),h=l?.getDsn();if(!l||!p||!h||!s.sampled)return Promise.resolve({});const g={type:Sw,replay_start_timestamp:d/1e3,timestamp:o/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:t,segment_id:n,replay_type:s.sampled},_=await WC({scope:f,client:l,replayId:t,event:g});if(!_)return l.recordDroppedEvent("event_processor","replay"),$&&B.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete _.sdkProcessingMetadata;const y=UC(_,i,h,l.getOptions().tunnel);let b;try{b=await p.send(y)}catch(A){const H=new Error(mc);try{H.cause=A}catch{}throw H}if(typeof b.statusCode=="number"&&(b.statusCode<200||b.statusCode>=300))throw new Rh(b.statusCode);const P=pf({},b);if(ff(P,"replay"))throw new Ac(P);return b}class Rh extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Ac extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function Ch(e,t={count:0,interval:ww}){const{recordingData:n,onError:r}=e;if(n.length)try{return await jC(e),!0}catch(o){if(o instanceof Rh||o instanceof Ac)throw o;if(i_("Replays",{_retryCount:t.count}),r&&r(o),t.count>=kw){const s=new Error(`${mc} - max retries exceeded`);try{s.cause=o}catch{}throw s}return t.interval*=++t.count,new Promise((s,i)=>{Qr(async()=>{try{await Ch(e,t),s(!0)}catch(a){i(a)}},t.interval)})}}const Ah="__THROTTLED",qC="__SKIPPED";function zC(e,t,n){const r=new Map,o=a=>{const c=a-n;r.forEach((u,d)=>{d<c&&r.delete(d)})},s=()=>[...r.values()].reduce((a,c)=>a+c,0);let i=!1;return(...a)=>{const c=Math.floor(Date.now()/1e3);if(o(c),s()>=t){const d=i;return i=!0,d?qC:Ah}i=!1;const u=r.get(c)||0;return r.set(c,u+1),e(...a)}}class GC{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:bw,sessionIdleExpire:Ew},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=PC(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=zC((i,a)=>UR(this,i,a),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),s=r?{threshold:Math.min(Rw,r),timeout:r,scrollTimeout:Cw,ignoreSelector:o?o.join(","):""}:void 0;if(s&&(this.clickDetector=new Zk(this,s)),$){const i=t._experiments;B.setConfig({captureExceptions:!!i.captureExceptions,traceInternals:!!i.traceInternals})}this._handleVisibilityChange=()=>{de.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const i=ft({category:"ui.blur"});this._doChangeToBackgroundTasks(i)},this._handleWindowFocus=()=>{const i=ft({category:"ui.focus"});this._doChangeToForegroundTasks(i)},this._handleKeyboardEvent=i=>{fR(this,i)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){$&&B.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(t),!this.session){$&&B.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",$&&B.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){$&&B.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){$&&B.log("Buffering is in progress, call `flush()` to save the replay");return}$&&B.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=ki({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){$&&B.log("Buffering is in progress, call `flush()` to save the replay");return}$&&B.infoTick("Starting replay in buffer mode");const t=ki({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=wt({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:Iw}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:DC(this),...LC(),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}={}){if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{$&&B.log(`Stopping Replay${n?` triggered by ${n}`:""}`),Th(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,LR(this)}catch(r){this.handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),$&&B.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),$&&B.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();$&&B.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){if(!(t&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&ua(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${de.location.pathname}${de.location.hash}${de.location.search}`,n=`${de.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===Ah){const o=ft({category:"replay.throttled"});this.addUpdate(()=>!Rc(this,{type:Gk,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||be(),n=t&&Se(t),o=(n&&U(n).data||{})[Pe];if(!(!n||!o||!["route","custom"].includes(o)))return U(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=NR({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=ki({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 yh(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{de.document.addEventListener("visibilitychange",this._handleVisibilityChange),de.addEventListener("blur",this._handleWindowBlur),de.addEventListener("focus",this._handleWindowFocus),de.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(MC(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=wR(this)}_removeListeners(){try{de.document.removeEventListener("visibilitychange",this._handleVisibilityChange),de.removeEventListener("blur",this._handleWindowBlur),de.removeEventListener("focus",this._handleWindowFocus),de.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||_h(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()){$&&B.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:V.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=gR(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(Ks(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(){const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){$&&B.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await NC(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await Ch({replayId:t,recordingData:s,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:i=>this.handleException(i)})}catch(n){this.handleException(n),this.stop({reason:"sendReplay"});const r=R();if(r){const o=n instanceof Ac?"ratelimit_backoff":"send_error";r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){$&&B.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();const s=o<this._options.minReplayDuration,i=o>this._options.maxReplayDuration+5e3;if(s||i){$&&B.log(`Session duration (${Math.floor(o/1e3)}s) is too ${s?"short":"long"}, not sending replay.`),s&&this._debouncedFlush();return}const a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&$&&B.log("Flushing initial segment without checkout.");const c=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,c&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Ys(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{const c=BC(a.target),u=n.join(",");return c?.matches(u)}))return!1;const r=t.length,o=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=o&&r>o;if(r>s||i){const a=ft({category:"replay.mutations",data:{count:r,limit:i}});this._createCustomBreadcrumb(a)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function mr(e,t){return[...e,...t].join(",")}function VC({mask:e,unmask:t,block:n,unblock:r,ignore:o}){const s=["base","iframe[srcdoc]:not([src])"],i=mr(e,[".sentry-mask","[data-sentry-mask]"]),a=mr(t,[]);return{maskTextSelector:i,unmaskTextSelector:a,blockSelector:mr(n,[".sentry-block","[data-sentry-block]",...s]),unblockSelector:mr(r,[]),ignoreSelector:mr(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function JC({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:s}){return!r||o.unmaskTextSelector&&e.matches(o.unmaskTextSelector)?s:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?s.replace(/[\S]/g,"*"):s}const Ul='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',YC=["content-length","content-type","accept"],KC=Symbol.for("sentry__originalRequestBody");let Hl=!1,Wl=!1;function XC(){if(typeof Request>"u"||Wl)return;const e=Request;try{const t=function(n,r){const o=new e(n,r);return r?.body!=null&&(o[KC]=r.body),o};t.prototype=e.prototype,L.Request=t,Wl=!0}catch{}}const Nx=(e=>new QC(e));class QC{constructor({flushMinDelay:t=Tw,flushMaxDelay:n=vw,minReplayDuration:r=Aw,maxReplayDuration:o=Sl,stickySession:s=!0,useCompression:i=!0,workerUrl:a,_experiments:c={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:y=[],networkCaptureBodies:b=!0,networkRequestHeaders:P=[],networkResponseHeaders:A=[],mask:H=[],maskAttributes:N=["title","placeholder","aria-label"],unmask:S=[],block:C=[],unblock:F=[],ignore:E=[],maskFn:x,beforeAddRecordingEvent:k,beforeErrorSampling:M,onError:O,attachRawBodyFromRequest:ee=!1}={}){this.name="Replay";const K=VC({mask:H,unmask:S,block:C,unblock:F,ignore:E});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:x,maskInputFn:x,maskAttributeFn:(ne,T,j)=>JC({maskAttributes:N,maskAllText:u,privacyOptions:K,key:ne,value:T,el:j}),...K,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:ne=>{try{ne.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!c.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,xw),maxReplayDuration:Math.min(o,Sl),stickySession:s,useCompression:i,workerUrl:a,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:g,networkDetailAllowUrls:_,networkDetailDenyUrls:y,networkCaptureBodies:b,networkRequestHeaders:jl(P),networkResponseHeaders:jl(A),beforeAddRecordingEvent:k,beforeErrorSampling:M,onError:O,attachRawBodyFromRequest:ee,_experiments:c},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Ul}`:Ul,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&rs())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Hl}set _isInitialized(t){Hl=t}afterAllSetup(t){!rs()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&XC(),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){if(this._replay?.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=ZC(this._initialOptions,t);this._replay=new GC({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function ZC(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=pn(n.replaysSessionSampleRate),s=pn(n.replaysOnErrorSampleRate);return o==null&&s==null&&yt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),s!=null&&(r.errorSampleRate=s),r}function jl(e){return[...YC,...e.map(t=>t.toLowerCase())]}function Ox(){return R()?.getIntegrationByName("Replay")}var e1=Object.defineProperty,t1=(e,t,n)=>t in e?e1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ql=(e,t,n)=>t1(e,typeof t!="symbol"?t+"":t,n);class n1{constructor(){ql(this,"idNodeMap",new Map),ql(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function r1(){return new n1}function o1(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function fa(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:fa(e.parentNode,t,n,r+1)}function zl(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(o1(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}const Nn=`Please stop import mirror directly. Instead of that,\r
498
- now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
499
- or you can use record.mirror to access the mirror instance during recording.`;let Gl={map:{},getId(){return console.error(Nn),-1},getNode(){return console.error(Nn),null},removeNodeFromMap(){console.error(Nn)},has(){return console.error(Nn),!1},reset(){console.error(Nn)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Gl=new Proxy(Gl,{get(e,t,n){return t==="map"&&console.error(Nn),Reflect.get(e,t,n)}}));function xc(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(i){Mh(()=>{n.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>xc(e,t,s||{},!0)}function Mc(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}Date.now().toString();function s1(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Qs(e,t,n,r,o){if(!e)return!1;const s=s1(e);if(!s)return!1;const i=zl(t,n),a=fa(s,i);let c=-1;return a<0?!1:(r&&(c=fa(s,zl(null,r))),a>-1&&c<0?!0:a<c)}const Vl={};function xh(e){const t=Vl[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch{}return Vl[e]=r.bind(window)}function rn(...e){return xh("requestAnimationFrame")(...e)}function Mh(...e){return xh("setTimeout")(...e)}var Qn=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Qn||{});let Uo;function i1(e){Uo=e}const Ri=e=>Uo?(...n)=>{try{return e(...n)}catch(r){if(Uo&&Uo(r)===!0)return()=>{};throw r}}:e;var Fn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var So=0;So<Fn.length;So++)a1[Fn.charCodeAt(So)]=So;var c1=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=Fn[t[n]>>2],o+=Fn[(t[n]&3)<<4|t[n+1]>>4],o+=Fn[(t[n+1]&15)<<2|t[n+2]>>6],o+=Fn[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const Jl=new Map;function u1(e,t){let n=Jl.get(e);return n||(n=new Map,Jl.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const Nh=(e,t,n)=>{if(!e||!(Ph(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=u1(n,r);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function Ho(e,t,n){if(e instanceof Array)return e.map(r=>Ho(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=c1(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ho(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ho(e.data,t,n),e.width,e.height]};if(Ph(e,t)||typeof e=="object"){const r=e.constructor.name,o=Nh(e,t,n);return{rr_type:r,index:o}}}}return e}const Oh=(e,t,n)=>e.map(r=>Ho(r,t,n)),Ph=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function l1(e,t,n,r,o){const s=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const c=Mc(t.CanvasRenderingContext2D.prototype,a,function(u){return function(...d){return Qs(this.canvas,n,r,o,!0)||Mh(()=>{const l=Oh(d,t,this);e(this.canvas,{type:Qn["2D"],property:a,args:l})},0),u.apply(this,d)}});s.push(c)}catch{const c=xc(t.CanvasRenderingContext2D.prototype,a,{set(u){e(this.canvas,{type:Qn["2D"],property:a,args:[u],setter:!0})}});s.push(c)}return()=>{s.forEach(a=>a())}}function d1(e){return e==="experimental-webgl"?"webgl":e}function Yl(e,t,n,r,o){const s=[];try{const i=Mc(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...u){if(!Qs(this,t,n,r,!0)){const d=d1(c);if("__context"in this||(this.__context=d),o&&["webgl","webgl2"].includes(d))if(u[0]&&typeof u[0]=="object"){const l=u[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else u.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[c,...u])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(i=>i())}}function Kl(e,t,n,r,o,s,i,a){const c=[],u=Object.getOwnPropertyNames(e);for(const d of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(d))try{if(typeof e[d]!="function")continue;const l=Mc(e,d,function(f){return function(...p){const h=f.apply(this,p);if(Nh(h,a,this),"tagName"in this.canvas&&!Qs(this.canvas,r,o,s,!0)){const g=Oh(p,a,this),_={type:t,property:d,args:g};n(this.canvas,_)}return h}});c.push(l)}catch{const l=xc(e,d,{set(f){n(this.canvas,{type:t,property:d,args:[f],setter:!0})}});c.push(l)}return c}function f1(e,t,n,r,o,s){const i=[];return i.push(...Kl(t.WebGLRenderingContext.prototype,Qn.WebGL,e,n,r,o,s,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Kl(t.WebGL2RenderingContext.prototype,Qn.WebGL2,e,n,r,o,s,t)),()=>{i.forEach(a=>a())}}const p1='for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};';function h1(){const e=new Blob([p1]);return URL.createObjectURL(e)}class m1{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)};const{enableManualSnapshot:n,sampling:r="all",win:o,recordCanvas:s,errorHandler:i}=t;t.sampling=r,this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,i&&i1(i),(s&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&Ri(()=>{s&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),s&&typeof r=="number"&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(t){const{sampling:n="all",blockClass:r,blockSelector:o,unblockSelector:s,recordCanvas:i,enableManualSnapshot:a}=this.options;if(!this.windowsSet.has(t)){if(a){this.windowsSet.add(t),this.windows.push(new WeakRef(t));return}Ri(()=>{if(i&&n==="all"&&this.initCanvasMutationObserver(t,r,o,s),i&&typeof n=="number"){const c=Yl(t,r,o,s,!0);this.restoreHandlers.push(()=>{c()})}})(),this.windowsSet.add(t),this.windows.push(new WeakRef(t))}}addShadowRoot(t){this.shadowDoms.add(new WeakRef(t))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(t,n){if(n?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,t);return}rn(r=>this.takeSnapshot(r,!0,t))}initFPSWorker(){const t=new Worker(h1());return t.onmessage=n=>{const r=n.data,{id:o}=r;if(this.snapshotInProgressMap.set(o,!1),!("base64"in r))return;const{base64:s,type:i,width:a,height:c}=r;this.mutationCb({id:o,type:Qn["2D"],commands:[{property:"clearRect",args:[0,0,a,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:i}]},0,0,a,c]}]})},t}initCanvasFPSObserver(){let t;if(!this.windows.length&&!this.shadowDoms.size)return;const n=r=>{this.takeSnapshot(r,!1),t=rn(n)};t=rn(n),this.restoreHandlers.push(()=>{t&&cancelAnimationFrame(t)})}initCanvasMutationObserver(t,n,r,o){const s=Yl(t,n,r,o,!1),i=l1(this.processMutation.bind(this),t,n,r,o),a=f1(this.processMutation.bind(this),t,n,r,o,this.mirror);this.restoreHandlers.push(()=>{s(),i(),a()})}getCanvasElements(t,n,r){const o=[],s=i=>{i.querySelectorAll("canvas").forEach(a=>{Qs(a,t,n,r)||o.push(a)})};for(const i of this.windows){const a=i.deref();let c;try{c=a&&a.document}catch{}c&&s(c)}for(const i of this.shadowDoms){const a=i.deref();a&&s(a)}return o}takeSnapshot(t,n,r){const{sampling:o,blockClass:s,blockSelector:i,unblockSelector:a,dataURLOptions:c,maxCanvasSize:u}=this.options,l=1e3/(o==="all"?2:o||2);return this.lastSnapshotTime&&t-this.lastSnapshotTime<l?!1:(this.lastSnapshotTime=t,(r?[r]:this.getCanvasElements(s,i,a)).forEach(h=>{const g=this.mirror.getId(h);if(!(!this.mirror.hasNode(h)||!h.width||!h.height||this.snapshotInProgressMap.get(g))){if(this.snapshotInProgressMap.set(g,!0),!n&&["webgl","webgl2"].includes(h.__context)){const _=h.getContext(h.__context);_?.getContextAttributes()?.preserveDrawingBuffer===!1&&_.clear(_.COLOR_BUFFER_BIT)}createImageBitmap(h).then(_=>{this.worker?.postMessage({id:g,bitmap:_,width:h.width,height:h.height,dataURLOptions:c,maxCanvasSize:u},[_])}).catch(_=>{Ri(()=>{throw this.snapshotInProgressMap.delete(g),_})()})}}),!0)}startPendingCanvasMutationFlusher(){rn(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,rn(t)};rn(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),rn(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(i=>{const{type:a,...c}=i;return c}),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}r1();var Xl;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Xl||(Xl={}));const Ql={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},g1="ReplayCanvas",bo=1280,_1=((e={})=>{const[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,bo):bo,n?Math.min(n,bo):bo]};let o,s;const i=new Promise(a=>s=a);return{name:g1,getOptions(){const{quality:a,enableManualSnapshot:c,maxCanvasSize:u}=r;return{enableManualSnapshot:c,recordCanvas:!0,getCanvasManager:d=>{const l=new m1({...d,enableManualSnapshot:c,maxCanvasSize:u,errorHandler:f=>{try{typeof f=="object"&&(f.__rrweb__=!0)}catch{}}});return o=l,s(l),l},...Ql[a]||Ql.medium}},async snapshot(a,c){(o||await i).snapshot(a,c)}}}),Px=_1;function y1(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Lh(e){try{return new URL(e,D.location.origin).href}catch{return}}function S1(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Dh(e){try{return new Headers(e)}catch{return}}const Zl=new WeakMap,Ci=new Map,Fh={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function b1(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:o,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:c,onRequestSpanEnd:u}={...Fh,...t},d=typeof s=="function"?s:h=>!0,l=h=>E1(h,a),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(g=>{if(g.op==="http.client"){const _=Ci.get(g.span_id);_&&(g.timestamp=_/1e3,Ci.delete(g.span_id))}}),h)),o&&ME(h=>{if(h.response){const g=Zl.get(h.response);g&&h.endTimestamp&&Ci.set(g,h.endTimestamp)}}),Xa(h=>{const g=bS(h,d,l,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&Zl.set(h.response,h.fetchData.__span),g){const _=Lh(h.fetchData.url),y=_?fn(_).host:void 0;g.setAttributes({"http.url":_,"server.address":y}),i&&ed(g),c?.(g,{headers:h.headers})}})),r&&fc(h=>{const g=T1(h,d,l,f,p,u);g&&(i&&ed(g),c?.(g,{headers:Dh(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}function ed(e){const{url:t}=U(e).data;if(!t||typeof t!="string")return;const n=En("resource",({entries:r})=>{r.forEach(o=>{S1(o)&&o.name.endsWith(t)&&(e.setAttributes(kp(o)),setTimeout(n))})})}function E1(e,t){const n=Tn();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}const s=r.origin===o;return t?st(r.toString(),t)||s&&st(r.pathname,t):s}else{const r=!!e.match(/^\/(?!\/)/);return t?st(e,t):r}}function T1(e,t,n,r,o,s){const i=e.xhr,a=i?.[Tt];if(!i||i.__sentry_own_request__||!a)return;const{url:c,method:u}=a,d=Xe()&&t(c);if(e.endTimestamp&&d){const y=i.__sentry_xhr_span_id__;if(!y)return;const b=r[y];b&&a.status_code!==void 0&&(qo(b,a.status_code),b.end(),s?.(b,{headers:Dh(Ap(i)),error:e.error}),delete r[y]);return}const l=Lh(c),f=fn(l||c),p=Ef(c),h=!!be(),g=d&&h?it({name:`${u} ${p}`,attributes:{url:c,type:"xhr","http.method":u,"http.url":l,"server.address":f?.host,[Y]:"auto.http.browser",[Te]:"http.client",...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new At;i.__sentry_xhr_span_id__=g.spanContext().spanId,r[i.__sentry_xhr_span_id__]=g,n(c)&&v1(i,Xe()&&h?g:void 0,o);const _=R();return _&&_.emit("beforeOutgoingRequestSpan",g,e),g}function v1(e,t,n){const{"sentry-trace":r,baggage:o,traceparent:s}=If({span:t,propagateTraceparent:n});r&&I1(e,r,o,s)}function I1(e,t,n,r){const o=e.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!o?.traceparent&&e.setRequestHeader("traceparent",r),n){const s=o?.baggage;(!s||!y1(s))&&e.setRequestHeader("baggage",n)}}catch{}}function w1(){D.document?D.document.addEventListener("visibilitychange",()=>{const e=be();if(!e)return;const t=Se(e);if(D.document.hidden&&t){const n="cancelled",{op:r,status:o}=U(t);v&&m.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:Z,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):v&&m.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const k1=3600,$h="sentry_previous_trace",R1="sentry.previous_trace";function C1(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let o=r?M1():void 0;e.on("spanStart",i=>{if(Se(i)!==i)return;const a=z().getPropagationContext();o=A1(o,i,a),r&&x1(o)});let s=!0;n&&e.on("beforeSampling",i=>{if(!o)return;const a=z(),c=a.getPropagationContext();if(s&&c.parentSpanId){s=!1;return}a.setPropagationContext({...c,dsc:{...c.dsc,sample_rate:String(o.sampleRate),sampled:String(pa(o.spanContext))},sampleRand:o.sampleRand}),i.parentSampled=pa(o.spanContext),i.parentSampleRate=o.sampleRate,i.spanAttributes={...i.spanAttributes,[Md]:o.sampleRate}})}function A1(e,t,n){const r=U(t);function o(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[Ea])}catch{return 0}}const s={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return s;const i=e.spanContext;return i.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=k1&&(v&&m.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:i,attributes:{[Fm]:"previous_trace"}}),t.setAttribute(R1,`${i.traceId}-${i.spanId}-${pa(i)?1:0}`)),s)}function x1(e){try{D.sessionStorage.setItem($h,JSON.stringify(e))}catch(t){v&&m.warn("Could not store previous trace in sessionStorage",t)}}function M1(){try{const e=D.sessionStorage?.getItem($h);return JSON.parse(e)}catch{return}}function pa(e){return e.traceFlags===1}const N1="BrowserTracing",O1={...ko,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:{},...Fh},P1=((e={})=>{const t={name:void 0,source:void 0},n=D.document,{enableInp:r,enableElementTiming:o,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:a,enableStandaloneClsSpans:c,enableStandaloneLcpSpans:u},beforeStartSpan:d,idleTimeout:l,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:g,traceXHR:_,trackFetchStreamPerformance:y,shouldCreateSpanForRequest:b,enableHTTPTimings:P,ignoreResourceSpans:A,ignorePerformanceApiSpans:H,instrumentPageLoad:N,instrumentNavigation:S,detectRedirects:C,linkPreviousTrace:F,consistentTraceSampling:E,enableReportPageLoaded:x,onRequestSpanStart:k,onRequestSpanEnd:M}={...O1,...e};let O,ee,K;function ne(T,j,I=!0){const G=j.op==="pageload",se=j.name,re=d?d(j):j,ye=re.attributes||{};if(se!==re.name&&(ye[Pe]="custom",re.attributes=ye),!I){const Me=vn();it({...re,startTime:Me}).end(Me);return}t.name=re.name,t.source=ye[Pe];const xe=Zd(re,{idleTimeout:l,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:G,beforeSpanEnd:Me=>{O?.(),o0(Me,{recordClsOnPageloadSpan:!c,recordLcpOnPageloadSpan:!u,ignoreResourceSpans:A,ignorePerformanceApiSpans:H}),nd(T,void 0);const De=z(),ut=De.getPropagationContext();De.setPropagationContext({...ut,traceId:xe.spanContext().traceId,sampled:Zt(xe),dsc:at(Me)}),G&&(K=void 0)},trimIdleSpanEndTimestamp:!x});G&&x&&(K=xe),nd(T,xe);function Lt(){n&&["interactive","complete"].includes(n.readyState)&&T.emit("idleSpanEnableAutoFinish",xe)}G&&!x&&n&&(n.addEventListener("readystatechange",()=>{Lt()}),Lt())}return{name:N1,setup(T){if(ag(),O=Xv({recordClsStandaloneSpans:c||!1,recordLcpStandaloneSpans:u||!1,client:T}),r&&x0(),o&&g0(),i&&L.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?Zv():s&&Qv(),a&&e0(),C&&n){const I=()=>{ee=fe()};addEventListener("click",I,{capture:!0}),addEventListener("keydown",I,{capture:!0,passive:!0})}function j(){const I=Pr(T);I&&!U(I).timestamp&&(v&&m.log(`[Tracing] Finishing current active span with op: ${U(I).op}`),I.setAttribute(Rr,"cancelled"),I.end())}T.on("startNavigationSpan",(I,G)=>{if(R()!==T)return;if(G?.isRedirect){v&&m.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ne(T,{op:"navigation.redirect",...I},!1);return}ee=void 0,j(),Ie().setPropagationContext({traceId:mt(),sampleRand:Math.random(),propagationSpanId:Xe()?void 0:It()});const se=z();se.setPropagationContext({traceId:mt(),sampleRand:Math.random(),propagationSpanId:Xe()?void 0:It()}),se.setSDKProcessingMetadata({normalizedRequest:void 0}),ne(T,{op:"navigation",...I,parentSpan:null,forceTransaction:!0})}),T.on("startPageLoadSpan",(I,G={})=>{if(R()!==T)return;j();const se=G.sentryTrace||td("sentry-trace"),re=G.baggage||td("baggage"),ye=Ud(se,re),xe=z();xe.setPropagationContext(ye),Xe()||(xe.getPropagationContext().propagationSpanId=It()),xe.setSDKProcessingMetadata({normalizedRequest:rc()}),ne(T,{op:"pageload",...I})}),T.on("endPageloadSpan",()=>{x&&K&&(K.setAttribute(Rr,"reportPageLoaded"),K.end())})},afterAllSetup(T){let j=Tn();if(F!=="off"&&C1(T,{linkPreviousTrace:F,consistentTraceSampling:E}),D.location){if(N){const I=Ae();L1(T,{name:D.location.pathname,startTime:I?I/1e3:void 0,attributes:{[Pe]:"url",[Y]:"auto.pageload.browser"}})}S&&js(({to:I,from:G})=>{if(G===void 0&&j?.indexOf(I)!==-1){j=void 0;return}j=void 0;const se=Ba(I),re=Pr(T),ye=re&&C&&F1(re,ee);Bh(T,{name:se?.pathname||D.location.pathname,attributes:{[Pe]:"url",[Y]:"auto.navigation.browser"}},{url:I,isRedirect:ye})})}h&&w1(),a&&D1(T,l,f,p,t),r&&O0(),b1(T,{traceFetch:g,traceXHR:_,trackFetchStreamPerformance:y,tracePropagationTargets:T.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:b,enableHTTPTimings:P,onRequestSpanStart:k,onRequestSpanEnd:M})}}});function L1(e,t,n){e.emit("startPageLoadSpan",t,n),z().setTransactionName(t.name);const r=Pr(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function Bh(e,t,n){const{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});const s=z();return s.setTransactionName(t.name),r&&!o&&s.setSDKProcessingMetadata({normalizedRequest:{...rc(),url:r}}),Pr(e)}function td(e){return D.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function D1(e,t,n,r,o){const s=D.document;let i;const a=()=>{const c="ui.action.click",u=Pr(e);if(u){const d=U(u).op;if(["navigation","pageload"].includes(d)){v&&m.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(Rr,"interactionInterrupted"),i.end(),i=void 0),!o.name){v&&m.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}i=Zd({name:o.name,op:c,attributes:{[Pe]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};s&&addEventListener("click",a,{capture:!0})}const Uh="_sentry_idleSpan";function Pr(e){return e[Uh]}function nd(e,t){Le(e,Uh,t)}const rd=1.5;function F1(e,t){const n=U(e),r=vn(),o=n.start_timestamp;return!(r-o>rd||t&&r-t<=rd)}function Lx(e=R()){e?.emit("endPageloadSpan")}function Dx(e){const t=be();if(t===e)return;const n=z();e.end=new Proxy(e.end,{apply(r,o,s){return gt(n,t),Reflect.apply(r,o,s)}}),gt(n,e)}function Zn(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function $1(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=Zn(n);return o=>r.then(s=>o(s.transaction(t,"readwrite").objectStore(t)))}function Nc(e){return Zn(e.getAllKeys())}function B1(e,t,n){return e(r=>Nc(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.max(...o,0)+1),Zn(r.transaction)}))}function U1(e,t,n){return e(r=>Nc(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.min(...o,0)-1),Zn(r.transaction)}))}function H1(e){return e(t=>Nc(t).then(n=>{const r=n[0];if(r!=null)return Zn(t.get(r)).then(o=>(t.delete(r),Zn(t.transaction).then(()=>o)))}))}function W1(e){let t;function n(){return t==null&&(t=$1(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const o=await Jo(r);await B1(n(),o,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const o=await Jo(r);await U1(n(),o,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await H1(n());if(r)return yg(r)}catch{}}}}function j1(e){return t=>{const n=e({...t,createStore:W1});return D.addEventListener("online",async r=>{await n.flush()}),n}}function Fx(e=xp){return j1(Y_(e))}const od=1e6,q1="window"in L&&L.window===L&&typeof importScripts>"u",Gt=String(0),Ss=q1?"main":"worker",bs=D.navigator;let Hh="",Wh="",jh="",ha=bs?.userAgent||"",qh="";const z1=bs?.language||bs?.languages?.[0]||"";function G1(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const sd=bs?.userAgentData;G1(sd)&&sd.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(Hh=e.platform||"",jh=e.architecture||"",qh=e.model||"",Wh=e.platformVersion||"",e.fullVersionList?.length){const t=e.fullVersionList[e.fullVersionList.length-1];ha=`${t.brand} ${t.version}`}}).catch(e=>{});function V1(e){return!("thread_metadata"in e)}function J1(e){return V1(e)?eA(e):e}function Y1(e){const t=e.contexts?.trace?.trace_id;return typeof t=="string"&&t.length!==32&&v&&m.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function K1(e,t,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const o=Y1(r),s=J1(n),i=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:fe()*1e3),a=typeof r.timestamp=="number"?r.timestamp*1e3:fe()*1e3;return{event_id:e,timestamp:new Date(i).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Is,runtime:{name:"javascript",version:D.navigator.userAgent},os:{name:Hh,version:Wh,build_number:ha},device:{locale:z1,model:qh,manufacturer:ha,architecture:jh,is_emulator:!1},debug_meta:{images:Gh(n.resources)},profile:s,transactions:[{name:r.transaction||"",id:r.event_id||ve(),trace_id:o,active_thread_id:Gt,relative_start_ns:"0",relative_end_ns:((a-i)*1e6).toFixed(0)}]}}function X1(e,t,n){if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const r=Z1(e),o=t.getOptions(),s=t.getSdkMetadata?.()?.sdk;return{chunk_id:ve(),client_sdk:{name:s?.name??"sentry.javascript.browser",version:s?.version??"0.0.0"},profiler_id:n||ve(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:Gh(e.resources)},profile:r}}function Q1(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 Z1(e){const t=[];for(let a=0;a<e.frames.length;a++){const c=e.frames[a];c&&(t[a]={function:c.name,abs_path:typeof c.resourceId=="number"?e.resources[c.resourceId]:void 0,lineno:c.line,colno:c.column})}const n=[];for(let a=0;a<e.stacks.length;a++){const c=e.stacks[a];if(!c)continue;const u=[];let d=c;for(;d;)u.push(d.frameId),d=d.parentId===void 0?void 0:e.stacks[d.parentId];n[a]=u}const r=Ae(),o=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,s=o-(r||o),i=[];for(let a=0;a<e.samples.length;a++){const c=e.samples[a];if(!c)continue;const u=(o+(c.timestamp-s))/1e3;i[a]={stack_id:c.stackId??0,thread_id:Gt,timestamp:u}}return{frames:t,stacks:n,samples:i,thread_metadata:{[Gt]:{name:Ss}}}}function zh(e){return U(e).op==="pageload"}function eA(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[Gt]:{name:Ss}}},o=e.samples[0];if(!o)return r;const s=o.timestamp,i=Ae(),a=typeof performance.timeOrigin=="number"?performance.timeOrigin:i||0,c=a-(i||a);return e.samples.forEach((u,d)=>{if(u.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[d]={elapsed_since_start_ns:((u.timestamp+c-s)*od).toFixed(0),stack_id:t,thread_id:Gt};return}let l=e.stacks[u.stackId];const f=[];for(;l;){f.push(l.frameId);const h=e.frames[l.frameId];h&&r.frames[l.frameId]===void 0&&(r.frames[l.frameId]={function:h.name,abs_path:typeof h.resourceId=="number"?e.resources[h.resourceId]:void 0,lineno:h.line,colno:h.column}),l=l.parentId===void 0?void 0:e.stacks[l.parentId]}const p={elapsed_since_start_ns:((u.timestamp+c-s)*od).toFixed(0),stack_id:n,thread_id:Gt};r.stacks[n]=f,r.samples[d]=p,n++}),r}function tA(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function nA(e){const t=[];return hn(e,(n,r)=>{if(r==="transaction")for(let o=1;o<n.length;o++)n[o]?.contexts?.profile?.profile_id&&t.push(n[o])}),t}function Gh(e){const r=R()?.getOptions()?.stackParser;return r?Wg(r,e):[]}function Vh(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(v&&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?(v&&m.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function rA(e){return e.samples.length<2?(v&&m.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(v&&m.log("[Profiling] Discarding profile because it contains no frames"),!1)}let Oc=!1;const Jh=3e4;function oA(e){return typeof e=="function"}function Yh(){const e=D.Profiler;if(!oA(e)){v&&m.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const t=10,n=Math.floor(Jh/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{v&&(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.")),Oc=!0}}function id(e){if(Oc)return v&&m.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return v&&m.log("[Profiling] Discarding profile because root span was not sampled."),!1;const n=R()?.getOptions();if(!n)return v&&m.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return Vh(r)?r?(r===!0?!0:Math.random()<r)?!0:(v&&m.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(v&&m.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(v&&m.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function sA(e){if(Oc)return v&&m.log("[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started."),!1;if(e.profileLifecycle!=="trace"&&e.profileLifecycle!=="manual")return v&&m.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;const t=e.profileSessionSampleRate;return Vh(t)?t?Math.random()<=t:(v&&m.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(v&&m.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function Eo(e){return typeof e.profilesSampleRate<"u"}function iA(e,t,n,r){return rA(n)?K1(e,t,n,r):null}const un=new Map;function aA(){return un.size}function cA(e){const t=un.get(e);return t&&un.delete(e),t}function uA(e,t){if(un.set(e,t),un.size>30){const n=un.keys().next().value;n!==void 0&&un.delete(n)}}function lA(e){return!e?.contexts?.profile||!e.contexts||(e.contexts.trace={...e.contexts?.trace??{},data:{...e.contexts?.trace?.data??{},"thread.id":Gt,"thread.name":Ss}},e.spans?.forEach(t=>{t.data={...t.data||{},"thread.id":Gt,"thread.name":Ss}})),e}function ad(e){let t;zh(e)&&(t=fe()*1e3);const n=Yh();if(!n)return;v&&m.log(`[Profiling] started profiling span: ${U(e).description}`);const r=ve();let o=null;z().setContext("profile",{profile_id:r,start_timestamp:t});async function s(){if(e&&n){if(o){v&&m.log("[Profiling] profile for:",U(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(i&&(D.clearTimeout(i),i=void 0),v&&m.log(`[Profiling] stopped profiling of span: ${U(e).description}`),!u){v&&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}o=u,uA(r,u)}).catch(u=>{v&&m.log("[Profiling] error while stopping profiler:",u)})}}let i=D.setTimeout(()=>{v&&m.log("[Profiling] max profile duration elapsed, stopping profiling for:",U(e).description),s()},Jh);const a=e.end.bind(e);function c(){return e?(s().then(()=>{a()},()=>{a()}),e):a()}e.end=c}const dA=6e4,fA=3e5;class pA{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(t){const n=t.getOptions().profileLifecycle,r=sA(t.getOptions());v&&m.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||v&&m.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=ve(),this._client=t,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(t)}start(){if(this._lifecycleMode==="trace"){v&&m.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){v&&m.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){v&&m.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){v&&m.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){v&&m.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(t){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;const n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);const r=this._activeRootSpanIds.size;r===1&&(v&&m.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling())}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,v&&m.log("[Profiling] Started profiling with profiler ID:",this._profilerId),br().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){v&&m.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(t=>{v&&m.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}),this._lifecycleMode==="manual"&&br().setContext("profile",{}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){v&&m.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==Se(n))return;if(!n.isRecording()){v&&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 o=this._activeRootSpanIds.size;o===1&&(v&&m.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${o}).`),this._beginProfiling())}),t.on("spanEnd",n=>{if(!this._sessionSampled)return;const r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);const o=this._activeRootSpanIds.size;v&&m.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${o}).`),o===0&&(this._collectCurrentChunk().catch(s=>{v&&m.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",s)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,br().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);const n=setTimeout(()=>this._onRootSpanTimeout(t),fA);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;const t=Yh();if(!t){v&&m.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{v&&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()}},dA))}_onRootSpanTimeout(t){this._rootSpanTimeouts.has(t)&&(this._rootSpanTimeouts.delete(t),this._activeRootSpanIds.has(t)&&(v&&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._endProfiling()))}async _collectCurrentChunk(){const t=this._profiler;if(this._profiler=void 0,!!t)try{const n=await t.stop(),r=X1(n,this._client,this._profilerId),o=Q1(r);if("reason"in o){v&&m.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),v&&m.log("[Profiling] Collected browser profile chunk.")}catch(n){v&&m.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(t){const n=this._client,r=ws(n.getSdkMetadata?.()),o=n.getDsn(),s=n.getOptions().tunnel,i=ct({event_id:ve(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!s&&o&&{dsn:Ot(o)}},[[{type:"profile_chunk"},t]]);n.sendEnvelope(i).then(null,a=>{v&&m.error("Error while sending profile chunk envelope:",a)})}}const hA="BrowserProfiling",mA=(()=>({name:hA,setup(e){const t=e.getOptions(),n=new pA;if(!Eo(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),Eo(t)&&!t.profilesSampleRate){v&&m.log("[Profiling] Profiling disabled, no profiling options found.");return}const r=be(),o=r&&Se(r);if(Eo(t)&&t.profileSessionSampleRate!==void 0&&v&&m.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),Eo(t))o&&zh(o)&&id(o)&&ad(o),e.on("spanStart",s=>{s===Se(s)&&id(s)&&ad(s)}),e.on("beforeEnvelope",s=>{if(!aA())return;const i=nA(s);if(!i.length)return;const a=[];for(const c of i){const u=c?.contexts,d=u?.profile?.profile_id,l=u?.profile?.start_timestamp;if(typeof d!="string"){v&&m.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!d){v&&m.log("[Profiling] cannot find profile for a span without a profile context");continue}u?.profile&&delete u.profile;const f=cA(d);if(!f){v&&m.log(`[Profiling] Could not retrieve profile for span: ${d}`);continue}const p=iA(d,l,f,c);p&&a.push(p)}tA(s,a)});else{const s=t.profileLifecycle;if(e.on("startUIProfiler",()=>n.start()),e.on("stopUIProfiler",()=>n.stop()),s==="manual")n.initialize(e);else if(s==="trace"){if(!Xe(t)){v&&m.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),o&&n.notifyRootSpanActive(o),D.setTimeout(()=>{const i=be(),a=i&&Se(i);a&&n.notifyRootSpanActive(a)},0)}}},processEvent(e){return lA(e)}})),$x=mA,Bx=()=>({name:"LaunchDarkly",processEvent(e,t,n){return or(e)}});function Ux(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{mn(e,t.value),gn(e,t.value)}}}const Hx=()=>({name:"OpenFeature",processEvent(e,t,n){return or(e)}});class Wx{after(t,n){mn(n.flagKey,n.value),gn(n.flagKey,n.value)}error(t,n,r){mn(t.flagKey,t.defaultValue),gn(t.flagKey,t.defaultValue)}}const jx=({featureFlagClientClass:e})=>({name:"Unleash",setupOnce(){const t=e.prototype;Re(t,"isEnabled",gA)},processEvent(t,n,r){return or(t)}});function gA(e){return function(...t){const n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"?(mn(n,r),gn(n,r)):v&&m.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}const qx=(({growthbookClass:e})=>SS({growthbookClass:e})),zx=({featureFlagClient:e})=>({name:"Statsig",setup(t){e.on("gate_evaluation",n=>{mn(n.gate.name,n.gate.value),gn(n.gate.name,n.gate.value)})},processEvent(t,n,r){return or(t)}});async function Gx(){const e=R();if(!e)return"no-client-active";if(!e.getDsn())return"no-dsn-configured";const r=e.getOptions().tunnel||"https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7";try{await Og(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}const _A="WebWorker",Vx=({worker:e})=>({name:_A,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(t=>cd(t))},addWorker:t=>cd(t)});function cd(e){e.addEventListener("message",t=>{SA(t.data)&&(t.stopImmediatePropagation(),t.data._sentryDebugIds&&(v&&m.log("Sentry debugId web worker message received",t.data),D._sentryDebugIds={...t.data._sentryDebugIds,...D._sentryDebugIds}),t.data._sentryModuleMetadata&&(v&&m.log("Sentry module metadata web worker message received",t.data),D._sentryModuleMetadata={...t.data._sentryModuleMetadata,...D._sentryModuleMetadata}),t.data._sentryWorkerError&&(v&&m.log("Sentry worker rejection message received",t.data._sentryWorkerError),yA(t.data._sentryWorkerError)))})}function yA(e){const t=R();if(!t)return;const n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,o=e.reason,s=Vt(o)?Op(o):Us(n,o,void 0,r,!0);s.level="error",e.filename&&(s.contexts={...s.contexts,worker:{filename:e.filename}}),Wr(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),v&&m.log("Captured worker unhandled rejection",o)}function Jx({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener("unhandledrejection",t=>{const r={reason:Np(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),v&&m.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),v&&m.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function SA(e){if(!rt(e)||e._sentryMessage!==!0)return!1;const t="_sentryDebugIds"in e,n="_sentryModuleMetadata"in e,r="_sentryWorkerError"in e;return!(!t&&!n&&!r||t&&!(rt(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(rt(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!rt(e._sentryWorkerError))}const bA="BrowserTracing";function Yx(e){e.integrations&&Array.isArray(e.integrations)&&e.integrations.some(r=>r.name===bA)&&yt(()=>{console.warn("browserTracingIntegration is not fully compatible with @sentry/react-router. Please use reactRouterTracingIntegration instead.")}),vf(e,"react-router",["react-router","browser"]);const t=VI(e);return a_("runtime","browser"),t}const EA=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,TA=L,ud=40;function vA(){function e(){const t=TA.__reactRouterDataRouter;if(t){const n=ld();if(n){const r=U(n).description,o=dd(t.state);if(r&&Sr(t.state.location.pathname)===Sr(r)&&(n.updateName(o),n.setAttributes({[Pe]:"route",[Y]:"auto.pageload.react_router"})),typeof t.navigate=="function"){const s=t.navigate.bind(t);t.navigate=function(...a){return IA(String(a[0])||"<unknown route>","url"),s(...a)}}}return t.subscribe(r=>{const o=ld();if(!o)return;const s=U(o).description,i=dd(r);s&&r.navigation.state==="idle"&&Sr(r.location.pathname)===Sr(s)&&(o.updateName(i),o.setAttributes({[Pe]:"route",[Y]:"auto.navigation.react_router"}))}),!0}return!1}if(!e()){let t=0;const n=setInterval(()=>{(e()||t>=ud)&&(t>=ud&&EA&&yt(()=>{console.warn("Unable to instrument React Router: router not found after hydration.")}),clearInterval(n)),t++},50)}}function IA(e,t){const n=R();if(n)return Bh(n,{name:e,attributes:{[Pe]:t,[Te]:"navigation",[Y]:"auto.navigation.react_router"}})}function ld(){const e=be();if(!e)return;const t=Se(e),n=U(t).op;return n==="navigation"||n==="pageload"?t:void 0}function dd(e){const t=e.matches[e.matches.length-1];return Sr(t?.route.path??e.location.pathname)}function Sr(e){let t=e.startsWith("/")?e:`/${e}`;return t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t}function Kx(){const e=P1({instrumentNavigation:!1});return{...e,name:"ReactRouterTracingIntegration",afterAllSetup(t){e.afterAllSetup(t),vA()}}}function wA(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function kA(e,t){const n=new WeakSet;function r(o,s){if(!n.has(o)){if(o.cause)return n.add(o),r(o.cause,s);o.cause=s}}r(e,t)}function Kh(e,{componentStack:t},n){if(wA(Ye.version)&&pt(e)&&t){const r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,kA(e,r)}return Ge(r=>(r.setContext("react",{componentStack:t}),me(e,n)))}function Xx(e){return(t,n)=>{const r=!!e,o=Kh(t,n,{mechanism:{handled:r,type:"auto.function.react.error_handler"}});r&&e(t,n,o)}}const Xh="ui.react.render",RA="ui.react.update",Qh="ui.react.mount",CA={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},AA={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},xA={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Zh={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},MA=Symbol.for("react.forward_ref"),em=Symbol.for("react.memo");function NA(e){return typeof e=="object"&&e!==null&&e.$$typeof===em}const Pc={};Pc[MA]=xA;Pc[em]=Zh;function fd(e){if(NA(e))return Zh;const t=e.$$typeof;return t&&Pc[t]||CA}const OA=Object.defineProperty.bind(Object),PA=Object.getOwnPropertyNames.bind(Object),pd=Object.getOwnPropertySymbols?.bind(Object),hd=Object.getOwnPropertyDescriptor.bind(Object),LA=Object.getPrototypeOf.bind(Object),md=Object.prototype;function Lc(e,t,n){if(typeof t!="string"){if(md){const i=LA(t);i&&i!==md&&Lc(e,i)}let r=PA(t);pd&&(r=r.concat(pd(t)));const o=fd(e),s=fd(t);for(const i of r){const a=String(i);if(!AA[a]&&!s?.[a]&&!o?.[a]&&!hd(e,i)){const c=hd(t,i);if(c)try{OA(e,i,c)}catch{}}}}return e}const DA="unknown";class tm extends Ye.Component{constructor(t){super(t);const{name:n,disabled:r=!1}=this.props;r||(this._mountSpan=it({name:`<${n}>`,onlyIfParent:!0,op:Qh,attributes:{[Y]:"auto.ui.react.profiler","ui.component_name":n}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate({updateProps:t,includeUpdates:n=!0}){if(n&&this._mountSpan&&t!==this.props.updateProps){const r=Object.keys(t).filter(o=>t[o]!==this.props.updateProps[o]);if(r.length>0){const o=fe();this._updateSpan=jn(this._mountSpan,()=>it({name:`<${this.props.name}>`,onlyIfParent:!0,op:RA,startTime:o,attributes:{[Y]:"auto.ui.react.profiler","ui.component_name":this.props.name,"ui.react.changed_props":r}}))}}return!0}componentDidUpdate(){this._updateSpan&&(this._updateSpan.end(),this._updateSpan=void 0)}componentWillUnmount(){const t=fe(),{name:n,includeRender:r=!0}=this.props;if(this._mountSpan&&r){const o=U(this._mountSpan).timestamp;jn(this._mountSpan,()=>{const s=it({onlyIfParent:!0,name:`<${n}>`,op:Xh,startTime:o,attributes:{[Y]:"auto.ui.react.profiler","ui.component_name":n}});s&&s.end(t)})}}render(){return this.props.children}}Object.assign(tm,{defaultProps:{disabled:!1,includeRender:!0,includeUpdates:!0}});function Qx(e,t){const n=t?.name||e.displayName||e.name||DA,r=o=>Ye.createElement(tm,{...t,name:n,updateProps:o},Ye.createElement(e,{...o}));return r.displayName=`profiler(${n})`,Lc(r,e),r}function Zx(e,t={disabled:!1,hasRenderSpan:!0}){const[n]=Ye.useState(()=>{if(!t?.disabled)return it({name:`<${e}>`,onlyIfParent:!0,op:Qh,attributes:{[Y]:"auto.ui.react.profiler","ui.component_name":e}})});Ye.useEffect(()=>(n&&n.end(),()=>{if(n&&t.hasRenderSpan){const r=U(n).timestamp,o=fe(),s=it({name:`<${e}>`,onlyIfParent:!0,op:Xh,startTime:r,attributes:{[Y]:"auto.ui.react.profiler","ui.component_name":e}});s&&s.end(o)}}),[])}const FA=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,$A="unknown",Ai={componentStack:null,error:null,eventId:null};class BA extends Ye.Component{constructor(t){super(t),this.state=Ai,this._openFallbackReportDialog=!0;const n=R();n&&t.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&ml({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){const{componentStack:r}=n,{beforeCapture:o,onError:s,showDialog:i,dialogOptions:a}=this.props;Ge(c=>{o&&o(c,t,r);const u=this.props.handled!=null?this.props.handled:!!this.props.fallback,d=Kh(t,n,{mechanism:{handled:u,type:"auto.function.react.error_boundary"}});s&&s(t,r,d),i&&(this._lastEventId=d,this._openFallbackReportDialog&&ml({...a,eventId:d})),this.setState({error:t,componentStack:r,eventId:d})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===Ai?o(null,null,null):o(t,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){const{onReset:t}=this.props,{error:n,componentStack:r,eventId:o}=this.state;t&&t(n,r,o),this.setState(Ai)}render(){const{fallback:t,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;const o=typeof t=="function"?Ye.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return Ye.isValidElement(o)?o:(t&&FA&&m.warn("fallback did not produce a valid ReactElement"),null)}}function eM(e,t){const n=e.displayName||e.name||$A,r=Ye.memo(o=>Ye.createElement(BA,{...t},Ye.createElement(e,{...o})));return r.displayName=`errorBoundary(${n})`,Lc(r,e),r}export{mv as BrowserClient,BA as ErrorBoundary,ui as MULTIPLEXED_TRANSPORT_EXTRA_KEY,Wx as OpenFeatureIntegrationHook,tm as Profiler,jt as SDK_VERSION,Te as SEMANTIC_ATTRIBUTE_SENTRY_OP,Y as SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,Ea as SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,Pe as SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,_t as Scope,D as WINDOW,xt as addBreadcrumb,l_ as addEventProcessor,du as addIntegration,uI as breadcrumbsIntegration,bI as browserApiErrorsIntegration,$x as browserProfilingIntegration,kI as browserSessionIntegration,P1 as browserTracingIntegration,Ux as buildLaunchDarklyFlagUsedHandler,ex as captureConsoleIntegration,Wr as captureEvent,me as captureException,RS as captureFeedback,s_ as captureMessage,Kh as captureReactException,cu as captureSession,V0 as chromeStackLineParser,KA as close,cx as consoleLoggingIntegration,Ax as contextLinesIntegration,qA as continueTrace,lx as createConsolaReporter,hx as createLangChainCallbackHandler,L_ as createTransport,vx as createUserFeedbackEnvelope,Ny as dedupeIntegration,Fh as defaultRequestInstrumentationOptions,oI as defaultStackLineParsers,sI as defaultStackParser,Gx as diagnoseSdkConnectivity,nf as endSession,hy as eventFiltersIntegration,lv as eventFromException,dv as eventFromMessage,oc as exceptionFromError,tx as extraErrorDataIntegration,ix as featureFlagsIntegration,_x as feedbackAsyncIntegration,yx as feedbackIntegration,yx as feedbackSyncIntegration,YA as flush,wx as forceLoad,dy as functionToStringIntegration,X0 as geckoStackLineParser,be as getActiveSpan,R as getClient,z as getCurrentScope,GI as getDefaultIntegrations,gx as getFeedback,br as getGlobalScope,Ie as getIsolationScope,Ox as getReplay,Se as getRootSpan,Io as getSpanDescendants,Bm as getSpanStatusFromHttpCode,If as getTraceData,AI as globalHandlersIntegration,xx as graphqlClientIntegration,qx as growthbookIntegration,Cx as httpClientIntegration,PI as httpContextIntegration,my as inboundFiltersIntegration,Yx as init,fx as instrumentAnthropicAiClient,px as instrumentGoogleGenAIClient,mx as instrumentLangGraph,dx as instrumentOpenAiClient,b1 as instrumentOutgoingRequests,tS as instrumentSupabaseClient,u_ as isEnabled,XA as isInitialized,c_ as lastEventId,Bx as launchDarklyIntegration,nv as lazyLoadIntegration,BI as linkedErrorsIntegration,ax as logger,Fx as makeBrowserOfflineTransport,xp as makeFetchTransport,QA as makeMultiplexedTransport,ux as metrics,ZA as moduleMetadataIntegration,kx as onLoad,Hx as openFeatureIntegration,Ex as opera10StackLineParser,Tx as opera11StackLineParser,ny as parameterize,Xx as reactErrorHandler,Kx as reactRouterTracingIntegration,ag as registerSpanErrorInstrumentation,Jx as registerWebWorker,Px as replayCanvasIntegration,Nx as replayIntegration,Lx as reportPageLoaded,Rx as reportingObserverIntegration,nx as rewriteFramesIntegration,iT as sendFeedback,Dx as setActiveSpanInBrowser,i_ as setContext,V_ as setCurrentClient,GA as setExtra,zA as setExtras,qo as setHttpStatus,Cg as setMeasurement,a_ as setTag,VA as setTags,JA as setUser,ml as showReportDialog,jA as spanToBaggageHeader,U as spanToJSON,ng as spanToTraceHeader,Ix as spotlightBrowserIntegration,Bh as startBrowserTracingNavigationSpan,L1 as startBrowserTracingPageLoadSpan,it as startInactiveSpan,Pg as startNewTrace,au as startSession,en as startSpan,Ht as startSpanManual,zx as statsigIntegration,rx as supabaseIntegration,Og as suppressTracing,sx as thirdPartyErrorFilterIntegration,Sx as uiProfiler,jx as unleashIntegration,WA as updateSpanName,Zx as useProfiler,Vx as webWorkerIntegration,bx as winjsStackLineParser,jn as withActiveSpan,eM as withErrorBoundary,HA as withIsolationScope,Qx as withProfiler,Ge as withScope,ox as zodErrorsIntegration};
500
- //# sourceMappingURL=index.client-B5fbXzJV.js.map