The only tool you need to know what is happening and how to fix it.
Go alertingexception-trackerissue-trackinglogsmetricsmonitoringobservability-platformopen-telemetryotelsession-replaytelemetrytraces
import"../chunks/DsnmJJEf.js";import{p as me,j as i,k as ve,b as pe,ac as he,l as t,e as D,f as m,g as e,u as n,d as g,a as xe,h as N,m as b,r as V,c as M}from"../chunks/BKFspo1J.js";import{i as I}from"../chunks/COK9M2N0.js";import{a as _e,g as ke}from"../chunks/CqMCVSVw.js";import{p as c,a as z,t as ye,d as be,e as Ie}from"../chunks/BrdmM8Kw.js";import{L as He}from"../chunks/CN84UmjY.js";import{E as G}from"../chunks/NVaYW5lc.js";import{g as je}from"../chunks/qSFdVk7G.js";import{f as we}from"../chunks/DbaB4N6s.js";import{l as Se,S as Ee,E as Pe,a as Ae}from"../chunks/R3guvEg1.js";import{P as Te}from"../chunks/N0z9j_AG.js";import{c as B}from"../chunks/h7yRWCtK.js";import{r as H}from"../chunks/UDuKBjKQ.js";import{A as Le}from"../chunks/D2Ejyvah.js";import{g as Oe}from"../chunks/Cv0CJCi1.js";const Fe=!1;function Me({params:v,url:a}){return{exceptionHash:v.exceptionHash,exceptionId:v.exceptionId,recordedAt:a.searchParams.get("t")}}const et=Object.freeze(Object.defineProperty({__proto__:null,load:Me,prerender:Fe},Symbol.toStringTag,{value:"Module"}));var ze=D('<div class="flex items-center justify-center py-20"><!></div>'),Be=D("<!> <!> <!>",1),De=D('<div class="space-y-6"><!> <!></div> <!>',1);function tt(v,a){me(a,!0);const K=n(je);let s=i(null),j=i(ve([])),w=i(!0),p=i(""),h=i(!1),S=i(0),E=i(null),P=i(null),A=i(null),x=i(!1),_=i(!1);const Q=n(()=>e(s)?.isMessage??!1),U=n(()=>(c.currentProject?.framework?be(c.currentProject.framework):!1)||Ie(e(s)?.attributes?.["telemetry.sdk.language"])),X=n(()=>c.currentProject?.framework==="flutter"),Y=n(()=>c.currentProject?.framework==="ios"||["ios","swift"].includes((e(s)?.attributes?.["telemetry.sdk.language"]??"").toLowerCase())),Z=n(()=>e(s)?.stackTrace.split(`
`)[0]||"Exception"),$=n(()=>e(S)>10),ee=n(()=>e(s)?`Event from ${we(e(s).recordedAt,{timezone:e(K)})}`:"Loading...");let l=0;async function T(){const o=++l;t(w,!0),t(p,""),t(h,!1),t(E,null),t(P,null);try{const r=await z.post(`/exception-stack-traces/by-id/${a.data.exceptionId}`,a.data.recordedAt?{recordedAt:a.data.recordedAt}:{},{projectId:c.currentProjectId??void 0});if(o!==l)return;if(t(s,r.exception,!0),t(E,Se(r.relatedEntity),!0),t(P,r.sessionRecording??null,!0),t(A,r.sessionId??null,!0),!e(s)){t(h,!0);return}const u=await z.post(`/exception-stack-traces/${a.data.exceptionHash}`,{pagination:{page:1,pageSize:10}},{projectId:c.currentProjectId??void 0});if(o!==l)return;t(j,u.occurrences||[],!0),t(S,u.pagination.total,!0)}catch(r){if(o!==l)return;console.error(r),_e(r)===404?t(h,!0):t(p,ke(r)||"Failed to load exception details",!0)}finally{o===l&&t(w,!1)}}async function te(o){t(_,!0);try{await z.post("/exception-stack-traces/archive",{hashes:[a.data.exceptionHash],resolvePages:o},{projectId:c.currentProjectId??void 0}),ye.success("Successfully archived the Issue"),Oe(H("/issues"))}catch(r){throw console.error("Archive failed:",r),r}finally{t(_,!1)}}pe(()=>(a.data.exceptionId,a.data.exceptionHash,a.data.recordedAt,c.currentProjectId,he(()=>{t(s,null),t(j,[],!0),t(A,null),T()}),()=>{l++}));var R=De(),L=m(R),J=N(L);{let o=n(()=>B({fallbackPath:H("/issues/[exceptionHash]",{exceptionHash:a.data.exceptionHash})}));Te(J,{get title(){return e(Z)},get subtitle(){return e(ee)},get onBack(){return e(o)}})}var re=b(J,2);{var ae=o=>{var r=ze(),u=N(r);He(u,{size:"xlg"}),V(r),g(o,r)},oe=o=>{var r=M(),u=m(r);{var ne=d=>{{let k=n(()=>B({fallbackPath:H("/issues/[exceptionHash]",{exceptionHash:a.data.exceptionHash})}));G(d,{status:404,title:"Event Not Found",description:"The specific event you're looking for doesn't exist or may have been removed.",get onBack(){return e(k)},backLabel:"Back to Exception",onRetry:()=>T()})}},ie=d=>{var k=M(),ce=m(k);{var le=f=>{{let y=n(()=>B({fallbackPath:H("/issues/[exceptionHash]",{exceptionHash:a.data.exceptionHash})}));G(f,{status:400,title:"Something Went Wrong",get description(){return e(p)},get onBack(){return e(y)},backLabel:"Back to Exception",onRetry:()=>T()})}},ue=f=>{var y=M(),de=m(y);{var fe=O=>{var C=Be(),q=m(C);Ee(q,{get stackTrace(){return e(s).stackTrace},get isMessage(){return e(Q)},get isJavaScript(){return e(U)},get isFlutter(){return e(X)},get isIOS(){return e(Y)},get showArchiveDialog(){return e(x)},set showArchiveDialog(F){t(x,F,!0)},get archiving(){return e(_)},set archiving(F){t(_,F,!0)}});var W=b(q,2);Pe(W,{get occurrence(){return e(s)},get linkedTrace(){return e(E)},get sessionRecording(){return e(P)},get sessionId(){return e(A)},title:"Event",description:"Details for this specific occurrence"});var ge=b(W,2);Ae(ge,{get occurrences(){return e(j)},get exceptionHash(){return a.data.exceptionHash},get total(){return e(S)},get hasMore(){return e($)},showViewAll:!0,get currentExceptionId(){return a.data.exceptionId}}),g(O,C)};I(de,O=>{e(s)&&O(fe)},!0)}g(f,y)};I(ce,f=>{e(p)?f(le):f(ue,!1)},!0)}g(d,k)};I(u,d=>{e(h)?d(ne):d(ie,!1)},!0)}g(o,r)};I(re,o=>{e(w)&&!e(s)?o(ae):o(oe,!1)})}V(L);var se=b(L,2);{let o=n(()=>[a.data.exceptionHash]);Le(se,{get open(){return e(x)},onOpenChange:r=>t(x,r,!0),count:1,get hashes(){return e(o)},onConfirm:te})}g(v,R),xe()}export{tt as component,et as universal};