PageSourceSearch

https://capitaineaventure.fr/assets/MonUnivers-DLo9x8ox.js

js capitaineaventure.fr collected 2026-09-24 14:22:16 UTC 26,660 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-query-CnVJgDtS.js";import{r as d,u as ke}from"./vendor-react-B9UTwVUJ.js";import{L as se}from"./Layout-BZTG21Wl.js";import{S as re}from"./SEO-DcvjisX6.js";import{C as f,d as b}from"./card-CU6MTvUa.js";import{P as _e}from"./progress-B-TX3zXw.js";import{toast as S}from"./index-CqtmjIGR.js";import{j as Me,g as Se,b as Ce,f as De,i as Ge}from"./yuki-C8SucqDK.js";import{s as x,B as Ee}from"./index-Cx49XYBu.js";import{L as me}from"./lock-C6qimmfF.js";import{a as qe}from"./utils-CS3tZPw8.js";import{u as Ae}from"./useProfileManager-Iiiak9U-.js";import{f as Le}from"./garden-B-FUBqGm.js";import{d as Ie}from"./rewards-Bq94og4B.js";import{f as Pe}from"./adventure-CD1Z2ZIa.js";import{u as Ue,G as $e}from"./GameModalsRenderer-HmvXnsvL.js";import{C as ze,a as Re}from"./ChallengePopup-DyUrAWK5.js";import{f as Be,a as Te}from"./fr-FC4MUEWM.js";import"./use-toast-tfTEdvO_.js";import"./sheet-DhRWtD2W.js";import"./vendor-ui-KzfIh-gD.js";import"./dialog-BzZESAe8.js";import"./createLucideIcon-DcuJWPyU.js";import"./separator-BhN3qP2C.js";import"./engagementMilestones-Ox9hKC8e.js";import"./crown-Ulhw-YL6.js";import"./settings-k-fEU8RX.js";import"./vendor-supabase-C6GHtIgE.js";import"./HangmanGame-DoL5x5uI.js";import"./WasteSortingGame-DOknk9bF.js";import"./nativeHapticBridge-S4jWxo5q.js";import"./sparkles-Cy9dIcCr.js";import"./trophy-DhW1Dn2L.js";import"./rotate-ccw-CXB76rZi.js";import"./map-BRlKdpu7.js";import"./CompassGame-eX6QWq_L.js";import"./compass-DusABFan.js";import"./check-DR_4ma0J.js";import"./eye-off-CkhzDiTm.js";import"./eye-RyZK6Udq.js";import"./input-DzgpH4lB.js";import"./lightbulb-DceSKUbG.js";import"./volume-2-C2seD3g2.js";const y=[{type:"worddefs",emoji:"📘",name:"Défi Dico"},{type:"memory",emoji:"🧠",name:"Memory"},{type:"wordsearch",emoji:"🔤",name:"Mots Mêlés"},{type:"hangman",emoji:"✨",name:"Mot Magique"},{type:"wordscramble",emoji:"🔀",name:"Mots Mélangés"},{type:"puzzle",emoji:"🧩",name:"Puzzle"},{type:"compass",emoji:"🧭",name:"Boussole Magique"},{type:"riddle",emoji:"❓",name:"Devinettes"},{type:"animalsounds",emoji:"🐾",name:"Sons d'animaux"},{type:"truefalse",emoji:"✅",name:"Vrai ou Faux"},{type:"wastesorting",emoji:"♻️",name:"Tri des déchets"}],le=3;function We(o){return Math.min(y.length,Math.floor(Math.max(0,o)/2))}async function Ye(o){const{data:r,error:i}=await x.from("child_minigame_unlocks").select("game_type").eq("child_profile_id",o);if(i)throw i;return(r||[]).map(a=>a.game_type).filter(a=>y.some(m=>m.type===a))}async function Fe(o,r){const{error:i}=await x.from("child_minigame_unlocks").insert({child_profile_id:o,game_type:r});if(i)throw i}async function Oe(o){const r=new Date,i=new Date(r);i.setHours(0,0,0,0);const a=new Date(i);a.setDate(a.getDate()+1);const{data:m,error:C}=await x.from("child_minigame_plays").select("game_type").eq("child_profile_id",o).gte("played_at",i.toISOString()).lt("played_at",a.toISOString());if(C)throw C;const D=Object.fromEntries(y.map(h=>[h.type,0]));for(const h of m||[])if(y.some(G=>G.type===h.game_type)){const G=h.game_type;D[G]+=1}return D}async function de(o,r){const{error:i}=await x.from("child_minigame_plays").insert({child_profile_id:o,game_type:r});if(i)throw i}async function Ve(){const{data:o,error:r}=await x.from("page_content").select("content").eq("section_id","disabled_games").maybeSingle();if(r)throw r;if(!o?.content)return[];try{const i=JSON.parse(o.content);if(!Array.isArray(i))return[];const a=new Set(y.map(m=>m.type));return i.filter(m=>typeof m=="string"&&a.has(m))}catch{return[]}}const ce={memory:"from-pink-500/20 to-rose-500/10 border-pink-400/40",wordsearch:"from-sky-500/20 to-cyan-500/10 border-sky-400/40",hangman:"from-violet-500/20 to-sky-500/10 border-violet-400/40",wordscramble:"from-violet-500/20 to-fuchsia-500/10 border-violet-400/40",puzzle:"from-amber-500/20 to-orange-500/10 border-amber-400/40",compass:"from-cyan-500/20 to-blue-500/10 border-cyan-400/40",worddefs:"from-blue-500/20 to-indigo-500/10 border-blue-400/40",riddle:"from-emerald-500/20 to-teal-500/10 border-emerald-400/40",animalsounds:"from-lime-500/20 to-green-500/10 border-lime-400/40",truefalse:"from-indigo-500/20 to-blue-500/10 border-indigo-400/40",wastesorting:"from-yellow-500/20 to-lime-500/10 border-yellow-500/40"},oe="worddefs",He="https://iwgcbgtzfpzeqvgjjlyw.supabase.co/storage/v1/object/public/images-generales/plaine.webp",ue=d.memo(({storiesRead:o,activeProfileId:r,onPlayGame:i,onOpenYuki:a,yukiSleeping:m=!1,yukiLevel:C=1,onOpenGarden:D,gardenCount:h=0,hasNewGarden:G=!1,gardenDayMoment:F="Matin"})=>{const[N,p]=d.useState(new Set),[q,O]=d.useState(new Set),[P,w]=d.use
1State(Object.fromEntries(y.map(s=>[s.type,0]))),[V,v]=d.useState(!0),[U,k]=d.useState(null),g=d.useMemo(()=>y.filter(s=>!q.has(s.type)),[q]),_=d.useMemo(()=>g.filter(s=>s.type!==oe),[g]),$=d.useMemo(()=>Math.min(_.length,We(o)),[o,_.length]),E=d.useMemo(()=>_.filter(s=>N.has(s.type)).length,[_,N]),z=Math.max(0,$-E),M=z>0,R=(Math.floor(o/2)+1)*2,B=Math.max(0,R-o),H=Math.min(100,o%2/2*100),J=Me(Se());d.useEffect(()=>{(async()=>{if(!r){p(new Set),v(!1);return}try{v(!0);const[t,n,c]=await Promise.all([Ye(r),Oe(r),Ve()]);p(new Set(t)),w(n),O(new Set(c))}catch{S.error("Impossible de charger les mini-jeux pour le moment.")}finally{v(!1)}})()},[r]);const K=async s=>{if(!r||U||q.has(s))return;if(s===oe){try{k(s),await de(r,s),w(c=>({...c,[s]:(c[s]||0)+1})),i(s)}catch{S.error("Impossible de lancer ce mini-jeu maintenant.")}finally{k(null)}return}if(N.has(s)){if((P[s]||0)>=le){S.info("Limite atteinte: 3 parties maximum par jour pour ce mini-jeu.");return}try{k(s),await de(r,s),w(u=>({...u,[s]:(u[s]||0)+1})),i(s)}catch{S.error("Impossible de lancer ce mini-jeu maintenant.")}finally{k(null)}return}if(M)try{k(s),await Fe(r,s),p(c=>{const u=new Set(c);return u.add(s),u}),S.success("Mini-jeu débloqué !")}catch{S.error("Impossible de débloquer ce mini-jeu maintenant.")}finally{k(null)}};return e.jsx(f,{className:"bg-gradient-to-r from-indigo-500/10 to-purple-500/10 border border-indigo-500/20",children:e.jsxs(b,{className:"p-5",children:[M&&e.jsx("div",{className:"mb-3 rounded-lg border border-primary/30 bg-primary/10 px-3 py-2",children:e.jsx("p",{className:"text-sm font-medium text-primary",children:"Tu peux débloquer un nouveau mini-jeu !"})}),V?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Chargement des mini-jeux..."}):e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[e.jsxs("button",{type:"button",onClick:()=>a?.(),className:"group relative aspect-square overflow-hidden rounded-2xl border border-fuchsia-400/40 bg-fuchsia-50 text-center shadow-sm transition-all hover:-translate-y-0.5 hover:shadow-md",children:[e.jsx("img",{src:J,alt:"","aria-hidden":"true",className:"absolute inset-0 h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background via-background/15 to-fuchsia-200/10"}),e.jsx("img",{src:Ce(),alt:"Yuki dans son univers magique",className:"absolute left-1/2 top-[47%] h-[54%] w-[62%] -translate-x-1/2 -translate-y-1/2 object-contain drop-shadow-lg transition-transform duration-300 group-hover:scale-105",loading:"lazy"}),e.jsx("div",{className:"absolute left-0 top-0 rounded-br-md bg-fuchsia-600/90 px-1.5 py-0.5 text-[10px] font-semibold text-white",children:"Compagnon"}),e.jsx("div",{className:"absolute right-0 top-0 rounded-bl-md border-l border-b border-fuchsia-300 bg-fuchsia-100 px-2 py-0.5 text-[10px] font-semibold leading-tight text-fuchsia-900",children:m?"Dodo":`Niv. ${C}`}),e.jsxs("div",{className:"relative z-10 flex h-full flex-col items-center justify-end gap-0.5 px-2 pb-2",children:[e.jsx("span",{className:"text-sm font-semibold leading-tight text-foreground",children:"Mon Compagnon Yuki"}),m?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Yuki fait dodo !"}),e.jsx("span",{className:"text-[10px] font-medium text-fuchsia-700",children:"Entrer doucement ✨"})]}):e.jsx("span",{className:"text-[10px] font-medium text-fuchsia-700",children:"Ouvrir sa porte magique ✨"})]})]}),e.jsxs("button",{type:"button",onClick:()=>D?.(),className:"group relative aspect-square overflow-hidden rounded-2xl border border-emerald-400/40 bg-emerald-50 text-center shadow-sm transition-all hover:-translate-y-0.5 hover:shadow-md",children:[e.jsx("img",{src:He,alt:"","aria-hidden":"true",className:"absolute inset-0 h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background via-background/10 to-emerald-200/5"}),e.jsxs("div",{className:"absolute inset-x-0 top-[30%] flex items-end justify-center gap-1 text-3xl drop-shadow-md transition-transform duration-300 group-hover:scale-105","aria-hidden":"true",children:[e.jsx("span",{className:"-rotate-6",children:"🌷"}),e.jsx("span",{className:"text-4xl",children:"🌳"}),e.jsx("span",{className:"rotate-6",children:"🌻"})]}),e.jsx("div",{className:"absolute left-0 top-0 rounded-br-md bg-emerald-600/90 px-1.5 py-0.5 text-[10px] font-semibold text-white",children:"Jardin"}),e.jsx("div",{className:"absolute right-0 top-0 rounded-bl-md border-l border-b border-emerald-300 bg-emerald-100 px-2 py-0.5 text-[10px] font-semibold leading-tight text-emerald-800",children:F}),e.jsxs("div",{className:"relative z-10 flex h-full flex-col items-center justify-end gap-0.5 px-2 pb-2",children:[e.jsx("span",{className:"text-sm font-semibold leading-tight text-foreground",children:"Mon Jardin"}),e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[h," plantation",h>1?"s":""," à faire"]}),e.jsx("span",{className:"text-[10px] font-medium text-emerald-700",children:"Pousser la porte du jardin ✨"})]})]}),g.map(s=>{const t=s.type===oe,n=t||N.has(s.type),c=!n&&M,u=!n&&!c,Q=P[s.type]||0,T=Math.max(0,le-Q),W=n&&T===0,X=U===s.t
1ype;return e.jsxs("button",{type:"button",onClick:()=>K(s.type),disabled:u||X,className:`group relative aspect-square overflow-hidden rounded-2xl border px-2.5 pb-2 pt-6 text-center transition-all ${n?`bg-gradient-to-br ${ce[s.type]} hover:shadow-md hover:-translate-y-0.5`:c?`bg-gradient-to-br ${ce[s.type]} grayscale hover:border-primary/70 hover:shadow-sm`:"bg-muted/60 border-border grayscale opacity-70 cursor-not-allowed"}`,children:[c&&e.jsx("div",{className:"absolute left-0 top-0 rounded-br-md bg-primary/90 px-1.5 py-0.5 text-[10px] font-semibold text-primary-foreground",children:"Nouveau"}),n&&!t&&e.jsx("div",{className:`absolute right-0 top-0 rounded-bl-md px-2 py-0.5 text-[10px] font-semibold leading-tight ${W?"bg-amber-200 text-amber-900 border-l border-b border-amber-300":"bg-muted text-muted-foreground border-l border-b border-border"}`,children:W?"Dispo demain":`x${T}`}),e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-1 px-1",children:[e.jsx("span",{className:"text-3xl transition-transform duration-200 group-hover:scale-110",children:s.emoji}),e.jsx("span",{className:"text-sm font-semibold leading-tight text-foreground",children:s.name}),s.type==="worddefs"&&e.jsx("span",{className:"text-[10px] leading-tight text-muted-foreground text-center",children:"Trouve les définitions des mots rencontrés lors des aventures !"})]}),!n&&e.jsx("div",{className:"absolute bottom-2 right-2 rounded-full border border-border bg-background/95 p-1 shadow-sm",children:e.jsx(me,{className:"h-3.5 w-3.5 text-foreground"})})]},s.type)})]}),!M&&z===0&&E<g.length&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Lis encore ",e.jsxs("span",{className:"font-semibold text-foreground",children:[B," histoire",B>1?"s":""]})," pour débloquer un nouveau mini-jeu."]}),e.jsx(_e,{value:H,className:"h-2"})]}),E===g.length&&g.length>0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"🎉 Bravo ! Tous les mini-jeux sont débloqués."}),g.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Aucun mini-jeu disponible pour le moment."})]})})});ue.displayName="MiniGamesUnlocked";const Bt=()=>{const o=ke(),r=qe(),{readerName:i}=Ae(),[a,m]=d.useState({backpackCount:0,gardenCount:0,wordsCount:0,hasNewBackpack:!1,hasNewGarden:!1,hasNewWord:!1}),[C,D]=d.useState(0),[h,G]=d.useState(null),[F,N]=d.useState(!0),[p,q]=d.useState({storiesRead:0,chaptersCompleted:0,engagementMessage:"",readingStreak:0,totalReadingTimeSec:0}),[O,P]=d.useState(!1),[w,V]=d.useState(null),v=Ue();d.useEffect(()=>{(async()=>{if(!r){P(!0),N(!1);return}try{let n=await De(r);n||(n=await Ge(r)),G(n);const{data:c}=await x.rpc("get_child_reading_stats",{p_child_profile_id:r,p_days_back:365}),{data:u}=await x.from("adventure_progress").select("completed_chapters").eq("profile_id",r),Q=u?.reduce((l,L)=>l+(L.completed_chapters?.length||0),0)||0,T=c?.[0]?.stories_completed||0,W=c?.[0]?.total_reading_time_sec||0,{data:X}=await x.rpc("get_engagement_level",{p_child_profile_id:r}),{data:Z}=await x.from("story_sessions").select("created_at").eq("child_profile_id",r).order("created_at",{ascending:!1}).limit(200);let ee=0;if(Z&&Z.length>0){const l=new Date;l.setHours(0,0,0,0);const L=new Set(Z.map(j=>{const I=new Date(j.created_at);return I.setHours(0,0,0,0),I.getTime()})),Y=Array.from(L).sort((j,I)=>I-j),ve=Y[0];if(Math.round((l.getTime()-ve)/864e5)<=1){ee=1;for(let j=1;j<Y.length&&Math.round((Y[j-1]-Y[j])/864e5)===1;j++)ee++}}q({storiesRead:T,chaptersCompleted:Q,engagementMessage:X?.[0]?.message||"Continue à lire pour débloquer des surprises ! ✨",readingStreak:ee,totalReadingTimeSec:W});const pe=await Pe();V(pe[0]?.id||null);const ae=localStorage.getItem(`mon_univers_last_visit_${r}`),ne=ae?new Date(ae):new Date(0),{data:ie}=await x.from("backpack_items").select("obtained_at").eq("user_id",r),xe=ie?.length||0,he=ie?.some(l=>new Date(l.obtained_at||"")>ne)||!1,te=await Le(r),ge=te.length,fe=te.some(l=>new Date(l.created_at)>ne),be=(await Ie(r)).plant,je=te.map(l=>l.item_emoji),A={};be.forEach(l=>{A[l.emoji]=(A[l.emoji]||0)+1}),je.forEach(l=>{A[l]&&A[l]--});const ye=Object.values(A).filter(l=>l>0).reduce((l,L)=>l+L,0);D(ye);const{data:Ne}=await x.rpc("get_encountered_words",{p_profile_id:r}),we=Ne?.length||0;m({backpackCount:xe,gardenCount:ge,wordsCount:we||0,hasNewBackpack:he,hasNewGarden:fe,hasNewWord:!1}),localStorage.setItem(`mon_univers_last_visit_${r}`,new Date().toISOString())}catch{}finally{N(!1)}})()},[r,o]);const U=h?.level||1,g=(()=>{const t=new Date,n=t.getHours(),c=t.getMinutes(),u=n*60+c;return u>=1230||u<420})(),_=Be(new Date,"EEEE d MMMM yyyy",{locale:Te}),$=new Date,E=$.getHours(),z=$.getMinutes(),M=E*60+z,R=M>=1230||M<420?"Nuit":E<12?"Matin":"Apres-midi",B=R==="Nuit",H=[{emoji:"🎒",t
1itle:"Mon Sac à Dos",description:`${a.backpackCount} trésor${a.backpackCount>1?"s":""} collecté${a.backpackCount>1?"s":""}`,path:"/sacados",color:"from-amber-500/10 to-orange-500/10 border-amber-500/20",hasNew:a.hasNewBackpack},{emoji:"✨",title:"Mes Mots Découverts",description:`${a.wordsCount} mot${a.wordsCount>1?"s":""} découvert${a.wordsCount>1?"s":""}`,path:"/mes-mots",color:"from-blue-500/10 to-indigo-500/10 border-blue-500/20",hasNew:a.hasNewWord},{emoji:"🎁",title:"Aventures rien qu'à moi",description:"Tes histoires personnalisées et cadeaux",path:"/mes-aventures",color:"from-yellow-500/10 to-amber-500/10 border-yellow-500/20",hasNew:!1},{emoji:"❤️",title:"Mes Favoris",description:"Les histoires que tu as adorées",path:"/favoris",color:"from-red-500/10 to-rose-500/10 border-red-500/20",hasNew:!1}],J=[{key:"yuki",emoji:"🐱",name:"Mon Compagnon Yuki"},{key:"garden",emoji:"🌱",name:"Mon Jardin"},...y.map(t=>({key:t.type,emoji:t.emoji,name:t.name}))];if(F)return e.jsxs(se,{children:[e.jsx(re,{title:"Mon Univers",description:"Découvre ton univers magique !"}),e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-bounce text-6xl mb-4",children:"🌟"}),e.jsx("p",{className:"text-lg text-muted-foreground",children:"Chargement..."})]})})]});const K=t=>{if(!w){S.error("Mini-jeux indisponibles pour le moment.");return}v.openGame(t)},s=()=>{const t=window.matchMedia("(min-width: 768px) and (hover: hover) and (pointer: fine)").matches,n=typeof window.isFlutterWebView=="function"&&!!window.isFlutterWebView()||typeof window.isFlutterWebView=="boolean"&&window.isFlutterWebView||!!window.FlutterChannel;if(t&&!n){window.dispatchEvent(new CustomEvent("capitaine:open-signup-popin"));return}o("/auth?tab=signup")};return O?e.jsxs(se,{children:[e.jsx(re,{title:"Mon Univers",description:"Découvre ton univers magique !"}),e.jsx("div",{className:"container mx-auto px-4 py-8 max-w-lg",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(f,{className:"rounded-2xl border border-primary/20 bg-gradient-to-r from-primary/10 to-sky-500/10",children:e.jsxs(b,{className:"p-4 text-center",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-1",children:"🌟 Mon Univers"}),e.jsx("p",{className:"text-sm text-foreground/80",children:"Bienvenue dans ton univers !"}),e.jsxs("p",{className:"text-sm text-foreground/70 mt-1",children:["📅 Aujourd'hui, ",_]})]})}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 opacity-40 pointer-events-none",children:[e.jsxs("div",{className:"bg-card/80 border border-border/60 rounded-2xl p-3 text-center",children:[e.jsx("span",{className:"text-2xl block mb-1",children:"📖"}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:"0"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"histoires terminées"})]}),e.jsxs("div",{className:"bg-card/80 border border-border/60 rounded-2xl p-3 text-center",children:[e.jsx("span",{className:"text-2xl block mb-1",children:"🗺️"}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:"0"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"chapitres du Voyage"})]}),e.jsxs("div",{className:"bg-card/80 border border-border/60 rounded-2xl p-3 text-center",children:[e.jsx("span",{className:"text-2xl block mb-1",children:"⏱️"}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:"0 min"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"temps de lecture"})]})]}),e.jsx(f,{className:"rounded-2xl bg-gradient-to-br from-primary/10 to-purple-500/10 border border-primary/20",children:e.jsxs(b,{className:"p-5 text-center",children:[e.jsx("p",{className:"text-base font-medium text-foreground mb-3",children:"Crée un compte gratuit pour accéder à ton univers ✨"}),e.jsx(Ee,{onClick:()=>o("/auth"),className:"bg-primary hover:bg-primary/90",children:"Créer mon compte"})]})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-2",children:"Mes minis jeux"}),e.jsx(f,{className:"rounded-2xl border border-indigo-500/20 bg-gradient-to-r from-indigo-500/10 to-purple-500/10 o
1pacity-70",children:e.jsxs(b,{className:"p-4",children:[e.jsx("div",{className:"grid grid-cols-2 gap-2",children:J.map(t=>e.jsxs("button",{type:"button",onClick:s,className:"relative aspect-square overflow-hidden rounded-2xl border border-border bg-card/80 p-2 text-center grayscale transition-all hover:shadow-sm","aria-label":`Débloquer ${t.name}`,children:[e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-1",children:[e.jsx("span",{className:"text-3xl",children:t.emoji}),e.jsx("span",{className:"text-sm font-semibold leading-tight text-foreground",children:t.name})]}),e.jsx("div",{className:"absolute right-2 top-2 rounded-full border border-border bg-background/95 p-1 shadow-sm",children:e.jsx(me,{className:"h-3.5 w-3.5 text-foreground"})})]},t.key))}),e.jsx("p",{className:"mt-3 text-center text-sm text-muted-foreground",children:"🔒 Crée un compte pour débloquer les mini-jeux"})]})})]}),e.jsxs("div",{className:"space-y-3",children:[[{emoji:"🎒",title:"Mon Sac à Dos",color:"from-amber-500/10 to-orange-500/10 border-amber-500/20"},{emoji:"🌱",title:"Mon Jardin",color:"from-green-500/10 to-emerald-500/10 border-green-500/20"},{emoji:"✨",title:"Mes Mots Découverts",color:"from-blue-500/10 to-indigo-500/10 border-blue-500/20"}].map(t=>e.jsx(f,{className:`rounded-2xl bg-gradient-to-r ${t.color} border opacity-60 pointer-events-none`,children:e.jsxs(b,{className:"flex items-center gap-4 p-5",children:[e.jsx("span",{className:"text-4xl",children:t.emoji}),e.jsxs("div",{className:"flex-1 text-left",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"🔒 Crée un compte pour débloquer"})]}),e.jsx("span",{className:"text-muted-foreground text-xl",children:"🔒"})]})},t.title)),[{emoji:"🎁",title:"Aventures rien qu'à moi",description:"Tes histoires personnalisées et cadeaux",path:"/mes-aventures",color:"from-yellow-500/10 to-amber-500/10 border-yellow-500/20"},{emoji:"❤️",title:"Mes Favoris",description:"Les histoires que tu as adorées",path:"/favoris",color:"from-red-500/10 to-rose-500/10 border-red-500/20"}].map(t=>e.jsx(f,{className:`rounded-2xl bg-gradient-to-r ${t.color} border opacity-60 pointer-events-none`,children:e.jsxs(b,{className:"flex items-center gap-4 p-5",children:[e.jsx("span",{className:"text-4xl",children:t.emoji}),e.jsxs("div",{className:"flex-1 text-left",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"🔒 Crée un compte pour débloquer"})]}),e.jsx("span",{className:"text-muted-foreground text-xl",children:"🔒"})]})},t.path))]})]})})]}):e.jsxs(se,{children:[e.jsx(re,{title:"Mon Univers",description:"Découvre ton univers magique !"}),e.jsxs("div",{className:"relative",children:[B&&e.jsx("div",{className:"pointer-events-none fixed inset-0 z-10 bg-slate-900/20"}),e.jsxs("div",{className:"container relative z-20 mx-auto max-w-lg px-4 py-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(f,{className:"rounded-2xl border border-primary/20 bg-gradient-to-r from-primary/10 to-sky-500/10",children:e.jsxs(b,{className:"p-4 text-center",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-1",children:"🌟 Mon Univers"}),e.jsxs("p",{className:"text-sm text-foreground/80",children:["Bienvenue dans ton univers ",i||""," !"]}),e.jsxs("p",{className:"text-sm text-foreground/70 mt-1",children:["📅 Aujourd'hui, ",_]})]})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-2",children:"Progrès"}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-card/80 border border-border/60 rounded-2xl p-3 text-center",children:[e.jsx("span",{className:"text-2xl block mb-1",children:"📖"}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:p.storiesRead}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"histoires terminées"})]}),e.jsxs("button",{type:"button",onClick:()=>o("/aventure"),className:"bg-card/80 border border-border/60 rounded-2xl p-3 text-center transition-all hover:-translate-y-0.5 hover:shadow-sm",children:[e.jsx("span",{className:"text-2xl block mb-1",children:"🗺️"}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:p.chaptersCompleted}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"chapitres du Voyage"})]}),e.jsxs("div",{className:"bg-card/80 border border-border/60 rounded-2xl p-3 text-center",children:[e.jsx("span",{className:"text-2xl block mb-1",children:"⏱️"}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:p.totalReadingTimeSec>=3600?`${Math.floor(p.totalReadingTimeSec/3600)}h${Math.floor(p.totalReadingTimeSec%3600/60).toString().padStart(2,"0")}`:`${Math.floor(p.totalReadingTimeSec/60)} min`}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"temps de lecture"})]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-2",children:"Mes minis jeux"}),e.jsx(ue,{storiesRead:p.storiesRead,activeProfileId:r,onPlayGame:K,onOpenYuki:()=>o("/yuki"),yukiSleeping:g,yukiLevel:U,onOpenGarden:()=>o("/jardin"),gardenCount:C,hasNewGarden:a.hasNewGarden,gardenDayMoment:R})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-2",children:"Relève le défi !"}),e.jsx(f,{className:"rounded-2xl border border-primary/20 bg-gradient-to-r from-primary/10 to-amber-500/10",children:e.jsxs(b,{className:"p-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choisis un thème, désigne quelqu'un (ou toi-même), puis lance le défi !"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ze.map(t=>{const n=Re[t];return e.jsxs("button",{type:"button",onClick:()=>v.openChallenge(t),className:"rounded-xl border border-border/70 bg-card/80 px-3 py-2 text-left transition-all hover:-translate-y-0.5 hover:shadow-sm",children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground",children:[n.emoji," ",n.label]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Lancer un défi"})]},t)})})]})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-2",children:"Explorer ton univers"}),e.jsx("div",{className:"space-y-3",children:H.map(t=>e.jsx(f,{className:`group cursor-pointer rounded-2xl hover:shadow-md transition-all duration-200 hover:-translate-y-0.5 bg-gradient-to-r ${t.color} border`,onClick:()=>o(t.path),children:e.jsxs(b,{className:"flex items-center gap-4 p-5",children:[e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"text-4xl",children:t.emoji}),t.hasNew&&e.jsx("span",{className:"absolute -top-1 -right-1 w-3 h-3 rounded-full bg-primary animate-pulse shadow-[0_0_8px_hsl(var(--primary)/0.6)]"})]}),e.jsxs("div",{className:"flex-1 text-left",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.description})]}),e.jsx("span",{className:"text-muted-foreground text-xl transition-transform duration-200 group-hover:translate-x-0.5",children:"›"})]})},t.path))})]})]}),w&&e.jsx($e,{modals:v,worldId:w,parkSlug:"",fromMonUnivers:!0})]})]})]})};export{Bt 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.