PageSourceSearch

https://rezixsnkrs.com/assets/EpisodeDetail-BjWz4Ij2.js

js rezixsnkrs.com collected 2026-10-02 01:41:24 UTC 24,329 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BlockNoteLazy-CsP91jQG.js","assets/vendor-react-DjhEi87Y.js","assets/index-CSaaeOAk.js","assets/vendor-supabase-BwNLGjrE.js","assets/vendor-icons-BAsfzkFD.js","assets/index-oZNbedJW.css","assets/BlockNoteLazy-BxZNaHXc.css"])))=>i.map(i=>d[i]);
2import{z as ne,r as ht,i as gt,u as bt,b as vt,s as u,L as C,D as jt,o as Nt,p as _t,q as yt,t as Re,A as Ie,v as Te,w as Pe,x as Ae,y as De,_ as wt}from"./index-CSaaeOAk.js";import{j as e,r as n}from"./vendor-react-DjhEi87Y.js";import{t as Le}from"./blocknote-utils-C5DturhV.js";import{c as kt,B as j}from"./button-CzMtciak.js";import{b as Me,g as Qe}from"./youtube-DwyF6DTr.js";import{a7 as te,a2 as St,m as se,b as Et,$ as Be,n as re,T as qt,a5 as Ct,a6 as Fe,a1 as zt,a3 as Rt,g as It,L as Tt,ab as Pt,a8 as At,l as Dt,N as Lt,M as Mt,a9 as Qt,aa as Oe,S as Ve,ac as Ye,ad as Bt,ae as Ft,af as Ot,ag as Vt,h as Yt}from"./vendor-icons-BAsfzkFD.js";import"./vendor-supabase-BwNLGjrE.js";const $t=kt("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"border-destructive/50 text-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}});function Ut({className:r,variant:m,...b}){return e.jsx("div",{"data-slot":"alert",role:"alert",className:ne($t({variant:m}),r),...b})}function Kt({className:r,...m}){return e.jsx("div",{"data-slot":"alert-title",className:ne("col-start-2 font-medium tracking-tight",r),...m})}function Gt({className:r,...m}){return e.jsx("div",{"data-slot":"alert-description",className:ne("col-start-2 text-sm [&_p]:leading-relaxed",r),...m})}const ae=n.lazy(()=>wt(()=>import("./BlockNoteLazy-CsP91jQG.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),Jt="id,episode_id,title,url,type,sort_order,created_at",Ht="id,is_required,require_quiz_every_time,quiz_questions(id,quiz_id,question,sort_order,quiz_options(id,question_id,text,is_correct,sort_order))";function Wt(){var m;const r=window;return(m=r.YT)!=null&&m.loaded?Promise.resolve():new Promise(b=>{const z=r.onYouTubeIframeAPIReady;if(r.onYouTubeIframeAPIReady=()=>{z&&z(),b()},!document.getElementById("yt-iframe-api")){const v=document.createElement("script");
2v.id="yt-iframe-api",v.src="https://www.youtube.com/iframe_api",document.head.appendChild(v)}})}function Xt({type:r}){const b={pdf:Yt,link:Vt,video:Ot,image:Ft,excel:Bt,other:Ye}[r]??Ye;return e.jsx(b,{className:"h-3.5 w-3.5 shrink-0"})}function os(){var qe;const{id:r}=ht(),{chapterGroups:m,markEpisodeComplete:b,unmarkEpisodeComplete:z,awardBadge:v,markEpisodeViewed:ie}=gt(),{user:a}=bt(),{isAdmin:p}=vt(),V=n.useRef(null),Y=`yt-player-${r??"ep"}`,[$e,$]=n.useState(!1),R=n.useRef(0);n.useEffect(()=>{if(!r)return;const t=m.flatMap(o=>o.episodes).find(o=>o.id===r),s=t!=null&&t.youtube_url?Me(t.youtube_url):null;if(!s)return;const d=++R.current;let c=!1;const l=parseInt(localStorage.getItem(`yt_p_${r}`)??"0",10)||0;return $(!0),Wt().then(()=>{if(c||d!==R.current)return;const o=window;if(!o.YT){$(!1);return}const h=new o.YT.Player(Y,{videoId:s,playerVars:{start:l,rel:0,modestbranding:1},events:{onReady:()=>{d===R.current&&$(!1)},onStateChange:y=>{if(d!==R.current)return;const{PAUSED:x,BUFFERING:F}=o.YT.PlayerState;if(y.data===x||y.data===F){const O=Math.floor(h.getCurrentTime());O>5&&localStorage.setItem(`yt_p_${r}`,String(O))}y.data===0&&localStorage.removeItem(`yt_p_${r}`)}}});V.current=h}),()=>{var o;c=!0;try{(o=V.current)==null||o.destroy()}catch{}V.current=null}},[m,r,Y]);const[oe,I]=n.useState([]),[Ue,de]=n.useState(!0),[T,le]=n.useState(""),[Ke,ce]=n.useState(!1),[Ge,ue]=n.useState(null),[P,U]=n.useState(""),[Je,me]=n.useState(!1),[xe,K]=n.useState(!1),[G,fe]=n.useState(!1),[pe,He]=n.useState(void 0),[We,Xe]=n.useState(!1),[Ze,he]=n.useState(!1),[et,ge]=n.useState(!1),be=n.useRef(),[J,H]=n.useState(!1),[ve,je]=n.useState(!1),[Ne,tt]=n.useState([]),[f,st]=n.useState(null),[rt,_e]=n.useState(!1),[at,nt]=n.useState(0),[A,w]=n.useState(0),[D,L]=n.useState({}),[ye,M]=n.useState(!1),[g,Q]=n.useState(null),i=m.flatMap(t=>t.episodes).find(t=>t.id===r),W=i==null?void 0:i.chapter_id;n.useEffect(()=>{r&&ie(r)},[r,ie]),n.useEffect(()=>{r&&Promise.all([W&&!p?u.from("chapter_quizzes").select(Ht).eq("chapter_id",W).maybeSingle().then(({data:t})=>{if(!t)return;const s=t,c=(s.quiz_questions??[]).sort((l,o)=>(l.sort_order??0)-(o.sort_order??0)).map(l=>({...l,options:(l.quiz_options??[]).sort((o,h)=>(o.sort_order??0)-(h.sort_order??0))}));st({id:s.id,is_required:s.is_required,require_quiz_every_time:s.require_quiz_every_time,questions:c})}):Promise.resolve(),(async()=>{de(!0);const{data:t}=await u.from("chapter_questions").select("id, content, created_at, user_id, parent_id, profiles(name, avatar_url)").eq("episode_id",r).order("created_at",{ascending:!0});I(t??[]),de(!1)})(),a!=null&&a.id?u.from("member_notes").select("content").eq("user_id",a.id).eq("episode_id",r).maybeSingle().then(({data:t})=>{t!=null&&t.content&&He(Le(t.content)),Xe(!0)}):Promise.resolve(),a!=null&&a.id?u.from("bookmarks").select("id").eq("user_id",a.id).eq("episode_id",r).maybeSingle().then(({data:t})=>H(!!t)):Promise.resolve(),u.from("episode_resources").select(Jt).eq("episode_id",r).order("sort_order",{ascending:!0}).then(({data:t})=>tt(t??[]))])},[r,W,a==null?void 0:a.id,p]);async function we(){if(!T.trim()||!a||!r)return;ce(!0);const{data:t}=await u.from("chapter_questions").insert({episode_id:r,user_id:a.id,content:T.trim(),parent_id:null}).select("id, content, created_at, user_id, parent_id, profiles(name, avatar_url)").single();t&&(I(s=>[...s,t]),v("first_question")),le(""),ce(!1)}async function ke(t){if(!P.trim()||!a||!r)return;me(!0);const{data:s}=await u.from("chapter_questions").insert({episode_id:r,user_id:a.id,content:P.trim(),parent_id:t}).select("id, content, created_at, user_id, parent_id, profiles(name, avatar_url)").single();s&&I(d=>[...d,s]),U(""),ue(null),me(!1)}const k=n.useRef(null),Se=n.useRef(null);async function it(){var t;if(!(!i||!((t=k.current)!=null&&t.editor))){K(!0);try{await u.from("episodes").update({content:JSON.stringify(k.current.editor.document)}).eq("id",i.id),K(!1),fe(!0),setTimeout(()=>fe(!1),2500)}catch{K(!1)}}}const ot=n.useCallback(()=>{clearTimeout(be.current),be.current=setTimeout(async()=>{var l;const t=(l=Se.current)==null?void 0:l.editor,s=a==null?void 0:a.id;if(!t||!r||!s)return;he(!0);const d=JSON.stringify(t.document);await u.from("member_notes").upsert({user_id:s,episode_id:r,content:d,updated_at:new Date().toISOString()},{onConflict:"user_id,episode_id"}),he(!1),ge(!0),setTimeout(()=>ge(!1),2e3),v("first_note");const{count:c}=await u.from("member_notes").select("episode_id",{count:"exact",head:!0}).eq("user_id",s);(c??0)>=3&&v("note_addict")},1500)},[r,a==null?void 0:a.id,v]);async function dt(){if(!(!(a!=null&&a.id)||!r||ve)){if(je(!0),J)await u.from("bookmarks").delete().eq("user_id",a.id).eq("episode_id",r),H(!1);else{await u.from("bookmarks").insert({user_id:a.id,episode_id:r}),H(!0);const{count:t}=await u.from("bookmarks").select("id",{count:"exact",head:!0}).eq("user_id",a.id);(t??0)>=5&&v("bookmarker")}je(!1)}}async function Ee(t){await u.from("chapter_questions").delete().eq("id",t),I(s=>s.filter(d=>d.id!==t&&d.parent_id!==t))}function X(){r&&localStorage.removeItem(`yt_p_${r}`)}
2async function lt(){if(i){if(!f||f.questions.length===0){b(i.id),X();return}if(f.require_quiz_every_time===!1&&(a!=null&&a.id)){const{data:t}=await u.from("quiz_attempts").select("score, total").eq("user_id",a.id).eq("quiz_id",f.id);if((t??[]).some(d=>d.total>0&&d.score/d.total>=.6)){b(i.id),X();return}}nt(t=>t+1),w(0),L({}),M(!1),Q(null),_e(!0)}}function Z(){_e(!1),M(!1),Q(null),L({}),w(0)}async function ct(){if(!f||!a||!i)return;const t=f.questions.filter(d=>{var c;return D[d.id]!==void 0&&((c=d.options.find(l=>l.id===D[d.id]))==null?void 0:c.is_correct)}).length,s=f.questions.length;Q({score:t,total:s}),M(!0),await u.from("quiz_attempts").insert({user_id:a.id,quiz_id:f.id,score:t,total:s}),t/s>=.6&&(b(i.id),X(),v("first_episode"))}const S=n.useMemo(()=>Le(i==null?void 0:i.content),[i==null?void 0:i.content]),B=n.useMemo(()=>m.flatMap(t=>t.episodes.map(s=>({...s,chapterTitle:t.title}))),[m]);if(!i)return e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs(C,{to:"/formation",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",children:[e.jsx(te,{className:"h-3.5 w-3.5"})," Formation"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"\xC9pisode introuvable."})]});const N=m.find(t=>t.episodes.some(s=>s.id===i.id));if(!p&&(()=>{if(!(N!=null&&N.sequential))return!1;const t=N.episodes.findIndex(s=>s.id===i.id);return t<=0?!1:N.episodes.slice(0,t).some(s=>!s.completed)})())return e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs(C,{to:"/formation",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",children:[e.jsx(te,{className:"h-3.5 w-3.5"})," Formation"]}),e.jsxs(Ut,{children:[e.jsx(St,{className:"h-4 w-4"}),e.jsx(Kt,{children:"\xC9pisode verrouill\xE9"}),e.jsx(Gt,{children:"Compl\xE9tez les \xE9pisodes pr\xE9c\xE9dents pour acc\xE9der \xE0 celui-ci."})]})]});const ut=i.youtube_url?Me(i.youtube_url):null,mt=!!((qe=i.content)!=null&&qe.trim()),xt=S!==void 0,ee=oe.filter(t=>!t.parent_id),ft=t=>oe.filter(s=>s.parent_id===t),E=B.findIndex(t=>t.id===r),q=E>0?B[E-1]:null,_=E>=0&&E<B.length-1?B[E+1]:null;return e.jsxs("div",{className:"w-full max-w-6xl space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsxs(C,{to:"/formation",className:"inline-flex items-center gap-1 hover:text-foreground transition-colors",children:[e.jsx(te,{className:"h-3.5 w-3.5"})," Formation"]}),N&&e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"h-3 w-3 opacity-40"}),e.jsx("span",{className:"text-foreground/70",children:N.title})]})]}),!p&&f&&f.questions.length>0&&e.jsx(jt,{open:rt,onOpenChange:t=>{t||Z()},children:e.jsxs(Nt,{className:"max-w-lg max-h-[85vh] overflow-y-auto",children:[e.jsx(_t,{children:e.jsxs(yt,{className:"flex items-center gap-2 text-base",children:[e.jsx(Et,{className:"h-4 w-4 text-muted-foreground"}),"Quiz pour valider l'\xE9pisode",!f.is_required&&e.jsx("span",{className:"text-[10px] font-normal text-muted-foreground normal-case",children:"(optionnel)"})]})}),!f.is_required&&!ye&&e.jsx("p",{className:"-mt-2",children:e.jsx("button",{type:"button",onClick:()=>{i&&b(i.id),Z()},className:"text-[11px] text-muted-foreground hover:text-foreground underline",children:"Marquer compl\xE9t\xE9 sans passer le quiz"})}),ye?g?e.jsx("div",{className:"py-4 px-1",children:g.score/g.total>=.6?e.jsxs("div",{className:"text-center space-y-5",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"rounded-full bg-emerald-500/15 p-4",children:e.jsx(qt,{className:"h-10 w-10 text-emerald-600 dark:text-emerald-400"})})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-3xl font-bold tabular-nums text-foreground",children:[Math.round(g.score/g.total*100)," %"]}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[g.score," bonne",g.score>1?"s":""," r\xE9ponse",g.score>1?"s":""," sur ",g.total]})]}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:"\xC9pisode marqu\xE9 compl\xE9t\xE9."}),e.jsx(j,{size:"sm",className:"w-full",onClick:Z,children:"Fermer"})]}):e.jsxs("div",{className:"text-center space-y-5",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"rounded-full bg-amber-500/15 p-4",children:e.jsx(Ct,{className:"h-10 w-10 text-amber-600 dar
2k:text-amber-400"})})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-2xl font-bold tabular-nums text-foreground",children:[g.score," / ",g.total]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Il faut au moins 60 % pour valider."})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Relisez le contenu et r\xE9essayez."}),e.jsxs(j,{variant:"outline",size:"sm",className:"w-full gap-1.5",onClick:()=>{M(!1),L({}),Q(null),w(0)},children:[e.jsx(Fe,{className:"h-3.5 w-3.5"})," Recommencer"]})]})}):null:(()=>{var l;const t=f.questions[A],s=f.questions.length,d=A===s-1,c=D[t==null?void 0:t.id]!==void 0;return e.jsxs("div",{className:"space-y-4 pt-2",children:[e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Question ",A+1," / ",s]}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:t==null?void 0:t.question}),e.jsx("div",{className:"space-y-1.5",children:(l=t==null?void 0:t.options)==null?void 0:l.map(o=>e.jsx("button",{type:"button",onClick:()=>L(h=>({...h,[t.id]:o.id})),className:`w-full text-left text-xs px-3 py-2.5 rounded-md border transition-colors ${D[t.id]===o.id?"border-foreground bg-foreground text-background":"border-border bg-background text-foreground hover:bg-muted/50"}`,children:o.text},o.id))}),e.jsxs("div",{className:"flex justify-between gap-2 pt-2",children:[e.jsxs(j,{variant:"outline",size:"sm",className:"gap-1 text-xs",disabled:A===0,onClick:()=>w(o=>o-1),children:[e.jsx(Be,{className:"h-3 w-3"})," Pr\xE9c\xE9dent"]}),d?e.jsxs(j,{size:"sm",className:"gap-1 text-xs",disabled:!c,onClick:ct,children:[e.jsx(re,{className:"h-3 w-3"})," Valider le quiz"]}):e.jsxs(j,{size:"sm",className:"gap-1 text-xs",disabled:!c,onClick:()=>w(o=>o+1),children:["Suivant ",e.jsx(se,{className:"h-3 w-3"})]})]})]})})()]},at)}),e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-lg font-semibold tracking-tight text-foreground",children:i.title}),i.subtitle&&e.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:i.subtitle}),i.duration&&e.jsxs("p",{className:"mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(zt,{className:"h-3 w-3"})," ",i.duration]})]}),!p&&e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:dt,disabled:ve,title:J?"Retirer des favoris":"Ajouter aux favoris",className:"text-muted-foreground hover:text-foreground transition-colors",children:J?e.jsx(Rt,{className:"h-4 w-4 text-foreground"}):e.jsx(It,{className:"h-4 w-4"})}),i.completed?e.jsxs(j,{variant:"outline",size:"sm",onClick:()=>z(i.id),className:"gap-1.5 text-xs",children:[e.jsx(Fe,{className:"h-3 w-3"})," Annuler"]}):e.jsxs(j,{size:"sm",onClick:lt,className:"gap-1.5",children:[e.jsx(re,{className:"h-3.5 w-3.5"})," Marquer compl\xE9t\xE9"]})]})]}),ut&&e.jsxs("div",{className:"aspect-video w-full overflow-hidden rounded-lg border border-border bg-black relative",children:[$e&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(Tt,{className:"h-6 w-6 animate-spin text-white/60"})}),e.jsx("div",{id:Y,className:"h-full w-full"})]}),(mt||p)&&e.jsxs("div",{className:"rounded-lg border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-1",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Notes"}),p&&e.jsxs(j,{size:"sm",variant:"ghost",onClick:it,disabled:xe,className:`h-7 gap-1.5 text-xs transition-colors ${G?"text-emerald-600 hover:text-emerald-600":""}`,children:[G?e.jsx(re,{className:"h-3 w-3"}):e.jsx(Pt,{className:"h-3 w-3"}),xe?"Enregistrement\u2026":G?"Sauvegard\xE9":"Sauvegarder"]})]}),p?e.jsx(n.Suspense,{fallback:e.jsx("div",{className:"h-32 animate-pulse bg-muted/30"}),children:e.jsx(ae,{initialContent:S,contentDeps:[S],onEditorReady:t=>{k.current=t}})}):xt?e.jsx("div",{onClickCapture:t=>{var c;const s=(c=k.current)==null?void 0:c.editor;if(!s)return;const d=t.target;if(d.tagName==="INPUT"&&d.getAttribute("type")==="checkbox"){t.preventDefault(),t.stopPropagation();const l=d.closest("[data-id]");if(!l)return;const o=l.getAttribute("data-id");if(!o)return;const h=s.getBlock(o);if(!h)return;s.updateBlock(o,{props:{checked:!h.props.checked}}),u.from("episodes").update({content:JSON.stringify(s.document)}).eq("id",i.id)}},children:e.jsx(n.Suspense,{fallback:e.jsx("div",{className:"h-32 animate-pulse bg-muted/30"}),children:e.jsx(ae,{initialContent:S,contentDeps:[S],editable:!1,onEditorReady:t=>{k.current=t}})})}):e.jsx("div",{className:"px-4 pb-4 text-sm text-foreground whitespace-pre-wrap leading-relaxed",children:i.content})]}),(Ne.length>0||i.pdf_url)&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Ressources"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ne.map(t=>e.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-3 py-2 text-xs text-foreground hover:bg-accent transition-colors",children:[e.jsx(Xt,{type:t.type}),t.title]},t.id)),i.pdf_url&&e.jsxs("a",{href:i.pdf_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-3 py-2 text-xs text-foreground hover:bg-accent transition-colors",children:[e.jsx(At,{className:"h-3.5 w-3.5 shrink-0"})," T\xE9l\xE9charger le PDF"]})]})]}),!p&&(q||_)&&e.jsxs("div",{className:"flex gap-3",children:[q&&e.jsxs(C,{to:`/formation/episode/${q.id}`,className:"group flex-1 flex items-center gap-3 rounded-xl border border-border bg-card p-3 hover:bg-muted/20 transition-colors",children:[e.jsx(Be,{className:"h-4 w-4 shrink-0 text-muted-foreground group-hover:-translate-x-0.5 transition-transform"}),e.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground mb-0.5",children:"Pr\xE9c\xE9dent"}),e.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:q.title}),e.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:q.chapterTitle})]})]}),_&&e.jsxs(C,{to:`/formation/episode/${_.id}`,className:"group flex-1 flex items-center gap-3 rounded-xl border border-border bg-card overflow-hidden hover:bg-muted/20 transition-colors",children:[e.jsx("div",{className:"relative h-16 w-24 shrink-0 bg-muted overflow-hidden",children:Qe(_.youtube_url)?e.jsx("img",{src:Qe(_.youtube_url),alt:"",className:"h-full w-full object-cover"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center",children:e.jsx(Dt,{className:"h-5 w-5 text-muted-foreground
2/40"})})}),e.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden py-1",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground mb-0.5",children:"Suivant"}),e.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:_.title}),e.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:_.chapterTitle})]}),e.jsx(se,{className:"h-4 w-4 shrink-0 text-muted-foreground mr-3 group-hover:translate-x-0.5 transition-transform"})]})]}),!p&&e.jsxs("div",{className:"rounded-lg border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Lt,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Mes Notes"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground transition-opacity",children:Ze?"Enregistrement\u2026":et?"\u2713 Sauvegard\xE9":""})]}),We?e.jsx(n.Suspense,{fallback:e.jsx("div",{className:"h-16 animate-pulse bg-muted/30 mx-4 mb-4 rounded"}),children:e.jsx(ae,{initialContent:pe,contentDeps:[pe],onChange:ot,onEditorReady:t=>{Se.current=t}})}):e.jsx("div",{className:"h-16 animate-pulse bg-muted/30 mx-4 mb-4 rounded"})]}),e.jsxs("div",{className:"space-y-4 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-2 border-t border-border pt-4",children:[e.jsx(Mt,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("h2",{className:"text-sm font-medium text-foreground",children:["Questions (",ee.length,")"]})]}),Ue?e.jsx("div",{className:"space-y-2",children:[1,2].map(t=>e.jsx("div",{className:"h-14 rounded-lg bg-muted animate-pulse"},t))}):ee.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Aucune question pour cet \xE9pisode. Soyez le premier !"}):e.jsx("div",{className:"space-y-3",children:ee.map(t=>{var h,y;const s=((h=t.profiles)==null?void 0:h.name)??"Membre",d=Re((y=t.profiles)==null?void 0:y.avatar_url,t.user_id),c=p||t.user_id===(a==null?void 0:a.id),l=ft(t.id),o=Ge===t.id;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex gap-3 rounded-lg border border-border bg-card p-3",children:[e.jsxs(Ie,{className:"h-7 w-7 shrink-0",children:[e.jsx(Te,{src:d,alt:""}),e.jsx(Pe,{className:"text-[10px]",children:Ae(s)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-foreground",children:s}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:De(t.created_at)})]}),e.jsx("p",{className:"mt-0.5 text-xs text-foreground",children:t.content}),e.jsxs("button",{onClick:()=>{ue(o?null:t.id),U("")},className:"mt-1.5 text-[11px] text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:[e.jsx(Qt,{className:"h-3 w-3"})," R\xE9pondre"]})]}),c&&e.jsx("button",{onClick:()=>Ee(t.id),className:"shrink-0 text-muted-foreground hover:text-destructive transition-colors","aria-label":"Supprimer",children:e.jsx(Oe,{className:"h-3.5 w-3.5"})})]}),(l.length>0||o)&&e.jsxs("div",{className:"ml-8 space-y-2",children:[l.map(x=>{var Ce,ze;const F=((Ce=x.profiles)==null?void 0:Ce.name)??"Membre",O=Re((ze=x.profiles)==null?void 0:ze.avatar_url,x.user_id),pt=p||x.user_id===(a==null?void 0:a.id);return e.jsxs("div",{className:"flex gap-2.5 rounded-lg border border-border bg-card p-2.5",children:[e.jsxs(Ie,{className:"h-6 w-6 shrink-0",children:[e.jsx(Te,{src:O,alt:""}),e.jsx(Pe,{className:"text-[10px]",children:Ae(F)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-foreground",children:F}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:De(x.created_at)})]}),e.jsx("p",{className:"mt-0.5 text-xs text-foreground",children:x.content})]}),pt&&e.jsx("button",{onClick:()=>Ee(x.id),className:"shrink-0 text-muted-foreground hover:text-destructive transition-colors","aria-label":"Supprimer",children:e.jsx(Oe,{className:"h-3 w-3"})})]},x.id)}),o&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx("textarea",{value:P,onChange:x=>U(x.target.value),onKeyDown:x=>
2{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),ke(t.id))},placeholder:"Votre r\xE9ponse\u2026",rows:2,autoFocus:!0,className:"flex-1 resize-none rounded-md border border-input bg-background px-3 py-2 text-xs placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),e.jsx(j,{type:"button",size:"icon",disabled:!P.trim()||Je,onClick:()=>ke(t.id),className:"h-auto self-end px-3 py-2",children:e.jsx(Ve,{className:"h-3.5 w-3.5"})})]})]})]},t.id)})}),e.jsxs("form",{onSubmit:t=>{t.preventDefault(),we()},className:"flex gap-2",children:[e.jsx("textarea",{value:T,onChange:t=>le(t.target.value),onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),we())},placeholder:"Posez une question\u2026 (Entr\xE9e pour envoyer)",rows:2,className:"flex-1 resize-none rounded-md border border-input bg-background px-3 py-2 text-xs placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),e.jsx(j,{type:"submit",size:"icon",disabled:!T.trim()||Ke,className:"h-auto self-end px-3 py-2",children:e.jsx(Ve,{className:"h-3.5 w-3.5"})})]})]})]})}export{os 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.