1import{N as z,O as P,af as U,r as m,g as B,h as H,c as a,b as e,d as G,F as y,j as w,u as n,t as l,w as _,l as Q,m as C,A as I,a as $,i as k,s as q,o as i,z as J,n as v,e as K}from"./CEci50r9.js";import{C as W}from"./B-BmC9MJ.js";import{S as u}from"./2hmjLzVQ.js";import{u as M}from"./D7l-NlI3.js";import{u as X}from"./C4xA2Md-.js";import"./DS0SR-hg.js";import"./7ygs-9za.js";import"./D2bfmsZI.js";import"./CbX3XlNj.js";const Y={class:"p-6"},Z={class:"max-w-7xl mx-auto"},ee={class:"mb-6 grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-4"},te={class:"text-xs font-medium text-gray-500 uppercase"},se={class:"mt-1 text-2xl font-bold text-gray-900"},oe={class:"bg-white p-4 rounded-lg shadow border-t-4 border-blue-500"},re={class:"mt-1 text-2xl font-bold text-gray-900"},ne={class:"bg-white p-4 rounded-lg shadow border-t-4 border-red-500"},ae={class:"mt-1 text-2xl font-bold text-gray-900"},ie={class:"bg-white p-4 rounded-lg shadow border-t-4 border-gray-400"},le={class:"mt-1 text-2xl font-bold text-gray-900"},de={class:"bg-white shadow rounded-lg mb-6 p-4"},ue={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},ce={class:"col-span-1 md:col-span-2"},pe={class:"relative rounded-md shadow-sm"},ge={class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},xe={class:"h-5 w-5",style:{color:"rgb(var(--color-text-muted))"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},me=["value"],fe={class:"bg-white shadow overflow-hidden sm:rounded-lg"},ye={class:"overflow-x-auto"},ve={class:"min-w-full divide-y divide-gray-200"},be={class:"bg-white divide-y divide-gray-200"},he={key:0,class:"animate-pulse"},we={key:1},_e=["onClick"],Ce={class:"px-6 py-4 whitespace-nowrap"},ke={class:"flex items-center"},Se={class:"text-lg font-bold text-gray-900"},Ae={class:"text-xs text-gray-500 ml-1"},Re={class:"px-6 py-4"},Be=["title"],Ie={class:"text-sm text-gray-500"},Me={class:"px-6 py-4 whitespace-nowrap"},Ne={key:1,class:"text-gray-400 text-xs"},Le={class:"px-6 py-4 whitespace-nowrap"},Ve={key:0,class:"text-xs text-gray-500 mt-1"},Ee={class:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium"},Fe={key:0,class:"bg-gray-50"},De={colspan:"5",class:"px-6 py-4"},qe=z({__name:"scoring-recap",setup(Te){const N=P(),{getCollection:S}=U(),{error:L}=q(),b=m([]),h=m(!0),c=m(""),p=m(""),g=m(""),x=m(new Set),A=B(()=>b.value.filter(o=>{const t=o.title?.toLowerCase().includes(c.value.toLowerCase())||o.author?.lastname?.toLowerCase().includes(c.value.toLowerCase())||o.author?.firstname?.toLowerCase().includes(c.value.toLowerCase()),s=p.value===""||o.submissionCategory===p.value||o.category===p.value,r=g.value===""||(o.decision||"pending")===g.value||g.value==="pending"&&!o.decision;return t&&s&&r}).sort((o,t)=>(t.ratingAverage||0)-(o.ratingAverage||0))),f=B(()=>{const o={categories:{},posters:0,refused:0,undecided:0};for(const t in u)o.categories[t]=0;return b.value.forEach(t=>{t.decision==="poster"?o.posters++:t.decision==="refused"?o.refused++:t.decision==="undecided"&&o.undecided++;let s=t.submissionCategory||t.category;if(s&&!o.categories[s]){const r=Object.entries(u).find(([d,O])=>O.label===s);r&&(s=r[0])}s&&o.categories[s]!==void 0&&o.categories[s]++}),o}),R=async()=>{h.value=!0;try{const[o,t]=await Promise.all([S("communications"),S("users")]),s=new Map(t.map(d=>[d.id,d])),r=o.filter(d=>d.isDeleted!==!0);b.value=r.map(d=>({...d,author:s.get(d.userId)||{firstname:"Inconnu",lastname:""}}))}catch(o){L("Erreur lors du chargement: "+o.message)}finally{h.value=!1}},V=o=>u[o]?.label||o,E=o=>{switch(u[o]?.color){case"blue":return"#3B82F6";case"green":return"#10B981";case"purple":return"#8B5CF6";case"orange":return"#F59E0B";default:return"#9CA3AF"}},F=o=>{switch(u[o]?.color){case"blue":return"bg-blue-100 text-blue-800";case"green":return"bg-green-100 text-green-800";case"purple":return"bg-purple-100 text-purple-800";case"orange":return"bg-orange-100 text-orange-800";default:return"bg-gray-100 text-gray-800"}},D=o=>{switch(o){case"oral":return"Oral";case"poster":return"Poster";case"refused":return"Refusé";case"undecided":return"Indécis";default:return"En attente"}},T=o=>{switch(o){case"oral":return"bg-green-100 text-green-800";
1case"poster":return"bg-blue-100 text-blue-800";case"refused":return"bg-red-100 text-red-800";case"undecided":return"bg-gray-100 text-gray-800 border border-gray-300";default:return"bg-yellow-100 text-yellow-800"}},j=o=>{x.value.has(o)?x.value.delete(o):x.value.add(o)};return H(async()=>{const{isSuperAdmin:o}=M(),{initAuthState:t}=M();if(await t(),!o.value){const{getSettings:s}=X();if(!(await s()).showScoringRecapToAdmins){N.push("/admin");return}}R()}),(o,t)=>(i(),a("div",Y,[e("div",Z,[e("div",{class:"mb-8 flex justify-between items-center"},[t[4]||(t[4]=e("div",null,[e("h1",{class:"text-2xl font-bold text-main"},"Récapitulatif des Notes"),e("p",{class:"mt-2 text-sm text-text-muted"}," Vue d'ensemble et accès aux détails des soumissions ")],-1)),e("div",{class:"flex space-x-3"},[e("button",{onClick:R,class:"inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary"},[...t[3]||(t[3]=[e("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),G(" Actualiser ",-1)])])])]),e("div",ee,[(i(!0),a(y,null,w(n(u),(s,r)=>(i(),a("div",{key:r,class:"bg-white p-4 rounded-lg shadow border-t-4",style:J({borderColor:E(r)})},[e("div",te,l(s.label),1),e("div",se,l(n(f).categories[r]||0),1)],4))),128)),e("div",oe,[t[5]||(t[5]=e("div",{class:"text-xs font-medium text-gray-500 uppercase"},"Posters",-1)),e("div",re,l(n(f).posters),1)]),e("div",ne,[t[6]||(t[6]=e("div",{class:"text-xs font-medium text-gray-500 uppercase"},"Refusés",-1)),e("div",ae,l(n(f).refused),1)]),e("div",ie,[t[7]||(t[7]=e("div",{class:"text-xs font-medium text-gray-500 uppercase"},"Indécis",-1)),e("div",le,l(n(f).undecided),1)])]),e("div",de,[e("div",ue,[e("div",ce,[t[9]||(t[9]=e("label",{for:"search",class:"sr-only"},"Rechercher",-1)),e("div",pe,[e("div",ge,[(i(),a("svg",xe,[...t[8]||(t[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"},null,-1)])]))]),_(e("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=s=>C(c)?c.value=s:null),class:"block w-full pl-10 px-3 py-2 rounded-md shadow-sm focus:outline-none focus:ring-1 transition-colors sm:text-sm",style:{border:"1px solid rgb(var(--color-border))","--tw-ring-color":"rgb(var(--color-primary))"},placeholder:"Rechercher par titre, auteur..."},null,512),[[Q,n(c)]])])]),e("div",null,[_(e("select",{"onUpdate:modelValue":t[1]||(t[1]=s=>C(p)?p.value=s:null),class:"block w-full px-3 py-2 text-base focus:outline-none focus:ring-1 sm:text-sm rounded-md transition-colors",style:{border:"1px solid rgb(var(--color-border))","--tw-ring-color":"rgb(var(--color-primary))"}},[t[10]||(t[10]=e("option",{value:""},"Toutes catégories",-1)),(i(!0),a(y,null,w(n(u),(s,r)=>(i(),a("option",{key:r,value:r},l(s.label),9,me))),128))],512),[[I,n(p)]])]),e("div",null,[_(e("select",{"onUpdate:modelValue":t[2]||(t[2]=s=>C(g)?g.value=s:null),class:"block w-full px-3 py-2 text-base focus:outline-none focus:ring-1 sm:text-sm rounded-md transition-colors",style:{border:"1px solid rgb(var(--color-border))","--tw-ring-color":"rgb(var(--color-primary))"}},[...t[11]||(t[11]=[$('<option value="">Tous statuts</option><option value="pending">En attente</option><option value="oral">Oral</option><option value="poster">Poster</option><option value="refused">Refusé</option><option value="undecided">Indécis</option>',6)])],512),[[I,n(g)]])])])]),e("div",fe,[e("div",ye,[e("table",ve,[t[15]||(t[15]=e("thead",{class:"bg-gray-50"},[e("tr",null,[e("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Note"),e("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Titre / Auteur"),e("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Catégorie"),e("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Statut"),e("th",{scope:"col",class:"relative px-6 py-3"},[e("span",{class:"sr-only"},"Détails")])])],-1)),e("tbody",be,[n(h)?(i(),a("tr",he,[...t[12]||(t[12]=[e("td",{colspan:"5",class:"px-6 py-4 text-center text-sm text-gray-500"},"Chargement...",-1)])])):n(A).length===0?(i(),a("tr",we,[...t[13]||(t[13]=[e("td",{colspan:"5",class:"px-6 py-4 text-center text-sm text-gray-500"},"Aucune communication trouvée",-1)])])):k("",!0),(i(!0),a(y,null,w(n(A),s=>(i(),a(y,{key:s.id},[e("tr",{class:v(["hover:bg-gray-50 transition-colors cursor-pointer",{"bg-gray-50":n(x).has(s.id)}]),onClick:r=>j(s.id)},[e("td",Ce,[e("div",ke,[e("span",Se,l((s.ratingAverage||0).toFixed(1)),1),e("span",Ae,"("+l(s.ratingCount||0)+")",1)])]),e("td",Re,[e
1("div",{class:"text-sm font-medium text-gray-900 line-clamp-2",title:s.title},l(s.title),9,Be),e("div",Ie,l(s.author?.firstname||"Inconnu")+" "+l(s.author?.lastname||""),1)]),e("td",Me,[s.submissionCategory?(i(),a("span",{key:0,class:v(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",F(s.submissionCategory)])},l(V(s.submissionCategory)),3)):(i(),a("span",Ne,"-"))]),e("td",Le,[e("span",{class:v(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",T(s.decision)])},l(D(s.decision)),3),s.assignedSlotId?(i(),a("div",Ve," Slot assigné ")):k("",!0)]),e("td",Ee,[e("span",{class:v(["text-gray-400 hover:text-primary transition-transform duration-200",{"transform rotate-180":n(x).has(s.id)}])},[...t[14]||(t[14]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)])],2)])],10,_e),n(x).has(s.id)?(i(),a("tr",Fe,[e("td",De,[K(W,{"criteria-details":s.criteriaDetails,"rating-count":s.ratingCount,"communication-id":s.id,"source-page":"/admin/scoring-recap"},null,8,["criteria-details","rating-count","communication-id"])])])):k("",!0)],64))),128))])])])])])]))}});export{qe 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.