1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[88981],{16762:(e,t,r)=>{r.d(t,{C5:()=>g,MJ:()=>f,eI:()=>m,lR:()=>p,lV:()=>c,zB:()=>u});var l=r(95155),s=r(12115),n=r(32467),a=r(22544),o=r(64269),i=r(76444);let c=a.Op,d=s.createContext({}),u=e=>{let{...t}=e;return(0,l.jsx)(d.Provider,{value:{name:t.name},children:(0,l.jsx)(a.xI,{...t})})},h=()=>{let e=s.useContext(d),t=s.useContext(x),{getFieldState:r,formState:l}=(0,a.xW)(),n=r(e.name,l);if(!e)throw Error("useFormField should be used within <FormField>");let{id:o}=t;return{id:o,name:e.name,formItemId:"".concat(o,"-form-item"),formDescriptionId:"".concat(o,"-form-item-description"),formMessageId:"".concat(o,"-form-item-message"),...n}},x=s.createContext({}),m=s.forwardRef((e,t)=>{let{className:r,...n}=e,a=s.useId();return(0,l.jsx)(x.Provider,{value:{id:a},children:(0,l.jsx)("div",{ref:t,className:(0,o.cn)("flex w-full flex-col gap-1",r),...n})})});m.displayName="FormItem";let p=s.forwardRef((e,t)=>{let{className:r,...s}=e,{error:n,formItemId:a}=h();return(0,l.jsx)(i.J,{ref:t,className:(0,o.cn)(n&&"text-text-normal","h-[17px]",r),htmlFor:a,...s})});p.displayName="FormLabel";let f=s.forwardRef((e,t)=>{let{...r}=e,{error:s,formItemId:a,formDescriptionId:o,formMessageId:i}=h();return(0,l.jsx)(n.DX,{ref:t,id:a,"aria-describedby":s?"".concat(o," ").concat(i):"".concat(o),"aria-invalid":!!s,...r})});f.displayName="FormControl",s.forwardRef((e,t)=>{let{className:r,...s}=e,{formDescriptionId:n}=h();return(0,l.jsx)("p",{ref:t,id:n,className:(0,o.cn)("text-muted-foreground text-[0.8rem]",r),...s})}).displayName="FormDescription";let g=s.forwardRef((e,t)=>{var r;let{className:s,children:n,...a}=e,{error:i,formMessageId:c}=h(),d=i?String(null!=(r=null==i?void 0:i.message)?r:""):n;return d?(0,l.jsx)("p",{ref:t,id:c,className:(0,o.cn)("text-error text-sm font-medium",s),...a,children:d}):null});g.displayName="FormMessage"},22460:(e,t,r)=>{r.d(t,{Cf:()=>u,lG:()=>o,zM:()=>i});var l=r(95155),s=r(89511);r(12115);var n=r(64269),a=r(4595);function o(e){let{...t}=e;return(0,l.jsx)(s.bL,{"data-slot":"dialog",...t})}function i(e){let{...t}=e;return(0,l.jsx)(s.l9,{"data-slot":"dialog-trigger",...t})}function c(e){let{...t}=e;return(0,l.jsx)(s.ZL,{"data-slot":"dialog-portal",...t})}function d(e){let{className:t,...r}=e;return(0,l.jsx)(s.hJ,{"data-slot":"dialog-overlay",className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",t),...r})}function u(e){let{className:t,children:r,showCloseButton:o=!0,title:i,titleClassName:u="",headerClassName:m="",closeClassName:p="",...f}=e;return(0,l.jsxs)(c,{"data-slot":"dialog-portal",children:[(0,l.jsx)(d,{}),(0,l.jsxs)(s.UC,{"data-slot":"dialog-content",className:(0,n.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex w-auto max-w-[583px] translate-x-[-50%] translate-y-[-50%] flex-col rounded-[24px] border-none shadow-[0_2px_4px_0_var(--shadow-modal)] duration-200 sm:max-w-[886px]",t),...f,children:[(0,l.jsxs)(h,{className:m,children:[(0,l.jsx)(x,{className:i?"text-text-normal-template-3 h-full align-middle text-[20px] leading-[22px] font-semibold ".concat(u," "):"hidden",children:i}),o&&(0,l.jsxs)(s.bm,{"data-slot":"dialog-close",className:(0,n.cn)("sticky-0 focus:ring-primary-hover data-[state=open]:bg-accent data-[state=open]:text-muted-foreground right-0 z-[60] rounded-full bg-black/50 transition-opacity hover:cursor-pointer hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",p),children:[(0,l.jsx)(a.F.CloseIcon,{className:"!h-6 !w-6 !text-white"}),(0,l.jsx)("span",{className:"sr-only",children:"Close"})]})]}),r]})]})}function h(e){let{className:t,...r}=e;return(0,l.jsx)("div",{"data-slot":"dialog-header",className:(0,n.cn)("sticky top-0 z-50 flex h-14 w-auto flex-row items-center justify-between gap-24 rounded-t-2xl bg-[#F3EAE2] px-8 py-4 text-center sm:text-left",t),...r})}function x(e){let{className:t,...r}=e;return(0,l.jsx)(s.hE,{"data-slot":"dialog-title",className:(0,n.cn)("text-normal text-base leading-none font-semibold",t),...r})}},23795:(e,t,r)=>{r.d(t,{c:()=>o});var l=r(95155);r(12115);var s=r(55817),n=r(64269),a=r(4595);function o(e){let{className:t,hideKeyIcon:r=!1,hasValue:o=!1,...i}=e;return(0,l.jsx)(s.bL,{children:(0,l.jsxs)("div",{className:"relative w-full",children:[!r&&(0,l.jsx)("div",{className:"text-white'} absolute top-1/2 left-4 !h-5 !w-5 -translate-y-1/2 transition-colors",children:(0,l.jsx)(a.F.KeyIcon,{className:"pointer-events-none !h-5 !w-5 text-white"})}),(0,l.jsx)(s.pd,{className:(0,n.cn)("placeholder:text-icon selection:bg-primary selection:text-primary-foreground border-input flex h-9 w-full min-w-0 gap-2 rounded-lg border bg-transparent px-3 py-2.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-primary focus-visible:ring-primary/20 hover:border-primary/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","pr-[40px] [&::-ms-clear]:hidden [&::-ms-reveal]:hidden [&::-webkit-contacts-auto-fill-button]:hidden [&::-webkit-credentials-auto-fill-button]:hidden",!r&&"pl-[48px]","truncate overflow-hidden text-ellipsis whitespace-nowrap",t),...i}),(0,l.jsx)(s.lM,{id:i.id+"btn-toggle",className:"absolute top-1/2 right-4 -translate-y-1/2 text-gray-500 hover:cursor-pointer hover:text-gray-700",children:(0,l.jsx)(s.In,{visible:(0,l.jsx)(a.F.EyeOpenIcon,{className:"!h-5 !w-5 text-white"}),hidden:(0,l.jsx)(a.F.EyeCloseIcon,{className:"!h-5 !w-5 text-white"})})})]})})}},35411:(e,t,r)=>{r.d(t,{a:()=>a});var l=r(95155),s=r(4595),n=r(22460);let a=e=>{let{title:t,description:r,isOpen:a,onClose:o,children:i,className:c,titleClassName:d,headerClassName:u,closeClassName:h,style:x}=e;return(0,l.jsx)(n.lG,{open:a,onOpenChange:e=>{e||o()},children:(0,l.jsxs)(n.Cf,{className:c,style:x,title:t,titleClassName:null!=d?d:"",headerClassName:null!=u?u:"",onOpenAutoFocus:e=>{e.preventDefault()},showCloseButton:!1,children:[(0,l.jsx)("button",{type:"button",onClick:o,className:"hover:border-primary-hover absolute -top-4 -right-5 z-99 flex cursor-pointer items-center justify-center rounded-full bg-black/50 transition-all hover:cursor-pointer hover:border-1 hover:brightness-110 focus:outline-none",children:(0,l.jsx)(s.F.CloseIcon,{className:"!h-6 !w-6 text-white ".concat(h)})}),(0,l.jsx)("div",{className:"h-full w-full",children:i})]})})}},47528:(e,t,r)=>{r.d(t,{k:()=>i,p:()=>c});var l=r(95155),s=r(12115),n=r(64269),a=r(12108),o=r(24033);let i="border-[#79797A] text-[#C2C2C2] placeholder:text-[#C2C2C2] hover:border-[#DBDBDC] hover:text-[#F5F5F6] hover:placeholder:text-[#F5F5F6] focus:border-[#DBDBDC] focus:text-[#F5F5F6] focus-visible:border-[#DBDBDC] focus-visible:text-[#F5F5F6] focus-visible:ring-0 data-[state=open]:border-[#DBDBDC] data-[state=open]:text-[#F5F5F6]";function c(e){let{className:t,type:r,useCustomStepper:i=!1,stepperPlacement:c="overlay",disabled:d=!1,onChange:u,...h}=e,x="number"===r,m=x&&i,p=s.useRef(null),f=e=>{let t=p.current;t&&!d&&("up"===e?t.stepUp():t.stepDown(),null==u||u({target:t,currentTarget:t}))};if(m){let e="beside"===c;return(0,l.jsxs)("div",{className:(0,n.cn)("group",e?"inline-flex items-center gap-0.5":"relative"),children:[(0,l.jsx)("input",{...h,ref:p,type:r,"data-slot":"input",disabled:d,onChange:u,className:(0,n.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground text-normal flex h-10 w-full min-w-0 bg-transparent shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","placeholder:text-icon placeholder:text-sm placeholder:font-normal","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","border-border-input gap-2 rounded-lg border px-3 py-2.5 shadow-none","focus-visible:border-primary focus-visible:ring-primary/20 hover:border-primary/50 focus-visible:ring-[3px]","[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",x&&"w-full",t,!e&&"pr-7")}),x&&!1===d&&(0,l.jsxs)("div",{className:(0,n.cn)("flex flex-col items-center justify-center",e?"shrink-0 -translate-x-1":"pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 gap-0 opacity-0 transition-opacity duration-150 group-hover:pointer-events-auto group-hover:opacity-100"),children:[(0,l.jsx)("button",{type:"button",tabIndex:-1,
1className:"flex h-3.5 w-3.5 cursor-pointer items-center justify-center text-[#C2C2C2] transition-colors group-focus-within:text-[#F5F5F6] hover:text-[#F5F5F6]",onClick:()=>f("up"),children:(0,l.jsx)(a.A,{className:"h-3.5 w-3.5",strokeWidth:3})}),(0,l.jsx)("button",{type:"button",tabIndex:-1,className:"flex h-3.5 w-3.5 cursor-pointer items-center justify-center text-[#C2C2C2] transition-colors group-focus-within:text-[#F5F5F6] hover:text-[#F5F5F6]",onClick:()=>f("down"),children:(0,l.jsx)(o.A,{className:"h-3.5 w-3.5",strokeWidth:3})})]})]})}return(0,l.jsx)("input",{...h,type:r,"data-slot":"input",disabled:d,onChange:u,className:(0,n.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground text-normal flex h-10 w-full min-w-0 bg-transparent shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed md:text-sm","placeholder:text-icon placeholder:text-sm placeholder:font-normal","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","border-border-template-5 gap-2 rounded-lg border px-3 py-2.5 shadow-none","focus-visible:border-primary focus-visible:ring-primary/20 hover:border-primary/50 focus-visible:ring-[3px]","truncate overflow-hidden text-ellipsis whitespace-nowrap",t)})}},88981:(e,t,r)=>{r.d(t,{A:()=>et});var l=r(95155),s=r(20865),n=r(39180),a=r(92820),o=r(16762),i=r(47528),c=r(23795),d=r(35411),u=r(4595),h=r(66942),x=r(52056),m=r(12115),p=r(22544),f=r(18720),g=r(15653);let v=(0,r(25959).v)()(e=>({user:null,setUser:t=>e({user:t}),updateCoin:t=>e(e=>({user:e.user?{...e.user,coin:Number(e.user.coin)+t}:null})),clearUser:()=>e({user:null})}));var b=r(13744),w=r(60919),j=r(61362),N=r(1141),y=r(64269);let k={background:"var(--border-gradient-modal-template-7)"};function C(e){let{children:t,className:r}=e;return(0,l.jsx)("div",{className:(0,y.cn)("rounded-2xl p-[1px]",r),style:k,children:(0,l.jsx)("div",{className:"overflow-hidden rounded-2xl",children:t})})}function F(e){let{children:t,className:r,style:s}=e;return(0,l.jsx)("div",{className:"w-full rounded-2xl p-[1px]",style:k,children:(0,l.jsx)("div",{className:(0,y.cn)("z-0 flex h-auto w-full flex-col items-center justify-center gap-3 overflow-y-auto rounded-2xl bg-white/20 p-4",r),style:s,children:t})})}let z={modalWidth:730,modalHeight:355,leftWidth:230,formWidth:468,formHeight:323},I={modalWidth:730,modalHeight:370,leftWidth:230,formWidth:468,formHeight:338},A={login:{modalWidth:730,modalHeight:287,leftWidth:230,formWidth:468,formHeight:255},register:z,forgot:I};function M(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:65,t=(0,m.useRef)(null),[r,l]=(0,m.useState)(e);return(0,m.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let r=()=>{let t=Math.ceil(e.getBoundingClientRect().height);t>0&&l(t)};r();let s=new ResizeObserver(r);return s.observe(e),()=>s.disconnect()},[]),{captchaRef:t,captchaHeight:r}}function S(){var e,t;let r=(0,n.r)(e=>e.config);return(0,l.jsxs)("div",{className:"absolute bottom-6 left-1/2 z-0 flex w-[calc(100%-1.5rem)] -translate-x-1/2 flex-col items-center justify-center gap-1 text-center",children:[(0,l.jsx)("h2",{className:"text-[14px] leading-[17px] font-bold text-[#FAEBFF]",children:"Ch\xe0o mừng bạn Äến vá»i"}),(0,l.jsx)("h1",{className:"max-w-full truncate text-[22px] leading-[26px] font-bold",style:{WebkitTextStroke:"1px white",backgroundImage:"url('/images/images-template-7/banner-auth.png')",backgroundSize:"cover",backgroundPosition:"-80px center",backgroundClip:"text",WebkitBackgroundClip:"text",color:"transparent"},children:null!=(t=null==r||null==(e=r.theme)?void 0:e.merchantName)?t:"Home Proxy"})]})}function B(e){let{children:t,variant:r="login",extraHeight:s=0}=e,n=A[r],a="login"===r?0:Math.max(0,s),o=n.modalHeight+a,i=n.formHeight+a;return(0,l.jsxs)("div",{className:"flex h-auto w-full flex-row items-stretch rounded-2xl p-0 lg:h-[var(--auth-modal-h)] lg:w-[730px]",style:{"--auth-modal-h":"".concat(o,"px"),"--auth-form-h":"".concat(i,"px")},children:[(0,l.jsx)("div",{className:"relative hidden w-[230px] shrink-0 flex-col items-start justify-center gap-2.5 rounded-l-2xl p-4 lg:flex lg:h-[var(--auth-modal-h)]",style:{backgroundImage:"url('/images/images-template-7/banner-auth.png')",backgroundSize:"cover",backgroundRepeat:"no-repeat"},children:(0,l.jsx)(S,{})}),(0,l.jsxs)("div",{className:"relative flex h-auto w-full flex-col items-center justify-center rounded-2xl p-4 lg:h-[var(--auth-modal-h)] lg:w-[500px] lg:rounded-l-none lg:rou
1nded-r-2xl",style:{backgroundImage:"url('/images/images-template-7/background-form.png')",backgroundColor:"#151A30",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},children:[(0,l.jsx)("div",{className:"absolute inset-0 rounded-2xl bg-black/50 lg:rounded-l-none lg:rounded-r-2xl"}),(0,l.jsx)("div",{className:"relative z-10 flex h-full w-full items-center justify-center",children:t})]})]})}let P="auth-input-template-7 placeholder:text-sidebar-foreground h-10 w-full rounded-lg border-0 bg-[var(--input-bg-modal-template-7)] text-base leading-[19px] font-normal text-white focus-visible:ring-0 focus-visible:ring-offset-0";var E=r(66654);let J=g.z.object({hash:g.z.string().nonempty("M\xe3 l\xe0 bắt buá»c"),email:E.rK,password:E.$w,confirmPassword:E.$w}),L={invalidEmail:"Email kh\xf4ng hợp lá»",emailNotExists:"Email kh\xf4ng tá»n tại",invalidHash:"M\xe3 kh\xf4ng tá»n tại"};function D(e){let{setFormType:t,onClose:r,onExtraHeightChange:s}=e,[d,g]=(0,m.useState)(!1),[v,y]=(0,m.useState)(""),[k,C]=(0,m.useState)(""),{captchaRef:z,captchaHeight:I}=M(),A=I+12;(0,m.useEffect)(()=>{null==s||s(A)},[A,s]);let S=(0,p.mN)({resolver:(0,h.u)(J),values:{password:"",confirmPassword:"",hash:"",email:""},mode:"onChange"}),{formState:{isSubmitting:E,isValid:D},setError:R}=S,H=S.watch("email"),V=(0,n.r)(e=>e.config);async function _(e){try{if(!v)return void C("Vui l\xf2ng x\xe1c nháºn bạn kh\xf4ng phải l\xe0 ngưá»i m\xe1y");await b.A.postApi("/api/v1/auth/reset/password",e,"",{headers:{"x-merchant-id":null==V?void 0:V.merchantId}}),f.toast.success("Äặt lại máºt khẩu th\xe0nh c\xf4ng",{duration:5e3,icon:(0,l.jsx)(j.A,{className:"text-success h-4 w-4"})})}catch(e){if(e instanceof w.pe){var t,r,s;let l=null==(t=e.response)?void 0:t.data;if(null==l?void 0:l.errors)for(let[e,t]of Object.entries(l.errors))R(e,{type:"server",message:null!=(s=null==L?void 0:L[null!=(r=null==t?void 0:t.key)?r:t])?s:t})}else f.toast.error("Äặt lại máºt khẩu lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,l.jsx)(x.A,{className:"text-error h-4 w-4"})})}}async function W(e){try{e.preventDefault(),g(!0),await S.trigger("email")&&(await b.A.postApi("/api/v1/auth/forgot/password",{email:H},"",{headers:{"x-merchant-id":null==V?void 0:V.merchantId}}),f.toast.success("Gá»i m\xe3 th\xe0nh c\xf4ng",{duration:5e3,icon:(0,l.jsx)(j.A,{className:"text-success h-4 w-4"})}))}catch(e){if(e instanceof w.pe){var t,r,s,n;let a=null==(t=e.response)?void 0:t.data;if(null==a?void 0:a.errors)for(let[e,t]of Object.entries(a.errors))R(e,{type:"server",message:null!=(n=null==L?void 0:L[null!=(s=null==t?void 0:t.key)?s:t])?n:t});else f.toast.error("Gá»i m\xe3 lá»i",{description:null!=(r=null==a?void 0:a.message)?r:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,l.jsx)(x.A,{className:"text-error h-4 w-4"})})}else f.toast.error("Gá»i m\xe3 lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,l.jsx)(x.A,{className:"text-error h-4 w-4"})})}finally{g(!1)}}return(0,l.jsx)(B,{variant:"forgot",extraHeight:A,children:(0,l.jsxs)(F,{className:"lg:h-[var(--auth-form-h)] lg:w-[468px]",children:[(0,l.jsx)("h1",{className:"text-center text-lg leading-[22px] font-bold text-white",children:"Qu\xean máºt khẩu"}),(0,l.jsx)(o.lV,{...S,children:(0,l.jsxs)("form",{onSubmit:S.handleSubmit(_),className:"flex w-full max-w-full flex-col items-center gap-3",children:[(0,l.jsx)(o.zB,{control:S.control,name:"email",render:e=>{let{field:t}=e;return(0,l.jsxs)(o.eI,{className:"z-10 w-full self-stretch",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsxs)("div",{className:"relative w-full",children:[(0,l.jsx)(u.F.MailIcon,{className:"pointer-events-none absolute top-1/2 left-4 h-6 w-6 -translate-y-1/2 transition-colors ".concat(t.value?"text-white":"text-[#F5F5F6]")}),(0,l.jsx)(i.p,{autoComplete:"email",type:"email",placeholder:"Email",className:"".concat(P," pr-4 pl-[52px]"),...t})]})}),(0,l.jsx)(o.C5,{})]})}}),(0,l.jsxs)("div",{className:"z-10 flex w-full flex-row items-start gap-3 self-stretch",children:[(0,l.jsx)(o.zB,{control:S.control,name:"hash",render:e=>{let{field:t}=e;return(0,l.jsxs)(o.eI,{className:"flex-1",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsx)(i.p,{autoComplete:"one-time-code",type:"text",placeholder:"M\xe3 OTP",className:"text-sidebar-foreground ".concat(P," px-4"),...t})}),(0,l.jsx)(o.C5,{})]})}}),(0,l.jsx)(a.$,{onClick:W,className:"h-10 rounded-lg px-6 text-sm font-semibold text-white hover:cursor-pointer hover:brightness-110",style:{background:"var(--button-2-gradient-template-7)"},disabled:d||!H||""===H,type:"button",children:"Gá»i"})]}),(0,l.jsx)(o.zB,{control:S.control,name:"password",render:e=>{let{field:t}=e;
1return(0,l.jsxs)(o.eI,{className:"z-10 w-full self-stretch",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsx)(c.c,{autoComplete:"new-password",placeholder:"Máºt khẩu má»i",hasValue:!!t.value,className:P,...t})}),(0,l.jsx)(o.C5,{})]})}}),(0,l.jsx)(o.zB,{control:S.control,name:"confirmPassword",render:e=>{let{field:t}=e;return(0,l.jsxs)(o.eI,{className:"z-10 w-full self-stretch",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsx)(c.c,{autoComplete:"new-password",placeholder:"X\xe1c nháºn máºt khẩu má»i",hasValue:!!t.value,className:P,...t})}),(0,l.jsx)(o.C5,{})]})}}),(0,l.jsxs)("div",{ref:z,className:"z-10 flex w-full flex-col items-center justify-center gap-2 self-stretch",children:[(0,l.jsx)(N.A,{sitekey:"6LcpBJ0pAAAAAP1Tf9GVLbiodi69ko_XQCP6Kqvx",onChange:e=>{e&&(y(e),k&&C(""))},onExpired:()=>y(""),hl:"vi",theme:"dark",className:"origin-center scale-[0.85] sm:scale-100"}),k&&(0,l.jsx)("span",{className:"text-xs text-red-400",children:k})]}),(0,l.jsx)(a.$,{className:"flex h-[35px] w-full flex-row items-center justify-center gap-2 self-stretch rounded-full px-4 py-2 text-base leading-[19px] font-semibold text-white hover:cursor-pointer hover:brightness-110",style:{background:"var(--button-2-gradient-template-7)"},disabled:E||!D,type:"submit",children:"Äặt lại máºt khẩu"}),(0,l.jsx)(a.$,{onClick:()=>t("login"),type:"button",variant:"link",className:"h-auto w-full p-0 text-center text-sm leading-[17px] font-normal text-white hover:cursor-pointer hover:no-underline hover:brightness-110",children:"Quay lại ÄÄng nháºp"})]})})]})})}var R=r(95307),H=r(35652);let V=g.z.object({firstName:E.fV,lastName:E.tM,email:E.rK,phone:E.KA,password:E.$w}),_={invalidPhone:"Sá» Äiá»n thoại kh\xf4ng hợp lá»",phoneExists:"Sá» Äiá»n thoại Ä\xe3 tá»n tại"};function W(e){let{setFormType:t,onExtraHeightChange:r}=e,d=(0,p.mN)({resolver:(0,h.u)(V),values:{email:"",password:"",firstName:"",lastName:"",phone:""},mode:"onChange"}),{formState:{isSubmitting:g,isValid:v},setError:y}=d,k=(0,n.r)(e=>e.config),[C,z]=(0,m.useState)(""),[I,A]=(0,m.useState)(""),{captchaRef:S,captchaHeight:E}=M(),J=E+12;async function L(e){try{if(!C)return void A("Vui l\xf2ng x\xe1c nháºn bạn kh\xf4ng phải l\xe0 ngưá»i m\xe1y");let t=(0,R.G2)(),r=(0,s.mD)(),n={...e,...r&&{domainSource:r},...t&&{refClickId:t}};await b.A.postApi("/api/v1/auth/register",n,"",{headers:{"x-merchant-id":null==k?void 0:k.merchantId}}),t&&(0,R.p7)(),f.toast.success("ÄÄng k\xfd th\xe0nh c\xf4ng",{duration:5e3,icon:(0,l.jsx)(j.A,{className:"text-success h-4 w-4"})}),await (0,s.Jv)("credentials",{phone:e.phone,password:e.password,merchantId:null==k?void 0:k.merchantId,redirect:!1}),(0,H.E)(),(0,s.IL)()||(window.location.href=(0,s.LN)())}catch(e){if(e instanceof w.pe){var t,r,n;let l=null==(t=e.response)?void 0:t.data;if(null==l?void 0:l.errors)for(let[e,t]of Object.entries(l.errors))y(e,{type:"server",message:null!=(n=null==_?void 0:_[null!=(r=null==t?void 0:t.key)?r:t])?n:t})}else f.toast.error("ÄÄng k\xfd lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,l.jsx)(x.A,{className:"text-error h-4 w-4"})})}}return(0,m.useEffect)(()=>{null==r||r(J)},[J,r]),(0,l.jsx)(B,{variant:"register",extraHeight:J,children:(0,l.jsxs)(F,{className:"lg:h-[var(--auth-form-h)] lg:w-[468px]",children:[(0,l.jsxs)("div",{className:"flex h-[33px] flex-row items-center gap-1 p-0",children:[(0,l.jsx)("button",{type:"button",className:"flex h-[33px] flex-row items-center justify-center rounded-full px-3 py-1.5 text-sm leading-[17px] font-semibold whitespace-nowrap text-white hover:cursor-pointer",style:{background:"var(--button-2-gradient-template-7)"},children:"ÄÄng k\xfd"}),(0,l.jsx)("button",{onClick:()=>t("login"),type:"button",className:"flex h-[33px] flex-row items-center justify-center rounded-full px-3 py-1.5 text-sm leading-[17px] font-semibold whitespace-nowrap text-white hover:cursor-pointer",children:"ÄÄng nháºp"})]}),(0,l.jsx)(o.lV,{...d,children:(0,l.jsxs)("form",{onSubmit:d.handleSubmit(L),className:"flex w-full max-w-full flex-col items-center gap-3 self-stretch",children:[(0,l.jsxs)("div",{className:"flex w-full flex-col items-center gap-3 self-stretch",children:[(0,l.jsxs)("div",{className:"flex w-full flex-row items-center gap-4 self-stretch",children:[(0,l.jsx)(o.zB,{control:d.control,name:"firstName",render:e=>{let{field:t}=e;return(0,l.jsxs)(o.eI,{className:"z-10 w-full flex-[2]",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsx)(i.p,{autoComplete:"given-name",placeholder:"Nguyá»
n VÄn",className:"".concat(P," px-4"),...t})}),(0,l.jsx)(o.C5,{})]})}}),(0,l.jsx)(o.zB,{control:d.control,name:"lastName",render:e=>{let{field:t}=e;return(0,l.jsxs)(o.eI,{className:"z-10 w-full flex-1",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsx)(i.p,{autoComplete:"family-name",placeholder:"T\xean",className:"text-sidebar-foreground ".concat(P," px-4"),...t})}),(0,l.jsx)(o.C5,{})]})}})]}),(0,l.jsx)(o.zB,{control:d.control,name:"phone",render:e=>{let{field:t}=e;
1return(0,l.jsxs)(o.eI,{className:"z-10 w-full self-stretch",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsxs)("div",{className:"relative w-full",children:[(0,l.jsx)(u.F.PhoneIcon,{className:"pointer-events-none absolute top-1/2 left-4 h-6 w-6 -translate-y-1/2 transition-colors ".concat(t.value?"text-white":"text-[#F5F5F6]")}),(0,l.jsx)(i.p,{autoComplete:"tel",type:"tel",placeholder:"Sá» Äiá»n thoại",className:"".concat(P," pr-4 pl-[52px]"),...t})]})}),(0,l.jsx)(o.C5,{})]})}}),(0,l.jsx)(o.zB,{control:d.control,name:"email",render:e=>{let{field:t}=e;return(0,l.jsxs)(o.eI,{className:"z-10 w-full self-stretch",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsxs)("div",{className:"relative w-full",children:[(0,l.jsx)(u.F.MailIcon,{className:"pointer-events-none absolute top-1/2 left-4 h-6 w-6 -translate-y-1/2 transition-colors ".concat(t.value?"text-white":"text-[#F5F5F6]")}),(0,l.jsx)(i.p,{autoComplete:"email",type:"email",placeholder:"Email",className:"".concat(P," pr-4 pl-[52px]"),...t})]})}),(0,l.jsx)(o.C5,{})]})}}),(0,l.jsx)(o.zB,{control:d.control,name:"password",render:e=>{let{field:t}=e;return(0,l.jsxs)(o.eI,{className:"z-10 w-full self-stretch",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsx)(c.c,{autoComplete:"new-password",placeholder:"Máºt khẩu",hasValue:!!t.value,className:P,...t})}),(0,l.jsx)(o.C5,{})]})}})]}),(0,l.jsxs)("div",{ref:S,className:"flex w-full flex-col items-center justify-center gap-2",children:[(0,l.jsx)("div",{className:"origin-center scale-[0.85] sm:scale-100",children:(0,l.jsx)(N.A,{sitekey:"6LcpBJ0pAAAAAP1Tf9GVLbiodi69ko_XQCP6Kqvx",onChange:e=>{e&&(z(e),I&&A(""))},theme:"dark"})}),I&&(0,l.jsx)("span",{className:"text-xs text-red-400",children:I})]}),(0,l.jsx)(a.$,{className:"flex h-[35px] w-full flex-row items-center justify-center gap-2 self-stretch rounded-full px-4 py-2 text-base leading-[19px] font-semibold text-white hover:cursor-pointer hover:brightness-110",style:{background:"var(--button-2-gradient-template-7)"},disabled:g||!v,type:"submit",children:"Tạo t\xe0i khoản"})]})})]})})}var O=r(86948),T=r(41052),$=r(65142),G=r(80389),K=r(76444),U=r(96199),X=r(15239);let Q=g.z.object({password:g.z.string().optional(),firstName:g.z.string().min(2,"Há» tá»i thiá»u 2 k\xed tá»±").optional(),lastName:g.z.string().min(2,"T\xean tá»i thiá»u 2 k\xed tá»±").optional(),email:g.z.string().optional(),oldPassword:g.z.string().optional()}),Z={invalidPhone:"Sá» Äiá»n thoại kh\xf4ng hợp lá»",phoneNotExists:"Sá» Äiá»n thoại kh\xf4ng tá»n tại",incorrectOldPassword:"Máºt khẩu cÅ© kh\xf4ng ch\xednh x\xe1c"};function q(e){var t,r,o,i;let{onCallBack:c=()=>{}}=e,{data:d}=(0,U.wV)(),{user:u,setUser:m}=v(),g={firstName:null!=(o=null==u?void 0:u.firstName)?o:"",lastName:null!=(i=null==u?void 0:u.lastName)?i:"",email:null==u?void 0:u.email,password:"",oldPassword:""},N=(0,p.mN)({resolver:(0,h.u)(Q),values:g}),{formState:{isSubmitting:y},setError:k}=N,C=(0,n.r)(e=>e.config);async function F(e){try{let t={...e};(null==e?void 0:e.password)||delete e.password,(null==e?void 0:e.oldPassword)||delete e.oldPassword;let r=await b.A.patchApi("/api/v1/auth/me",e,null==d?void 0:d.accessToken).then(e=>e.data);t.password?(0,s.CI)({callbackUrl:new URL("/",window.location.href).href,redirect:!0}):m(r),f.toast.success("Cáºp nháºt th\xf4ng tin th\xe0nh c\xf4ng",{duration:5e3,icon:(0,l.jsx)(j.A,{className:"h-4 w-4 text-green-600"})}),c()}catch(e){if(e instanceof w.pe){var t,r,n;let l=null==(t=e.response)?void 0:t.data;if(null==l?void 0:l.errors)for(let[e,t]of Object.entries(l.errors))k(e,{type:"server",message:null!=(n=null==Z?void 0:Z[null!=(r=null==t?void 0:t.key)?r:t])?n:t})}else f.toast.error("Cáºp nháºt th\xf4ng tin lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,l.jsx)(x.A,{className:"h-4 w-4 text-red-500"})})}}return(0,l.jsxs)(O.Zp,{className:"mx-auto w-full gap-4 border-none shadow-none",children:[(0,l.jsxs)(O.aR,{className:"gap-8",children:[(0,l.jsx)(O.ZB,{className:"text-center",children:(null==C||null==(t=C.theme)?void 0:t.logo)&&(0,l.jsx)(X.default,{className:"mx-auto",src:C.theme.logo.replace("/api/v1",""),alt:"",width:88,height:88})}),(0,l.jsx)("div",{className:"text-center",children:(0,l.jsx)("h3",{className:"text-2xl font-semibold",children:"Cáºp nháºt th\xf4ng tin"})})]}),(0,l.jsx)(O.Wu,{children:(0,l.jsx)(T.lV,{...N,children:(0,l.jsxs)("form",{onSubmit:N.handleSubmit(F),className:"space-y-5",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,l.jsx)(T.zB,{control:N.control,name:"firstName",render:e=>{let{field:t}=e;return(0,l.jsxs)(T.eI,{children:[(0,l.jsx)(T.lR,{children:"Há»"}),(0,l.jsx)(T.MJ,{children:(0,l.jsx)($.p,{autoComplete:"given-name",placeholder:"Nháºp há»",className:"h-10",...t})}),(0,l.jsx)(T.C5,{})]})}}),(0,l.jsx)(T.zB,{control:N.control,name:"lastName",render:e=>{let{field:t}=e;return(0,l.jsxs)(T.eI,{children:[(0,l.jsx)(T.lR,{children:"T\xean"}),(0,l.jsx)(T.MJ,{children:(0,l.jsx)($.p,{autoComplete:"family-name",placeholder:"Nháºp t\xean",className:"h-10",...t})}),(0,l.jsx)(T.C5,{})]})}})]}),(0,l.jsxs)("div",{className:"grid gap-2",children:[(0,l.jsx)(K.J,{children:"Sá» Äiá»n thoại"}),(0,l.jsx)($.p,{disabled:!0,className:"h-10",value:null==d||null==(r=d.user)?void 0:r.phone})]}),(0,l.jsx)(T.zB,{control:N.control,name:"email",render:e=>{let{field:t}=e;return(0,l.jsxs)(T.eI,{children:[(0,l.jsx)(T.lR,{children:"Email"}),(0,l.jsx)(T.MJ,{children:(0,l.jsx)($.p,{autoComplete:"email",type:"email",placeholder:"Nháºp email",className:"h-10",...t})}),(0,l.jsx)(T.C5,{})]})}}),(0,l.jsx)(T.zB,{control:N.control,name:"oldPassword",render:e=>{let{field:t}=e;return(0,l.jsxs)(T.eI,{children:[(0,l.jsx)(T.lR,{children:"Máºt khẩu cÅ©"}),(0,l.jsx)(T.MJ,{children:(0,l.jsx)(G.c,{className:"h-10",placeholder:"Nháºp máºt khẩu",autoComplete:"current-password",...t})}),(0,l.jsx)(T.C5,{})]})}}),(0,l.jsx)(T.zB,{control:N.control,name:"password",render:e=>{let{field:t}=e;return(0,l.jsxs)(T.eI,{children:[(0,l.jsx)(T.lR,{children:"Máºt khẩu"}),(0,l.jsx)(T.MJ,{children:(0,l.jsx)(G.c,{className:"h-10",placeholder:"Nháºp máºt khẩu",autoComplete:"new-password",...t})}),(0,l.jsx)(T.C5,{})]})}})]}),(0,l.jsx)(a.$,{className:"h-12 w-full",size:"lg",disabled:y,type:"submit",children:"X\xe1c nháºn"})]})})})]})}let Y=g.z.object({phone:E.KA,password:E.$w}),ee={incorrectPassword:"Máºt khẩu kh\xf4ng ch\xednh x\xe1c",notFound:"Sá» Äiá»n thoại kh\xf4ng tá»n tại",invali
1dPhone:"Sá» Äiá»n thoại kh\xf4ng hợp lá»"};function et(e){let{initFormType:t="login",onCallBack:r=()=>{}}=e,g=(0,p.mN)({resolver:(0,h.u)(Y),values:{phone:"",password:""},mode:"onChange"}),{formState:{isSubmitting:b,isValid:w},setError:j}=g,N=(0,n.r)(e=>e.config),y=v(e=>e.user);async function k(e){try{let l=await (0,s.Jv)("credentials",{...e,merchantId:null==N?void 0:N.merchantId,redirect:!1});if(l.code||l.error){let e=JSON.parse(l.code);if(null==e?void 0:e.errors)for(let[r,l]of Object.entries(e.errors)){var t,n;j(r,{type:"server",message:null!=(n=null==ee?void 0:ee[null!=(t=null==l?void 0:l.key)?t:l])?n:l})}}else(0,s.IL)()?r():window.location.href=(0,s.LN)()}catch(e){f.toast.error("ÄÄng Nháºp lá»i",{description:"Lá»i kết ná»i Äến m\xe1y chá»§.",duration:5e3,icon:(0,l.jsx)(x.A,{className:"text-error h-4 w-4"})})}}let[A,M]=(0,m.useState)(!0);(0,m.useEffect)(()=>{(null==y?void 0:y.id)&&M(!1)},[null==y?void 0:y.id]);let[S,E]=(0,m.useState)(t),[J,L]=(0,m.useState)(77);return(0,m.useLayoutEffect)(()=>()=>{M(!0)},[]),(0,l.jsx)(d.a,{title:"",titleClassName:"hidden",description:"",isOpen:A,onClose:()=>{M(!1),r()},headerClassName:"!bg-transparent !h-auto !absolute !top-[-11.5px] !right-[500px] !w-auto !p-0 !z-[100]",className:"!h-fit !w-[calc(100%-3rem)] !max-w-[calc(100%-2rem)] !overflow-visible !rounded-2xl !border-0 !bg-transparent !p-0 sm:!w-[500px] lg:!w-[730px] ".concat("login"===S?"lg:!h-[287px]":"register"===S||"forgotPassword"===S?"lg:!h-[var(--auth-modal-h)]":"lg:!h-auto"),style:"register"===S?{"--auth-modal-h":"".concat(z.modalHeight+J,"px")}:"forgotPassword"===S?{"--auth-modal-h":"".concat(I.modalHeight+J,"px")}:void 0,children:(0,l.jsxs)(C,{children:["login"==S&&(0,l.jsx)(B,{variant:"login",children:(0,l.jsxs)(F,{className:"lg:h-[255px] lg:w-[468px]",children:[(0,l.jsxs)("div",{className:"flex h-[33px] flex-row items-center gap-1 p-0",children:[(0,l.jsx)("button",{onClick:()=>E("register"),type:"button",className:"flex h-[33px] flex-row items-center justify-center rounded-full px-3 py-1.5 text-sm leading-[17px] font-semibold whitespace-nowrap text-white hover:cursor-pointer",children:"ÄÄng k\xfd"}),(0,l.jsx)("button",{type:"button",className:"flex h-[33px] flex-row items-center justify-center rounded-full px-3 py-1.5 text-sm leading-[17px] font-semibold whitespace-nowrap text-white hover:cursor-pointer",style:{background:"var(--button-2-gradient-template-7)"},children:"ÄÄng nháºp"})]}),(0,l.jsx)(o.lV,{...g,children:(0,l.jsxs)("form",{onSubmit:g.handleSubmit(k),className:"flex w-full max-w-full flex-col items-center gap-3",children:[(0,l.jsxs)("div",{className:"flex w-full flex-col items-center gap-3",children:[(0,l.jsx)(o.zB,{control:g.control,name:"phone",render:e=>{let{field:t}=e;return(0,l.jsxs)(o.eI,{className:"z-10 w-full self-stretch",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsxs)("div",{className:"relative w-full",children:[(0,l.jsx)(u.F.PhoneIcon,{className:"pointer-events-none absolute top-1/2 left-4 h-6 w-6 -translate-y-1/2 transition-colors ".concat(t.value?"text-white":"text-[#F5F5F6]")}),(0,l.jsx)(i.p,{type:"tel",autoComplete:"username",placeholder:"Sá» Äiá»n thoại",className:"".concat(P," pl-[48px]"),...t})]})}),(0,l.jsx)(o.C5,{className:"!text-[#ffb4b4]"})]})}}),(0,l.jsx)(o.zB,{control:g.control,name:"password",render:e=>{let{field:t}=e;return(0,l.jsxs)(o.eI,{className:"z-10 w-full self-stretch",children:[(0,l.jsx)(o.MJ,{children:(0,l.jsx)(c.c,{autoComplete:"current-password",placeholder:"Máºt khẩu",hasValue:!!t.value,className:P,...t})}),(0,l.jsx)(o.C5,{className:"!text-[#ffb4b4]"})]})}})]}),(0,l.jsx)(a.$,{className:"flex h-[35px] w-full flex-row items-center justify-center gap-2 self-stretch rounded-full px-4 py-2 text-base leading-[19px] font-semibold text-white hover:cursor-pointer hover:brightness-110",style:{background:"var(--button-2-gradient-template-7)"},disabled:b||!w,type:"submit",children:"ÄÄng nháºp"}),(0,l.jsx)(a.$,{onClick:()=>E("forgotPassword"),type:"button",variant:"link",className:"h-auto w-full p-0 text-center text-sm leading-[17px] font-normal text-white hover:no-underline hover:brightness-110",children:"Qu\xean máºt khẩu?"})]})})]})}),"register"==S&&(0,l.jsx)(W,{setFormType:E,onExtraHeightChange:L}),"forgotPassword"==S&&(0,l.jsx)(D,{setFormType:E,onExtraHeightChange:L,onClose:()=>{M(!1),r()}}),"updateProfile"==S&&(0,l.jsx)(q,{onCallBack:r})]})})}},92820:(e,t,r)=>{r.d(t,{$:()=>i});var l=r(95155);r(12115);var s=r(32467),n=r(83101),a=r(64269);let o=(0,n.F)("inline-flex items-center hover:cursor-pointer justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[1px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border border-primary bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 text-primary data-[active=true]:text-primary data-[active=true]:border-primary data-[active=true]:bg-primary/10",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-primary-hover hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-lg gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-lg px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function i(e){let{className:t,variant:r,size:n,asChild:i=!1,...c}=e,d=i?s.DX:"button";return(0,l.jsx)(d,{"data-slot":"button",className:(0,a.cn)(o({variant:r,size:n,className:t})),...c})}}}]);
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.