1import{c as v,u as w,a as y,r as n,s as u,j as e,L as i,S as F}from"./main-Cc8MXM0b.js";import{L as _}from"./loader-circle-BDgPbVnp.js";import{A}from"./arrow-left-D54QkzE4.js";import{S as E}from"./sparkle-Bn8r8X9I.js";import{P as D}from"./palette-mRSIIKyt.js";import{C as L}from"./calendar-gmvOydCJ.js";import{T as S}from"./triangle-alert-B05WW2Gt.js";import{A as B}from"./arrow-right-CV1TWFR8.js";import{B as M}from"./book-open-CsDDMk7x.js";import{C as P}from"./clipboard-list-B2vGeRFn.js";import{G as C}from"./gamepad-2-BajtX9um.js";import{m as R}from"./proxy-uvBKCwa0.js";const q=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],$=v("history",q),I=[{title:"Catálogo",to:"/materials",icon:M,tint:"#FDAA3E"},{title:"Plano de Aula IA",to:"/plano-de-aula",icon:P,tint:"#7B2FFF"},{title:"ExercÃcios IA",to:"/atividade-inteligente",icon:F,tint:"#EE5A70"},{title:"Monaplay",to:"/monoplay",icon:C,tint:"#2DD4A8",badge:"Premium"}];function Y(){const{user:r,isLoading:c}=w(),m=y(),[t,f]=n.useState(null),[x,g]=n.useState([]),[j,p]=n.useState(!0);if(n.useEffect(()=>{if(!c){if(!r){m({to:"/login"});return}(async()=>{p(!0);const[{data:a},{data:l}]=await Promise.all([u.from("user_subscriptions").select("pinceis_balance, pinceis_max, pinceis_monthly, plan_name, next_refill_at").eq("user_id",r.id).maybeSingle(),u.from("pincel_transactions").select("id, kind, amount, balance_after, description, created_at").order("created_at",{ascending:!1}).limit(30)]);f({pinceis_balance:a?.pinceis_balance??0,pinceis_max:a?.pinceis_max??0,pinceis_monthly:a?.pinceis_monthly??0,plan_name:a?.plan_name??"Gratuito",next_refill_at:a?.next_refill_at??null}),g(l??[]),p(!1)})()}},[r,c,m]),c||j)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-[#FFFBF3]",children:e.jsx(_,{className:"w-8 h-8 text-[#7B2FFF] animate-spin"})});const o=t?.pinceis_balance??0,s=t?.pinceis_max??0,b=s>0?Math.min(100,Math.round(o/s*100)):0,h=s>0&&o>=Math.floor(s*.8),k=t?.next_refill_at?new Date(t.next_refill_at).toLocaleDateString("pt-BR"):"â";return e.jsxs("div",{className:"min-h-screen bg-[#FFFBF3] text-[#1a1a1a]",style:{fontFamily:"'Plus Jakarta Sans', 'Inter', system-ui, sans-serif"},children:[e.jsx("header",{className:"sticky top-0 z-50 bg-white/80 backdrop-blur-xl border-b border-black/5",children:e.jsxs("div",{className:"max-w-5xl mx-auto h-16 px-4 sm:px-6 flex items-center justify-between",children:[e.jsxs(i,{to:"/app",className:"flex items-center gap-2 text-sm font-bold text-black/60 hover:text-black",children:[e.jsx(A,{className:"w-4 h-4"}),"Voltar"]}),e.jsxs(i,{to:"/app",className:"flex items-center gap-2 font-black tracking-tight",children:[e.jsx("span",{className:"w-7 h-7 rounded-xl bg-gradient-to-br from-[#FDAA3E] via-[#EE5A70] to-[#7B2FFF] grid place-items-center",children:e.jsx(E,{className:"w-3.5 h-3.5 text-white"})}),"Minha Conta"]}),e.jsx("div",{className:"w-16"})]})}),e.jsxs("main",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-10 space-y-10",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"text-xs font-black uppercase tracking-[0.25em] text-black/40 mb-4",children:"Meu Saldo"}),e.jsx("div",{className:"rounded-3xl overflow-hidden bg-gradient-to-br from-[#FDAA3E] via-[#EE5A70] to-[#7B2FFF] p-[1.5px]",children:e.jsxs("div",{className:"rounded-3xl bg-white p-6 sm:p-8",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-6",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-black uppercase tracking-[0.25em] text-[#7B2FFF]",children:["Plano ",t?.plan_name??"â"]}),e.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[e.jsx(D,{className:"w-7 h-7 text-[#FDAA3E]"}),e.jsx("span",{className:"text-5xl font-black tabular-nums text-[#1a1a1a]",children:o}),e.jsxs("span",{className:"text-lg font-bold text-black/40",children:["/ ",s," pincéis"]})]}),e.jsxs("p",{className:"mt-2 text-sm text-black/55",children:["Recebe ",e.jsx("strong",{children:t?.pinceis_monthly??0})," pincéis por mês · acúmulo até ",e.jsx("strong",{children:s})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-black/60 bg-black/[0.04] rounded-2xl px-4 py-3",children:[e.jsx(L,{className:"w-4 h-4 text-[#7B2FFF]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-black uppercase tracking-widest text-black/40",children:"Próxima recarga"}),e.jsx("div",{className:"font-bold text-[#1a1a1a]",children:k})]})]})]}),e.jsxs("div",{className:"mt-6",children:[e.jsx("div",{className:"h-2.5 rounded-full bg-black/[0.06] overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${b}%`,background:h?"linear-gradient(90deg, #EE5A70, #FDAA3E)":"linear-gradient(90deg, #7B2FFF, #EE5A70)"}})}),e.jsxs("div",{className:"mt-1.5 flex justify-between text-[10px] font-bold text-black/40 uppercase tracking-wider",children:[e.jsx("span",{children:"0"}),e.jsxs("span",{children:[b,"% do limite"]}),e.jsx("span",{children:s})]})]}
1),h&&e.jsxs("div",{className:"mt-5 rounded-2xl border border-[#EE5A70]/30 bg-[#EE5A70]/5 p-4 flex gap-3",children:[e.jsx(S,{className:"w-5 h-5 text-[#EE5A70] shrink-0 mt-0.5"}),e.jsx("p",{className:"text-sm text-black/75 leading-relaxed",children:"Você está próximo do limite de pincéis do seu plano. Aproveite para desbloquear novos materiais e enriquecer sua biblioteca pedagógica."})]}),e.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[e.jsxs(i,{to:"/materials",className:"inline-flex items-center gap-2 rounded-xl bg-[#1a1a1a] text-white px-5 py-3 text-sm font-bold hover:bg-black transition-colors",children:["Usar Pincéis no catálogo",e.jsx(B,{className:"w-4 h-4"})]}),e.jsx(i,{to:"/planos",className:"inline-flex items-center gap-2 rounded-xl border-2 border-black/10 text-[#1a1a1a] px-5 py-3 text-sm font-bold hover:border-black/30 transition-colors",children:"Mudar plano"})]})]})})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xs font-black uppercase tracking-[0.25em] text-black/40 mb-4",children:"Minhas Ferramentas"}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:I.map((a,l)=>e.jsx(R.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:l*.05},children:e.jsxs(i,{to:a.to,className:"block p-5 rounded-2xl bg-white border border-black/[0.06] hover:border-black/15 transition-all hover:-translate-y-0.5",style:{boxShadow:`0 10px 30px -20px ${a.tint}88`},children:[e.jsx("div",{className:"w-10 h-10 rounded-xl grid place-items-center mb-3",style:{background:`${a.tint}1a`,color:a.tint},children:e.jsx(a.icon,{className:"w-5 h-5"})}),e.jsx("div",{className:"text-sm font-black text-[#1a1a1a]",children:a.title}),"badge"in a&&a.badge&&e.jsx("span",{className:"mt-2 inline-block text-[9px] font-black uppercase tracking-widest px-2 py-0.5 rounded-full",style:{background:`${a.tint}1a`,color:a.tint},children:a.badge})]})},a.title))})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"text-xs font-black uppercase tracking-[0.25em] text-black/40 mb-4 flex items-center gap-2",children:[e.jsx($,{className:"w-4 h-4"})," Histórico de Pincéis"]}),e.jsx("div",{className:"rounded-3xl bg-white border border-black/[0.06] overflow-hidden",children:x.length===0?e.jsx("div",{className:"p-10 text-center text-sm text-black/40",children:"Nenhuma movimentação ainda. Desbloqueie um material no catálogo para começar."}):e.jsx("ul",{className:"divide-y divide-black/[0.05]",children:x.map(a=>{const d=a.amount<0?"#EE5A70":"#2DD4A8",N=a.kind==="refill"?"Recarga mensal":a.kind==="debit"?"Desbloqueio":a.kind==="bonus"?"Bônus":a.kind==="reset"?"Reset":"Ajuste";return e.jsxs("li",{className:"flex items-center justify-between p-4 sm:p-5 hover:bg-black/[0.015]",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest px-2 py-0.5 rounded-full",style:{background:`${d}1a`,color:d},children:N}),e.jsx("span",{className:"text-[11px] text-black/40 font-bold",children:new Date(a.created_at).toLocaleDateString("pt-BR")})]}),e.jsx("div",{className:"text-sm text-black/70 mt-1 truncate",children:a.description??"â"})]}),e.jsxs("div",{className:"text-right shrink-0 ml-4",children:[e.jsxs("div",{className:"text-base font-black tabular-nums",style:{color:d},children:[a.amount>0?"+":"",a.amount]}),e.jsxs("div",{className:"text-[10px] text-black/40 font-bold uppercase tracking-wider",children:["saldo ",a.balance_after]})]})]},a.id)})})})]})]})]})}export{Y as component};
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.