1import{d as v,r as p,D as y,a as x,t as w,z as B,o as s,l as t,k as o,n as C,K as n,E as _,I as m,m as E,s as R}from"./app-GC03Gq4U.js";import{_ as S}from"./Layout.vue_vue_type_script_setup_true_lang-OjQXUhnG.js";import{I as N}from"./IconLoading-nChL0Y9u.js";import{C as O,B as z,a as I,L,p as D,b as M,c as P}from"./index-b_riGbu7.js";import{s as T}from"./show-error-zM9JovDt.js";import"./index-7hMjYadJ.js";import"./index-423UCd14.js";import"./index-L_JWdKAj.js";import"./logo-VLooSubU.js";const V={class:"flex-grow flex flex-row flex-wrap"},$={class:"animate__animated animate__slideInUp animate__faster w-full bg-white rounded-md shadow-sm p-5 flex flex-col"},A={key:0,class:"flex justify-center py-10"},j={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6"},q={class:"bg-primary rounded-md p-4 flex flex-col"},F=t("span",{class:"text-white/80 text-xs font-medium"},"Total de Perguntas",-1),K={class:"text-white font-bold text-3xl mt-1"},U={class:"bg-white rounded-md p-4 flex flex-col border border-black/10"},Z=t("span",{class:"text-black/60 text-xs font-medium"},"Total de Opções",-1),G={class:"text-black/80 font-bold text-3xl mt-1"},H={class:"bg-white rounded-md p-4 flex flex-col border border-black/10"},J=t("span",{class:"text-black/60 text-xs font-medium"},"Média de Opções/Pergunta",-1),Q={class:"text-black/80 font-bold text-3xl mt-1"},W={key:0,class:"flex flex-col gap-4"},X={class:"px-4 py-3 bg-black/[0.02] border-b border-black/10"},Y={class:"text-sm font-medium text-black/80"},tt={class:"text-xs text-black/40 ml-2"},et={class:"p-4"},st={class:"h-48 mb-4"},at={class:"flex flex-col gap-1.5"},ot=t("span",{class:"w-3 h-3 rounded-full border-2 border-primary shrink-0"},null,-1),lt={class:"text-xs text-black/70 flex-1"},nt={class:"text-xs text-black/40 font-mono"},it={key:1,class:"text-center py-10 text-xs text-black/40"},rt={key:2,class:"text-center py-10 text-xs text-black/40"},kt=v({__name:"SatisfactionReport",setup(ct){O.register(z,I,L,D,M);const f=p(!0),a=p(null),c=p({}),u=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#84cc16","#f97316","#6366f1"],b={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:l=>`${l.raw} opção${l.raw!==1?"ns":""}`}}},scales:{y:{beginAtZero:!0,ticks:{stepSize:1,font:{size:11}},grid:{color:"rgba(0,0,0,0.06)"}},x:{ticks:{font:{size:10}},grid:{display:!1}}}};return y(async()=>{try{const l=await B.get("/satisfaction-reports");if(l.status===200){a.value=l.data.data;const d={};a.value.questions&&a.value.questions.forEach(e=>{const i={};let h=0;e.options.forEach(r=>{i[r.id]=1,h+=1});const g=e.options.map(r=>r.option_text);d[e.id]={labels:g,datasets:[{label:"Opções",data:e.options.map(r=>i[r.id]||0),backgroundColor:e.options.map((r,k)=>u[k%u.length]),borderRadius:4,maxBarThickness:40}]}}),c.value=d}}catch(l){T(l)}finally{f.value=!1}}),(l,d)=>(s(),x(S,{title:"Relatório - Pesquisa de Satisfação"},{default:w(()=>[t("div",V,[t("div",$,[f.value?(s(),o("div",A,[C(N)])):a.value?(s(),o(_,{key:1},[t("div",j,[t("div",q,[F,t("span",K,n(a.value.total_questions),1)]),t("div",U,[Z,t("span",G,n(a.value.total_options),1)]),t("div",H,[J,t("span",Q,n(a.value.avg_options_per_question),1)])]),a.value.questions&&a.value.questions.length>0?(s(),o("div",W,[(s(!0),o(_,null,m(a.value.questions,e=>(s(),o("div",{key:e.id,class:"border border-black/10 rounded-md overflow-hidden"},[t("div",X,[t("span",Y,n(e.question_text),1),t("span",tt,"("+n(e.options_count)+" opções)",1)]),t("div",et,[t("div",st,[c.value[e.id]?(s(),x(E(P),{key:0,data:c.value[e.id],options:b},null,8,["data"])):R("",!0)]),t("div",at,[(s(!0),o(_,null,m(e.options,i=>(s(),o("div",{key:i.id,class:"flex items-center gap-3 px-3 py-2 bg-black/[0.02] rounded border border-black/5"},[ot,t("span",lt,n(i.option_text),1),t("span",nt,"Ordem "+n(i.ordering),1)]))),128))])])]))),128))])):(s(),o("div",it," Nenhuma pergunta cadastrada nas pesquisas de satisfação. "))],64)):(s(),o("div",rt," Nenhum dado encontrado. "))])])]),_:1}))}});export{kt 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.