1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,521180,e=>{"use strict";var t=e.i(678752),i=e.i(831894),a=e.i(522832),s=e.i(931168),r=e.i(10355),o=e.i(276249),n=e.i(475116),l=e.i(626923),c=e.i(739132),u=e.i(818778),d=e.i(133423),m=e.i(740590),g=e.i(636957),p=e.i(197663),h=e.i(234796),x=e.i(183144),f=e.i(981831),w=e.i(632137),v=e.i(374725),b=e.i(551804),C=e.i(964324),j=e.i(902486),N=e.i(989718),y=e.i(629106),T=e.i(405210),k=e.i(253903),L=e.i(527296),_=e.i(726691),P=e.i(850395),S=e.i(638955),A=e.i(77274),R=e.i(832356),I=e.i(133447),E=e.i(242230),F=e.i(310851);async function $(e,t,i){let{data:a,error:s}=await e.auth.signInWithPassword({email:t.email,password:t.password});if(s)throw Error(i("login_wrong_data"));await (0,j.checkAndCreatePetOwner)();let r=a?.user?.id,o=(0,E.resolveLocale)(a?.user?.user_metadata?.locale);return r?{userId:r,locale:o}:null}async function O(){let{data:{user:e}}=await b.supabase.auth.getUser();if(!e)return null;let{data:t,error:i}=await b.supabase.from("pet_owners").select("first_name").eq("user_id",e.id).limit(1).maybeSingle();if(i)throw Error(i.message);return t?.first_name??null}var B=e.i(605280),M=e.i(189746),U=e.i(311525);let D=({theme:e})=>{let i=(0,c.useTranslations)("common"),a=(0,c.useTranslations)("onboarding"),s=(0,c.useTranslations)(),r=(0,o.useIsMobileNative)(),n=(0,h.useSearchParams)(),l=(0,S.getPromoCodeParam)(n),{register:m,handleSubmit:g,formState:{errors:j},mutation:E,isLoading:D,setValue:V}=function(e){let t=(0,h.useRouter)(),i=(0,I.useSwitchLang)(),a=(0,A.useLocale)(),s=(0,h.useSearchParams)(),{redirectToBrowser:r}=(0,T.useRedirectToBrowser)(),n=(0,c.useTranslations)(),l=(0,o.useIsMobileNative)(),m=(0,u.useMemo)(()=>{let e;return e=n("common.errors.required"),R.z.object({email:R.z.string({required_error:e}).trim().email({message:n("common.errors.email_invalid")}),password:R.z.string({required_error:e}).trim().min(1,{message:e})})},[n]),g=(0,u.useMemo)(()=>s.get("redirectTo")||(0,P.toHome)(),[s]),p=(0,S.getPromoCodeParam)(s),[x,f]=(0,u.useState)(!1),w=(0,u.useRef)(!0);(0,u.useEffect)(()=>()=>{w.current=!1},[]);let{isLoading:j,...E}=(0,y.useSupabaseForm)({schema:m,mutationFn:(e,t)=>$(e,t,n),onSuccess:async({userId:e})=>{f(!0);try{let s=await (0,C.checkPaymentSubscription)(e);if(await (0,_.getQueryClient)().invalidateQueries({queryKey:["pet_owners"],exact:!1}),!s){await r((0,P.toPaymentSubscription)(p),!1,!0),await (0,F.backgroundLogoutForNativeApp)();return}if(!l){if((0,v.isAllowedDesktopNavigation)())return void t.push(g);t.push((0,P.toUserSubscriptionUpdate)("profile",`locale=${a}`));return}let[o,n]=await Promise.all([O(),k.get(L.PreferencesEnum.Language)]),c=n||a||"de";if(await (0,N.updateUserLanguage)(c),!o)return void t.push(`${(0,P.toRegistration)()}?locale=${c}`);i(c);let u=g.includes("?")?"&":"?";t.replace(`${g}${u}locale=${c}`)}finally{f(!1)}},onError:async t=>{e&&e(),t?.message==="doctorCanNotLoginInThisApp"?(d.toast.error(n("doctorC
1anNotLoginInThisApp")),await b.supabase.auth.signOut()):t?.message==="partnerCanNotLoginInThisApp"?(d.toast.error(n("partnerCanNotLoginInThisApp")),await b.supabase.auth.signOut()):t?.message==="userDeactivated"&&(d.toast.error(n("userDeactivated")),await b.supabase.auth.signOut()),f(!1)}});return{isLoading:x||j,...E}}(()=>{V("password","")}),q=(0,u.useCallback)((e,t=!1)=>{if(e){if("userDeactivated"===e)return s("userDeactivated");else if("doctorCanNotLoginInThisApp"===e)return s("doctorCanNotLoginInThisApp");else if("partnerCanNotLoginInThisApp"===e)return s("partnerCanNotLoginInThisApp")}return t?"":e},[s]),W=(0,u.useMemo)(()=>q(E?.error?.message||""),[E?.error?.message,s]);return(0,t.jsxs)("form",{className:"flex-col flex mb-[30px]",onSubmit:g,children:[(0,t.jsxs)(B.FormItem,{label:i("fields.email.label"),labelClassName:"white"===e?"text-white":"",children:[(0,t.jsx)(x.Input,{placeholder:i("fields.email.placeholder"),type:"email",...m("email"),error:!!j.email?.message,disabled:E.isPending}),j.email&&(0,t.jsx)(M.ErrorText,{text:j.email.message})]}),(0,t.jsxs)(B.FormItem,{label:i("fields.password.label"),labelClassName:"white"===e?"text-white":"",children:[(0,t.jsx)(x.Input,{placeholder:i("fields.password.placeholder"),type:"password",showPasswordToggle:!0,...m("password"),error:!!j.password?.message,disabled:E.isPending}),j.password&&(0,t.jsx)(M.ErrorText,{text:j.password.message})]}),(0,t.jsx)(p.default,{href:(0,P.toPasswordReset)(),className:(0,w.cn)("text-Violet-500 text-base font-bold mb-[30px]","white"===e&&"text-white"),children:i("links.forgotPassword")}),E.isError&&(0,t.jsx)(M.ErrorText,{text:W,className:"mb-2 -mt-3.5"}),(0,t.jsx)(f.Button,{type:"submit",variant:"redNatural",isLoading:E.isPending||D,children:i("actions.login")}),(0,t.jsx)(U.AlternativeLogin,{promoCode:l,color:"white"===e?"#fff":"var(--dark)"}),r&&(0,t.jsxs)("div",{className:"inline-flex justify-center items-center gap-1 flex-wrap mt-5",children:[(0,t.jsx)("p",{className:" text-stone-500 text-base font-semibold ",children:a("loginForm.noAccount")}),(0,t.jsx)(p.default,{href:(0,P.toRegistrationEmail)(l),className:" text-Violet-500 text-base font-bold",children:i("actions.signUp")})]})]})};var V=e.i(330451);let q=["userDeactivated","doctorCanNotLoginInThisApp","partnerCanNotLoginInThisApp"];function W(){let[e,o]=(0,u.useState)("Registration"),d=(0,c.useTranslations)();return(0,t.jsxs)(a.DesktopFormWithSideImageLayout,{imageUrl:"/static/images/onboarding/slide-1.webp",className:"relative",children:[(0,t.jsx)(i.LanguageChange,{type:"dropdown",className:"absolute !top-16 !right-18"}),(0,t.jsxs)("div",{className:"h-fit w-full flex flex-col max-w-2xl mx-auto my-auto min-h-[612px]",children:[(0,t.jsx)(s.Stepper,{currentStep:1,steps:4,className:(0,w.cn)("mb-[68px]","Login"===e&&"opacity-0")}),(0,t.jsx)(l.Tabs,{defaultValue:"Registration",className:"p-1 bg-white rounded-2xl w-full mb-[30px]",onValueChange:o,children:(0,t.jsxs)(l.TabsList,{className:"w-full bg-transparent gap-2",children:[(0,t.jsxs)(l.TabsTrigger,{className:"relative px-3 py-4 text-Text-Default text-sm rounded-[10px] font-bold bg-[var(--grey-500)] text-[var(--dark)] data-[state=active]:bg-[var(--dark)] data-[state=active]:text-white data-[state=active]:shadow-none cursor-pointer",value:"Registration",children:[(0,t.jsx)(n.Ripple,{}),d("common.actions.signUp")]}),(0,t.jsxs)(l.TabsTrigger,{className:"relative px-3 py-4 text-Text-Default text-sm rounded-[10px] font-bold bg-[var(--grey-500)] text-[var(--dark)] data-[state=active]:bg-[var(--dark)] data-[state=active]:text-white data-[state=active]:shadow-none cursor-pointer",value:"Login",children:[(0,t.jsx)(n.Ripple,{}),d("common.actions.login")]})]})}),"Registration"===e&&(0,t.jsxs)("div",{className:"",children:[(0,t.jsx)("h2",{className:"self-stretch justify-start text-white text-3xl font-bold leading-loose mb-[32px]",children:d("common.actions.signUp")}),(0,t.jsx)(r.EmailRegistrationForm,{theme:"white"})]}),"Login"===e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h2",{className:"self-stretch justify-start text-white text-3xl font-bold leading-loose mb-[32px]",children:d("common.actions.login")}),(0,t.jsx)(D,{theme:"white"})]})]})]})}e.s(["default",0,function(){let e=(0,c.useTranslations)("common"),a=(0,c.useTranslations)(),s=(0,o.useIsMobileNative)(),r=(0,u.useCallback)(e=>{let t=q.includes(e)?a(e):"";d.toast.error(t||a("common.errors.generic_try_again"))},[a]);return(0,V.useQueryParamOnce)("errorMessage",r),(0,t.jsx)(t.Fragment,{children:s?(0,t.jsxs)(g.BottomSlideLayout,{renderHeader:()=>(0,t.jsx)("div",{className:"relative mt-[-15px] flex justify-end",children:(0,t.jsx)(i.LanguageChange,{type:"dropdown",className:"static mb
1-[-10px] [&_span]:text-white [&_path]:fill-white hover:[&_span]:text-gray-300 hover:[&_path]:fill-gray-300"})}),children:[(0,t.jsxs)("div",{className:"grid gap-2 items-center grid-cols-[40px_auto_40px] w-full mb-[10px]",children:[(0,t.jsx)(m.BackButton,{force_url:(0,P.toOnboarding)()}),(0,t.jsx)("h1",{className:"text-center justify-start text-Text-Default text-lg font-bold",children:e("actions.login")})]}),(0,t.jsx)(D,{})]}):(0,t.jsx)(W,{})})}],521180)},311525,e=>{"use strict";var t=e.i(678752),i=e.i(739132),a=e.i(818778),s=e.i(981831);function r({width:e=24,height:i=24,fill:a="none"}){return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:i,viewBox:"0 0 24 24",fill:a,children:[(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.04 12.2615C23.04 11.446 22.9668 10.6619 22.8309 9.90918H12V14.3576H18.1891C17.9225 15.7951 17.1123 17.013 15.8943 17.8285V20.714H19.6109C21.7855 18.7119 23.04 15.7637 23.04 12.2615Z",fill:"#4285F4"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9995 23.5001C15.1045 23.5001 17.7077 22.4703 19.6104 20.7139L15.8938 17.8285C14.864 18.5185 13.5467 18.9262 11.9995 18.9262C9.00425 18.9262 6.46902 16.9032 5.5647 14.1851H1.72266V17.1646C3.61493 20.923 7.50402 23.5001 11.9995 23.5001Z",fill:"#34A853"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.56523 14.185C5.33523 13.495 5.20455 12.7579 5.20455 12C5.20455 11.242 5.33523 10.505 5.56523 9.81499V6.83545H1.72318C0.944318 8.38795 0.5 10.1443 0.5 12C0.5 13.8557 0.944318 15.612 1.72318 17.1645L5.56523 14.185Z",fill:"#FBBC05"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9995 5.07386C13.6879 5.07386 15.2038 5.65409 16.3956 6.79364L19.694 3.49523C17.7024 1.63955 15.0992 0.5 11.9995 0.5C7.50402 0.5 3.61493 3.07705 1.72266 6.83545L5.5647 9.815C6.46902 7.09682 9.00425 5.07386 11.9995 5.07386Z",fill:"#EA4335"})]})}function o({width:e=24,height:i=24,fill:a="white"}){return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:i,viewBox:"0 0 24 24",fill:"none",children:[(0,t.jsx)("rect",{width:"24",height:"24",fill:"black"}),(0,t.jsx)("path",{d:"M21.2808 18.424C20.933 19.2275 20.5213 19.9672 20.0442 20.6472C19.394 21.5743 18.8616 22.216 18.4513 22.5724C17.8153 23.1573 17.1338 23.4568 16.4041 23.4739C15.8802 23.4739 15.2485 23.3248 14.513 23.0224C13.7752 22.7214 13.0972 22.5724 12.4772 22.5724C11.827 22.5724 11.1296 22.7214 10.3837 23.0224C9.63662 23.3248 9.03481 23.4824 8.57468 23.498C7.87491 23.5278 7.1774 23.2197 6.48118 22.5724C6.03681 22.1848 5.48099 21.5204 4.81515 20.5791C4.10075 19.5739 3.51342 18.4084 3.05329 17.0795C2.56051 15.6442 2.31348 14.2543 2.31348 12.9087C2.31348 11.3673 2.64654 10.0379 3.31366 8.92385C3.83796 8.029 4.53546 7.32312 5.40844 6.80493C6.28142 6.28674 7.22468 6.02267 8.24048 6.00578C8.7963 6.00578 9.52518 6.1777 10.431 6.51559C11.3342 6.85462 11.9141 7.02655 12.1684 7.02655C12.3585 7.02655 13.0028 6.82552 14.0949 6.42473C15.1278 6.05305 15.9995 5.89916 16.7136 5.95978C18.6487 6.11595 20.1024 6.87876 21.0693 8.25303C19.3386 9.30163 18.4826 10.7703 18.4996 12.6544C18.5152 14.122 19.0476 15.3432 20.0939 16.3129C20.5681 16.7629 21.0977 17.1107 21.6868 17.3578C21.5591 17.7283 21.4242 18.0832 21.2808 18.424ZM16.8428 0.960131C16.8428 2.11039 16.4226 3.18439 15.5849 4.17847C14.5741 5.36023 13.3514 6.04311 12.0256 5.93536C12.0087 5.79736 11.9989 5.65213 11.9989 5.49951C11.9989 4.39526 12.4796 3.21349 13.3333 2.24724C13.7595 1.75801 14.3015 1.35122 14.9588 1.02671C15.6147 0.707053 16.2352 0.530273 16.8187 0.5C16.8357 0.653772 16.8428 0.807554 16.8428 0.960116V0.960131Z",fill:a})]})}var n=e.i(897874),l=e.i(772350),c=e.i(226043),u=e.i(405210),d=e.i(850395);let m="android"===c.Capacitor.getPlatform();e.s(["AlternativeLogin",0,({isChecked:e,handleClick:g,color:p="#fff",isCheckedNewsletter:h=!1,promoCode:x})=>{let f=(0,i.useTranslations)("common.auth"),{signInWithApple:w,isLoading:v}=(0,l.useAppleAuth)(h,!1,x),{signInWithGoogle:b,isLoading:C}=(0,n.useGoogleAuth)(h,!1,x),{redirectToBrowser:j}=(0,u.useRedirectToBrowser)(),N=(0,a.useCallback)(()=>{g?.(),(e||void 0===e)&&(c.Capacitor.isNativePlatform()?j((0,d.toSocialAuthInitiate)("google",h,!0,x),!0):b())},[j,b,e]),y=(0,a.useCallback)(()=>{g?.(),(e||void 0===e)&&(c.Capacitor.isNativePlatform()?j((0,d.toSocialAuthInitiate)("apple",h,!0,x),!0):w())},[j,w,e]);return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 my-5",children:[(0,t.jsx)("div",{className:"flex-1 h-px",style:{backgroundColor:p}}),(0,t.jsx)("span",{className:"text-lg font-semibold",style:{color:p},children:f("or")}
1),(0,t.jsx)("div",{className:"flex-1 h-px",style:{backgroundColor:p}})]}),(0,t.jsxs)(s.Button,{type:"button",variant:"lightGray",className:"w-full",onClick:N,disabled:C||v,isLoading:C,children:[(0,t.jsx)(r,{}),(0,t.jsx)("div",{className:"justify-start text-neutral-900 text-base font-semibold ml-[15px]",children:f("continue_google")})]}),!m&&(0,t.jsxs)(s.Button,{type:"button",variant:"dark",className:"w-full !bg-[var(--dark-1200)] mt-[20px]",onClick:y,disabled:C||v,isLoading:v,children:[(0,t.jsx)(o,{}),(0,t.jsx)("div",{className:"justify-start text-white text-base font-semibold ml-[15px]",children:f("continue_apple")})]})]})}],311525)},522832,e=>{"use strict";var t=e.i(678752),i=e.i(397970);e.s(["DesktopFormWithSideImageLayout",0,({children:e,imageUrl:a,className:s})=>(0,t.jsxs)("div",{className:`h-screen min-h-[100svh] bg-[var(--purple)] flex gap-[40px] overflow-y-auto py-[44px] px-[52px] relative max-md:py-[22px] max-md:px-[30px] ${s}`,children:[(0,t.jsx)("div",{className:"w-full flex flex-col",children:e}),a&&(0,t.jsx)("div",{className:"relative w-full rounded-[15px] overflow-hidden",children:(0,t.jsx)(i.AvatarImage,{img:a,alt:"pet",fill:!0,quality:100,imageClassName:"object-cover object-center",fallback:null,spinnerClassName:"w-16 h-16"})})]})])},10355,e=>{"use strict";var t=e.i(678752),i=e.i(311525),a=e.i(605280),s=e.i(549398),r=e.i(90257),o=e.i(276249),n=e.i(330451),l=e.i(405210),c=e.i(981831),u=e.i(325329),d=e.i(189746),m=e.i(183144),g=e.i(632137),p=e.i(77274),h=e.i(739132),x=e.i(234796),f=e.i(638955),w=e.i(818778);e.s(["EmailRegistrationForm",0,({theme:e})=>{let[v,b]=(0,w.useState)(!1),[C,j]=(0,w.useState)(!1),[N,y]=(0,w.useState)(!1),{redirectToBrowser:T}=(0,l.useRedirectToBrowser)(),k=(0,h.useTranslations)("onboarding"),L=(0,h.useTranslations)("common"),_=(0,o.useIsMobileNative)(),P=(0,p.useLocale)(),S=(0,x.useSearchParams)(),A=(0,f.getPromoCodeParam)(S);(0,n.useQueryParamOnce)("isCheckedNewsletter",e=>{j("true"===e)});let{register:R,handleSubmit:I,formState:{errors:E},mutation:F}=(0,r.useEmailRegistration)(!1,C,A);return(0,t.jsxs)("form",{className:"flex flex-col h-full",onSubmit:e=>{e.preventDefault(),y(!0),(_||v)&&I()},children:[_&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h1",{className:"text-color-text text-xl font-bold mb-1",children:k("emailRegistrationForm.title")}),(0,t.jsx)("p",{className:"text-Text-Subtitle text-base font-medium mb-[10px]",children:k("emailRegistrationForm.description")})]}),(0,t.jsxs)(a.FormItem,{label:L("fields.email.label"),labelClassName:"white"===e?"text-white":"",children:[(0,t.jsx)(m.Input,{placeholder:L("fields.email.placeholder"),type:"email",...R("email"),error:!!E.email?.message}),E.email&&(0,t.jsx)(d.ErrorText,{text:E.email.message})]}),!_&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex gap-3 mb-3",children:[(0,t.jsx)(u.Checkbox,{id:"terms",variant:"white",className:"mt-0.75",error:N&&!v,checked:v,onCheckedChange:e=>b(!!e)}),(0,t.jsx)("label",{htmlFor:"terms",className:(0,g.cn)("self-stretch justify-start text-white text-base font-medium",N&&!v&&"text-[var(--red-700)]"),children:k.rich("registrationEmailPage.consent",{terms:e=>(0,t.jsx)("span",{className:"underline",onClick:()=>T(s.APP_INFO_LINKS.TERMS_OF_SERVICE?.[P],!0),children:e}),privacy:e=>(0,t.jsx)("span",{className:"underline",onClick:()=>T(s.APP_INFO_LINKS.PRIVACY_POLICY?.[P],!0),children:e})})})]}),(0,t.jsxs)("div",{className:"flex gap-3 mb-6",children:[(0,t.jsx)(u.Checkbox,{id:"newsletter",variant:"white",className:"mt-0.75",checked:C,onCheckedChange:e=>j(!!e)}),(0,t.jsx)("label",{htmlFor:"newsletter",className:(0,g.cn)("self-stretch justify-start text-white text-base font-medium"),children:k("registrationEmailPage.newsletterConsent")})]})]}),(0,t.jsx)(c.Button,{variant:"redNatural",className:"mt-[18px]",type:"submit",isLoading:F.isPending,children:L("actions.createAccount")}),!_&&(0,t.jsx)(i.AlternativeLogin,{isChecked:v,handleClick:()=>y(!0),isCheckedNewsletter:C,promoCode:A})]})}])},90257,e=>{"use strict";var t=e.i(77274),i=e.i(739132),a=e.i(234796),s=e.i(133423),r=e.i(629106),o=e.i(932464),n=e.i(844117),l=e.i(832356);let c=l.z.object({email:l.z.string().email()});var u=e.i(850395);e.s(["useEmailRegistration",0,function(e=!1,l=!0,d){let m=(0,a.useRouter)(),{setInitialState:g}=(0,n.useInitialContext)(),p=(0,t.useLocale)(),h=(0,i.useTranslations)(),{api:x}=(0,o.useApi)();return{...(0,r.useSupabaseForm)({schema:c,mutationFn:async(t,i)=>{g("registrationEmail",i.email);let a=(await x.post("/auth/register",{email:i.email,locale:p,resend:e,isCheckedNewsletter:l,promoCode:d})).data;if(a?.code==="user_exist")throw Error("user_exist")},onSuccess:()=>{m.push((0,u.toRegistrationEmailSent)())},onError:(e,{reset:t})=>(s.toast.error("user_exist"===e.message?h("userAlreadyRegistered"):h("common.errors.generic_try_again")),t())})}}],90257)},897874,772350,e=>{"use strict";var t=e.i(77274),i=e.i(739132),a=e.i(818778),s=e.i(133423),r=e.i(551804);e.s(["useGoogleAuth",0,function(e=!1,o=!1,n){let[l,c]=(0,a.useState)(!1),u=(0,i.useTranslations)(),d=(0,t.useLocale)();return{signInWithGoogle:async()=>{try{c(!0),await new Promise(e=>setTimeout(e,1e3));let{data:t,error:i}=await r.supabase.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}/auth/callback?locale=${d}&isCheckedNewsletter=${e}${o?"&platform=mobile":""}${n?`&promoCode=${encodeURIComponent(n)}`:""}`,queryParams:{access_type:"offline",prompt:"consent",locale:d,isCheckedNewsletter:e.toString()},skipBrowserRedirect:!0}});if(i){console.error("Google OAuth error:",i),s.toast.error(u("common.errors.generic_try_again"));return}if(!t?.url)return void s.toast.error(u("common.errors.login_failed"));let a=0,l=!1;for(;a<20&&!l;){await new Promise(e=>setTimeout(e,100));let e=document.cookie,t=Object.keys(localStorage);l=e.includes("code-verifier")||e.includes("code_verifier")||/sb-[^-]+-auth-token-code
1-verifier/.test(e)||t.some(e=>/sb-[^-]+-auth-token-code-verifier/.test(e)),a++}if(!l){console.error("Code verifier was not created in time"),s.toast.error(u("common.errors.generic_try_again"));return}/mobile|android|iphone/i.test(navigator.userAgent)&&await new Promise(e=>setTimeout(e,300)),window.location.href=t.url}catch(e){console.error("Error during Google sign in:",e),s.toast.error(u("common.errors.generic_try_again"))}finally{c(!1)}},isLoading:l}}],897874),e.s(["useAppleAuth",0,function(e=!1,o=!1,n){let[l,c]=(0,a.useState)(!1),u=(0,i.useTranslations)(),d=(0,t.useLocale)();return{signInWithApple:async()=>{try{c(!0),await new Promise(e=>setTimeout(e,1e3));let t=`${window.location.origin}/auth/callback?locale=${d}&isCheckedNewsletter=${e}${o?"&platform=mobile":""}${n?`&promoCode=${encodeURIComponent(n)}`:""}`,{data:i,error:a}=await r.supabase.auth.signInWithOAuth({provider:"apple",options:{redirectTo:t,skipBrowserRedirect:!0,queryParams:{locale:d,isCheckedNewsletter:e.toString()}}});if(a){console.error("Apple OAuth error:",a),s.toast.error(u("common.errors.login_failed"));return}if(!i?.url)return void s.toast.error(u("common.errors.login_failed"));let l=0,m=!1;for(;l<20&&!m;){await new Promise(e=>setTimeout(e,100));let e=document.cookie,t=Object.keys(localStorage);m=e.includes("code-verifier")||e.includes("code_verifier")||/sb-[^-]+-auth-token-code-verifier/.test(e)||t.some(e=>/sb-[^-]+-auth-token-code-verifier/.test(e)),l++}if(!m){console.error("Code verifier was not created in time"),s.toast.error(u("common.errors.generic_try_again"));return}/mobile|android|iphone/i.test(navigator.userAgent)&&await new Promise(e=>setTimeout(e,300)),window.location.href=i.url}catch(e){console.error("Error during Apple sign in:",e),s.toast.error(u("common.errors.generic_try_again"))}finally{c(!1)}},isLoading:l}}],772350)},989718,e=>{"use strict";var t=e.i(551804),i=e.i(726691),a=e.i(430637);async function s(e){await t.supabase.auth.updateUser({data:{locale:e}})}e.s(["updateUserLanguage",0,s,"useUpdateUserLanguage",0,function(){return(0,a.useMutation)({mutationFn:e=>s(e),onSuccess:async()=>{await (0,i.getQueryClient)().invalidateQueries({queryKey:["profile_settings"]})}})}])},276249,e=>{"use strict";var t=e.i(818778),i=e.i(226043);e.s(["useIsMobileNative",0,function(){let[e,a]=t.default.useState(void 0);return(0,t.useEffect)(()=>{let e,t=i.Capacitor.isNativePlatform(),s=(e=window.navigator.userAgent.toLowerCase(),/iphone|ipad|ipod|android/.test(e)),r=window.matchMedia("(max-width: 767px)"),o=()=>{let e=window.innerWidth<768;a(t||s||e)};return r.addEventListener("change",o),o(),()=>r.removeEventListener("change",o)},[]),!!e}])},330451,e=>{"use strict";var t=e.i(818778),i=e.i(234796);e.s(["useQueryParamOnce",0,function(e,a){let s=(0,i.useRouter)(),r=(0,i.useSearchParams)(),o=(0,i.usePathname)(),n=(0,t.useRef)(null);(0,t.useEffect)(()=>{let t=r.get(e);if(!t||n.current===t)return;n.current=t,a(t);let i=new URLSearchParams(r.toString());i.delete(e);let l=i.toString()?`${o}?${i.toString()}`:o;s.replace(l,{scroll:!1})},[e])}])}]); 2 3//# sourceMappingURL=24y5fxct60gac.js.map
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.