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]="8a050e13-3073-517d-f935-0b4d5e687e37")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,870519,e=>{"use strict";e.s(["capitalizeWords",0,function(e){return e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")},"getURL",0,(e="")=>{let t="https://foodie.plus",r="the-foodie-menu-ognst1nli-jessicaxiangs-projects.vercel.app",o=t&&""!==t.trim()?t:r&&""!==r.trim()?r:"http://localhost:3000/";return o=(o=o.replace(/\/+$/,"")).includes("http")?o:`https://${o}`,(e=e.replace(/^\/+/,""))?`${o}/${e}`:o}])},772328,e=>{"use strict";var t=e.i(271645),r=e.i(422875),o=e.i(796097);e.s(["useReducedMotion",0,function(){o.hasReducedMotionListener.current||(0,r.initPrefersReducedMotion)();let[e]=(0,t.useState)(o.prefersReducedMotion.current);return e}])},664659,e=>{"use strict";let t=(0,e.i(475254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],664659)},248425,e=>{"use strict";var t=e.i(271645),r=e.i(174080);function o(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}var i=e.i(843476),n=Symbol("radix.slottable");function a(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===n}var s=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{var n,s;let d,l,u,c=(s=n=`Primitive.${r}`,(d=t.forwardRef((e,r)=>{let{children:i,...n}=e;if(t.isValidElement(i)){var a;let e,s,d=(a=i,(s=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(s=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),l=function(e,t){let r={...t};for(let o in t){let i=e[o],n=t[o];/^on[A-Z]/.test(o)?i&&n?r[o]=(...e)=>{let t=n(...e);return i(...e),t}:i&&(r[o]=i):"style"===o?r[o]={...i,...n}:"className"===o&&(r[o]=[i,n].filter(Boolean).join(" "))}return{...e,...r}}(n,i.props);return i.type!==t.Fragment&&(l.ref=r?function(...e){return t=>{let r=!1,i=e.map(e=>{let i=o(e,t);return r||"function"!=typeof i||(r=!0),i});if(r)return()=>{for(let t=0;t<i.length;t++){let r=i[t];"function"==typeof r?r():o(e[t],null)}}}}(r,d):d),t.cloneElement(i,l)}return t.Children.count(i)>1?t.Children.only(null):null})).displayName=`${s}.SlotClone`,l=d,(u=t.forwardRef((e,r)=>{let{children:o,...n}=e,s=t.Children.toArray(o),d=s.find(a);if(d){let e=d.props.children,o=s.map(r=>r!==d?r:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,i.jsx)(l,{...n,ref:r,children:t.isValidElement(e)?t.cloneElement(e,void 0,o):null})}return(0,i.jsx)(l,{...n,ref:r,children:o})})).displayName=`${n}.Slot`,u),p=t.forwardRef((e,t)=>{let{asChild:o,...n}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(o?c:r,{...n,ref:t})});return p.displayName=`Primitive.${r}`,{...e,[r]:p}},{});e.s(["Primitive",0,s,"dispatchDiscreteCustomEvent",0,function(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}],248425)},410949,e=>{"use strict";let t="https://storage.googleapis.com/foodie-menu-videos",r=["mp4","mov","webm","mkv","avi","m4v"];e.s(["getRecipeVideoUrls",0,function(e){let o=e.toLowerCase().replace(/[^a-zA-Z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||e,i=`${t}/videos/${o}/${o}`,n=`${t}/${o}`,a=`${t}/${e}`,s=`${i}.mp4`,d=`${n}.mp4`,l=[];return r.forEach(e=>{l.push(`${i}.${e}`)}),r.forEach(e=>{l.push(`${n}.${e}`)}),r.forEach(e=>{l.push(`${a}.${e}`)}),{primary:s,fallback:d,candidates:l}},"getStepVideoUrls",0,function(e){if(e.startsWith("http"))return{primary:e,fallback:null};if(e.startsWith("videos/"))return{primary:`${t}/${e}`,fallback:null};if(e.match(/-step-\d+/)){let r=e.match(/\.(mp4|mov|avi|webm)$/i),o=e.replace(/-step-\d+.*$/,"");if(r)return{primary:`${t}/videos/${o}/${e}`,fallback:`${t}/${e}`};let i=`${t}/videos/${o}/${e}`,n=`${t}/${e}`,a=[];return a.push(`${i}.mp4`),a.push(`${i}.mov`),a.push(`${n}.mp4`),a.push(`${n}.mov`),{primary:`${i}.mp4`,fallback:`${n}.mp4`,candidates:a}}let r=e.match(/\.(mp4|mov|avi|webm)$/i)?e:`${e}.mp4`;return{primary:`${t}/${r}`,fallback:null}}])},123560,e=>{"use strict";function t(e,t){if(t){let r=e.split("/").pop();return`${t}/${r}.png`}return`${e}.png`}e.i(410949);let r=`${"https://jhsnzyqggpslvlbzypef.supabase.co".replace(/\/+$/,"")}/storage/v1/object/public/recipe-images`;e.s(["PLACEHOLDER_RECIPE_IMAGE",0,"/placeholder-recipe.svg","imageFromPath",0,(e,o,i)=>{let n=t(e,o),a=`${r}/${n}`;return i?`${a}?v=${new Date(i).getTime()}`:a},"recipeImageStoragePath",0,t,"sourceImageUrl",0,function(e,t){return`${r}/${e}/${t}`},"titleFromPath",0,e=>(e.includes("/")?e.split("/").pop():e).replace(/-/g," ").replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())])},107233,e=>{"use strict";let t=(0,e.i(475254).default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],107233)},582458,e=>{"use strict";let t=(0,e.i(475254).default)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},878894,e=>{"use strict";var t=e.i(582458);e.s(["AlertTriangle",()=>t.default])},158524,e=>{"use strict";let t=(0,e.i(475254).default)("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",ke
2y:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);e.s(["Link2",0,t],158524)},605030,e=>{"use strict";var t=e.i(843476),r=e.i(271645),o=e.i(248425),i="Progress",[n,a]=function(e,o=[]){let i=[],n=()=>{let t=i.map(e=>r.createContext(e));return function(o){let i=o?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...o,[e]:i}}),[o,i])}};return n.scopeName=e,[function(o,n){let a=r.createContext(n),s=i.length;i=[...i,n];let d=o=>{let{scope:i,children:n,...d}=o,l=i?.[e]?.[s]||a,u=r.useMemo(()=>d,Object.values(d));return(0,t.jsx)(l.Provider,{value:u,children:n})};return d.displayName=o+"Provider",[d,function(t,i){let d=i?.[e]?.[s]||a,l=r.useContext(d);if(l)return l;if(void 0!==n)return n;throw Error(`\`${t}\` must be used within \`${o}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let o=()=>{let o=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let i=o.reduce((t,{useScope:r,scopeName:o})=>{let i=r(e)[`__scope${o}`];return{...t,...i}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return o.scopeName=t.scopeName,o}(n,...o)]}(i),[s,d]=n(i),l=r.forwardRef((e,r)=>{var i,n;let{__scopeProgress:a,value:d=null,max:l,getValueLabel:u=p,...c}=e;(l||0===l)&&!h(l)&&console.error((i=`${l}`,`Invalid prop \`max\` of value \`${i}\` supplied to \`Progress\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`));let g=h(l)?l:100;null===d||_(d,g)||console.error((n=`${d}`,`Invalid prop \`value\` of value \`${n}\` supplied to \`Progress\`. The \`value\` prop must be: 3 - a positive number 4 - less than the value passed to \`max\` (or 100 if no \`max\` prop is set) 5 - \`null\` or \`undefined\` if the progress is indeterminate. 6 7Defaulting to \`null\`.`));let b=_(d,g)?d:null,y=f(b)?u(b,g):void 0;return(0,t.jsx)(s,{scope:a,value:b,max:g,children:(0,t.jsx)(o.Primitive.div,{"aria-valuemax":g,"aria-valuemin":0,"aria-valuenow":f(b)?b:void 0,"aria-valuetext":y,role:"progressbar","data-state":m(b,g),"data-value":b??void 0,"data-max":g,...c,ref:r})})});l.displayName=i;var u="ProgressIndicator",c=r.forwardRef((e,r)=>{let{__scopeProgress:i,...n}=e,a=d(u,i);return(0,t.jsx)(o.Primitive.div,{"data-state":m(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:r})});function p(e,t){return`${Math.round(e/t*100)}%`}function m(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function f(e){return"number"==typeof e}function h(e){return f(e)&&!isNaN(e)&&e>0}function _(e,t){return f(e)&&!isNaN(e)&&e<=t&&e>=0}c.displayName=u;var g=e.i(647163);let b=r.forwardRef(({className:e,value:r,...o},i)=>(0,t.jsx)(l,{ref:i,className:(0,g.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...o,children:(0,t.jsx)(c,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}})}));b.displayName=l.displayName,e.s(["Progress",0,b],605030)},200911,452264,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.s(["FadeText",0,function({text:e,className:o=""}){let[i,n]=(0,r.useState)(e),[a,s]=(0,r.useState)(!1),d=(0,r.useRef)(e);return(0,r.useEffect)(()=>{if(e===d.current)return;d.current=e,s(!0);let t=setTimeout(()=>{n(e),s(!1)},200);return()=>clearTimeout(t)},[e]),(0,t.jsx)("span",{className:`transition-opacity duration-200 ${a?"opacity-0":"opacity-100"} ${o}`,children:i})}],200911);var o=e.i(531278),i=e.i(647163);e.s(["RecipeImportPreviewImage",0,function({src:e,className:n,imageClassName:a,fallbackClassName:s,overlayClassName:d}){let[l,u]=(0,r.useState)(null),[c,p]=(0,r.useState)(!!e),[m,f]=(0,r.useState)(!1),[h,_]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(!e){u(null),p(!1),f(!1),_(0);return}p(e!==l),f(!1),_(0)},[e,l]);let g=!!e&&e!==l;(0,r.useEffect)(()=>{if(!e||!m||!g||h>=5)return;let t=window.setTimeout(()=>{f(!1),p(!0),_(e=>e+1)},1e3);return()=>window.clearTimeout(t)},[e,m,g,h]);let b=h>=5,y=g&&!m&&!b,x=!l&&!!e&&(c||m||b);return(0,t.jsxs)("div",{className:(0,i.cn)("relative overflow-hidden bg-foodie-brown/10",n),children:[l&&(0,t.jsx)("img",{src:l,alt:"",className:(0,i.cn)("absolute inset-0 h-full w-full object-cover",a)}),y&&(0,t.jsx)("img",{src:e??void 0,alt:"",className:"absolute inset-0 h-full w-full object-cover opacity-0",onLoad:()=>{u(e??null),p(!1)},onError:()=>{p(!1),f(!0)}},`${e}-${h}`),x&&(0,t.jsx)("div",{className:(0,i.cn)("absolute inset-0 flex items-center justify-center text-foodie-orange",s),children:(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin"})}),l&&d&&(0,t.jsx)("div",{className:(0,i.cn)("absolute inset-0",d)})]})}],452264)},290343,e=>{"use strict";var t=e.i(843476),r=e.i(271645),o=e.i(981140),i=e.i(30030),n=e.i(820783),a=e.i(991918),s=e.i(610772);e.i(174080);var d=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,o)=>{let i=r.forwardRef((e,r)=>{let{asChild:i,...n}=e,s=i?a.Slot:o;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(s,{...n,ref:r})});return i.displayName=`Primitive.${o}`,{...e,[o]:i}},{}),l=e.i(30207),u=e.i(369340),c=r.createContext(void 0);function p(e){let t=r.useContext(c);return e||t||"ltr"}var m="rovingFocusGroup.onEntryFocus",f={bubbles:!1,cancelable:!0},h="RovingFocusGroup",[_,g,b]=function(e){let o=e+"CollectionProvider",[s,d]=(0,i.createContextScope)(o),[l,u]=s(o,{collectionRef:{current:null},itemMap:new Map}),c=e=>{let{scope:o,children:i}=e,n=r.default.useRef(null),a=r.default.useRef(new Map).current;return(0,t.jsx)(l,{scope:o,itemMap:a,collectionRef:n,children:i})};c.displayName=o;let p=e+"CollectionSlot",m=r.default.forwardRef((e,r)=>{let{scope:o,children:i}=e,s=u(p,o),d=(0,n.useComposedRefs)(r,s.collectionRef);return(0,t.jsx)(a.Slot,{ref:d,children:i})});m.displayName=p;let f=e+"CollectionItemSlot",h="data-radix-collection-item",_=r.default.forwardRef((e,o)=>{let{scope:i,children:s,...d}=e,l=r.default.useRef(null),c=(0,n.useComposedRefs)(o,l),p=u(f,i);return r.default.useEffect(()=>(p.itemMap.set(l,{ref:l,...d}),()=>void p.itemMap.delete(l))),(0,t.jsx)(a.Slot,{...{[h]:""},ref:c,children:s})});return _.displayName=f,[{Provider:c,Slot:m,ItemSlot:_},function(t){let o=u(e+"CollectionConsumer",t);return r.default.useCallback(()=>{let e=o.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(o.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[o.collectionRef,o.itemMap])},d]}(h),[y,x]=(0,i.createContextScope)(h,[b]),[v,j]=y(h),w=r.forwardRef((e,r)=>(0,t.jsx)(_.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(_.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(E,{...e,ref:r})})}));w.displayName=h;var E=r.forwardRef((e,i)=>{let{__scopeRovingFocusGroup:a,orientation:s,loop:c=!1,dir:h,currentTabStopId:_,defaultCurrentTabStopId:b,onCurrentTabStopIdChange:y,onEntryFocus:x,preventScrollOnEntryFocus:j=!1,...w}
7=e,E=r.useRef(null),S=(0,n.useComposedRefs)(i,E),R=p(h),[k=null,q]=(0,u.useControllableState)({prop:_,defaultProp:b,onChange:y}),[C,I]=r.useState(!1),P=(0,l.useCallbackRef)(x),F=g(a),T=r.useRef(!1),[L,M]=r.useState(0);return r.useEffect(()=>{let e=E.current;if(e)return e.addEventListener(m,P),()=>e.removeEventListener(m,P)},[P]),(0,t.jsx)(v,{scope:a,orientation:s,dir:R,loop:c,currentTabStopId:k,onItemFocus:r.useCallback(e=>q(e),[q]),onItemShiftTab:r.useCallback(()=>I(!0),[]),onFocusableItemAdd:r.useCallback(()=>M(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>M(e=>e-1),[]),children:(0,t.jsx)(d.div,{tabIndex:C||0===L?-1:0,"data-orientation":s,...w,ref:S,style:{outline:"none",...e.style},onMouseDown:(0,o.composeEventHandlers)(e.onMouseDown,()=>{T.current=!0}),onFocus:(0,o.composeEventHandlers)(e.onFocus,e=>{let t=!T.current;if(e.target===e.currentTarget&&t&&!C){let t=new CustomEvent(m,f);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=F().filter(e=>e.focusable);N([e.find(e=>e.active),e.find(e=>e.id===k),...e].filter(Boolean).map(e=>e.ref.current),j)}}T.current=!1}),onBlur:(0,o.composeEventHandlers)(e.onBlur,()=>I(!1))})})}),S="RovingFocusGroupItem",R=r.forwardRef((e,i)=>{let{__scopeRovingFocusGroup:n,focusable:a=!0,active:l=!1,tabStopId:u,...c}=e,p=(0,s.useId)(),m=u||p,f=j(S,n),h=f.currentTabStopId===m,b=g(n),{onFocusableItemAdd:y,onFocusableItemRemove:x}=f;return r.useEffect(()=>{if(a)return y(),()=>x()},[a,y,x]),(0,t.jsx)(_.ItemSlot,{scope:n,id:m,focusable:a,active:l,children:(0,t.jsx)(d.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:i,onMouseDown:(0,o.composeEventHandlers)(e.onMouseDown,e=>{a?f.onItemFocus(m):e.preventDefault()}),onFocus:(0,o.composeEventHandlers)(e.onFocus,()=>f.onItemFocus(m)),onKeyDown:(0,o.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var o;let i=(o=e.key,"rtl"!==r?o:"ArrowLeft"===o?"ArrowRight":"ArrowRight"===o?"ArrowLeft":o);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return k[i]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,o;"prev"===t&&i.reverse();let n=i.indexOf(e.currentTarget);i=f.loop?(r=i,o=n+1,r.map((e,t)=>r[(o+t)%r.length])):i.slice(n+1)}setTimeout(()=>N(i))}})})})});R.displayName=S;var k={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function N(e,t=!1){let r=document.activeElement;for(let o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}var q=e.i(296626),C="Tabs",[I,P]=(0,i.createContextScope)(C,[x]),F=x(),[T,L]=I(C),M=r.forwardRef((e,r)=>{let{__scopeTabs:o,value:i,onValueChange:n,defaultValue:a,orientation:l="horizontal",dir:c,activationMode:m="automatic",...f}=e,h=p(c),[_,g]=(0,u.useControllableState)({prop:i,onChange:n,defaultProp:a});return(0,t.jsx)(T,{scope:o,baseId:(0,s.useId)(),value:_,onValueChange:g,orientation:l,dir:h,activationMode:m,children:(0,t.jsx)(d.div,{dir:h,"data-orientation":l,...f,ref:r})})});M.displayName=C;var $="TabsList",A=r.forwardRef((e,r)=>{let{__scopeTabs:o,loop:i=!0,...n}=e,a=L($,o),s=F(o);return(0,t.jsx)(w,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:i,children:(0,t.jsx)(d.div,{role:"tablist","aria-orientation":a.orientation,...n,ref:r})})});A.displayName=$;var O="TabsTrigger",D=r.forwardRef((e,r)=>{let{__scopeTabs:i,value:n,disabled:a=!1,...s}=e,l=L(O,i),u=F(i),c=B(l.baseId,n),p=H(l.baseId,n),m=n===l.value;return(0,t.jsx)(R,{asChild:!0,...u,focusable:!a,active:m,children:(0,t.jsx)(d.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":p,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...s,ref:r,onMouseDown:(0,o.composeEventHandlers)(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():l.onValueChange(n)}),onKeyDown:(0,o.composeEventHandlers)(e.onKeyDown,e=>
7{[" ","Enter"].includes(e.key)&&l.onValueChange(n)}),onFocus:(0,o.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==l.activationMode;m||a||!e||l.onValueChange(n)})})})});D.displayName=O;var U="TabsContent",W=r.forwardRef((e,o)=>{let{__scopeTabs:i,value:n,forceMount:a,children:s,...l}=e,u=L(U,i),c=B(u.baseId,n),p=H(u.baseId,n),m=n===u.value,f=r.useRef(m);return r.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(q.Presence,{present:a||m,children:({present:r})=>(0,t.jsx)(d.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":c,hidden:!r,id:p,tabIndex:0,...l,ref:o,style:{...e.style,animationDuration:f.current?"0s":void 0},children:r&&s})})});function B(e,t){return`${e}-trigger-${t}`}function H(e,t){return`${e}-content-${t}`}W.displayName=U;var V=e.i(647163);let K=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)(A,{ref:o,className:(0,V.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...r}));K.displayName=A.displayName;let z=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)(D,{ref:o,className:(0,V.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...r}));z.displayName=D.displayName;let G=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)(W,{ref:o,className:(0,V.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...r}));G.displayName=W.displayName,e.s(["Tabs",0,M,"TabsContent",0,G,"TabsList",0,K,"TabsTrigger",0,z],290343)},999663,e=>{e.v({assistantAdaptationContent:"prototype-module__jd9mEq__assistantAdaptationContent",assistantAdaptationEdit:"prototype-module__jd9mEq__assistantAdaptationEdit",assistantAdaptationEdits:"prototype-module__jd9mEq__assistantAdaptationEdits",assistantAdaptationLabel:"prototype-module__jd9mEq__assistantAdaptationLabel",assistantAdaptationLine:"prototype-module__jd9mEq__assistantAdaptationLine",assistantAdaptationSequence:"prototype-module__jd9mEq__assistantAdaptationSequence",assistantDeliveryCarrier:"prototype-module__jd9mEq__assistantDeliveryCarrier",assistantDeliveryMascot:"prototype-module__jd9mEq__assistantDeliveryMascot",assistantDeliveryPreference:"prototype-module__jd9mEq__assistantDeliveryPreference",assistantHanddrawnCircle:"prototype-module__jd9mEq__assistantHanddrawnCircle",assistantHandwrittenStrike:"prototype-module__jd9mEq__assistantHandwrittenStrike",assistantLactoseBubble:"prototype-module__jd9mEq__assistantLactoseBubble",assistantMascot:"prototype-module__jd9mEq__assistantMascot",assistantNutritionLine:"prototype-module__jd9mEq__assistantNutritionLine",assistantOnionBubble:"prototype-module__jd9mEq__assistantOnionBubble",assistantPickupBubble:"prototype-module__jd9mEq__assistantPickupBubble",assistantPickupCarrier:"prototype-module__jd9mEq__assistantPickupCarrier",assistantPreferenceBubble:"prototype-module__jd9mEq__assistantPreferenceBubble",assistantPreferenceBubbleText:"prototype-module__jd9mEq__assistantPreferenceBubbleText",assistantPreferenceFlow:"prototype-module__jd9mEq__assistantPreferenceFlow",assistantPreferenceMessage:"prototype-module__jd9mEq__assistantPreferenceMessage",assistantPreferenceSlot:"prototype-module__jd9mEq__assistantPreferenceSlot",assistantPreferenceSlotFinal:"prototype-module__jd9mEq__assistantPreferenceSlotFinal",assistantPreferences:"prototype-module__jd9mEq__assistantPreferences",assistantProofStage:"prototype-module__jd9mEq__assistantProofStage",assistantProteinBubble:"prototype-module__jd9mEq__assistantProteinBubble",assistantProteinPlaceholder:"prototype-module__jd9mEq__assistantProteinPlaceholder",assistantReceivedPreference:"prototype-module__jd9mEq__assistantReceivedPreference",assistantTransferredPlaceholder:"prototype-module__jd9mEq__assistantTransferredPlaceholder",assistantValueChange:"prototype-module__jd9mEq__assistantValueChange",assistantValueOriginal:"prototype-module__jd9mEq__assistantValueOriginal",assistantValueReplacement:"prototype-module__jd9mEq__assistantValueReplacement",capturedIngredient:"prototype-module__jd9mEq__capturedIngredient",capturedIngredientCompact:"prototype-module__jd9mEq__capturedIngredientCompact",closingActionButton:"prototype-module__jd9mEq__closingActionButton",closingCopy:"prototype-module__jd9mEq__closingCopy",closingSection:"prototype-module__jd9mEq__closingSection",closingWaveCanvas:"prototype-module__jd9mEq__closingWaveCanvas",closingWaveContent:"prototype-module__jd9mEq__closingWaveContent",cookIntroCopy:"prototype-module__jd9mEq__cookIntroCopy",cookIntroGrid:"prototype-module__jd9mEq__cookIntroGrid",cookMobileLine:"prototype-module__jd9mEq__cookMobileLine",cookSection:"prototype-module__jd9mEq__cookSection",cookSectionInner:"prototype-module__jd9mEq__cookSectionInner",featurePair:"prototype-module__jd9mEq__featurePair",featureSection:"prototype-module__jd9mEq__featureSection",featureSectionIngredient:"prototype-module__jd9mEq__featureSectionIngredient",flourParenthesis:"prototype-module__jd9mEq__flourParenthesis",handsFreeFoodie:"prototype-module__jd9mEq__handsFreeFoodie",handsFreeFoodieMask:"prototype-module__jd9mEq__handsFreeFoodieMask",handsFreeFoodieReveal:"prototype-module__jd9mEq__handsFreeFoodieReveal",handsFreeHeroFrame:"prototype-module__jd9mEq__handsFreeHeroFrame",handsFreeIllustration:"prototype-module__jd9mEq__handsFreeIllustration",handsFreeMeasurement:"prototype-module__jd9mEq__handsFreeMeasurement",handsFreePhone:"prototype-module__jd9mEq__handsFreePhone",handsFreeProof:"prototype-module__jd9mEq__handsFreeProof",handsFreeScreen:"prototype-module__jd9mEq__handsFreeScreen",handsFreeStage:"prototype-module__jd9mEq__handsFreeStage",handsFreeVoicePill:"prototype-module__jd9mEq__handsFreeVoicePill",handsFreeVoiceWave:"prototype-module__jd9mEq__handsFreeVoiceWave","hero-save-highlight":"prototype-module__jd9mEq__hero-save-highlight","hero-understanding-cursor":"prototype-module__jd9mEq__hero-understanding-cursor","hero-understanding-shimmer"
7:"prototype-module__jd9mEq__hero-understanding-shimmer",heroActionGroup:"prototype-module__jd9mEq__heroActionGroup",heroCanvas:"prototype-module__jd9mEq__heroCanvas",heroFoodieCrop:"prototype-module__jd9mEq__heroFoodieCrop",heroFoodieFrame:"prototype-module__jd9mEq__heroFoodieFrame",heroFoodieStack:"prototype-module__jd9mEq__heroFoodieStack",heroHeading:"prototype-module__jd9mEq__heroHeading",heroIntroCopy:"prototype-module__jd9mEq__heroIntroCopy",heroIntroLayout:"prototype-module__jd9mEq__heroIntroLayout",heroIntroSection:"prototype-module__jd9mEq__heroIntroSection",heroPhoneToTable:"prototype-module__jd9mEq__heroPhoneToTable",heroPromiseHeading:"prototype-module__jd9mEq__heroPromiseHeading",heroSaveBookmark:"prototype-module__jd9mEq__heroSaveBookmark",heroSaveHighlight:"prototype-module__jd9mEq__heroSaveHighlight",heroSaveHighlightStroke:"prototype-module__jd9mEq__heroSaveHighlightStroke",heroSavePhrase:"prototype-module__jd9mEq__heroSavePhrase",heroStage:"prototype-module__jd9mEq__heroStage",heroSubtitle:"prototype-module__jd9mEq__heroSubtitle",heroUnderstandingCursor:"prototype-module__jd9mEq__heroUnderstandingCursor",heroUnderstandingMeasure:"prototype-module__jd9mEq__heroUnderstandingMeasure",heroUnderstandingPixel:"prototype-module__jd9mEq__heroUnderstandingPixel",heroUnderstandingShimmer:"prototype-module__jd9mEq__heroUnderstandingShimmer",heroUnderstandingShimmerText:"prototype-module__jd9mEq__heroUnderstandingShimmerText",heroUnderstandingThinkingSlot:"prototype-module__jd9mEq__heroUnderstandingThinkingSlot",heroUnderstandingTypedText:"prototype-module__jd9mEq__heroUnderstandingTypedText",heroUnderstandingWord:"prototype-module__jd9mEq__heroUnderstandingWord","ingredient-lab-flow":"prototype-module__jd9mEq__ingredient-lab-flow","ingredient-search-cursor":"prototype-module__jd9mEq__ingredient-search-cursor",ingredientLab:"prototype-module__jd9mEq__ingredientLab",ingredientLabArtwork:"prototype-module__jd9mEq__ingredientLabArtwork",ingredientLabGrid:"prototype-module__jd9mEq__ingredientLabGrid",ingredientLabRailArtwork:"prototype-module__jd9mEq__ingredientLabRailArtwork",ingredientLabRailSection:"prototype-module__jd9mEq__ingredientLabRailSection",ingredientLabRailTrack:"prototype-module__jd9mEq__ingredientLabRailTrack",ingredientLabRailTrackPaused:"prototype-module__jd9mEq__ingredientLabRailTrackPaused",ingredientLabRailViewport:"prototype-module__jd9mEq__ingredientLabRailViewport",ingredientLabSizeRow:"prototype-module__jd9mEq__ingredientLabSizeRow",ingredientLabSizeSample:"prototype-module__jd9mEq__ingredientLabSizeSample",ingredientLabSubject:"prototype-module__jd9mEq__ingredientLabSubject",ingredientLabSubjectList:"prototype-module__jd9mEq__ingredientLabSubjectList",ingredientLabSwitcher:"prototype-module__jd9mEq__ingredientLabSwitcher",ingredientLabSwitcherDivider:"prototype-module__jd9mEq__ingredientLabSwitcherDivider",ingredientLabSwitcherLink:"prototype-module__jd9mEq__ingredientLabSwitcherLink",ingredientLabSwitcherLinkActive:"prototype-module__jd9mEq__ingredientLabSwitcherLinkActive",ingredientLabVariant:"prototype-module__jd9mEq__ingredientLabVariant",ingredientLabVariantHeading:"prototype-module__jd9mEq__ingredientLabVariantHeading",ingredientLabVariantNumber:"prototype-module__jd9mEq__ingredientLabVariantNumber",ingredientProofCard:"prototype-module__jd9mEq__ingredientProofCard",ingredientProofGridCompact:"prototype-module__jd9mEq__ingredientProofGridCompact",ingredientRecipeCard:"prototype-module__jd9mEq__ingredientRecipeCard",ingredientRecipeGrid:"prototype-module__jd9mEq__ingredientRecipeGrid",ingredientRecipeRules:"prototype-module__jd9mEq__ingredientRecipeRules",ingredientRecipeSourceIcon:"prototype-module__jd9mEq__ingredientRecipeSourceIcon",ingredientRecipeWording:"prototype-module__jd9mEq__ingredientRecipeWording",ingredientRecognitionIndicator:"prototype-module__jd9mEq__ingredientRecognitionIndicator",ingredientRecognitionInput:"prototype-module__jd9mEq__ingredientRecognitionInput",ingredientRecognitionPaper:"prototype-module__jd9mEq__ingredientRecognitionPaper",ingredientRecognitionProof:"prototype-module__jd9mEq__ingredientRecognitionProof",ingredientRecognitionStep:"prototype-module__jd9mEq__ingredientRecognitionStep",ingredientRecognitionSteps:"prototype-module__jd9mEq__ingredientRecognitionSteps",ingredientResultsCountCompact:"prototype-module__jd9mEq__ingredientResultsCountCompact",ingredientResultsCountExpanded:"prototype-module__jd9mEq__ingredientResultsCountExpanded",ingredientSearchCursor:"prototype-module__jd9mEq__ingredientSearchCursor",inputRailViewport:"prototype-module__jd9mEq__inputRailViewport",islandEquals:"prototype-module__jd9mEq__islandEquals",
7islandIndicatorSlot:"prototype-module__jd9mEq__islandIndicatorSlot",islandSquiggleArrow:"prototype-module__jd9mEq__islandSquiggleArrow",islandSquiggleStroke:"prototype-module__jd9mEq__islandSquiggleStroke",islandText:"prototype-module__jd9mEq__islandText",measureGroup:"prototype-module__jd9mEq__measureGroup",measureParen:"prototype-module__jd9mEq__measureParen",measureParenLeft:"prototype-module__jd9mEq__measureParenLeft",measureParenRight:"prototype-module__jd9mEq__measureParenRight",measureResult:"prototype-module__jd9mEq__measureResult",measureSlot:"prototype-module__jd9mEq__measureSlot","output-ingredient-pop":"prototype-module__jd9mEq__output-ingredient-pop","output-ingredient-spin":"prototype-module__jd9mEq__output-ingredient-spin","output-ingredient-travel":"prototype-module__jd9mEq__output-ingredient-travel",outputIngredientImage:"prototype-module__jd9mEq__outputIngredientImage",outputIngredientPop:"prototype-module__jd9mEq__outputIngredientPop",outputIngredientSlot:"prototype-module__jd9mEq__outputIngredientSlot",outputIngredientTilt:"prototype-module__jd9mEq__outputIngredientTilt",outputIngredientTrack:"prototype-module__jd9mEq__outputIngredientTrack",outputIngredientTrackPaused:"prototype-module__jd9mEq__outputIngredientTrackPaused",outputIngredientTravel:"prototype-module__jd9mEq__outputIngredientTravel",outputRailViewport:"prototype-module__jd9mEq__outputRailViewport",phoneGlow:"prototype-module__jd9mEq__phoneGlow",proofStage:"prototype-module__jd9mEq__proofStage",proofStageCompact:"prototype-module__jd9mEq__proofStageCompact",prototypeRoot:"prototype-module__jd9mEq__prototypeRoot",reducedMotion:"prototype-module__jd9mEq__reducedMotion",rigatoniSizing:"prototype-module__jd9mEq__rigatoniSizing","source-icon-absorb":"prototype-module__jd9mEq__source-icon-absorb",sourceIconFacebook:"prototype-module__jd9mEq__sourceIconFacebook",sourceIconInstagram:"prototype-module__jd9mEq__sourceIconInstagram",sourceIconNotes:"prototype-module__jd9mEq__sourceIconNotes",sourceIconPhotos:"prototype-module__jd9mEq__sourceIconPhotos",sourceIconTikTok:"prototype-module__jd9mEq__sourceIconTikTok",sourceIconTile:"prototype-module__jd9mEq__sourceIconTile",sourceIconYoutube:"prototype-module__jd9mEq__sourceIconYoutube",sourceRibbonAnimated:"prototype-module__jd9mEq__sourceRibbonAnimated",sourceRibbonStatic:"prototype-module__jd9mEq__sourceRibbonStatic",sourceRibbonSvg:"prototype-module__jd9mEq__sourceRibbonSvg",sourceRibbonText:"prototype-module__jd9mEq__sourceRibbonText",sourceWaveBackground:"prototype-module__jd9mEq__sourceWaveBackground",sourceWaveBackgroundMobile:"prototype-module__jd9mEq__sourceWaveBackgroundMobile",sourceWaveBackgroundStandard:"prototype-module__jd9mEq__sourceWaveBackgroundStandard",sourceWaveBackgroundUltrawide:"prototype-module__jd9mEq__sourceWaveBackgroundUltrawide",sourceWaveBand:"prototype-module__jd9mEq__sourceWaveBand",sourceWaveCanvas:"prototype-module__jd9mEq__sourceWaveCanvas",sourceWaveHeadingWrap:"prototype-module__jd9mEq__sourceWaveHeadingWrap",sourceWaveItem:"prototype-module__jd9mEq__sourceWaveItem",sourceWaveList:"prototype-module__jd9mEq__sourceWaveList",sourceWavePhoneAspectCorrection:"prototype-module__jd9mEq__sourceWavePhoneAspectCorrection",sourceWavePhoneGeometryCorrection:"prototype-module__jd9mEq__sourceWavePhoneGeometryCorrection",sourceWavePhoneLayer:"prototype-module__jd9mEq__sourceWavePhoneLayer",sourceWavePhoneMotion:"prototype-module__jd9mEq__sourceWavePhoneMotion",sourceWavePhoneTitle:"prototype-module__jd9mEq__sourceWavePhoneTitle",sourceWaveRecipeCard:"prototype-module__jd9mEq__sourceWaveRecipeCard",sourceWaveRibbon:"prototype-module__jd9mEq__sourceWaveRibbon",sourceWaveRibbonBurgundy:"prototype-module__jd9mEq__sourceWaveRibbonBurgundy",sourceWaveRibbonOrange:"prototype-module__jd9mEq__sourceWaveRibbonOrange",sourceWaveSection:"prototype-module__jd9mEq__sourceWaveSection",sourceWaveSourceMotion:"prototype-module__jd9mEq__sourceWaveSourceMotion",staggeredSubfeature:"prototype-module__jd9mEq__staggeredSubfeature",staggeredSubfeatureCopy:"prototype-module__jd9mEq__staggeredSubfeatureCopy",staggeredSubfeatureGrid:"prototype-module__jd9mEq__staggeredSubfeatureGrid",staggeredSubfeatureStepFour:"prototype-module__jd9mEq__staggeredSubfeatureStepFour",staggeredSubfeatureStepOne:"prototype-module__jd9mEq__staggeredSubfeatureStepOne",staggeredSubfeatureStepThree:"prototype-module__jd9mEq__staggeredSubfeatureStepThree",staggeredSubfeatureStepTwo:"prototype-module__jd9mEq__staggeredSubfeatureStepTwo",staggeredSubfeatureVisual:"prototype-module__jd9mEq__staggeredSubfeatureVisual",thoughtIsland:"prototype-module__jd9mEq__thoughtIsland",thoughtMeasure:"prototype-module__jd9mEq__thoughtMeasure",thoughtSequence:"prototype-module__jd9mEq__thoughtSequence",thoughtStack:"prototype-module__jd9mEq__thoughtStack",understandingSection:"prototype-module__jd9mEq__understandingSection","voice-wave":"prototype-module__jd9mEq__voice-wave",voiceBar:"prototype-module__jd9mEq__voiceBar"})},853010,e=>{"use strict";var t=e.i(271645);function r(){return!1}function o(e){let o=(0,t.useCallback)(t=>{let r=window.matchMedia(e);return"function"==typeof r.addEventListener?(r.addEventListener("change",t),()=>r.removeEventListener("change",t)):(r.addListener(t),()=>r.removeListener(t))},[e]),i=(0,t.useCallback)(()=>window.matchMedia(e).matches,[e]);return(0,t.useSyncExternalStore)(o,i,r)}e.s(["useIsMobile",0,function(){return o("(max-width: 767px)")},"useMediaQueryMatch",0,o])},531278,e=>{"use strict";let t=(0,e.i(475254).default)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],531278)},954616,e=>{"use strict";var t=e.i(271645),r=e.i(114272),o=e.i(540143),i=e.i(915823),n=e.i(619273),a=class extends i.Subscribable{#e;#t=void 0;#r;#o;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,n.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,n.hashKey)(t.mutationKey)!==(0,n.hashKey)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#n(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#i(),this.#n()}mutate(e,t){return this.#o=t,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#i(){let e=this.#r?.state??(0,r.getDefaultState)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#n(e){o.notifyManager.batch(()=>
7{if(this.#o&&this.hasListeners()){let t=this.#t.variables,r=this.#t.context;e?.type==="success"?(this.#o.onSuccess?.(e.data,t,r),this.#o.onSettled?.(e.data,null,t,r)):e?.type==="error"&&(this.#o.onError?.(e.error,t,r),this.#o.onSettled?.(void 0,e.error,t,r))}this.listeners.forEach(e=>{e(this.#t)})})}},s=e.i(912598),d=e.i(811076);e.s(["useMutation",0,function(e,r){let i=(0,s.useQueryClient)(r),[n]=t.useState(()=>new a(i,e));t.useEffect(()=>{n.setOptions(e)},[n,e]);let l=t.useSyncExternalStore(t.useCallback(e=>n.subscribe(o.notifyManager.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),u=t.useCallback((e,t)=>{n.mutate(e,t).catch(d.noop)},[n]);if(l.error&&(0,d.shouldThrowError)(n.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}],954616)},215652,631315,e=>{"use strict";var t=e.i(843476),r=e.i(271645),o=e.i(853010);function i(e,t,r){let o=document.getElementById(t);e?o||((o=document.createElement("div")).id=t,o.style.cssText=`position:absolute;left:0;top:0;right:0;bottom:0;z-index:45;pointer-events:none;background:${r}`,document.body.appendChild(o)):o?.remove()}function n({sheetRef:e,enabled:t,washId:o,washColor:a}){(0,r.useEffect)(()=>{if(!t)return;let r=window.visualViewport;if(!r)return;let n=()=>{let t=e.current;if(!t)return;let{height:o,paddingBottom:i}=function({innerHeight:e,viewportHeight:t,offsetTop:r}){let o=e-t;if(o<=60)return{height:"",paddingBottom:""};let i=Math.min(Math.max(r,0),o);return{height:`${e-i}px`,paddingBottom:`${o-i}px`}}({innerHeight:window.innerHeight,viewportHeight:r.height,offsetTop:r.offsetTop});t.style.height=o,t.style.maxHeight=o,t.style.paddingBottom=i};return n(),i(!0,o,a),r.addEventListener("resize",n),r.addEventListener("scroll",n),()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n),i(!1,o,a);let t=e.current;t&&(t.style.height="",t.style.maxHeight="",t.style.paddingBottom="")}},[t,e,o,a])}e.s(["useMobileSheetKeyboardSync",0,n],631315);var a=e.i(552105),s=e.i(991279);e.s(["default",0,function({open:e,onOpenChange:i,title:d,children:l,footer:u,mobileOverlayClassName:c}){let p=(0,o.useMediaQueryMatch)("(min-width: 768px)"),m=r.default.useRef(null);return(n({sheetRef:m,enabled:e&&!p,washId:"responsive-dialog-page-wash",washColor:"rgba(255,255,255,0.92)"}),p)?(0,t.jsx)(a.Dialog,{open:e,onOpenChange:i,children:(0,t.jsxs)(a.DialogContent,{children:[(0,t.jsx)(a.DialogHeader,{children:(0,t.jsx)(a.DialogTitle,{children:d})}),l,u&&(0,t.jsx)(a.DialogFooter,{children:u})]})}):(0,t.jsx)(s.Drawer,{open:e,onOpenChange:i,repositionInputs:!1,children:(0,t.jsxs)(s.DrawerContent,{ref:m,overlayClassName:c,className:"focus:outline-none focus-visible:outline-none",onOpenAutoFocus:e=>e.preventDefault(),children:[(0,t.jsx)(s.DrawerHeader,{children:(0,t.jsx)(s.DrawerTitle,{children:d})}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pb-10",children:l}),u&&(0,t.jsx)(s.DrawerFooter,{className:"px-4",children:u})]})})}],215652)},612891,e=>{"use strict";var t=e.i(843476),r=e.i(271645),o=e.i(618566),i=e.i(531278),n=e.i(846696),a=e.i(954616),s=e.i(912598),d=e.i(195399),l=e.i(868127);let u="108, 63, 24",c="#1E88F5";function p({size:e}){return(0,t.jsx)("svg",{width:e,height:e,viewBox:"0 0 13 20","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8.2 20V12.1H11.1L11.6 8.6H8.2V6.4C8.2 4.9 9 4 10.5 4H12.7V0.2C11.7 0.1 10.6 0 9.4 0C5.7 0 3.8 2.3 3.8 5.9V8.6H0.7V12.1H3.8V20Z",fill:"#FFFFFF"})})}function m({size:e}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"-1.06 -1.06 2.12 2.12","aria-hidden":"true",children:[(0,t.jsx)("circle",{r:"1",fill:c}),(0,t.jsx)("polygon",{points:"-0.66,0 0,-0.23 0.66,0 0,0.23",transform:"rotate(-45)",fill:"#FFFFFF",stroke:"#FFFFFF",strokeWidth:"0.06",strokeLinejoin:"round"}),(0,t.jsx)("circle",{r:"0.11",fill:c})]})}let f={tiktok:"#111111",instagram:null,facebook:"#1877F2",youtube:"#FF0033",safari:"#FFFFFF"};function h({mark:e,size:r=48,style:o}){let i=r/44,n=10*r/44,a=r-2*("safari"===e?.6*n:n),s=[`0 ${6.4*i}px ${12.8*i}px rgba(${u}, 0.14)`,`0 ${1.6*i}px ${3.2*i}px rgba(${u}, 0.1)`];return"instagram"!==e&&s.unshift(`inset 0 0 0 1px rgba(${u}, 0.12)`),(0,t.jsx)("div",{"aria-hidden":"true","data-source-mark":e,className:"flex shrink-0 items-center justify-center overflow-hidden",style:{width:r,height:r,borderRadius:.22*r,background:f[e]??`radial-gradient(circle ${.72*r}px at 68% 68%, #FFDC80 0%, #FFDC80 15%, rgba(255, 220, 128, 0) 36%), radial-gradient(circle ${1.17*r}px at 28% 92%, #F77737 0%, #F77737 28%, rgba(247, 119, 55, 0) 55%), linear-gradient(135deg, #833AB4 8%, #C13584 45%, #FD1D1D 72%, #FCB045 100%)`,boxShadow:s.join(", "),...o},children:function(e,r){switch(e){case"tiktok":return(0,t.jsx)(l.SiTiktok,{size:r,color:"#FFFFFF"});case"instagram":return(0,t.jsx)(l.SiInstagram,{size:r,color:"#FFFFFF"});case"youtube":return(0,t.jsx)(l.SiYoutube,{size:r,color:"#FFFFFF"});case"facebook":return(0,t.jsx)(p,{size:r});case"safari":return(0,t.jsx)(m,{size:r})}}(e,a)})}let _=[{mark:"tiktok",rotation:-6,yOffset:4},{mark:"instagram",rotation:4,yOffset:-3},{mark:"facebook",rotation:-3,yOffset:3},{mark:"youtube",rotation:5,yOffset:-4},{mark:"safari",rotation:-4,yOffset:2}];function g(){return(0,t.jsx)("div",{role:"img","aria-label":"TikTok, Instagram, Facebook, YouTube, and Safari",className:"flex items-center justify-center gap-[14px] py-3",children:_.map(({mark:e,rotation:r,yOffset:o})=>(0,t.jsx)(h,{mark:e,size:48,style:{transform:`translateY(${o}px) rotate(${r}deg)`}},e))})}var b=e.i(278669);e.s(["default",0,function({onClose:e,onNavigate:l,onProcessingStart:u,initialURL:c}){let p,m=(0,o.useRouter)(),[f,h]=(0,r.useState)(c??""),_=(p=(0,s.useQueryClient)(),(0,a.useMutation)({mutationFn:async e=>{let t=await fetch("/api/user-recipes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),r=await t.json();if(!t.ok){let e=Error(r.error||"Failed to import recipe");throw e.data=r,e.status=t.status,e}return r},onSuccess:()=>{p.invalidateQueries({queryKey:["user-recipes"]}),p.invalidateQueries({queryKey:d.ACTIVE_RECIPE_IMPORT_QUERY_KEY})}}));(0,r.useEffect)(()=>{c&&h(c)},[c]);let y=f.trim(),x=function(e){try{let t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}}(y),v=y.length>0&&!x,j=async()=>{let e;try{e=await navigator.clipboard.readText()}catch(e){console.error("Clipboard read failed:",e),(0,b.track)("Recipe Import URL Pasted",{source_type:"url",result:"blocked"}),n.toast.error("Couldn't read your clipboard",{description:"Paste the recipe URL into the field instead."});return}let t=e.trim().split(/\r?\n/)[0].trim();((0,b.track)("Recipe Import URL Pasted",{source_type:"url",result:t?"filled":"empty"}),t)?h(t):n.toast.error("Nothing to paste",{description:"Copy a recipe link first, then try again."})},w=async()=>
7{if(x)try{let t=await _.mutateAsync({source_type:"url",source_url:y});(0,b.track)("Recipe Import Started",{source_type:"url",recipe_id:t.recipe.id,source_url_domain:new URL(y).hostname}),e(),t.processing&&u?u(t.recipe.id,t.workflow_run_id,t.preview??null):(l??m.push)(t.redirect_to)}catch(r){let t=r?.data;if(r?.status===409&&t?.existing_recipe_id){let r=["pending","processing","failed"].includes(t.existing_status)?"processing":"edit";e(),(l??m.push)(`/my-recipes/${r}/${t.existing_recipe_id}`);return}if(t?.code&&["BLOCKED","TOO_LARGE","NO_RECIPE"].includes(t.code))return void n.toast.error(r.message,{description:"Try copying the recipe text and using the Text tab instead."});n.toast.error(r instanceof Error?r.message:"Failed to import recipe")}};return(0,t.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,t.jsxs)("div",{className:"space-y-4 pb-4",children:[(0,t.jsx)(g,{}),(0,t.jsx)("p",{className:"text-foodie-brown/70 text-sm text-center",children:"Paste a recipe URL and we'll import it for you. Supports TikTok, Instagram, YouTube, Facebook, and any website with a recipe."}),(0,t.jsx)("input",{type:"url",value:f,onChange:e=>h(e.target.value),placeholder:"https://example.com/recipe",disabled:_.isPending,className:"w-full rounded-lg border border-foodie-brown/15 bg-foodie-brown/[0.03] px-4 py-3 text-base sm:text-sm text-foodie-brown placeholder:text-foodie-brown/30 focus:outline-none focus:ring-0 focus:border-transparent transition-colors disabled:opacity-50"}),(0,t.jsx)("p",{"aria-live":"polite",className:"min-h-4 text-xs text-foodie-brown/40",children:v?"Please enter a valid URL starting with http:// or https://":""})]}),(0,t.jsx)("button",{onClick:w,disabled:!x||_.isPending,className:"w-full px-6 py-3 mt-auto bg-foodie-orange text-white rounded-md font-semibold hover:bg-foodie-orange/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:_.isPending?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Loader2,{className:"w-4 h-4 animate-spin"}),"Importing recipe..."]}):"Import Recipe"}),(0,t.jsx)("button",{type:"button",onClick:j,disabled:_.isPending,className:"w-full min-h-11 mt-2 text-sm font-semibold text-foodie-orange hover:text-foodie-dark-orange transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Paste from Clipboard"})]})}],612891)},78333,(e,t,r)=>{var o=0/0,i=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,d=parseInt,l=e.g&&e.g.Object===Object&&e.g,u="object"==typeof self&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),p=Object.prototype.toString,m=Math.max,f=Math.min,h=function(){return c.Date.now()};function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==p.call(t))return o;if(_(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=_(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var l=a.test(e);return l||s.test(e)?d(e.slice(2),l?2:8):n.test(e)?o:+e}t.exports=function(e,t,r){var o,i,n,a,s,d,l=0,u=!1,c=!1,p=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var r=o,n=i;return o=i=void 0,l=t,a=e.apply(n,r)}function y(e){var r=e-d,o=e-l;return void 0===d||r>=t||r<0||c&&o>=n}function x(){var e,r,o,i=h();if(y(i))return v(i);s=setTimeout(x,(e=i-d,r=i-l,o=t-e,c?f(o,n-r):o))}function v(e){return(s=void 0,p&&o)?b(e):(o=i=void 0,a)}function j(){var e,r=h(),n=y(r);if(o=arguments,i=this,d=r,n){if(void 0===s)return l=e=d,s=setTimeout(x,t),u?b(e):a;if(c)return s=setTimeout(x,t),b(d)}return void 0===s&&(s=setTimeout(x,t)),a}return t=g(t)||0,_(r)&&(u=!!r.leading,n=(c="maxWait"in r)?m(g(r.maxWait)||0,t):n,p="trailing"in r?!!r.trailing:p),j.cancel=function(){void 0!==s&&clearTimeout(s),l=0,o=d=i=s=void 0},j.flush=function(){return void 0===s?a:v(h())},j}},296626,e=>{"use strict";var t=e.i(271645),r=e.i(174080),o=e.i(820783),i=e.i(934620),n=e=>{var n;let s,d,{present:l,children:u}=e,c=function(e){var o,n;let[s,d]=t.useState(),l=t.useRef({}),u=t.useRef(e),c=t.useRef("none"),[p,m]=(o=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},t.useReducer((e,t)=>
7n[e][t]??e,o));return t.useEffect(()=>{let e=a(l.current);c.current="mounted"===p?e:"none"},[p]),(0,i.useLayoutEffect)(()=>{let t=l.current,r=u.current;if(r!==e){let o=c.current,i=a(t);e?m("MOUNT"):"none"===i||t?.display==="none"?m("UNMOUNT"):r&&o!==i?m("ANIMATION_OUT"):m("UNMOUNT"),u.current=e}},[e,m]),(0,i.useLayoutEffect)(()=>{if(s){let e=e=>{let t=a(l.current).includes(e.animationName);e.target===s&&t&&r.flushSync(()=>m("ANIMATION_END"))},t=e=>{e.target===s&&(c.current=a(l.current))};return s.addEventListener("animationstart",t),s.addEventListener("animationcancel",e),s.addEventListener("animationend",e),()=>{s.removeEventListener("animationstart",t),s.removeEventListener("animationcancel",e),s.removeEventListener("animationend",e)}}m("ANIMATION_END")},[s,m]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:t.useCallback(e=>{e&&(l.current=getComputedStyle(e)),d(e)},[])}}(l),p="function"==typeof u?u({present:c.isPresent}):t.Children.only(u),m=(0,o.useComposedRefs)(c.ref,(n=p,(d=(s=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?n.ref:(d=(s=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?n.props.ref:n.props.ref||n.ref));return"function"==typeof u||c.isPresent?t.cloneElement(p,{ref:m}):null};function a(e){return e?.animationName||"none"}n.displayName="Presence",e.s(["Presence",0,n])},431343,e=>{"use strict";let t=(0,e.i(475254).default)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);e.s(["Play",0,t],431343)},859682,e=>{"use strict";var t=e.i(843476);e.s(["default",0,({minutes:e})=>(0,t.jsx)("span",{children:(e=>{if(e<60)return`${e} min`;{let t=Math.floor(e/60),r=e%60;return`${t} hr${t>1?"s":""}${r>0?` ${r} min`:""}`}})(e)})])},706482,e=>{"use strict";var t=e.i(843476),r=e.i(271645),o=(e,t,r,o,i,n,a,s)=>{let d=document.documentElement,l=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,o=r&&n?i.map(e=>n[e]||e):i;r?(d.classList.remove(...o),d.classList.add(n&&n[t]?n[t]:t)):d.setAttribute(e,t)}),r=t,s&&l.includes(r)&&(d.style.colorScheme=r)}if(o)u(o);else try{let e=localStorage.getItem(t)||r,o=a&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(o)}catch(e){}},i=r.createContext(void 0),n={setTheme:e=>{},themes:[]};r.memo(({forcedTheme:e,storageKey:t,attribute:i,enableSystem:n,enableColorScheme:a,defaultTheme:s,value:d,themes:l,nonce:u,scriptProps:c})=>{let p=JSON.stringify([i,t,s,e,l,d,n,a]).slice(1,-1);return r.createElement("script",{...c,suppressHydrationWarning:!0,nonce:"u"<typeof window?u:"",dangerouslySetInnerHTML:{__html:`(${o.toString()})(${p})`}})});var a=e.i(846696);let s={"--normal-bg":"#ffffff","--normal-text":"#6c3f18","--normal-border":"rgba(108, 63, 24, 0.18)","--success-bg":"#ffffff","--success-text":"#6c3f18","--success-border":"rgba(234, 96, 47, 0.32)","--error-bg":"#ffffff","--error-text":"#6c3f18","--error-border":"rgba(220, 38, 38, 0.32)"};e.s(["Toaster",0,({...e})=>{var o;let{theme:d="system"}=null!=(o=r.useContext(i))?o:n,{richColors:l,toastOptions:u,style:c,...p}=e;return(0,t.jsx)(a.Toaster,{theme:d,className:"toaster group",style:{...s,...c},toastOptions:{classNames:{icon:"[&_svg]:fill-foodie-orange [&_svg]:text-foodie-orange data-[type=error]:[&_svg]:fill-red-600 data-[type=error]:[&_svg]:text-red-600",description:"text-foodie-brown/70",actionButton:"!bg-foodie-orange !text-white hover:!bg-foodie-orange/90",cancelButton:"!bg-foodie-light-brown !text-foodie-brown hover:!bg-foodie-light-brown/90"},...u},...p})}],706482)},166385,e=>{"use strict";var t=e.i(266027),r=e.i(151288),o=e.i(656135);let i=e=>["user-lists",e];e.s(["useUserLists",0,function(e){return(0,t.useQuery)({queryKey:i(e),enabled:!!e,queryFn:async()=>{let t=(0,r.createClient)(),{data:i,error:n}=await t.from("lists").select("id, name, created_at, list_recipes(recipe_id)").eq("user_id",e).order("created_at");if(n)throw console.error("Error fetching user lists:",n),(0,o.captureError)(n,{flow:"lists",surface:"client",operation:"useUserLists",userId:e}),n;return i.map(e=>({id:String(e.id),name:e.name,recipeIds:e.list_recipes.map(e=>e.recipe_id)}))}})},"userListsQueryKey",0,i])},331261,e=>{"use strict";var t=e.i(843476),r=e.i(225913),o=e.i(647163);let i=(0,r.cva)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r,...n}){return(0,t.jsx)("div",{className:(0,o.cn)(i({variant:r}),e),...n})}])},166489,e=>{"use strict";var t=e.i(843476),r=e.i(271645),o=e.i(647163);let i=r.forwardRef(({className:e,type:r,...i},n)=>(0,t.jsx)("input",{type:r,className:(0,o.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
7ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...i}));i.displayName="Input",e.s(["Input",0,i])},453842,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.i(174080);var o=e.i(991918),i=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,i)=>{let n=r.forwardRef((e,r)=>{let{asChild:n,...a}=e,s=n?o.Slot:i;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(s,{...a,ref:r})});return n.displayName=`Primitive.${i}`,{...e,[i]:n}},{}),n=r.forwardRef((e,r)=>(0,t.jsx)(i.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));n.displayName="Label";var a=e.i(225913),s=e.i(647163);let d=(0,a.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),l=r.forwardRef(({className:e,...r},o)=>(0,t.jsx)(n,{ref:o,className:(0,s.cn)(d(),e),...r}));l.displayName=n.displayName,e.s(["Label",0,l],453842)},221345,e=>{"use strict";let t=(0,e.i(475254).default)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);e.s(["Link",0,t],221345)},729607,571930,626761,e=>{"use strict";var t=e.i(843476),r=e.i(123560),o=e.i(522016),i=e.i(859682),n=e.i(511152),a=e.i(563181),s=e.i(991279),d=e.i(911321),l=e.i(453842),u=e.i(271645),c=e.i(814489),p=e.i(151288),m=e.i(818344),f=e.i(912598),h=e.i(166385),_=e.i(166489),g=e.i(706482),b=e.i(846696),y=e.i(278669),x=e.i(475254);let v=(0,x.default)("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);e.s(["Bookmark",0,v],571930);let j=(0,x.default)("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"}]]);var w=e.i(662434),E=e.i(552105);let S=e=>{var r,o;let i=(0,p.createClient)(),{foodieUser:n}=(0,m.useFoodieUser)(),[x,S]=(0,u.useState)(""),[R,k]=(0,u.useState)((r=e.lists||[],o=e.recipeId,r?r.map(e=>({id:e.id,name:e.name,isIncluded:e.recipes?.some(e=>e.id===o)||!1})):[])),[N,q]=(0,u.useState)(!1),[C,I]=(0,u.useState)(!1),[P,F]=(0,u.useState)(!1),[T,L]=(0,u.useState)(!1),M=n?.authUser?.id,$=(0,f.useQueryClient)(),{data:A}=(0,h.useUserLists)(e.lists?void 0:M);(0,u.useEffect)(()=>{A&&k(A.map(t=>({id:t.id,name:t.name,isIncluded:t.recipeIds.includes(e.recipeId)})))},[A,e.recipeId]);let O=()=>$.invalidateQueries({queryKey:(0,h.userListsQueryKey)(M)}),D=async()=>{if((0,y.track)("Create Saved Recipes"),0===R.length)try{let t=n?.authUser;if(t){let r=await (0,c.createList)(i,t.id,{name:"Saved Recipes"});k(e=>[...e,{id:r.id,name:r.name,isIncluded:!1}]),await (0,c.addRecipeToList)(i,r.id,e.recipeId),O()}}catch(e){console.error("Error Adding List:",e)}},U=e.open??P,W=t=>{t&&D(),e.onOpenChange?e.onOpenChange(t):F(t)},B=()=>{q(!1),I(!1),W(!1)},H=async t=>{(0,y.track)("List Toggle");try{t.isIncluded?(V(t.id,!1),b.toast.success(`Recipe removed from ${t.name}`),await (0,c.removeRecipeFromList)(i,t.id,e.recipeId)):(V(t.id,!0),b.toast.success(`Recipe saved to ${t.name}`),await (0,c.addRecipeToList)(i,t.id,e.recipeId)),O(),B()}catch(e){console.error("Error adding recipe to list:",e)}},V=(e,t)=>{k(r=>r.map(r=>r.id===e?{...r,isIncluded:t}:r))},K=async()=>{(0,y.track)("Create New List");try{if(!n?.authUser?.id)throw Error("User not authenticated");let t=await (0,c.createList)(i,n.authUser.id,{name:x});await (0,c.addRecipeToList)(i,t.id,e.recipeId),O(),k(e=>[...e,{id:t.id,name:x,isIncluded:!0}]),b.toast.success(`Recipe saved to ${x}`),B(),S("")}catch(e){console.error("Error creating new list:",e),"23505"===e.code&&b.toast.error("You already have a list with that name")}},z=()=>(0,t.jsx)("div",{className:"cursor-pointer",children:R.some(e=>e.isIncluded)?(0,t.jsx)(j,{className:"mx-auto w-full h-full text-foodie-orange"}):(0,t.jsx)(v,{className:"mx-auto w-full h-full text-foodie-orange"})}),G=()=>(0,t.jsx)("div",{className:"grid gap-4",children:(0,t.jsx)("div",{className:"grid divide-y divide-foodie-beige/80",children:n?.user?(0,t.jsxs)(t.Fragment,{children:[R?.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-md",children:[(0,t.jsx)(l.Label,{htmlFor:`list-${e.id}`,className:"flex-grow p-4 text-sm sm:text-base font-light text-foodie-brown cursor-pointer",children:e.name}
7),(0,t.jsx)(d.Checkbox,{id:`list-${e.id}`,checked:e.isIncluded,onCheckedChange:t=>H(e),className:"h-6 w-6 rounded-full border m-4 border-foodie-brown text-white data-[state=checked]:border-2 data-[state=checked]:bg-foodie-orange data-[state=checked]:border-foodie-orange data-[state=checked]:text-white focus:ring-foodie-orange focus-visible:ring-transparent"})]},e.id)),(0,t.jsxs)("div",{className:"flex w-full items-center space-x-2",children:[(0,t.jsx)(_.Input,{placeholder:"New List Name",value:x,onChange:e=>S(e.target.value),className:"flex-grow p-4 border-0 text-foodie-brown text-sm sm:text-base font-light focus-visible:ring-0 !ring-offset-0 placeholder:text-foodie-light-brown",onKeyDown:e=>{"Enter"===e.key&&K()}}),(0,t.jsx)("button",{className:"p-4 text-sm sm:text-base text-foodie-brown disabled:opacity-50 disabled:cursor-not-allowed",type:"submit",disabled:!x,onClick:K,children:"Add"})]})]}):(0,t.jsx)("div",{className:"p-4",children:(0,t.jsxs)("p",{className:"text-lg",children:[(0,t.jsx)("button",{onClick:()=>L(!0),className:"font-bold text-foodie-brown hover:underline hover:text-foodie-brown active:text-foodie-brown focus:ring-0 hover:ring-0 focus:outline-none",children:"Create an account"})," ","to save recipes!"]})})})});return e.hideTrigger?(0,t.jsxs)("div",{children:[(0,t.jsx)(g.Toaster,{richColors:!0,expand:!0,position:"top-right",className:"text-foodie-brown"}),(0,t.jsx)(E.Dialog,{open:U,onOpenChange:W,children:(0,t.jsxs)(E.DialogContent,{className:"rounded-md border-foodie-brown/20 bg-white text-foodie-brown",onOpenAutoFocus:D,children:[(0,t.jsxs)(E.DialogHeader,{children:[(0,t.jsx)(E.DialogTitle,{children:"Save recipe"}),(0,t.jsx)(E.DialogDescription,{className:"text-foodie-brown/70",children:"Choose a list or create a new one."})]}),G(),(0,t.jsx)(E.DialogFooter,{children:(0,t.jsx)("button",{type:"button",onClick:()=>W(!1),className:"rounded-md border border-foodie-brown/30 px-4 py-2 text-sm font-medium text-foodie-brown transition-colors hover:bg-foodie-beige/60",children:"Close"})})]})}),(0,t.jsx)(w.default,{isOpen:T,onOpenChange:L,showUpsell:!1})]}):(0,t.jsxs)("div",{children:[(0,t.jsx)(g.Toaster,{richColors:!0,expand:!0,position:"top-right",className:"text-foodie-brown"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsxs)(s.Drawer,{open:N,onOpenChange:q,preventScrollRestoration:!1,children:[(0,t.jsx)(s.DrawerTrigger,{asChild:!0,children:z()}),(0,t.jsxs)(s.DrawerContent,{className:"focus:outline-none",onCloseAutoFocus:B,onOpenAutoFocus:D,children:[G(),(0,t.jsx)(s.DrawerFooter,{children:(0,t.jsx)(s.DrawerClose,{children:(0,t.jsx)("button",{children:"Close"})})})]})]})}),(0,t.jsx)("div",{className:"hidden md:inline",children:(0,t.jsxs)(a.Popover,{open:C,onOpenChange:I,children:[(0,t.jsx)(a.PopoverTrigger,{asChild:!0,children:z()}),(0,t.jsx)(a.PopoverContent,{className:"w-64 p-0",align:"end",onCloseAutoFocus:B,onOpenAutoFocus:D,children:G()})]})})]}),(0,t.jsx)(w.default,{isOpen:T,onOpenChange:L,showUpsell:!1})]})};e.s(["RecipeSave",0,S],626761);var R=e.i(331261),k=e.i(431343);let N=({size:e="medium"})=>{let r={medium:{container:"px-2 py-1 top-2 right-2",icon:"w-3 h-3 mr-1",text:"text-xs"},large:{container:"px-3 py-1.5 top-4 right-4",icon:"w-4 h-4 mr-1.5",text:"text-sm"}},{container:o,icon:i,text:n}=r[e]||r.medium;return(0,t.jsxs)("div",{className:`absolute bg-foodie-orange text-white rounded-full flex items-center ${o}`,children:[(0,t.jsx)(k.Play,{className:i}),(0,t.jsx)("span",{className:n,children:"Video Guides"})]})};var q=e.i(567593),C=e.i(221345),I=e.i(532932),P=e.i(536849);e.s(["RecipeItem",0,e=>{let[a,s]=(0,u.useState)(!1),[d,l]=(0,u.useState)(!1),[c,p]=(0,u.useState)(!1),m=e.recipe,f=!!m.user_id,h="url"===m.source_type?(0,P.getFaviconUrl)(m.source_url):null,_="url"===m.source_type?(0,P.getProvenanceLabel)(m.source_url):null,g=!!(h&&_),b=e.completionFade?"opacity-0 animate-fade-in":"";return(0,t.jsx)("li",{children:(0,t.jsx)(I.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)("div",{className:`relative group ${e.skipAnimation?"opacity-100":"opacity-0 animate-fade-in"}`,style:{...!e.skipAnimation&&{animationDelay:`${Math.min(50*e.index,200)}ms`,animationFillMode:"forwards"}},children:[(0,t.jsx)(o.default,{href:`/recipes/${e.recipe.path}`,onClick:()=>{s(!0)},className:"block",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("img",{src:f&&d?r.PLACEHOLDER_RECIPE_IMAGE:(0,r.imageFromPath)(e.recipe.path,m.user_id,m.updated_at),alt:(0,r.titleFromPath)(e.recipe.path),loading:"lazy",className:`w-full aspect-square object-cover border-2 border-solid rounded-md border-foodie-brown shadow-foodie-card-shadow-yellow ${b}`,onError:()=>{f&&l(!0)}}),a&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-20 rounded-md",children:(0,t.jsx)(q.FoodieLoaderCircle,{size:"md",className:"text-white"})}),m.has_video&&!e.listsEnabled&&(0,t.jsx)(N,{}),g&&(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("div",{role:"img","aria-label":`Imported from ${_}`,className:"absolute bottom-2 left-2 w-7 h-7 bg-white border border-foodie-brown/25 rounded-md shadow-md flex items-center justify-center p-1",children:c?(0,t.jsx)(C.Link,{className:"w-full h-full text-foodie-brown"}):(0,t.jsx)("img",{src:h,alt:"",loading:"lazy",className:"w-full h-full object-contain",onError:()=>p(!0)})})}),(0,t.jsxs)(I.TooltipContent,{side:"top",className:"bg-white text-foodie-brown border-foodie-brown/25 font-body",children:["Imported from ",_]})]})]}),(0,t.jsxs)("div",{className:"flex-1 text-foodie-orange pt-4 text-left",children:[(0,t.jsx)("div",{className:`text-foodie-brown whitespace-normal overflow-hidden line-clamp-2 font-body text-fluid-body-lg ${b}`,style:e.completionFade?{animationDelay:"120ms",animationFillMode:"forwards"}:void 0,children:e.recipe.title}),(0,t.jsx)("div",{className:"font-body text-foodie-brown text-fluid-sm flex items-center pt-2",children:(0,t.jsxs)("div",{className:"flex items-center",children:[(()=>{if(e.badgeEnabled&&!m.premium&&!f)return(0,t.jsx)(R.Badge,{className:"mr-4 bg-foodie-yellow text-xs font-light rounded-md",children:"Free!"})})(),(0,t.jsx)(n.FaClock,{className:"mr-2"}),(0,t.jsx)(i.default,{minutes:e.recipe.minutes})]})})]})]})}),(0,t.jsx)("div",{className:"absolute top-2 right-2 size-6",children:e.listsEnabled&&!f&&(0,t.jsx)(S,{recipeId:e.recipe.id,isEnabled:e.listsEnabled})})]})})})}],729607)},178583,e=>{"use strict";let t=(0,e.i(475254).default)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,t],178583)},159358,e=>{"use strict";var t=e.i(843476),r=e.i(729607);e.s(["default",0,function({recipes:e,skipAnimation:o}){let i=Array.isArray(e)?e:[];return(0,t.jsx)("div",{className:"transition-all duration-300 ease-out",style:{minHeight:i.length>0?`${300*Math.ceil(i.length/4)}px`:"0"},children:(0,t.jsx)("ul",{className:"grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:i.map((e,i)=>(0,t.jsx)(r.RecipeItem,{recipe:e,index:i,listsEnabled:!1,badgeEnabled:!0,skipAnimation:o},e.path||i))})})}])},989770,e=>{"use strict";var t=e.i(843476);e.s(["RecipeSkeletonGrid",0,function({count:e=8,rowHeight:r=300}){let o=Math.ceil(e/4);return(0,t.jsx)("div",{className:"transition-all duration-300 ease-out",style:{minHeight:`${o*r}px`},children:(0,t.jsx)("ul",{className:"grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:Array.from({length:e}).map((e,r)=>(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"w-full aspect-square bg-foodie-light-brown rounded-md border-2 border-foodie-brown shadow-foodie-card-shadow-yellow animate-pulse"}),(0,t.jsxs)("div",{className:"flex-1 pt-4",children:[(0,t.jsx)("div",{className:"h-6 bg-foodie-light-brown rounded animate-pulse mb-2"}),(0,t.jsx)("div",{className:"h-6 bg-foodie-light-brown rounded animate-pulse w-3/4"}),(0,t.jsx)("div",{className:"flex items-center pt-2",children:(0,t.jsx)("div",{className:"h-4 w-20 bg-foodie-light-brown rounded animate-pulse"})})]})]})},r))})})}])},364681,e=>{"use strict";var t=e.i(843476),r=e.i(522016),o=e.i(271645),i=e.i(912598),n=e.i(531278),a=e.i(878894),s=e.i(200911),d=e.i(452264),l=e.i(605030),u=e.i(678525),c=e.i(134693);e.s(["default",0,function({status:e,recipeId:p,workflowRunId:m,preview:f}){let h=(0,i.useQueryClient)(),_="failed"===e,g=!_&&"completed"!==e,b=(0,o.useCallback)(()=>{h.invalidateQueries({queryKey:["user-recipes"]})},[h]),{phase:y,displayLabel:x,progress:v,preview:j}=(0,u.useWorkflowStream)(g?p:null,g&&m||null,b),w=(0,c.mergeRecipeImportPreviews)(j,f),E=w.image_url?.trim(),S=!!E,R=w.title?.trim(),k=x?.trim()||"Starting import...",N=_||"dead"===y&&"processing"===e;return"completed"===e?null:(0,t.jsx)("li",{children:(0,t.jsx)(r.default,{href:`/my-recipes/processing/${p}`,className:"block group",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"relative w-full aspect-square rounded-md border-2 border-solid border-foodie-brown shadow-foodie-card-shadow-yellow bg-foodie-brown/10 flex items-center justify-center",children:(0,t.jsx)("div",{className:"flex flex-col items-center gap-2 text-foodie-brown/70 text-center px-4 w-full",children:N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.AlertTriangle,{className:"w-8 h-8 text-red-400"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foodie-brown",children:"Import Failed"}),(0,t.jsx)("span",{className:"text-xs text-foodie-brown/50",children:"See more details"})]}):(0,t.jsxs)(t.Fragment,{children:[S&&(0,t.jsx)(d.RecipeImportPreviewImage,{src:E,className:"absolute inset-0 rounded-md",overlayClassName:"bg-foodie-beige/65"}),!S&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,t.jsx)(n.Loader2,{className:"w-8 h-8 animate-spin text-foodie-orange"})}),(0,t.jsx)("div",{className:"absolute inset-x-4 bottom-4",children:(0,t.jsx)(l.Progress,{value:v,className:"h-1.5 w-full bg-foodie-brown/15 [&>div]:bg-foodie-orange"})})]})})}),!N&&(0,t.jsxs)("div",{className:"flex-1 pt-4 text-left",children:[(0,t.jsx)("p",{className:"line-clamp-2 overflow-hidden whitespace-normal font-body text-fluid-body-lg text-foodie-brown",children:R||"Saving recipe..."}),(0,t.jsx)(s.FadeText,{text:k,className:"block pt-2 line-clamp-1 font-body text-fluid-sm text-foodie-brown/50"})]})]})})})}])},944044,e=>{"use strict";var t=e.i(843476),r=e.i(618566),o=e.i(475254);let i=(0,o.default)("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);var n=e.i(178583),a=e.i(158524);let s=(0,o.default)("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var d=e.i(215652),l=e.i(290343),u=e.i(271645),c=e.i(531278),p=e.i(846696),m=e.i(954616),f=e.i(912598),h=e.i(195399),_=e.i(278669);function g({onClose:e,onProcessingStart:o}){let i,n=(0,r.useRouter)(),[a,s]=(0,u.useState)(""),d=(i=(0,f.useQueryClient)(),(0,m.useMutation)({mutationFn:async e=>{let t=await fetch("/api/user-recipes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),r=await t.json();if(!t.ok){let e=Error(r.error||"Failed to import recipe");throw e.data=r,e.status=t.status,e}return r},onSuccess:()=>{i.invalidateQueries({queryKey:["user-recipes"]}),i.invalidateQueries({queryKey:h.ACTIVE_RECIPE_IMPORT_QUERY_KEY})}})),l=a.trim().length>=20,b=async()=>
7{if(l)try{let t=await d.mutateAsync({source_type:"text",raw_text:a.trim()});(0,_.track)("Recipe Import Started",{source_type:"text",recipe_id:t.recipe.id,text_length:a.trim().length}),e(),t.processing&&o?o(t.recipe.id,t.workflow_run_id,t.preview??null):n.push(t.redirect_to)}catch(t){let e=t?.data?.code;e&&(0,_.track)("Recipe Import Submit Failed",{source_type:"text",reason:e}),p.toast.error(t instanceof Error?t.message:"Failed to import recipe")}};return(0,t.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-foodie-brown/60 text-sm",children:"Paste a recipe from a website, cookbook, or your own notes."}),(0,t.jsx)("textarea",{value:a,onChange:e=>s(e.target.value),placeholder:"Paste your recipe here...",rows:5,disabled:d.isPending,className:"w-full rounded-lg border border-foodie-brown/15 bg-foodie-brown/[0.03] px-4 py-3 text-base sm:text-sm text-foodie-brown placeholder:text-foodie-brown/30 focus:outline-none focus:ring-0 focus:border-transparent transition-colors disabled:opacity-50 resize-none"}),a.length>0&&a.trim().length<20&&(0,t.jsx)("p",{className:"text-xs text-foodie-brown/40 text-center",children:"Please enter at least 20 characters"})]}),(0,t.jsx)("button",{onClick:b,disabled:!l||d.isPending,className:"w-full px-6 py-3 mt-auto bg-foodie-orange text-white rounded-md font-semibold hover:bg-foodie-orange/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:d.isPending?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Loader2,{className:"w-4 h-4 animate-spin"}),"Analyzing your recipe..."]}):"Process Recipe"})]})}var b=e.i(612891),y=e.i(107233),x=e.i(37727);let v=4,j=4,w=`That upload is too large. Keep photos under ${v}MB total, or a PDF under ${j}MB.`;async function E(e){return new Promise((t,r)=>{let o=new Image,i=URL.createObjectURL(e);o.onload=()=>{URL.revokeObjectURL(i);let{width:e,height:n}=o;if(e<=2048&&n<=2048){let i=document.createElement("canvas");i.width=e,i.height=n;let a=i.getContext("2d");return a?(a.drawImage(o,0,0),void i.toBlob(e=>{(i.width=0,i.height=0,e)?t(new File([e],"recipe.jpeg",{type:"image/jpeg"})):r(Error("Failed to compress image"))},"image/jpeg",.85)):void r(Error("Could not create canvas context"))}let a=2048/Math.max(e,n);e=Math.round(e*a),n=Math.round(n*a);let s=document.createElement("canvas");s.width=e,s.height=n;let d=s.getContext("2d");d?(d.drawImage(o,0,0,e,n),s.toBlob(e=>{(s.width=0,s.height=0,e)?t(new File([e],"recipe.jpeg",{type:"image/jpeg"})):r(Error("Failed to compress image"))},"image/jpeg",.85)):r(Error("Could not create canvas context"))},o.onerror=()=>{URL.revokeObjectURL(i),r(Error("Failed to load image"))},o.src=i})}function S({onClose:e,onProcessingStart:o}){let i,a=(0,r.useRouter)(),[d,l]=(0,u.useState)([]),[g,b]=(0,u.useState)([]),[R,k]=(0,u.useState)(!1),N=(0,u.useRef)(null),q=(0,u.useRef)([]),C=(i=(0,f.useQueryClient)(),(0,m.useMutation)({mutationFn:async e=>{let t=new FormData;if("pdf"in e)t.append("source_type","pdf"),t.append("file",e.pdf);else for(let r of e.images)t.append("images",r);let r=await fetch("/api/user-recipes",{method:"POST",body:t});if(!r.ok){let e=null;try{e=await r.json()}catch{}let t=Error(e?.error||(413===r.status?"That upload is too large. Keep photos under 4MB total, or a PDF under 4MB.":"Failed to import recipe from image"));throw t.data=e??{},t.status=r.status,t}return r.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["user-recipes"]}),i.invalidateQueries({queryKey:h.ACTIVE_RECIPE_IMPORT_QUERY_KEY})}})),I=d.find(e=>"application/pdf"===e.type);(0,u.useEffect)(()=>()=>{q.current.forEach(e=>URL.revokeObjectURL(e))},[]);let P=(0,u.useCallback)(e=>{if(0===e.length)return;N.current&&(N.current.value="");let t=e.filter(e=>"application/pdf"===e.type),r=t[0],o=e.filter(e=>"application/pdf"!==e.type),i=d.some(e=>"application/pdf"===e.type);if(t.length>1||o.length>0&&(r||i))return void p.toast.error("Add either photos or one PDF.");if(r){!i&&d.length>0&&p.toast.info("Replaced your photos with the PDF."),q.current.forEach(e
7=>URL.revokeObjectURL(e)),q.current=[],b([]),l([r]);return}let n=Math.max(5-d.length,0);o.length>n&&p.toast.error("You can add up to 5 photos.");let a=o.slice(0,n);0!==a.length&&(q.current=q.current.concat(a.map(e=>URL.createObjectURL(e))),b(q.current),l(d.concat(a)))},[d]),F=(0,u.useCallback)(e=>{let t=q.current[e];t&&URL.revokeObjectURL(t),q.current=q.current.filter((t,r)=>r!==e),b(q.current),l(t=>t.filter((t,r)=>r!==e)),N.current&&(N.current.value="")},[]),T=async()=>{if(0!==d.length)try{let t,r=d.find(e=>"application/pdf"===e.type);if(r)t=await C.mutateAsync({pdf:r});else{let e=[];for(let t of d)e.push(await E(t));if(e.reduce((e,t)=>e+t.size,0)>4194304)return void p.toast.error(w);t=await C.mutateAsync({images:e})}(0,_.track)("Recipe Import Started",{source_type:r?"pdf":"photo",recipe_id:t.recipe.id,attachment_count:d.length}),e(),t.processing&&o?o(t.recipe.id,t.workflow_run_id,t.preview??null):a.push(t.redirect_to)}catch(t){let e=t?.data?.code;e&&(0,_.track)("Recipe Import Submit Failed",{source_type:I?"pdf":"photo",reason:e}),p.toast.error(t instanceof Error?t.message:"Failed to import recipe")}};return(0,t.jsxs)("div",{className:"flex flex-col flex-1",children:[0===d.length?(0,t.jsxs)("div",{onClick:()=>N.current?.click(),onDragOver:e=>{e.preventDefault(),k(!0)},onDragLeave:e=>{e.preventDefault(),k(!1)},onDrop:e=>{e.preventDefault(),k(!1),P(Array.from(e.dataTransfer.files).filter(e=>e.type.startsWith("image/")||"application/pdf"===e.type))},className:`flex-1 flex flex-col items-center justify-center gap-3 rounded-lg border-2 border-dashed px-4 cursor-pointer transition-colors ${R?"border-foodie-orange bg-foodie-orange/5":"border-foodie-brown/15 bg-foodie-brown/[0.03] hover:border-foodie-orange/30 hover:bg-foodie-orange/5"}`,children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-foodie-orange/10 flex items-center justify-center",children:(0,t.jsx)(s,{className:"w-6 h-6 text-foodie-orange"})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foodie-brown/70",children:"Tap to upload photos or drag & drop"}),(0,t.jsx)("p",{className:"text-xs text-foodie-brown/40 mt-1",children:"Recipe cards, cookbook pages, or screenshots"}),(0,t.jsxs)("p",{className:"text-xs text-foodie-brown/30 mt-0.5",children:["JPEG, PNG, WebP: up to ",5," photos, ",v,"MB total, or one PDF up to ",j,"MB"]})]})]}):I?(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-foodie-brown/15 bg-foodie-brown/[0.03] px-3 py-3",children:[(0,t.jsx)("div",{className:"w-9 h-9 rounded-full bg-foodie-orange/10 flex items-center justify-center shrink-0",children:(0,t.jsx)(n.FileText,{className:"w-4 h-4 text-foodie-orange"})}),(0,t.jsx)("span",{className:"flex-1 min-w-0 truncate text-sm text-foodie-brown/70",children:I.name}),(0,t.jsx)("button",{onClick:()=>F(0),disabled:C.isPending,"aria-label":"Remove PDF",className:"p-1 bg-black/50 rounded-full text-white hover:bg-black/70 transition-colors disabled:opacity-50 shrink-0",children:(0,t.jsx)(x.X,{className:"w-4 h-4"})})]}):(0,t.jsxs)("div",{className:"flex gap-2 overflow-x-auto pb-1",children:[g.map((e,r)=>(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsx)("img",{src:e,alt:`Recipe photo ${r+1}`,className:"h-32 w-24 object-cover rounded-lg bg-foodie-brown/5"}),(0,t.jsx)("button",{onClick:()=>F(r),disabled:C.isPending,"aria-label":`Remove photo ${r+1}`,className:"absolute top-1 right-1 p-1 bg-black/50 rounded-full text-white hover:bg-black/70 transition-colors disabled:opacity-50",children:(0,t.jsx)(x.X,{className:"w-4 h-4"})})]},e)),d.length<5&&(0,t.jsx)("button",{onClick:()=>N.current?.click(),disabled:C.isPending,"aria-label":"Add another photo",className:"h-32 w-24 shrink-0 flex items-center justify-center rounded-lg border-2 border-dashed border-foodie-brown/15 bg-foodie-brown/[0.03] text-foodie-brown/40 hover:border-foodie-orange/30 hover:bg-foodie-orange/5 transition-colors disabled:opacity-50",children:(0,t.jsx)(y.Plus,{className:"w-5 h-5"})})]}),(0,t.jsx)("input",{ref:N,type:"file",accept:"image/jpeg,image/png,image/webp,application/pdf",multiple:!0,onChange:e=>{P(Array.from(e.target.files??[]))},className:"hidden"}),(0,t.jsx)("button",{onClick:T,disabled:0===d.length||C.isPending,className:"w-full px-6 py-3 mt-4 bg-foodie-orange text-white rounded-md font-semibold hover:bg-foodie-orange/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:C.isPending?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Loader2,{className:"w-4 h-4 animate-spin"}),"Reading your recipe..."]}):"Extract Recipe"})]})}let R="group flex flex-col items-center gap-1.5 py-2.5 text-xs rounded-md transition-all text-foodie-brown/40 data-[state=active]:bg-white data-[state=active]:shadow-sm data-[state=active]:text-foodie-orange",k="w-9 h-9 rounded-full flex items-center justify-center transition-all bg-foodie-brown/[0.04] group-data-[state=active]:bg-foodie-orange/15 group-data-[state=active]:ring-2 group-data-[state=active]:ring-foodie-orange/25",N="mt-4 data-[state=active]:flex data-[state=active]:flex-col data-[state=active]:flex-1";e.s(["default",0,function({open:e,onOpenChange:o,onIntentionalExit:u,onProcessingStart:c,prefilledURL:p}){let m=(0,r.useRouter)(),f=()=>{u?.(),o(!1)};return(0,t.jsx)(d.default,{open:e,onOpenChange:o,title:"Add Recipe",children:(0,t.jsxs)(l.Tabs,{defaultValue:"url",className:"w-full",children:[(0,t.jsxs)(l.TabsList,{className:"grid w-full grid-cols-4 h-auto gap-1 bg-foodie-brown/[0.04] p-1.5 rounded-lg",children:[(0,t.jsxs)(l.TabsTrigger,{value:"url",className:R,children:[(0,t.jsx)("div",{className:k,children:(0,t.jsx)(a.Link2,{className:"w-4 h-4"})}),(0,t.jsx)("span",{className:"font-medium",children:"URL"})]}),(0,t.jsxs)(l.TabsTrigger,{value:"text",className:R,children:[(0,t.jsx)("div",{className:k,children:(0,t.jsx)(n.FileText,{className:"w-4 h-4"})}),(0,t.jsx)("span",{className:"font-medium",children:"Text"})]}),(0,t.jsxs)(l.TabsTrigger,{value:"photo",className:R,children:[(0,t.jsx)("div",{className:k,children:(0,t.jsx)(s,{className:"w-4 h-4"})}),(0,t.jsx)("span",{className:"font-medium",children:"Photo"})]}),(0,t.jsxs)(l.TabsTrigger,{value:"form",className:R,children:[(0,t.jsx)("div",{className:k,children:(0,t.jsx)(i,{className:"w-4 h-4"})}),(0,t.jsx)("span",{className:"font-medium",children:"Manual"})]})]}),(0,t.jsxs)("div",{className:"flex flex-col min-h-[380px] sm:min-h-[357px]",children:[(0,t.jsx)(l.TabsContent,{value:"url",className:N,children:(0,t.jsx)(b.default,{onClose:f,onProcessingStart:c,initialURL:p})}),(0,t.jsx)(l.TabsContent,{value:"text",className:N,children:(0,t.jsx)(g,{onClose:f,onProcessingStart:c})}),(0,t.jsx)(l.TabsContent,{value:"photo",className:N,children:(0,t.jsx)(S,{onClose:f,onProcessingStart:c})}),(0,t.jsx)(l.TabsContent,{value:"form",className:N,children:(0,t.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 rounded-lg bg-foodie-brown/[0.03] py-6",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-foodie-orange/10 flex items-center justify-center",children:(0,t.jsx)(i,{className:"w-6 h-6 text-foodie-orange"})}),(0,t.jsxs)("div",{className:"text-center px-4",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foodie-brown/70",children:"Build your own recipe"}),(0,t.jsx)("p",{className:"text-xs text-foodie-brown/40 mt-1",children:"Add ingredients, steps, and photos manually"})]})]}),(0,t.jsx)("button",{onClick:()=>{(0,_.track)("Recipe Import Started",{source_type:"manual"}),u?.(),o(!1),m.push("/my-recipes/new")},className:"w-full px-6 py-3 mt-4 bg-foodie-orange text-white rounded-md font-semibold hover:bg-foodie-orange/90 transition-colors",children:"Create from Scratch"})]})})]})]})})}],944044)},167927,156100,e=>{"use strict";var t=e.i(266027);e.s(["useUserRecipes",0,function(){return(0,t.useQuery)({queryKey:["user-recipes"],queryFn:async()=>{let e=await fetch("/api/user-recipes");if(!e.ok)throw Error("Failed to fetch recipes");return(await e.json()).recipes}})}],167927);var r=e.i(271645),o=e.i(618566),i=e.i(912598),n=e.i(411754),a=e.i(656135),s=e.i(624464);
7e.s(["useImportRedirect",0,function(e,t,d={}){let l=(0,o.useRouter)(),u=(0,i.useQueryClient)(),{shouldSuppressRedirect:c}=d,p=(0,r.useRef)(e),m=(0,r.useRef)(c);p.current=e,m.current=c;let{data:f,isError:h,error:_}=(0,s.useRecipeProcessingStatus)(e?.recipeId??null),g=(0,r.useRef)(null),b=(0,r.useRef)(null),y=(0,r.useRef)(null);return(0,r.useEffect)(()=>{e&&h&&y.current!==e.recipeId&&(y.current=e.recipeId,(0,a.captureError)(_??Error("Recipe processing status poll failed"),{flow:"recipe-import",surface:"client",operation:"import-status-poll",extra:{recipeId:e.recipeId}}),u.invalidateQueries({queryKey:["user-recipes"]}),t(null))},[h,_,e,u,t]),(0,r.useEffect)(()=>{var r;if(!e||g.current===e.recipeId||c?.(e.recipeId))return;let o="completed"===(r={recipeId:e.recipeId,processing_status:f?.processing_status,recipe_path:f?.recipe_path}).processing_status?r.recipe_path?{kind:"recipe",path:r.recipe_path}:{kind:"edit",recipeId:r.recipeId}:"failed"===r.processing_status?{kind:"processing",recipeId:r.recipeId}:null;o&&(g.current=e.recipeId,(async()=>{if(("recipe"===o.kind||"edit"===o.kind)&&b.current!==e.recipeId&&(u.invalidateQueries({queryKey:["user-recipes"]}),await (0,n.trackRecipeImportCompleted)({recipeId:e.recipeId,workflowRunId:f?.workflow_run_id??e.workflowRunId,sourceType:f?.source_type,processAttempts:f?.process_attempts}),b.current=e.recipeId),p.current?.recipeId!==e.recipeId||m.current?.(e.recipeId)){g.current===e.recipeId&&(g.current=null);return}"recipe"===o.kind?l.push(`/recipes/${o.path}`):"edit"===o.kind?l.push(`/my-recipes/edit/${o.recipeId}`):l.push(`/my-recipes/processing/${o.recipeId}`),t(null)})().catch(t=>{console.error("useImportRedirect: completion redirect failed",t),(0,a.captureError)(t,{flow:"recipe-import",surface:"client",operation:"import-completion-redirect",extra:{recipeId:e.recipeId}})}))},[f,e,u,l,t,c]),{processingStatus:f}}],156100)}]); 8 9//# debugId=8a050e13-3073-517d-f935-0b4d5e687e37
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.