import{_ as q,a as I}from"./DR96n_VU.js";import{_ as K}from"./gQe2oyAA.js";import{_ as L}from"./BYHNlRPy.js";import{_ as P}from"./CS_MeOS_.js";import{_ as U}from"./B-TjZPEJ.js";import{_ as z}from"./C9KnTrrC.js";import{_ as O}from"./DWMTOSv8.js";import{_ as W}from"./DvpWg0hF.js";import{d as G,M as Q,a2 as X,k as Y,N as Z,a3 as ee,f as s,b as t,q as a,a as c,c as u,w as l,u as r,F as d,g as b,s as te,e as f,n as re,t as j}from"./B2UyoCas.js";import"./8cAMPTBV.js";import"./BGYJXalu.js";import"./CsNNGtvO.js";import"./DeNTsafF.js";import"./BhXuhlb7.js";import"./Bw4qhTdR.js";import"./88opOQSr.js";import"./CVosDfjh.js";import"./DmViyvlQ.js";import"./ABctaOB9.js";import"./CB3BcoM2.js";import"./DaLgO_IH.js";import"./Cy--ZdFw.js";import"./NkNhW2e0.js";const oe={key:0,class:"flex items-center gap-2 flex-wrap o_mb-4"},se={key:1,class:"flex flex-col o_gap-6 @container/simpleresult"},ne={class:"list-inside text-sm text-uiText-toned text-pretty max-w-[90ch] flex flex-col o_gap-1"},ae={class:"flex items-center o_gap-2"},ie={class:"text-uiText-toned"},T="javascript",Ee=G({__name:"javascript-[pid]-[sid]",setup(ce){const{kapi:C}=Q(),{setCachedData:D,addTimeToProcessedData:N}=X(),h=Y(),{sid:p,pid:R}=h.params;if(!p)throw new Error("sid is required");const{trackFirstSeen:$}=Z(),{data:i,error:g,refresh:v}=ee(`metrics-javascript-${p||0}`,async()=>await C("CheckJavaScriptErrors").then(e=>e.getResults(Number(p))),{transform:e=>{$(Number(R),Number(p),h.name);const _={results:Object.values(e).map(({javascript_errors:n,...m})=>({...m,errors:n||[]}))};return N(_)},getCachedData:(e,_,n)=>{if(!(n.cause==="refresh:manual"||n.cause==="refresh:hook"))return D(e)}});return(e,_)=>{var x,k,y;const n=q,m=K,w=I,E=L,H=P,A=U,B=z,M=O,F=W;return t(),s("div",null,[a(m,{"page-key":"pMonitoringTechnicalJavascript"},{title:l(()=>[a(n,{title:"pMonitoringTechnicalJavascript","info-type":T})]),_:1}),(x=r(i))!=null&&x.results?(t(),s(d,{key:0},[a(w,{"data-count":r(i).results.length,class:"o_mb-6"},null,8,["data-count"]),(y=(k=r(i))==null?void 0:k.results)!=null&&y.length?(t(),s("div",oe,[a(E,{"metric-key":T,onSaveSettings:r(v)},null,8,["onSaveSettings"])])):c("",!0),r(i).results.length?(t(),s("div",se,[(t(!0),s(d,null,b(r(i).results,(o,V)=>(t(),u(M,{key:V,"component-info":o.component},{default:l(()=>[a(H,{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(B,{key:0,title:e.$t("javascriptResults.errorList"),color:"error",variant:"subtle",icon:r(te).icoError,class:"o_mt-6"},{description:l(()=>[f("ul",ne,[(t(!0),s(d,null,b(o.errors,(S,J)=>(t(),s("li",{key:J},[f("div",ae,[a(A,{color:"error",variant:"solid",size:"sm"},{default:l(()=>[re(j(S.type),1)]),_:2},1024),f("span",ie,j(S.error),1)])]))),128))])]),_:2},1032,["title","icon"])):c("",!0)]),_:2},1032,["component-info"]))),128))])):c("",!0)],64)):c("",!0),r(g)?(t(),u(F,{key:1,error:r(g),refresh:r(v)},null,8,["error","refresh"])):c("",!0)])}}});export{Ee as default};
