1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,539668,e=>{"use strict";var a=e.i(522459),t=e.i(144908),l=e.i(445739),i=e.i(441875),n=e.i(54972),r=e.i(280019),s=e.i(669492),o=e.i(616403),c=e.i(333857),d=e.i(815314),u=e.i(110537),x=e.i(362790),m=e.i(85562),h=e.i(395099);let p={customerRegister:"activate-customer",recoverPassword:"reset-password"};function T(){return{sendTOTP:(0,x.useMutation)({mutationFn:e=>{let a={type:e.flow,email:e.email};return h.httpClient.post({type:"auth",body:a,path:"get-validation-totp"})},mutationKey:m.MUTATION_KEYS.CUSTOMERS.REQUEST_TOTP_VERIFICATION()}),validateTOTP:(0,x.useMutation)({mutationFn:({flow:e,variables:a})=>{let t=p[e];return h.httpClient.post({type:"auth",body:a,path:t})},mutationKey:m.MUTATION_KEYS.CUSTOMERS.VALIDATE_PASSWORD_OR_REGISTER_RECOVERY()}),validateCRMMerge:(0,x.useMutation)({mutationFn:({flow:e,variables:a})=>{let t="",l={};return"crmExternalEmailValidation"===e?(t="validate-token",l={token:a.targetAccount.token,customerEmail:a.targetAccount.email}):"crmPersonalEmailValidation"===e&&(t="connect-crm-account",l=a),h.httpClient.post({type:"auth",body:l,path:t})},mutationKey:m.MUTATION_KEYS.CUSTOMERS.VALIDATE_CRM_MERGE()})}}let g=(0,t.createContext)(null),f=()=>(0,t.useContext)(g);function j({children:e}){let[l,i]=(0,t.useState)("selectFlow"),[n,r]=(0,t.useState)({externalEmail:"",externalEmailToken:"",internalEmail:"",internalEmailToken:""});return(0,a.jsx)(g.Provider,{value:{currentView:l,changeCurrentView:e=>{i(e)},customerData:n,changeCustomerData:e=>{r(a=>({...a,...e}))}},children:e})}var C=e.i(567120);let y=(0,t.createContext)(null),b=()=>(0,t.useContext)(y);function v({children:e}){let[l,i]=(0,t.useState)("emailSet"),[n,r]=(0,t.useState)({}),[s,o]=(0,t.useState)([]),c=(0,t.useCallback)(e=>{i(e)},[]),d=(0,t.useCallback)(e=>{r(a=>({...a,...e}))},[]),u=(0,t.useCallback)(e=>{switch(e){case"emailSet":let a=(0,C.validateEmail)(n.email);return a||o(["email"]),a;case"activation":return!0}},[n]);return(0,a.jsx)(y.Provider,{value:{currentView:l,changeCurrentView:c,formData:n,changeFormData:d,invalidFields:s,validate:u},children:e})}var E=e.i(414237),w=e.i(866801),A=e.i(135404);let k=(0,t.createContext)(null),S=()=>(0,t.useContext)(k);function R({children:e}){let i=(0,n.useTranslations)("Auth"),{countrySettings:r}=(0,A.usePageSettings)(),{isPending:s,mutateAsync:o}=(0,x.useMutation)({mutationFn:e=>h.httpClient.post({type:"auth",body:e,path:"register-customer"}),mutationKey:m.MUTATION_KEYS.CUSTOMERS.REGISTER_CUSTOMER()}),{mutateAsync:d,isPending:p}=(0,w.default)("customer"),{closeDialog:T}=(0,l.useDialog)(),{showToast:g}=(0,c.useToast)(),{addGTMEvent:f}=(0,u.useTracking)(),[j,y]=(0,t.useState)("requiredField"),[b,v]=(0,t.useState)({type:"private",phoneCode:`${(0,E.getCountryCodeForRegionCode)(r.countryIsoCode)}`}),[S,N]=(0,t.useState)([]),[M,_]=(0,t.useState)(),I=(0,t.useCallback)(e=>{y(e)},[]),P=(0,t.useCallback)(e=>{N([]),v(a=>({...a,...e}))},[]),L=(0,t.useCallback)(e=>{_(e)},[]),O=(0,t.useCallback)(e=>{let a=[],t=(e,t)=>{t||a.push(e)};switch(e){case"requiredField":return t("name",!!b.name&&b.name.length>=2),t("surname",!!b.surname&&b.surname.length>=2),t("phone",(0,C.validatePhone)({phone:b.phone,phoneCode:b.phoneCode})),t("email",(0,C.validateEmail)(b.email)),t("password",(0,C.validatePassword)(b.password)),t("conditionsAccepted",!!b.conditionsAccepted),N(a),0===a.length;case"customerType":return t("type",!!b.type),t("countryIso",!!b.countryIso),N(a),0===a.length;case"personalData":case"activation":return!0}},[b]),D=(0,t.useCallback)(async()=>{let e=null;M&&(e=await d([M]).catch(e=>null)),o({name:b.name||"",surname:b.surname||"",email:b.email||"",password:b.password||"",phone:b.phone||"",phoneCode:b.phoneCode||"",type:b.type,countryIso:b.countryIso?.toLowerCase()||"",commertialName:b.commertialName,description:b.description,photo:e?e[0].imageUrl:b.photo,url:b.url}).then(()=>{y("activation"),f("User registration",{payload:{button:"Register",isAuth:!1,buttonPlace:"session modal"}})}).catch(()=>{T(),g({variant:"error",title:i("ErrorTitle"),content:i("ErrorMessage")})})},[b,y,o,T,g,i,M,d]);return(0,a.jsx)(k.Provider,{value:{currentView:j,changeCurrentView:I,changeFormData:P,validateForm:O,changeAvatarFile:L,invalidFields:S,formData:b,isLoading:s||p,registerCustomer:D},children:e})}function N({email:e,flow:x}){let m=(0,n.useTranslations)("Auth"),{closeDialog:h}=(0,l.useDialog)(),{showToast:p}=(0,c.useToast)(),{addGTMEvent:g}
1=(0,u.useTracking)(),j=f(),C=S(),y=b(),{sendTOTP:v,validateTOTP:E,validateCRMMerge:w}=T(),[A,k]=(0,t.useState)(""),R=(0,t.useMemo)(()=>E.isPending||w.isPending,[E.isPending,w.isPending]),M=(0,t.useMemo)(()=>E.isError||w.isError,[E.isError,w.isError]),_=(0,t.useCallback)(e=>{let{value:a}=e.target;k(a)},[]),I=(0,t.useCallback)(()=>{switch(x){case"recoverPassword":y.changeCurrentView("emailSet");break;case"customerRegister":C.changeCurrentView("personalData");break;case"crmExternalEmailValidation":j.changeCurrentView("externalEmail");break;case"crmPersonalEmailValidation":j.changeCurrentView("inputPersonalEmail")}},[x,y,C,j]),P=(0,t.useCallback)(()=>{switch(x){case"recoverPassword":h(),p({title:m("PasswordRecoverySuccessTitle"),content:m("PasswordRecoverySuccessMessage"),variant:"success"});break;case"customerRegister":p({title:m("SignUpSuccessTitle"),content:m("SignUpSuccessMessage"),variant:"success"}),g("New User",{payload:{button:"Register",isAuth:!1,buttonPlace:"session modal"}}),h();break;case"crmExternalEmailValidation":j.changeCurrentView("inputPersonalEmail"),j.changeCustomerData({externalEmailToken:A});break;case"crmPersonalEmailValidation":h(),p({title:m("CRMMergeSuccessTitle"),content:m("CRMMergeSuccessMessage"),variant:"success"})}},[x,h,p,m,A,j]),L=(0,t.useCallback)(()=>{if(["crmExternalEmailValidation","crmPersonalEmailValidation"].includes(x)){let a={targetAccount:{email:e,token:A},crmAccount:{email:j.customerData.externalEmail,token:j.customerData.externalEmailToken}};w.mutateAsync({flow:x,variables:a}).then(e=>{P()})}else E.mutateAsync({flow:x,variables:{email:e,code:A}}).then(e=>{P()})},[e,A,x,w,E,j,P]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Modal.Header,{extraAction:{icon:(0,a.jsx)(d.BackSolid,{}),onClick:I},title:m("AccountVerification.ModalTitle"),onClose:h}),(0,a.jsx)(i.Modal.Content,{children:(0,a.jsxs)("div",{className:"gap-l flex flex-col",children:[(0,a.jsx)(o.Typography,{variant:"subheader",weight:"semibold",children:m("AccountVerification.Title")}),(0,a.jsxs)("div",{className:"gap-s flex flex-col",children:[(0,a.jsx)(o.Typography,{children:m("AccountVerification.TextEmail",{email:e})}),(0,a.jsx)(o.Typography,{children:m("AccountVerification.HelperText")})]}),(0,a.jsx)("div",{className:"gap-l flex max-w-[288px] flex-col",children:(0,a.jsx)(s.Textfield,{type:"text",error:M,helperText:M?m("AccountVerification.ErrorMessage"):"",label:m("AccountVerification.InputLabel"),value:A,onChange:_})})]})}),(0,a.jsx)(i.Modal.Footer,{children:(0,a.jsxs)("div",{className:"gap-m tablet:flex-row flex flex-col items-center justify-between",children:[(0,a.jsx)(r.Button,{loading:R,disabled:R,onClick:L,children:m("AccountVerification.VerifyBtnLabel")}),(0,a.jsx)(r.Button,{loading:v.isPending,disabled:v.isPending,onClick:()=>{v.mutate({email:e,flow:x})},variant:"text",style:{padding:0},icon:(0,a.jsx)(d.Refresh,{}),children:m("AccountVerification.ResendBtnLabel")})]})})]})}function M(){let e=(0,n.useTranslations)("Auth.CRMInputExternalEmail"),{closeDialog:c}=(0,l.useDialog)(),{changeCurrentView:u,customerData:x,changeCustomerData:m}=f(),[h,p]=(0,t.useState)(!0),{sendTOTP:g}=T(),j=(0,t.useCallback)(e=>{p(!0),e.preventDefault();let{value:a}=e.target;m({externalEmail:a})},[m]),y=(0,t.useCallback)(()=>{u("selectFlow")},[u]),b=(0,t.useCallback)(()=>{(0,C.validateEmail)(x.externalEmail)?g.mutateAsync({email:x.externalEmail,flow:"crmExternalEmailValidation"}).then(e=>{u("verificationExternal")}).catch(e=>{p(!1)}):p(!1)},[x.externalEmail,g,u]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Modal.Header,{extraAction:{icon:(0,a.jsx)(d.BackSolid,{}),onClick:y},title:e("ModalTitle"),onClose:c}),(0,a.jsx)(i.Modal.Content,{children:(0,a.jsxs)("div",{className:"gap-xl flex flex-col",children:[(0,a.jsx)(o.Typography,{variant:"subheader",weight:"semibold",children:e("Title")}),(0,a.jsx)(o.Typography,{children:e("Description")}),(0,a.jsx)("div",{className:"w-full max-w-[288px]",children:(0,a.jsx)(s.Textfield,{error:!h,helperText:h?"":e("EmailError"),label:e("EmailLabel"),value:x.externalEmail,onChange:j,helperIcon:!h&&(0,a.jsx)(d.Information,{})})})]})}),(0,a.jsx)(i.Modal.Footer,{children:(0,a.jsxs)("div",{className:"gap-m tablet:flex-row flex flex-col justify-between",children:[(0,a.jsx)(r.Button,{disabled:g.isPending,loading:g.isPending,onClick:b,children:e("NextBtnLabel")}),(0,a.jsx)(r.Button,{variant:"text",iconPosition:"end",icon:(0,a.jsx)(d.Information,{}),children:e("LegalInfo")})]})})]})}function _(){let e=(0,n.useTranslations)("Auth.CRMInputPersonEmail"),{closeDialog:c}=(0,l.useDialog)(),{changeCurrentView:u,customerData:x,changeCustomerData:m}=f(),[h,p]=(0,t.useState)(!0),{sendTOTP:g}=T(),j=(0,t.useCallback)(e=>{p(!0),e.preventDefault();let{value:a}=e.target;m({internalEmail:a})},[m]),y=(0,t.useCallback)(()=>{(0,C.validateEmail)(x.internalEmail)?g.mutateAsync({email:x.internalEmail,flow:"crmPersonalEmailValidation"}).then(e=>{u("verificationInternal")}).catch(e=>{p(!1)}):p(!1)},[x.internalEmail,g,u]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Modal.Header,{extraAction:{icon:(0,a.jsx)(d.BackSolid,{}),onClick:()=>u("selectFlow")},title:e("ModalTitle"),onClose:c}),(0,a.jsx)(i.Modal.Content,{children:(0,a.jsxs)("div",{className:"gap-xl flex flex-col",children:[(0,a.jsx)(o.Typography,{variant:"subheader",weight:"semibold",children:e("Title")}),(0,a.jsx)(o.Typography,{children:e("Description")}),(0,a.jsx)(s.Textfield,{className:"max-w-[288px]",error:!h,helperText:h?"":e("EmailError"),label:e("EmailLabel"),value:x.internalEmail,onChange:j,helperIcon:!h&&(0,a.jsx)(d.Information,{})})]})}),(0,a.jsx)(i.Modal.Footer,{children:(0,a.jsxs)("div",{className:"gap-m tablet:flex-row flex flex-col justify-between",children:[(0,a.jsx)(r.Button,{disabled:g.isPending,loading:g.isPending,onClick:y,children:e("NextBtnLabel")}),(0,a.jsx)(r.Button,{variant:"text",iconPosition:"end",icon:(0,a.jsx)(d.Information,{}),children:e("LegalInfo")})]})})]})}var I=e.i(478418);let P=(0,t.createContext)(null),L=()=>(0,t.useContext)(P);function O({children:e}){let[l,i]=(0,t.useState)("login"),n=(0,t.useCallback)(e=>{i(e)},[]);return(0,a.jsx)(P.Provider,{value:{currentView:l,changeCurrentView:n},children:e})}function D(){let e=(0,n.useTranslations)("Auth.SelectCRMFlow"),{closeDialog:s}=(0,l.useDialog)(),{changeCurrentView:c}=L(),{changeCurrentView:u}=f(),[x,m]=(0,t.useState)("withExternalId"),h=(0,t.useCallback)(()=>{"withExternalId"===x?c("forgotPassword"):u("externalEmail")},[u,x,c]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Modal.Header,{extraAction:{icon:(0,a.jsx)(d.BackSolid,{}),onClick:()=>c("login")},title:e("ModalTitle"),onClose:s}),(0,a.jsx)(i.Modal.Content,{children:(0,a.jsxs)("div",{className:"gap-l flex flex-col",children:[(0,a.jsx)(o.Typography,{variant:"subheader",weight:"semibold",children:e("Title")}),(0,a.jsxs)("div",{className:"gap-l flex flex-col",children:[(0,a.jsx)(I.Radio,{label:e("WithExternalId"),checked:"withExternalId"===x,onChange:()=>m("withExternalId")}),(0,a.jsx)(I.Radio,{label:e("WithPersonalEmail"),checked:"withPersonalEmail"===x,onChange:()=>m("withPersonalEmail")})]}),(0,a.jsxs)("div",{className:"gap-l flex flex-col",children:[(0,a.jsx)(o.Typography,{children:e("DisclaimerTitle")}),(0,a.jsx)(o.Typography,{children:e("DisclaimerDescription_1")}),(0,a.jsx)(o.Typography,{children:e("DisclaimerDescription_2")})]})]})}),(0,a.jsx)(i.Modal.Footer,{children:(0,a.jsx)(r.Button,{onClick:h,children:e("ButtonNext")})})]})}let U=()=>{let{currentView:e,customerData:l}=f();return(0,t.useMemo)(()=>{switch(e){case"selectFlow":return(0,a.jsx)(D,{});case"externalEmail":return(0,a.jsx)(M,{});
1case"verificationExternal":return(0,a.jsx)(N,{flow:"crmExternalEmailValidation",email:l.externalEmail});case"inputPersonalEmail":return(0,a.jsx)(_,{});case"verificationInternal":return(0,a.jsx)(N,{flow:"crmPersonalEmailValidation",email:l.internalEmail});default:return null}},[e,l])};function V(){return(0,a.jsx)(j,{children:(0,a.jsx)(U,{})})}var B=e.i(506435);function F(){let e=(0,n.useTranslations)("Auth.PasswordRecovery"),{closeDialog:u}=(0,l.useDialog)(),{showToast:x}=(0,c.useToast)(),{changeCurrentView:m}=L(),{changeCurrentView:h,formData:p,changeFormData:g,validate:f,invalidFields:j}=b(),{sendTOTP:C}=T(),y=(0,t.useCallback)(()=>{m("login")},[m]),v=(0,t.useCallback)(e=>{e.preventDefault();let{name:a,value:t}=e.target;g({[a]:t})},[g]),E=(0,t.useCallback)(()=>{if(!f("emailSet"))return!1;C.mutateAsync({email:p.email||"",flow:"recoverPassword"}).then(()=>{h("activation")}).catch(()=>{u(),x({variant:"error",content:e("ErrorMessage"),title:e("ErrorTitle")})})},[f,C,p.email,h,u,x,e]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Modal.Header,{extraAction:{icon:(0,a.jsx)(d.BackSolid,{}),onClick:y},title:e("ModalTitle"),onClose:u,"data-pw":B.AUTH_ATTR.FORGOT_PASSWORD_BACK_BUTTON}),(0,a.jsx)(i.Modal.Content,{children:(0,a.jsxs)("div",{className:"gap-xl flex flex-col",children:[(0,a.jsx)(o.Typography,{variant:"subheader",weight:"semibold",children:e("InfoEmailTitle")}),(0,a.jsx)(o.Typography,{children:e("InfoEmailDescription")}),(0,a.jsx)("div",{className:"gap-l flex max-w-[288px] flex-col",children:(0,a.jsx)(s.Textfield,{error:j.includes("email"),helperText:j.includes("email")?e("EmailNotValid"):"",label:e("EmailLabel"),type:"email",value:p.email,defaultValue:p.email,name:"email",onChange:v,"data-pw":B.AUTH_ATTR.FORGOT_PASSWORD_EMAIL_INPUT})})]})}),(0,a.jsx)(i.Modal.Footer,{children:(0,a.jsx)(r.Button,{loading:C.isPending,onClick:E,"data-pw":B.AUTH_ATTR.FORGOT_PASSWORD_CONTINUE_BUTTON,children:e("ContinueBtnLabel")})})]})}function G(){let{currentView:e,formData:l}=b();return(0,t.useMemo)(()=>{switch(e){case"emailSet":return(0,a.jsx)(F,{});case"activation":return(0,a.jsx)(N,{flow:"recoverPassword",email:l.email||""});default:return null}},[e])}function H(){return(0,a.jsx)(v,{children:(0,a.jsx)(G,{})})}var K=e.i(625721),W=e.i(738932),q=e.i(571635);let Y=(0,q.createServerReference)("60a5e515cb7623d056184db846b90896cfdd81d2c8",q.callServer,void 0,q.findSourceMapURL,"loginAction");var z=e.i(483856),Q=e.i(383143);let $={email:{valid:!0,helperText:""},password:{valid:!0,helperText:""}};function J({redirectTo:e}){let u=(0,n.useTranslations)("Auth.Login"),x=(0,n.useTranslations)("Auth"),{closeDialog:m}=(0,l.useDialog)(),{showToast:h}=(0,c.useToast)(),{changeCurrentView:p}=L(),{refreshProfile:T}=(0,Q.useCustomerSession)(),g=(0,W.useRouter)(),[f,j]=(0,t.useState)(!1),[y,b]=(0,t.useState)({email:"",password:""}),[v,E]=(0,t.useState)($),[w,A,k]=(0,t.useActionState)(Y,null),S=(0,t.useCallback)(()=>{j(e=>!e)},[]);(0,t.useEffect)(()=>{w&&w.success&&("/add-spot/[[...spotId]]"===(0,z.clientCookiesManager)().getCookie(K.COOKIES_LOCALE)&&localStorage.setItem("keepCurrentProperty","true"),m(),h({title:x("SignInSuccessTitle"),content:x("SignInSuccessMessage"),variant:"success"}),T(),e?g.push(e):g.refresh())},[w,m,h,x,T,g,e]);let R=(0,t.useCallback)(()=>{let e=(0,C.validateEmail)(y.email),a=(0,C.validatePassword)(y.password);return E({email:{valid:e,helperText:e?"":x("Login.EmailNotValid")},password:{valid:a,helperText:a?"":x("Login.PaswordNotValid")}}),e&&a},[y,x]),N=(0,t.useCallback)(e=>{if(e.preventDefault(),!R())return;let a=new FormData(e.currentTarget);(0,t.startTransition)(()=>{A(a)})},[R,A]),M=e=>{let{name:a,value:t}=e.target;b(e=>({...e,[a]:t})),w&&!w.success&&E($)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Modal.Header,{title:u("ModalTitle"),onClose:m}),(0,a.jsx)(i.Modal.Content,{children:(0,a.jsxs)("div",{className:"gap-xl flex flex-col items-center justify-center",children:[(0,a.jsx)(o.Typography,{variant:"header-5",fontFamily:"secondary",style:{textAlign:"center"},children:u("Title")}),(0,a.jsxs)("form",{className:"gap-m tablet:w-[65%] flex w-[80%] flex-col",onSubmit:N,children:[(0,a.jsx)(s.Textfield,{error:!v.email.valid,helperText:v.email.helperText,label:u("EmailLabel"),type:"email",name:"email",value:y.email,onChange:M,"data-pw":B.AUTH_ATTR.LOGIN_DIALOG_EMAIL_INPUT}),(0,a.jsx)(s.Textfield,{error:!v.password.valid,helperText:v.password.helperText,name:"password",type:f?"text":"password",value:y.password,label:u("PasswordLabel"),onChange:M,"data-pw":B.AUTH_ATTR.LOGIN_DIALOG_PASSWORD_INPUT,icon:(0,a.jsx)("div",{className:"cursor-pointer",onClick:S,"data-pw":B.AUTH_ATTR.LOGIN_DIALOG_PASSWORD_TOGGLE,children:f?(0,a.jsx)(d.VisibilityOff,{color:v.password.valid?"primary-miron-100":"support-matador"}):(0,a.jsx)(d.Visibility,{color:v.password.valid?"primary-miron-100":"support-matador"})})}),w&&!w.success&&(0,a.jsx)(o.Typography,{className:"mb-l",color:"support-matador",children:u("Invalid credentials."===w.error?"CredentialError":"GeneralError")}),(0,a.jsx)(r.Button,{type:"submit",loading:k,disabled:k,className:"w-full","data-pw":B.AUTH_ATTR.LOGIN_DIALOG_SUBMIT_BUTTON,children:u("SubmitBtnLabel")}),(0,a.jsx)(r.Button,{onClick:()=>p("forgotPassword"),variant:"text",type:"button",style:{alignSelf:"center"},"data-pw":B.AUTH_ATTR.LOGIN_DIALOG_FORGOT_PASSWORD_BUTTON,children:u("PasswordRecoveryBtnLabel")}),(0,a.jsx)(r.Button,{onClick:()=>p("CRMIntegration"),variant:"text",type:"button",style:{alignSelf:"center"},"data-pw":B.AUTH_ATTR.LOGIN_DIALOG_CRM_BUTTON,children:u("CRMIntegrationBtnLabel")})]})]})}),(0,a.jsx)(i.Modal.Footer,{children:(0,a.jsxs)("div",{className:"gap-l flex flex-col items-center justify-center",children:[(0,a.jsx)(o.Typography,{children:u("NotAccount")}
1),(0,a.jsx)("div",{children:(0,a.jsx)(r.Button,{variant:"outlined",stretch:!0,onClick:()=>p("register"),"data-pw":B.AUTH_ATTR.LOGIN_DIALOG_CREATE_ACCOUNT_BUTTON,children:u("CreateAccountBtnLabel")})})]})})]})}var X=e.i(608588);function Z(){let e=(0,n.useTranslations)("Auth.Register"),{closeDialog:s}=(0,l.useDialog)(),{changeCurrentView:c,validateForm:u,formData:x,changeFormData:m,invalidFields:h}=S(),p=(0,t.useCallback)(()=>{c("requiredField")},[c]),T=(0,t.useCallback)(()=>{if(!u("customerType"))return!1;c("personalData")},[u,c]),g=(0,t.useCallback)(e=>{let{value:a}=e.currentTarget;m({type:a})},[m]),f=(0,t.useCallback)(e=>{m({countryIso:e.code})},[m]),j=(0,t.useMemo)(()=>{switch(x?.type){case"private":return e.rich("CustomerTypeDisclaimer_CUSTOMER",{"link-subscription":e=>(0,a.jsx)(W.Link,{prefetch:!1,className:"text-primary-miron-50 underline",href:"/subscription",children:e}),p:e=>(0,a.jsx)(o.Typography,{children:e})});case"agent":return e.rich("CustomerTypeDisclaimer_AGENT",{p:e=>(0,a.jsx)(o.Typography,{children:e}),"link-subscription":e=>(0,a.jsx)(W.Link,{prefetch:!1,className:"text-primary-miron-50 underline",href:"/subscription",children:e})});default:return""}},[e,x?.type]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Modal.Header,{extraAction:{icon:(0,a.jsx)(d.BackSolid,{}),onClick:p},title:e("ModalTitle_2"),onClose:s}),(0,a.jsx)(i.Modal.Content,{children:(0,a.jsxs)("div",{className:"gap-xl flex flex-col",children:[(0,a.jsxs)("div",{className:"gap-l flex max-w-[288px] flex-col",children:[(0,a.jsx)(o.Typography,{variant:"subheader",weight:"semibold",children:e("CountryTitle")}),(0,a.jsx)(X.default,{value:x.countryIso,label:e("CountryLabel"),onChange:f,error:h.includes("countryIso")})]}),(0,a.jsxs)("div",{className:"gap-l flex flex-col",children:[(0,a.jsx)(o.Typography,{variant:"subheader",weight:"semibold",children:e("UserType")}),(0,a.jsxs)("div",{className:"gap-l flex flex-col",children:[(0,a.jsx)(I.Radio,{id:"customer",onClick:g,value:"private",checked:"private"===x.type,label:e("UserType_CUSTOMER")}),(0,a.jsx)(I.Radio,{id:"agent",onClick:g,value:"agent",checked:"agent"===x.type,label:e("UserType_AGENT")})]}),j]})]})}),(0,a.jsx)(i.Modal.Footer,{children:(0,a.jsx)(r.Button,{onClick:T,children:e("ContinueBtnLabel")})})]})}var ee=e.i(76595);function ea(){let e=(0,n.useTranslations)("Auth.Register"),{closeDialog:c}=(0,l.useDialog)(),{changeCurrentView:u,validateForm:x,formData:m,changeFormData:h,registerCustomer:p,isLoading:T,changeAvatarFile:g}=S(),f=(0,t.useCallback)(()=>{u("customerType")},[u]),j=(0,t.useCallback)(()=>{if(!x("personalData"))return!1;p()},[x,p]),C=(0,t.useCallback)(e=>{e.preventDefault();let{name:a,value:t}=e.target;h({[a]:t})},[h]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Modal.Header,{extraAction:{icon:(0,a.jsx)(d.BackSolid,{}),onClick:f},title:e("ModalTitle_2"),onClose:c}),(0,a.jsx)(i.Modal.Content,{children:(0,a.jsxs)("div",{className:"gap-xl flex flex-col",children:[(0,a.jsxs)("div",{className:"gap-l flex flex-col",children:[(0,a.jsx)(o.Typography,{variant:"subheader",weight:"semibold",children:e("AgentInfo")}),(0,a.jsx)(ee.default,{isRegister:!0,onChange:g})]}),"agent"===m.type&&(0,a.jsxs)("div",{className:"gap-l flex flex-col",children:[(0,a.jsx)(o.Typography,{variant:"subheader",weight:"semibold",children:e("AgentTitle")}),(0,a.jsxs)("div",{className:"gap-l flex max-w-2xs flex-col",children:[(0,a.jsx)(s.Textfield,{label:e("ComertialLabel"),type:"text",value:m.commertialName,name:"commertialName",defaultValue:m.commertialName,onChange:C}),(0,a.jsx)(s.Textfield,{label:e("UrlLabel"),type:"text",value:m.url,name:"url",defaultValue:m.url,onChange:C}),(0,a.jsx)(s.Textfield,{label:e("DescriptionLabel"),helperText:e("MaxCharacters",{currentLength:m.description?.length||0,limitLength:56}),type:"text",value:m.description,defaultValue:m.description,name:"description",maxLength:56,onChange:C})]})]})]})}),(0,a.jsx)(i.Modal.Footer,{children:(0,a.jsx)(r.Button,{loading:T,disabled:T,onClick:j,children:e("SkipBtnLabel")})})]})}var et=e.i(952089),el=e.i(659341),ei=e.i(444171);function en(){let e=(0,n.useTranslations)("Auth.Register"),{closeDialog:c}=(0,l.useDialog)(),{changeFormData:u,invalidFields:x,validateForm:m,changeCurrentView:h,formData:p}=S(),{changeCurrentView:T}=L(),[g,f]=(0,t.useState)(!1),j=(0,t.useCallback)(e=>{e.preventDefault();let{name:a,value:t}=e.target;u({[a]:t})},[u]),C=(0,t.useCallback)(({value:e,code:a})=>{u({phone:e,phoneCode:a})},[u]),y=(0,t.useCallback)(()=>{f(e=>!e)},[]),b=(0,t.useCallback)(e=>{let a=e.currentTarget.value;u({[a]:!p[a]})},[u,p]),v=(0,t.useCallback)(()=>
1{if(!m("requiredField"))return!1;h("customerType")},[m,h]),E=(0,t.useCallback)(()=>{T("login")},[T]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Modal.Header,{extraAction:{icon:(0,a.jsx)(d.BackSolid,{}),onClick:E},title:e("ModalTitle_1"),onClose:c,"data-pw":B.AUTH_ATTR.REGISTER_BACK_BUTTON}),(0,a.jsx)(i.Modal.Content,{children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(o.Typography,{variant:"header-5",fontFamily:"secondary",className:"text-center",children:e("Title")}),(0,a.jsxs)("div",{className:"flex max-w-[288px] flex-col",children:[(0,a.jsx)(s.Textfield,{name:"name",error:x.includes("name"),helperText:x.includes("name")?e("RequiredField"):"",label:e("NameLabel"),type:"text",defaultValue:p.name,value:p.name,onChange:j,"data-pw":B.AUTH_ATTR.REGISTER_NAME_INPUT}),(0,a.jsx)(s.Textfield,{error:x.includes("surname"),name:"surname",helperText:x.includes("surname")?e("RequiredField"):"",label:e("LastNameLabel"),type:"text",defaultValue:p.surname,value:p.surname,onChange:j,"data-pw":B.AUTH_ATTR.REGISTER_SURNAME_INPUT}),(0,a.jsx)(s.Textfield,{error:x.includes("email"),name:"email",helperText:x.includes("email")?e("EmailNotValid"):"",label:e("EmailLabel"),type:"email",defaultValue:p.email,value:p.email,onChange:j,"data-pw":B.AUTH_ATTR.REGISTER_EMAIL_INPUT}),(0,a.jsx)(s.Textfield,{error:x.includes("password"),name:"password",helperText:e("HelpersPassword"),type:g?"text":"password",label:e("PasswordLabel"),defaultValue:p.password,value:p.password,onChange:j,"data-pw":B.AUTH_ATTR.REGISTER_PASSWORD_INPUT,icon:(0,a.jsx)("div",{className:"cursor-pointer",onClick:y,children:g?(0,a.jsx)(d.VisibilityOff,{color:x.includes("password")?"support-matador":"primary-miron-100"}):(0,a.jsx)(d.Visibility,{color:x.includes("password")?"support-matador":"primary-miron-100"})})}),(0,a.jsx)(el.PhoneTextfield,{helperText:x.includes("phone")?e("PhoneNotValid"):"",error:x.includes("phone"),onChange:C,defaultValue:p?.phone,dropDownClassName:"z-[2147483648]",label:e("PhoneLabel"),value:{code:p.phoneCode||"",value:p?.phone||""}})]}),(0,a.jsxs)("div",{className:"gap-m flex flex-col",children:[(0,a.jsx)(et.Checkbox,{id:"promotionAccepted",label:(0,a.jsx)(o.Typography,{variant:"body-s",children:e("AcceptPromotions")}),checked:p.promotionAccepted,value:"promotionAccepted",onClick:b}),(0,a.jsx)(et.Checkbox,{id:"conditionsAccepted",error:x.includes("conditionsAccepted"),value:"conditionsAccepted",onClick:b,checked:p.conditionsAccepted,label:e.rich("PrivacyDisclaimer",{"a-condition":e=>(0,a.jsx)(W.Link,{prefetch:!1,href:"/conditions-of-use",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"},children:e}),"a-policy":e=>(0,a.jsx)(W.Link,{prefetch:!1,href:"/privacy-policy",target:"_blank",rel:"noreferrer",style:{textDecoration:"underline"},children:e}),"a-cookies":e=>(0,a.jsx)(W.Link,{prefetch:!1,href:"/cookies-policy",target:"_blank",rel:"noreferrer",style:{textDecoration:"underline"},children:e}),p:e=>(0,a.jsx)(o.Typography,{color:"current",variant:"body-s",children:e})})})]})]})}),(0,a.jsx)(i.Modal.Footer,{children:(0,a.jsxs)("div",{className:"gap-m tablet:flex-row flex flex-col items-center justify-between",children:[(0,a.jsx)(r.Button,{onClick:v,"data-pw":B.AUTH_ATTR.REGISTER_CONTINUE_BUTTON,children:e("ContinueBtnLabel")}),(0,a.jsx)(r.Button,{variant:"text",iconPosition:"end",icon:(0,a.jsx)(ei.Tooltip,{align:"end",position:"top",content:e.rich("PrivacyTooltip",{p:e=>(0,a.jsx)(o.Typography,{color:"primary-calm",children:e}),a:e=>(0,a.jsx)(W.Link,{prefetch:!1,href:"/privacy-policy",children:e})}),children:(0,a.jsx)(d.Information,{})}),children:e("PrivacyLabel")})]})})]})}function er(){let{currentView:e,formData:l}=S();return(0,t.useMemo)(()=>{switch(e){case"requiredField":return(0,a.jsx)(en,{});case"customerType":return(0,a.jsx)(Z,{});case"personalData":return(0,a.jsx)(ea,{});case"activation":return(0,a.jsx)(N,{flow:"customerRegister",email:l.email||""});default:return null}},[e])}function es(){return(0,a.jsx)(R,{children:(0,a.jsx)(er,{})})}function eo({redirectTo:e}){let{currentView:l}=L(),n=(0,t.useMemo)(()=>{switch(l){case"login":return(0,a.jsx)(J,{redirectTo:e});case"register":return(0,a.jsx)(es,{});case"forgotPassword":return(0,a.jsx)(H,{});case"CRMIntegration":return(0,a.jsx)(V,{});default:return null}},[l,e]);return(0,a.jsx)(i.Modal,{children:n})}function ec({redirectTo:e}){return(0,a.jsx)(O,{children:(0,a.jsx)(eo,{redirectTo:e})})}e.s(["default",0,function(){let{openDialog:e}=(0,l.useDialog)(),{isLoading:i}=(0,Q.useCustomerSession)();return{openAuthDialog:(0,t.useCallback)(t=>{i||e({component:(0,a.jsx)(ec,{redirectTo:t}),backdrop:!0})},[i,e])}}],539668)}]);
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.