import{_ as A,a as H}from"./CQblF2yi.js";import{_ as F}from"./C-XkP9tB.js";import{_ as I}from"./BKofJQ5v.js";import{_ as j}from"./i0fBWypb.js";import{_ as v}from"./BnFHREeV.js";import{_ as B}from"./BbCYHBXa.js";import{_ as M}from"./BXyDg5m4.js";import{d as P,N as q,a4 as K,i as L,ch as O,a5 as T,e as m,o,a,l as u,c as p,w as _,m as r,F as h,r as V,q as U}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"./D5F0NbWF.js";import"./88opOQSr.js";import"./BtsG96Qa.js";import"./BJxNwbOK.js";import"./BTe-eGo6.js";import"./DXyvFCCy.js";import"./PJSlhYeJ.js";import"./NkNhW2e0.js";import"./Dptbt2z6.js";const W={key:0,class:"flex flex-col o_gap-6 @container/simpleresult"},z="insecureElements",ye=P({__name:"elements-[pid]-[sid]",setup(G){const{kapi:g}=q(),{setCachedData:y,addTimeToProcessedData:d}=K(),k=L(),{sid:c,pid:C}=k.params;if(!c)throw new Error("sid is required");const{setFirstSeenData:b}=O(),{data:i,error:f,refresh:E}=T(`metrics-elements${c||0}`,async()=>await g("CheckInsecureContent").then(e=>e.getInsecureElements(Number(c))),{transform:e=>{if(Object.keys(e.results).length===0)return d({results:[]},0);b(Number(C),Number(c));const l={results:Object.values(e.results).map(t=>({component:t.component,elements:t.insecure_elements?.map(s=>typeof s=="string"?s:{content:s.url,status:{text:s.status,color:"error"}})||[],error:t.error||""}))};return d(l)},getCachedData:(e,l,t)=>{if(!(t.cause==="refresh:manual"||t.cause==="refresh:hook"))return y(e)}});return(e,l)=>{const t=A,s=F,D=H,x=I,R=j,S=v,$=B,N=M;return o(),m("div",null,[a(s,{"page-key":"pMonitoringSecurityElements"},{title:_(()=>[a(t,{title:"pMonitoringSecurityElements","info-type":z})]),_:1}),r(i)?.results?(o(),m(h,{key:0},[a(D,{"data-count":r(i).results.length,class:"o_mb-6"},null,8,["data-count"]),r(i).results.length?(o(),m("div",W,[(o(!0),m(h,null,V(r(i).results,(n,w)=>(o(),p($,{key:w,"component-info":n.component},{default:_(()=>[a(x,{status:n.elements.length?"danger":"success",title:n.elements.length?e.$t("insecureResults.errorHeadline",{n:n.elements.length}):e.$t("insecureResults.noErrorHeadline"),description:n.elements.length?e.$t("insecureResults.errorSubline"):e.$t("insecureResults.noErrorSubline"),class:"o_mb-2"},null,8,["status","title","description"]),n.elements.length?(o(),p(S,{key:0,title:e.$t("insecureResults.errorList"),color:"error",variant:"subtle",icon:r(U).icoError,class:"o_mt-6"},{description:_(()=>[a(R,{entries:n.elements,class:"font-medium"},null,8,["entries"])]),_:2},1032,["title","icon"])):u("",!0)]),_:2},1032,["component-info"]))),128))])):u("",!0)],64)):u("",!0),r(f)?(o(),p(N,{key:1,error:r(f),refresh:r(E)},null,8,["error","refresh"])):u("",!0)])}}});export{ye as default};
