(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[340],{5279:(e,t,r)=>{"use strict";r.d(t,{J:()=>u});var o=r(5125),a=r(2115);let n="https://george-fx.github.io/yummer-api/",s={GET_OFFERS:"".concat(n,"offers.json"),GET_DISHES:"".concat(n,"dishes.json"),GET_PROMOCODES:"".concat(n,"promocodes.json")},u={useGetDish:e=>{let[t,r]=(0,a.useState)(null),[n,u]=(0,a.useState)(!0),l=async()=>{u(!0);try{var t;let a=await o.A.get(s.GET_DISHES),n=(null!=(t=a.data.dishes)?t:a.data).find(t=>t.id===e);return r(n||null),u(!1),n}catch(e){throw u(!1),console.error("Error fetching dishes:",e),e}};return(0,a.useEffect)(()=>{l()},[e]),{dish:t,isLoading:n}},useFormField:e=>{let[t,r]=(0,a.useState)(e);return{form:t,setForm:r,handleChangeField:(e,o)=>{let a=window.prompt("Enter your ".concat(o),t[e]);null!==a&&r(t=>({...t,[e]:a}))}}},useGetDishes:()=>{let[e,t]=(0,a.useState)([]),[r,n]=(0,a.useState)(!0),u=async()=>{n(!0);try{let e=await o.A.get(s.GET_DISHES);if(!e.data)throw Error("No data in response");let r=e.data.dishes||e.data||[];t(r)}catch(e){throw console.error("API request failed:",e),e}finally{n(!1)}};return(0,a.useEffect)(()=>{u()},[]),{dishes:e,loading:r}},useBodyColor:e=>{(0,a.useEffect)(()=>{let t=document.body.style.backgroundColor;return document.body.style.backgroundColor=e,()=>{document.body.style.backgroundColor=t}},[e])},useGetOffers:()=>{let[e,t]=(0,a.useState)([]),[r,n]=(0,a.useState)(!0),u=async()=>{n(!0);try{let e=await o.A.get(s.GET_OFFERS);if(!e.data)throw Error("No data in response");let r=e.data.offers||e.data||[];t(r)}catch(e){throw console.error("API request failed:",e),e}finally{n(!1)}};return(0,a.useEffect)(()=>{u()},[]),{offers:e,loading:r}},useThemeColor:e=>{(0,a.useEffect)(()=>{let t=document.querySelector('meta[name="theme-color"]');t||((t=document.createElement("meta")).setAttribute("name","theme-color"),document.head.appendChild(t));let r=t.getAttribute("content");return t.setAttribute("content",e),()=>{r&&t.setAttribute("content",r)}},[e])},useGetPromocodes:()=>{let[e,t]=(0,a.useState)([]),[r,n]=(0,a.useState)(!0),u=async()=>{n(!0);try{let e=await o.A.get(s.GET_PROMOCODES);if(!e.data)throw Error("No data in response");let r=e.data.promocodes||e.data||[];t(r)}catch(e){throw console.error("API request failed:",e),e}finally{n(!1)}};return(0,a.useEffect)(()=>{u()},[]),{promocodes:e,loading:r}}}},6523:(e,t,r)=>{Promise.resolve().then(r.bind(r,7054))},7054:(e,t,r)=>{"use strict";r.d(t,{VerifyYourPhoneNumber:()=>l});var o=r(5155);r(2115);var a=r(63),n=r(5279),s=r(2800),u=r(8018);let l=()=>{n.J.useThemeColor("#EEF3FC"),n.J.useBodyColor("#EEF3FC");let e=(0,a.useRouter)(),{form:t,handleChangeField:r}=n.J.useFormField({phoneNumber:""});return(0,o.jsx)(u.d.MotionWrapper,{children:(0,o.jsxs)(u.d.SafeAreaView,{children:[(0,o.jsx)(u.d.Header,{showGoBack:!0,title:"Verify Your Number"}),(0,o.jsxs)("main",{style:{marginTop:s.A.sizes.headerHeight,paddingLeft:20,paddingRight:20,paddingTop:28},children:[(0,o.jsx)("p",{style:{maxWidth:319,marginBottom:30},children:"We have sent you an SMS with a code to number +17 0123456789."}),(0,o.jsx)(u.d.Input,{label:"phone number",placeholder:"+17123456789",containerStyle:{marginBottom:30},value:t.phoneNumber,onClickAction:()=>r("phoneNumber","phone number")}),(0,o.jsx)(u.d.Button,{label:"Confirm",onClickAction:()=>{e.push(s.A.routes.confirmationCode)}})]})]})})}}},e=>{e.O(0,[171,385,125,406,18,441,315,358],()=>e(e.s=6523)),_N_E=e.O()}]);