PageSourceSearch

https://foodie.plus/_next/static/chunks/29rchckwuh2fr.js

js foodie.plus collected 2026-10-09 23:35:01 UTC 25,628 bytes, 19 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="e2575800-e0a3-ae41-1454-719a4d7c547f")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,814489,e=>{"use strict";var t=e.i(271645),r=e.i(656135);let i=(0,t.cache)(async e=>{try{let t=await a(e),r=await n(e);return{user:await s(e),authUser:t,subscription:r}}catch(e){return console.error("Unexpected error fetching user data:",e),{}}}),s=(0,t.cache)(async e=>{let{data:t}=await e.from("users").select("*").single();return t});(0,t.cache)(async(e,t)=>{let{data:r}=await e.from("users").select("*").eq("id",t).single();return r});let a=(0,t.cache)(async e=>{let{data:{user:t}}=await e.auth.getUser();return t}),n=(0,t.cache)(async e=>{let{data:{user:t}}=await e.auth.getUser();if(!t)return null;let{data:i,error:s}=await e.from("subscriptions").select("*").eq("user_id",t.id).eq("is_active",!0).limit(1).maybeSingle();return s?((0,r.captureError)(s,{flow:"payment",surface:"service",operation:"getSubscription",userId:t.id}),null):i});(0,t.cache)(async e=>{let{data:t}=await e.from("users").select("*").single();return t});let o=async(e,t)=>{let{error:r}=await e.from("users").update(t).eq("id",t.id);if(r)throw r},l=async(e,t,r)=>{let i=e.from("lists").select(`
3      *,
4      list_recipes (
5        recipe:recipes (*)
6      )
7    `).eq("uuid",r);t&&i.eq("user_id",t);let{data:s,error:a}=await i.single();return a?(console.error("Error fetching list with recipes:",a),null):{...s,recipes:s?.list_recipes?.map(e=>e.recipe).filter(e=>null!=e&&!0!==e.hidden)||[]}},d=async(e,t)=>{let{data:r,error:i}=await e.from("lists").select(`
8      *,
9      list_recipes (
10        recipe:recipes (*)
11      )
12    `).eq("user_id",t);return i?(console.error("Error fetching user lists with recipes:",i),[]):(r.forEach(e=>{e.recipes=e.list_recipes.map(e=>e.recipe),delete e.list_recipes}),r)},c=async e=>{let{data:t,error:r}=await e.from("lists").select(`
13      *,
14      list_recipes (
15        recipe:recipes (*)
16      )
17    `).is("user_id",null).eq("public",!0);return r?(console.error("Error fetching public lists with recipes:",r),[]):(t.forEach(e=>{e.recipes=e.list_recipes.map(e=>e.recipe),delete e.list_recipes}),t)},u=async(e,t)=>{let{data:r,error:i}=await e.from("recipes").select("id, is_new, has_video, premium, created_at, author, title, path, minutes").in("path",t).eq("hidden","false");if(i)throw i;return r},m=async(e,t,r)=>{let{data:i,error:s}=await e.from("lists").upsert({...r,user_id:t}).select().single();if(s)throw s;return i},x=async(e,t,r)=>{let{error:i}=await e.from("lists").delete().eq("id",r).eq("user_id",t);if(i)throw i},h=async(e,t,r)=>{let{error:i}=await e.from("lists").update({name:r.name,description:r.description,public:r.public}).eq("id",r.id).eq("user_id",t);if(i)throw i},p=async(e,t,r)=>{let{error:i}=await e.from("list_recipes").upsert({list_id:t,recipe_id:r});if(i)throw i},f=async(e,t,r)=>{let{error:i}=await e.from("list_recipes").delete().eq("list_id",t).eq("recipe_id",r);if(i)throw i},g=async(e,t,r)=>{let i,s=new Date().toISOString(),{data:a,error:n}=await e.from("share_links").select().eq("user_id",t).eq("recipe_id",r).gt("expires_at",s);if(n)throw n;if(a&&a.length>0)return a[0].code;let o=new Date(Date.now()+864e5),l=(i=new Uint8Array(8),crypto.getRandomValues(i),Array.from(i,e=>{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return t[e%t.length]}).join("")),{data:d,error:c}=await e.from("share_links").upsert({user_id:t,recipe_id:r,code:l,expires_at:o.toISOString()}).select().single();if(c)throw c;return d.code},w=async(e,t,r)=>{let{data:i,error:s}=await e.rpc("resolve_share_link",{p_code:t,p_recipe_id:r});if(s)throw s;return i&&i.length>0?i[0]:null},b=async(e,t,r)=>{let{data:i,error:s}=await e.from("user_recipe_edits").select("*").eq("user_id",t).eq("recipe_id",r).limit(1);if(s)throw s;return i?.[0]||null},v=async(e,t,r,i,s)=>
17{let a={user_id:t,recipe_id:r,ingredients:i,updated_at:new Date().toISOString()};s&&(a.directions=s);let{error:n}=await e.from("user_recipe_edits").upsert(a);if(n)throw n},j=async(e,t,r,i,s)=>{let{error:a}=await e.from("tasting_notes").upsert({recipe_id:r,user_id:t,rating:i,comment:s},{onConflict:"user_id,recipe_id",ignoreDuplicates:!1});if(a)throw a},y=async(e,t,r)=>{let{error:i}=await e.from("tasting_notes").delete().eq("user_id",t).eq("recipe_id",r);if(i)throw i},N=async(e,t,r)=>{let{error:i}=await e.from("user_recipe_edits").delete().eq("user_id",t).eq("recipe_id",r);if(i)throw i};e.s(["addRecipeToList",0,p,"addTastingNote",0,j,"createList",0,m,"createShareLink",0,g,"deleteList",0,x,"deleteRecipeEdits",0,N,"deleteTastingNote",0,y,"fetchShareLink",0,w,"getFoodieUser",0,i,"getListWithRecipes",0,l,"getPublicListsWithRecipes",0,c,"getRecipeEdits",0,b,"getRecipes",0,u,"getUserListsWithRecipes",0,d,"removeRecipeFromList",0,f,"updateList",0,h,"updateUserDetails",0,o,"upsertRecipeEdits",0,v])},960671,e=>{"use strict";let t="https://accounts.google.com/gsi/client";e.s(["GOOGLE_CLIENT_ID",0,"14487844990-bfdlddnk3bpa6ibb9soeepo2rrn5vte9.apps.googleusercontent.com","loadGoogleIdentityServices",0,function(){return new Promise((e,r)=>{if(window.google?.accounts?.id)return void e();let i=()=>{let t=Date.now(),i=window.setInterval(()=>{window.google?.accounts?.id?(window.clearInterval(i),e()):Date.now()-t>1e4&&(window.clearInterval(i),r(Error("Google Identity Services did not initialize in time")))},50)},s=e=>()=>{e.remove(),r(Error("Failed to load Google Identity Services script"))},a=e=>()=>{e.dataset.gsiLoaded="true",i()},n=document.querySelector(`script[src="${t}"]`);if(n){n.addEventListener("error",s(n)),n.dataset.gsiLoaded?i():n.addEventListener("load",a(n));return}let o=document.createElement("script");o.src=t,o.async=!0,o.addEventListener("load",a(o)),o.addEventListener("error",s(o)),document.body.appendChild(o)})}])},671830,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(30030),s=e.i(30207),a=e.i(934620);e.i(174080);var n=e.i(991918),o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,i)=>{let s=r.forwardRef((e,r)=>{let{asChild:s,...a}=e,o=s?n.Slot:i;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(o,{...a,ref:r})});return s.displayName=`Primitive.${i}`,{...e,[i]:s}},{}),l="Avatar",[d,c]=(0,i.createContextScope)(l),[u,m]=d(l),x=r.forwardRef((e,i)=>{let{__scopeAvatar:s,...a}=e,[n,l]=r.useState("idle");return(0,t.jsx)(u,{scope:s,imageLoadingStatus:n,onImageLoadingStatusChange:l,children:(0,t.jsx)(o.span,{...a,ref:i})})});x.displayName=l;var h="AvatarImage",p=r.forwardRef((e,i)=>{let{__scopeAvatar:n,src:l,onLoadingStatusChange:d=()=>{},...c}=e,u=m(h,n),x=function(e){let[t,i]=r.useState("idle");return(0,a.useLayoutEffect)(()=>{if(!e)return void i("error");let t=!0,r=new window.Image,s=e=>()=>{t&&i(e)};return i("loading"),r.onload=s("loaded"),r.onerror=s("error"),r.src=e,()=>{t=!1}},[e]),t}(l),p=(0,s.useCallbackRef)(e=>{d(e),u.onImageLoadingStatusChange(e)});return(0,a.useLayoutEffect)(()=>{"idle"!==x&&p(x)},[x,p]),"loaded"===x?(0,t.jsx)(o.img,{...c,ref:i,src:l}):null});p.displayName=h;var f="AvatarFallback",g=r.forwardRef((e,i)=>{let{__scopeAvatar:s,delayMs:a,...n}=e,l=m(f,s),[d,c]=r.useState(void 0===a);return r.useEffect(()=>{if(void 0!==a){let e=window.setTimeout(()=>c(!0),a);return()=>window.clearTimeout(e)}},[a]),d&&"loaded"!==l.imageLoadingStatus?(0,t.jsx)(o.span,{...n,ref:i}):null});g.displayName=f;var w=e.i(647163);let b=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(x,{ref:i,className:(0,w.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...r}));b.displayName=x.displayName;let v=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(p,{ref:i,className:(0,w.cn)("aspect-square h-full w-full",e),...r}));v.displayName=p.displayName;let j=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(g,{ref:i,className:(0,w.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...r}));j.displayName=g.displayName,e.s(["Avatar",0,b,"AvatarFallback",0,j,"AvatarImage",0,v],671830)},198246,e=>{"use strict";let t={otp_expired:{title:"Link Expired",message:"This link is no longer valid. It may have expired or already been used. Please request a new one.",showResendLink:!0}
17,access_denied:{title:"Access Denied",message:"You do not have permission to access this resource.",showResendLink:!0}},r={title:"Something Went Wrong",message:"An unexpected error occurred. Please try again.",showResendLink:!0};e.s(["getAuthErrorConfig",0,function(e){return e?{...Object.prototype.hasOwnProperty.call(t,e)?t[e]:r,code:e}:{...r,code:null}}])},842190,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("60f50e029fb2c218be0912e531070abd56aec6eea7",t.callServer,void 0,t.findSourceMapURL,"resetPassword");e.s(["resetPassword",0,r])},676045,306495,e=>{"use strict";var t=e.i(843476),r=e.i(278669),i=e.i(271645),s=e.i(151288),a=e.i(656135),n=e.i(960671);let o=e=>{let r=(0,i.useRef)(null),[o,l]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let t=!1;return window.handleSignInWithGoogle=async t=>{let r=(0,s.createClient)(),{error:i}=await r.auth.signInWithIdToken({provider:"google",token:t.credential});if(i){console.error(i),(0,a.captureError)(i,{flow:"auth",operation:"oauth-google",surface:"client"});return}e.setSignedInState?.(!0)},(0,n.loadGoogleIdentityServices)().then(()=>{!t&&r.current&&(window.google.accounts.id.initialize({client_id:n.GOOGLE_CLIENT_ID,callback:window.handleSignInWithGoogle,use_fedcm_for_prompt:!0}),window.google.accounts.id.renderButton(r.current,{theme:"outline",size:"large",logo_alignment:"center",width:250,text:"continue_with"}),l(!0))}).catch(e=>{console.error(e),(0,a.captureError)(e,{flow:"auth",operation:"oauth-google-render",surface:"client"})}),()=>{t=!0}},[]),(0,t.jsx)("div",{className:"mx-auto max-w-xs",children:(0,t.jsxs)("div",{className:"relative flex items-center justify-center mx-auto h-[40px] text-center",children:[(0,t.jsx)("div",{ref:r,className:"h-[40px] scale-110"}),!o&&(0,t.jsx)("button",{type:"button","aria-hidden":!0,className:"absolute inset-0 m-auto flex w-[250px] h-[40px] scale-110 items-center justify-center px-4 py-2 border text-slate-700 border-gray-300 rounded-md shadow-sm bg-white text-md",children:(0,t.jsxs)("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),(0,t.jsx)("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),(0,t.jsx)("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),(0,t.jsx)("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})})]})})};var l=e.i(671830),d=e.i(814489),c=e.i(567593);function u(){return(0,t.jsx)("div",{className:"flex items-center justify-center min-h-[200px] w-full",children:(0,t.jsx)(c.FoodieLoaderCircle,{size:"lg"})})}var m=e.i(154083),x=e.i(618566),h=e.i(846696),p=e.i(95187);let f=(0,p.createServerReference)("70d3b98e8ddbdb623ce89f3c648667fd70c8e21e32",p.callServer,void 0,p.findSourceMapURL,"checkoutWithStripe");async function g(e,t){try{let i=r.analytics?.getAmplitudeDeviceId()??null,s=r.analytics?.getAmplitudeSessionId()??null,a=await f(e,void 0,{deviceId:i,sessionId:s});a&&!1===a.ok&&("ALREADY_SUBSCRIBED_VIA_APPLE"===a.code?h.toast.success("You're already on Foodie Plus",{description:"Apple handles your billing — manage it in Settings.",action:{label:"Open Settings",onClick:()=>window.open(a.manageUrl,"_blank","noopener,noreferrer")}}):h.toast.success("You're already on Foodie Plus",{description:"Manage your plan or billing in Account.",action:{label:"Manage plan",onClick:()=>{t?t.push("/account"):window.location.assign("/account")}}}))}catch(e){(0,a.captureError)(e,{flow:"payment",surface:"client",operation:"get-premium.subscribe"}),h.toast.error("Something went wrong",{description:e instanceof Error?e.message:"Please try again."})}}e.s(["GetPremium",0,()=>{let e=(0,x.useRouter)(),r=(0,x.usePathname)(),[s,a]=(0,i.useState)(!1),n=async()=>{a(!0),await g(r,e),a(!1)};return(0,t.jsx)("div",{children:(0,t.jsx)("button",{onClick:n,disabled:s,className:"text-white bg-foodie-orange border border-black shadow-foodie-box-shadow-yellow px-4 py-2 my-2 rounded disabled:opacity-50",children:s?"Proceeding to checkout...":"Get Foodie Plus"})})},"handleStripeCheckoutRequest",0,g],306495);var w=e.i(818344),b=e.i(842190);let v={message:""};function j({onCancel:e}){let[r,s]=(0,i.useActionState)(b.resetPassword,v);return(0,t.jsxs)("div",{className:"container mx-auto py-4 px-4 sm:px-8",children:[(0,t.jsx)("div",{className:"text-foodie-orange text-4xl font-bold text-center",children:"Reset your password"}),r?.message&&(0,t.jsx)("div",{className:"mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded",children:r?.message}),(0,t.jsxs)("form",{className:"flex flex-col space-y-4",autoComplete:"on",children:[(0,t.jsx)("span",{className:"pt-6 text-center",children:"Enter the email address you used to sign up and we'll send you an email."}),(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("input",{id:"email",name:"email",type:"email",autoComplete:"email",placeholder:"Email",required:!0,className:"flex-grow min-w-60 p-2 rounded-md border-foodie-brown border focus:outline-none focus:ring-0 placeholder:text-foodie-brown/50"})}),(0,t.jsxs)("div",{className:"flex items-center justify-center gap-4 pt-6",children:[(0,t.jsx)("button",{formAction:s,className:"text-white bg-foodie-orange px-4 py-2 rounded w-full",children:"Send Email"}),(0,t.jsx)("button",{onClick:e,className:"text-foodie-brown border-foodie-brown border px-4 py-2 rounded w-full",children:"Cancel"})]})]})]})}let y=(0,p.createServerReference)("4014a8a06f06a2a1b892e73f7172925a892e663229",p.callServer,void 0,p.findSourceMapURL,"signin");function N({onForgotPassword:e,onSignUp:r,setSignedInState:s}){let[a,n]=(0,i.useState)(),o=async e=>{n(void 0);let{error:t,success:r}=await y(e);t?(n(t),console.error(t)):r&&s(!0)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-foodie-brown/80 text-xl sm:text-2xl font-bold text-center mb-6",children:"Log in"}),a&&(0,t.jsx)("div",{className:"mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded",children:a}),(0,t.jsxs)("form",{className:"flex flex-col space-y-4",autoComplete:"on",children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("input",{id:"email",name:"email",type:"email",autoComplete:"email",placeholder:"Email",required:!0,className:"flex-grow min-w-60 p-2 rounded-md border border-foodie-brown focus:outline-none focus:ring-0 placeholder:text-foodie-light-brown"})}),(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("input",{id:"password",name:"password",type:"password",required:!0,placeholder:"Password",className:"flex-grow min-w-60 p-2 rounded-md border border-foodie-brown focus:outline-none focus:ring-0 placeholder:text-foodie-light-brown",autoComplete:"password"})}),(0,t.jsx)("div",{className:"flex items-center justify-center pt-4",children:(0,t.jsx)("button",{formAction:e=>o(e),className:"text-white bg-orange-600 px-4 py-2 rounded",children:"Continue"})})]}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsxs)("div",{className:"text-left pt-3 leading-7 text-foodie-brown",children:[(0,t.jsx)("button",{onClick:e,className:"text-inherit hover:underline hover:text-inherit text-left",children:(0,t.jsx)("div",{className:"text-sm sm:text-base",children:"Forgot your password?"})}),(0,t.jsx)("br",{}),(0,t.jsx)("button",{className:"pt-3 text-inherit hover:underline hover:text-inherit text-left",onClick:r,children:(0,t.jsx)("div",{className:"text-sm sm:text-base",children:"Don't have an account? Sign up"})})]})})]})}let S=(0,p.createServerReference)("60975ce9cfbd2bb46fa05951831a709ba206fdb677",p.callServer,void 0,p.findSourceMapURL,"signup");function _({authReturnTo:e,onLogin:r,setSignedInState:s}){let[a,n]=(0,i.useState)(),o=async t=>{n(void 0);let{error:r,success:i}=await S(t,e);r?(n(r),console.error(r)):i&&s(!0)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-foodie-brown/80 text-xl sm:text-2xl font-bold text-center mb-6",children:"Create an account"}),a&&(0,t.jsx)("div",{className:"mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded",children:a}),(0,t.jsxs)("form",{className:"flex flex-col space-y-4",autoComplete:"on",children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("input",{id:"email",name:"email",type:"email",autoComplete:"email",placeholder:"Email",required:!0,className:"flex-grow min-w-60 p-2 rounded-md border border-foodie-brown focus:outline-none focus:ring-0 placeholder:text-foodie-light-brown"})}),(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("input",{id:"password",name:"password",type:"password",required:!0,placeholder:"Password",className:"flex-grow min-w-60 p-2 rounded-md border border-foodie-brown focus:outline-none focus:ring-0 placeholder:text-foodie-light-brown",autoComplete:"password"})}),(0,t.jsx)("div",{className:"flex items-center justify-center pt-4",children:(0,t.jsx)("button",{formAction:e=>o(e),className:"text-white bg-orange-600 px-4 py-2 rounded",children:"Continue"})})]}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsxs)("div",{className:"text-left pt-3 leading-7 text-foodie-brown",children:[(0,t.jsx)("button",{className:"text-inherit hover:underline hover:text-inherit",onClick:r,children:(0,t.jsx)("div",{className:"text-sm sm:text-base",children:"Already have an account? Log in"})}),(0,t.jsxs)("div",{className:"text-sm sm:text-base text-left pt-3 leading-7 text-foodie-brown",children:["By signing up you agree to our"," ",(0,t.jsx)(m.PrivacyAwareLink,{href:"/terms",className:"text-inherit hover:underline hover:text-inherit",children:(0,t.jsx)("span",{className:"text-sm sm:text-base font-bold",children:"terms of service"})})," ","and"," ",(0,t.jsx)(m.PrivacyAwareLink,{href:"/privacy",className:"text-inherit hover:underline hover:text-inherit",children:(0,t.jsx)("span",{className:"text-sm sm:text-base font-bold",children:"privacy policy"})}),"."]})]})})]})}function k({authReturnTo:e,isSignUp:n}){let[o,l]=(0,i.useState)(""),[d,c]=(0,i.useState)(!1),[u,m]=(0,i.useState)(null),x=(0,s.createClient)(),h=async t=>{t.preventDefault();try{c(!0);let t=new URL("/auth/confirm",window.location.origin);e&&t.searchParams.set("next",e);let{error:i}=await x.auth.signInWithOtp({email:o,options:{emailRedirectTo:t.toString()}});if(i)throw i;(0,r.track)("Magic Link Sent",{source:"signin",is_sign_up:!n}),m("Check your email for the login link!")}catch(e){m("Error sending magic link. Please try again."),console.error(e),(0,a.captureError)(e,{flow:"auth",operation:"magic-link-client",surface:"client"})}finally{c(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-foodie-brown/80 text-2xl font-bold text-center mb-6",children:n?"Login with just email":"Sign up with 
17just email"}),(0,t.jsxs)("form",{className:"flex flex-col space-y-4",onSubmit:h,children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("input",{type:"email",placeholder:"Email",value:o,onChange:e=>l(e.target.value),required:!0,className:"flex-grow min-w-60 p-2 rounded-md border border-foodie-brown focus:outline-none focus:ring-0 placeholder:text-foodie-light-brown",autoComplete:"email"})}),(0,t.jsx)("div",{className:"flex items-center justify-center pt-4",children:(0,t.jsx)("button",{type:"submit",disabled:d,className:"text-white bg-orange-600 px-4 py-2 rounded",children:d?"Sending...":"Continue"})})]}),u&&(0,t.jsx)("div",{className:`mt-4 p-3 rounded ${u.includes("error")||u.includes("Error")?"bg-red-100 border border-red-400 text-red-700":"bg-green-100 border border-green-400 text-green-700"}`,children:u})]})}var E=e.i(198246),C=e.i(919692);let R="Send magic link",L="Sign in with password",A="Reset your password";e.s(["default",0,({authReturnTo:e,source:a})=>{let[n,c]=i.default.useState(L),[h,p]=i.default.useState(!0),[f,b]=i.default.useState(!0),[v,y]=(0,i.useState)(null),{foodieUser:S,setFoodieUser:I}=(0,w.useFoodieUser)(),P=(0,x.usePathname)(),q=(0,x.useRouter)(),U=(0,x.useSearchParams)(),F=(0,C.sanitizeRelativePath)(e??null,""),T=(0,i.useRef)(!1);(0,i.useEffect)(()=>{if(T.current)return;let e=window.location.hash;if(e){let t=new URLSearchParams(e.substring(1)),r=t.get("error_code")||t.get("error");if(r){T.current=!0,y(r),window.history.replaceState(null,"",window.location.pathname);return}}let t=U.get("source");t&&(T.current=!0,y(t))},[U]);let D=async()=>{try{b(!0);let e=(0,s.createClient)(),t=await (0,d.getFoodieUser)(e);I(t)}catch(e){console.error("Error getting user:",e.message)}finally{b(!1)}};(0,i.useEffect)(()=>{D()},[]),(0,i.useEffect)(()=>{"Account Tab"===a&&!f&&S?.authUser&&F&&q.replace(F)},[S?.authUser,q,F,a,f]);let O=e=>{let r=(S?.user?.full_name||"A Foodie").split(" "),i=r[0],s="";r.length>1&&(s=r[1]);let a=S?.subscription?.is_active?"Foodie Plus":"Foodie Freeloader";return(0,t.jsxs)("div",{className:"px-2",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[(0,t.jsx)("a",{href:"/account",children:(0,t.jsxs)(l.Avatar,{className:"w-16 h-16",children:[(0,t.jsx)(l.AvatarImage,{src:S?.authUser?.user_metadata?.avatar_url,alt:S?.authUser?.user_metadata?.full_name}),(0,t.jsx)(l.AvatarFallback,{className:"bg-foodie-beige",children:S?.authUser?.user_metadata.name?.charAt(0)||"A"})]})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-2xl",children:[i," ",s]}),(0,t.jsx)("div",{className:"text-sm break-all text-foodie-brown",children:S?.authUser?.email}),(0,t.jsx)("div",{className:"text-sm break-all text-foodie-light-brown",children:a})]})]}),e?(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)("div",{className:"text-center mt-4",children:"Proceeding to checkout..."}),(0,t.jsx)("div",{className:"text-center mt-4",children:"You will be automatically redirected."})]}):(0,t.jsx)("div",{className:"my-4 flex justify-center",children:(0,t.jsx)(m.PrivacyAwareLink,{href:"/recipes",children:(0,t.jsx)("button",{className:"text-white text-center bg-foodie-orange border border-black shadow-foodie-box-shadow-yellow px-4 py-2 my-2 rounded",children:"Explore the menu"})})})]})},M=e=>{c(e)},G=e=>{e?((0,r.track)("Set Signed In"),D()):I(void 0)},W=v?(0,t.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-4 mx-4",children:(0,t.jsx)("p",{className:"text-red-800 text-sm text-center",children:(0,E.getAuthErrorConfig)(v).message})}):null;return(0,t.jsxs)("div",{children:[W,(()=>{if(S?.authUser)if(f)return(0,t.jsx)(u,{});else{let e=!!S?.subscription?.is_active;return"Upsell Modal"!==a||e?O(!1):(g(P),O(!0))}return n===A?(0,t.jsx)(j,{onCancel:()=>M(L)}):n===R?(0,t.jsxs)("div",{className:"text-center mt-4 mb-4",children:[(0,t.jsx)("h1",{className:"text-foodie-orange text-2xl sm:text-4xl font-bold text-center",children:"Upsell Modal"===a?"Start Your Free Trial":"Welcome to Foodie"}),(0,t.jsxs)("div",{className:"container mx-auto py-4 px-4 sm:px-8",children:[(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(k,{authReturnTo:e,isSignUp:!h})}),(0,t.jsx)("div",{className:"text-left pt-3 leading-7 text-foodie-brown",children:(0,t.jsx)("button",{onClick:()=>M(L),className:"text-inherit hover:underline hover:text-inherit",children:(0,t.jsx)("div",{className:"text-md",children:"Sign in with password"})})}),(0,t.jsxs)("div",{className:"flex items-center mt-6",children:[(0,t.jsx)("div",{className:"flex-grow border-t border-foodie-brown"}),(0,t.jsx)("span",{className:"flex-shrink mx-4 my-6 text-foodie-brown text-md",children:"OR"}),(0,t.jsx)("div",{className:"flex-grow border-t border-foodie-brown"})]}),(0,t.jsx)("div",{className:"scale-110",children:(0,t.jsx)(o,{setSignedInState:G})})]})]}):n===L?(0,t.jsxs)("div",{className:"text-center sm:mt-4 mb-4",children:[(0,t.jsx)("h1",{className:"text-foodie-orange  text-2xl sm:text-4xl font-bold text-center",children:"Upsell Modal"===a?"Start Your Free Trial":"Welcome to Foodie"}
17),(0,t.jsxs)("div",{className:"container mx-auto sm:py-4 px-4 sm:px-8",children:[h?(0,t.jsx)(_,{authReturnTo:e,onLogin:()=>p(!1),setSignedInState:G}):(0,t.jsx)(N,{onForgotPassword:()=>M(A),onSignUp:()=>p(!0),setSignedInState:G}),(0,t.jsx)("div",{className:"text-left pt-3 leading-7 text-foodie-brown",children:(0,t.jsx)("button",{onClick:()=>M(R),className:"text-inherit hover:underline hover:text-inherit",children:(0,t.jsx)("div",{className:"text-sm sm:text-base",children:h?"Sign up with magic link":"Login with magic link"})})}),(0,t.jsxs)("div",{className:"flex items-center mt-6",children:[(0,t.jsx)("div",{className:"flex-grow border-t border-foodie-brown"}),(0,t.jsx)("span",{className:"flex-shrink mx-4 my-6 text-foodie-brown text-md",children:"OR"}),(0,t.jsx)("div",{className:"flex-grow border-t border-foodie-brown"})]}),(0,t.jsx)("div",{className:"scale-110",children:(0,t.jsx)(o,{setSignedInState:G})})]})]}):void 0})()]})}],676045)}]);
18
19//# debugId=e2575800-e0a3-ae41-1454-719a4d7c547f

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.