UNPKG

chromatic

Version:

Automate visual testing across browsers. Gather UI feedback. Versioned documentation.

5 lines (4 loc) • 725 kB
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e98bca62-edd1-5715-947b-399730718438")}catch(e){}}(); const e=require(`./chunk-gGpyby2o.cjs`),t=require(`./node-src-CRJRIT5i.cjs`),n=require(`./src-BhnG2iLI.cjs`),r=require(`./meow-Cmqsflq2.cjs`),i=require(`./strip-ansi-DWzhKQ1g.cjs`);let a=require(`url`);a=e.a(a,1);let o=require(`module`);o=e.a(o,1);let s=require(`worker_threads`),c=require(`node:util`);c=e.a(c,1);let l=require(`node:child_process`),u=require(`node:fs`),d=require(`node:os`);d=e.a(d,1);let f=require(`node:path`),p=require(`node:readline`),m=require(`node:worker_threads`),h=require(`node:http`);h=e.a(h,1);let g=require(`node:diagnostics_channel`);g=e.a(g,1);let _=require(`node:https`);_=e.a(_,1);let v=require(`node:stream`),y=require(`node:zlib`),b=require(`node:net`);b=e.a(b,1);let x=require(`node:tls`);x=e.a(x,1);const S={},C={};function w(e,t){S[e]=S[e]||[],S[e].push(t)}function T(e,n){if(!C[e]){C[e]=!0;try{n()}catch(n){t.qt&&t.Gt.error(`Error while instrumenting ${e}`,n)}}}function ee(e,n){let r=e&&S[e];if(r)for(let i of r)try{i(n)}catch(n){t.qt&&t.Gt.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${t.Vt(i)}\nError:`,n)}}let te=null;function eee(e){let t=`error`;w(t,e),T(t,tee)}function tee(){te=t.Jt.onerror,t.Jt.onerror=function(e,t,n,r,i){return ee(`error`,{column:r,error:i,line:n,msg:e,url:t}),te?te.apply(this,arguments):!1},t.Jt.onerror.__SENTRY_INSTRUMENTED__=!0}let ne=null;function nee(e){let t=`unhandledrejection`;w(t,e),T(t,ree)}function ree(){ne=t.Jt.onunhandledrejection,t.Jt.onunhandledrejection=function(e){return ee(`unhandledrejection`,e),ne?ne.apply(this,arguments):!0},t.Jt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}let iee=!1;function aee(){iee||(iee=!0,eee(re),nee(re))}function re(){let e=t.y(),n=e&&t.b(e);if(n){let e=`internal_error`;t.Xt&&t.Gt.log(`[Tracing] Root span: ${e} -> Global error occurred`),n.setStatus({code:2,message:e})}}re.tag=`sentry_tracingErrorCallback`;const ie=`_sentryScope`,ae=`_sentryIsolationScope`;function oe(e,n,r){e&&(t.Ct(e,ae,r),t.Ct(e,ie,n))}function se(e){return{scope:e[ie],isolationScope:e[ae]}}var ce=class{constructor(e={}){this._traceId=e.traceId||t.ut(),this._spanId=e.spanId||t.lt()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function le(e,t,n=()=>{}){let r;try{r=e()}catch(e){throw t(e),n(),e}return oee(r,t,n)}function oee(e,n,r){return t.Rt(e)?e.then(e=>(r(),e),e=>{throw n(e),r(),e}):(r(),e)}function see(e){if(!t.Xt)return;let{description:n=`< unknown name >`,op:r=`< unknown op >`,parent_span_id:i}=t.E(e),{spanId:a}=e.spanContext(),o=t.w(e),s=t.b(e),c=s===e,l=`[Tracing] Starting ${o?`sampled`:`unsampled`} ${c?`root `:``}span`,u=[`op: ${r}`,`name: ${n}`,`ID: ${a}`];if(i&&u.push(`parent ID: ${i}`),!c){let{op:e,description:n}=t.E(s);u.push(`root ID: ${s.spanContext().spanId}`),e&&u.push(`root op: ${e}`),n&&u.push(`root description: ${n}`)}t.Gt.log(`${l} ${u.join(` `)}`)}function cee(e){if(!t.Xt)return;let{description:n=`< unknown name >`,op:r=`< unknown op >`}=t.E(e),{spanId:i}=e.spanContext(),a=`[Tracing] Finishing "${r}" ${t.b(e)===e?`root `:``}span "${n}" with ID ${i}`;t.Gt.log(a)}function lee(e){if(typeof e==`boolean`)return Number(e);let n=typeof e==`string`?parseFloat(e):e;if(typeof n!=`number`||isNaN(n)||n<0||n>1){t.Xt&&t.Gt.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`);return}return n}function uee(e,n){if(!t._(e))return[!1];let r=t.$().getScopeData().sdkProcessingMetadata.normalizedRequest,i={...n,normalizedRequest:n.normalizedRequest||r},a;a=typeof e.tracesSampler==`function`?e.tracesSampler(i):i.parentSampled===void 0?e.tracesSampleRate===void 0?1:e.tracesSampleRate:i.parentSampled;let o=lee(a);return o===void 0?(t.Xt&&t.Gt.warn(`[Tracing] Discarding transaction because of invalid sample rate.`),[!1]):o?Math.random()<o?[!0,o]:(t.Xt&&t.Gt.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(a)})`),[!1,o]):(t.Xt&&t.Gt.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,o])}const dee=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function fee(e){return e===`http`||e===`https`}function ue(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function pee(e){let n=dee.exec(e);if(!n){t.Wt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[r,i,a=``,o=``,s=``,c=``]=n.slice(1),l=``,u=c,d=u.split(`/`);if(d.length>1&&(l=d.slice(0,-1).join(`/`),u=d.pop()),u){let e=u.match(/^\d+/);e&&(u=e[0])}return mee({host:o,pass:a,path:l,projectId:u,port:s,protocol:r,publicKey:i})}function mee(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function hee(e){if(!t.qt)return!0;let{port:n,projectId:r,protocol:i}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(n=>e[n]?!1:(t.Gt.error(`Invalid Sentry Dsn: ${n} missing`),!0))?!1:r.match(/^\d+$/)?fee(i)?n&&isNaN(parseInt(n,10))?(t.Gt.error(`Invalid Sentry Dsn: Invalid port ${n}`),!1):!0:(t.Gt.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(t.Gt.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function gee(e){let t=typeof e==`string`?pee(e):mee(e);if(!(!t||!hee(t)))return t}function de(e,t=[]){return[e,t]}function _ee(e,t){let[n,r]=e;return[n,[...r,t]]}function fe(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function pe(e){return t.Jt.__SENTRY__&&t.Jt.__SENTRY__.encodePolyfill?t.Jt.__SENTRY__.encodePolyfill(e):new TextEncoder().encode(e)}function me(e){let[n,r]=e,i=JSON.stringify(n);function a(e){typeof i==`string`?i=typeof e==`string`?i+e:[pe(i),e]:i.push(typeof e==`string`?pe(e):e)}for(let e of r){let[n,r]=e;if(a(`\n${JSON.stringify(n)}\n`),typeof r==`string`||r instanceof Uint8Array)a(r);else{let e;try{e=JSON.stringify(r)}catch{e=JSON.stringify(t.f(r))}a(e)}}return typeof i==`string`?i:vee(i)}function vee(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function yee(e){return[{type:`span`},e]}function bee(e){let n=typeof e.data==`string`?pe(e.data):e.data;return[t.wt({type:`attachment`,length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const xee={session:`session`,sessions:`session`,attachment:`attachment`,transaction:`transaction`,event:`error`,client_report:`internal`,user_report:`default`,profile:`profile`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,feedback:`feedback`,span:`span`,statsd:`metric_bucket`,raw_security:`security`};function he(e){return xee[e]}function ge(e){if(!e||!e.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function See(e,n,r,i){let a=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...n&&{sdk:n},...!!r&&i&&{dsn:ue(i)},...a&&{trace:t.wt({...a})}}}function Cee(e,t){return t?(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]],e):e}function wee(e,t,n,r){let i=ge(n);return de({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:ue(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function Tee(e,t,n,r){let i=ge(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;Cee(e,n&&n.sdk);let o=See(e,i,r,t);return delete e.sdkProcessingMetadata,de(o,[[{type:a},e]])}function Eee(e,n){function r(e){return!!e.trace_id&&!!e.public_key}let i=t.g(e[0]),a=n&&n.getDsn(),o=n&&n.getOptions().tunnel,s={sent_at:new Date().toISOString(),...r(i)&&{trace:i},...!!o&&a&&{dsn:ue(a)}},c=n&&n.getOptions().beforeSendSpan,l=c?e=>{let n=c(t.E(e));return n||t.C(),n}:e=>t.E(e),u=[];for(let t of e){let e=l(t);e&&u.push(yee(e))}return de(s,u)}function _e(e){if(!e||e.length===0)return;let n={};return e.forEach(e=>{let r=e.attributes||{},i=r[t.W],a=r[t.G];typeof i==`string`&&typeof a==`number`&&(n[e.name]={value:a,unit:i})}),n}const ve=1e3;var ye=class{constructor(e={}){this._traceId=e.traceId||t.ut(),this._spanId=e.spanId||t.lt(),this._startTime=e.startTimestamp||t.St(),this._attributes={},this.setAttributes({[t.q]:`manual`,[t.K]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this}addLinks(e){return this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return t===void 0?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=t.T(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(t.Y,`custom`),this}end(e){this._endTime||(this._endTime=t.T(e),cee(this),this._onSpanEnded())}getSpanJSON(){return t.wt({data:this._attributes,description:this._name,op:this._attributes[t.K],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:t.S(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[t.q],_metrics_summary:t.X(this),profile_id:this._attributes[t.H],exclusive_time:this._attributes[t.V],measurements:_e(this._events),is_segment:this._isStandaloneSpan&&t.b(this)===this||void 0,segment_id:this._isStandaloneSpan?t.b(this).spanContext().spanId:void 0})}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){t.Xt&&t.Gt.log(`[Tracing] Adding an event to span:`,e);let i=be(n)?n:r||t.St(),a=be(n)?{}:n||{},o={name:e,time:t.T(i),attributes:a};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=t.Z();if(e&&e.emit(`spanEnd`,this),!(this._isStandaloneSpan||this===t.b(this)))return;if(this._isStandaloneSpan){this._sampled?Oee(Eee([this],e)):(t.Xt&&t.Gt.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}let n=this._convertSpanToTransaction();n&&(se(this).scope||t.Q()).captureEvent(n)}_convertSpanToTransaction(){if(!xe(t.E(this)))return;this._name||=(t.Xt&&t.Gt.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:e,isolationScope:n}=se(this),r=(e||t.Q()).getClient()||t.Z();if(this._sampled!==!0){t.Xt&&t.Gt.log(`[Tracing] Discarding transaction because its trace was not chosen to be sampled.`),r&&r.recordDroppedEvent(`sample_rate`,`transaction`);return}let i=t.x(this).filter(e=>e!==this&&!Dee(e)).map(e=>t.E(e)).filter(xe),a=this._attributes[t.Y];delete this._attributes[t.U],i.forEach(e=>{e.data&&delete e.data[`sentry.custom_span_name`]});let o={contexts:{trace:t.k(this)},spans:i.length>ve?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,ve):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,...t.wt({dynamicSamplingContext:t.g(this)})},_metrics_summary:t.X(this),...a&&{transaction_info:{source:a}}},s=_e(this._events);return s&&Object.keys(s).length&&(t.Xt&&t.Gt.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(s,void 0,2)),o.measurements=s),o}};function be(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function xe(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Dee(e){return e instanceof ye&&e.isStandaloneSpan()}function Oee(e){let n=t.Z();if(!n)return;let r=e[1];if(!r||r.length===0){n.recordDroppedEvent(`before_send`,`span`);return}n.sendEnvelope(e)}const Se=`__SENTRY_SUPPRESS_TRACING__`;function Ce(e,n){let r=Oe();if(r.startSpan)return r.startSpan(e,n);let i=De(e),{forceTransaction:a,parentSpan:o}=e;return t.nt(e.scope,()=>Nee(o)(()=>{let r=t.Q(),o=ke(r),s=e.onlyIfParent&&!o?new ce:Ee({parentSpan:o,spanArguments:i,forceTransaction:a,scope:r});return t.ct(r,s),le(()=>n(s),()=>{let{status:e}=t.E(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})},()=>s.end())}))}function we(e,n){let r=Oe();if(r.startSpanManual)return r.startSpanManual(e,n);let i=De(e),{forceTransaction:a,parentSpan:o}=e;return t.nt(e.scope,()=>Nee(o)(()=>{let r=t.Q(),o=ke(r),s=e.onlyIfParent&&!o?new ce:Ee({parentSpan:o,spanArguments:i,forceTransaction:a,scope:r});t.ct(r,s);function c(){s.end()}return le(()=>n(s,c),()=>{let{status:e}=t.E(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})})}))}function kee(e){let n=Oe();if(n.startInactiveSpan)return n.startInactiveSpan(e);let r=De(e),{forceTransaction:i,parentSpan:a}=e;return(e.scope?n=>t.nt(e.scope,n):a===void 0?e=>e():e=>Te(a,e))(()=>{let n=t.Q(),a=ke(n);return e.onlyIfParent&&!a?new ce:Ee({parentSpan:a,spanArguments:r,forceTransaction:i,scope:n})})}function Te(e,n){let r=Oe();return r.withActiveSpan?r.withActiveSpan(e,n):t.nt(r=>(t.ct(r,e||void 0),n(r)))}function Aee(e){let n=Oe();return n.suppressTracing?n.suppressTracing(e):t.nt(t=>(t.setSDKProcessingMetadata({[Se]:!0}),e()))}function Ee({parentSpan:e,spanArguments:n,forceTransaction:r,scope:i}){if(!t._())return new ce;let a=t.$(),o;if(e&&!r)o=Mee(e,i,n),t.v(e,o);else if(e){let r=t.g(e),{traceId:a,spanId:s}=e.spanContext(),c=t.w(e);o=jee({traceId:a,parentSpanId:s,...n},i,c),t.m(o,r)}else{let{traceId:e,dsc:r,parentSpanId:s,sampled:c}={...a.getPropagationContext(),...i.getPropagationContext()};o=jee({traceId:e,parentSpanId:s,...n},i,c),r&&t.m(o,r)}return see(o),oe(o,i,a),o}function De(e){let n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...n};return r.startTimestamp=t.T(e.startTime),delete r.startTime,r}return n}function Oe(){return t.rt(t.zt())}function jee(e,n,r){let i=t.Z(),a=i&&i.getOptions()||{},{name:o=``,attributes:s}=e,[c,l]=n.getScopeData().sdkProcessingMetadata[Se]?[!1]:uee(a,{name:o,parentSampled:r,attributes:s,transactionContext:{name:o,parentSampled:r}}),u=new ye({...e,attributes:{[t.Y]:`custom`,...e.attributes},sampled:c});return l!==void 0&&u.setAttribute(t.J,l),i&&i.emit(`spanStart`,u),u}function Mee(e,n,r){let{spanId:i,traceId:a}=e.spanContext(),o=n.getScopeData().sdkProcessingMetadata[Se]?!1:t.w(e),s=o?new ye({...r,parentSpanId:i,traceId:a,sampled:o}):new ce({traceId:a});t.v(e,s);let c=t.Z();return c&&(c.emit(`spanStart`,s),r.endTimestamp&&c.emit(`spanEnd`,s)),s}function ke(e){let n=t.st(e);if(!n)return;let r=t.Z();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?t.b(n):n}function Nee(e){return e===void 0?e=>e():t=>Te(e,t)}var Pee=class{constructor(e,t){this._client=e,this.flushTimeout=60,this._pendingAggregates=new Map,this._isEnabled=!0,this._intervalId=setInterval(()=>this.flush(),this.flushTimeout*1e3),this._intervalId.unref&&this._intervalId.unref(),this._sessionAttrs=t}flush(){let e=this.getSessionAggregates();e.aggregates.length!==0&&(this._pendingAggregates=new Map,this._client.sendSession(e))}getSessionAggregates(){let e=Array.from(this._pendingAggregates.values());return t.wt({attrs:this._sessionAttrs,aggregates:e})}close(){clearInterval(this._intervalId),this._isEnabled=!1,this.flush()}incrementSessionStatusCount(){if(!this._isEnabled)return;let e=t.$(),n=e.getRequestSession();n&&n.status&&(this._incrementSessionStatusCount(n.status,new Date),e.setRequestSession(void 0))}_incrementSessionStatusCount(e,t){let n=new Date(t).setSeconds(0,0),r=this._pendingAggregates.get(n);switch(r||(r={started:new Date(n).toISOString()},this._pendingAggregates.set(n,r)),e){case`errored`:return r.errored=(r.errored||0)+1,r.errored;case`ok`:return r.exited=(r.exited||0)+1,r.exited;default:return r.crashed=(r.crashed||0)+1,r.crashed}}};function Fee(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function Iee(e){return`${Fee(e)}${e.projectId}/envelope/`}function Lee(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Ree(e,t,n){return t||`${Iee(e)}?${Lee(e,n)}`}const zee=[];function Bee(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function Vee(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;let i=Bee(r),a=i.findIndex(e=>e.name===`Debug`);if(a>-1){let[e]=i.splice(a,1);i.push(e)}return i}function Hee(e,t){let n={};return t.forEach(t=>{t&&Wee(e,t,n)}),n}function Uee(e,t){for(let n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function Wee(e,n,r){if(r[n.name]){t.Xt&&t.Gt.log(`Integration skipped because it was already installed: ${n.name}`);return}if(r[n.name]=n,zee.indexOf(n.name)===-1&&typeof n.setupOnce==`function`&&(n.setupOnce(),zee.push(n.name)),n.setup&&typeof n.setup==`function`&&n.setup(e),typeof n.preprocessEvent==`function`){let t=n.preprocessEvent.bind(n);e.on(`preprocessEvent`,(n,r)=>t(n,r,e))}if(typeof n.processEvent==`function`){let t=n.processEvent.bind(n),r=Object.assign((n,r)=>t(n,r,e),{id:n.name});e.addEventProcessor(r)}t.Xt&&t.Gt.log(`Integration installed: ${n.name}`)}function E(e){return e}function Gee(e,n,r){let i=[{type:`client_report`},{timestamp:r||t.xt(),discarded_events:e}];return de(n?{dsn:n}:{},[i])}var D=class extends Error{constructor(e,t=`warn`){super(e),this.message=e,this.logLevel=t}};const Kee=`Not capturing exception because it's already been captured.`;var qee=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=gee(e.dsn):t.Xt&&t.Gt.warn(`No DSN provided, client will not send events.`),this._dsn){let t=Ree(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}let n=[`enableTracing`,`tracesSampleRate`,`tracesSampler`].find(t=>t in e&&e[t]==null);n&&t.Wt(()=>{console.warn(`[Sentry] Deprecation warning: \`${n}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(e,n,r){let i=t.bt();if(t._t(e))return t.Xt&&t.Gt.log(Kee),i;let a={event_id:i,...n};return this._process(this.eventFromException(e,a).then(e=>this._captureEvent(e,a,r))),a.event_id}captureMessage(e,n,r,i){let a={event_id:t.bt(),...r},o=t.Pt(e)?e:String(e),s=t.It(e)?this.eventFromMessage(o,n,a):this.eventFromException(e,a);return this._process(s.then(e=>this._captureEvent(e,a,i))),a.event_id}captureEvent(e,n,r){let i=t.bt();if(n&&n.originalException&&t._t(n.originalException))return t.Xt&&t.Gt.log(Kee),i;let a={event_id:i,...n},o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,a,o||r)),a.event_id}captureSession(e){typeof e.release==`string`?(this.sendSession(e),t.dt(e,{init:!1})):t.Xt&&t.Gt.warn(`Discarded session because of missing or non-string release`)}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let n=this._transport;return n?(this.emit(`flush`),this._isClientDoneProcessing(e).then(t=>n.flush(e).then(e=>t&&e))):t.mt(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.emit(`close`),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];Wee(this,e,this._integrations),t||Uee(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=Tee(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=_ee(n,bee(e));let r=this.sendEnvelope(n);r&&r.then(t=>this.emit(`afterSendEvent`,e,t),null)}sendSession(e){let t=wee(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){let i=typeof r==`number`?r:1,a=`${e}:${n}`;t.Xt&&t.Gt.log(`Recording outcome: "${a}"${i>1?` (${i} times)`:``}`),this._outcomes[a]=(this._outcomes[a]||0)+i}}on(e,t){let n=this._hooks[e]=this._hooks[e]||[];return n.push(t),()=>{let e=n.indexOf(t);e>-1&&n.splice(e,1)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}sendEnvelope(e){return this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,e=>(t.Xt&&t.Gt.error(`Error while sending envelope:`,e),e)):(t.Xt&&t.Gt.error(`Transport disabled`),t.mt({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Hee(this,e),Uee(this,e)}_updateSessionFromEvent(e,n){let r=n.level===`fatal`,i=!1,a=n.exception&&n.exception.values;if(a){i=!0;for(let e of a){let t=e.mechanism;if(t&&t.handled===!1){r=!0;break}}}let o=e.status===`ok`;(o&&e.errors===0||o&&r)&&(t.dt(e,{...r&&{status:`crashed`},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new t.ft(t=>{let n=0,r=setInterval(()=>{this._numProcessing==0?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r=t.Q(),i=t.$()){let a=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o.length>0&&(n.integrations=o),this.emit(`preprocessEvent`,e,n),e.type||i.setLastEventId(e.event_id||n.event_id),t.d(a,e,n,r,this,i).then(e=>e===null?e:(e.contexts={trace:t.et(r),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:t.h(this,r),...e.sdkProcessingMetadata},e))}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(e=>e.event_id,e=>{t.Xt&&(e instanceof D&&e.logLevel===`log`?t.Gt.log(e.message):t.Gt.warn(e))})}_processEvent(e,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=Zee(e),s=Xee(e),c=e.type||`error`,l=`before send for type \`${c}\``,u=a===void 0?void 0:lee(a);if(s&&typeof u==`number`&&Math.random()>u)return this.recordDroppedEvent(`sample_rate`,`error`,e),t.pt(new D(`Discarding event because it's not included in the random sample (sampling rate = ${a})`,`log`));let d=c===`replay_event`?`replay`:c,f=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,f).then(t=>{if(t===null)throw this.recordDroppedEvent(`event_processor`,d,e),new D("An event processor returned `null`, will not send event.",`log`);return n.data&&n.data.__sentry__===!0?t:Jee(Yee(this,i,t,n),l)}).then(t=>{if(t===null){if(this.recordDroppedEvent(`before_send`,d,e),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw new D(`${l} returned \`null\`, will not send event.`,`log`)}let i=r&&r.getSession();if(!o&&i&&this._updateSessionFromEvent(i,t),o){let e=(t.sdkProcessingMetadata&&t.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(t.spans?t.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let a=t.transaction_info;return o&&a&&t.transaction!==e.transaction&&(t.transaction_info={...a,source:`custom`}),this.sendEvent(t,n),t}).then(null,e=>{throw e instanceof D?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new D(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){t.Xt&&t.Gt.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){t.Xt&&t.Gt.log(`No outcomes to send`);return}if(!this._dsn){t.Xt&&t.Gt.log(`No dsn provided, will not send outcomes`);return}t.Xt&&t.Gt.log(`Sending outcomes:`,e);let n=Gee(e,this._options.tunnel&&ue(this._dsn));this.sendEnvelope(n)}};function Jee(e,n){let r=`${n} must return \`null\` or a valid event.`;if(t.Rt(e))return e.then(e=>{if(!t.Ft(e)&&e!==null)throw new D(r);return e},e=>{throw new D(`${n} rejected with ${e}`)});if(!t.Ft(e)&&e!==null)throw new D(r);return e}function Yee(e,n,r,i){let{beforeSend:a,beforeSendTransaction:o,beforeSendSpan:s}=n;if(Xee(r)&&a)return a(r,i);if(Zee(r)){if(r.spans&&s){let n=[];for(let i of r.spans){let r=s(i);r?n.push(r):(t.C(),e.recordDroppedEvent(`before_send`,`span`))}r.spans=n}if(o){if(r.spans){let e=r.spans.length;r.sdkProcessingMetadata={...r.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return o(r,i)}}return r}function Xee(e){return e.type===void 0}function Zee(e){return e.type===`transaction`}function Qee(e,n,r,i,a){let o={sent_at:new Date().toISOString()};return r&&r.sdk&&(o.sdk={name:r.sdk.name,version:r.sdk.version}),i&&a&&(o.dsn=ue(a)),n&&(o.trace=t.wt(n)),de(o,[$ee(e)])}function $ee(e){return[{type:`check_in`},e]}function ete(e,t){return e(t.stack||``,1)}function tte(e,t){let n={type:t.name||t.constructor.name,value:t.message},r=ete(e,t);return r.length&&(n.stacktrace={frames:r}),n}function nte(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}function rte(e){if(`name`in e&&typeof e.name==`string`){let t=`'${e.name}' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message '${e.message}'`),t}else if(`message`in e&&typeof e.message==`string`)return e.message;let n=t.Tt(e);if(t.Mt(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let r=ite(e);return`${r&&r!==`Object`?`'${r}'`:`Object`} captured as exception with keys: ${n}`}function ite(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function ate(e,n,r,i){if(t.jt(r))return[r,void 0];if(n.synthetic=!0,t.Ft(r)){let n=e&&e.getOptions().normalizeDepth,a={__serialized__:t.p(r,n)},o=nte(r);if(o)return[o,a];let s=rte(r),c=i&&i.syntheticException||Error(s);return c.message=s,[c,a]}let a=i&&i.syntheticException||Error(r);return a.message=`${r}`,[a,void 0]}function ote(e,n,r,i){let a=i&&i.data&&i.data.mechanism||{handled:!0,type:`generic`},[o,s]=ate(e,a,r,i),c={exception:{values:[tte(n,o)]}};return s&&(c.extra=s),t.gt(c,void 0,void 0),t.ht(c,a),{...c,event_id:i&&i.event_id}}function ste(e,n,r=`info`,i,a){let o={event_id:i&&i.event_id,level:r};if(a&&i&&i.syntheticException){let r=ete(e,i.syntheticException);r.length&&(o.exception={values:[{value:n,stacktrace:{frames:r}}]},t.ht(o,{synthetic:!0}))}if(t.Pt(n)){let{__sentry_template_string__:e,__sentry_template_values__:t}=n;return o.logentry={message:e,params:t},o}return o.message=n,o}var cte=class extends qee{constructor(e){aee(),super(e)}eventFromException(e,n){let r=ote(this,this._options.stackParser,e,n);return r.level=`error`,t.mt(r)}eventFromMessage(e,n=`info`,r){return t.mt(ste(this._options.stackParser,e,n,r,this._options.attachStacktrace))}captureException(e,n,r){if(this._options.autoSessionTracking&&this._sessionFlusher){let e=t.$().getRequestSession();e&&e.status===`ok`&&(e.status=`errored`)}return super.captureException(e,n,r)}captureEvent(e,n,r){if(this._options.autoSessionTracking&&this._sessionFlusher&&(e.type||`exception`)===`exception`&&e.exception&&e.exception.values&&e.exception.values.length>0){let e=t.$().getRequestSession();e&&e.status===`ok`&&(e.status=`errored`)}return super.captureEvent(e,n,r)}close(e){return this._sessionFlusher&&this._sessionFlusher.close(),super.close(e)}initSessionFlusher(){let{release:e,environment:n}=this._options;e?this._sessionFlusher=new Pee(this,{release:e,environment:n}):t.Xt&&t.Gt.warn(`Cannot initialize an instance of SessionFlusher if no release is provided!`)}captureCheckIn(e,n,r){let i=`checkInId`in e&&e.checkInId?e.checkInId:t.bt();if(!this._isEnabled())return t.Xt&&t.Gt.warn(`SDK not enabled, will not capture checkin.`),i;let{release:a,environment:o,tunnel:s}=this.getOptions(),c={check_in_id:i,monitor_slug:e.monitorSlug,status:e.status,release:a,environment:o};`duration`in e&&(c.duration=e.duration),n&&(c.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone,failure_issue_threshold:n.failureIssueThreshold,recovery_threshold:n.recoveryThreshold});let[l,u]=this._getTraceInfoFromScope(r);u&&(c.contexts={trace:u});let d=Qee(c,l,this.getSdkMetadata(),s,this.getDsn());return t.Xt&&t.Gt.info(`Sending checkin:`,e.monitorSlug,e.status),this.sendEnvelope(d),i}_captureRequestSession(){this._sessionFlusher?this._sessionFlusher.incrementSessionStatusCount():t.Xt&&t.Gt.warn(`Discarded request mode session because autoSessionTracking option was disabled`)}_prepareEvent(e,t,n,r){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:(e.contexts||{}).runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,t,n,r)}_getTraceInfoFromScope(e){if(!e)return[void 0,void 0];let n=t.st(e),r=n?t.D(n):t.et(e);return[n?t.g(n):t.h(this,e),r]}};function lte(e){let n=[];function r(){return e===void 0||n.length<e}function i(e){return n.splice(n.indexOf(e),1)[0]||Promise.resolve(void 0)}function a(e){if(!r())return t.pt(new D(`Not adding Promise because buffer limit was reached.`));let a=e();return n.indexOf(a)===-1&&n.push(a),a.then(()=>i(a)).then(null,()=>i(a).then(null,()=>{})),a}function o(e){return new t.ft((r,i)=>{let a=n.length;if(!a)return r(!0);let o=setTimeout(()=>{e&&e>0&&r(!1)},e);n.forEach(e=>{t.mt(e).then(()=>{--a||(clearTimeout(o),r(!0))},i)})})}return{$:n,add:a,drain:o}}function ute(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}function dte(e,t){return e[t]||e.all||0}function fte(e,t,n=Date.now()){return dte(e,t)>n}function pte(e,{statusCode:t,headers:n},r=Date.now()){let i={...e},a=n&&n[`x-sentry-rate-limits`],o=n&&n[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+ute(o,r):t===429&&(i.all=r+60*1e3);return i}function mte(e,n,r=lte(e.bufferSize||64)){let i={},a=e=>r.drain(e);function o(a){let o=[];if(fe(a,(t,n)=>{let r=he(n);if(fte(i,r)){let i=hte(t,n);e.recordDroppedEvent(`ratelimit_backoff`,r,i)}else o.push(t)}),o.length===0)return t.mt({});let s=de(a[0],o),c=t=>{fe(s,(n,r)=>{let i=hte(n,r);e.recordDroppedEvent(t,he(r),i)})};return r.add(()=>n({body:me(s)}).then(e=>(e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&t.Xt&&t.Gt.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),i=pte(i,e),e),e=>{throw c(`network_error`),e})).then(e=>e,e=>{if(e instanceof D)return t.Xt&&t.Gt.error(`Skipped sending event because buffer is full.`),c(`queue_overflow`),t.mt({});throw e})}return{send:o,flush:a}}function hte(e,t){if(!(t!==`event`&&t!==`transaction`))return Array.isArray(e)?e[1]:void 0}function gte(e,n,r=[n],i=`npm`){let a=e._metadata||{};a.sdk||={name:`sentry.javascript.${n}`,packages:r.map(e=>({name:`${i}:@sentry/${e}`,version:t.Yt})),version:t.Yt},e._metadata=a}function _te(e={}){let n=t.Z();if(!t.l()||!n)return{};let r=t.rt(t.zt());if(r.getTraceData)return r.getTraceData(e);let i=t.Q(),a=e.span||t.y(),o=a?t.O(a):vte(i),s=t.F(a?t.g(a):t.h(n,i));return t.A.test(o)?{"sentry-trace":o,baggage:s}:(t.Gt.warn(`Invalid sentry-trace data. Cannot generate trace data`),{})}function vte(e){let{traceId:n,sampled:r,spanId:i}=e.getPropagationContext();return t.j(n,i,r)}function Ae(e,n){let r=t.Z(),i=t.$();if(!r)return;let{beforeBreadcrumb:a=null,maxBreadcrumbs:o=100}=r.getOptions();if(o<=0)return;let s={timestamp:t.xt(),...e},c=a?t.Wt(()=>a(s,n)):s;c!==null&&(r.emit&&r.emit(`beforeAddBreadcrumb`,c,n),i.addBreadcrumb(c,o))}let yte;const bte=new WeakMap,xte=E((()=>({name:`FunctionToString`,setupOnce(){yte=Function.prototype.toString;try{Function.prototype.toString=function(...e){let n=t.Dt(this),r=bte.has(t.Z())&&n!==void 0?n:this;return yte.apply(r,e)}}catch{}},setup(e){bte.set(e,!0)}}))),Ste=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,`undefined is not an object (evaluating 'a.L')`,`can't redefine non-configurable property "solana"`,`vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)`,`Can't find variable: _AutofillCallbackHandler`,/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],Cte=E(((e={})=>({name:`InboundFilters`,processEvent(t,n,r){return Tte(t,wte(e,r.getOptions()))?null:t}})));function wte(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Ste],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:e.ignoreInternal===void 0?!0:e.ignoreInternal}}function Tte(e,n){return n.ignoreInternal&&jte(e)?(t.Xt&&t.Gt.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${t.vt(e)}`),!0):Ete(e,n.ignoreErrors)?(t.Xt&&t.Gt.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${t.vt(e)}`),!0):Nte(e)?(t.Xt&&t.Gt.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${t.vt(e)}`),!0):Dte(e,n.ignoreTransactions)?(t.Xt&&t.Gt.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${t.vt(e)}`),!0):Ote(e,n.denyUrls)?(t.Xt&&t.Gt.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${t.vt(e)}.\nUrl: ${je(e)}`),!0):kte(e,n.allowUrls)?!1:(t.Xt&&t.Gt.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${t.vt(e)}.\nUrl: ${je(e)}`),!0)}function Ete(e,n){return e.type||!n||!n.length?!1:Ate(e).some(e=>t.kt(e,n))}function Dte(e,n){if(e.type!==`transaction`||!n||!n.length)return!1;let r=e.transaction;return r?t.kt(r,n):!1}function Ote(e,n){if(!n||!n.length)return!1;let r=je(e);return r?t.kt(r,n):!1}function kte(e,n){if(!n||!n.length)return!0;let r=je(e);return r?t.kt(r,n):!0}function Ate(e){let t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch{}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),t}function jte(e){try{return e.exception.values[0].type===`SentryError`}catch{}return!1}function Mte(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function je(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?Mte(t):null}catch{return t.Xt&&t.Gt.error(`Cannot extract url for event ${t.vt(e)}`),null}}function Nte(e){return e.type||!e.exception||!e.exception.values||e.exception.values.length===0?!1:!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value)}function Pte(e,n,r=250,i,a,o,s){if(!o.exception||!o.exception.values||!s||!t.Nt(s.originalException,Error))return;let c=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;c&&(o.exception.values=Lte(Me(e,n,a,s.originalException,i,o.exception.values,c,0),r))}function Me(e,n,r,i,a,o,s,c){if(o.length>=r+1)return o;let l=[...o];if(t.Nt(i[a],Error)){Fte(s,c);let t=e(n,i[a]),o=l.length;Ite(t,a,o,c),l=Me(e,n,r,i[a],a,[t,...l],t,o)}return Array.isArray(i.errors)&&i.errors.forEach((i,o)=>{if(t.Nt(i,Error)){Fte(s,c);let t=e(n,i),u=l.length;Ite(t,`errors[${o}]`,u,c),l=Me(e,n,r,i,a,[t,...l],t,u)}}),l}function Fte(e,t){e.mechanism=e.mechanism||{type:`generic`,handled:!0},e.mechanism={...e.mechanism,...e.type===`AggregateError`&&{is_exception_group:!0},exception_id:t}}function Ite(e,t,n,r){e.mechanism=e.mechanism||{type:`generic`,handled:!0},e.mechanism={...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function Lte(e,n){return e.map(e=>(e.value&&=t.At(e.value,n),e))}const Rte=E(((e={})=>{let t=e.limit||5,n=e.key||`cause`;return{name:`LinkedErrors`,preprocessEvent(e,r,i){let a=i.getOptions();Pte(tte,a.stackParser,a.maxValueLength,n,t,e,r)}}}));function zte(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf(`=`,n);if(r===-1)break;let i=e.indexOf(`;`,n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(`;`,r-1)+1;continue}let a=e.slice(n,r).trim();if(t[a]===void 0){let n=e.slice(r+1,i).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));try{t[a]=n.indexOf(`%`)===-1?n:decodeURIComponent(n)}catch{t[a]=n}}n=i+1}return t}function Ne(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Pe(e){return e.split(/[?#]/,1)[0]}function Fe(e){let{protocol:t,host:n,path:r}=e,i=n&&n.replace(/^.*@/,`[filtered]:[filtered]@`).replace(/(:80)$/,``).replace(/(:443)$/,``)||``;return`${t?`${t}://`:``}${i}${r}`}const Ie=[`X-Client-IP`,`X-Forwarded-For`,`Fly-Client-IP`,`CF-Connecting-IP`,`Fastly-Client-Ip`,`True-Client-Ip`,`X-Real-IP`,`X-Cluster-Client-IP`,`X-Forwarded`,`Forwarded-For`,`Forwarded`,`X-Vercel-Forwarded-For`];function Bte(e){return Ie.map(t=>{let n=e[t],r=Array.isArray(n)?n.join(`;`):n;return t===`Forwarded`?Vte(r):r&&r.split(`,`).map(e=>e.trim())}).reduce((e,t)=>t?e.concat(t):e,[]).find(e=>e!==null&&Hte(e))||null}function Vte(e){if(!e)return null;for(let t of e.split(`;`))if(t.startsWith(`for=`))return t.slice(4);return null}function Hte(e){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)}const Ute={ip:!1,request:!0,user:!0},Le=[`cookies`,`data`,`headers`,`method`,`query_string`,`url`],Wte=[`id`,`username`,`email`];function Gte(e,t){let n={};return(Array.isArray(t)?t:Wte).forEach(t=>{e&&t in e&&(n[t]=e[t])}),n}function Kte(e,n={}){let{include:r=Le}=n,i={},a=e.headers||{},o=e.method,s=a.host||e.hostname||e.host||`<no host>`,c=e.protocol===`https`||e.socket&&e.socket.encrypted?`https`:`http`,l=e.originalUrl||e.url||``,u=l.startsWith(c)?l:`${c}://${s}${l}`;return r.forEach(n=>{switch(n){case`headers`:i.headers=a,r.includes(`cookies`)||delete i.headers.cookie,r.includes(`ip`)||Ie.forEach(e=>{delete i.headers[e]});break;case`method`:i.method=o;break;case`url`:i.url=u;break;case`cookies`:i.cookies=e.cookies||a.cookie&&zte(a.cookie)||{};break;case`query_string`:i.query_string=Yte(e);break;case`data`:{if(o===`GET`||o===`HEAD`)break;let n=e.body;if(n!==void 0){let e=t.Lt(n)?n:t.Ft(n)?JSON.stringify(t.f(n)):t.At(`${n}`,1024);e&&(i.data=e)}break}default:({}).hasOwnProperty.call(e,n)&&(i[n]=e[n])}}),i}function qte(e,n,r,i){let a={...Ute,...i&&i.include};if(a.request){let t=Array.isArray(a.request)?[...a.request]:[...Le];a.ip&&t.push(`ip`);let r=$te(n,{include:t});e.request={...e.request,...r}}if(a.user){let n=r.user&&t.Ft(r.user)?Gte(r.user,a.user):{};Object.keys(n).length&&(e.user={...n,...e.user})}if(a.ip){let t=n.headers&&Bte(n.headers)||r.ipAddress;t&&(e.user={...e.user,ip_address:t})}}function Jte(e,n,r){let i={...Ute,...r&&r.include};if(i.request){let t=Array.isArray(i.request)?[...i.request]:[...Le];i.ip&&t.push(`ip`);let r=Kte(n,{include:t});e.request={...e.request,...r}}if(i.user){let r=n.user&&t.Ft(n.user)?Gte(n.user,i.user):{};Object.keys(r).length&&(e.user={...e.user,...r})}if(i.ip){let t=n.headers&&Bte(n.headers)||n.ip||n.socket&&n.socket.remoteAddress;t&&(e.user={...e.user,ip_address:t})}return e}function Yte(e){let t=e.originalUrl||e.url||``;if(t){t.startsWith(`/`)&&(t=`http://dogs.are.great${t}`);try{let n=e.query||new URL(t).search.slice(1);return n.length?n:void 0}catch{return}}}function Xte(e){let n=Object.create(null);try{Object.entries(e).forEach(([e,t])=>{typeof t==`string`&&(n[e]=t)})}catch{t.qt&&t.Gt.warn(`Sentry failed extracting headers from a request object. If you see this, please file an issue.`)}return n}function Zte(e){let n=e.headers||{},r=n.host||`<no host>`,i=e.socket&&e.socket.encrypted?`https`:`http`,a=e.url||``,o=a.startsWith(i)?a:`${i}://${r}${a}`,s=e.body||void 0,c=e.cookies;return t.wt({url:o,method:e.method,query_string:Qte(a),headers:Xte(n),cookies:c,data:s})}function Qte(e){if(e)try{let t=new URL(e,`http://dogs.are.great`).search.slice(1);return t.length?t:void 0}catch{return}}function $te(e,{include:t}){let n=t?Array.isArray(t)?t:Le:[],r={},i={...e.headers};return n.includes(`headers`)&&(r.headers=i,t.includes(`cookies`)||delete i.cookie,t.includes(`ip`)||Ie.forEach(e=>{delete i[e]})),n.includes(`method`)&&(r.method=e.method),n.includes(`url`)&&(r.url=e.url),n.includes(`cookies`)&&(r.cookies=e.cookies||(i&&i.cookie?zte(i.cookie):void 0)||{}),n.includes(`query_string`)&&(r.query_string=e.query_string),n.includes(`data`)&&(r.data=e.data),r}const Re={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:`methodPath`},ene=E(((e={})=>{let t={...Re,...e,include:{...Re.include,...e.include,user:e.include&&typeof e.include.user==`boolean`?e.include.user:{...Re.include.user,...(e.include||{}).user}}};return{name:`RequestData`,processEvent(e){let{sdkProcessingMetadata:n={}}=e,{request:r,normalizedRequest:i}=n,a=tne(t);return i?(qte(e,i,{ipAddress:r?r.ip||r.socket&&r.socket.remoteAddress:void 0,user:r?r.user:void 0},a),e):r?Jte(e,r,a):e}}}));function tne(e){let{transactionNamingScheme:t,include:{ip:n,user:r,...i}}=e,a=[`method`];for(let[e,t]of Object.entries(i))t&&a.push(e);let o;if(r===void 0)o=!0;else if(typeof r==`boolean`)o=r;else{let e=[];for(let[t,n]of Object.entries(r))n&&e.push(t);o=e}return{include:{ip:n,user:o,request:a.length===0?void 0:a,transaction:t}}}function nne(e){let t=`console`;w(t,e),T(t,rne)}function rne(){`console`in t.Jt&&t.Ut.forEach(function(e){e in t.Jt.console&&t.Et(t.Jt.console,e,function(n){return t.Kt[e]=n,function(...n){ee(`console`,{args:n,level:e});let r=t.Kt[e];r&&r.apply(t.Jt.console,n)}})})}function ine(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}const ane=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function one(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=ane.exec(t);return n?n.slice(1):[]}function sne(e){let t=one(e),n=t[0]||``,r=t[1];return!n&&!r?`.`:(r&&=r.slice(0,r.length-1),n+r)}function ze(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}function cne(e,t=!1){return!(t||e&&!e.startsWith(`/`)&&!e.match(/^[A-Z]:/)&&!e.startsWith(`.`)&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes(`node_modules/`)}function lne(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return r=>{let i=r.match(n);if(i){let t,n,r,a,o;if(i[1]){r=i[1];let e=r.lastIndexOf(`.`);if(r[e-1]===`.`&&e--,e>0){t=r.slice(0,e),n=r.slice(e+1);let i=t.indexOf(`.Module`);i>0&&(r=r.slice(i+1),t=t.slice(0,i))}a=void 0}n&&(a=t,o=n),n===`<anonymous>`&&(o=void 0,r=void 0),r===void 0&&(o||=`?`,r=a?`${a}.${o}`:o);let s=i[2]&&i[2].startsWith(`file://`)?i[2].slice(7):i[2],c=i[5]===`native`;return s&&s.match(/\/[A-Z]:/)&&(s=s.slice(1)),!s&&i[5]&&!c&&(s=i[5]),{filename:s?decodeURI(s):void 0,module:e?e(s):void 0,function:r,lineno:Be(i[3]),colno:Be(i[4]),in_app:cne(s||``,c)}}if(r.match(t))return{filename:r}}}function une(e){return[90,lne(e)]}function Be(e){return parseInt(e||``,10)||void 0}var Ve=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){let t=this._cache.get(e);if(t!==void 0)return this._cache.delete(e),this._cache.set(e,t),t}set(e,t){this._cache.size>=this._maxSize&&this._cache.delete(this._cache.keys().next().value),this._cache.set(e,t)}remove(e){let t=this._cache.get(e);return t&&this._cache.delete(e),t}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let e=[];return this._cache.forEach(t=>e.push(t)),e}};function O(e,t){return e??t()}function k(e){let t,n=e[0],r=1;for(;r<e.length;){let i=e[r],a=e[r+1];if(r+=2,(i===`optionalAccess`||i===`optionalCall`)&&n==null)return;i===`access`||i===`optionalAccess`?(t=n,n=a(n)):(i===`call`||i===`optionalCall`)&&(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}var He,Ue=e.n((()=>{He=`1.9.1`}));function dne(e){let t=new Set([e]),n=new Set,r=e.match(We);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(We);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var We,Ge,fne=e.n((()=>{Ue(),We=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,Ge=dne(He)}));function Ke(e,t,n,r=!1){let i=Ze[Xe]=Ze[Xe]??{version:He};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${He}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${He}.`),!0}function qe(e){let t=Ze[Xe]?.version;if(!(!t||!Ge(t)))return Ze[Xe]?.[e]}function Je(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${He}.`);let n=Ze[Xe];n&&delete n[e]}var Ye,Xe,Ze,Qe=e.n((()=>{Ue(),fne(),Ye=He.split(`.`)[0],Xe=Symbol.for(`opentelemetry.js.api.${Ye}`),Ze=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function $e(e,t,n){let r=qe(`diag`);if(r)return r[e](t,...n)}var et,pne=e.n((()=>{Qe(),et=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return $e(`debug`,this._namespace,e)}error(...e){return $e(`error`,this._namespace,e)}info(...e){return $e(`info`,this._namespace,e)}warn(...e){return $e(`warn`,this._namespace,e)}verbose(...e){return $e(`verbose`,this._namespace,e)}}})),A,tt=e.n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(A||={})}));function mne(e,t){e<A.NONE?e=A.NONE:e>A.ALL&&(e=A.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,A.ERROR),warn:n(`warn`,A.WARN),info:n(`info`,A.INFO),debug:n(`debug`,A.DEBUG),verbose:n(`verbose`,A.VERBOSE)}}var hne=e.n((()=>{tt()})),nt,j,rt=e.n((()=>{pne(),hne(),tt(),Qe(),nt=`diag`,j=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=qe(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:A.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error