PageSourceSearch

https://fitdietaihkapp.manus.space/assets/Recipes-BiNIEDEQ.js

js fitdietaihkapp.manus.space collected 2026-10-03 05:02:09 UTC 38,105 bytes, 26 lines download raw bytes

1import{f as v,l as ye,r as c,t as N,j as e,A as ke,ap as L,S as E,m as u,C as r,c as o,d as m,e as n,U as ee,B as g,X as we,F as se,w as te,b as i,aq as Se,af as Ce}from"./index-bM8UT4Os.js";import{L as p}from"./label-2Seh_wFH.js";import{I as b}from"./input-BwpLlRYf.js";import{S as Ie,a as Te,b as Me,c as Pe,d as C}from"./select-CDP2pHh8.js";import{T as _e,a as Fe,b as q,c as G}from"./tabs-qssmSDz1.js";import{B as ce}from"./bookmark-Dym4i0oW.js";import{L as ae}from"./lightbulb-Pi6aQ1eP.js";import{P as Ae}from"./plus-DSaqw8wa.js";import{T as Be}from"./trash-2-4iirX7DH.js";import"./dialog-CxcTDVnZ.js";import"./useComposition-DO5dIJEj.js";import"./chevron-up-TG6jWiKP.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Le=v("BookmarkCheck",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2Z",key:"169p4p"}],["path",{d:"m9 10 2 2 4-4",key:"1gnqz4"}]]);/**
7 * @license lucide-react v0.453.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ee=v("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
12 * @license lucide-react v0.453.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const le=v("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
17 * @license lucide-react v0.453.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const h=v("Refrigerator",[["path",{d:"M5 6a4 4 0 0 1 4-4h6a4 4 0 0 1 4 4v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6Z",key:"fpq118"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M15 7v6",key:"1nx30x"}]]);/**
22 * @license lucide-react v0.453.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const re=v("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),ie=[{id:"high_protein",label:"💪 高蛋白",desc:"增肌必備",preference:"高蛋白質,每餐至少30g蛋白質,用雞髀肉/蝦/牛肉/蛋白/豆腐"},{id:"low_cal",label:"🥗 低卡輕食",desc:"減脂恩物",preference:"低卡路里,每餐控制在400kcal以內,多蔬菜少油"},{id:"quick_15min",label:"⚡ 15分鐘快手",desc:"趕時間必睇",preference:"15分鐘內完成,簡單快手,適合返工忙嘅人"},{id:"meal_prep_hero",label:"📦 備餐王者",desc:"一次煮幾日",preference:"適合一次過煮好分裝,容易翻熱,味道唔會變差"},{id:"late_night",label:"🌙 健康宵夜",desc:"夜晚肚餓",preference:"健康宵夜選擇,低GI、唔太重口味、容易消化"},{id:"post_workout",label:"🏋️ 練後補給",desc:"訓練後食",preference:"訓練後恢復餐,高蛋白+適量碳水,幫助肌肉修復"},{id:"budget",label:"💰 窮人恩物",desc:"$30以內",preference:"材料費控制在$30以內,平靚正,街市買到"},{id:"no_cook",label:"🥪 免煮輕食",desc:"唔使開火",preference:"免煮或者只需要微波爐/焗爐,唔使開火煮"},{id:"asian_fusion",label:"🍜 亞洲風味",desc:"中日韓泰",preference:"亞洲風味(中式/日式/韓式/泰式),香港人鍾意嘅口味"},{id:"western",label:"🥩 西式健康",desc:"意粉焗嘢",preference:"西式健康餐,意粉、焗雞、三文治呢類"},{id:"soup_stew",label:"🍲 湯水燉品",desc:"暖胃養生",preference:"湯水或者燉品,養生暖胃,適合香港天氣"},{id:"sweet_healthy",label:"🍰 健康甜品",desc:"滿足甜癮",preference:"健康甜品/小食,低糖或者用代糖,滿足甜癮但唔肥"}],qe=["雞蛋","雞胸肉","雞髀肉","豬肉碎","牛肉片","三文魚","豆腐","白飯","意粉","烏冬","米粉","番茄","洋蔥","蒜頭","薑","青椒","菜心","西蘭花","白菜","生菜","粟米","薯仔","紅蘿蔔","冬瓜","蘑菇","蝦"];function We(){ye();const[ne,H]=c.useState("generate"),[R,$]=c.useState("single_meal"),[O,de]=c.useState("lunch"),[V,pe]=c.useState(3),[z,xe]=c.useState(""),[I,oe]=c.useState(""),[j,T]=c.useState(null),[M,U]=c.useState(!1),[y,Z]=c.useState(null),[d,K]=c.useState([]),[k,Q]=c.useState(""),[X,me]=c.useState(""),[P,ge]=c.useState(""),[w,_]=c.useState(null),[F,J]=c.useState(!1),ue=N.recipes.generate.useMutation(),he=N.recipes.generateFromFridge.useMutation(),A=N.recipes.save.useMutation(),Re=N.recipes.deleteSaved.useMutation(),{data:x,refetch:W}=N.recipes.getSaved.useQuery(),je=async()=>{U(!0),T(null);try{const t=[y&&ie.find(a=>
26a.id===y)?.preference||"",z].filter(Boolean).join("。"),l=await ue.mutateAsync({type:R,mealType:O,prepDays:R==="meal_prep"?V:void 0,preferences:t||void 0,targetCalories:I?parseInt(I):void 0});l.success&&l.recipe?(T(l.recipe),i.success("食譜生成完成!🍳")):i.error("食譜生成唔到,試多次")}catch(s){i.error("生成唔到:"+(s.message||"試多次"))}finally{U(!1)}},fe=async()=>{if(d.length===0){i.error("至少加一樣食材先!");return}J(!0),_(null);try{const s=await he.mutateAsync({ingredients:d,preferences:X||void 0,targetCalories:P?parseInt(P):void 0});s.success&&s.recipe?(_(s.recipe),i.success("食譜生成完成!用晒你雪櫃嘅嘢 🧊🍳")):i.error("食譜生成唔到,試多次")}catch(s){i.error("生成唔到:"+(s.message||"試多次"))}finally{J(!1)}},B=s=>{const t=s.trim();if(t){if(d.includes(t)){i.error("已經加咗呢樣嘢喇");return}if(d.length>=15){i.error("最多加 15 樣食材");return}K([...d,t]),Q("")}},Ne=s=>{K(d.filter(t=>t!==s))},Y=async s=>{const t=s||j;if(t)try{await A.mutateAsync({recipe:t}),i.success("食譜已收藏!❤️"),W()}catch(l){i.error("收藏唔到:"+(l.message||"試多次"))}},be=async s=>{try{await Re.mutateAsync({id:s}),i.success("已移除收藏"),W()}catch{i.error("剷唔到")}},ve=s=>{Z(y===s?null:s)},S={easy:{label:"簡單",color:"bg-green-100 text-green-700"},medium:{label:"中等",color:"bg-yellow-100 text-yellow-700"},hard:{label:"較難",color:"bg-red-100 text-red-700"}},D=({recipeData:s,onSave:t,onReset:l})=>e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:227",className:"space-y-4",children:[e.jsx(r,{"data-loc":"client/src/pages/Recipes.tsx:229",className:"card-premium overflow-hidden",children:e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:230",className:"bg-gradient-to-r from-purple-600 to-pink-600 p-5 text-white",children:[e.jsx("h2",{"data-loc":"client/src/pages/Recipes.tsx:231",className:"text-xl font-bold",children:s.title}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:232",className:"text-purple-100 text-sm mt-1",children:s.description}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:233",className:"flex items-center gap-3 mt-3 flex-wrap",children:[e.jsx(u,{"data-loc":"client/src/pages/Recipes.tsx:234",className:S[s.difficulty]?.color||"bg-gray-100",children:S[s.difficulty]?.label||s.difficulty}),e.jsxs("span",{"data-loc":"client/src/pages/Recipes.tsx:237",className:"flex items-center gap-1 text-xs text-purple-100",children:[e.jsx(te,{"data-loc":"client/src/pages/Recipes.tsx:238",className:"w-3 h-3"}),"準備 ",s.prepTime,"分鐘 + 煮 ",s.cookTime,"分鐘"]}),e.jsxs("span",{"data-loc":"client/src/pages/Recipes.tsx:241",className:"flex items-center gap-1 text-xs text-purple-100",children:[e.jsx(ee,{"data-loc":"client/src/pages/Recipes.tsx:242",className:"w-3 h-3"}),s.servings," 份"]})]})]})}),e.jsxs(r,{"data-loc":"client/src/pages/Recipes.tsx:250",className:"card-premium",children:[e.jsx(o,{"data-loc":"client/src/pages/Recipes.tsx:251",className:"pb-2",children:e.jsxs(m,{"data-loc":"client/src/pages/Recipes.tsx:252",className:"text-base flex items-center gap-2",children:[e.jsx(se,{"data-loc":"client/src/pages/Recipes.tsx:253",className:"w-4 h-4 text-purple-500"}),"每份營養"]})}),e.jsxs(n,{"data-loc":"client/src/pages/Recipes.tsx:257",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:258",className:"grid grid-cols-4 gap-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:259",className:"bg-orange-50 dark:bg-orange-950/30 p-3 rounded-lg text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:260",className:"text-xs text-muted-foreground",children:"熱量"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:261",className:"text-lg font-bold text-orange-600",children:s.nutrition.perServing.calories}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:262",className:"text-xs text-muted-foreground",children:"kcal"})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:264",className:"bg-green-50 dark:bg-green-950/30 p-3 rounded-lg text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:265",className:"text-xs text-muted-foreground",children:"蛋白質"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:266",className:"text-lg font-bold text-green-600",children:s.nutrition.perServing.protein}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:267",className:"text-xs text-muted-foreground",children:"g"})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:269",className:"bg-yellow-50 dark:bg-yellow-950/30 p-3 rounded-lg text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:270",className:"text-xs text-muted-foreground",children:"碳水"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:271",className:"text-lg font-bold text-yellow-600",children:s.nutrition.perServing.carbs}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:272",className:"text-xs text-muted-foreground",children:"g"})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:274",className:"bg-red-50 dark:bg-red-950/30 p-3 rounded-lg text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:275",className:"text-xs text-muted-foreground",children:"脂肪"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:276",className:"text-lg font-bold text-red-600",children:s.nutrition.perServing.fat}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:277",className:"text-xs text-muted-foreground",children:"g"})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:280",className:"flex items-center gap-4 mt-3 pt-3 border-t border-border",children:[e.jsxs("span",{"data-loc":"client/src/pages/Recipes.tsx:281",className:"flex items-center gap-1 text-sm",children:[e.jsx(Ee,{"data-loc":"client/src/pages/Recipes.tsx:282",className:"w-4 h-4 text-green-500"}),"總材料費:",s.totalCost]}),s.costPerServing&&e.jsxs("span",{"data-loc":"client/src/pages/Recipes.tsx:286",className:"text-sm text-muted-foreground",children:["(每餐約 ",s.costPerServing,")"]})]})]})]}),e.jsxs(r,{"data-loc":"client/src/pages/Recipes.tsx:295",className:"card-premium",children:[e.jsx(o,{"data-loc":"client/src/pages/Recipes.tsx:296",className:"pb-2",children:e.jsxs(m,{"data-loc":"client/src/pages/Recipes.tsx:297",className:"text-base flex items-center gap-2",children:[e.jsx(re,{"data-loc":"client/src/pages/Recipes.tsx:298",className:"w-4 h-4 text-blue-500"}),"材料清單"]})}),e.jsx(n,{"data-loc":"client/src/pages/Recipes.tsx:302",children:e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:303",className:"space-y-2",children:s.ingredients.map((a,f)=>e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:305",className:"flex items-center justify-between py-2 px-3 rounded-lg bg-muted/50 hover:bg-muted transition-colors",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:309",className:"flex items-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/pages/Recipes.tsx:310",className:"w-5 h-5 rounded-full bg-blue-100 dar
26k:bg-blue-900/50 text-blue-600 text-xs flex items-center justify-center font-medium",children:f+1}),e.jsx("span",{"data-loc":"client/src/pages/Recipes.tsx:313",className:"text-sm font-medium",children:a.name}),e.jsx("span",{"data-loc":"client/src/pages/Recipes.tsx:314",className:"text-xs text-muted-foreground",children:a.amount})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:316",className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a.estimatedCost&&e.jsx("span",{"data-loc":"client/src/pages/Recipes.tsx:317",className:"text-green-600",children:a.estimatedCost}),a.whereToBuy&&e.jsx("span",{"data-loc":"client/src/pages/Recipes.tsx:319",className:"px-1.5 py-0.5 rounded bg-blue-50 dark:bg-blue-900/30 text-blue-600 text-[10px]",children:a.whereToBuy})]})]},f))})})]}),e.jsxs(r,{"data-loc":"client/src/pages/Recipes.tsx:329",className:"card-premium",children:[e.jsx(o,{"data-loc":"client/src/pages/Recipes.tsx:330",className:"pb-2",children:e.jsxs(m,{"data-loc":"client/src/pages/Recipes.tsx:331",className:"text-base flex items-center gap-2",children:[e.jsx(le,{"data-loc":"client/src/pages/Recipes.tsx:332",className:"w-4 h-4 text-purple-500"}),"煮法步驟"]})}),e.jsx(n,{"data-loc":"client/src/pages/Recipes.tsx:336",children:e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:337",className:"space-y-3",children:s.steps.map((a,f)=>e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:339",className:"flex gap-3",children:[e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:340",className:"flex-shrink-0 w-7 h-7 rounded-full bg-gradient-to-br from-purple-500 to-pink-500 text-white text-xs flex items-center justify-center font-bold",children:f+1}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:343",className:"text-sm pt-1 leading-relaxed",children:a})]},f))})})]}),(s.storage||s.reheat||s.mealPrepTips)&&e.jsxs(r,{"data-loc":"client/src/pages/Recipes.tsx:352",className:"card-premium",children:[e.jsx(o,{"data-loc":"client/src/pages/Recipes.tsx:353",className:"pb-2",children:e.jsxs(m,{"data-loc":"client/src/pages/Recipes.tsx:354",className:"text-base flex items-center gap-2",children:[e.jsx(h,{"data-loc":"client/src/pages/Recipes.tsx:355",className:"w-4 h-4 text-blue-500"}),"備餐貼士"]})}),e.jsxs(n,{"data-loc":"client/src/pages/Recipes.tsx:359",className:"space-y-3",children:[s.storage&&e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:361",className:"bg-blue-50 dark:bg-blue-950/30 p-3 rounded-lg",children:[e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:362",className:"text-xs font-medium text-blue-700 dark:text-blue-400 mb-1",children:"📦 保鮮方法"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:363",className:"text-sm",children:s.storage})]}),s.reheat&&e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:367",className:"bg-orange-50 dark:bg-orange-950/30 p-3 rounded-lg",children:[e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:368",className:"text-xs font-medium text-orange-700 dark:text-orange-400 mb-1",children:"🔥 翻熱方法"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:369",className:"text-sm",children:s.reheat})]}),s.mealPrepTips&&e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:373",className:"bg-green-50 dark:bg-green-950/30 p-3 rounded-lg",children:[e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:374",className:"text-xs font-medium text-green-700 dark:text-green-400 mb-1",children:"💡 備餐心得"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:375",className:"text-sm",children:s.mealPrepTips})]})]})]}),e.jsx(r,{"data-loc":"client/src/pages/Recipes.tsx:383",className:"card-premium",children:e.jsxs(n,{"data-loc":"client/src/pages/Recipes.tsx:384",className:"p-4 space-y-3",children:[s.tips&&e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:386",className:"flex items-start gap-2",children:[e.jsx(ae,{"data-loc":"client/src/pages/Recipes.tsx:387",className:"w-4 h-4 text-amber-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:388",className:"text-sm",children:s.tips})]}),s.healthComment&&e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:392",className:"flex items-start gap-2",children:[e.jsx(Se,{"data-loc":"client/src/pages/Recipes.tsx:393",className:"w-4 h-4 text-pink-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:394",className:"text-sm",children:s.healthComment})]})]})}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:401",className:"flex gap-3 pt-2",children:[e.jsx(g,{"data-loc":"client/src/pages/Recipes.tsx:402",variant:"outline",onClick:l,className:"flex-1",children:"換一個食譜"}),e.jsxs(g,{"data-loc":"client/src/pages/Recipes.tsx:409",onClick:t,disabled:A.isPending,className:"flex-1 bg-gradient-to-r from-purple-600 to-pink-600 text-white",children:[A.isPending?e.jsx(Ce,{"data-loc":"client/src/pages/Recipes.tsx:415",className:"w-4 h-4 mr-1"}):e.jsx(Le,{"data-loc":"client/src/pages/Recipes.tsx:417",className:"w-4 h-4 mr-1"}),"收藏食譜"]})]})]});return e.jsx(ke,{"data-loc":"client/src/pages/Recipes.tsx:426",title:"AI 食譜",
26showBack:!0,children:e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:427",className:"max-w-3xl mx-auto px-4 py-6 pb-24 space-y-5",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:429",className:"text-left mb-2",children:[e.jsxs("h1",{"data-loc":"client/src/pages/Recipes.tsx:430",className:"text-2xl font-bold text-foreground flex items-center gap-2",children:[e.jsx(L,{"data-loc":"client/src/pages/Recipes.tsx:431",className:"w-7 h-7 text-purple-500"}),"AI 食譜推薦"]}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:434",className:"text-sm text-muted-foreground mt-1",children:"根據你嘅目標,AI 幫你設計啱食嘅食譜 🍽️"})]}),e.jsxs(_e,{"data-loc":"client/src/pages/Recipes.tsx:440",value:ne,onValueChange:H,className:"mb-6",children:[e.jsxs(Fe,{"data-loc":"client/src/pages/Recipes.tsx:441",className:"grid w-full grid-cols-3",children:[e.jsxs(q,{"data-loc":"client/src/pages/Recipes.tsx:442",value:"generate",className:"flex items-center gap-1 text-xs sm:text-sm",children:[e.jsx(E,{"data-loc":"client/src/pages/Recipes.tsx:443",className:"w-3.5 h-3.5"}),"生成食譜"]}),e.jsxs(q,{"data-loc":"client/src/pages/Recipes.tsx:446",value:"fridge",className:"flex items-center gap-1 text-xs sm:text-sm",children:[e.jsx(h,{"data-loc":"client/src/pages/Recipes.tsx:447",className:"w-3.5 h-3.5"}),"雪櫃煮乜"]}),e.jsxs(q,{"data-loc":"client/src/pages/Recipes.tsx:450",value:"saved",className:"flex items-center gap-1 text-xs sm:text-sm",children:[e.jsx(ce,{"data-loc":"client/src/pages/Recipes.tsx:451",className:"w-3.5 h-3.5"}),"收藏 ",x&&x.length>0&&e.jsx(u,{"data-loc":"client/src/pages/Recipes.tsx:453",variant:"secondary",className:"ml-0.5 text-[10px] px-1 py-0",children:x.length})]})]}),e.jsxs(G,{"data-loc":"client/src/pages/Recipes.tsx:461",value:"generate",className:"mt-4",children:[!j&&!M&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{"data-loc":"client/src/pages/Recipes.tsx:466",className:"mb-4 shadow-lg card-premium",children:[e.jsxs(o,{"data-loc":"client/src/pages/Recipes.tsx:467",className:"pb-3",children:[e.jsxs(m,{"data-loc":"client/src/pages/Recipes.tsx:468",className:"text-lg flex items-center gap-2",children:[e.jsx(ae,{"data-loc":"client/src/pages/Recipes.tsx:469",className:"w-5 h-5 text-amber-500"}),"揀個靈感先"]}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:472",className:"text-xs text-muted-foreground",children:"撳一個分類,AI 會根據呢個方向設計食譜"})]}),e.jsx(n,{"data-loc":"client/src/pages/Recipes.tsx:474",children:e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:475",className:"grid grid-cols-3 sm:grid-cols-4 gap-2",children:ie.map(s=>e.jsxs("button",{"data-loc":"client/src/pages/Recipes.tsx:477",onClick:()=>ve(s.id),className:`p-2.5 rounded-xl border-2 text-center transition-all duration-200 hover:scale-[1.02] active:scale-95 ${y===s.id?"border-purple-400 bg-purple-50 dark:bg-purple-950/30 shadow-md":"border-border hover:border-purple-200 dark:hover:border-purple-800"}`,children:[e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:486",className:"text-base leading-none",children:s.label.split(" ")[0]}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:487",className:"text-[11px] font-medium mt-1 text-foreground",children:s.label.split(" ").slice(1).join(" ")}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:488",className:"text-[10px] text-muted-foreground mt-0.5",children:s.desc})]},s.id))})})]}),e.jsxs(r,{"data-loc":"client/src/pages/Recipes.tsx:496",className:"mb-6 card-premium",children:[e.jsx(o,{"data-loc":"client/src/pages/Recipes.tsx:497",className:"pb-3",children:e.jsxs(m,{"data-loc":"client/src/pages/Recipes.tsx:498",className:"text-lg flex items-center gap-2",children:[e.jsx(E,{"data-loc":"client/src/pages/Recipes.tsx:499",className:"w-5 h-5 text-purple-500"}),"想食咩?"]})}),e.jsxs(n,{"data-loc":"client/src/pages/Recipes.tsx:503",className:"space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:505",children:[e.jsx(p,{"data-loc":"client/src/pages/Recipes.tsx:506",className:"text-sm font-medium",children:"食譜類型"}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:507",className:"grid grid-cols-2 gap-3 mt-2",children:[e.jsxs("button",{"data-loc":"client/src/pages/Recipes.tsx:508",onClick:()=>$("single_meal"),className:`p-4 rounded-xl border-2 text-left transition-all ${R==="single_meal"?"border-purple-400 bg-purple-50 dark:bg-purple-950/30":"border-border hover:border-muted-foreground
26/30"}`,children:[e.jsx(ee,{"data-loc":"client/src/pages/Recipes.tsx:516",className:"w-5 h-5 text-purple-500 mb-1"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:517",className:"font-medium text-sm",children:"單餐食譜"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:518",className:"text-xs text-muted-foreground",children:"煮一餐食"})]}),e.jsxs("button",{"data-loc":"client/src/pages/Recipes.tsx:520",onClick:()=>$("meal_prep"),className:`p-4 rounded-xl border-2 text-left transition-all ${R==="meal_prep"?"border-purple-400 bg-purple-50 dark:bg-purple-950/30":"border-border hover:border-muted-foreground/30"}`,children:[e.jsx(h,{"data-loc":"client/src/pages/Recipes.tsx:528",className:"w-5 h-5 text-purple-500 mb-1"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:529",className:"font-medium text-sm",children:"備餐計劃"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:530",className:"text-xs text-muted-foreground",children:"一次煮幾日份"})]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:536",children:[e.jsx(p,{"data-loc":"client/src/pages/Recipes.tsx:537",className:"text-sm font-medium",children:"邊餐"}),e.jsxs(Ie,{"data-loc":"client/src/pages/Recipes.tsx:538",value:O,onValueChange:de,children:[e.jsx(Te,{"data-loc":"client/src/pages/Recipes.tsx:539",className:"mt-1",children:e.jsx(Me,{"data-loc":"client/src/pages/Recipes.tsx:540"})}),e.jsxs(Pe,{"data-loc":"client/src/pages/Recipes.tsx:542",children:[e.jsx(C,{"data-loc":"client/src/pages/Recipes.tsx:543",value:"breakfast",children:"早餐"}),e.jsx(C,{"data-loc":"client/src/pages/Recipes.tsx:544",value:"lunch",children:"午餐"}),e.jsx(C,{"data-loc":"client/src/pages/Recipes.tsx:545",value:"dinner",children:"晚餐"}),e.jsx(C,{"data-loc":"client/src/pages/Recipes.tsx:546",value:"snack",children:"小食/加餐"})]})]})]}),R==="meal_prep"&&e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:553",children:[e.jsx(p,{"data-loc":"client/src/pages/Recipes.tsx:554",className:"text-sm font-medium",children:"備幾日份?"}),e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:555",className:"flex gap-2 mt-2",children:[2,3,4,5].map(s=>e.jsxs("button",{"data-loc":"client/src/pages/Recipes.tsx:557",onClick:()=>pe(s),className:`flex-1 py-2 rounded-lg text-sm font-medium transition-all ${V===s?"bg-purple-500 text-white":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:[s," 日"]},s))})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:574",children:[e.jsx(p,{"data-loc":"client/src/pages/Recipes.tsx:575",className:"text-sm font-medium",children:"目標熱量(可選)"}),e.jsx(b,{"data-loc":"client/src/pages/Recipes.tsx:576",type:"number",placeholder:"留空會根據你嘅 TDEE 自動計算",value:I,onChange:s=>oe(s.target.value),className:"mt-1"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:583",className:"text-xs text-muted-foreground mt-1",children:"每餐嘅目標熱量(kcal)"})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:587",children:[e.jsx(p,{"data-loc":"client/src/pages/Recipes.tsx:588",className:"text-sm font-medium",children:"額外要求(可選)"}),e.jsx(b,{"data-loc":"client/src/pages/Recipes.tsx:589",placeholder:"例如:唔食牛、想食辣、要高蛋白...",value:z,onChange:s=>xe(s.target.value),className:"mt-1"})]}),e.jsxs(g,{"data-loc":"client/src/pages/Recipes.tsx:598",onClick:je,disabled:M,className:"w-full bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700 text-white py-6 text-lg font-medium",children:[e.jsx(L,{"data-loc":"client/src/pages/Recipes.tsx:603",className:"w-5 h-5 mr-2"}),"生成食譜"]})]})]})]}),M&&e.jsx(r,{"data-loc":"client/src/pages/Recipes.tsx:613",className:"mb-6 card-premium overflow-hidden",children:e.jsxs(n,{"data-loc":"client/src/pages/Recipes.tsx:614",className:"p-8 text-center",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:615",className:"relative w-20 h-20 mx-auto mb-4",children:[e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:616",className:"absolute inset-0 rounded-full bg-gradient-to-r from-purple-400 to-pink-400 animate-ping opacity-20"}),e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:617",className:"absolute inset-2 rounded-full bg-gradient-to-r from-purple-400 to-pink-400 animate-pulse opacity-40"}),e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:618",className:"absolute inset-4 rounded-full bg-background flex items-center justify-center",children:e.jsx(L,{"data-loc":"client/src/pages/Recipes.tsx:619",className:"w-8 h-8 text-purple-500"})})]}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:622",className:"font-medium",children:"AI 廚師正在設計食譜..."}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:623",className:"text-sm text-muted-foreground mt-1",children:"今次唔會出藜麥彩虹飯㗎喇 😏"})]})}),j&&e.jsx(D,{"data-loc":"client/src/pages/Recipes.tsx:630",recipeData:j,onSave:()=>Y(j),onReset:()=>T(null)})]}),e.jsxs(G,{"data-loc":"client/src/pages/Recipes.tsx:639",value:"fridge",className:"mt-4",children:[!w&&!F&&e.jsx(e.Fragment,{children:e.jsxs(r,{"data-loc":"client/src/pages/Recipes.tsx:642",className:"mb-4 shadow-lg card-premium",children:[e.jsxs(o,{"data-loc":"client/src/pages/Recipes.tsx:643",className:"pb-3",children:[e.jsxs(m,{"data-loc":"client/src/pages/Recipes.tsx:644",className:"text-lg flex items-center gap-2",children:[e.jsx(h,{"data-loc":"client/src/pages/Recipes.tsx:645",className:"w-5 h-5 text-purple-500"}),"雪櫃有乜煮乜"]}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:648",className:"text-xs text-muted-foreground",children:"入你手頭有嘅食材,AI 幫你用現有材料設計食譜,
26唔使額外去買嘢!"})]}),e.jsxs(n,{"data-loc":"client/src/pages/Recipes.tsx:652",className:"space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:654",children:[e.jsx(p,{"data-loc":"client/src/pages/Recipes.tsx:655",className:"text-sm font-medium",children:"你有咩食材?"}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:656",className:"flex gap-2 mt-2",children:[e.jsx(b,{"data-loc":"client/src/pages/Recipes.tsx:657",placeholder:"打食材名,例如:雞蛋",value:k,onChange:s=>Q(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),B(k))},className:"flex-1"}),e.jsx(g,{"data-loc":"client/src/pages/Recipes.tsx:669",variant:"outline",size:"sm",onClick:()=>B(k),disabled:!k.trim(),className:"px-3",children:e.jsx(Ae,{"data-loc":"client/src/pages/Recipes.tsx:676",className:"w-4 h-4"})})]})]}),d.length>0&&e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:683",className:"flex flex-wrap gap-2",children:d.map(s=>e.jsxs(u,{"data-loc":"client/src/pages/Recipes.tsx:685",variant:"secondary",className:"pl-2.5 pr-1 py-1.5 text-sm bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300 hover:bg-purple-200 dark:hover:bg-purple-900/50",children:[s,e.jsx("button",{"data-loc":"client/src/pages/Recipes.tsx:691",onClick:()=>Ne(s),className:"ml-1.5 p-0.5 rounded-full hover:bg-purple-300 dark:hover:bg-purple-800 transition-colors",children:e.jsx(we,{"data-loc":"client/src/pages/Recipes.tsx:695",className:"w-3 h-3"})})]},s))}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:703",children:[e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:704",className:"text-xs text-muted-foreground mb-2",children:"快速加入常見食材 👇"}),e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:705",className:"flex flex-wrap gap-1.5",children:qe.filter(s=>!d.includes(s)).map(s=>e.jsxs("button",{"data-loc":"client/src/pages/Recipes.tsx:707",onClick:()=>B(s),className:"px-2.5 py-1 text-xs rounded-full border border-border hover:border-purple-400 hover:bg-purple-50 dark:hover:bg-purple-950/30 transition-all active:scale-95",children:["+ ",s]},s))})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:719",children:[e.jsx(p,{"data-loc":"client/src/pages/Recipes.tsx:720",className:"text-sm font-medium",children:"額外要求(可選)"}),e.jsx(b,{"data-loc":"client/src/pages/Recipes.tsx:721",placeholder:"例如:想食辣啲、要快手...",value:X,onChange:s=>me(s.target.value),className:"mt-1"})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:730",children:[e.jsx(p,{"data-loc":"client/src/pages/Recipes.tsx:731",className:"text-sm font-medium",children:"目標熱量(可選)"}),e.jsx(b,{"data-loc":"client/src/pages/Recipes.tsx:732",type:"number",placeholder:"留空會自動計算",value:P,onChange:s=>ge(s.target.value),className:"mt-1"})]}),e.jsxs(g,{"data-loc":"client/src/pages/Recipes.tsx:742",onClick:fe,disabled:F||d.length===0,className:"w-full bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700 text-white py-6 text-lg font-medium",children:[e.jsx(h,{"data-loc":"client/src/pages/Recipes.tsx:747",className:"w-5 h-5 mr-2"}),"用呢啲材料煮嘢食!"]}),d.length===0&&e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:752",className:"text-xs text-center text-muted-foreground",children:"至少加一樣食材先可以生成食譜 ☝️"})]})]})}),F&&e.jsx(r,{"data-loc":"client/src/pages/Recipes.tsx:763",className:"mb-6 card-premium overflow-hidden",children:e.jsxs(n,{"data-loc":"client/src/pages/Recipes.tsx:764",className:"p-8 text-center",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:765",className:"relative w-20 h-20 mx-auto mb-4",children:[e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:766",className:"absolute inset-0 rounded-full bg-gradient-to-r from-purple-400 to-pink-400 animate-ping opacity-20"}),e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:767",className:"absolute inset-2 rounded-full bg-gradient-to-r from-purple-400 to-pink-400 animate-pulse opacity-40"}),e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:768",className:"absolute inset-4 rounded-full bg-background flex items-center justify-center",children:e.jsx(h,{"data-loc":"client/src/pages/Recipes.tsx:769",className:"w-8 h-8 text-purple-500"})})]}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:772",className:"font-medium",children:"AI 廚師正在翻你雪櫃..."}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:773",className:"text-sm text-muted-foreground mt-1",children:"用你手頭嘅食材設計緊食譜 🧊"})]})}),w&&e.jsx(D,{"data-loc":"client/src/pages/Recipes.tsx:780",recipeData:w,onSave:()=>Y(w),onReset:()=>_(null)})]}),e.jsx(G,{"data-loc":"client/src/pages/Recipes.tsx:789",value:"saved",className:"mt-4",children:!x||x.length===0?e.jsx(r,{"data-loc":"client/src/pages/Recipes.tsx:791",className:"card-premium",children:e.jsxs(n,{"data-loc":"client/src/pages/Recipes.tsx:792",className:"p-8 text-center",children:[e.jsx(ce,{"data-loc":"client/src/pages/Recipes.tsx:793",className:"w-12 h-12 text-muted-foreground
26/30 mx-auto mb-3"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:794",className:"font-medium text-muted-foreground",children:"仲未有收藏食譜"}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:795",className:"text-sm text-muted-foreground mt-1",children:"生成食譜之後撳「收藏」就可以儲存喺呢度 📌"}),e.jsxs(g,{"data-loc":"client/src/pages/Recipes.tsx:798",variant:"outline",className:"mt-4",onClick:()=>H("generate"),children:[e.jsx(E,{"data-loc":"client/src/pages/Recipes.tsx:803",className:"w-4 h-4 mr-1"}),"去生成食譜"]})]})}):e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:809",className:"space-y-3",children:[e.jsxs("p",{"data-loc":"client/src/pages/Recipes.tsx:810",className:"text-sm text-muted-foreground mb-2",children:["你收藏咗 ",x.length," 個食譜,隨時翻睇 👇"]}),x.map(s=>{const t=s.recipe;return e.jsx(r,{"data-loc":"client/src/pages/Recipes.tsx:816",className:"card-premium hover:opacity-90 transition-opacity",children:e.jsxs(n,{"data-loc":"client/src/pages/Recipes.tsx:817",className:"p-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:818",className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:819",className:"flex-1 min-w-0",children:[e.jsx("h3",{"data-loc":"client/src/pages/Recipes.tsx:820",className:"font-bold text-base truncate",children:t.title}),e.jsx("p",{"data-loc":"client/src/pages/Recipes.tsx:821",className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:t.description}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:822",className:"flex items-center gap-3 mt-2 flex-wrap",children:[e.jsxs(u,{"data-loc":"client/src/pages/Recipes.tsx:823",variant:"secondary",className:"text-xs",children:[e.jsx(se,{"data-loc":"client/src/pages/Recipes.tsx:824",className:"w-3 h-3 mr-0.5"}),t.nutrition?.perServing?.calories||"?"," kcal"]}),e.jsxs(u,{"data-loc":"client/src/pages/Recipes.tsx:827",variant:"secondary",className:"text-xs",children:[e.jsx(te,{"data-loc":"client/src/pages/Recipes.tsx:828",className:"w-3 h-3 mr-0.5"}),t.prepTime||"?","+",t.cookTime||"?","分鐘"]}),t.difficulty&&e.jsx(u,{"data-loc":"client/src/pages/Recipes.tsx:832",className:`text-xs ${S[t.difficulty]?.color||""}`,children:S[t.difficulty]?.label||t.difficulty})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:837",className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[e.jsxs("span",{"data-loc":"client/src/pages/Recipes.tsx:838",children:["P: ",t.nutrition?.perServing?.protein||0,"g"]}),e.jsxs("span",{"data-loc":"client/src/pages/Recipes.tsx:839",children:["C: ",t.nutrition?.perServing?.carbs||0,"g"]}),e.jsxs("span",{"data-loc":"client/src/pages/Recipes.tsx:840",children:["F: ",t.nutrition?.perServing?.fat||0,"g"]}),t.costPerServing&&e.jsxs("span",{"data-loc":"client/src/pages/Recipes.tsx:841",className:"text-green-600",children:["💰 ",t.costPerServing]})]})]}),e.jsx(g,{"data-loc":"client/src/pages/Recipes.tsx:844",variant:"ghost",size:"sm",onClick:()=>be(s.id),className:"flex-shrink-0 text-destructive hover:text-destructive",children:e.jsx(Be,{"data-loc":"client/src/pages/Recipes.tsx:850",className:"w-4 h-4"})})]}),e.jsxs("details",{"data-loc":"client/src/pages/Recipes.tsx:854",className:"mt-3",children:[e.jsx("summary",{"data-loc":"client/src/pages/Recipes.tsx:855",className:"text-xs text-primary cursor-pointer hover:underline",children:"展開查看完整食譜 →"}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:858",className:"mt-3 space-y-3 border-t border-border pt-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:860",children:[e.jsxs("p",{"data-loc":"client/src/pages/Recipes.tsx:861",className:"text-xs font-medium mb-1.5 flex items-center gap-1",children:[e.jsx(re,{"data-loc":"client/src/pages/Recipes.tsx:862",className:"w-3 h-3"})," 材料"]}),e.jsx("div",{"data-loc":"client/src/pages/Recipes.tsx:864",className:"space-y-1",children:t.ingredients?.map((l,a)=>e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:866",className:"text-xs flex justify-between px-2 py-1 bg-muted/30 rounded",children:[e.jsxs("span",{"data-loc":"client/src/pages/Recipes.tsx:867",children:[l.name," ",l.amount]}),e.jsx("span",{"data-loc":"client/src/pages/Recipes.tsx:868",className:"text-muted-foreground",children:l.estimatedCost})]},a))})]}),e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:874",children:[e.jsxs("p",{"data-loc":"client/src/pages/Recipes.tsx:875",className:"text-xs font-medium mb-1.5 flex items-center gap-1",children:[e.jsx(le,{"data-loc":"client/src/pages/Recipes.tsx:876",className:"w-3 h-3"})," 步驟"]}),e.jsx("ol",{"data-loc":"client/src/pages/Recipes.tsx:878",className:"space-y-1 list-decimal list-inside",children:t.steps?.map((l,a)=>e.jsx("li",{"data-loc":"client/src/pages/Recipes.tsx:880",className:"text-xs leading-relaxed",children:l},a))})]}),t.tips&&e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:886",className:"text-xs bg-amber-50 dark:bg-amber-950/30 p-2 rounded",children:["💡 ",t.tips]}),t.storage&&e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:891",className:"text-xs bg-blue-50 dark:bg-blue-950/30 p-2 rounded",children:["📦 ",t.storage]}),t.reheat&&e.jsxs("div",{"data-loc":"client/src/pages/Recipes.tsx:896",className:"text-xs bg-orange-50 dark:bg-orange-950/30 p-2 rounded",children:["🔥 ",t.reheat]})]})]})]})},s.id)})]})})]})]})})}export{We 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.