diff --git a/js/sentry-8.2.1.min.js b/js/sentry-8.2.1.min.js new file mode 100644 index 000000000..4076c494f --- /dev/null +++ b/js/sentry-8.2.1.min.js @@ -0,0 +1,3 @@ +/*! @sentry/browser 8.2.1 (bb2f1bc) | https://github.com/getsentry/sentry-javascript */ +var Sentry=function(t){const n=Object.prototype.toString;function e(t){switch(n.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return l(t,Error)}}function r(t,e){return n.call(t)===`[object ${e}]`}function o(t){return r(t,"ErrorEvent")}function i(t){return r(t,"DOMError")}function s(t){return r(t,"String")}function c(t){return"object"==typeof t&&null!==t&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function u(t){return null===t||c(t)||"object"!=typeof t&&"function"!=typeof t}function a(t){return r(t,"Object")}function f(t){return"undefined"!=typeof Event&&l(t,Event)}function h(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function l(t,n){try{return t instanceof n}catch(t){return!1}}function d(t){return!("object"!=typeof t||null===t||!t.__isVue&&!t.t)}function p(t,n=0){return"string"!=typeof t||0===n||t.length<=n?t:`${t.slice(0,n)}...`}function m(t,n){if(!Array.isArray(t))return"";const e=[];for(let n=0;ny(t,n,e)))}function v(t,n,e=250,r,o,i,s){if(!(i.exception&&i.exception.values&&s&&l(s.originalException,Error)))return;const c=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;var u,a;c&&(i.exception.values=(u=b(t,n,o,s.originalException,r,i.exception.values,c,0),a=e,u.map((t=>(t.value&&(t.value=p(t.value,a)),t)))))}function b(t,n,e,r,o,i,s,c){if(i.length>=e+1)return i;let u=[...i];if(l(r[o],Error)){_(s,c);const i=t(n,r[o]),a=u.length;w(i,o,a,c),u=b(t,n,e,r[o],o,[i,...u],i,a)}return Array.isArray(r.errors)&&r.errors.forEach(((r,i)=>{if(l(r,Error)){_(s,c);const a=t(n,r),f=u.length;w(a,`errors[${i}]`,f,c),u=b(t,n,e,r,o,[a,...u],a,f)}})),u}function _(t,n){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,..."AggregateError"===t.type&&{is_exception_group:!0},exception_id:n}}function w(t,n,e,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:n,exception_id:e,parent_id:r}}const $=globalThis;function E(t,n,e){const r=e||$,o=r.__SENTRY__=r.__SENTRY__||{};return o[t]||(o[t]=n())}const S=$,x=80;function k(t,n={}){if(!t)return"";try{let e=t;const r=5,o=[];let i=0,s=0;const c=" > ",u=c.length;let a;const f=Array.isArray(n)?n:n.keyAttrs,h=!Array.isArray(n)&&n.maxStringLength||x;for(;e&&i++1&&s+o.length*u+a.length>=h));)o.push(a),s+=a.length,e=e.parentNode;return o.reverse().join(c)}catch(t){return""}}function I(t,n){const e=t,r=[];let o,i,c,u,a;if(!e||!e.tagName)return"";if(S.HTMLElement&&e instanceof HTMLElement&&e.dataset){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}r.push(e.tagName.toLowerCase());const f=n&&n.length?n.filter((t=>e.getAttribute(t))).map((t=>[t,e.getAttribute(t)])):null;if(f&&f.length)f.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else if(e.id&&r.push(`#${e.id}`),o=e.className,o&&s(o))for(i=o.split(/\s+/),a=0;a{const r=T[t];e[t]=n[t],n[t]=r}));try{return t()}finally{r.forEach((t=>{n[t]=e[t]}))}}const M=function(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return j.forEach((t=>{n[t]=()=>{}})),n}(),C=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function R(t,n=!1){const{host:e,path:r,pass:o,port:i,projectId:s,protocol:c,publicKey:u}=t;return`${c}://${u}${n&&o?`:${o}`:""}@${e}${i?`:${i}`:""}/${r?`${r}/`:r}${s}`}function D(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function A(t){const n="string"==typeof t?function(t){const n=C.exec(t);if(!n)return void O((()=>{console.error(`Invalid Sentry Dsn: ${t}`)}));const[e,r,o="",i,s="",c]=n.slice(1);let u="",a=c;const f=a.split("/");if(f.length>1&&(u=f.slice(0,-1).join("/"),a=f.pop()),a){const t=a.match(/^\d+/);t&&(a=t[0])}return D({host:i,pass:o,path:u,projectId:a,port:s,protocol:e,publicKey:r})}(t):D(t);if(n)return n}class N extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function L(t,n,e){if(!(n in t))return;const r=t[n],o=e(r);"function"==typeof o&&U(o,r),t[n]=o}function P(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch(t){}}function U(t,n){try{const e=n.prototype||{};t.prototype=n.prototype=e,P(t,"__sentry_original__",n)}catch(t){}}function F(t){return t.__sentry_original__}function q(t){if(e(t))return{message:t.message,name:t.name,stack:t.stack,...H(t)};if(f(t)){const n={type:t.type,target:B(t.target),currentTarget:B(t.currentTarget),...H(t)};return"undefined"!=typeof CustomEvent&&l(t,CustomEvent)&&(n.detail=t.detail),n}return t}function B(t){try{return n=t,"undefined"!=typeof Element&&l(n,Element)?k(t):Object.prototype.toString.call(t)}catch(t){return""}var n}function H(t){if("object"==typeof t&&null!==t){const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}return{}}function W(t){return z(t,new Map)}function z(t,n){if(function(t){if(!a(t))return!1;try{const n=Object.getPrototypeOf(t).constructor.name;return!n||"Object"===n}catch(t){return!0}}(t)){const e=n.get(t);if(void 0!==e)return e;const r={};n.set(t,r);for(const e of Object.keys(t))void 0!==t[e]&&(r[e]=z(t[e],n));return r}if(Array.isArray(t)){const e=n.get(t);if(void 0!==e)return e;const r=[];return n.set(t,r),t.forEach((t=>{r.push(z(t,n))})),r}return t}const X=50,J="?",G=/\(error: (.*)\)/,K=/captureMessage|captureException/;function V(...t){const n=t.sort(((t,n)=>t[0]-n[0])).map((t=>t[1]));return(t,e=0,r=0)=>{const o=[],i=t.split("\n");for(let t=e;t1024)continue;const s=G.test(e)?e.replace(G,"$1"):e;if(!s.match(/\S*Error: /)){for(const t of n){const n=t(s);if(n){o.push(n);break}}if(o.length>=X+r)break}}return function(t){if(!t.length)return[];const n=Array.from(t);/sentryWrapped/.test(n[n.length-1].function||"")&&n.pop();n.reverse(),K.test(n[n.length-1].function||"")&&(n.pop(),K.test(n[n.length-1].function||"")&&n.pop());return n.slice(0,X).map((t=>({...t,filename:t.filename||n[n.length-1].filename,function:t.function||J})))}(o.slice(r))}}const Y="";function Q(t){try{return t&&"function"==typeof t&&t.name||Y}catch(t){return Y}}const Z={},tt={};function nt(t,n){Z[t]=Z[t]||[],Z[t].push(n)}function et(t,n){tt[t]||(n(),tt[t]=!0)}function rt(t,n){const e=t&&Z[t];if(e)for(const t of e)try{t(n)}catch(t){}}function ot(){"console"in $&&j.forEach((function(t){t in $.console&&L($.console,t,(function(n){return T[t]=n,function(...n){rt("console",{args:n,level:t});const e=T[t];e&&e.apply($.console,n)}}))}))}const it=$;function st(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function ct(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in it))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}())return!1;if(st(it.fetch))return!0;let t=!1;const n=it.document;if(n&&"function"==typeof n.createElement)try{const e=n.createElement("iframe");e.hidden=!0,n.head.appendChild(e),e.contentWindow&&e.contentWindow.fetch&&(t=st(e.contentWindow.fetch)),n.head.removeChild(e)}catch(t){}return t}const ut=1e3;function at(){return Date.now()/ut}const ft=function(){const{performance:t}=$;if(!t||!t.now)return at;const n=Date.now()-t.now(),e=null==t.timeOrigin?n:t.timeOrigin;return()=>(e+t.now())/ut}();function ht(){ct()&&L($,"fetch",(function(t){return function(...n){const{method:e,url:r}=function(t){if(0===t.length)return{method:"GET",url:""};if(2===t.length){const[n,e]=t;return{url:dt(n),method:lt(e,"method")?String(e.method).toUpperCase():"GET"}}const n=t[0];return{url:dt(n),method:lt(n,"method")?String(n.method).toUpperCase():"GET"}}(n),o={args:n,fetchData:{method:e,url:r},startTimestamp:1e3*ft()};return rt("fetch",{...o}),t.apply($,n).then((t=>(rt("fetch",{...o,endTimestamp:1e3*ft(),response:t}),t)),(t=>{throw rt("fetch",{...o,endTimestamp:1e3*ft(),error:t}),t}))}}))}function lt(t,n){return!!t&&"object"==typeof t&&!!t[n]}function dt(t){return"string"==typeof t?t:t?lt(t,"url")?t.url:t.toString?t.toString():"":""}(()=>{const{performance:t}=$;if(!t||!t.now)return;const n=36e5,e=t.now(),r=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+e-r):n,i=o16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch(t){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&e())>>t/4).toString(16)))}function bt(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function _t(t){const{message:n,event_id:e}=t;if(n)return n;const r=bt(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||e||"":e||""}function wt(t,n,e){const r=t.exception=t.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=n||""),i.type||(i.type=e||"Error")}function $t(t,n){const e=bt(t);if(!e)return;const r=e.mechanism;if(e.mechanism={type:"generic",handled:!0,...r,...n},n&&"data"in n){const t={...r&&r.data,...n.data};e.mechanism.data=t}}function Et(t){if(t&&t.__sentry_captured__)return!0;try{P(t,"__sentry_captured__",!0)}catch(t){}return!1}function St(t){return Array.isArray(t)?t:[t]}function xt(t,n=100,e=1/0){try{return It("",t,n,e)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function kt(t,n=3,e=102400){const r=xt(t,n);return o=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(o))>e?kt(t,n-1,e):r;var o}function It(t,n,e=1/0,r=1/0,o=function(){const t="function"==typeof WeakSet,n=t?new WeakSet:[];return[function(e){if(t)return!!n.has(e)||(n.add(e),!1);for(let t=0;t=r){h[t]="[MaxProperties ~]";break}const n=p[t];h[t]=It(t,n,u-1,r,o),l++}return s(n),h}var jt;function Tt(t){return new Mt((n=>{n(t)}))}function Ot(t){return new Mt(((n,e)=>{e(t)}))}!function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(jt||(jt={}));class Mt{constructor(t){Mt.prototype.__init.call(this),Mt.prototype.__init2.call(this),Mt.prototype.__init3.call(this),Mt.prototype.__init4.call(this),this.i=jt.PENDING,this.u=[];try{t(this.h,this.l)}catch(t){this.l(t)}}then(t,n){return new Mt(((e,r)=>{this.u.push([!1,n=>{if(t)try{e(t(n))}catch(t){r(t)}else e(n)},t=>{if(n)try{e(n(t))}catch(t){r(t)}else r(t)}]),this.p()}))}catch(t){return this.then((t=>t),t)}finally(t){return new Mt(((n,e)=>{let r,o;return this.then((n=>{o=!1,r=n,t&&t()}),(n=>{o=!0,r=n,t&&t()})).then((()=>{o?e(r):n(r)}))}))}__init(){this.h=t=>{this.m(jt.RESOLVED,t)}}__init2(){this.l=t=>{this.m(jt.REJECTED,t)}}__init3(){this.m=(t,n)=>{this.i===jt.PENDING&&(h(n)?n.then(this.h,this.l):(this.i=t,this.v=n,this.p()))}}__init4(){this.p=()=>{if(this.i===jt.PENDING)return;const t=this.u.slice();this.u=[],t.forEach((t=>{t[0]||(this.i===jt.RESOLVED&&t[1](this.v),this.i===jt.REJECTED&&t[2](this.v),t[0]=!0)}))}}}function Ct(t){const n=[];function e(t){return n.splice(n.indexOf(t),1)[0]}return{$:n,add:function(r){if(!(void 0===t||n.lengthe(o))).then(null,(()=>e(o).then(null,(()=>{})))),o},drain:function(t){return new Mt(((e,r)=>{let o=n.length;if(!o)return e(!0);const i=setTimeout((()=>{t&&t>0&&e(!1)}),t);n.forEach((t=>{Tt(t).then((()=>{--o||(clearTimeout(i),e(!0))}),r)}))}))}}}function Rt(t){if(!t)return{};const n=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!n)return{};const e=n[6]||"",r=n[8]||"";return{host:n[4],path:n[5],protocol:n[2],search:e,hash:r,relative:n[5]+e+r}}const Dt=["fatal","error","warning","log","info","debug"];function At(t){return"warn"===t?"warning":Dt.includes(t)?t:"log"}const Nt="sentry-",Lt=/^sentry-/,Pt=8192;function Ut(t){const n=function(t){if(!t||!s(t)&&!Array.isArray(t))return;if(Array.isArray(t))return t.reduce(((t,n)=>{const e=qt(n);for(const n of Object.keys(e))t[n]=e[n];return t}),{});return qt(t)}(t);if(!n)return;const e=Object.entries(n).reduce(((t,[n,e])=>{if(n.match(Lt)){t[n.slice(Nt.length)]=e}return t}),{});return Object.keys(e).length>0?e:void 0}function Ft(t){if(!t)return;return function(t){if(0===Object.keys(t).length)return;return Object.entries(t).reduce(((t,[n,e],r)=>{const o=`${encodeURIComponent(n)}=${encodeURIComponent(e)}`,i=0===r?o:`${t},${o}`;return i.length>Pt?t:i}),"")}(Object.entries(t).reduce(((t,[n,e])=>(e&&(t[`${Nt}${n}`]=e),t)),{}))}function qt(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[n,e])=>(t[n]=e,t)),{})}const Bt=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Ht(t,n){const e=function(t){if(!t)return;const n=t.match(Bt);if(!n)return;let e;return"1"===n[3]?e=!0:"0"===n[3]&&(e=!1),{traceId:n[1],parentSampled:e,parentSpanId:n[2]}}(t),r=Ut(n),{traceId:o,parentSpanId:i,parentSampled:s}=e||{};return e?{traceId:o||vt(),parentSpanId:i||vt().substring(16),spanId:vt().substring(16),sampled:s,dsc:r||{}}:{traceId:o||vt(),spanId:vt().substring(16)}}function Wt(t,n=[]){return[t,n]}function zt(t,n){const[e,r]=t;return[e,[...r,n]]}function Xt(t,n){const e=t[1];for(const t of e){if(n(t,t[0].type))return!0}return!1}function Jt(t){return $.__SENTRY__&&$.__SENTRY__.encodePolyfill?$.__SENTRY__.encodePolyfill(t):(new TextEncoder).encode(t)}function Gt(t){const[n,e]=t;let r=JSON.stringify(n);function o(t){"string"==typeof r?r="string"==typeof t?r+t:[Jt(r),t]:r.push("string"==typeof t?Jt(t):t)}for(const t of e){const[n,e]=t;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch(n){t=JSON.stringify(xt(e))}o(t)}}return"string"==typeof r?r:function(t){const n=t.reduce(((t,n)=>t+n.length),0),e=new Uint8Array(n);let r=0;for(const n of t)e.set(n,r),r+=n.length;return e}(r)}function Kt(t){const n="string"==typeof t.data?Jt(t.data):t.data;return[W({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const Vt={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 Yt(t){return Vt[t]}function Qt(t){if(!t||!t.sdk)return;const{name:n,version:e}=t.sdk;return{name:n,version:e}}const Zt=6e4;function tn(t,{statusCode:n,headers:e},r=Date.now()){const o={...t},i=e&&e["x-sentry-rate-limits"],s=e&&e["retry-after"];if(i)for(const t of i.trim().split(",")){const[n,e,,,i]=t.split(":",5),s=parseInt(n,10),c=1e3*(isNaN(s)?60:s);if(e)for(const t of e.split(";"))"metric_bucket"===t&&i&&!i.split(";").includes("custom")||(o[t]=r+c);else o.all=r+c}else s?o.all=r+function(t,n=Date.now()){const e=parseInt(`${t}`,10);if(!isNaN(e))return 1e3*e;const r=Date.parse(`${t}`);return isNaN(r)?Zt:r-n}(s,r):429===n&&(o.all=r+6e4);return o}const nn=$;const en=()=>{},rn=["attachTo","createWidget","remove"];function on(t){return O((()=>{console.warn("You are using feedbackIntegration() even though this bundle does not include feedback.")})),{name:"Feedback",...rn.reduce(((t,n)=>(t[n]=en,t)),{})}}const sn=["start","stop","flush"];function cn(){return un($),$}function un(t){return t.__SENTRY__||(t.__SENTRY__={extensions:{}}),t.__SENTRY__}function an(t){const n=ft(),e={sid:vt(),init:!0,timestamp:n,started:n,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return W({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${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}})}(e)};return t&&fn(e,t),e}function fn(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),t.did||n.did||(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||ft(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:vt()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}const hn="_sentrySpan";function ln(t,n){n?P(t,hn,n):delete t[hn]}function dn(t){return t[hn]}class pn{constructor(){this._=!1,this.S=[],this.k=[],this.I=[],this.j=[],this.T={},this.O={},this.M={},this.C={},this.R={},this.D=yn()}clone(){const t=new pn;return t.I=[...this.I],t.O={...this.O},t.M={...this.M},t.C={...this.C},t.T=this.T,t.A=this.A,t.N=this.N,t.L=this.L,t.P=this.P,t.k=[...this.k],t.U=this.U,t.j=[...this.j],t.R={...this.R},t.D={...this.D},t.F=this.F,t.q=this.q,ln(t,dn(this)),t}setClient(t){this.F=t}setLastEventId(t){this.q=t}getClient(){return this.F}lastEventId(){return this.q}addScopeListener(t){this.S.push(t)}addEventProcessor(t){return this.k.push(t),this}setUser(t){return this.T=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this.N&&fn(this.N,{user:t}),this.B(),this}getUser(){return this.T}getRequestSession(){return this.U}setRequestSession(t){return this.U=t,this}setTags(t){return this.O={...this.O,...t},this.B(),this}setTag(t,n){return this.O={...this.O,[t]:n},this.B(),this}setExtras(t){return this.M={...this.M,...t},this.B(),this}setExtra(t,n){return this.M={...this.M,[t]:n},this.B(),this}setFingerprint(t){return this.P=t,this.B(),this}setLevel(t){return this.A=t,this.B(),this}setTransactionName(t){return this.L=t,this.B(),this}setContext(t,n){return null===n?delete this.C[t]:this.C[t]=n,this.B(),this}setSession(t){return t?this.N=t:delete this.N,this.B(),this}getSession(){return this.N}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,[e,r]=n instanceof mn?[n.getScopeData(),n.getRequestSession()]:a(n)?[t,t.requestSession]:[],{tags:o,extra:i,user:s,contexts:c,level:u,fingerprint:f=[],propagationContext:h}=e||{};return this.O={...this.O,...o},this.M={...this.M,...i},this.C={...this.C,...c},s&&Object.keys(s).length&&(this.T=s),u&&(this.A=u),f.length&&(this.P=f),h&&(this.D=h),r&&(this.U=r),this}clear(){return this.I=[],this.O={},this.M={},this.T={},this.C={},this.A=void 0,this.L=void 0,this.P=void 0,this.U=void 0,this.N=void 0,ln(this,void 0),this.j=[],this.D=yn(),this.B(),this}addBreadcrumb(t,n){const e="number"==typeof n?n:100;if(e<=0)return this;const r={timestamp:at(),...t},o=this.I;return o.push(r),this.I=o.length>e?o.slice(-e):o,this.B(),this}getLastBreadcrumb(){return this.I[this.I.length-1]}clearBreadcrumbs(){return this.I=[],this.B(),this}addAttachment(t){return this.j.push(t),this}clearAttachments(){return this.j=[],this}getScopeData(){return{breadcrumbs:this.I,attachments:this.j,contexts:this.C,tags:this.O,extra:this.M,user:this.T,level:this.A,fingerprint:this.P||[],eventProcessors:this.k,propagationContext:this.D,sdkProcessingMetadata:this.R,transactionName:this.L,span:dn(this)}}setSDKProcessingMetadata(t){return this.R={...this.R,...t},this}setPropagationContext(t){return this.D=t,this}getPropagationContext(){return this.D}captureException(t,n){const e=n&&n.event_id?n.event_id:vt();if(!this.F)return M.warn("No client configured on scope - will not capture exception!"),e;const r=new Error("Sentry syntheticException");return this.F.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e&&e.event_id?e.event_id:vt();if(!this.F)return M.warn("No client configured on scope - will not capture message!"),r;const o=new Error(t);return this.F.captureMessage(t,n,{originalException:t,syntheticException:o,...e,event_id:r},this),r}captureEvent(t,n){const e=n&&n.event_id?n.event_id:vt();return this.F?(this.F.captureEvent(t,{...n,event_id:e},this),e):(M.warn("No client configured on scope - will not capture event!"),e)}B(){this._||(this._=!0,this.S.forEach((t=>{t(this)})),this._=!1)}}const mn=pn;function yn(){return{traceId:vt(),spanId:vt().substring(16)}}function gn(){return In(cn()).getCurrentScope()}function vn(){return In(cn()).getIsolationScope()}function bn(){return E("globalScope",(()=>new mn))}function _n(...t){const n=In(cn());if(2===t.length){const[e,r]=t;return e?n.withSetScope(e,r):n.withScope(r)}return n.withScope(t[0])}function wn(){return gn().getClient()}class $n{constructor(t,n){let e,r;e=t||new mn,r=n||new mn,this.H=[{scope:e}],this.W=r}withScope(t){const n=this.X();let e;try{e=t(n)}catch(t){throw this.J(),t}return h(e)?e.then((t=>(this.J(),t)),(t=>{throw this.J(),t})):(this.J(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this.W}getStack(){return this.H}getStackTop(){return this.H[this.H.length-1]}X(){const t=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:t}),t}J(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}}function En(){const t=un(cn());return t.hub||(t.hub=new $n(E("defaultCurrentScope",(()=>new mn)),E("defaultIsolationScope",(()=>new mn)))),t.hub}function Sn(t){return En().withScope(t)}function xn(t,n){const e=En();return e.withScope((()=>(e.getStackTop().scope=t,n(t))))}function kn(t){return En().withScope((()=>t(En().getIsolationScope())))}function In(t){const n=un(t);return n.acs?n.acs:{withIsolationScope:kn,withScope:Sn,withSetScope:xn,withSetIsolationScope:(t,n)=>kn(n),getCurrentScope:()=>En().getScope(),getIsolationScope:()=>En().getIsolationScope()}}let jn;function Tn(t){return jn?jn.get(t):void 0}function On(t){const n=Tn(t);if(!n)return;const e={};for(const[,[t,r]]of n)e[t]||(e[t]=[]),e[t].push(W(r));return e}const Mn="sentry.source",Cn="sentry.sample_rate",Rn="sentry.op",Dn="sentry.origin",An=0,Nn=1,Ln="production",Pn="_frozenDsc";function Un(t,n){const e=n.getOptions(),{publicKey:r}=n.getDsn()||{},o=W({environment:e.environment||Ln,release:e.release,public_key:r,trace_id:t});return n.emit("createDsc",o),o}function Fn(t){const n=wn();if(!n)return{};const e=Un(zn(t).trace_id||"",n),r=Kn(t);if(!r)return e;const o=r[Pn];if(o)return o;const i=zn(r),s=i.data||{},c=s[Cn];null!=c&&(e.sample_rate=`${c}`);const u=s[Mn];return u&&"url"!==u&&(e.transaction=i.description),e.sampled=String(Xn(r)),n.emit("createDsc",e),e}const qn=1;function Bn(t){const{spanId:n,traceId:e}=t.spanContext(),{parent_span_id:r}=zn(t);return W({parent_span_id:r,span_id:n,trace_id:e})}function Hn(t){return"number"==typeof t?Wn(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Wn(t.getTime()):ft()}function Wn(t){return t>9999999999?t/1e3:t}function zn(t){if(function(t){return"function"==typeof t.getSpanJSON}(t))return t.getSpanJSON();try{const{spanId:n,traceId:e}=t.spanContext();if(function(t){const n=t;return!!(n.attributes&&n.startTime&&n.name&&n.endTime&&n.status)}(t)){const{attributes:r,startTime:o,name:i,endTime:s,parentSpanId:c,status:u}=t;return W({span_id:n,trace_id:e,data:r,description:i,parent_span_id:c,start_timestamp:Hn(o),timestamp:Hn(s)||void 0,status:Jn(u),op:r[Rn],origin:r[Dn],G:On(t)})}return{span_id:n,trace_id:e}}catch(t){return{}}}function Xn(t){const{traceFlags:n}=t.spanContext();return n===qn}function Jn(t){if(t&&t.code!==An)return t.code===Nn?"ok":t.message||"unknown_error"}const Gn="_sentryRootSpan";function Kn(t){return t[Gn]||t}function Vn(){const t=In(cn());return t.getActiveSpan?t.getActiveSpan():dn(gn())}function Yn(t,n,e,r,o,i){const s=Vn();s&&function(t,n,e,r,o,i,s){const c=Tn(t)||new Map,u=`${n}:${e}@${o}`,a=c.get(s);if(a){const[,t]=a;c.set(s,[u,{min:Math.min(t.min,r),max:Math.max(t.max,r),count:t.count+=1,sum:t.sum+=r,tags:t.tags}])}else c.set(s,[u,{min:r,max:r,count:1,sum:r,tags:i}]);jn||(jn=new WeakMap),jn.set(t,c)}(s,t,n,e,r,o,i)}function Qn(t,n,e,r){const o=Qt(e),i=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,n){n&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||n.name,t.sdk.version=t.sdk.version||n.version,t.sdk.integrations=[...t.sdk.integrations||[],...n.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...n.packages||[]])}(t,e&&e.sdk);const s=function(t,n,e,r){const o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&{sdk:n},...!!e&&r&&{dsn:R(r)},...o&&{trace:W({...o})}}}(t,o,r,n);delete t.sdkProcessingMetadata;return Wt(s,[[{type:i},t]])}function Zn(t,n,e,r=0){return new Mt(((o,i)=>{const s=t[r];if(null===n||"function"!=typeof s)o(n);else{const c=s({...n},e);h(c)?c.then((n=>Zn(t,n,e,r+1).then(o))).then(null,i):Zn(t,c,e,r+1).then(o).then(null,i)}}))}function te(t,n){const{fingerprint:e,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=n;!function(t,n){const{extra:e,tags:r,user:o,contexts:i,level:s,transactionName:c}=n,u=W(e);u&&Object.keys(u).length&&(t.extra={...u,...t.extra});const a=W(r);a&&Object.keys(a).length&&(t.tags={...a,...t.tags});const f=W(o);f&&Object.keys(f).length&&(t.user={...f,...t.user});const h=W(i);h&&Object.keys(h).length&&(t.contexts={...h,...t.contexts});s&&(t.level=s);c&&"transaction"!==t.type&&(t.transaction=c)}(t,n),r&&function(t,n){t.contexts={trace:Bn(n),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Fn(n),...t.sdkProcessingMetadata};const e=Kn(n),r=zn(e).description;r&&!t.transaction&&"transaction"===t.type&&(t.transaction=r)}(t,r),function(t,n){t.fingerprint=t.fingerprint?St(t.fingerprint):[],n&&(t.fingerprint=t.fingerprint.concat(n));t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}(t,e),function(t,n){const e=[...t.breadcrumbs||[],...n];t.breadcrumbs=e.length?e:void 0}(t,o),function(t,n){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...n}}(t,i)}function ne(t,n){const{extra:e,tags:r,user:o,contexts:i,level:s,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:a,eventProcessors:f,attachments:h,propagationContext:l,transactionName:d,span:p}=n;ee(t,"extra",e),ee(t,"tags",r),ee(t,"user",o),ee(t,"contexts",i),ee(t,"sdkProcessingMetadata",c),s&&(t.level=s),d&&(t.transactionName=d),p&&(t.span=p),u.length&&(t.breadcrumbs=[...t.breadcrumbs,...u]),a.length&&(t.fingerprint=[...t.fingerprint,...a]),f.length&&(t.eventProcessors=[...t.eventProcessors,...f]),h.length&&(t.attachments=[...t.attachments,...h]),t.propagationContext={...t.propagationContext,...l}}function ee(t,n,e){if(e&&Object.keys(e).length){t[n]={...t[n]};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[n][r]=e[r])}}function re(t,n,e,r,o,i){const{normalizeDepth:s=3,normalizeMaxBreadth:c=1e3}=t,u={...n,event_id:n.event_id||e.event_id||vt(),timestamp:n.timestamp||at()},a=e.integrations||t.integrations.map((t=>t.name));!function(t,n){const{environment:e,release:r,dist:o,maxValueLength:i=250}=n;"environment"in t||(t.environment="environment"in n?e:Ln);void 0===t.release&&void 0!==r&&(t.release=r);void 0===t.dist&&void 0!==o&&(t.dist=o);t.message&&(t.message=p(t.message,i));const s=t.exception&&t.exception.values&&t.exception.values[0];s&&s.value&&(s.value=p(s.value,i));const c=t.request;c&&c.url&&(c.url=p(c.url,i))}(u,t),function(t,n){n.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...n])}(u,a),void 0===n.type&&function(t,n){const e=$._sentryDebugIds;if(!e)return;let r;const o=oe.get(n);o?r=o:(r=new Map,oe.set(n,r));const i=Object.keys(e).reduce(((t,o)=>{let i;const s=r.get(o);s?i=s:(i=n(o),r.set(o,i));for(let n=i.length-1;n>=0;n--){const r=i[n];if(r.filename){t[r.filename]=e[o];break}}return t}),{});try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.filename&&(t.debug_id=i[t.filename])}))}))}catch(t){}}(u,t.stackParser);const f=function(t,n){if(!n)return t;const e=t?t.clone():new mn;return e.update(n),e}(r,e.captureContext);e.mechanism&&$t(u,e.mechanism);const h=o?o.getEventProcessors():[],l=bn().getScopeData();if(i){ne(l,i.getScopeData())}if(f){ne(l,f.getScopeData())}const d=[...e.attachments||[],...l.attachments];d.length&&(e.attachments=d),te(u,l);return Zn([...h,...l.eventProcessors],u,e).then((t=>(t&&function(t){const n={};try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.debug_id&&(t.abs_path?n[t.abs_path]=t.debug_id:t.filename&&(n[t.filename]=t.debug_id),delete t.debug_id)}))}))}catch(t){}if(0===Object.keys(n).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const e=t.debug_meta.images;Object.keys(n).forEach((t=>{e.push({type:"sourcemap",code_file:t,debug_id:n[t]})}))}(t),"number"==typeof s&&s>0?function(t,n,e){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((t=>({...t,...t.data&&{data:xt(t.data,n,e)}})))},...t.user&&{user:xt(t.user,n,e)},...t.contexts&&{contexts:xt(t.contexts,n,e)},...t.extra&&{extra:xt(t.extra,n,e)}};t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=xt(t.contexts.trace.data,n,e)));t.spans&&(r.spans=t.spans.map((t=>({...t,...t.data&&{data:xt(t.data,n,e)}}))));return r}(t,s,c):t)))}const oe=new WeakMap;function ie(t){if(t)return function(t){return t instanceof mn||"function"==typeof t}(t)||function(t){return Object.keys(t).some((t=>se.includes(t)))}(t)?{captureContext:t}:t}const se=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function captureException(t,n){return gn().captureException(t,ie(n))}function ce(t,n){return gn().captureEvent(t,n)}function ue(t,n){vn().setContext(t,n)}function ae(t){vn().setExtras(t)}function fe(t,n){vn().setExtra(t,n)}function he(t){vn().setTags(t)}function le(t,n){vn().setTag(t,n)}function de(t){vn().setUser(t)}function pe(){return vn().lastEventId()}function me(t){const n=wn(),e=vn(),r=gn(),{release:o,environment:i=Ln}=n&&n.getOptions()||{},{userAgent:s}=$.navigator||{},c=an({release:o,environment:i,user:r.getUser()||e.getUser(),...s&&{userAgent:s},...t}),u=e.getSession();return u&&"ok"===u.status&&fn(u,{status:"exited"}),ye(),e.setSession(c),r.setSession(c),c}function ye(){const t=vn(),n=gn(),e=n.getSession()||t.getSession();e&&function(t,n){let e={};n?e={status:n}:"ok"===t.status&&(e={status:"exited"}),fn(t,e)}(e),ge(),t.setSession(),n.setSession()}function ge(){const t=vn(),n=gn(),e=wn(),r=n.getSession()||t.getSession();r&&e&&e.captureSession(r)}function ve(t=!1){t?ye():ge()}const be="7";function _e(t){const n=t.protocol?`${t.protocol}:`:"",e=t.port?`:${t.port}`:"";return`${n}//${t.host}${e}${t.path?`/${t.path}`:""}/api/`}function we(t,n){return e={sentry_key:t.publicKey,sentry_version:be,...n&&{sentry_client:`${n.name}/${n.version}`}},Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&");var e}function $e(t,n,e){return n||`${function(t){return`${_e(t)}${t.projectId}/envelope/`}(t)}?${we(t,e)}`}const Ee=[];function Se(t){const n=t.defaultIntegrations||[],e=t.integrations;let r;n.forEach((t=>{t.isDefaultInstance=!0})),r=Array.isArray(e)?[...n,...e]:"function"==typeof e?St(e(n)):n;const o=function(t){const n={};return t.forEach((t=>{const{name:e}=t,r=n[e];r&&!r.isDefaultInstance&&t.isDefaultInstance||(n[e]=t)})),Object.keys(n).map((t=>n[t]))}(r),i=function(t,n){for(let e=0;e"Debug"===t.name));if(-1!==i){const[t]=o.splice(i,1);o.push(t)}return o}function xe(t,n){for(const e of n)e&&e.afterAllSetup&&e.afterAllSetup(t)}function ke(t,n,e){if(!e[n.name]){if(e[n.name]=n,-1===Ee.indexOf(n.name)&&"function"==typeof n.setupOnce&&(n.setupOnce(),Ee.push(n.name)),n.setup&&"function"==typeof n.setup&&n.setup(t),"function"==typeof n.preprocessEvent){const e=n.preprocessEvent.bind(n);t.on("preprocessEvent",((n,r)=>e(n,r,t)))}if("function"==typeof n.processEvent){const e=n.processEvent.bind(n),r=Object.assign(((n,r)=>e(n,r,t)),{id:n.name});t.addEventProcessor(r)}}}class Ie{constructor(t){if(this.K=t,this._integrations={},this.V=0,this.Y={},this.Z={},this.k=[],t.dsn&&(this.tt=A(t.dsn)),this.tt){const n=$e(this.tt,t.tunnel,t.nt?t.nt.sdk:void 0);this.et=t.transport({tunnel:this.K.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:n})}}captureException(t,n,e){const r=vt();if(Et(t))return r;const o={event_id:r,...n};return this.rt(this.eventFromException(t,o).then((t=>this.ot(t,o,e)))),o.event_id}captureMessage(t,n,e,r){const o={event_id:vt(),...e},i=c(t)?t:String(t),s=u(t)?this.eventFromMessage(i,n,o):this.eventFromException(t,o);return this.rt(s.then((t=>this.ot(t,o,r)))),o.event_id}captureEvent(t,n,e){const r=vt();if(n&&n.originalException&&Et(n.originalException))return r;const o={event_id:r,...n},i=(t.sdkProcessingMetadata||{}).capturedSpanScope;return this.rt(this.ot(t,o,i||e)),o.event_id}captureSession(t){"string"!=typeof t.release||(this.sendSession(t),fn(t,{init:!1}))}getDsn(){return this.tt}getOptions(){return this.K}getSdkMetadata(){return this.K.nt}getTransport(){return this.et}flush(t){const n=this.et;return n?(this.emit("flush"),this.it(t).then((e=>n.flush(t).then((t=>e&&t))))):Tt(!0)}close(t){return this.flush(t).then((t=>(this.getOptions().enabled=!1,this.emit("close"),t)))}getEventProcessors(){return this.k}addEventProcessor(t){this.k.push(t)}init(){this.st()&&this.ct()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];ke(this,t,this._integrations),n||xe(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let e=Qn(t,this.tt,this.K.nt,this.K.tunnel);for(const t of n.attachments||[])e=zt(e,Kt(t));const r=this.sendEnvelope(e);r&&r.then((n=>this.emit("afterSendEvent",t,n)),null)}sendSession(t){const n=function(t,n,e,r){const o=Qt(e);return Wt({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&n&&{dsn:R(n)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(t,this.tt,this.K.nt,this.K.tunnel);this.sendEnvelope(n)}recordDroppedEvent(t,n,e){if(this.K.sendClientReports){const e=`${t}:${n}`;this.Y[e]=this.Y[e]+1||1}}on(t,n){this.Z[t]||(this.Z[t]=[]),this.Z[t].push(n)}emit(t,...n){this.Z[t]&&this.Z[t].forEach((t=>t(...n)))}sendEnvelope(t){return this.emit("beforeEnvelope",t),this.st()&&this.et?this.et.send(t).then(null,(t=>t)):Tt({})}ct(){const{integrations:t}=this.K;this._integrations=function(t,n){const e={};return n.forEach((n=>{n&&ke(t,n,e)})),e}(this,t),xe(this,t)}ut(t,n){let e=!1,r=!1;const o=n.exception&&n.exception.values;if(o){r=!0;for(const t of o){const n=t.mechanism;if(n&&!1===n.handled){e=!0;break}}}const i="ok"===t.status;(i&&0===t.errors||i&&e)&&(fn(t,{...e&&{status:"crashed"},errors:t.errors||Number(r||e)}),this.captureSession(t))}it(t){return new Mt((n=>{let e=0;const r=setInterval((()=>{0==this.V?(clearInterval(r),n(!0)):(e+=1,t&&e>=t&&(clearInterval(r),n(!1)))}),1)}))}st(){return!1!==this.getOptions().enabled&&void 0!==this.et}ft(t,n,e,r=vn()){const o=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i.length>0&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||r.setLastEventId(t.event_id||n.event_id),re(o,t,n,e,this,r).then((t=>{if(null===t)return t;const n={...r.getPropagationContext(),...e?e.getPropagationContext():void 0};if(!(t.contexts&&t.contexts.trace)&&n){const{traceId:e,spanId:r,parentSpanId:o,dsc:i}=n;t.contexts={trace:W({trace_id:e,span_id:r,parent_span_id:o}),...t.contexts};const s=i||Un(e,this);t.sdkProcessingMetadata={dynamicSamplingContext:s,...t.sdkProcessingMetadata}}return t}))}ot(t,n={},e){return this.ht(t,n,e).then((t=>t.event_id),(t=>{}))}ht(t,n,e){const r=this.getOptions(),{sampleRate:o}=r,i=Te(t),s=je(t),c=t.type||"error",u=`before send for type \`${c}\``,f=void 0===o?void 0:function(t){if("boolean"==typeof t)return Number(t);const n="string"==typeof t?parseFloat(t):t;return"number"!=typeof n||isNaN(n)||n<0||n>1?void 0:n}(o);if(s&&"number"==typeof f&&Math.random()>f)return this.recordDroppedEvent("sample_rate","error",t),Ot(new N(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const l="replay_event"===c?"replay":c,d=(t.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this.ft(t,n,e,d).then((e=>{if(null===e)throw this.recordDroppedEvent("event_processor",l,t),new N("An event processor returned `null`, will not send event.","log");if(n.data&&!0===n.data.__sentry__)return e;const o=function(t,n,e){const{beforeSend:r,beforeSendTransaction:o,beforeSendSpan:i}=t;if(je(n)&&r)return r(n,e);if(Te(n)){if(n.spans&&i){const t=[];for(const e of n.spans){const n=i(e);n&&t.push(n)}n.spans=t}if(o)return o(n,e)}return n}(r,e,n);return function(t,n){const e=`${n} must return \`null\` or a valid event.`;if(h(t))return t.then((t=>{if(!a(t)&&null!==t)throw new N(e);return t}),(t=>{throw new N(`${n} rejected with ${t}`)}));if(!a(t)&&null!==t)throw new N(e);return t}(o,u)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",l,t),new N(`${u} returned \`null\`, will not send event.`,"log");const o=e&&e.getSession();!i&&o&&this.ut(o,r);const s=r.transaction_info;if(i&&s&&r.transaction!==t.transaction){const t="custom";r.transaction_info={...s,source:t}}return this.sendEvent(r,n),r})).then(null,(t=>{if(t instanceof N)throw t;throw this.captureException(t,{data:{__sentry__:!0},originalException:t}),new N(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)}))}rt(t){this.V++,t.then((t=>(this.V--,t)),(t=>(this.V--,t)))}lt(){const t=this.Y;return this.Y={},Object.keys(t).map((n=>{const[e,r]=n.split(":");return{reason:e,category:r,quantity:t[n]}}))}}function je(t){return void 0===t.type}function Te(t){return"transaction"===t.type}function Oe(t){gn().setClient(t),function(t){const n=un(cn());n.hub&&"function"==typeof n.hub.getStackTop&&(n.hub.getStackTop().client=t)}(t)}const Me=64;function Ce(t,n,e=Ct(t.bufferSize||Me)){let r={};return{send:function(o){const i=[];if(Xt(o,((n,e)=>{const o=Yt(e);if(function(t,n,e=Date.now()){return function(t,n){return t[n]||t.all||0}(t,n)>e}(r,o)){const r=Re(n,e);t.recordDroppedEvent("ratelimit_backoff",o,r)}else i.push(n)})),0===i.length)return Tt({});const s=Wt(o[0],i),c=n=>{Xt(s,((e,r)=>{const o=Re(e,r);t.recordDroppedEvent(n,Yt(r),o)}))};return e.add((()=>n({body:Gt(s)}).then((t=>(r=tn(r,t),t)),(t=>{throw c("network_error"),t})))).then((t=>t),(t=>{if(t instanceof N)return c("queue_overflow"),Tt({});throw t}))},flush:t=>e.drain(t)}}function Re(t,n){if("event"===n||"transaction"===n)return Array.isArray(t)?t[1]:void 0}const De="8.2.1";const Ae=100;function Ne(t,n){const e=wn(),r=vn();if(!e)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Ae}=e.getOptions();if(i<=0)return;const s={timestamp:at(),...t},c=o?O((()=>o(s,n))):s;null!==c&&(e.emit&&e.emit("beforeAddBreadcrumb",c,n),r.addBreadcrumb(c,i))}let Le;const Pe=new WeakMap,Ue=()=>({name:"FunctionToString",setupOnce(){Le=Function.prototype.toString;try{Function.prototype.toString=function(...t){const n=F(this),e=Pe.has(wn())&&void 0!==n?n:this;return Le.apply(e,t)}}catch(t){}},setup(t){Pe.set(t,!0)}}),Fe=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],qe=(t={})=>({name:"InboundFilters",processEvent(n,e,r){const o=r.getOptions(),i=function(t={},n={}){return{allowUrls:[...t.allowUrls||[],...n.allowUrls||[]],denyUrls:[...t.denyUrls||[],...n.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...n.ignoreErrors||[],...t.disableErrorDefaults?[]:Fe],ignoreTransactions:[...t.ignoreTransactions||[],...n.ignoreTransactions||[]],ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(t,o);return function(t,n){if(n.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(t){}return!1}(t))return!0;if(function(t,n){if(t.type||!n||!n.length)return!1;return function(t){const n=[];t.message&&n.push(t.message);let e;try{e=t.exception.values[t.exception.values.length-1]}catch(t){}e&&e.value&&(n.push(e.value),e.type&&n.push(`${e.type}: ${e.value}`));return n}(t).some((t=>g(t,n)))}(t,n.ignoreErrors))return!0;if(function(t,n){if("transaction"!==t.type||!n||!n.length)return!1;const e=t.transaction;return!!e&&g(e,n)}(t,n.ignoreTransactions))return!0;if(function(t,n){if(!n||!n.length)return!1;const e=Be(t);return!!e&&g(e,n)}(t,n.denyUrls))return!0;if(!function(t,n){if(!n||!n.length)return!0;const e=Be(t);return!e||g(e,n)}(t,n.allowUrls))return!0;return!1}(n,i)?null:n}});function Be(t){try{let n;try{n=t.exception.values[0].stacktrace.frames}catch(t){}return n?function(t=[]){for(let n=t.length-1;n>=0;n--){const e=t[n];if(e&&""!==e.filename&&"[native code]"!==e.filename)return e.filename||null}return null}(n):null}catch(t){return null}}const He=()=>{let t;return{name:"Dedupe",processEvent(n){if(n.type)return n;try{if(function(t,n){if(!n)return!1;if(function(t,n){const e=t.message,r=n.message;if(!e&&!r)return!1;if(e&&!r||!e&&r)return!1;if(e!==r)return!1;if(!ze(t,n))return!1;if(!We(t,n))return!1;return!0}(t,n))return!0;if(function(t,n){const e=Xe(n),r=Xe(t);if(!e||!r)return!1;if(e.type!==r.type||e.value!==r.value)return!1;if(!ze(t,n))return!1;if(!We(t,n))return!1;return!0}(t,n))return!0;return!1}(n,t))return null}catch(t){}return t=n}}};function We(t,n){let e=Je(t),r=Je(n);if(!e&&!r)return!0;if(e&&!r||!e&&r)return!1;if(r.length!==e.length)return!1;for(let t=0;tnew WeakMap)),r=e.get(t);if(r)return r;const o=new n(t);return t.on("flush",(()=>o.flush())),t.on("close",(()=>o.close())),e.set(t,o),o}function Ke(t,n,e,r,o={}){const i=o.client||wn();if(!i)return;const s=Vn(),c=s?Kn(s):void 0,{unit:u,tags:a,timestamp:f}=o,{release:h,environment:l}=i.getOptions(),d={};h&&(d.release=h),l&&(d.environment=l),c&&(d.transaction=zn(c).description||"");Ge(i,t).add(n,e,r,u,{...d,...a},f)}const Ve={increment:function(t,n,e=1,r){Ke(t,"c",n,e,r)},distribution:function(t,n,e,r){Ke(t,"d",n,e,r)},set:function(t,n,e,r){Ke(t,"s",n,e,r)},gauge:function(t,n,e,r){Ke(t,"g",n,e,r)},getMetricsAggregatorForClient:Ge};function Ye(t){return t.replace(/[^\w\-./]+/gi,"")}const Qe=[["\n","\\n"],["\r","\\r"],["\t","\\t"],["\\","\\\\"],["|","\\u{7c}"],[",","\\u{2c}"]];function Ze(t){return[...t].reduce(((t,n)=>t+function(t){for(const[n,e]of Qe)if(t===n)return e;return t}(n)),"")}function tr(t,n){M.log(`Flushing aggregated metrics, number of metrics: ${n.length}`);const e=function(t,n,e,r){const o={sent_at:(new Date).toISOString()};e&&e.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version});r&&n&&(o.dsn=R(n));const i=function(t){const n=function(t){let n="";for(const e of t){const t=Object.entries(e.tags),r=t.length>0?`|#${t.map((([t,n])=>`${t}:${n}`)).join(",")}`:"";n+=`${e.name}@${e.unit}:${e.metric}|${e.metricType}${r}|T${e.timestamp}\n`}return n}(t);return[{type:"statsd",length:n.length},n]}(t);return Wt(o,[i])}(n,t.getDsn(),t.getSdkMetadata(),t.getOptions().tunnel);t.sendEnvelope(e)}const nr={c:class{constructor(t){this.v=t}get weight(){return 1}add(t){this.v+=t}toString(){return`${this.v}`}},g:class{constructor(t){this.dt=t,this.yt=t,this.gt=t,this.vt=t,this.bt=1}get weight(){return 5}add(t){this.dt=t,tthis.gt&&(this.gt=t),this.vt+=t,this.bt++}toString(){return`${this.dt}:${this.yt}:${this.gt}:${this.vt}:${this.bt}`}},d:class{constructor(t){this.v=[t]}get weight(){return this.v.length}add(t){this.v.push(t)}toString(){return this.v.join(":")}},s:class{constructor(t){this.first=t,this.v=new Set([t])}get weight(){return this.v.size}add(t){this.v.add(t)}toString(){return Array.from(this.v).map((t=>"string"==typeof t?function(t){let n=0;for(let e=0;e>>0}(t):t)).join(":")}}};class er{constructor(t){this.F=t,this._t=new Map,this.wt=setInterval((()=>this.flush()),5e3)}add(t,n,e,r="none",o={},i=ft()){const s=Math.floor(i),c=n.replace(/[^\w\-.]+/gi,"_");const u=function(t){const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[Ye(e)]=Ze(String(t[e])));return n}(o),a=function(t){return t.replace(/[^\w]+/gi,"_")}(r),f=function(t,n,e,r){return`${t}${n}${e}${Object.entries(W(r)).sort(((t,n)=>t[0].localeCompare(n[0])))}`}(t,c,a,u);let h=this._t.get(f);const l=h&&"s"===t?h.metric.weight:0;h?(h.metric.add(e),h.timestampwn(),getScope:gn,getIsolationScope:vn,captureException:(t,n)=>gn().captureException(t,n),captureMessage:(t,n,e)=>gn().captureMessage(t,n,e),captureEvent:ce,addBreadcrumb:Ne,setUser:de,setTags:he,setTag:le,setExtra:fe,setExtras:ae,setContext:ue,getIntegration(t){const n=wn();return n&&n.getIntegrationByName(t.id)||null},startSession:me,endSession:ye,captureSession(t){if(t)return ye();!function(){const t=gn(),n=wn(),e=t.getSession();n&&e&&n.captureSession(e)}()}}};const or=t=>(O((()=>{console.warn("You are using browserTracingIntegration() even though this bundle does not include tracing.")})),{name:"BrowserTracing"});const ir={increment:function(t,n=1,e){Ve.increment(er,t,n,e)},distribution:function(t,n,e){Ve.distribution(er,t,n,e)},set:function(t,n,e){Ve.set(er,t,n,e)},gauge:function(t,n,e){Ve.gauge(er,t,n,e)}},sr=$;let cr=0;function ur(){return cr>0}function ar(t,n={},e){if("function"!=typeof t)return t;try{const n=t.__sentry_wrapped__;if(n)return n;if(F(t))return t}catch(n){return t}const sentryWrapped=function(){const r=Array.prototype.slice.call(arguments);try{e&&"function"==typeof e&&e.apply(this,arguments);const o=r.map((t=>ar(t,n)));return t.apply(this,o)}catch(t){throw cr++,setTimeout((()=>{cr--})),_n((e=>{e.addEventProcessor((t=>(n.mechanism&&(wt(t,void 0,void 0),$t(t,n.mechanism)),t.extra={...t.extra,arguments:r},t))),captureException(t)})),t}};try{for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(sentryWrapped[n]=t[n])}catch(t){}U(sentryWrapped,t),P(t,"__sentry_wrapped__",sentryWrapped);try{Object.getOwnPropertyDescriptor(sentryWrapped,"name").configurable&&Object.defineProperty(sentryWrapped,"name",{get:()=>t.name})}catch(t){}return sentryWrapped}function fr(t,n){const e=dr(t,n),r={type:n&&n.name,value:mr(n)};return e.length&&(r.stacktrace={frames:e}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function hr(t,n,e,r){const o=wn(),i=o&&o.getOptions().normalizeDepth,s=function(t){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const e=t[n];if(e instanceof Error)return e}return}(n),c={__serialized__:kt(n,i)};if(s)return{exception:{values:[fr(t,s)]},extra:c};const u={exception:{values:[{type:f(n)?n.constructor.name:r?"UnhandledRejection":"Error",value:_r(n,{isUnhandledRejection:r})}]},extra:c};if(e){const n=dr(t,e);n.length&&(u.exception.values[0].stacktrace={frames:n})}return u}function lr(t,n){return{exception:{values:[fr(t,n)]}}}function dr(t,n){const e=n.stacktrace||n.stack||"",r=function(t){if(t&&pr.test(t.message))return 1;return 0}(n),o=function(t){if("number"==typeof t.framesToPop)return t.framesToPop;return 0}(n);try{return t(e,r,o)}catch(t){}return[]}const pr=/Minified React error #\d+;/i;function mr(t){const n=t&&t.message;return n?n.error&&"string"==typeof n.error.message?n.error.message:n:"No error message"}function yr(t,n,e,r){const o=vr(t,n,e&&e.syntheticException||void 0,r);return $t(o),o.level="error",e&&e.event_id&&(o.event_id=e.event_id),Tt(o)}function gr(t,n,e="info",r,o){const i=br(t,n,r&&r.syntheticException||void 0,o);return i.level=e,r&&r.event_id&&(i.event_id=r.event_id),Tt(i)}function vr(t,n,s,c,u){let h;if(o(n)&&n.error){return lr(t,n.error)}if(i(n)||r(n,"DOMException")){const e=n;if("stack"in n)h=lr(t,n);else{const n=e.name||(i(e)?"DOMError":"DOMException"),r=e.message?`${n}: ${e.message}`:n;h=br(t,r,s,c),wt(h,r)}return"code"in e&&(h.tags={...h.tags,"DOMException.code":`${e.code}`}),h}if(e(n))return lr(t,n);if(a(n)||f(n)){return h=hr(t,n,s,u),$t(h,{synthetic:!0}),h}return h=br(t,n,s,c),wt(h,`${n}`,void 0),$t(h,{synthetic:!0}),h}function br(t,n,e,r){const o={};if(r&&e){const r=dr(t,e);r.length&&(o.exception={values:[{value:n,stacktrace:{frames:r}}]})}if(c(n)){const{__sentry_template_string__:t,__sentry_template_values__:e}=n;return o.logentry={message:t,params:e},o}return o.message=n,o}function _r(t,{isUnhandledRejection:n}){const e=function(t,n=40){const e=Object.keys(q(t));if(e.sort(),!e.length)return"[object has no keys]";if(e[0].length>=n)return p(e[0],n);for(let t=e.length;t>0;t--){const r=e.slice(0,t).join(", ");if(!(r.length>n))return t===e.length?r:p(r,n)}return""}(t),r=n?"promise rejection":"exception";if(o(t))return`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``;if(f(t)){return`Event \`${function(t){try{const n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch(t){}}(t)}\` (type=${t.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${e}`}function wr(t,{metadata:n,tunnel:e,dsn:r}){const o={event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&n.sdk&&{sdk:{name:n.sdk.name,version:n.sdk.version}},...!!e&&!!r&&{dsn:R(r)}},i=function(t){return[{type:"user_report"},t]}(t);return Wt(o,[i])}class $r extends Ie{constructor(t){const n={parentSpanIsAlwaysRootSpan:!0,...t};!function(t,n,e=[n],r="npm"){const o=t.nt||{};o.sdk||(o.sdk={name:`sentry.javascript.${n}`,packages:e.map((t=>({name:`${r}:@sentry/${t}`,version:De}))),version:De}),t.nt=o}(n,"browser",["browser"],sr.SENTRY_SDK_SOURCE||"npm"),super(n),n.sendClientReports&&sr.document&&sr.document.addEventListener("visibilitychange",(()=>{"hidden"===sr.document.visibilityState&&this.$t()}))}eventFromException(t,n){return yr(this.K.stackParser,t,n,this.K.attachStacktrace)}eventFromMessage(t,n="info",e){return gr(this.K.stackParser,t,n,e,this.K.attachStacktrace)}captureUserFeedback(t){if(!this.st())return;const n=wr(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}ft(t,n,e){return t.platform=t.platform||"javascript",super.ft(t,n,e)}$t(){const t=this.lt();if(0===t.length)return;if(!this.tt)return;const n=(e=t,Wt((r=this.K.tunnel&&R(this.tt))?{dsn:r}:{},[[{type:"client_report"},{timestamp:o||at(),discarded_events:e}]]));var e,r,o;this.sendEnvelope(n)}}let Er;function Sr(){Er=void 0}function xr(t,n=function(){if(Er)return Er;if(st(sr.fetch))return Er=sr.fetch.bind(sr);const t=sr.document;let n=sr.fetch;if(t&&"function"==typeof t.createElement)try{const e=t.createElement("iframe");e.hidden=!0,t.head.appendChild(e);const r=e.contentWindow;r&&r.fetch&&(n=r.fetch),t.head.removeChild(e)}catch(t){}try{return Er=n.bind(sr)}catch(t){}}()){let e=0,r=0;return Ce(t,(function(o){const i=o.body.length;e+=i,r++;const s={body:o.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:e<=6e4&&r<15,...t.fetchOptions};if(!n)return Sr(),Ot("No fetch implementation available");try{return n(t.url,s).then((t=>(e-=i,r--,{statusCode:t.status,headers:{"x-sentry-rate-limits":t.headers.get("X-Sentry-Rate-Limits"),"retry-after":t.headers.get("Retry-After")}})))}catch(t){return Sr(),e-=i,r--,Ot(t)}}))}function kr(t,n,e,r){const o={filename:t,function:""===n?J:n,in_app:!0};return void 0!==e&&(o.lineno=e),void 0!==r&&(o.colno=r),o}const Ir=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,jr=/\((\S*)(?::(\d+))(?::(\d+))\)/,Tr=[30,t=>{const n=Ir.exec(t);if(n){if(n[2]&&0===n[2].indexOf("eval")){const t=jr.exec(n[2]);t&&(n[2]=t[1],n[3]=t[2],n[4]=t[3])}const[t,e]=qr(n[1]||J,n[2]);return kr(e,t,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],Or=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Mr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Cr=[50,t=>{const n=Or.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=Mr.exec(n[3]);t&&(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]="")}let t=n[3],e=n[1]||J;return[e,t]=qr(e,t),kr(t,e,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}}],Rr=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Dr=[40,t=>{const n=Rr.exec(t);return n?kr(n[2],n[1]||J,+n[3],n[4]?+n[4]:void 0):void 0}],Ar=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,Nr=[10,t=>{const n=Ar.exec(t);return n?kr(n[2],n[3]||J,+n[1]):void 0}],Lr=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,Pr=[20,t=>{const n=Lr.exec(t);return n?kr(n[5],n[3]||n[4]||J,+n[1],+n[2]):void 0}],Ur=[Tr,Cr],Fr=V(...Ur),qr=(t,n)=>{const e=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return e||r?[-1!==t.indexOf("@")?t.split("@")[0]:J,e?`safari-extension:${n}`:`safari-web-extension:${n}`]:[t,n]},Br=$,Hr=1e3;let Wr,zr,Xr,Jr;function Gr(){if(!Br.document)return;const t=rt.bind(null,"dom"),n=Kr(t,!0);Br.document.addEventListener("click",n,!1),Br.document.addEventListener("keypress",n,!1),["EventTarget","Node"].forEach((n=>{const e=Br[n]&&Br[n].prototype;e&&e.hasOwnProperty&&e.hasOwnProperty("addEventListener")&&(L(e,"addEventListener",(function(n){return function(e,r,o){if("click"===e||"keypress"==e)try{const r=this,i=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},s=i[e]=i[e]||{refCount:0};if(!s.handler){const r=Kr(t);s.handler=r,n.call(this,e,r,o)}s.refCount++}catch(t){}return n.call(this,e,r,o)}})),L(e,"removeEventListener",(function(t){return function(n,e,r){if("click"===n||"keypress"==n)try{const e=this,o=e.__sentry_instrumentation_handlers__||{},i=o[n];i&&(i.refCount--,i.refCount<=0&&(t.call(this,n,i.handler,r),i.handler=void 0,delete o[n]),0===Object.keys(o).length&&delete e.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,n,e,r)}})))}))}function Kr(t,n=!1){return e=>{if(!e||e._sentryCaptured)return;const r=function(t){try{return t.target}catch(t){return null}}(e);if(function(t,n){return"keypress"===t&&(!n||!n.tagName||"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable)}(e.type,r))return;P(e,"_sentryCaptured",!0),r&&!r._sentryId&&P(r,"_sentryId",vt());const o="keypress"===e.type?"input":e.type;if(!function(t){if(t.type!==zr)return!1;try{if(!t.target||t.target._sentryId!==Xr)return!1}catch(t){}return!0}(e)){t({event:e,name:o,global:n}),zr=e.type,Xr=r?r._sentryId:void 0}clearTimeout(Wr),Wr=Br.setTimeout((()=>{Xr=void 0,zr=void 0}),Hr)}}function Vr(t){const n="history";nt(n,t),et(n,Yr)}function Yr(){if(!function(){const t=nn.chrome,n=t&&t.app&&t.app.runtime,e="history"in nn&&!!nn.history.pushState&&!!nn.history.replaceState;return!n&&e}())return;const t=Br.onpopstate;function n(t){return function(...n){const e=n.length>2?n[2]:void 0;if(e){const t=Jr,n=String(e);Jr=n;rt("history",{from:t,to:n})}return t.apply(this,n)}}Br.onpopstate=function(...n){const e=Br.location.href,r=Jr;Jr=e;if(rt("history",{from:r,to:e}),t)try{return t.apply(this,n)}catch(t){}},L(Br.history,"pushState",n),L(Br.history,"replaceState",n)}const Qr="__sentry_xhr_v3__";function Zr(){if(!Br.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;L(t,"open",(function(t){return function(...n){const e=1e3*ft(),r=s(n[0])?n[0].toUpperCase():void 0,o=function(t){if(s(t))return t;try{return t.toString()}catch(t){}return}(n[1]);if(!r||!o)return t.apply(this,n);this[Qr]={method:r,url:o,request_headers:{}},"POST"===r&&o.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const i=()=>{const t=this[Qr];if(t&&4===this.readyState){try{t.status_code=this.status}catch(t){}rt("xhr",{endTimestamp:1e3*ft(),startTimestamp:e,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?L(this,"onreadystatechange",(function(t){return function(...n){return i(),t.apply(this,n)}})):this.addEventListener("readystatechange",i),L(this,"setRequestHeader",(function(t){return function(...n){const[e,r]=n,o=this[Qr];return o&&s(e)&&s(r)&&(o.request_headers[e.toLowerCase()]=r),t.apply(this,n)}})),t.apply(this,n)}})),L(t,"send",(function(t){return function(...n){const e=this[Qr];if(!e)return t.apply(this,n);void 0!==n[0]&&(e.body=n[0]);return rt("xhr",{startTimestamp:1e3*ft(),xhr:this}),t.apply(this,n)}}))}const to=1024,no=(t={})=>{const n={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:"Breadcrumbs",setup(t){var e;n.console&&function(t){const n="console";nt(n,t),et(n,ot)}(function(t){return function(n){if(wn()!==t)return;const e={category:"console",data:{arguments:n.args,logger:"console"},level:At(n.level),message:m(n.args," ")};if("assert"===n.level){if(!1!==n.args[0])return;e.message=`Assertion failed: ${m(n.args.slice(1)," ")||"console.assert"}`,e.data.arguments=n.args.slice(1)}Ne(e,{input:n.args,level:n.level})}}(t)),n.dom&&(e=function(t,n){return function(e){if(wn()!==t)return;let r,o,i="object"==typeof n?n.serializeAttribute:void 0,s="object"==typeof n&&"number"==typeof n.maxStringLength?n.maxStringLength:void 0;s&&s>to&&(s=to),"string"==typeof i&&(i=[i]);try{const t=e.event,n=function(t){return!!t&&!!t.target}(t)?t.target:t;r=k(n,{keyAttrs:i,maxStringLength:s}),o=function(t){if(!S.HTMLElement)return null;let n=t;for(let t=0;t<5;t++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}(n)}catch(t){r=""}if(0===r.length)return;const c={category:`ui.${e.name}`,message:r};o&&(c.data={"ui.component_name":o}),Ne(c,{event:e.event,name:e.name,global:e.global})}}(t,n.dom),nt("dom",e),et("dom",Gr)),n.xhr&&function(t){nt("xhr",t),et("xhr",Zr)}(function(t){return function(n){if(wn()!==t)return;const{startTimestamp:e,endTimestamp:r}=n,o=n.xhr[Qr];if(!e||!r||!o)return;const{method:i,url:s,status_code:c,body:u}=o;Ne({category:"xhr",data:{method:i,url:s,status_code:c},type:"http"},{xhr:n.xhr,input:u,startTimestamp:e,endTimestamp:r})}}(t)),n.fetch&&function(t){const n="fetch";nt(n,t),et(n,ht)}(function(t){return function(n){if(wn()!==t)return;const{startTimestamp:e,endTimestamp:r}=n;if(r&&(!n.fetchData.url.match(/sentry_key/)||"POST"!==n.fetchData.method))if(n.error){Ne({category:"fetch",data:n.fetchData,level:"error",type:"http"},{data:n.error,input:n.args,startTimestamp:e,endTimestamp:r})}else{const t=n.response;Ne({category:"fetch",data:{...n.fetchData,status_code:t&&t.status},type:"http"},{input:n.args,response:t,startTimestamp:e,endTimestamp:r})}}}(t)),n.history&&Vr(function(t){return function(n){if(wn()!==t)return;let e=n.from,r=n.to;const o=Rt(sr.location.href);let i=e?Rt(e):void 0;const s=Rt(r);i&&i.path||(i=o),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),o.protocol===i.protocol&&o.host===i.host&&(e=i.relative),Ne({category:"navigation",data:{from:e,to:r}})}}(t)),n.sentry&&t.on("beforeSendEvent",function(t){return function(n){wn()===t&&Ne({category:"sentry."+("transaction"===n.type?"transaction":"event"),event_id:n.event_id,level:n.level,message:_t(n)},{event:n})}}(t))}}};const eo=["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"],ro=(t={})=>{const n={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:"BrowserApiErrors",setupOnce(){n.setTimeout&&L(sr,"setTimeout",oo),n.setInterval&&L(sr,"setInterval",oo),n.requestAnimationFrame&&L(sr,"requestAnimationFrame",io),n.XMLHttpRequest&&"XMLHttpRequest"in sr&&L(XMLHttpRequest.prototype,"send",so);const t=n.eventTarget;if(t){(Array.isArray(t)?t:eo).forEach(co)}}}};function oo(t){return function(...n){const e=n[0];return n[0]=ar(e,{mechanism:{data:{function:Q(t)},handled:!1,type:"instrument"}}),t.apply(this,n)}}function io(t){return function(n){return t.apply(this,[ar(n,{mechanism:{data:{function:"requestAnimationFrame",handler:Q(t)},handled:!1,type:"instrument"}})])}}function so(t){return function(...n){const e=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((t=>{t in e&&"function"==typeof e[t]&&L(e,t,(function(n){const e={mechanism:{data:{function:t,handler:Q(n)},handled:!1,type:"instrument"}},r=F(n);return r&&(e.mechanism.data.handler=Q(r)),ar(n,e)}))})),t.apply(this,n)}}function co(t){const n=sr,e=n[t]&&n[t].prototype;e&&e.hasOwnProperty&&e.hasOwnProperty("addEventListener")&&(L(e,"addEventListener",(function(n){return function(e,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=ar(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Q(r),target:t},handled:!1,type:"instrument"}}))}catch(t){}return n.apply(this,[e,ar(r,{mechanism:{data:{function:"addEventListener",handler:Q(r),target:t},handled:!1,type:"instrument"}}),o])}})),L(e,"removeEventListener",(function(t){return function(n,e,r){const o=e;try{const e=o&&o.__sentry_wrapped__;e&&t.call(this,n,e,r)}catch(t){}return t.call(this,n,o,r)}})))}const uo=(t={})=>{const n={onerror:!0,onunhandledrejection:!0,...t};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(t){n.onerror&&function(t){!function(t){const n="error";nt(n,t),et(n,mt)}((n=>{const{stackParser:e,attachStacktrace:r}=ao();if(wn()!==t||ur())return;const{msg:o,url:i,line:c,column:u,error:a}=n,f=function(t,n,e,r){const o=t.exception=t.exception||{},i=o.values=o.values||[],c=i[0]=i[0]||{},u=c.stacktrace=c.stacktrace||{},a=u.frames=u.frames||[],f=isNaN(parseInt(r,10))?void 0:r,h=isNaN(parseInt(e,10))?void 0:e,l=s(n)&&n.length>0?n:function(){try{return S.document.location.href}catch(t){return""}}();0===a.length&&a.push({colno:f,filename:l,function:J,in_app:!0,lineno:h});return t}(vr(e,a||o,void 0,r,!1),i,c,u);f.level="error",ce(f,{originalException:a,mechanism:{handled:!1,type:"onerror"}})}))}(t),n.onunhandledrejection&&function(t){!function(t){const n="unhandledrejection";nt(n,t),et(n,gt)}((n=>{const{stackParser:e,attachStacktrace:r}=ao();if(wn()!==t||ur())return;const o=function(t){if(u(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}(n),i=u(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:vr(e,o,void 0,r,!0);i.level="error",ce(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(t)}}};function ao(){const t=wn();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const fo=()=>({name:"HttpContext",preprocessEvent(t){if(!sr.navigator&&!sr.location&&!sr.document)return;const n=t.request&&t.request.url||sr.location&&sr.location.href,{referrer:e}=sr.document||{},{userAgent:r}=sr.navigator||{},o={...t.request&&t.request.headers,...e&&{Referer:e},...r&&{"User-Agent":r}},i={...t.request,...n&&{url:n},headers:o};t.request=i}}),ho=(t={})=>{const n=t.limit||5,e=t.key||"cause";return{name:"LinkedErrors",preprocessEvent(t,r,o){const i=o.getOptions();v(fr,i.stackParser,i.maxValueLength,e,n,t,r)}}};function lo(t){return[qe(),Ue(),ro(),no(),uo(),ho(),He(),fo()]}const po={replayIntegration:"replay",replayCanvasIntegration:"replay-canvas",feedbackIntegration:"feedback",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot",captureConsoleIntegration:"captureconsole",contextLinesIntegration:"contextlines",linkedErrorsIntegration:"linkederrors",debugIntegration:"debug",dedupeIntegration:"dedupe",extraErrorDataIntegration:"extraerrordata",httpClientIntegration:"httpclient",reportingObserverIntegration:"reportingobserver",rewriteFramesIntegration:"rewriteframes",sessionTimingIntegration:"sessiontiming"},mo=sr;return t.BrowserClient=$r,t.SDK_VERSION=De,t.SEMANTIC_ATTRIBUTE_SENTRY_OP=Rn,t.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN=Dn,t.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE=Cn,t.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE=Mn,t.Scope=mn,t.WINDOW=sr,t.addBreadcrumb=Ne,t.addEventProcessor=function(t){vn().addEventProcessor(t)},t.addIntegration=function(t){const n=wn();n&&n.addIntegration(t)},t.breadcrumbsIntegration=no,t.browserApiErrorsIntegration=ro,t.browserTracingIntegration=or,t.captureEvent=ce,t.captureException=captureException,t.captureMessage=function(t,n){const e="string"==typeof n?n:void 0,r="string"!=typeof n?{captureContext:n}:void 0;return gn().captureMessage(t,e,r)},t.captureSession=ve,t.captureUserFeedback=function(t){const n=wn();n&&n.captureUserFeedback(t)},t.chromeStackLineParser=Tr,t.close=async function(t){const n=wn();return n?n.close(t):Promise.resolve(!1)},t.continueTrace=({sentryTrace:t,baggage:n},e)=>_n((r=>{const o=Ht(t,n);return r.setPropagationContext(o),e()})),t.createTransport=Ce,t.createUserFeedbackEnvelope=wr,t.dedupeIntegration=He,t.defaultStackLineParsers=Ur,t.defaultStackParser=Fr,t.endSession=ye,t.eventFromException=yr,t.eventFromMessage=gr,t.exceptionFromError=fr,t.feedbackAsyncIntegration=on,t.feedbackIntegration=on,t.flush=async function(t){const n=wn();return n?n.flush(t):Promise.resolve(!1)},t.forceLoad=function(){},t.functionToStringIntegration=Ue,t.geckoStackLineParser=Cr,t.getClient=wn,t.getCurrentHub=rr,t.getCurrentScope=gn,t.getDefaultIntegrations=lo,t.getGlobalScope=bn,t.getIsolationScope=vn,t.globalHandlersIntegration=uo,t.httpContextIntegration=fo,t.inboundFiltersIntegration=qe,t.init=function(t={}){const n=function(t={}){return{defaultIntegrations:lo(),release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:sr.SENTRY_RELEASE&&sr.SENTRY_RELEASE.id?sr.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0,...t}}(t);if(function(){const t=sr,n=t&&t.chrome&&t.chrome.runtime&&t.chrome.runtime.id,e=sr;return!!(e&&e.browser&&e.browser.runtime&&e.browser.runtime.id)||!!n}())return void O((()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}));const e={...n,stackParser:(r=n.stackParser||Fr,Array.isArray(r)?V(...r):r),integrations:Se(n),transport:n.transport||xr};var r;!function(t,n){!0===n.debug&&O((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),gn().update(n.initialScope);const e=new t(n);Oe(e),e.init()}($r,e),n.autoSessionTracking&&function(){if(void 0===sr.document)return;me({ignoreDuration:!0}),ve(),Vr((({from:t,to:n})=>{void 0!==t&&t!==n&&(me({ignoreDuration:!0}),ve())}))}()},t.isInitialized=function(){return!!wn()},t.lastEventId=pe,t.lazyLoadIntegration=async function(t){const n=po[t],e=mo.Sentry=mo.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${t}`);const r=e[t];if("function"==typeof r)return r;const o=function(t){const n=wn(),e=n&&n.getOptions(),r=e&&e.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${De}/${t}.min.js`,r).toString()}(n),i=sr.document.createElement("script");i.src=o,i.crossOrigin="anonymous";const s=new Promise(((t,n)=>{i.addEventListener("load",(()=>t())),i.addEventListener("error",n)}));sr.document.body.appendChild(i);try{await s}catch(n){throw new Error(`Error when loading integration: ${t}`)}const c=e[t];if("function"!=typeof c)throw new Error(`Could not load integration: ${t}`);return c},t.linkedErrorsIntegration=ho,t.makeFetchTransport=xr,t.metrics=ir,t.onLoad=function(t){t()},t.opera10StackLineParser=Nr,t.opera11StackLineParser=Pr,t.parameterize=function(t,...n){const e=new String(String.raw(t,...n));return e.__sentry_template_string__=t.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),e.__sentry_template_values__=n,e},t.replayIntegration=function(t){return O((()=>{console.warn("You are using replayIntegration() even though this bundle does not include replay.")})),{name:"Replay",...sn.reduce(((t,n)=>(t[n]=en,t)),{})}},t.setContext=ue,t.setCurrentClient=Oe,t.setExtra=fe,t.setExtras=ae,t.setTag=le,t.setTags=he,t.setUser=de,t.showReportDialog=function(t={}){if(!sr.document)return;const n=gn(),e=n.getClient(),r=e&&e.getDsn();if(!r)return;if(n&&(t.user={...n.getUser(),...t.user}),!t.eventId){const n=pe();n&&(t.eventId=n)}const o=sr.document.createElement("script");o.async=!0,o.crossOrigin="anonymous",o.src=function(t,n){const e=A(t);if(!e)return"";const r=`${_e(e)}embed/error-page/`;let o=`dsn=${R(e)}`;for(const t in n)if("dsn"!==t&&"onClose"!==t)if("user"===t){const t=n.user;if(!t)continue;t.name&&(o+=`&name=${encodeURIComponent(t.name)}`),t.email&&(o+=`&email=${encodeURIComponent(t.email)}`)}else o+=`&${encodeURIComponent(t)}=${encodeURIComponent(n[t])}`;return`${r}?${o}`}(r,t),t.onLoad&&(o.onload=t.onLoad);const{onClose:i}=t;if(i){const t=n=>{if("__sentry_reportdialog_closed__"===n.data)try{i()}finally{sr.removeEventListener("message",t)}};sr.addEventListener("message",t)}const s=sr.document.head||sr.document.body;s&&s.appendChild(o)},t.spanToBaggageHeader=function(t){return Ft(Fn(t))},t.spanToJSON=zn,t.spanToTraceHeader=function(t){const{traceId:n,spanId:e}=t.spanContext();return function(t=vt(),n=vt().substring(16),e){let r="";return void 0!==e&&(r=e?"-1":"-0"),`${t}-${n}${r}`}(n,e,Xn(t))},t.startSession=me,t.winjsStackLineParser=Dr,t.withIsolationScope=function(...t){const n=In(cn());if(2===t.length){const[e,r]=t;return e?n.withSetIsolationScope(e,r):n.withIsolationScope(r)}return n.withIsolationScope(t[0])},t.withScope=_n,t}({}); +//# sourceMappingURL=bundle.min.js.map diff --git a/js/sentry.js b/js/sentry.js new file mode 100644 index 000000000..7c65e5da8 --- /dev/null +++ b/js/sentry.js @@ -0,0 +1,56 @@ +/** + * Copyright since 2007 PrestaShop SA and Contributors + * PrestaShop is an International Registered Trademark & Property of PrestaShop SA + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.md. + * It is also available through the world-wide-web at this URL: + * https://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@prestashop.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to https://devdocs.prestashop.com/ for more information. + * + * @author PrestaShop SA and Contributors + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + */ + +Sentry.init({ + dsn: "https://eae192966a8d79509154c65c317a7e5d@o298402.ingest.us.sentry.io/4507254110552064", +}); + +document.getElementById("submitErrorReport").addEventListener("click", function () { + const errorsElements = document.getElementById("infoError"); + if (errorsElements) { + const childNodes = errorsElements.childNodes; + let messages = ''; + childNodes.forEach((node, index) => { + if (node.nodeType === Node.TEXT_NODE && index > 0) { + messages += node.textContent.trim() + '\n'; + } + }); + + const eventId = Sentry.captureMessage(messages, "error"); + const userEmail = document.getElementById("userEmail"); + const errorDescription = document.getElementById("errorDescription"); + + Sentry.captureUserFeedback({ + event_id: eventId, + email: userEmail.value, + comments: errorDescription.value, + }); + + userEmail.value = ""; + errorDescription.value = ""; + + $('#errorModal').modal('hide') + } +}); diff --git a/views/templates/block/activityLog.twig b/views/templates/block/activityLog.twig index 87faff16e..3cc39f556 100644 --- a/views/templates/block/activityLog.twig +++ b/views/templates/block/activityLog.twig @@ -19,6 +19,42 @@ + + diff --git a/views/templates/main.twig b/views/templates/main.twig index e4a8b10b4..0d1a218ce 100644 --- a/views/templates/main.twig +++ b/views/templates/main.twig @@ -1,12 +1,13 @@ +
@@ -40,6 +41,7 @@ +