1import{r as c,o as w,d as l,f as a,g as e,e as u,F as h,i as b,t as i,j as f,m as k,s as v,u as A,R as D,x as g}from"./app.Btm2sMGp.js";import"./sp-badge.C8ejbdpA.js";import{c as M}from"./profileModules.0s6T8jCe.js";const R={class:"space-y-6"},j={class:"rounded-3xl border border-slate-200 bg-white/90 p-6 shadow-sm"},B={class:"mt-6 grid gap-4 sm:grid-cols-2 xl:grid-cols-4"},C={class:"text-xs font-semibold uppercase tracking-[0.2em] text-slate-400"},N={class:"mt-2 text-2xl font-semibold text-slate-900"},z={class:"mt-1 text-xs text-slate-500"},E={key:0,class:"rounded-2xl border border-dashed border-slate-200 bg-white/70 p-4 text-sm text-slate-500"},V={class:"rounded-3xl border border-slate-200 bg-white/90 p-6 shadow-sm"},F={class:"mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-3"},I={class:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary-500/10 text-primary-600 shadow-inner shadow-primary-500/10"},L={class:"space-y-1 text-left"},P={class:"font-semibold text-slate-900"},S={class:"text-xs text-slate-500"},W={key:0,class:"col-span-full rounded-2xl border border-dashed border-slate-200 bg-white/70 p-4 text-sm text-slate-500"},U={key:0,class:"rounded-2xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-600"},K={__name:"DashboardModule",setup($){const n=c(!1),d=c(""),p=c([]),m=c([]),x=r=>typeof r=="string"&&r.startsWith("/")&&!r.startsWith("http");return w(async()=>{n.value=!0,d.value="";try{const[r,o]=await Promise.all([g.get("/api/frontend/hub"),g.get("/api/frontend/profile")]),s=Array.isArray(r.data?.sections)?r.data.sections:[];p.value=s.flatMap(t=>t.items??[]).map(t=>{const y=typeof t.count<"u"?t.count:t.metrics?.value;return{id:t.id,label:t.title,value:y??"â",description:t.subtitle??""}}).filter(t=>t.value!==void 0).slice(0,8);const _=o.data?.user?.modules??[];m.value=M(_).slice(0,9)}catch(r){console.error(r),d.value="Impossibile caricare la panoramica della dashboard."}finally{n.value=!1}}),(r,o)=>(a(),l("div",R,[e("section",j,[o[0]||(o[0]=e("div",{class:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between"},[e("div",null,[e("h2",{class:"text-xl font-semibold text-slate-900"},"Panoramica account"),e("p",{class:"text-sm text-slate-600"},"Uno sguardo rapido sulle metriche principali del tuo profilo.")]),e("sp-badge",{variant:"info",size:"s"},"Aggiornato in tempo reale")],-1)),e("div",B,[(a(!0),l(h,null,b(p.value,s=>(a(),l("div",{key:s.id,class:"rounded-2xl border border-slate-200 bg-white/80 p-4 shadow-sm"},[e("p",C,i(s.label),1),e("p",N,i(s.value),1),e("p",z,i(s.description),1)]))),128)),!p.value.length&&!n.value?(a(),l("div",E," Nessun dato disponibile al momento. Attiva i moduli per iniziare a generare metriche. ")):u("",!0),n.value?(a(),l(h,{key:1},b(4,s=>e("div",{key:`dashboard-loading-${s}`,class:"h-28 animate-pulse rounded-2xl bg-slate-100"})),64)):u("",!0)])]),e("section",V,[o[2]||(o[2]=e("div",{class:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between"},[e("div",null,[e("h2",{class:"text-xl font-semibold text-slate-900"},"Moduli rapidi"),e("p",{class:"text-sm text-slate-600"},"Apri subito gli strumenti a cui hai accesso.")])],-1)),e("div",F,[(a(!0),l(h,null,b(m.value,s=>(a(),f(v(x(s.url)?A(D):"a"),{key:s.id,to:x(s.url)?s.url:void 0,href:x(s.url)?void 0:s.url,class:"group flex items-start gap-3 rounded-2xl border border-primary-100 bg-white px-4 py-3 text-sm shadow-sm transition hover:-translate-y-0.5 hover:border-primary-300 hover:shadow-lg"},{default:k(()=>[e("div",I,[(a(),f(v(s.icon),{class:"h-5 w-5"}))]),e("div",L,[e("p",P,i(s.label),1),e("p",S,i(s.description),1)]),o[1]||(o[1]=e("span",{class:"ml-auto text-xs font-semibold text-primary-600 transition group-hover:text-primary-700"},"Apri â",-1))]),_:2},1032,["to","href"]))),128)),!m.value.length&&!n.value?(a(),l("div",W," Nessun modulo abilitato. Richiedi nuovi ruoli dall'area servizi per ottenere più strumenti. ")):u("",!0)])]),d.value?(a(),l("p",U,i(d.value),1)):u("",!0)]))}};export{K as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.