!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e3f8fb2e-b0b6-470b-a967-41920c744121",e._sentryDebugIdIdentifier="sentry-dbid-e3f8fb2e-b0b6-470b-a967-41920c744121")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4430],{1907:function(e,t,a){a.d(t,{S:function(){return m}});var r=a(57437),n=a(61396),s=a.n(n),l=a(36468),o=a(54440),i=a.n(o);let c=e=>i()("flex items-start gap-1 text-xs text-gray-450 md:items-center md:text-sm mb-2 md:mb-4 xl:mb-6",e);var m=e=>{let{links:t,currentLocation:a,className:n}=e;return(0,r.jsxs)("div",{className:c(n),children:[(0,r.jsx)(s(),{href:"/",className:"text-black-main hover:text-pink-100 focus:text-pink-100 active:text-pink-300",children:"Головна"}),(null==t?void 0:t.length)&&t.map((e,t)=>(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(l.fY0,{size:16,className:"mr-1 rotate-90"}),(0,r.jsx)(s(),{href:e.href,className:"text-black-main hover:text-pink-100 focus:text-pink-100 active:text-pink-300",children:e.name},t)]},t)),(0,r.jsx)(l.fY0,{size:16,className:"rotate-90"}),(0,r.jsx)("span",{children:a})]})}},63471:function(e,t,a){a.d(t,{l:function(){return L}});var r=a(57437),n=a(92164),s=a(38469),l=a(61865),o=a(54440),i=a.n(o);let c=e=>i()(e),m=e=>i()("justify-center",{"mt-[35px] xl:!h-12 xl:!text-sm":"loginPhone"===e||"loginEmail"===e,"":"paymentPhone"===e||"paymentEmail"===e});var u=a(29894),d=a(64951),p=a(11490),x=a(27431);let h=(e,t)=>i()("bg-white custom-checkbox absolute -ml-7 flex h-5 w-5 items-center justify-center rounded border transition-all duration-300",{"border-gray-400 group-hover/checkbox:border-black-light group-focus/checkbox:border-black-light":!e&&!t,"border-pink-100":e,"!border-notify-error":t});var g=e=>{let{staticData:t,options:a,errors:n,control:s,isChecked:o}=e,{label:i}=t,{name:c,type:m,required:u}=a,d=n[c];return(0,r.jsxs)("label",{className:"group/checkbox relative flex max-w-fit pl-8 text-black-light hover:cursor-pointer",children:[(0,r.jsx)(l.Qr,{shouldUnregister:!0,name:c,rules:{required:u},control:s,render:e=>{let{field:t}=e;return(0,r.jsx)("input",{...t,className:"hidden-checkbox",type:m})}}),(0,r.jsx)("span",{className:h(o,d),"aria-label":"Іконка підтвердження",children:o&&(0,r.jsx)(x.dZ6,{width:18,height:18,"aria-hidden":!0,className:"text-pink-100"})}),(0,r.jsx)("span",{className:"block text-sm",children:i})]})},f=a(2265),y=a(88920),b=a(47093),v=a.n(b);let w=e=>i()("group/input relative flex flex-col gap-1 md:gap-2",e),k=(e,t,a,r)=>i()("outline-without input-autofill pl-4 flex border h-10 text-sm rounded-xl bg-white placeholder-gray-650",{"border-gray-400 group-hover/input:border-black-light focus:border-black-light":!a,"border-notify-error":a,"pr-4":"password"!==e,"pr-12 tracking-[6px]":"password"===e&&"password"!==t,"tracking-[10px]":"password"===e&&"password"===t,"md:h-12 md:text-lg":"paymentEmail"!==r&&"paymentPhone"!==r,"md:h-10 md:text-sm xl:h-12":"paymentEmail"===r||"paymentPhone"===r}),j=e=>i()("absolute right-4 top-1/2 flex -translate-y-[2px] items-center justify-center text-[10px] md:translate-y-0",{"text-gray-400":"password"===e},{"text-pink-100":"password"!==e}),N=e=>i()("absolute right-4 top-1/2 text-notify-error",{"-translate-y-[2px] md:translate-y-0":"paymentPhone"!==e&&"paymentEmail"!==e},{"-translate-y-3":"paymentPhone"===e||"paymentEmail"===e});var S=e=>{let{formVariant:t,staticData:a,register:n,watch:s,control:o,options:i,errors:c,className:m=""}=e,{name:u,label:d,placeholder:p,error:x}=a,[h,g]=(0,f.useState)(i.type),b=c[u],S=e=>{switch(e){case"password":g("text");break;case"text":g("password")}};return(0,r.jsxs)("label",{className:w(m),children:["paymentPhone"!==t&&"paymentEmail"!==t&&(0,r.jsx)("span",{className:"text-xs text-gray",children:d}),"phone"!==u&&(0,r.jsx)("input",{className:k(u,h,!!b,t),type:h,placeholder:p||void 0,...n(u,{...i,validate:()=>{if("password"!==u)return;let e=s("password").trim();if(""===e||e.length<4)return"Не менше 4 символів"},pattern:i.pattern?new RegExp(i.pattern):void 0})}),"phone"===u&&(0,r.jsx)(l.Qr,{name:"phone",control:o,rules:{required:!0,minLength:i.minLength,maxLength:i.maxLength},render:e=>{let{field:a}=e;return(0,r.jsx)(v(),{type:"text",name:"phone",maskPlaceholder:"",value:a.value||"",mask:"+38 099 999 99 99",onChange:a.onChange,placeholder:p,className:k(u,h,!!b,t)})}}),"password"===u&&(0,r.jsx)("button",{type:"button",onClick:()=>S(h),className:j(h),children:"password"===h?(0,r.jsx)(y.rDJ,{size:24,"aria-label":"Показати пароль"}):(0,r.jsx)(y.rzC,{size:24,"aria-label":"Приховати пароль"})}),!!b&&"password"===u&&(0,r.jsx)("span",{className:"absolute top-full mt-1 text-xs text-notify-error",children:(null==b?void 0:b.message)||x}),!!b&&"password"!==u&&"avatar"!==u&&(0,r.jsxs)(r.Fragment,{children:["paymentPhone"!==t&&"paymentEmail"!==t&&(0,r.jsx)("span",{className:"absolute top-full mt-1 text-xs text-notify-error",children:(null==b?void 0:b.message)||x}),(0,r.jsx)(y.BJv,{size:24,className:N(t),"aria-hidden":!0})]})]})},T=e=>{let{staticData:t,checkedValue:a,control:n,options:s}=e,{optionButtons:o}=t,{name:i,type:c,required:m}=s;return(0,r.jsx)(l.Qr,{name:i,control:n,rules:{required:m},render:e=>{let{field:t}=e;return(0,r.jsx)("div",{className:"flex gap-2",children:o.map((e,n)=>(0,r.jsxs)("label",{className:"border border-black-light p-2",children:[e.title,(0,r.jsx)("input",{...t,value:o[n].value,checked:a===e.value,type:c})]},e.value))})}})},I=a(61016),Z=JSON.parse('{"Y":{"name":{"name":"name","type":"text","required":true,"pattern":"^(?![\\\\s-]*[\\\\s-])(?!.*--)(?!.*- )(?!.* -)(?!.*\'-)(?=.*[A-Za-zА-Яа-яЇїІіЄєҐґ])[A-Za-zА-Яа-яЇїІіЄєҐґ\' -]+$","minLength":2,"maxLength":70},"phone":{"name":"phone","type":"text","required":true,"pattern":"^\\\\+[0-9]+$","minLength":17,"maxLength":17},"email":{"name":"email","type":"text","required":true,"pattern":"^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?@[a-zA-Z0-9.-]+(?:\\\\.[a-zA-Z]{2,})+$","minLength":{"value":6,"message":"Не менше 6 символів"},"maxLength":{"value":63,"message":"Не більше 63 символів"}},"password":{"name":"password","type":"password","required":true,"minLength":{"value":6,"message":"Не менше 6 символів"},"maxLength":{"value":40,"message":"Не більше 40 символів"}},"avatar":{"name":"avatar","type":"file","required":false},"paymentMethod":{"name":"paymentMethod","type":"radio","required":true},"agreement":{"name":"agreement","type":"checkbox","required":true}}}'),E=JSON.parse('{"loginPhone":{"inputs":[{"name":"phone","label":"Номер мобільного","placeholder":"+38 066 000 00 00","error":"Ви ввели невірний формат телефону"}],"button":{"submitText":"Далі"}},"loginEmail":{"inputs":[{"name":"email","label":"Email","placeholder":"Введіть ваш email","error":"Ви вказали email у невірному форматі"}],"button":{"submitText":"Далі"}},"paymentPhone":{"inputs":[{"name":"phone","label":"","placeholder":"Введіть свій мобільний номер","error":"Ви ввели невірний формат телефону"}],"button":{"submitText":"Далі"}},"paymentEmail":{"inputs":[{"name":"email","label":"","placeholder":"Введіть свій email","error":"Ви вказали email у невірному форматі"}],"button":{"submitText":"Далі"}},"payment":{"inputs":[{"name":"email","label":"Куди надсилати квитки","placeholder":"Вкажіть свій email","error":"Ви вказали email у невірному форматі"}],"radio":{"optionButtons":[{"value":"portmone","title":"Portmone"},{"value":"googlePay","title":"Google pay"},{"value":"applePay","title":"Apple pay"},{"value":"paymentCard","title":"Платіжна карта"}]},"checkbox":{"label":"При купівлі квитка Ви автоматично погоджуєтесь з правилами нашого кінотеатру"},"button":{"submitText":"Оплатити"}}}'),D=a(69059),P=a(24033),L=e=>{let{id:t,variant:a,isOptionalError:o=!1,actionHandler:i,isLoading:x=!1,setIsLoading:h,className:f=""}=e,y=(0,P.useRouter)(),{register:b,control:v,watch:w,setValue:k,handleSubmit:j,formState:{errors:N}}=(0,l.cI)();(0,D.Z)((0,d.x4)(a),{watch:w,setValue:k,exclude:["password"]});let L=E[a],C=Z.Y,F=async e=>{void 0!==h&&h(!0);try{if("loginEmail"===a){let t=await (0,u.bW)(e.email);if(!t){console.log("Something went wrong. Reload the page and try again \uD83E\uDD37‍♂️");return}p.Z.set("confirmToken",t.confirmToken,{expires:1/96}),sessionStorage.removeItem(s.eu),p.Z.set("userEmail",e.email,{expires:1/12}),i&&i(!0)}if("loginPhone"===a){let t=await (0,u.nK)(e.phone.replaceAll(" ",""));if(!t){console.log("Something went wrong. Reload the page and try again \uD83E\uDD37‍♂️");return}p.Z.set("confirmToken",t.confirmToken,{expires:1/96}),sessionStorage.removeItem(s.eu),p.Z.set("userPhone",e.phone.replaceAll(" ",""),{expires:12}),i&&i(!0)}if("paymentPhone"===a){if(o){console.log("error in formData");return}let t=p.Z.get("user"),a=t?JSON.parse(t):null,r=e.phone.replaceAll(" ","");if(!a||a.phone!==r){let e=await (0,u.nK)(r);if(!e){console.log("Something went wrong. Reload the page and try again \uD83E\uDD37‍♂️");return}p.Z.set("confirmToken",e.confirmToken,{expires:1/96}),p.Z.set("userPhone",r,{expires:1/12}),sessionStorage.removeItem(s._),i&&i(!0);return}let n=sessionStorage.getItem("eventId"),l=sessionStorage.getItem("userCart-".concat(n)),c=l?JSON.parse(l):null;if(n&&c&&c.placeIds.length>0){let e=await (0,u.LV)([],[],n,c.placeIds,{wardrobeCount:c.wardrobes.length,wardrobeId:n.startsWith("kyiv")?"ky1-120":"te1-100"},{email:null,phone:r}),t=await (0,u.$B)({eventId:n,placeIds:c.placeIds,orderSlug:e.slug});t&&(sessionStorage.removeItem(s._),sessionStorage.removeItem("email"),sessionStorage.setItem("phone",r),await (0,d.SF)(t))}else sessionStorage.clear(),p.Z.remove("bookingTimer-".concat(n)),p.Z.remove("slot"),y.replace("/"),await (0,u.DY)();console.log("PAYMENT by PHONE ==> submitted:",r)}if("paymentEmail"===a){if(o){console.log("error in formData");return}let t=p.Z.get("user"),a=t?JSON.parse(t):null;if(!a||a.email!==e.email){let t=await (0,u.bW)(e.email);if(!t){console.log("Something went wrong. Reload the page and try again \uD83E\uDD37‍♂️");return}p.Z.set("confirmToken",t.confirmToken,{expires:1/96}),p.Z.set("userEmail",e.email,{expires:1/12}),sessionStorage.removeItem(s._),i&&i(!0);return}let r=sessionStorage.getItem("eventId"),n=sessionStorage.getItem("userCart-".concat(r)),l=n?JSON.parse(n):null;if(r&&l&&l.placeIds.length>0){let t=await (0,u.LV)([],[],r,l.placeIds,{wardrobeCount:l.wardrobes.length,wardrobeId:r.startsWith("kyiv")?"ky1-120":"te1-100"},{email:e.email,phone:null}),a=await (0,u.$B)({eventId:r,placeIds:l.placeIds,orderSlug:t.slug});a&&(sessionStorage.removeItem(s._),sessionStorage.removeItem("phone"),sessionStorage.setItem("email",e.email),await (0,d.SF)(a))}else sessionStorage.clear(),p.Z.remove("bookingTimer-".concat(r)),p.Z.remove("slot"),y.replace("/"),await (0,u.DY)();console.log("PAYMENT by EMAIL ==> submitted:",e.email)}}catch(e){if((0,n.IZ)(e)){var t;console.log(null===(t=e.response)||void 0===t?void 0:t.data.message)}}finally{void 0!==h&&h(!1)}};return(0,r.jsxs)("form",{id:t,noValidate:!0,onSubmit:j(F),className:c(f),children:[L.radio&&(0,r.jsx)(T,{staticData:L.radio,options:C.paymentMethod,control:v,checkedValue:w().paymentMethod}),L.inputs.map(e=>(0,r.jsx)(S,{formVariant:a,staticData:e,options:C[e.name],register:b,watch:w,control:v,errors:N,className:"".concat(e.name,"-").concat(a)},e.name)),L.checkbox&&(0,r.jsx)(g,{staticData:L.checkbox,control:v,options:C.agreement,isChecked:!!w().agreement,errors:N}),"paymentPhone"!==a&&"paymentEmail"!==a&&(0,r.jsx)(I.K,{variant:"filled",type:"submit",disabled:x,className:m(a),children:L.button.submitText})]})}},86298:function(e,t,a){a.d(t,{K:function(){return k}});var r=a(57437),n=a(92164),s=a(2265),l=a(29894),o=a(64951),i=a(11490),c=a(54440),m=a.n(c);let u=e=>m()("h-[30px] w-[30px] fill-transparent stroke-2 rotate-90 -scale-x-100 translate-x-full translate-y-full",{"stroke-gray-600":!e,"stroke-orange-primary ":e}),d=e=>m()("absolute text-xs",{"text-orange-primary":e,"text-gray-600":!e});var p=e=>{let{totalSeconds:t,isActiveTimer:a}=e,[n,l]=(0,s.useState)(t),o=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!a){o.current&&(o.current.style.strokeDasharray="0");return}l(t);let e=setInterval(()=>{l(e=>{let a=e-1;if(o.current){let e=2*Math.PI*o.current.r.baseVal.value;o.current.style.strokeDasharray=e.toString(),o.current.style.strokeLinecap="round";let r=a/t*e;o.current.style.strokeDashoffset=(e-r).toString()}return a})},1e3);return()=>{clearInterval(e)}},[a,t]),(0,r.jsxs)("div",{className:"circle pointer-events-none relative flex h-8 w-8 items-center justify-center",children:[(0,r.jsx)("svg",{className:"relative h-8 w-8",children:(0,r.jsx)("circle",{ref:o,cx:16,cy:16,r:15,className:u(a)})}),(0,r.jsxs)("div",{className:d(a),children:[(0,r.jsx)("span",{children:n}),"с"]})]})},x=a(38469),h=a(75540),g=a(61016),f=a(38354);let y=(e,t)=>m()("bg-white flex h-10 min-w-[12px] md:h-12 md:min-w-0 md:w-[42px] items-center justify-center rounded-xl text-center text-lg outline outline-1",{"outline-gray-400":!t[e],"outline-notify-error":t[e]});var b=a(4202),v=a(24033);let w=/^[0-9]+$/;var k=e=>{let{variant:t,place:a,isUpdate:c=!1,actionHandler:m}=e,[u,d]=(0,s.useState)(Array(6).fill("")),[k,j]=(0,s.useState)(Array(6).fill(!1)),[N,S]=(0,s.useState)(!0),[T,I]=(0,s.useState)(!1),[Z,E]=(0,s.useState)(!1),D=(0,v.useRouter)(),P=(0,b.TL)();(0,s.useEffect)(()=>{T?document.body.classList.toggle("overflow-hidden"):document.body.classList.remove("overflow-hidden")},[T]);let L=i.Z.get("userEmail"),C=i.Z.get("userPhone"),F=Array.from({length:6},()=>(0,s.createRef)()),z=(0,s.useRef)(null),A=(0,s.useRef)(null);(0,s.useEffect)(()=>{z&&z.current&&z.current.focus()},[]),(0,s.useEffect)(()=>{if(!N)return;let e=setTimeout(()=>{S(!1)},3e4);return()=>clearTimeout(e)},[N]);let R=e=>{e<F.length-1&&F[e+1].current.focus()},_=(e,t)=>{if(T)return;let a=e.target.value;j(e=>{let r=[...e];return r[t]=!w.test(a),r}),d(e=>{let r=[...e];return r[t]=a,r}),1===a.length&&w.test(a)&&R(t)},W=(e,t)=>{if("Backspace"===e.key){if(""===u[t]&&t>1){F[t-1].current.focus(),d(e=>{let a=[...e];return a[t-1]="",a});return}if(""===u[t]&&1===t&&z&&z.current){z.current.focus(),d(e=>{let t=[...e];return t[0]="",t});return}if(""!==u[t]&&t>0){F[t].current.focus(),d(e=>{let a=[...e];return a[t]="",a});return}if(""!==u[t]&&0===t&&z&&z.current){z.current.focus(),d(e=>{let t=[...e];return t[0]="",t});return}}},J=async(e,t)=>{if(e.preventDefault(),0===t)try{let t=e.clipboardData.getData("text")||await navigator.clipboard.readText(),a=t.split("");if(6!==a.length)return;d(a)}catch(e){console.log("Failed to read clipboard data:",e)}},V=async e=>{I(!0);try{if(!c&&"email"===e&&L){let e=await (0,l.bW)(L);if(!e){console.log("Something went wrong. Reload the page and try again \uD83E\uDD37‍♂️");return}i.Z.set("confirmToken",e.confirmToken,{expires:1/96}),S(!0)}if(!c&&"phone"===e&&C){let e=await (0,l.nK)(C);if(!e){console.log("Something went wrong. Reload the page and try again \uD83E\uDD37‍♂️");return}i.Z.set("confirmToken",e.confirmToken,{expires:1/96}),S(!0)}if(c&&"email"===e&&L){let e=await (0,l.gW)(L);if(!e){console.log("Something went wrong. Reload the page and try again \uD83E\uDD37‍♂️");return}i.Z.set("confirmToken",e.confirmToken,{expires:1/96}),S(!0)}if(c&&"phone"===e&&C){let e=await (0,l._e)(C.replaceAll(" ",""));if(!e){console.log("Something went wrong. Reload the page and try again \uD83E\uDD37‍♂️");return}i.Z.set("confirmToken",e.confirmToken,{expires:1/96}),S(!0)}}catch(e){if((0,n.IZ)(e)){var t;console.log(null===(t=e.response)||void 0===t?void 0:t.data.message)}}finally{I(!1)}},M=(0,s.useCallback)(async e=>{if(e&&e.preventDefault(),u.forEach((e,t)=>{w.test(e)||j(e=>{let a=[...e];return a[t]=!0,a})}),!u.some(e=>!w.test(e)))try{I(!0),E(!1);let e=u.join(""),r=i.Z.get("confirmToken");if(!r){m&&m(!1);return}let{accessToken:n,refreshToken:s,user:d}=await (0,l.uP)(r,e);if(i.Z.set("accessToken",n,{expires:1/24}),"seatsPage"!==a&&(i.Z.set("user",JSON.stringify(d),{expires:1/24}),P((0,f.I8)(!!n)),i.Z.set("refreshToken",s,{expires:14})),c&&"email"===t&&L&&(await (0,l.ic)({email:L}),i.Z.remove("loginWithService")),c&&"phone"===t&&C&&(await (0,l.ic)({phone:C}),i.Z.remove("loginWithService")),i.Z.remove("confirmToken"),i.Z.remove("userEmail"),i.Z.remove("userPhone"),"loginPage"===a&&D.replace(i.Z.get("redirectLink")||"/account"),"personalInfoPage"===a&&m&&m(!1),"seatsPage"===a&&m){let e=sessionStorage.getItem("eventId"),t=sessionStorage.getItem("userCart-".concat(e)),a=t?JSON.parse(t):null;if(e&&a&&a.placeIds.length>0){I(!0);let t=await (0,l.LV)([],[],e,a.placeIds,{wardrobeCount:a.wardrobes.length,wardrobeId:e.startsWith("kyiv")?"ky1-120":"te1-100"},{email:L||null,phone:C||null});I(!0);let r=await (0,l.$B)({eventId:e,placeIds:a.placeIds,orderSlug:t.slug});r&&(sessionStorage.removeItem(x._),L&&(sessionStorage.removeItem("phone"),sessionStorage.setItem("email",L)),C&&(sessionStorage.removeItem("email"),sessionStorage.setItem("phone",C)),I(!0),await (0,o.SF)(r)),i.Z.remove("accessToken")}else sessionStorage.clear(),i.Z.remove("bookingTimer-".concat(e)),i.Z.remove("slot"),D.replace("/"),await (0,l.DY)(),m(!1)}}catch(e){if((0,n.IZ)(e)){var r;console.log(null===(r=e.response)||void 0===r?void 0:r.data.message),E(!0)}}finally{I(!1)}},[u,P,c,t,L,C,a,m,D]);return(0,s.useEffect)(()=>{u.some(e=>!w.test(e))||M()},[u,M]),(0,r.jsxs)("form",{ref:A,noValidate:!0,autoComplete:"off",onSubmit:M,className:"mx-auto flex max-w-[302px] flex-col md:max-w-none",children:[(0,r.jsx)("span",{className:"mb-2 text-xs text-black-light",children:"Перевірочний код"}),(0,r.jsxs)("div",{className:"relative mb-[43px] flex w-full justify-between gap-1 md:mb-[39px]",children:[F.map((e,t)=>(0,r.jsx)("input",{type:(0,o.s2)()?"number":"text",maxLength:1,value:u[t],ref:0===t?z:e,onChange:e=>_(e,t),onKeyDown:e=>W(e,t),onPaste:e=>J(e,t),className:y(t,k)},t)),Z&&(0,r.jsx)("span",{className:"absolute top-full mt-2 text-xs text-notify-error",children:"Ви ввели неправильний код, спробуйте ще"})]}),(0,r.jsx)(g.K,{variant:"filled",type:"submit",disabled:T,className:"mb-6 justify-center md:mb-5 xl:!h-12 xl:!text-sm",children:"Відправити"}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(p,{totalSeconds:30,isActiveTimer:N}),(0,r.jsx)("button",{type:"button",disabled:N||T,onClick:()=>V(t),className:"w-fit text-sm text-blue-secondary hover:text-pink-100 disabled:text-gray-600 md:text-sm",children:"Не прийшов код? Відправити ще раз"})]}),T&&(0,r.jsx)(h.a,{isTranslucent:!0})]})}},12683:function(e,t,a){a.d(t,{J:function(){return c}});var r=a(57437),n=a(2265),s=a(24033),l=a(9805),o=a(33097),i=a(61016),c=e=>{let{isOpen:t,modalContent:a,setShouldModalCommonErrorOpen:c}=e,m=(0,s.useRouter)(),u=()=>{if(a.linkto){m.push(a.linkto),c(!1);return}if(a.refresh){m.refresh(),c(!1);return}c(!1)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(l.u,{appear:!0,show:t,as:n.Fragment,children:(0,r.jsxs)(o.V,{as:"div",className:"relative z-[51]",onClose:u,children:[(0,r.jsx)(l.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,r.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-md"})}),(0,r.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,r.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,r.jsx)(l.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,r.jsxs)(o.V.Panel,{className:"w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all md:p-10 xl:rounded-3xl",children:[(0,r.jsxs)("p",{className:"mb-4 text-sm leading-[1.5] xl:text-lg",children:["Упс... ",(0,r.jsx)("br",{})," ",a.modalText]}),(0,r.jsx)(i.K,{variant:"filled",className:"justify-center outline-none",actionHandler:u,children:a.buttonText})]})})})})]})})})}},4892:function(e,t,a){a.d(t,{T:function(){return c}});var r=a(57437),n=a(2265),s=a(9805),l=a(33097),o=a(36468),i=a(86298),c=e=>{let{openModal:t,handleClose:a,isPhoneChanged:c,isUpdate:m,place:u="personalInfoPage",setIsPhoneChanged:d,setIsEmailChanged:p}=e,[x,h]=(0,n.useState)(!1),g=()=>{h(!0),setTimeout(()=>{a()},200)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(s.u,{appear:!0,show:!x&&t,as:n.Fragment,children:(0,r.jsxs)(l.V,{as:"div",className:"relative z-20",onClose:g,children:[(0,r.jsx)(s.u.Child,{as:n.Fragment,enter:"ease-out duration-200",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,r.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-md"})}),(0,r.jsx)("div",{className:"fixed inset-0",children:(0,r.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,r.jsx)(s.u.Child,{as:n.Fragment,enter:"ease-out duration-200",enterFrom:"opacity-0 translate-y-1/3",enterTo:"opacity-100 translate-y-0",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1/3",children:(0,r.jsxs)(l.V.Panel,{className:"relative w-[calc(100%-32px)] max-w-[348px] rounded-2xl bg-white md:w-[440px] md:max-w-none md:rounded-3xl",children:[(0,r.jsx)("button",{type:"button",onClick:g,className:"absolute -right-[13px] -top-[13px] z-10 flex h-6 w-6 items-center justify-center overflow-hidden rounded-full bg-white md:bottom-full md:left-full md:right-auto md:top-auto md:h-12 md:w-12 onlyMobile:border onlyMobile:border-pink-100",children:(0,r.jsx)(o.bjh,{size:16,className:"h-4 w-4 text-pink-100 md:h-6 md:w-6"})}),(0,r.jsxs)("div",{className:"p-5 md:mx-auto md:p-0 md:px-12 md:py-10",children:[(0,r.jsx)("h1",{className:"mb-3 text-lg text-gray-900 md:mb-4 md:text-[27px] xl:text-center",children:"Введіть перевірочний код"}),(0,r.jsxs)("p",{className:"mb-6 w-72 text-xs leading-[1.5] text-[#969696] md:mb-6 md:w-full md:text-base md:text-gray-900",children:["На ваш ",c?"телефон":"Email"," був відправлений 6-ти значний код, введіть його у відповідні поля"]}),(0,r.jsx)("div",{className:"md:mx-auto md:p-0",children:(0,r.jsx)(i.K,{variant:c?"phone":"email",place:u,isUpdate:m,actionHandler:c?d:p})})]})]})})})})]})})})}},72940:function(e,t,a){a.d(t,{Zs:function(){return u},IN:function(){return m},Lm:function(){return r.L}});var r=a(89716),n=a(2265),s=a(24033),l=a(11490),o=a(4202),i=a(38354),c=a(29894);let m=e=>{let t=(0,s.useSearchParams)(),a=(0,s.useRouter)(),r=(0,o.TL)(),m=(0,n.useCallback)(async()=>{let n=t.get("code"),s=t.get("denied")||t.get("error");if(!n||s){a.replace(l.Z.get("redirectLink")||"/");return}try{e(!0);let t=await (0,c.HB)(n);t&&(l.Z.set("accessToken",t.accessToken,{expires:1/24}),l.Z.set("user",JSON.stringify(t.user),{expires:1/24}),l.Z.set("refreshToken",t.refreshToken,{expires:14}),l.Z.set("loginWithService","google",{expires:14}),r((0,i.I8)(!!t.accessToken)))}catch(e){console.log("useGoogleEntryCallback",e)}finally{e(!1),a.replace(l.Z.get("redirectLink")||"/")}},[t,a,e,r]);(0,n.useLayoutEffect)(()=>{m()},[m])},u=e=>{let t=(0,s.useSearchParams)(),a=(0,s.useRouter)(),r=(0,o.TL)(),m=(0,n.useCallback)(async()=>{let n=t.get("code"),s=t.get("denied")||t.get("error");if(!n||s){a.replace(l.Z.get("redirectLink")||"/");return}try{e(!0);let t=await (0,c.T3)(n);t&&(l.Z.set("accessToken",t.accessToken,{expires:1/24}),l.Z.set("user",JSON.stringify(t.user),{expires:1/24}),l.Z.set("refreshToken",t.refreshToken,{expires:14}),l.Z.set("loginWithService","facebook",{expires:14}),r((0,i.I8)(!!t.accessToken)))}catch(e){console.log("useFacebookEntryCallback",e)}finally{e(!1),a.replace(l.Z.get("redirectLink")||"/")}},[t,a,e,r]);(0,n.useLayoutEffect)(()=>{m()},[m])}},89716:function(e,t,a){a.d(t,{L:function(){return s}});var r=a(2265),n=a(38469);let s=()=>{let[e,t]=(0,r.useState)(null);(0,r.useEffect)(()=>{e||t(window.innerWidth);let a=e=>{e.target instanceof Window&&t(e.target.innerWidth)};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[e]);let a=e>0&&e<n.y3,s=e>=n.NB&&e<n.y3,l=e>=n.y3&&e<n.te,o=e>=n.te&&e<n.bb,i=e>=n.bb;return{width:e,isScreenMobile:a,isLargeScreenMobile:s,isScreenTablet:l,isScreenDesktop:o,isLargeScreenDesktop:i}}},38354:function(e,t,a){a.d(t,{I8:function(){return o}});var r=a(35414),n=a(64951);let s=(0,n.Yb)(),l=(0,r.oM)({name:"auth",initialState:s,reducers:{auth(e,t){let{payload:a}=t;return a}}}),{auth:o}=l.actions;t.ZP=l.reducer}}]);