import{a as Xa,h as Qv,d as Gh,e as Zv,r as jn,g as ey}from"./react-DJqlvk1W.js";import{e as ty}from"./utils-Jo7XZaji.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="67a8dea8-b5d5-44a3-85b4-267453cc891c",t._sentryDebugIdIdentifier="sentry-dbid-67a8dea8-b5d5-44a3-85b4-267453cc891c")}catch{}})();const qh=Object.prototype.toString;function vr(t){switch(qh.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Yt(t,Error)}}function Ur(t,e){return qh.call(t)===`[object ${e}]`}function Wu(t){return Ur(t,"ErrorEvent")}function yl(t){return Ur(t,"DOMError")}function ny(t){return Ur(t,"DOMException")}function At(t){return Ur(t,"String")}function Vu(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function Ku(t){return t===null||Vu(t)||typeof t!="object"&&typeof t!="function"}function Pn(t){return Ur(t,"Object")}function Wo(t){return typeof Event<"u"&&Yt(t,Event)}function ry(t){return typeof Element<"u"&&Yt(t,Element)}function iy(t){return Ur(t,"RegExp")}function Mi(t){return!!(t&&t.then&&typeof t.then=="function")}function sy(t){return Pn(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function zh(t){return typeof t=="number"&&t!==t}function Yt(t,e){try{return t instanceof e}catch{return!1}}function Wh(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function yr(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Ea(t,e){let n=t;const r=n.length;if(r<=150)return n;e>r&&(e=r);let i=Math.max(e-60,0);i<5&&(i=0);let s=Math.min(i+140,r);return s>r-5&&(s=r),s===r&&(i=Math.max(s-140,0)),n=n.slice(i,s),i>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function uo(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{Wh(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function oy(t,e,n=!1){return At(t)?iy(e)?e.test(t):At(e)?n?t===e:t.includes(e):!1:!1}function Fr(t,e=[],n=!1){return e.some(r=>oy(t,r,n))}function Vh(t,e,n=250,r,i,s,o){if(!s.exception||!s.exception.values||!o||!Yt(o.originalException,Error))return;const u=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;u&&(s.exception.values=ay(Ja(t,e,i,o.originalException,r,s.exception.values,u,0),n))}function Ja(t,e,n,r,i,s,o,u){if(s.length>=n+1)return s;let a=[...s];if(Yt(r[i],Error)){Sl(o,u);const c=t(e,r[i]),l=a.length;bl(c,i,l,u),a=Ja(t,e,n,r[i],i,[c,...a],c,l)}return Array.isArray(r.errors)&&r.errors.forEach((c,l)=>{if(Yt(c,Error)){Sl(o,u);const d=t(e,c),f=a.length;bl(d,`errors[${l}]`,f,u),a=Ja(t,e,n,c,i,[d,...a],d,f)}}),a}function Sl(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function bl(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function ay(t,e){return t.map(n=>(n.value&&(n.value=yr(n.value,e)),n))}function ls(t){return t&&t.Math==Math?t:void 0}const X=typeof globalThis=="object"&&ls(globalThis)||typeof window=="object"&&ls(window)||typeof self=="object"&&ls(self)||typeof global=="object"&&ls(global)||function(){return this}()||{};function Yu(){return X}function Kh(t,e,n){const r=n||X,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const Sr=Yu(),uy=80;function pn(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,i=[];let s=0,o=0;const u=" > ",a=u.length;let c;const l=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||uy;for(;n&&s++<r&&(c=cy(n,l),!(c==="html"||s>1&&o+i.length*a+c.length>=d));)i.push(c),o+=c.length,n=n.parentNode;return i.reverse().join(u)}catch{return"<unknown>"}}function cy(t,e){const n=t,r=[];let i,s,o,u,a;if(!n||!n.tagName)return"";if(Sr.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const c=e&&e.length?e.filter(d=>n.getAttribute(d)).map(d=>[d,n.getAttribute(d)]):null;if(c&&c.length)c.forEach(d=>{r.push(`[${d[0]}="${d[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&At(i))for(s=i.split(/\s+/),a=0;a<s.length;a++)r.push(`.${s[a]}`);const l=["aria-label","type","name","title","alt"];for(a=0;a<l.length;a++)o=l[a],u=n.getAttribute(o),u&&r.push(`[${o}="${u}"]`);return r.join("")}function Yh(){try{return Sr.document.location.href}catch{return""}}function Xh(t){return Sr.document&&Sr.document.querySelector?Sr.document.querySelector(t):null}function Jh(t){if(!Sr.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement&&e.dataset.sentryComponent)return e.dataset.sentryComponent;e=e.parentNode}return null}const Br=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ly="Sentry Logger ",co=["debug","info","warn","error","log","assert","trace"],lo={};function gn(t){if(!("console"in X))return t();const e=X.console,n={},r=Object.keys(lo);r.forEach(i=>{const s=lo[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function dy(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Br?co.forEach(n=>{e[n]=(...r)=>{t&&gn(()=>{X.console[n](`${ly}[${n}]:`,...r)})}}):co.forEach(n=>{e[n]=()=>{}}),e}const O=dy(),fy=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function hy(t){return t==="http"||t==="https"}function Gn(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:u,publicKey:a}=t;return`${u}://${a}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${o}`}function Qh(t){const e=fy.exec(t);if(!e){gn(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,i="",s,o="",u]=e.slice(1);let a="",c=u;const l=c.split("/");if(l.length>1&&(a=l.slice(0,-1).join("/"),c=l.pop()),c){const d=c.match(/^\d+/);d&&(c=d[0])}return Zh({host:s,pass:i,path:a,projectId:c,port:o,protocol:n,publicKey:r})}function Zh(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function py(t){if(!Br)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:(O.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?hy(r)?e&&isNaN(parseInt(e,10))?(O.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(O.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(O.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function ep(t){const e=typeof t=="string"?Qh(t):Zh(t);if(!(!e||!py(e)))return e}class Rt extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function Ue(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);typeof i=="function"&&tp(i,r),t[e]=i}function mn(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{Br&&O.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function tp(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,mn(t,"__sentry_original__",e)}catch{}}function Xu(t){return t.__sentry_original__}function gy(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function np(t){if(vr(t))return{message:t.message,name:t.name,stack:t.stack,...Tl(t)};if(Wo(t)){const e={type:t.type,target:El(t.target),currentTarget:El(t.currentTarget),...Tl(t)};return typeof CustomEvent<"u"&&Yt(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function El(t){try{return ry(t)?pn(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Tl(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function my(t,e=40){const n=Object.keys(np(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return yr(n[0],e);for(let r=n.length;r>0;r--){const i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length?i:yr(i,e)}return""}function Fe(t){return Qa(t,new Map)}function Qa(t,e){if(_y(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))typeof t[i]<"u"&&(r[i]=Qa(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(Qa(i,e))}),r}return t}function _y(t){if(!Pn(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const rp=50,Il=/\(error: (.*)\)/,wl=/captureMessage|captureException/;function ip(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{const i=[],s=n.split(` `);for(let o=r;o<s.length;o++){const u=s[o];if(u.length>1024)continue;const a=Il.test(u)?u.replace(Il,"$1"):u;if(!a.match(/\S*Error: /)){for(const c of e){const l=c(a);if(l){i.push(l);break}}if(i.length>=rp)break}}return yy(i)}}function vy(t){return Array.isArray(t)?ip(...t):t}function yy(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),wl.test(e[e.length-1].function||"")&&(e.pop(),wl.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,rp).map(n=>({...n,filename:n.filename||e[e.length-1].filename,function:n.function||"?"}))}const Ta="<anonymous>";function Xt(t){try{return!t||typeof t!="function"?Ta:t.name||Ta}catch{return Ta}}const Qs={},Cl={};function qn(t,e){Qs[t]=Qs[t]||[],Qs[t].push(e)}function zn(t,e){Cl[t]||(e(),Cl[t]=!0)}function _t(t,e){const n=t&&Qs[t];if(n)for(const r of n)try{r(e)}catch(i){Br&&O.error(`Error while triggering instrumentation handler. Type: ${t} Name: ${Xt(r)} Error:`,i)}}function sp(t){const e="console";qn(e,t),zn(e,Sy)}function Sy(){"console"in X&&co.forEach(function(t){t in X.console&&Ue(X.console,t,function(e){return lo[t]=e,function(...n){_t("console",{args:n,level:t});const i=lo[t];i&&i.apply(X.console,n)}})})}function ue(){const t=X,e=t.crypto||t.msCrypto;let n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function op(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function cn(t){const{message:e,event_id:n}=t;if(e)return e;const r=op(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Za(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function $n(t,e){const n=op(t);if(!n)return;const r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...e},e&&"data"in e){const s={...i&&i.data,...e.data};n.mechanism.data=s}}function by(t,e,n=5){if(e.lineno===void 0)return;const r=t.length,i=Math.max(Math.min(r-1,e.lineno-1),0);e.pre_context=t.slice(Math.max(0,i-n),i).map(s=>Ea(s,0)),e.context_line=Ea(t[Math.min(r-1,i)],e.colno||0),e.post_context=t.slice(Math.min(i+1,r),i+1+n).map(s=>Ea(s,0))}function kl(t){if(t&&t.__sentry_captured__)return!0;try{mn(t,"__sentry_captured__",!0)}catch{}return!1}function ap(t){return Array.isArray(t)?t:[t]}const ur=X,Ey=1e3;let Rl,eu,tu;function up(t){const e="dom";qn(e,t),zn(e,Ty)}function Ty(){if(!ur.document)return;const t=_t.bind(null,"dom"),e=xl(t,!0);ur.document.addEventListener("click",e,!1),ur.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=ur[n]&&ur[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ue(r,"addEventListener",function(i){return function(s,o,u){if(s==="click"||s=="keypress")try{const a=this,c=a.__sentry_instrumentation_handlers__=a.__sentry_instrumentation_handlers__||{},l=c[s]=c[s]||{refCount:0};if(!l.handler){const d=xl(t);l.handler=d,i.call(this,s,d,u)}l.refCount++}catch{}return i.call(this,s,o,u)}}),Ue(r,"removeEventListener",function(i){return function(s,o,u){if(s==="click"||s=="keypress")try{const a=this,c=a.__sentry_instrumentation_handlers__||{},l=c[s];l&&(l.refCount--,l.refCount<=0&&(i.call(this,s,l.handler,u),l.handler=void 0,delete c[s]),Object.keys(c).length===0&&delete a.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,u)}}))})}function Iy(t){if(t.type!==eu)return!1;try{if(!t.target||t.target._sentryId!==tu)return!1}catch{}return!0}function wy(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function xl(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Cy(n);if(wy(n.type,r))return;mn(n,"_sentryCaptured",!0),r&&!r._sentryId&&mn(r,"_sentryId",ue());const i=n.type==="keypress"?"input":n.type;Iy(n)||(t({event:n,name:i,global:e}),eu=n.type,tu=r?r._sentryId:void 0),clearTimeout(Rl),Rl=ur.setTimeout(()=>{tu=void 0,eu=void 0},Ey)}}function Cy(t){try{return t.target}catch{return null}}const fo=Yu();function cp(){if(!("fetch"in fo))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function nu(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function lp(){if(typeof EdgeRuntime=="string")return!0;if(!cp())return!1;if(nu(fo.fetch))return!0;let t=!1;const e=fo.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=nu(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){Br&&O.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function ky(){return"ReportingObserver"in fo}function Vo(t){const e="fetch";qn(e,t),zn(e,Ry)}function Ry(){lp()&&Ue(X,"fetch",function(t){return function(...e){const{method:n,url:r}=xy(e),i={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return _t("fetch",{...i}),t.apply(X,e).then(s=>{const o={...i,endTimestamp:Date.now(),response:s};return _t("fetch",o),s},s=>{const o={...i,endTimestamp:Date.now(),error:s};throw _t("fetch",o),s})}})}function ru(t,e){return!!t&&typeof t=="object"&&!!t[e]}function Ol(t){return typeof t=="string"?t:t?ru(t,"url")?t.url:t.toString?t.toString():"":""}function xy(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:Ol(n),method:ru(r,"method")?String(r.method).toUpperCase():"GET"}}const e=t[0];return{url:Ol(e),method:ru(e,"method")?String(e.method).toUpperCase():"GET"}}let ds=null;function dp(t){const e="error";qn(e,t),zn(e,Oy)}function Oy(){ds=X.onerror,X.onerror=function(t,e,n,r,i){return _t("error",{column:r,error:i,line:n,msg:t,url:e}),ds&&!ds.__SENTRY_LOADER__?ds.apply(this,arguments):!1},X.onerror.__SENTRY_INSTRUMENTED__=!0}let fs=null;function fp(t){const e="unhandledrejection";qn(e,t),zn(e,Ay)}function Ay(){fs=X.onunhandledrejection,X.onunhandledrejection=function(t){return _t("unhandledrejection",t),fs&&!fs.__SENTRY_LOADER__?fs.apply(this,arguments):!0},X.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const hs=Yu();function Dy(){const t=hs.chrome,e=t&&t.app&&t.app.runtime,n="history"in hs&&!!hs.history.pushState&&!!hs.history.replaceState;return!e&&n}const ti=X;let ps;function Li(t){const e="history";qn(e,t),zn(e,My)}function My(){if(!Dy())return;const t=ti.onpopstate;ti.onpopstate=function(...n){const r=ti.location.href,i=ps;if(ps=r,_t("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=ps,o=String(i);ps=o,_t("history",{from:s,to:o})}return n.apply(this,r)}}Ue(ti.history,"pushState",e),Ue(ti.history,"replaceState",e)}const Ly=X,Wt="__sentry_xhr_v3__";function Ko(t){const e="xhr";qn(e,t),zn(e,Ny)}function Ny(){if(!Ly.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;Ue(t,"open",function(e){return function(...n){const r=Date.now(),i=At(n[0])?n[0].toUpperCase():void 0,s=Py(n[1]);if(!i||!s)return e.apply(this,n);this[Wt]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const u=this[Wt];if(u&&this.readyState===4){try{u.status_code=this.status}catch{}const a={args:[i,s],endTimestamp:Date.now(),startTimestamp:r,xhr:this};_t("xhr",a)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Ue(this,"onreadystatechange",function(u){return function(...a){return o(),u.apply(this,a)}}):this.addEventListener("readystatechange",o),Ue(this,"setRequestHeader",function(u){return function(...a){const[c,l]=a,d=this[Wt];return d&&At(c)&&At(l)&&(d.request_headers[c.toLowerCase()]=l),u.apply(this,a)}}),e.apply(this,n)}}),Ue(t,"send",function(e){return function(...n){const r=this[Wt];if(!r)return e.apply(this,n);n[0]!==void 0&&(r.body=n[0]);const i={args:[r.method,r.url],startTimestamp:Date.now(),xhr:this};return _t("xhr",i),e.apply(this,n)}})}function Py(t){if(At(t))return t;try{return t.toString()}catch{}}function $y(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Uy(){return"npm"}function Fy(){return!$y()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function iu(){return typeof window<"u"&&(!Fy()||By())}function By(){return X.process!==void 0&&X.process.type==="renderer"}function Hy(){const t=typeof WeakSet=="function",e=t?new WeakSet:[];function n(i){if(t)return e.has(i)?!0:(e.add(i),!1);for(let s=0;s<e.length;s++)if(e[s]===i)return!0;return e.push(i),!1}function r(i){if(t)e.delete(i);else for(let s=0;s<e.length;s++)if(e[s]===i){e.splice(s,1);break}}return[n,r]}function ht(t,e=100,n=1/0){try{return su("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function hp(t,e=3,n=100*1024){const r=ht(t,e);return zy(r)>n?hp(t,e-1,n):r}function su(t,e,n=1/0,r=1/0,i=Hy()){const[s,o]=i;if(e==null||["number","boolean","string"].includes(typeof e)&&!zh(e))return e;const u=jy(t,e);if(!u.startsWith("[object "))return u;if(e.__sentry_skip_normalization__)return e;const a=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(a===0)return u.replace("object ","");if(s(e))return"[Circular ~]";const c=e;if(c&&typeof c.toJSON=="function")try{const h=c.toJSON();return su("",h,a-1,r,i)}catch{}const l=Array.isArray(e)?[]:{};let d=0;const f=np(e);for(const h in f){if(!Object.prototype.hasOwnProperty.call(f,h))continue;if(d>=r){l[h]="[MaxProperties ~]";break}const p=f[h];l[h]=su(h,p,a-1,r,i),d++}return o(e),l}function jy(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Wh(e))return"[VueViewModel]";if(sy(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${Xt(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const n=Gy(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Gy(t){const e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function qy(t){return~-encodeURI(t).split(/%..|./).length}function zy(t){return qy(JSON.stringify(t))}function Wy(t,e){let n=0;for(let r=t.length-1;r>=0;r--){const i=t[r];i==="."?t.splice(r,1):i===".."?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}const Vy=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Ky(t){const e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=Vy.exec(e);return n?n.slice(1):[]}function Al(...t){let e="",n=!1;for(let r=t.length-1;r>=-1&&!n;r--){const i=r>=0?t[r]:"/";i&&(e=`${i}/${e}`,n=i.charAt(0)==="/")}return e=Wy(e.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+e||"."}function Dl(t){let e=0;for(;e<t.length&&t[e]==="";e++);let n=t.length-1;for(;n>=0&&t[n]==="";n--);return e>n?[]:t.slice(e,n-e+1)}function Yy(t,e){t=Al(t).slice(1),e=Al(e).slice(1);const n=Dl(t.split("/")),r=Dl(e.split("/")),i=Math.min(n.length,r.length);let s=i;for(let u=0;u<i;u++)if(n[u]!==r[u]){s=u;break}let o=[];for(let u=s;u<n.length;u++)o.push("..");return o=o.concat(r.slice(s)),o.join("/")}function Xy(t,e){return Ky(t)[2]}var jt;(function(t){t[t.PENDING=0]="PENDING";const n=1;t[t.RESOLVED=n]="RESOLVED";const r=2;t[t.REJECTED=r]="REJECTED"})(jt||(jt={}));function Ir(t){return new Hr(e=>{e(t)})}function Ju(t){return new Hr((e,n)=>{n(t)})}let Hr=class Cn{constructor(e){Cn.prototype.__init.call(this),Cn.prototype.__init2.call(this),Cn.prototype.__init3.call(this),Cn.prototype.__init4.call(this),this._state=jt.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new Cn((r,i)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(o){i(o)}},s=>{if(!n)i(s);else try{r(n(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Cn((n,r)=>{let i,s;return this.then(o=>{s=!1,i=o,e&&e()},o=>{s=!0,i=o,e&&e()}).then(()=>{if(s){r(i);return}n(i)})})}__init(){this._resolve=e=>{this._setResult(jt.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(jt.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===jt.PENDING){if(Mi(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===jt.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===jt.RESOLVED&&n[1](this._value),this._state===jt.REJECTED&&n[2](this._value),n[0]=!0)})}}};function Jy(t){const e=[];function n(){return t===void 0||e.length<t}function r(o){return e.splice(e.indexOf(o),1)[0]}function i(o){if(!n())return Ju(new Rt("Not adding Promise because buffer limit was reached."));const u=o();return e.indexOf(u)===-1&&e.push(u),u.then(()=>r(u)).then(null,()=>r(u).then(null,()=>{})),u}function s(o){return new Hr((u,a)=>{let c=e.length;if(!c)return u(!0);const l=setTimeout(()=>{o&&o>0&&u(!1)},o);e.forEach(d=>{Ir(d).then(()=>{--c||(clearTimeout(l),u(!0))},a)})})}return{$:e,add:i,drain:s}}function Nn(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Qy(t){return t.split(/[\?#]/,1)[0]}const Zy=["fatal","error","warning","log","info","debug"];function pp(t){return t==="warn"?"warning":Zy.includes(t)?t:"log"}const gp=1e3;function Ni(){return Date.now()/gp}function e0(){const{performance:t}=X;if(!t||!t.now)return Ni;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/gp}const Jt=e0(),qe=(()=>{const{performance:t}=X;if(!t||!t.now)return;const e=3600*1e3,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,o=t.timing&&t.timing.navigationStart,a=typeof o=="number"?Math.abs(o+n-r):e,c=a<e;return s||c?i<=a?t.timeOrigin:o:r})(),ou="baggage",mp="sentry-",t0=/^sentry-/,n0=8192;function _p(t){if(!At(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((r,i)=>{const s=Ml(i);for(const o of Object.keys(s))r[o]=s[o];return r},{});else{if(!t)return;e=Ml(t)}const n=Object.entries(e).reduce((r,[i,s])=>{if(i.match(t0)){const o=i.slice(mp.length);r[o]=s}return r},{});if(Object.keys(n).length>0)return n}function vp(t){if(!t)return;const e=Object.entries(t).reduce((n,[r,i])=>(i&&(n[`${mp}${r}`]=i),n),{});return r0(e)}function Ml(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(e[n]=r,e),{})}function r0(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],i)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=i===0?s:`${e},${s}`;return o.length>n0?(Br&&O.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}const i0=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Qu(t){if(!t)return;const e=t.match(i0);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function s0(t,e){const n=Qu(t),r=_p(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceparentData:n,dynamicSamplingContext:r||{},propagationContext:{traceId:i||ue(),parentSpanId:s||ue().substring(16),spanId:ue().substring(16),sampled:o,dsc:r||{}}}:{traceparentData:n,dynamicSamplingContext:void 0,propagationContext:{traceId:i||ue(),spanId:ue().substring(16)}}}function yp(t,e){const n=Qu(t),r=_p(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceId:i||ue(),parentSpanId:s||ue().substring(16),spanId:ue().substring(16),sampled:o,dsc:r||{}}:{traceId:i||ue(),spanId:ue().substring(16)}}function Zu(t=ue(),e=ue().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function Zt(t,e=[]){return[t,e]}function o0(t,e){const[n,r]=t;return[n,[...r,e]]}function wr(t,e){const n=t[1];for(const r of n){const i=r[0].type;if(e(r,i))return!0}return!1}function a0(t,e){return wr(t,(n,r)=>e.includes(r))}function au(t,e){return(e||new TextEncoder).encode(t)}function Sp(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(o){typeof i=="string"?i=typeof o=="string"?i+o:[au(i,e),o]:i.push(typeof o=="string"?au(o,e):o)}for(const o of r){const[u,a]=o;if(s(` ${JSON.stringify(u)} `),typeof a=="string"||a instanceof Uint8Array)s(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(ht(a))}s(c)}}return typeof i=="string"?i:u0(i)}function u0(t){const e=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function c0(t,e,n){let r=typeof t=="string"?e.encode(t):t;function i(a){const c=r.subarray(0,a);return r=r.subarray(a+1),c}function s(){let a=r.indexOf(10);return a<0&&(a=r.length),JSON.parse(n.decode(i(a)))}const o=s(),u=[];for(;r.length;){const a=s(),c=typeof a.length=="number"?a.length:void 0;u.push([a,c?i(c):s()])}return[o,u]}function l0(t,e){const n=typeof t.data=="string"?au(t.data,e):t.data;return[Fe({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const d0={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function Ll(t){return d0[t]}function ec(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function bp(t,e,n,r){const i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:Gn(r)},...i&&{trace:Fe({...i})}}}function f0(t,e,n){const r=[{type:"client_report"},{timestamp:Ni(),discarded_events:t}];return Zt(e?{dsn:e}:{},[r])}const h0=60*1e3;function Ep(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?h0:r-e}function p0(t,e){return t[e]||t.all||0}function Tp(t,e,n=Date.now()){return p0(t,e)>n}function Ip(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(s)for(const u of s.trim().split(",")){const[a,c,,,l]=u.split(":",5),d=parseInt(a,10),f=(isNaN(d)?60:d)*1e3;if(!c)i.all=r+f;else for(const h of c.split(";"))h==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(i[h]=r+f):i[h]=r+f}else o?i.all=r+Ep(o,r):e===429&&(i.all=r+60*1e3);return i}function g0(t,e){return t(e.stack||"",1)}function m0(t,e){const n={type:e.name||e.constructor.name,value:e.message},r=g0(t,e);return r.length&&(n.stacktrace={frames:r}),n}function _0(t,e){return t??e()}function Zs(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const B=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Pi="production";function tc(){return Kh("globalEventProcessors",()=>[])}function wp(t){tc().push(t)}function ho(t,e,n,r=0){return new Hr((i,s)=>{const o=t[r];if(e===null||typeof o!="function")i(e);else{const u=o({...e},n);B&&o.id&&u===null&&O.log(`Event processor "${o.id}" dropped event`),Mi(u)?u.then(a=>ho(t,a,n,r+1).then(i)).then(null,s):ho(t,u,n,r+1).then(i).then(null,s)}})}function Cp(t){const e=Jt(),n={sid:ue(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>v0(n)};return t&&Un(n,t),n}function Un(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Jt(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:ue()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function kp(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),Un(t,n)}function v0(t){return Fe({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}const y0=0,Rp=1;function nc(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:i,parent_span_id:s,status:o,tags:u,origin:a}=ce(t);return Fe({data:r,op:i,parent_span_id:s,span_id:e,status:o,tags:u,trace_id:n,origin:a})}function Yo(t){const{traceId:e,spanId:n}=t.spanContext(),r=rc(t);return Zu(e,n,r)}function Xo(t){return typeof t=="number"?Nl(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Nl(t.getTime()):Jt()}function Nl(t){return t>9999999999?t/1e3:t}function ce(t){return S0(t)?t.getSpanJSON():typeof t.toJSON=="function"?t.toJSON():{}}function S0(t){return typeof t.getSpanJSON=="function"}function rc(t){const{traceFlags:e}=t.spanContext();return!!(e&Rp)}function ic(t,e,n,r,i,s){const{normalizeDepth:o=3,normalizeMaxBreadth:u=1e3}=t,a={...e,event_id:e.event_id||n.event_id||ue(),timestamp:e.timestamp||Ni()},c=n.integrations||t.integrations.map(_=>_.name);b0(a,t),I0(a,c),e.type===void 0&&E0(a,t.stackParser);const l=C0(r,n.captureContext);n.mechanism&&$n(a,n.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],f=Y0().getScopeData();if(s){const _=s.getScopeData();$l(f,_)}if(l){const _=l.getScopeData();$l(f,_)}const h=[...n.attachments||[],...f.attachments];h.length&&(n.attachments=h),Ap(a,f);const p=[...d,...tc(),...f.eventProcessors];return ho(p,a,n).then(_=>(_&&T0(_),typeof o=="number"&&o>0?w0(_,o,u):_))}function b0(t,e){const{environment:n,release:r,dist:i,maxValueLength:s=250}=e;"environment"in t||(t.environment="environment"in e?n:Pi),t.release===void 0&&r!==void 0&&(t.release=r),t.dist===void 0&&i!==void 0&&(t.dist=i),t.message&&(t.message=yr(t.message,s));const o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=yr(o.value,s));const u=t.request;u&&u.url&&(u.url=yr(u.url,s))}const Pl=new WeakMap;function E0(t,e){const n=X._sentryDebugIds;if(!n)return;let r;const i=Pl.get(e);i?r=i:(r=new Map,Pl.set(e,r));const s=Object.keys(n).reduce((o,u)=>{let a;const c=r.get(u);c?a=c:(a=e(u),r.set(u,a));for(let l=a.length-1;l>=0;l--){const d=a[l];if(d.filename){o[d.filename]=n[u];break}}return o},{});try{t.exception.values.forEach(o=>{o.stacktrace.frames.forEach(u=>{u.filename&&(u.debug_id=s[u.filename])})})}catch{}}function T0(t){const e={};try{t.exception.values.forEach(r=>{r.stacktrace.frames.forEach(i=>{i.debug_id&&(i.abs_path?e[i.abs_path]=i.debug_id:i.filename&&(e[i.filename]=i.debug_id),delete i.debug_id)})})}catch{}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.keys(e).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:e[r]})})}function I0(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function w0(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>({...i,...i.data&&{data:ht(i.data,e,n)}}))},...t.user&&{user:ht(t.user,e,n)},...t.contexts&&{contexts:ht(t.contexts,e,n)},...t.extra&&{extra:ht(t.extra,e,n)}};return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=ht(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>{const s=ce(i).data;return s&&(i.data=ht(s,e,n)),i})),r}function C0(t,e){if(!e)return t;const n=t?t.clone():new kr;return n.update(e),n}function k0(t){if(t)return R0(t)?{captureContext:t}:O0(t)?{captureContext:t}:t}function R0(t){return t instanceof kr||typeof t=="function"}const x0=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function O0(t){return Object.keys(t).some(e=>x0.includes(e))}function $i(t,e){return le().captureException(t,k0(e))}function po(t,e){const n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return le().captureMessage(t,n,r)}function Ui(t,e){return le().captureEvent(t,e)}function A0(t){le().configureScope(t)}function Qt(t,e){le().addBreadcrumb(t,e)}function xp(t,e){le().setContext(t,e)}function D0(t){le().setExtras(t)}function M0(t,e){le().setExtra(t,e)}function L0(t){le().setTags(t)}function N0(t,e){le().setTag(t,e)}function P0(t){le().setUser(t)}function vn(...t){const e=le();if(t.length===2){const[n,r]=t;return n?e.withScope(()=>(e.getStackTop().scope=n,r(n))):e.withScope(r)}return e.withScope(t[0])}function $0(t){return Qo(()=>t(Mt()))}function uu(t,e){return vn(n=>(n.setSpan(t),e(n)))}function U0(t,e){return le().startTransaction({...t},e)}async function F0(t){const e=W();return e?e.flush(t):(B&&O.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function B0(t){const e=W();return e?e.close(t):(B&&O.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function H0(){return le().lastEventId()}function W(){return le().getClient()}function j0(){return!!W()}function we(){return le().getScope()}function cu(t){const e=W(),n=Mt(),r=we(),{release:i,environment:s=Pi}=e&&e.getOptions()||{},{userAgent:o}=X.navigator||{},u=Cp({release:i,environment:s,user:r.getUser()||n.getUser(),...o&&{userAgent:o},...t}),a=n.getSession();return a&&a.status==="ok"&&Un(a,{status:"exited"}),sc(),n.setSession(u),r.setSession(u),u}function sc(){const t=Mt(),e=we(),n=e.getSession()||t.getSession();n&&kp(n),Op(),t.setSession(),e.setSession()}function Op(){const t=Mt(),e=we(),n=W(),r=e.getSession()||t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function lu(t=!1){if(t){sc();return}Op()}function go(t){return t.transaction}function Jo(t,e,n){const r=e.getOptions(),{publicKey:i}=e.getDsn()||{},{segment:s}=n&&n.getUser()||{},o=Fe({environment:r.environment||Pi,release:r.release,user_segment:s,public_key:i,trace_id:t});return e.emit&&e.emit("createDsc",o),o}function Cr(t){const e=W();if(!e)return{};const n=Jo(ce(t).trace_id||"",e,we()),r=go(t);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:s,source:o}=r.metadata;s!=null&&(n.sample_rate=`${s}`);const u=ce(r);return o&&o!=="url"&&(n.transaction=u.description),n.sampled=String(rc(r)),e.emit&&e.emit("createDsc",n),n}function Ap(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;G0(t,e),r&&W0(t,r),V0(t,n),q0(t,i),z0(t,s)}function $l(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,sdkProcessingMetadata:u,breadcrumbs:a,fingerprint:c,eventProcessors:l,attachments:d,propagationContext:f,transactionName:h,span:p}=e;ni(t,"extra",n),ni(t,"tags",r),ni(t,"user",i),ni(t,"contexts",s),ni(t,"sdkProcessingMetadata",u),o&&(t.level=o),h&&(t.transactionName=h),p&&(t.span=p),a.length&&(t.breadcrumbs=[...t.breadcrumbs,...a]),c.length&&(t.fingerprint=[...t.fingerprint,...c]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...f}}function ni(t,e,n){if(n&&Object.keys(n).length){t[e]={...t[e]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[e][r]=n[r])}}function G0(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:u}=e,a=Fe(n);a&&Object.keys(a).length&&(t.extra={...a,...t.extra});const c=Fe(r);c&&Object.keys(c).length&&(t.tags={...c,...t.tags});const l=Fe(i);l&&Object.keys(l).length&&(t.user={...l,...t.user});const d=Fe(s);d&&Object.keys(d).length&&(t.contexts={...d,...t.contexts}),o&&(t.level=o),u&&(t.transaction=u)}function q0(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function z0(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function W0(t,e){t.contexts={trace:nc(e),...t.contexts};const n=go(e);if(n){t.sdkProcessingMetadata={dynamicSamplingContext:Cr(e),...t.sdkProcessingMetadata};const r=ce(n).description;r&&(t.tags={transaction:r,...t.tags})}}function V0(t,e){t.fingerprint=t.fingerprint?ap(t.fingerprint):[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}const K0=100;let Ia,kr=class eo{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Ul()}static clone(e){return e?e.clone():new eo}clone(){const e=new eo;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&Un(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e;if(n instanceof eo){const r=n.getScopeData();this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&Object.keys(r.user).length&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint.length&&(this._fingerprint=r.fingerprint),n.getRequestSession()&&(this._requestSession=n.getRequestSession()),r.propagationContext&&(this._propagationContext=r.propagationContext)}else if(Pn(n)){const r=e;this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint&&(this._fingerprint=r.fingerprint),r.requestSession&&(this._requestSession=r.requestSession),r.propagationContext&&(this._propagationContext=r.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Ul(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:K0;if(r<=0)return this;const i={timestamp:Ni(),...e},s=this._breadcrumbs;return s.push(i),this._breadcrumbs=s.length>r?s.slice(-r):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:n,_contexts:r,_tags:i,_extra:s,_user:o,_level:u,_fingerprint:a,_eventProcessors:c,_propagationContext:l,_sdkProcessingMetadata:d,_transactionName:f,_span:h}=this;return{breadcrumbs:e,attachments:n,contexts:r,tags:i,extra:s,user:o,level:u,fingerprint:a||[],eventProcessors:c,propagationContext:l,sdkProcessingMetadata:d,transactionName:f,span:h}}applyToEvent(e,n={},r=[]){Ap(e,this.getScopeData());const i=[...r,...tc(),...this._eventProcessors];return ho(i,e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n&&n.event_id?n.event_id:ue();if(!this._client)return O.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r&&r.event_id?r.event_id:ue();if(!this._client)return O.warn("No client configured on scope - will not capture message!"),i;const s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:ue();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(O.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function Y0(){return Ia||(Ia=new kr),Ia}function Ul(){return{traceId:ue(),spanId:ue().substring(16)}}const mo="7.120.0",Dp=parseFloat(mo),X0=100;let oc=class{constructor(e,n,r,i=Dp){this._version=i;let s;n?s=n:(s=new kr,s.setClient(e));let o;r?o=r:(o=new kr,o.setClient(e)),this._stack=[{scope:s}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const n=this.getStackTop();n.client=e,n.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){const n=this.pushScope();let r;try{r=e(n)}catch(i){throw this.popScope(),i}return Mi(r)?r.then(i=>(this.popScope(),i),i=>{throw this.popScope(),i}):(this.popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){const r=this._lastEventId=n&&n.event_id?n.event_id:ue(),i=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:ue(),s=new Error(e);return this.getScope().captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:ue();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...n,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=X0}=i.getOptions&&i.getOptions()||{};if(o<=0)return;const a={timestamp:Ni(),...e},c=s?gn(()=>s(a,n)):a;c!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",c,n),r.addBreadcrumb(c,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n),this.getIsolationScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n),this.getIsolationScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n),this.getIsolationScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=du(this);try{e(this)}finally{du(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return B&&O.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return B&&!r&&(this.getClient()?O.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init': Sentry.addTracingExtensions(); Sentry.init({...}); `):O.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,r=n.getSession();r&&kp(r),this._sendSessionUpdate(),n.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=Pi}=r&&r.getOptions()||{},{userAgent:o}=X.navigator||{},u=Cp({release:i,environment:s,user:n.getUser(),...o&&{userAgent:o},...e}),a=n.getSession&&n.getSession();return a&&a.status==="ok"&&Un(a,{status:"exited"}),this.endSession(),n.setSession(u),u}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_callExtensionMethod(e,...n){const i=jr().__SENTRY__;if(i&&i.extensions&&typeof i.extensions[e]=="function")return i.extensions[e].apply(this,n);B&&O.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function jr(){return X.__SENTRY__=X.__SENTRY__||{extensions:{},hub:void 0},X}function du(t){const e=jr(),n=_o(e);return Mp(e,t),n}function le(){const t=jr();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return J0(t)}function Mt(){return le().getIsolationScope()}function J0(t=jr()){return(!Q0(t)||_o(t).isOlderThan(Dp))&&Mp(t,new oc),_o(t)}function Qo(t,e={}){const n=jr();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(t,e):t()}function Q0(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function _o(t){return Kh("hub",()=>new oc,t)}function Mp(t,e){if(!t)return!1;const n=t.__SENTRY__=t.__SENTRY__||{};return n.hub=e,!0}function Dt(t){return(t||le()).getScope().getTransaction()}const Z0=Qu;let Fl=!1;function eS(){Fl||(Fl=!0,dp(fu),fp(fu))}function fu(){const t=Dt();if(t){const e="internal_error";B&&O.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}fu.tag="sentry_tracingErrorCallback";var Bl;(function(t){const e="ok";t.Ok=e;const n="deadline_exceeded";t.DeadlineExceeded=n;const r="unauthenticated";t.Unauthenticated=r;const i="permission_denied";t.PermissionDenied=i;const s="not_found";t.NotFound=s;const o="resource_exhausted";t.ResourceExhausted=o;const u="invalid_argument";t.InvalidArgument=u;const a="unimplemented";t.Unimplemented=a;const c="unavailable";t.Unavailable=c;const l="internal_error";t.InternalError=l;const d="unknown_error";t.UnknownError=d;const f="cancelled";t.Cancelled=f;const h="already_exists";t.AlreadyExists=h;const p="failed_precondition";t.FailedPrecondition=p;const m="aborted";t.Aborted=m;const _="out_of_range";t.OutOfRange=_;const g="data_loss";t.DataLoss=g})(Bl||(Bl={}));function ac(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}const tS=ac;function Zo(t,e){t.setTag("http.status_code",String(e)),t.setData("http.response.status_code",e);const n=ac(e);n!=="unknown_error"&&t.setStatus(n)}function uc(t,e,n=()=>{}){let r;try{r=t()}catch(i){throw e(i),n(),i}return nS(r,e,n)}function nS(t,e,n){return Mi(t)?t.then(r=>(n(),r),r=>{throw e(r),n(),r}):(n(),t)}function Gr(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=W(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function rS(t,e,n=()=>{},r=()=>{}){const i=le(),s=we(),o=s.getSpan(),u=ta(t),a=ea(i,{parentSpan:o,spanContext:u,forceTransaction:!1,scope:s});return s.setSpan(a),uc(()=>e(a),c=>{a&&a.setStatus("internal_error"),n(c,a)},()=>{a&&a.end(),s.setSpan(o),r()})}function iS(t,e){const n=ta(t);return Qo(()=>vn(t.scope,r=>{const i=le(),s=r.getSpan(),u=t.onlyIfParent&&!s?void 0:ea(i,{parentSpan:s,spanContext:n,forceTransaction:t.forceTransaction,scope:r});return uc(()=>e(u),()=>{if(u){const{status:a}=ce(u);(!a||a==="ok")&&u.setStatus("internal_error")}},()=>u&&u.end())}))}function sS(t,e){const n=ta(t);return Qo(()=>vn(t.scope,r=>{const i=le(),s=r.getSpan(),u=t.onlyIfParent&&!s?void 0:ea(i,{parentSpan:s,spanContext:n,forceTransaction:t.forceTransaction,scope:r});function a(){u&&u.end()}return uc(()=>e(u,a),()=>{if(u&&u.isRecording()){const{status:c}=ce(u);(!c||c==="ok")&&u.setStatus("internal_error")}})}))}function br(t){if(!Gr())return;const e=ta(t),n=le(),r=t.scope?t.scope.getSpan():Fi();if(t.onlyIfParent&&!r)return;const o=(t.scope||we()).clone();return ea(n,{parentSpan:r,spanContext:e,forceTransaction:t.forceTransaction,scope:o})}function Fi(){return we().getSpan()}const oS=({sentryTrace:t,baggage:e},n)=>{const r=we(),{traceparentData:i,dynamicSamplingContext:s,propagationContext:o}=s0(t,e);r.setPropagationContext(o),B&&i&&O.log(`[Tracing] Continuing trace ${i.traceId}.`);const u={...i,metadata:Fe({dynamicSamplingContext:s})};return n?Qo(()=>n(u)):u};function ea(t,{parentSpan:e,spanContext:n,forceTransaction:r,scope:i}){if(!Gr())return;const s=Mt();let o;if(e&&!r)o=e.startChild(n);else if(e){const u=Cr(e),{traceId:a,spanId:c}=e.spanContext(),l=rc(e);o=t.startTransaction({traceId:a,parentSpanId:c,parentSampled:l,...n,metadata:{dynamicSamplingContext:u,...n.metadata}})}else{const{traceId:u,dsc:a,parentSpanId:c,sampled:l}={...s.getPropagationContext(),...i.getPropagationContext()};o=t.startTransaction({traceId:u,parentSpanId:c,parentSampled:l,...n,metadata:{dynamicSamplingContext:a,...n.metadata}})}return i.setSpan(o),aS(o,i,s),o}function ta(t){if(t.startTime){const e={...t};return e.startTimestamp=Xo(t.startTime),delete e.startTime,e}return t}const Lp="_sentryScope",Np="_sentryIsolationScope";function aS(t,e,n){t&&(mn(t,Np,n),mn(t,Lp,e))}function uS(t){return{scope:t[Lp],isolationScope:t[Np]}}let pi;function Pp(t){return pi?pi.get(t):void 0}function $p(t){const e=Pp(t);if(!e)return;const n={};for(const[,[r,i]]of e)n[r]||(n[r]=[]),n[r].push(Fe(i));return n}function cS(t,e,n,r,i,s){const o=Fi();if(o){const u=Pp(o)||new Map,a=`${t}:${e}@${r}`,c=u.get(s);if(c){const[,l]=c;u.set(s,[a,{min:Math.min(l.min,n),max:Math.max(l.max,n),count:l.count+=1,sum:l.sum+=n,tags:l.tags}])}else u.set(s,[a,{min:n,max:n,count:1,sum:n,tags:i}]);pi||(pi=new WeakMap),pi.set(o,u)}}const tt="sentry.source",xn="sentry.sample_rate",li="sentry.op",On="sentry.origin",lS="profile_id";let Up=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},Fp=class Bp{constructor(e={}){this._traceId=e.traceId||ue(),this._spanId=e.spanId||ue().substring(16),this._startTime=e.startTimestamp||Jt(),this.tags=e.tags?{...e.tags}:{},this.data=e.data?{...e.data}:{},this.instrumenter=e.instrumenter||"sentry",this._attributes={},this.setAttributes({[On]:e.origin||"manual",[li]:e.op,...e.attributes}),this._name=e.name||e.description,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.status&&(this._status=e.status),e.endTimestamp&&(this._endTime=e.endTimestamp),e.exclusiveTime!==void 0&&(this._exclusiveTime=e.exclusiveTime),this._measurements=e.measurements?{...e.measurements}:{}}get name(){return this._name||""}set name(e){this.updateName(e)}get description(){return this._name}set description(e){this._name=e}get traceId(){return this._traceId}set traceId(e){this._traceId=e}get spanId(){return this._spanId}set spanId(e){this._spanId=e}set parentSpanId(e){this._parentSpanId=e}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(e){this._sampled=e}get attributes(){return this._attributes}set attributes(e){this._attributes=e}get startTimestamp(){return this._startTime}set startTimestamp(e){this._startTime=e}get endTimestamp(){return this._endTime}set endTimestamp(e){this._endTime=e}get status(){return this._status}set status(e){this._status=e}get op(){return this._attributes[li]}set op(e){this.setAttribute(li,e)}get origin(){return this._attributes[On]}set origin(e){this.setAttribute(On,e)}spanContext(){const{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?Rp:y0}}startChild(e){const n=new Bp({...e,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n);const r=go(this);if(n.transaction=r,B&&r){const i=e&&e.op||"< unknown op >",s=ce(n).description||"< unknown name >",o=r.spanContext().spanId,u=`[Tracing] Starting '${i}' span on transaction '${s}' (${o}).`;O.log(u),this._logMessage=u}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setAttribute(e,n){n===void 0?delete this._attributes[e]:this._attributes[e]=n}setAttributes(e){Object.keys(e).forEach(n=>this.setAttribute(n,e[n]))}setStatus(e){return this._status=e,this}setHttpStatus(e){return Zo(this,e),this}setName(e){this.updateName(e)}updateName(e){return this._name=e,this}isSuccess(){return this._status==="ok"}finish(e){return this.end(e)}end(e){if(this._endTime)return;const n=go(this);if(B&&n&&n.spanContext().spanId!==this._spanId){const r=this._logMessage;r&&O.log(r.replace("Starting","Finishing"))}this._endTime=Xo(e)}toTraceparent(){return Yo(this)}toContext(){return Fe({data:this._getData(),description:this._name,endTimestamp:this._endTime,op:this.op,parentSpanId:this._parentSpanId,sampled:this._sampled,spanId:this._spanId,startTimestamp:this._startTime,status:this._status,tags:this.tags,traceId:this._traceId})}updateWithContext(e){return this.data=e.data||{},this._name=e.name||e.description,this._endTime=e.endTimestamp,this.op=e.op,this._parentSpanId=e.parentSpanId,this._sampled=e.sampled,this._spanId=e.spanId||this._spanId,this._startTime=e.startTimestamp||this._startTime,this._status=e.status,this.tags=e.tags||{},this._traceId=e.traceId||this._traceId,this}getTraceContext(){return nc(this)}getSpanJSON(){return Fe({data:this._getData(),description:this._name,op:this._attributes[li],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:this._status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[On],_metrics_summary:$p(this),profile_id:this._attributes[lS],exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}toJSON(){return this.getSpanJSON()}_getData(){const{data:e,_attributes:n}=this,r=Object.keys(e).length>0,i=Object.keys(n).length>0;if(!(!r&&!i))return r&&i?{...e,...n}:r?e:n}},Hp=class extends Fp{constructor(e,n){super(e),this._contexts={},this._hub=n||le(),this._name=e.name||"",this._metadata={...e.metadata},this._trimEnd=e.trimEnd,this.transaction=this;const r=this._metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}get metadata(){return{source:"custom",spanMetadata:{},...this._metadata,...this._attributes[tt]&&{source:this._attributes[tt]},...this._attributes[xn]&&{sampleRate:this._attributes[xn]}}}set metadata(e){this._metadata=e}setName(e,n="custom"){this._name=e,this.setAttribute(tt,n)}updateName(e){return this._name=e,this}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Up(e)),this.spanRecorder.add(this)}setContext(e,n){n===null?delete this._contexts[e]:this._contexts[e]=n}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this._metadata={...this._metadata,...e}}end(e){const n=Xo(e),r=this._finishTransaction(n);if(r)return this._hub.captureEvent(r)}toContext(){const e=super.toContext();return Fe({...e,name:this._name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this._name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){return Cr(this)}setHub(e){this._hub=e}getProfileId(){if(this._contexts!==void 0&&this._contexts.profile!==void 0)return this._contexts.profile.profile_id}_finishTransaction(e){if(this._endTime!==void 0)return;this._name||(B&&O.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>"),super.end(e);const n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this._sampled!==!0){B&&O.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}const r=this.spanRecorder?this.spanRecorder.spans.filter(l=>l!==this&&ce(l).timestamp):[];if(this._trimEnd&&r.length>0){const l=r.map(d=>ce(d).timestamp).filter(Boolean);this._endTime=l.reduce((d,f)=>d>f?d:f)}const{scope:i,isolationScope:s}=uS(this),{metadata:o}=this,{source:u}=o,a={contexts:{...this._contexts,trace:nc(this)},spans:r,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{...o,capturedSpanScope:i,capturedSpanIsolationScope:s,...Fe({dynamicSamplingContext:Cr(this)})},_metrics_summary:$p(this),...u&&{transaction_info:{source:u}}};return Object.keys(this._measurements).length>0&&(B&&O.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),a.measurements=this._measurements),B&&O.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),a}};const gi={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},dS="finishReason",Qn=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];let fS=class extends Up{constructor(e,n,r,i){super(i),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){if(e.spanContext().spanId!==this.transactionSpanId){const n=e.end;e.end=(...r)=>(this._popActivity(e.spanContext().spanId),n.apply(e,r)),ce(e).timestamp===void 0&&this._pushActivity(e.spanContext().spanId)}super.add(e)}},hS=class extends Hp{constructor(e,n,r=gi.idleTimeout,i=gi.finalTimeout,s=gi.heartbeatInterval,o=!1,u=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=i,this._heartbeatInterval=s,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=Qn[4],this._autoFinishAllowed=!u,o&&(B&&O.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),n.getScope().setSpan(this)),u||this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Qn[3],this.end())},this._finalTimeout)}end(e){const n=Xo(e);if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setAttribute(dS,this._finishReason),this.spanRecorder){B&&O.log("[Tracing] finishing IdleTransaction",new Date(n*1e3).toISOString(),this.op);for(const r of this._beforeFinishCallbacks)r(this,n);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanContext().spanId===this.spanContext().spanId)return!0;ce(r).timestamp||(r.setStatus("cancelled"),r.end(n),B&&O.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));const{start_timestamp:i,timestamp:s}=ce(r),o=i&&i<n,u=(this._finalTimeout+this._idleTimeout)/1e3,a=s&&i&&s-i<u;if(B){const c=JSON.stringify(r,void 0,2);o?a||O.log("[Tracing] discarding Span since it finished after Transaction final timeout",c):O.log("[Tracing] discarding Span since it happened after Transaction was finished",c)}return o&&a}),B&&O.log("[Tracing] flushing IdleTransaction")}else B&&O.log("[Tracing] No active IdleTransaction");if(this._onScope){const r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.end(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const n=i=>{this._finished||this._pushActivity(i)},r=i=>{this._finished||this._popActivity(i)};this.spanRecorder=new fS(n,r,this.spanContext().spanId,e),B&&O.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Qn[5],this.end(e)))}setFinishReason(e){this._finishReason=e}sendAutoFinishSignal(){this._autoFinishAllowed||(B&&O.log("[Tracing] Received finish signal for idle transaction."),this._restartIdleTimeout(),this._autoFinishAllowed=!0)}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=Qn[1],this.end(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),B&&O.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,B&&O.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(B&&O.log(`[Tracing] popActivity ${e}`),delete this.activities[e],B&&O.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const n=Jt();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason=Qn[5],this.end(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?this._autoFinishAllowed&&(B&&O.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Qn[0],this.end()):this._pingHeartbeat()}_pingHeartbeat(){B&&O.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function jp(t,e,n){if(!Gr(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setAttribute(xn,Number(t.sampled)),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setAttribute(xn,Number(r))):n.parentSampled!==void 0?r=n.parentSampled:typeof e.tracesSampleRate<"u"?(r=e.tracesSampleRate,t.setAttribute(xn,Number(r))):(r=1,t.setAttribute(xn,r)),Gp(r)?r?(t.sampled=Math.random()<r,t.sampled?(B&&O.log(`[Tracing] starting ${t.op} transaction - ${ce(t).description}`),t):(B&&O.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):(B&&O.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"}`),t.sampled=!1,t):(B&&O.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function Gp(t){return zh(t)||!(typeof t=="number"||typeof t=="boolean")?(B&&O.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?(B&&O.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function pS(){const e=this.getScope().getSpan();return e?{"sentry-trace":Yo(e)}:{}}function gS(t,e){const n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||"sentry",s=t.instrumenter||"sentry";i!==s&&(B&&O.error(`A transaction was started with instrumenter=\`${s}\`, but the SDK is configured with the \`${i}\` instrumenter. The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),t.sampled=!1);let o=new Hp(t,this);return o=jp(o,r,{name:t.name,parentSampled:t.parentSampled,transactionContext:t,attributes:{...t.data,...t.attributes},...e}),o.isRecording()&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function vo(t,e,n,r,i,s,o,u=!1){const a=t.getClient(),c=a&&a.getOptions()||{};let l=new hS(e,t,n,r,o,i,u);return l=jp(l,c,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...s}),l.isRecording()&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",l),l}function cc(){const t=jr();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=gS),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=pS),eS())}function qp(t,e,n){const r=Dt();r&&r.setMeasurement(t,e,n)}function mS(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function _S(t,e,n,r){const i=ec(n),s={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&e&&{dsn:Gn(e)}},o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Zt(s,[o])}function zp(t,e,n,r){const i=ec(n),s=t.type&&t.type!=="replay_event"?t.type:"event";mS(t,n&&n.sdk);const o=bp(t,i,r,e);return delete t.sdkProcessingMetadata,Zt(o,[[{type:s},t]])}const vS="7";function Wp(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function yS(t){return`${Wp(t)}${t.projectId}/envelope/`}function SS(t,e){return gy({sentry_key:t.publicKey,sentry_version:vS,...e&&{sentry_client:`${e.name}/${e.version}`}})}function Vp(t,e={}){const n=typeof e=="string"?e:e.tunnel,r=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return n||`${yS(t)}?${SS(t,r)}`}function bS(t,e){const n=ep(t);if(!n)return"";const r=`${Wp(n)}embed/error-page/`;let i=`dsn=${Gn(n)}`;for(const s in e)if(s!=="dsn"&&s!=="onClose")if(s==="user"){const o=e.user;if(!o)continue;o.name&&(i+=`&name=${encodeURIComponent(o.name)}`),o.email&&(i+=`&email=${encodeURIComponent(o.email)}`)}else i+=`&${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`;return`${r}?${i}`}const Hl=[];function ES(t){const e={};return t.forEach(n=>{const{name:r}=n,i=e[r];i&&!i.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.keys(e).map(n=>e[n])}function TS(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...e,...n]:typeof n=="function"?r=ap(n(e)):r=e;const i=ES(r),s=CS(i,o=>o.name==="Debug");if(s!==-1){const[o]=i.splice(s,1);i.push(o)}return i}function IS(t,e){const n={};return e.forEach(r=>{r&&Kp(t,r,n)}),n}function jl(t,e){for(const n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function Kp(t,e,n){if(n[e.name]){B&&O.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,Hl.indexOf(e.name)===-1&&(e.setupOnce(wp,le),Hl.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),t.on&&typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,s)=>r(i,s,t))}if(t.addEventProcessor&&typeof e.processEvent=="function"){const r=e.processEvent.bind(e),i=Object.assign((s,o)=>r(s,o,t),{id:e.name});t.addEventProcessor(i)}B&&O.log(`Integration installed: ${e.name}`)}function wS(t){const e=W();if(!e||!e.addIntegration){B&&O.warn(`Cannot add integration "${t.name}" because no SDK Client is available.`);return}e.addIntegration(t)}function CS(t,e){for(let n=0;n<t.length;n++)if(e(t[n])===!0)return n;return-1}function Ie(t,e){return Object.assign(function(...r){return e(...r)},{id:t})}function kS(t,e,n,r){const i=Object.entries(Fe(r)).sort((s,o)=>s[0].localeCompare(o[0]));return`${t}${e}${n}${i}`}function RS(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e&=e}return e>>>0}function xS(t){let e="";for(const n of t){const r=Object.entries(n.tags),i=r.length>0?`|#${r.map(([s,o])=>`${s}:${o}`).join(",")}`:"";e+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${i}|T${n.timestamp} `}return e}function OS(t){return t.replace(/[^\w]+/gi,"_")}function AS(t){return t.replace(/[^\w\-.]+/gi,"_")}function DS(t){return t.replace(/[^\w\-./]+/gi,"")}const MS=[[` `,"\\n"],["\r","\\r"],[" ","\\t"],["\\","\\\\"],["|","\\u{7c}"],[",","\\u{2c}"]];function LS(t){for(const[e,n]of MS)if(t===e)return n;return t}function NS(t){return[...t].reduce((e,n)=>e+LS(n),"")}function PS(t){const e={};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=DS(n);e[r]=NS(String(t[n]))}return e}function $S(t,e,n,r){const i={sent_at:new Date().toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&e&&(i.dsn=Gn(e));const s=US(t);return Zt(i,[s])}function US(t){const e=xS(t);return[{type:"statsd",length:e.length},e]}const Gl="Not capturing exception because it's already been captured.";class FS{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=ep(e.dsn):B&&O.warn("No DSN provided, client will not send events."),this._dsn){const n=Vp(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(kl(e)){B&&O.log(Gl);return}let i=n&&n.event_id;return this._process(this.eventFromException(e,n).then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureMessage(e,n,r,i){let s=r&&r.event_id;const o=Vu(e)?e:String(e),u=Ku(e)?this.eventFromMessage(o,n,r):this.eventFromException(e,r);return this._process(u.then(a=>this._captureEvent(a,r,i)).then(a=>{s=a})),s}captureEvent(e,n,r){if(n&&n.originalException&&kl(n.originalException)){B&&O.log(Gl);return}let i=n&&n.event_id;const o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,n,o||r).then(u=>{i=u})),i}captureSession(e){typeof e.release!="string"?B&&O.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Un(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):Ir(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return B&&O.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const n=this._integrations[e.name];Kp(this,e,this._integrations),n||jl(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=zp(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=o0(r,l0(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){const n=_S(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=typeof r=="number"?r:1,s=`${e}:${n}`;B&&O.log(`Recording outcome: "${s}"${i>1?` (${i} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+i}}captureAggregateMetrics(e){B&&O.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const n=$S(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=IS(this,e),jl(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const a of s){const c=a.mechanism;if(c&&c.handled===!1){r=!0;break}}}const o=e.status==="ok";(o&&e.errors===0||o&&r)&&(Un(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Hr(n=>{let r=0;const i=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),n(!0)):(r+=i,e&&r>=e&&(clearInterval(s),n(!1)))},i)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,i=Mt()){const s=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o.length>0&&(n.integrations=o),this.emit("preprocessEvent",e,n),ic(s,e,n,r,this,i).then(u=>{if(u===null)return u;const a={...i.getPropagationContext(),...r?r.getPropagationContext():void 0};if(!(u.contexts&&u.contexts.trace)&&a){const{traceId:l,spanId:d,parentSpanId:f,dsc:h}=a;u.contexts={trace:{trace_id:l,span_id:d,parent_span_id:f},...u.contexts};const p=h||Jo(l,this,r);u.sdkProcessingMetadata={dynamicSamplingContext:p,...u.sdkProcessingMetadata}}return u})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(B){const s=i;s.logLevel==="log"?O.log(s.message):O.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i,o=Xp(e),u=Yp(e),a=e.type||"error",c=`before send for type \`${a}\``;if(u&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),Ju(new Rt(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const l=a==="replay_event"?"replay":a,f=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,f).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",l,e),new Rt("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return h;const m=HS(i,h,n);return BS(m,c)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",l,e),o){const g=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",g)}throw new Rt(`${c} returned \`null\`, will not send event.`,"log")}const p=r&&r.getSession();if(!o&&p&&this._updateSessionFromEvent(p,h),o){const _=h.sdkProcessingMetadata&&h.sdkProcessingMetadata.spanCountBeforeProcessing||0,g=h.spans?h.spans.length:0,v=_-g;v>0&&this.recordDroppedEvent("before_send","span",v)}const m=h.transaction_info;if(o&&m&&h.transaction!==e.transaction){const _="custom";h.transaction_info={...m,source:_}}return this.sendEvent(h,n),h}).then(null,h=>{throw h instanceof Rt?h:(this.captureException(h,{data:{__sentry__:!0},originalException:h}),new Rt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${h}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,n=>{B&&O.error("Error while sending event:",n)});B&&O.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{const[r,i]=n.split(":");return{reason:r,category:i,quantity:e[n]}})}}function BS(t,e){const n=`${e} must return \`null\` or a valid event.`;if(Mi(t))return t.then(r=>{if(!Pn(r)&&r!==null)throw new Rt(n);return r},r=>{throw new Rt(`${e} rejected with ${r}`)});if(!Pn(t)&&t!==null)throw new Rt(n);return t}function HS(t,e,n){const{beforeSend:r,beforeSendTransaction:i}=t;if(Yp(e)&&r)return r(e,n);if(Xp(e)&&i){if(e.spans){const s=e.spans.length;e.sdkProcessingMetadata={...e.sdkProcessingMetadata,spanCountBeforeProcessing:s}}return i(e,n)}return e}function Yp(t){return t.type===void 0}function Xp(t){return t.type==="transaction"}function Jp(t){const e=W();!e||!e.addEventProcessor||e.addEventProcessor(t)}const Qp="c",Zp="g",lc="s",eg="d",jS=5e3;class GS{constructor(e){this._value=e}get weight(){return 1}add(e){this._value+=e}toString(){return`${this._value}`}}class qS{constructor(e){this._last=e,this._min=e,this._max=e,this._sum=e,this._count=1}get weight(){return 5}add(e){this._last=e,e<this._min&&(this._min=e),e>this._max&&(this._max=e),this._sum+=e,this._count++}toString(){return`${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`}}class zS{constructor(e){this._value=[e]}get weight(){return this._value.length}add(e){this._value.push(e)}toString(){return this._value.join(":")}}class WS{constructor(e){this.first=e,this._value=new Set([e])}get weight(){return this._value.size}add(e){this._value.add(e)}toString(){return Array.from(this._value).map(e=>typeof e=="string"?RS(e):e).join(":")}}const VS={[Qp]:GS,[Zp]:qS,[eg]:zS,[lc]:WS};function KS(t,e){e.debug===!0&&(B?O.enable():gn(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),we().update(e.initialScope);const r=new t(e);tg(r),YS(r)}function tg(t){const n=le().getStackTop();n.client=t,n.scope.setClient(t)}function YS(t){t.init?t.init():t.setupIntegrations&&t.setupIntegrations()}const XS=30;function dc(t,e,n=Jy(t.bufferSize||XS)){let r={};const i=o=>n.drain(o);function s(o){const u=[];if(wr(o,(d,f)=>{const h=Ll(f);if(Tp(r,h)){const p=ql(d,f);t.recordDroppedEvent("ratelimit_backoff",h,p)}else u.push(d)}),u.length===0)return Ir();const a=Zt(o[0],u),c=d=>{wr(a,(f,h)=>{const p=ql(f,h);t.recordDroppedEvent(d,Ll(h),p)})},l=()=>e({body:Sp(a,t.textEncoder)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&B&&O.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=Ip(r,d),d),d=>{throw c("network_error"),d});return n.add(l).then(d=>d,d=>{if(d instanceof Rt)return B&&O.error("Skipped sending event because buffer is full."),c("queue_overflow"),Ir();throw d})}return s.__sentry__baseTransport__=!0,{send:s,flush:i}}function ql(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}const JS=100,zl=5e3,QS=36e5;function wa(t,e){B&&O.info(`[Offline]: ${t}`,e)}function ZS(t){return e=>{const n=t(e),r=e.createStore?e.createStore(e):void 0;let i=zl,s;function o(l,d,f){return a0(l,["replay_event","replay_recording","client_report"])?!1:e.shouldStore?e.shouldStore(l,d,f):!0}function u(l){r&&(s&&clearTimeout(s),s=setTimeout(async()=>{s=void 0;const d=await r.pop();d&&(wa("Attempting to send previously queued event"),c(d).catch(f=>{wa("Failed to retry sending",f)}))},l),typeof s!="number"&&s.unref&&s.unref())}function a(){s||(u(i),i=Math.min(i*2,QS))}async function c(l){try{const d=await n.send(l);let f=JS;if(d){if(d.headers&&d.headers["retry-after"])f=Ep(d.headers["retry-after"]);else if((d.statusCode||0)>=400)return d}return u(f),i=zl,d}catch(d){if(r&&await o(l,d,i))return await r.insert(l),a(),wa("Error sending. Event queued",d),{};throw d}}return e.flushAtStartup&&a(),{send:c,flush:l=>n.flush(l)}}}function ng(t,e){let n;return wr(t,(r,i)=>(e.includes(i)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function eb(t,e){return n=>{const r=t(n);return{...r,send:async i=>{const s=ng(i,["event","transaction","profile","replay_event"]);return s&&(s.release=e),r.send(i)}}}}function tb(t,e){return Zt(e?{...t[0],dsn:e}:t[0],t[1])}function nb(t,e){return n=>{const r=t(n),i=new Map;function s(a,c){const l=c?`${a}:${c}`:a;let d=i.get(l);if(!d){const f=Qh(a);if(!f)return;const h=Vp(f,n.tunnel);d=c?eb(t,c)({...n,url:h}):t({...n,url:h}),i.set(l,d)}return[a,d]}async function o(a){function c(f){const h=f&&f.length?f:["event"];return ng(a,h)}const l=e({envelope:a,getEvent:c}).map(f=>typeof f=="string"?s(f,void 0):s(f.dsn,f.release)).filter(f=>!!f);return l.length===0&&l.push(["",r]),(await Promise.all(l.map(([f,h])=>h.send(tb(a,f)))))[0]}async function u(a){const c=[await r.flush(a)];for(const[,l]of i)c.push(await l.flush(a));return c.every(l=>l)}return{send:o,flush:u}}}function rb(t,e){const n={sent_at:new Date().toISOString()};e&&(n.dsn=Gn(e));const r=t.map(ib);return Zt(n,r)}function ib(t){return[{type:"span"},t]}function rg(t,e){const n=e&&ab(e)?e.getClient():e,r=n&&n.getDsn(),i=n&&n.getOptions().tunnel;return ob(t,r)||sb(t,i)}function sb(t,e){return e?Wl(t)===Wl(e):!1}function ob(t,e){return e?t.includes(e.host):!1}function Wl(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function ab(t){return t.getClient!==void 0}function ub(t,...e){const n=new String(String.raw(t,...e));return n.__sentry_template_string__=t.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=e,n}function ig(t,e,n=[e],r="npm"){const i=t._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${e}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:mo})),version:mo}),t._metadata=i}const sg=new Map,Vl=new Set;function cb(t){if(X._sentryModuleMetadata)for(const e of Object.keys(X._sentryModuleMetadata)){const n=X._sentryModuleMetadata[e];if(Vl.has(e))continue;Vl.add(e);const r=t(e);for(const i of r.reverse())if(i.filename){sg.set(i.filename,n);break}}}function lb(t,e){return cb(t),sg.get(e)}function db(t,e){try{e.exception.values.forEach(n=>{if(n.stacktrace)for(const r of n.stacktrace.frames||[]){if(!r.filename)continue;const i=lb(t,r.filename);i&&(r.module_metadata=i)}})}catch{}}function fb(t){try{t.exception.values.forEach(e=>{if(e.stacktrace)for(const n of e.stacktrace.frames||[])delete n.module_metadata})}catch{}}const og="ModuleMetadata",hb=()=>({name:og,setupOnce(){},setup(t){typeof t.on=="function"&&t.on("beforeEnvelope",e=>{wr(e,(n,r)=>{if(r==="event"){const i=Array.isArray(n)?n[1]:void 0;i&&(fb(i),n[1]=i)}})})},processEvent(t,e,n){const r=n.getOptions().stackParser;return db(r,t),t}}),ag=hb,pb=Ie(og,ag),gb=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],mb=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],ug="InboundFilters",_b=(t={})=>({name:ug,setupOnce(){},processEvent(e,n,r){const i=r.getOptions(),s=vb(t,i);return yb(e,s)?null:e}}),fc=_b,cg=Ie(ug,fc);function vb(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:gb],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:mb],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function yb(t,e){return e.ignoreInternal&&wb(t)?(B&&O.warn(`Event dropped due to being internal Sentry Error. Event: ${cn(t)}`),!0):Sb(t,e.ignoreErrors)?(B&&O.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${cn(t)}`),!0):bb(t,e.ignoreTransactions)?(B&&O.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${cn(t)}`),!0):Eb(t,e.denyUrls)?(B&&O.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${cn(t)}. Url: ${yo(t)}`),!0):Tb(t,e.allowUrls)?!1:(B&&O.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${cn(t)}. Url: ${yo(t)}`),!0)}function Sb(t,e){return t.type||!e||!e.length?!1:Ib(t).some(n=>Fr(n,e))}function bb(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const n=t.transaction;return n?Fr(n,e):!1}function Eb(t,e){if(!e||!e.length)return!1;const n=yo(t);return n?Fr(n,e):!1}function Tb(t,e){if(!e||!e.length)return!0;const n=yo(t);return n?Fr(n,e):!0}function Ib(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),B&&e.length===0&&O.error(`Could not extract message for event ${cn(t)}`),e}function wb(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function Cb(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function yo(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?Cb(e):null}catch{return B&&O.error(`Cannot extract url for event ${cn(t)}`),null}}let Kl;const lg="FunctionToString",Yl=new WeakMap,kb=()=>({name:lg,setupOnce(){Kl=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=Xu(this),n=Yl.has(W())&&e!==void 0?e:this;return Kl.apply(n,t)}}catch{}},setup(t){Yl.set(t,!0)}}),hc=kb,dg=Ie(lg,hc),Rb="cause",xb=5,fg="LinkedErrors",Ob=(t={})=>{const e=t.limit||xb,n=t.key||Rb;return{name:fg,setupOnce(){},preprocessEvent(r,i,s){const o=s.getOptions();Vh(m0,o.stackParser,o.maxValueLength,n,e,r,i)}}},Ab=Ob,Db=Ie(fg,Ab),Mb=Object.freeze(Object.defineProperty({__proto__:null,FunctionToString:dg,InboundFilters:cg,LinkedErrors:Db},Symbol.toStringTag,{value:"Module"}));class Lb{constructor(e){this._client=e,this._buckets=new Map,this._interval=setInterval(()=>this.flush(),jS)}add(e,n,r,i="none",s={},o=Jt()){const u=Math.floor(o),a=AS(n),c=PS(s),l=OS(i),d=kS(e,a,l,c);let f=this._buckets.get(d);const h=f&&e===lc?f.metric.weight:0;f?(f.metric.add(r),f.timestamp<u&&(f.timestamp=u)):(f={metric:new VS[e](r),timestamp:u,metricType:e,name:a,unit:l,tags:c},this._buckets.set(d,f));const p=typeof r=="string"?f.metric.weight-h:r;cS(e,a,p,l,s,d)}flush(){if(this._buckets.size!==0){if(this._client.captureAggregateMetrics){const e=Array.from(this._buckets).map(([,n])=>n);this._client.captureAggregateMetrics(e)}this._buckets.clear()}}close(){clearInterval(this._interval),this.flush()}}const hg="MetricsAggregator",Nb=()=>({name:hg,setupOnce(){},setup(t){t.metricsAggregator=new Lb(t)}}),pg=Nb,Pb=Ie(hg,pg);function na(t,e,n,r={}){const i=W(),s=we();if(i){if(!i.metricsAggregator){B&&O.warn("No metrics aggregator enabled. Please add the MetricsAggregator integration to use metrics APIs");return}const{unit:o,tags:u,timestamp:a}=r,{release:c,environment:l}=i.getOptions(),d=s.getTransaction(),f={};c&&(f.release=c),l&&(f.environment=l),d&&(f.transaction=ce(d).description||""),B&&O.log(`Adding value of ${n} to ${t} metric ${e}`),i.metricsAggregator.add(t,e,n,o,{...f,...u},a)}}function $b(t,e=1,n){na(Qp,t,e,n)}function Ub(t,e,n){na(eg,t,e,n)}function Fb(t,e,n){na(lc,t,e,n)}function Bb(t,e,n){na(Zp,t,e,n)}const Hb={increment:$b,distribution:Ub,set:Fb,gauge:Bb,MetricsAggregator:Pb,metricsAggregatorIntegration:pg},jb=Mb,ie=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,G=X;function gg(){G.document?G.document.addEventListener("visibilitychange",()=>{const t=Dt();if(G.document.hidden&&t){const e="cancelled",{op:n,status:r}=ce(t);ie&&O.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.end()}}):ie&&O.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Bi=(t,e,n)=>{let r,i;return s=>{e.value>=0&&(s||n)&&(i=e.value-(r||0),(i||r===void 0)&&(r=e.value,e.delta=i,t(e)))}},Gb=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,qb=()=>{const t=G.performance.timing,e=G.performance.navigation.type,n={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(const r in t)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n},ra=()=>G.__WEB_VITALS_POLYFILL__?G.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||qb()):G.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],pc=()=>{const t=ra();return t&&t.activationStart||0},Hi=(t,e)=>{const n=ra();let r="navigate";return n&&(G.document&&G.document.prerendering||pc()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:Gb(),navigationType:r}},qr=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(i=>{e(i.getEntries())});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},ji=(t,e)=>{const n=r=>{(r.type==="pagehide"||G.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};G.document&&(addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0))},zb=(t,e={})=>{const n=Hi("CLS",0);let r,i=0,s=[];const o=a=>{a.forEach(c=>{if(!c.hadRecentInput){const l=s[0],d=s[s.length-1];i&&s.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-l.startTime<5e3?(i+=c.value,s.push(c)):(i=c.value,s=[c]),i>n.value&&(n.value=i,n.entries=s,r&&r())}})},u=qr("layout-shift",o);if(u){r=Bi(t,n,e.reportAllChanges);const a=()=>{o(u.takeRecords()),r(!0)};return ji(a),a}};let So=-1;const Wb=()=>{G.document&&G.document.visibilityState&&(So=G.document.visibilityState==="hidden"&&!G.document.prerendering?0:1/0)},Vb=()=>{ji(({timeStamp:t})=>{So=t},!0)},gc=()=>(So<0&&(Wb(),Vb()),{get firstHiddenTime(){return So}}),Kb=t=>{const e=gc(),n=Hi("FID");let r;const i=u=>{u.startTime<e.firstHiddenTime&&(n.value=u.processingStart-u.startTime,n.entries.push(u),r(!0))},s=u=>{u.forEach(i)},o=qr("first-input",s);r=Bi(t,n),o&&ji(()=>{s(o.takeRecords()),o.disconnect()},!0)};let mg=0,Ca=1/0,gs=0;const Yb=t=>{t.forEach(e=>{e.interactionId&&(Ca=Math.min(Ca,e.interactionId),gs=Math.max(gs,e.interactionId),mg=gs?(gs-Ca)/7+1:0)})};let hu;const Xb=()=>hu?mg:performance.interactionCount||0,Jb=()=>{"interactionCount"in performance||hu||(hu=qr("event",Yb,{type:"event",buffered:!0,durationThreshold:0}))},_g=()=>Xb(),Xl=10,qt=[],ka={},Jl=t=>{const e=qt[qt.length-1],n=ka[t.interactionId];if(n||qt.length<Xl||t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};ka[r.id]=r,qt.push(r)}qt.sort((r,i)=>i.latency-r.latency),qt.splice(Xl).forEach(r=>{delete ka[r.id]})}},Qb=()=>{const t=Math.min(qt.length-1,Math.floor(_g()/50));return qt[t]},Zb=(t,e)=>{e=e||{},Jb();const n=Hi("INP");let r;const i=o=>{o.forEach(a=>{a.interactionId&&Jl(a),a.entryType==="first-input"&&!qt.some(l=>l.entries.some(d=>a.duration===d.duration&&a.startTime===d.startTime))&&Jl(a)});const u=Qb();u&&u.latency!==n.value&&(n.value=u.latency,n.entries=u.entries,r())},s=qr("event",i,{durationThreshold:e.durationThreshold||40});r=Bi(t,n,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),ji(()=>{i(s.takeRecords()),n.value<0&&_g()>0&&(n.value=0,n.entries=[]),r(!0)}))},Ql={},eE=t=>{const e=gc(),n=Hi("LCP");let r;const i=o=>{const u=o[o.length-1];if(u){const a=Math.max(u.startTime-pc(),0);a<e.firstHiddenTime&&(n.value=a,n.entries=[u],r())}},s=qr("largest-contentful-paint",i);if(s){r=Bi(t,n);const o=()=>{Ql[n.id]||(i(s.takeRecords()),s.disconnect(),Ql[n.id]=!0,r(!0))};return["keydown","click"].forEach(u=>{G.document&&addEventListener(u,o,{once:!0,capture:!0})}),ji(o,!0),o}},pu=t=>{G.document&&(G.document.prerendering?addEventListener("prerenderingchange",()=>pu(t),!0):G.document.readyState!=="complete"?addEventListener("load",()=>pu(t),!0):setTimeout(t,0))},tE=(t,e)=>{e=e||{};const n=Hi("TTFB"),r=Bi(t,n,e.reportAllChanges);pu(()=>{const i=ra();if(i){if(n.value=Math.max(i.responseStart-pc(),0),n.value<0||n.value>performance.now())return;n.entries=[i],r(!0)}})},mi={},bo={};let vg,yg,Sg,bg,Eg;function nE(t,e=!1){return Gi("cls",t,oE,vg,e)}function Tg(t,e=!1){return Gi("lcp",t,uE,Sg,e)}function rE(t){return Gi("ttfb",t,cE,bg)}function iE(t){return Gi("fid",t,aE,yg)}function sE(t){return Gi("inp",t,lE,Eg)}function _n(t,e){return Ig(t,e),bo[t]||(dE(t),bo[t]=!0),wg(t,e)}function zr(t,e){const n=mi[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(i){ie&&O.error(`Error while triggering instrumentation handler. Type: ${t} Name: ${Xt(r)} Error:`,i)}}function oE(){return zb(t=>{zr("cls",{metric:t}),vg=t},{reportAllChanges:!0})}function aE(){return Kb(t=>{zr("fid",{metric:t}),yg=t})}function uE(){return eE(t=>{zr("lcp",{metric:t}),Sg=t})}function cE(){return tE(t=>{zr("ttfb",{metric:t}),bg=t})}function lE(){return Zb(t=>{zr("inp",{metric:t}),Eg=t})}function Gi(t,e,n,r,i=!1){Ig(t,e);let s;return bo[t]||(s=n(),bo[t]=!0),r&&e({metric:r}),wg(t,e,i?s:void 0)}function dE(t){const e={};t==="event"&&(e.durationThreshold=0),qr(t,n=>{zr(t,{entries:n})},e)}function Ig(t,e){mi[t]=mi[t]||[],mi[t].push(e)}function wg(t,e,n){return()=>{n&&n();const r=mi[t];if(!r)return;const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}function Ra(t){return typeof t=="number"&&isFinite(t)}function Rr(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}const fE=2147483647;function Ae(t){return t/1e3}function mc(){return G&&G.addEventListener&&G.performance}let Zl=0,Ee={},wt,_i;function Cg(){const t=mc();if(t&&qe){t.mark&&G.performance.mark("sentry-tracing-init");const e=gE(),n=hE(),r=pE(),i=mE();return()=>{e(),n(),r(),i()}}return()=>{}}function kg(){_n("longtask",({entries:t})=>{for(const e of t){const n=Dt();if(!n)return;const r=Ae(qe+e.startTime),i=Ae(e.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}})}function Rg(){_n("event",({entries:t})=>{for(const e of t){const n=Dt();if(!n)return;if(e.name==="click"){const r=Ae(qe+e.startTime),i=Ae(e.duration),s={description:pn(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i},o=Jh(e.target);o&&(s.attributes={"ui.component_name":o}),n.startChild(s)}}})}function xg(t,e){if(mc()&&qe){const r=_E(t,e);return()=>{r()}}return()=>{}}function hE(){return nE(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(ie&&O.log("[Measurements] Adding CLS"),Ee.cls={value:t.value,unit:""},_i=e)},!0)}function pE(){return Tg(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(ie&&O.log("[Measurements] Adding LCP"),Ee.lcp={value:t.value,unit:"millisecond"},wt=e)},!0)}function gE(){return iE(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=Ae(qe),r=Ae(e.startTime);ie&&O.log("[Measurements] Adding FID"),Ee.fid={value:t.value,unit:"millisecond"},Ee["mark.fid"]={value:n+r,unit:"second"}})}function mE(){return rE(({metric:t})=>{t.entries[t.entries.length-1]&&(ie&&O.log("[Measurements] Adding TTFB"),Ee.ttfb={value:t.value,unit:"millisecond"})})}const ed={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 _E(t,e){return sE(({metric:n})=>{if(n.value===void 0)return;const r=n.entries.find(S=>S.duration===n.value&&ed[S.name]!==void 0),i=W();if(!r||!i)return;const s=ed[r.name],o=i.getOptions(),u=Ae(qe+r.startTime),a=Ae(n.value),c=r.interactionId!==void 0?t[r.interactionId]:void 0;if(c===void 0)return;const{routeName:l,parentContext:d,activeTransaction:f,user:h,replayId:p}=c,m=h!==void 0?h.email||h.id||h.ip_address:void 0,_=f!==void 0?f.getProfileId():void 0,g=new Fp({startTimestamp:u,endTimestamp:u+a,op:`ui.interaction.${s}`,name:pn(r.target),attributes:{release:o.release,environment:o.environment,transaction:l,...m!==void 0&&m!==""?{user:m}:{},..._!==void 0?{profile_id:_}:{},...p!==void 0?{replay_id:p}:{}},exclusiveTime:n.value,measurements:{inp:{value:n.value,unit:"millisecond"}}}),v=wE(d,o,e);if(v&&Math.random()<v){const S=g?rb([g],i.getDsn()):void 0,C=i&&i.getTransport();C&&S&&C.send(S).then(null,R=>{ie&&O.error("Error while sending interaction:",R)});return}})}function Og(t){const e=mc();if(!e||!G.performance.getEntries||!qe)return;ie&&O.log("[Tracing] Adding & adjusting spans using Performance API");const n=Ae(qe),r=e.getEntries(),{op:i,start_timestamp:s}=ce(t);if(r.slice(Zl).forEach(o=>{const u=Ae(o.startTime),a=Ae(o.duration);if(!(t.op==="navigation"&&s&&n+u<s))switch(o.entryType){case"navigation":{yE(t,o,n);break}case"mark":case"paint":case"measure":{vE(t,o,u,a,n);const c=gc(),l=o.startTime<c.firstHiddenTime;o.name==="first-paint"&&l&&(ie&&O.log("[Measurements] Adding FP"),Ee.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&l&&(ie&&O.log("[Measurements] Adding FCP"),Ee.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{bE(t,o,o.name,u,a,n);break}}}),Zl=Math.max(r.length-1,0),EE(t),i==="pageload"){IE(Ee),["fcp","fp","lcp"].forEach(u=>{if(!Ee[u]||!s||n>=s)return;const a=Ee[u].value,c=n+Ae(a),l=Math.abs((c-s)*1e3),d=l-a;ie&&O.log(`[Measurements] Normalized ${u} from ${a} to ${l} (${d})`),Ee[u].value=l});const o=Ee["mark.fid"];o&&Ee.fid&&(Rr(t,{description:"first input delay",endTimestamp:o.value+Ae(Ee.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete Ee["mark.fid"]),"fcp"in Ee||delete Ee.cls,Object.keys(Ee).forEach(u=>{qp(u,Ee[u].value,Ee[u].unit)}),TE(t)}wt=void 0,_i=void 0,Ee={}}function vE(t,e,n,r,i){const s=i+n,o=s+r;return Rr(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s}),s}function yE(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{ms(t,e,r,n)}),ms(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),ms(t,e,"fetch",n,"cache","domainLookupStart"),ms(t,e,"domainLookup",n,"DNS"),SE(t,e,n)}function ms(t,e,n,r,i,s){const o=s?e[s]:e[`${n}End`],u=e[`${n}Start`];!u||!o||Rr(t,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+Ae(u),endTimestamp:r+Ae(o)})}function SE(t,e,n){e.responseEnd&&(Rr(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+Ae(e.requestStart),endTimestamp:n+Ae(e.responseEnd)}),Rr(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+Ae(e.responseStart),endTimestamp:n+Ae(e.responseEnd)}))}function bE(t,e,n,r,i,s){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const o=Nn(n),u={};xa(u,e,"transferSize","http.response_transfer_size"),xa(u,e,"encodedBodySize","http.response_content_length"),xa(u,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(u["resource.render_blocking_status"]=e.renderBlockingStatus),o.protocol&&(u["url.scheme"]=o.protocol.split(":").pop()),o.host&&(u["server.address"]=o.host),u["url.same_origin"]=n.includes(G.location.origin);const a=s+r,c=a+i;Rr(t,{description:n.replace(G.location.origin,""),endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:u})}function EE(t){const e=G.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),Ra(n.rtt)&&(Ee["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Ra(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),Ra(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function TE(t){wt&&(ie&&O.log("[Measurements] Adding LCP Data"),wt.element&&t.setTag("lcp.element",pn(wt.element)),wt.id&&t.setTag("lcp.id",wt.id),wt.url&&t.setTag("lcp.url",wt.url.trim().slice(0,200)),t.setTag("lcp.size",wt.size)),_i&&_i.sources&&(ie&&O.log("[Measurements] Adding CLS Data"),_i.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,pn(e.node))))}function xa(t,e,n,r){const i=e[n];i!=null&&i<fE&&(t[r]=i)}function IE(t){const e=ra();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(ie&&O.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function wE(t,e,n){if(!Gr(e))return!1;let r;return t!==void 0&&typeof e.tracesSampler=="function"?r=e.tracesSampler({transactionContext:t,name:t.name,parentSampled:t.parentSampled,attributes:{...t.data,...t.attributes},location:G.location}):t!==void 0&&t.sampled!==void 0?r=t.sampled:typeof e.tracesSampleRate<"u"?r=e.tracesSampleRate:r=1,Gp(r)?r===!0?n:r===!1?0:r*n:(ie&&O.warn("[Tracing] Discarding interaction span because of invalid sample rate."),!1)}function CE(t,e,n,r,i="auto.http.browser"){if(!Gr()||!t.fetchData)return;const s=e(t.fetchData.url);if(t.endTimestamp&&s){const h=t.fetchData.__span;if(!h)return;const p=r[h];p&&(xE(p,t),delete r[h]);return}const o=we(),u=W(),{method:a,url:c}=t.fetchData,l=RE(c),d=l?Nn(l).host:void 0,f=s?br({name:`${a} ${c}`,onlyIfParent:!0,attributes:{url:c,type:"fetch","http.method":a,"http.url":l,"server.address":d,[On]:i},op:"http.client"}):void 0;if(f&&(t.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f),n(t.fetchData.url)&&u){const h=t.args[0];t.args[1]=t.args[1]||{};const p=t.args[1];p.headers=kE(h,u,o,p,f)}return f}function kE(t,e,n,r,i){const s=i||n.getSpan(),o=Mt(),{traceId:u,spanId:a,sampled:c,dsc:l}={...o.getPropagationContext(),...n.getPropagationContext()},d=s?Yo(s):Zu(u,a,c),f=vp(l||(s?Cr(s):Jo(u,e,n))),h=r.headers||(typeof Request<"u"&&Yt(t,Request)?t.headers:void 0);if(h)if(typeof Headers<"u"&&Yt(h,Headers)){const p=new Headers(h);return p.append("sentry-trace",d),f&&p.append(ou,f),p}else if(Array.isArray(h)){const p=[...h,["sentry-trace",d]];return f&&p.push([ou,f]),p}else{const p="baggage"in h?h.baggage:void 0,m=[];return Array.isArray(p)?m.push(...p):p&&m.push(p),f&&m.push(f),{...h,"sentry-trace":d,baggage:m.length>0?m.join(","):void 0}}else return{"sentry-trace":d,baggage:f}}function RE(t){try{return new URL(t).href}catch{return}}function xE(t,e){if(e.response){Zo(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus("internal_error");t.end()}const gu=["localhost",/^\/(?!\/)/],wi={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:gu,tracePropagationTargets:gu};function _c(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o}={traceFetch:wi.traceFetch,traceXHR:wi.traceXHR,...t},u=typeof s=="function"?s:l=>!0,a=l=>ME(l,r||i),c={};e&&Vo(l=>{const d=CE(l,u,a,c);if(d){const f=Ag(l.fetchData.url),h=f?Nn(f).host:void 0;d.setAttributes({"http.url":f,"server.address":h})}o&&d&&td(d)}),n&&Ko(l=>{const d=LE(l,u,a,c);o&&d&&td(d)})}function OE(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function td(t){const{url:e}=ce(t).data||{};if(!e||typeof e!="string")return;const n=_n("resource",({entries:r})=>{r.forEach(i=>{OE(i)&&i.name.endsWith(e)&&(DE(i).forEach(o=>t.setAttribute(...o)),setTimeout(n))})})}function AE(t){let e="unknown",n="unknown",r="";for(const i of t){if(i==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(i))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=i}return r===t&&(e=r),{name:e,version:n}}function yt(t=0){return((qe||performance.timeOrigin)+t)/1e3}function DE(t){const{name:e,version:n}=AE(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),qe?[...r,["http.request.redirect_start",yt(t.redirectStart)],["http.request.fetch_start",yt(t.fetchStart)],["http.request.domain_lookup_start",yt(t.domainLookupStart)],["http.request.domain_lookup_end",yt(t.domainLookupEnd)],["http.request.connect_start",yt(t.connectStart)],["http.request.secure_connection_start",yt(t.secureConnectionStart)],["http.request.connection_end",yt(t.connectEnd)],["http.request.request_start",yt(t.requestStart)],["http.request.response_start",yt(t.responseStart)],["http.request.response_end",yt(t.responseEnd)]]:r}function ME(t,e){return Fr(t,e||gu)}function LE(t,e,n,r){const i=t.xhr,s=i&&i[Wt];if(!Gr()||!i||i.__sentry_own_request__||!s)return;const o=e(s.url);if(t.endTimestamp&&o){const h=i.__sentry_xhr_span_id__;if(!h)return;const p=r[h];p&&s.status_code!==void 0&&(Zo(p,s.status_code),p.end(),delete r[h]);return}const u=we(),a=Mt(),c=Ag(s.url),l=c?Nn(c).host:void 0,d=o?br({name:`${s.method} ${s.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":s.method,"http.url":c,url:s.url,"server.address":l,[On]:"auto.http.browser"},op:"http.client"}):void 0;d&&(i.__sentry_xhr_span_id__=d.spanContext().spanId,r[i.__sentry_xhr_span_id__]=d);const f=W();if(i.setRequestHeader&&n(s.url)&&f){const{traceId:h,spanId:p,sampled:m,dsc:_}={...a.getPropagationContext(),...u.getPropagationContext()},g=d?Yo(d):Zu(h,p,m),v=vp(_||(d?Cr(d):Jo(h,f,u)));NE(i,g,v)}return d}function NE(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(ou,n)}catch{}}function Ag(t){try{return new URL(t,G.location.origin).href}catch{return}}function PE(t,e=!0,n=!0){if(!G||!G.location){ie&&O.warn("Could not initialize routing instrumentation due to invalid location");return}let r=G.location.href,i;e&&(i=t({name:G.location.pathname,startTimestamp:qe?qe/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&Li(({to:s,from:o})=>{if(o===void 0&&r&&r.indexOf(s)!==-1){r=void 0;return}o!==s&&(r=void 0,i&&(ie&&O.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.end()),i=t({name:G.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}const $E="BrowserTracing",UE={...gi,markBackgroundTransactions:!0,routingInstrumentation:PE,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...wi},nd=10;let FE=class{constructor(e){this.name=$E,this._hasSetTracePropagationTargets=!1,cc(),ie&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...UE,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=Cg(),this._interactionIdToRouteNameMapping={},this.options.enableInp&&xg(this._interactionIdToRouteNameMapping,this.options.interactionsSampleRate),this.options.enableLongTask&&kg(),this.options._experiments.enableInteractions&&Rg(),this._latestRoute={name:void 0,context:void 0}}setupOnce(e,n){this._getCurrentHub=n;const i=n().getClient(),s=i&&i.getOptions(),{routingInstrumentation:o,startTransactionOnLocationChange:u,startTransactionOnPageLoad:a,markBackgroundTransactions:c,traceFetch:l,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:h,_experiments:p}=this.options,m=s&&s.tracePropagationTargets,_=m||this.options.tracePropagationTargets;ie&&this._hasSetTracePropagationTargets&&m&&O.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),o(g=>{const v=this._createRouteTransaction(g);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(v,g,n),v},a,u),c&&gg(),p.enableInteractions&&this._registerInteractionListener(),this.options.enableInp&&this._registerInpInteractionListener(),_c({traceFetch:l,traceXHR:d,tracePropagationTargets:_,shouldCreateSpanForRequest:f,enableHTTPTimings:h})}_createRouteTransaction(e){if(!this._getCurrentHub){ie&&O.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}const n=this._getCurrentHub(),{beforeNavigate:r,idleTimeout:i,finalTimeout:s,heartbeatInterval:o}=this.options,u=e.op==="pageload";let a;if(u){const h=u?rd("sentry-trace"):"",p=u?rd("baggage"):void 0,{traceId:m,dsc:_,parentSpanId:g,sampled:v}=yp(h,p);a={traceId:m,parentSpanId:g,parentSampled:v,...e,metadata:{...e.metadata,dynamicSamplingContext:_},trimEnd:!0}}else a={trimEnd:!0,...e};const c=typeof r=="function"?r(a):a,l=c===void 0?{...a,sampled:!1}:c;l.metadata=l.name!==a.name?{...l.metadata,source:"custom"}:l.metadata,this._latestRoute.name=l.name,this._latestRoute.context=l,l.sampled===!1&&ie&&O.log(`[Tracing] Will not send ${l.op} transaction because of beforeNavigate.`),ie&&O.log(`[Tracing] Starting ${l.op} transaction on scope`);const{location:d}=G,f=vo(n,l,i,s,!0,{location:d},o,u);return u&&G.document&&(G.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(G.document.readyState)&&f.sendAutoFinishSignal()}),["interactive","complete"].includes(G.document.readyState)&&f.sendAutoFinishSignal()),f.registerBeforeFinishCallback(h=>{this._collectWebVitals(),Og(h)}),f}_registerInteractionListener(){let e;const n=()=>{const{idleTimeout:r,finalTimeout:i,heartbeatInterval:s}=this.options,o="ui.action.click",u=Dt();if(u&&u.op&&["navigation","pageload"].includes(u.op)){ie&&O.warn(`[Tracing] Did not create ${o} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.end(),e=void 0),!this._getCurrentHub){ie&&O.warn(`[Tracing] Did not create ${o} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRoute.name){ie&&O.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`);return}const a=this._getCurrentHub(),{location:c}=G,l={name:this._latestRoute.name,op:o,trimEnd:!0,data:{[tt]:this._latestRoute.context?BE(this._latestRoute.context):"url"}};e=vo(a,l,r,i,!0,{location:c},s)};["click"].forEach(r=>{G.document&&addEventListener(r,n,{once:!1,capture:!0})})}_registerInpInteractionListener(){const e=({entries:n})=>{const r=W(),i=r!==void 0&&r.getIntegrationByName!==void 0?r.getIntegrationByName("Replay"):void 0,s=i!==void 0?i.getReplayId():void 0,o=Dt(),u=we(),a=u!==void 0?u.getUser():void 0;n.forEach(c=>{if(HE(c)){const l=c.interactionId;if(l===void 0)return;const d=this._interactionIdToRouteNameMapping[l],f=c.duration,h=c.startTime,p=Object.keys(this._interactionIdToRouteNameMapping),m=p.length>0?p.reduce((_,g)=>this._interactionIdToRouteNameMapping[_].duration<this._interactionIdToRouteNameMapping[g].duration?_:g):void 0;if(c.entryType==="first-input"&&p.map(g=>this._interactionIdToRouteNameMapping[g]).some(g=>g.duration===f&&g.startTime===h)||!l)return;if(d)d.duration=Math.max(d.duration,f);else if(p.length<nd||m===void 0||f>this._interactionIdToRouteNameMapping[m].duration){const _=this._latestRoute.name,g=this._latestRoute.context;_&&g&&(m&&Object.keys(this._interactionIdToRouteNameMapping).length>=nd&&delete this._interactionIdToRouteNameMapping[m],this._interactionIdToRouteNameMapping[l]={routeName:_,duration:f,parentContext:g,user:a,activeTransaction:o,replayId:s,startTime:h})}}})};_n("event",e),_n("first-input",e)}};function rd(t){const e=Xh(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function BE(t){const e=t.attributes&&t.attributes[tt],n=t.data&&t.data[tt],r=t.metadata&&t.metadata.source;return e||n||r}function HE(t){return"duration"in t}const jE="BrowserTracing",GE={...gi,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...wi},qE=(t={})=>{const e=ie?!!(t.tracePropagationTargets||t.tracingOrigins):!1;cc(),!t.tracePropagationTargets&&t.tracingOrigins&&(t.tracePropagationTargets=t.tracingOrigins);const n={...GE,...t},r=Cg(),i={};n.enableInp&&xg(i,n.interactionsSampleRate),n.enableLongTask&&kg(),n._experiments.enableInteractions&&Rg();const s={name:void 0,context:void 0};function o(u){const a=le(),{beforeStartSpan:c,idleTimeout:l,finalTimeout:d,heartbeatInterval:f}=n,h=u.op==="pageload";let p;if(h){const v=h?id("sentry-trace"):"",S=h?id("baggage"):void 0,{traceId:C,dsc:R,parentSpanId:E,sampled:x}=yp(v,S);p={traceId:C,parentSpanId:E,parentSampled:x,...u,metadata:{...u.metadata,dynamicSamplingContext:R},trimEnd:!0}}else p={trimEnd:!0,...u};const m=c?c(p):p;m.metadata=m.name!==p.name?{...m.metadata,source:"custom"}:m.metadata,s.name=m.name,s.context=m,m.sampled===!1&&ie&&O.log(`[Tracing] Will not send ${m.op} transaction because of beforeNavigate.`),ie&&O.log(`[Tracing] Starting ${m.op} transaction on scope`);const{location:_}=G,g=vo(a,m,l,d,!0,{location:_},f,h);return h&&G.document&&(G.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(G.document.readyState)&&g.sendAutoFinishSignal()}),["interactive","complete"].includes(G.document.readyState)&&g.sendAutoFinishSignal()),g.registerBeforeFinishCallback(v=>{r(),Og(v)}),g}return{name:jE,setupOnce:()=>{},afterAllSetup(u){const a=u.getOptions(),{markBackgroundSpan:c,traceFetch:l,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:h,_experiments:p}=n,m=a&&a.tracePropagationTargets,_=m||n.tracePropagationTargets;ie&&e&&m&&O.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.");let g,v=G.location&&G.location.href;if(u.on&&(u.on("startNavigationSpan",S=>{g&&(ie&&O.log(`[Tracing] Finishing current transaction with op: ${ce(g).op}`),g.end()),g=o({op:"navigation",...S})}),u.on("startPageLoadSpan",S=>{g&&(ie&&O.log(`[Tracing] Finishing current transaction with op: ${ce(g).op}`),g.end()),g=o({op:"pageload",...S})})),n.instrumentPageLoad&&u.emit&&G.location){const S={name:G.location.pathname,startTimestamp:qe?qe/1e3:void 0,origin:"auto.pageload.browser",attributes:{[tt]:"url"}};Dg(u,S)}n.instrumentNavigation&&u.emit&&G.location&&Li(({to:S,from:C})=>{if(C===void 0&&v&&v.indexOf(S)!==-1){v=void 0;return}if(C!==S){v=void 0;const R={name:G.location.pathname,origin:"auto.navigation.browser",attributes:{[tt]:"url"}};Mg(u,R)}}),c&&gg(),p.enableInteractions&&zE(n,s),n.enableInp&&VE(i,s),_c({traceFetch:l,traceXHR:d,tracePropagationTargets:_,shouldCreateSpanForRequest:f,enableHTTPTimings:h})},options:n}};function Dg(t,e){if(!t.emit)return;t.emit("startPageLoadSpan",e);const n=Fi();return(n&&ce(n).op)==="pageload"?n:void 0}function Mg(t,e){if(!t.emit)return;t.emit("startNavigationSpan",e);const n=Fi();return(n&&ce(n).op)==="navigation"?n:void 0}function id(t){const e=Xh(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function zE(t,e){let n;const r=()=>{const{idleTimeout:i,finalTimeout:s,heartbeatInterval:o}=t,u="ui.action.click",a=Dt();if(a&&a.op&&["navigation","pageload"].includes(a.op)){ie&&O.warn(`[Tracing] Did not create ${u} transaction because a pageload or navigation transaction is in progress.`);return}if(n&&(n.setFinishReason("interactionInterrupted"),n.end(),n=void 0),!e.name){ie&&O.warn(`[Tracing] Did not create ${u} transaction because _latestRouteName is missing.`);return}const{location:c}=G,l={name:e.name,op:u,trimEnd:!0,data:{[tt]:e.context?KE(e.context):"url"}};n=vo(le(),l,i,s,!0,{location:c},o)};["click"].forEach(i=>{G.document&&addEventListener(i,r,{once:!1,capture:!0})})}function WE(t){return"duration"in t}const sd=10;function VE(t,e){const n=({entries:r})=>{const i=W(),s=i!==void 0&&i.getIntegrationByName!==void 0?i.getIntegrationByName("Replay"):void 0,o=s!==void 0?s.getReplayId():void 0,u=Dt(),a=we(),c=a!==void 0?a.getUser():void 0;r.forEach(l=>{if(WE(l)){const d=l.interactionId;if(d===void 0)return;const f=t[d],h=l.duration,p=l.startTime,m=Object.keys(t),_=m.length>0?m.reduce((g,v)=>t[g].duration<t[v].duration?g:v):void 0;if(l.entryType==="first-input"&&m.map(v=>t[v]).some(v=>v.duration===h&&v.startTime===p)||!d)return;if(f)f.duration=Math.max(f.duration,h);else if(m.length<sd||_===void 0||h>t[_].duration){const g=e.name,v=e.context;g&&v&&(_&&Object.keys(t).length>=sd&&delete t[_],t[d]={routeName:g,duration:h,parentContext:v,user:c,activeTransaction:u,replayId:o,startTime:p})}}})};_n("event",n),_n("first-input",n)}function KE(t){const e=t.attributes&&t.attributes[tt],n=t.data&&t.data[tt],r=t.metadata&&t.metadata.source;return e||n||r}const z=X;let mu=0;function Lg(){return mu>0}function YE(){mu++,setTimeout(()=>{mu--})}function Fn(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return typeof i=="function"?i:t;if(Xu(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{const s=i.map(o=>Fn(o,e));return t.apply(this,s)}catch(s){throw YE(),vn(o=>{o.addEventProcessor(u=>(e.mechanism&&(Za(u,void 0),$n(u,e.mechanism)),u.extra={...u.extra,arguments:i},u)),$i(s)}),s}};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}tp(r,t),mn(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}const oe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function vc(t,e){const n=yc(t,e),r={type:e&&e.name,value:ZE(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function XE(t,e,n,r){const i=W(),s=i&&i.getOptions().normalizeDepth,o={exception:{values:[{type:Wo(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:eT(e,{isUnhandledRejection:r})}]},extra:{__serialized__:hp(e,s)}};if(n){const u=yc(t,n);u.length&&(o.exception.values[0].stacktrace={frames:u})}return o}function Oa(t,e){return{exception:{values:[vc(t,e)]}}}function yc(t,e){const n=e.stacktrace||e.stack||"",r=QE(e);try{return t(n,r)}catch{}return[]}const JE=/Minified React error #\d+;/i;function QE(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(JE.test(t.message))return 1}return 0}function ZE(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Ng(t,e,n,r){const i=n&&n.syntheticException||void 0,s=Sc(t,e,i,r);return $n(s),s.level="error",n&&n.event_id&&(s.event_id=n.event_id),Ir(s)}function Pg(t,e,n="info",r,i){const s=r&&r.syntheticException||void 0,o=_u(t,e,s,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),Ir(o)}function Sc(t,e,n,r,i){let s;if(Wu(e)&&e.error)return Oa(t,e.error);if(yl(e)||ny(e)){const o=e;if("stack"in e)s=Oa(t,e);else{const u=o.name||(yl(o)?"DOMError":"DOMException"),a=o.message?`${u}: ${o.message}`:u;s=_u(t,a,n,r),Za(s,a)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return vr(e)?Oa(t,e):Pn(e)||Wo(e)?(s=XE(t,e,n,i),$n(s,{synthetic:!0}),s):(s=_u(t,e,n,r),Za(s,`${e}`),$n(s,{synthetic:!0}),s)}function _u(t,e,n,r){const i={};if(r&&n){const s=yc(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}if(Vu(e)){const{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function eT(t,{isUnhandledRejection:e}){const n=my(t),r=e?"promise rejection":"exception";return Wu(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Wo(t)?`Event \`${tT(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function tT(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function $g(t,{metadata:e,tunnel:n,dsn:r}){const i={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:Gn(r)}},s=nT(t);return Zt(i,[s])}function nT(t){return[{type:"user_report"},t]}class Ug extends FS{constructor(e){const n=z.SENTRY_SDK_SOURCE||Uy();ig(e,"browser",["browser"],n),super(e),e.sendClientReports&&z.document&&z.document.addEventListener("visibilitychange",()=>{z.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return Ng(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Pg(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){oe&&O.warn("SDK not enabled, will not capture user feedback.");return}const n=$g(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){oe&&O.log("No outcomes to send");return}if(!this._dsn){oe&&O.log("No dsn provided, will not send outcomes");return}oe&&O.log("Sending outcomes:",e);const n=f0(e,this._options.tunnel&&Gn(this._dsn));this._sendEnvelope(n)}}let di;function rT(){if(di)return di;if(nu(z.fetch))return di=z.fetch.bind(z);const t=z.document;let e=z.fetch;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(n){oe&&O.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return di=e.bind(z)}function iT(){di=void 0}function Fg(t,e=rT()){let n=0,r=0;function i(s){const o=s.body.length;n+=o,r++;const u={body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,u).then(a=>(n-=o,r--,{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}))}catch(a){return iT(),n-=o,r--,Ju(a)}}return dc(t,i)}const sT=4;function Bg(t){function e(n){return new Hr((r,i)=>{const s=new XMLHttpRequest;s.onerror=i,s.onreadystatechange=()=>{s.readyState===sT&&r({statusCode:s.status,headers:{"x-sentry-rate-limits":s.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":s.getResponseHeader("Retry-After")}})},s.open("POST",t.url);for(const o in t.headers)Object.prototype.hasOwnProperty.call(t.headers,o)&&s.setRequestHeader(o,t.headers[o]);s.send(n.body)})}return dc(t,e)}const Wr="?",oT=10,aT=20,uT=30,cT=40,lT=50;function qi(t,e,n,r){const i={filename:t,function:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const dT=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fT=/\((\S*)(?::(\d+))(?::(\d+))\)/,hT=t=>{const e=dT.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){const s=fT.exec(e[2]);s&&(e[2]=s[1],e[3]=s[2],e[4]=s[3])}const[r,i]=Wg(e[1]||Wr,e[2]);return qi(i,r,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},Hg=[uT,hT],pT=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,gT=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,mT=t=>{const e=pT.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const s=gT.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}let r=e[3],i=e[1]||Wr;return[i,r]=Wg(i,r),qi(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},jg=[lT,mT],_T=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,vT=t=>{const e=_T.exec(t);return e?qi(e[2],e[1]||Wr,+e[3],e[4]?+e[4]:void 0):void 0},Gg=[cT,vT],yT=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,ST=t=>{const e=yT.exec(t);return e?qi(e[2],e[3]||Wr,+e[1]):void 0},bT=[oT,ST],ET=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,TT=t=>{const e=ET.exec(t);return e?qi(e[5],e[3]||e[4]||Wr,+e[1],+e[2]):void 0},IT=[aT,TT],qg=[Hg,jg,Gg],zg=ip(...qg),Wg=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Wr,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},_s=1024,Vg="Breadcrumbs",wT=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:Vg,setupOnce(){},setup(n){e.console&&sp(RT(n)),e.dom&&up(kT(n,e.dom)),e.xhr&&Ko(xT(n)),e.fetch&&Vo(OT(n)),e.history&&Li(AT(n)),e.sentry&&n.on&&n.on("beforeSendEvent",CT(n))}}},bc=wT,Kg=Ie(Vg,bc);function CT(t){return function(n){W()===t&&Qt({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:cn(n)},{event:n})}}function kT(t,e){return function(r){if(W()!==t)return;let i,s,o=typeof e=="object"?e.serializeAttribute:void 0,u=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;u&&u>_s&&(oe&&O.warn(`\`dom.maxStringLength\` cannot exceed ${_s}, but a value of ${u} was configured. Sentry will use ${_s} instead.`),u=_s),typeof o=="string"&&(o=[o]);try{const c=r.event,l=DT(c)?c.target:c;i=pn(l,{keyAttrs:o,maxStringLength:u}),s=Jh(l)}catch{i="<unknown>"}if(i.length===0)return;const a={category:`ui.${r.name}`,message:i};s&&(a.data={"ui.component_name":s}),Qt(a,{event:r.event,name:r.name,global:r.global})}}function RT(t){return function(n){if(W()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:pp(n.level),message:uo(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${uo(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Qt(r,{input:n.args,level:n.level})}}function xT(t){return function(n){if(W()!==t)return;const{startTimestamp:r,endTimestamp:i}=n,s=n.xhr[Wt];if(!r||!i||!s)return;const{method:o,url:u,status_code:a,body:c}=s,l={method:o,url:u,status_code:a},d={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:i};Qt({category:"xhr",data:l,type:"http"},d)}}function OT(t){return function(n){if(W()!==t)return;const{startTimestamp:r,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:i};Qt({category:"fetch",data:s,level:"error",type:"http"},o)}else{const s=n.response,o={...n.fetchData,status_code:s&&s.status},u={input:n.args,response:s,startTimestamp:r,endTimestamp:i};Qt({category:"fetch",data:o,type:"http"},u)}}}function AT(t){return function(n){if(W()!==t)return;let r=n.from,i=n.to;const s=Nn(z.location.href);let o=r?Nn(r):void 0;const u=Nn(i);(!o||!o.path)&&(o=s),s.protocol===u.protocol&&s.host===u.host&&(i=u.relative),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),Qt({category:"navigation",data:{from:r,to:i}})}}function DT(t){return!!t&&!!t.target}const Yg="Dedupe",MT=()=>{let t;return{name:Yg,setupOnce(){},processEvent(e){if(e.type)return e;try{if(LT(e,t))return oe&&O.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Xg=MT,Jg=Ie(Yg,Xg);function LT(t,e){return e?!!(NT(t,e)||PT(t,e)):!1}function NT(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Zg(t,e)||!Qg(t,e))}function PT(t,e){const n=od(e),r=od(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Zg(t,e)||!Qg(t,e))}function Qg(t,e){let n=ad(t),r=ad(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){const s=r[i],o=n[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function Zg(t,e){let n=t.fingerprint,r=e.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 od(t){return t.exception&&t.exception.values&&t.exception.values[0]}function ad(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const em="GlobalHandlers",$T=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:em,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(UT(n),ud("onerror")),e.onunhandledrejection&&(FT(n),ud("onunhandledrejection"))}}},Ec=$T,tm=Ie(em,Ec);function UT(t){dp(e=>{const{stackParser:n,attachStacktrace:r}=rm();if(W()!==t||Lg())return;const{msg:i,url:s,line:o,column:u,error:a}=e,c=a===void 0&&At(i)?jT(i,s,o,u):nm(Sc(n,a||i,void 0,r,!1),s,o,u);c.level="error",Ui(c,{originalException:a,mechanism:{handled:!1,type:"onerror"}})})}function FT(t){fp(e=>{const{stackParser:n,attachStacktrace:r}=rm();if(W()!==t||Lg())return;const i=BT(e),s=Ku(i)?HT(i):Sc(n,i,void 0,r,!0);s.level="error",Ui(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function BT(t){if(Ku(t))return t;const e=t;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return t}function HT(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function jT(t,e,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let s=Wu(t)?t.message:t,o="Error";const u=s.match(i);return u&&(o=u[1],s=u[2]),nm({exception:{values:[{type:o,value:s}]}},e,n,r)}function nm(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},u=o.stacktrace=o.stacktrace||{},a=u.frames=u.frames||[],c=isNaN(parseInt(r,10))?void 0:r,l=isNaN(parseInt(n,10))?void 0:n,d=At(e)&&e.length>0?e:Yh();return a.length===0&&a.push({colno:c,filename:d,function:"?",in_app:!0,lineno:l}),t}function ud(t){oe&&O.log(`Global Handler attached: ${t}`)}function rm(){const t=W();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const im="HttpContext",GT=()=>({name:im,setupOnce(){},preprocessEvent(t){if(!z.navigator&&!z.location&&!z.document)return;const e=t.request&&t.request.url||z.location&&z.location.href,{referrer:n}=z.document||{},{userAgent:r}=z.navigator||{},i={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...t.request,...e&&{url:e},headers:i};t.request=s}}),Tc=GT,sm=Ie(im,Tc),qT="cause",zT=5,om="LinkedErrors",WT=(t={})=>{const e=t.limit||zT,n=t.key||qT;return{name:om,setupOnce(){},preprocessEvent(r,i,s){const o=s.getOptions();Vh(vc,o.stackParser,o.maxValueLength,n,e,r,i)}}},Ic=WT,am=Ie(om,Ic),VT=["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"],um="TryCatch",KT=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:um,setupOnce(){e.setTimeout&&Ue(z,"setTimeout",cd),e.setInterval&&Ue(z,"setInterval",cd),e.requestAnimationFrame&&Ue(z,"requestAnimationFrame",YT),e.XMLHttpRequest&&"XMLHttpRequest"in z&&Ue(XMLHttpRequest.prototype,"send",XT);const n=e.eventTarget;n&&(Array.isArray(n)?n:VT).forEach(JT)}}},wc=KT,cm=Ie(um,wc);function cd(t){return function(...e){const n=e[0];return e[0]=Fn(n,{mechanism:{data:{function:Xt(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function YT(t){return function(e){return t.apply(this,[Fn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Xt(t)},handled:!1,type:"instrument"}})])}}function XT(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&Ue(n,i,function(s){const o={mechanism:{data:{function:i,handler:Xt(s)},handled:!1,type:"instrument"}},u=Xu(s);return u&&(o.mechanism.data.handler=Xt(u)),Fn(s,o)})}),t.apply(this,e)}}function JT(t){const e=z,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Ue(n,"addEventListener",function(r){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=Fn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Xt(s),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,Fn(s,{mechanism:{data:{function:"addEventListener",handler:Xt(s),target:t},handled:!1,type:"instrument"}}),o])}}),Ue(n,"removeEventListener",function(r){return function(i,s,o){const u=s;try{const a=u&&u.__sentry_wrapped__;a&&r.call(this,i,a,o)}catch{}return r.call(this,i,u,o)}}))}const lm=[fc(),hc(),wc(),bc(),Ec(),Ic(),Xg(),Tc()];function dm(t){return[...lm]}function fm(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=dm()),t.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(t.release=__SENTRY_RELEASE__),z.SENTRY_RELEASE&&z.SENTRY_RELEASE.id&&(t.release=z.SENTRY_RELEASE.id)),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);const e={...t,stackParser:vy(t.stackParser||zg),integrations:TS(t),transport:t.transport||(cp()?Fg:Bg)};KS(Ug,e),t.autoSessionTracking&&nI()}const QT=(t={},e=le())=>{if(!z.document){oe&&O.error("Global document not defined in showReportDialog call");return}const{client:n,scope:r}=e.getStackTop(),i=t.dsn||n&&n.getDsn();if(!i){oe&&O.error("DSN not configured for showReportDialog call");return}r&&(t.user={...r.getUser(),...t.user}),t.eventId||(t.eventId=e.lastEventId());const s=z.document.createElement("script");s.async=!0,s.crossOrigin="anonymous",s.src=bS(i,t),t.onLoad&&(s.onload=t.onLoad);const{onClose:o}=t;if(o){const a=c=>{if(c.data==="__sentry_reportdialog_closed__")try{o()}finally{z.removeEventListener("message",a)}};z.addEventListener("message",a)}const u=z.document.head||z.document.body;u?u.appendChild(s):oe&&O.error("Not injecting report dialog. No injection point found in HTML")};function ZT(){}function eI(t){t()}function tI(t){return Fn(t)()}function nI(){if(typeof z.document>"u"){oe&&O.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}cu({ignoreDuration:!0}),lu(),Li(({from:t,to:e})=>{t!==void 0&&t!==e&&(cu({ignoreDuration:!0}),lu())})}function rI(t){const e=W();e&&e.captureUserFeedback(t)}const iI=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumbs:Kg,Dedupe:Jg,GlobalHandlers:tm,HttpContext:sm,LinkedErrors:am,TryCatch:cm},Symbol.toStringTag,{value:"Module"})),pe=X,Cc="sentryReplaySession",sI="replay_event",kc="Unable to send Replay",oI=3e5,aI=9e5,uI=5e3,cI=5500,lI=6e4,dI=5e3,fI=3,ld=15e4,vs=5e3,hI=3e3,pI=300,Rc=2e7,gI=4999,mI=15e3,dd=36e5;function _I(t,e){return t??e()}function Eo(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}var Oe;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(Oe||(Oe={}));function vI(t){return t.nodeType===t.ELEMENT_NODE}function vi(t){const e=Eo([t,"optionalAccess",n=>n.host]);return Eo([e,"optionalAccess",n=>n.shadowRoot])===t}function yi(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function yI(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t}function SI(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function To(t){try{const e=t.rules||t.cssRules;return e?yI(Array.from(e,hm).join("")):null}catch{return null}}function hm(t){let e;if(EI(t))try{e=To(t.styleSheet)||SI(t)}catch{}else if(TI(t)&&t.selectorText.includes(":"))return bI(t.cssText);return e||t.cssText}function bI(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function EI(t){return"styleSheet"in t}function TI(t){return"selectorText"in t}class pm{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){if(!e)return-1;const n=Eo([this,"access",r=>r.getMeta,"call",r=>r(e),"optionalAccess",r=>r.id]);return _I(n,()=>-1)}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function II(){return new pm}function ia({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),!!(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function Ci({isMasked:t,element:e,value:n,maskInputFn:r}){let i=n||"";return t?(r&&(i=r(i,e)),"*".repeat(i.length)):i}function xr(t){return t.toLowerCase()}function vu(t){return t.toUpperCase()}const fd="__rrweb_original__";function wI(t){const e=t.getContext("2d");if(!e)return!0;const n=50;for(let r=0;r<t.width;r+=n)for(let i=0;i<t.height;i+=n){const s=e.getImageData,o=fd in s?s[fd]:s;if(new Uint32Array(o.call(e,r,i,Math.min(n,t.width-r),Math.min(n,t.height-i)).data.buffer).some(a=>a!==0))return!1}return!0}function xc(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?xr(e):null}function Io(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}let CI=1;const kI=new RegExp("[^a-z0-9-_:]"),ki=-2;function Oc(){return CI++}function RI(t){if(t instanceof HTMLFormElement)return"form";const e=xr(t.tagName);return kI.test(e)?"div":e}function xI(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}let Zn,hd;const OI=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,AI=/^(?:[a-z+]+:)?\/\//i,DI=/^www\..*/i,MI=/^(data:)([^,]*),(.*)/i;function wo(t,e){return(t||"").replace(OI,(n,r,i,s,o,u)=>{const a=i||o||u,c=r||s||"";if(!a)return n;if(AI.test(a)||DI.test(a))return`url(${c}${a}${c})`;if(MI.test(a))return`url(${c}${a}${c})`;if(a[0]==="/")return`url(${c}${xI(e)+a}${c})`;const l=e.split("/"),d=a.split("/");l.pop();for(const f of d)f!=="."&&(f===".."?l.pop():l.push(f));return`url(${c}${l.join("/")}${c})`})}const LI=/^[^ \t\n\r\u000c]+/,NI=/^[, \t\n\r\u000c]+/;function PI(t,e){if(e.trim()==="")return e;let n=0;function r(s){let o;const u=s.exec(e.substring(n));return u?(o=u[0],n+=o.length,o):""}const i=[];for(;r(NI),!(n>=e.length);){let s=r(LI);if(s.slice(-1)===",")s=dr(t,s.substring(0,s.length-1)),i.push(s);else{let o="";s=dr(t,s);let u=!1;for(;;){const a=e.charAt(n);if(a===""){i.push((s+o).trim());break}else if(u)a===")"&&(u=!1);else if(a===","){n+=1,i.push((s+o).trim());break}else a==="("&&(u=!0);o+=a,n+=1}}}return i.join(", ")}function dr(t,e){if(!e||e.trim()==="")return e;const n=t.createElement("a");return n.href=e,n.href}function $I(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function Ac(){const t=document.createElement("a");return t.href="",t.href}function gm(t,e,n,r,i,s){return r&&(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(e==="table"||e==="td"||e==="th")?dr(t,r):n==="srcset"?PI(t,r):n==="style"?wo(r,Ac()):e==="object"&&n==="data"?dr(t,r):typeof s=="function"?s(n,r,i):r)}function mm(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function UI(t,e,n,r){try{if(r&&t.matches(r))return!1;if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}if(n)return t.matches(n)}catch{}return!1}function FI(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}function An(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:An(t.parentNode,e,n,r+1)}function fr(t,e){return n=>{const r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(FI(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function Or(t,e,n,r,i,s){try{const o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const c=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(c))return!0}let u=-1,a=-1;if(s){if(a=An(o,fr(r,i)),a<0)return!0;u=An(o,fr(e,n),a>=0?a:1/0)}else{if(u=An(o,fr(e,n)),u<0)return!1;a=An(o,fr(r,i),u>=0?u:1/0)}return u>=0?a>=0?u<=a:!0:a>=0?!1:!!s}catch{}return!!s}function BI(t,e,n){const r=t.contentWindow;if(!r)return;let i=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){const u=setTimeout(()=>{i||(e(),i=!0)},n);t.addEventListener("load",()=>{clearTimeout(u),i=!0,e()});return}const o="about:blank";if(r.location.href!==o||t.src===o||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function HI(t,e,n){let r=!1,i;try{i=t.sheet}catch{return}if(i)return;const s=setTimeout(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{clearTimeout(s),r=!0,e()})}function jI(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskAttributeFn:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:h,maskInputOptions:p={},maskTextFn:m,maskInputFn:_,dataURLOptions:g={},inlineImages:v,recordCanvas:S,keepIframeSrcFn:C,newlyAddedElement:R=!1}=e,E=GI(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Oe.Document,childNodes:[],compatMode:t.compatMode}:{type:Oe.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Oe.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:E};case t.ELEMENT_NODE:return zI(t,{doc:n,blockClass:i,blockSelector:s,unblockSelector:o,inlineStylesheet:h,maskAttributeFn:a,maskInputOptions:p,maskInputFn:_,dataURLOptions:g,inlineImages:v,recordCanvas:S,keepIframeSrcFn:C,newlyAddedElement:R,rootId:E,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f});case t.TEXT_NODE:return qI(t,{maskAllText:u,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:p,maskInputFn:_,rootId:E});case t.CDATA_SECTION_NODE:return{type:Oe.CDATA,textContent:"",rootId:E};case t.COMMENT_NODE:return{type:Oe.Comment,textContent:t.textContent||"",rootId:E};default:return!1}}function GI(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return n===1?void 0:n}function qI(t,e){const{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:s,unmaskTextSelector:o,maskTextFn:u,maskInputOptions:a,maskInputFn:c,rootId:l}=e,d=t.parentNode&&t.parentNode.tagName;let f=t.textContent;const h=d==="STYLE"?!0:void 0,p=d==="SCRIPT"?!0:void 0,m=d==="TEXTAREA"?!0:void 0;if(h&&f){try{t.nextSibling||t.previousSibling||Eo([t,"access",g=>g.parentNode,"access",g=>g.sheet,"optionalAccess",g=>g.cssRules])&&(f=To(t.parentNode.sheet))}catch(g){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${g}`,t)}f=wo(f,Ac())}p&&(f="SCRIPT_PLACEHOLDER");const _=Or(t,r,s,i,o,n);if(!h&&!p&&!m&&f&&_&&(f=u?u(f,t.parentElement):f.replace(/[\S]/g,"*")),m&&f&&(a.textarea||_)&&(f=c?c(f,t.parentNode):f.replace(/[\S]/g,"*")),d==="OPTION"&&f){const g=ia({type:null,tagName:d,maskInputOptions:a});f=Ci({isMasked:Or(t,r,s,i,o,g),element:t,value:f,maskInputFn:c})}return{type:Oe.Text,textContent:f||"",isStyle:h,rootId:l}}function zI(t,e){const{doc:n,blockClass:r,blockSelector:i,unblockSelector:s,inlineStylesheet:o,maskInputOptions:u={},maskAttributeFn:a,maskInputFn:c,dataURLOptions:l={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:m,maskTextClass:_,unmaskTextClass:g,maskTextSelector:v,unmaskTextSelector:S}=e,C=UI(t,r,i,s),R=RI(t);let E={};const x=t.attributes.length;for(let y=0;y<x;y++){const b=t.attributes[y];b.name&&!mm(R,b.name,b.value)&&(E[b.name]=gm(n,R,xr(b.name),b.value,t,a))}if(R==="link"&&o){const y=Array.from(n.styleSheets).find(I=>I.href===t.href);let b=null;y&&(b=To(y)),b&&(delete E.rel,delete E.href,E._cssText=wo(b,y.href))}if(R==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const y=To(t.sheet);y&&(E._cssText=wo(y,Ac()))}if(R==="input"||R==="textarea"||R==="select"||R==="option"){const y=t,b=xc(y),I=Io(y,vu(R),b),k=y.checked;if(b!=="submit"&&b!=="button"&&I){const w=Or(y,_,v,g,S,ia({type:b,tagName:vu(R),maskInputOptions:u}));E.value=Ci({isMasked:w,element:y,value:I,maskInputFn:c})}k&&(E.checked=k)}if(R==="option"&&(t.selected&&!u.select?E.selected=!0:delete E.selected),R==="canvas"&&f){if(t.__context==="2d")wI(t)||(E.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){const y=t.toDataURL(l.type,l.quality),b=document.createElement("canvas");b.width=t.width,b.height=t.height;const I=b.toDataURL(l.type,l.quality);y!==I&&(E.rr_dataURL=y)}}if(R==="img"&&d){Zn||(Zn=n.createElement("canvas"),hd=Zn.getContext("2d"));const y=t,b=y.crossOrigin;y.crossOrigin="anonymous";const I=()=>{y.removeEventListener("load",I);try{Zn.width=y.naturalWidth,Zn.height=y.naturalHeight,hd.drawImage(y,0,0),E.rr_dataURL=Zn.toDataURL(l.type,l.quality)}catch(k){console.warn(`Cannot inline img src=${y.currentSrc}! Error: ${k}`)}b?E.crossOrigin=b:y.removeAttribute("crossorigin")};y.complete&&y.naturalWidth!==0?I():y.addEventListener("load",I)}if((R==="audio"||R==="video")&&(E.rr_mediaState=t.paused?"paused":"played",E.rr_mediaCurrentTime=t.currentTime),p||(t.scrollLeft&&(E.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(E.rr_scrollTop=t.scrollTop)),C){const{width:y,height:b}=t.getBoundingClientRect();E={class:E.class,rr_width:`${y}px`,rr_height:`${b}px`}}R==="iframe"&&!h(E.src)&&(t.contentDocument||(E.rr_src=E.src),delete E.src);let T;try{customElements.get(R)&&(T=!0)}catch{}return{type:Oe.Element,tagName:R,attributes:E,childNodes:[],isSVG:$I(t)||void 0,needBlock:C,rootId:m,isCustom:T}}function he(t){return t==null?"":t.toLowerCase()}function WI(t,e){if(e.comment&&t.type===Oe.Comment)return!0;if(t.type===Oe.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(he(t.attributes.name).match(/^msapplication-tile(image|color)$/)||he(t.attributes.name)==="application-name"||he(t.attributes.rel)==="icon"||he(t.attributes.rel)==="apple-touch-icon"||he(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&he(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(he(t.attributes.property).match(/^(og|twitter|fb):/)||he(t.attributes.name).match(/^(og|twitter):/)||he(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(he(t.attributes.name)==="robots"||he(t.attributes.name)==="googlebot"||he(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(he(t.attributes.name)==="author"||he(t.attributes.name)==="generator"||he(t.attributes.name)==="framework"||he(t.attributes.name)==="publisher"||he(t.attributes.name)==="progid"||he(t.attributes.property).match(/^article:/)||he(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(he(t.attributes.name)==="google-site-verification"||he(t.attributes.name)==="yandex-verification"||he(t.attributes.name)==="csrf-token"||he(t.attributes.name)==="p:domain_verify"||he(t.attributes.name)==="verify-v1"||he(t.attributes.name)==="verification"||he(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function hr(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:h=!0,maskInputOptions:p={},maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:S={},inlineImages:C=!1,recordCanvas:R=!1,onSerialize:E,onIframeLoad:x,iframeLoadTimeout:T=5e3,onStylesheetLoad:y,stylesheetLoadTimeout:b=5e3,keepIframeSrcFn:I=()=>!1,newlyAddedElement:k=!1}=e;let{preserveWhiteSpace:w=!0}=e;const D=jI(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:u,unblockSelector:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,dataURLOptions:S,inlineImages:C,recordCanvas:R,keepIframeSrcFn:I,newlyAddedElement:k});if(!D)return console.warn(t,"not serialized"),null;let M;r.hasNode(t)?M=r.getId(t):WI(D,v)||!w&&D.type===Oe.Text&&!D.isStyle&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?M=ki:M=Oc();const A=Object.assign(D,{id:M});if(r.add(t,A),M===ki)return null;E&&E(t);let L=!f;if(A.type===Oe.Element){L=L&&!A.needBlock,delete A.needBlock;const P=t.shadowRoot;P&&yi(P)&&(A.isShadowHost=!0)}if((A.type===Oe.Document||A.type===Oe.Element)&&L){v.headWhitespace&&A.type===Oe.Element&&A.tagName==="head"&&(w=!1);const P={doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:u,unblockSelector:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,skipChild:f,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:S,inlineImages:C,recordCanvas:R,preserveWhiteSpace:w,onSerialize:E,onIframeLoad:x,iframeLoadTimeout:T,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:I};for(const $ of Array.from(t.childNodes)){const N=hr($,P);N&&A.childNodes.push(N)}if(vI(t)&&t.shadowRoot)for(const $ of Array.from(t.shadowRoot.childNodes)){const N=hr($,P);N&&(yi(t.shadowRoot)&&(N.isShadow=!0),A.childNodes.push(N))}}return t.parentNode&&vi(t.parentNode)&&yi(t.parentNode)&&(A.isShadow=!0),A.type===Oe.Element&&A.tagName==="iframe"&&BI(t,()=>{const P=t.contentDocument;if(P&&x){const $=hr(P,{doc:P,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:S,inlineImages:C,recordCanvas:R,preserveWhiteSpace:w,onSerialize:E,onIframeLoad:x,iframeLoadTimeout:T,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:I});$&&x(t,$)}},T),A.type===Oe.Element&&A.tagName==="link"&&A.attributes.rel==="stylesheet"&&HI(t,()=>{if(y){const P=hr(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:v,dataURLOptions:S,inlineImages:C,recordCanvas:R,preserveWhiteSpace:w,onSerialize:E,onIframeLoad:x,iframeLoadTimeout:T,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:I});P&&y(t,P)}},b),A}function VI(t,e){const{mirror:n=new pm,blockClass:r="rr-block",blockSelector:i=null,unblockSelector:s=null,maskAllText:o=!1,maskTextClass:u="rr-mask",unmaskTextClass:a=null,maskTextSelector:c=null,unmaskTextSelector:l=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:h=!1,maskAllInputs:p=!1,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOM:v=!1,dataURLOptions:S,preserveWhiteSpace:C,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:x,onStylesheetLoad:T,stylesheetLoadTimeout:y,keepIframeSrcFn:b=()=>!1}=e||{};return hr(t,{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,maskAllText:o,maskTextClass:u,unmaskTextClass:a,maskTextSelector:c,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:p===!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}:p===!1?{}:p,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:v===!0||v==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:S,inlineImages:f,recordCanvas:h,preserveWhiteSpace:C,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:x,onStylesheetLoad:T,stylesheetLoadTimeout:y,keepIframeSrcFn:b,newlyAddedElement:!1})}function nn(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}function Xe(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const cr=`Please stop import mirror directly. Instead of that,\r now you can use replayer.getMirror() to access the mirror instance of a replayer,\r or you can use record.mirror to access the mirror instance during recording.`;let pd={map:{},getId(){return console.error(cr),-1},getNode(){return console.error(cr),null},removeNodeFromMap(){console.error(cr)},has(){return console.error(cr),!1},reset(){console.error(cr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(pd=new Proxy(pd,{get(t,e,n){return e==="map"&&console.error(cr),Reflect.get(t,e,n)}}));function Ri(t,e,n={}){let r=null,i=0;return function(...s){const o=Date.now();!i&&n.leading===!1&&(i=o);const u=e-(o-i),a=this;u<=0||u>e?(r&&(ew(r),r=null),i=o,t.apply(a,s)):!r&&n.trailing!==!1&&(r=sa(()=>{i=n.leading===!1?0:Date.now(),r=null,t.apply(a,s)},u))}}function _m(t,e,n,r,i=window){const s=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,r?n:{set(o){sa(()=>{n.set.call(this,o)},0),s&&s.set&&s.set.call(this,o)}}),()=>_m(t,e,s||{},!0)}function Dc(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}let Co=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Co=()=>new Date().getTime());function vm(t){const e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:nn([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||nn([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||nn([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:e.scrollingElement?e.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:nn([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||nn([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||nn([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function ym(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Sm(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function bm(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function pt(t,e,n,r,i){if(!t)return!1;const s=bm(t);if(!s)return!1;const o=fr(e,n);if(!i){const c=r&&s.matches(r);return o(s)&&!c}const u=An(s,o);let a=-1;return u<0?!1:(r&&(a=An(s,fr(null,r))),u>-1&&a<0?!0:u<a)}function KI(t,e){return e.getId(t)!==-1}function Aa(t,e){return e.getId(t)===ki}function Em(t,e){if(vi(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?Em(t.parentNode,e):!0:!0}function yu(t){return!!t.changedTouches}function YI(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Tm(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function Im(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function Su(t){return!!nn([t,"optionalAccess",e=>e.shadowRoot])}class XI{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return _0(this.styleIDMap.get(e),()=>-1)}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function wm(t){let e=null;return nn([t,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function JI(t){let e=t,n;for(;n=wm(e);)e=n;return e}function QI(t){const e=t.ownerDocument;if(!e)return!1;const n=JI(t);return e.contains(n)}function Cm(t){const e=t.ownerDocument;return e?e.contains(t)||QI(t):!1}const gd={};function Mc(t){const e=gd[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch{}return gd[t]=r.bind(window)}function ZI(...t){return Mc("requestAnimationFrame")(...t)}function sa(...t){return Mc("setTimeout")(...t)}function ew(...t){return Mc("clearTimeout")(...t)}var Z=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Z||{}),ee=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ee||{}),Ke=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Ke||{}),Bt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Bt||{});function tw(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}function md(t){return"__ln"in t}class nw{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=tw([n,"optionalAccess",i=>i.next])||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&md(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&md(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.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(e){const n=e.__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),e.__ln&&delete e.__ln,this.length--)}}const _d=(t,e)=>`${t}@${e}`;class rw{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new nw,i=a=>{let c=a,l=ki;for(;l===ki;)c=c&&c.nextSibling,l=c&&this.mirror.getId(c);return l},s=a=>{if(!a.parentNode||!Cm(a))return;const c=vi(a.parentNode)?this.mirror.getId(wm(a)):this.mirror.getId(a.parentNode),l=i(a);if(c===-1||l===-1)return r.addNode(a);const d=hr(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{Tm(f,this.mirror)&&this.iframeManager.addIframe(f),Im(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Su(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,h)=>{this.iframeManager.attachIframe(f,h),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,h)=>{this.stylesheetManager.attachLinkElement(f,h)}});d&&(e.push({parentId:c,nextId:l,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)vd(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||s(a);for(const a of this.addedSet)!yd(this.droppedSet,a)&&!vd(this.removes,a,this.mirror)||yd(this.movedSet,a)?s(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const c=this.mirror.getId(o.value.parentNode),l=i(o.value);c!==-1&&l!==-1&&(a=o)}if(!a){let c=r.tail;for(;c;){const l=c;if(c=c.previous,l){const d=this.mirror.getId(l.value.parentNode);if(i(l.value)===-1)continue;if(d!==-1){a=l;break}else{const h=l.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const p=h.parentNode.host;if(this.mirror.getId(p)!==-1){a=l;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),s(a.value)}const u={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:c}=a;if(typeof c.style=="string"){const l=JSON.stringify(a.styleDiff),d=JSON.stringify(a._unchangedStyles);l.length<c.style.length&&(l+d).split("var(").length===c.style.split("var(").length&&(c.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:c}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.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(u))},this.processMutation=e=>{if(!Aa(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!pt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Or(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,bm(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=xc(n),u=n.tagName;i=Io(n,u,o);const a=ia({maskInputOptions:this.maskInputOptions,tagName:u,type:o}),c=Or(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);i=Ci({isMasked:c,element:n,value:i,maskInputFn:this.maskInputFn})}if(pt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||i===e.oldValue)return;let s=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!n.contentDocument)r="rr_src";else return;if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!mm(n.tagName,r)&&(s.attributes[r]=gm(this.doc,xr(n.tagName),xr(r),i,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const u of Array.from(n.style)){const a=n.style.getPropertyValue(u),c=n.style.getPropertyPriority(u);a!==o.style.getPropertyValue(u)||c!==o.style.getPropertyPriority(u)?c===""?s.styleDiff[u]=a:s.styleDiff[u]=[a,c]:s._unchangedStyles[u]=[a,c]}for(const u of Array.from(o.style))n.style.getPropertyValue(u)===""&&(s.styleDiff[u]=!1)}break}case"childList":{if(pt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),i=vi(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);pt(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Aa(n,this.mirror)||!KI(n,this.mirror)||(this.addedSet.has(n)?(bu(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||Em(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[_d(r,i)]?bu(this.movedSet,n):this.removes.push({parentId:i,id:r,isShadow:vi(e.target)&&yi(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Aa(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[_d(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);pt(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes.forEach(r=>this.genAdds(r)),Su(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[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 bu(t,e){t.delete(e),e.childNodes.forEach(n=>bu(t,n))}function vd(t,e,n){return t.length===0?!1:km(t,e,n)}function km(t,e,n){const{parentNode:r}=e;if(!r)return!1;const i=n.getId(r);return t.some(s=>s.id===i)?!0:km(t,r,n)}function yd(t,e){return t.size===0?!1:Rm(t,e)}function Rm(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:Rm(t,n):!1}let Si;function iw(t){Si=t}function sw(){Si=void 0}const se=t=>Si?(...n)=>{try{return t(...n)}catch(r){if(Si&&Si(r)===!0)return()=>{};throw r}}:t;function kt(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const pr=[];function zi(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function xm(t,e){const n=new rw;pr.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver;const i=kt([window,"optionalAccess",o=>o.Zone,"optionalAccess",o=>o.__symbol__,"optionalCall",o=>o("MutationObserver")]);i&&window[i]&&(r=window[i]);const s=new r(se(o=>{t.onMutation&&t.onMutation(o)===!1||n.processMutations.bind(n)(o)}));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function ow({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,s=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],u;const a=Ri(se(d=>{const f=Date.now()-u;t(o.map(h=>(h.timeOffset-=f,h)),d),o=[],u=null}),s),c=se(Ri(se(d=>{const f=zi(d),{clientX:h,clientY:p}=yu(d)?d.changedTouches[0]:d;u||(u=Co()),o.push({x:h,y:p,id:r.getId(f),timeOffset:Co()-u}),a(typeof DragEvent<"u"&&d instanceof DragEvent?ee.Drag:d instanceof MouseEvent?ee.MouseMove:ee.TouchMove)}),i,{trailing:!1})),l=[Xe("mousemove",c,n),Xe("touchmove",c,n),Xe("drag",c,n)];return se(()=>{l.forEach(d=>d())})}function aw({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const u=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let c=null;const l=d=>f=>{const h=zi(f);if(pt(h,r,i,s,!0))return;let p=null,m=d;if("pointerType"in f){switch(f.pointerType){case"mouse":p=Bt.Mouse;break;case"touch":p=Bt.Touch;break;case"pen":p=Bt.Pen;break}p===Bt.Touch?Ke[d]===Ke.MouseDown?m="TouchStart":Ke[d]===Ke.MouseUp&&(m="TouchEnd"):Bt.Pen}else yu(f)&&(p=Bt.Touch);p!==null?(c=p,(m.startsWith("Touch")&&p===Bt.Touch||m.startsWith("Mouse")&&p===Bt.Mouse)&&(p=null)):Ke[d]===Ke.Click&&(p=c,c=null);const _=yu(f)?f.changedTouches[0]:f;if(!_)return;const g=n.getId(h),{clientX:v,clientY:S}=_;se(t)({type:Ke[m],id:g,x:v,y:S,...p!==null&&{pointerType:p}})};return Object.keys(Ke).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&u[d]!==!1).forEach(d=>{let f=xr(d);const h=l(d);if(window.PointerEvent)switch(Ke[d]){case Ke.MouseDown:case Ke.MouseUp:f=f.replace("mouse","pointer");break;case Ke.TouchStart:case Ke.TouchEnd:return}a.push(Xe(f,h,e))}),se(()=>{a.forEach(d=>d())})}function Om({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){const u=se(Ri(se(a=>{const c=zi(a);if(!c||pt(c,r,i,s,!0))return;const l=n.getId(c);if(c===e&&e.defaultView){const d=vm(e.defaultView);t({id:l,x:d.left,y:d.top})}else t({id:l,x:c.scrollLeft,y:c.scrollTop})}),o.scroll||100));return Xe("scroll",u,e)}function uw({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const i=se(Ri(se(()=>{const s=ym(),o=Sm();(n!==s||r!==o)&&(t({width:Number(o),height:Number(s)}),n=s,r=o)}),200));return Xe("resize",i,e)}const cw=["INPUT","TEXTAREA","SELECT"],Sd=new WeakMap;function lw({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,ignoreClass:o,ignoreSelector:u,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:h,maskTextSelector:p,unmaskTextSelector:m}){function _(x){let T=zi(x);const y=x.isTrusted,b=T&&vu(T.tagName);if(b==="OPTION"&&(T=T.parentElement),!T||!b||cw.indexOf(b)<0||pt(T,r,i,s,!0))return;const I=T;if(I.classList.contains(o)||u&&I.matches(u))return;const k=xc(T);let w=Io(I,b,k),D=!1;const M=ia({maskInputOptions:a,tagName:b,type:k}),A=Or(T,f,p,h,m,M);(k==="radio"||k==="checkbox")&&(D=T.checked),w=Ci({isMasked:A,element:T,value:w,maskInputFn:c}),g(T,d?{text:w,isChecked:D,userTriggered:y}:{text:w,isChecked:D});const L=T.name;k==="radio"&&L&&D&&e.querySelectorAll(`input[type="radio"][name="${L}"]`).forEach(P=>{if(P!==T){const $=Ci({isMasked:A,element:P,value:Io(P,b,k),maskInputFn:c});g(P,d?{text:$,isChecked:!D,userTriggered:!1}:{text:$,isChecked:!D})}})}function g(x,T){const y=Sd.get(x);if(!y||y.text!==T.text||y.isChecked!==T.isChecked){Sd.set(x,T);const b=n.getId(x);se(t)({...T,id:b})}}const S=(l.input==="last"?["change"]:["input","change"]).map(x=>Xe(x,se(_),e)),C=e.defaultView;if(!C)return()=>{S.forEach(x=>x())};const R=C.Object.getOwnPropertyDescriptor(C.HTMLInputElement.prototype,"value"),E=[[C.HTMLInputElement.prototype,"value"],[C.HTMLInputElement.prototype,"checked"],[C.HTMLSelectElement.prototype,"value"],[C.HTMLTextAreaElement.prototype,"value"],[C.HTMLSelectElement.prototype,"selectedIndex"],[C.HTMLOptionElement.prototype,"selected"]];return R&&R.set&&S.push(...E.map(x=>_m(x[0],x[1],{set(){se(_)({target:this,isTrusted:!1})}},!1,C))),se(()=>{S.forEach(x=>x())})}function ko(t){const e=[];function n(r,i){if(ys("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||ys("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||ys("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||ys("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return n(t,e)}function rn(t,e,n){let r,i;return t?(t.ownerNode?r=e.getId(t.ownerNode):i=n.getId(t),{styleId:i,id:r}):{}}function dw({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:se((l,d,f)=>{const[h,p]=f,{id:m,styleId:_}=rn(d,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,adds:[{rule:h,index:p}]}),l.apply(d,f)})});const s=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:se((l,d,f)=>{const[h]=f,{id:p,styleId:m}=rn(d,e,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&t({id:p,styleId:m,removes:[{index:h}]}),l.apply(d,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:se((l,d,f)=>{const[h]=f,{id:p,styleId:m}=rn(d,e,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&t({id:p,styleId:m,replace:h}),l.apply(d,f)})}));let u;r.CSSStyleSheet.prototype.replaceSync&&(u=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:se((l,d,f)=>{const[h]=f,{id:p,styleId:m}=rn(d,e,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&t({id:p,styleId:m,replaceSync:h}),l.apply(d,f)})}));const a={};Ss("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Ss("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Ss("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Ss("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(a).forEach(([l,d])=>{c[l]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(c[l].insertRule,{apply:se((f,h,p)=>{const[m,_]=p,{id:g,styleId:v}=rn(h.parentStyleSheet,e,n.styleMirror);return(g&&g!==-1||v&&v!==-1)&&t({id:g,styleId:v,adds:[{rule:m,index:[...ko(h),_||0]}]}),f.apply(h,p)})}),d.prototype.deleteRule=new Proxy(c[l].deleteRule,{apply:se((f,h,p)=>{const[m]=p,{id:_,styleId:g}=rn(h.parentStyleSheet,e,n.styleMirror);return(_&&_!==-1||g&&g!==-1)&&t({id:_,styleId:g,removes:[{index:[...ko(h),m]}]}),f.apply(h,p)})})}),se(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=s,o&&(r.CSSStyleSheet.prototype.replace=o),u&&(r.CSSStyleSheet.prototype.replaceSync=u),Object.entries(a).forEach(([l,d])=>{d.prototype.insertRule=c[l].insertRule,d.prototype.deleteRule=c[l].deleteRule})})}function Am({mirror:t,stylesheetManager:e},n){let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.getId(n.host);const i=n.nodeName==="#document"?kt([n,"access",o=>o.defaultView,"optionalAccess",o=>o.Document]):kt([n,"access",o=>o.ownerDocument,"optionalAccess",o=>o.defaultView,"optionalAccess",o=>o.ShadowRoot]),s=kt([i,"optionalAccess",o=>o.prototype])?Object.getOwnPropertyDescriptor(kt([i,"optionalAccess",o=>o.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!i||!s?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return kt([s,"access",o=>o.get,"optionalAccess",o=>o.call,"call",o=>o(this)])},set(o){const u=kt([s,"access",a=>a.set,"optionalAccess",a=>a.call,"call",a=>a(this,o)]);if(r!==null&&r!==-1)try{e.adoptStyleSheets(o,r)}catch{}return u}}),se(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function fw({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:se((u,a,c)=>{const[l,d,f]=c;if(n.has(l))return s.apply(a,[l,d,f]);const{id:h,styleId:p}=rn(kt([a,"access",m=>m.parentRule,"optionalAccess",m=>m.parentStyleSheet]),e,r.styleMirror);return(h&&h!==-1||p&&p!==-1)&&t({id:h,styleId:p,set:{property:l,value:d,priority:f},index:ko(a.parentRule)}),u.apply(a,c)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:se((u,a,c)=>{const[l]=c;if(n.has(l))return o.apply(a,[l]);const{id:d,styleId:f}=rn(kt([a,"access",h=>h.parentRule,"optionalAccess",h=>h.parentStyleSheet]),e,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&t({id:d,styleId:f,remove:{property:l},index:ko(a.parentRule)}),u.apply(a,c)})}),se(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=o})}function hw({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:i,sampling:s,doc:o}){const u=se(c=>Ri(se(l=>{const d=zi(l);if(!d||pt(d,e,n,r,!0))return;const{currentTime:f,volume:h,muted:p,playbackRate:m}=d;t({type:c,id:i.getId(d),currentTime:f,volume:h,muted:p,playbackRate:m})}),s.media||500)),a=[Xe("play",u(0),o),Xe("pause",u(1),o),Xe("seeked",u(2),o),Xe("volumechange",u(3),o),Xe("ratechange",u(4),o)];return se(()=>{a.forEach(c=>c())})}function pw({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,s=n.FontFace;n.FontFace=function(a,c,l){const d=new s(a,c,l);return i.set(d,{family:a,buffer:typeof c!="string",descriptors:l,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};const o=Dc(e.fonts,"add",function(u){return function(a){return sa(se(()=>{const c=i.get(a);c&&(t(c),i.delete(a))}),0),u.apply(this,[a])}});return r.push(()=>{n.FontFace=s}),r.push(o),se(()=>{r.forEach(u=>u())})}function gw(t){const{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,selectionCb:o}=t;let u=!0;const a=se(()=>{const c=e.getSelection();if(!c||u&&kt([c,"optionalAccess",f=>f.isCollapsed]))return;u=c.isCollapsed||!1;const l=[],d=c.rangeCount||0;for(let f=0;f<d;f++){const h=c.getRangeAt(f),{startContainer:p,startOffset:m,endContainer:_,endOffset:g}=h;pt(p,r,i,s,!0)||pt(_,r,i,s,!0)||l.push({start:n.getId(p),startOffset:m,end:n.getId(_),endOffset:g})}o({ranges:l})});return a(),Xe("selectionchange",a)}function mw({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:Dc(n.customElements,"define",function(i){return function(s,o,u){try{e({define:{name:s}})}catch{}return i.apply(this,[s,o,u])}})}function _w(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};const r=xm(t,t.doc),i=ow(t),s=aw(t),o=Om(t),u=uw(t,{win:n}),a=lw(t),c=hw(t),l=dw(t,{win:n}),d=Am(t,t.doc),f=fw(t,{win:n}),h=t.collectFonts?pw(t):()=>{},p=gw(t),m=mw(t),_=[];for(const g of t.plugins)_.push(g.observer(g.callback,n,g.options));return se(()=>{pr.forEach(g=>g.reset()),r.disconnect(),i(),s(),o(),u(),a(),c(),l(),d(),f(),h(),p(),m(),_.forEach(g=>g())})}function ys(t){return typeof window[t]<"u"}function Ss(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Eu{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,i){const s=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let u=s.get(n);return u||(u=this.generateIdFn(),s.set(n,u),o.set(u,n)),u}getIds(e,n){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return n.map(s=>this.getId(e,s,r,i))}getRemoteId(e,n,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const s=i.get(n);return s||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}function bd(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}class vw{constructor(){this.crossOriginIframeMirror=new Eu(Oc),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class yw{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Eu(Oc),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Eu(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),bd([this,"access",r=>r.loadListener,"optionalCall",r=>r(e)]),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const s=this.transformCrossOriginEvent(i,n.data.event);s&&this.wrappedEmit(s,n.data.isCheckout)}transformCrossOriginEvent(e,n){switch(n.type){case Z.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:Z.IncrementalSnapshot,data:{source:ee.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Z.Meta:case Z.Load:case Z.DomContentLoaded:return!1;case Z.Plugin:return n;case Z.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case Z.IncrementalSnapshot:switch(n.data.source){case ee.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const i=this.crossOriginIframeRootIdMap.get(e);i&&this.patchRootIdOnNode(r.node,i)}),n.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case ee.Drag:case ee.TouchMove:case ee.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case ee.ViewportResize:return!1;case ee.MediaInteraction:case ee.MouseInteraction:case ee.Scroll:case ee.CanvasMutation:case ee.Input:return this.replaceIds(n.data,e,["id"]),n;case ee.StyleSheetRule:case ee.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case ee.Font:return n;case ee.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case ee.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),bd([n,"access",r=>r.data,"access",r=>r.styles,"optionalAccess",r=>r.forEach,"call",r=>r(i=>{this.replaceStyleIds(i,e,["styleId"])})]),n}}return!1}replace(e,n,r,i){for(const s of i)!Array.isArray(n[s])&&typeof n[s]!="number"||(Array.isArray(n[s])?n[s]=e.getIds(r,n[s]):n[s]=e.getId(r,n[s]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==Oe.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class Sw{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class bw{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!yi(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=xm({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Om({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),sa(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Am({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(Dc(e.prototype,"attachShadow",function(i){return function(s){const o=i.call(this,s);return this.shadowRoot&&Cm(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class Ed{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class Ew{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new XI,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},i=[];for(const s of e){let o;this.styleMirror.has(s)?o=this.styleMirror.getId(s):(o=this.styleMirror.add(s),i.push({styleId:o,rules:Array.from(s.rules||CSSRule,(u,a)=>({rule:hm(u),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Tw{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){ZI(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==n)}add(e,n){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}let be,Ro;const dt=II();function ln(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:s=null,unblockSelector:o=null,ignoreClass:u="rr-ignore",ignoreSelector:a=null,maskAllText:c=!1,maskTextClass:l="rr-mask",unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:h=null,inlineStylesheet:p=!0,maskAllInputs:m,maskInputOptions:_,slimDOMOptions:g,maskAttributeFn:v,maskInputFn:S,maskTextFn:C,maxCanvasSize:R=null,packFn:E,sampling:x={},dataURLOptions:T={},mousemoveWait:y,recordCanvas:b=!1,recordCrossOriginIframes:I=!1,recordAfter:k=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:w=!1,collectFonts:D=!1,inlineImages:M=!1,plugins:A,keepIframeSrcFn:L=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:$,onMutation:N,getCanvasManager:j}=t;iw($);const q=I?window.parent===window:!0;let Q=!1;if(!q)try{window.parent.document&&(Q=!1)}catch{Q=!0}if(q&&!e)throw new Error("emit function is required");y!==void 0&&x.mousemove===void 0&&(x.mousemove=y),dt.reset();const ge=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:_!==void 0?_:{},ye=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};YI();let ze,Xn=0;const as=K=>{for(const Ne of A||[])Ne.eventProcessor&&(K=Ne.eventProcessor(K));return E&&!Q&&(K=E(K)),K};be=(K,Ne)=>{const te=K;if(te.timestamp=Co(),Zs([pr,"access",H=>H[0],"optionalAccess",H=>H.isFrozen,"call",H=>H()])&&te.type!==Z.FullSnapshot&&!(te.type===Z.IncrementalSnapshot&&te.data.source===ee.Mutation)&&pr.forEach(H=>H.unfreeze()),q)Zs([e,"optionalCall",H=>H(as(te),Ne)]);else if(Q){const H={type:"rrweb",event:as(te),origin:window.location.origin,isCheckout:Ne};window.parent.postMessage(H,"*")}if(te.type===Z.FullSnapshot)ze=te,Xn=0;else if(te.type===Z.IncrementalSnapshot){if(te.data.source===ee.Mutation&&te.data.isAttachIframe)return;Xn++;const H=r&&Xn>=r,F=n&&ze&&te.timestamp-ze.timestamp>n;(H||F)&&Jn(!0)}};const Lt=K=>{be({type:Z.IncrementalSnapshot,data:{source:ee.Mutation,...K}})},Zr=K=>be({type:Z.IncrementalSnapshot,data:{source:ee.Scroll,...K}}),bn=K=>be({type:Z.IncrementalSnapshot,data:{source:ee.CanvasMutation,...K}}),ba=K=>be({type:Z.IncrementalSnapshot,data:{source:ee.AdoptedStyleSheet,...K}}),lt=new Ew({mutationCb:Lt,adoptedStyleSheetCb:ba}),Qe=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new vw:new yw({mirror:dt,mutationCb:Lt,stylesheetManager:lt,recordCrossOriginIframes:I,wrappedEmit:be});for(const K of A||[])K.getMirror&&K.getMirror({nodeMirror:dt,crossOriginIframeMirror:Qe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Qe.crossOriginIframeStyleMirror});const En=new Tw,us=ww(j,{mirror:dt,win:window,mutationCb:K=>be({type:Z.IncrementalSnapshot,data:{source:ee.CanvasMutation,...K}}),recordCanvas:b,blockClass:i,blockSelector:s,unblockSelector:o,maxCanvasSize:R,sampling:x.canvas,dataURLOptions:T,errorHandler:$}),Tn=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Sw:new bw({mutationCb:Lt,scrollCb:Zr,bypassOptions:{onMutation:N,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:ge,dataURLOptions:T,maskAttributeFn:v,maskTextFn:C,maskInputFn:S,recordCanvas:b,inlineImages:M,sampling:x,slimDOMOptions:ye,iframeManager:Qe,stylesheetManager:lt,canvasManager:us,keepIframeSrcFn:L,processedNodeManager:En},mirror:dt}),Jn=(K=!1)=>{be({type:Z.Meta,data:{href:window.location.href,width:Sm(),height:ym()}},K),lt.reset(),Tn.init(),pr.forEach(te=>te.lock());const Ne=VI(document,{mirror:dt,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:p,maskAllInputs:ge,maskAttributeFn:v,maskInputFn:S,maskTextFn:C,slimDOM:ye,dataURLOptions:T,recordCanvas:b,inlineImages:M,onSerialize:te=>{Tm(te,dt)&&Qe.addIframe(te),Im(te,dt)&<.trackLinkElement(te),Su(te)&&Tn.addShadowRoot(te.shadowRoot,document)},onIframeLoad:(te,H)=>{Qe.attachIframe(te,H),Tn.observeAttachShadow(te)},onStylesheetLoad:(te,H)=>{lt.attachLinkElement(te,H)},keepIframeSrcFn:L});if(!Ne)return console.warn("Failed to snapshot the document");be({type:Z.FullSnapshot,data:{node:Ne,initialOffset:vm(window)}}),pr.forEach(te=>te.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&<.adoptStyleSheets(document.adoptedStyleSheets,dt.getId(document))};Ro=Jn;try{const K=[],Ne=H=>se(_w)({onMutation:N,mutationCb:Lt,mousemoveCb:(F,Y)=>be({type:Z.IncrementalSnapshot,data:{source:Y,positions:F}}),mouseInteractionCb:F=>be({type:Z.IncrementalSnapshot,data:{source:ee.MouseInteraction,...F}}),scrollCb:Zr,viewportResizeCb:F=>be({type:Z.IncrementalSnapshot,data:{source:ee.ViewportResize,...F}}),inputCb:F=>be({type:Z.IncrementalSnapshot,data:{source:ee.Input,...F}}),mediaInteractionCb:F=>be({type:Z.IncrementalSnapshot,data:{source:ee.MediaInteraction,...F}}),styleSheetRuleCb:F=>be({type:Z.IncrementalSnapshot,data:{source:ee.StyleSheetRule,...F}}),styleDeclarationCb:F=>be({type:Z.IncrementalSnapshot,data:{source:ee.StyleDeclaration,...F}}),canvasMutationCb:bn,fontCb:F=>be({type:Z.IncrementalSnapshot,data:{source:ee.Font,...F}}),selectionCb:F=>{be({type:Z.IncrementalSnapshot,data:{source:ee.Selection,...F}})},customElementCb:F=>{be({type:Z.IncrementalSnapshot,data:{source:ee.CustomElement,...F}})},blockClass:i,ignoreClass:u,ignoreSelector:a,maskAllText:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,maskInputOptions:ge,inlineStylesheet:p,sampling:x,recordCanvas:b,inlineImages:M,userTriggeredOnInput:w,collectFonts:D,doc:H,maskAttributeFn:v,maskInputFn:S,maskTextFn:C,keepIframeSrcFn:L,blockSelector:s,unblockSelector:o,slimDOMOptions:ye,dataURLOptions:T,mirror:dt,iframeManager:Qe,stylesheetManager:lt,shadowDomManager:Tn,processedNodeManager:En,canvasManager:us,ignoreCSSAttributes:P,plugins:Zs([A,"optionalAccess",F=>F.filter,"call",F=>F(Y=>Y.observer),"optionalAccess",F=>F.map,"call",F=>F(Y=>({observer:Y.observer,options:Y.options,callback:Se=>be({type:Z.Plugin,data:{plugin:Y.name,payload:Se}})}))])||[]},{});Qe.addLoadListener(H=>{try{K.push(Ne(H.contentDocument))}catch(F){console.warn(F)}});const te=()=>{Jn(),K.push(Ne(document))};return document.readyState==="interactive"||document.readyState==="complete"?te():(K.push(Xe("DOMContentLoaded",()=>{be({type:Z.DomContentLoaded,data:{}}),k==="DOMContentLoaded"&&te()})),K.push(Xe("load",()=>{be({type:Z.Load,data:{}}),k==="load"&&te()},window))),()=>{K.forEach(H=>H()),En.destroy(),Ro=void 0,sw()}}catch(K){console.warn(K)}}function Iw(t){if(!Ro)throw new Error("please take full snapshot after start recording");Ro(t)}ln.mirror=dt;ln.takeFullSnapshot=Iw;function ww(t,e){try{return t?t(e):new Ed}catch{return console.warn("Unable to initialize CanvasManager"),new Ed}}const Cw=3,kw=5;function Lc(t){return t>9999999999?t:t*1e3}function Da(t){return t>9999999999?t/1e3:t}function Wi(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:Z.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:ht(e,10,1e3)}}),e.category==="console")))}const Rw="button,a";function Dm(t){return t.closest(Rw)||t}function Mm(t){const e=Lm(t);return!e||!(e instanceof Element)?e:Dm(e)}function Lm(t){return xw(t)?t.target:t}function xw(t){return typeof t=="object"&&!!t&&"target"in t}let sn;function Ow(t){return sn||(sn=[],Aw()),sn.push(t),()=>{const e=sn?sn.indexOf(t):-1;e>-1&&sn.splice(e,1)}}function Aw(){Ue(pe,"open",function(t){return function(...e){if(sn)try{sn.forEach(n=>n())}catch{}return t.apply(pe,e)}})}function Dw(t,e,n){t.handleClick(e,n)}class Mw{constructor(e,n,r=Wi){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scollTimeout=n.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const e=Ow(()=>{this._lastMutation=Td()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,n){if(Nw(n,this._ignoreSelector)||!Pw(e))return;const r={timestamp:Da(e.timestamp),clickBreadcrumb:e,clickCount:0,node:n};this._clicks.some(i=>i.node===r.node&&Math.abs(i.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=Da(e)}registerScroll(e=Date.now()){this._lastScroll=Da(e)}registerClick(e){const n=Dm(e);this._handleMultiClick(n)}_handleMultiClick(e){this._getClicks(e).forEach(n=>{n.clickCount++})}_getClicks(e){return this._clicks.filter(n=>n.node===e)}_checkClicks(){const e=[],n=Td();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&&e.push(r)});for(const r of e){const i=this._clicks.indexOf(r);i>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(i,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,i=e.mutationAfter&&e.mutationAfter<=this._threshold,s=!r&&!i,{clickCount:o,clickBreadcrumb:u}=e;if(s){const a=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,c=a<this._timeout*1e3?"mutation":"timeout",l={type:"default",message:u.message,timestamp:u.timestamp,category:"ui.slowClickDetected",data:{...u.data,url:pe.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:c,clickCount:o||1}};this._addBreadcrumbEvent(n,l);return}if(o>1){const a={type:"default",message:u.message,timestamp:u.timestamp,category:"ui.multiClick",data:{...u.data,url:pe.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}}const Lw=["A","BUTTON","INPUT"];function Nw(t,e){return!!(!Lw.includes(t.tagName)||t.tagName==="INPUT"&&!["submit","button"].includes(t.getAttribute("type")||"")||t.tagName==="A"&&(t.hasAttribute("download")||t.hasAttribute("target")&&t.getAttribute("target")!=="_self")||e&&t.matches(e))}function Pw(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function Td(){return Date.now()/1e3}function $w(t,e){try{if(!Uw(e))return;const{source:n}=e.data;if(n===ee.Mutation&&t.registerMutation(e.timestamp),n===ee.Scroll&&t.registerScroll(e.timestamp),Fw(e)){const{type:r,id:i}=e.data,s=ln.mirror.getNode(i);s instanceof HTMLElement&&r===Ke.Click&&t.registerClick(s)}}catch{}}function Uw(t){return t.type===Cw}function Fw(t){return t.data.source===ee.MouseInteraction}function Ot(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var xo;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(xo||(xo={}));const Bw=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Hw(t){const e={};for(const n in t)if(Bw.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}const jw=t=>e=>{if(!t.isEnabled())return;const n=Gw(e);if(!n)return;const r=e.name==="click",i=r?e.event:void 0;r&&t.clickDetector&&i&&i.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&Dw(t.clickDetector,n,Mm(e.event)),Wi(t,n)};function Nm(t,e){const n=ln.mirror.getId(t),r=n&&ln.mirror.getNode(n),i=r&&ln.mirror.getMeta(r),s=i&&zw(i)?i:null;return{message:e,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(o=>o.type===xo.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:Hw(s.attributes)}}:{}}}function Gw(t){const{target:e,message:n}=qw(t);return Ot({category:`ui.${t.name}`,...Nm(e,n)})}function qw(t){const e=t.name==="click";let n,r=null;try{r=e?Mm(t.event):Lm(t.event),n=pn(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function zw(t){return t.type===xo.Element}function Ww(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=Vw(e);n&&Wi(t,n)}function Vw(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s,target:o}=t;if(!o||Kw(o)||!s)return null;const u=e||r||i,a=s.length===1;if(!u&&a)return null;const c=pn(o,{maxStringLength:200})||"<unknown>",l=Nm(o,c);return Ot({category:"ui.keyDown",message:c,data:{...l.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s}})}function Kw(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}const Id={resource:Zw,paint:Jw,navigation:Qw};function Yw(t){return t.map(Xw).filter(Boolean)}function Xw(t){return Id[t.entryType]?Id[t.entryType](t):null}function Ar(t){return((qe||pe.performance.timeOrigin)+t)/1e3}function Jw(t){const{duration:e,entryType:n,name:r,startTime:i}=t,s=Ar(i);return{type:n,name:r,start:s,end:s+e,data:void 0}}function Qw(t){const{entryType:e,name:n,decodedBodySize:r,duration:i,domComplete:s,encodedBodySize:o,domContentLoadedEventStart:u,domContentLoadedEventEnd:a,domInteractive:c,loadEventStart:l,loadEventEnd:d,redirectCount:f,startTime:h,transferSize:p,type:m}=t;return i===0?null:{type:`${e}.${m}`,start:Ar(h),end:Ar(s),name:n,data:{size:p,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:c,domContentLoadedEventStart:u,domContentLoadedEventEnd:a,loadEventStart:l,loadEventEnd:d,domComplete:s,redirectCount:f}}}function Zw(t){const{entryType:e,initiatorType:n,name:r,responseEnd:i,startTime:s,decodedBodySize:o,encodedBodySize:u,responseStatus:a,transferSize:c}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:Ar(s),end:Ar(i),name:r,data:{size:c,statusCode:a,decodedBodySize:o,encodedBodySize:u}}}function e1(t){const e=t.entries,n=e[e.length-1],r=n?n.element:void 0,i=t.value,s=Ar(i);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:s,end:s,data:{value:i,size:i,nodeId:r?ln.mirror.getId(r):void 0}}}function t1(t){function e(i){t.performanceEntries.includes(i)||t.performanceEntries.push(i)}function n({entries:i}){i.forEach(e)}const r=[];return["navigation","paint","resource"].forEach(i=>{r.push(_n(i,n))}),r.push(Tg(({metric:i})=>{t.replayPerformanceEntries.push(e1(i))})),()=>{r.forEach(i=>i())}}const fe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,n1='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]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(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,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(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},A=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},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=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:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(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,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}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 a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),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=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+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(C,U,0),R=C;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[a[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=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(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;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=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,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];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(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[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=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),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(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[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-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,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 a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),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(a),32768),this.s.z=n.length-a+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}();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,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.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)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}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}(),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(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}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(let r=0,e=t.length;r<e;r++)n+=t[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 r1(){const t=new Blob([n1]);return URL.createObjectURL(t)}function Ye(t,e){fe&&(O.info(t),e&&Pm(t))}function Er(t,e){fe&&(O.info(t),e&&setTimeout(()=>{Pm(t)},0))}function Pm(t){Qt({category:"console",data:{logger:"replay"},level:"info",message:t},{level:"info"})}class Nc extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Rc}.`)}}class $m{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const n=JSON.stringify(e).length;if(this._totalSize+=n,this._totalSize>Rc)throw new Nc;this.events.push(e)}finish(){return new Promise(e=>{const n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map(n=>n.timestamp).sort()[0];return e?Lc(e):null}}class i1{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){Ye("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(e,n){const r=this._getAndIncrementId();return new Promise((i,s)=>{const o=({data:u})=>{const a=u;if(a.method===e&&a.id===r){if(this._worker.removeEventListener("message",o),!a.success){fe&&O.error("[Replay]",a.response),s(new Error("Error in compression worker"));return}i(a.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:e,arg:n})})}_getAndIncrementId(){return this._id++}}class s1{constructor(e){this._worker=new i1(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const n=Lc(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>Rc?Promise.reject(new Nc):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{fe&&O.warn('[Replay] Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class o1{constructor(e){this._fallback=new $m,this._compression=new s1(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch{Ye("[Replay] Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:n}=this._fallback,r=[];for(const i of e)r.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._used=this._compression;try{await Promise.all(r)}catch(i){fe&&O.warn("[Replay] Failed to add events when switching buffers.",i)}}}function a1({useCompression:t,workerUrl:e}){if(t&&window.Worker){const n=u1(e);if(n)return n}return Ye("[Replay] Using simple buffer"),new $m}function u1(t){try{const e=t||c1();if(!e)return;Ye(`[Replay] Using compression worker${t?` from ${t}`:""}`);const n=new Worker(e);return new o1(n)}catch{Ye("[Replay] Failed to create compression worker")}}function c1(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?r1():""}function Pc(){try{return"sessionStorage"in pe&&!!pe.sessionStorage}catch{return!1}}function l1(t){d1(),t.session=void 0}function d1(){if(Pc())try{pe.sessionStorage.removeItem(Cc)}catch{}}function Um(t){return t===void 0?!1:Math.random()<t}function Fm(t){const e=Date.now(),n=t.id||ue(),r=t.started||e,i=t.lastActivity||e,s=t.segmentId||0,o=t.sampled,u=t.previousSessionId;return{id:n,started:r,lastActivity:i,segmentId:s,sampled:o,previousSessionId:u}}function $c(t){if(Pc())try{pe.sessionStorage.setItem(Cc,JSON.stringify(t))}catch{}}function f1(t,e){return Um(t)?"session":e?"buffer":!1}function wd({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){const i=f1(t,e),s=Fm({sampled:i,previousSessionId:r});return n&&$c(s),s}function h1(t){if(!Pc())return null;try{const e=pe.sessionStorage.getItem(Cc);if(!e)return null;const n=JSON.parse(e);return Er("[Replay] Loading existing session",t),Fm(n)}catch{return null}}function Tu(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function Bm(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return Tu(t.started,e,r)||Tu(t.lastActivity,n,r)}function Hm(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!Bm(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function Ma({traceInternals:t,sessionIdleExpire:e,maxReplayDuration:n,previousSessionId:r},i){const s=i.stickySession&&h1(t);return s?Hm(s,{sessionIdleExpire:e,maxReplayDuration:n})?(Er("[Replay] Session in sessionStorage is expired, creating new one..."),wd(i,{previousSessionId:s.id})):s:(Er("[Replay] Creating new session",t),wd(i,{previousSessionId:r}))}function p1(t){return t.type===Z.Custom}function Uc(t,e,n){return Gm(t,e)?(jm(t,e,n),!0):!1}function g1(t,e,n){return Gm(t,e)?jm(t,e,n):Promise.resolve(null)}async function jm(t,e,n){if(!t.eventBuffer)return null;try{n&&t.recordingMode==="buffer"&&t.eventBuffer.clear(),n&&(t.eventBuffer.hasCheckout=!0);const r=t.getOptions(),i=m1(e,r.beforeAddRecordingEvent);return i?await t.eventBuffer.addEvent(i):void 0}catch(r){const i=r&&r instanceof Nc?"addEventSizeExceeded":"addEvent";fe&&O.error(r),await t.stop({reason:i});const s=W();s&&s.recordDroppedEvent("internal_sdk_error","replay")}}function Gm(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;const n=Lc(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(Ye(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,t.getOptions()._experiments.traceInternals),!1):!0}function m1(t,e){try{if(typeof e=="function"&&p1(t))return e(t)}catch(n){return fe&&O.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return t}function Fc(t){return!t.type}function Iu(t){return t.type==="transaction"}function _1(t){return t.type==="replay_event"}function Cd(t){return t.type==="feedback"}function qm(t){const e=S1();return(n,r)=>{if(!t.isEnabled()||!Fc(n)&&!Iu(n))return;const i=r&&r.statusCode;if(!(e&&(!i||i<200||i>=300))){if(Iu(n)){v1(t,n);return}y1(t,n)}}}function v1(t,e){const n=t.getContext();e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(e.contexts.trace.trace_id)}function y1(t,e){const n=t.getContext();if(e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id),t.recordingMode!=="buffer"||!e.tags||!e.tags.replayId)return;const{beforeErrorSampling:r}=t.getOptions();typeof r=="function"&&!r(e)||setTimeout(()=>{t.sendBufferedReplayOrFlush()})}function S1(){const t=W();if(!t)return!1;const e=t.getTransport();return e&&e.send.__sentry__baseTransport__||!1}function b1(t){return e=>{!t.isEnabled()||!Fc(e)||E1(t,e)}}function E1(t,e){const n=e.exception&&e.exception.values&&e.exception.values[0].value;if(typeof n=="string"&&(n.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=Ot({category:"replay.hydrate-error"});Wi(t,r)}}function T1(t,e){return t.type||!t.exception||!t.exception.values||!t.exception.values.length?!1:!!(e.originalException&&e.originalException.__rrweb__)}function I1(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:Z.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function w1(t,e){return t.recordingMode!=="buffer"||e.message===kc||!e.exception||e.type?!1:Um(t.getOptions().errorSampleRate)}function C1(t,e=!1){const n=e?qm(t):void 0;return Object.assign((r,i)=>t.isEnabled()?_1(r)?(delete r.breadcrumbs,r):!Fc(r)&&!Iu(r)&&!Cd(r)||!t.checkAndHandleExpiredSession()?r:Cd(r)?(t.flush(),r.contexts.feedback.replay_id=t.getSessionId(),I1(t,r),r):T1(r,i)&&!t.getOptions()._experiments.captureExceptions?(fe&&O.log("[Replay] Ignoring error from rrweb internals",r),null):((w1(t,r)||t.recordingMode==="session")&&(r.tags={...r.tags,replayId:t.getSessionId()}),n&&n(r,{statusCode:200}),r):r,{id:"Replay"})}function oa(t,e){return e.map(({type:n,start:r,end:i,name:s,data:o})=>{const u=t.throttledAddEvent({type:Z.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:i,data:o}}});return typeof u=="string"?Promise.resolve(null):u})}function k1(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}function R1(t){return e=>{if(!t.isEnabled())return;const n=k1(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(oa(t,[n]),!1)))}}function x1(t,e){return fe&&t.getOptions()._experiments.traceInternals?!1:rg(e,W())}function aa(t,e){t.isEnabled()&&e!==null&&(x1(t,e.name)||t.addUpdate(()=>(oa(t,[e]),!0)))}function O1(t){const{startTimestamp:e,endTimestamp:n,fetchData:r,response:i}=t;if(!n)return null;const{method:s,url:o}=r;return{type:"resource.fetch",start:e/1e3,end:n/1e3,name:o,data:{method:s,statusCode:i?i.status:void 0}}}function A1(t){return e=>{if(!t.isEnabled())return;const n=O1(e);aa(t,n)}}function D1(t){const{startTimestamp:e,endTimestamp:n,xhr:r}=t,i=r[Wt];if(!e||!n||!i)return null;const{method:s,url:o,status_code:u}=i;return o===void 0?null:{type:"resource.xhr",name:o,start:e/1e3,end:n/1e3,data:{method:s,statusCode:u}}}function M1(t){return e=>{if(!t.isEnabled())return;const n=D1(e);aa(t,n)}}function ua(t,e){if(t)try{if(typeof t=="string")return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=Km(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function zm(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function Wm(t){try{if(typeof t=="string")return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[Km(t)];if(!t)return[void 0]}catch{return fe&&O.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return fe&&O.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Oo(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function Vm(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:i,method:s,statusCode:o,request:u,response:a}=e;return{type:t,start:n/1e3,end:r/1e3,name:i,data:Fe({method:s,statusCode:o,request:u,response:a})}}function xi(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function dn(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:i,warnings:s}=L1(n);return r.body=i,s&&s.length>0&&(r._meta={warnings:s}),r}function wu(t,e){return Object.keys(t).reduce((n,r)=>{const i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=t[r]),n},{})}function Km(t){return new URLSearchParams(t).toString()}function L1(t){if(!t||typeof t!="string")return{body:t};const e=t.length>ld,n=N1(t);if(e){const r=t.slice(0,ld);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch{}return{body:t}}function N1(t){const e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function Ao(t,e){const n=P1(t);return Fr(n,e)}function P1(t,e=pe.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(pe.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function $1(t,e,n){try{const r=await F1(t,e,n),i=Vm("resource.fetch",r);aa(n.replay,i)}catch(r){fe&&O.error("[Replay] Failed to capture fetch breadcrumb",r)}}function U1(t,e,n){const{input:r,response:i}=e,s=r?Ym(r):void 0,o=ua(s,n.textEncoder),u=i?zm(i.headers.get("content-length")):void 0;o!==void 0&&(t.data.request_body_size=o),u!==void 0&&(t.data.response_body_size=u)}async function F1(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r}=e,{url:o,method:u,status_code:a=0,request_body_size:c,response_body_size:l}=t.data,d=Ao(o,n.networkDetailAllowUrls)&&!Ao(o,n.networkDetailDenyUrls),f=d?B1(n,e.input,c):xi(c),h=await H1(d,n,e.response,l);return{startTimestamp:i,endTimestamp:s,url:o,method:u,statusCode:a,request:f,response:h}}function B1({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const i=n?q1(n,e):{};if(!t)return dn(i,r,void 0);const s=Ym(n),[o,u]=Wm(s),a=dn(i,r,o);return u?Oo(a,u):a}async function H1(t,{networkCaptureBodies:e,textEncoder:n,networkResponseHeaders:r},i,s){if(!t&&s!==void 0)return xi(s);const o=i?Xm(i.headers,r):{};if(!i||!e&&s!==void 0)return dn(o,s,void 0);const[u,a]=await G1(i),c=j1(u,{networkCaptureBodies:e,textEncoder:n,responseBodySize:s,captureDetails:t,headers:o});return a?Oo(c,a):c}function j1(t,{networkCaptureBodies:e,textEncoder:n,responseBodySize:r,captureDetails:i,headers:s}){try{const o=t&&t.length&&r===void 0?ua(t,n):r;return i?e?dn(s,o,t):dn(s,o,void 0):xi(o)}catch(o){return fe&&O.warn("[Replay] Failed to serialize response body",o),dn(s,r,void 0)}}async function G1(t){const e=z1(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await W1(e)]}catch(n){return fe&&O.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}}function Ym(t=[]){if(!(t.length!==2||typeof t[1]!="object"))return t[1].body}function Xm(t,e){const n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function q1(t,e){return t.length===1&&typeof t[0]!="string"?kd(t[0],e):t.length===2?kd(t[1],e):{}}function kd(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?Xm(n,e):Array.isArray(n)?{}:wu(n,e):{}}function z1(t){try{return t.clone()}catch(e){fe&&O.warn("[Replay] Failed to clone response body",e)}}function W1(t){return new Promise((e,n)=>{const r=setTimeout(()=>n(new Error("Timeout while trying to read response body")),500);V1(t).then(i=>e(i),i=>n(i)).finally(()=>clearTimeout(r))})}async function V1(t){return await t.text()}async function K1(t,e,n){try{const r=X1(t,e,n),i=Vm("resource.xhr",r);aa(n.replay,i)}catch(r){fe&&O.error("[Replay] Failed to capture xhr breadcrumb",r)}}function Y1(t,e,n){const{xhr:r,input:i}=e;if(!r)return;const s=ua(i,n.textEncoder),o=r.getResponseHeader("content-length")?zm(r.getResponseHeader("content-length")):eC(r.response,r.responseType,n.textEncoder);s!==void 0&&(t.data.request_body_size=s),o!==void 0&&(t.data.response_body_size=o)}function X1(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r,input:o,xhr:u}=e,{url:a,method:c,status_code:l=0,request_body_size:d,response_body_size:f}=t.data;if(!a)return null;if(!u||!Ao(a,n.networkDetailAllowUrls)||Ao(a,n.networkDetailDenyUrls)){const E=xi(d),x=xi(f);return{startTimestamp:i,endTimestamp:s,url:a,method:c,statusCode:l,request:E,response:x}}const h=u[Wt],p=h?wu(h.request_headers,n.networkRequestHeaders):{},m=wu(J1(u),n.networkResponseHeaders),[_,g]=n.networkCaptureBodies?Wm(o):[void 0],[v,S]=n.networkCaptureBodies?Q1(u):[void 0],C=dn(p,d,_),R=dn(m,f,v);return{startTimestamp:i,endTimestamp:s,url:a,method:c,statusCode:l,request:g?Oo(C,g):C,response:S?Oo(R,S):R}}function J1(t){const e=t.getAllResponseHeaders();return e?e.split(`\r `).reduce((n,r)=>{const[i,s]=r.split(": ");return n[i.toLowerCase()]=s,n},{}):{}}function Q1(t){const e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return Z1(t.response,t.responseType)}catch(n){e.push(n)}return fe&&O.warn("[Replay] Failed to get xhr response body",...e),[void 0]}function Z1(t,e){try{if(typeof t=="string")return[t];if(t instanceof Document)return[t.body.outerHTML];if(e==="json"&&t&&typeof t=="object")return[JSON.stringify(t)];if(!t)return[void 0]}catch{return fe&&O.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return fe&&O.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function eC(t,e,n){try{const r=e==="json"&&t&&typeof t=="object"?JSON.stringify(t):t;return ua(r,n)}catch{return}}function tC(t){const e=W();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:u}=t.getOptions(),a={replay:t,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:u};e&&e.on?e.on("beforeAddBreadcrumb",(c,l)=>nC(a,c,l)):(Vo(A1(t)),Ko(M1(t)))}catch{}}function nC(t,e,n){if(e.data)try{rC(e)&&sC(n)&&(Y1(e,n,t),K1(e,n,t)),iC(e)&&oC(n)&&(U1(e,n,t),$1(e,n,t))}catch{fe&&O.warn("Error when enriching network breadcrumb")}}function rC(t){return t.category==="xhr"}function iC(t){return t.category==="fetch"}function sC(t){return t&&t.xhr}function oC(t){return t&&t.response}let Rd=null;function aC(t){return!!t.category}const uC=t=>e=>{if(!t.isEnabled())return;const n=cC(e);n&&Wi(t,n)};function cC(t){const e=t.getLastBreadcrumb&&t.getLastBreadcrumb();return Rd===e||!e||(Rd=e,!aC(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))?null:e.category==="console"?lC(e):Ot(e)}function lC(t){const e=t.data&&t.data.arguments;if(!Array.isArray(e)||e.length===0)return Ot(t);let n=!1;const r=e.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>vs?(n=!0,`${i.slice(0,vs)}…`):i;if(typeof i=="object")try{const s=ht(i,7);return JSON.stringify(s).length>vs?(n=!0,`${JSON.stringify(s,null,2).slice(0,vs)}…`):s}catch{}return i});return Ot({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function dC(t){const e=we(),n=W();e.addScopeListener(uC(t)),up(jw(t)),Li(R1(t)),tC(t);const r=C1(t,!xd(n));n&&n.addEventProcessor?n.addEventProcessor(r):Jp(r),xd(n)&&(n.on("beforeSendEvent",b1(t)),n.on("afterSendEvent",qm(t)),n.on("createDsc",i=>{const s=t.getSessionId();s&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(i.replay_id=s)}),n.on("startTransaction",i=>{t.lastTransaction=i}),n.on("finishTransaction",i=>{t.lastTransaction=i}),n.on("beforeSendFeedback",(i,s)=>{const o=t.getSessionId();s&&s.includeReplay&&t.isEnabled()&&o&&i.contexts&&i.contexts.feedback&&(i.contexts.feedback.replay_id=o)}))}function xd(t){return!!(t&&t.on)}async function fC(t){try{return Promise.all(oa(t,[hC(pe.performance.memory)]))}catch{return[]}}function hC(t){const{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function pC(t,e,n){let r,i,s;const o=n&&n.maxWait?Math.max(n.maxWait,e):0;function u(){return a(),r=t(),r}function a(){i!==void 0&&clearTimeout(i),s!==void 0&&clearTimeout(s),i=s=void 0}function c(){return i!==void 0||s!==void 0?u():r}function l(){return i&&clearTimeout(i),i=setTimeout(u,e),o&&s===void 0&&(s=setTimeout(u,o)),r}return l.cancel=a,l.flush=c,l}function gC(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession()){fe&&O.warn("[Replay] Received replay event after session expired.");return}const i=r||!e;e=!0,t.clickDetector&&$w(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&i&&t.setInitialState(),!Uc(t,n,i))return!0;if(!i)return!1;if(_C(t,i),t.session&&t.session.previousSessionId)return!0;if(t.recordingMode==="buffer"&&t.session&&t.eventBuffer){const s=t.eventBuffer.getEarliestTimestamp();s&&(Ye(`[Replay] Updating session start time to earliest event in buffer to ${new Date(s)}`,t.getOptions()._experiments.traceInternals),t.session.started=s,t.getOptions().stickySession&&$c(t.session))}return t.recordingMode==="session"&&t.flush(),!0})}}function mC(t){const e=t.getOptions();return{type:Z.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:t.eventBuffer?t.eventBuffer.type==="worker":!1,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}function _C(t,e){!e||!t.session||t.session.segmentId!==0||Uc(t,mC(t),!1)}function vC(t,e,n,r){return Zt(bp(t,ec(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:typeof e=="string"?new TextEncoder().encode(e).length:e.length},e]])}function yC({recordingData:t,headers:e}){let n;const r=`${JSON.stringify(e)} `;if(typeof t=="string")n=`${r}${t}`;else{const s=new TextEncoder().encode(r);n=new Uint8Array(s.length+t.length),n.set(s),n.set(t,s.length)}return n}async function SC({client:t,scope:e,replayId:n,event:r}){const i=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,s={event_id:n,integrations:i};t.emit&&t.emit("preprocessEvent",r,s);const o=await ic(t.getOptions(),r,s,e,t,Mt());if(!o)return null;o.platform=o.platform||"javascript";const u=t.getSdkMetadata&&t.getSdkMetadata(),{name:a,version:c}=u&&u.sdk||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:c||"0.0.0"},o}async function bC({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:i,session:s}){const o=yC({recordingData:t,headers:{segment_id:n}}),{urls:u,errorIds:a,traceIds:c,initialTimestamp:l}=r,d=W(),f=we(),h=d&&d.getTransport(),p=d&&d.getDsn();if(!d||!h||!p||!s.sampled)return;const m={type:sI,replay_start_timestamp:l/1e3,timestamp:i/1e3,error_ids:a,trace_ids:c,urls:u,replay_id:e,segment_id:n,replay_type:s.sampled},_=await SC({scope:f,client:d,replayId:e,event:m});if(!_){d.recordDroppedEvent("event_processor","replay",m),Ye("An event processor returned `null`, will not send event.");return}delete _.sdkProcessingMetadata;const g=vC(_,o,p,d.getOptions().tunnel);let v;try{v=await h.send(g)}catch(C){const R=new Error(kc);try{R.cause=C}catch{}throw R}if(!v)return v;if(typeof v.statusCode=="number"&&(v.statusCode<200||v.statusCode>=300))throw new Jm(v.statusCode);const S=Ip({},v);if(Tp(S,"replay"))throw new Qm(S);return v}class Jm extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class Qm extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function Zm(t,e={count:0,interval:dI}){const{recordingData:n,options:r}=t;if(n.length)try{return await bC(t),!0}catch(i){if(i instanceof Jm||i instanceof Qm)throw i;if(xp("Replays",{_retryCount:e.count}),fe&&r._experiments&&r._experiments.captureExceptions&&$i(i),e.count>=fI){const s=new Error(`${kc} - max retries exceeded`);try{s.cause=i}catch{}throw s}return e.interval*=++e.count,new Promise((s,o)=>{setTimeout(async()=>{try{await Zm(t,e),s(!0)}catch(u){o(u)}},e.interval)})}}const e_="__THROTTLED",EC="__SKIPPED";function TC(t,e,n){const r=new Map,i=u=>{const a=u-n;r.forEach((c,l)=>{l<a&&r.delete(l)})},s=()=>[...r.values()].reduce((u,a)=>u+a,0);let o=!1;return(...u)=>{const a=Math.floor(Date.now()/1e3);if(i(a),s()>=e){const l=o;return o=!0,l?EC:e_}o=!1;const c=r.get(a)||0;return r.set(a,c+1),t(...u)}}class on{constructor({options:e,recordingOptions:n}){on.prototype.__init.call(this),on.prototype.__init2.call(this),on.prototype.__init3.call(this),on.prototype.__init4.call(this),on.prototype.__init5.call(this),on.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:oI,sessionIdleExpire:aI},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=e,this._debouncedFlush=pC(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=TC((o,u)=>g1(this,o,u),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:i}=this.getOptions(),s=r?{threshold:Math.min(hI,r),timeout:r,scrollTimeout:pI,ignoreSelector:i?i.join(","):""}:void 0;s&&(this.clickDetector=new Mw(this,s))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(e){const{errorSampleRate:n,sessionSampleRate:r}=this._options;if(!(n<=0&&r<=0)){if(this._initializeSessionForSampling(e),!this.session){this._handleException(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",Er(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session")throw new Error("Replay recording is already in progress");if(this._isEnabled&&this.recordingMode==="buffer")throw new Error("Replay buffering is in progress, call `flush()` to save the replay");Er("[Replay] Starting replay in session mode",this._options._experiments.traceInternals),this._updateUserActivity();const e=Ma({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");Er("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const e=Ma({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=ln({...this._recordingOptions,...this.recordingMode==="buffer"&&{checkoutEveryNms:lI},emit:gC(this),onMutation:this._onMutationHandler,...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this._handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this._handleException(e),!1}}async stop({forceFlush:e=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1;try{Ye(`[Replay] Stopping Replay${n?` triggered by ${n}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,l1(this)}catch(r){this._handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Ye("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Ye("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();Ye("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const n=e();this.recordingMode!=="buffer"&&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(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&Tu(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const e=`${pe.location.pathname}${pe.location.hash}${pe.location.search}`,n=`${pe.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){const r=this._throttledAddEvent(e,n);if(r===e_){const i=Ot({category:"replay.throttled"});this.addUpdate(()=>!Uc(this,{type:kw,timestamp:i.timestamp||0,data:{tag:"breadcrumb",payload:i,metric:!0}}))}return r}getCurrentRoute(){const e=this.lastTransaction||we().getTransaction(),r=(e&&ce(e).data||{})[tt];if(!(!e||!r||!["route","custom"].includes(r)))return ce(e).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=a1({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(e){fe&&O.error("[Replay]",e),fe&&this._options._experiments&&this._options._experiments.captureExceptions&&$i(e)}_initializeSessionForSampling(e){const n=this._options.errorSampleRate>0,r=Ma({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const e=this.session;return Hm(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{pe.document.addEventListener("visibilitychange",this._handleVisibilityChange),pe.addEventListener("blur",this._handleWindowBlur),pe.addEventListener("focus",this._handleWindowFocus),pe.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(dC(this),this._hasInitializedCoreListeners=!0)}catch(e){this._handleException(e)}this._performanceCleanupCallback=t1(this)}_removeListeners(){try{pe.document.removeEventListener("visibilitychange",this._handleVisibilityChange),pe.removeEventListener("blur",this._handleWindowBlur),pe.removeEventListener("focus",this._handleWindowFocus),pe.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this._handleException(e)}}__init(){this._handleVisibilityChange=()=>{pe.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=Ot({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=Ot({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{Ww(this,e)}}_doChangeToBackgroundTasks(e){!this.session||Bm(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){Ye("[Replay] Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:Z.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){const e=Yw(this.performanceEntries).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(oa(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:n}=this;if(!e||!n||e.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const e={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(),e}async _runFlush(){const e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){fe&&O.error("[Replay] No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await fC(this),!!this.eventBuffer&&e===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(),i=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await Zm({replayId:e,recordingData:s,segmentId:i,eventContext:r,session:this.session,options:this.getOptions(),timestamp:n})}catch(n){this._handleException(n),this.stop({reason:"sendReplay"});const r=W();r&&r.recordDroppedEvent("send_error","replay")}}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){fe&&O.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,i=Date.now()-n;this._debouncedFlush.cancel();const s=i<this._options.minReplayDuration,o=i>this._options.maxReplayDuration+5e3;if(s||o){Ye(`[Replay] Session duration (${Math.floor(i/1e3)}s) is too ${s?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),s&&this._debouncedFlush();return}const u=this.eventBuffer;if(u&&this.session.segmentId===0&&!u.hasCheckout&&Ye("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(a){fe&&O.error(a)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&$c(this.session)}__init6(){this._onMutationHandler=e=>{const n=e.length,r=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,s=r&&n>r;if(n>i||s){const o=Ot({category:"replay.mutations",data:{count:n,limit:s}});this._createCustomBreadcrumb(o)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function ri(t,e,n,r){const i=typeof r=="string"?r.split(","):[],s=[...t,...i,...e];return typeof n<"u"&&(typeof n=="string"&&s.push(`.${n}`),gn(()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")})),s.join(",")}function IC({mask:t,unmask:e,block:n,unblock:r,ignore:i,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:a,ignoreClass:c}){const l=['base[href="/"]'],d=ri(t,[".sentry-mask","[data-sentry-mask]"],u,a),f=ri(e,[".sentry-unmask","[data-sentry-unmask]"]),h={maskTextSelector:d,unmaskTextSelector:f,blockSelector:ri(n,[".sentry-block","[data-sentry-block]",...l],s,o),unblockSelector:ri(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:ri(i,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],c)};return s instanceof RegExp&&(h.blockClass=s),u instanceof RegExp&&(h.maskTextClass=u),h}function wC({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:i,value:s}){return!r||i.unmaskTextSelector&&t.matches(i.unmaskTextSelector)?s:n.includes(e)||e==="value"&&t.tagName==="INPUT"&&["submit","button"].includes(t.getAttribute("type")||"")?s.replace(/[\S]/g,"*"):s}const Od='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',CC=["content-length","content-type","accept"];let Ad=!1;const kC=t=>new Vi(t);class Vi{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=uI,flushMaxDelay:n=cI,minReplayDuration:r=gI,maxReplayDuration:i=dd,stickySession:s=!0,useCompression:o=!0,workerUrl:u,_experiments:a={},sessionSampleRate:c,errorSampleRate:l,maskAllText:d=!0,maskAllInputs:f=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:p=750,mutationLimit:m=1e4,slowClickTimeout:_=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:v=[],networkDetailDenyUrls:S=[],networkCaptureBodies:C=!0,networkRequestHeaders:R=[],networkResponseHeaders:E=[],mask:x=[],maskAttributes:T=["title","placeholder"],unmask:y=[],block:b=[],unblock:I=[],ignore:k=[],maskFn:w,beforeAddRecordingEvent:D,beforeErrorSampling:M,blockClass:A,blockSelector:L,maskInputOptions:P,maskTextClass:$,maskTextSelector:N,ignoreClass:j}={}){this.name=Vi.id;const q=IC({mask:x,unmask:y,block:b,unblock:I,ignore:k,blockClass:A,blockSelector:L,maskTextClass:$,maskTextSelector:N,ignoreClass:j});if(this._recordingOptions={maskAllInputs:f,maskAllText:d,maskInputOptions:{...P||{},password:!0},maskTextFn:w,maskInputFn:w,maskAttributeFn:(Q,ge,ye)=>wC({maskAttributes:T,maskAllText:d,privacyOptions:q,key:Q,value:ge,el:ye}),...q,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:Q=>{try{Q.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,mI),maxReplayDuration:Math.min(i,dd),stickySession:s,sessionSampleRate:c,errorSampleRate:l,useCompression:o,workerUrl:u,blockAllMedia:h,maskAllInputs:f,maskAllText:d,mutationBreadcrumbLimit:p,mutationLimit:m,slowClickTimeout:_,slowClickIgnoreSelectors:g,networkDetailAllowUrls:v,networkDetailDenyUrls:S,networkCaptureBodies:C,networkRequestHeaders:Dd(R),networkResponseHeaders:Dd(E),beforeAddRecordingEvent:D,beforeErrorSampling:M,_experiments:a},typeof c=="number"&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration. This option is deprecated and will be removed soon. Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.: Sentry.init({ replaysSessionSampleRate: ${c} })`),this._initialOptions.sessionSampleRate=c),typeof l=="number"&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration. This option is deprecated and will be removed soon. Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.: Sentry.init({ replaysOnErrorSampleRate: ${l} })`),this._initialOptions.errorSampleRate=l),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Od}`:Od),this._isInitialized&&iu())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Ad}set _isInitialized(e){Ad=e}setupOnce(){iu()&&(this._setup(),setTimeout(()=>this._initialize()))}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(e){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(e)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){const e=RC(this._initialOptions);this._replay=new on({options:e,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{const n=W().getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}Vi.__initStatic();function RC(t){const e=W(),n=e&&e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...Fe(t)};return n?(t.sessionSampleRate==null&&t.errorSampleRate==null&&n.replaysSessionSampleRate==null&&n.replaysOnErrorSampleRate==null&&gn(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),typeof n.replaysSessionSampleRate=="number"&&(r.sessionSampleRate=n.replaysSessionSampleRate),typeof n.replaysOnErrorSampleRate=="number"&&(r.errorSampleRate=n.replaysOnErrorSampleRate),r):(gn(()=>{console.warn("SDK client is not available.")}),r)}function Dd(t){return[...CC,...t.map(e=>e.toLowerCase())]}function xC(){const t=W();return t&&t.getIntegrationByName&&t.getIntegrationByName("Replay")}var Md;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(Md||(Md={}));function OC(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}function Cu(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:Cu(t.parentNode,e,n,r+1)}function Ld(t,e){return n=>{const r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(OC(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}const lr=`Please stop import mirror directly. Instead of that,\r now you can use replayer.getMirror() to access the mirror instance of a replayer,\r or you can use record.mirror to access the mirror instance during recording.`;let Nd={map:{},getId(){return console.error(lr),-1},getNode(){return console.error(lr),null},removeNodeFromMap(){console.error(lr)},has(){return console.error(lr),!1},reset(){console.error(lr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Nd=new Proxy(Nd,{get(t,e,n){return e==="map"&&console.error(lr),Reflect.get(t,e,n)}}));function Bc(t,e,n,r,i=window){const s=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,r?n:{set(o){n_(()=>{n.set.call(this,o)},0),s&&s.set&&s.set.call(this,o)}}),()=>Bc(t,e,s||{},!0)}function Hc(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString());function AC(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function ca(t,e,n,r,i){if(!t)return!1;const s=AC(t);if(!s)return!1;const o=Ld(e,n),u=Cu(s,o);let a=-1;return u<0?!1:(r&&(a=Cu(s,Ld(null,r))),u>-1&&a<0?!0:u<a)}const Pd={};function t_(t){const e=Pd[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch{}return Pd[t]=r.bind(window)}function In(...t){return t_("requestAnimationFrame")(...t)}function n_(...t){return t_("setTimeout")(...t)}var Dr=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Dr||{});let to;function DC(t){to=t}const $d=t=>to?(...n)=>{try{return t(...n)}catch(r){if(to&&to(r)===!0)return()=>{};throw r}}:t;var gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",MC=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var bs=0;bs<gr.length;bs++)MC[gr.charCodeAt(bs)]=bs;var LC=function(t){var e=new Uint8Array(t),n,r=e.length,i="";for(n=0;n<r;n+=3)i+=gr[e[n]>>2],i+=gr[(e[n]&3)<<4|e[n+1]>>4],i+=gr[(e[n+1]&15)<<2|e[n+2]>>6],i+=gr[e[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const Ud=new Map;function NC(t,e){let n=Ud.get(t);return n||(n=new Map,Ud.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const r_=(t,e,n)=>{if(!t||!(s_(t,e)||typeof t=="object"))return;const r=t.constructor.name,i=NC(n,r);let s=i.indexOf(t);return s===-1&&(s=i.length,i.push(t)),s};function no(t,e,n){if(t instanceof Array)return t.map(r=>no(r,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const r=t.constructor.name,i=LC(t);return{rr_type:r,base64:i}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[no(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const r=t.constructor.name,{src:i}=t;return{rr_type:r,src:i}}else if(t instanceof HTMLCanvasElement){const r="HTMLImageElement",i=t.toDataURL();return{rr_type:r,src:i}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[no(t.data,e,n),t.width,t.height]};if(s_(t,e)||typeof t=="object"){const r=t.constructor.name,i=r_(t,e,n);return{rr_type:r,index:i}}}}return t}const i_=(t,e,n)=>t.map(r=>no(r,e,n)),s_=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>t instanceof e[i]);function PC(t,e,n,r,i){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const u of o)try{if(typeof e.CanvasRenderingContext2D.prototype[u]!="function")continue;const a=Hc(e.CanvasRenderingContext2D.prototype,u,function(c){return function(...l){return ca(this.canvas,n,r,i,!0)||n_(()=>{const d=i_(l,e,this);t(this.canvas,{type:Dr["2D"],property:u,args:d})},0),c.apply(this,l)}});s.push(a)}catch{const c=Bc(e.CanvasRenderingContext2D.prototype,u,{set(l){t(this.canvas,{type:Dr["2D"],property:u,args:[l],setter:!0})}});s.push(c)}return()=>{s.forEach(u=>u())}}function $C(t){return t==="experimental-webgl"?"webgl":t}function Fd(t,e,n,r,i){const s=[];try{const o=Hc(t.HTMLCanvasElement.prototype,"getContext",function(u){return function(a,...c){if(!ca(this,e,n,r,!0)){const l=$C(a);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(c[0]&&typeof c[0]=="object"){const d=c[0];d.preserveDrawingBuffer||(d.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return u.apply(this,[a,...c])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(o=>o())}}function Bd(t,e,n,r,i,s,o,u){const a=[],c=Object.getOwnPropertyNames(t);for(const l of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof t[l]!="function")continue;const d=Hc(t,l,function(f){return function(...h){const p=f.apply(this,h);if(r_(p,u,this),"tagName"in this.canvas&&!ca(this.canvas,r,i,s,!0)){const m=i_(h,u,this),_={type:e,property:l,args:m};n(this.canvas,_)}return p}});a.push(d)}catch{const f=Bc(t,l,{set(h){n(this.canvas,{type:e,property:l,args:[h],setter:!0})}});a.push(f)}return a}function UC(t,e,n,r,i,s){const o=[];return o.push(...Bd(e.WebGLRenderingContext.prototype,Dr.WebGL,t,n,r,i,s,e)),typeof e.WebGL2RenderingContext<"u"&&o.push(...Bd(e.WebGL2RenderingContext.prototype,Dr.WebGL2,t,n,r,i,s,e)),()=>{o.forEach(u=>u())}}var FC='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 BC(){const t=new Blob([FC]);return URL.createObjectURL(t)}class HC{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(d,f)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(d)||this.pendingCanvasMutations.set(d,[]),this.pendingCanvasMutations.get(d).push(f)};const{sampling:n="all",win:r,blockClass:i,blockSelector:s,unblockSelector:o,maxCanvasSize:u,recordCanvas:a,dataURLOptions:c,errorHandler:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,l&&DC(l),!e.enableManualSnapshot&&$d(()=>{a&&n==="all"&&this.initCanvasMutationObserver(r,i,s,o),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,i,s,o,u,{dataURLOptions:c})})()}initCanvasFPSObserver(e,n,r,i,s,o,u){const a=Fd(n,r,i,s,!0),c=this.takeSnapshot(!1,e,n,r,i,s,o,u.dataURLOptions);this.resetObservers=()=>{a(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,n,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Fd(e,n,r,i,!1),o=PC(this.processMutation.bind(this),e,n,r,i),u=UC(this.processMutation.bind(this),e,n,r,i,this.mirror);this.resetObservers=()=>{s(),o(),u()}}snapshot(e){const{options:n}=this,r=this.takeSnapshot(!0,n.sampling==="all"?2:n.sampling||2,n.win,n.blockClass,n.blockSelector,n.unblockSelector,n.maxCanvasSize,n.dataURLOptions,e);this.resetObservers=()=>{cancelAnimationFrame(r)}}takeSnapshot(e,n,r,i,s,o,u,a,c){const l=new Map,d=new Worker(BC());d.onmessage=g=>{const v=g.data,{id:S}=v;if(l.set(S,!1),!("base64"in v))return;const{base64:C,type:R,width:E,height:x}=v;this.mutationCb({id:S,type:Dr["2D"],commands:[{property:"clearRect",args:[0,0,E,x]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:C}],type:R}]},0,0,E,x]}]})};const f=1e3/n;let h=0,p;const m=g=>{if(g)return[g];const v=[];return r.document.querySelectorAll("canvas").forEach(S=>{ca(S,i,s,o)||v.push(S)}),v},_=g=>{if(h&&g-h<f){p=In(_);return}h=g,m(c).forEach(v=>{const S=this.mirror.getId(v);if(!l.get(S)&&!(!v.width||!v.height)){if(l.set(S,!0),!e&&["webgl","webgl2"].includes(v.__context)){const C=v.getContext(v.__context);Zs([C,"optionalAccess",R=>R.getContextAttributes,"call",R=>R(),"optionalAccess",R=>R.preserveDrawingBuffer])===!1&&C.clear(C.COLOR_BUFFER_BIT)}createImageBitmap(v).then(C=>{d.postMessage({id:S,bitmap:C,width:v.width,height:v.height,dataURLOptions:a,maxCanvasSize:u},[C])}).catch(C=>{$d(()=>{throw C})()})}}),p=In(_)};return p=In(_),p}startPendingCanvasMutationFlusher(){In(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,In(e)};In(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),In(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||n===-1)return;const i=r.map(o=>{const{type:u,...a}=o;return a}),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:i}),this.pendingCanvasMutations.delete(e)}}const Hd={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}}},o_="ReplayCanvas",Es=1280,jC=(t={})=>{const[e,n]=t.maxCanvasSize||[],r={quality:t.quality||"medium",enableManualSnapshot:t.enableManualSnapshot,maxCanvasSize:[e?Math.min(e,Es):Es,n?Math.min(n,Es):Es]};let i;const s=new Promise(o=>i=o);return{name:o_,setupOnce(){},getOptions(){const{quality:o,enableManualSnapshot:u,maxCanvasSize:a}=r;return{enableManualSnapshot:u,recordCanvas:!0,getCanvasManager:c=>{const l=new HC({...c,enableManualSnapshot:u,maxCanvasSize:a,errorHandler:d=>{try{typeof d=="object"&&(d.__rrweb__=!0)}catch{}}});return i(l),l},...Hd[o]||Hd.medium}},async snapshot(o){(await s).snapshot(o)}}},a_=jC,GC=Ie(o_,a_),Wn=X,La="#ffffff",jd="inherit",Na="rgba(108, 95, 199, 1)",Gd={fontFamily:"system-ui, 'Helvetica Neue', Arial, sans-serif",fontSize:"14px",background:La,backgroundHover:"#f6f6f7",foreground:"#2b2233",border:"1.5px solid rgba(41, 35, 47, 0.13)",borderRadius:"25px",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",success:"#268d75",error:"#df3338",submitBackground:"rgba(88, 74, 192, 1)",submitBackgroundHover:Na,submitBorder:Na,submitOutlineFocus:"#29232f",submitForeground:La,submitForegroundHover:La,cancelBackground:"transparent",cancelBackgroundHover:"var(--background-hover)",cancelBorder:"var(--border)",cancelOutlineFocus:"var(--input-outline-focus)",cancelForeground:"var(--foreground)",cancelForegroundHover:"var(--foreground)",inputBackground:jd,inputForeground:jd,inputBorder:"var(--border)",inputOutlineFocus:Na,formBorderRadius:"20px",formContentBorderRadius:"6px"},qd={light:Gd,dark:{...Gd,background:"#29232f",backgroundHover:"#352f3b",foreground:"#ebe6ef",border:"1.5px solid rgba(235, 230, 239, 0.15)",success:"#2da98c",error:"#f55459"}},qC="Report a Bug",zC="Cancel",WC="Send Bug Report",VC="Report a Bug",KC="your.email@example.org",YC="Email",XC="What's the bug? What did you expect?",JC="Description",QC="Your Name",ZC="Name",ek="(required)",tk="Thank you for your report!",u_="widget",c_="api";async function nk({client:t,scope:e,event:n}){const r={};t.emit&&t.emit("preprocessEvent",n,r);const i=await ic(t.getOptions(),n,r,e,t,Mt());return i===null?(t.recordDroppedEvent("event_processor","feedback",n),null):(i.platform=i.platform||"javascript",i)}async function rk({feedback:{message:t,email:e,name:n,source:r,url:i}},{includeReplay:s=!0}={}){const o=W(),u=o&&o.getTransport(),a=o&&o.getDsn();if(!o||!u||!a)return;const c={contexts:{feedback:{contact_email:e,name:n,message:t,url:i,source:r}},type:"feedback"};return vn(async l=>{l.clearBreadcrumbs(),[c_,u_].includes(String(r))&&l.setLevel("info");const d=await nk({scope:l,client:o,event:c});if(!d)return;o.emit&&o.emit("beforeSendFeedback",d,{includeReplay:!!s});const f=zp(d,a,o.getOptions()._metadata,o.getOptions().tunnel);let h;try{h=await u.send(f)}catch(p){const m=new Error("Unable to send Feedback");try{m.cause=p}catch{}throw m}if(h){if(typeof h.statusCode=="number"&&(h.statusCode<200||h.statusCode>=300))throw new Error("Unable to send Feedback");return h}})}function l_({name:t,email:e,message:n,source:r=c_,url:i=Yh()},s={}){if(!n)throw new Error("Unable to submit feedback with empty message");return rk({feedback:{name:t,email:e,message:n,url:i,source:r}},s)}const kn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function zd(t,e){return{...t,...e,themeDark:{...t.themeDark,...e.themeDark},themeLight:{...t.themeLight,...e.themeLight}}}function ik(t){const e=t.createElement("style");return e.textContent=` .widget__actor { position: fixed; left: var(--left); right: var(--right); bottom: var(--bottom); top: var(--top); z-index: var(--z-index); line-height: 16px; display: flex; align-items: center; gap: 8px; border-radius: var(--border-radius); cursor: pointer; font-family: inherit; font-size: var(--font-size); font-weight: 600; padding: 16px; text-decoration: none; z-index: 9000; color: var(--foreground); background-color: var(--background); border: var(--border); box-shadow: var(--box-shadow); opacity: 1; transition: opacity 0.1s ease-in-out; } .widget__actor:hover { background-color: var(--background-hover); } .widget__actor svg { width: 16px; height: 16px; } .widget__actor--hidden { opacity: 0; pointer-events: none; visibility: hidden; } .widget__actor__text { } @media (max-width: 600px) { .widget__actor__text { display: none; } } .feedback-icon path { fill: var(--foreground); } `,e}function sk(t){const e=t.createElement("style");return e.textContent=` .dialog { line-height: 25px; background-color: rgba(0, 0, 0, 0.05); border: none; position: fixed; inset: 0; z-index: 10000; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; opacity: 1; transition: opacity 0.2s ease-in-out; } .dialog:not([open]) { opacity: 0; pointer-events: none; visibility: hidden; } .dialog:not([open]) .dialog__content { transform: translate(0, -16px) scale(0.98); } .dialog__content { position: fixed; left: var(--left); right: var(--right); bottom: var(--bottom); top: var(--top); border: var(--border); border-radius: var(--form-border-radius); background-color: var(--background); color: var(--foreground); width: 320px; max-width: 100%; max-height: calc(100% - 2rem); display: flex; flex-direction: column; box-shadow: var(--box-shadow); transition: transform 0.2s ease-in-out; transform: translate(0, 0) scale(1); } .dialog__header { display: flex; align-items: center; justify-content: space-between; font-size: 20px; font-weight: 600; padding: 24px 24px 0 24px; margin: 0; margin-bottom: 16px; } .brand-link { display: inline-flex; } .error { color: var(--error); margin-bottom: 16px; } .form { display: grid; overflow: auto; flex-direction: column; gap: 16px; padding: 0 24px 24px; } .form__error-container { color: var(--error); } .form__error-container--hidden { display: none; } .form__label { display: flex; flex-direction: column; gap: 4px; margin: 0px; } .form__label__text { display: grid; gap: 4px; align-items: center; grid-auto-flow: column; grid-auto-columns: max-content; } .form__label__text--required { font-size: 0.85em; } .form__input { line-height: inherit; background-color: var(--input-background); box-sizing: border-box; border: var(--input-border); border-radius: var(--form-content-border-radius); color: var(--input-foreground); font-family: inherit; font-size: var(--font-size); font-weight: 500; padding: 6px 12px; } .form__input::placeholder { color: var(--input-foreground); opacity: 0.65; } .form__input:focus-visible { outline: 1px auto var(--input-outline-focus); } .form__input--textarea { font-family: inherit; resize: vertical; } .btn-group { display: grid; gap: 8px; margin-top: 8px; } .btn { line-height: inherit; border: var(--cancel-border); border-radius: var(--form-content-border-radius); cursor: pointer; font-family: inherit; font-size: var(--font-size); font-weight: 600; padding: 6px 16px; } .btn[disabled] { opacity: 0.6; pointer-events: none; } .btn--primary { background-color: var(--submit-background); border-color: var(--submit-border); color: var(--submit-foreground); } .btn--primary:hover { background-color: var(--submit-background-hover); color: var(--submit-foreground-hover); } .btn--primary:focus-visible { outline: 1px auto var(--submit-outline-focus); } .btn--default { background-color: var(--cancel-background); color: var(--cancel-foreground); font-weight: 500; } .btn--default:hover { background-color: var(--cancel-background-hover); color: var(--cancel-foreground-hover); } .btn--default:focus-visible { outline: 1px auto var(--cancel-outline-focus); } .success-message { background-color: var(--background); border: var(--border); border-radius: var(--border-radius); box-shadow: var(--box-shadow); font-weight: 600; color: var(--success); padding: 12px 24px; line-height: 25px; display: grid; align-items: center; grid-auto-flow: column; gap: 6px; cursor: default; } .success-icon path { fill: var(--success); } `,e}function Wd(t){return` --background: ${t.background}; --background-hover: ${t.backgroundHover}; --foreground: ${t.foreground}; --error: ${t.error}; --success: ${t.success}; --border: ${t.border}; --border-radius: ${t.borderRadius}; --box-shadow: ${t.boxShadow}; --submit-background: ${t.submitBackground}; --submit-background-hover: ${t.submitBackgroundHover}; --submit-border: ${t.submitBorder}; --submit-outline-focus: ${t.submitOutlineFocus}; --submit-foreground: ${t.submitForeground}; --submit-foreground-hover: ${t.submitForegroundHover}; --cancel-background: ${t.cancelBackground}; --cancel-background-hover: ${t.cancelBackgroundHover}; --cancel-border: ${t.cancelBorder}; --cancel-outline-focus: ${t.cancelOutlineFocus}; --cancel-foreground: ${t.cancelForeground}; --cancel-foreground-hover: ${t.cancelForegroundHover}; --input-background: ${t.inputBackground}; --input-foreground: ${t.inputForeground}; --input-border: ${t.inputBorder}; --input-outline-focus: ${t.inputOutlineFocus}; --form-border-radius: ${t.formBorderRadius}; --form-content-border-radius: ${t.formContentBorderRadius}; `}function ok(t,e,n){const r=t.createElement("style");return r.textContent=` :host { --bottom: 1rem; --right: 1rem; --top: auto; --left: auto; --z-index: 100000; --font-family: ${n.light.fontFamily}; --font-size: ${n.light.fontSize}; position: fixed; left: var(--left); right: var(--right); bottom: var(--bottom); top: var(--top); z-index: var(--z-index); font-family: var(--font-family); font-size: var(--font-size); ${Wd(e==="dark"?n.dark:n.light)} } ${e==="system"?` @media (prefers-color-scheme: dark) { :host { ${Wd(n.dark)} } }`:""} }`,r}function ak({id:t,colorScheme:e,themeDark:n,themeLight:r}){try{const i=Wn.document,s=i.createElement("div");s.id=t;const o=s.attachShadow({mode:"open"});return o.appendChild(ok(i,e,{dark:n,light:r})),o.appendChild(sk(i)),{shadow:o,host:s}}catch{throw O.warn("[Feedback] Browser does not support shadow DOM API"),new Error("Browser does not support shadow DOM API.")}}async function uk(t,e,n){if(!t)return;const r=()=>{t&&t.showError("There was a problem submitting feedback, please wait and try again.")};t.hideError();try{return await l_({...e,source:u_},n)}catch(i){kn&&O.error(i),r()}}function et(t,e){return Object.entries(e).forEach(([n,r])=>{t.setAttributeNS(null,n,r)}),t}const er=20,ck="http://www.w3.org/2000/svg";function lk(){const t=u=>Wn.document.createElementNS(ck,u),e=et(t("svg"),{class:"feedback-icon",width:`${er}`,height:`${er}`,viewBox:`0 0 ${er} ${er}`,fill:"none"}),n=et(t("g"),{clipPath:"url(#clip0_57_80)"}),r=et(t("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"});e.appendChild(n).appendChild(r);const i=t("defs"),s=et(t("clipPath"),{id:"clip0_57_80"}),o=et(t("rect"),{width:`${er}`,height:`${er}`,fill:"white"});return s.appendChild(o),i.appendChild(s),e.appendChild(i).appendChild(s).appendChild(o),{get el(){return e}}}function _e(t,e,...n){const i=Wn.document.createElement(t);e&&Object.entries(e).forEach(([s,o])=>{s==="className"&&typeof o=="string"?i.setAttribute("class",o):typeof o=="boolean"&&o?i.setAttribute(s,""):typeof o=="string"?i.setAttribute(s,o):s.startsWith("on")&&typeof o=="function"&&i.addEventListener(s.substring(2).toLowerCase(),o)});for(const s of n)d_(i,s);return i}function d_(t,e){const n=Wn.document;if(!(typeof e>"u"||e===null))if(Array.isArray(e))for(const r of e)d_(t,r);else e===!1||(typeof e=="string"?t.appendChild(n.createTextNode(e)):e instanceof Node?t.appendChild(e):t.appendChild(n.createTextNode(String(e))))}function dk({buttonLabel:t,onClick:e}){function n(i){e&&e(i)}const r=_e("button",{type:"button",className:"widget__actor","aria-label":t,"aria-hidden":"false"},lk().el,t?_e("span",{className:"widget__actor__text"},t):null);return r.addEventListener("click",n),{get el(){return r},show:()=>{r.classList.remove("widget__actor--hidden"),r.setAttribute("aria-hidden","false")},hide:()=>{r.classList.add("widget__actor--hidden"),r.setAttribute("aria-hidden","true")}}}function fk({label:t}){return{el:_e("button",{type:"submit",className:"btn btn--primary","aria-label":t},t)}}function Pa(t,e){const n=t.get(e);return typeof n=="string"?n.trim():""}function hk({nameLabel:t,namePlaceholder:e,emailLabel:n,emailPlaceholder:r,messageLabel:i,messagePlaceholder:s,isRequiredLabel:o,cancelButtonLabel:u,submitButtonLabel:a,showName:c,showEmail:l,isNameRequired:d,isEmailRequired:f,defaultName:h,defaultEmail:p,onCancel:m,onSubmit:_}){const{el:g}=fk({label:a});function v(I){if(I.preventDefault(),I.target instanceof HTMLFormElement)try{if(_){const k=new FormData(I.target),w={name:Pa(k,"name"),email:Pa(k,"email"),message:Pa(k,"message")};_(w)}}catch{}}const S=_e("div",{className:"form__error-container form__error-container--hidden","aria-hidden":"true"});function C(I){S.textContent=I,S.classList.remove("form__error-container--hidden"),S.setAttribute("aria-hidden","false")}function R(){S.textContent="",S.classList.add("form__error-container--hidden"),S.setAttribute("aria-hidden","true")}const E=_e("input",{id:"name",type:c?"text":"hidden","aria-hidden":c?"false":"true",name:"name",required:d,className:"form__input",placeholder:e,value:h}),x=_e("input",{id:"email",type:l?"text":"hidden","aria-hidden":l?"false":"true",name:"email",required:f,className:"form__input",placeholder:r,value:p}),T=_e("textarea",{id:"message",autoFocus:"true",rows:"5",name:"message",required:!0,className:"form__input form__input--textarea",placeholder:s}),y=_e("button",{type:"button",className:"btn btn--default","aria-label":u,onClick:I=>{m&&m(I)}},u),b=_e("form",{className:"form",onSubmit:v},[S,c&&_e("label",{htmlFor:"name",className:"form__label"},[_e("span",{className:"form__label__text"},t,d&&_e("span",{className:"form__label__text--required"},` ${o}`)),E]),!c&&E,l&&_e("label",{htmlFor:"email",className:"form__label"},[_e("span",{className:"form__label__text"},n,f&&_e("span",{className:"form__label__text--required"},` ${o}`)),x]),!l&&x,_e("label",{htmlFor:"message",className:"form__label"},[_e("span",{className:"form__label__text"},i,_e("span",{className:"form__label__text--required"},` ${o}`)),T]),_e("div",{className:"btn-group"},[g,y])]);return{get el(){return b},showError:C,hideError:R}}const pk="http://www.w3.org/2000/svg";function gk({colorScheme:t}){const e=o=>Wn.document.createElementNS(pk,o),n=et(e("svg"),{class:"sentry-logo",width:"32",height:"30",viewBox:"0 0 72 66",fill:"none"}),r=et(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"});n.append(r);const i=e("defs"),s=e("style");return s.textContent=` path { fill: ${t==="dark"?"#fff":"#362d59"}; }`,t==="system"&&(s.textContent+=` @media (prefers-color-scheme: dark) { path: { fill: '#fff'; } } `),i.append(s),n.append(i),{get el(){return n}}}function mk({formTitle:t,showBranding:e,showName:n,showEmail:r,isNameRequired:i,isEmailRequired:s,colorScheme:o,defaultName:u,defaultEmail:a,onClosed:c,onCancel:l,onSubmit:d,...f}){let h=null;function p(){m(),c&&c()}function m(){h&&(h.open=!1)}function _(){h&&(h.open=!0)}function g(){return h&&h.open===!0||!1}const{el:v,showError:S,hideError:C}=hk({showEmail:r,showName:n,isEmailRequired:s,isNameRequired:i,defaultName:u,defaultEmail:a,onSubmit:d,onCancel:l,...f});return h=_e("dialog",{className:"dialog",open:!0,onClick:p},_e("div",{className:"dialog__content",onClick:R=>{R.stopPropagation()}},_e("h2",{className:"dialog__header"},t,e&&_e("a",{className:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer"},gk({colorScheme:o}).el)),v)),{get el(){return h},showError:S,hideError:C,open:_,close:m,checkIsOpen:g}}const Ts=16,Vd=17,_k="http://www.w3.org/2000/svg";function vk(){const t=a=>Wn.document.createElementNS(_k,a),e=et(t("svg"),{class:"success-icon",width:`${Ts}`,height:`${Vd}`,viewBox:`0 0 ${Ts} ${Vd}`,fill:"none"}),n=et(t("g"),{clipPath:"url(#clip0_57_156)"}),r=et(t("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),i=et(t("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"});e.appendChild(n).append(i,r);const s=t("defs"),o=et(t("clipPath"),{id:"clip0_57_156"}),u=et(t("rect"),{width:`${Ts}`,height:`${Ts}`,fill:"white",transform:"translate(0 0.5)"});return o.appendChild(u),s.appendChild(o),e.appendChild(s).appendChild(o).appendChild(u),{get el(){return e}}}function yk({message:t,onRemove:e}){function n(){r&&(r.remove(),e&&e())}const r=_e("div",{className:"success-message",onClick:n},vk().el,t);return{el:r,remove:n}}function Kd({shadow:t,options:{shouldCreateActor:e=!0,...n},attachTo:r}){let i,s,o=!1;function u(){if(t)try{const g=yk({message:n.successMessageText,onRemove:()=>{v&&clearTimeout(v),l()}});if(!g.el)throw new Error("Unable to show success message");t.appendChild(g.el);const v=setTimeout(()=>{g&&g.remove()},5e3)}catch(g){O.error(g)}}async function a(g){if(!s)return;const v=[];if(n.isNameRequired&&!g.name&&v.push(n.nameLabel),n.isEmailRequired&&!g.email&&v.push(n.emailLabel),g.message||v.push(n.messageLabel),v.length>0){s.showError(`Please enter in the following required fields: ${v.join(", ")}`);return}if(!await uk(s,g)){n.onSubmitError&&n.onSubmitError();return}m(),u(),n.onSubmitSuccess&&n.onSubmitSuccess()}function c(){const g=W(),v=g&&g.getIntegrationByName&&g.getIntegrationByName("Replay");v&&v.flush().catch(S=>{kn&&O.error(S)})}function l(){i&&i.show()}function d(){i&&i.hide()}function f(){i&&i.el&&i.el.remove()}function h(){try{if(s){s.open(),o=!0,n.onFormOpen&&n.onFormOpen(),c();return}const g=n.useSentryUser,v=we(),S=v&&v.getUser();if(s=mk({colorScheme:n.colorScheme,showBranding:n.showBranding,showName:n.showName||n.isNameRequired,showEmail:n.showEmail||n.isEmailRequired,isNameRequired:n.isNameRequired,isEmailRequired:n.isEmailRequired,formTitle:n.formTitle,cancelButtonLabel:n.cancelButtonLabel,submitButtonLabel:n.submitButtonLabel,emailLabel:n.emailLabel,emailPlaceholder:n.emailPlaceholder,messageLabel:n.messageLabel,messagePlaceholder:n.messagePlaceholder,nameLabel:n.nameLabel,namePlaceholder:n.namePlaceholder,isRequiredLabel:n.isRequiredLabel,defaultName:g&&S&&S[g.name]||"",defaultEmail:g&&S&&S[g.email]||"",onClosed:()=>{l(),o=!1,n.onFormClose&&n.onFormClose()},onCancel:()=>{p(),l()},onSubmit:a}),!s.el)throw new Error("Unable to open Feedback dialog");t.appendChild(s.el),d(),n.onFormOpen&&n.onFormOpen(),c()}catch(g){O.error(g)}}function p(){s&&(s.close(),o=!1,n.onFormClose&&n.onFormClose())}function m(){if(s){p();const g=s.el;g&&g.remove(),s=void 0}}function _(){o||h(),d()}return r?r.addEventListener("click",_):e&&(i=dk({buttonLabel:n.buttonLabel,onClick:_}),i.el&&t.appendChild(i.el)),{get actor(){return i},get dialog(){return s},showActor:l,hideActor:d,removeActor:f,openDialog:h,closeDialog:p,removeDialog:m}}const Is=Wn.document,Sk=t=>new Ki(t);class Ki{static __initStatic(){this.id="Feedback"}constructor({autoInject:e=!0,id:n="sentry-feedback",isEmailRequired:r=!1,isNameRequired:i=!1,showBranding:s=!0,showEmail:o=!0,showName:u=!0,useSentryUser:a={email:"email",name:"username"},themeDark:c,themeLight:l,colorScheme:d="system",buttonLabel:f=qC,cancelButtonLabel:h=zC,submitButtonLabel:p=WC,formTitle:m=VC,emailPlaceholder:_=KC,emailLabel:g=YC,messagePlaceholder:v=XC,messageLabel:S=JC,namePlaceholder:C=QC,nameLabel:R=ZC,isRequiredLabel:E=ek,successMessageText:x=tk,onFormClose:T,onFormOpen:y,onSubmitError:b,onSubmitSuccess:I}={}){this.name=Ki.id,this._host=null,this._shadow=null,this._widget=null,this._widgets=new Set,this._hasInsertedActorStyles=!1,this.options={autoInject:e,showBranding:s,id:n,isEmailRequired:r,isNameRequired:i,showEmail:o,showName:u,useSentryUser:a,colorScheme:d,themeDark:{...qd.dark,...c},themeLight:{...qd.light,...l},buttonLabel:f,cancelButtonLabel:h,submitButtonLabel:p,formTitle:m,emailLabel:g,emailPlaceholder:_,messageLabel:S,messagePlaceholder:v,nameLabel:R,namePlaceholder:C,isRequiredLabel:E,successMessageText:x,onFormClose:T,onFormOpen:y,onSubmitError:b,onSubmitSuccess:I}}setupOnce(){if(iu())try{this._cleanupWidgetIfExists();const{autoInject:e}=this.options;if(!e)return;this._createWidget(this.options)}catch(e){kn&&O.error(e)}}openDialog(){this._widget||this._createWidget({...this.options,shouldCreateActor:!1}),this._widget&&this._widget.openDialog()}closeDialog(){this._widget&&this._widget.closeDialog()}attachTo(e,n){try{const r=zd(this.options,n||{});return this._ensureShadowHost(r,({shadow:i})=>{const s=typeof e=="string"?Is.querySelector(e):typeof e.addEventListener=="function"?e:null;if(!s)return kn&&O.error("[Feedback] Unable to attach to target element"),null;const o=Kd({shadow:i,options:r,attachTo:s});return this._widgets.add(o),this._widget||(this._widget=o),o})}catch(r){return kn&&O.error(r),null}}createWidget(e){try{return this._createWidget(zd(this.options,e||{}))}catch(n){return kn&&O.error(n),null}}removeWidget(e){if(!e)return!1;try{if(this._widgets.has(e))return e.removeActor(),e.removeDialog(),this._widgets.delete(e),this._widget===e&&(this._widget=null),!0}catch(n){kn&&O.error(n)}return!1}getWidget(){return this._widget}remove(){this._host&&this._host.remove(),this._initialize()}_initialize(){this._host=null,this._shadow=null,this._widget=null,this._widgets=new Set,this._hasInsertedActorStyles=!1}_cleanupWidgetIfExists(){this._host&&this.remove();const e=Is.querySelector(`#${this.options.id}`);e&&e.remove()}_createWidget(e){return this._ensureShadowHost(e,({shadow:n})=>{const r=Kd({shadow:n,options:e});return!this._hasInsertedActorStyles&&r.actor&&(n.appendChild(ik(Is)),this._hasInsertedActorStyles=!0),this._widgets.add(r),this._widget||(this._widget=r),r})}_ensureShadowHost(e,n){let r=!1;if(!this._shadow||!this._host){const{id:s,colorScheme:o,themeLight:u,themeDark:a}=e,{shadow:c,host:l}=ak({id:s,colorScheme:o,themeLight:u,themeDark:a});this._shadow=c,this._host=l,r=!0}this._host.dataset.sentryFeedbackColorscheme=e.colorScheme;const i=n({shadow:this._shadow,host:this._host});return r&&Is.body.appendChild(this._host),i}}Ki.__initStatic();const f_="CaptureConsole",bk=(t={})=>{const e=t.levels||co;return{name:f_,setupOnce(){},setup(n){"console"in X&&sp(({args:r,level:i})=>{W()!==n||!e.includes(i)||Ek(r,i)})}}},h_=bk;Ie(f_,h_);function Ek(t,e){const n={level:pp(e),extra:{arguments:t}};vn(r=>{if(r.addEventProcessor(o=>(o.logger="console",$n(o,{handled:!1,type:"console"}),o)),e==="assert"&&t[0]===!1){const o=`Assertion failed: ${uo(t.slice(1)," ")||"console.assert"}`;r.setExtra("arguments",t.slice(1)),po(o,n);return}const i=t.find(o=>o instanceof Error);if(e==="error"&&i){$i(i,n);return}const s=uo(t," ");po(s,n)})}const p_="Debug",Tk=(t={})=>{const e={debugger:!1,stringify:!1,...t};return{name:p_,setupOnce(){},setup(n){n.on&&n.on("beforeSendEvent",(r,i)=>{if(e.debugger)debugger;gn(()=>{e.stringify?(console.log(JSON.stringify(r,null,2)),i&&Object.keys(i).length&&console.log(JSON.stringify(i,null,2))):(console.log(r),i&&Object.keys(i).length&&console.log(i))})})}}},g_=Tk;Ie(p_,g_);const Mr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,m_="Dedupe",Ik=()=>{let t;return{name:m_,setupOnce(){},processEvent(e){if(e.type)return e;try{if(wk(e,t))return Mr&&O.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},__=Ik;Ie(m_,__);function wk(t,e){return e?!!(Ck(t,e)||kk(t,e)):!1}function Ck(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!y_(t,e)||!v_(t,e))}function kk(t,e){const n=Yd(e),r=Yd(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!y_(t,e)||!v_(t,e))}function v_(t,e){let n=Xd(t),r=Xd(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){const s=r[i],o=n[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function y_(t,e){let n=t.fingerprint,r=e.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 Yd(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Xd(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const S_="ExtraErrorData",Rk=(t={})=>{const e=t.depth||3,n=t.captureErrorCause||!1;return{name:S_,setupOnce(){},processEvent(r,i){return xk(r,i,e,n)}}},b_=Rk;Ie(S_,b_);function xk(t,e={},n,r){if(!e.originalException||!vr(e.originalException))return t;const i=e.originalException.name||e.originalException.constructor.name,s=Ok(e.originalException,r);if(s){const o={...t.contexts},u=ht(s,n);return Pn(u)&&(mn(u,"__sentry_skip_normalization__",!0),o[i]=u),{...t,contexts:o}}return t}function Ok(t,e){try{const n=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],r={};for(const i of Object.keys(t)){if(n.indexOf(i)!==-1)continue;const s=t[i];r[i]=vr(s)?s.toString():s}if(e&&t.cause!==void 0&&(r.cause=vr(t.cause)?t.cause.toString():t.cause),typeof t.toJSON=="function"){const i=t.toJSON();for(const s of Object.keys(i)){const o=i[s];r[s]=vr(o)?o.toString():o}}return r}catch(n){Mr&&O.error("Unable to extract extra data from the Error object:",n)}return null}function CM(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const Ak=X,E_="ReportingObserver",Jd=new WeakMap,Dk=(t={})=>{const e=t.types||["crash","deprecation","intervention"];function n(r){if(Jd.has(W()))for(const i of r)vn(s=>{s.setExtra("url",i.url);const o=`ReportingObserver [${i.type}]`;let u="No details available";if(i.body){const a={};for(const c in i.body)a[c]=i.body[c];if(s.setExtra("body",a),i.type==="crash"){const c=i.body;u=[c.crashId||"",c.reason||""].join(" ").trim()||u}else u=i.body.message||u}po(`${o}: ${u}`)})}return{name:E_,setupOnce(){if(!ky())return;new Ak.ReportingObserver(n,{buffered:!0,types:e}).observe()},setup(r){Jd.set(r,!0)}}},T_=Dk;Ie(E_,T_);const I_="RewriteFrames",Mk=(t={})=>{const e=t.root,n=t.prefix||"app:///",r=t.iteratee||(o=>{if(!o.filename)return o;const u=/^[a-zA-Z]:\\/.test(o.filename)||o.filename.includes("\\")&&!o.filename.includes("/"),a=/^\//.test(o.filename);if(u||a){const c=u?o.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):o.filename,l=e?Yy(e,c):Xy(c);o.filename=`${n}${l}`}return o});function i(o){try{return{...o,exception:{...o.exception,values:o.exception.values.map(u=>({...u,...u.stacktrace&&{stacktrace:s(u.stacktrace)}}))}}}catch{return o}}function s(o){return{...o,frames:o&&o.frames&&o.frames.map(u=>r(u))}}return{name:I_,setupOnce(){},processEvent(o){let u=o;return o.exception&&Array.isArray(o.exception.values)&&(u=i(u)),u}}},w_=Mk;Ie(I_,w_);const C_="SessionTiming",Lk=()=>{const t=Date.now();return{name:C_,setupOnce(){},processEvent(e){const n=Date.now();return{...e,extra:{...e.extra,"session:start":t,"session:duration":n-t,"session:end":n}}}}},k_=Lk;Ie(C_,k_);const R_="HttpClient",Nk=(t={})=>{const e={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...t};return{name:R_,setupOnce(){},setup(n){Gk(n,e),qk(n,e)}}},x_=Nk;Ie(R_,x_);function Pk(t,e,n,r){if(A_(t,n.status,n.url)){const i=zk(e,r);let s,o,u,a;M_()&&([{headers:s,cookies:u},{headers:o,cookies:a}]=[{cookieHeader:"Cookie",obj:i},{cookieHeader:"Set-Cookie",obj:n}].map(({cookieHeader:l,obj:d})=>{const f=Fk(d.headers);let h;try{const p=f[l]||f[l.toLowerCase()]||void 0;p&&(h=O_(p))}catch{Mr&&O.log(`Could not extract cookies from header ${l}`)}return{headers:f,cookies:h}}));const c=D_({url:i.url,method:i.method,status:n.status,requestHeaders:s,responseHeaders:o,requestCookies:u,responseCookies:a});Ui(c)}}function $k(t,e,n,r){if(A_(t,e.status,e.responseURL)){let i,s,o;if(M_()){try{const a=e.getResponseHeader("Set-Cookie")||e.getResponseHeader("set-cookie")||void 0;a&&(s=O_(a))}catch{Mr&&O.log("Could not extract cookies from response headers")}try{o=Bk(e)}catch{Mr&&O.log("Could not extract headers from response")}i=r}const u=D_({url:e.responseURL,method:n,status:e.status,requestHeaders:i,responseHeaders:o,responseCookies:s});Ui(u)}}function Uk(t){if(t){const e=t["Content-Length"]||t["content-length"];if(e)return parseInt(e,10)}}function O_(t){return t.split("; ").reduce((e,n)=>{const[r,i]=n.split("=");return e[r]=i,e},{})}function Fk(t){const e={};return t.forEach((n,r)=>{e[r]=n}),e}function Bk(t){const e=t.getAllResponseHeaders();return e?e.split(`\r `).reduce((n,r)=>{const[i,s]=r.split(": ");return n[i]=s,n},{}):{}}function Hk(t,e){return t.some(n=>typeof n=="string"?e.includes(n):n.test(e))}function jk(t,e){return t.some(n=>typeof n=="number"?n===e:e>=n[0]&&e<=n[1])}function Gk(t,e){lp()&&Vo(n=>{if(W()!==t)return;const{response:r,args:i}=n,[s,o]=i;r&&Pk(e,s,r,o)})}function qk(t,e){"XMLHttpRequest"in X&&Ko(n=>{if(W()!==t)return;const r=n.xhr,i=r[Wt];if(!i)return;const{method:s,request_headers:o}=i;try{$k(e,r,s,o)}catch(u){Mr&&O.warn("Error while extracting response event form XHR response",u)}})}function A_(t,e,n){return jk(t.failedRequestStatusCodes,e)&&Hk(t.failedRequestTargets,n)&&!rg(n,W())}function D_(t){const e=`HTTP Client Error with status code: ${t.status}`,n={message:e,exception:{values:[{type:"Error",value:e}]},request:{url:t.url,method:t.method,headers:t.requestHeaders,cookies:t.requestCookies},contexts:{response:{status_code:t.status,headers:t.responseHeaders,cookies:t.responseCookies,body_size:Uk(t.responseHeaders)}}};return $n(n,{type:"http.client",handled:!1}),n}function zk(t,e){return!e&&t instanceof Request||t instanceof Request&&t.bodyUsed?t:new Request(t,e)}function M_(){const t=W();return t?!!t.getOptions().sendDefaultPii:!1}const $a=X,Wk=7,L_="ContextLines",Vk=(t={})=>{const e=t.frameContextLines!=null?t.frameContextLines:Wk;return{name:L_,setupOnce(){},processEvent(n){return Kk(n,e)}}},N_=Vk;Ie(L_,N_);function Kk(t,e){const n=$a.document,r=$a.location&&Qy($a.location.href);if(!n||!r)return t;const i=t.exception&&t.exception.values;if(!i||!i.length)return t;const s=n.documentElement.innerHTML;if(!s)return t;const o=["<!DOCTYPE html>","<html>",...s.split(` `),"</html>"];return i.forEach(u=>{const a=u.stacktrace;a&&a.frames&&(a.frames=a.frames.map(c=>Yk(c,o,r,e)))}),t}function Yk(t,e,n,r){return t.filename!==n||!t.lineno||!e.length||by(e,t,r),t}function Oi(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Xk(t,e){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);const r=Oi(n);return i=>r.then(s=>i(s.transaction(e,"readwrite").objectStore(e)))}function P_(t){return Oi(t.getAllKeys())}function Jk(t,e,n){return t(r=>P_(r).then(i=>{if(!(i.length>=n))return r.put(e,Math.max(...i,0)+1),Oi(r.transaction)}))}function Qk(t){return t(e=>P_(e).then(n=>{if(n.length!==0)return Oi(e.get(n[0])).then(r=>(e.delete(n[0]),Oi(e.transaction).then(()=>r)))}))}function Zk(t){let e;function n(){return e==null&&(e=Xk(t.dbName||"sentry-offline",t.storeName||"queue")),e}return{insert:async r=>{try{const i=await Sp(r,t.textEncoder);await Jk(n(),i,t.maxQueueSize||30)}catch{}},pop:async()=>{try{const r=await Qk(n());if(r)return c0(r,t.textEncoder||new TextEncoder,t.textDecoder||new TextDecoder)}catch{}}}}function eR(t){return e=>t({...e,createStore:Zk})}function tR(t){return eR(ZS(t))}const Qd=1e6,ro=String(0),nR="main";let $_="",U_="",F_="",ku=z.navigator&&z.navigator.userAgent||"",B_="";const rR=z.navigator&&z.navigator.language||z.navigator&&z.navigator.languages&&z.navigator.languages[0]||"";function iR(t){return typeof t=="object"&&t!==null&&"getHighEntropyValues"in t}const Zd=z.navigator&&z.navigator.userAgentData;iR(Zd)&&Zd.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(t=>{if($_=t.platform||"",F_=t.architecture||"",B_=t.model||"",U_=t.platformVersion||"",t.fullVersionList&&t.fullVersionList.length>0){const e=t.fullVersionList[t.fullVersionList.length-1];ku=`${e.brand} ${e.version}`}}).catch(t=>{});function sR(t){return!("thread_metadata"in t)}function oR(t){return sR(t)?cR(t):t}function aR(t){const e=t&&t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id;return typeof e=="string"&&e.length!==32&&oe&&O.log(`[Profiling] Invalid traceId: ${e} on profiled event`),typeof e!="string"?"":e}function uR(t,e,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 i=aR(r),s=oR(n),o=e||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:Date.now()),u=typeof r.timestamp=="number"?r.timestamp*1e3:Date.now();return{event_id:t,timestamp:new Date(o).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Pi,runtime:{name:"javascript",version:z.navigator.userAgent},os:{name:$_,version:U_,build_number:ku},device:{locale:rR,model:B_,manufacturer:ku,architecture:F_,is_emulator:!1},debug_meta:{images:fR(n.resources)},profile:s,transactions:[{name:r.transaction||"",id:r.event_id||ue(),trace_id:i,active_thread_id:ro,relative_start_ns:"0",relative_end_ns:((u-o)*1e6).toFixed(0)}]}}function H_(t){return t.op==="pageload"}function cR(t){let e,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[ro]:{name:nR}}};if(!t.samples.length)return r;const i=t.samples[0].timestamp,s=typeof performance.timeOrigin=="number"?performance.timeOrigin:qe||0,o=s-(qe||s);for(let u=0;u<t.samples.length;u++){const a=t.samples[u];if(a.stackId===void 0){e===void 0&&(e=n,r.stacks[e]=[],n++),r.samples[u]={elapsed_since_start_ns:((a.timestamp+o-i)*Qd).toFixed(0),stack_id:e,thread_id:ro};continue}let c=t.stacks[a.stackId];const l=[];for(;c;){l.push(c.frameId);const f=t.frames[c.frameId];r.frames[c.frameId]===void 0&&(r.frames[c.frameId]={function:f.name,abs_path:typeof f.resourceId=="number"?t.resources[f.resourceId]:void 0,lineno:f.line,colno:f.column}),c=c.parentId===void 0?void 0:t.stacks[c.parentId]}const d={elapsed_since_start_ns:((a.timestamp+o-i)*Qd).toFixed(0),stack_id:n,thread_id:ro};r.stacks[n]=l,r.samples[u]=d,n++}return r}function lR(t,e){if(!e.length)return t;for(const n of e)t[1].push([{type:"profile"},n]);return t}function dR(t){const e=[];return wr(t,(n,r)=>{if(r==="transaction")for(let i=1;i<n.length;i++){const s=n[i];s&&s.contexts&&s.contexts.profile&&s.contexts.profile.profile_id&&e.push(n[i])}}),e}const ef=new WeakMap;function fR(t){const e=X._sentryDebugIds;if(!e)return[];const n=W(),r=n&&n.getOptions(),i=r&&r.stackParser;if(!i)return[];let s;const o=ef.get(i);o?s=o:(s=new Map,ef.set(i,s));const u=Object.keys(e).reduce((c,l)=>{let d;const f=s.get(l);f?d=f:(d=i(l),s.set(l,d));for(let h=d.length-1;h>=0;h--){const p=d[h],m=p&&p.filename;if(p&&m){c[m]=e[l];break}}return c},{}),a=[];for(const c of t)c&&u[c]&&a.push({type:"sourcemap",code_file:c,debug_id:u[c]});return a}function hR(t){return typeof t!="number"&&typeof t!="boolean"||typeof t=="number"&&isNaN(t)?(oe&&O.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t===!0||t===!1?!0:t<0||t>1?(oe&&O.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function pR(t){return t.samples.length<2?(oe&&O.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):t.frames.length?!0:(oe&&O.log("[Profiling] Discarding profile because it contains no frames"),!1)}let j_=!1;const G_=3e4;function gR(t){return typeof t=="function"}function mR(){const t=z.Profiler;if(!gR(t)){oe&&O.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const e=10,n=Math.floor(G_/e);try{return new t({sampleInterval:e,maxBufferSize:n})}catch{oe&&(O.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),O.log("[Profiling] Disabling profiling for current user session.")),j_=!0}}function Ru(t){if(j_)return oe&&O.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!t.isRecording())return oe&&O.log("[Profiling] Discarding profile because transaction was not sampled."),!1;const e=W(),n=e&&e.getOptions();if(!n)return oe&&O.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return hR(r)?r?(r===!0?!0:Math.random()<r)?!0:(oe&&O.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(oe&&O.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(oe&&O.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function _R(t,e,n,r){return pR(n)?uR(t,e,n,r):null}const Dn=new Map;function vR(){return Dn.size}function yR(t){const e=Dn.get(t);return e&&Dn.delete(t),e}function SR(t,e){if(Dn.set(t,e),Dn.size>30){const n=Dn.keys().next().value;Dn.delete(n)}}function bR(t){return t?Ru(t)?xu(t):t:(oe&&O.log("[Profiling] Transaction is undefined, skipping profiling"),t)}function xu(t){let e;H_(t)&&(e=Jt()*1e3);const n=mR();if(!n)return t;oe&&O.log(`[Profiling] started profiling transaction: ${ce(t).description}`);const r=ue();async function i(){return!t||!n?null:n.stop().then(a=>(s&&(z.clearTimeout(s),s=void 0),oe&&O.log(`[Profiling] stopped profiling of transaction: ${ce(t).description}`),a?(SR(r,a),null):(oe&&O.log(`[Profiling] profiler returned null profile for: ${ce(t).description}`,"this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started"),null))).catch(a=>(oe&&O.log("[Profiling] error while stopping profiler:",a),null))}let s=z.setTimeout(()=>{oe&&O.log("[Profiling] max profile duration elapsed, stopping profiling for:",ce(t).description),i()},G_);const o=t.end.bind(t);function u(){return t?(i().then(()=>{t.setContext("profile",{profile_id:r,start_timestamp:e}),o()},()=>{o()}),t):o()}return t.end=u,t}const q_="BrowserProfiling",ER=()=>({name:q_,setupOnce(){},setup(t){const n=we().getTransaction();if(n&&H_(n)&&Ru(n)&&xu(n),typeof t.on!="function"){O.warn("[Profiling] Client does not support hooks, profiling will be disabled");return}t.on("startTransaction",r=>{Ru(r)&&xu(r)}),t.on("beforeEnvelope",r=>{if(!vR())return;const i=dR(r);if(!i.length)return;const s=[];for(const o of i){const u=o&&o.contexts,a=u&&u.profile&&u.profile.profile_id,c=u&&u.profile&&u.profile.start_timestamp;if(typeof a!="string"){oe&&O.log("[Profiling] cannot find profile for a transaction without a profile context");continue}if(!a){oe&&O.log("[Profiling] cannot find profile for a transaction without a profile context");continue}u&&u.profile&&delete u.profile;const l=yR(a);if(!l){oe&&O.log(`[Profiling] Could not retrieve profile for transaction: ${a}`);continue}const d=_R(a,c,l,o);d&&s.push(d)}lR(r,s)})}}),z_=ER,TR=Ie(q_,z_);let W_={};z.Sentry&&z.Sentry.Integrations&&(W_=z.Sentry.Integrations);const IR={...W_,...jb,...iI},kM=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumbs:Kg,BrowserClient:Ug,BrowserProfilingIntegration:TR,BrowserTracing:FE,Dedupe:Jg,Feedback:Ki,FunctionToString:dg,GlobalHandlers:tm,HttpContext:sm,Hub:oc,InboundFilters:cg,Integrations:IR,LinkedErrors:am,ModuleMetadata:pb,Replay:Vi,ReplayCanvas:GC,SDK_VERSION:mo,SEMANTIC_ATTRIBUTE_SENTRY_OP:li,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:On,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:xn,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:tt,Scope:kr,TryCatch:cm,WINDOW:z,addBreadcrumb:Qt,addEventProcessor:Jp,addGlobalEventProcessor:wp,addIntegration:wS,addTracingExtensions:cc,breadcrumbsIntegration:bc,browserApiErrorsIntegration:wc,browserProfilingIntegration:z_,browserTracingIntegration:qE,captureConsoleIntegration:h_,captureEvent:Ui,captureException:$i,captureMessage:po,captureSession:lu,captureUserFeedback:rI,chromeStackLineParser:Hg,close:B0,configureScope:A0,contextLinesIntegration:N_,continueTrace:oS,createTransport:dc,createUserFeedbackEnvelope:$g,debugIntegration:g_,dedupeIntegration:__,defaultIntegrations:lm,defaultRequestInstrumentationOptions:wi,defaultStackLineParsers:qg,defaultStackParser:zg,endSession:sc,eventFromException:Ng,eventFromMessage:Pg,exceptionFromError:vc,extraErrorDataIntegration:b_,extractTraceparentData:Z0,feedbackIntegration:Sk,flush:F0,forceLoad:ZT,functionToStringIntegration:hc,geckoStackLineParser:jg,getActiveSpan:Fi,getActiveTransaction:Dt,getClient:W,getCurrentHub:le,getCurrentScope:we,getDefaultIntegrations:dm,getHubFromCarrier:_o,getReplay:xC,getSpanStatusFromHttpCode:ac,globalHandlersIntegration:Ec,httpClientIntegration:x_,httpContextIntegration:Tc,inboundFiltersIntegration:fc,init:fm,instrumentOutgoingRequests:_c,isInitialized:j0,lastEventId:H0,linkedErrorsIntegration:Ic,makeBrowserOfflineTransport:tR,makeFetchTransport:Fg,makeMain:du,makeMultiplexedTransport:nb,makeXHRTransport:Bg,metrics:Hb,moduleMetadataIntegration:ag,onLoad:eI,onProfilingStartRouteTransaction:bR,opera10StackLineParser:bT,opera11StackLineParser:IT,parameterize:ub,replayCanvasIntegration:a_,replayIntegration:kC,reportingObserverIntegration:T_,rewriteFramesIntegration:w_,sendFeedback:l_,sessionTimingIntegration:k_,setContext:xp,setCurrentClient:tg,setExtra:M0,setExtras:D0,setHttpStatus:Zo,setMeasurement:qp,setTag:N0,setTags:L0,setUser:P0,showReportDialog:QT,spanStatusfromHttpCode:tS,startBrowserTracingNavigationSpan:Mg,startBrowserTracingPageLoadSpan:Dg,startInactiveSpan:br,startSession:cu,startSpan:iS,startSpanManual:sS,startTransaction:U0,trace:rS,winjsStackLineParser:Gg,withActiveSpan:uu,withIsolationScope:$0,withScope:vn,wrap:tI},Symbol.toStringTag,{value:"Module"}));function RM(t){const e={...t};ig(e,"react"),fm(e)}const wR="ui.react.render",CR="ui.react.update",kR="ui.react.mount",tf="/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/profiler.tsx",RR="unknown";class V_ extends Xa.Component{static __initStatic(){this.defaultProps={disabled:!1,includeRender:!0,includeUpdates:!0}}constructor(e){super(e);const{name:n,disabled:r=!1}=this.props;r||(this._mountSpan=br({name:`<${n}>`,onlyIfParent:!0,op:kR,origin:"auto.ui.react.profiler",attributes:{"ui.component_name":n}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate({updateProps:e,includeUpdates:n=!0}){if(n&&this._mountSpan&&e!==this.props.updateProps){const r=Object.keys(e).filter(i=>e[i]!==this.props.updateProps[i]);if(r.length>0){const i=Jt();this._updateSpan=uu(this._mountSpan,()=>br({name:`<${this.props.name}>`,onlyIfParent:!0,op:CR,origin:"auto.ui.react.profiler",startTimestamp:i,attributes:{"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 e=Jt(),{name:n,includeRender:r=!0}=this.props;if(this._mountSpan&&r){const i=ce(this._mountSpan).timestamp;uu(this._mountSpan,()=>{const s=br({onlyIfParent:!0,name:`<${n}>`,op:wR,origin:"auto.ui.react.profiler",startTimestamp:i,attributes:{"ui.component_name":n}});s&&s.end(e)})}}render(){return this.props.children}}V_.__initStatic();function xM(t,e){const n=t.displayName||t.name||RR,r=i=>Xa.createElement(V_,{...e,name:n,updateProps:i,__self:this,__source:{fileName:tf,lineNumber:159}},Xa.createElement(t,{...i,__self:this,__source:{fileName:tf,lineNumber:160}}));return r.displayName=`profiler(${n})`,Qv(r,t),r}const xR=Object.prototype.toString;function jc(t,e){return xR.call(t)===`[object ${e}]`}function fn(t){return jc(t,"String")}function K_(t){return jc(t,"Object")}function Y_(t){return jc(t,"RegExp")}function yn(t){return!!(t&&t.then&&typeof t.then=="function")}function OR(t){return typeof t=="number"&&t!==t}function nf(t,e){try{return t instanceof e}catch{return!1}}function AR(t,e,n=!1){return fn(t)?Y_(e)?e.test(t):fn(e)?n?t===e:t.includes(e):!1:!1}function DR(t,e=[],n=!1){return e.some(r=>AR(t,r,n))}function ws(t){return t&&t.Math==Math?t:void 0}const ve=typeof globalThis=="object"&&ws(globalThis)||typeof window=="object"&&ws(window)||typeof self=="object"&&ws(self)||typeof global=="object"&&ws(global)||function(){return this}()||{};function Gc(){return ve}function X_(t,e,n){const r=n||ve,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const bi=Gc(),MR=80;function Do(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,i=[];let s=0,o=0;const u=" > ",a=u.length;let c;const l=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||MR;for(;n&&s++<r&&(c=LR(n,l),!(c==="html"||s>1&&o+i.length*a+c.length>=d));)i.push(c),o+=c.length,n=n.parentNode;return i.reverse().join(u)}catch{return"<unknown>"}}function LR(t,e){const n=t,r=[];let i,s,o,u,a;if(!n||!n.tagName)return"";if(bi.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const c=e&&e.length?e.filter(d=>n.getAttribute(d)).map(d=>[d,n.getAttribute(d)]):null;if(c&&c.length)c.forEach(d=>{r.push(`[${d[0]}="${d[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&fn(i))for(s=i.split(/\s+/),a=0;a<s.length;a++)r.push(`.${s[a]}`);const l=["aria-label","type","name","title","alt"];for(a=0;a<l.length;a++)o=l[a],u=n.getAttribute(o),u&&r.push(`[${o}="${u}"]`);return r.join("")}function NR(t){return bi.document&&bi.document.querySelector?bi.document.querySelector(t):null}function PR(t){if(!bi.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement&&e.dataset.sentryComponent)return e.dataset.sentryComponent;e=e.parentNode}return null}const Yi=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,$R="Sentry Logger ",rf=["debug","info","warn","error","log","assert","trace"],sf={};function J_(t){if(!("console"in ve))return t();const e=ve.console,n={},r=Object.keys(sf);r.forEach(i=>{const s=sf[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function UR(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Yi?rf.forEach(n=>{e[n]=(...r)=>{t&&J_(()=>{ve.console[n](`${$R}[${n}]:`,...r)})}}):rf.forEach(n=>{e[n]=()=>{}}),e}const U=UR();function FR(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:u,publicKey:a}=t;return`${u}://${a}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${o}`}function Je(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);typeof i=="function"&&BR(i,r),t[e]=i}function Mo(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{Yi&&U.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function BR(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,Mo(t,"__sentry_original__",e)}catch{}}function gt(t){return Ou(t,new Map)}function Ou(t,e){if(HR(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))typeof t[i]<"u"&&(r[i]=Ou(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(Ou(i,e))}),r}return t}function HR(t){if(!K_(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const Ua="<anonymous>";function Q_(t){try{return!t||typeof t!="function"?Ua:t.name||Ua}catch{return Ua}}const io={},of={};function Xi(t,e){io[t]=io[t]||[],io[t].push(e)}function Ji(t,e){of[t]||(e(),of[t]=!0)}function Kt(t,e){const n=t&&io[t];if(n)for(const r of n)try{r(e)}catch(i){Yi&&U.error(`Error while triggering instrumentation handler. Type: ${t} Name: ${Q_(r)} Error:`,i)}}function De(){const t=ve,e=t.crypto||t.msCrypto;let n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function Au(t){return Array.isArray(t)?t:[t]}const Du=Gc();function jR(){if(!("fetch"in Du))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function af(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function GR(){if(typeof EdgeRuntime=="string")return!0;if(!jR())return!1;if(af(Du.fetch))return!0;let t=!1;const e=Du.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=af(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){Yi&&U.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function qR(t){const e="fetch";Xi(e,t),Ji(e,zR)}function zR(){GR()&&Je(ve,"fetch",function(t){return function(...e){const{method:n,url:r}=WR(e),i={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return Kt("fetch",{...i}),t.apply(ve,e).then(s=>{const o={...i,endTimestamp:Date.now(),response:s};return Kt("fetch",o),s},s=>{const o={...i,endTimestamp:Date.now(),error:s};throw Kt("fetch",o),s})}})}function Mu(t,e){return!!t&&typeof t=="object"&&!!t[e]}function uf(t){return typeof t=="string"?t:t?Mu(t,"url")?t.url:t.toString?t.toString():"":""}function WR(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:uf(n),method:Mu(r,"method")?String(r.method).toUpperCase():"GET"}}const e=t[0];return{url:uf(e),method:Mu(e,"method")?String(e.method).toUpperCase():"GET"}}let Cs=null;function VR(t){const e="error";Xi(e,t),Ji(e,KR)}function KR(){Cs=ve.onerror,ve.onerror=function(t,e,n,r,i){return Kt("error",{column:r,error:i,line:n,msg:t,url:e}),Cs&&!Cs.__SENTRY_LOADER__?Cs.apply(this,arguments):!1},ve.onerror.__SENTRY_INSTRUMENTED__=!0}let ks=null;function YR(t){const e="unhandledrejection";Xi(e,t),Ji(e,XR)}function XR(){ks=ve.onunhandledrejection,ve.onunhandledrejection=function(t){return Kt("unhandledrejection",t),ks&&!ks.__SENTRY_LOADER__?ks.apply(this,arguments):!0},ve.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Rs=Gc();function JR(){const t=Rs.chrome,e=t&&t.app&&t.app.runtime,n="history"in Rs&&!!Rs.history.pushState&&!!Rs.history.replaceState;return!e&&n}const ii=ve;let xs;function QR(t){const e="history";Xi(e,t),Ji(e,ZR)}function ZR(){if(!JR())return;const t=ii.onpopstate;ii.onpopstate=function(...n){const r=ii.location.href,i=xs;if(xs=r,Kt("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=xs,o=String(i);xs=o,Kt("history",{from:s,to:o})}return n.apply(this,r)}}Je(ii.history,"pushState",e),Je(ii.history,"replaceState",e)}const ex=ve,fi="__sentry_xhr_v3__";function tx(t){const e="xhr";Xi(e,t),Ji(e,nx)}function nx(){if(!ex.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;Je(t,"open",function(e){return function(...n){const r=Date.now(),i=fn(n[0])?n[0].toUpperCase():void 0,s=rx(n[1]);if(!i||!s)return e.apply(this,n);this[fi]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const u=this[fi];if(u&&this.readyState===4){try{u.status_code=this.status}catch{}const a={args:[i,s],endTimestamp:Date.now(),startTimestamp:r,xhr:this};Kt("xhr",a)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Je(this,"onreadystatechange",function(u){return function(...a){return o(),u.apply(this,a)}}):this.addEventListener("readystatechange",o),Je(this,"setRequestHeader",function(u){return function(...a){const[c,l]=a,d=this[fi];return d&&fn(c)&&fn(l)&&(d.request_headers[c.toLowerCase()]=l),u.apply(this,a)}}),e.apply(this,n)}}),Je(t,"send",function(e){return function(...n){const r=this[fi];if(!r)return e.apply(this,n);n[0]!==void 0&&(r.body=n[0]);const i={args:[r.method,r.url],startTimestamp:Date.now(),xhr:this};return Kt("xhr",i),e.apply(this,n)}})}function rx(t){if(fn(t))return t;try{return t.toString()}catch{}}function ix(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function sx(){return!ix()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Mn(t,e){return t.require(e)}function Bn(t){let e;try{e=Mn(module,t)}catch{}try{const{cwd:n}=Mn(module,"process");e=Mn(module,`${n()}/node_modules/${t}`)}catch{}return e}var Gt;(function(t){t[t.PENDING=0]="PENDING";const n=1;t[t.RESOLVED=n]="RESOLVED";const r=2;t[t.REJECTED=r]="REJECTED"})(Gt||(Gt={}));class an{constructor(e){an.prototype.__init.call(this),an.prototype.__init2.call(this),an.prototype.__init3.call(this),an.prototype.__init4.call(this),this._state=Gt.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new an((r,i)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(o){i(o)}},s=>{if(!n)i(s);else try{r(n(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new an((n,r)=>{let i,s;return this.then(o=>{s=!1,i=o,e&&e()},o=>{s=!0,i=o,e&&e()}).then(()=>{if(s){r(i);return}n(i)})})}__init(){this._resolve=e=>{this._setResult(Gt.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Gt.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===Gt.PENDING){if(yn(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Gt.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Gt.RESOLVED&&n[1](this._value),this._state===Gt.REJECTED&&n[2](this._value),n[0]=!0)})}}}function la(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Lo(t){return t.split(/[\?#]/,1)[0]}function No(t){return t.split(/\\?\//).filter(e=>e.length>0&&e!==",").length}function ox(t,e={}){const n=t.method&&t.method.toUpperCase();let r="",i="url";e.customRoute||t.route?(r=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,i="route"):(t.originalUrl||t.url)&&(r=Lo(t.originalUrl||t.url||""));let s="";return e.method&&n&&(s+=n),e.method&&e.path&&(s+=" "),e.path&&r&&(s+=r),[s,i]}const Z_=1e3;function qc(){return Date.now()/Z_}function ax(){const{performance:t}=ve;if(!t||!t.now)return qc;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/Z_}const Qi=ax(),ct=(()=>{const{performance:t}=ve;if(!t||!t.now)return;const e=3600*1e3,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,o=t.timing&&t.timing.navigationStart,a=typeof o=="number"?Math.abs(o+n-r):e,c=a<e;return s||c?i<=a?t.timeOrigin:o:r})(),Lu="baggage",ev="sentry-",ux=/^sentry-/,cx=8192;function lx(t){if(!fn(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((r,i)=>{const s=cf(i);for(const o of Object.keys(s))r[o]=s[o];return r},{});else{if(!t)return;e=cf(t)}const n=Object.entries(e).reduce((r,[i,s])=>{if(i.match(ux)){const o=i.slice(ev.length);r[o]=s}return r},{});if(Object.keys(n).length>0)return n}function tv(t){if(!t)return;const e=Object.entries(t).reduce((n,[r,i])=>(i&&(n[`${ev}${r}`]=i),n),{});return dx(e)}function cf(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(e[n]=r,e),{})}function dx(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],i)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=i===0?s:`${e},${s}`;return o.length>cx?(Yi&&U.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}const fx=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function hx(t){if(!t)return;const e=t.match(fx);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function px(t,e){const n=hx(t),r=lx(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceId:i||De(),parentSpanId:s||De().substring(16),spanId:De().substring(16),sampled:o,dsc:r||{}}:{traceId:i||De(),spanId:De().substring(16)}}function zc(t=De(),e=De().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function gx(t,e=[]){return[t,e]}function ne(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const ae=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,nv="production";function mx(){return X_("globalEventProcessors",()=>[])}function Nu(t,e,n,r=0){return new an((i,s)=>{const o=t[r];if(e===null||typeof o!="function")i(e);else{const u=o({...e},n);ae&&o.id&&u===null&&U.log(`Event processor "${o.id}" dropped event`),yn(u)?u.then(a=>Nu(t,a,n,r+1).then(i)).then(null,s):Nu(t,u,n,r+1).then(i).then(null,s)}})}function _x(t){const e=Qi(),n={sid:De(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>yx(n)};return t&&da(n,t),n}function da(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Qi(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:De()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function vx(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),da(t,n)}function yx(t){return gt({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}const Sx=0,rv=1;function Wc(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:i,parent_span_id:s,status:o,tags:u,origin:a}=Ve(t);return gt({data:r,op:i,parent_span_id:s,span_id:e,status:o,tags:u,trace_id:n,origin:a})}function fa(t){const{traceId:e,spanId:n}=t.spanContext(),r=Vc(t);return zc(e,n,r)}function ha(t){return typeof t=="number"?lf(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?lf(t.getTime()):Qi()}function lf(t){return t>9999999999?t/1e3:t}function Ve(t){return bx(t)?t.getSpanJSON():typeof t.toJSON=="function"?t.toJSON():{}}function bx(t){return typeof t.getSpanJSON=="function"}function Vc(t){const{traceFlags:e}=t.spanContext();return!!(e&rv)}function Ex(...t){const e=en();if(t.length===2){const[n,r]=t;return n?e.withScope(()=>(e.getStackTop().scope=n,r(n))):e.withScope(r)}return e.withScope(t[0])}function Vr(){return en().getClient()}function Kr(){return en().getScope()}function Po(t){return t.transaction}function Kc(t,e,n){const r=e.getOptions(),{publicKey:i}=e.getDsn()||{},{segment:s}=n&&n.getUser()||{},o=gt({environment:r.environment||nv,release:r.release,user_segment:s,public_key:i,trace_id:t});return e.emit&&e.emit("createDsc",o),o}function Lr(t){const e=Vr();if(!e)return{};const n=Kc(Ve(t).trace_id||"",e,Kr()),r=Po(t);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:s,source:o}=r.metadata;s!=null&&(n.sample_rate=`${s}`);const u=Ve(r);return o&&o!=="url"&&(n.transaction=u.description),n.sampled=String(Vc(r)),e.emit&&e.emit("createDsc",n),n}function Tx(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;Ix(t,e),r&&kx(t,r),Rx(t,n),wx(t,i),Cx(t,s)}function Ix(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:u}=e,a=gt(n);a&&Object.keys(a).length&&(t.extra={...a,...t.extra});const c=gt(r);c&&Object.keys(c).length&&(t.tags={...c,...t.tags});const l=gt(i);l&&Object.keys(l).length&&(t.user={...l,...t.user});const d=gt(s);d&&Object.keys(d).length&&(t.contexts={...d,...t.contexts}),o&&(t.level=o),u&&(t.transaction=u)}function wx(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function Cx(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function kx(t,e){t.contexts={trace:Wc(e),...t.contexts};const n=Po(e);if(n){t.sdkProcessingMetadata={dynamicSamplingContext:Lr(e),...t.sdkProcessingMetadata};const r=Ve(n).description;r&&(t.tags={transaction:r,...t.tags})}}function Rx(t,e){t.fingerprint=t.fingerprint?Au(t.fingerprint):[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}const xx=100;class Tr{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=df()}static clone(e){return e?e.clone():new Tr}clone(){const e=new Tr;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&da(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e;if(n instanceof Tr){const r=n.getScopeData();this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&Object.keys(r.user).length&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint.length&&(this._fingerprint=r.fingerprint),n.getRequestSession()&&(this._requestSession=n.getRequestSession()),r.propagationContext&&(this._propagationContext=r.propagationContext)}else if(K_(n)){const r=e;this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint&&(this._fingerprint=r.fingerprint),r.requestSession&&(this._requestSession=r.requestSession),r.propagationContext&&(this._propagationContext=r.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=df(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:xx;if(r<=0)return this;const i={timestamp:qc(),...e},s=this._breadcrumbs;return s.push(i),this._breadcrumbs=s.length>r?s.slice(-r):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:n,_contexts:r,_tags:i,_extra:s,_user:o,_level:u,_fingerprint:a,_eventProcessors:c,_propagationContext:l,_sdkProcessingMetadata:d,_transactionName:f,_span:h}=this;return{breadcrumbs:e,attachments:n,contexts:r,tags:i,extra:s,user:o,level:u,fingerprint:a||[],eventProcessors:c,propagationContext:l,sdkProcessingMetadata:d,transactionName:f,span:h}}applyToEvent(e,n={},r=[]){Tx(e,this.getScopeData());const i=[...r,...mx(),...this._eventProcessors];return Nu(i,e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n&&n.event_id?n.event_id:De();if(!this._client)return U.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r&&r.event_id?r.event_id:De();if(!this._client)return U.warn("No client configured on scope - will not capture message!"),i;const s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:De();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(U.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function df(){return{traceId:De(),spanId:De().substring(16)}}const Ox="7.114.0",iv=parseFloat(Ox),Ax=100;class sv{constructor(e,n,r,i=iv){this._version=i;let s;n?s=n:(s=new Tr,s.setClient(e));let o;r?o=r:(o=new Tr,o.setClient(e)),this._stack=[{scope:s}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const n=this.getStackTop();n.client=e,n.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){const n=this.pushScope();let r;try{r=e(n)}catch(i){throw this.popScope(),i}return yn(r)?r.then(i=>(this.popScope(),i),i=>{throw this.popScope(),i}):(this.popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){const r=this._lastEventId=n&&n.event_id?n.event_id:De(),i=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:De(),s=new Error(e);return this.getScope().captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:De();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...n,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=Ax}=i.getOptions&&i.getOptions()||{};if(o<=0)return;const a={timestamp:qc(),...e},c=s?J_(()=>s(a,n)):a;c!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",c,n),r.addBreadcrumb(c,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n),this.getIsolationScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n),this.getIsolationScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n),this.getIsolationScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=ff(this);try{e(this)}finally{ff(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return ae&&U.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return ae&&!r&&(this.getClient()?U.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init': Sentry.addTracingExtensions(); Sentry.init({...}); `):U.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,r=n.getSession();r&&vx(r),this._sendSessionUpdate(),n.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=nv}=r&&r.getOptions()||{},{userAgent:o}=ve.navigator||{},u=_x({release:i,environment:s,user:n.getUser(),...o&&{userAgent:o},...e}),a=n.getSession&&n.getSession();return a&&a.status==="ok"&&da(a,{status:"exited"}),this.endSession(),n.setSession(u),u}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_callExtensionMethod(e,...n){const i=Vn().__SENTRY__;if(i&&i.extensions&&typeof i.extensions[e]=="function")return i.extensions[e].apply(this,n);ae&&U.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Vn(){return ve.__SENTRY__=ve.__SENTRY__||{extensions:{},hub:void 0},ve}function ff(t){const e=Vn(),n=Pu(e);return ov(e,t),n}function en(){const t=Vn();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return Dx(t)}function Yc(){return en().getIsolationScope()}function Dx(t=Vn()){return(!Lx(t)||Pu(t).isOlderThan(iv))&&ov(t,new sv),Pu(t)}function Mx(t,e={}){const n=Vn();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(t,e):t()}function Lx(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function Pu(t){return X_("hub",()=>new sv,t)}function ov(t,e){if(!t)return!1;const n=t.__SENTRY__=t.__SENTRY__||{};return n.hub=e,!0}function Hn(t){return(t||en()).getScope().getTransaction()}let hf=!1;function Nx(){hf||(hf=!0,VR($u),YR($u))}function $u(){const t=Hn();if(t){const e="internal_error";ae&&U.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}$u.tag="sentry_tracingErrorCallback";var pf;(function(t){const e="ok";t.Ok=e;const n="deadline_exceeded";t.DeadlineExceeded=n;const r="unauthenticated";t.Unauthenticated=r;const i="permission_denied";t.PermissionDenied=i;const s="not_found";t.NotFound=s;const o="resource_exhausted";t.ResourceExhausted=o;const u="invalid_argument";t.InvalidArgument=u;const a="unimplemented";t.Unimplemented=a;const c="unavailable";t.Unavailable=c;const l="internal_error";t.InternalError=l;const d="unknown_error";t.UnknownError=d;const f="cancelled";t.Cancelled=f;const h="already_exists";t.AlreadyExists=h;const p="failed_precondition";t.FailedPrecondition=p;const m="aborted";t.Aborted=m;const _="out_of_range";t.OutOfRange=_;const g="data_loss";t.DataLoss=g})(pf||(pf={}));function Px(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function Xc(t,e){t.setTag("http.status_code",String(e)),t.setData("http.response.status_code",e);const n=Px(e);n!=="unknown_error"&&t.setStatus(n)}function $x(t,e,n=()=>{}){let r;try{r=t()}catch(i){throw e(i),n(),i}return Ux(r,e,n)}function Ux(t,e,n){return yn(t)?t.then(r=>(n(),r),r=>{throw e(r),n(),r}):(n(),t)}function Yr(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=Vr(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function Fx(t,e){const n=cv(t);return Mx(()=>Ex(t.scope,r=>{const i=en(),s=r.getSpan(),u=t.onlyIfParent&&!s?void 0:uv(i,{parentSpan:s,spanContext:n,forceTransaction:t.forceTransaction,scope:r});return $x(()=>e(u),()=>{if(u){const{status:a}=Ve(u);(!a||a==="ok")&&u.setStatus("internal_error")}},()=>u&&u.end())}))}function av(t){if(!Yr())return;const e=cv(t),n=en(),r=t.scope?t.scope.getSpan():Bx();if(t.onlyIfParent&&!r)return;const o=(t.scope||Kr()).clone();return uv(n,{parentSpan:r,spanContext:e,forceTransaction:t.forceTransaction,scope:o})}function Bx(){return Kr().getSpan()}function uv(t,{parentSpan:e,spanContext:n,forceTransaction:r,scope:i}){if(!Yr())return;const s=Yc();let o;if(e&&!r)o=e.startChild(n);else if(e){const u=Lr(e),{traceId:a,spanId:c}=e.spanContext(),l=Vc(e);o=t.startTransaction({traceId:a,parentSpanId:c,parentSampled:l,...n,metadata:{dynamicSamplingContext:u,...n.metadata}})}else{const{traceId:u,dsc:a,parentSpanId:c,sampled:l}={...s.getPropagationContext(),...i.getPropagationContext()};o=t.startTransaction({traceId:u,parentSpanId:c,parentSampled:l,...n,metadata:{dynamicSamplingContext:a,...n.metadata}})}return i.setSpan(o),Hx(o,i,s),o}function cv(t){if(t.startTime){const e={...t};return e.startTimestamp=ha(t.startTime),delete e.startTime,e}return t}const lv="_sentryScope",dv="_sentryIsolationScope";function Hx(t,e,n){t&&(Mo(t,dv,n),Mo(t,lv,e))}function jx(t){return{scope:t[lv],isolationScope:t[dv]}}const hn="sentry.source",mr="sentry.sample_rate",Os="sentry.op",Ln="sentry.origin",Gx="profile_id";class fv{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class pa{constructor(e={}){this._traceId=e.traceId||De(),this._spanId=e.spanId||De().substring(16),this._startTime=e.startTimestamp||Qi(),this.tags=e.tags?{...e.tags}:{},this.data=e.data?{...e.data}:{},this.instrumenter=e.instrumenter||"sentry",this._attributes={},this.setAttributes({[Ln]:e.origin||"manual",[Os]:e.op,...e.attributes}),this._name=e.name||e.description,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.status&&(this._status=e.status),e.endTimestamp&&(this._endTime=e.endTimestamp),e.exclusiveTime!==void 0&&(this._exclusiveTime=e.exclusiveTime),this._measurements=e.measurements?{...e.measurements}:{}}get name(){return this._name||""}set name(e){this.updateName(e)}get description(){return this._name}set description(e){this._name=e}get traceId(){return this._traceId}set traceId(e){this._traceId=e}get spanId(){return this._spanId}set spanId(e){this._spanId=e}set parentSpanId(e){this._parentSpanId=e}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(e){this._sampled=e}get attributes(){return this._attributes}set attributes(e){this._attributes=e}get startTimestamp(){return this._startTime}set startTimestamp(e){this._startTime=e}get endTimestamp(){return this._endTime}set endTimestamp(e){this._endTime=e}get status(){return this._status}set status(e){this._status=e}get op(){return this._attributes[Os]}set op(e){this.setAttribute(Os,e)}get origin(){return this._attributes[Ln]}set origin(e){this.setAttribute(Ln,e)}spanContext(){const{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?rv:Sx}}startChild(e){const n=new pa({...e,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n);const r=Po(this);if(n.transaction=r,ae&&r){const i=e&&e.op||"< unknown op >",s=Ve(n).description||"< unknown name >",o=r.spanContext().spanId,u=`[Tracing] Starting '${i}' span on transaction '${s}' (${o}).`;U.log(u),this._logMessage=u}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setAttribute(e,n){n===void 0?delete this._attributes[e]:this._attributes[e]=n}setAttributes(e){Object.keys(e).forEach(n=>this.setAttribute(n,e[n]))}setStatus(e){return this._status=e,this}setHttpStatus(e){return Xc(this,e),this}setName(e){this.updateName(e)}updateName(e){return this._name=e,this}isSuccess(){return this._status==="ok"}finish(e){return this.end(e)}end(e){if(this._endTime)return;const n=Po(this);if(ae&&n&&n.spanContext().spanId!==this._spanId){const r=this._logMessage;r&&U.log(r.replace("Starting","Finishing"))}this._endTime=ha(e)}toTraceparent(){return fa(this)}toContext(){return gt({data:this._getData(),description:this._name,endTimestamp:this._endTime,op:this.op,parentSpanId:this._parentSpanId,sampled:this._sampled,spanId:this._spanId,startTimestamp:this._startTime,status:this._status,tags:this.tags,traceId:this._traceId})}updateWithContext(e){return this.data=e.data||{},this._name=e.name||e.description,this._endTime=e.endTimestamp,this.op=e.op,this._parentSpanId=e.parentSpanId,this._sampled=e.sampled,this._spanId=e.spanId||this._spanId,this._startTime=e.startTimestamp||this._startTime,this._status=e.status,this.tags=e.tags||{},this._traceId=e.traceId||this._traceId,this}getTraceContext(){return Wc(this)}getSpanJSON(){return gt({data:this._getData(),description:this._name,op:this._attributes[Os],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:this._status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Ln],_metrics_summary:void 0,profile_id:this._attributes[Gx],exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}toJSON(){return this.getSpanJSON()}_getData(){const{data:e,_attributes:n}=this,r=Object.keys(e).length>0,i=Object.keys(n).length>0;if(!(!r&&!i))return r&&i?{...e,...n}:r?e:n}}class hv extends pa{constructor(e,n){super(e),this._contexts={},this._hub=n||en(),this._name=e.name||"",this._metadata={...e.metadata},this._trimEnd=e.trimEnd,this.transaction=this;const r=this._metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}get metadata(){return{source:"custom",spanMetadata:{},...this._metadata,...this._attributes[hn]&&{source:this._attributes[hn]},...this._attributes[mr]&&{sampleRate:this._attributes[mr]}}}set metadata(e){this._metadata=e}setName(e,n="custom"){this._name=e,this.setAttribute(hn,n)}updateName(e){return this._name=e,this}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new fv(e)),this.spanRecorder.add(this)}setContext(e,n){n===null?delete this._contexts[e]:this._contexts[e]=n}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this._metadata={...this._metadata,...e}}end(e){const n=ha(e),r=this._finishTransaction(n);if(r)return this._hub.captureEvent(r)}toContext(){const e=super.toContext();return gt({...e,name:this._name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this._name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){return Lr(this)}setHub(e){this._hub=e}getProfileId(){if(this._contexts!==void 0&&this._contexts.profile!==void 0)return this._contexts.profile.profile_id}_finishTransaction(e){if(this._endTime!==void 0)return;this._name||(ae&&U.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>"),super.end(e);const n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this._sampled!==!0){ae&&U.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}const r=this.spanRecorder?this.spanRecorder.spans.filter(l=>l!==this&&Ve(l).timestamp):[];if(this._trimEnd&&r.length>0){const l=r.map(d=>Ve(d).timestamp).filter(Boolean);this._endTime=l.reduce((d,f)=>d>f?d:f)}const{scope:i,isolationScope:s}=jx(this),{metadata:o}=this,{source:u}=o,a={contexts:{...this._contexts,trace:Wc(this)},spans:r,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{...o,capturedSpanScope:i,capturedSpanIsolationScope:s,...gt({dynamicSamplingContext:Lr(this)})},_metrics_summary:void 0,...u&&{transaction_info:{source:u}}};return Object.keys(this._measurements).length>0&&(ae&&U.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),a.measurements=this._measurements),ae&&U.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),a}}const so={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},qx="finishReason",tr=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class zx extends fv{constructor(e,n,r,i){super(i),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){if(e.spanContext().spanId!==this.transactionSpanId){const n=e.end;e.end=(...r)=>(this._popActivity(e.spanContext().spanId),n.apply(e,r)),Ve(e).timestamp===void 0&&this._pushActivity(e.spanContext().spanId)}super.add(e)}}class Wx extends hv{constructor(e,n,r=so.idleTimeout,i=so.finalTimeout,s=so.heartbeatInterval,o=!1,u=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=i,this._heartbeatInterval=s,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=tr[4],this._autoFinishAllowed=!u,o&&(ae&&U.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),n.getScope().setSpan(this)),u||this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=tr[3],this.end())},this._finalTimeout)}end(e){const n=ha(e);if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setAttribute(qx,this._finishReason),this.spanRecorder){ae&&U.log("[Tracing] finishing IdleTransaction",new Date(n*1e3).toISOString(),this.op);for(const r of this._beforeFinishCallbacks)r(this,n);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanContext().spanId===this.spanContext().spanId)return!0;Ve(r).timestamp||(r.setStatus("cancelled"),r.end(n),ae&&U.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));const{start_timestamp:i,timestamp:s}=Ve(r),o=i&&i<n,u=(this._finalTimeout+this._idleTimeout)/1e3,a=s&&i&&s-i<u;if(ae){const c=JSON.stringify(r,void 0,2);o?a||U.log("[Tracing] discarding Span since it finished after Transaction final timeout",c):U.log("[Tracing] discarding Span since it happened after Transaction was finished",c)}return o&&a}),ae&&U.log("[Tracing] flushing IdleTransaction")}else ae&&U.log("[Tracing] No active IdleTransaction");if(this._onScope){const r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.end(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const n=i=>{this._finished||this._pushActivity(i)},r=i=>{this._finished||this._popActivity(i)};this.spanRecorder=new zx(n,r,this.spanContext().spanId,e),ae&&U.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=tr[5],this.end(e)))}setFinishReason(e){this._finishReason=e}sendAutoFinishSignal(){this._autoFinishAllowed||(ae&&U.log("[Tracing] Received finish signal for idle transaction."),this._restartIdleTimeout(),this._autoFinishAllowed=!0)}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=tr[1],this.end(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),ae&&U.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,ae&&U.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(ae&&U.log(`[Tracing] popActivity ${e}`),delete this.activities[e],ae&&U.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const n=Qi();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason=tr[5],this.end(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?this._autoFinishAllowed&&(ae&&U.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=tr[0],this.end()):this._pingHeartbeat()}_pingHeartbeat(){ae&&U.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function pv(t,e,n){if(!Yr(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setAttribute(mr,Number(t.sampled)),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setAttribute(mr,Number(r))):n.parentSampled!==void 0?r=n.parentSampled:typeof e.tracesSampleRate<"u"?(r=e.tracesSampleRate,t.setAttribute(mr,Number(r))):(r=1,t.setAttribute(mr,r)),gv(r)?r?(t.sampled=Math.random()<r,t.sampled?(ae&&U.log(`[Tracing] starting ${t.op} transaction - ${Ve(t).description}`),t):(ae&&U.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):(ae&&U.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"}`),t.sampled=!1,t):(ae&&U.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function gv(t){return OR(t)||!(typeof t=="number"||typeof t=="boolean")?(ae&&U.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?(ae&&U.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function Vx(){const e=this.getScope().getSpan();return e?{"sentry-trace":fa(e)}:{}}function Kx(t,e){const n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||"sentry",s=t.instrumenter||"sentry";i!==s&&(ae&&U.error(`A transaction was started with instrumenter=\`${s}\`, but the SDK is configured with the \`${i}\` instrumenter. The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),t.sampled=!1);let o=new hv(t,this);return o=pv(o,r,{name:t.name,parentSampled:t.parentSampled,transactionContext:t,attributes:{...t.data,...t.attributes},...e}),o.isRecording()&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function gf(t,e,n,r,i,s,o,u=!1){const a=t.getClient(),c=a&&a.getOptions()||{};let l=new Wx(e,t,n,r,o,i,u);return l=pv(l,c,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...s}),l.isRecording()&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",l),l}function mv(){const t=Vn();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=Kx),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=Vx),Nx())}function Yx(t,e,n){const r=Hn();r&&r.setMeasurement(t,e,n)}function Xx(t,e){const n={sent_at:new Date().toISOString()};e&&(n.dsn=FR(e));const r=t.map(Jx);return gx(n,r)}function Jx(t){return[{type:"span"},t]}const V=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Kn(t){const e=ne([t,"call",r=>r(),"access",r=>r.getClient,"call",r=>r(),"optionalAccess",r=>r.getOptions,"call",r=>r()]);return(ne([e,"optionalAccess",r=>r.instrumenter])||"sentry")!=="sentry"}class Jc{static __initStatic(){this.id="Express"}constructor(e={}){this.name=Jc.id,this._router=e.router||e.app,this._methods=(Array.isArray(e.methods)?e.methods:[]).concat("use")}setupOnce(e,n){if(!this._router){V&&U.error("ExpressIntegration is missing an Express instance");return}if(Kn(n)){V&&U.log("Express Integration is skipped because of instrumenter configuration.");return}eO(this._router,this._methods),tO(this._router)}}Jc.__initStatic();function mf(t,e){const n=t.length;switch(n){case 2:return function(r,i){const s=i.__sentry_transaction;if(s){const o=s.startChild({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"});i.once("finish",()=>{o.end()})}return t.call(this,r,i)};case 3:return function(r,i,s){const o=i.__sentry_transaction,u=ne([o,"optionalAccess",a=>a.startChild,"call",a=>a({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"})]);t.call(this,r,i,function(...a){ne([u,"optionalAccess",c=>c.end,"call",c=>c()]),s.call(this,...a)})};case 4:return function(r,i,s,o){const u=s.__sentry_transaction,a=ne([u,"optionalAccess",c=>c.startChild,"call",c=>c({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"})]);t.call(this,r,i,s,function(...c){ne([a,"optionalAccess",l=>l.end,"call",l=>l()]),o.call(this,...c)})};default:throw new Error(`Express middleware takes 2-4 arguments. Got: ${n}`)}}function Qx(t,e){return t.map(n=>typeof n=="function"?mf(n,e):Array.isArray(n)?n.map(r=>typeof r=="function"?mf(r,e):r):n)}function Zx(t,e){const n=t[e];return t[e]=function(...r){return n.call(this,...Qx(r,e))},t}function eO(t,e=[]){e.forEach(n=>Zx(t,n))}function tO(t){const e="settings"in t;e&&t._router===void 0&&t.lazyrouter&&t.lazyrouter();const n=e?t._router:t;if(!n){V&&U.debug("Cannot instrument router for URL Parameterization (did not find a valid router)."),V&&U.debug("Routing instrumentation is currently only supported in Express 4.");return}const r=Object.getPrototypeOf(n),i=r.process_params;r.process_params=function(o,u,a,c,l){a._reconstructedRoute||(a._reconstructedRoute="");const{layerRoutePath:d,isRegex:f,isArray:h,numExtraSegments:p}=rO(o);(d||f||h)&&(a._hasParameters=!0);let m;d?m=d:m=oO(a.originalUrl,a._reconstructedRoute,o.path)||"";const _=m.split("/").filter(S=>S.length>0&&(f||h||!S.includes("*"))).join("/");_&&_.length>0&&(a._reconstructedRoute+=`/${_}${f?"/":""}`);const g=No(Lo(a.originalUrl||""))+p,v=No(a._reconstructedRoute);if(g===v){a._hasParameters||a._reconstructedRoute!==a.originalUrl&&(a._reconstructedRoute=a.originalUrl?Lo(a.originalUrl):a.originalUrl);const S=c.__sentry_transaction,C=S&&Ve(S).data||{};if(S&&C[hn]!=="custom"){const R=a._reconstructedRoute||"/",[E,x]=ox(a,{path:!0,method:!0,customRoute:R});S.updateName(E),S.setAttribute(hn,x)}}return i.call(this,o,u,a,c,l)}}const nO=(t,e,n)=>{if(!t||!e||!n||Object.keys(n).length===0||!ne([n,"access",c=>c[0],"optionalAccess",c=>c.offset]))return;const r=n.sort((c,l)=>c.offset-l.offset),s=new RegExp(e,`${e.flags}d`).exec(t);if(!s||!s.indices)return;const[,...o]=s.indices;if(o.length!==r.length)return;let u=t,a=0;return o.forEach((c,l)=>{if(c){const[d,f]=c,h=u.substring(0,d-a),p=`:${r[l].name}`,m=u.substring(f-a);u=h+p+m,a=a+(f-d-p.length)}}),u};function rO(t){let e=ne([t,"access",o=>o.route,"optionalAccess",o=>o.path]);const n=Y_(e),r=Array.isArray(e);if(!e){const[o]=ve.process.versions.node.split(".").map(Number);o>=16&&(e=nO(t.path,t.regexp,t.keys))}if(!e)return{isRegex:n,isArray:r,numExtraSegments:0};const i=r?Math.max(iO(e)-No(t.path||""),0):0;return{layerRoutePath:sO(r,e),isRegex:n,isArray:r,numExtraSegments:i}}function iO(t){return t.reduce((e,n)=>e+No(n.toString()),0)}function sO(t,e){return t?e.map(n=>n.toString()).join(","):e&&e.toString()}function oO(t,e,n){const r=Lo(t||""),i=ne([r,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c)]);let s=0;const o=ne([e,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c),"access",a=>a.length])||0;return ne([n,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>ne([i,"optionalAccess",l=>l[o+s]])===c?(s+=1,!0):!1),"access",a=>a.join,"call",a=>a("/")])}class Qc{static __initStatic(){this.id="Postgres"}constructor(e={}){this.name=Qc.id,this._usePgNative=!!e.usePgNative,this._module=e.module}loadDependency(){return this._module=this._module||Bn("pg")}setupOnce(e,n){if(Kn(n)){V&&U.log("Postgres Integration is skipped because of instrumenter configuration.");return}const r=this.loadDependency();if(!r){V&&U.error("Postgres Integration was unable to require `pg` package.");return}const i=this._usePgNative?ne([r,"access",s=>s.native,"optionalAccess",s=>s.Client]):r.Client;if(!i){V&&U.error("Postgres Integration was unable to access 'pg-native' bindings.");return}Je(i.prototype,"query",function(s){return function(o,u,a){const l=n().getScope().getSpan(),d={"db.system":"postgresql"};try{this.database&&(d["db.name"]=this.database),this.host&&(d["server.address"]=this.host),this.port&&(d["server.port"]=this.port),this.user&&(d["db.user"]=this.user)}catch{}const f=ne([l,"optionalAccess",p=>p.startChild,"call",p=>p({description:typeof o=="string"?o:o.text,op:"db",origin:"auto.db.postgres",data:d})]);if(typeof a=="function")return s.call(this,o,u,function(p,m){ne([f,"optionalAccess",_=>_.end,"call",_=>_()]),a(p,m)});if(typeof u=="function")return s.call(this,o,function(p,m){ne([f,"optionalAccess",_=>_.end,"call",_=>_()]),u(p,m)});const h=typeof u<"u"?s.call(this,o,u):s.call(this,o);return yn(h)?h.then(p=>(ne([f,"optionalAccess",m=>m.end,"call",m=>m()]),p)):(ne([f,"optionalAccess",p=>p.end,"call",p=>p()]),h)}})}}Qc.__initStatic();class Zc{static __initStatic(){this.id="Mysql"}constructor(){this.name=Zc.id}loadDependency(){return this._module=this._module||Bn("mysql/lib/Connection.js")}setupOnce(e,n){if(Kn(n)){V&&U.log("Mysql Integration is skipped because of instrumenter configuration.");return}const r=this.loadDependency();if(!r){V&&U.error("Mysql Integration was unable to require `mysql` package.");return}let i;try{r.prototype.connect=new Proxy(r.prototype.connect,{apply(u,a,c){return i||(i=a.config),u.apply(a,c)}})}catch{V&&U.error("Mysql Integration was unable to instrument `mysql` config.")}function s(){return i?{"server.address":i.host,"server.port":i.port,"db.user":i.user}:{}}function o(u){if(!u)return;const a=s();Object.keys(a).forEach(c=>{u.setAttribute(c,a[c])}),u.end()}Je(r,"createQuery",function(u){return function(a,c,l){const f=n().getScope().getSpan(),h=ne([f,"optionalAccess",m=>m.startChild,"call",m=>m({description:typeof a=="string"?a:a.sql,op:"db",origin:"auto.db.mysql",data:{"db.system":"mysql"}})]);if(typeof l=="function")return u.call(this,a,c,function(m,_,g){o(h),l(m,_,g)});if(typeof c=="function")return u.call(this,a,function(m,_,g){o(h),c(m,_,g)});const p=u.call(this,a,c);return p.on("end",()=>{o(h)}),p}})}}Zc.__initStatic();const aO=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],uO={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]};function cO(t){return t&&typeof t=="object"&&t.once&&typeof t.once=="function"}class el{static __initStatic(){this.id="Mongo"}constructor(e={}){this.name=el.id,this._operations=Array.isArray(e.operations)?e.operations:aO,this._describeOperations="describeOperations"in e?e.describeOperations:!0,this._useMongoose=!!e.useMongoose}loadDependency(){const e=this._useMongoose?"mongoose":"mongodb";return this._module=this._module||Bn(e)}setupOnce(e,n){if(Kn(n)){V&&U.log("Mongo Integration is skipped because of instrumenter configuration.");return}const r=this.loadDependency();if(!r){const i=this._useMongoose?"mongoose":"mongodb";V&&U.error(`Mongo Integration was unable to require \`${i}\` package.`);return}this._instrumentOperations(r.Collection,this._operations,n)}_instrumentOperations(e,n,r){n.forEach(i=>this._patchOperation(e,i,r))}_patchOperation(e,n,r){if(!(n in e.prototype))return;const i=this._getSpanContextFromOperationArguments.bind(this);Je(e.prototype,n,function(s){return function(...o){const u=o[o.length-1],a=r(),c=a.getScope(),l=a.getClient(),d=c.getSpan(),f=ne([l,"optionalAccess",p=>p.getOptions,"call",p=>p(),"access",p=>p.sendDefaultPii]);if(typeof u!="function"||n==="mapReduce"&&o.length===2){const p=ne([d,"optionalAccess",_=>_.startChild,"call",_=>_(i(this,n,o,f))]),m=s.call(this,...o);if(yn(m))return m.then(_=>(ne([p,"optionalAccess",g=>g.end,"call",g=>g()]),_));if(cO(m)){const _=m;try{_.once("close",()=>{ne([p,"optionalAccess",g=>g.end,"call",g=>g()])})}catch{ne([p,"optionalAccess",v=>v.end,"call",v=>v()])}return _}else return ne([p,"optionalAccess",_=>_.end,"call",_=>_()]),m}const h=ne([d,"optionalAccess",p=>p.startChild,"call",p=>p(i(this,n,o.slice(0,-1)))]);return s.call(this,...o.slice(0,-1),function(p,m){ne([h,"optionalAccess",_=>_.end,"call",_=>_()]),u(p,m)})}})}_getSpanContextFromOperationArguments(e,n,r,i=!1){const s={"db.system":"mongodb","db.name":e.dbName,"db.operation":n,"db.mongodb.collection":e.collectionName},o={op:"db",origin:"auto.db.mongo",description:n,data:s},u=uO[n],a=Array.isArray(this._describeOperations)?this._describeOperations.includes(n):this._describeOperations;if(!u||!a||!i)return o;try{if(n==="mapReduce"){const[c,l]=r;s[u[0]]=typeof c=="string"?c:c.name||"<anonymous>",s[u[1]]=typeof l=="string"?l:l.name||"<anonymous>"}else for(let c=0;c<u.length;c++)s[`db.mongodb.${u[c]}`]=JSON.stringify(r[c])}catch{}return o}}el.__initStatic();function lO(t){return!!t&&!!t.$use}class tl{static __initStatic(){this.id="Prisma"}constructor(e={}){if(this.name=tl.id,lO(e.client)&&!e.client._sentryInstrumented){Mo(e.client,"_sentryInstrumented",!0);const n={};try{const r=e.client._engineConfig;if(r){const{activeProvider:i,clientVersion:s}=r;i&&(n["db.system"]=i),s&&(n["db.prisma.version"]=s)}}catch{}e.client.$use((r,i)=>{if(Kn(en))return i(r);const s=r.action,o=r.model;return Fx({name:o?`${o} ${s}`:s,onlyIfParent:!0,op:"db.prisma",attributes:{[Ln]:"auto.db.prisma"},data:{...n,"db.operation":s}},()=>i(r))})}else V&&U.warn("Unsupported Prisma client provided to PrismaIntegration. Provided client:",e.client)}setupOnce(){}}tl.__initStatic();class nl{static __initStatic(){this.id="GraphQL"}constructor(){this.name=nl.id}loadDependency(){return this._module=this._module||Bn("graphql/execution/execute.js")}setupOnce(e,n){if(Kn(n)){V&&U.log("GraphQL Integration is skipped because of instrumenter configuration.");return}const r=this.loadDependency();if(!r){V&&U.error("GraphQL Integration was unable to require graphql/execution package.");return}Je(r,"execute",function(i){return function(...s){const o=n().getScope(),u=o.getSpan(),a=ne([u,"optionalAccess",l=>l.startChild,"call",l=>l({description:"execute",op:"graphql.execute",origin:"auto.graphql.graphql"})]);ne([o,"optionalAccess",l=>l.setSpan,"call",l=>l(a)]);const c=i.call(this,...s);return yn(c)?c.then(l=>(ne([a,"optionalAccess",d=>d.end,"call",d=>d()]),ne([o,"optionalAccess",d=>d.setSpan,"call",d=>d(u)]),l)):(ne([a,"optionalAccess",l=>l.end,"call",l=>l()]),ne([o,"optionalAccess",l=>l.setSpan,"call",l=>l(u)]),c)}})}}nl.__initStatic();class rl{static __initStatic(){this.id="Apollo"}constructor(e={useNestjs:!1}){this.name=rl.id,this._useNest=!!e.useNestjs}loadDependency(){return this._useNest?this._module=this._module||Bn("@nestjs/graphql"):this._module=this._module||Bn("apollo-server-core"),this._module}setupOnce(e,n){if(Kn(n)){V&&U.log("Apollo Integration is skipped because of instrumenter configuration.");return}if(this._useNest){const r=this.loadDependency();if(!r){V&&U.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package.");return}Je(r.GraphQLFactory.prototype,"mergeWithSchema",function(i){return function(...s){return Je(this.resolversExplorerService,"explore",function(o){return function(){const u=Au(o.call(this));return _f(u,n)}}),i.call(this,...s)}})}else{const r=this.loadDependency();if(!r){V&&U.error("Apollo Integration was unable to require apollo-server-core package.");return}Je(r.ApolloServerBase.prototype,"constructSchema",function(i){return function(){if(!this.config.resolvers)return V&&(this.config.schema?(U.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."),U.warn()):this.config.modules&&U.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."),U.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.")),i.call(this);const s=Au(this.config.resolvers);return this.config.resolvers=_f(s,n),i.call(this)}})}}}rl.__initStatic();function _f(t,e){return t.map(n=>(Object.keys(n).forEach(r=>{Object.keys(n[r]).forEach(i=>{typeof n[r][i]=="function"&&dO(n,r,i,e)})}),n))}function dO(t,e,n,r){Je(t[e],n,function(i){return function(...s){const u=r().getScope().getSpan(),a=ne([u,"optionalAccess",l=>l.startChild,"call",l=>l({description:`${e}.${n}`,op:"graphql.resolve",origin:"auto.graphql.apollo"})]),c=i.call(this,...s);return yn(c)?c.then(l=>(ne([a,"optionalAccess",d=>d.end,"call",d=>d()]),l)):(ne([a,"optionalAccess",l=>l.end,"call",l=>l()]),c)}})}const J=ve;function fO(){J.document?J.document.addEventListener("visibilitychange",()=>{const t=Hn();if(J.document.hidden&&t){const e="cancelled",{op:n,status:r}=Ve(t);V&&U.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.end()}}):V&&U.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Zi=(t,e,n)=>{let r,i;return s=>{e.value>=0&&(s||n)&&(i=e.value-(r||0),(i||r===void 0)&&(r=e.value,e.delta=i,t(e)))}},hO=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,pO=()=>{const t=J.performance.timing,e=J.performance.navigation.type,n={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(const r in t)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n},ga=()=>J.__WEB_VITALS_POLYFILL__?J.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||pO()):J.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],il=()=>{const t=ga();return t&&t.activationStart||0},es=(t,e)=>{const n=ga();let r="navigate";return n&&(J.document&&J.document.prerendering||il()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:hO(),navigationType:r}},Xr=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(i=>{e(i.getEntries())});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},ts=(t,e)=>{const n=r=>{(r.type==="pagehide"||J.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};J.document&&(addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0))},gO=(t,e={})=>{const n=es("CLS",0);let r,i=0,s=[];const o=a=>{a.forEach(c=>{if(!c.hadRecentInput){const l=s[0],d=s[s.length-1];i&&s.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-l.startTime<5e3?(i+=c.value,s.push(c)):(i=c.value,s=[c]),i>n.value&&(n.value=i,n.entries=s,r&&r())}})},u=Xr("layout-shift",o);if(u){r=Zi(t,n,e.reportAllChanges);const a=()=>{o(u.takeRecords()),r(!0)};return ts(a),a}};let $o=-1;const mO=()=>{J.document&&J.document.visibilityState&&($o=J.document.visibilityState==="hidden"&&!J.document.prerendering?0:1/0)},_O=()=>{ts(({timeStamp:t})=>{$o=t},!0)},sl=()=>($o<0&&(mO(),_O()),{get firstHiddenTime(){return $o}}),vO=t=>{const e=sl(),n=es("FID");let r;const i=u=>{u.startTime<e.firstHiddenTime&&(n.value=u.processingStart-u.startTime,n.entries.push(u),r(!0))},s=u=>{u.forEach(i)},o=Xr("first-input",s);r=Zi(t,n),o&&ts(()=>{s(o.takeRecords()),o.disconnect()},!0)};let _v=0,Fa=1/0,As=0;const yO=t=>{t.forEach(e=>{e.interactionId&&(Fa=Math.min(Fa,e.interactionId),As=Math.max(As,e.interactionId),_v=As?(As-Fa)/7+1:0)})};let Uu;const SO=()=>Uu?_v:performance.interactionCount||0,bO=()=>{"interactionCount"in performance||Uu||(Uu=Xr("event",yO,{type:"event",buffered:!0,durationThreshold:0}))},vv=()=>SO(),vf=10,zt=[],Ba={},yf=t=>{const e=zt[zt.length-1],n=Ba[t.interactionId];if(n||zt.length<vf||t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};Ba[r.id]=r,zt.push(r)}zt.sort((r,i)=>i.latency-r.latency),zt.splice(vf).forEach(r=>{delete Ba[r.id]})}},EO=()=>{const t=Math.min(zt.length-1,Math.floor(vv()/50));return zt[t]},TO=(t,e)=>{e=e||{},bO();const n=es("INP");let r;const i=o=>{o.forEach(a=>{a.interactionId&&yf(a),a.entryType==="first-input"&&!zt.some(l=>l.entries.some(d=>a.duration===d.duration&&a.startTime===d.startTime))&&yf(a)});const u=EO();u&&u.latency!==n.value&&(n.value=u.latency,n.entries=u.entries,r())},s=Xr("event",i,{durationThreshold:e.durationThreshold||40});r=Zi(t,n,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),ts(()=>{i(s.takeRecords()),n.value<0&&vv()>0&&(n.value=0,n.entries=[]),r(!0)}))},Sf={},IO=t=>{const e=sl(),n=es("LCP");let r;const i=o=>{const u=o[o.length-1];if(u){const a=Math.max(u.startTime-il(),0);a<e.firstHiddenTime&&(n.value=a,n.entries=[u],r())}},s=Xr("largest-contentful-paint",i);if(s){r=Zi(t,n);const o=()=>{Sf[n.id]||(i(s.takeRecords()),s.disconnect(),Sf[n.id]=!0,r(!0))};return["keydown","click"].forEach(u=>{J.document&&addEventListener(u,o,{once:!0,capture:!0})}),ts(o,!0),o}},Fu=t=>{J.document&&(J.document.prerendering?addEventListener("prerenderingchange",()=>Fu(t),!0):J.document.readyState!=="complete"?addEventListener("load",()=>Fu(t),!0):setTimeout(t,0))},wO=(t,e)=>{e=e||{};const n=es("TTFB"),r=Zi(t,n,e.reportAllChanges);Fu(()=>{const i=ga();if(i){if(n.value=Math.max(i.responseStart-il(),0),n.value<0||n.value>performance.now())return;n.entries=[i],r(!0)}})},Ei={},Uo={};let yv,Sv,bv,Ev,Tv;function CO(t,e=!1){return ns("cls",t,AO,yv,e)}function kO(t,e=!1){return ns("lcp",t,MO,bv,e)}function RO(t){return ns("ttfb",t,LO,Ev)}function xO(t){return ns("fid",t,DO,Sv)}function OO(t){return ns("inp",t,NO,Tv)}function Ai(t,e){return Iv(t,e),Uo[t]||(PO(t),Uo[t]=!0),wv(t,e)}function Jr(t,e){const n=Ei[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(i){V&&U.error(`Error while triggering instrumentation handler. Type: ${t} Name: ${Q_(r)} Error:`,i)}}function AO(){return gO(t=>{Jr("cls",{metric:t}),yv=t},{reportAllChanges:!0})}function DO(){return vO(t=>{Jr("fid",{metric:t}),Sv=t})}function MO(){return IO(t=>{Jr("lcp",{metric:t}),bv=t})}function LO(){return wO(t=>{Jr("ttfb",{metric:t}),Ev=t})}function NO(){return TO(t=>{Jr("inp",{metric:t}),Tv=t})}function ns(t,e,n,r,i=!1){Iv(t,e);let s;return Uo[t]||(s=n(),Uo[t]=!0),r&&e({metric:r}),wv(t,e,i?s:void 0)}function PO(t){const e={};t==="event"&&(e.durationThreshold=0),Xr(t,n=>{Jr(t,{entries:n})},e)}function Iv(t,e){Ei[t]=Ei[t]||[],Ei[t].push(e)}function wv(t,e,n){return()=>{n&&n();const r=Ei[t];if(!r)return;const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}function Ha(t){return typeof t=="number"&&isFinite(t)}function Nr(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}const $O=2147483647;function Me(t){return t/1e3}function ol(){return J&&J.addEventListener&&J.performance}let bf=0,Te={},Ct,Ti;function UO(){const t=ol();if(t&&ct){t.mark&&J.performance.mark("sentry-tracing-init");const e=qO(),n=jO(),r=GO(),i=zO();return()=>{e(),n(),r(),i()}}return()=>{}}function FO(){Ai("longtask",({entries:t})=>{for(const e of t){const n=Hn();if(!n)return;const r=Me(ct+e.startTime),i=Me(e.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}})}function BO(){Ai("event",({entries:t})=>{for(const e of t){const n=Hn();if(!n)return;if(e.name==="click"){const r=Me(ct+e.startTime),i=Me(e.duration),s={description:Do(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i},o=PR(e.target);o&&(s.attributes={"ui.component_name":o}),n.startChild(s)}}})}function HO(t,e){if(ol()&&ct){const r=WO(t,e);return()=>{r()}}return()=>{}}function jO(){return CO(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(V&&U.log("[Measurements] Adding CLS"),Te.cls={value:t.value,unit:""},Ti=e)},!0)}function GO(){return kO(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(V&&U.log("[Measurements] Adding LCP"),Te.lcp={value:t.value,unit:"millisecond"},Ct=e)},!0)}function qO(){return xO(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=Me(ct),r=Me(e.startTime);V&&U.log("[Measurements] Adding FID"),Te.fid={value:t.value,unit:"millisecond"},Te["mark.fid"]={value:n+r,unit:"second"}})}function zO(){return RO(({metric:t})=>{t.entries[t.entries.length-1]&&(V&&U.log("[Measurements] Adding TTFB"),Te.ttfb={value:t.value,unit:"millisecond"})})}const Ef={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 WO(t,e){return OO(({metric:n})=>{if(n.value===void 0)return;const r=n.entries.find(S=>S.duration===n.value&&Ef[S.name]!==void 0),i=Vr();if(!r||!i)return;const s=Ef[r.name],o=i.getOptions(),u=Me(ct+r.startTime),a=Me(n.value),c=r.interactionId!==void 0?t[r.interactionId]:void 0;if(c===void 0)return;const{routeName:l,parentContext:d,activeTransaction:f,user:h,replayId:p}=c,m=h!==void 0?h.email||h.id||h.ip_address:void 0,_=f!==void 0?f.getProfileId():void 0,g=new pa({startTimestamp:u,endTimestamp:u+a,op:`ui.interaction.${s}`,name:Do(r.target),attributes:{release:o.release,environment:o.environment,transaction:l,...m!==void 0&&m!==""?{user:m}:{},..._!==void 0?{profile_id:_}:{},...p!==void 0?{replay_id:p}:{}},exclusiveTime:n.value,measurements:{inp:{value:n.value,unit:"millisecond"}}}),v=tA(d,o,e);if(v&&Math.random()<v){const S=g?Xx([g],i.getDsn()):void 0,C=i&&i.getTransport();C&&S&&C.send(S).then(null,R=>{V&&U.error("Error while sending interaction:",R)});return}})}function VO(t){const e=ol();if(!e||!J.performance.getEntries||!ct)return;V&&U.log("[Tracing] Adding & adjusting spans using Performance API");const n=Me(ct),r=e.getEntries(),{op:i,start_timestamp:s}=Ve(t);if(r.slice(bf).forEach(o=>{const u=Me(o.startTime),a=Me(o.duration);if(!(t.op==="navigation"&&s&&n+u<s))switch(o.entryType){case"navigation":{YO(t,o,n);break}case"mark":case"paint":case"measure":{KO(t,o,u,a,n);const c=sl(),l=o.startTime<c.firstHiddenTime;o.name==="first-paint"&&l&&(V&&U.log("[Measurements] Adding FP"),Te.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&l&&(V&&U.log("[Measurements] Adding FCP"),Te.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{JO(t,o,o.name,u,a,n);break}}}),bf=Math.max(r.length-1,0),QO(t),i==="pageload"){eA(Te),["fcp","fp","lcp"].forEach(u=>{if(!Te[u]||!s||n>=s)return;const a=Te[u].value,c=n+Me(a),l=Math.abs((c-s)*1e3),d=l-a;V&&U.log(`[Measurements] Normalized ${u} from ${a} to ${l} (${d})`),Te[u].value=l});const o=Te["mark.fid"];o&&Te.fid&&(Nr(t,{description:"first input delay",endTimestamp:o.value+Me(Te.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete Te["mark.fid"]),"fcp"in Te||delete Te.cls,Object.keys(Te).forEach(u=>{Yx(u,Te[u].value,Te[u].unit)}),ZO(t)}Ct=void 0,Ti=void 0,Te={}}function KO(t,e,n,r,i){const s=i+n,o=s+r;return Nr(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s}),s}function YO(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Ds(t,e,r,n)}),Ds(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Ds(t,e,"fetch",n,"cache","domainLookupStart"),Ds(t,e,"domainLookup",n,"DNS"),XO(t,e,n)}function Ds(t,e,n,r,i,s){const o=s?e[s]:e[`${n}End`],u=e[`${n}Start`];!u||!o||Nr(t,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+Me(u),endTimestamp:r+Me(o)})}function XO(t,e,n){e.responseEnd&&(Nr(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+Me(e.requestStart),endTimestamp:n+Me(e.responseEnd)}),Nr(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+Me(e.responseStart),endTimestamp:n+Me(e.responseEnd)}))}function JO(t,e,n,r,i,s){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const o=la(n),u={};ja(u,e,"transferSize","http.response_transfer_size"),ja(u,e,"encodedBodySize","http.response_content_length"),ja(u,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(u["resource.render_blocking_status"]=e.renderBlockingStatus),o.protocol&&(u["url.scheme"]=o.protocol.split(":").pop()),o.host&&(u["server.address"]=o.host),u["url.same_origin"]=n.includes(J.location.origin);const a=s+r,c=a+i;Nr(t,{description:n.replace(J.location.origin,""),endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:u})}function QO(t){const e=J.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),Ha(n.rtt)&&(Te["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Ha(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),Ha(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function ZO(t){Ct&&(V&&U.log("[Measurements] Adding LCP Data"),Ct.element&&t.setTag("lcp.element",Do(Ct.element)),Ct.id&&t.setTag("lcp.id",Ct.id),Ct.url&&t.setTag("lcp.url",Ct.url.trim().slice(0,200)),t.setTag("lcp.size",Ct.size)),Ti&&Ti.sources&&(V&&U.log("[Measurements] Adding CLS Data"),Ti.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,Do(e.node))))}function ja(t,e,n,r){const i=e[n];i!=null&&i<$O&&(t[r]=i)}function eA(t){const e=ga();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(V&&U.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function tA(t,e,n){if(!Yr(e))return!1;let r;return t!==void 0&&typeof e.tracesSampler=="function"?r=e.tracesSampler({transactionContext:t,name:t.name,parentSampled:t.parentSampled,attributes:{...t.data,...t.attributes},location:J.location}):t!==void 0&&t.sampled!==void 0?r=t.sampled:typeof e.tracesSampleRate<"u"?r=e.tracesSampleRate:r=1,gv(r)?r===!0?n:r===!1?0:r*n:(V&&U.warn("[Tracing] Discarding interaction span because of invalid sample rate."),!1)}function nA(t,e,n,r,i="auto.http.browser"){if(!Yr()||!t.fetchData)return;const s=e(t.fetchData.url);if(t.endTimestamp&&s){const h=t.fetchData.__span;if(!h)return;const p=r[h];p&&(sA(p,t),delete r[h]);return}const o=Kr(),u=Vr(),{method:a,url:c}=t.fetchData,l=iA(c),d=l?la(l).host:void 0,f=s?av({name:`${a} ${c}`,onlyIfParent:!0,attributes:{url:c,type:"fetch","http.method":a,"http.url":l,"server.address":d,[Ln]:i},op:"http.client"}):void 0;if(f&&(t.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f),n(t.fetchData.url)&&u){const h=t.args[0];t.args[1]=t.args[1]||{};const p=t.args[1];p.headers=rA(h,u,o,p,f)}return f}function rA(t,e,n,r,i){const s=i||n.getSpan(),o=Yc(),{traceId:u,spanId:a,sampled:c,dsc:l}={...o.getPropagationContext(),...n.getPropagationContext()},d=s?fa(s):zc(u,a,c),f=tv(l||(s?Lr(s):Kc(u,e,n))),h=r.headers||(typeof Request<"u"&&nf(t,Request)?t.headers:void 0);if(h)if(typeof Headers<"u"&&nf(h,Headers)){const p=new Headers(h);return p.append("sentry-trace",d),f&&p.append(Lu,f),p}else if(Array.isArray(h)){const p=[...h,["sentry-trace",d]];return f&&p.push([Lu,f]),p}else{const p="baggage"in h?h.baggage:void 0,m=[];return Array.isArray(p)?m.push(...p):p&&m.push(p),f&&m.push(f),{...h,"sentry-trace":d,baggage:m.length>0?m.join(","):void 0}}else return{"sentry-trace":d,baggage:f}}function iA(t){try{return new URL(t).href}catch{return}}function sA(t,e){if(e.response){Xc(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus("internal_error");t.end()}const Bu=["localhost",/^\/(?!\/)/],Hu={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:Bu,tracePropagationTargets:Bu};function oA(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o}={traceFetch:Hu.traceFetch,traceXHR:Hu.traceXHR,...t},u=typeof s=="function"?s:l=>!0,a=l=>lA(l,r||i),c={};e&&qR(l=>{const d=nA(l,u,a,c);if(d){const f=Cv(l.fetchData.url),h=f?la(f).host:void 0;d.setAttributes({"http.url":f,"server.address":h})}o&&d&&Tf(d)}),n&&tx(l=>{const d=dA(l,u,a,c);o&&d&&Tf(d)})}function aA(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Tf(t){const{url:e}=Ve(t).data||{};if(!e||typeof e!="string")return;const n=Ai("resource",({entries:r})=>{r.forEach(i=>{aA(i)&&i.name.endsWith(e)&&(cA(i).forEach(o=>t.setAttribute(...o)),setTimeout(n))})})}function uA(t){let e="unknown",n="unknown",r="";for(const i of t){if(i==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(i))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=i}return r===t&&(e=r),{name:e,version:n}}function St(t=0){return((ct||performance.timeOrigin)+t)/1e3}function cA(t){const{name:e,version:n}=uA(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),ct?[...r,["http.request.redirect_start",St(t.redirectStart)],["http.request.fetch_start",St(t.fetchStart)],["http.request.domain_lookup_start",St(t.domainLookupStart)],["http.request.domain_lookup_end",St(t.domainLookupEnd)],["http.request.connect_start",St(t.connectStart)],["http.request.secure_connection_start",St(t.secureConnectionStart)],["http.request.connection_end",St(t.connectEnd)],["http.request.request_start",St(t.requestStart)],["http.request.response_start",St(t.responseStart)],["http.request.response_end",St(t.responseEnd)]]:r}function lA(t,e){return DR(t,e||Bu)}function dA(t,e,n,r){const i=t.xhr,s=i&&i[fi];if(!Yr()||!i||i.__sentry_own_request__||!s)return;const o=e(s.url);if(t.endTimestamp&&o){const h=i.__sentry_xhr_span_id__;if(!h)return;const p=r[h];p&&s.status_code!==void 0&&(Xc(p,s.status_code),p.end(),delete r[h]);return}const u=Kr(),a=Yc(),c=Cv(s.url),l=c?la(c).host:void 0,d=o?av({name:`${s.method} ${s.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":s.method,"http.url":c,url:s.url,"server.address":l,[Ln]:"auto.http.browser"},op:"http.client"}):void 0;d&&(i.__sentry_xhr_span_id__=d.spanContext().spanId,r[i.__sentry_xhr_span_id__]=d);const f=Vr();if(i.setRequestHeader&&n(s.url)&&f){const{traceId:h,spanId:p,sampled:m,dsc:_}={...a.getPropagationContext(),...u.getPropagationContext()},g=d?fa(d):zc(h,p,m),v=tv(_||(d?Lr(d):Kc(h,f,u)));fA(i,g,v)}return d}function fA(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(Lu,n)}catch{}}function Cv(t){try{return new URL(t,J.location.origin).href}catch{return}}function hA(t,e=!0,n=!0){if(!J||!J.location){V&&U.warn("Could not initialize routing instrumentation due to invalid location");return}let r=J.location.href,i;e&&(i=t({name:J.location.pathname,startTimestamp:ct?ct/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&QR(({to:s,from:o})=>{if(o===void 0&&r&&r.indexOf(s)!==-1){r=void 0;return}o!==s&&(r=void 0,i&&(V&&U.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.end()),i=t({name:J.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}const pA="BrowserTracing",gA={...so,markBackgroundTransactions:!0,routingInstrumentation:hA,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...Hu},If=10;let mA=class{constructor(e){this.name=pA,this._hasSetTracePropagationTargets=!1,mv(),V&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...gA,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=UO(),this._interactionIdToRouteNameMapping={},this.options.enableInp&&HO(this._interactionIdToRouteNameMapping,this.options.interactionsSampleRate),this.options.enableLongTask&&FO(),this.options._experiments.enableInteractions&&BO(),this._latestRoute={name:void 0,context:void 0}}setupOnce(e,n){this._getCurrentHub=n;const i=n().getClient(),s=i&&i.getOptions(),{routingInstrumentation:o,startTransactionOnLocationChange:u,startTransactionOnPageLoad:a,markBackgroundTransactions:c,traceFetch:l,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:h,_experiments:p}=this.options,m=s&&s.tracePropagationTargets,_=m||this.options.tracePropagationTargets;V&&this._hasSetTracePropagationTargets&&m&&U.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),o(g=>{const v=this._createRouteTransaction(g);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(v,g,n),v},a,u),c&&fO(),p.enableInteractions&&this._registerInteractionListener(),this.options.enableInp&&this._registerInpInteractionListener(),oA({traceFetch:l,traceXHR:d,tracePropagationTargets:_,shouldCreateSpanForRequest:f,enableHTTPTimings:h})}_createRouteTransaction(e){if(!this._getCurrentHub){V&&U.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}const n=this._getCurrentHub(),{beforeNavigate:r,idleTimeout:i,finalTimeout:s,heartbeatInterval:o}=this.options,u=e.op==="pageload";let a;if(u){const h=u?wf("sentry-trace"):"",p=u?wf("baggage"):void 0,{traceId:m,dsc:_,parentSpanId:g,sampled:v}=px(h,p);a={traceId:m,parentSpanId:g,parentSampled:v,...e,metadata:{...e.metadata,dynamicSamplingContext:_},trimEnd:!0}}else a={trimEnd:!0,...e};const c=typeof r=="function"?r(a):a,l=c===void 0?{...a,sampled:!1}:c;l.metadata=l.name!==a.name?{...l.metadata,source:"custom"}:l.metadata,this._latestRoute.name=l.name,this._latestRoute.context=l,l.sampled===!1&&V&&U.log(`[Tracing] Will not send ${l.op} transaction because of beforeNavigate.`),V&&U.log(`[Tracing] Starting ${l.op} transaction on scope`);const{location:d}=J,f=gf(n,l,i,s,!0,{location:d},o,u);return u&&J.document&&(J.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(J.document.readyState)&&f.sendAutoFinishSignal()}),["interactive","complete"].includes(J.document.readyState)&&f.sendAutoFinishSignal()),f.registerBeforeFinishCallback(h=>{this._collectWebVitals(),VO(h)}),f}_registerInteractionListener(){let e;const n=()=>{const{idleTimeout:r,finalTimeout:i,heartbeatInterval:s}=this.options,o="ui.action.click",u=Hn();if(u&&u.op&&["navigation","pageload"].includes(u.op)){V&&U.warn(`[Tracing] Did not create ${o} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.end(),e=void 0),!this._getCurrentHub){V&&U.warn(`[Tracing] Did not create ${o} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRoute.name){V&&U.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`);return}const a=this._getCurrentHub(),{location:c}=J,l={name:this._latestRoute.name,op:o,trimEnd:!0,data:{[hn]:this._latestRoute.context?_A(this._latestRoute.context):"url"}};e=gf(a,l,r,i,!0,{location:c},s)};["click"].forEach(r=>{J.document&&addEventListener(r,n,{once:!1,capture:!0})})}_registerInpInteractionListener(){const e=({entries:n})=>{const r=Vr(),i=r!==void 0&&r.getIntegrationByName!==void 0?r.getIntegrationByName("Replay"):void 0,s=i!==void 0?i.getReplayId():void 0,o=Hn(),u=Kr(),a=u!==void 0?u.getUser():void 0;n.forEach(c=>{if(vA(c)){const l=c.interactionId;if(l===void 0)return;const d=this._interactionIdToRouteNameMapping[l],f=c.duration,h=c.startTime,p=Object.keys(this._interactionIdToRouteNameMapping),m=p.length>0?p.reduce((_,g)=>this._interactionIdToRouteNameMapping[_].duration<this._interactionIdToRouteNameMapping[g].duration?_:g):void 0;if(c.entryType==="first-input"&&p.map(g=>this._interactionIdToRouteNameMapping[g]).some(g=>g.duration===f&&g.startTime===h)||!l)return;if(d)d.duration=Math.max(d.duration,f);else if(p.length<If||m===void 0||f>this._interactionIdToRouteNameMapping[m].duration){const _=this._latestRoute.name,g=this._latestRoute.context;_&&g&&(m&&Object.keys(this._interactionIdToRouteNameMapping).length>=If&&delete this._interactionIdToRouteNameMapping[m],this._interactionIdToRouteNameMapping[l]={routeName:_,duration:f,parentContext:g,user:a,activeTransaction:o,replayId:s,startTime:h})}}})};Ai("event",e),Ai("first-input",e)}};function wf(t){const e=NR(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function _A(t){const e=t.attributes&&t.attributes[hn],n=t.data&&t.data[hn],r=t.metadata&&t.metadata.source;return e||n||r}function vA(t){return"duration"in t}function yA(){const t=Vn();if(!t.__SENTRY__)return;const e={mongodb(){const r=Mn(module,"./node/integrations/mongo");return new r.Mongo},mongoose(){const r=Mn(module,"./node/integrations/mongo");return new r.Mongo},mysql(){const r=Mn(module,"./node/integrations/mysql");return new r.Mysql},pg(){const r=Mn(module,"./node/integrations/postgres");return new r.Postgres}},n=Object.keys(e).filter(r=>!!Bn(r)).map(r=>{try{return e[r]()}catch{return}}).filter(r=>r);n.length>0&&(t.__SENTRY__.integrations=[...t.__SENTRY__.integrations||[],...n])}function SA(){mv(),sx()&&yA()}const bA=mA,AM={BrowserTracing:bA};(typeof __SENTRY_TRACING__>"u"||__SENTRY_TRACING__)&&SA();var si={},Nt={},Pt={},Cf;function al(){if(Cf)return Pt;Cf=1;var t=Pt&&Pt.__extends||function(){var r=function(i,s){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var a in u)Object.prototype.hasOwnProperty.call(u,a)&&(o[a]=u[a])},r(i,s)};return function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");r(i,s);function o(){this.constructor=i}i.prototype=s===null?Object.create(s):(o.prototype=s.prototype,new o)}}();Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.StatsigInvalidArgumentError=Pt.StatsigUninitializedError=void 0;var e=function(r){t(i,r);function i(s){var o=r.call(this,s??"Call and wait for initialize() to finish first.")||this;return Object.setPrototypeOf(o,i.prototype),o}return i}(Error);Pt.StatsigUninitializedError=e;var n=function(r){t(i,r);function i(s){var o=r.call(this,s)||this;return Object.setPrototypeOf(o,i.prototype),o}return i}(Error);return Pt.StatsigInvalidArgumentError=n,Pt}var nt={},Ms={},kf;function ul(){if(kf)return Ms;kf=1,Object.defineProperty(Ms,"__esModule",{value:!0});var t=function(){function e(n,r,i,s,o,u,a,c,l,d){o===void 0&&(o=[]),u===void 0&&(u=""),a===void 0&&(a=null),c===void 0&&(c=null),l===void 0&&(l=null),d===void 0&&(d=null),this.onDefaultValueFallback=null,this.name=n,this.value=JSON.parse(JSON.stringify(r??{})),this.ruleID=i??"",this.secondaryExposures=o,this.allocatedExperimentName=u,this.evaluationDetails=s,this.onDefaultValueFallback=a,this.groupName=c,this.idType=l,this.isExperimentActive=d}return e.prototype.get=function(n,r,i){var s,o,u=this.getValue(n,r);if(u==null)return r;var a=Array.isArray(r)?"array":typeof r,c=Array.isArray(u)?"array":typeof u;return i?i(u)?u:((s=this.onDefaultValueFallback)===null||s===void 0||s.call(this,this,n,a,c),r):r==null||a===c?u:((o=this.onDefaultValueFallback)===null||o===void 0||o.call(this,this,n,a,c),r)},e.prototype.getValue=function(n,r){return n==null?this.value:(r==null&&(r=null),this.value[n]==null?r:this.value[n])},e.prototype.getRuleID=function(){return this.ruleID},e.prototype.getGroupName=function(){return this.groupName},e.prototype.getIDType=function(){return this.idType},e.prototype.getName=function(){return this.name},e.prototype.getEvaluationDetails=function(){return this.evaluationDetails},e.prototype._getSecondaryExposures=function(){return this.secondaryExposures},e.prototype._getAllocatedExperimentName=function(){return this.allocatedExperimentName},e.prototype.getIsExperimentActive=function(){return this.isExperimentActive},e}();return Ms.default=t,Ms}var $t={},tn={},wn={},Rf;function kv(){if(Rf)return wn;Rf=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.difference=wn.now=void 0;function t(n){return n===void 0&&(n={withPrecision:!1}),typeof performance>"u"||!performance?Date.now():n.withPrecision?performance.now():performance.now()|0}wn.now=t;function e(n){return t()-n}return wn.difference=e,wn}var xf;function ma(){if(xf)return tn;xf=1;var t=tn&&tn.__assign||function(){return t=Object.assign||function(i){for(var s,o=1,u=arguments.length;o<u;o++){s=arguments[o];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},t.apply(this,arguments)};Object.defineProperty(tn,"__esModule",{value:!0}),tn.DiagnosticsImpl=void 0;var e=kv(),n=function(){function i(s){var o=this,u,a,c;this.mark={overall:this.selectAction("overall"),intialize:this.selectStep("initialize"),bootstrap:this.selectStep("bootstrap"),api_call:function(l){switch(l){case"getConfig":return o.selectAction("get_config");case"getExperiment":return o.selectAction("get_experiment");case"checkGate":return o.selectAction("check_gate");case"getLayer":return o.selectAction("get_layer")}return null}},this.context="initialize",this.defaultMaxMarkers=30,this.maxMarkers={initialize:this.defaultMaxMarkers,config_sync:this.defaultMaxMarkers,event_logging:this.defaultMaxMarkers,api_call:this.defaultMaxMarkers},this.markers=(u=s.markers)!==null&&u!==void 0?u:{initialize:[],config_sync:[],event_logging:[],api_call:[]},this.disabled=(c=(a=s.options)===null||a===void 0?void 0:a.getDisableDiagnosticsLogging())!==null&&c!==void 0?c:!1}return i.prototype.setContext=function(s){this.context=s},i.prototype.selectAction=function(s,o){var u=this;return{start:function(a,c){return u.addMarker(t({key:s,step:o,action:"start",timestamp:(0,e.now)({withPrecision:!0})},a??{}),c)},end:function(a,c){return u.addMarker(t({key:s,step:o,action:"end",timestamp:(0,e.now)({withPrecision:!0})},a??{}),c)}}},i.prototype.selectStep=function(s){return{process:this.selectAction(s,"process"),networkRequest:this.selectAction(s,"network_request")}},i.prototype.addMarker=function(s,o){var u;if(this.disabled)return!1;var a=o??this.context;return this.maxMarkers[a]!==void 0&&this.markers[a].length>=((u=this.maxMarkers[a])!==null&&u!==void 0?u:this.defaultMaxMarkers)?!1:(this.markers[a].push(s),!0)},i.prototype.getMarkers=function(s){return this.markers[s]},i.prototype.setMaxMarkers=function(s,o){this.maxMarkers[s]=o},i.prototype.getMarkerCount=function(s){return this.markers[s].length},i.prototype.clearContext=function(s){this.markers[s]=[]},i}();tn.DiagnosticsImpl=n;var r=function(){function i(){}return i.initialize=function(s){this.instance=new n(s),this.mark=this.instance.mark,this.disabled=this.instance.disabled,this.getMarkers=this.instance.getMarkers.bind(this.instance),this.getMarkerCount=this.instance.getMarkerCount.bind(this.instance),this.setMaxMarkers=this.instance.setMaxMarkers.bind(this.instance),this.setContext=this.instance.setContext.bind(this.instance),this.clearContext=this.instance.clearContext.bind(this.instance)},i.formatError=function(s){if(s&&typeof s=="object")return{code:this.safeGetField(s,"code"),name:this.safeGetField(s,"name"),message:this.safeGetField(s,"message")}},i.safeGetField=function(s,o){if(o in s)return s[o]},i}();return tn.default=r,tn}var Ls={},Of;function EA(){if(Of)return Ls;Of=1,Object.defineProperty(Ls,"__esModule",{value:!0});function t(n){var r=n??Error("[Statsig] Error was empty"),i=r instanceof Error,s=i?r.name:"No Name",o=i?r.message:void 0,u=i?r.stack:e(r);return{name:s,message:o,trace:u}}Ls.default=t;function e(n){try{return JSON.stringify(n)}catch{return"[Statsig] Failed to get string for error."}}return Ls}var Af;function TA(){return Af||(Af=1,function(t){var e=$t&&$t.__awaiter||function(l,d,f,h){function p(m){return m instanceof f?m:new f(function(_){_(m)})}return new(f||(f=Promise))(function(m,_){function g(C){try{S(h.next(C))}catch(R){_(R)}}function v(C){try{S(h.throw(C))}catch(R){_(R)}}function S(C){C.done?m(C.value):p(C.value).then(g,v)}S((h=h.apply(l,d||[])).next())})},n=$t&&$t.__generator||function(l,d){var f={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},h,p,m,_;return _={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function g(S){return function(C){return v([S,C])}}function v(S){if(h)throw new TypeError("Generator is already executing.");for(;f;)try{if(h=1,p&&(m=S[0]&2?p.return:S[0]?p.throw||((m=p.return)&&m.call(p),0):p.next)&&!(m=m.call(p,S[1])).done)return m;switch(p=0,m&&(S=[S[0]&2,m.value]),S[0]){case 0:case 1:m=S;break;case 4:return f.label++,{value:S[1],done:!1};case 5:f.label++,p=S[1],S=[0];continue;case 7:S=f.ops.pop(),f.trys.pop();continue;default:if(m=f.trys,!(m=m.length>0&&m[m.length-1])&&(S[0]===6||S[0]===2)){f=0;continue}if(S[0]===3&&(!m||S[1]>m[0]&&S[1]<m[3])){f.label=S[1];break}if(S[0]===6&&f.label<m[1]){f.label=m[1],m=S;break}if(m&&f.label<m[2]){f.label=m[2],f.ops.push(S);break}m[2]&&f.ops.pop(),f.trys.pop();continue}S=d.call(l,f)}catch(C){S=[6,C],p=0}finally{h=m=0}if(S[0]&5)throw S[1];return{value:S[0]?S[1]:void 0,done:!0}}},r=$t&&$t.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExceptionEndpoint=void 0;var i=al(),s=r(ma()),o=r(EA());t.ExceptionEndpoint="https://statsigapi.net/v1/sdk_exception";var u=30,a=1e4,c=function(){function l(d){this.sdkKey=d,this.seen=new Set;var f=Math.floor(Math.random()*a);this.setupDiagnostics(f===0?u:0)}return l.prototype.setStatsigMetadata=function(d){this.statsigMetadata=d},l.prototype.swallow=function(d,f,h){h===void 0&&(h={}),this.capture(d,f,function(){},h)},l.prototype.capture=function(d,f,h,p){var m=this,_=p===void 0?{}:p,g=_.getExtraData,v=_.configName,S=null;try{S=this.beginMarker(d);var C=f(),R=!0;return C instanceof Promise?C.catch(function(E){return R=!1,m.onCaught(d,E,h,g)}).then(function(E){return m.endMarker(d,R,S),E}):(this.endMarker(d,!0,S,v),C)}catch(E){return this.endMarker(d,!1,S,v),this.onCaught(d,E,h,g)}},l.prototype.logError=function(d,f,h){var p=this;(function(){return e(p,void 0,void 0,function(){var m,_,g,v,S,C,R,E;return n(this,function(x){switch(x.label){case 0:return x.trys.push([0,4,,5]),typeof h!="function"?[3,2]:[4,h()];case 1:return _=x.sent(),[3,3];case 2:_=null,x.label=3;case 3:return m=_,g=(0,o.default)(f),v=g.name,S=g.trace,this.seen.has(v)?[2]:(this.seen.add(v),C=(E=this.statsigMetadata)!==null&&E!==void 0?E:{},R=JSON.stringify({tag:d,exception:v,info:S,statsigMetadata:C,extra:m??{}}),[2,fetch(t.ExceptionEndpoint,{method:"POST",headers:{"STATSIG-API-KEY":this.sdkKey,"STATSIG-SDK-TYPE":String(C.sdkType),"STATSIG-SDK-VERSION":String(C.sdkVersion),"Content-Type":"application/json; charset=UTF-8"},body:R})]);case 4:return x.sent(),[3,5];case 5:return[2]}})})})().catch(function(){})},l.prototype.setupDiagnostics=function(d){s.default.setMaxMarkers("api_call",d)},l.prototype.beginMarker=function(d){var f=s.default.mark.api_call(d);if(!f)return null;var h=s.default.getMarkerCount("api_call"),p=d+"_"+h,m=f.start({markerID:p},"api_call");return m?p:null},l.prototype.endMarker=function(d,f,h,p){var m=s.default.mark.api_call(d);!h||!m||m.end({markerID:h,success:f,configName:p},"api_call")},l.prototype.onCaught=function(d,f,h,p){if(f instanceof i.StatsigUninitializedError||f instanceof i.StatsigInvalidArgumentError)throw f;return console.error("[Statsig] An unexpected exception occurred.",f),this.logError(d,f,p),h()},l}();t.default=c}($t)),$t}var Ns={},Df;function cl(){if(Df)return Ns;Df=1,Object.defineProperty(Ns,"__esModule",{value:!0});var t=function(){function e(n,r,i,s,o,u,a,c,l,d){o===void 0&&(o=null),u===void 0&&(u=[]),a===void 0&&(a=[]),c===void 0&&(c=""),l===void 0&&(l=[]),d===void 0&&(d=null),this.logParameterFunction=o,this.name=n,this.value=JSON.parse(JSON.stringify(r??{})),this.ruleID=i??"",this.evaluationDetails=s,this.secondaryExposures=u,this.undelegatedSecondaryExposures=a,this.allocatedExperimentName=c,this.explicitParameters=l,this.groupName=d}return e._create=function(n,r,i,s,o,u,a,c,l,d){return o===void 0&&(o=null),u===void 0&&(u=[]),a===void 0&&(a=[]),c===void 0&&(c=""),l===void 0&&(l=[]),d===void 0&&(d=null),new e(n,r,i,s,o,u,a,c,l,d)},e.prototype.get=function(n,r,i){var s=this,o=this.value[n];if(o==null)return r;var u=function(){return s.logLayerParameterExposure(n),o};return i?i(o)?u():r:r==null||typeof o==typeof r&&Array.isArray(r)===Array.isArray(o)?u():r},e.prototype.getValue=function(n,r){r==null&&(r=null);var i=this.value[n];return i!=null&&this.logLayerParameterExposure(n),i??r},e.prototype.getRuleID=function(){return this.ruleID},e.prototype.getGroupName=function(){return this.groupName},e.prototype.getName=function(){return this.name},e.prototype.getEvaluationDetails=function(){return this.evaluationDetails},e.prototype._getSecondaryExposures=function(){return this.secondaryExposures},e.prototype._getUndelegatedSecondaryExposures=function(){return this.undelegatedSecondaryExposures},e.prototype._getAllocatedExperimentName=function(){return this.allocatedExperimentName},e.prototype._getExplicitParameters=function(){return this.explicitParameters},e.prototype._getEvaluationDetails=function(){return this.evaluationDetails},e.prototype.logLayerParameterExposure=function(n){var r;(r=this.logParameterFunction)===null||r===void 0||r.call(this,this,n)},e}();return Ns.default=t,Ns}var nr={},Mf;function Rv(){if(Mf)return nr;Mf=1;var t=nr&&nr.__assign||function(){return t=Object.assign||function(n){for(var r,i=1,s=arguments.length;i<s;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},t.apply(this,arguments)};Object.defineProperty(nr,"__esModule",{value:!0});var e=function(){function n(r){this.user=null,this.value=null,this.metadata=null,this.eventName=r,this.statsigMetadata={},this.time=Date.now()}return n.prototype.getName=function(){return this.eventName},n.prototype.setValue=function(r){this.value=r},n.prototype.setMetadata=function(r){this.metadata=r},n.prototype.addStatsigMetadata=function(r,i){this.statsigMetadata[r]=i},n.prototype.setUser=function(r){this.user=t({},r),delete this.user.privateAttributes},n.prototype.setSecondaryExposures=function(r){r===void 0&&(r=[]),this.secondaryExposures=r},n.prototype.toJsonObject=function(){var r;return{eventName:this.eventName,user:this.user,value:this.value,metadata:this.metadata,time:this.time,statsigMetadata:this.statsigMetadata,secondaryExposures:(r=this.secondaryExposures)!==null&&r!==void 0?r:void 0}},n}();return nr.default=e,nr}var bt={};const IA=Gh(ty);var Be={},Lf;function _a(){return Lf||(Lf=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.STORAGE_PREFIX=Be.LOCAL_STORAGE_KEYS=Be.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY=Be.STATSIG_STABLE_ID_KEY=Be.INTERNAL_STORE_KEY=Be.STICKY_DEVICE_EXPERIMENTS_KEY=Be.OVERRIDES_STORE_KEY=void 0,Be.OVERRIDES_STORE_KEY="STATSIG_LOCAL_STORAGE_INTERNAL_STORE_OVERRIDES_V3",Be.STICKY_DEVICE_EXPERIMENTS_KEY="STATSIG_LOCAL_STORAGE_STICKY_DEVICE_EXPERIMENTS",Be.INTERNAL_STORE_KEY="STATSIG_LOCAL_STORAGE_INTERNAL_STORE_V4",Be.STATSIG_STABLE_ID_KEY="STATSIG_LOCAL_STORAGE_STABLE_ID",Be.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY="STATSIG_LOCAL_STORAGE_LOGGING_REQUEST",Be.LOCAL_STORAGE_KEYS={STATSIG_LOCAL_STORAGE_STABLE_ID:!0,STATSIG_LOCAL_STORAGE_INTERNAL_STORE_V4:!0,STATSIG_LOCAL_STORAGE_STICKY_DEVICE_EXPERIMENTS:!0,STATSIG_LOCAL_STORAGE_INTERNAL_STORE_OVERRIDES_V3:!0,STATSIG_LOCAL_STORAGE_LOGGING_REQUEST:!0},Be.STORAGE_PREFIX="STATSIG_LOCAL_STORAGE"),Be}var Ps={},Nf;function rs(){if(Nf)return Ps;Nf=1,Object.defineProperty(Ps,"__esModule",{value:!0});var t=function(){function e(){}return e.getItemAsync=function(n){var r;return e.asyncStorage?(r=e.asyncStorage.getItem(n))!==null&&r!==void 0?r:null:Promise.resolve(null)},e.setItemAsync=function(n,r){return e.asyncStorage?e.asyncStorage.setItem(n,r):Promise.resolve()},e.removeItemAsync=function(n){return e.asyncStorage?e.asyncStorage.removeItem(n):Promise.resolve()},e}();return Ps.default=t,Ps}var $s={},Pf;function va(){if(Pf)return $s;Pf=1,Object.defineProperty($s,"__esModule",{value:!0});var t=_a(),e=function(){function n(){}return n.getItem=function(r){var i;try{if(this.isStorageAccessible())return window.localStorage.getItem(r)}catch{}return(i=this.fallbackSessionCache[r])!==null&&i!==void 0?i:null},n.setItem=function(r,i){try{if(this.isStorageAccessible()){window.localStorage.setItem(r,i);return}}catch{}this.fallbackSessionCache[r]=i},n.removeItem=function(r){try{if(this.isStorageAccessible()){window.localStorage.removeItem(r);return}}catch{}delete this.fallbackSessionCache[r]},n.cleanup=function(){try{if(this.isStorageAccessible(!0))for(var r in window.localStorage)typeof window.localStorage[r]=="string"&&r!=null&&(!this.disabled&&r in t.LOCAL_STORAGE_KEYS||!this.disabled&&r.substring(0,t.STORAGE_PREFIX.length)!==t.STORAGE_PREFIX||window.localStorage.removeItem(r))}catch{}},n.isStorageAccessible=function(r){r===void 0&&(r=!1),this.canAccessStorageAccessible==null&&(this.canAccessStorageAccessible=typeof Storage<"u"&&typeof window<"u"&&window!=null&&window.localStorage!=null);var i=this.canAccessStorageAccessible;return(r||!this.disabled)&&i},n.disabled=!1,n.fallbackSessionCache={},n.canAccessStorageAccessible=null,n}();return $s.default=e,$s}var oi={},$f;function wA(){return $f||($f=1,Object.defineProperty(oi,"__esModule",{value:!0}),oi.version=void 0,oi.version="4.42.0"),oi}var Uf;function CA(){if(Uf)return bt;Uf=1;var t=bt&&bt.__awaiter||function(c,l,d,f){function h(p){return p instanceof d?p:new d(function(m){m(p)})}return new(d||(d=Promise))(function(p,m){function _(S){try{v(f.next(S))}catch(C){m(C)}}function g(S){try{v(f.throw(S))}catch(C){m(C)}}function v(S){S.done?p(S.value):h(S.value).then(_,g)}v((f=f.apply(c,l||[])).next())})},e=bt&&bt.__generator||function(c,l){var d={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},f,h,p,m;return m={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function _(v){return function(S){return g([v,S])}}function g(v){if(f)throw new TypeError("Generator is already executing.");for(;d;)try{if(f=1,h&&(p=v[0]&2?h.return:v[0]?h.throw||((p=h.return)&&p.call(h),0):h.next)&&!(p=p.call(h,v[1])).done)return p;switch(h=0,p&&(v=[v[0]&2,p.value]),v[0]){case 0:case 1:p=v;break;case 4:return d.label++,{value:v[1],done:!1};case 5:d.label++,h=v[1],v=[0];continue;case 7:v=d.ops.pop(),d.trys.pop();continue;default:if(p=d.trys,!(p=p.length>0&&p[p.length-1])&&(v[0]===6||v[0]===2)){d=0;continue}if(v[0]===3&&(!p||v[1]>p[0]&&v[1]<p[3])){d.label=v[1];break}if(v[0]===6&&d.label<p[1]){d.label=p[1],p=v;break}if(p&&d.label<p[2]){d.label=p[2],d.ops.push(v);break}p[2]&&d.ops.pop(),d.trys.pop();continue}v=l.call(c,d)}catch(S){v=[6,S],h=0}finally{f=p=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},n=bt&&bt.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(bt,"__esModule",{value:!0});var r=IA,i=_a(),s=n(rs()),o=n(va()),u=wA(),a=function(){function c(l,d,f){var h;this.platform=null,this.nativeModules=null,this.sdkType="js-client",this.reactNativeUUID=f,this.user=l,this.sdkVersion=u.version,this.statsigMetadata={sdkType:this.sdkType,sdkVersion:this.sdkVersion};var p=d;s.default.asyncStorage||(p=(h=p??o.default.getItem(i.STATSIG_STABLE_ID_KEY))!==null&&h!==void 0?h:this.getUUID()),p&&(this.statsigMetadata.stableID=p)}return c.prototype.saveStableID=function(){this.statsigMetadata.stableID!=null&&o.default.setItem(i.STATSIG_STABLE_ID_KEY,this.statsigMetadata.stableID)},c.prototype.initAsync=function(){return t(this,void 0,void 0,function(){var l;return e(this,function(d){switch(d.label){case 0:return l=this.statsigMetadata.stableID,l?[3,2]:[4,s.default.getItemAsync(i.STATSIG_STABLE_ID_KEY)];case 1:l=d.sent(),l=l??this.getUUID(),d.label=2;case 2:return s.default.setItemAsync(i.STATSIG_STABLE_ID_KEY,l).catch(function(){}),this.statsigMetadata.stableID=l,[2,this]}})})},c.prototype.getSDKType=function(){return this.sdkType},c.prototype.getSDKVersion=function(){return this.sdkVersion},c.prototype.getStatsigMetadata=function(){return this.statsigMetadata.sdkType=this.sdkType,this.statsigMetadata.sdkVersion=this.sdkVersion,this.statsigMetadata},c.prototype.getUser=function(){return this.user},c.prototype.updateUser=function(l){this.user=l},c.prototype.setSDKPackageInfo=function(l){this.sdkType=l.sdkType,this.sdkVersion=l.sdkVersion},c.prototype.setPlatform=function(l){this.platform=l,this.updateMetadataFromNativeModules()},c.prototype.setNativeModules=function(l){this.nativeModules=l,this.updateMetadataFromNativeModules()},c.prototype.updateMetadataFromNativeModules=function(){var l,d,f,h,p,m,_;this.platform==null||this.nativeModules==null||(((l=this.platform.OS)===null||l===void 0?void 0:l.toLocaleLowerCase())==="android"?this.statsigMetadata.locale=(d=this.nativeModules.I18nManager)===null||d===void 0?void 0:d.localeIdentifier:((f=this.platform.OS)===null||f===void 0?void 0:f.toLocaleLowerCase())==="ios"&&(this.statsigMetadata.locale=((p=(h=this.nativeModules.SettingsManager)===null||h===void 0?void 0:h.settings)===null||p===void 0?void 0:p.AppleLocale)||((_=(m=this.nativeModules.SettingsManager)===null||m===void 0?void 0:m.settings)===null||_===void 0?void 0:_.AppleLanguages[0])))},c.prototype.getUUID=function(){var l,d;return(d=(l=this.reactNativeUUID)===null||l===void 0?void 0:l.v4())!==null&&d!==void 0?d:(0,r.v4)()},c.prototype.setRNDeviceInfo=function(l){var d,f,h,p,m;this.statsigMetadata.appVersion=(d=l.getVersion())!==null&&d!==void 0?d:"",this.statsigMetadata.systemVersion=(f=l.getSystemVersion())!==null&&f!==void 0?f:"",this.statsigMetadata.systemName=(h=l.getSystemName())!==null&&h!==void 0?h:"",this.statsigMetadata.deviceModelName=(p=l.getModel())!==null&&p!==void 0?p:"",this.statsigMetadata.deviceModel=(m=l.getDeviceId())!==null&&m!==void 0?m:""},c.prototype.setExpoConstants=function(l){var d,f;this.statsigMetadata.appVersion=(f=(d=l.nativeAppVersion)!==null&&d!==void 0?d:l.nativeBuildVersion)!==null&&f!==void 0?f:""},c.prototype.setExpoDevice=function(l){var d,f,h,p;this.statsigMetadata.systemVersion=(d=l.osVersion)!==null&&d!==void 0?d:"",this.statsigMetadata.systemName=(f=l.osName)!==null&&f!==void 0?f:"",this.statsigMetadata.deviceModelName=(h=l.modelName)!==null&&h!==void 0?h:"",this.statsigMetadata.deviceModel=(p=l.modelId)!==null&&p!==void 0?p:""},c}();return bt.default=a,bt}var Et={},Ut={},Us={},Ff;function xv(){if(Ff)return Us;Ff=1,Object.defineProperty(Us,"__esModule",{value:!0});var t=function(){function e(){}return e.encodeInitializeCall=!0,e}();return Us.default=t,Us}var Bf;function Ov(){return Bf||(Bf=1,function(t){var e=Ut&&Ut.__awaiter||function(c,l,d,f){function h(p){return p instanceof d?p:new d(function(m){m(p)})}return new(d||(d=Promise))(function(p,m){function _(S){try{v(f.next(S))}catch(C){m(C)}}function g(S){try{v(f.throw(S))}catch(C){m(C)}}function v(S){S.done?p(S.value):h(S.value).then(_,g)}v((f=f.apply(c,l||[])).next())})},n=Ut&&Ut.__generator||function(c,l){var d={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},f,h,p,m;return m={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function _(v){return function(S){return g([v,S])}}function g(v){if(f)throw new TypeError("Generator is already executing.");for(;d;)try{if(f=1,h&&(p=v[0]&2?h.return:v[0]?h.throw||((p=h.return)&&p.call(h),0):h.next)&&!(p=p.call(h,v[1])).done)return p;switch(h=0,p&&(v=[v[0]&2,p.value]),v[0]){case 0:case 1:p=v;break;case 4:return d.label++,{value:v[1],done:!1};case 5:d.label++,h=v[1],v=[0];continue;case 7:v=d.ops.pop(),d.trys.pop();continue;default:if(p=d.trys,!(p=p.length>0&&p[p.length-1])&&(v[0]===6||v[0]===2)){d=0;continue}if(v[0]===3&&(!p||v[1]>p[0]&&v[1]<p[3])){d.label=v[1];break}if(v[0]===6&&d.label<p[1]){d.label=p[1],p=v;break}if(p&&d.label<p[2]){d.label=p[2],d.ops.push(v);break}p[2]&&d.ops.pop(),d.trys.pop();continue}v=l.call(c,d)}catch(S){v=[6,S],h=0}finally{f=p=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},r=Ut&&Ut.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEndpoint=void 0;var i=r(xv()),s=r(ma()),o;(function(c){c.Initialize="initialize",c.Rgstr="rgstr",c.LogEventBeacon="log_event_beacon"})(o=t.StatsigEndpoint||(t.StatsigEndpoint={}));var u=204,a=function(){function c(l){this.retryCodes={408:!0,500:!0,502:!0,503:!0,504:!0,522:!0,524:!0,599:!0},this.canUseKeepalive=!1,this.sdkInternal=l,this.leakyBucket={},this.init()}return c.prototype.init=function(){if(!this.sdkInternal.getOptions().getDisableNetworkKeepalive())try{this.canUseKeepalive="keepalive"in new Request("")}catch{this.canUseKeepalive=!1}},c.prototype.fetchValues=function(l){var d=l.user,f=l.sinceTime,h=l.timeout,p=l.useDeltas,m=l.prefetchUsers,_=l.previousDerivedFields,g=l.hadBadDeltaChecksum,v=l.badChecksum,S={user:d,prefetchUsers:m,statsigMetadata:this.sdkInternal.getStatsigMetadata(),sinceTime:f??void 0,canProcessDeltas:p,hash:"djb2",previousDerivedFields:_,hadBadDeltaChecksum:g,badChecksum:v};return this.postWithTimeout(o.Initialize,S,{timeout:h,retries:3,diagnostics:s.default.mark.intialize.networkRequest})},c.prototype.postWithTimeout=function(l,d,f){var h=this,p=f??{},m=p.timeout,_=m===void 0?0:m,g=p.retries,v=g===void 0?0:g,S=p.backoff,C=S===void 0?1e3:S,R=p.diagnostics,E=R===void 0?null:R,x=!1,T=null,y=null,b=[],I=function(M){return function(A){return x&&y?A(y):b.push(A),M}};_!=0&&(T=new Promise(function(M,A){setTimeout(function(){x=!0,A(new Error("The initialization timeout of "+_+"ms has been hit before the network request has completed."))},_)}));var k,w=this.postToEndpoint(l,d,{retryOptions:{retryLimit:v,backoff:C},diagnostics:E}).then(function(M){if(k=M,!k.ok)return Promise.reject(new Error("Request to "+l+" failed with status "+k.status));if(typeof k.data!="object"){var A=new Error("Request to "+l+" received invalid response type. Expected 'object' but got '"+typeof k.data+"'");return h.sdkInternal.getErrorBoundary().logError("postWithTimeoutInvalidRes",A,function(){return e(h,void 0,void 0,function(){return n(this,function(P){return[2,this.getErrorData(l,d,v,C,k)]})})}),Promise.reject(A)}var L=k.data;return h.sdkInternal.getErrorBoundary().capture("postWithTimeout",function(){return e(h,void 0,void 0,function(){return n(this,function(P){return y=L,x&&(b.forEach(function($){return $(L)}),b=[]),[2,Promise.resolve(L)]})})},function(){return Promise.resolve({})},{getExtraData:function(){return e(h,void 0,void 0,function(){return n(this,function(P){return[2,this.getErrorData(l,d,v,C,k)]})})}})}).catch(function(M){return Promise.reject(M)}),D=T?Promise.race([w,T]):w;return D.eventually=I(D),D},c.prototype.sendLogBeacon=function(l){var d=this.sdkInternal.getOptions();if(d.getLocalModeEnabled())return!0;var f=new URL(d.getEventLoggingApi()+o.LogEventBeacon);f.searchParams.append("k",this.sdkInternal.getSDKKey()),l.clientTime=Date.now()+"";var h=null;try{h=JSON.stringify(l)}catch{return!1}return navigator.sendBeacon(f.toString(),h)},c.prototype.postToEndpoint=function(l,d,f){var h;return e(this,void 0,void 0,function(){var p,m,_,g,v,S,C,R,E,x,T,y,b,I,k,w,D,M,A,L,P,$,N=this;return n(this,function(j){if(p=f??{},m=p.useKeepalive,_=m===void 0?!1:m,g=p.diagnostics,v=g===void 0?null:g,S=(h=f?.retryOptions)!==null&&h!==void 0?h:{},C=S.retryLimit,R=C===void 0?0:C,E=S.attempt,x=E===void 0?1:E,T=S.backoff,y=T===void 0?1e3:T,b=this.sdkInternal.getOptions(),b.getLocalModeEnabled())return[2,Promise.reject("no network requests in localMode")];if(typeof fetch!="function")return[2,Promise.reject("fetch is not defined")];if(typeof window>"u"&&!b.getIgnoreWindowUndefined())return[2,Promise.reject("window is not defined")];if(I=[o.Initialize].includes(l)?b.getApi():b.getEventLoggingApi(),k=I+l,w=this.leakyBucket[k],w!=null&&w>=30)return[2,Promise.reject(new Error("Request failed because you are making the same request too frequently."))];if(w==null?this.leakyBucket[k]=1:this.leakyBucket[k]=w+1,D=l===o.Initialize&&i.default.encodeInitializeCall&&typeof window<"u"&&typeof window?.btoa=="function",M=JSON.stringify(d),D)try{A=window.btoa(M).split("").reverse().join(""),M=A}catch{D=!1}return L={method:"POST",body:M,headers:{"Content-type":"application/json; charset=UTF-8","STATSIG-API-KEY":this.sdkInternal.getSDKKey(),"STATSIG-CLIENT-TIME":Date.now()+"","STATSIG-SDK-TYPE":this.sdkInternal.getSDKType(),"STATSIG-SDK-VERSION":this.sdkInternal.getSDKVersion(),"STATSIG-ENCODED":D?"1":"0"}},this.canUseKeepalive&&_&&(L.keepalive=!0),v?.start({attempt:x}),$=!0,[2,fetch(k,L).then(function(q){return e(N,void 0,void 0,function(){var Q,ge,ye;return n(this,function(ze){switch(ze.label){case 0:return P=q,P.ok?(Q=P,P.status!==u?[3,1]:(Q.data={has_updates:!1,is_no_content:!0},[3,3])):[3,4];case 1:return[4,P.text()];case 2:ge=ze.sent(),Q.data=JSON.parse(ge),ze.label=3;case 3:return v?.end(this.getDiagnosticsData(P,x)),[2,Promise.resolve(Q)];case 4:return this.retryCodes[P.status]||($=!1),[4,P.text()];case 5:return ye=ze.sent(),[2,Promise.reject(new Error(P.status+": "+ye))]}})})}).catch(function(q){return v?.end(N.getDiagnosticsData(P,x,q)),x<R&&$?new Promise(function(Q,ge){setTimeout(function(){N.leakyBucket[k]=Math.max(N.leakyBucket[k]-1,0),N.postToEndpoint(l,d,{retryOptions:{retryLimit:R,attempt:x+1,backoff:y*2},useKeepalive:_,diagnostics:v}).then(Q).catch(ge)},y)}):Promise.reject(q)}).finally(function(){N.leakyBucket[k]=Math.max(N.leakyBucket[k]-1,0)})]})})},c.prototype.supportsKeepalive=function(){return this.canUseKeepalive},c.prototype.getDiagnosticsData=function(l,d,f){var h,p;return{success:l?.ok===!0,statusCode:l?.status,sdkRegion:(h=l?.headers)===null||h===void 0?void 0:h.get("x-statsig-region"),isDelta:((p=l?.data)===null||p===void 0?void 0:p.is_delta)===!0,attempt:d,error:s.default.formatError(f)}},c.prototype.getErrorData=function(l,d,f,h,p){var m;return e(this,void 0,void 0,function(){var _;return n(this,function(g){try{return _={},((m=p.headers)!==null&&m!==void 0?m:[]).forEach(function(v,S){_[S]=v}),[2,{responseInfo:{headers:_,status:p.status,statusText:p.statusText,type:p.type,url:p.url,redirected:p.redirected,bodySnippet:p.data?JSON.stringify(p.data).slice(0,500):null},requestInfo:{endpointName:l,bodySnippet:JSON.stringify(d).slice(0,500),retries:f,backoff:h}}]}catch{return[2,{statusText:"statsig::failed to extract extra data"}]}return[2]})})},c}();t.default=a}(Ut)),Ut}var Hf;function kA(){if(Hf)return Et;Hf=1;var t=Et&&Et.__awaiter||function(I,k,w,D){function M(A){return A instanceof w?A:new w(function(L){L(A)})}return new(w||(w=Promise))(function(A,L){function P(j){try{N(D.next(j))}catch(q){L(q)}}function $(j){try{N(D.throw(j))}catch(q){L(q)}}function N(j){j.done?A(j.value):M(j.value).then(P,$)}N((D=D.apply(I,k||[])).next())})},e=Et&&Et.__generator||function(I,k){var w={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},D,M,A,L;return L={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function P(N){return function(j){return $([N,j])}}function $(N){if(D)throw new TypeError("Generator is already executing.");for(;w;)try{if(D=1,M&&(A=N[0]&2?M.return:N[0]?M.throw||((A=M.return)&&A.call(M),0):M.next)&&!(A=A.call(M,N[1])).done)return A;switch(M=0,A&&(N=[N[0]&2,A.value]),N[0]){case 0:case 1:A=N;break;case 4:return w.label++,{value:N[1],done:!1};case 5:w.label++,M=N[1],N=[0];continue;case 7:N=w.ops.pop(),w.trys.pop();continue;default:if(A=w.trys,!(A=A.length>0&&A[A.length-1])&&(N[0]===6||N[0]===2)){w=0;continue}if(N[0]===3&&(!A||N[1]>A[0]&&N[1]<A[3])){w.label=N[1];break}if(N[0]===6&&w.label<A[1]){w.label=A[1],A=N;break}if(A&&w.label<A[2]){w.label=A[2],w.ops.push(N);break}A[2]&&w.ops.pop(),w.trys.pop();continue}N=k.call(I,w)}catch(j){N=[6,j],M=0}finally{D=A=0}if(N[0]&5)throw N[1];return{value:N[0]?N[1]:void 0,done:!0}}},n=Et&&Et.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(Et,"__esModule",{value:!0});var r=n(Rv()),i=Ov(),s=_a(),o=n(ma()),u=n(rs()),a=n(va()),c="statsig::",l=c+"config_exposure",d=c+"layer_exposure",f=c+"gate_exposure",h=c+"log_event_failed",p=c+"app_error",m=c+"app_metrics::page_load_time",_=c+"app_metrics::dom_interactive_time",g=c+"app_metrics::scroll_depth",v=c+"app_metrics::time_on_page_ms",S=c+"diagnostics",C=c+"default_value_type_mismatch",R=5*24*60*60*1e3,E=100,x=1e3,T=1024*x,y=10,b=function(){function I(k){this.failedLogEventCount=0,this.sdkInternal=k,this.queue=[],this.flushInterval=null,this.loggedErrors=new Set,this.failedLogEvents=[],this.exposureDedupeKeys={},this.failedLogEventCount=0,this.init()}return I.prototype.init=function(){var k=this;typeof window<"u"&&typeof window.addEventListener=="function"&&(window.addEventListener("blur",function(){return k.flush(!0)}),window.addEventListener("beforeunload",function(){return k.flush(!0)}),window.addEventListener("load",function(){setTimeout(function(){return k.flush()},100),setTimeout(function(){return k.flush()},1e3)})),typeof document<"u"&&typeof document.addEventListener=="function"&&document.addEventListener("visibilitychange",function(){k.flush(document.visibilityState!=="visible")}),!(!this.sdkInternal.getOptions().getIgnoreWindowUndefined()&&(typeof window>"u"||window==null))&&(this.sdkInternal.getOptions().getLocalModeEnabled()||(this.flushInterval=setInterval(function(){k.flush()},this.sdkInternal.getOptions().getLoggingIntervalMillis()),setTimeout(function(){return k.flush()},100),setTimeout(function(){return k.flush()},1e3)))},I.prototype.log=function(k){if(!this.sdkInternal.getOptions().isAllLoggingDisabled()){try{if(!this.sdkInternal.getOptions().getDisableCurrentPageLogging()&&typeof window<"u"&&window!=null&&typeof window.location=="object"&&typeof window.location.href=="string"){var w=window.location.href.split(/[?#]/);w?.length>0&&k.addStatsigMetadata("currentPage",w[0])}}catch{}this.queue.push(k.toJsonObject()),this.queue.length>=this.sdkInternal.getOptions().getLoggingBufferMaxSize()&&this.flush()}},I.prototype.resetDedupeKeys=function(){this.exposureDedupeKeys={}},I.prototype.shouldLogExposure=function(k){var w=this.exposureDedupeKeys[k],D=Date.now();return w==null?(this.exposureDedupeKeys[k]=D,!0):w>=D-600*1e3?!1:(this.exposureDedupeKeys[k]=D,!0)},I.prototype.logGateExposure=function(k,w,D,M,A,L,P){var $=w+String(D)+M+L.reason;if(this.shouldLogExposure($)){var N={gate:w,gateValue:String(D),ruleID:M,reason:L.reason,time:L.time};P&&(N.isManualExposure="true");var j=new r.default(f);j.setUser(k),j.setMetadata(N),j.setSecondaryExposures(A),this.log(j)}},I.prototype.logConfigExposure=function(k,w,D,M,A,L){var P=w+D+A.reason;if(this.shouldLogExposure(P)){var $={config:w,ruleID:D,reason:A.reason,time:A.time};L&&($.isManualExposure="true");var N=new r.default(l);N.setUser(k),N.setMetadata($),N.setSecondaryExposures(M),this.log(N)}},I.prototype.logLayerExposure=function(k,w,D,M,A,L,P,$,N){var j=[w,D,A,L,String(P),$.reason].join("|");if(this.shouldLogExposure(j)){var q={config:w,ruleID:D,allocatedExperiment:A,parameterName:L,isExplicitParameter:String(P),reason:$.reason,time:$.time};N&&(q.isManualExposure="true");var Q=new r.default(d);Q.setUser(k),Q.setMetadata(q),Q.setSecondaryExposures(M),this.log(Q)}},I.prototype.logConfigDefaultValueFallback=function(k,w,D){this.logGenericEvent(C,k,w,D),this.loggedErrors.add(w),this.sdkInternal.getConsoleLogger().error(w)},I.prototype.logAppError=function(k,w,D){var M=w.substring(0,128);this.loggedErrors.has(M)||this.loggedErrors.size>y||(this.logGenericEvent(p,k,M,D),this.loggedErrors.add(M))},I.prototype.logDiagnostics=function(k,w){if(!o.default.disabled){var D=o.default.getMarkers(w);o.default.clearContext(w);var M=this.makeDiagnosticsEvent(k,{markers:D,context:w});this.log(M)}},I.prototype.logAppMetrics=function(k){var w=this,D;if(typeof((D=window?.performance)===null||D===void 0?void 0:D.getEntriesByType)=="function"){var M=window.performance.getEntriesByType("navigation");if(!(!M||M.length<1)){var A=M[0],L={url:A.name};if(A instanceof PerformanceNavigationTiming&&(this.logGenericEvent(m,k,A.duration,L),this.logGenericEvent(_,k,A.domInteractive-A.startTime,L)),typeof window?.addEventListener=="function"&&document?.body){var P=0;window.addEventListener("scroll",function(){var $=document.body.scrollHeight||1,N=Math.min(100,Math.round((window.scrollY+window.innerHeight)/$*100));N>P&&(P=N)}),window.addEventListener("beforeunload",function(){w.logGenericEvent(g,k,P,L),w.logGenericEvent(v,k,window.performance.now(),L)})}}}},I.prototype.logGenericEvent=function(k,w,D,M){var A=new r.default(k);return A.setUser(w),A.setValue(D),A.setMetadata(M),this.log(A),A},I.prototype.shutdown=function(){this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.flush(!0)},I.prototype.flush=function(k){var w=this;if(k===void 0&&(k=!1),this.addErrorBoundaryDiagnostics(),this.queue.length!==0){var D=this.queue;if(this.queue=[],k&&!this.sdkInternal.getNetwork().supportsKeepalive()&&typeof navigator<"u"&&navigator?.sendBeacon!=null){var M=this.sdkInternal.getNetwork().sendLogBeacon({events:D,statsigMetadata:this.sdkInternal.getStatsigMetadata()});M||(this.queue=D.concat(this.queue),this.queue.length>0&&(this.addFailedRequest({events:this.queue,statsigMetadata:this.sdkInternal.getStatsigMetadata(),time:Date.now()}),this.queue=[]),this.saveFailedRequests());return}this.sdkInternal.getNetwork().postToEndpoint(i.StatsigEndpoint.Rgstr,{events:D,statsigMetadata:this.sdkInternal.getStatsigMetadata()},{retryOptions:{retryLimit:3,backoff:1e3},useKeepalive:k}).then(function(A){if(!A.ok)throw A}).catch(function(A){typeof A.text=="function"?A.text().then(function(L){w.sdkInternal.getErrorBoundary().logError(h,A,function(){return t(w,void 0,void 0,function(){return e(this,function(P){return[2,{eventCount:D.length,error:L}]})})})}):w.sdkInternal.getErrorBoundary().logError(h,A,function(){return t(w,void 0,void 0,function(){return e(this,function(L){return[2,{eventCount:D.length,error:A.message}]})})}),w.newFailedRequest(h,D)}).finally(function(){return t(w,void 0,void 0,function(){return e(this,function(A){return k&&(this.queue.length>0&&(this.addFailedRequest({events:this.queue,statsigMetadata:this.sdkInternal.getStatsigMetadata(),time:Date.now()}),this.queue=[]),this.saveFailedRequests()),[2]})})})}},I.prototype.saveFailedRequests=function(){var k=this;if(this.failedLogEvents.length>0){var w=JSON.stringify(this.failedLogEvents);if(w.length>T){this.clearLocalStorageRequests();return}if(u.default.asyncStorage){u.default.setItemAsync(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY,w).catch(function(D){return k.sdkInternal.getErrorBoundary().logError("saveFailedRequests",D)});return}a.default.setItem(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY,w)}},I.prototype.sendSavedRequests=function(){return t(this,void 0,void 0,function(){var k,w,D,M,A,L,P,$,N=this;return e(this,function(j){switch(j.label){case 0:return w=!1,u.default.asyncStorage?[4,u.default.getItemAsync(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY)]:[3,2];case 1:return k=j.sent(),[3,3];case 2:k=a.default.getItem(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY),j.label=3;case 3:if(k==null)return this.clearLocalStorageRequests(),[2];k.length>T&&(w=!0),D=[];try{for(D=JSON.parse(k),M=function(q){q!=null&&q.events&&Array.isArray(q.events)&&A.sdkInternal.getNetwork().postToEndpoint(i.StatsigEndpoint.Rgstr,q).then(function(Q){if(!Q.ok)throw Error(Q.status+"")}).catch(function(){w||N.addFailedRequest(q)})},A=this,L=0,P=D;L<P.length;L++)$=P[L],M($)}catch(q){this.sdkInternal.getErrorBoundary().logError("sendSavedRequests",q)}finally{this.clearLocalStorageRequests()}return[2]}})})},I.prototype.addFailedRequest=function(k){if(!(k.time<Date.now()-R)&&!(this.failedLogEvents.length>E)){var w=k.events.length;this.failedLogEventCount+w>x||(this.failedLogEvents.push(k),this.failedLogEventCount+=w)}},I.prototype.clearLocalStorageRequests=function(){var k=this;u.default.asyncStorage?u.default.removeItemAsync(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY).catch(function(w){return k.sdkInternal.getErrorBoundary().logError("clearLocalStorageRequests",w)}):a.default.removeItem(s.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY)},I.prototype.newFailedRequest=function(k,w){this.loggedErrors.has(k)||(this.loggedErrors.add(k),this.failedLogEvents.push({events:w,statsigMetadata:this.sdkInternal.getStatsigMetadata(),time:Date.now()}),this.saveFailedRequests())},I.prototype.makeDiagnosticsEvent=function(k,w){var D=new r.default(S);return D.setUser(k),D.setMetadata(w),D},I.prototype.addErrorBoundaryDiagnostics=function(){if(o.default.getMarkerCount("api_call")!==0){var k=this.makeDiagnosticsEvent(this.sdkInternal.getCurrentUser(),{context:"api_call",markers:o.default.getMarkers("api_call")});this.queue.push(k),o.default.clearContext("api_call")}},I}();return Et.default=b,Et}var Ga={},jf;function Av(){return jf||(jf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=t.INIT_TIMEOUT_DEFAULT_MS=void 0;var e="https://featuregates.org/v1/",n="https://events.statsigapi.net/v1/";t.INIT_TIMEOUT_DEFAULT_MS=3e3;var r;(function(s){s[s.NONE=0]="NONE",s[s.INFO=1]="INFO",s[s.DEBUG=2]="DEBUG"})(r=t.LogLevel||(t.LogLevel={}));var i=function(){function s(o){var u,a,c,l,d,f,h,p,m,_,g,v,S,C,R,E,x,T,y,b,I,k,w;o==null&&(o={});var D=(u=o.api)!==null&&u!==void 0?u:e;this.api=D.endsWith("/")?D:D+"/",this.disableCurrentPageLogging=(a=o.disableCurrentPageLogging)!==null&&a!==void 0?a:!1,this.environment=(c=o.environment)!==null&&c!==void 0?c:null,this.loggingIntervalMillis=this.normalizeNumberInput(o.loggingIntervalMillis,{default:1e4,min:1e3,max:6e4}),this.loggingBufferMaxSize=this.normalizeNumberInput(o.loggingBufferMaxSize,{default:100,min:2,max:500}),this.disableNetworkKeepalive=(l=o.disableNetworkKeepalive)!==null&&l!==void 0?l:!1,this.overrideStableID=(d=o.overrideStableID)!==null&&d!==void 0?d:null,this.localMode=(f=o.localMode)!==null&&f!==void 0?f:!1,this.initTimeoutMs=o.initTimeoutMs&&o.initTimeoutMs>=0?o.initTimeoutMs:t.INIT_TIMEOUT_DEFAULT_MS,this.disableErrorLogging=(h=o.disableErrorLogging)!==null&&h!==void 0?h:!1,this.disableAutoMetricsLogging=(p=o.disableAutoMetricsLogging)!==null&&p!==void 0?p:!1,this.initializeValues=(m=o.initializeValues)!==null&&m!==void 0?m:null;var M=(g=(_=o.eventLoggingApi)!==null&&_!==void 0?_:o.api)!==null&&g!==void 0?g:n;this.eventLoggingApi=M.endsWith("/")?M:M+"/",this.prefetchUsers=(v=o.prefetchUsers)!==null&&v!==void 0?v:[],this.disableLocalStorage=(S=o.disableLocalStorage)!==null&&S!==void 0?S:!1,this.initCompletionCallback=(C=o.initCompletionCallback)!==null&&C!==void 0?C:null,this.updateCompletionCallback=(R=o.updateUserCompletionCallback)!==null&&R!==void 0?R:null,this.disableDiagnosticsLogging=(E=o.disableDiagnosticsLogging)!==null&&E!==void 0?E:!1,this.logLevel=(x=o?.logLevel)!==null&&x!==void 0?x:r.NONE,this.ignoreWindowUndefined=(T=o?.ignoreWindowUndefined)!==null&&T!==void 0?T:!1,this.fetchMode=(y=o.fetchMode)!==null&&y!==void 0?y:"network-only",this.disableLocalOverrides=(b=o?.disableLocalOverrides)!==null&&b!==void 0?b:!1,this.gateEvaluationCallback=(I=o?.gateEvaluationCallback)!==null&&I!==void 0?I:null,this.userPersistentStorage=(k=o?.userPersistentStorage)!==null&&k!==void 0?k:null,this.disableAllLogging=(w=o.disableAllLogging)!==null&&w!==void 0?w:!1}return s.prototype.getApi=function(){return this.api},s.prototype.getEnvironment=function(){return this.environment},s.prototype.getDisableCurrentPageLogging=function(){return this.disableCurrentPageLogging},s.prototype.getLoggingIntervalMillis=function(){return this.loggingIntervalMillis},s.prototype.getLoggingBufferMaxSize=function(){return this.loggingBufferMaxSize},s.prototype.getDisableNetworkKeepalive=function(){return this.disableNetworkKeepalive},s.prototype.getOverrideStableID=function(){return this.overrideStableID},s.prototype.getLocalModeEnabled=function(){return this.localMode},s.prototype.getInitTimeoutMs=function(){return this.initTimeoutMs},s.prototype.getDisableErrorLogging=function(){return this.disableErrorLogging},s.prototype.getDisableAutoMetricsLogging=function(){return this.disableAutoMetricsLogging},s.prototype.getInitializeValues=function(){return this.initializeValues},s.prototype.getEventLoggingApi=function(){return this.eventLoggingApi},s.prototype.getPrefetchUsers=function(){return this.prefetchUsers},s.prototype.getDisableLocalStorage=function(){return this.disableLocalStorage},s.prototype.getInitCompletionCallback=function(){return this.initCompletionCallback},s.prototype.getUpdateUserCompletionCallback=function(){return this.updateCompletionCallback},s.prototype.getDisableDiagnosticsLogging=function(){return this.disableDiagnosticsLogging},s.prototype.getLogLevel=function(){return this.logLevel},s.prototype.getIgnoreWindowUndefined=function(){return this.ignoreWindowUndefined},s.prototype.getFetchMode=function(){return this.fetchMode},s.prototype.getDisableLocalOverrides=function(){return this.disableLocalOverrides},s.prototype.getGateEvaluationCallback=function(){return this.gateEvaluationCallback},s.prototype.getUserPersistentStorage=function(){return this.userPersistentStorage},s.prototype.isAllLoggingDisabled=function(){return this.disableAllLogging},s.prototype.reenableAllLogging=function(){this.disableAllLogging=!1},s.prototype.normalizeNumberInput=function(o,u){return o==null?u.default:Math.max(Math.min(o,u.max),u.min)},s}();t.default=i}(Ga)),Ga}var rt={},rr={},Ft={},He={},qa={},Gf;function RA(){return Gf||(Gf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Base64=void 0,t.Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_encodeBinary:function(e){for(var n="",r,i,s,o,u,a,c,l=0;l<e.length;)r=e.charCodeAt(l++),i=e.charCodeAt(l++),s=e.charCodeAt(l++),o=r>>2,u=(r&3)<<4|i>>4,a=(i&15)<<2|s>>6,c=s&63,isNaN(i)?a=c=64:isNaN(s)&&(c=64),n=n+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)+this._keyStr.charAt(c);return n},encodeArrayBuffer:function(e){for(var n="",r=new Uint8Array(e),i=r.byteLength,s=0;s<i;s++)n+=String.fromCharCode(r[s]);return t.Base64._encodeBinary(n)}}}(qa)),qa}var za={exports:{}};const xA={},OA=Object.freeze(Object.defineProperty({__proto__:null,default:xA},Symbol.toStringTag,{value:"Module"})),qf=Gh(OA);/** * [js-sha256]{@link https://github.com/emn178/js-sha256} * * @version 0.10.1 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2014-2023 * @license MIT */var zf;function AA(){return zf||(zf=1,function(t){(function(){var e="input is invalid type",n=typeof window=="object",r=n?window:{};r.JS_SHA256_NO_WINDOW&&(n=!1);var i=!n&&typeof self=="object",s=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?r=Zv:i&&(r=self);var o=!r.JS_SHA256_NO_COMMON_JS&&!0&&t.exports,u=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",a="0123456789abcdef".split(""),c=[-2147483648,8388608,32768,128],l=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],h=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(E){return Object.prototype.toString.call(E)==="[object Array]"}),u&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(E){return typeof E=="object"&&E.buffer&&E.buffer.constructor===ArrayBuffer});var p=function(E,x){return function(T){return new S(x,!0).update(T)[E]()}},m=function(E){var x=p("hex",E);s&&(x=_(x,E)),x.create=function(){return new S(E)},x.update=function(b){return x.create().update(b)};for(var T=0;T<f.length;++T){var y=f[T];x[y]=p(y,E)}return x},_=function(E,x){var T=qf,y=qf.Buffer,b=x?"sha224":"sha256",I;y.from&&!r.JS_SHA256_NO_BUFFER_FROM?I=y.from:I=function(w){return new y(w)};var k=function(w){if(typeof w=="string")return T.createHash(b).update(w,"utf8").digest("hex");if(w==null)throw new Error(e);return w.constructor===ArrayBuffer&&(w=new Uint8Array(w)),Array.isArray(w)||ArrayBuffer.isView(w)||w.constructor===y?T.createHash(b).update(I(w)).digest("hex"):E(w)};return k},g=function(E,x){return function(T,y){return new C(T,x,!0).update(y)[E]()}},v=function(E){var x=g("hex",E);x.create=function(b){return new C(b,E)},x.update=function(b,I){return x.create(b).update(I)};for(var T=0;T<f.length;++T){var y=f[T];x[y]=g(y,E)}return x};function S(E,x){x?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=E}S.prototype.update=function(E){if(!this.finalized){var x,T=typeof E;if(T!=="string"){if(T==="object"){if(E===null)throw new Error(e);if(u&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!u||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);x=!0}for(var y,b=0,I,k=E.length,w=this.blocks;b<k;){if(this.hashed&&(this.hashed=!1,w[0]=this.block,w[16]=w[1]=w[2]=w[3]=w[4]=w[5]=w[6]=w[7]=w[8]=w[9]=w[10]=w[11]=w[12]=w[13]=w[14]=w[15]=0),x)for(I=this.start;b<k&&I<64;++b)w[I>>2]|=E[b]<<l[I++&3];else for(I=this.start;b<k&&I<64;++b)y=E.charCodeAt(b),y<128?w[I>>2]|=y<<l[I++&3]:y<2048?(w[I>>2]|=(192|y>>6)<<l[I++&3],w[I>>2]|=(128|y&63)<<l[I++&3]):y<55296||y>=57344?(w[I>>2]|=(224|y>>12)<<l[I++&3],w[I>>2]|=(128|y>>6&63)<<l[I++&3],w[I>>2]|=(128|y&63)<<l[I++&3]):(y=65536+((y&1023)<<10|E.charCodeAt(++b)&1023),w[I>>2]|=(240|y>>18)<<l[I++&3],w[I>>2]|=(128|y>>12&63)<<l[I++&3],w[I>>2]|=(128|y>>6&63)<<l[I++&3],w[I>>2]|=(128|y&63)<<l[I++&3]);this.lastByteIndex=I,this.bytes+=I-this.start,I>=64?(this.block=w[16],this.start=I-64,this.hash(),this.hashed=!0):this.start=I}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var E=this.blocks,x=this.lastByteIndex;E[16]=this.block,E[x>>2]|=c[x&3],this.block=E[16],x>=56&&(this.hashed||this.hash(),E[0]=this.block,E[16]=E[1]=E[2]=E[3]=E[4]=E[5]=E[6]=E[7]=E[8]=E[9]=E[10]=E[11]=E[12]=E[13]=E[14]=E[15]=0),E[14]=this.hBytes<<3|this.bytes>>>29,E[15]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var E=this.h0,x=this.h1,T=this.h2,y=this.h3,b=this.h4,I=this.h5,k=this.h6,w=this.h7,D=this.blocks,M,A,L,P,$,N,j,q,Q,ge,ye;for(M=16;M<64;++M)$=D[M-15],A=($>>>7|$<<25)^($>>>18|$<<14)^$>>>3,$=D[M-2],L=($>>>17|$<<15)^($>>>19|$<<13)^$>>>10,D[M]=D[M-16]+A+D[M-7]+L<<0;for(ye=x&T,M=0;M<64;M+=4)this.first?(this.is224?(q=300032,$=D[0]-1413257819,w=$-150054599<<0,y=$+24177077<<0):(q=704751109,$=D[0]-210244248,w=$-1521486534<<0,y=$+143694565<<0),this.first=!1):(A=(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10),L=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),q=E&x,P=q^E&T^ye,j=b&I^~b&k,$=w+L+j+d[M]+D[M],N=A+P,w=y+$<<0,y=$+N<<0),A=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),L=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7),Q=y&E,P=Q^y&x^q,j=w&b^~w&I,$=k+L+j+d[M+1]+D[M+1],N=A+P,k=T+$<<0,T=$+N<<0,A=(T>>>2|T<<30)^(T>>>13|T<<19)^(T>>>22|T<<10),L=(k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7),ge=T&y,P=ge^T&E^Q,j=k&w^~k&b,$=I+L+j+d[M+2]+D[M+2],N=A+P,I=x+$<<0,x=$+N<<0,A=(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10),L=(I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7),ye=x&T,P=ye^x&y^ge,j=I&k^~I&w,$=b+L+j+d[M+3]+D[M+3],N=A+P,b=E+$<<0,E=$+N<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+E<<0,this.h1=this.h1+x<<0,this.h2=this.h2+T<<0,this.h3=this.h3+y<<0,this.h4=this.h4+b<<0,this.h5=this.h5+I<<0,this.h6=this.h6+k<<0,this.h7=this.h7+w<<0},S.prototype.hex=function(){this.finalize();var E=this.h0,x=this.h1,T=this.h2,y=this.h3,b=this.h4,I=this.h5,k=this.h6,w=this.h7,D=a[E>>28&15]+a[E>>24&15]+a[E>>20&15]+a[E>>16&15]+a[E>>12&15]+a[E>>8&15]+a[E>>4&15]+a[E&15]+a[x>>28&15]+a[x>>24&15]+a[x>>20&15]+a[x>>16&15]+a[x>>12&15]+a[x>>8&15]+a[x>>4&15]+a[x&15]+a[T>>28&15]+a[T>>24&15]+a[T>>20&15]+a[T>>16&15]+a[T>>12&15]+a[T>>8&15]+a[T>>4&15]+a[T&15]+a[y>>28&15]+a[y>>24&15]+a[y>>20&15]+a[y>>16&15]+a[y>>12&15]+a[y>>8&15]+a[y>>4&15]+a[y&15]+a[b>>28&15]+a[b>>24&15]+a[b>>20&15]+a[b>>16&15]+a[b>>12&15]+a[b>>8&15]+a[b>>4&15]+a[b&15]+a[I>>28&15]+a[I>>24&15]+a[I>>20&15]+a[I>>16&15]+a[I>>12&15]+a[I>>8&15]+a[I>>4&15]+a[I&15]+a[k>>28&15]+a[k>>24&15]+a[k>>20&15]+a[k>>16&15]+a[k>>12&15]+a[k>>8&15]+a[k>>4&15]+a[k&15];return this.is224||(D+=a[w>>28&15]+a[w>>24&15]+a[w>>20&15]+a[w>>16&15]+a[w>>12&15]+a[w>>8&15]+a[w>>4&15]+a[w&15]),D},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var E=this.h0,x=this.h1,T=this.h2,y=this.h3,b=this.h4,I=this.h5,k=this.h6,w=this.h7,D=[E>>24&255,E>>16&255,E>>8&255,E&255,x>>24&255,x>>16&255,x>>8&255,x&255,T>>24&255,T>>16&255,T>>8&255,T&255,y>>24&255,y>>16&255,y>>8&255,y&255,b>>24&255,b>>16&255,b>>8&255,b&255,I>>24&255,I>>16&255,I>>8&255,I&255,k>>24&255,k>>16&255,k>>8&255,k&255];return this.is224||D.push(w>>24&255,w>>16&255,w>>8&255,w&255),D},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var E=new ArrayBuffer(this.is224?28:32),x=new DataView(E);return x.setUint32(0,this.h0),x.setUint32(4,this.h1),x.setUint32(8,this.h2),x.setUint32(12,this.h3),x.setUint32(16,this.h4),x.setUint32(20,this.h5),x.setUint32(24,this.h6),this.is224||x.setUint32(28,this.h7),E};function C(E,x,T){var y,b=typeof E;if(b==="string"){var I=[],k=E.length,w=0,D;for(y=0;y<k;++y)D=E.charCodeAt(y),D<128?I[w++]=D:D<2048?(I[w++]=192|D>>6,I[w++]=128|D&63):D<55296||D>=57344?(I[w++]=224|D>>12,I[w++]=128|D>>6&63,I[w++]=128|D&63):(D=65536+((D&1023)<<10|E.charCodeAt(++y)&1023),I[w++]=240|D>>18,I[w++]=128|D>>12&63,I[w++]=128|D>>6&63,I[w++]=128|D&63);E=I}else if(b==="object"){if(E===null)throw new Error(e);if(u&&E.constructor===ArrayBuffer)E=new Uint8Array(E);else if(!Array.isArray(E)&&(!u||!ArrayBuffer.isView(E)))throw new Error(e)}else throw new Error(e);E.length>64&&(E=new S(x,!0).update(E).array());var M=[],A=[];for(y=0;y<64;++y){var L=E[y]||0;M[y]=92^L,A[y]=54^L}S.call(this,x,T),this.update(A),this.oKeyPad=M,this.inner=!0,this.sharedMemory=T}C.prototype=new S,C.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var E=this.array();S.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(E),S.prototype.finalize.call(this)}};var R=m();R.sha256=R,R.sha224=m(!0),R.sha256.hmac=v(),R.sha224.hmac=v(!0),o?t.exports=R:(r.sha256=R.sha256,r.sha224=R.sha224)})()}(za)),za.exports}var Wf;function ll(){if(Wf)return He;Wf=1,Object.defineProperty(He,"__esModule",{value:!0}),He.getUserCacheKey=He.getSortedObject=He.djb2HashForObject=He.sha256Hash=He.djb2Hash=He.memoizedUserCacheKeyHash=He.fasthash=void 0;var t=RA(),e=AA(),n={};function r(l){for(var d=0,f=0;f<l.length;f++){var h=l.charCodeAt(f);d=(d<<5)-d+h,d=d&d}return d}He.fasthash=r;function i(l){var d=n[l];if(d)return d;var f=String(r(l));return n[l]=f,f}He.memoizedUserCacheKeyHash=i;function s(l){return String(r(l)>>>0)}He.djb2Hash=s;function o(l){var d=n[l];if(d)return d;var f=e.sha256.create().update(l).arrayBuffer(),h=t.Base64.encodeArrayBuffer(f);return n[l]=h,h}He.sha256Hash=o;function u(l){return s(JSON.stringify(a(l)))}He.djb2HashForObject=u;function a(l){if(l==null)return null;var d=Object.keys(l).sort(),f={};return d.forEach(function(h){var p=l[h];p instanceof Object&&(p=a(p)),f[h]=p}),f}He.getSortedObject=a;function c(l,d){var f,h=["userID:"+String((f=d?.userID)!==null&&f!==void 0?f:"")],p=d?.customIDs;if(p!=null)for(var m=0,_=Object.entries(p);m<_.length;m++){var g=_[m],v=g[0],S=g[1];h.push(v+":"+S)}var C=i(h.join(";"));h.splice(1,0,"stableID:"+l);var R=i(h.join(";"));return{v1:R,v2:C}}return He.getUserCacheKey=c,He}var Vf;function DA(){if(Vf)return Ft;Vf=1;var t=Ft&&Ft.__assign||function(){return t=Object.assign||function(i){for(var s,o=1,u=arguments.length;o<u;o++){s=arguments[o];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},t.apply(this,arguments)},e=Ft&&Ft.__rest||function(i,s){var o={};for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&s.indexOf(u)<0&&(o[u]=i[u]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,u=Object.getOwnPropertySymbols(i);a<u.length;a++)s.indexOf(u[a])<0&&Object.prototype.propertyIsEnumerable.call(i,u[a])&&(o[u[a]]=i[u[a]]);return o};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.getUserHashWithoutStableID=void 0;var n=ll();function r(i){var s=i.customIDs,o=e(i,["customIDs"]),u=t({},s);return delete u.stableID,(0,n.djb2HashForObject)(t(t({},o),{customIDs:u}))}return Ft.getUserHashWithoutStableID=r,Ft}var Wa={},Kf;function Di(){return Kf||(Kf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EvaluationReason=void 0,function(e){e.Network="Network",e.Bootstrap="Bootstrap",e.InvalidBootstrap="InvalidBootstrap",e.Cache="Cache",e.Prefetch="Prefetch",e.Sticky="Sticky",e.LocalOverride="LocalOverride",e.Unrecognized="Unrecognized",e.Uninitialized="Uninitialized",e.Error="Error",e.NetworkNotModified="NetworkNotModified",e.BootstrapStableIDMismatch="BootstrapStableIDMismatch"}(t.EvaluationReason||(t.EvaluationReason={}))}(Wa)),Wa}var Yf;function MA(){if(Yf)return rr;Yf=1;var t=rr&&rr.__assign||function(){return t=Object.assign||function(i){for(var s,o=1,u=arguments.length;o<u;o++){s=arguments[o];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},t.apply(this,arguments)};Object.defineProperty(rr,"__esModule",{value:!0});var e=DA(),n=Di(),r=function(){function i(){}return i.getEvaluationReasonForBootstrap=function(s,o,u){var a=!0,c=!1;try{var l=o.evaluated_keys;if(l&&typeof l=="object"){var d=this.copyObject(l),f=s==null?null:this.copyObject(s);a=a&&i.validate(d,f)&&i.validate(f,d);var h=l.customIDs;u!=h?.stableID&&(c=!0)}var p=o.user_hash;p&&typeof p=="string"&&s!=null&&(a=a&&p===(0,e.getUserHashWithoutStableID)(s))}catch{}return a?c?n.EvaluationReason.BootstrapStableIDMismatch:n.EvaluationReason.Bootstrap:n.EvaluationReason.InvalidBootstrap},i.validate=function(s,o){if(s==null)return o==null;if(o==null)return!1;for(var u=0,a=Object.entries(s);u<a.length;u++){var c=a[u],l=c[0],d=c[1];if(l!=="stableID"){if(typeof d!=typeof o[l])return!1;if(typeof d=="string"){if(d!==o[l])return!1}else return typeof d=="object"?this.validate(d,o[l]):!1}}return!0},i.copyObject=function(s){if(s==null)return null;var o={};if(s?.userID&&(o.userID=s?.userID),s?.customIDs){var u=t({},s.customIDs);delete u.stableID,Object.keys(u).length!==0&&(o.customIDs=u)}return o},i}();return rr.default=r,rr}var Xf;function LA(){if(Xf)return rt;Xf=1;var t=rt&&rt.__assign||function(){return t=Object.assign||function(m){for(var _,g=1,v=arguments.length;g<v;g++){_=arguments[g];for(var S in _)Object.prototype.hasOwnProperty.call(_,S)&&(m[S]=_[S])}return m},t.apply(this,arguments)},e=rt&&rt.__awaiter||function(m,_,g,v){function S(C){return C instanceof g?C:new g(function(R){R(C)})}return new(g||(g=Promise))(function(C,R){function E(y){try{T(v.next(y))}catch(b){R(b)}}function x(y){try{T(v.throw(y))}catch(b){R(b)}}function T(y){y.done?C(y.value):S(y.value).then(E,x)}T((v=v.apply(m,_||[])).next())})},n=rt&&rt.__generator||function(m,_){var g={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},v,S,C,R;return R={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function E(T){return function(y){return x([T,y])}}function x(T){if(v)throw new TypeError("Generator is already executing.");for(;g;)try{if(v=1,S&&(C=T[0]&2?S.return:T[0]?S.throw||((C=S.return)&&C.call(S),0):S.next)&&!(C=C.call(S,T[1])).done)return C;switch(S=0,C&&(T=[T[0]&2,C.value]),T[0]){case 0:case 1:C=T;break;case 4:return g.label++,{value:T[1],done:!1};case 5:g.label++,S=T[1],T=[0];continue;case 7:T=g.ops.pop(),g.trys.pop();continue;default:if(C=g.trys,!(C=C.length>0&&C[C.length-1])&&(T[0]===6||T[0]===2)){g=0;continue}if(T[0]===3&&(!C||T[1]>C[0]&&T[1]<C[3])){g.label=T[1];break}if(T[0]===6&&g.label<C[1]){g.label=C[1],C=T;break}if(C&&g.label<C[2]){g.label=C[2],g.ops.push(T);break}C[2]&&g.ops.pop(),g.trys.pop();continue}T=_.call(m,g)}catch(y){T=[6,y],S=0}finally{v=C=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},r=rt&&rt.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(rt,"__esModule",{value:!0});var i=r(ul()),s=r(cl()),o=r(MA()),u=_a(),a=ll(),c=r(rs()),l=r(va()),d=Di(),f=10,h=function(){function m(_,g){this.overrides={gates:{},configs:{},layers:{}},this.sdkInternal=_,this.userCacheKey=this.sdkInternal.getCurrentUserCacheKey(),this.values={},this.userValues={feature_gates:{},dynamic_configs:{},sticky_experiments:{},layer_configs:{},has_updates:!1,time:0,evaluation_time:0,derived_fields:{}},this.stickyDeviceExperiments={},this.loaded=!1,this.reason=d.EvaluationReason.Uninitialized,this.userPersistentStorageAdapter=this.sdkInternal.getOptions().getUserPersistentStorage(),this.userPersistentStorageData={experiments:{}},g?this.bootstrap(g):this.load()}return m.prototype.load=function(){this.loadFromLocalStorage(),this.partialLoadFromPersistentStorageAdapter()},m.prototype.loadAsync=function(){return e(this,void 0,void 0,function(){return n(this,function(_){switch(_.label){case 0:return[4,this.loadFromAsyncStorage()];case 1:return _.sent(),this.partialLoadFromPersistentStorageAdapter(),[2]}})})},m.prototype.updateUser=function(_){this.userCacheKey=this.sdkInternal.getCurrentUserCacheKey();var g=this.setUserValueFromCache(_);return this.partialLoadFromPersistentStorageAdapter(),g},m.prototype.loadFromAsyncStorage=function(){return e(this,void 0,void 0,function(){var _,g;return n(this,function(v){switch(v.label){case 0:return _=this.parseCachedValues,[4,c.default.getItemAsync(u.INTERNAL_STORE_KEY)];case 1:return g=[v.sent()],[4,c.default.getItemAsync(u.STICKY_DEVICE_EXPERIMENTS_KEY)];case 2:return _.apply(this,g.concat([v.sent()])),this.userCacheKey=this.sdkInternal.getCurrentUserCacheKey(),this.loaded=!0,[2]}})})},m.prototype.bootstrap=function(_){var g,v,S,C,R,E,x=this.sdkInternal.getCurrentUserCacheKey(),T=this.sdkInternal.getCurrentUser(),y=(S=(v=(g=T?.customIDs)===null||g===void 0?void 0:g.stableID)!==null&&v!==void 0?v:this.sdkInternal.getStatsigMetadata().stableID)!==null&&S!==void 0?S:null,b=o.default.getEvaluationReasonForBootstrap(T,_,y);this.loaded=!0;try{var I=_;this.userValues.feature_gates=(C=I.feature_gates)!==null&&C!==void 0?C:{},this.userValues.dynamic_configs=(R=I.dynamic_configs)!==null&&R!==void 0?R:{},this.userValues.layer_configs=(E=I.layer_configs)!==null&&E!==void 0?E:{},this.userValues.evaluation_time=Date.now(),this.userValues.time=Date.now(),this.userValues.hash_used=I.hash_used,this.values[x.v2]=this.userValues,this.reason=b,this.loadOverrides()}catch{return}},m.prototype.loadFromLocalStorage=function(){c.default.asyncStorage||(this.parseCachedValues(l.default.getItem(u.INTERNAL_STORE_KEY),l.default.getItem(u.STICKY_DEVICE_EXPERIMENTS_KEY)),this.loaded=!0)},m.prototype.partialLoadFromPersistentStorageAdapter=function(){var _;if(this.userPersistentStorageAdapter){var g=(_=this.userPersistentStorageAdapter.userIDType)!==null&&_!==void 0?_:"userID",v=this.sdkInternal.getCurrentUserUnitID(g);if(v){try{this.userPersistentStorageData=JSON.parse(this.userPersistentStorageAdapter.load(v+":"+g))}catch(S){console.warn("Failed to load from user persistent storage.",S)}this.userValues.sticky_experiments=this.userPersistentStorageData.experiments}}},m.prototype.saveStickyExperimentsToPersistentStorageAdapter=function(){var _;if(this.userPersistentStorageAdapter){var g=(_=this.userPersistentStorageAdapter.userIDType)!==null&&_!==void 0?_:"userID",v=this.sdkInternal.getCurrentUserUnitID(g);if(v){var S=t(t({},this.userPersistentStorageData),{experiments:this.userValues.sticky_experiments});try{this.userPersistentStorageAdapter.save(v+":"+g,JSON.stringify(S))}catch(C){console.warn("Failed to save user experiment values to persistent storage.",C)}}}},m.prototype.isLoaded=function(){return this.loaded},m.prototype.getLastUpdateTime=function(_){var g=(0,a.djb2HashForObject)(_);return this.userValues.user_hash==g?this.userValues.time:null},m.prototype.getPreviousDerivedFields=function(_){var g=(0,a.djb2HashForObject)(_);if(this.userValues.user_hash==g)return this.userValues.derived_fields},m.prototype.parseCachedValues=function(_,g){try{this.values=_?JSON.parse(_):this.values,this.setUserValueFromCache()}catch{this.removeFromStorage(u.INTERNAL_STORE_KEY)}try{var v=g?JSON.parse(g):null;v&&(this.stickyDeviceExperiments=v)}catch{this.removeFromStorage(u.STICKY_DEVICE_EXPERIMENTS_KEY)}this.loadOverrides()},m.prototype.getUserValues=function(_){var g;return(g=this.values[_.v2])!==null&&g!==void 0?g:this.values[_.v1]},m.prototype.setUserValueFromCache=function(_){var g;_===void 0&&(_=!1);var v=this.getUserValues(this.userCacheKey);return v==null?(this.resetUserValues(),this.reason=d.EvaluationReason.Uninitialized,null):(this.userValues=v,this.reason=_?d.EvaluationReason.Prefetch:d.EvaluationReason.Cache,(g=v.evaluation_time)!==null&&g!==void 0?g:0)},m.prototype.removeFromStorage=function(_){var g=this;c.default.removeItemAsync(_).catch(function(v){return g.sdkInternal.getErrorBoundary().logError("removeFromStorage",v)}),l.default.removeItem(_)},m.prototype.loadOverrides=function(){if(!this.sdkInternal.getOptions().getDisableLocalOverrides()){var _=l.default.getItem(u.OVERRIDES_STORE_KEY);if(_!=null)try{this.overrides=JSON.parse(_)}catch{l.default.removeItem(u.OVERRIDES_STORE_KEY)}}},m.prototype.setEvaluationReason=function(_){this.reason=_},m.prototype.save=function(_,g,v){return e(this,void 0,void 0,function(){var S,C,R,E;return n(this,function(x){switch(x.label){case 0:return S=(0,a.getUserCacheKey)(this.getStableID(),_),C=g,C.is_delta?[2,this.saveInitDeltas(_,g,!0,v)]:(this.mergeInitializeResponseIntoUserMap(C,this.values,S,_,function(T){return T},v),R=this.getUserValues(S),R&&S&&S.v2===this.userCacheKey.v2&&(this.userValues=R,this.reason=d.EvaluationReason.Network),E=this,[4,this.writeValuesToStorage(this.values)]);case 1:return E.values=x.sent(),[2]}})})},m.prototype.saveWithoutUpdatingClientState=function(_,g,v){return e(this,void 0,void 0,function(){var S,C,R;return n(this,function(E){switch(E.label){case 0:return S=(0,a.getUserCacheKey)(this.getStableID(),_),C=g,C.is_delta?[2,this.saveInitDeltas(_,g,!1,v)]:(R=JSON.parse(JSON.stringify(this.values)),this.mergeInitializeResponseIntoUserMap(C,R,S,_,function(x){return x},v),[4,this.writeValuesToStorage(R)]);case 1:return E.sent(),[2]}})})},m.prototype.saveInitDeltas=function(_,g,v,S){var C,R;return e(this,void 0,void 0,function(){var E,x,T,y,b,I,k,w,D,M,A,L=this;return n(this,function(P){switch(P.label){case 0:return E=(0,a.getUserCacheKey)(this.getStableID(),_),x=g,T=JSON.parse(JSON.stringify(this.values)),this.mergeInitializeResponseIntoUserMap(x,T,E,_,function($,N){var j,q=(j=T[N])!==null&&j!==void 0?j:L.getDefaultUserCacheValues();return L.mergeUserCacheValues(q,$)},S),y=!1,b=void 0,I=!1,k=Object.keys((C=x.prefetched_user_values)!==null&&C!==void 0?C:{}),k.forEach(function($){var N,j=T[$],q=(N=x.prefetched_user_values)===null||N===void 0?void 0:N[$];if(j&&q){p(q,j);var Q=q.checksum,ge=(0,a.djb2HashForObject)({feature_gates:T[$].feature_gates,dynamic_configs:T[$].dynamic_configs,layer_configs:T[$].layer_configs});Q&&Q!==ge&&(y=!0,b=ge),w.hash_used!==x.hash_used&&(I=!0)}}),w=(R=T[E.v2])!==null&&R!==void 0?R:T[E.v1],p(x,w),D=x.checksum,M=(0,a.djb2HashForObject)({feature_gates:w.feature_gates,dynamic_configs:w.dynamic_configs,layer_configs:w.layer_configs}),D&&D!==M&&(y=!0,b=M),w.hash_used!==x.hash_used&&(I=!0),y||I?(this.refetchAndSaveValues(_,S,void 0,b,y).catch(function($){return L.sdkInternal.getErrorBoundary().logError("refetchAndSaveValues",$)}),[2]):v?(w&&E.v2===this.userCacheKey.v2&&(this.userValues=w,this.reason=d.EvaluationReason.Network),A=this,[4,this.writeValuesToStorage(T)]):[3,2];case 1:return A.values=P.sent(),[3,4];case 2:return[4,this.writeValuesToStorage(T)];case 3:P.sent(),P.label=4;case 4:return[2]}})})},m.prototype.refetchAndSaveValues=function(_,g,v,S,C){return v===void 0&&(v=this.sdkInternal.getOptions().getInitTimeoutMs()),e(this,void 0,void 0,function(){var R,E,x=this;return n(this,function(T){return R=this.getLastUpdateTime(_),E=this.getPreviousDerivedFields(_),[2,this.sdkInternal.getNetwork().fetchValues({user:_,sinceTime:R,timeout:v,useDeltas:!1,prefetchUsers:g,previousDerivedFields:E,hadBadDeltaChecksum:C,badChecksum:S}).then(function(y){y?.has_updates&&x.saveWithoutUpdatingClientState(_,y,g).catch(function(b){return x.sdkInternal.getErrorBoundary().logError("refetchAndSaveValues:then",b)})}).catch(function(y){return x.sdkInternal.getErrorBoundary().logError("refetchAndSaveValues",y)})]})})},m.prototype.getStableID=function(){return this.sdkInternal.getStableID()},m.prototype.mergeInitializeResponseIntoUserMap=function(_,g,v,S,C,R){if(_.prefetched_user_values)for(var E=Object.keys(_.prefetched_user_values),x=0,T=E;x<T.length;x++){var y=T[x],b=_.prefetched_user_values[y],I=C(this.convertAPIDataToCacheValues(b,y),y);if(_.has_updates&&_.time&&R){var k=(0,a.djb2HashForObject)(R[y]);I.user_hash=k}g[y]=I}if(v){var w=this.convertAPIDataToCacheValues(_,v.v2);if(_.has_updates&&_.time){var k=(0,a.djb2HashForObject)(S);w.user_hash=k}g[v.v2]=C(w,v.v2)}},m.prototype.getDefaultUserCacheValues=function(){return{feature_gates:{},layer_configs:{},dynamic_configs:{},sticky_experiments:{},time:0,evaluation_time:0,derived_fields:{}}},m.prototype.mergeUserCacheValues=function(_,g){return{feature_gates:t(t({},_.feature_gates),g.feature_gates),layer_configs:t(t({},_.layer_configs),g.layer_configs),dynamic_configs:t(t({},_.dynamic_configs),g.dynamic_configs),sticky_experiments:_.sticky_experiments,time:g.time,evaluation_time:g.evaluation_time,derived_fields:g.derived_fields,hash_used:g.hash_used,user_hash:g.user_hash}},m.prototype.writeValuesToStorage=function(_){return e(this,void 0,void 0,function(){var g;return n(this,function(v){switch(v.label){case 0:return _[this.userCacheKey.v2]&&delete _[this.userCacheKey.v1],g=Object.entries(_).sort(function(S,C){var R,E,x=S[1],T=C[1];return x==null?1:T==null?-1:((R=T?.evaluation_time)!==null&&R!==void 0?R:T?.time)-((E=x?.evaluation_time)!==null&&E!==void 0?E:x?.time)}).slice(0,f),_=Object.fromEntries(g),c.default.asyncStorage?[4,c.default.setItemAsync(u.INTERNAL_STORE_KEY,JSON.stringify(_))]:[3,2];case 1:return v.sent(),[3,3];case 2:l.default.setItem(u.INTERNAL_STORE_KEY,JSON.stringify(_)),v.label=3;case 3:return[2,_]}})})},m.prototype.checkGate=function(_,g){var v;g===void 0&&(g=!1);var S=this.getHashedSpecName(_),C={name:_,value:!1,rule_id:"",secondary_exposures:[]},R;if(!g&&this.overrides.gates[_]!=null)C={name:_,value:this.overrides.gates[_],rule_id:"override",secondary_exposures:[]},R=this.getEvaluationDetails(!1,d.EvaluationReason.LocalOverride);else{var E=(v=this.userValues)===null||v===void 0?void 0:v.feature_gates[S];E&&(C=E),R=this.getEvaluationDetails(E!=null)}return{evaluationDetails:R,gate:C}},m.prototype.getConfig=function(_,g){var v,S;g===void 0&&(g=!1);var C=this.getHashedSpecName(_),R,E;if(!g&&this.overrides.configs[_]!=null)E=this.getEvaluationDetails(!1,d.EvaluationReason.LocalOverride),R=new i.default(_,this.overrides.configs[_],"override",E,[],"",this.makeOnConfigDefaultValueFallback(this.sdkInternal.getCurrentUser()));else if(((v=this.userValues)===null||v===void 0?void 0:v.dynamic_configs[C])!=null){var x=(S=this.userValues)===null||S===void 0?void 0:S.dynamic_configs[C];E=this.getEvaluationDetails(!0),R=this.createDynamicConfig(_,x,E)}else E=this.getEvaluationDetails(!1),R=new i.default(_,{},"",E);return R},m.prototype.getExperiment=function(_,g,v){g===void 0&&(g=!1),v===void 0&&(v=!1);var S,C;if(!v&&this.overrides.configs[_]!=null)C=this.getEvaluationDetails(!1,d.EvaluationReason.LocalOverride),S=new i.default(_,this.overrides.configs[_],"override",C);else{var R=this.getLatestValue(_,"dynamic_configs");C=this.getEvaluationDetails(R!=null);var E=this.getPossiblyStickyValue(_,R,g,!1,C);S=this.createDynamicConfig(_,E,C)}return S},m.prototype.getLayer=function(_,g,v){var S,C,R,E;if(this.overrides.layers[g]!=null){var x=this.getEvaluationDetails(!1,d.EvaluationReason.LocalOverride);return s.default._create(g,(S=this.overrides.layers[g])!==null&&S!==void 0?S:{},"override",x,_)}var T=this.getLatestValue(g,"layer_configs"),y=this.getEvaluationDetails(T!=null),b=this.getPossiblyStickyValue(g,T,v,!0,y);return s.default._create(g,(C=b?.value)!==null&&C!==void 0?C:{},(R=b?.rule_id)!==null&&R!==void 0?R:"",y,_,b?.secondary_exposures,b?.undelegated_secondary_exposures,(E=b?.allocated_experiment_name)!==null&&E!==void 0?E:"",b?.explicit_parameters,b?.group_name)},m.prototype.overrideConfig=function(_,g){try{JSON.stringify(g)}catch(v){console.warn("Failed to stringify given config override. Dropping",v);return}this.overrides.configs[_]=g,this.saveOverrides()},m.prototype.overrideLayer=function(_,g){try{JSON.stringify(g)}catch(v){console.warn("Failed to stringify given layer override. Dropping",v);return}this.overrides.layers[_]=g,this.saveOverrides()},m.prototype.overrideGate=function(_,g){this.overrides.gates[_]=g,this.saveOverrides()},m.prototype.removeGateOverride=function(_){_==null?this.overrides.gates={}:delete this.overrides.gates[_],this.saveOverrides()},m.prototype.removeConfigOverride=function(_){_==null?this.overrides.configs={}:delete this.overrides.configs[_],this.saveOverrides()},m.prototype.removeLayerOverride=function(_){_==null?this.overrides.layers={}:delete this.overrides.layers[_],this.saveOverrides()},m.prototype.getAllOverrides=function(){return this.overrides},m.prototype.saveOverrides=function(){try{l.default.setItem(u.OVERRIDES_STORE_KEY,JSON.stringify(this.overrides))}catch{console.warn("Failed to persist gate/config overrides")}},m.prototype.getLatestValue=function(_,g){var v,S,C,R,E,x=this.getHashedSpecName(_);return(C=(S=(v=this.userValues)===null||v===void 0?void 0:v[g])===null||S===void 0?void 0:S[x])!==null&&C!==void 0?C:(E=(R=this.userValues)===null||R===void 0?void 0:R[g])===null||E===void 0?void 0:E[_]},m.prototype.getPossiblyStickyValue=function(_,g,v,S,C){var R,E=this.getHashedSpecName(_);if(!v)return this.removeStickyValue(E),g;var x=this.getStickyValue(E);if(!x)return this.attemptToSaveStickyValue(E,g),g;var T=null;return S?T=this.getLatestValue((R=x?.allocated_experiment_name)!==null&&R!==void 0?R:"","dynamic_configs"):T=g,T?.is_experiment_active==!0?(C.reason=d.EvaluationReason.Sticky,x):(g?.is_experiment_active==!0?this.attemptToSaveStickyValue(E,g):this.removeStickyValue(E),g)},m.prototype.createDynamicConfig=function(_,g,v){var S,C,R;return new i.default(_,(S=g?.value)!==null&&S!==void 0?S:{},(C=g?.rule_id)!==null&&C!==void 0?C:"",v,g?.secondary_exposures,(R=g?.allocated_experiment_name)!==null&&R!==void 0?R:"",this.makeOnConfigDefaultValueFallback(this.sdkInternal.getCurrentUser()),g?.group_name,g?.id_type,g?.is_experiment_active)},m.prototype.getStickyValue=function(_){var g,v;return(v=(g=this.userValues)===null||g===void 0?void 0:g.sticky_experiments[_])!==null&&v!==void 0?v:this.stickyDeviceExperiments[_]},m.prototype.attemptToSaveStickyValue=function(_,g){var v;!g||!g.is_user_in_experiment||!g.is_experiment_active||(g.is_device_based===!0?this.stickyDeviceExperiments[_]=g:!((v=this.userValues)===null||v===void 0)&&v.sticky_experiments&&(this.userValues.sticky_experiments[_]=g),this.saveStickyValuesToStorage())},m.prototype.removeStickyValue=function(_){var g,v,S,C;Object.keys((v=(g=this.userValues)===null||g===void 0?void 0:g.sticky_experiments)!==null&&v!==void 0?v:{}).length===0&&Object.keys((S=this.stickyDeviceExperiments)!==null&&S!==void 0?S:{}).length===0||((C=this.userValues)===null||C===void 0||delete C.sticky_experiments[_],delete this.stickyDeviceExperiments[_],this.saveStickyValuesToStorage())},m.prototype.saveStickyValuesToStorage=function(){this.userPersistentStorageAdapter?this.saveStickyExperimentsToPersistentStorageAdapter():(this.values[this.userCacheKey.v2]=this.userValues,this.setItemToStorage(u.INTERNAL_STORE_KEY,JSON.stringify(this.values)),this.setItemToStorage(u.STICKY_DEVICE_EXPERIMENTS_KEY,JSON.stringify(this.stickyDeviceExperiments)))},m.prototype.getGlobalEvaluationDetails=function(){var _,g;return{reason:(_=this.reason)!==null&&_!==void 0?_:d.EvaluationReason.Uninitialized,time:(g=this.userValues.evaluation_time)!==null&&g!==void 0?g:0}},m.prototype.getEvaluationDetails=function(_,g){var v;return _?{reason:this.reason,time:(v=this.userValues.evaluation_time)!==null&&v!==void 0?v:Date.now()}:{reason:g??(this.reason==d.EvaluationReason.Uninitialized?d.EvaluationReason.Uninitialized:d.EvaluationReason.Unrecognized),time:Date.now()}},m.prototype.resetUserValues=function(){this.userValues={feature_gates:{},dynamic_configs:{},sticky_experiments:{},layer_configs:{},time:0,evaluation_time:0,derived_fields:{}}},m.prototype.getHashedSpecName=function(_){switch(this.userValues.hash_used){case"djb2":return(0,a.djb2Hash)(_);case"none":return _;default:return(0,a.sha256Hash)(_)}},m.prototype.convertAPIDataToCacheValues=function(_,g){var v,S;return{feature_gates:_.feature_gates,layer_configs:_.layer_configs,dynamic_configs:_.dynamic_configs,sticky_experiments:(S=(v=this.values[g])===null||v===void 0?void 0:v.sticky_experiments)!==null&&S!==void 0?S:{},time:_.time==null||isNaN(_.time)?0:_.time,evaluation_time:Date.now(),hash_used:_.hash_used,derived_fields:_.derived_fields}},m.prototype.setItemToStorage=function(_,g){var v=this;c.default.asyncStorage?c.default.setItemAsync(_,g).catch(function(S){v.sdkInternal.getErrorBoundary().logError("setItemToStorage",S)}):l.default.setItem(_,g)},m.prototype.makeOnConfigDefaultValueFallback=function(_){var g=this;return function(v,S,C,R){g.isLoaded()&&g.sdkInternal.getLogger().logConfigDefaultValueFallback(_,"Parameter "+S+" is a value of type "+R+`. Returning requested defaultValue type `+C,{name:v.getName(),ruleID:v.getRuleID(),parameter:S,defaultValueType:C,valueType:R})}},m}();rt.default=h;function p(m,_){var g,v,S;((g=m.deleted_configs)!==null&&g!==void 0?g:[]).forEach(function(C){delete _.dynamic_configs[C]}),((v=m.deleted_gates)!==null&&v!==void 0?v:[]).forEach(function(C){delete _.feature_gates[C]}),((S=m.deleted_layers)!==null&&S!==void 0?S:[]).forEach(function(C){delete _.layer_configs[C]})}return rt}var Fs={},Jf;function NA(){if(Jf)return Fs;Jf=1,Object.defineProperty(Fs,"__esModule",{value:!0});var t=Av(),e=function(){function n(r){this.logLevel=r}return n.prototype.info=function(r){this.logLevel!==t.LogLevel.NONE&&console.log(r)},n.prototype.error=function(r){this.logLevel===t.LogLevel.DEBUG&&console.error(r)},n}();return Fs.default=e,Fs}var Qf;function Zf(){if(Qf)return nt;Qf=1;var t=nt&&nt.__assign||function(){return t=Object.assign||function(T){for(var y,b=1,I=arguments.length;b<I;b++){y=arguments[b];for(var k in y)Object.prototype.hasOwnProperty.call(y,k)&&(T[k]=y[k])}return T},t.apply(this,arguments)},e=nt&&nt.__awaiter||function(T,y,b,I){function k(w){return w instanceof b?w:new b(function(D){D(w)})}return new(b||(b=Promise))(function(w,D){function M(P){try{L(I.next(P))}catch($){D($)}}function A(P){try{L(I.throw(P))}catch($){D($)}}function L(P){P.done?w(P.value):k(P.value).then(M,A)}L((I=I.apply(T,y||[])).next())})},n=nt&&nt.__generator||function(T,y){var b={label:0,sent:function(){if(w[0]&1)throw w[1];return w[1]},trys:[],ops:[]},I,k,w,D;return D={next:M(0),throw:M(1),return:M(2)},typeof Symbol=="function"&&(D[Symbol.iterator]=function(){return this}),D;function M(L){return function(P){return A([L,P])}}function A(L){if(I)throw new TypeError("Generator is already executing.");for(;b;)try{if(I=1,k&&(w=L[0]&2?k.return:L[0]?k.throw||((w=k.return)&&w.call(k),0):k.next)&&!(w=w.call(k,L[1])).done)return w;switch(k=0,w&&(L=[L[0]&2,w.value]),L[0]){case 0:case 1:w=L;break;case 4:return b.label++,{value:L[1],done:!1};case 5:b.label++,k=L[1],L=[0];continue;case 7:L=b.ops.pop(),b.trys.pop();continue;default:if(w=b.trys,!(w=w.length>0&&w[w.length-1])&&(L[0]===6||L[0]===2)){b=0;continue}if(L[0]===3&&(!w||L[1]>w[0]&&L[1]<w[3])){b.label=L[1];break}if(L[0]===6&&b.label<w[1]){b.label=w[1],w=L;break}if(w&&b.label<w[2]){b.label=w[2],b.ops.push(L);break}w[2]&&b.ops.pop(),b.trys.pop();continue}L=y.call(T,b)}catch(P){L=[6,P],k=0}finally{I=w=0}if(L[0]&5)throw L[1];return{value:L[0]?L[1]:void 0,done:!0}}},r=nt&&nt.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(nt,"__esModule",{value:!0});var i=r(ul()),s=r(TA()),o=al(),u=r(cl()),a=r(Rv()),c=r(CA()),l=r(kA()),d=r(Ov()),f=r(Av()),h=r(LA()),p=Di(),m=ll(),_=r(rs()),g=r(va()),v=r(ma()),S=r(NA()),C=kv(),R=64,E=2048,x=function(){function T(y,b,I){var k=this;if(this.appState=null,this.currentAppState=null,this.onCacheLoadedForReact=null,this.initCalled=!1,this.pendingInitPromise=null,this.optionalLoggingSetup=!1,this.prefetchedUsersByCacheKey={},this.logLayerParameterExposureForLayer=function(D,M,A){A===void 0&&(A=!1);var L="",P=D._getUndelegatedSecondaryExposures(),$=D._getExplicitParameters().includes(M);$&&(L=D._getAllocatedExperimentName(),P=D._getSecondaryExposures()),k.logger.logLayerExposure(k.getCurrentUser(),D.getName(),D.getRuleID(),P,L,M,$,D._getEvaluationDetails(),A)},I?.localMode!==!0&&(typeof y!="string"||!y.startsWith("client-")))throw new o.StatsigInvalidArgumentError("Invalid key provided. You must use a Client SDK Key from the Statsig console to initialize the sdk");if(this.startTime=(0,C.now)(),this.options=new f.default(I),this.logger=new l.default(this),v.default.initialize({options:this.options}),this.errorBoundary=new s.default(y),this.ready=!1,this.sdkKey=y,this.consoleLogger=new S.default(this.options.getLogLevel()),g.default.disabled=this.options.getDisableLocalStorage(),this.identity=new c.default(this.normalizeUser(b??null),this.options.getOverrideStableID(),T.reactNativeUUID),this.network=new d.default(this),this.store=new h.default(this,this.options.getInitializeValues()),this.errorBoundary.setStatsigMetadata(this.getStatsigMetadata()),this.options.getInitializeValues()!=null){var w=this.options.getInitCompletionCallback();this.ready=!0,this.initCalled=!0,setTimeout(function(){return k.delayedSetup()},20),this.handleOptionalLogging(),w&&w((0,C.now)()-this.startTime,!0,null)}}return T.prototype.getErrorBoundary=function(){return this.errorBoundary},T.prototype.getNetwork=function(){return this.network},T.prototype.getStore=function(){return this.store},T.prototype.getLogger=function(){return this.logger},T.prototype.getOptions=function(){return this.options},T.prototype.getSDKKey=function(){var y=this;return this.errorBoundary.capture("getSDKKey",function(){var b;return(b=y.sdkKey)!==null&&b!==void 0?b:""},function(){return""})},T.prototype.getCurrentUser=function(){var y=this;return this.errorBoundary.capture("getCurrentUser",function(){return y.identity.getUser()},function(){return null})},T.prototype.getCurrentUserCacheKey=function(){var y=this;return this.errorBoundary.capture("getCurrentUserCacheKey",function(){return(0,m.getUserCacheKey)(y.getStableID(),y.getCurrentUser())},function(){return{v1:"",v2:""}})},T.prototype.getCurrentUserUnitID=function(y){var b=this;return this.errorBoundary.capture("getCurrentUserUnitID",function(){return b.getUnitID(b.getCurrentUser(),y)},function(){return""})},T.prototype.getCurrentUserID=function(){var y=this;return this.errorBoundary.capture("getCurrentUserID",function(){return y.getUnitID(y.getCurrentUser(),"userid")},function(){return""})},T.prototype.getUnitID=function(y,b){var I,k,w;return y?b.toLowerCase()==="userid"?(k=(I=y.userID)===null||I===void 0?void 0:I.toString())!==null&&k!==void 0?k:null:y.customIDs?(w=y.customIDs[b])!==null&&w!==void 0?w:y.customIDs[b.toLowerCase()]:null:null},T.prototype.getStatsigMetadata=function(){var y=this;return this.errorBoundary.capture("getStatsigMetadata",function(){return y.identity.getStatsigMetadata()},function(){return{}})},T.prototype.getSDKType=function(){var y=this;return this.errorBoundary.capture("getSDKType",function(){return y.identity.getSDKType()},function(){return""})},T.prototype.getSDKVersion=function(){var y=this;return this.errorBoundary.capture("getSDKVersion",function(){return y.identity.getSDKVersion()},function(){return""})},T.prototype.getConsoleLogger=function(){return this.consoleLogger},T.prototype.delayedSetup=function(){var y=this;this.errorBoundary.swallow("delayedSetup",function(){y.options.getInitializeValues()!=null&&y.fireAndForgetPrefechUsers(),y.identity.saveStableID(),y.logger.sendSavedRequests().catch(function(b){return y.errorBoundary.logError("sendSavedRequests:delayedSetup",b)})})},T.prototype.setInitializeValues=function(y){var b=this;this.errorBoundary.capture("setInitializeValues",function(){b.store.bootstrap(y);var I=null;b.ready||(b.ready=!0,b.initCalled=!0,I=b.options.getInitCompletionCallback()),b.handleOptionalLogging(),b.logger.sendSavedRequests().catch(function(k){return b.errorBoundary.logError("sendSavedRequests:setInitializeValues",k)}),I&&I((0,C.now)()-b.startTime,!0,null)},function(){b.ready=!0,b.initCalled=!0;var I=b.options.getInitCompletionCallback();I&&I((0,C.now)()-b.startTime,!1,"Caught an exception during setInitializeValues")})},T.prototype.initializeAsync=function(){return e(this,void 0,void 0,function(){var y=this;return n(this,function(b){return[2,this.errorBoundary.capture("initializeAsync",function(){return e(y,void 0,void 0,function(){var I,k=this,w;return n(this,function(D){switch(D.label){case 0:return this.pendingInitPromise!=null?[2,this.pendingInitPromise]:this.ready?[2,Promise.resolve()]:(v.default.mark.overall.start({}),this.initCalled=!0,_.default.asyncStorage?[4,this.identity.initAsync()]:[3,3]);case 1:return D.sent(),[4,this.store.loadAsync()];case 2:D.sent(),D.label=3;case 3:return(w=this.onCacheLoadedForReact)===null||w===void 0||w.call(this),this.appState&&this.appState.addEventListener&&typeof this.appState.addEventListener=="function"&&(this.currentAppState=this.appState.currentState,this.appState.addEventListener("change",this.handleAppStateChange.bind(this))),this.options.getLocalModeEnabled()?[2,Promise.resolve()]:(I=this.identity.getUser(),this.pendingInitPromise=this.fetchAndSaveValues({user:I,prefetchUsers:this.options.getPrefetchUsers(),timeout:this.options.getInitTimeoutMs()}).then(function(){return v.default.mark.overall.end({success:!0,evaluationDetails:k.store.getGlobalEvaluationDetails()}),{success:!0,message:null}}).catch(function(M){var A;return k.errorBoundary.logError("initializeAsync:fetchAndSaveValues",M),v.default.mark.overall.end({success:!1,error:v.default.formatError(M),evaluationDetails:k.store.getGlobalEvaluationDetails()}),{success:!1,message:(A=M.message)!==null&&A!==void 0?A:null}}).then(function(M){var A=M.success,L=M.message,P=k.options.getInitCompletionCallback();P&&P((0,C.now)()-k.startTime,A,L)}).finally(function(){return e(k,void 0,void 0,function(){return n(this,function(M){return this.pendingInitPromise=null,this.ready=!0,this.delayedSetup(),this.logger.logDiagnostics(I,"initialize"),[2]})})}),this.handleOptionalLogging(),[2,this.pendingInitPromise])}})})},function(){return y.ready=!0,y.initCalled=!0,Promise.resolve()})]})})},T.prototype.prefetchUsers=function(y){return e(this,void 0,void 0,function(){var b=this;return n(this,function(I){return[2,this.errorBoundary.capture("prefetchUsers",function(){if(!(!y||y.length==0))return b.fetchAndSaveValues({user:null,prefetchUsers:y,timeout:0})},function(){return Promise.resolve()})]})})},T.prototype.getEvaluationDetails=function(){var y=this;return this.errorBoundary.capture("getEvaluationDetails",function(){return y.store.getGlobalEvaluationDetails()},function(){return{time:Date.now(),reason:p.EvaluationReason.Error}})},T.prototype.checkGate=function(y,b){var I=this;return b===void 0&&(b=!1),this.errorBoundary.capture("checkGate",function(){var k=I.checkGateImpl(y,b);I.logGateExposureImpl(y,k);var w=I.options.getGateEvaluationCallback();return w&&w(y,k.gate.value,{withExposureLoggingDisabled:!1}),k.gate.value===!0},function(){return!1},{configName:y})},T.prototype.checkGateWithExposureLoggingDisabled=function(y,b){var I=this;return b===void 0&&(b=!1),this.errorBoundary.capture("checkGateWithExposureLoggingDisabled",function(){var k=I.checkGateImpl(y,b),w=I.options.getGateEvaluationCallback();return w&&w(y,k.gate.value,{withExposureLoggingDisabled:!0}),k.gate.value===!0},function(){return!1})},T.prototype.logGateExposure=function(y){var b=this;this.errorBoundary.swallow("logGateExposure",function(){b.logGateExposureImpl(y)})},T.prototype.getConfig=function(y,b){var I=this;return b===void 0&&(b=!1),this.errorBoundary.capture("getConfig",function(){var k=I.getConfigImpl(y,b);return I.logConfigExposureImpl(y,k),k},function(){return I.getEmptyConfig(y)},{configName:y})},T.prototype.getConfigWithExposureLoggingDisabled=function(y,b){var I=this;return b===void 0&&(b=!1),this.errorBoundary.capture("getConfig",function(){return I.getConfigImpl(y,b)},function(){return I.getEmptyConfig(y)})},T.prototype.logConfigExposure=function(y){var b=this;this.errorBoundary.swallow("logConfigExposure",function(){b.logConfigExposureImpl(y)})},T.prototype.getExperiment=function(y,b,I){var k=this;return b===void 0&&(b=!1),I===void 0&&(I=!1),this.errorBoundary.capture("getExperiment",function(){var w=k.getExperimentImpl(y,b,I);return k.logExperimentExposureImpl(y,b,w),w},function(){return k.getEmptyConfig(y)},{configName:y})},T.prototype.getExperimentWithExposureLoggingDisabled=function(y,b,I){var k=this;return b===void 0&&(b=!1),I===void 0&&(I=!1),this.errorBoundary.capture("getExperimentWithExposureLoggingDisabled",function(){return k.getExperimentImpl(y,b,I)},function(){return k.getEmptyConfig(y)})},T.prototype.logExperimentExposure=function(y,b){var I=this;this.errorBoundary.swallow("logExperimentExposure",function(){I.logExperimentExposureImpl(y,b)})},T.prototype.getLayer=function(y,b){var I=this;return b===void 0&&(b=!1),this.errorBoundary.capture("getLayer",function(){return I.getLayerImpl(I.logLayerParameterExposureForLayer,y,b)},function(){return u.default._create(y,{},"",I.getEvalutionDetailsForError())},{configName:y})},T.prototype.getLayerWithExposureLoggingDisabled=function(y,b){var I=this;return b===void 0&&(b=!1),this.errorBoundary.capture("getLayerWithExposureLoggingDisabled",function(){return I.getLayerImpl(null,y,b)},function(){return u.default._create(y,{},"",I.getEvalutionDetailsForError())})},T.prototype.logLayerParameterExposure=function(y,b,I){var k=this;I===void 0&&(I=!1),this.errorBoundary.swallow("logLayerParameterExposure",function(){var w=k.getLayerImpl(null,y,I);k.logLayerParameterExposureForLayer(w,b,!0)})},T.prototype.logEvent=function(y,b,I){var k=this;b===void 0&&(b=null),I===void 0&&(I=null),this.errorBoundary.swallow("logEvent",function(){if(!k.logger||!k.sdkKey)throw new o.StatsigUninitializedError("Must initialize() before logging events.");if(typeof y!="string"||y.length===0){k.consoleLogger.error("Event not logged. No valid eventName passed.");return}k.shouldTrimParam(y,R)&&(k.consoleLogger.info("eventName is too long, trimming to "+R+" characters."),y=y.substring(0,R)),typeof b=="string"&&k.shouldTrimParam(b,R)&&(k.consoleLogger.info("value is too long, trimming to "+R+"."),b=b.substring(0,R)),k.shouldTrimParam(I,E)&&(k.consoleLogger.info("metadata is too big. Dropping the metadata."),I={error:"not logged due to size too large"});var w=new a.default(y);w.setValue(b),w.setMetadata(I),w.setUser(k.getCurrentUser()),k.logger.log(w)})},T.prototype.updateUserWithValues=function(y,b){var I=this,k;return this.errorBoundary.capture("updateUserWithValues",function(){var w=Date.now();if(!I.initializeCalled())throw new o.StatsigUninitializedError("Call initialize() first.");return k=function(D,M){var A=I.options.getUpdateUserCompletionCallback();A?.(Date.now()-w,D,M)},I.identity.updateUser(I.normalizeUser(y)),I.store.bootstrap(b),k(!0,null),!0},function(){return k?.(!1,"Failed to update user. An unexpected error occured."),!1})},T.prototype.updateUser=function(y){return e(this,void 0,void 0,function(){var b,I=this;return n(this,function(k){return[2,this.errorBoundary.capture("updateUser",function(){return e(I,void 0,void 0,function(){var w,D,M,A,L,P=this;return n(this,function($){switch($.label){case 0:if(w=Date.now(),!this.initializeCalled())throw new o.StatsigUninitializedError("Call initialize() first.");return b=function(N,j){var q=P.options.getUpdateUserCompletionCallback();q?.(Date.now()-w,N,j)},this.identity.updateUser(this.normalizeUser(y)),D=this.getCurrentUserCacheKey(),M=!!this.prefetchedUsersByCacheKey[D.v2],A=this.store.updateUser(M),v.default.clearContext("api_call"),this.logger.resetDedupeKeys(),A!=null&&(M||this.isCacheValidForFetchMode(A))?(b(!0,null),[2,Promise.resolve(!0)]):this.pendingInitPromise==null?[3,2]:[4,this.pendingInitPromise];case 1:$.sent(),$.label=2;case 2:return this.options.getLocalModeEnabled()?(b(!0,null),[2,Promise.resolve(!0)]):(L=this.identity.getUser(),this.pendingInitPromise=this.fetchAndSaveValues({user:L,prefetchUsers:[],timeout:void 0}).finally(function(){P.pendingInitPromise=null}),[2,this.pendingInitPromise.then(function(){return b(!0,null),Promise.resolve(!0)}).catch(function(N){return b(!1,"Failed to update user: "+N),Promise.resolve(!1)})])}})})},function(){return b?.(!1,"Failed to update user. An unexpected error occured."),Promise.resolve(!1)})]})})},T.prototype.shutdown=function(){var y=this;this.errorBoundary.swallow("shutdown",function(){y.logger.shutdown(),y.appState&&y.appState.removeEventListener&&typeof y.appState.removeEventListener=="function"&&y.appState.removeEventListener("change",y.handleAppStateChange.bind(y)),g.default.cleanup()})},T.prototype.overrideGate=function(y,b){var I=this;this.errorBoundary.swallow("overrideGate",function(){I.ensureStoreLoaded(),I.store.overrideGate(y,b)})},T.prototype.overrideConfig=function(y,b){var I=this;this.errorBoundary.swallow("overrideConfig",function(){I.ensureStoreLoaded(),I.store.overrideConfig(y,b)})},T.prototype.overrideLayer=function(y,b){var I=this;this.errorBoundary.swallow("overrideLayer",function(){I.ensureStoreLoaded(),I.store.overrideLayer(y,b)})},T.prototype.removeGateOverride=function(y){var b=this;this.errorBoundary.swallow("removeGateOverride",function(){b.ensureStoreLoaded(),b.store.removeGateOverride(y)})},T.prototype.removeConfigOverride=function(y){var b=this;this.errorBoundary.swallow("removeConfigOverride",function(){b.ensureStoreLoaded(),b.store.removeConfigOverride(y)})},T.prototype.removeLayerOverride=function(y){var b=this;this.errorBoundary.swallow("removeLayerOverride",function(){b.ensureStoreLoaded(),b.store.removeLayerOverride(y)})},T.prototype.removeOverride=function(y){var b=this;this.errorBoundary.swallow("removeOverride",function(){b.ensureStoreLoaded(),b.store.removeGateOverride(y)})},T.prototype.getOverrides=function(){var y=this;return this.errorBoundary.capture("getOverrides",function(){return y.ensureStoreLoaded(),y.store.getAllOverrides().gates},function(){return{}})},T.prototype.getAllOverrides=function(){var y=this;return this.errorBoundary.capture("getAllOverrides",function(){return y.ensureStoreLoaded(),y.store.getAllOverrides()},function(){return{gates:{},configs:{},layers:{}}})},T.prototype.getStableID=function(){var y=this;return this.errorBoundary.capture("getStableID",function(){return y.identity.getStatsigMetadata().stableID},function(){return""})},T.prototype.initializeCalled=function(){return this.initCalled},T.prototype.setSDKPackageInfo=function(y){y!=null&&(this.identity.setSDKPackageInfo(y),this.errorBoundary.setStatsigMetadata(this.getStatsigMetadata()))},T.setAsyncStorage=function(y){y!=null&&(_.default.asyncStorage=y)},T.prototype.setOnCacheLoadedReactCallback=function(y){this.onCacheLoadedForReact=y??null},T.setReactNativeUUID=function(y){y!=null&&(T.reactNativeUUID=y)},T.prototype.setAppState=function(y){y!=null&&(this.appState=y)},T.prototype.setNativeModules=function(y){y!=null&&this.identity.setNativeModules(y)},T.prototype.setPlatform=function(y){y!=null&&this.identity.setPlatform(y)},T.prototype.setRNDeviceInfo=function(y){y!=null&&this.identity.setRNDeviceInfo(y)},T.prototype.setExpoConstants=function(y){y!=null&&this.identity.setExpoConstants(y)},T.prototype.setExpoDevice=function(y){y!=null&&this.identity.setExpoDevice(y)},T.prototype.flushEvents=function(){this.logger.flush()},T.prototype.reenableAllLogging=function(){this.getOptions().reenableAllLogging()},T.prototype.isCacheValidForFetchMode=function(y){return this.options.getFetchMode()!=="cache-or-network"?!1:y>this.startTime},T.prototype.handleOptionalLogging=function(){var y=this,b=this.options.getDisableErrorLogging(),I=this.options.getDisableAutoMetricsLogging();if(!(b&&I)&&!(this.optionalLoggingSetup||typeof window>"u"||!window||!window.addEventListener)){var k=this.identity.getUser();if(b||window.addEventListener("error",function(D){var M,A=D.error;if(A!=null&&typeof A=="object")try{A=JSON.stringify(A)}catch{A="Failed to stringify Error"}y.logger.logAppError(k,(M=D.message)!==null&&M!==void 0?M:"",{filename:D.filename,lineno:D.lineno,colno:D.colno,error_obj:A})}),!I){if(typeof document>"u"||!document||typeof setTimeout>"u"||!setTimeout)return;var w=function(){setTimeout(function(){y.logger.logAppMetrics(k)},1e3)};document.readyState==="complete"?w():window.addEventListener("load",function(){return w()})}this.optionalLoggingSetup=!0}},T.prototype.handleAppStateChange=function(y){var b=this,I;this.currentAppState==="active"&&y.match(/inactive|background/)?this.logger.flush(!0):!((I=this.currentAppState)===null||I===void 0)&&I.match(/inactive|background/)&&y==="active"&&this.logger.sendSavedRequests().catch(function(k){return b.errorBoundary.logError("sendSavedRequests:handleAppStateChange",k)}),this.currentAppState=y},T.prototype.shouldTrimParam=function(y,b){return y==null?!1:typeof y=="string"?y.length>b:typeof y=="object"?JSON.stringify(y).length>b:typeof y=="number"?y.toString().length>b:!1},T.prototype.normalizePrefetchUsers=function(y){var b=this;return y==null?[]:y.map(function(I){return b.normalizeUser(I)})},T.prototype.normalizeUser=function(y){var b={};try{b=JSON.parse(JSON.stringify(y))}catch{throw new o.StatsigInvalidArgumentError("User object must be convertable to JSON string.")}return b=this.trimUserObjIfNeeded(b),this.options.getEnvironment()!=null&&(b.statsigEnvironment=this.options.getEnvironment()),b},T.prototype.trimUserObjIfNeeded=function(y){var b,I;return y==null?{}:(this.shouldTrimParam((b=y.userID)!==null&&b!==void 0?b:null,R)&&(this.consoleLogger.info("User ID is too large, trimming to "+R+"characters"),y.userID=(I=y.userID)===null||I===void 0?void 0:I.toString().substring(0,R)),this.shouldTrimParam(y,E)&&(y.custom={},this.shouldTrimParam(y,E)?(this.consoleLogger.info("User object is too large, only keeping the user ID."),y={userID:y.userID}):this.consoleLogger.info("User object is too large, dropping the custom property.")),y)},T.prototype.ensureStoreLoaded=function(){if(!this.store.isLoaded())throw new o.StatsigUninitializedError("Call and wait for initialize() to finish first.")},T.prototype.getEvalutionDetailsForError=function(){return{time:Date.now(),reason:p.EvaluationReason.Error}},T.prototype.fetchAndSaveValues=function(y){var b,I;return e(this,void 0,void 0,function(){var k,w,D,M,A,L,P=this;return n(this,function($){return k=y.user,w=(b=y.prefetchUsers)!==null&&b!==void 0?b:[],D=(I=y.timeout)!==null&&I!==void 0?I:this.options.getInitTimeoutMs(),w.length>5&&this.consoleLogger.info("Cannot prefetch more than 5 users."),M=this.normalizePrefetchUsers(w).slice(0,5).reduce(function(N,j){return N[(0,m.getUserCacheKey)(P.getStableID(),j).v2]=j,N},{}),A=null,w.length===0&&(A=this.store.getLastUpdateTime(k)),L=this.store.getPreviousDerivedFields(k),[2,this.network.fetchValues({user:k,sinceTime:A,timeout:D,useDeltas:A!=null,prefetchUsers:w.length>0?M:void 0,previousDerivedFields:L}).eventually(function(N){N?.has_updates&&P.store.saveWithoutUpdatingClientState(k,N,w.length>0?M:void 0).catch(function(j){return P.errorBoundary.logError("fetchAndSaveValues:eventually",j)})}).then(function(N){return e(P,void 0,void 0,function(){var j=this;return n(this,function(q){return[2,this.errorBoundary.swallow("fetchAndSaveValues",function(){return e(j,void 0,void 0,function(){return n(this,function(Q){switch(Q.label){case 0:return v.default.mark.intialize.process.start({}),N?.has_updates?[4,this.store.save(k,N,w.length>0?M:void 0)]:[3,2];case 1:return Q.sent(),[3,3];case 2:N?.is_no_content&&this.store.setEvaluationReason(p.EvaluationReason.NetworkNotModified),Q.label=3;case 3:return this.prefetchedUsersByCacheKey=t(t({},this.prefetchedUsersByCacheKey),M),v.default.mark.intialize.process.end({success:!0}),[2]}})})})]})})})]})})},T.prototype.checkGateImpl=function(y,b){if(this.ensureStoreLoaded(),typeof y!="string"||y.length===0)throw new o.StatsigInvalidArgumentError("Must pass a valid string as the gateName.");return this.store.checkGate(y,b)},T.prototype.logGateExposureImpl=function(y,b){var I=!b,k=b??this.checkGateImpl(y,!1),w=k.gate;this.logger.logGateExposure(this.getCurrentUser(),y,w.value,w.rule_id,w.secondary_exposures,k.evaluationDetails,I)},T.prototype.getConfigImpl=function(y,b){if(this.ensureStoreLoaded(),typeof y!="string"||y.length===0)throw new o.StatsigInvalidArgumentError("Must pass a valid string as the configName.");return this.store.getConfig(y,b)},T.prototype.logConfigExposureImpl=function(y,b){var I=!b,k=b??this.getConfigImpl(y,!1);this.logger.logConfigExposure(this.getCurrentUser(),y,k.getRuleID(),k._getSecondaryExposures(),k.getEvaluationDetails(),I)},T.prototype.getExperimentImpl=function(y,b,I){if(this.ensureStoreLoaded(),typeof y!="string"||y.length===0)throw new o.StatsigInvalidArgumentError("Must pass a valid string as the experimentName.");return this.store.getExperiment(y,b,I)},T.prototype.logExperimentExposureImpl=function(y,b,I){var k=!I,w=I??this.getExperimentImpl(y,b,!1);this.logger.logConfigExposure(this.getCurrentUser(),y,w.getRuleID(),w._getSecondaryExposures(),w.getEvaluationDetails(),k)},T.prototype.getLayerImpl=function(y,b,I){if(this.ensureStoreLoaded(),typeof b!="string"||b.length===0)throw new o.StatsigInvalidArgumentError("Must pass a valid string as the layerName.");return this.store.getLayer(y,b,I)},T.prototype.getEmptyConfig=function(y){return new i.default(y,{},"",this.getEvalutionDetailsForError())},T.prototype.fireAndForgetPrefechUsers=function(){this.prefetchUsers(this.options.getPrefetchUsers()).catch(function(){})},T}();return nt.default=x,nt}var Bs={},eh;function PA(){if(eh)return Bs;eh=1,Object.defineProperty(Bs,"__esModule",{value:!0});function t(){Object.entries||(Object.entries=function(e){for(var n=Object.keys(e),r=n.length,i=new Array(r);r--;)i[r]=[n[r],e[n[r]]];return i})}return Bs.default=t,Bs}var Hs={},th;function $A(){if(th)return Hs;th=1,Object.defineProperty(Hs,"__esModule",{value:!0});function t(){Object.fromEntries||(Object.fromEntries=function(e){for(var n={},r=0,i=e;r<i.length;r++){var s=i[r];if(Object(s)!==s)throw new TypeError("iterable for fromEntries should yield objects");var o=s[0],u=s[1];Object.defineProperty(n,o,{configurable:!0,enumerable:!0,writable:!0,value:u})}return n})}return Hs.default=t,Hs}var js={},nh;function UA(){if(nh)return js;nh=1,Object.defineProperty(js,"__esModule",{value:!0});function t(){Promise.prototype.finally=Promise.prototype.finally||function(e){var n=function(r){return Promise.resolve(e()).then(r)};return this.then(function(r){return n(function(){return r})},function(r){return n(function(){return Promise.reject(r)})})}}return js.default=t,js}var rh;function is(){return rh||(rh=1,function(t){var e=Nt&&Nt.__awaiter||function(g,v,S,C){function R(E){return E instanceof S?E:new S(function(x){x(E)})}return new(S||(S=Promise))(function(E,x){function T(I){try{b(C.next(I))}catch(k){x(k)}}function y(I){try{b(C.throw(I))}catch(k){x(k)}}function b(I){I.done?E(I.value):R(I.value).then(T,y)}b((C=C.apply(g,v||[])).next())})},n=Nt&&Nt.__generator||function(g,v){var S={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},C,R,E,x;return x={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function T(b){return function(I){return y([b,I])}}function y(b){if(C)throw new TypeError("Generator is already executing.");for(;S;)try{if(C=1,R&&(E=b[0]&2?R.return:b[0]?R.throw||((E=R.return)&&E.call(R),0):R.next)&&!(E=E.call(R,b[1])).done)return E;switch(R=0,E&&(b=[b[0]&2,E.value]),b[0]){case 0:case 1:E=b;break;case 4:return S.label++,{value:b[1],done:!1};case 5:S.label++,R=b[1],b=[0];continue;case 7:b=S.ops.pop(),S.trys.pop();continue;default:if(E=S.trys,!(E=E.length>0&&E[E.length-1])&&(b[0]===6||b[0]===2)){S=0;continue}if(b[0]===3&&(!E||b[1]>E[0]&&b[1]<E[3])){S.label=b[1];break}if(b[0]===6&&S.label<E[1]){S.label=E[1],E=b;break}if(E&&S.label<E[2]){S.label=E[2],S.ops.push(b);break}E[2]&&S.ops.pop(),S.trys.pop();continue}b=v.call(g,S)}catch(I){b=[6,I],R=0}finally{C=E=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},r=Nt&&Nt.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigAsyncStorage=t.EvaluationReason=t.StatsigClient=t.Layer=t.DynamicConfig=void 0;var i=al(),s=r(Zf()),o=r(xv()),u=r(PA()),a=r($A()),c=r(UA()),l=Di(),d=ul();Object.defineProperty(t,"DynamicConfig",{enumerable:!0,get:function(){return r(d).default}});var f=cl();Object.defineProperty(t,"Layer",{enumerable:!0,get:function(){return r(f).default}});var h=Zf();Object.defineProperty(t,"StatsigClient",{enumerable:!0,get:function(){return r(h).default}});var p=Di();Object.defineProperty(t,"EvaluationReason",{enumerable:!0,get:function(){return p.EvaluationReason}});var m=rs();Object.defineProperty(t,"StatsigAsyncStorage",{enumerable:!0,get:function(){return r(m).default}}),(0,u.default)(),(0,a.default)(),(0,c.default)();var _=function(){function g(){}return Object.defineProperty(g,"encodeIntializeCall",{get:function(){return o.default.encodeInitializeCall},set:function(v){o.default.encodeInitializeCall=v},enumerable:!1,configurable:!0}),g.initialize=function(v,S,C){var R;return e(this,void 0,void 0,function(){var E;return n(this,function(x){return E=(R=g.instance)!==null&&R!==void 0?R:new s.default(v,S,C),g.instance||(g.instance=E),[2,E.initializeAsync()]})})},g.prefetchUsers=function(v){return e(this,void 0,void 0,function(){return n(this,function(S){switch(S.label){case 0:return[4,g.getClientX().prefetchUsers(v)];case 1:return[2,S.sent()]}})})},g.setInitializeValues=function(v){g.getClientX().setInitializeValues(v)},g.checkGate=function(v,S){return S===void 0&&(S=!1),g.getClientX().checkGate(v,S)},g.checkGateWithExposureLoggingDisabled=function(v,S){return S===void 0&&(S=!1),g.getClientX().checkGateWithExposureLoggingDisabled(v,S)},g.manuallyLogGateExposure=function(v){g.getClientX().logGateExposure(v)},g.getConfig=function(v,S){return S===void 0&&(S=!1),g.getClientX().getConfig(v,S)},g.getConfigWithExposureLoggingDisabled=function(v,S){return S===void 0&&(S=!1),g.getClientX().getConfigWithExposureLoggingDisabled(v,S)},g.manuallyLogConfigExposure=function(v){g.getClientX().logConfigExposure(v)},g.getExperiment=function(v,S,C){return S===void 0&&(S=!1),C===void 0&&(C=!1),g.getClientX().getExperiment(v,S,C)},g.getExperimentWithExposureLoggingDisabled=function(v,S,C){return S===void 0&&(S=!1),C===void 0&&(C=!1),g.getClientX().getExperimentWithExposureLoggingDisabled(v,S,C)},g.manuallyLogExperimentExposure=function(v,S){S===void 0&&(S=!1),g.getClientX().logExperimentExposure(v,S)},g.getLayer=function(v,S){return S===void 0&&(S=!1),g.getClientX().getLayer(v,S)},g.getLayerWithExposureLoggingDisabled=function(v,S){return S===void 0&&(S=!1),g.getClientX().getLayerWithExposureLoggingDisabled(v,S)},g.manuallyLogLayerParameterExposure=function(v,S,C){C===void 0&&(C=!1),g.getClientX().logLayerParameterExposure(v,S,C)},g.logEvent=function(v,S,C){return S===void 0&&(S=null),C===void 0&&(C=null),g.getClientX().logEvent(v,S,C)},g.updateUser=function(v){return g.getClientX().updateUser(v)},g.updateUserWithValues=function(v,S){return g.getClientX().updateUserWithValues(v,S)},g.shutdown=function(){g.getClientX().shutdown(),g.instance=null},g.overrideGate=function(v,S){g.getClientX().overrideGate(v,S)},g.overrideConfig=function(v,S){g.getClientX().overrideConfig(v,S)},g.overrideLayer=function(v,S){g.getClientX().overrideLayer(v,S)},g.removeGateOverride=function(v){g.getClientX().removeGateOverride(v)},g.removeConfigOverride=function(v){g.getClientX().removeConfigOverride(v)},g.removeLayerOverride=function(v){g.getClientX().removeLayerOverride(v)},g.getAllOverrides=function(){return g.getClientX().getAllOverrides()},g.getStableID=function(){return g.getClientX().getStableID()},g.getEvaluationDetails=function(){var v,S;return(S=(v=g.instance)===null||v===void 0?void 0:v.getEvaluationDetails())!==null&&S!==void 0?S:{reason:l.EvaluationReason.Uninitialized,time:0}},g.removeOverride=function(v){g.getClientX().removeOverride(v)},g.getOverrides=function(){return g.getClientX().getOverrides()},g.initializeCalled=function(){return g.instance!=null&&g.instance.initializeCalled()},g.flushEvents=function(){g.getClientX().flushEvents()},g.reenableAllLogging=function(){g.getClientX().reenableAllLogging()},g.getClientX=function(){if(!g.instance)throw new i.StatsigUninitializedError;return g.instance},g.instance=null,g}();t.default=_}(Nt)),Nt}var Tt={},ai={},ih;function Dv(){if(ih)return ai;ih=1,Object.defineProperty(ai,"__esModule",{value:!0}),ai.staticImplements=void 0;function t(){return function(e){}}return ai.staticImplements=t,ai}var ui={},sh;function Mv(){return sh||(sh=1,Object.defineProperty(ui,"__esModule",{value:!0}),ui.version=void 0,ui.version="1.32.0"),ui}var oh;function Qr(){if(oh)return Tt;oh=1;var t={},e=Tt&&Tt.__decorate||function(a,c,l,d){var f=arguments.length,h=f<3?c:d===null?d=Object.getOwnPropertyDescriptor(c,l):d,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(a,c,l,d);else for(var m=a.length-1;m>=0;m--)(p=a[m])&&(h=(f<3?p(h):f>3?p(c,l,h):p(c,l))||h);return f>3&&h&&Object.defineProperty(c,l,h),h},n=Tt&&Tt.__awaiter||function(a,c,l,d){function f(h){return h instanceof l?h:new l(function(p){p(h)})}return new(l||(l=Promise))(function(h,p){function m(v){try{g(d.next(v))}catch(S){p(S)}}function _(v){try{g(d.throw(v))}catch(S){p(S)}}function g(v){v.done?h(v.value):f(v.value).then(m,_)}g((d=d.apply(a,c||[])).next())})},r=Tt&&Tt.__generator||function(a,c){var l={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,f,h,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(g){return function(v){return _([g,v])}}function _(g){if(d)throw new TypeError("Generator is already executing.");for(;l;)try{if(d=1,f&&(h=g[0]&2?f.return:g[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,g[1])).done)return h;switch(f=0,h&&(g=[g[0]&2,h.value]),g[0]){case 0:case 1:h=g;break;case 4:return l.label++,{value:g[1],done:!1};case 5:l.label++,f=g[1],g=[0];continue;case 7:g=l.ops.pop(),l.trys.pop();continue;default:if(h=l.trys,!(h=h.length>0&&h[h.length-1])&&(g[0]===6||g[0]===2)){l=0;continue}if(g[0]===3&&(!h||g[1]>h[0]&&g[1]<h[3])){l.label=g[1];break}if(g[0]===6&&l.label<h[1]){l.label=h[1],h=g;break}if(h&&l.label<h[2]){l.label=h[2],l.ops.push(g);break}h[2]&&l.ops.pop(),l.trys.pop();continue}g=c.call(a,l)}catch(v){g=[6,v],f=0}finally{d=h=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}};Object.defineProperty(Tt,"__esModule",{value:!0});var i=is(),s=Dv(),o=Mv(),u=function(){function a(l,d,f){if(c.instance!=null&&c.canThrow())throw new Error("Cannot create another instance of the static Statsig class");c.instance=new i.StatsigClient(l,d,f)}c=a,a.initialize=function(l,d,f){return n(this,void 0,void 0,function(){return r(this,function(h){try{return c.instance||(c.instance=new i.StatsigClient(l,d,f),c.instance.setSDKPackageInfo(this.sdkPackageInfo),c.instance.setAppState(this.appState),c.instance.setNativeModules(this.nativeModules),c.instance.setPlatform(this.platform),c.instance.setRNDeviceInfo(this.deviceInfo),c.instance.setExpoConstants(this.expoConstants),c.instance.setExpoDevice(this.expoDevice),c.instance.setOnCacheLoadedReactCallback(this.onCacheLoadedCallback)),[2,c.instance.initializeAsync()]}catch(p){if(c.canThrow())throw p}return[2,Promise.resolve()]})})},a.bootstrap=function(l,d,f,h){if(c.instance!=null){c.setInitializeValues(d);return}h==null&&(h={}),h.initializeValues=d,c.instance=new i.StatsigClient(l,f,h),c.instance.setSDKPackageInfo({sdkType:"react-client",sdkVersion:o.version})},a.flushEvents=function(){return this.capture(function(){return c.getClientX().flushEvents()},void 0)},a.reenableAllLogging=function(){return this.capture(function(){return c.getClientX().reenableAllLogging()},void 0)},a.prefetchUsers=function(l){return n(this,void 0,void 0,function(){return r(this,function(d){return[2,this.capture(function(){return c.getClientX().prefetchUsers(l)},Promise.resolve())]})})},a.setInitializeValues=function(l){this.capture(function(){return c.getClientX().setInitializeValues(l)},void 0)},a.getCurrentUser=function(){return this.capture(function(){return c.getClientX().getCurrentUser()},null)},a.checkGate=function(l,d){return d===void 0&&(d=!1),this.capture(function(){return c.getClientX().checkGate(l,d)},!1)},a.checkGateWithExposureLoggingDisabled=function(l,d){return this.capture(function(){return c.getClientX().checkGateWithExposureLoggingDisabled(l,d?.ignoreOverrides)},!1)},a.manuallyLogGateExposure=function(l){this.capture(function(){return c.getClientX().logGateExposure(l)},void 0)},a.getConfig=function(l,d){return d===void 0&&(d=!1),this.capture(function(){return c.getClientX().getConfig(l,d)},new i.DynamicConfig(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.getConfigWithExposureLoggingDisabled=function(l,d){return this.capture(function(){return c.getClientX().getConfigWithExposureLoggingDisabled(l,d?.ignoreOverrides)},new i.DynamicConfig(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.manuallyLogConfigExposure=function(l){this.capture(function(){return c.getClientX().logConfigExposure(l)},void 0)},a.getExperiment=function(l,d,f){return d===void 0&&(d=!1),f===void 0&&(f=!1),this.capture(function(){return c.getClientX().getExperiment(l,d,f)},new i.DynamicConfig(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.getExperimentWithExposureLoggingDisabled=function(l,d){return this.capture(function(){return c.getClientX().getExperimentWithExposureLoggingDisabled(l,d?.keepDeviceValue,d?.ignoreOverrides)},new i.DynamicConfig(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.manuallyLogExperimentExposure=function(l,d){this.capture(function(){return c.getClientX().logExperimentExposure(l,d)},void 0)},a.getLayer=function(l,d){return d===void 0&&(d=!1),this.capture(function(){return c.getClientX().getLayer(l,d)},i.Layer._create(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.getLayerWithExposureLoggingDisabled=function(l,d){return this.capture(function(){return c.getClientX().getLayerWithExposureLoggingDisabled(l,d?.keepDeviceValue)},i.Layer._create(l,{},"",{time:Date.now(),reason:i.EvaluationReason.Uninitialized}))},a.manuallyLogLayerParameterExposure=function(l,d,f){f===void 0&&(f=!1),this.capture(function(){return c.getClientX().logLayerParameterExposure(l,d,f)},void 0)},a.logEvent=function(l,d,f){d===void 0&&(d=null),f===void 0&&(f=null),this.capture(function(){return c.getClientX().logEvent(l,d,f)},void 0)},a.updateUser=function(l){return this.capture(function(){return c.getClientX().updateUser(l)},Promise.resolve(!1))},a.updateUserWithValues=function(l,d){return this.capture(function(){return c.getClientX().updateUserWithValues(l,d)},!1)},a.shutdown=function(){this.capture(function(){return c.getClientX().shutdown()},void 0),c.instance=void 0},a.overrideGate=function(l,d){this.capture(function(){var f;((f=c.getAllOverrides().gates)===null||f===void 0?void 0:f[l])!==d&&(c.getClientX().overrideGate(l,d),c.updateContext())},void 0)},a.overrideConfig=function(l,d){this.capture(function(){var f;((f=c.getAllOverrides().configs)===null||f===void 0?void 0:f[l])!==d&&(c.getClientX().overrideConfig(l,d),c.updateContext())},void 0)},a.overrideLayer=function(l,d){this.capture(function(){var f;((f=c.getAllOverrides().layers)===null||f===void 0?void 0:f[l])!==d&&(c.getClientX().overrideLayer(l,d),c.updateContext())},void 0)},a.removeGateOverride=function(l){this.capture(function(){c.getClientX().removeGateOverride(l),c.updateContext()},void 0)},a.removeConfigOverride=function(l){this.capture(function(){c.getClientX().removeConfigOverride(l),c.updateContext()},void 0)},a.removeLayerOverride=function(l){this.capture(function(){c.getClientX().removeLayerOverride(l),c.updateContext()},void 0)},a.getAllOverrides=function(){return this.capture(function(){return c.getClientX().getAllOverrides()},{gates:{},configs:{},layers:{}})},a.getEvaluationDetails=function(){var l,d;return(d=(l=c.instance)===null||l===void 0?void 0:l.getEvaluationDetails())!==null&&d!==void 0?d:{reason:i.EvaluationReason.Uninitialized,time:0}},a.getStableID=function(){return this.capture(function(){return c.getClientX().getStableID()},"")},a.initializeCalled=function(){return c.instance!=null&&c.instance.initializeCalled()},a.setSDKPackageInfo=function(l){c.sdkPackageInfo=l},a.setReactNativeUUID=function(l){l!=null&&i.StatsigClient.setReactNativeUUID(l)},a.setAsyncStorage=function(l){l!=null&&(i.StatsigAsyncStorage.asyncStorage=l)},a.setAppState=function(l){l!=null&&(c.appState=l)},a.setNativeModules=function(l){l!=null&&(c.nativeModules=l)},a.setPlatform=function(l){l!=null&&(c.platform=l)},a.setRNDeviceInfo=function(l){l!=null&&(c.deviceInfo=l)},a.setExpoConstants=function(l){l!=null&&(c.expoConstants=l)},a.setExpoDevice=function(l){l!=null&&(c.expoDevice=l)},a.setReactContextUpdater=function(l){c.reactContextUpdater=l},a.setOnCacheLoadedCallback=function(l){c.onCacheLoadedCallback=l},a.getClientX=function(){if(!c.instance)throw new Error("Call and wait for initialize() to finish first.");return c.instance},a.capture=function(l,d){try{return l()}catch(f){if(c.canThrow())throw f;return d}},a.updateContext=function(){c.reactContextUpdater!=null&&c.reactContextUpdater()},a.canThrow=function(){var l;return typeof process>"u"||typeof t>"u"||((l=process==null?void 0:t)===null||l===void 0?void 0:l.REACT_APP_STATSIG_SDK_MODE)!=="silent"};var c;return a.reactContextUpdater=null,a=c=e([(0,s.staticImplements)()],a),a}();return Tt.default=u,Tt}var ir={},ah;function Yn(){if(ah)return ir;ah=1;var t=ir&&ir.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ir,"__esModule",{value:!0});var e=t(jn());return ir.default=e.default.createContext({initialized:!1,statsigPromise:null,userVersion:0,initStarted:!1,updateUser:function(){}}),ir}var it={},uh;function FA(){if(uh)return it;uh=1;var t=it&&it.__createBinding||(Object.create?function(f,h,p,m){m===void 0&&(m=p),Object.defineProperty(f,m,{enumerable:!0,get:function(){return h[p]}})}:function(f,h,p,m){m===void 0&&(m=p),f[m]=h[p]}),e=it&&it.__setModuleDefault||(Object.create?function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}:function(f,h){f.default=h}),n=it&&it.__importStar||function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var p in f)p!=="default"&&Object.prototype.hasOwnProperty.call(f,p)&&t(h,f,p);return e(h,f),h},r=it&&it.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(it,"__esModule",{value:!0});var i=n(jn()),s=r(Yn()),o=r(is()),u=r(Qr()),a=Mv();function c(f){var h=(0,i.useRef)(null);return(0,i.useEffect)(function(){h.current=f},[f]),h.current}function l(f){var h=f.children,p=f.sdkKey,m=f.user,_=f.setUser,g=f.options,v=f.waitForCache,S=f.waitForInitialization,C=f.initializingComponent,R=f.mountKey,E=f.shutdownOnUnmount,x=E===void 0?!1:E,T=f._reactNativeDependencies,y=!!T,b=(0,i.useState)(!1),I=b[0],k=b[1],w=(0,i.useState)(!1),D=w[0],M=w[1],A=(0,i.useRef)(null),L=(0,i.useState)(0),P=L[0],$=L[1],N=(0,i.useRef)(new Promise(function(ye){A.current=ye})),j=(0,i.useMemo)(function(){return m},[JSON.stringify(m)]),q=c(R??null);(0,i.useEffect)(function(){if(u.default.initializeCalled()){N.current=new Promise(function(ze){A.current=ze});var ye=R===void 0||q!==R;ye&&(M(!1),k(!1)),u.default.updateUser(m).then(function(){A.current&&A.current(),$(function(ze){return ze+1}),ye&&(M(!0),k(!0))});return}u.default.setSDKPackageInfo({sdkType:"react-client",sdkVersion:a.version}),y&&(u.default.setSDKPackageInfo(T.SDKPackageInfo),u.default.setAppState(T.AppState),u.default.setAsyncStorage(T.AsyncStorage),u.default.setNativeModules(T.NativeModules),u.default.setPlatform(T.Platform),u.default.setRNDeviceInfo(T.RNDevice),u.default.setReactNativeUUID(T.ReactNativeUUID),u.default.setExpoConstants(T.Constants),u.default.setExpoDevice(T.ExpoDevice)),u.default.setOnCacheLoadedCallback(function(){k(!0)}),u.default.initialize(p,j,g).then(function(){M(!0),A.current&&A.current()}),typeof window<"u"&&(window.__STATSIG_SDK__=u.default,window.__STATSIG_JS_SDK__=o.default,window.__STATSIG_RERENDER_OVERRIDE__=function(){$(P+1)})},[j]),(0,i.useEffect)(function(){return u.default.setReactContextUpdater(function(){return $(function(ye){return ye+1})}),function(){x&&u.default.shutdown(),u.default.setReactContextUpdater(null)}},[]);var Q=d(v===!0,S===!0,D,I,h,C),ge=(0,i.useMemo)(function(){return{initialized:D,statsigPromise:N,userVersion:P,initStarted:u.default.initializeCalled(),updateUser:_??function(){}}},[D,N,P,u.default.initializeCalled(),_]);return i.default.createElement(s.default.Provider,{value:ge},Q)}it.default=l;function d(f,h,p,m,_,g){return p||h!==!0&&f!==!0||f&&m||h&&p?_:(h||f)&&g!=null?g:null}return it}var Gs={},Ze={},ch;function Sn(){if(ch)return Ze;ch=1;var t=Ze&&Ze.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.useLayerImpl=Ze.useExperimentImpl=Ze.useConfigImpl=Ze.useGateImpl=void 0;var e=jn(),n=is(),r=t(Yn()),i=t(Qr());function s(c,l,d){d===void 0&&(d=!1);var f=(0,e.useContext)(r.default),h=f.initialized,p=f.userVersion,m=f.initStarted,_=(0,e.useMemo)(function(){return m?d?i.default.checkGateWithExposureLoggingDisabled(c,l):i.default.checkGate(c,l?.ignoreOverrides):!1},[h,m,c,p,l,d]);return{isLoading:!h,value:_}}Ze.useGateImpl=s;function o(c,l,d){d===void 0&&(d=!1);var f=(0,e.useContext)(r.default),h=f.initialized,p=f.initStarted,m=f.userVersion,_=(0,e.useMemo)(function(){return p?d?i.default.getConfigWithExposureLoggingDisabled(c,l):i.default.getConfig(c,l?.ignoreOverrides):new n.DynamicConfig(c,{},"",{time:Date.now(),reason:n.EvaluationReason.Uninitialized})},[h,p,c,m,l,d]);return{isLoading:!h,config:_}}Ze.useConfigImpl=o;function u(c,l,d){d===void 0&&(d=!1);var f=(0,e.useContext)(r.default),h=f.initialized,p=f.initStarted,m=f.userVersion,_=(0,e.useMemo)(function(){return p?d?i.default.getExperimentWithExposureLoggingDisabled(c,l):i.default.getExperiment(c,l?.keepDeviceValue,l?.ignoreOverrides):new n.DynamicConfig(c,{},"",{time:Date.now(),reason:n.EvaluationReason.Uninitialized})},[h,p,c,m,l,d]);return{isLoading:!h,config:_}}Ze.useExperimentImpl=u;function a(c,l,d){d===void 0&&(d=!1);var f=(0,e.useContext)(r.default),h=f.initialized,p=f.initStarted,m=f.userVersion,_=(0,e.useMemo)(function(){return p?d?i.default.getLayerWithExposureLoggingDisabled(c,l):i.default.getLayer(c,l?.keepDeviceValue):n.Layer._create(c,{},"",{time:Date.now(),reason:n.EvaluationReason.Uninitialized})},[h,p,c,m,l,d]);return{isLoading:!h,layer:_}}return Ze.useLayerImpl=a,Ze}var lh;function BA(){if(lh)return Gs;lh=1,Object.defineProperty(Gs,"__esModule",{value:!0});var t=Sn();function e(n,r){return(0,t.useConfigImpl)(n,{ignoreOverrides:r})}return Gs.default=e,Gs}var qs={},dh;function HA(){if(dh)return qs;dh=1,Object.defineProperty(qs,"__esModule",{value:!0});var t=Sn();function e(n,r,i){return r===void 0&&(r=!1),(0,t.useExperimentImpl)(n,{keepDeviceValue:r,ignoreOverrides:i})}return qs.default=e,qs}var zs={},fh;function jA(){if(fh)return zs;fh=1,Object.defineProperty(zs,"__esModule",{value:!0});var t=Sn();function e(n,r){return(0,t.useGateImpl)(n,{ignoreOverrides:r})}return zs.default=e,zs}var Ws={},hh;function GA(){if(hh)return Ws;hh=1,Object.defineProperty(Ws,"__esModule",{value:!0});var t=Sn();function e(n,r){return r===void 0&&(r=!1),(0,t.useLayerImpl)(n,{keepDeviceValue:r})}return Ws.default=e,Ws}var sr={},ph;function qA(){if(ph)return sr;ph=1;var t=sr&&sr.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(sr,"__esModule",{value:!0});var e=jn(),n=t(Qr()),r=t(Yn());function i(s){var o=(0,e.useContext)(r.default).initStarted;(0,e.useEffect)(function(){!o||s.length==0||n.default.prefetchUsers(s).catch(function(){})},[o,s])}return sr.default=i,sr}var or={},gh;function zA(){if(gh)return or;gh=1;var t=or&&or.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(or,"__esModule",{value:!0});var e=jn(),n=t(Qr()),r=t(Yn());function i(s,o,u){var a=(0,e.useContext)(r.default).initStarted;(0,e.useEffect)(function(){a&&n.default.logEvent(s,o,u)},[a])}return or.default=i,or}var st={},mh;function WA(){if(mh)return st;mh=1;var t=st&&st.__createBinding||(Object.create?function(c,l,d,f){f===void 0&&(f=d),Object.defineProperty(c,f,{enumerable:!0,get:function(){return l[d]}})}:function(c,l,d,f){f===void 0&&(f=d),c[f]=l[d]}),e=st&&st.__setModuleDefault||(Object.create?function(c,l){Object.defineProperty(c,"default",{enumerable:!0,value:l})}:function(c,l){c.default=l}),n=st&&st.__importStar||function(c){if(c&&c.__esModule)return c;var l={};if(c!=null)for(var d in c)d!=="default"&&Object.prototype.hasOwnProperty.call(c,d)&&t(l,c,d);return e(l,c),l},r=st&&st.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(st,"__esModule",{value:!0});var i=n(jn()),s=r(Yn()),o=r(is()),u=r(Qr());function a(c){var l=c.children,d=c.sdkKey,f=c.user,h=c.options,p=c.initializeValues,m=c.setUser,_=c.shutdownOnUnmount,g=(0,i.useState)(0),v=g[0],S=g[1],C=(0,i.useState)(!0),R=C[0],E=C[1],x=(0,i.useRef)(!0),T=(0,i.useMemo)(function(){return f},[JSON.stringify(f)]);(0,i.useMemo)(function(){return u.default.bootstrap(d,p,T,h),p},[JSON.stringify(p)]),(0,i.useEffect)(function(){if(x.current){x.current=!1,typeof window<"u"&&(window.__STATSIG_SDK__=u.default,window.__STATSIG_JS_SDK__=o.default,window.__STATSIG_RERENDER_OVERRIDE__=function(){S(v+1)});return}E(!1),u.default.updateUser(f).then(function(){S(v+1),E(!0)})},[T]),(0,i.useEffect)(function(){return u.default.setReactContextUpdater(function(){return S(function(b){return b+1})}),function(){_&&u.default.shutdown(),u.default.setReactContextUpdater(null)}},[]);var y=(0,i.useMemo)(function(){return{initialized:R,statsigPromise:null,userVersion:v,initStarted:u.default.initializeCalled(),updateUser:m??function(){}}},[R,v,u.default.initializeCalled(),m]);return i.default.createElement(s.default.Provider,{value:y},l)}return st.default=a,st}var Vs={},_h;function VA(){if(_h)return Vs;_h=1,Object.defineProperty(Vs,"__esModule",{value:!0});var t=Sn();function e(n,r){return(0,t.useConfigImpl)(n,r,!0)}return Vs.default=e,Vs}var Ks={},vh;function KA(){if(vh)return Ks;vh=1,Object.defineProperty(Ks,"__esModule",{value:!0});var t=Sn();function e(n,r){return(0,t.useGateImpl)(n,r,!0)}return Ks.default=e,Ks}var Ys={},yh;function YA(){if(yh)return Ys;yh=1,Object.defineProperty(Ys,"__esModule",{value:!0});var t=Sn();function e(n,r){return(0,t.useExperimentImpl)(n,r,!0)}return Ys.default=e,Ys}var Xs={},Sh;function XA(){if(Sh)return Xs;Sh=1,Object.defineProperty(Xs,"__esModule",{value:!0});var t=Sn();function e(n,r){return(0,t.useLayerImpl)(n,r,!0)}return Xs.default=e,Xs}var ar={},bh;function JA(){if(bh)return ar;bh=1;var t=ar&&ar.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ar,"__esModule",{value:!0});var e=jn(),n=t(Yn());function r(){var i=(0,e.useContext)(n.default);return i.updateUser}return ar.default=r,ar}var Eh;function DM(){return Eh||(Eh=1,function(t){var e=si&&si.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSynchronousProvider=t.Layer=t.staticImplements=t.DynamicConfig=t.useUpdateUser=t.useStatsigLogEffect=t.useGateWithExposureLoggingDisabled=t.useGate=t.usePrefetchUsers=t.useLayerWithExposureLoggingDisabled=t.useLayer=t.useExperimentWithExposureLoggingDisabled=t.useExperiment=t.useConfigWithExposureLoggingDisabled=t.useConfig=t.StatsigProvider=t.StatsigContext=t.Statsig=void 0;var n=is();Object.defineProperty(t,"DynamicConfig",{enumerable:!0,get:function(){return n.DynamicConfig}}),Object.defineProperty(t,"Layer",{enumerable:!0,get:function(){return n.Layer}});var r=e(Qr());t.Statsig=r.default;var i=e(Yn());t.StatsigContext=i.default;var s=e(FA());t.StatsigProvider=s.default;var o=Dv();Object.defineProperty(t,"staticImplements",{enumerable:!0,get:function(){return o.staticImplements}});var u=e(BA());t.useConfig=u.default;var a=e(HA());t.useExperiment=a.default;var c=e(jA());t.useGate=c.default;var l=e(GA());t.useLayer=l.default;var d=e(qA());t.usePrefetchUsers=d.default;var f=e(zA());t.useStatsigLogEffect=f.default;var h=e(WA());t.StatsigSynchronousProvider=h.default;var p=e(VA());t.useConfigWithExposureLoggingDisabled=p.default;var m=e(KA());t.useGateWithExposureLoggingDisabled=m.default;var _=e(YA());t.useExperimentWithExposureLoggingDisabled=_.default;var g=e(XA());t.useLayerWithExposureLoggingDisabled=g.default;var v=e(JA());t.useUpdateUser=v.default}(si)),si}var Lv=-1,dl=function(t){addEventListener("pageshow",function(e){e.persisted&&(Lv=e.timeStamp,t(e))},!0)},Nv=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},fl=function(){var t=Nv();return t&&t.activationStart||0},Fo=function(t,e){var n=Nv(),r="navigate";return Lv>=0?r="back-forward-cache":n&&(document.prerendering||fl()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:-1,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Pv=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver(function(i){Promise.resolve().then(function(){e(i.getEntries())})});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},Bo=function(t,e,n,r){var i,s;return function(o){e.value>=0&&(o||r)&&((s=e.value-(i||0))||i===void 0)&&(i=e.value,e.delta=s,e.rating=function(u,a){return u>a[1]?"poor":u>a[0]?"needs-improvement":"good"}(e.value,n),t(e))}},$v=function(t){requestAnimationFrame(function(){return requestAnimationFrame(function(){return t()})})},Uv=function(t){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&t()})},Fv=function(t){var e=!1;return function(){e||(t(),e=!0)}},_r=-1,Th=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Ho=function(t){document.visibilityState==="hidden"&&_r>-1&&(_r=t.type==="visibilitychange"?t.timeStamp:0,QA())},Ih=function(){addEventListener("visibilitychange",Ho,!0),addEventListener("prerenderingchange",Ho,!0)},QA=function(){removeEventListener("visibilitychange",Ho,!0),removeEventListener("prerenderingchange",Ho,!0)},Bv=function(){return _r<0&&(_r=Th(),Ih(),dl(function(){setTimeout(function(){_r=Th(),Ih()},0)})),{get firstHiddenTime(){return _r}}},Hv=function(t){document.prerendering?addEventListener("prerenderingchange",function(){return t()},!0):t()},wh=[1800,3e3],MM=function(t,e){e=e||{},Hv(function(){var n,r=Bv(),i=Fo("FCP"),s=Pv("paint",function(o){o.forEach(function(u){u.name==="first-contentful-paint"&&(s.disconnect(),u.startTime<r.firstHiddenTime&&(i.value=Math.max(u.startTime-fl(),0),i.entries.push(u),n(!0)))})});s&&(n=Bo(t,i,wh,e.reportAllChanges),dl(function(o){i=Fo("FCP"),n=Bo(t,i,wh,e.reportAllChanges),$v(function(){i.value=performance.now()-o.timeStamp,n(!0)})}))})},ZA=function(t){var e=self.requestIdleCallback||self.setTimeout,n=-1;return t=Fv(t),document.visibilityState==="hidden"?t():(n=e(t),Uv(t)),n},Ch=[2500,4e3],Va={},LM=function(t,e){e=e||{},Hv(function(){var n,r=Bv(),i=Fo("LCP"),s=function(a){e.reportAllChanges||(a=a.slice(-1)),a.forEach(function(c){c.startTime<r.firstHiddenTime&&(i.value=Math.max(c.startTime-fl(),0),i.entries=[c],n())})},o=Pv("largest-contentful-paint",s);if(o){n=Bo(t,i,Ch,e.reportAllChanges);var u=Fv(function(){Va[i.id]||(s(o.takeRecords()),o.disconnect(),Va[i.id]=!0,n(!0))});["keydown","click"].forEach(function(a){addEventListener(a,function(){return ZA(u)},!0)}),Uv(u),dl(function(a){i=Fo("LCP"),n=Bo(t,i,Ch,e.reportAllChanges),$v(function(){i.value=performance.now()-a.timeStamp,Va[i.id]=!0,n(!0)})})}})},Le=function(){return Le=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Le.apply(this,arguments)};function eD(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Pe(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function u(l){try{c(r.next(l))}catch(d){o(d)}}function a(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(u,a)}c((r=r.apply(t,[])).next())})}function $e(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(l){return a([c,l])}}function a(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(l){c=[6,l],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Pr(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ot(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function Ht(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var We;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(We||(We={}));var Rn;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE="$revenue"})(Rn||(Rn={}));var $r;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})($r||($r={}));var ft;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(ft||(ft={}));var Vt;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(Vt||(Vt={}));var jo;(function(t){t.US="US",t.EU="EU"})(jo||(jo={}));var xe;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(xe||(xe={}));var Go;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(Go||(Go={}));var kh="-",hl="AMP",tD="".concat(hl,"_unsent"),jv="https://api2.amplitude.com/2/httpapi",nD="https://api.eu.amplitude.com/2/httpapi",rD="https://api2.amplitude.com/batch",iD="https://api.eu.amplitude.com/batch",sD=1e3,ju=function(t){if(Object.keys(t).length>sD)return!1;for(var e in t){var n=t[e];if(!Gv(e,n))return!1}return!0},Gv=function(t,e){var n,r;if(typeof t!="string")return!1;if(Array.isArray(e)){var i=!0;try{for(var s=Pr(e),o=s.next();!o.done;o=s.next()){var u=o.value;if(Array.isArray(u))return!1;if(typeof u=="object")i=i&&ju(u);else if(!["number","string"].includes(typeof u))return!1;if(!i)return!1}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}else{if(e==null)return!1;if(typeof e=="object")return ju(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0},qo=function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return Le({},this._properties)},t.prototype.set=function(e,n){return this._safeSet(We.SET,e,n),this},t.prototype.setOnce=function(e,n){return this._safeSet(We.SET_ONCE,e,n),this},t.prototype.append=function(e,n){return this._safeSet(We.APPEND,e,n),this},t.prototype.prepend=function(e,n){return this._safeSet(We.PREPEND,e,n),this},t.prototype.postInsert=function(e,n){return this._safeSet(We.POSTINSERT,e,n),this},t.prototype.preInsert=function(e,n){return this._safeSet(We.PREINSERT,e,n),this},t.prototype.remove=function(e,n){return this._safeSet(We.REMOVE,e,n),this},t.prototype.add=function(e,n){return this._safeSet(We.ADD,e,n),this},t.prototype.unset=function(e){return this._safeSet(We.UNSET,e,kh),this},t.prototype.clearAll=function(){return this._properties={},this._properties[We.CLEAR_ALL]=kh,this},t.prototype._safeSet=function(e,n,r){if(this._validate(e,n,r)){var i=this._properties[e];return i===void 0&&(i={},this._properties[e]=i),i[n]=r,this._propertySet.add(n),!0}return!1},t.prototype._validate=function(e,n,r){return this._properties[We.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:e===We.ADD?typeof r=="number":e!==We.UNSET&&e!==We.REMOVE?Gv(n,r):!0},t}(),oD=function(t,e,n){var r=typeof t=="string"?{event_type:t}:t;return Le(Le(Le({},r),n),e&&{event_properties:e})},qv=function(t,e){var n=Le(Le({},e),{event_type:$r.IDENTIFY,user_properties:t.getUserProperties()});return n},aD=function(t,e,n,r){var i,s=Le(Le({},r),{event_type:$r.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[t]=e,i)});return s},uD=function(t,e,n){var r,i=new qo;i.set(t,e);var s=Le(Le({},n),{event_type:$r.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[t]=e,r)});return s},cD=function(t,e){return Le(Le({},e),{event_type:$r.REVENUE,event_properties:t.getEventProperties()})},Ii=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=xe.Unknown),{event:t,code:e,message:n}},lD=function(){function t(){this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(e,n){return Pe(this,void 0,void 0,function(){return $e(this,function(r){switch(r.label){case 0:return[4,e.setup(n)];case 1:return r.sent(),this.plugins.push(e),[2]}})})},t.prototype.deregister=function(e){return this.plugins.splice(this.plugins.findIndex(function(n){return n.name===e}),1),Promise.resolve()},t.prototype.reset=function(){this.applying=!1,this.plugins=[]},t.prototype.push=function(e){var n=this;return new Promise(function(r){n.queue.push([e,r]),n.scheduleApply(0)})},t.prototype.scheduleApply=function(e){var n=this;this.applying||(this.applying=!0,setTimeout(function(){n.apply(n.queue.shift()).then(function(){n.applying=!1,n.queue.length>0&&n.scheduleApply(0)})},e))},t.prototype.apply=function(e){return Pe(this,void 0,void 0,function(){var n,r,i,s,o,u,a,h,c,l,d,f,h,p,m,_,g,v,S,C;return $e(this,function(R){switch(R.label){case 0:if(!e)return[2];n=ot(e,1),r=n[0],i=ot(e,2),s=i[1],o=this.plugins.filter(function(E){return E.type===Vt.BEFORE}),R.label=1;case 1:R.trys.push([1,6,7,8]),u=Pr(o),a=u.next(),R.label=2;case 2:return a.done?[3,5]:(h=a.value,[4,h.execute(Le({},r))]);case 3:r=R.sent(),R.label=4;case 4:return a=u.next(),[3,2];case 5:return[3,8];case 6:return c=R.sent(),g={error:c},[3,8];case 7:try{a&&!a.done&&(v=u.return)&&v.call(u)}finally{if(g)throw g.error}return[7];case 8:l=this.plugins.filter(function(E){return E.type===Vt.ENRICHMENT}),R.label=9;case 9:R.trys.push([9,14,15,16]),d=Pr(l),f=d.next(),R.label=10;case 10:return f.done?[3,13]:(h=f.value,[4,h.execute(Le({},r))]);case 11:r=R.sent(),R.label=12;case 12:return f=d.next(),[3,10];case 13:return[3,16];case 14:return p=R.sent(),S={error:p},[3,16];case 15:try{f&&!f.done&&(C=d.return)&&C.call(d)}finally{if(S)throw S.error}return[7];case 16:return m=this.plugins.filter(function(E){return E.type===Vt.DESTINATION}),_=m.map(function(E){var x=Le({},r);return E.execute(x).catch(function(T){return Ii(x,0,String(T))})}),Promise.all(_).then(function(E){var x=ot(E,1),T=x[0];s(T)}),[2]}})})},t.prototype.flush=function(){return Pe(this,void 0,void 0,function(){var e,n,r,i=this;return $e(this,function(s){switch(s.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(o){return i.apply(o)}))];case 1:return s.sent(),n=this.plugins.filter(function(o){return o.type===Vt.DESTINATION}),r=n.map(function(o){return o.flush&&o.flush()}),[4,Promise.all(r)];case 2:return s.sent(),[2]}})})},t}(),dD="Event tracked successfully",fD="Unexpected error occurred",hD="Event rejected due to exceeded retry count",pD="Event skipped due to optOut config",gD="Event rejected due to missing API key",mD="Invalid API key",_D="Client not initialized",vD=function(){function t(e){e===void 0&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new lD,this.name=e}return t.prototype._init=function(e){return Pe(this,void 0,void 0,function(){return $e(this,function(n){switch(n.label){case 0:return this.config=e,this.timeline.reset(),[4,this.runQueuedFunctions("q")];case 1:return n.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(e){return Pe(this,void 0,void 0,function(){var n,r,i,s,o,u,a;return $e(this,function(c){switch(c.label){case 0:n=this[e],this[e]=[],c.label=1;case 1:c.trys.push([1,6,7,8]),r=Pr(n),i=r.next(),c.label=2;case 2:return i.done?[3,5]:(s=i.value,[4,s()]);case 3:c.sent(),c.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return o=c.sent(),u={error:o},[3,8];case 7:try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(u)throw u.error}return[7];case 8:return[2]}})})},t.prototype.track=function(e,n,r){var i=oD(e,n,r);return this.dispatch(i)},t.prototype.identify=function(e,n){var r=qv(e,n);return this.dispatch(r)},t.prototype.groupIdentify=function(e,n,r,i){var s=aD(e,n,r,i);return this.dispatch(s)},t.prototype.setGroup=function(e,n,r){var i=uD(e,n,r);return this.dispatch(i)},t.prototype.revenue=function(e,n){var r=cD(e,n);return this.dispatch(r)},t.prototype.add=function(e){return Pe(this,void 0,void 0,function(){return $e(this,function(n){return this.config?[2,this.timeline.register(e,this.config)]:(this.q.push(this.add.bind(this,e)),[2])})})},t.prototype.remove=function(e){return Pe(this,void 0,void 0,function(){return $e(this,function(n){return this.config?[2,this.timeline.deregister(e)]:(this.q.push(this.remove.bind(this,e)),[2])})})},t.prototype.dispatchWithCallback=function(e,n){if(!this.config)return n(Ii(e,0,_D));this.process(e).then(n)},t.prototype.dispatch=function(e){return Pe(this,void 0,void 0,function(){var n=this;return $e(this,function(r){return this.config?[2,this.process(e)]:[2,new Promise(function(i){n.dispatchQ.push(n.dispatchWithCallback.bind(n,e,i))})]})})},t.prototype.process=function(e){return Pe(this,void 0,void 0,function(){var i,n,r,i;return $e(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),this.config.optOut?[2,Ii(e,0,pD)]:[4,this.timeline.push(e)];case 1:return i=s.sent(),i.code===200?this.config.loggerProvider.log(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return n=s.sent(),r=String(n),this.config.loggerProvider.error(r),i=Ii(e,0,r),[2,i];case 3:return[2]}})})},t.prototype.setOptOut=function(e){if(!this.config){this.q.push(this.setOptOut.bind(this,!!e));return}this.config.optOut=!!e},t.prototype.flush=function(){return this.timeline.flush()},t}(),yD=function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(e){return this.productId=e,this},t.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},t.prototype.setPrice=function(e){return this.price=e,this},t.prototype.setRevenueType=function(e){return this.revenueType=e,this},t.prototype.setRevenue=function(e){return this.revenue=e,this},t.prototype.setEventProperties=function(e){return ju(e)&&(this.properties=e),this},t.prototype.getEventProperties=function(){var e=this.properties?Le({},this.properties):{};return e[Rn.REVENUE_PRODUCT_ID]=this.productId,e[Rn.REVENUE_QUANTITY]=this.quantity,e[Rn.REVENUE_PRICE]=this.price,e[Rn.REVENUE_TYPE]=this.revenueType,e[Rn.REVENUE]=this.revenue,e},t}(),SD=function(t,e){var n=Math.max(e,1);return t.reduce(function(r,i,s){var o=Math.floor(s/n);return r[o]||(r[o]=[]),r[o].push(i),r},[])},Js="Amplitude Logger ",bD=function(){function t(){this.logLevel=ft.None}return t.prototype.disable=function(){this.logLevel=ft.None},t.prototype.enable=function(e){e===void 0&&(e=ft.Warn),this.logLevel=e},t.prototype.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<ft.Verbose||console.log("".concat(Js,"[Log]: ").concat(e.join(" ")))},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<ft.Warn||console.warn("".concat(Js,"[Warn]: ").concat(e.join(" ")))},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<ft.Error||console.error("".concat(Js,"[Error]: ").concat(e.join(" ")))},t.prototype.debug=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<ft.Debug||console.log("".concat(Js,"[Debug]: ").concat(e.join(" ")))},t}(),oo=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:ft.Warn,loggerProvider:new bD,optOut:!1,serverUrl:jv,serverZone:jo.US,useBatch:!1}},ED=function(){function t(e){var n,r,i;this._optOut=!1;var s=oo();this.apiKey=e.apiKey,this.flushIntervalMillis=e.flushIntervalMillis||s.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||s.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||s.flushQueueSize,this.loggerProvider=e.loggerProvider||s.loggerProvider,this.logLevel=(n=e.logLevel)!==null&&n!==void 0?n:s.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=(r=e.optOut)!==null&&r!==void 0?r:s.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||s.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=(i=e.useBatch)!==null&&i!==void 0?i:s.useBatch,this.loggerProvider.enable(this.logLevel);var o=zv(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),t}(),TD=function(t,e){return t===jo.EU?e?iD:nD:e?rD:jv},zv=function(t,e,n){if(t===void 0&&(t=""),e===void 0&&(e=oo().serverZone),n===void 0&&(n=oo().useBatch),t)return{serverUrl:t,serverZone:void 0};var r=["US","EU"].includes(e)?e:oo().serverZone;return{serverZone:r,serverUrl:TD(r,n)}},ID=function(){function t(){this.name="amplitude",this.type=Vt.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(e){var n;return Pe(this,void 0,void 0,function(){var r,i=this;return $e(this,function(s){switch(s.label){case 0:return this.config=e,this.storageKey="".concat(tD,"_").concat(this.config.apiKey.substring(0,10)),[4,(n=this.config.storageProvider)===null||n===void 0?void 0:n.get(this.storageKey)];case 1:return r=s.sent(),this.saveEvents(),r&&r.length>0&&Promise.all(r.map(function(o){return i.execute(o)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(e){var n=this;return new Promise(function(r){var i={event:e,attempts:0,callback:function(s){return r(s)},timeout:0};n.addToQueue(i)})},t.prototype.addToQueue=function(){for(var e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.filter(function(s){return s.attempts<e.config.flushMaxRetries?(s.attempts+=1,!0):(e.fulfillRequest([s],500,hD),!1)});i.forEach(function(s){if(e.queue=e.queue.concat(s),s.timeout===0){e.schedule(e.config.flushIntervalMillis);return}setTimeout(function(){s.timeout=0,e.schedule(0)},s.timeout)}),this.saveEvents()},t.prototype.schedule=function(e){var n=this;this.scheduled||(this.scheduled=setTimeout(function(){n.flush(!0).then(function(){n.queue.length>0&&n.schedule(e)})},e))},t.prototype.flush=function(e){return e===void 0&&(e=!1),Pe(this,void 0,void 0,function(){var n,r,i,s=this;return $e(this,function(o){switch(o.label){case 0:return n=[],r=[],this.queue.forEach(function(u){return u.timeout===0?n.push(u):r.push(u)}),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),i=SD(n,this.config.flushQueueSize),[4,Promise.all(i.map(function(u){return s.send(u,e)}))];case 1:return o.sent(),[2]}})})},t.prototype.send=function(e,n){return n===void 0&&(n=!0),Pe(this,void 0,void 0,function(){var r,i,s,o,u;return $e(this,function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,gD)];r={api_key:this.config.apiKey,events:e.map(function(c){var l=c.event;l.extra;var d=eD(l,["extra"]);return d}),options:{min_id_length:this.config.minIdLength}},a.label=1;case 1:return a.trys.push([1,3,,4]),i=zv(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,r)];case 2:if(s=a.sent(),s===null)return this.fulfillRequest(e,0,fD),[2];if(!n){if("body"in s){o="";try{o=JSON.stringify(s.body,null,2)}catch{}this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(o))}else this.fulfillRequest(e,s.statusCode,s.status);return[2]}return this.handleReponse(s,e),[3,4];case 3:return u=a.sent(),this.fulfillRequest(e,0,String(u)),[3,4];case 4:return[2]}})})},t.prototype.handleReponse=function(e,n){var r=e.status;switch(r){case xe.Success:this.handleSuccessResponse(e,n);break;case xe.Invalid:this.handleInvalidResponse(e,n);break;case xe.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,n);break;case xe.RateLimit:this.handleRateLimitResponse(e,n);break;default:this.handleOtherReponse(n)}},t.prototype.handleSuccessResponse=function(e,n){this.fulfillRequest(n,e.statusCode,dD)},t.prototype.handleInvalidResponse=function(e,n){var r=this;if(e.body.missingField||e.body.error.startsWith(mD)){this.fulfillRequest(n,e.statusCode,e.body.error);return}var i=Ht(Ht(Ht(Ht([],ot(Object.values(e.body.eventsWithInvalidFields)),!1),ot(Object.values(e.body.eventsWithMissingFields)),!1),ot(Object.values(e.body.eventsWithInvalidIdLengths)),!1),ot(e.body.silencedEvents),!1).flat(),s=new Set(i),o=n.filter(function(u,a){if(s.has(a)){r.fulfillRequest([u],e.statusCode,e.body.error);return}return!0});this.addToQueue.apply(this,Ht([],ot(o),!1))},t.prototype.handlePayloadTooLargeResponse=function(e,n){if(n.length===1){this.fulfillRequest(n,e.statusCode,e.body.error);return}this.config.flushQueueSize/=2,this.addToQueue.apply(this,Ht([],ot(n),!1))},t.prototype.handleRateLimitResponse=function(e,n){var r=this,i=Object.keys(e.body.exceededDailyQuotaUsers),s=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,u=new Set(i),a=new Set(s),c=new Set(o),l=n.filter(function(d,f){if(d.event.user_id&&u.has(d.event.user_id)||d.event.device_id&&a.has(d.event.device_id)){r.fulfillRequest([d],e.statusCode,e.body.error);return}return c.has(f)&&(d.timeout=r.throttleTimeout),!0});this.addToQueue.apply(this,Ht([],ot(l),!1))},t.prototype.handleOtherReponse=function(e){var n=this;this.addToQueue.apply(this,Ht([],ot(e.map(function(r){return r.timeout=r.attempts*n.retryTimeout,r})),!1))},t.prototype.fulfillRequest=function(e,n,r){this.saveEvents(),e.forEach(function(i){return i.callback(Ii(i.event,n,r))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map(function(n){return n.event}));this.config.storageProvider.set(this.storageKey,e)}},t}(),It=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return{promise:t.apply(void 0,Ht([],ot(e),!1))}}},wD=function(t){var e=new Error().stack||"";return e.split(` `).slice(2+t).map(function(n){return n.trim()})},Ce=function(t){return function(){var e=Le({},t.config),n=e.loggerProvider,r=e.logLevel;return{logger:n,logLevel:r}}},CD=function(t,e){var n,r;e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,"");try{for(var i=Pr(e.split(".")),s=i.next();!s.done;s=i.next()){var o=s.value;if(o in t)t=t[o];else return}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},ke=function(t,e){return function(){var n,r,i={};try{for(var s=Pr(e),o=s.next();!o.done;o=s.next()){var u=o.value;i[u]=CD(t,u)}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i}},Re=function(t,e,n,r,i){return i===void 0&&(i=null),function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var u=n(),a=u.logger,c=u.logLevel;if(c&&c<ft.Debug||!c||!a)return t.apply(i,s);var l={type:"invoke public method",name:e,args:s,stacktrace:wD(1),time:{start:new Date().toISOString()},states:{}};r&&l.states&&(l.states.before=r());var d=t.apply(i,s);return d&&d.promise?d.promise.then(function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),a.debug(JSON.stringify(l,null,2))}):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),a.debug(JSON.stringify(l,null,2))),d}},ya=function(t){return t?(t^Math.random()*16>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,ya)},Wv=function(){function t(){this.memoryStorage=new Map}return t.prototype.isEnabled=function(){return Pe(this,void 0,void 0,function(){return $e(this,function(e){return[2,!0]})})},t.prototype.get=function(e){return Pe(this,void 0,void 0,function(){return $e(this,function(n){return[2,this.memoryStorage.get(e)]})})},t.prototype.getRaw=function(e){return Pe(this,void 0,void 0,function(){var n;return $e(this,function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return n=r.sent(),[2,n?JSON.stringify(n):void 0]}})})},t.prototype.set=function(e,n){return Pe(this,void 0,void 0,function(){return $e(this,function(r){return this.memoryStorage.set(e,n),[2]})})},t.prototype.remove=function(e){return Pe(this,void 0,void 0,function(){return $e(this,function(n){return this.memoryStorage.delete(e),[2]})})},t.prototype.reset=function(){return Pe(this,void 0,void 0,function(){return $e(this,function(e){return this.memoryStorage.clear(),[2]})})},t}(),pl=function(){function t(){}return t.prototype.send=function(e,n){return Promise.resolve(null)},t.prototype.buildResponse=function(e){var n,r,i,s,o,u,a,c,l,d,f,h,p,m,_,g,v,S,C,R,E,x;if(typeof e!="object")return null;var T=e.code||0,y=this.buildStatus(T);switch(y){case xe.Success:return{status:y,statusCode:T,body:{eventsIngested:(n=e.events_ingested)!==null&&n!==void 0?n:0,payloadSizeBytes:(r=e.payload_size_bytes)!==null&&r!==void 0?r:0,serverUploadTime:(i=e.server_upload_time)!==null&&i!==void 0?i:0}};case xe.Invalid:return{status:y,statusCode:T,body:{error:(s=e.error)!==null&&s!==void 0?s:"",missingField:(o=e.missing_field)!==null&&o!==void 0?o:"",eventsWithInvalidFields:(u=e.events_with_invalid_fields)!==null&&u!==void 0?u:{},eventsWithMissingFields:(a=e.events_with_missing_fields)!==null&&a!==void 0?a:{},eventsWithInvalidIdLengths:(c=e.events_with_invalid_id_lengths)!==null&&c!==void 0?c:{},epsThreshold:(l=e.eps_threshold)!==null&&l!==void 0?l:0,exceededDailyQuotaDevices:(d=e.exceeded_daily_quota_devices)!==null&&d!==void 0?d:{},silencedDevices:(f=e.silenced_devices)!==null&&f!==void 0?f:[],silencedEvents:(h=e.silenced_events)!==null&&h!==void 0?h:[],throttledDevices:(p=e.throttled_devices)!==null&&p!==void 0?p:{},throttledEvents:(m=e.throttled_events)!==null&&m!==void 0?m:[]}};case xe.PayloadTooLarge:return{status:y,statusCode:T,body:{error:(_=e.error)!==null&&_!==void 0?_:""}};case xe.RateLimit:return{status:y,statusCode:T,body:{error:(g=e.error)!==null&&g!==void 0?g:"",epsThreshold:(v=e.eps_threshold)!==null&&v!==void 0?v:0,throttledDevices:(S=e.throttled_devices)!==null&&S!==void 0?S:{},throttledUsers:(C=e.throttled_users)!==null&&C!==void 0?C:{},exceededDailyQuotaDevices:(R=e.exceeded_daily_quota_devices)!==null&&R!==void 0?R:{},exceededDailyQuotaUsers:(E=e.exceeded_daily_quota_users)!==null&&E!==void 0?E:{},throttledEvents:(x=e.throttled_events)!==null&&x!==void 0?x:[]}};case xe.Timeout:default:return{status:y,statusCode:T}}},t.prototype.buildStatus=function(e){return e>=200&&e<300?xe.Success:e===429?xe.RateLimit:e===413?xe.PayloadTooLarge:e===408?xe.Timeout:e>=400&&e<500?xe.Invalid:e>=500?xe.Failed:xe.Unknown},t}(),Gu=function(t,e){return Gu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Gu(t,e)};function Sa(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Gu(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var de=function(){return de=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},de.apply(this,arguments)};function je(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function u(l){try{c(r.next(l))}catch(d){o(d)}}function a(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(u,a)}c((r=r.apply(t,[])).next())})}function Ge(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(l){return a([c,l])}}function a(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(l){c=[6,l],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function kD(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function RD(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}var qu=function(t,e){return qu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},qu(t,e)};function xD(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");qu(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var mt=function(){return mt=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},mt.apply(this,arguments)};function Rh(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function at(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function u(l){try{c(r.next(l))}catch(d){o(d)}}function a(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(u,a)}c((r=r.apply(t,[])).next())})}function ut(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(c){return function(l){return a([c,l])}}function a(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(l){c=[6,l],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function OD(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}var xt=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},zu=function(){var t,e=xt();if(!(!((t=e?.location)===null||t===void 0)&&t.search))return{};var n=e.location.search.substring(1).split("&").filter(Boolean),r=n.reduce(function(i,s){var o=s.split("=",2),u=xh(o[0]),a=xh(o[1]);return a&&(i[u]=a),i},{});return r},xh=function(t){t===void 0&&(t="");try{return decodeURIComponent(t)}catch{return""}},AD="utm_campaign",DD="utm_content",MD="utm_id",LD="utm_medium",ND="utm_source",PD="utm_term",Oh="dclid",Ah="fbclid",Dh="gbraid",Mh="gclid",Lh="ko_click_id",Nh="msclkid",Ph="ttclid",$h="twclid",Uh="wbraid",$D="EMPTY",Vv={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,msclkid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},UD="MKTG",FD=function(){function t(){}return t.prototype.parse=function(){return at(this,void 0,void 0,function(){return ut(this,function(e){return[2,mt(mt(mt(mt({},Vv),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},t.prototype.getUtmParam=function(){var e=zu(),n=e[AD],r=e[DD],i=e[MD],s=e[LD],o=e[ND],u=e[PD];return{utm_campaign:n,utm_content:r,utm_id:i,utm_medium:s,utm_source:o,utm_term:u}},t.prototype.getReferrer=function(){var e,n,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=(n=(e=r.referrer)===null||e===void 0?void 0:e.split("/")[2])!==null&&n!==void 0?n:void 0}catch{}return r},t.prototype.getClickIds=function(){var e,n=zu();return e={},e[Oh]=n[Oh],e[Ah]=n[Ah],e[Dh]=n[Dh],e[Mh]=n[Mh],e[Lh]=n[Lh],e[Nh]=n[Nh],e[Ph]=n[Ph],e[$h]=n[$h],e[Uh]=n[Uh],e},t}(),gl=function(t,e,n){return e===void 0&&(e=""),n===void 0&&(n=10),[hl,e,t.substring(0,n)].filter(Boolean).join("_")},BD=function(t){return"".concat(hl.toLowerCase(),"_").concat(t.substring(0,6))},HD=function(){function t(e,n){var r,i;this.storage=n.storage,this.storageKey=gl(e,UD),this.parser=new FD,this.track=n.track,this.onNewCampaign=n.onNewCampaign,this.disabled=!!n.disabled,this.trackNewCampaigns=!!n.trackNewCampaigns,this.trackPageViews=!!n.trackPageViews,this.excludeReferrers=(r=n.excludeReferrers)!==null&&r!==void 0?r:[],typeof location<"u"&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=(i=n.initialEmptyValue)!==null&&i!==void 0?i:$D}return t.prototype.isNewCampaign=function(e,n,r){r===void 0&&(r=!1),e.referrer;var i=e.referring_domain,s=Rh(e,["referrer","referring_domain"]),o=n||{};o.referrer;var u=o.referring_domain,a=Rh(o,["referrer","referring_domain"]);if(e.referring_domain&&this.excludeReferrers.includes(e.referring_domain))return!1;var c=JSON.stringify(s)!==JSON.stringify(a),l=r?Fh(i||"")!==Fh(u||""):i!==u;return!n||c||l},t.prototype.saveCampaignToStorage=function(e){return at(this,void 0,void 0,function(){return ut(this,function(n){switch(n.label){case 0:return[4,this.storage.set(this.storageKey,e)];case 1:return n.sent(),[2]}})})},t.prototype.getCampaignFromStorage=function(){return at(this,void 0,void 0,function(){return ut(this,function(e){switch(e.label){case 0:return[4,this.storage.get(this.storageKey)];case 1:return[2,e.sent()]}})})},t.prototype.createCampaignEvent=function(e){var n=this,r=mt(mt({},Vv),e),i=Object.entries(r).reduce(function(o,u){var a=OD(u,2),c=a[0],l=a[1];return o.setOnce("initial_".concat(c),l||n.initialEmptyValue),l?o.set(c,l):o.unset(c)},new qo),s={event_type:"Page View",event_properties:{page_title:typeof document<"u"&&document.title||"",page_location:typeof location<"u"&&location.href||"",page_path:typeof location<"u"&&location.pathname||""}};return mt(mt({},qv(i)),this.trackPageViews&&s)},t.prototype.send=function(e){return at(this,void 0,void 0,function(){var n,r;return ut(this,function(i){switch(i.label){case 0:return this.disabled?[2]:[4,this.parser.parse()];case 1:return n=i.sent(),[4,this.getCampaignFromStorage()];case 2:if(r=i.sent(),!e){if(!this.trackNewCampaigns||!this.isNewCampaign(n,r))return[2];this.onNewCampaign(n)}return[4,this.track(this.createCampaignEvent(n))];case 3:return i.sent(),[4,this.saveCampaignToStorage(n)];case 4:return i.sent(),[2]}})})},t}(),Fh=function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")},zo=function(){function t(e){this.options=mt({},e)}return t.prototype.isEnabled=function(){return at(this,void 0,void 0,function(){var e,n,r,i;return ut(this,function(s){switch(s.label){case 0:if(!xt())return[2,!1];e=String(Date.now()),n=new t(this.options),r="AMP_TEST",s.label=1;case 1:return s.trys.push([1,4,5,7]),[4,n.set(r,e)];case 2:return s.sent(),[4,n.get(r)];case 3:return i=s.sent(),[2,i===e];case 4:return s.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return s.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return at(this,void 0,void 0,function(){var n;return ut(this,function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:if(n=r.sent(),!n)return[2,void 0];try{try{n=decodeURIComponent(atob(n))}catch{}return[2,JSON.parse(n)]}catch{return[2,void 0]}return[2]}})})},t.prototype.getRaw=function(e){var n;return at(this,void 0,void 0,function(){var r,i,s;return ut(this,function(o){return r=xt(),i=(n=r?.document.cookie.split("; "))!==null&&n!==void 0?n:[],s=i.find(function(u){return u.indexOf(e+"=")===0}),s?[2,s.substring(e.length+1)]:[2,void 0]})})},t.prototype.set=function(e,n){var r;return at(this,void 0,void 0,function(){var i,s,o,u,a,c;return ut(this,function(l){try{i=(r=this.options.expirationDays)!==null&&r!==void 0?r:0,s=n!==null?i:-1,o=void 0,s&&(u=new Date,u.setTime(u.getTime()+s*24*60*60*1e3),o=u),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(n)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),c=xt(),c&&(c.document.cookie=a)}catch{}return[2]})})},t.prototype.remove=function(e){return at(this,void 0,void 0,function(){return ut(this,function(n){switch(n.label){case 0:return[4,this.set(e,null)];case 1:return n.sent(),[2]}})})},t.prototype.reset=function(){return at(this,void 0,void 0,function(){return ut(this,function(e){return[2]})})},t}(),jD=function(t){xD(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(n,r){return at(this,void 0,void 0,function(){var i,s,o;return ut(this,function(u){switch(u.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(r),method:"POST"},[4,fetch(n,i)];case 1:return s=u.sent(),[4,s.json()];case 2:return o=u.sent(),[2,this.buildResponse(o)]}})})},e}(pl),hi={exports:{}},GD=hi.exports,Bh;function qD(){return Bh||(Bh=1,function(t,e){(function(n,r){var i="0.7.31",s="",o="?",u="function",a="undefined",c="object",l="string",d="major",f="model",h="name",p="type",m="vendor",_="version",g="architecture",v="console",S="mobile",C="tablet",R="smarttv",E="wearable",x="embedded",T=275,y="Amazon",b="Apple",I="ASUS",k="BlackBerry",w="Browser",D="Chrome",M="Edge",A="Firefox",L="Google",P="Huawei",$="LG",N="Microsoft",j="Motorola",q="Opera",Q="Samsung",ge="Sony",ye="Xiaomi",ze="Zebra",Xn="Facebook",as=function(H,F){var Y={};for(var Se in H)F[Se]&&F[Se].length%2===0?Y[Se]=F[Se].concat(H[Se]):Y[Se]=H[Se];return Y},Lt=function(H){for(var F={},Y=0;Y<H.length;Y++)F[H[Y].toUpperCase()]=H[Y];return F},Zr=function(H,F){return typeof H===l?bn(F).indexOf(bn(H))!==-1:!1},bn=function(H){return H.toLowerCase()},ba=function(H){return typeof H===l?H.replace(/[^\d\.]/g,s).split(".")[0]:r},lt=function(H,F){if(typeof H===l)return H=H.replace(/^\s\s*/,s).replace(/\s\s*$/,s),typeof F===a?H:H.substring(0,T)},Qe=function(H,F){for(var Y=0,Se,re,cs,me,ei,vt;Y<F.length&&!ei;){var _l=F[Y],vl=F[Y+1];for(Se=re=0;Se<_l.length&&!ei;)if(ei=_l[Se++].exec(H),ei)for(cs=0;cs<vl.length;cs++)vt=ei[++re],me=vl[cs],typeof me===c&&me.length>0?me.length===2?typeof me[1]==u?this[me[0]]=me[1].call(this,vt):this[me[0]]=me[1]:me.length===3?typeof me[1]===u&&!(me[1].exec&&me[1].test)?this[me[0]]=vt?me[1].call(this,vt,me[2]):r:this[me[0]]=vt?vt.replace(me[1],me[2]):r:me.length===4&&(this[me[0]]=vt?me[3].call(this,vt.replace(me[1],me[2])):r):this[me]=vt||r;Y+=2}},En=function(H,F){for(var Y in F)if(typeof F[Y]===c&&F[Y].length>0){for(var Se=0;Se<F[Y].length;Se++)if(Zr(F[Y][Se],H))return Y===o?r:Y}else if(Zr(F[Y],H))return Y===o?r:Y;return H},us={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Tn={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Jn={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[_,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[_,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,_],[/opios[\/ ]+([\w\.]+)/i],[_,[h,q+" Mini"]],[/\bopr\/([\w\.]+)/i],[_,[h,q]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[h,_],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[_,[h,"UC"+w]],[/\bqbcore\/([\w\.]+)/i],[_,[h,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[_,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[_,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[_,[h,"IE"]],[/yabrowser\/([\w\.]+)/i],[_,[h,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+w],_],[/\bfocus\/([\w\.]+)/i],[_,[h,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[_,[h,q+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[_,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[_,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[_,[h,q+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[_,[h,"MIUI "+w]],[/fxios\/([-\w\.]+)/i],[_,[h,A]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+w]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+w],_],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],_],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[h,_],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,Xn],_],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[h,_],[/\bgsa\/([\w\.]+) .*safari\//i],[_,[h,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[_,[h,D+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,D+" WebView"],_],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[_,[h,"Android "+w]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,_],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[_,[h,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[_,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[_,En,us]],[/(webkit|khtml)\/([\w\.]+)/i],[h,_],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],_],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[_,[h,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[h,_]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,bn]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,s,bn]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,bn]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[m,Q],[p,C]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[m,Q],[p,S]],[/((ipod|iphone)\d+,\d+)/i],[f,[m,b],[p,S]],[/(ipad\d+,\d+)/i],[f,[m,b],[p,C]],[/\((ip(?:hone|od)[\w ]*);/i],[f,[m,b],[p,S]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[m,b],[p,C]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[m,P],[p,C]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[m,P],[p,S]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g," "],[m,ye],[p,S]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g," "],[m,ye],[p,C]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[m,"OPPO"],[p,S]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[m,"Vivo"],[p,S]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[m,"Realme"],[p,S]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[m,j],[p,S]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[m,j],[p,C]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[m,$],[p,C]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[m,$],[p,S]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[m,"Lenovo"],[p,C]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g," "],[m,"Nokia"],[p,S]],[/(pixel c)\b/i],[f,[m,L],[p,C]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[m,L],[p,S]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[m,ge],[p,S]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[m,ge],[p,C]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[m,"OnePlus"],[p,S]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[m,y],[p,C]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[m,y],[p,S]],[/(playbook);[-\w\),; ]+(rim)/i],[f,m,[p,C]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[m,k],[p,S]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[m,I],[p,C]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[m,I],[p,S]],[/(nexus 9)/i],[f,[m,"HTC"],[p,C]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[f,/_/g," "],[p,S]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[m,"Acer"],[p,C]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[m,"Meizu"],[p,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[m,"Sharp"],[p,S]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[m,f,[p,S]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[m,f,[p,C]],[/(surface duo)/i],[f,[m,N],[p,C]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[m,"Fairphone"],[p,S]],[/(u304aa)/i],[f,[m,"AT&T"],[p,S]],[/\bsie-(\w*)/i],[f,[m,"Siemens"],[p,S]],[/\b(rct\w+) b/i],[f,[m,"RCA"],[p,C]],[/\b(venue[\d ]{2,7}) b/i],[f,[m,"Dell"],[p,C]],[/\b(q(?:mv|ta)\w+) b/i],[f,[m,"Verizon"],[p,C]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[m,"Barnes & Noble"],[p,C]],[/\b(tm\d{3}\w+) b/i],[f,[m,"NuVision"],[p,C]],[/\b(k88) b/i],[f,[m,"ZTE"],[p,C]],[/\b(nx\d{3}j) b/i],[f,[m,"ZTE"],[p,S]],[/\b(gen\d{3}) b.+49h/i],[f,[m,"Swiss"],[p,S]],[/\b(zur\d{3}) b/i],[f,[m,"Swiss"],[p,C]],[/\b((zeki)?tb.*\b) b/i],[f,[m,"Zeki"],[p,C]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,"Dragon Touch"],f,[p,C]],[/\b(ns-?\w{0,9}) b/i],[f,[m,"Insignia"],[p,C]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[m,"NextBook"],[p,C]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,"Voice"],f,[p,S]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,"LvTel"],f,[p,S]],[/\b(ph-1) /i],[f,[m,"Essential"],[p,S]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[m,"Envizen"],[p,C]],[/\b(trio[-\w\. ]+) b/i],[f,[m,"MachSpeed"],[p,C]],[/\btu_(1491) b/i],[f,[m,"Rotor"],[p,C]],[/(shield[\w ]+) b/i],[f,[m,"Nvidia"],[p,C]],[/(sprint) (\w+)/i],[m,f,[p,S]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[m,N],[p,S]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[m,ze],[p,C]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[m,ze],[p,S]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,f,[p,v]],[/droid.+; (shield) bui/i],[f,[m,"Nvidia"],[p,v]],[/(playstation [345portablevi]+)/i],[f,[m,ge],[p,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[m,N],[p,v]],[/smart-tv.+(samsung)/i],[m,[p,R]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[m,Q],[p,R]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,$],[p,R]],[/(apple) ?tv/i],[m,[f,b+" TV"],[p,R]],[/crkey/i],[[f,D+"cast"],[m,L],[p,R]],[/droid.+aft(\w)( bui|\))/i],[f,[m,y],[p,R]],[/\(dtv[\);].+(aquos)/i],[f,[m,"Sharp"],[p,R]],[/(bravia[\w- ]+) bui/i],[f,[m,ge],[p,R]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[m,lt],[f,lt],[p,R]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,R]],[/((pebble))app/i],[m,f,[p,E]],[/droid.+; (glass) \d/i],[f,[m,L],[p,E]],[/droid.+; (wt63?0{2,3})\)/i],[f,[m,ze],[p,E]],[/(quest( 2)?)/i],[f,[m,Xn],[p,E]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[p,x]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[p,S]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[p,C]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,C]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[p,S]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[m,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[_,[h,M+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[_,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[h,_],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[_,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,_],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[h,[_,En,Tn]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,"Windows"],[_,En,Tn]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[_,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,"Mac OS"],[_,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[_,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,_],[/\(bb(10);/i],[_,[h,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[_,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[_,[h,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[_,[h,"webOS"]],[/crkey\/([\d\.]+)/i],[_,[h,D+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[h,"Chromium OS"],_],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,_],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],_],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[h,_]]},K=function(H,F){if(typeof H===c&&(F=H,H=r),!(this instanceof K))return new K(H,F).getResult();var Y=H||(typeof n!==a&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:s),Se=F?as(Jn,F):Jn;return this.getBrowser=function(){var re={};return re[h]=r,re[_]=r,Qe.call(re,Y,Se.browser),re.major=ba(re.version),re},this.getCPU=function(){var re={};return re[g]=r,Qe.call(re,Y,Se.cpu),re},this.getDevice=function(){var re={};return re[m]=r,re[f]=r,re[p]=r,Qe.call(re,Y,Se.device),re},this.getEngine=function(){var re={};return re[h]=r,re[_]=r,Qe.call(re,Y,Se.engine),re},this.getOS=function(){var re={};return re[h]=r,re[_]=r,Qe.call(re,Y,Se.os),re},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Y},this.setUA=function(re){return Y=typeof re===l&&re.length>T?lt(re,T):re,this},this.setUA(Y),this};K.VERSION=i,K.BROWSER=Lt([h,_,d]),K.CPU=Lt([g]),K.DEVICE=Lt([f,m,p,v,S,R,C,E,x]),K.ENGINE=K.OS=Lt([h,_]),t.exports&&(e=t.exports=K),e.UAParser=K;var Ne=typeof n!==a&&(n.jQuery||n.Zepto);if(Ne&&!Ne.ua){var te=new K;Ne.ua=te.getResult(),Ne.ua.get=function(){return te.getUA()},Ne.ua.set=function(H){te.setUA(H);var F=te.getResult();for(var Y in F)Ne.ua[Y]=F[Y]}}})(typeof window=="object"?window:GD)}(hi,hi.exports)),hi.exports}var Kv=qD();const zD=ey(Kv);var WD=function(){function t(){this.ua=new Kv.UAParser(typeof navigator<"u"?navigator.userAgent:null).getResult()}return t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:YD(),platform:"Web",os:VD(this.ua),deviceModel:KD(this.ua)}},t}(),VD=function(t){var e,n;return[(e=t.browser)===null||e===void 0?void 0:e.name,(n=t.browser)===null||n===void 0?void 0:n.major].filter(function(r){return r!=null}).join(" ")},KD=function(t){var e;return(e=t.os)===null||e===void 0?void 0:e.name},YD=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},XD=function(){function t(){this.queue=[]}return t.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},t.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(n){e(n)}),this.queue=[])},t}();/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var un=function(){return un=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},un.apply(this,arguments)},ao=function(t,e){var n=["string","number","boolean","undefined"],r=typeof t,i=typeof e;if(r!==i)return!1;for(var s=0,o=n;s<o.length;s++){var u=o[s];if(u===r)return t===e}if(t==null&&e==null)return!0;if(t==null||e==null||t.length!==e.length)return!1;var a=Array.isArray(t),c=Array.isArray(e);if(a!==c)return!1;if(a&&c){for(var l=0;l<t.length;l++)if(!ao(t[l],e[l]))return!1}else{var d=Object.keys(t).sort(),f=Object.keys(e).sort();if(!ao(d,f))return!1;var h=!0;return Object.keys(t).forEach(function(p){ao(t[p],e[p])||(h=!1)}),h}return!0},JD="$set",QD="$unset",ZD="$clearAll";Object.entries||(Object.entries=function(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r});var eM=function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return t.prototype.editIdentity=function(){var e=this,n=un({},this.identity.userProperties),r=un(un({},this.identity),{userProperties:n});return{setUserId:function(i){return r.userId=i,this},setDeviceId:function(i){return r.deviceId=i,this},setUserProperties:function(i){return r.userProperties=i,this},updateUserProperties:function(i){for(var s=r.userProperties||{},o=0,u=Object.entries(i);o<u.length;o++){var a=u[o],c=a[0],l=a[1];switch(c){case JD:for(var d=0,f=Object.entries(l);d<f.length;d++){var h=f[d],p=h[0],m=h[1];s[p]=m}break;case QD:for(var _=0,g=Object.keys(l);_<g.length;_++){var p=g[_];delete s[p]}break;case ZD:s={};break}}return r.userProperties=s,this},commit:function(){return e.setIdentity(r),this}}},t.prototype.getIdentity=function(){return un({},this.identity)},t.prototype.setIdentity=function(e){var n=un({},this.identity);this.identity=un({},e),ao(n,this.identity)||this.listeners.forEach(function(r){r(e)})},t.prototype.addIdentityListener=function(e){this.listeners.add(e)},t.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},t}(),ci=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,tM=function(){function t(){this.identityStore=new eM,this.eventBridge=new XD,this.applicationContextProvider=new WD}return t.getInstance=function(e){return ci.analyticsConnectorInstances||(ci.analyticsConnectorInstances={}),ci.analyticsConnectorInstances[e]||(ci.analyticsConnectorInstances[e]=new t),ci.analyticsConnectorInstances[e]},t}(),Yv=function(){return tM.getInstance("$default_instance")},nM=function(){function t(){this.name="identity",this.type=Vt.BEFORE,this.identityStore=Yv().identityStore}return t.prototype.execute=function(e){return at(this,void 0,void 0,function(){var n;return ut(this,function(r){return n=e.user_properties,n&&this.identityStore.editIdentity().updateUserProperties(n).commit(),[2,e]})})},t.prototype.setup=function(e){return Promise.resolve(void 0)},t}(),rM=function(){var t,e,n,r;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(r=(n=(e=(t=navigator.languages)===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:navigator.language)!==null&&n!==void 0?n:i)!==null&&r!==void 0?r:""},Ka=function(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.name,s=r.args,o=r.resolve,u=t&&t[i];if(typeof u=="function"){var a=u.apply(t,s);typeof o=="function"&&o(a?.promise)}}return t},Ya=function(t){var e=t;return e&&e._q!==void 0},iM="1.8.0",sM="Web",oM="$remote",aM=function(){function t(){this.name="context",this.type=Vt.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat(iM);var e;typeof navigator<"u"&&(e=navigator.userAgent),this.uaResult=new zD(e).getResult()}return t.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},t.prototype.execute=function(e){return je(this,void 0,void 0,function(){var n,r,i,s,o,u;return Ge(this,function(a){return this.isSessionValid()||(this.config.sessionId=Date.now()),this.config.lastEventTime=Date.now(),n=new Date().getTime(),r=this.uaResult.browser.name,i=this.uaResult.browser.version,s=this.uaResult.device.model||this.uaResult.os.name,o=this.uaResult.device.vendor,u=de(de(de(de(de(de(de(de(de(de(de(de({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:n},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:sM}),this.config.trackingOptions.osName&&{os_name:r}),this.config.trackingOptions.osVersion&&{os_version:i}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:o}),this.config.trackingOptions.deviceModel&&{device_model:s}),this.config.trackingOptions.language&&{language:rM()}),this.config.trackingOptions.ipAddress&&{ip:oM}),{insert_id:ya(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:this.eventId++,library:this.library}),[2,u]})})},t.prototype.isSessionValid=function(){var e=this.config.lastEventTime||Date.now(),n=Date.now()-e;return n<this.config.sessionTimeout},t}(),ml=function(){function t(){}return t.prototype.isEnabled=function(){return je(this,void 0,void 0,function(){var e,n,r,i;return Ge(this,function(s){switch(s.label){case 0:if(!xt())return[2,!1];e=String(Date.now()),n=new t,r="AMP_TEST",s.label=1;case 1:return s.trys.push([1,4,5,7]),[4,n.set(r,e)];case 2:return s.sent(),[4,n.get(r)];case 3:return i=s.sent(),[2,i===e];case 4:return s.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return s.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return je(this,void 0,void 0,function(){var n;return Ge(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return n=r.sent(),n?[2,JSON.parse(n)]:[2,void 0];case 2:return r.sent(),[2,void 0];case 3:return[2]}})})},t.prototype.getRaw=function(e){var n;return je(this,void 0,void 0,function(){return Ge(this,function(r){return[2,((n=xt())===null||n===void 0?void 0:n.localStorage.getItem(e))||void 0]})})},t.prototype.set=function(e,n){var r;return je(this,void 0,void 0,function(){return Ge(this,function(i){try{(r=xt())===null||r===void 0||r.localStorage.setItem(e,JSON.stringify(n))}catch{}return[2]})})},t.prototype.remove=function(e){var n;return je(this,void 0,void 0,function(){return Ge(this,function(r){try{(n=xt())===null||n===void 0||n.localStorage.removeItem(e)}catch{}return[2]})})},t.prototype.reset=function(){var e;return je(this,void 0,void 0,function(){return Ge(this,function(n){try{(e=xt())===null||e===void 0||e.localStorage.clear()}catch{}return[2]})})},t}(),uM=function(t){Sa(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={done:4},n}return e.prototype.send=function(n,r){return je(this,void 0,void 0,function(){var i=this;return Ge(this,function(s){return[2,new Promise(function(o,u){typeof XMLHttpRequest>"u"&&u(new Error("XHRTransport is not supported."));var a=new XMLHttpRequest;a.open("POST",n,!0),a.onreadystatechange=function(){if(a.readyState===i.state.done)try{var c=a.responseText,l=JSON.parse(c),d=i.buildResponse(l);o(d)}catch(f){u(f)}},a.setRequestHeader("Content-Type","application/json"),a.setRequestHeader("Accept","*/*"),a.send(JSON.stringify(r))})]})})},e}(pl),cM=function(t){Sa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(n,r){return je(this,void 0,void 0,function(){var i=this;return Ge(this,function(s){return[2,new Promise(function(o,u){var a=xt();if(!a?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var c=JSON.stringify(r),l=a.navigator.sendBeacon(n,JSON.stringify(r));return o(l?i.buildResponse({code:200,events_ingested:r.events.length,payload_size_bytes:c.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(d){u(d)}})]})})},e}(pl),ss=function(){var t=new Wv,e={deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0};return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:t,cookieUpgrade:!0,disableCookies:!1,domain:"",sessionTimeout:30*60*1e3,trackingOptions:e,transportProvider:new jD}},Hh=function(t){Sa(e,t);function e(n,r){var i=this,s,o,u,a,c,l,d,f,h,p=ss();return i=t.call(this,de(de({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30,transportProvider:p.transportProvider},r),{apiKey:n}))||this,i._optOut=!1,i.cookieStorage=(s=r?.cookieStorage)!==null&&s!==void 0?s:p.cookieStorage,i.deviceId=r?.deviceId,i.lastEventTime=r?.lastEventTime,i.optOut=!!r?.optOut,i.sessionId=r?.sessionId,i.userId=r?.userId,i.appVersion=r?.appVersion,i.attribution=r?.attribution,i.cookieExpiration=(o=r?.cookieExpiration)!==null&&o!==void 0?o:p.cookieExpiration,i.cookieSameSite=(u=r?.cookieSameSite)!==null&&u!==void 0?u:p.cookieSameSite,i.cookieSecure=(a=r?.cookieSecure)!==null&&a!==void 0?a:p.cookieSecure,i.cookieUpgrade=(c=r?.cookieUpgrade)!==null&&c!==void 0?c:p.cookieUpgrade,i.disableCookies=(l=r?.disableCookies)!==null&&l!==void 0?l:p.disableCookies,i.domain=(d=r?.domain)!==null&&d!==void 0?d:p.domain,i.partnerId=r?.partnerId,i.sessionTimeout=(f=r?.sessionTimeout)!==null&&f!==void 0?f:p.sessionTimeout,i.trackingOptions=(h=r?.trackingOptions)!==null&&h!==void 0?h:p.trackingOptions,i}return Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._deviceId},set:function(n){this._deviceId!==n&&(this._deviceId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},set:function(n){this._userId!==n&&(this._userId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this._sessionId},set:function(n){this._sessionId!==n&&(this._sessionId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(n){this._optOut!==n&&(this._optOut=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(n){this._lastEventTime!==n&&(this._lastEventTime=n,this.updateStorage())},enumerable:!1,configurable:!0}),e.prototype.updateStorage=function(){var n,r={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime};(n=this.cookieStorage)===null||n===void 0||n.set(gl(this.apiKey),r)},e}(ED),lM=function(t,e){return je(void 0,void 0,void 0,function(){var n,r,i,s,o,u,a,c,l,d,f,h,p,m,_,g,v,S,C,R,E,x,T,y;return Ge(this,function(b){switch(b.label){case 0:return n=ss(),(g=e?.domain)!==null&&g!==void 0?(i=g,[3,3]):[3,1];case 1:return[4,hM()];case 2:i=b.sent(),b.label=3;case 3:return r=i,[4,dM(de(de({},e),{domain:r}))];case 4:return s=b.sent(),[4,s.get(gl(t))];case 5:return o=b.sent(),u=zu(),a=(C=(S=(v=e?.deviceId)!==null&&v!==void 0?v:u.deviceId)!==null&&S!==void 0?S:o?.deviceId)!==null&&C!==void 0?C:ya(),c=(R=e?.lastEventTime)!==null&&R!==void 0?R:o?.lastEventTime,l=(E=e?.optOut)!==null&&E!==void 0?E:!!o?.optOut,d=(x=e?.sessionId)!==null&&x!==void 0?x:o?.sessionId,f=(T=e?.userId)!==null&&T!==void 0?T:o?.userId,h=Hh.bind,p=[void 0,t],m=[de({},e)],_={cookieStorage:s,deviceId:a,domain:r,lastEventTime:c,optOut:l,sessionId:d},[4,fM(e)];case 6:return[2,new(h.apply(Hh,p.concat([de.apply(void 0,m.concat([(_.storageProvider=b.sent(),_.trackingOptions=de(de({},n.trackingOptions),e?.trackingOptions),_.transportProvider=(y=e?.transportProvider)!==null&&y!==void 0?y:Jv(e?.transport),_.userId=f,_)]))])))]}})})},dM=function(t,e){return e===void 0&&(e=ss()),je(void 0,void 0,void 0,function(){var n,r,i;return Ge(this,function(s){switch(s.label){case 0:return n=de(de({},e),t),r=t?.cookieStorage,i=!r,i?[3,2]:[4,r.isEnabled()];case 1:i=!s.sent(),s.label=2;case 2:return i?[2,Xv(n)]:[2,r]}})})},Xv=function(t){return je(void 0,void 0,void 0,function(){var e,n;return Ge(this,function(r){switch(r.label){case 0:return e=new zo({domain:t.domain,expirationDays:t.cookieExpiration,sameSite:t.cookieSameSite,secure:t.cookieSecure}),n=t.disableCookies,n?[3,2]:[4,e.isEnabled()];case 1:n=!r.sent(),r.label=2;case 2:return n?(e=new ml,[4,e.isEnabled()]):[3,4];case 3:r.sent()||(e=new Wv),r.label=4;case 4:return[2,e]}})})},fM=function(t){return je(void 0,void 0,void 0,function(){var e,n,r,i,s,o,u,a;return Ge(this,function(c){switch(c.label){case 0:if(e=t&&Object.prototype.hasOwnProperty.call(t,"storageProvider"),!(!e||t.storageProvider))return[3,9];c.label=1;case 1:c.trys.push([1,7,8,9]),n=kD([t?.storageProvider,new ml]),r=n.next(),c.label=2;case 2:return r.done?[3,6]:(i=r.value,s=i,s?[4,i.isEnabled()]:[3,4]);case 3:s=c.sent(),c.label=4;case 4:if(s)return[2,i];c.label=5;case 5:return r=n.next(),[3,2];case 6:return[3,9];case 7:return o=c.sent(),u={error:o},[3,9];case 8:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(u)throw u.error}return[7];case 9:return[2,void 0]}})})},Jv=function(t){return t===Go.XHR?new uM:t===Go.SendBeacon?new cM:ss().transportProvider},hM=function(t){return je(void 0,void 0,void 0,function(){var e,n,r,i,s,s,o,u,a,c;return Ge(this,function(l){switch(l.label){case 0:return[4,new zo().isEnabled()];case 1:if(!l.sent()||typeof location>"u")return[2,""];for(e=location.hostname,n=e.split("."),r=[],i="AMP_TLDTEST",s=n.length-2;s>=0;--s)r.push(n.slice(s).join("."));s=0,l.label=2;case 2:return s<r.length?(o=r[s],u={domain:"."+o},a=new zo(u),[4,a.set(i,1)]):[3,7];case 3:return l.sent(),[4,a.get(i)];case 4:return c=l.sent(),c?[4,a.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+o];case 6:return s++,[3,2];case 7:return[2,""]}})})},pM=function(t,e){return je(void 0,void 0,void 0,function(){var n,r,i,s,o,u,a,c,l,d;return Ge(this,function(f){switch(f.label){case 0:return n=new zo,[4,n.isEnabled()];case 1:return(!f.sent()||e?.disableCookies)&&(n=new ml),[4,n.isEnabled()];case 2:return f.sent()?(r=BD(t),[4,n.getRaw(r)]):[2,{optOut:!1}];case 3:return i=f.sent(),i?((d=e?.cookieUpgrade)!==null&&d!==void 0?d:ss().cookieUpgrade)?[4,n.remove(r)]:[3,5]:[2,{optOut:!1}];case 4:f.sent(),f.label=5;case 5:return s=RD(i.split("."),5),o=s[0],u=s[1],a=s[2],c=s[3],l=s[4],[2,{deviceId:o,userId:gM(u),sessionId:jh(c),lastEventTime:jh(l),optOut:!!a}]}})})},jh=function(t){var e=parseInt(t,32);if(!isNaN(e))return e},gM=function(t){if(!(!atob||!escape||!t))try{return decodeURIComponent(escape(atob(t)))}catch{return}},mM=function(t){Sa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(n,r,i){var s,o,u;return n===void 0&&(n=""),je(this,void 0,void 0,function(){var a,c,l,d,f=this;return Ge(this,function(h){switch(h.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,pM(n,i)]);case 1:return a=h.sent(),[4,lM(n,de(de({},i),{deviceId:(s=a.deviceId)!==null&&s!==void 0?s:i?.deviceId,sessionId:(o=a.sessionId)!==null&&o!==void 0?o:i?.sessionId,optOut:(u=i?.optOut)!==null&&u!==void 0?u:a.optOut,lastEventTime:a.lastEventTime,userId:r??a.userId}))];case 2:return c=h.sent(),[4,t.prototype._init.call(this,c)];case 3:return h.sent(),l=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),l=!0),d=Yv(),d.eventBridge.setEventReceiver(function(p){f.track(p.eventType,p.eventProperties)}),d.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new aM)];case 4:return h.sent(),[4,this.add(new nM)];case 5:return h.sent(),[4,this.add(new ID)];case 6:return h.sent(),this.initializing=!1,[4,this.runAttributionStrategy(c.attribution,l)];case 7:return h.sent(),[4,this.runQueuedFunctions("dispatchQ")];case 8:return h.sent(),[2]}})})},e.prototype.runAttributionStrategy=function(n,r){return r===void 0&&(r=!1),je(this,void 0,void 0,function(){var i,s,o,u;return Ge(this,function(a){switch(a.label){case 0:return i=this.track.bind(this),s=this.setSessionId.bind(this,Date.now()),[4,Xv(this.config)];case 1:return o=a.sent(),u=new HD(this.config.apiKey,de(de({},n),{storage:o,track:i,onNewCampaign:s})),[4,u.send(r)];case 2:return a.sent(),[2]}})})},e.prototype.getUserId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.userId},e.prototype.setUserId=function(n){if(!this.config){this.q.push(this.setUserId.bind(this,n));return}this.config.userId=n},e.prototype.getDeviceId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.deviceId},e.prototype.setDeviceId=function(n){if(!this.config){this.q.push(this.setDeviceId.bind(this,n));return}this.config.deviceId=n},e.prototype.reset=function(){this.setUserId(void 0),this.setDeviceId(ya())},e.prototype.getSessionId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.sessionId},e.prototype.setSessionId=function(n){if(!this.config){this.q.push(this.setSessionId.bind(this,n));return}this.config.sessionId=n,this.config.lastEventTime=void 0},e.prototype.setTransport=function(n){if(!this.config){this.q.push(this.setTransport.bind(this,n));return}this.config.transportProvider=Jv(n)},e.prototype.identify=function(n,r){if(Ya(n)){var i=n._q;n._q=[],n=Ka(new qo,i)}return r?.user_id&&this.setUserId(r.user_id),r?.device_id&&this.setDeviceId(r.device_id),t.prototype.identify.call(this,n,r)},e.prototype.groupIdentify=function(n,r,i,s){if(Ya(i)){var o=i._q;i._q=[],i=Ka(new qo,o)}return t.prototype.groupIdentify.call(this,n,r,i,s)},e.prototype.revenue=function(n,r){if(Ya(n)){var i=n._q;n._q=[],n=Ka(new yD,i)}return t.prototype.revenue.call(this,n,r)},e}(vD),_M=function(){var t=new mM;return{init:Re(It(t.init.bind(t)),"init",Ce(t),ke(t,["config"])),add:Re(It(t.add.bind(t)),"add",Ce(t),ke(t,["config.apiKey","timeline.plugins"])),remove:Re(It(t.remove.bind(t)),"remove",Ce(t),ke(t,["config.apiKey","timeline.plugins"])),track:Re(It(t.track.bind(t)),"track",Ce(t),ke(t,["config.apiKey","timeline.queue.length"])),logEvent:Re(It(t.logEvent.bind(t)),"logEvent",Ce(t),ke(t,["config.apiKey","timeline.queue.length"])),identify:Re(It(t.identify.bind(t)),"identify",Ce(t),ke(t,["config.apiKey","timeline.queue.length"])),groupIdentify:Re(It(t.groupIdentify.bind(t)),"groupIdentify",Ce(t),ke(t,["config.apiKey","timeline.queue.length"])),setGroup:Re(It(t.setGroup.bind(t)),"setGroup",Ce(t),ke(t,["config.apiKey","timeline.queue.length"])),revenue:Re(It(t.revenue.bind(t)),"revenue",Ce(t),ke(t,["config.apiKey","timeline.queue.length"])),flush:Re(It(t.flush.bind(t)),"flush",Ce(t),ke(t,["config.apiKey","timeline.queue.length"])),getUserId:Re(t.getUserId.bind(t),"getUserId",Ce(t),ke(t,["config","config.userId"])),setUserId:Re(t.setUserId.bind(t),"setUserId",Ce(t),ke(t,["config","config.userId"])),getDeviceId:Re(t.getDeviceId.bind(t),"getDeviceId",Ce(t),ke(t,["config","config.deviceId"])),setDeviceId:Re(t.setDeviceId.bind(t),"setDeviceId",Ce(t),ke(t,["config","config.deviceId"])),reset:Re(t.reset.bind(t),"reset",Ce(t),ke(t,["config","config.userId","config.deviceId"])),getSessionId:Re(t.getSessionId.bind(t),"getSessionId",Ce(t),ke(t,["config"])),setSessionId:Re(t.setSessionId.bind(t),"setSessionId",Ce(t),ke(t,["config"])),setOptOut:Re(t.setOptOut.bind(t),"setOptOut",Ce(t),ke(t,["config"])),setTransport:Re(t.setTransport.bind(t),"setTransport",Ce(t),ke(t,["config"]))}};const os=_M();var NM=os.identify,PM=os.init,$M=os.reset,UM=os.setUserId,FM=os.track;export{LM as G,qo as I,MM as S,NM as a,$M as b,CM as c,$i as d,kM as e,P0 as f,le as g,qf as h,PM as i,po as j,RM as k,AM as l,kC as m,xM as n,DM as r,UM as s,FM as t,vn as w}; //# sourceMappingURL=analytics-BRpNfSMK.js.map