PageSourceSearch

https://etreprof.fr/_nuxt/Dnof1w_j.js

js etreprof.fr collected 2026-10-03 21:21:37 UTC 64,099 bytes, 1 lines download raw bytes

1import{b6 as X,b8 as ee,bH as pe,bb as ae,bh as f,bi as e,bl as s,bj as y,bo as Z,bm as b,bu as E,bv as T,ba as C,bp as ie,bg as a,bq as G,ce as Ge,bn as Q,bM as re,br as he,bt as U,bF as Be,bS as Re,bK as tt,b$ as ze,bk as _e,cz as Ke,bI as nt,bG as We,bA as Le,cA as ot,b7 as at,cc as st,bc as it,bf as lt,bN as Ue}from"./Bl3OJams.js";import{_ as rt}from"./CulUnMZZ.js";import{_ as ct}from"./BJd4zC8G.js";import{_ as $e}from"./BC_GU2bR.js";import{S as we,b as dt}from"./CaWknvKR.js";import{s as ut}from"./C2sL7k6w.js";import{u as ge}from"./C9j7Z0Ba.js";import{_ as De,S as Ye}from"./ZGFQMquQ.js";import{_ as Fe}from"./BbDjB3IU.js";import{_ as je}from"./Dxgf9W-B.js";import{_ as ke}from"./D91UmsT1.js";import{_ as pt}from"./DZtkuQr8.js";import{C as ft}from"./RC5ht6Wf.js";import{s as mt}from"./CWxKbm0S.js";import"./CzsiSt4U.js";import"./Db92ovy1.js";import"./DkwzbJPH.js";import"./D0ywb2kW.js";import"./Z7JuNJNv.js";import"./DDpQ9iPf.js";import"./CKqyDCss.js";import"./NXwdpfai.js";import"./VgnNI3nJ.js";import"./DNhO6QpW.js";import"./B4FxW8wU.js";import"./rg4swsKP.js";import"./Cqan76au.js";import"./CwUiy5mE.js";import"./B44bGjKH.js";import"./DMLIuEAQ.js";import"./C-DV0Fpb.js";(function(){try{var c=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},R=new c.Error().stack;R&&(c._sentryDebugIds=c._sentryDebugIds||{},c._sentryDebugIds[R]="86b467e5-925e-4474-ae9a-e88eb11be57f",c._sentryDebugIdIdentifier="sentry-dbid-86b467e5-925e-4474-ae9a-e88eb11be57f")}catch{}})();var ye=(c=>(c.SEANCE="seance",c.FICHE_PROF="fiche_prof",c.SUPPORT="support",c))(ye||{});const gt={class:"relative flex min-h-[160px] w-full flex-col overflow-hidden rounded-lg p-4 sm:min-h-[173px] sm:p-3"},xt={key:0,class:"pointer-events-none absolute inset-0","aria-hidden":"true"},vt=["src"],bt={key:1,class:"pointer-events-none absolute inset-0 bg-ui-bg-inverted","aria-hidden":"true"},ht={class:"relative z-10 flex shrink-0 items-start justify-end gap-2"},_t=["aria-label"],yt={class:"relative z-10 mt-auto flex min-w-0 flex-col justify-end gap-2 pt-4"},wt={class:"text-2xl font-heading break-words text-white"},kt={key:0,class:"text-sm font-medium text-white/75"},St=X({__name:"SeanceCover",props:{seance:{}},emits:["delete","update"],setup(c,{emit:R}){const o=c,d=R,{t}=ee(),l=pe(),k=ge(),r=T(()=>o.seance.etat===we.BROUILLON),m=T(()=>r.value?t("seance.statusBrouillon"):t("seance.statusConfirmee")),n=T(()=>r.value?"neutral":"success"),v=T(()=>r.value?"subtle":"solid"),F=T(()=>{const _=[];o.seance.position!=null&&o.seance.sequence?.nbSeances&&_.push(t("seance.positionLabel",{position:o.seance.position,total:o.seance.sequence.nbSeances}));const j=o.seance.classes.flatMap(O=>O.niveaux.map(H=>H.nomAffiche)).filter((O,H,V)=>V.indexOf(O)===H);return j.length&&_.push(j.join(", ")),o.seance.discipline?.nomAffiche?_.push(o.seance.discipline.nomAffiche):o.seance.domaines.length&&_.push(o.seance.domaines.map(O=>O.nomAffiche).join(", ")),_.join(" · ")}),P=C(!1),M=T(()=>P.value||!o.seance.coverImage?ut:o.seance.coverImage);ae(()=>o.seance.coverImage,()=>{P.value=!1});const B=C(!1),u=C(!1),i=C(null),p=T(()=>{const _=o.seance.coverImage;return _?_.includes("/seances/covers/")||_.includes("userUploads"):!1});function $(){i.value?.click()}async function I(_){const j=_.target,O=j.files?.[0];if(!O)return;j.value="";const H=5*1024*1024;if(O.size>H){l.add({title:t("seance.coverImageTooLarge"),color:"error"});return}if(!["image/jpeg","image/png","image/webp"].includes(O.type)){l.add({title:t("seance.coverImageInvalidFormat"),color:"error"});return}B.value=!0;try{const oe=await k.uploadCoverImage(o.seance.id,O);d("update",oe),l.add({title:t("seance.coverImageUploaded"),color:"success"})}catch{l.add({title:t("seance.coverImageUploadError"),color:"error"})}finally{B.value=!1}}async function h(){u.value=!0;try{const _=await k.deleteCoverImage(o.seance.id);d("update",_),l.add({title:t("seance.coverImageRemoved"),color:"success"})}catch{l.add({title:t("seance.coverImageRemoveError"),color:"error"})}finally{u.value=!1}}const N=T(()=>{const _=[];return p.value&&_.push({label:t("seance.removeCoverPhoto"),icon:"i-lucide-image-minus",onSelect:()=>h()}),_.push({label:t("seance.deleteSeance"),icon:"i-lucide-trash-2",color:"error",onSelect:()=>d("delete")}),[_]});return(_,j)=>{const O=ie,H=ct,V=$e;return a(),f("div",gt,[e(M)?(a(),f("div",xt,[s("img",{src:e(M),alt:"",class:"absolute size-full object-cover object-center",onError:j[0]||(j[0]=oe=>P.value=!0)},null,40,vt),j[1]||(j[1]=s("div",{class:"absolute inset-0 bg-linear-to-r from-black/70 via-black/30 to-transparent"},null,-1))])):(a(),f("div",bt)),s("div",ht,[s("input",{ref_key:"fileInputRef",ref:i,type:"file",accept:"image/jpeg,image/png,image/webp",class:"hidden","aria-label":e(t)("seance.addCoverPhoto"),onChange:I},null,40,_t),y(O,{label:e(B)?e(t)("seance.coverImageUploading"):e(t)("seance.addCoverPhoto"),icon:e(p)?"i-lucide-image-up":void 0,color:"neutral",variant:"ghost",size:"xs",loading:e(B),class:"hidden rounded-xl bg-ui-bg-elevated px-2 py-1 text-xs font-medium text-ui-text hover:bg-ui-bg-muted sm:inline-flex",onClick:$},null,8,["label","icon","loading"]),y(H,{items:e(N),"aria-label":e(t)("seance.kebabMenu")},{default:Z(()=>[y(O,{icon:"i-lucide-ellipsis",color:"neutral",variant:"ghost",size:"xs",class:"rounded-xl bg-ui-bg-elevated p-1 text-ui-text hover:bg-ui-bg-muted","aria-label":e(t)("seance.kebabMenu")},null,8,["aria-label"])]),_:1},8,["items","aria-label"])]),s("div",yt,[y(V,{label:e(m),color:e(n),variant:e(v),size:"sm",class:"w-fit roun
1ded-md px-2 py-1 text-xs leading-4 font-medium"},null,8,["label","color","variant"]),s("h1",wt,b(c.seance.titre),1),e(F)?(a(),f("p",kt,b(e(F)),1)):E("",!0)])])}}}),$t=Object.assign(St,{__name:"SeanceCover"}),At={class:"flex flex-col items-start gap-4 rounded-lg bg-amber-300 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6 sm:pr-10"},Tt={class:"flex flex-1 flex-col gap-1"},Ct={class:"text-sm font-medium text-amber-950"},Pt={class:"text-sm text-amber-950"},It=X({__name:"SeanceRatingAlert",emits:["select-star"],setup(c,{emit:R}){const o=R,{t:d}=ee(),t=C(0);function l(k){t.value=k,o("select-star",k)}return(k,r)=>{const m=De;return a(),f("div",At,[s("div",Tt,[s("p",Ct,b(e(d)("seance.ratingAlertTitle")),1),s("p",Pt,b(e(d)("seance.ratingAlertDescription")),1)]),y(m,{"model-value":e(t),tone:"banner","onUpdate:modelValue":l},null,8,["model-value"])])}}}),Mt=Object.assign(It,{__name:"SeanceRatingAlert"}),Rt={class:"flex flex-col items-center gap-5 px-2 py-2"},Lt={class:"text-center text-2xl font-heading font-bold text-ui-text-highlighted"},Ut={class:"w-full rounded-lg bg-zinc-100 px-4 py-3"},Et={class:"whitespace-pre-line text-sm text-ui-text"},Ot={class:"text-center text-sm text-ui-text-muted"},Bt={key:0,class:"text-center text-2xl font-bold text-ui-text-highlighted"},Dt={key:1,class:"text-center text-sm text-ui-text-muted"},Ft={key:2,class:"whitespace-pre-line text-center text-sm text-ui-text-muted"},jt={key:3,class:"w-full rounded-lg bg-zinc-100 px-4 py-3"},Nt={class:"whitespace-pre-line text-sm text-ui-text"},zt={class:"flex w-full flex-col gap-3"},Vt={key:2,class:"flex w-full items-center justify-between gap-3"},qt=X({__name:"SeanceRatingModal",props:{open:{type:Boolean},initialRating:{},seanceId:{}},emits:["update:open","validated","delete-and-regenerate"],setup(c,{emit:R}){const o=c,d=R,{t}=ee(),l=pe(),k=ge(),r=C(o.initialRating),m=C(""),n=C(!1),v=C(!1);ae(()=>o.open,I=>{I&&(r.value=o.initialRating,m.value="",n.value=!1,v.value=!1)}),ae(()=>o.initialRating,I=>{o.open&&(r.value=I)});const F=T(()=>v.value?t("seance.ratingModal.titleConfirmed"):r.value===0?t("seance.ratingModal.titleInitial"):r.value>=5?t("seance.ratingModal.title5"):r.value===4?t("seance.ratingModal.title4"):r.value===3?t("seance.ratingModal.title3"):t("seance.ratingModal.title2")),P=T(()=>!v.value&&r.value>=1&&r.value<=4),M=T(()=>!v.value&&r.value>=1&&r.value<=3),B=T(()=>!v.value&&r.value===3),u=T(()=>!v.value&&r.value>=1&&r.value<=2);function i(){d("update:open",!1)}async function p(){if(!(r.value===0||n.value)){n.value=!0;try{const I=await k.validate(o.seanceId,{note:r.value,commentaire:m.value.trim()||void 0});v.value=!0,setTimeout(()=>{i(),l.add({title:t("seance.ratingModal.toastValidated"),color:"success"}),d("validated",I)},2e3)}catch{l.add({title:t("seance.ratingModal.toastError"),color:"error"}),n.value=!1}}}async function $(){if(n.value)return;n.value=!0;const h={reason:"resume",comment:m.value.trim()||void 0,rating:r.value>0?r.value:void 0};try{await k.deleteSeance(o.seanceId,h),l.add({title:t("seance.ratingModal.toastDeleted"),color:"success"}),i(),d("delete-and-regenerate")}catch{l.add({title:t("seance.deleteModal.toastError"),color:"error"}),n.value=!1}}return(I,h)=>{const N=De,_=Fe,j=je,O=ie,H=ke;return a(),G(H,{open:c.open,title:e(F),description:e(v)?e(t)("seance.ratingModal.descriptionConfirmed"):e(t)("seance.ratingModal.descriptionInitial"),ui:{content:"bg-default flex flex-col focus:outline-none divide-y-0",title:"text-lg leading-7 font-bold text-ui-text-highlighted",description:e(v)?"":"sr-only",footer:"flex items-center gap-2 p-4 sm:px-6 border-t-0"},"onUpdate:open":h[2]||(h[2]=V=>d("update:open",V))},Ge({body:Z(()=>[s("div",Rt,[e(v)?(a(),f(Q,{key:0},[s("p",Lt,b(e(t)("seance.ratingModal.confirmedHeading")),1),s("div",Ut,[s("p",Et,b(e(t)("seance.ratingModal.iaLearning")),1)]),s("p",Ot,b(e(t)("seance.ratingModal.descriptionConfirmed")),1)],64)):(a(),f(Q,{key:1},[e(r)>0?(a(),f("p",Bt,b(e(t)("seance.ratingModal.scoreDisplay",{score:e(r)})),1)):E("",!0),y(N,{modelValue:e(r),"onUpdate:modelValue":h[0]||(h[0]=V=>re(r)?r.value=V:null),size:"lg"},null,8,["modelValue"]),e(r)>=5?(a(),f("p",Dt,b(e(t)("seance.ratingModal.description5")),1)):E("",!0),e(r)===0?(a(),f("p",Ft,b(e(t)("seance.ratingModal.descriptionInitial")),1)):E("",!0),e(M)?(a(),f("div",jt,[s("p",Nt,b(e(t)("seance.ratingModal.iaLearning")),1)])):E("",!0),e(P)?(a(),G(j,{key:4,class:"w-full",label:e(t)("seance.ratingModal.textareaPlaceholder"),ui:{label:"sr-only"}},{default:Z(()=>[y(_,{modelValue:e(m),"onUpdate:modelValue":h[1]||(h[1]=V=>re(m)?m.value=V:null),placeholder:e(t)("seance.ratingModal.textareaPlaceholder"),rows:4,class:"w-full",maxlength:e(Ye)},null,8,["modelValue","placeholder","maxlength"])]),_:1},8,["label"])):E("",!0)],64))])]),_:2},[e(v)?void 0:{name:"footer",fn:Z(()=>[s("div",zt,[e(u)?(a(),f(Q,{key:0},[y(O,{block:"",variant:"link",color:"primary",size:"sm",class:"py-2 text-sm font-medium",label:e(t)("seance.ratingModal.validateAnyway"),disabled:e(n),onClick:p},null,8,["label","disabled"]),y(O,{block:"",size:"sm",class:"border border-white shadow-(--shadow-primary-btn)",label:e(t)("seance.ratingModal.deleteAndRegenerate"),loading:e(n),onClick:$},null,8,["label","loading"])],64)):e(B)?(a(),f(Q,{key:1},[y(O,{block:"",label:e(t)("seance.ratingModal.validate"),size:"sm",class:"border border-white shadow-(--shadow-primary-btn)",loading:e(n),disabled:e(r)===0,onClick:p},null,8,["label","loading","disabled"]),y(O,{block:"",variant:"link",color:"primary",size:"sm",class:"py-2 text-sm font-medium",label:e(t)("seance.ratingModal.deleteAndRegenerate"),disabled:e(n),onClick:$},null,8,["label","disabled"])],64)):(a(),f("div",Vt,[y(O,{block:"",variant:"link",color:"primary",size:"sm",class:"flex-1 py-2 text-center text-sm font-medium",label:e(t)("seance.ratingModal.cancel"),disabled:e(n),onClick:i},null,8,["label","disabled"]),y(O,{block:"",label:e(t)("seance.ratingModal.validate"),size:"sm",class:"flex-1 border border-white px-3 py-2 text-sm font-medium shadow-(--shadow-primary-btn)",loading:e(n),disabled:e(r)===0,onClick:p},null,8,["label","loading","disabled"])]))])]),key:"0"}]),1032,["open","title","description","ui"])}}}),Ht=Object.assign(qt,{__name:"SeanceRatingModal"}),Gt={class:"flex flex-col gap-5 px-2 py-2"},Kt={class:"mb-3 text-sm font-medium text-ui-text-highlighted"},Wt={class:"flex flex-wrap gap-2",role:"radiogroup"},Yt=["aria-checked","tabindex","onClick","onKeydown"],Jt={class:"flex w-full items-center justify-between gap-3"},Xt=X({__name:"SeanceDeleteModal",props:{open:{type:Boolean},seanceId:{}},emits:["update:open","deleted"],setup(c,{emit:R}){const o=c,d=R,{t}=ee(),l=pe(),k=ge(),r=["resume","sequence","test","error","betterResource"],m=C(null),n=C(""),v=C(!1);ae(()=>o.open,u=>{u&&(m.value=null,n.value="",v.value=!1)});function F(){d("update:open",!1)}function P(u){m.value=m.value===u?null:u}function M(u,i){let p=i;if(u.key==="ArrowRight"||u.key==="ArrowDown")u.preventDefault(),p=i<r.length-1?i+1:0;else if(u.key==="ArrowLeft"||u.key==="ArrowUp")u.preventDefault(),p=i>0?i-1:r.length-1;else return;const $=r[p];if(!$)return;P($),document.querySelectorAll("[data-reason-btn]")[p]?.focus()}async function B(){if(!(!m.value||v.value)){v.value=!0;try{const u=t(`seance.deleteModal.reasons.${m.value}`);await k.deleteSeance(o.seanceId,{reason:u,comment:n.value.trim()||void 0}),F(),d("deleted")}catch{l.add({title:t("seance.deleteModal.toastError"),color:"error"}),v.value=!1}}}return(u,i)=>{const p=Fe,$=je,I=ie,h=ke;return a(),G(h,{open:c.open,title:e(t)("seance.deleteModal.title"),description:e(t)("seance.deleteModal.reasonLabel"),ui:{description:"sr-only"},"onUpdate:open":i[1]||(i[1]=N=>d("update:open",N))},{body:Z(()=>[s("div",Gt,[s("fieldset",null,[s("legend",Kt,b(e(t)("seance.deleteModal.reasonLabel")),1),s("div",Wt,[(a(),f(Q,null,he(r,(N,_)=>s("button",{key:N,"data-reason-btn":"",type:"button",role:"radio","aria-checked":e(m)===N,tabindex:e(m)===N||e(m)===null&&_===0?0:-1,class:U(["curs
1or-pointer rounded-full border px-3 py-1.5 text-sm transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600",e(m)===N?"border-ui-text-highlighted bg-ui-text-highlighted text-white":"border-ui-border bg-white text-ui-text hover:border-ui-border-accented"]),onClick:j=>P(N),onKeydown:j=>M(j,_)},b(e(t)(`seance.deleteModal.reasons.${N}`)),43,Yt)),64))])]),y($,{label:e(t)("seance.deleteModal.commentLabel")},{default:Z(()=>[y(p,{modelValue:e(n),"onUpdate:modelValue":i[0]||(i[0]=N=>re(n)?n.value=N:null),placeholder:e(t)("seance.deleteModal.commentPlaceholder"),rows:4,class:"w-full",maxlength:500},null,8,["modelValue","placeholder"])]),_:1},8,["label"])])]),footer:Z(()=>[s("div",Jt,[y(I,{variant:"link",color:"neutral",label:e(t)("seance.deleteModal.cancel"),disabled:e(v),onClick:F},null,8,["label","disabled"]),y(I,{color:"error",label:e(t)("seance.deleteModal.delete"),loading:e(v),disabled:!e(m),onClick:B},null,8,["label","loading","disabled"])])]),_:1},8,["open","title","description"])}}}),Qt=Object.assign(Xt,{__name:"SeanceDeleteModal"}),Zt="flex-1 !rounded-md border border-solid !border-etreprof-600 !ring-0 shadow-none bg-white font-medium text-base !text-etreprof-800",en="flex-1 !rounded-md border-0 !ring-0 shadow-none font-medium text-base",tn=X({__name:"SeanceExportButtons",props:{loadingFormat:{default:null},variant:{default:"compact"}},emits:["export"],setup(c,{emit:R}){const o=c,d=R,{t}=ee(),l=T(()=>o.variant==="cta"),k=T(()=>{const r={format:"docx",label:t("seance.exportDocx"),brand:!1},m={format:"odt",label:t("seance.exportOdt"),brand:!1},n={format:"pdf",label:t("seance.exportPdf"),brand:l.value};return l.value?[r,m,n]:[n,r]});return(r,m)=>{const n=ie;return a(),f("div",{class:U(["flex items-center",e(l)?"w-full gap-6":"gap-2"])},[(a(!0),f(Q,null,he(e(k),v=>(a(),G(n,{key:v.format,label:v.label,"trailing-icon":o.loadingFormat===v.format?"i-lucide-loader-2":"i-lucide-download",color:e(l)?"primary":"neutral",variant:v.brand?"brand":"outline",size:e(l)?"lg":"xs",class:U(e(l)?v.brand?en:Zt:""),ui:{trailingIcon:o.loadingFormat===v.format?"animate-spin":""},disabled:!!o.loadingFormat,onClick:F=>d("export",v.format)},null,8,["label","trailing-icon","color","variant","size","class","ui","disabled","onClick"]))),128))],2)}}}),Ae=Object.assign(tn,{__name:"SeanceExportButtons"}),nn={class:"flex max-h-[60vh] flex-col overflow-y-auto rounded-md border border-ui-border bg-white p-6"},on=["innerHTML"],an={key:1,class:"py-8 text-center text-sm text-ui-text-muted"},sn=X({__name:"SeanceContentModal",props:{open:{type:Boolean},title:{},description:{},content:{},emptyMessage:{},exportingFormat:{default:null},showExport:{type:Boolean,default:!0}},emits:["update:open","export"],setup(c,{emit:R}){const o=R,d={content:"sm:max-w-2xl md:min-w-[90vw] md:max-w-[90vw] p-4 gap-4 divide-y-0",header:"p-0 sm:px-0 pb-4 border-b border-ui-border",title:"font-heading font-normal text-xl leading-7 text-ui-text-highlighted",description:"sr-only",body:"p-0 sm:p-0 flex-none",footer:"p-0 sm:px-0 border-t-0"};return(t,l)=>{const k=Ae,r=ke;return a(),G(r,{open:c.open,title:c.title,description:c.description,ui:d,"onUpdate:open":l[1]||(l[1]=m=>o("update:open",m))},Ge({body:Z(()=>[s("section",nn,[c.content?(a(),f("div",{key:0,class:"prose prose-sm max-w-none text-sm text-ui-text-toned [&_strong]:text-ui-text-highlighted",innerHTML:c.content},null,8,on)):(a(),f("p",an,b(c.emptyMessage),1))])]),_:2},[c.showExport?{name:"footer",fn:Z(()=>[y(k,{variant:"cta","loading-format":c.exportingFormat,onExport:l[0]||(l[0]=m=>o("export",m))},null,8,["loading-format"])]),key:"0"}:void 0]),1032,["open","title","description"])}}}),ln=Object.assign(sn,{__name:"SeanceContentModal"}),rn="aucun";function be(c){return(c.typeSupport??[]).filter(R=>R&&!R.startsWith(rn))}function cn(c,R){const o=c.filter(t=>t.mdLink&&t.activiteId&&t.typeSupport),d=[];for(const t of R)for(const l of be(t)){const k=o.find(r=>r.activiteId===t.id&&r.typeSupport===l);k&&d.push(k)}for(const t of o)d.some(l=>l.id===t.id)||d.push(t);return d}const dn={class:"flex w-full items-center justify-between gap-3 border-b border-ui-border pb-4"},un={class:"flex min-w-0 flex-1 items-center gap-2"},pn=["aria-label"],fn={id:"seance-support-modal-title",class:"min-w-0 truncate text-base font-semibold leading-6 text-ui-text-highlighted md:text-lg md:font-bold md:leading-7"},mn={class:"flex flex-col gap-support-modal-stack"},gn={class:"flex items-stretch gap-2"},xn=["aria-hidden","onClick"],vn={class:"relative max-h-[min(60vh,calc(100dvh-14rem))] overflow-y-auto rounded-md border border-ui-border bg-white"},bn={class:"sticky top-0 z-10 flex justify-end p-4 pb-0"},hn={class:"p-6 pt-2"},_n=["innerHTML"],yn={key:1,class:"py-8 text-center text-sm text-ui-text-muted"},wn="inline-flex h-support-badge shrink-0 items-center rounded-full bg-etreprof-50 px-support-badge-x text-support-badge leading-5 font-medium text-etreprof-800",kn="prose prose-sm max-w-none text-sm text-ui-text-toned [&_strong]:text-ui-text-highlighted [&_>:first-child:is(h1,h2)]:hidden",Sn=X({__name:"SeanceSupportModal",props:{open:{type:Boolean},product:{},activite:{},activites:{},products:{},exportingFormat:{}},emits:["update:open","export","navigate"],setup(c,{emit:R}){const o=c,d=R,{t}=ee(),l=pe(),k={overlay:"backdrop-blur-[5px] bg-(--overlay-modal) max-md:backdrop-blur-[3.65px] max-md:bg-(--overlay-modal-mobile)",content:"w-[calc(100vw-1rem)] max-w-support-modal divide-y-0 gap-4 border border-ui-border p-4 shadow-(--shadow-modal-elevated) sm:w-[calc(100vw-2rem)] rounded-md",header:"p-0 sm:px-0",title:"hidden",description:"sr-only",body:"p-0 sm:p-0 flex-none",footer:"p-0 sm:px-0 border-t-0 pt-support-modal-stack"},r=T(()=>cn(o.products,o.activites)),m=T(()=>o.product?r.value.findIndex(D=>D.id===o.product?.id):-1),n=T(()=>r.value.length>1),v=T(()=>m.value>0),F=T(()=>m.value>=0&&m.value<r.value.length-1),P=T(()=>o.activite?.supportActivite?.titre?o.activite.supportActivite.titre:o.activite?.etape??t("seance.supportModalTitle")),M=T(()=>
1o.activite?.supportActivite?.resume??o.activite?.resume??t("seance.supportModalTitle")),B=T(()=>m.value<0||r.value.length===0?"":t("seance.supportModalPositionBadge",{current:m.value+1,total:r.value.length})),u=C(null),i=C([]),p=C(null);let $=!1,I=0;function h(D,z){if(!D)return;if(D instanceof Element){D instanceof HTMLElement&&(i.value[z]=D);return}const q=D.$el;q instanceof HTMLElement&&(i.value[z]=q)}function N(D){return z=>h(z,D)}ae(()=>o.open,D=>{D&&Re(()=>j(m.value,"instant"))}),ae(m,D=>{!o.open||D<0||Re(()=>j(D,"smooth"))});function _(){Re(()=>{const z=p.value?.$el;if(!(z instanceof HTMLElement))return;(z.tagName==="BUTTON"?z:z.querySelector("button"))?.focus()})}function j(D,z="smooth"){const q=u.value,ne=i.value[D];!q||!ne||($=!0,q.scrollTo({left:ne.offsetLeft-q.offsetLeft,behavior:z}),window.setTimeout(()=>{$=!1},z==="instant"?0:400))}function O(){$||!n.value||(cancelAnimationFrame(I),I=requestAnimationFrame(()=>{const D=u.value;if(!D)return;const z=D.scrollLeft;let q=m.value,ne=Number.POSITIVE_INFINITY;i.value.forEach((J,se)=>{if(!J)return;const me=Math.abs(J.offsetLeft-D.offsetLeft-z);me<ne&&(ne=me,q=se)});const le=r.value[q];le&&q!==m.value&&d("navigate",le)}))}function H(D){D!==m.value&&window.matchMedia("(min-width: 768px)").matches&&te(D)}function V(){v.value&&d("navigate",r.value[m.value-1])}function oe(){F.value&&d("navigate",r.value[m.value+1])}function te(D){if(D===m.value)return;const z=r.value[D];z&&d("navigate",z)}async function fe(){if(o.product?.content)try{const D=o.product.content.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();await navigator.clipboard.writeText(D),l.add({title:t("seance.supportCopyToast"),color:"success"})}catch{l.add({title:t("seance.supportCopyToastError"),color:"error"})}}function de(){d("update:open",!1)}return(D,z)=>{const q=ie,ne=Ae,le=ke;return a(),G(le,{open:c.open,close:!1,title:e(P),description:e(M),ui:k,"aria-labelledby":"seance-support-modal-title","onUpdate:open":z[1]||(z[1]=J=>d("update:open",J)),"onAfter:enter":_},{header:Z(()=>[s("div",dn,[s("div",un,[e(B)?(a(),f("span",{key:0,class:U(wn),"aria-label":e(t)("seance.supportModalPositionAria",{current:e(m)+1,total:e(r).length})},b(e(B)),9,pn)):E("",!0),s("h2",fn,b(e(P)),1)]),y(q,{ref_key:"closeButtonRef",ref:p,icon:"i-lucide-x",color:"neutral",variant:"ghost",size:"sm",class:"shrink-0 rounded-xl","aria-label":e(t)("common.close"),onClick:de},null,8,["aria-label"])])]),body:Z(()=>[s("div",mn,[s("div",gn,[e(n)?(a(),G(q,{key:0,icon:"i-lucide-chevron-left",color:"neutral",variant:"outline",size:"md",class:"hidden shrink-0 self-center rounded-xl md:inline-flex","aria-label":e(t)("seance.supportNavPrevious"),disabled:!e(v),onClick:V},null,8,["aria-label","disabled"])):E("",!0),s("div",{ref_key:"carouselViewport",ref:u,class:U(["min-w-0 flex-1 scroll-smooth [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e(n)?"overflow-x-auto snap-x snap-mandatory":""]),onScrollPassive:O},[s("div",{class:U(["flex",e(n)?"gap-0 md:gap-4":"w-full"])},[(a(!0),f(Q,null,he(e(r),(J,se)=>(a(),f("article",{key:J.id,ref_for:!0,ref:N(se),class:U(["relative shrink-0 snap-start",e(n)?"w-full min-w-full md:min-w-0 md:w-[calc(100%-3rem)] md:cursor-pointer":"w-full"]),"aria-hidden":se!==e(m),onClick:me=>H(se)},[s("div",vn,[s("div",bn,[se===e(m)?(a(),G(q,{key:0,icon:"i-lucide-copy",color:"primary",variant:"brand",size:"xs","aria-label":e(t)("seance.supportCopyAria"),title:e(t)("seance.supportCopyAria"),onClick:Be(fe,["stop"])},null,8,["aria-label","title"])):E("",!0)]),s("div",hn,[J.content?(a(),f("div",{key:0,class:U(kn),innerHTML:J.content},null,8,_n)):(a(),f("p",yn,b(e(t)("seance.supportModalEmpty")),1))])])],10,xn))),128))],2)],34),e(n)?(a(),G(q,{key:1,icon:"i-lucide-chevron-right",color:"neutral",variant:"outline",size:"md",class:"hidden shrink-0 self-center rounded-xl md:inline-flex","aria-label":e(t)("seance.supportNavNext"),disabled:!e(F),onClick:oe},null,8,["aria-label","disabled"])):E("",!0)])])]),footer:Z(()=>[y(ne,{variant:"cta","loading-format":c.exportingFormat,onExport:z[0]||(z[0]=J=>d("export",J))},null,8,["loading-format"])]),_:1},8,["open","title","description"])}}}),$n=Object.assign(Sn,{__name:"SeanceSupportModal"}),An={class:"flex flex-col gap-4"},Tn={class:"flex flex-col gap-3"},Cn={class:"flex items-center gap-4"},Pn={class:"text-xl font-heading text-ui-text-toned"},In={key:0,class:"flex h-[320px] flex-col gap-6 overflow-hidden text-sm"},Mn=["innerHTML"],Rn={key:1,class:"py-8 text-center text-sm text-ui-text-muted"},Ln={key:2,class:"pointer-events-none absolute bottom-[77px] left-0 h-[54px] w-full bg-linear-to-b from-transparent to-white","aria-hidden":"true"},Un={key:3,class:"flex w-full flex-col items-center pt-4"},En=X({__name:"SeanceResumeCard",props:{seance:{},exportingFormat:{}},emits:["export","view-full"],setup(c,{emit:R}){const o=c,d=R,{t,locale:l}=ee(),k=T(()=>o.seance.etat===we.BROUILLON);function r(n){return new Date(n).toLocaleDateString(l.value,{day:"2-digit",month:"2-digit",year:"numeric"})}const m=T(()=>k.value?{label:t("seance.resumeStatusPending"),color:"warning",variant:"subtle",class:"bg-warning/15 px-2 py-1 text-xs leading-4 font-medium text-warning-700"}:o.seance.validatedAt?{label:t("seance.confirmedAt",{date:r(o.seance.validatedAt)}),color:"success",variant:"subtle",class:"px-2 py-1 text-xs leading-4 font-medium"}:{label:t("seance.statusConfirmee"),color:"success",variant:"subtle",class:"px-2 py-1 text-xs leading-4 font-medium"});return(n,v)=>{const F=$e,P=Ae,M=ie;return a(),f("section",An,[s("div",Tn,[s("div",Cn,[s("h2",Pn,b(e(t)("seance.resume")),1),y(F,{label:e(m).label,color:e(m).color,variant:e(m).variant,class:U(e(m).class),size:"sm"},null,8,["label","color","variant","class"]),e(k)?E("",!0):(a(),G(P,{
1key:0,"loading-format":o.exportingFormat,class:"hidden sm:flex ml-auto",onExport:v[0]||(v[0]=B=>d("export",B))},null,8,["loading-format"]))]),e(k)?E("",!0):(a(),G(P,{key:0,"loading-format":o.exportingFormat,class:"sm:hidden",onExport:v[1]||(v[1]=B=>d("export",B))},null,8,["loading-format"]))]),s("div",{class:U(["relative flex flex-col items-start justify-between overflow-hidden rounded-md border border-ui-border bg-white p-6",c.seance.resume?"h-[420px]":""])},[c.seance.resume?(a(),f("div",In,[s("div",{class:"prose prose-sm max-w-none text-ui-text-toned [&_strong]:text-ui-text-highlighted",innerHTML:c.seance.resume},null,8,Mn)])):(a(),f("p",Rn,b(e(t)("seance.resumeEmpty")),1)),c.seance.resume?(a(),f("div",Ln)):E("",!0),c.seance.resume?(a(),f("div",Un,[y(M,{label:e(t)("seance.resumeViewFull"),"trailing-icon":"i-lucide-eye",color:"neutral",variant:"outline",size:"sm",onClick:v[2]||(v[2]=B=>d("view-full"))},null,8,["label"])])):E("",!0)],2)])}}}),On=Object.assign(En,{__name:"SeanceResumeCard"}),Bn={class:"flex flex-col items-center gap-5 px-2 py-2"},Dn={key:0,class:"text-center text-2xl font-bold text-ui-text-highlighted"},Fn={key:1,class:"whitespace-pre-line text-center text-sm text-ui-text-muted"},jn={class:"flex w-full justify-between gap-3"},Nn=X({__name:"SeanceRatingAfterTestingModal",props:{open:{type:Boolean},seanceId:{}},emits:["update:open","closeModal","rated"],setup(c,{emit:R}){const o=c,d=R,{t}=ee(),l=pe(),{rateAfterTest:k}=ge(),r=C(0),m=C(""),n=C(""),v=C(!1),F=T(()=>r.value===5||r.value===4?t("seance.ratingAfterTesting.placeholderPositive"):t("seance.ratingAfterTesting.placeholderNegative")),P=T(()=>r.value===0?t("seance.ratingAfterTesting.titleInitial"):t("seance.ratingAfterTesting.titleRated")),M=T(()=>r.value===5||r.value===4?t("seance.ratingAfterTesting.labelPositive"):r.value===3?t("seance.ratingAfterTesting.labelNeutral"):t("seance.ratingAfterTesting.labelNegative"));function B(){d("update:open",!1),d("closeModal")}async function u(){if(n.value=r.value===0?t("seance.ratingAfterTesting.errorNoRating"):"",!(n.value||v.value)){v.value=!0;try{const i=await k(o.seanceId,{note:r.value,commentaire:m.value.trim()||void 0});l.add({title:ze("p",{},[ze("strong",{},t("seance.ratingAfterTesting.toastTitle"))]),description:t("seance.ratingAfterTesting.toastDescription"),color:"success",duration:tt}),d("rated",i),B()}catch{l.add({title:t("seance.ratingModal.toastError"),color:"error"})}finally{v.value=!1}}}return ae(()=>o.open,i=>{i&&(r.value=0,m.value="")}
1),ae(()=>r.value,i=>{i&&(n.value="")}),(i,p)=>{const $=De,I=pt,h=Fe,N=je,_=ie,j=ke;return a(),G(j,{open:c.open,title:e(P),"onUpdate:open":p[2]||(p[2]=O=>{O||B()})},{body:Z(()=>[s("div",Bn,[e(r)>0?(a(),f("p",Dn,b(e(t)("seance.ratingModal.scoreDisplay",{score:e(r)})),1)):E("",!0),y($,{modelValue:e(r),"onUpdate:modelValue":p[0]||(p[0]=O=>re(r)?r.value=O:null),size:"lg"},null,8,["modelValue"]),e(r)===0?(a(),f("p",Fn,b(e(t)("seance.ratingAfterTesting.instructions")),1)):E("",!0),e(n)?(a(),G(I,{key:2,color:"error",variant:"subtle",class:"mb-4",description:e(n)},null,8,["description"])):E("",!0),e(r)?(a(),G(N,{key:3,class:"w-full",label:e(M),ui:{label:"w-full text-center mb-4 font-bold"}},{default:Z(()=>[y(h,{modelValue:e(m),"onUpdate:modelValue":p[1]||(p[1]=O=>re(m)?m.value=O:null),placeholder:e(F),rows:4,class:"w-full",maxlength:e(Ye)},null,8,["modelValue","placeholder","maxlength"])]),_:1},8,["label"])):E("",!0)])]),footer:Z(()=>[s("div",jn,[y(_,{class:"flex-1",variant:"ghost",label:e(t)("common.cancel"),disabled:e(v),onClick:B},null,8,["label","disabled"]),y(_,{class:"flex-1",label:e(t)("common.validate"),loading:e(v),onClick:u},null,8,["label","loading"])])]),_:1},8,["open","title"])}}}),zn=Object.assign(Nn,{__name:"SeanceRatingAfterTestingModal"}),Vn={class:"bg-amber-300 text-amber-950 rounded-md flex text-sm p-4"},qn={class:"flex flex-col ml-2.5"},Hn={class:"font-semibold not-lg:hidden"},Gn={class:"mt-1 not-lg:hidden"},Kn={class:"mt-1 lg:hidden"},Wn=X({__name:"SeanceRatingAfterTastingBlock",props:{seanceId:{}},emits:["rated"],setup(c,{emit:R}){const{t:o}=ee(),d=R,t=C(!1);return(l,k)=>{const r=_e,m=ie,n=zn;return a(),f(Q,null,[s("div",Vn,[y(r,{class:"mt-0.5 text-[20px]",name:"i-lucide-presentation"}),s("div",qn,[s("p",Hn,b(e(o)("seance.ratingAfterTesting.blockTitle")),1),s("p",Gn,b(e(o)("seance.ratingAfterTesting.blockSubtitle")),1),s("p",Kn,b(e(o)("seance.ratingAfterTesting.blockSubtitleMobile")),1),y(m,{label:e(o)("seance.ratingAfterTesting.blockCta"),class:"text-xs max-w-40 rounded-2xl mt-2",color:"neutral","trailing-icon":"i-lucide-arrow-right",onClick:k[0]||(k[0]=v=>t.value=!0)},null,8,["label"])])]),y(n,{open:e(t),"onUpdate:open":k[1]||(k[1]=v=>re(t)?t.value=v:null),"seance-id":c.seanceId,onCloseModal:k[2]||(k[2]=v=>t.value=!1),onRated:k[3]||(k[3]=v=>d("rated",v))},null,8,["open","seance-id"])],64)}}}),Yn=Object.assign(Wn,{__name:"SeanceRatingAfterTastingBlock"}),Jn={class:"flex flex-col gap-4"},Xn={class:"flex flex-col gap-3"},Qn={class:"flex items-center gap-4"},Zn={class:"text-xl font-heading text-ui-text-toned"},eo={key:0,class:"flex flex-col items-center justify-center rounded-md border border-ui-border bg-ui-bg-elevated p-6"},to={class:"flex flex-col items-center gap-2"},no={class:"text-center text-xl font-heading text-ui-text"},oo={class:"text-center text-base font-medium text-ui-text-muted"},ao={key:1,class:"flex flex-col items-center justify-center rounded-md border border-ui-border bg-ui-bg-elevated p-6"},so={class:"flex flex-col items-center gap-4"},io={class:"text-center text-xl font-heading text-ui-text"},lo={class:"text-center text-base font-medium text-ui-text-muted"},ro={key:2,class:"flex flex-col items-center justify-center rounded-md border border-ui-border bg-ui-bg-elevated p-6"},co={class:"flex flex-col items-center gap-4"},uo={class:"text-center text-xl font-heading text-ui-text"},po={class:"text-center text-base font-medium text-ui-text-muted"},fo={key:3,class:"flex flex-col items-center justify-center rounded-md border border-ui-border bg-ui-bg-elevated p-6"},mo={class:"flex w-full flex-col items-center gap-6"},go={class:"flex w-full flex-col items-center gap-2"},xo={class:"text-center text-xl leading-7 font-heading text-ui-text"},vo={class:"text-center text-base leading-6 font-medium text-ui-text-muted"},bo={key:0,class:"mb-4 flex flex-col gap-1"},ho={class:"text-sm font-semibold text-ui-text-highlighted"},_o={class:"text-sm text-ui-text-muted"},yo={key:1,class:"flex h-[280px] flex-col gap-6 overflow-hidden text-sm"},wo=["innerHTML"],ko={key:2,class:"py-8 text-center text-sm text-ui-text-muted"},So={key:3,class:"pointer-events-none absolute bottom-[77px] left-0 h-[54px] w-full bg-linear-to-b from-transparent to-white","aria-hidden":"true"},$o={key:4,class:"flex w-full flex-col items-center pt-4"},Ao=3e3,To=X({__name:"SeanceFicheProfCard",props:{seance:{},generating:{type:Boolean},exportingFormat:{}},emits:["generate","export","view-full","ready","failed"],setup(c,{emit:R}){const o=["completed","failed"],d=c,t=R,{t:l}=ee(),k=pe(),{syncProductJob:r}=ge(),m=T(()=>d.seance.etat===we.BROUILLON),n=T(()=>d.seance.products.find(i=>i.type===ye.FICHE_PROF)),v=T(()=>!!n.value&&!n.value.mdLink),F=T(()=>!!n.value&&!!n.value.mdLink),P=C(!1);async function M(){if(n.value)try{const{status:i}=await r(d.seance.id,n.value.id);P.value=!0,o.includes(i)&&(u(),i==="completed"?(k.add({title:l("seance.ficheProfToastReady"),color:"success"}),t("ready")):(k.add({title:l("seance.ficheProfToastError"),color:"error"}),t("failed")))}catch(i){if(!P.value){console.error("Initial syncProductJob request failed during fiche prof generation",i),u(),k.add({title:l("seance.ficheProfToastError"),color:"error"}),t("failed");return}}}const{resume:B,pause:u}=Ke(M,Ao,{immediate:!1});return ae(v,i=>{i?B():u()}),nt(()=>{P.value=!1,v.value&&B()}),We(()=>{u()}),(i,p)=>{const $=$e,I=Ae,h=_e,N=ie;return a(),f("section",Jn,[s("div",Xn,[s("div",Qn,[s("h2",Zn,b(e(l)("seance.ficheProf")),1),e(m)?(a(),G($,{key:0,label:e(l)("seance.ficheProfLocked"),color:"neutral",variant:"subtle",size:"sm",class:"bg-ui-bg-accented px-2 py-1 text-xs leading-4 font-medium text-ui-text"},null,8,["label"])):e(F)?(a(),G($,{key:1,label:e(l)("seance.ficheProfGenerated"),color:"success",variant:"subtle",size:"sm",class:"px-2 py-1 text-xs leading-4 font-medium"},null,8,["label"])):E("",!0),e(F)?(a(),G(I,{key:2,"loading-format":d.exportingFormat,class:"hidden sm:flex ml-auto",onExport:p[0]||(p[0]=_=>t("export",_))},null,8,["loading-format"])):E("",!0)]),e(F)?(a(),G(I,{key:0,"loading-format":d.exportingFormat,class:"sm:hidden",onExport:p[1]||(p[1]=_=>t("export",_))},null,8,["loading-format"])):E("",!0)]),e(m)?(a(),f("div",eo,[s("div",to,[y(h,{name:"i-lucide-lock",class:"size-6 text-ui-text-muted","aria-hidden":"true"}),s("p",no,b(e(l)("seance.ficheProfLockedTitle")),1),s("p",oo,b(e(l)("seance.ficheProfLockedDescription")),1)])])):c.generating?(a(),f("div",ao,[s("div",so,[y(h,{name:"i-lucide-loader-2",class:"size-6 animate-spin text-primary-500","aria-hidden":"true"}),s("p",io,b(e(l)("seance.ficheProfGeneratingTitle")),1),s("p",lo,b(e(l)("seance.ficheProfGeneratingDescription")),1)])])):e(v)?(a(),f("div",ro,[s("div",co,[y(h,{name:"i-lucide-loader-2",class:"size-6 animate-spin text-primary-500","aria-hidden":"true"}),s("p",uo,b(e(l)("seance.ficheProfGeneratingTitle")),1),s("p",po,b(e(l)("seance.ficheProfGeneratingDescription")),1)])])):e(n)?(a(),f("div",{key:4,class:U(["relative flex flex-col overflow-hidden rounded-md border border-ui-border bg-white p-6",e
1(n).content?"h-[420px]":""])},[c.seance.titre?(a(),f("div",bo,[s("p",ho,b(c.seance.titre),1),s("p",_o,[Le(b(c.seance.discipline?.nomAffiche)+" ",1),c.seance.duree?(a(),f(Q,{key:0},[Le(" · "+b(e(l)("seance.paramDureeMinutes",{n:c.seance.duree})),1)],64)):E("",!0),c.seance.sequence&&c.seance.position!=null?(a(),f(Q,{key:1},[Le(" · "+b(e(l)("seance.positionLabel",{position:c.seance.position,total:c.seance.sequence.nbSeances})),1)],64)):E("",!0)])])):E("",!0),e(n).content?(a(),f("div",yo,[s("div",{class:"prose prose-sm max-w-none text-ui-text-toned [&_strong]:text-ui-text-highlighted",innerHTML:e(n).content},null,8,wo)])):(a(),f("p",ko,b(e(l)("seance.ficheProfEmptyContent")),1)),e(n).content?(a(),f("div",So)):E("",!0),e(n).content?(a(),f("div",$o,[y(N,{label:e(l)("seance.ficheProfViewFull"),"trailing-icon":"i-lucide-eye",color:"neutral",variant:"outline",size:"sm",onClick:p[3]||(p[3]=_=>t("view-full"))},null,8,["label"])])):E("",!0)],2)):(a(),f("div",fo,[s("div",mo,[s("div",go,[y(h,{name:"i-lucide-file-text",class:"size-6 text-primary-300","aria-hidden":"true"}),s("p",xo,b(e(l)("seance.ficheProfReadyTitle")),1),s("p",vo,b(e(l)("seance.ficheProfReadyDescription")),1)]),y(N,{label:e(l)("seance.ficheProfGenerate"),size:"xs",onClick:p[2]||(p[2]=_=>t("generate"))},null,8,["label"])])]))])}}}),Co=Object.assign(To,{__name:"SeanceFicheProfCard"}),Po=["id","aria-expanded","aria-controls","onClick"],Io={class:"flex w-full items-start gap-1 sm:contents"},Mo={class:"hidden sm:inline"},Ro={class:"sm:hidden"},Lo={class:"hidden min-w-0 flex-1 text-sm leading-[1.4] font-medium text-ui-text-highlighted sm:inline"},Uo={class:"ml-auto flex shrink-0 items-center gap-1 sm:ml-0"},Eo={class:"w-full text-sm leading-[1.4] font-medium text-ui-text-highlighted sm:hidden"},Oo=["id","aria-labelledby"],Bo={key:0,class:"text-xs leading-4 text-ui-text-highlighted"},Do={class:"min-w-0 flex-1 text-sm leading-[1.4] font-medium text-ui-text-highlighted"},Fo=["aria-label","onClick"],jo={class:"min-w-0 flex-1 text-sm leading-[1.4] font-medium text-ui-text-highlighted"},No={class:"flex w-full shrink-0 flex-wrap items-center justify-end gap-1 sm:w-auto"},zo={class:"min-w-0 flex-1 text-sm leading-[1.4] font-medium text-ui-text-highlighted"},Vo={class:"flex w-full shrink-0 flex-wrap items-center justify-end gap-1 sm:w-auto"},qo=["aria-label"],Ho={class:"relative whitespace-nowrap text-white"},Go={key:1,class:"flex w-full shrink-0 flex-wrap items-center justify-end gap-1 sm:w-auto"},Ko="/support-preparing-gradient.png",Ee="inline-flex h-6 shrink-0 items-center gap-1 px-2 text-xs leading-4 font-medium",Oe="inline-flex h-support-badge shrink-0 items-center rounded-full px-support-badge-x text-support-badge leading-5 font-medium",Wo="inline-flex h-support-badge shrink-0 items-center rounded-full bg-ui-bg-elevated px-support-badge-x text-support-badge leading-5 font-medium text-ui-text",ue="inline-flex shrink-0 items-center rounded-md bg-ui-bg-elevated px-2.5 py-1.5 text-xs font-medium text-ui-text-muted",Yo="inline-flex shrink-0 items-center rounded-md bg-success-500/15 px-2.5 py-1.5 text-xs font-medium text-success-600",Jo="rounded-support-card border border-ui-border bg-white",Se="flex flex-col gap-4 roun
1ded-support-card border border-ui-border bg-white p-support-card sm:min-h-14 sm:flex-row sm:items-start sm:justify-between sm:p-support-card",Ve="flex flex-col gap-1.5",qe="flex flex-col gap-4 rounded-b-support-card border border-t-0 border-ui-border bg-white px-4 pt-4 pb-4",Xo=X({__name:"SeanceSupportsActiviteAccordion",props:{activites:{},locked:{type:Boolean},availabilityPending:{type:Boolean},isActiviteExpanded:{type:Function},isTypeAvailable:{type:Function},formatSupportLabel:{type:Function},supportState:{type:Function}},emits:["toggle-activite","prepare","open-support"],setup(c,{emit:R}){const o=`${Ee} shrink-0 border-0 shadow-none ring-0 py-0 [&>svg]:size-4`,d=c,t=R,{t:l}=ee();function k(i,p){return`${i}:${p}`}function r(i,p){return{activite:i,typeSupport:p,key:k(i.id,p)}}function m(i){const p=i.etape?.trim()||i.supportActivite?.titre?.trim()||"";return p.endsWith(".")?p.slice(0,-1):p}function n(i){return i.duree?.trim()??""}function v(i){return d.locked?`${Oe} bg-neutral-300 text-etreprof-950`:i?`${Oe} bg-etreprof-200 text-etreprof-800`:`${Oe} bg-etreprof-50 text-etreprof-800`}function F(i){return d.isActiviteExpanded(i)?d.locked?"rounded-t-support-card border border-b-0 border-ui-border bg-white p-support-card":"rounded-t-support-card border border-b-0 border-ui-border bg-etreprof-50 p-support-card":"p-support-card"}function P(i){return d.locked&&d.isActiviteExpanded(i)?[qe,"border-x border-b"]:qe}function M(i,p){return d.supportState?.(i,p)??"idle"}function B(i){return d.availabilityPending?l("seance.supportAvailabilityChecking"):d.isTypeAvailable(i)?l("seance.supportPlanToValidate"):l("seance.supportComingSoon")}function u(i,p){if(d.availabilityPending||d.isTypeAvailable(p))return!1;const $=M(i,p);return $!=="ready"&&$!=="running"&&$!=="checking"&&$!=="failed"}return(i,p)=>{const $=_e,I=ie;return a(),f("div",{class:U(Ve)},[(a(!0),f(Q,null,he(c.activites,(h,N)=>(a(),f("article",{key:h.id,class:U(c.isActiviteExpanded(h.id)?"":Jo)},[s("button",{id:`activite-trigger-${h.id}`,type:"button",class:U(["flex w-full flex-col gap-2 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-600 sm:flex-row sm:items-start sm:gap-1",F(h.id)]),"aria-expanded":c.isActiviteExpanded(h.id),"aria-controls":`activite-panel-${h.id}`,onClick:_=>t("toggle-activite",h.id)},[s("div",Io,[s("span",{class:U(v(c.isActiviteExpanded(h.id)))},[s("span",Mo,b(N+1),1),s("span",Ro,b(e(l)("seance.supportActivityBadge",{number:N+1})),1)],2),s("span",Lo,b(m(h)),1),s("span",Uo,[n(h)?(a(),f("span",{key:0,class:U(Wo)},b(n(h)),1)):E("",!0),y($,{name:"i-lucide-chevron-down",class:U(["size-5 shrink-0 text-ui-text-muted transition-transform",{"rotate-180":c.isActiviteExpanded(h.id)}]),"aria-hidden":"true"},null,8,["class"])])]),s("span",Eo,b(m(h)),1)],10,Po),c.isActiviteExpanded(h.id)?(a(),f("div",{key:0,id:`activite-panel-${h.id}`,role:"region","aria-labelledby":`activite-trigger-${h.id}`,class:U(P(h.id))},[h.resume?.trim()?(a(),f("p",Bo,b(h.resume),1)):E("",!0),e(be)(h).length?E("",!0):(a(),f("article",{key:1,class:U(Se)},[s("span",{class:U([ue,"sm:ml-auto"])},b(e(l)("seance.supportNoSupport")),3)])),e(be)(h).length?(a(),f("div",{key:2,class:U(Ve)},[(a(!0),f(Q,null,he(e(be)(h),_=>(a(),f(Q,{key:k(h.id,_)},[c.locked?(a(),f("article",{key:0,class:U(Se)},[c.availabilityPending||!c.isTypeAvailable(_)?(a(),f("span",{key:0,class:U(["sm:hidden",ue])},b(B(_)),1)):E("",!0),s("p",Do,b(c.formatSupportLabel(_)),1),s("span",{class:U([ue,c.availabilityPending||!c.isTypeAvailable(_)?"hidden sm:inline-flex":""])},b(B(_)),3)])):M(h.id,_)==="ready"?(a(),f("button",{key:1,type:"button",class:U([Se,"w-full cursor-pointer text-left transition-colors hover:bg-ui-bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600"]),"aria-label":`${e(l)("seance.supportView")} — ${c.formatSupportLabel(_)}`,onClick:j=>t("open-support",r(h,_))},[s("p",jo,b(c.formatSupportLabel(_)),1),s("div",No,[s("span",{class:U(Yo)},b(e(l)("seance.supportReadyBadge")),1)])],10,Fo)):(a(),f("article",{key:2,class:U(Se)},[u(h.id,_)?(a(),f("span",{key:0,class:U(["sm:hidden",ue])},b(e(l)("seance.supportComingSoon")),1)):c.availabilityPending&&M(h.id,_)!=="ready"&&M(h.id,_)!=="running"&&M(h.id,_)!=="checking"&&M(h.id,_)!=="failed"?(a(),f("span",{key:1,class:U(["sm:hidden",ue])},b(e(l)("seance.supportAvailabilityChecking")),1)):E("",!0),s("p",zo,b(c.formatSupportLabel(_)),1),s("div",Vo,[M(h.id,_)==="running"||M(h.id,_)==="checking"?(a(),f("span",{key:0,class:U([Ee,"relative w-full justify-center overflow-hidden rounded-xl sm:w-auto"]),role:"status","aria-label":e(l)("seance.supportPreparing")},[s("img",{src:Ko,alt:"",class:"pointer-events-none absolute inset-0 size-full rounded-xl object-cover","aria-hidden":"true"}),y($,{name:"i-lucide-loader-circle",class:"relative size-4 shrink-0 animate-spin text-white","aria-hidden":"true"}),s("span",Ho,b(e(l)("seance.supportPreparing")),1)],10,qo)):M(h.id,_)==="failed"?(a(),f("div",Go,[s("span",{class:U([Ee,"rounded-md bg-error-500/15 text-error-600"])},b(e(l)("seance.supportFailedBadge")),3),c.isTypeAvailable(_)?(a(),G(I,{key:0,label:e(l)("seance.supportRetry"),icon:"i-lucide-rotate-cw",color:"primary",variant:"brand",size:"xs",class:U([o,"w-full justify-center sm:w-auto"]),onClick:Be(j=>t("prepare",r(h,_)),["stop"])},null,8,["label","class","onClick"])):c.availabilityPending?(a(),f("span",{key:1,class:U([ue,"w-full justify-center sm:w-auto"])},b(e(l)("seance.supportAvailabilityChecking")),3)):(a(),f("span",{key:2,class:U([ue,"w-full justify-center sm:w-auto"])},b(e(l)("seance.supportComingSoon")),3))])):c.availabilityPending?(a(),f("span",{key:2,class:U([ue,"hidden sm:inline-flex"]),role:"status"},b(e(l)("seance.supportAvailabilityChecking")),3)):c.isTypeAvailable(_)?(a(),G(I,{key:3,label:e(l)("seance.supportPrepare"),icon:"i-lucide-wand-sparkles",color:"primary",variant:"brand",size:"xs",class:U([o,"w-full justify-center sm:w-auto"]),onClick:Be(j=>t("prepare",r(h,_)),["stop"])},null,8,["label","class","onClick"])):(a(),f("span",{key:4,class:U([ue,"hidden sm:inline-flex"])},b(e(l)("seance.supportComingSoon")),3))])]))],64))),128))])):E("",!0)],10,Oo)):E("",!0)],2))),128))])}}}),Qo=Object.assign(Xo,{__name:"SeanceSupportsActiviteAccordion"}),Zo={class:"flex flex-col gap-4","aria-labelledby":"seance-supports-heading"},ea={class:"flex items-center gap-4"},ta={key:0,class:"text-base font-medium text-ui-text-muted"},na={key:1,class:"flex flex-col items-center gap-6 rounded-md border border-ui-border bg-ui-bg-elevated p-6"},oa={class:"flex flex-col items-center gap-2 text-center"},aa={class:"text-xl font-heading-title text-ui-text"},sa={class:"text-base font-medium text-ui-text-muted"},ia={key:2,class:"rounded-md border border-ui-border bg-white p-6"},la={key:0,class:"text-center text-base text-ui-text-muted"},ra=3e3,ca="support-ready-",da="flex flex-col gap-1.5",ua=X({__name:"SeanceSupportsCard",props:{seance:{}},emits:["ready","open-support"],setup(c,{emit:R}){const o=c,d=R,{t}=ee(),l=pe(),{generateSupport:k,fetchAvailableSupportTypes:r,syncProductJob:m}=ge(),n=C([]),v=C(!1);let F=0;const P=C(new Set),M=C(new Set),B=C(new Set),u=C(!1),i=C(!1),p=C(new Set),$=T(()=>o.seance.etat===we.BROUILLON),I=T(()=>
1o.seance.activitesDetail??[]),h=T(()=>o.seance.products.filter(g=>g.type===ye.SUPPORT)),N=T(()=>I.value.length>0),_=T(()=>!v.value||n.value.length===0?!1:I.value.some(g=>be(g).some(x=>n.value.includes(x)))),j=T(()=>v.value?_.value?{label:t("seance.supportsAvailableBadge"),color:"success",class:"rounded-md bg-success-500/10 px-2 py-1 text-xs leading-4 font-medium text-success-600"}:{label:t("seance.supportsUnavailableBadge"),color:"neutral",class:"rounded-md bg-ui-bg-accented px-2 py-1 text-xs leading-4 font-medium text-ui-text"}:{label:t("seance.supportAvailabilityChecking"),color:"neutral",class:"rounded-md bg-ui-bg-accented px-2 py-1 text-xs leading-4 font-medium text-ui-text"});function O(g,x){return`${g}:${x}`}function H(g,x){if(g.value.has(x))return;const S=new Set(g.value);S.add(x),g.value=S}function V(g,x){if(!g.value.has(x))return;const S=new Set(g.value);S.delete(x),g.value=S}function oe(g){return v.value?n.value.includes(g):!1}const te=T(()=>!v.value);function fe(g,x){return h.value.find(S=>S.activiteId===g&&S.typeSupport===x)}function de(g,x){const S=O(g,x),L=fe(g,x);return L?.mdLink||B.value.has(S)?"ready":P.value.has(S)?"running":M.value.has(S)?"failed":L?i.value?"running":"checking":"idle"}function D(g){return o.seance.supportTypeLabels?.[g]??g.replaceAll("_"," ")}function z(g){return p.value.has(g)}function q(g){const x=new Set(p.value);x.has(g)?x.delete(g):x.add(g),p.value=x}function ne(){const g=new Set(I.value.map(K=>K.id)),x=new Set([...p.value].filter(K=>g.has(K)));if(x.size>0){p.value=x;return}const L=I.value.find(K=>be(K).length>0)?.id??I.value[0]?.id;p.value=L?new Set([L]):new Set}async function le(){const g=++F;v.value||(n.value=[]);try{const x=await r(o.seance.id);if(g!==F)return;n.value=Array.isArray(x?.availableTypes)?x.availableTypes:[]}catch(x){if(g!==F)return;console.error("fetchAvailableSupportTypes failed",x),n.value=[]}finally{g===F&&(v.value=!0)}}function J(g,x){const S=O(g,x);return B.value.has(S)||M.value.has(S)}function se(){return h.value.some(g=>{const x=g.activiteId??"",S=g.typeSupport??"";return!g.mdLink&&!J(x,S)})}function me(g,x={}){const S=B.value.has(g);V(P,g),V(M,g),H(B,g),!S&&x.toastTitle!==void 0&&Te(g,x.toastTitle),x.notifyReady!==!1&&d("ready")}function ve(g,x,S){const L=x,K=L.data;let ce=L.message??"Unknown error";(ot(K)||typeof K=="object"&&K!==null&&"message"in K&&typeof K.message=="string")&&(ce=K.message),console.error(`[SeanceSupportsCard] ${g}
1`,{seanceId:o.seance.id,activiteId:S.activiteId??null,typeSupport:S.typeSupport??null,productId:S.productId??null,statusCode:L.statusCode??L.status??null,apiMessage:ce,error:x})}function xe(g){return`${ca}${g}`}function Te(g,x){l.remove(xe(g)),l.add({id:xe(g),title:t("seance.supportToastReady",{title:x}),color:"success"})}async function Ce(g){const{activite:x,typeSupport:S}=g,L=O(x.id,S);if(!(!oe(S)||P.value.has(L)||B.value.has(L))){V(M,L),V(B,L),H(P,L);try{await k(o.seance.id,{activiteId:x.id,typeSupport:S}),d("ready"),w()}catch(K){ve("generateSupport failed",K,{activiteId:x.id,typeSupport:S}),V(P,L),H(M,L)}}}function Pe(g){const{activite:x,typeSupport:S}=g;if(de(x.id,S)!=="ready")return;const L=fe(x.id,S);!L?.content&&!L?.mdLink||d("open-support",L,x)}async function Ie(){const g=h.value.filter(x=>{const S=x.activiteId??"",L=x.typeSupport??"";return!x.mdLink&&!J(S,L)});if(g.length===0){i.value=!0;return}for(const x of g){const S=O(x.activiteId??"",x.typeSupport??"");try{const{status:L}=await m(o.seance.id,x.id);u.value=!0,L==="completed"?me(S):L==="failed"&&(V(P,S),H(M,S))}catch(L){ve("hydratePendingSupports sync failed",L,{activiteId:x.activiteId,typeSupport:x.typeSupport,productId:x.id}),V(P,S),H(M,S)}}i.value=!0,se()?w():W()}async function A(){const g=h.value.filter(x=>{const S=x.activiteId??"",L=x.typeSupport??"";return!x.mdLink&&!J(S,L)});if(g.length===0){W();return}for(const x of g){const S=O(x.activiteId??"",x.typeSupport??"");try{const{status:L}=await m(o.seance.id,x.id);if(u.value=!0,L==="completed"){const K=I.value.find(Me=>Me.id===x.activiteId),ce=K?.etape?.trim()||K?.supportActivite?.titre?.trim()||"";me(S,{toastTitle:ce.endsWith(".")?ce.slice(0,-1):ce})}else L==="failed"&&(V(P,S),H(M,S))}catch(L){if(!u.value){ve("Initial support sync failed",L,{activiteId:x.activiteId,typeSupport:x.typeSupport,productId:x.id}),W(),V(P,S),H(M,S);return}}}se()||W()}const{resume:w,pause:W}=Ke(A,ra,{immediate:!1});return ae(()=>o.seance.products,()=>{i.value&&(se()?w():W())},{deep:!0}),ae(()=>o.seance.id,()=>{W(),P.value=new Set,M.value=new Set,B.value=new Set,u.value=!1,i.value=!1,F+=1,v.value=!1,n.value=[],le(),ne(),Ie()},{immediate:!0}),ae(()=>o.seance.etat,()=>{le()}),ae(I,()=>{ne()}),We(()=>{W()}),(g,x)=>{const S=$e,L=_e,K=Qo;return a(),f("section",Zo,[s("div",ea,[s("h2",{id:"seance-supports-heading",class:U(e(ft))},b(e(t)("seance.supportsEleves")),3),e($)?(a(),G(S,{key:0,label:e(t)("seance.supportsLockedBadge"),color:"neutral",variant:"subtle",size:"sm",class:"rounded-md bg-ui-bg-accented px-2 py-1 text-xs leading-4 font-medium text-ui-text"},null,8,["label"])):(a(),G(S,{key:1,label:e(j).label,color:e(j).color,variant:"subtle",size:"sm",class:U(e(j).class)},null,8,["label","color","class"]))]),e($)?E("",!0):(a(),f("p",ta,b(e(t)("seance.supportsUnlockedDescription")),1)),e($)?(a(),f("div",na,[s("div",oa,[y(L,{name:"i-lucide-lock",class:"size-6 text-ui-text-muted","aria-hidden":"true"}),s("p",aa,b(e(t)("seance.supportsLockedTitle")),1),s("p",sa,b(e(t)("seance.supportsLockedDescription")),1)]),e(N)?(a(),f("div",{key:0,class:U(["flex w-full flex-col",da])},[y(K,{activites:e(I),locked:"","availability-pending":e(te),"is-activite-expanded":z,"is-type-available":oe,"format-support-label":D,onToggleActivite:q},null,8,["activites","availability-pending"])])):E("",!0)])):(a(),f("div",ia,[e(N)?(a(),G(K,{key:1,activites:e(I),locked:!1,"availability-pending":e(te),"is-activite-expanded":z,"is-type-available":oe,"format-support-label":D,"support-state":de,onToggleActivite:q,onPrepare:Ce,onOpenSupport:Pe},null,8,["activites","availability-pending"])):(a(),f("p",la,b(e(t)("seance.supportsEmpty")),1))]))])}}}),pa=Object.assign(ua,{__name:"SeanceSupportsCard"}
1),fa={class:"flex flex-col gap-4 rounded-md border border-ui-border bg-ui-bg-elevated p-6"},ma={class:"flex items-center justify-between"},ga={class:"text-xl font-heading text-ui-text"},xa={class:"flex flex-col gap-4"},va={class:"text-sm font-medium text-ui-text-highlighted"},ba={class:"text-sm font-medium text-ui-text-toned"},He=4,ha=X({__name:"SeanceParametresCard",props:{seance:{}},setup(c){const R=c,{t:o}=ee(),d=C(!1);function t(u){return u.trim().toLowerCase()}function l(u){if(typeof u=="boolean")return u;if(typeof u=="number"){if(u===1)return!0;if(u===0)return!1}if(typeof u!="string")return null;const i=t(u);return["true","1","oui","yes"].includes(i)?!0:["false","0","non","no"].includes(i)?!1:null}function k(u,i){let p=u;for(const $ of i.split(".")){if(p==null||typeof p!="object")return null;p=p[$]}return p}function r(u){return u==null?!1:typeof u=="string"?u.trim()!=="":Array.isArray(u)?u.some(i=>String(i).trim()!==""):!0}function m(u,i){for(const p of i){const $=k(u,p);if(r($))return $}return null}function n(u){return Array.isArray(u)?u.map(i=>String(i).trim()).filter(Boolean).join(", "):String(u)}function v(u){if(u==null)return"";if(Array.isArray(u))return n(u);if(typeof u=="object"){const i=u,p=i.liste??i.list;return Array.isArray(p)?p.map($=>{if(typeof $=="string")return $.trim();if($&&typeof $=="object"){const I=$,h=I.name??I.label??I.nom;if(typeof h=="string")return h.trim()}return""}).filter(Boolean).join(", "):""}return n(u)}function F(u){const i=u.parametresGeneration??{},p=m(i,["profil_classe.cycle","profilClasse.cycle","cycle"]);return typeof p=="string"?t(p)==="cycle 1":u.discipline==null}const P=T(()=>{const u=[],i=R.seance,p=i.parametresGeneration??{};i.themes.length&&u.push({label:o("seance.paramTheme"),value:i.themes.map(te=>te.nomAffiche).join(", ")}),i.competences.length&&u.push({label:o("seance.paramCompetence"),value:i.competences.map(te=>te.nomAffiche).join(", ")});const $=m(p,["momentPedagogique","formulaire.moment_pedagogique"]);$&&u.push({label:o("seance.paramMomentPedagogique"),value:n($)});const I=m(p,["formePedagogique","typeContenu","formulaire.forme_pedagogique","formulaire.type_contenu"]);I&&u.push({label:o("seance.paramFormePedagogique"),value:n(I)});const h=m(p,["approchePedagogique","formulaire.approches_pedagogiques"]);h&&u.push({label:o("seance.paramApprochePedagogique"),value:n(h)});const N=m(p,["modaliteTravail","formulaire.modalites_travail"]);N&&u.push({label:o("seance.paramModaliteTravail"),value:n(N)});const _=m(p,["typeActivites","typesActivites","typeActivite","formulaire.types_activites"]),j=v(_);j&&u.push({label:o("seance.paramTypeActivites"),value:j}),i.duree!=null&&u.push({label:o("seance.paramDuree"),value:o("seance.paramDureeMinutes",{n:i.duree})}),i.sequence?.titre&&u.push({label:o("seance.paramSequence"),value:i.sequence.titre});const O=m(p,["anneeScolaire","formulaire.annee_scolaire"]);O&&u.push({label:o("seance.paramAnneeScolaire"),value:n(O)});const H=m(p,["besoinsParticuliers","besoinParticulier","formulaire.besoins_particuliers"]);H&&u.push({label:o("seance.paramBesoinsParticuliers"),value:n(H)});const V=m(p,["atsem","presenceAtsem","formulaire.presence_atsem"]),oe=l(V);return F(i)&&oe!==null&&u.push({label:o("seance.paramAtsem"),value:o(oe?"generationSeance.step3.atsemOptions.yes":"generationSeance.step3.atsemOptions.no")}),i.classes.length&&u.push({label:o("seance.paramClasses"),value:i.classes.map(te=>te.nom).join(", ")}),u}),M=T(()=>d.value?P.value:P.value.slice(0,He)),B=T(()=>P.value.length>He);return(u,i)=>{const p=ie;return a(),f("section",fa,[s("div",ma,[s("h2",ga,b(e(o)("seance.parametres")),1),e(B)?(a(),G(p,{key:0,label:e(d)?e(o)("seance.parametresVoirMoins"):e(o)("seance.parametresVoirPlus"),color:"neutral",variant:"outline",size:"xs",onClick:i[0]||(i[0]=$=>d.value=!e(d))},null,8,["label"])):E("",!0)]),s("dl",xa,[(a(!0),f(Q,null,he(e(M),$=>(a(),f("div",{key:$.label,class:"flex flex-col gap-1.5"},[s("dt",va,b($.label),1),s("dd",ba,b($.value),1)]))),128))])])}}}),_a=Object.assign(ha,{__name:"SeanceParametresCard"}),ya={key:0,class:"flex items-start gap-2.5 rounded-lg bg-primary-500/15 p-4"},wa={class:"flex flex-1 flex-col gap-2"},ka={class:"flex flex-col gap-1 text-sm text-primary-900"},Sa={class:"font-medium"},$a={class:"flex items-start gap-1.5"},Aa=X({__name:"SeanceConseilCard",props:{conseil:{},seanceId:{}},emits:["refreshed"],setup(c,{emit:R}){const o=c,d=R,{t}=ee(),l=pe(),k=ge(),r=C(!1);async function m(){if(!r.value){r.value=!0;try{const n=await k.refreshConseil(o.seanceId);d("refreshed",n.conseil)}catch{l.add({title:t("seance.conseilRefreshError"),color:"error"})}finally{r.value=!1}}}return(n,v)=>{const F=_e,P=ie;return c.conseil?(a(),f("section",ya,[y(F,{name:"i-lucide-lightbulb",class:"size-5 shrink-0 text-primary-900","aria-hidden":"true"}),s("div",wa,[s("div",ka,[s("p",Sa,b(e(t)("seance.conseilTitle")),1),s("p",null,b(c.conseil),1)]),s("div",$a,[y(P,{label:e(r)?e(t)("seance.conseilRefreshLoading"):e(t)("seance.conseilRefresh"),"trailing-icon":"i-lucide-refresh-cw",color:"neutral",variant:"outline",size:"xs",class:"bg-white text-ui-text ring-1 ring-ui-border-accented hover:bg-ui-bg-muted",loading:e(r),onClick:m},null,8,["label","loading"])])])])):E("",!0)}}}),Ta=Object.assign(Aa,{__name:"SeanceConseilCard"}),Ca={id:"main-content",class:"mx-auto w-full max-w-5xl px-4 pb-12 pt-4 md:px-8 md:pt-6 lg:pb-16"},Pa={key:0,class:"flex min-h-[400px] items-center justify-center"},Ia={key:1,class:"flex min-h-[400px] flex-col items-center justify-center gap-4"},Ma={class:"text-2xl font-heading text-ui-text-highlighted"},Ra={class:"text-base text-ui-text-muted"},La={class:"pb-4 pt-8"},Ua={key:0,class:"mt-4"},Ea={class:"mt-12 flex flex-col gap-6 lg:flex-row lg:gap-6"},Oa={class:"flex flex-col gap-10 lg:flex-1 lg:min-w-0"},Ba={key:0,class:"lg:hidden"},Da={class:"flex w-full flex-col gap-6 lg:w-98.25 lg:shrink-0"},Fa={key:0,class:"not-lg:hidden"},vs=X({__name:"[id]",async setup(c){let R,o;const{t:d}=ee(),t=at(),l=pe(),k=ge(),{trackPlanDeSeanceConsulte:r}=st(),m=T(()=>t.params.id),n=C(null),v=C(!0),F=C(!1);async function P(A={}){const w=A.silent===!0;w||(v.value=!0),F.value=!1;try{n.value=await k.getById(m.value)}catch{F.value=!0,l.add({title:d("seance.errorLoad"),color:"error"})}finally{w||(v.value=!1)}}[R,o]=it(()=>P()),await R,o();const M=T(()=>n.value?.etat===we.BROUILLON),B=T(()=>t.query.from==="generation"),u=T(()=>{if(t.query.from==="dashboard")return"/espace-enseignant";const w=n.value?.sequence?.id??t.query.sequenceId;return w?`/espace-enseignant/programmation/sequence/${w}`:"/espace-enseignant"}),i=T(()=>t.query.from==="dashboard"?d("seance.backToDashboard"):d("seance.backToSequence")),p=C(!1),$=C(0);function I(A){$.value=A,p.value=!0}function h(A){n.value=A}function N(A){n.value=A}function _(){const A=n.value?.sequence?.id;if(!A){Ue("/espace-enseignant/generation-seance/mode");return}Ue(dt(A,void 0))}const j=C(!1);function O(){j.value=!0}function H(){l.add({title:d("seance.deleteModal.toastDeleted"),color:"success"});const A=n.value?.sequence?.id;Ue(A?`/espace-enseignant/programmation/sequence/${A}`:"/espace-enseignant")}const V=C(!1);async function oe(){if(n.value){V.value=!0,l.add({title:d("seance.ficheProfToastGenerating"),color:"info"});try{const A=await k.generateFicheProf(n.value.id);n.value={...n.value,products:[...n.value.products,A]}}catch{l.add({title:d("seance.ficheProfToastError"),color:"error"})}finally{V.value=!1}}}const te=C(null),fe=C(null),de=C(!1),D=C(!1),z=C(!1),q=C(null),ne=C(null),le=C(null),J=T(()=>n.value?.products.find(A=>A.type===ye.FICHE_PROF)),se=T(()=>(n.value?.products??[]).filter(A=>A.type===ye.SUPPORT));function me(){if(!n.value)return;const A=n.value.classes.flatMap(w=>w.niveaux.map(W=>W.nomAffiche));r({seanceId:n.value.id,titre:n.value.titre,sequenceId:n.value.sequence?.id,niveau:[...new Set(A.map(w=>
1w.trim()).filter(Boolean))].join(", "),discipline:n.value.discipline?.nomAffiche?.trim()||"",cycle:mt(n.value.classes)}),de.value=!0}function ve(A,w,W){const g=document.createElement("a");g.href=A,W==="pdf"?(g.target="_blank",g.rel="noopener noreferrer"):g.download=w,document.body.appendChild(g),g.click(),document.body.removeChild(g)}async function xe(A,w){if(!n.value)return;const W=A==="resume"?te:fe;W.value=w,l.add({id:`export-${A}-${w}`,title:d("seance.exportToastLoading"),color:"info"});try{const{signedUrl:g}=await k.exportDocument(n.value.id,A,w);ve(g,`${n.value.titre}.${w}`,w),l.remove(`export-${A}-${w}`),l.add({title:d("seance.exportToastSuccess"),color:"success"})}catch{l.remove(`export-${A}-${w}`),l.add({title:d("seance.exportToastError"),color:"error"})}finally{W.value=null}}function Te(A){n.value&&(n.value={...n.value,conseil:A})}function Ce(A,w){q.value=A,ne.value=w,z.value=!0}function Pe(A){const w=n.value?.activitesDetail?.find(W=>W.id===A.activiteId)??null;q.value=A,ne.value=w}async function Ie(A){if(!n.value||!q.value)return;const w=q.value.id;le.value=A,l.add({id:`export-support-${A}`,title:d("seance.exportToastLoading"),color:"info"});try{const{signedUrl:W}=await k.exportSupportProduct(n.value.id,w,A);ve(W,`${n.value.titre}.${A}`,A),l.remove(`export-support-${A}`),l.add({title:d("seance.exportToastSuccess"),color:"success"})}catch{l.remove(`export-support-${A}`),l.add({title:d("seance.exportToastError"),color:"error"})}finally{le.value=null}}return lt({title:()=>n.value?.titre?d("seance.pageTitle",{title:n.value.titre}):d("seance.notFound")}),(A,w)=>{const W=_e,g=rt,x=$t,S=Mt,L=Ht,K=Qt,ce=ln,Me=$n,Je=On,Ne=Yn,Xe=Co,Qe=pa,Ze=_a,et=Ta;return a(),f("main",Ca,[e(v)?(a(),f("div",Pa,[y(W,{name:"i-lucide-loader-2",class:"size-8 animate-spin text-ui-text-muted"})])):e(F)||!e(n)?(a(),f("div",Ia,[s("h1",Ma,b(e(d)("seance.notFound")),1),s("p",Ra,b(e(d)("seance.notFoundDescription")),1),y(g,{fallback:e(u)},null,8,["fallback"])])):(a(),f(Q,{key:2},[s("div",La,[y(g,{fallback:e(u),"force-fallback":e(B),label:e(d)("seance.back"),"aria-label":e(i)},null,8,["fallback","force-fallback","label","aria-label"])]),y(x,{seance:e(n),onDelete:O,onUpdate:w[0]||(w[0]=Y=>n.value=Y)},null,8,["seance"]),e(M)?(a(),f("div",Ua,[y(S,{onSelectStar:I})])):E("",!0),y(L,{open:e(p),"onUpdate:open":w[1]||(w[1]=Y=>re(p)?p.value=Y:null),"initial-rating":e($),"seance-id":e(n).id,onValidated:h,onDeleteAndRegenerate:_},null,8,["open","initial-rating","seance-id"]),y(K,{open:e(j),"onUpdate:open":w[2]||(w[2]=Y=>re(j)?j.value=Y:null),"seance-id":e(n).id,onDeleted:H},null,8,["open","seance-id"]),y(ce,{open:e(de),"onUpdate:open":w[3]||(w[3]=Y=>re(de)?de.value=Y:null),title:e(d)("seance.resumeModalTitle"),description:e(d)("seance.resumeModalDescription"),content:e(n).resume,"empty-message":e(d)("seance.resumeEmpty"),"exporting-format":e(te),"show-export":!e(M),onExport:w[4]||(w[4]=Y=>xe("resume",Y))},null,8,["open","title","description","content","empty-message","exporting-format","show-export"]),y(ce,{open:e(D),"onUpdate:open":w[5]||(w[5]=Y=>re(D)?D.value=Y:null),title:e(d)("seance.ficheProfModalTitle"),description:e(d)("seance.ficheProfModalDescription"),content:e(J)?.content,"empty-message":e(d)("seance.ficheProfEmptyContent"),"exporting-format":e(fe),"show-export":!!e(J)?.content,onExport:w[6]||(w[6]=Y=>xe("fiche-prof",Y))},null,8,["open","title","description","content","empty-message","exporting-format","show-export"]),y(Me,{open:e(z),"onUpdate:open":w[7]||(w[7]=Y=>re(z)?z.value=Y:null),product:e(q),activite:e(ne),activites:e(n).activitesDetail??[],products:e(se),"exporting-format":e(le),onExport:Ie,onNavigate:Pe},null,8,["open","product","activite","activites","products","exporting-format"]),s("div",Ea,[s("div",Oa,[y(Je,{seance:e(n),"exporting-format":e(te),onExport:w[8]||(w[8]=Y=>xe("resume",Y)),onViewFull:me},null,8,["seance","exporting-format"]),e(n).noteApresTest===null&&!e(M)?(a(),f("div",Ba,[y(Ne,{"seance-id":e(n).id,onRated:N},null,8,["seance-id"])])):E("",!0),y(Xe,{seance:e(n),generating:e(V),"exporting-format":e(fe),onGenerate:oe,onExport:w[9]||(w[9]=Y=>xe("fiche-prof",Y)),onViewFull:w[10]||(w[10]=Y=>D.value=!0),onReady:w[11]||(w[11]=()=>P({silent:!0}))},null,8,["seance","generating","exporting-format"]),y(Qe,{seance:e(n),onReady:w[12]||(w[12]=()=>P({silent:!0})),onOpenSupport:Ce},null,8,["seance"])]),s("div",Da,[e(n).noteApresTest===null&&!e(M)?(a(),f("div",Fa,[y(Ne,{"seance-id":e(n).id,onRated:N},null,8,["seance-id"])])):E("",!0),y(Ze,{seance:e(n)},null,8,["seance"]),y(et,{conseil:e(n).conseil,"seance-id":e(n).id,onRefreshed:Te},null,8,["conseil","seance-id"])])])],64))])}}});
1export{vs 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.