import{_ as M,a as V}from"./CQblF2yi.js";import{_ as J}from"./C-XkP9tB.js";import{_ as P}from"./DFGWrG5M.js";import{_ as q}from"./BKofJQ5v.js";import{_ as I}from"./BtsG96Qa.js";import{_ as K}from"./BnFHREeV.js";import{_ as L}from"./BbCYHBXa.js";import{_ as U}from"./BXyDg5m4.js";import{d as z,N as O,a4 as W,i as G,ch as Q,a5 as X,e as s,o as t,a,l as c,c as u,w as l,m as r,F as d,r as x,q as Y,b as f,n as Z,t as y}from"./Dk4AzF7j.js";import"./C_tXuDKt.js";import"./CR2z6V-x.js";import"./D7D5X_-3.js";import"./DgCXB7yu.js";import"./CJbRX-Xv.js";import"./BOMWTB7S.js";import"./B_jJHUd2.js";import"./DMtpgJrn.js";import"./D5F0NbWF.js";import"./88opOQSr.js";import"./BJxNwbOK.js";import"./BTe-eGo6.js";import"./DXyvFCCy.js";import"./PJSlhYeJ.js";import"./NkNhW2e0.js";import"./Dptbt2z6.js";const ee={key:0,class:"flex items-center gap-2 flex-wrap o_mb-4"},te={key:1,class:"flex flex-col o_gap-6 @container/simpleresult"},re={class:"list-inside text-sm text-uiText-toned text-pretty max-w-[90ch] flex flex-col o_gap-1"},oe={class:"flex items-center o_gap-2"},se={class:"text-uiText-toned"},k="javascript",we=z({__name:"javascript-[pid]-[sid]",setup(ne){const{kapi:S}=O(),{setCachedData:b,addTimeToProcessedData:j}=W(),C=G(),{sid:p,pid:D}=C.params;if(!p)throw new Error("sid is required");const{setFirstSeenData:R}=Q(),{data:i,error:h,refresh:g}=X(`metrics-javascript-${p||0}`,async()=>await S("CheckJavaScriptErrors").then(e=>e.getResults(Number(p))),{transform:e=>{R(Number(D),Number(p));const _={results:Object.values(e).map(({javascript_errors:n,...m})=>({...m,errors:n||[]}))};return j(_)},getCachedData:(e,_,n)=>{if(!(n.cause==="refresh:manual"||n.cause==="refresh:hook"))return b(e)}});return(e,_)=>{const n=M,m=J,N=V,T=P,$=q,w=I,E=K,A=L,B=U;return t(),s("div",null,[a(m,{"page-key":"pMonitoringTechnicalJavascript"},{title:l(()=>[a(n,{title:"pMonitoringTechnicalJavascript","info-type":k})]),_:1}),r(i)?.results?(t(),s(d,{key:0},[a(N,{"data-count":r(i).results.length,class:"o_mb-6"},null,8,["data-count"]),r(i)?.results?.length?(t(),s("div",ee,[a(T,{"metric-key":k,onSaveSettings:r(g)},null,8,["onSaveSettings"])])):c("",!0),r(i).results.length?(t(),s("div",te,[(t(!0),s(d,null,x(r(i).results,(o,H)=>(t(),u(A,{key:H,"component-info":o.component},{default:l(()=>[a($,{status:o.errors.length?"danger":"success",title:o.errors.length?e.$t("javascriptResults.errorHeadline",{n:o.errors.length}):e.$t("javascriptResults.noErrorHeadline"),description:o.errors.length?e.$t("javascriptResults.errorSubline"):e.$t("javascriptResults.noErrorSubline"),class:"o_mb-2"},null,8,["status","title","description"]),o.errors.length?(t(),u(E,{key:0,title:e.$t("javascriptResults.errorList"),color:"error",variant:"subtle",icon:r(Y).icoError,class:"o_mt-6"},{description:l(()=>[f("ul",re,[(t(!0),s(d,null,x(o.errors,(v,F)=>(t(),s("li",{key:F},[f("div",oe,[a(w,{color:"error",variant:"solid",size:"sm"},{default:l(()=>[Z(y(v.type),1)]),_:2},1024),f("span",se,y(v.error),1)])]))),128))])]),_:2},1032,["title","icon"])):c("",!0)]),_:2},1032,["component-info"]))),128))])):c("",!0)],64)):c("",!0),r(h)?(t(),u(B,{key:1,error:r(h),refresh:r(g)},null,8,["error","refresh"])):c("",!0)])}}});export{we as default};
