PageSourceSearch

https://ceomindos.com/assets/ChampionRoutineHistory-C5aXk_hu.js

js ceomindos.com collected 2026-10-10 02:35:27 UTC 12,486 bytes, 7 lines download raw bytes

1import{j as e}from"./vendor-ui-BBcGEyn3.js";import{L as P,r as p}from"./vendor-react-ZTecBUnV.js";import{p as Z,q as r,x as V,bg as T,ao as $,w as O,Z as A,z as J,bl as K,aE as W,s as X,B as f,bf as G,ae as B,D as Q,k as U,l as Y,m as ee,a3 as se,C as m,b3 as x,K as te,y as ae,a4 as z}from"./index-KGKWUjdc.js";import{C as ie}from"./chart-line-exhBQJLI.js";import{B as re}from"./beef-EHicmuQ5.js";import{f as h,C as N,D as R,w as ne,y as le,z as ce,A as de}from"./vendor-date-CX9rHtAx.js";import"./vendor-charts-DDMqbH1O.js";import"./vendor-query-Bg4vXuM0.js";import"./vendor-supabase-kHwMmFCK.js";import"./vendor-motion-CmYyPEuW.js";const oe=[{cat:"corp",label:{ro:"Corp",en:"Body"},icon:$,color:"text-green-500"},{cat:"minte",label:{ro:"Minte",en:"Mind"},icon:O,color:"text-purple-500"},{cat:"relatii",label:{ro:"Relații",en:"Relations"},icon:A,color:"text-rose-500"},{cat:"spiritualitate",label:{ro:"Spiritualitate",en:"Spirit"},icon:J,color:"text-yellow-500"},{cat:"business",label:{ro:"Business",en:"Business"},icon:K,color:"text-blue-500"}],me=()=>{const{language:d}=Z();return e.jsx(r,{children:e.jsxs(V,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(ie,{className:"h-4 w-4 text-primary"}),e.jsx("h3",{className:"font-semibold",children:d==="ro"?"Progres & Istoric pe categorii":"Progress & History by category"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2",children:oe.map(({cat:i,label:g,icon:o,color:u})=>e.jsxs(P,{to:`/progres?cat=${i}`,className:"group flex items-center justify-between rounded-lg border bg-card/60 p-3 hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(o,{className:`h-4 w-4 shrink-0 ${u}`}),e.jsx("span",{className:"text-sm font-medium truncate",children:g[d==="ro"?"ro":"en"]})]}),e.jsx(T,{className:"h-4 w-4 text-muted-foreground group-hover:text-foreground"})]},i))})]})})};function _e(){var _,w,M,C,S,D;const{user:d}=W(),[i,g]=p.useState(new Date),[o,u]=p.useState([]),[a,y]=p.useState(null),[xe,v]=p.useState(!0);p.useEffect(()=>{d&&E()},[d,i]);const E=async()=>{if(!d)return;v(!0);const s=h(N(i),"yyyy-MM-dd"),t=h(R(i),"yyyy-MM-dd"),{data:l,error:n}=await X.from("champion_routine_logs").select("*").eq("user_id",d.id).gte("date",s).lte("date",t).order("date",{ascending:!0});!n&&l&&u(l.map(c=>({...c,gratitude_items:c.gratitude_items||[],priorities:c.priorities||[],relationship_actions:c.relationship_actions||[],meals_logged:c.meals_logged||[],daily_todos:c.daily_todos||[]}))),v(!1)},H=s=>{const t=h(s,"yyyy-MM-dd");return o.find(l=>l.date===t)},j=s=>{var n,c,k,L;let t=0,l=10;return((n=s.gratitude_items)==null?void 0:n.length)>=3&&t++,s.water_drunk&&t++,s.meditation_duration_seconds>=600&&t++,s.autosuggestion_completed&&t++,s.exercise_completed&&t++,((c=s.meals_logged)==null?void 0:c.length)>0&&t++,(s.content_script||s.content_topic)&&t++,s.pomodoro_sessions>0&&t++,(s.big_one_today||((k=s.daily_todos)==null?void 0:k.length)>0)&&t++,(L=s.relationship_actions)!=null&&L.some(F=>F.completed)&&t++,Math.round(t/l*100)},I=ne({start:N(i),end:R(i)}),b=N(i).getDay(),q=Array(b===0?6:b-1).fill(null);return e.jsxs("div",{className:"min-h-screen bg-background p-4 md:p-8",children:[e.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Istoric Rutină de Campion"}),e.jsx("p",{className:"text-muted-foreground",children:"Vizualizează progresul tău în timp"})]}),e.jsx(f,{variant:"outline",onClick:()=>window.history.back(),children:"Înapoi"})]}),e.jsx(me,{}),e.jsx(r,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(f,{variant:"ghost",size:"icon",onClick:()=>g(le(i,1)),children:e.jsx(G,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-5 w-5 text-primary"}),e.jsx("span",{className:"text-xl font-semibold capitalize",children:h(i,"MMMM yyyy",{locale:z})})]}),e.jsx(f,{variant:"ghost",size:"icon",onClick:()=>
1g(ce(i,1)),children:e.jsx(T,{className:"h-5 w-5"})})]})}),e.jsxs(r,{className:"p-4 md:p-6",children:[e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:["Lun","Mar","Mie","Joi","Vin","Sâm","Dum"].map(s=>e.jsx("div",{className:"text-center text-sm font-medium text-muted-foreground py-2",children:s},s))}),e.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[q.map((s,t)=>e.jsx("div",{className:"aspect-square"},`empty-${t}`)),I.map(s=>{const t=H(s),l=de(s,new Date),n=t?j(t):0;return e.jsxs("button",{onClick:()=>t&&y(t),disabled:!t,className:`
2                    aspect-square rounded-lg p-1 flex flex-col items-center justify-center gap-1
3                    transition-all relative
4                    ${l?"ring-2 ring-primary":""}
5                    ${t?"cursor-pointer hover:scale-105":"opacity-50"}
6                    ${n>=80?"bg-green-500/20":n>=50?"bg-yellow-500/20":n>0?"bg-orange-500/20":"bg-muted/30"}
7                  `,children:[e.jsx("span",{className:`text-sm font-medium ${l?"text-primary":""}`,children:h(s,"d")}),t&&e.jsxs("span",{className:`text-xs font-bold ${n>=80?"text-green-500":n>=50?"text-yellow-500":"text-orange-500"}`,children:[n,"%"]})]},s.toISOString())})]})]}),e.jsx(r,{className:"p-4",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-4 justify-center text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-green-500/20"}),e.jsx("span",{children:"80-100%"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-yellow-500/20"}),e.jsx("span",{children:"50-79%"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-orange-500/20"}),e.jsx("span",{children:"1-49%"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-muted/30"}),e.jsx("span",{children:"Fără date"})]})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsxs(r,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-primary",children:o.length}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Zile Active"})]}),e.jsxs(r,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-green-500",children:o.filter(s=>j(s)>=80).length}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Zile Complete"})]}),e.jsxs(r,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-orange-500",children:o.reduce((s,t)=>s+(t.total_calories||0),0).toLocaleString()}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Calorii"})]}),e.jsxs(r,{className:"p-4 text-center",children:[e.jsxs("div",{className:"text-3xl font-bold text-red-500",children:[o.reduce((s,t)=>s+(t.total_protein||0),0).toLocaleString(),"g"]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Proteine"})]})]})]}),e.jsx(Q,{open:!!a,onOpenChange:()=>y(null),children:e.jsxs(U,{className:"max-w-2xl max-h-[90vh]",children:[e.jsx(Y,{children:e.jsxs(ee,{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-5 w-5"}),a&&h(new Date(a.date),"d MMMM yyyy",{locale:z})]})}),e.jsx(se,{className:"max-h-[70vh] pr-4",children:a&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center p-4 rounded-lg bg-muted/30",children:[e.jsxs("div",{className:"text-4xl font-bold text-primary",children:[j(a),"%"]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Scor Completare"})]}),e.jsxs(r,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[e.jsx(O,{className:"h-4 w-4 text-purple-500"}),"Being (Mindset)"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[((_=a.gratitude_items)==null?void 0:_.length)>=3?e.jsx(m,{className:"h-4 w-4 text-green-500"}):e.jsx(x,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("span",{children:["Recunoștință (",((w=a.gratitude_items)==null?void 0:w.length)||0,"/3)"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a.water_drunk?e.jsx(m,{className:"h-4 w-4 text-green-500"}):e.jsx(x,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Hidratare"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a.meditation_duration_seconds>=600?e.jsx(m,{className:"h-4 w-4 text-green-500"}):e.jsx(x,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("span",{children:["Meditație (",Math.floor(a.meditation_duration_seconds/60)," min)"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a.autosuggestion_completed?e.jsx(m,{className:"h-4 w-4 text-green-500"}):e.jsx(x,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Autosugestie"})]})]}),((M=a.gratitude_items)==null?void 0:M.length)>0&&e.jsxs("div",{className:"mt-2 pl-4 border-l-2 border-purple-500/30",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Recunoștință:"}),a.gratitude_items.map((s,t)=>e.jsxs("p",{className:"text-sm",children:["• ",s]},t))]})]}),e.jsxs(r,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[e.jsx($,{className:"h-4 w-4 text-green-500"}),"Body (Fizic)"]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.exercise_completed?e.jsx(m,{className:"h-4 w-4 text-green-500"}):e.jsx(x,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:"Exerciții"})]}),((C=a.meals_logged)==null?void 0:C.length)>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Mese înregistrate:"}),a.meals_logged.map((s,t)=>e.jsxs("div",{className:"text-sm flex justify-between",children:[e.jsx("span",{children:s.description}),e.jsxs("span",{className:"text-muted-foreground",children:[s.calories," kcal / ",s.protein,"g"]})]},t))]}),e.jsxs("div",{className:"flex gap-4 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(te,{className:"h-4 w-4 text-orange-500"}),e.jsxs("span",{children:[a.total_calories," kcal"]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"h-4 w-4 text-red-500"}),e.jsxs("span",{children:[a.total_protein,"g proteine"]})]})]})]}),e.jsxs(r,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[e.jsx(ae,{className:"h-4 w-4 text-blue-500"}),"Business (Execution)"]}),a.content_topic&&e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"text-muted-foreground",children:"Topic conținut:"}),e.jsx("p",{children:a.content_topic})]}),e.jsx("div",{className:"flex items-center gap-2 text-sm",children:e.jsxs("span",{children:["Sesiuni Pomodoro: ",a.pomodoro_sessions]})}),a.big_one_today&&e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"text-muted-foreground",children:"Big One Today:"}),e.jsx("p",{className:"font-medium",children:a.big_one_today})]}),((S=a.daily_todos)==null?void 0:S.length)>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Daily To-Dos:"}),a.daily_todos.map((s,t)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.completed?e.jsx(m,{className:"h-3 w-3 text-green-500"}):e.jsx(x,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:s.completed?"line-through text-muted-foreground":"",children:s.text})]},t))]})]}),e.jsxs(r,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[e.jsx(A,{className:"h-4 w-4 text-pink-500"}),"Balance (Relații)"]}),((D=a.relationship_actions)==null?void 0:D.length)>
70?e.jsx("div",{className:"space-y-1",children:a.relationship_actions.map((s,t)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.completed?e.jsx(m,{className:"h-3 w-3 text-green-500"}):e.jsx(x,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{children:s.action})]},t))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Nicio acțiune înregistrată"})]})]})})]})})]})}export{_e 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.