Files
aletheia/frontend/.next/server/app/history/page.js
bigtux 20a26affaa 📚 Documentação inicial do ALETHEIA
- MANUAL-PRODUTO.md: Manual do usuário final
- MANUAL-VENDAS.md: Estratégia comercial e vendas
- MANUAL-TECNICO.md: Infraestrutura e deploy
- README.md: Visão geral do projeto
2026-02-10 15:08:15 -03:00

1 line
7.6 KiB
JavaScript

(()=>{var e={};e.id=811,e.ids=[811],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},5258:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>i.a,__next_app__:()=>p,originalPathname:()=>u,pages:()=>d,routeModule:()=>h,tree:()=>c}),r(8316),r(3062),r(996);var s=r(170),a=r(5002),n=r(3876),i=r.n(n),o=r(6299),l={};for(let e in o)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>o[e]);r.d(t,l);let c=["",{children:["history",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,8316)),"/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/app/history/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(r.bind(r,3062)),"/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,996,23)),"next/dist/client/components/not-found-error"]}],d=["/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/app/history/page.tsx"],u="/history/page",p={require:r,loadChunk:()=>Promise.resolve()},h=new s.AppPageRouteModule({definition:{kind:a.x.APP_PAGE,page:"/history/page",pathname:"/history",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},5531:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,3642,23)),Promise.resolve().then(r.t.bind(r,7586,23)),Promise.resolve().then(r.t.bind(r,7838,23)),Promise.resolve().then(r.t.bind(r,8057,23)),Promise.resolve().then(r.t.bind(r,7741,23)),Promise.resolve().then(r.t.bind(r,3118,23))},8440:(e,t,r)=>{Promise.resolve().then(r.bind(r,1999)),Promise.resolve().then(r.bind(r,8210))},377:(e,t,r)=>{Promise.resolve().then(r.bind(r,5631))},4178:(e,t,r)=>{"use strict";var s=r(5289);r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}})},5631:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var s=r(7247),a=r(8964),n=r(4178),i=r(9906);r(2);var o=r(2064);function l(){let[e,t]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),{hydrate:c}=(0,o.t)();(0,n.useRouter)();let d=e=>e>=71?"text-green-400":e>=51?"text-yellow-400":e>=31?"text-orange-400":"text-red-400";return(0,s.jsxs)("div",{className:"min-h-screen bg-dark px-4 py-6 max-w-lg mx-auto",children:[(0,s.jsxs)("nav",{className:"flex items-center justify-between mb-8",children:[s.jsx(i.default,{href:"/scan",className:"text-gray-400 hover:text-white",children:"← Voltar"}),s.jsx("span",{className:"font-bold tracking-wider text-primary",children:"Hist\xf3rico"}),s.jsx("div",{})]}),r?s.jsx("div",{className:"text-center py-20 text-gray-400",children:"Carregando..."}):0===e.length?(0,s.jsxs)("div",{className:"text-center py-20",children:[s.jsx("p",{className:"text-gray-500 text-lg mb-4",children:"Nenhum scan ainda"}),s.jsx(i.default,{href:"/scan",className:"bg-primary text-dark px-6 py-3 rounded-xl font-bold",children:"Escanear agora"})]}):s.jsx("div",{className:"space-y-3",children:e.map(e=>(0,s.jsxs)("div",{className:"bg-dark-light rounded-xl p-4 flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:e.product_name||e.barcode}),e.brand&&s.jsx("p",{className:"text-gray-500 text-xs",children:e.brand}),s.jsx("p",{className:"text-gray-600 text-xs mt-1",children:new Date(e.scanned_at).toLocaleDateString("pt-BR")})]}),s.jsx("span",{className:`text-2xl font-black ${d(e.score)}`,children:e.score})]},e.id))})]})}},1999:(e,t,r)=>{"use strict";r.d(t,{InstallPrompt:()=>n});var s=r(7247),a=r(8964);function n(){let[e,t]=(0,a.useState)(null),[r,n]=(0,a.useState)(!1),i=async()=>{e&&(e.prompt(),await e.userChoice,t(null),n(!1))};return r?(0,s.jsxs)("div",{className:"fixed bottom-4 left-4 right-4 z-50 bg-gradient-to-r from-[#1A7A4C] to-[#0d5c38] text-white p-4 rounded-2xl shadow-2xl flex items-center justify-between gap-3 animate-fade-up",children:[(0,s.jsxs)("div",{children:[s.jsx("p",{className:"font-bold text-sm",children:"\uD83D\uDCF2 Instalar ALETHEIA"}),s.jsx("p",{className:"text-xs text-white/70",children:"Acesse direto da tela inicial"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>n(!1),className:"text-xs text-white/50 px-3 py-2",children:"Depois"}),s.jsx("button",{onClick:i,className:"bg-white text-[#1A7A4C] font-bold text-sm px-4 py-2 rounded-xl",children:"Instalar"})]})]}):null}},8210:(e,t,r)=>{"use strict";function s(){return null}r.d(t,{ServiceWorkerRegister:()=>s}),r(8964)},2:(e,t,r)=>{"use strict";r.d(t,{h:()=>n});let s=process.env.NEXT_PUBLIC_API_URL||"http://localhost:8090";async function a(e,t={}){let r={"Content-Type":"application/json",...t.headers||{}},a=await fetch(`${s}${e}`,{...t,headers:r});if(!a.ok)throw Error((await a.json().catch(()=>({detail:"Erro de rede"}))).detail||`HTTP ${a.status}`);return a.json()}let n={register:e=>a("/api/auth/register",{method:"POST",body:JSON.stringify(e)}),login:e=>a("/api/auth/login",{method:"POST",body:JSON.stringify(e)}),me:()=>a("/api/auth/me"),scan:e=>a("/api/scan",{method:"POST",body:JSON.stringify({barcode:e})}),history:()=>a("/api/history")}},2064:(e,t,r)=>{"use strict";let s;r.d(t,{t:()=>c});var a=r(8964);let n=e=>{let t;let r=new Set,s=(e,s)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},t,a),r.forEach(r=>r(t,e))}},a=()=>t,n={setState:s,getState:a,getInitialState:()=>i,subscribe:e=>(r.add(e),()=>r.delete(e))},i=t=e(s,a,n);return n},i=e=>e?n(e):n,o=e=>e,l=e=>{let t=i(e),r=e=>(function(e,t=o){let r=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},c=(s=e=>({user:null,token:null,setAuth:(t,r)=>{localStorage.setItem("token",t),localStorage.setItem("user",JSON.stringify(r)),e({token:t,user:r})},logout:()=>{localStorage.removeItem("token"),localStorage.removeItem("user"),e({token:null,user:null})},hydrate:()=>{let t=localStorage.getItem("token"),r=localStorage.getItem("user");t&&r&&e({token:t,user:JSON.parse(r)})}}))?l(s):l},8316:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});let s=(0,r(5347).createProxy)(String.raw`/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/app/history/page.tsx#default`)},3062:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c,metadata:()=>o,viewport:()=>l});var s=r(2051);r(5023);var a=r(5347);let n=(0,a.createProxy)(String.raw`/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/components/InstallPrompt.tsx#InstallPrompt`),i=(0,a.createProxy)(String.raw`/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/components/ServiceWorkerRegister.tsx#ServiceWorkerRegister`),o={title:"ALETHEIA — A verdade sobre o que voc\xea come",description:"Escaneie qualquer produto e nossa IA revela o que a ind\xfastria aliment\xedcia esconde nos r\xf3tulos.",manifest:"/manifest.json",appleWebApp:{capable:!0,statusBarStyle:"black-translucent",title:"ALETHEIA"},other:{"mobile-web-app-capable":"yes"}},l={themeColor:"#1A7A4C",width:"device-width",initialScale:1,maximumScale:1};function c({children:e}){return(0,s.jsxs)("html",{lang:"pt-BR",className:"dark",children:[s.jsx("head",{children:s.jsx("link",{rel:"apple-touch-icon",href:"/icons/icon-192.png"})}),(0,s.jsxs)("body",{className:"bg-dark text-white min-h-screen antialiased",children:[e,s.jsx(n,{}),s.jsx(i,{})]})]})}},5023:()=>{}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[138,906],()=>r(5258));module.exports=s})();