PageSourceSearch

https://j2proxy.vn/_next/static/chunks/60249-1d3ed973d80a1505.js

js j2proxy.vn collected 2026-10-02 02:13:29 UTC 35,768 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[60249],{54591:(e,t,l)=>{l.d(t,{p:()=>i});var r=l(95155);l(12115);var a=l(64269),s=l(12108),n=l(24033);function i(e){let{className:t,type:l,useCustomStepper:i=!1,disabled:o=!1,...c}=e,d="number"===l;return d&&i?(0,r.jsxs)("div",{className:"group relative",children:[(0,r.jsx)("input",{type:l,"data-slot":"input",disabled:o,className:(0,a.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 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",d&&"w-full",t),...c}),d&&!1===o&&(0,r.jsxs)("div",{className:(0,a.cn)("pointer-events-none absolute top-1/2 right-1.5 flex -translate-y-1/2 flex-col items-center justify-center opacity-0 transition-opacity duration-150","group-hover:pointer-events-auto group-hover:opacity-100"),children:[(0,r.jsx)("button",{type:"button",className:"hover:text-icon/110 text-icon h-4 w-4 translate-y-1 transition-colors",onClick:e=>{var t;let l=null==(t=e.currentTarget.parentElement)?void 0:t.previousElementSibling;l.stepUp(),l.dispatchEvent(new Event("change",{bubbles:!0}))},children:(0,r.jsx)(s.A,{className:"h-4 w-4",strokeWidth:3})}),(0,r.jsx)("button",{type:"button",className:"hover:text-icon/110 text-icon h-4 w-4 -translate-y-1 transition-colors",onClick:e=>{var t;let l=null==(t=e.currentTarget.parentElement)?void 0:t.previousElementSibling;l.stepDown(),l.dispatchEvent(new Event("change",{bubbles:!0}))},children:(0,r.jsx)(n.A,{className:"h-4 w-4",strokeWidth:3})})]})]}):(0,r.jsx)("input",{type:l,"data-slot":"input",disabled:o,className:(0,a.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 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-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]","truncate overflow-hidden text-ellipsis whitespace-nowrap",t),...c})}},57913:(e,t,l)=>{l.d(t,{$:()=>o,r:()=>i});var r=l(95155);l(12115);var a=l(32467),s=l(83101),n=l(64269);let i=(0,s.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 o(e){let{className:t,variant:l,size:s,asChild:o=!1,...c}=e,d=o?a.DX:"button";return(0,r.jsx)(d,{"data-slot":"button",className:(0,n.cn)(i({variant:l,size:s,className:t})),...c})}},60249:(e,t,l)=>{l.d(t,{A:()=>X});var r=l(95155),a=l(20865),s=l(39180),n=l(57913),i=l(60475),o=l(54591),c=l(80264),d=l(68388),p=l(76830),x=l(64269),m=l(66942),u=l(52056),h=l(12115),f=l(22544),g=l(18720),v=l(15653);let b=(0,l(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 w=l(13744),j=l(60919),y=l(61362),N=l(1141),k=l(15239);function C(e){var t,l;let{compact:a=!1}=e,n=(0,s.r)(e=>e.config),i=null!=(l=null==n||null==(t=n.theme)?void 0:t.merchantName)?l:"Home Proxy";return(0,r.jsxs)("h1",{className:a?"w-full min-w-0 text-base leading-snug font-bold text-[rgb(from_var(--primary)_calc(r_-_26)_calc(g_-_51)_calc(b_-_98))] sm:text-lg":"w-full min-w-0 text-[16px] leading-[145%] font-bold whitespace-nowrap text-[rgb(from_var(--primary)_calc(r_-_26)_calc(g_-_51)_calc(b_-_98))] min-[1440px]:text-[28px] sm:text-[24px] 2xl:text-[32px]",title:"Ch\xe0o mừng bạn đến vá
1»›i ".concat(i),children:["Ch\xe0o mừng bạn đến với ",i]})}function z(e){let{children:t,variant:l="default"}=e,a="compact"===l;return(0,r.jsxs)("div",{className:a?"relative flex h-auto min-h-[360px] w-full min-w-0 flex-col items-center gap-4 overflow-hidden rounded-[16px] p-5 lg:min-h-[392px] lg:flex-row lg:items-center lg:gap-8 lg:px-8 lg:py-7 xl:min-h-[408px]":"relative flex h-full w-full min-w-0 flex-col items-center gap-6 overflow-hidden rounded-[16px] p-4 min-[1440px]:gap-14 min-[1440px]:px-16 min-[1440px]:py-10 lg:flex-row lg:gap-12 lg:px-12 lg:py-8 2xl:gap-16 2xl:px-20",children:[(0,r.jsx)("div",{className:"absolute top-[-120px] left-[44px] z-0 h-[176px] w-[176px] rounded-full bg-[rgb(from_var(--primary)_calc(r_-_-4)_calc(g_-_-61)_calc(b_-_-41))] opacity-30 sm:opacity-100"}),(0,r.jsx)("div",{className:"absolute top-[24px] left-[6px] z-2 h-[30px] w-[30px] rounded-full bg-[rgb(from_var(--primary)_calc(r_-_-155)_calc(g_-_-130)_calc(b_-_-33))]"}),(0,r.jsx)("div",{className:"absolute top-[150px] -right-[128px] z-0 h-[176px] w-[176px] rounded-full bg-[rgb(from_var(--primary)_calc(r_-_-123)_calc(g_-_-106)_calc(b_-_-17))] opacity-30 sm:opacity-100"}),(0,r.jsx)("svg",{className:"absolute left-0 hidden ".concat(a?"lg:hidden":"lg:block"),width:"579",height:"545",viewBox:"0 0 579 545",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M-533.574 -60.9353C-620.385 -156.021 -687.664 -17.5491 -710.452 63.5727C-719.527 168.406 -734.923 386.578 -723.904 420.599C-710.131 463.126 -605.759 502.612 -506.134 535.775C-406.509 568.938 22.9901 719.287 54.6142 722.437C86.2383 725.586 431 879.069 567.5 455.569C684.839 91.5184 -151.664 233.569 -162.047 136.821C-184.693 -74.1947 -425.059 57.922 -533.574 -60.9353Z",style:{fill:"rgb(from var(--primary) calc(r - -200) calc(g - -157) calc(b - -41))"}})}),(0,r.jsx)("svg",{className:"absolute left-0 hidden ".concat(a?"lg:hidden":"lg:block"),width:"519",height:"545",viewBox:"0 0 519 545",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M-606.506 -164.859C-693.317 -259.944 -751.006 -6.72946 -773.794 74.3923C-782.869 179.225 -798.264 397.397 -787.246 431.419C-773.472 473.946 -669.101 513.432 -569.476 546.595C-469.85 579.758 -40.3516 730.107 -8.72754 733.256C22.8965 736.406 367.658 978.641 504.158 555.141C621.497 191.09 -18.3179 302.398 -35.5959 159.898C-61.1412 -50.7864 -497.991 -46.0014 -606.506 -164.859Z",fill:"white"})}),(0,r.jsx)("div",{className:a?"z-[5] hidden h-[260px] w-[300px] flex-shrink-0 flex-col items-center justify-center lg:flex xl:h-[280px] xl:w-[320px]":"z-[5] hidden h-[280px] w-[280px] flex-shrink-0 flex-col items-center justify-center gap-[10px] px-4 min-[1440px]:px-6 lg:flex xl:h-[481px] xl:w-[473px]",children:(0,r.jsx)(k.default,{className:a?"h-[220px] w-[270px] object-contain lg:h-[240px] lg:w-[300px] xl:h-[260px] xl:w-[320px]":"h-[180px] w-[220px] object-contain min-[1440px]:h-[360px] min-[1440px]:w-[440px] sm:h-[200px] sm:w-[250px] lg:h-[250px] lg:w-[300px] xl:h-[343px] xl:w-[425px]",src:"/images/images-Template4/server.svg",alt:"Server Illustration",width:425,height:343,priority:!0})}),(0,r.jsx)("div",{className:"@container/auth-form z-[6] flex min-h-0 w-full min-w-0 flex-1 flex-col",children:t})]})}var _=l(66654);let E=v.z.object({hash:v.z.string().nonempty("M\xe3 l\xe0 bắt buộc"),email:_.rK,password:_.$w,confirmPassword:_.$w}),I={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 A(e){let{setFormType:t,onClose:l}=e,[a,d]=(0,h.useState)(!1),[p,x]=(0,h.useState)(""),[v,b]=(0,h.useState)(""),k=(0,f.mN)({resolver:(0,m.u)(E),values:{password:"",confirmPassword:"",hash:"",email:""},mode:"onChange"}),{formState:{isSubmitting:_,isValid:A},setError:F}=k,M=k.watch("email"),S=(0,s.r)(e=>e.config);async function B(e){try{if(!p)return void b("Vui l\xf2ng x\xe1c nhận bạn kh\xf4ng phải l\xe0 người m\xe1y");await w.A.postApi("/api/v1/auth/reset/password",e,"",{headers:{"x-merchant-id":null==S?void 0:S.merchantId}}),g.toast.success("Đặt lại mật khẩu th\xe0nh c\xf4ng",{duration:5e3,icon:(0,r.jsx)(y.A,{className:"text-success h-4 w-4"})})}catch(e){if(e instanceof j.pe){var t,l,a;let r=null==(t=e.response)?void 0:t.data;if(null==r?void 0:r.errors)for(let[e,t]of Object.entries(r.errors))F(e,{type:"server",message:null!=(a=null==I?void 0:I[null!=(l=null==t?void 0:t.key)?l:t])?a:t})}else g.toast.error("Đặt lại mật khẩu lỗi",{description:"Lỗi kết nối đến m\xe1y chá»
1§.",duration:5e3,icon:(0,r.jsx)(u.A,{className:"text-error h-4 w-4"})})}}async function P(e){try{e.preventDefault(),d(!0),await k.trigger("email")&&(await w.A.postApi("/api/v1/auth/forgot/password",{email:M},"",{headers:{"x-merchant-id":null==S?void 0:S.merchantId}}),g.toast.success("Gá»­i m\xe3 th\xe0nh c\xf4ng",{duration:5e3,icon:(0,r.jsx)(y.A,{className:"text-success h-4 w-4"})}))}catch(e){if(e instanceof j.pe){var t,l,a,s;let n=null==(t=e.response)?void 0:t.data;if(null==n?void 0:n.errors)for(let[e,t]of Object.entries(n.errors))F(e,{type:"server",message:null!=(s=null==I?void 0:I[null!=(a=null==t?void 0:t.key)?a:t])?s:t});else g.toast.error("Gá»­i m\xe3 lỗi",{description:null!=(l=null==n?void 0:n.message)?l:"Lỗi kết nối đến m\xe1y chá»§.",duration:5e3,icon:(0,r.jsx)(u.A,{className:"text-error h-4 w-4"})})}else g.toast.error("Gá»­i m\xe3 lỗi",{description:"Lỗi kết nối đến m\xe1y chá»§.",duration:5e3,icon:(0,r.jsx)(u.A,{className:"text-error h-4 w-4"})})}finally{d(!1)}}return(0,r.jsx)(z,{children:(0,r.jsxs)("div",{className:"flex h-auto w-full max-w-full min-w-0 flex-col items-start gap-3 px-3 py-4 min-[1440px]:max-w-[580px] lg:h-[481px] lg:max-w-[540px] lg:gap-6 lg:overflow-y-auto lg:px-6 lg:py-0 2xl:max-w-[600px]",children:[(0,r.jsx)(C,{}),(0,r.jsx)(i.lV,{...k,children:(0,r.jsxs)("form",{onSubmit:k.handleSubmit(B),className:"flex w-full flex-col items-start gap-3 sm:gap-4",children:[(0,r.jsx)(i.zB,{control:k.control,name:"email",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"z-10 w-full",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"pointer-events-none absolute top-1/2 left-4 !h-5 !w-5 -translate-y-1/2 transition-colors ".concat(t.value?"text-primary":"text-icon"),children:(0,r.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z",fill:"currentColor"})}),(0,r.jsx)(o.p,{autoComplete:"email",type:"email",placeholder:"Nhập email",className:"auth-input-white border-border-template-4 focus-visible:border-primary h-[40px] w-full rounded-[8px] border pl-[48px] text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focus-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})]})}),(0,r.jsx)(i.C5,{})]})}}),(0,r.jsxs)("div",{className:"z-10 flex w-full flex-row gap-3",children:[(0,r.jsx)(i.zB,{control:k.control,name:"hash",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"flex-1",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsx)(o.p,{autoComplete:"one-time-code",type:"text",placeholder:"Nhập m\xe3 OTP",className:"auth-input-white border-border-template-4 focus-visible:border-primary h-[40px] w-full rounded-[8px] border px-4 text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focus-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})}),(0,r.jsx)(i.C5,{})]})}}),(0,r.jsx)(n.$,{onClick:P,className:"bg-primary hover:bg-primary/90 h-[40px] rounded-[8px] px-6 text-base leading-[130%] font-semibold text-white",disabled:a||!M||""===M,type:"button",children:"Gá»­i"})]}),(0,r.jsx)(i.zB,{control:k.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"z-10 w-full",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsx)(c.c,{autoComplete:"new-password",placeholder:"Nhập mật khẩu mới",hasValue:!!t.value,className:"auth-input-white border-border-template-4 focus-visible:border-primary h-[40px] w-full rounded-[8px] border pl-12 text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focus-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})}),(0,r.jsx)(i.C5,{})]})}}),(0,r.jsx)(i.zB,{control:k.control,name:"confirmPassword",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"z-10 w-full",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsx)(c.c,{autoComplete:"new-password",placeholder:"X\xe1c nhận mật khẩu mới",hasValue:!!t.value,className:"auth-input-white border-border-template-4 focus-visible:border-primary h-[40p
1x] w-full rounded-[8px] border pl-12 text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focus-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})}),(0,r.jsx)(i.C5,{})]})}}),(0,r.jsxs)("div",{className:"z-10 w-full",children:[(0,r.jsx)(N.A,{sitekey:"6LcpBJ0pAAAAAP1Tf9GVLbiodi69ko_XQCP6Kqvx",onChange:e=>{e&&(x(e),v&&b(""))},onExpired:()=>x(""),hl:"vi",className:"w-full origin-top-left scale-[0.85] sm:scale-100"}),v&&(0,r.jsx)("span",{className:"text-base leading-[130%] font-normal text-[#DC2626]",children:v})]}),(0,r.jsx)(n.$,{className:"bg-primary hover:bg-primary/90 z-10 flex h-[43px] w-full flex-row items-center justify-center gap-2 rounded-[8px] px-8 py-2 text-[18px] leading-[150%] font-semibold text-white",disabled:_||!A,type:"submit",children:"Đặt lại mật khẩu"}),(0,r.jsxs)("div",{className:"flex w-full items-center text-base leading-[130%] font-normal text-[#9E9E9F]",children:["Bạn đ\xe3 t\xecm lại được mật khẩu?"," ",(0,r.jsx)(n.$,{onClick:()=>t("login"),type:"button",variant:"link",className:"text-primary p-0 pl-1 text-base font-normal",children:"Đăng nhập ngay"})]})]})})]})})}var F=l(95307),M=l(35652);let S=v.z.object({firstName:_.fV,lastName:_.tM,email:_.rK,phone:_.KA,password:_.$w}),B={invalidPhone:"Số điện thoại kh\xf4ng hợp lệ",phoneExists:"Số điện thoại đ\xe3 tồn tại"};function P(e){let{setFormType:t}=e,l=(0,f.mN)({resolver:(0,m.u)(S),values:{email:"",password:"",firstName:"",lastName:"",phone:""},mode:"onChange"}),{formState:{isSubmitting:d,isValid:x},setError:v}=l,b=(0,s.r)(e=>e.config),[k,_]=(0,h.useState)(""),[E,I]=(0,h.useState)("");async function A(e){try{if(!k)return void I("Vui l\xf2ng x\xe1c nhận bạn kh\xf4ng phải l\xe0 người m\xe1y");let t=(0,F.G2)(),l=(0,a.mD)(),s={...e,...l&&{domainSource:l},...t&&{refClickId:t}};await w.A.postApi("/api/v1/auth/register",s,"",{headers:{"x-merchant-id":null==b?void 0:b.merchantId}}),t&&(0,F.p7)(),g.toast.success("Đăng k\xfd th\xe0nh c\xf4ng",{duration:5e3,icon:(0,r.jsx)(y.A,{className:"text-success h-4 w-4"})}),await (0,a.Jv)("credentials",{phone:e.phone,password:e.password,merchantId:null==b?void 0:b.merchantId,redirect:!1}),(0,M.E)(),(0,a.IL)()||(window.location.href=(0,a.LN)())}catch(e){if(e instanceof j.pe){var t,l,s;let r=null==(t=e.response)?void 0:t.data;if(null==r?void 0:r.errors)for(let[e,t]of Object.entries(r.errors))v(e,{type:"server",message:null!=(s=null==B?void 0:B[null!=(l=null==t?void 0:t.key)?l:t])?s:t})}else g.toast.error("Đăng k\xfd lỗi",{description:"Lỗi kết nối đến m\xe1y chủ.",duration:5e3,icon:(0,r.jsx)(u.A,{className:"text-error h-4 w-4"})})}}return(0,r.jsx)(z,{children:(0,r.jsxs)("div",{className:"no-scrollbar flex h-auto w-full max-w-full min-w-0 flex-col items-start gap-4 overflow-y-auto px-3 py-4 min-[1440px]:max-w-[580px] lg:h-[481px] lg:max-w-[540px] lg:gap-[24px] lg:px-[24px] lg:py-0 2xl:max-w-[600px]",children:[(0,r.jsx)(C,{}),(0,r.jsx)("p",{className:"w-full text-[18px] leading-[145%] font-normal text-[#000E43] sm:text-[20px]",children:"Tạo t\xe0i khoản mới"}),(0,r.jsx)(i.lV,{...l,children:(0,r.jsxs)("form",{onSubmit:l.handleSubmit(A),className:"flex w-full flex-col items-start gap-3 sm:gap-[16px]",children:[(0,r.jsx)(i.zB,{control:l.control,name:"firstName",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"z-10 w-full",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsx)(o.p,{autoComplete:"given-name",placeholder:"Nhập họ",className:"auth-input-white border-border-template-4 focus-visible:border-primary h-[37px] w-full rounded-[8px] border px-4 text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focus-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})}),(0,r.jsx)(i.C5,{})]})}}),(0,r.jsx)(i.zB,{control:l.control,name:"lastName",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"z-10 w-full",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsx)(o.p,{autoComplete:"family-name",placeholder:"Nhập t\xean",className:"auth-input-white border-border-template-4 focus-visible:border-primary h-[37px] w-full rounded-[8px] border px-4 text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focu
1s-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})}),(0,r.jsx)(i.C5,{})]})}}),(0,r.jsx)(i.zB,{control:l.control,name:"phone",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"z-10 w-full",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)(p.F.PhoneIcon,{className:"pointer-events-none absolute top-1/2 left-4 !h-5 !w-5 -translate-y-1/2 transition-colors ".concat(t.value?"text-primary":"text-icon")}),(0,r.jsx)(o.p,{autoComplete:"tel",type:"tel",placeholder:"Nhập số điện thoại",className:"auth-input-white border-border-template-4 focus-visible:border-primary h-[40px] w-full rounded-[8px] border pl-[48px] text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focus-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})]})}),(0,r.jsx)(i.C5,{})]})}}),(0,r.jsx)(i.zB,{control:l.control,name:"email",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"z-10 w-full",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"pointer-events-none absolute top-1/2 left-4 !h-5 !w-5 -translate-y-1/2 transition-colors ".concat(t.value?"text-primary":"text-icon"),children:(0,r.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z",fill:"currentColor"})}),(0,r.jsx)(o.p,{autoComplete:"email",type:"email",placeholder:"Nhập email",className:"auth-input-white border-border-template-4 focus-visible:border-primary h-[40px] w-full rounded-[8px] border pl-[48px] text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focus-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})]})}),(0,r.jsx)(i.C5,{})]})}}),(0,r.jsx)(i.zB,{control:l.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"z-10 w-full",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsx)(c.c,{autoComplete:"new-password",placeholder:"Nhập mật khẩu",hasValue:!!t.value,className:"auth-input-white border-border-template-4 focus-visible:border-primary h-[40px] w-full rounded-[8px] border pl-12 text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focus-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})}),(0,r.jsx)(i.C5,{})]})}}),(0,r.jsxs)("div",{className:"z-10 w-full",children:[(0,r.jsx)(N.A,{sitekey:"6LcpBJ0pAAAAAP1Tf9GVLbiodi69ko_XQCP6Kqvx",onChange:e=>{e&&(_(e),E&&I(""))},onExpired:()=>_(""),hl:"vi",className:"w-full origin-top-left scale-[0.85] sm:scale-100"}),E&&(0,r.jsx)("span",{className:"text-base leading-[130%] font-normal text-[#DC2626]",children:E})]}),(0,r.jsx)(n.$,{className:"bg-primary hover:bg-primary/90 z-10 flex h-[43px] w-full flex-row items-center justify-center gap-2 rounded-[8px] px-8 py-2 text-[18px] leading-[150%] font-semibold text-white",disabled:d||!x,type:"submit",children:"Tạo t\xe0i khoản"}),(0,r.jsxs)("div",{className:"flex w-full items-center text-base leading-[130%] font-normal text-[#9E9E9F]",children:["Bạn đ\xe3 c\xf3 t\xe0i khoản?"," ",(0,r.jsx)(n.$,{onClick:()=>t("login"),type:"button",variant:"link",className:"text-primary p-0 pl-1 text-base font-normal",children:"Đăng nhập"})]})]})})]})})}var J=l(86948),L=l(41052),V=l(65142),$=l(80389),O=l(76444),R=l(96199);let T=v.z.object({password:v.z.string().optional(),firstName:v.z.string().min(2,"Họ tối thiểu 2 k\xed tá»±").optional(),lastName:v.z.string().min(2,"T\xean tối thiểu 2 k\xed tá»±").optional(),email:v.z.string().optional(),oldPassword:v.z.string().optional()}),D={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 G(e){var t,l,i,o;let{onCallBack:c=()=>{}}=e,{data:d}=(0,R.wV)(),{user:p,setUser:x}=b(),h={firstName:null!=(i=null==p?void 0:p.firstName)?i:"",lastName:null!=(o=null==p?void 0:p.lastName)?o:"",email:null==p?void 0:p.email,password:"",oldPassword:""},v=(0,f.mN)({resolver:(0,m.u)(T),values:h}),{formState:{isSubmitting:N},setError:C}=v,z=(0,s.r)(e=>e.config);async function _(e){try{let t={...e};(null==e?void 0:e.password)||delete e.password,(null==e?void 0:e.oldPassword)||delete e.oldPassword;let l=await w.A.patchApi("/api/v1/auth/me",e,null==d?void 0:d.accessToken).then(e=>e.data);t.password?(0,a.CI)({callbackUrl:new URL("/",window.location.href).href,redirect:!0}):x(l),g.toast.success("Cập nhật th\xf4ng tin th\xe0nh c\xf4ng",{duration:5e3,icon:(0,r.jsx)(y.A,{className:"h-4 w-4 text-green-600"})}),c()}catch(e){if(e instanceof j.pe){var t,l,s;let r=null==(t=e.response)?void 0:t.data;if(null==r?void 0:r.errors)for(let[e,t]of Object.entries(r.errors))C(e,{type:"server",message:null!=(s=null==D?void 0:D[null!=(l=null==t?void 0:t.key)?l:t])?s:t})}else g.toast.error("Cập nhật th\xf4ng tin lỗi",{description:"Lỗi kết nối đến m\xe1y chá»
1§.",duration:5e3,icon:(0,r.jsx)(u.A,{className:"h-4 w-4 text-red-500"})})}}return(0,r.jsxs)(J.Zp,{className:"mx-auto w-full gap-4 border-none shadow-none",children:[(0,r.jsxs)(J.aR,{className:"gap-8",children:[(0,r.jsx)(J.ZB,{className:"text-center",children:(null==z||null==(t=z.theme)?void 0:t.logo)&&(0,r.jsx)(k.default,{className:"mx-auto",src:z.theme.logo.replace("/api/v1",""),alt:"",width:88,height:88})}),(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("h3",{className:"text-2xl font-semibold",children:"Cập nhật th\xf4ng tin"})})]}),(0,r.jsx)(J.Wu,{children:(0,r.jsx)(L.lV,{...v,children:(0,r.jsxs)("form",{onSubmit:v.handleSubmit(_),className:"space-y-5",children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)(L.zB,{control:v.control,name:"firstName",render:e=>{let{field:t}=e;return(0,r.jsxs)(L.eI,{children:[(0,r.jsx)(L.lR,{children:"Họ"}),(0,r.jsx)(L.MJ,{children:(0,r.jsx)(V.p,{autoComplete:"given-name",placeholder:"Nhập họ",className:"h-10",...t})}),(0,r.jsx)(L.C5,{})]})}}),(0,r.jsx)(L.zB,{control:v.control,name:"lastName",render:e=>{let{field:t}=e;return(0,r.jsxs)(L.eI,{children:[(0,r.jsx)(L.lR,{children:"T\xean"}),(0,r.jsx)(L.MJ,{children:(0,r.jsx)(V.p,{autoComplete:"family-name",placeholder:"Nhập t\xean",className:"h-10",...t})}),(0,r.jsx)(L.C5,{})]})}})]}),(0,r.jsxs)("div",{className:"grid gap-2",children:[(0,r.jsx)(O.J,{children:"Số điện thoại"}),(0,r.jsx)(V.p,{disabled:!0,className:"h-10",value:null==d||null==(l=d.user)?void 0:l.phone})]}),(0,r.jsx)(L.zB,{control:v.control,name:"email",render:e=>{let{field:t}=e;return(0,r.jsxs)(L.eI,{children:[(0,r.jsx)(L.lR,{children:"Email"}),(0,r.jsx)(L.MJ,{children:(0,r.jsx)(V.p,{autoComplete:"email",type:"email",placeholder:"Nhập email",className:"h-10",...t})}),(0,r.jsx)(L.C5,{})]})}}),(0,r.jsx)(L.zB,{control:v.control,name:"oldPassword",render:e=>{let{field:t}=e;return(0,r.jsxs)(L.eI,{children:[(0,r.jsx)(L.lR,{children:"Mật khẩu cÅ©"}),(0,r.jsx)(L.MJ,{children:(0,r.jsx)($.c,{className:"h-10",placeholder:"Nhập mật khẩu",autoComplete:"current-password",...t})}),(0,r.jsx)(L.C5,{})]})}}),(0,r.jsx)(L.zB,{control:v.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(L.eI,{children:[(0,r.jsx)(L.lR,{children:"Mật khẩu"}),(0,r.jsx)(L.MJ,{children:(0,r.jsx)($.c,{className:"h-10",placeholder:"Nhập mật khẩu",autoComplete:"new-password",...t})}),(0,r.jsx)(L.C5,{})]})}})]}),(0,r.jsx)(n.$,{className:"h-12 w-full",size:"lg",disabled:N,type:"submit",children:"X\xe1c nhận"})]})})})]})}let K=v.z.object({phone:_.KA,password:_.$w}),H={incorrectPassword:"Mật khẩu kh\xf4ng ch\xednh x\xe1c",notFound:"Số điện thoại kh\xf4ng tồn tại",invalidPhone:"Số điện thoại kh\xf4ng hợp lệ"};function X(e){let{initFormType:t="login",onCallBack:l=()=>{}}=e,v=(0,f.mN)({resolver:(0,m.u)(K),values:{phone:"",password:""},mode:"onChange"}),{formState:{isSubmitting:w,isValid:j},setError:y}=v,N=(0,s.r)(e=>e.config),k=b(e=>e.user);async function _(e){try{let r=await (0,a.Jv)("credentials",{...e,merchantId:null==N?void 0:N.merchantId,redirect:!1});if(r.code||r.error){let e=JSON.parse(r.code);if(null==e?void 0:e.errors)for(let[l,r]of Object.entries(e.errors)){var t,s;y(l,{type:"server",message:null!=(s=null==H?void 0:H[null!=(t=null==r?void 0:r.key)?t:r])?s:r})}}else(0,a.IL)()?l():window.location.href=(0,a.LN)()}catch(e){g.toast.error("Đăng Nhập lỗi",{description:"Lỗi kết nối đến m\xe1y chá»§.",duration:5e3,icon:(0,r.jsx)(u.A,{className:"text-error h-4 w-4"})})}}let[E,I]=(0,h.useState)(!0);(0,h.useEffect)(()=>{(null==k?void 0:k.id)&&I(!1)},[null==k?void 0:k.id]);let[F,M]=(0,h.useState)(t);return(0,h.useLayoutEffect)(()=>()=>{I(!0)},[]),(0,r.jsxs)(d.a,{title:"",titleClassName:"hidden",description:"",isOpen:E,onClose:()=>{I(!1),l()},headerClassName:"!bg-transparent !h-auto !absolute !top-3 !right-3 !w-auto !p-0 !z-[100] sm:!top-4 sm:!right-4",className:(0,x.cn)("!h-auto !w-[calc(100%-2rem)] !max-w-[calc(100%-2rem)] !overflow-hidden !rounded-[16px] !p-0","login"===F?"md:!w-[640px] lg:!w-[736px]":"max-h-[90vh] overflow-y-auto min-[1440px]:!w-[1200px] md:!w-[640px] lg:!w-[1040px] xl:!w-[1120px] 2xl:!w-[1260px]"),children:["login"==F&&(0,r.jsx)(z,{variant:"compact",children:(0,r.jsxs)("div",{className:"flex h-auto w-full max-w-full min-w-0 flex-col items-start justify-center gap-3 px-1 py-2 sm:px-2 lg:max-w-[360px] lg:gap-4 lg:py-0 xl:max-w-[380px]",children:[(0,r.jsx)(C,{compact:!0}),(0,r.jsx)(i.lV,{...v,children:(0,r.jsxs)("form",{onSubmit:v.handleSubmit(_),className:"flex w-full flex-col items-start gap-2.5 sm:gap-3",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-start gap-2.5 sm:gap-3",children:[(0,r.jsx)(i.zB,{control:v.control,name:"phone",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"z-10 w-full",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)(p.F.PhoneIcon,{className:"pointer-events-none absolute top-1/2 left-4 !h-5 !w-5 -translate-y-1/2 transition-colors ".concat(t.value?"text-primary":"text-icon")}),(0,r.jsx)(o.p,{autoComplete:"username",type:"tel",placeholder:"Nhập số điện thoại",className:"auth-input-white border-border-template-4 h-[40px] w-full rounded-[8px] border pl-[48px] text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focu
1s-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})]})}),(0,r.jsx)(i.C5,{})]})}}),(0,r.jsx)(i.zB,{control:v.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(i.eI,{className:"z-10 w-full",children:[(0,r.jsx)(i.MJ,{children:(0,r.jsx)(c.c,{autoComplete:"current-password",placeholder:"Nhập mật khẩu",hasValue:!!t.value,className:"auth-input-white border-border-template-4 h-[40px] w-full rounded-[8px] border pl-12 text-base leading-[130%] font-normal placeholder:text-[#9E9E9F] focus-visible:ring-0 focus-visible:ring-offset-0 ".concat(t.value?"text-primary":"text-text-normal-template-4"),...t})}),(0,r.jsx)(i.C5,{})]})}})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-start gap-2 sm:gap-2.5",children:[(0,r.jsx)(n.$,{className:"bg-primary hover:bg-primary/90 z-10 flex h-10 w-full flex-row items-center justify-center gap-2 rounded-[8px] px-6 py-2 text-base leading-normal font-semibold text-white",disabled:w||!j,type:"submit",children:"Đăng nhập"}),(0,r.jsx)(n.$,{onClick:()=>M("forgotPassword"),type:"button",variant:"link",className:"text-primary h-auto w-full p-0 text-center text-sm leading-normal font-semibold underline hover:no-underline",children:"Qu\xean mật khẩu"})]}),(0,r.jsxs)("div",{className:"flex w-full items-center text-sm leading-normal font-normal text-[#9E9E9F]",children:["Chưa c\xf3 t\xe0i khoản?"," ",(0,r.jsx)(n.$,{onClick:()=>M("register"),type:"button",variant:"link",className:"text-primary p-0 pl-1 text-sm font-normal",children:"Đăng k\xfd"})]})]})})]})}),"register"==F&&(0,r.jsx)(P,{setFormType:M}),"forgotPassword"==F&&(0,r.jsx)(A,{setFormType:M,onClose:()=>{I(!1),l()}}),"updateProfile"==F&&(0,r.jsx)(G,{onCallBack:l})]})}},60475:(e,t,l)=>{l.d(t,{C5:()=>g,MJ:()=>f,eI:()=>u,lR:()=>h,lV:()=>c,zB:()=>p});var r=l(95155),a=l(12115),s=l(32467),n=l(22544),i=l(64269),o=l(76444);let c=n.Op,d=a.createContext({}),p=e=>{let{...t}=e;return(0,r.jsx)(d.Provider,{value:{name:t.name},children:(0,r.jsx)(n.xI,{...t})})},x=()=>{let e=a.useContext(d),t=a.useContext(m),{getFieldState:l,formState:r}=(0,n.xW)(),s=l(e.name,r);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=t;return{id:i,name:e.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message"),...s}},m=a.createContext({}),u=a.forwardRef((e,t)=>{let{className:l,...s}=e,n=a.useId();return(0,r.jsx)(m.Provider,{value:{id:n},children:(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex w-full flex-col gap-2",l),...s})})});u.displayName="FormItem";let h=a.forwardRef((e,t)=>{let{className:l,...a}=e,{error:s,formItemId:n}=x();return(0,r.jsx)(o.J,{ref:t,className:(0,i.cn)(s&&"text-text-normal","h-[17px]",l),htmlFor:n,...a})});h.displayName="FormLabel";let f=a.forwardRef((e,t)=>{let{...l}=e,{error:a,formItemId:n,formDescriptionId:i,formMessageId:o}=x();return(0,r.jsx)(s.DX,{ref:t,id:n,"aria-describedby":a?"".concat(i," ").concat(o):"".concat(i),"aria-invalid":!!a,...l})});f.displayName="FormControl",a.forwardRef((e,t)=>{let{className:l,...a}=e,{formDescriptionId:s}=x();return(0,r.jsx)("p",{ref:t,id:s,className:(0,i.cn)("text-[0.8rem] text-muted-foreground",l),...a})}).displayName="FormDescription";let g=a.forwardRef((e,t)=>{var l;let{className:a,children:s,...n}=e,{error:o,formMessageId:c}=x(),d=o?String(null!=(l=null==o?void 0:o.message)?l:""):s;return d?(0,r.jsx)("p",{ref:t,id:c,className:(0,i.cn)("text-sm font-medium text-error",a),...n,children:d}):null});g.displayName="FormMessage"},68388:(e,t,l)=>{l.d(t,{a:()=>n});var r=l(95155),a=l(61504),s=l(64269);let n=e=>{let{title:t,description:l,isOpen:n,onClose:i,children:o,className:c,titleClassName:d,headerClassName:p,closeButtonClassName:x}=e;return(0,r.jsx)(a.lG,{open:n,onOpenChange:e=>{e||i()},children:(0,r.jsxs)(a.Cf,{className:c,title:t,description:l,titleClassName:null!=d?d:"",headerClassName:null!=p?p:"",onOpenAutoFocus:e=>{e.preventDefault()},showCloseButton:!1,children:[(0,r.jsx)("button",{type:"button",onClick:i,className:(0,s.cn)("absolute z-99 top-4 right-4 flex h-10 w-10 items-center justify-center rounded-full transition-all duration-200 hover:bg-gray-100 hover:rotate-90 curs
1or-pointer focus:outline-none",x),children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-6 w-6 text-[#636364]",children:[(0,r.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,r.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,r.jsx)("div",{children:o})]})})}},80264:(e,t,l)=>{l.d(t,{c:()=>i});var r=l(95155);l(12115);var a=l(55817),s=l(64269),n=l(76830);function i(e){let{className:t,hideKeyIcon:l=!1,hasValue:i=!1,...o}=e;return(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(a.bL,{children:(0,r.jsxs)("div",{className:"relative w-full",children:[!l&&(0,r.jsx)("div",{className:"absolute top-1/2 left-4 !h-5 !w-5 -translate-y-1/2 transition-colors ".concat(i?"text-primary":"text-icon hover:text-icon"),children:(0,r.jsx)(n.F.KeyIcon,{className:"pointer-events-none !h-5 !w-5"})}),(0,r.jsx)(a.pd,{className:(0,s.cn)("placeholder:text-icon selection:bg-primary selection:text-primary-foreground dark:bg-input/30 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]",!l&&"pl-[56px]","truncate overflow-hidden text-ellipsis whitespace-nowrap",t),...o}),(0,r.jsx)(a.lM,{id:o.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,r.jsx)(a.In,{visible:(0,r.jsx)(n.F.EyeOpenIcon,{className:"text-primary !h-5 !w-5"}),hidden:(0,r.jsx)(n.F.EyeCloseIcon,{className:"text-primary !h-5 !w-5"})})})]})})})}}}]);

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.