n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 43.8 kB
JavaScript
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(t){}}(),System.register(["./vue.runtime.esm-bundler-legacy-BW6xDdqj.js"],(function(t,e){var n,r,s,i,o,a,c,u,p,d,f,l,h,_,m,g,y,b,S,v,x,k,I,E,w,T,A,C,D,O,$,N,P,j,R,M,L,U,J,F,Y,z,V,H,B,W,G,K;function q(){return Q(i),i}function Q(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||"10.36.0",e[o]=e["10.36.0"]||{}}function X(t,e,n=i){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[o]=r["10.36.0"]||{};return s[t]||(s[t]=e())}function Z(t){if(!("console"in i))return t();const e=i.console,n={},r=Object.keys(c);r.forEach((t=>{const r=c[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}function tt(){at().enabled=!0}function et(){at().enabled=!1}function nt(){return at().enabled}function rt(...t){ot("log",...t)}function st(...t){ot("warn",...t)}function it(...t){ot("error",...t)}function ot(t,...e){s&&nt()&&Z((()=>{i.console[t](`${a}[${t}]:`,...e)}))}function at(){return s?X("loggerSettings",(()=>({enabled:!1}))):{enabled:!1}}function ct(...t){const e=t.sort(((t,e)=>t[0]-e[0])).map((t=>t[1]));return(t,n=0,r=0)=>{const s=[],i=t.split("\n");for(let o=n;o<i.length;o++){let t=i[o];t.length>1024&&(t=t.slice(0,1024));const n=d.test(t)?t.replace(d,"$1"):t;if(!n.match(/\S*Error: /)){for(const t of e){const e=t(n);if(e){s.push(e);break}}if(s.length>=p+r)break}}return function(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(ut(e).function||"")&&e.pop(),e.reverse(),f.test(ut(e).function||"")&&(e.pop(),f.test(ut(e).function||"")&&e.pop()),e.slice(0,p).map((t=>({...t,filename:t.filename||ut(e).filename,function:t.function||"?"})))}(s.slice(r))}}function ut(t){return t[t.length-1]||{}}function pt(t){try{return t&&"function"==typeof t&&t.name||l}catch{return l}}function dt(t){return"__v_isVNode"in t&&t.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function ft(t){switch(h.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return bt(t,Error)}}function lt(t,e){return h.call(t)===`[object ${e}]`}function ht(t){return lt(t,"String")}function _t(t){return"object"==typeof t&&null!==t&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function mt(t){return lt(t,"Object")}function gt(t){return"undefined"!=typeof Event&&bt(t,Event)}function yt(t){return Boolean(t?.then&&"function"==typeof t.then)}function bt(t,e){try{return t instanceof e}catch{return!1}}function St(t){return!("object"!=typeof t||null===t||!(t.__isVue||t._isVue||t.__v_isVNode))}function vt(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let i=0,o=0;const a=" > ",c=3;let u;const p=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||m;for(;n&&i++<r&&(u=xt(n,p),!("html"===u||i>1&&o+s.length*c+u.length>=d));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function xt(t,e){const n=t,r=[];if(!n?.tagName)return"";if(_.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=e?.length?e.filter((t=>n.getAttribute(t))).map((t=>[t,n.getAttribute(t)])):null;if(s?.length)s.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else{n.id&&r.push(`#${n.id}`);const t=n.className;if(t&&ht(t)){const e=t.split(/\s+/);for(const t of e)r.push(`.${t}`)}}for(const i of["aria-label","type","name","title","alt"]){const t=n.getAttribute(i);t&&r.push(`[${i}="${t}"]`)}return r.join("")}function kt(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{s&&u.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function It(t,e){try{t.prototype=e.prototype=e.prototype||{},kt(t,"__sentry_original__",e)}catch{}}function Et(t){if(ft(t))return{message:t.message,name:t.name,stack:t.stack,...Tt(t)};if(gt(t)){const e={type:t.type,target:wt(t.target),currentTarget:wt(t.currentTarget),...Tt(t)};return"undefined"!=typeof CustomEvent&&bt(t,CustomEvent)&&(e.detail=t.detail),e}return t}function wt(t){try{return e=t,"undefined"!=typeof Element&&bt(e,Element)?vt(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}var e}function Tt(t){if("object"==typeof t&&null!==t){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function At(t){if(void 0!==g)return g?g(t):t();const e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=i;return e in n&&"function"==typeof n[e]?(g=n[e])(t):(g=null,t())}function Ct(){return At((()=>Math.random()))}function Dt(){return At((()=>Date.now()))}function Ot(t,e=0){return"string"!=typeof t||0===e||t.length<=e?t:`${t.slice(0,e)}...`}function $t(t,e,n=!1){return!!ht(t)&&(lt(e,"RegExp")?e.test(t):!!ht(e)&&(n?t===e:t.includes(e)))}function Nt(t=function(){const t=i;return t.crypto||t.msCrypto}()){try{if(t?.randomUUID)return At((()=>t.randomUUID())).replace(/-/g,"")}catch{}return y||(y="10000000100040008000100000000000"),y.replace(/[018]/g,(t=>(t^(16*Ct()&15)>>t/4).toString(16)))}function Pt(t){return t.exception?.values?.[0]}function jt(t,e){const n=Pt(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const t={...r?.data,...e.data};n.mechanism.data=t}}function Rt(){return Dt()/b}function Mt(){return(S??(S=function(){const{performance:t}=i;if(!t?.now||!t.timeOrigin)return Rt;const e=t.timeOrigin;return()=>(e+At((()=>t.now())))/b}()))()}function Lt(t){const e=Mt(),n={sid:Nt(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return{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}}}(n)};return t&&Ut(n,t),n}function Ut(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Mt(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:Nt()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Jt(t,e,n=2){if(!e||"object"!=typeof e||n<=0)return e;if(t&&0===Object.keys(e).length)return t;const r={...t};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Jt(r[s],e[s],n-1));return r}function Ft(){return Nt()}function Yt(){return Nt().substring(16)}function zt(t,e){e?kt(t,v,e):delete t[v]}function Vt(t){return t[v]}function Ht(){const t=Q(q());return t.stack=t.stack||new k(X("defaultCurrentScope",(()=>new x)),X("defaultIsolationScope",(()=>new x)))}function Bt(t){return Ht().withScope(t)}function Wt(t,e){const n=Ht();return n.withScope((()=>(n.getStackTop().scope=t,e(t))))}function Gt(t){return Ht().withScope((()=>t(Ht().getIsolationScope())))}function Kt(t){const e=Q(t);return e.acs?e.acs:{withIsolationScope:Gt,withScope:Bt,withSetScope:Wt,withSetIsolationScope:(t,e)=>Gt(e),getCurrentScope:()=>Ht().getScope(),getIsolationScope:()=>Ht().getIsolationScope()}}function qt(){return Kt(q()).getCurrentScope()}function Qt(){return Kt(q()).getIsolationScope()}function Xt(...t){const e=Kt(q());if(2===t.length){const[n,r]=t;return n?e.withSetScope(n,r):e.withScope(r)}return e.withScope(t[0])}function Zt(){return qt().getClient()}function te(t){if(t){if("object"==typeof t&&"deref"in t&&"function"==typeof t.deref)try{return t.deref()}catch{return}return t}}function ee(t,e,n){t&&(kt(t,$,function(t){try{const e=i.WeakRef;if("function"==typeof e)return new e(t)}catch{}return t}(n)),kt(t,O,e))}function ne(t){const e=t;return{scope:e[O],isolationScope:te(e[$])}}function re(t){const e=function(t){if(t&&(ht(t)||Array.isArray(t)))return Array.isArray(t)?t.reduce(((t,e)=>{const n=se(e);return Object.entries(n).forEach((([e,n])=>{t[e]=n})),t}),{}):se(t)}(t);if(!e)return;const n=Object.entries(e).reduce(((t,[e,n])=>(e.match(N)&&(t[e.slice(7)]=n),t)),{});return Object.keys(n).length>0?n:void 0}function se(t){return t.split(",").map((t=>{const e=t.indexOf("=");return-1===e?[]:[t.slice(0,e),t.slice(e+1)].map((t=>{try{return decodeURIComponent(t.trim())}catch{return}}))})).reduce(((t,[e,n])=>(e&&n&&(t[e]=n),t)),{})}function ie(t,e=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${o}`}function oe(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function ae(t){const e=t.getOptions(),{host:n}=t.getDsn()||{};let r;return e.orgId?r=String(e.orgId):n&&(r=function(t){return t.match(P)?.[1]}(n)),r}function ce(t){if("boolean"==typeof t)return Number(t);const e="string"==typeof t?parseFloat(t):t;return"number"!=typeof e||isNaN(e)||e<0||e>1?void 0:e}function ue(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:a,links:c}=he(t);return{parent_span_id:i,span_id:e,trace_id:n,data:r,op:s,status:o,origin:a,links:c}}function pe(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext(),s=r?e:he(t).parent_span_id,i=ne(t).scope;return{parent_span_id:s,span_id:r?i?.getPropagationContext().propagationSpanId||Yt():e,trace_id:n}}function de(t){return t&&t.length>0?t.map((({context:{spanId:t,traceId:e,traceFlags:n,...r},attributes:s})=>({span_id:t,trace_id:e,sampled:1===n,attributes:s,...r}))):void 0}function fe(t){return"number"==typeof t?le(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?le(t.getTime()):Mt()}function le(t){return t>9999999999?t/1e3:t}function he(t){if(function(t){return"function"==typeof t.getSpanJSON}(t))return t.getSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(function(t){const e=t;return!!(e.attributes&&e.startTime&&e.name&&e.endTime&&e.status)}(t)){const{attributes:r,startTime:s,name:i,endTime:o,status:a,links:c}=t;return{span_id:e,trace_id:n,data:r,description:i,parent_span_id:"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0,start_timestamp:fe(s),timestamp:fe(o)||void 0,status:me(a),op:r[w],origin:r[T],links:de(c)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function _e(t){const{traceFlags:e}=t.spanContext();return 1===e}function me(t){if(t&&0!==t.code)return 1===t.code?"ok":t.message||"internal_error"}function ge(t,e){kt(e,L,t[L]||t),t[M]?t[M].add(e):kt(t,M,new Set([e]))}function ye(t){return t[L]||t}function be(){R||(Z((()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")})),R=!0)}function Se(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=t||Zt()?.getOptions();return!(!e||null==e.tracesSampleRate&&!e.tracesSampler)}function ve(t){u.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function xe(t,e){if(!e?.length||!t.description)return!1;for(const r of e){if("string"==typeof(n=r)||n instanceof RegExp){if($t(t.description,r))return s&&ve(t),!0;continue}if(!r.name&&!r.op)continue;const e=!r.name||$t(t.description,r.name),i=!r.op||t.op&&$t(t.op,r.op);if(e&&i)return s&&ve(t),!0}var n;return!1}function ke(t,e){kt(t,U,e)}function Ie(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},s={environment:n.environment||"production",release:n.release,public_key:r,trace_id:t,org_id:ae(e)};return e.emit("createDsc",s),s}function Ee(t){const e=Zt();if(!e)return{};const n=ye(t),r=he(n),s=r.data,i=n.spanContext().traceState,o=i?.get("sentry.sample_rate")??s["sentry.sample_rate"]??s["sentry.previous_trace_sample_rate"];function a(t){return"number"!=typeof o&&"string"!=typeof o||(t.sample_rate=`${o}`),t}const c=n[U];if(c)return a(c);const u=i?.get("sentry.dsc"),p=u&&re(u);if(p)return a(p);const d=Ie(t.spanContext().traceId,e),f=s[I],l=r.description;return"url"!==f&&l&&(d.transaction=l),Se()&&(d.sampled=String(_e(n)),d.sample_rand=i?.get("sentry.sample_rand")??ne(n).scope?.getPropagationContext().sampleRand.toString()),a(d),e.emit("createDsc",d,n),d}function we(t,e=100,n=1/0){try{return Te("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Te(t,e,n=1/0,s=1/0,i=function(){const t=new WeakSet;function e(e){return!!t.has(e)||(t.add(e),!1)}function n(e){t.delete(e)}return[e,n]}()){const[o,a]=i;if(null==e||["boolean","string"].includes(typeof e)||"number"==typeof e&&Number.isFinite(e))return e;const c=function(t,e){try{if("domain"===t&&e&&"object"==typeof e&&e._events)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if(void 0!==r&&e===r)return"[Global]";if("undefined"!=typeof window&&e===window)return"[Window]";if("undefined"!=typeof document&&e===document)return"[Document]";if(St(e))return dt(e);if(mt(n=e)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"==typeof e&&!Number.isFinite(e))return`[${e}]`;if("function"==typeof e)return`[Function: ${pt(e)}]`;if("symbol"==typeof e)return`[${String(e)}]`;if("bigint"==typeof e)return`[BigInt: ${String(e)}]`;const s=function(t){const e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}(e);return/^HTML(\w*)Element$/.test(s)?`[HTMLElement: ${s}]`:`[object ${s}]`}catch(s){return`**non-serializable** (${s})`}var n}(t,e);if(!c.startsWith("[object "))return c;if(e.__sentry_skip_normalization__)return e;const u="number"==typeof e.__sentry_override_normalization_depth__?e.__sentry_override_normalization_depth__:n;if(0===u)return c.replace("object ","");if(o(e))return"[Circular ~]";const p=e;if(p&&"function"==typeof p.toJSON)try{return Te("",p.toJSON(),u-1,s,i)}catch{}const d=Array.isArray(e)?[]:{};let f=0;const l=Et(e);for(const r in l){if(!Object.prototype.hasOwnProperty.call(l,r))continue;if(f>=s){d[r]="[MaxProperties ~]";break}const t=l[r];d[r]=Te(r,t,u-1,s,i),f++}return a(e),d}function Ae(t,e=[]){return[t,e]}function Ce(t,e){const n=t[1];for(const r of n)if(e(r,r[0].type))return!0;return!1}function De(t){const e=Q(i);return e.encodePolyfill?e.encodePolyfill(t):(new TextEncoder).encode(t)}function Oe(t){return[{type:"span"},t]}function $e(t){if(!t?.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function Ne(t){if(!t||0===t.length)return;const e={};return t.forEach((t=>{const n=t.attributes||{},r=n[A],s=n[C];"string"==typeof r&&"number"==typeof s&&(e[t.name]={value:s,unit:r})})),e}function Pe(t){return t&&"number"==typeof t||t instanceof Date||Array.isArray(t)}function je(t){return!!(t.start_timestamp&&t.timestamp&&t.span_id&&t.trace_id)}function Re(){return Kt(q())}function Me(t,e,n){const r=Zt(),i=r?.getOptions()||{},{name:o=""}=t,a={spanAttributes:{...t.attributes},spanName:o,parentSampled:n};r?.emit("beforeSampling",a,{decision:!1});const c=a.parentSampled??n,p=a.spanAttributes,d=e.getPropagationContext(),[f,l,h]=e.getScopeData().sdkProcessingMetadata[z]?[!1]:function(t,e,n){if(!Se(t))return[!1];let r,i;"function"==typeof t.tracesSampler?(i=t.tracesSampler({...e,inheritOrSampleWith:t=>"number"==typeof e.parentSampleRate?e.parentSampleRate:"boolean"==typeof e.parentSampled?Number(e.parentSampled):t}),r=!0):void 0!==e.parentSampled?i=e.parentSampled:void 0!==t.tracesSampleRate&&(i=t.tracesSampleRate,r=!0);const o=ce(i);if(void 0===o)return s&&u.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!o)return s&&u.log("[Tracing] Discarding transaction because "+("function"==typeof t.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),[!1,o,r];const a=n<o;return a||s&&u.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[a,o,r]}(i,{name:o,parentSampled:c,attributes:p,parentSampleRate:ce(d.dsc?.sample_rate)},d.sampleRand),_=new Y({...t,attributes:{[I]:"custom",[E]:void 0!==l&&h?l:void 0,...p},sampled:f});return!f&&r&&(s&&u.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",_),_}function Le(t){return new V((e=>{e(t)}))}function Ue(t){return new V(((e,n)=>{n(t)}))}function Je(t,e,n,r=0){try{const s=Fe(e,n,t,r);return yt(s)?s:Le(s)}catch(it){return Ue(it)}}function Fe(t,e,n,r){const i=n[r];if(!t||!i)return t;const o=i({...t},e);return s&&null===o&&u.log(`Event processor "${i.id||"?"}" dropped event`),yt(o)?o.then((t=>Fe(t,e,n,r+1))):Fe(o,e,n,r+1)}function Ye(t,e){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=e;!function(t,e){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:a}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(s).length&&(t.user={...s,...t.user}),Object.keys(i).length&&(t.contexts={...i,...t.contexts}),o&&(t.level=o),a&&"transaction"!==t.type&&(t.transaction=a)}(t,e),r&&function(t,e){t.contexts={trace:pe(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Ee(e),...t.sdkProcessingMetadata};const n=he(ye(e)).description;n&&!t.transaction&&"transaction"===t.type&&(t.transaction=n)}(t,r),function(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}(t,n),function(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}(t,s),function(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}(t,i)}function ze(t,e){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:p,eventProcessors:d,attachments:f,propagationContext:l,transactionName:h,span:_}=e;Ve(t,"extra",n),Ve(t,"tags",r),Ve(t,"attributes",s),Ve(t,"user",i),Ve(t,"contexts",o),t.sdkProcessingMetadata=Jt(t.sdkProcessingMetadata,c,2),a&&(t.level=a),h&&(t.transactionName=h),_&&(t.span=_),u.length&&(t.breadcrumbs=[...t.breadcrumbs,...u]),p.length&&(t.fingerprint=[...t.fingerprint,...p]),d.length&&(t.eventProcessors=[...t.eventProcessors,...d]),f.length&&(t.attachments=[...t.attachments,...f]),t.propagationContext={...t.propagationContext,...l}}function Ve(t,e,n){t[e]=Jt(t[e],n,1)}function He(t,e){const n=X("globalScope",(()=>new x)).getScopeData();return t&&ze(n,t.getScopeData()),e&&ze(n,e.getScopeData()),n}function Be(t){if(t)return function(t){return t instanceof x||"function"==typeof t}(t)||function(t){return Object.keys(t).some((t=>K.includes(t)))}(t)?{captureContext:t}:t}function We(){const t=Qt(),e=qt().getSession()||t.getSession();e&&function(t,e){let n={};e?n={status:e}:"ok"===t.status&&(n={status:"exited"}),Ut(t,n)}(e),Ge(),t.setSession()}function Ge(){const t=Qt(),e=Zt(),n=t.getSession();n&&e&&e.captureSession(n)}return t({$:kt,A:ie,B:Jt,D:function(){const t=Kt(q());return t.getActiveSpan?t.getActiveSpan():Vt(qt())},Dt:X,E:Se,F:Zt,G:function(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")},H:Rt,I:qt,J:Nt,K:function(t){if(function(t){try{return t.__sentry_captured__}catch{}}(t))return!0;try{kt(t,"__sentry_captured__",!0)}catch{}return!1},L:Qt,O:be,Q:Ct,R:function(t){const{traceId:e,parentSpanId:n,propagationSpanId:r}=t.getPropagationContext(),s={trace_id:e,span_id:r||Yt()};return n&&(s.parent_span_id=n),s},S:function(t,e){const n=e.getPropagationContext();return n.dsc||Ie(n.traceId,t)},St:function(t){return Array.isArray(t)?ct(...t):t},T:xe,U:Mt,V:Ut,W:jt,X:function(t,e=[],n=!1){return e.some((e=>$t(t,e,n)))},Y:function(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const e=t[r];try{St(e)?n.push(dt(e)):n.push(String(e))}catch{n.push("[value cannot be serialized]")}}return n.join(e)},Z:Dt,_:function(t,e){return Ce(t,((t,n)=>e.includes(n)))},_t:ht,a:function(t,e){Qt().setTag(t,e)},at:function(){try{return _.document.location.href}catch{return""}},b:function(t){const[e,n]=t;let r=JSON.stringify(e);function s(t){"string"==typeof r?r="string"==typeof t?r+t:[De(r),t]:r.push("string"==typeof t?De(t):t)}for(const i of n){const[t,e]=i;if(s(`\n${JSON.stringify(t)}\n`),"string"==typeof e||e instanceof Uint8Array)s(e);else{let t;try{t=JSON.stringify(e)}catch{t=JSON.stringify(we(e))}s(t)}}return"string"==typeof r?r:function(t){const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}(r)},bt:function(t){const e=t.exception;if(e){const t=[];try{return e.values.forEach((e=>{e.stacktrace.frames&&t.push(...e.stacktrace.frames)})),t}catch{return}}},c:function(t,e,n,r,s,o){const{normalizeDepth:a=3,normalizeMaxBreadth:c=1e3}=t,u={...e,event_id:e.event_id||n.event_id||Nt(),timestamp:e.timestamp||Rt()},p=n.integrations||t.integrations.map((t=>t.name));!function(t,e){const{environment:n,release:r,dist:s,maxValueLength:i}=e;t.environment=t.environment||n||"production",!t.release&&r&&(t.release=r),!t.dist&&s&&(t.dist=s);const o=t.request;o?.url&&i&&(o.url=Ot(o.url,i)),i&&t.exception?.values?.forEach((t=>{t.value&&(t.value=Ot(t.value,i))}))}(u,t),function(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}(u,p),s&&s.emit("applyFrameMetadata",e),void 0===e.type&&function(t,e){const n=function(t){const e=i._sentryDebugIds,n=i._debugIds;if(!e&&!n)return{};const r=e?Object.keys(e):[],s=n?Object.keys(n):[];if(G&&r.length===B&&s.length===W)return G;B=r.length,W=s.length,G={},H||(H={});const o=(e,n)=>{for(const r of e){const e=n[r],s=H?.[r];if(s&&G&&e)G[s[0]]=e,H&&(H[r]=[s[0],e]);else if(e){const n=t(r);for(let t=n.length-1;t>=0;t--){const s=n[t]?.filename;if(s&&G&&H){G[s]=e,H[r]=[s,e];break}}}}};return e&&o(r,e),n&&o(s,n),G}(e);t.exception?.values?.forEach((t=>{t.stacktrace?.frames?.forEach((t=>{t.filename&&(t.debug_id=n[t.filename])}))}))}(u,t.stackParser);const d=function(t,e){if(!e)return t;const n=t?t.clone():new x;return n.update(e),n}(r,n.captureContext);n.mechanism&&jt(u,n.mechanism);const f=s?s.getEventProcessors():[],l=He(o,d),h=[...n.attachments||[],...l.attachments];return h.length&&(n.attachments=h),Ye(u,l),Je([...f,...l.eventProcessors],u,n).then((t=>(t&&function(t){const e={};if(t.exception?.values?.forEach((t=>{t.stacktrace?.frames?.forEach((t=>{t.debug_id&&(t.abs_path?e[t.abs_path]=t.debug_id:t.filename&&(e[t.filename]=t.debug_id),delete t.debug_id)}))})),0===Object.keys(e).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.entries(e).forEach((([t,e])=>{n.push({type:"sourcemap",code_file:t,debug_id:e})}))}(t),"number"==typeof a&&a>0?function(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((t=>({...t,...t.data&&{data:we(t.data,e,n)}})))},...t.user&&{user:we(t.user,e,n)},...t.contexts&&{contexts:we(t.contexts,e,n)},...t.extra&&{extra:we(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=we(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map((t=>({...t,...t.data&&{data:we(t.data,e,n)}})))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=we(t.contexts.flags,3,n)),r}(t,a,c):t)))},ct:function(t){return lt(t,"DOMException")},d:function(t){const e=Re();if(e.startInactiveSpan)return e.startInactiveSpan(t);const n=function(t){const e={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){const n={...e};return n.startTimestamp=fe(t.startTime),delete n.startTime,n}return e}(t),{forceTransaction:r,parentSpan:i}=t;return(t.scope?e=>Xt(t.scope,e):void 0!==i?t=>function(t,e){const n=Re();return n.withActiveSpan?n.withActiveSpan(t,e):Xt((n=>(zt(n,t||void 0),e(n))))}(i,t):t=>t())((()=>{const e=qt(),o=function(t,e){if(e)return e;if(null===e)return;const n=Vt(t);if(!n)return;const r=Zt();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?ye(n):n}(e,i);return t.onlyIfParent&&!o?new J:function({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){if(!Se()){const r=new J;return!n&&t||ke(r,{sampled:"false",sample_rate:"0",transaction:e.name,...Ee(r)}),r}const i=Qt();let o;if(t&&!n)o=function(t,e,n){const{spanId:r,traceId:s}=t.spanContext(),i=!e.getScopeData().sdkProcessingMetadata[z]&&_e(t),o=i?new Y({...n,parentSpanId:r,traceId:s,sampled:i}):new J({traceId:s});ge(t,o);const a=Zt();return a&&(a.emit("spanStart",o),n.endTimestamp&&a.emit("spanEnd",o)),o}(t,r,e),ge(t,o);else if(t){const n=Ee(t),{traceId:s,spanId:i}=t.spanContext(),a=_e(t);o=Me({traceId:s,parentSpanId:i,...e},r,a),ke(o,n)}else{const{traceId:t,dsc:n,parentSpanId:s,sampled:a}={...i.getPropagationContext(),...r.getPropagationContext()};o=Me({traceId:t,parentSpanId:s,...e},r,a),n&&ke(o,n)}return function(t){if(!s)return;const{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=he(t),{spanId:i}=t.spanContext(),o=_e(t),a=ye(t),c=a===t,p=`[Tracing] Starting ${o?"sampled":"unsampled"} ${c?"root ":""}span`,d=[`op: ${n}`,`name: ${e}`,`ID: ${i}`];if(r&&d.push(`parent ID: ${r}`),!c){const{op:t,description:e}=he(a);d.push(`root ID: ${a.spanContext().spanId}`),t&&d.push(`root op: ${t}`),e&&d.push(`root description: ${e}`)}u.log(`${p}\n ${d.join("\n ")}`)}(o),ee(o,r,i),o}({parentSpan:o,spanArguments:n,forceTransaction:r,scope:e})}))},dt:gt,et:function(t){const e=Object.keys(Et(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"},f:function(t,e,n,r){const s=$e(n),i=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,e){if(!e)return t;const n=t.sdk||{};t.sdk={...n,name:n.name||e.name,version:n.version||e.version,integrations:[...t.sdk?.integrations||[],...e.integrations||[]],packages:[...t.sdk?.packages||[],...e.packages||[]],settings:t.sdk?.settings||e.settings?{...t.sdk?.settings,...e.settings}:void 0}}(t,n?.sdk);const o=function(t,e,n,r){const s=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:ie(r)},...s&&{trace:s}}}(t,s,r,e);return delete t.sdkProcessingMetadata,Ae(o,[[{type:i},t]])},ft:bt,g:Ae,gt:function(t){return"undefined"!=typeof Request&&bt(t,Request)},h:function(t){const e="string"==typeof t.data?De(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]},ht:function(t){return null===t||_t(t)||"object"!=typeof t&&"function"!=typeof t},i:function(t=!1){t?We():Ge()},it:function(t){if(!_.HTMLElement)return null;let e=t;for(let n=0;n<5;n++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null},j:function(t){const e="string"==typeof t?function(t){const e=j.exec(t);if(!e)return void Z((()=>{console.error(`Invalid Sentry Dsn: ${t}`)}));const[n,r,s="",i="",o="",a=""]=e.slice(1);let c="",u=a;const p=u.split("/");if(p.length>1&&(c=p.slice(0,-1).join("/"),u=p.pop()),u){const t=u.match(/^\d+/);t&&(u=t[0])}return oe({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}(t):oe(t);if(e&&function(t){if(!s)return!0;const{port:e,projectId:n,protocol:r}=t;return!(["protocol","publicKey","host","projectId"].find((e=>!t[e]&&(u.error(`Invalid Sentry Dsn: ${e} missing`),!0)))||(n.match(/^\d+$/)?function(t){return"http"===t||"https"===t}(r)?e&&isNaN(parseInt(e,10))&&(u.error(`Invalid Sentry Dsn: Invalid port ${e}`),1):(u.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(u.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(e))return e},k:ce,l:Ue,lt:ft,m:function(t,e){const[n,r]=t;return[n,[...r,e]]},mt:mt,n:function(t,e){return qt().captureException(t,Be(e))},nt:function(t){return t.__sentry_original__},o:function(t){Qt().setUser(t)},ot:vt,p:function(t,e,n,r){const s=$e(n);return Ae({sent_at:(new Date).toISOString(),...s&&{sdk:s},...!!r&&e&&{dsn:ie(e)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])},pt:_t,q:function(t){const{message:e,event_id:n}=t;if(e)return e;const r=Pt(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"},r:function(t,e){const n="string"==typeof e?e:void 0,r="string"!=typeof e?{captureContext:e}:void 0;return qt().captureMessage(t,n,r)},rt:It,s:function(t){const e=Qt(),n=qt(),{userAgent:r}=i.navigator||{},s=Lt({user:n.getUser()||e.getUser(),...r&&{userAgent:r},...t}),o=e.getSession();return"ok"===o?.status&&Ut(o,{status:"exited"}),We(),e.setSession(s),s},st:function(t){return lt(t,"DOMError")},t:function(t,e){return qt().captureEvent(t,e)},tt:function(t,e,n){if(!(e in t))return;const r=t[e];if("function"!=typeof r)return;const i=n(r);"function"==typeof i&&It(i,r);try{t[e]=i}catch{s&&u.log(`Failed to replace method "${e}" in object`,t)}},u:Le,ut:function(t){return lt(t,"ErrorEvent")},v:function(t){return F[t]},vt:yt,w:function(t,e){const n=e.parent_span_id,r=e.span_id;if(n)for(const s of t)s.parent_span_id===r&&(s.parent_span_id=n)},wt:Z,x:function t(e,n=3,r=102400){const s=we(e,n);return i=s,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(i))>r?t(e,n-1,r):s;var i},xt:pt,y:Ce,yt:ct,z:Xt}),{setters:[function(t){n=t.En,r=t.Tn}],execute:function(){try{e="undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(g=(new e.Error).stack)&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[g]="9ad6936b-5596-4af3-934f-b5f82e60e881",e._sentryDebugIdIdentifier="sentry-dbid-9ad6936b-5596-4af3-934f-b5f82e60e881")}catch(e){}var e,g;t("At",s="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__),t("kt",i=globalThis),t("Ot",o="10.36.0"),t("Ct",["debug","info","warn","error","log","assert","trace"]),a="Sentry Logger ",t("Et",c={}),t("Tt",u={enable:tt,disable:et,isEnabled:nt,log:rt,warn:st,error:it}),p=50,d=/\(error: (.*)\)/,f=/captureMessage|captureException/,l="<anonymous>",h=Object.prototype.toString,_=i,m=80,b=1e3,v="_sentrySpan",x=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ft(),sampleRand:Ct()}}clone(){const e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,zt(e,Vt(this)),e}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ut(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this.setTags({[t]:e})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,e){return this.setAttributes({[t]:e})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n="function"==typeof e?e(this):e,{tags:r,attributes:s,extra:i,user:o,contexts:a,level:c,fingerprint:u=[],propagationContext:p}=(n instanceof t?n.getScopeData():mt(n)?e:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...a},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),p&&(this._propagationContext=p),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,zt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ft(),sampleRand:Ct()}),this._notifyScopeListeners(),this}addBreadcrumb(t,e){const n="number"==typeof e?e:100;if(n<=0)return this;const r={timestamp:Rt(),...t,message:t.message?Ot(t.message,2048):t.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Vt(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Jt(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,e){const n=e?.event_id||Nt();if(!this._client)return s&&u.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...e,event_id:n},this),n}captureMessage(t,e,n){const r=n?.event_id||Nt();if(!this._client)return s&&u.warn("No client configured on scope - will not capture message!"),r;const i=n?.syntheticException??new Error(t);return this._client.captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:r},this),r}captureEvent(t,e){const n=e?.event_id||Nt();return this._client?(this._client.captureEvent(t,{...e,event_id:n},this),n):(s&&u.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}},k=class{constructor(t,e){let n,r;n=t||new x,r=e||new x,this._stack=[{scope:n}],this._isolationScope=r}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(e){throw this._popScope(),e}return yt(r)?r.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return!(this._stack.length<=1||!this._stack.pop())}},I="sentry.source",E="sentry.sample_rate",w="sentry.op",t("P",T="sentry.origin"),A="sentry.measurement_unit",C="sentry.measurement_value",D="sentry.custom_span_name",t("N","sentry.profile_id"),t("M","sentry.exclusive_time"),O="_sentryScope",$="_sentryIsolationScope",N=/^sentry-/,P=/^o(\d+)\./,j=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/,R=!1,M="_sentryChildSpans",L="_sentryRootSpan",t("C","production"),U="_frozenDsc",J=class{constructor(t={}){this._traceId=t.traceId||Ft(),this._spanId=t.spanId||Yt()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(t){}setAttribute(t,e){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,e,n){return this}addLink(t){return this}addLinks(t){return this}recordException(t,e){}},n(),F={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"},Y=class{constructor(t={}){this._traceId=t.traceId||Ft(),this._spanId=t.spanId||Yt(),this._startTime=t.startTimestamp||Mt(),this._links=t.links,this._attributes={},this.setAttributes({[T]:"manual",[w]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,e){}spanContext(){const{_spanId:t,_traceId:e,_sampled:n}=this;return{spanId:t,traceId:e,traceFlags:n?1:0}}setAttribute(t,e){return void 0===e?delete this._attributes[t]:this._attributes[t]=e,this}setAttributes(t){return Object.keys(t).forEach((e=>this.setAttribute(e,t[e]))),this}updateStartTime(t){this._startTime=fe(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(I,"custom"),this}end(t){this._endTime||(this._endTime=fe(t),function(t){if(!s)return;const{description:e="< unknown name >",op:n="< unknown op >"}=he(t),{spanId:r}=t.spanContext(),i=`[Tracing] Finishing "${n}" ${ye(t)===t?"root ":""}span "${e}" with ID ${r}`;u.log(i)}(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[w],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:me(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[T],profile_id:this._attributes["sentry.profile_id"],exclusive_time:this._attributes["sentry.exclusive_time"],measurements:Ne(this._events),is_segment:this._isStandaloneSpan&&ye(this)===this||void 0,segment_id:this._isStandaloneSpan?ye(this).spanContext().spanId:void 0,links:de(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,e,n){s&&u.log("[Tracing] Adding an event to span:",t);const r=Pe(e)?e:n||Mt(),i=Pe(e)?{}:e||{},o={name:t,time:fe(r),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=Zt();if(t&&t.emit("spanEnd",this),!this._isStandaloneSpan&&this!==ye(this))return;if(this._isStandaloneSpan)return void(this._sampled?function(t){const e=Zt();if(!e)return;const n=t[1];n&&0!==n.length?e.sendEnvelope(t):e.recordDroppedEvent("before_send","span")}(function(t,e){const n=Ee(t[0]),r=e?.getDsn(),s=e?.getOptions().tunnel,i={sent_at:(new Date).toISOString(),...function(t){return!!t.trace_id&&!!t.public_key}(n)&&{trace:n},...!!s&&r&&{dsn:ie(r)}},{beforeSendSpan:o,ignoreSpans:a}=e?.getOptions()||{},c=a?.length?t.filter((t=>!xe(he(t),a))):t,u=t.length-c.length;u&&e?.recordDroppedEvent("before_send","span",u);const p=o?t=>{const e=he(t);return o(e)||(be(),e)}:he,d=[];for(const f of c){const t=p(f);t&&d.push(Oe(t))}return Ae(i,d)}([this],t)):(s&&u.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span")));const e=this._convertSpanToTransaction();e&&(ne(this).scope||qt()).captureEvent(e)}_convertSpanToTransaction(){if(!je(he(this)))return;this._name||(s&&u.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:e}=ne(this),n=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(!0!==this._sampled)return;const r=function(t){const e=new Set;return function t(n){if(!e.has(n)&&_e(n)){e.add(n);const r=n[M]?Array.from(n[M]):[];for(const e of r)t(e)}}(t),Array.from(e)}(this).filter((t=>t!==this&&!function(t){return t instanceof Y&&t.isStandaloneSpan()}(t))).map((t=>he(t))).filter(je),i=this._attributes[I];delete this._attributes[D],r.forEach((t=>{delete t.data[D]}));const o={contexts:{trace:ue(this)},spans:r.length>1e3?r.sort(((t,e)=>t.start_timestamp-e.start_timestamp)).slice(0,1e3):r,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:e,dynamicSamplingContext:Ee(this)},request:n,...i&&{transaction_info:{source:i}}},a=Ne(this._events);return a&&Object.keys(a).length&&(s&&u.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),o.measurements=a),o}},z="__SENTRY_SUPPRESS_TRACING__",V=class t{constructor(t){this._state=0,this._handlers=[],this._runExecutor(t)}then(n,r){return new t(((t,s)=>{this._handlers.push([!1,r=>{if(n)try{t(n(r))}catch(e){s(e)}else t(r)},n=>{if(r)try{t(r(n))}catch(e){s(e)}else s(n)}]),this._executeHandlers()}))}catch(t){return this.then((t=>t),t)}finally(e){return new t(((t,n)=>{let r,s;return this.then((t=>{s=!1,r=t,e&&e()}),(t=>{s=!0,r=t,e&&e()})).then((()=>{s?n(r):t(r)}))}))}_executeHandlers(){if(0===this._state)return;const t=this._handlers.slice();this._handlers=[],t.forEach((t=>{t[0]||(1===this._state&&t[1](this._value),2===this._state&&t[2](this._value),t[0]=!0)}))}_runExecutor(t){const n=(t,e)=>{0===this._state&&(yt(e)?e.then(r,s):(this._state=t,this._value=e,this._executeHandlers()))},r=t=>{n(1,t)},s=t=>{n(2,t)};try{t(r,s)}catch(e){s(e)}}},K=["user","level","extra","contexts","tags","fingerprint","propagationContext"]}}}));
//# sourceMappingURL=exports-legacy-BC_zzayu.js.map