PageSourceSearch

https://liseo.be/assets/AtelierBrowser-DnbiW4dk.js

js liseo.be collected 2026-10-04 14:52:49 UTC 8,354 bytes, 1 lines download raw bytes

1import{F as e,H as t,K as n,Kt as r,L as i,N as a,P as o,Q as s,R as c,W as l,Wt as u,Y as d,ct as f}from"./Sections-V-V1vN4h.js";import{_ as p,d as m,f as h,g,h as _,l as v,u as y,v as b}from"./index-C5Logn8E.js";var x=r(u(),1),S=f(),C=[{key:`type`,label:`Type`,options:Object.keys(o).map(e=>({value:e,label:o[e]}))},{key:`theme`,label:`Thème`,options:Object.keys(t).map(e=>({value:e,label:t[e]}))},{key:`access`,label:`Accès`,options:[{value:`gratuit`,label:`Gratuit`},{value:`payant`,label:`Payant`}]},{key:`format`,label:`Format`,options:Object.entries(i).map(([e,t])=>({value:e,label:t}))},{key:`level`,label:`Niveau`,options:Object.entries(c).map(([e,t])=>({value:e,label:t}))}];function w({pool:t=d(),showTabs:r=!0,showSearch:i=!0}){let[o,c]=(0,x.useState)(``),[u,f]=(0,x.useState)(e),[w,T]=(0,x.useState)(`grid`),[E,D]=(0,x.useState)(null),[O,k]=(0,x.useState)(!1),[A,j]=(0,x.useState)(!1),M=(0,x.useRef)(0),N=(0,x.useMemo)(()=>E?l(``,u,t).filter(e=>E.slugs.includes(e.slug)).sort((e,t)=>E.slugs.indexOf(e.slug)-E.slugs.indexOf(t.slug)):l(o,u,t),[o,u,t,E]),P=async n=>{if(n.trim().length<2)return;let r=++M.current;c(n),k(!0),D(null);try{let e=await fetch(`/api/launcher/search/`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:n})});if(!e.ok)throw Error(`search unavailable`);let t=await e.json();r===M.current&&D(t)}catch{r===M.current&&D({slugs:l(n,e,t).map(e=>e.slug),mode:`keywords`,message:`La recherche IA est momentanément indisponible. Voici les résultats par mots-clés.`})}finally{r===M.current&&k(!1)}},F=(e,t)=>f(n=>({...n,[e]:n[e]===t?`all`:t})),I=()=>{M.current++,k(!1),f(e),c(``),D(null)},L=Object.values(u).filter(e=>e!==`all`).length,R=i?t.find(e=>e.featuredRank&&e.featuredRank>0):void 0,z=!E&&!o.trim()&&L===0,B=(0,x.useMemo)(()=>{let e=z&&R?N.filter(e=>e.id!==R.id):N;return z?n(e):e},[z,N,R]),V=(0,S.jsxs)(`div`,{className:`grid gap-5`,children:[C.map(e=>(0,S.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[7rem_minmax(0,1fr)] sm:items-start`,children:[(0,S.jsx)(`p`,{className:`text-xs tracking-[0.16em] text-muted-foreground uppercase`,children:e.label}),(0,S.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:e.options.map(t=>{let n=u[e.key]===t.value;return(0,S.jsx)(`li`,{children:(0,S.jsx)(`button`,{type:`button`,onClick:()=>F(e.key,t.value),"aria-pressed":n,className:`min-h-11 rounded-full border px-4 text-xs transition-colors sm:min-h-0 sm:py-1.5 ${n?`border-accent bg-accent/15 text-foreground`:`border-border text-muted-foreground hover:text-foreground`}`,children:t.label})},t.value)})})]},e.key)),(0,S.jsx)(`button`,{type:`button`,onClick:I,className:`justify-self-start text-xs text-muted-foreground underline underline-offset-4 hover:text-foreground`,children:`Réinitialiser les filtres`})]});return(0,S.jsxs)(`div`,{children:[R&&z&&(0,S.jsxs)(`section`,{"aria-labelledby":`atelier-spotlight`,className:`mb-8`,children:[(0,S.jsx)(`p`,{className:`mb-3 text-[11px] font-semibold tracking-[0.22em] text-accent uppercase`,children:`À la une dans l’Atelier`}),(0,S.jsx)(`h2`,{id:`atelier-spotlight`,className:`sr-only`,children:`Réalisation mise en avant`}),(0,S.jsx)(m,{item:R})]}),i&&(0,S.jsxs)(`div`,{className:`glass-card rounded-3xl p-5 sm:p-7`,children:[(0,S.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),P(o)},className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,S.jsx)(`label`,{className:`sr-only`,htmlFor:`atelier-search`,children:`Rechercher dans l'Atelier LISEO`}),(0,S.jsx)(`input`,{id:`atelier-search`,value:o,maxLength:300,onChange:e=>{M.current++,c(e.target.value),D(null),k(!1)},placeholder:`Que cherchez-vous à résoudre, explorer ou utiliser ?`,className:`w-full rounded-2xl border border-border bg-background/60 px-5 py-4 text-base outline-none placeholder:text-muted-foreground focus:border-accent`}),(0,S.jsx)(`button`,{type:`submit`,className:`rounded-2xl border border-primary/50 bg-primary/20 px-6 py-4 text-sm font-medium transition-colors hover:bg-primary/35`,children:O?`Recherche…`:`Explorer avec l’IA`})]}),(0,S.jsxs)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:[`Recherche dans le catalogue LISEO uniquement. La requête envoyée peut être traitée par un service IA : n’y incluez pas de données sensibles. `,(0,S.jsx)(`a`,{href:`/politique-de-confidentialite`,className:`underline`,children:`Confidentialité`})]}),(0,S.jsx)(`ul`,{className:`mt-4 flex flex-wrap gap-2`,children:a.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsx)(`button`,{type:`button`,onClick:()=>P(e),className:`min-h-10 rounded-full border border-border px-3.5 text-xs text-muted-foreground transition-colors hover:border-accent hover:text-foreground`,children:e})},e))}),O&&(0,S.jsxs)(`p`,{className:`mt-5 flex items-center gap-3 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,S.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-accent`,"aria-hidden":!0}),`Analyse de votre demande…`]}),E&&!O&&(0,S.jsxs)(`div`,{className:`rise-in mt-5 rounded-2xl border border-accent/40 bg-surface-2 p-5`,"aria-live":`polite`,children:[(0,S.jsx)(`p`,{className:`text-base text-foreground`,children:E.message}),(0,S.jsxs)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:[N.length,` résultat(s) avec vos filtres actifs · `,E.mode===`ai`?`Sélection assistée par IA`:`Recherche par mots-clés`]}),N.length>0&&(0,S.jsx)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:N.slice(0,4).map(e=>(0,S.jsx)(y,{item:e},e.id))})]})]}),r&&(0,S.jsx)(`nav`,{className:`mt-10 flex flex-wrap gap-2`,"aria-label":`Sections de l'Atelier`,children:s().map(e=>(0,S.jsx)(`a`,{href:e.href,className:`min-h-11 rounded-full border border-border px-4 py-2.5 text-sm text-muted-foreground transition-colors hover:border-accent hover:text-foreground`,children:e.label},e.id))}),(0,S.jsxs)(`div`,{className:`mt-8 flex flex-wrap items-center justify-between gap-3`,children:[(0,S.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[N.length,` élément`,N.length>1?`s`:``]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>j(!0),className:`min-h-11 rounded-full border border-border px-4 text-xs text-muted-foreground lg:hidden`,children:[`Filtres`,L?` (${L})`:``]}),(0,S.jsx)(`div`,{className:`flex items-center gap-2`,role:`group`,"aria-label":`Affichage`,children:[`grid`,`list`].map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>T(e),"aria-pressed":w===e,className:`min-h-11 rounded-full border px-4 text-xs transition-colors ${w===e?`border-accent text-foreground`:`border-border text-muted-foreground`}`,children:e===`grid`?`Grille`:`Liste`},e))})]})]}),(0,S.jsx)(`div`,{className:`mt-4 hidden rounded-3xl border border-border bg-surface p-6 lg:block`,children:V}),(0,S.jsx)(_,{open:A,onOpenChange:j,children:(0,S.jsxs)(g,{className:`max-h-[85dvh] overflow-y-auto bg-surface p-5 pb-8`,children:[(0,S.jsx)(b,{children:`Filtrer l’Atelier`}),(0,S.jsx)(p,{children:`Combinez les critères pour trouver le contenu adapté.`}),V,(0,S.jsxs)(`button`,{type:`button`,onClick:()=>j(!1),className:`mt-6 w-full rounded-full border border-primary/50 bg-primary/25 px-6 py-4 text-sm`,children:[`Voir `,N.length,` résultat`,N.length>1?`s`:``]})]})}),N.length===0?(0,S.jsxs)(`div`,{className:`mt-8 rounded-3xl border border-dashed border-border bg-surface p-10 text-center`,children:[(0,S.jsx)(`p`,{className:`text-lg`,children:`Rien ne correspond encore à cette c
1ombinaison.`}),(0,S.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Élargissez les filtres, ou décrivez votre besoin : la bonne ressource peut aussi être construite.`}),(0,S.jsxs)(`div`,{className:`mt-6 flex flex-col justify-center gap-3 sm:flex-row`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:I,className:`min-h-12 rounded-full border border-border px-5 text-sm hover:border-accent`,children:`Réinitialiser`}),(0,S.jsx)(`a`,{href:`/contact`,className:`min-h-12 rounded-full border border-primary/50 bg-primary/20 px-5 py-3.5 text-sm hover:bg-primary/35`,children:`Demander cette ressource`})]})]}):w===`grid`?(0,S.jsx)(`div`,{className:`mt-6 grid gap-5 sm:grid-cols-2 lg:grid-cols-3`,children:B.map(e=>(0,S.jsx)(v,{item:e},e.id))}):(0,S.jsx)(`div`,{className:`mt-6 grid gap-3`,children:B.map(e=>(0,S.jsx)(h,{item:e},e.id))})]})}export{w as t};

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.