1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2365],{62668:function(e,s,t){t.d(s,{n:function(){return o}});var r=t(39696),a=t(90170),l=t(34269);function o(e){let{siteKey:s="",verifyLoading:t=!0,success:o}=e,i=(0,a.useRef)(),[n,d]=(0,a.useState)("");return(0,a.useEffect)(()=>{if(t){var e,s,r;if("solved"===n){let t=null===(e=i.current)||void 0===e?void 0:e.getResponse();t?(o(t),d("expired")):null===(s=i.current)||void 0===s||s.resetCaptcha()}else""!==n&&(null===(r=i.current)||void 0===r||r.resetCaptcha())}},[t,n]),(0,r.jsx)(l.Z,{sitekey:s||"b6ee6c68-a540-4c3a-b1de-5de6fcb8ada0",onError:()=>d("error"),onExpire:()=>d("expired"),onVerify:()=>d("solved"),ref:i})}},75670:function(e,s,t){var r=t(25043);let a=t.n(r)()(()=>Promise.all([t.e(3905),t.e(4939),t.e(7473),t.e(5845),t.e(6628)]).then(t.bind(t,96628)),{loadableGenerated:{webpack:()=>[96628]},ssr:!1,loading:()=>null});s.Z=a},2365:function(e,s,t){t.r(s),t.d(s,{default:function(){return H}});var r=t(39696),a=t(90170),l=t(2649),o=t(95866),i=t(38489),n=t(32324),d=t(36380),c=t.n(d),u=t(56156),m=t(8722);function f(e){return"function"==typeof e}function x(e,s,t){return t?s:{...e,...s}}function g(e){let s={},t={};return Object.keys(e||{}).forEach(r=>{let a=e[r];f(a)?t[r]=a:s[r]=a}),{state:s,actions:t}}let h=function(e){let s=(0,a.createContext)(null),t=(0,a.createContext)(null),l=(0,a.createContext)(null),o={};{let s={},t={current:void 0};o=g(e(function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=t.current||s,l=f(e)?e(a):e;s=x(a,l,r),t.current=s},()=>t.current||s)).state}let i={current:o},n={};function d(e){Object.keys(e||{}).forEach(e=>{Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get(){var s;return null===(s=i.current)||void 0===s?void 0:s[e]}})})}function c(){let e=(0,a.useContext)(s);if(!e)throw Error("useStateOnly must be used within the store Provider");return e.state}function u(){let e=(0,a.useContext)(t);if(!e)throw Error("useActions must be used within the store Provider");return e}return d(o),Object.defineProperties(n,{Provider:{value:function(n){let{children:c,initialState:u}=n,m=(0,a.useRef)(),[h,p]=(0,a.useState)(()=>{let e=o;return u?{...e,...u}:e});m.current=h,i.current=h;let w=(0,a.useCallback)(()=>m.current,[]),v=(0,a.useCallback)(function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p(t=>{let r=f(e)?e(t):e,a=x(t,r,s);return d(a),a})},[]),y=(0,a.useMemo)(()=>({getState:w,setState:v}),[w,v]),{actions:b}=(0,a.useMemo)(()=>{let{actions:s}=g(e(function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return v(e,s)},w)),t={};return Object.keys(s).forEach(e=>{let r=s[e];t[e]=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return r(...s)}}),{actions:t}},[]);return(0,r.jsx)(l.Provider,{value:y,children:(0,r.jsx)(t.Provider,{value:b,children:(0,r.jsx)(s.Provider,{value:{state:h},children:c})})})}},useStore:{value:function(e){let s=c(),t=u(),{setState:r,getState:o}=function(){let e=(0,a.useContext)(l);if(!e)throw Error("useApi must be used within the store Provider");return e}(),i=(0,a.useMemo)(()=>({state:s,actions:t,setState:r,getState:o}),[s,t,r,o]);return f(e)?e(i):i}},useSelector:{value:function(e,s){let t=e(c()),r=(0,a.useRef)(t);return(s||Object.is)(r.current,t)||(r.current=t),r.current}},useState:{value:c},useActions:{value:u}}),n.getState=()=>i.current,n.setState=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=i.current||{},r=f(e)?e(t):e,a=x(t,r,s);d(a),i.current=a},n}((e,s)=>{let t;return{email:"",setEmail:s=>e({email:s}),password:"",setPassword:s=>e({password:s}),confirmPassword:"",setConfirmPassword:s=>e({confirmPassword:s}),sendCodeLoading:!1,codeExpiry:0,alert:{type:null,message:""},setAlert:s=>e({alert:s}),countdown:0,setCountdown:s=>e({countdown:s}),verifyLoading:!1,setVerifyLoading:s=>e({verifyLoading:s}),handleCaptchaSuccess:async(s,r)=>(e({verifyLoading:!1}),t(s,r)),sendVerificationCode:t=async function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=s();if(!r){e({verifyLoading:!0});return}if(!a.sendCodeLoading&&!(a.countdown>0))try{e({sendCodeLoading:!0}),e({alert:{type:null,message:""}});let s=[{email:a.email,type:"registration"},{verify:r}],l=await m.i.sendCode(...s);200===l.code?(e({codeExpiry:Date.now()+3e5}),e({alert:{type:"success",message:t("verifyCode.alert.codeSentTo",{email:a.email})}}),e({countdown:60})):e({alert:{type:"danger",message:l.msg}}),e({sendCodeLoading:!1})}catch(s){console.error(s),e({alert:{type:"danger",message:s.message}}),e({sendCodeLoading:!1})}}}});var p=t(27220),w=t(84140),v=t(18492),y=t(58302),b=t(75670),j=t(68237),C=e=>{let{containerRef:s,loginSuccessCallback:t}=e,{t:l}=(0,u.Z)("common"),{userStore:o}=(0,p.o)(),i=(0,j.useRouter)(),[n,d]=(0,a.useState)("100%");return(0,a.useEffect)(()=>{let e=()=>{s.current&&d(s.current.offsetWidth)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex flex-col items-center gap-2 overflow-hidden rounded-lg",children:(0,r.jsx)(y.kZ,{onSuccess:e=>{let s=v.ZP.loading(l("googleOneTap.loading"));o.sendGoogleLogin(e.credential,()=>{t?t():i.push("/market"),v.ZP.success(l("googleOneTap.success"))}).finally(()=>{v.ZP.dismiss(s)})},onError:()=>{v.ZP.error(l("googleOneTap.error"))},theme:"filled_green",size:"large",width:n,type:"standard",text:"signin_with",shape:"rectangular",logo_alignment:"left"})}),(0,r.jsx)(b.Z,{loginSuccessCallback:t})]})},N=e=>{let{loginSuccessCallback:s}=e,{state:t,actions:l}=h.useStore(),{userStore:o}=(0,p.o)(),{t:i,lang:d}=(0,u.Z)("get-started"),m=(0,j.useRouter)(),[[f,x],g]=a.useState([0,0]),[v,y]=a.useState(!0),[b,N]=(0,a.useState)(!1),[P,S]=(0,a.useState)({isVisible:!1,info:""}),k=(0,a.useRef)(null),L=a.useMemo(()=>{let e="CN"===o.ipCountry,s="zh-CN"===d||"zh-CN"===m.locale;return e||s},[o.ipCountry,d,m.locale]);return(0,r.jsx)("div",{ref:k,className:"flex w-full flex-col gap-4 roun
1ded-large",children:(0,r.jsxs)("div",{className:"flex w-full flex-col gap-4 rounded-large",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,r.jsx)(c(),{src:"/logo-icon.webp",width:100,height:100,alt:i("initial.logoAlt"),className:"h-12 w-12"}),(0,r.jsx)("p",{className:"text-xl font-medium",children:i("initial.title")}),(0,r.jsx)("p",{className:"text-small text-default-500",children:i("initial.subTitle")})]}),(0,r.jsx)(C,{containerRef:k,loginSuccessCallback:s}),L&&(0,r.jsx)(n.A,{fullWidth:!0,variant:"bordered",onPress:()=>setTimeout(()=>o.setLoginModalType("mobileLogin"),150),startContent:(0,r.jsx)(w.JO,{icon:"mdi:cellphone",className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-gray-800"}),className:"relative h-10 w-full border border-default-300 bg-white text-sm font-medium text-gray-800 shadow-sm",children:i("mobile.initial.continueWithMobile")}),(0,r.jsxs)("p",{className:"text-center text-small",children:[i("initial.alreadyHaveAccount"),"\xa0",(0,r.jsx)("span",{className:"cursor-pointer text-primary",onClick:()=>o.setLoginModalType("login"),children:i("initial.signIn")})]})]})})},P=t(51763),S=t(72017),k=t(82045),L=t(29281),O=t(97796),Z=t(62185),M=t(89970),T=t(82897),R=e=>{let{loginSuccessCallback:s}=e,{state:t,actions:l}=h.useStore(),{t:o,lang:i}=(0,u.Z)("get-started"),{userStore:d}=(0,p.o)(),c=(0,j.useRouter)(),[f,x]=(0,a.useState)(!1),g=(0,a.useRef)(null),[y,b]=(0,a.useState)(!1),[N,P]=(0,a.useState)({email:"",password:""}),[R,I]=(0,a.useState)({}),[A,E]=(0,a.useState)({isVisible:!1,info:""}),q=(0,a.useMemo)(()=>{let e="CN"===d.ipCountry,s="zh-CN"===i||"zh-CN"===c.locale;return e||s},[d.ipCountry,i,c.locale]),J=()=>{let e={};return t.email?/\S+@\S+\.\S+/.test(t.email)||(e.email=o("login.errors.email.invalid")):e.email=o("login.errors.email.required"),N.password||(e.password=o("login.errors.password.required")),I(e),0===Object.keys(e).length},z=async e=>{if(e.preventDefault(),J())try{b(!0);let e=await m.i.login({email:t.email,password:N.password});200===e.code?(v.ZP.success(o("login.messages.loginSuccess")),d.setLoginUserInfo(e.data),s?s():c.push("/market")):4030===e.code?c.push("/block"):E({isVisible:!0,info:e.msg})}catch(e){}finally{b(!1)}};return(0,r.jsxs)("div",{ref:g,className:"mt-2 flex w-full flex-col gap-4 roun
1ded-large",children:[(0,r.jsxs)(Z.m.div,{className:"flex min-h-[40px] items-center gap-2",children:[(0,r.jsx)(n.A,{isIconOnly:!0,size:"sm",variant:"flat",onPress:()=>d.setLoginModalType("initial"),children:(0,r.jsx)(w.JO,{className:"text-default-500",icon:"solar:alt-arrow-left-linear",width:16})}),(0,r.jsx)(Z.m.h1,{className:"text-xl font-medium",children:o("login.title")})]}),(0,r.jsxs)(S.l,{className:"flex flex-col gap-3",validationBehavior:"native",onSubmit:z,children:[(0,r.jsx)(k.Y,{isRequired:!0,label:o("login.form.email.label"),name:"email",placeholder:o("login.form.email.placeholder"),type:"email",variant:"bordered",value:t.email,onChange:e=>l.setEmail(e.target.value),isInvalid:!!R.email,errorMessage:R.email,startContent:(0,r.jsx)(M.Z,{className:"h-5 w-5 text-gray-400"})}),(0,r.jsx)(k.Y,{isRequired:!0,endContent:(0,r.jsx)("button",{type:"button",onClick:()=>x(!f),children:f?(0,r.jsx)(w.JO,{className:"pointer-events-none text-2xl text-default-400",icon:"solar:eye-closed-linear"}):(0,r.jsx)(w.JO,{className:"pointer-events-none text-2xl text-default-400",icon:"solar:eye-bold"})}),label:o("login.form.password.label"),name:"password",placeholder:o("login.form.password.placeholder"),type:f?"text":"password",variant:"bordered",value:N.password,onChange:e=>{let{name:s,value:t}=e.target;P(e=>({...e,[s]:t})),R[s]&&I(e=>({...e,[s]:""}))},isInvalid:!!R.password,errorMessage:R.password,startContent:(0,r.jsx)(T.Z,{className:"h-5 w-5 text-gray-400"})}),(0,r.jsx)("div",{className:"flex w-full items-center justify-between px-1 py-2 text-sm text-default-500",children:(0,r.jsx)("span",{className:"cursor-pointer",onClick:()=>d.setLoginModalType("resetPassword"),children:o("login.forgotPassword")})}),A.isVisible&&(0,r.jsx)(L.N,{color:"danger",description:A.info,isVisible:A.isVisible,variant:"faded",onClose:()=>E({isVisible:!1,info:""})}),(0,r.jsx)(n.A,{className:"w-full",color:"primary",type:"submit",isLoading:y,children:o("login.submit")})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(O.j,{className:"flex-1"}),(0,r.jsx)("p",{className:"shrink-0 text-tiny text-default-500",children:o("initial.or")}),(0,r.jsx)(O.j,{className:"flex-1"})]}),q&&(0,r.jsx)(n.A,{fullWidth:!0,variant:"bordered",onPress:()=>setTimeout(()=>d.setLoginModalType("mobileLogin"),150),startContent:(0,r.jsx)(w.JO,{icon:"mdi:cellphone",className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-gray-800"}),className:"relative h-10 w-full border border-default-300 bg-white text-sm font-medium text-gray-800 shadow-sm",children:o("mobile.initial.continueWithMobile")}),(0,r.jsx)(C,{containerRef:g,loginSuccessCallback:s}),(0,r.jsxs)("p",{className:"text-center text-small",children:[o("login.noAccount"),"\xa0",(0,r.jsx)("span",{className:"cursor-pointer text-sm text-primary",onClick:()=>d.setLoginModalType("initial"),children:o("login.signUpNow")})]})]})},I=e=>{let{loginSuccessCallback:s}=e,{t:t}=(0,u.Z)("auth"),{t:l,lang:o}=(0,u.Z)("get-started"),{state:i,actions:d}=h.useStore(),{userStore:c}=(0,p.o)(),m=(0,j.useRouter)(),[f,x]=(0,a.useState)(!1),[g,v]=(0,a.useState)(!1),[y,b]=(0,a.useState)({}),N=(0,a.useRef)(null),P=(0,a.useMemo)(()=>{let e="CN"===c.ipCountry,s="zh-CN"===o||"zh-CN"===m.locale;return e||s},[c.ipCountry,o,m.locale]),L=()=>{let e={};return i.password?i.password.length<6&&(e.password=t("errors.password.length")):e.password=t("errors.password.required"),i.confirmPassword?i.confirmPassword!==i.password&&(e.confirmPassword=t("errors.confirmPassword.notMatch")):e.confirmPassword=t("errors.confirmPassword.required"),b(e),0===Object.keys(e).length};return(0,r.jsxs)("div",{ref:N,className:"mt-2 flex w-full flex-col gap-4 roun
1ded-large",children:[(0,r.jsxs)(Z.m.div,{className:"flex min-h-[40px] items-center gap-2",children:[(0,r.jsx)(n.A,{isIconOnly:!0,size:"sm",variant:"flat",onPress:()=>c.setLoginModalType("initial"),children:(0,r.jsx)(w.JO,{className:"text-default-500",icon:"solar:alt-arrow-left-linear",width:16})}),(0,r.jsx)(Z.m.h1,{className:"text-xl font-medium",children:l("register.title")})]}),(0,r.jsxs)(S.l,{className:"flex flex-col gap-3",validationBehavior:"native",onSubmit:e=>{e.preventDefault(),L()&&(d.sendVerificationCode(l),c.setLoginModalType("verifyCode"))},children:[(0,r.jsx)(k.Y,{isRequired:!0,label:l("register.form.email.label"),name:"email",placeholder:l("register.form.email.placeholder"),type:"email",variant:"bordered",value:i.email,isDisabled:!0,startContent:(0,r.jsx)(M.Z,{className:"h-5 w-5 text-gray-400"})}),(0,r.jsx)(k.Y,{isRequired:!0,endContent:(0,r.jsx)("button",{type:"button",onClick:()=>x(!f),children:f?(0,r.jsx)(w.JO,{className:"pointer-events-none text-2xl text-default-400",icon:"solar:eye-closed-linear"}):(0,r.jsx)(w.JO,{className:"pointer-events-none text-2xl text-default-400",icon:"solar:eye-bold"})}),label:l("register.form.password.label"),name:"password",placeholder:l("register.form.password.placeholder"),type:f?"text":"password",variant:"bordered",value:i.password,onChange:e=>{b(e=>({...e,password:"",confirmPassword:""})),d.setPassword(e.target.value)},isInvalid:!!y.password,errorMessage:y.password,startContent:(0,r.jsx)(T.Z,{className:"h-5 w-5 text-gray-400"})}),(0,r.jsx)(k.Y,{isRequired:!0,endContent:(0,r.jsx)("button",{type:"button",onClick:()=>v(!g),children:g?(0,r.jsx)(w.JO,{className:"pointer-events-none text-2xl text-default-400",icon:"solar:eye-closed-linear"}):(0,r.jsx)(w.JO,{className:"pointer-events-none text-2xl text-default-400",icon:"solar:eye-bold"})}),label:l("register.form.confirmPassword.label"),name:"Confirm password",placeholder:l("register.form.confirmPassword.placeholder"),type:g?"text":"password",variant:"bordered",value:i.confirmPassword,onChange:e=>{b(e=>({...e,confirmPassword:""})),d.setConfirmPassword(e.target.value)},isInvalid:!!y.confirmPassword,errorMessage:y.confirmPassword,startContent:(0,r.jsx)(T.Z,{className:"h-5 w-5 text-gray-400"})}),(0,r.jsx)(n.A,{className:"w-full",color:"primary",type:"submit",children:l("register.form.submitButton.continue")})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(O.j,{className:"flex-1"}),(0,r.jsx)("p",{className:"shrink-0 text-tiny text-default-500",children:l("initial.or")}),(0,r.jsx)(O.j,{className:"flex-1"})]}),P&&(0,r.jsx)(n.A,{fullWidth:!0,variant:"bordered",onPress:()=>setTimeout(()=>c.setLoginModalType("mobileLogin"),150),startContent:(0,r.jsx)(w.JO,{icon:"mdi:cellphone",className:"h-5 w-5 text-default-600"}),className:"relative h-10 w-full border border-default-300 bg-white text-sm font-medium text-gray-800 shadow-sm",children:l("mobile.initial.continueWithMobile")}),(0,r.jsx)(C,{containerRef:N,loginSuccessCallback:s})]})},A=t(90541),E=e=>{let{loginSuccessCallback:s}=e,{t}=(0,u.Z)("get-started"),{userStore:l}=(0,p.o)(),[o,i]=a.useState(!1),[d,c]=a.useState(!1),[f,x]=a.useState(0),[g,h]=a.useState(!1),[y,b]=a.useState(!1),[j,C]=a.useState({email:"",verificationCode:"",password:"",confirmPassword:""}),[N,P]=a.useState({}),L=e=>{let{name:s,value:t}=e.target;C(e=>({...e,[s]:t})),N[s]&&P(e=>({...e,[s]:""}))},O=()=>{let e={};return j.email?/\S+@\S+\.\S+/.test(j.email)||(e.email=t("forgotPassword.errors.email.invalid")):e.email=t("forgotPassword.errors.email.required"),j.verificationCode?6!==j.verificationCode.length&&(e.verificationCode=t("forgotPassword.errors.verificationCode.length")):e.verificationCode=t("forgotPassword.errors.verificationCode.required"),j.password?j.password.length<6&&(e.password=t("forgotPassword.errors.password.length")):e.password=t("forgotPassword.errors.password.required"),j.confirmPassword?j.confirmPassword!==j.password&&(e.confirmPassword=t("forgotPassword.errors.confirmPassword.notMatch")):e.confirmPassword=t("forgotPassword.errors.confirmPassword.required"),P(e),0===Object.keys(e).length},Z=async()=>
1{if(!(f>0)){if(!j.email||!/\S+@\S+\.\S+/.test(j.email)){P(e=>({...e,email:t("forgotPassword.errors.email.invalid")}));return}try{b(!0);let e=await m.i.sendCode({email:j.email,type:"resetPassword"});if(200===e.code){v.ZP.success(t("forgotPassword.messages.codeSent")),x(60);let e=setInterval(()=>{x(s=>s<=1?(clearInterval(e),0):s-1)},1e3)}}catch(e){}finally{b(!1)}}},R=async e=>{if(e.preventDefault(),O())try{h(!0);let e=await m.i.resetPassword({email:j.email,password:j.password,confirmPassword:j.confirmPassword,verificationCode:j.verificationCode});200===e.code&&(v.ZP.success(t("forgotPassword.messages.resetPasswordSuccess")),l.setLoginUserInfo(e.data),s())}catch(e){}finally{h(!1)}};return(0,r.jsxs)("div",{className:"flex w-full flex-col gap-4 rounded-large",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsx)("p",{className:"text-xl font-medium",children:t("forgotPassword.title")}),(0,r.jsx)("p",{className:"text-small text-default-500",children:t("forgotPassword.subtitle")})]}),(0,r.jsxs)(S.l,{className:"flex flex-col gap-3",validationBehavior:"native",onSubmit:R,children:[(0,r.jsx)(k.Y,{isRequired:!0,label:t("forgotPassword.form.email.label"),name:"email",placeholder:t("forgotPassword.form.email.placeholder"),type:"email",variant:"bordered",value:j.email,onChange:L,isInvalid:!!N.email,errorMessage:N.email,startContent:(0,r.jsx)(M.Z,{className:"h-5 w-5 text-gray-400"})}),(0,r.jsx)(k.Y,{isRequired:!0,endContent:(0,r.jsx)(n.A,{className:"min-w-[100px] bg-default-100",size:"sm",variant:"flat",onPress:Z,isDisabled:f>0||y,isLoading:y,children:f>0?t("forgotPassword.form.verificationCode.countdown",{seconds:f}):t("forgotPassword.form.verificationCode.getCode")}),label:t("forgotPassword.form.verificationCode.label"),name:"verificationCode",placeholder:t("forgotPassword.form.verificationCode.placeholder"),variant:"bordered",value:j.verificationCode,onChange:L,isInvalid:!!N.verificationCode,errorMessage:N.verificationCode,startContent:(0,r.jsx)(A.Z,{className:"h-6 w-6 text-gray-400"})}),(0,r.jsx)(k.Y,{isRequired:!0,endContent:(0,r.jsx)("button",{type:"button",onClick:()=>i(!o),children:o?(0,r.jsx)(w.JO,{className:"pointer-events-none text-2xl text-default-400",icon:"solar:eye-closed-linear"}):(0,r.jsx)(w.JO,{className:"pointer-events-none text-2xl text-default-400",icon:"solar:eye-bold"})}),label:t("forgotPassword.form.password.label"),name:"password",placeholder:t("forgotPassword.form.password.placeholder"),type:o?"text":"password",variant:"bordered",value:j.password,onChange:L,isInvalid:!!N.password,errorMessage:N.password,startContent:(0,r.jsx)(T.Z,{className:"h-5 w-5 text-gray-400"})}),(0,r.jsx)(k.Y,{isRequired:!0,endContent:(0,r.jsx)("button",{type:"button",onClick:()=>c(!d),children:d?(0,r.jsx)(w.JO,{className:"pointer-events-none text-2xl text-default-400",icon:"solar:eye-closed-linear"}):(0,r.jsx)(w.JO,{className:"pointer-events-none text-2xl text-default-400",icon:"solar:eye-bold"})}),label:t("forgotPassword.form.confirmPassword.label"),name:"confirmPassword",placeholder:t("forgotPassword.form.confirmPassword.placeholder"),type:d?"text":"password",variant:"bordered",value:j.confirmPassword,onChange:L,isInvalid:!!N.confirmPassword,errorMessage:N.confirmPassword,startContent:(0,r.jsx)(T.Z,{className:"h-5 w-5 text-gray-400"})}),(0,r.jsx)(n.A,{className:"mt-6 h-auto w-full py-2.5 text-base",color:"primary",type:"submit",isLoading:g,children:t("forgotPassword.form.submitButton.resetPassword")})]}),(0,r.jsxs)("p",{className:"py-2 text-center text-sm text-default-400",children:[t("forgotPassword.backToLogin"),"\xa0",(0,r.jsx)("button",{type:"button",className:"text-default-600 hover:text-[var(--tool-color-primary)]",onClick:()=>l.setLoginModalType("login"),children:t("forgotPassword.loginLink")})]})]})},q=t(33884),J=t(47138),z=t(12732),V=t(62668),Y=e=>{let{loginSuccessCallback:s}=e,{t}=(0,u.Z)("get-started"),{userStore:l}=(0,p.o)(),o=(0,j.useRouter)(),[i,d]=(0,a.useState)(""),[c,f]=(0,a.useState)(!1),{actions:x,state:g,state:{codeExpiry:v,alert:y,countdown:b,sendCodeLoading:C,verifyLoading:N},actions:{setAlert:P,setCountdown:S,sendVerificationCode:k,handleCaptchaSuccess:O}}=h.useStore();(0,a.useEffect)(()=>
1{if(b<=0)return;let e=setInterval(()=>S(b>0?b-1:0),1e3);return()=>clearInterval(e)},[b]);let T=async()=>{try{if(f(!0),Date.now()>v){P({type:"danger",message:t("verifyCode.errors.codeExpired")});return}if(6!==i.length){P({type:"danger",message:t("verifyCode.errors.invalidCode")});return}let e=await m.i.register({email:g.email,password:g.password,confirmPassword:g.confirmPassword,nickname:"",avatar:"",verificationCode:i,referralDomain:(0,J.nm)()});200===e.code?(P({type:"success",message:t("verifyCode.alert.success")}),l.setLoginUserInfo(e.data),(0,J.zA)(),s?s():o.push("/market")):P({type:"danger",message:e.msg})}catch(e){P({type:"danger",message:e.message})}finally{f(!1)}};return(0,r.jsxs)("div",{className:"mt-2 flex w-full flex-col gap-4 rounded-large",children:[(0,r.jsxs)(Z.m.div,{className:"flex min-h-[40px] items-center gap-2",children:[(0,r.jsx)(n.A,{isIconOnly:!0,size:"sm",variant:"flat",onPress:()=>l.setLoginModalType("register"),children:(0,r.jsx)(w.JO,{className:"text-default-500",icon:"solar:alt-arrow-left-linear",width:16})}),(0,r.jsx)(Z.m.h1,{className:"text-xl font-medium",children:t("verifyCode.title")})]}),(0,r.jsx)("div",{className:"mb-6 rounded-2xl border border-default-200 p-6",children:N?(0,r.jsx)("div",{className:"flex w-full items-center justify-center",children:(0,r.jsx)(V.n,{verifyLoading:N,success:e=>{O(t,e)}})}):C?(0,r.jsx)(z.Z,{color:"var(--tool-color-primary)",className:"text-center"}):(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-gradient-to-br from-blue-500 to-indigo-600",children:(0,r.jsx)(M.Z,{className:"h-8 w-8 text-white"})}),(0,r.jsx)("h3",{className:"mb-2 text-xl font-semibold text-foreground",children:t("verifyCode.checkYourEmail.title")}),(0,r.jsxs)("p",{className:"leading-relaxed text-default-600",children:[t("verifyCode.checkYourEmail.sentPrefix"),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"font-semibold text-primary",children:g.email})]}),(0,r.jsx)("div",{className:"mt-3 flex justify-center",children:(0,r.jsx)("button",{onClick:()=>{0===b&&k(t)},disabled:b>0,className:"text-sm font-medium text-primary underline disabled:cursor-not-allowed disabled:opacity-60",children:b>0?t("verifyCode.resendCountdown",{seconds:b}):t("verifyCode.resend")})})]})}),(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(q.h,{value:i,onValueChange:d,length:6})}),y.type&&(0,r.jsx)(L.N,{color:y.type,title:"success"===y.type?t("verifyCode.alert.success"):t("verifyCode.alert.error"),description:"success"===y.type?t("verifyCode.alert.codeSentExpires",{minutes:Math.ceil(Math.max(v-Date.now(),0)/1e3/60)}):y.message,onClose:()=>P({type:null,message:""})})]}),(0,r.jsx)(n.A,{color:"primary",className:"mt-2 h-12 w-full",onPress:T,isLoading:c,children:t("verifyCode.submit")})]})]})},D=t(82949),B=e=>{let{loginSuccessCallback:s}=e,{t}=(0,u.Z)("common"),{userStore:l}=(0,p.o)(),o=(0,j.useRouter)(),[i,d]=(0,a.useState)(!1),m=async e=>{try{d(!0),await l.googleLoginTurnstileSuccessCallback(e),l.user&&(l.setLoginModalType("initial"),s?s():o.push("/market")),d(!1)}catch(e){d(!1)}};return(0,r.jsx)("div",{className:"flex w-full flex-col gap-4 roun
1ded-large",children:(0,r.jsxs)("div",{className:"relative flex w-full flex-col items-center gap-4 rounded-large",children:[(0,r.jsx)("div",{className:"absolute left-0 top-0",children:(0,r.jsx)(n.A,{isIconOnly:!0,size:"sm",variant:"flat",onPress:()=>l.setLoginModalType("initial"),children:(0,r.jsx)(w.JO,{className:"text-default-500",icon:"solar:alt-arrow-left-linear",width:16})})}),(0,r.jsx)("div",{className:"flex flex-col items-center text-center",children:(0,r.jsx)(c(),{src:"/logo-icon.webp",width:100,height:100,alt:t("initial.logoAlt"),className:"h-12 w-12"})}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("p",{className:"text-center text-default-700",children:t("googleLoginTurnstile.securityVerification")}),(0,r.jsx)("div",{className:"flex items-center justify-center",children:i?(0,r.jsx)(D.Z,{color:"var(--tool-color-primary)",size:12,className:"py-2"}):(0,r.jsx)(V.n,{siteKey:"671460be-d3bc-4fa4-9b98-b88af6b21aaa",verifyLoading:l.googleLoginTurnstileLoading,success:m})}),(0,r.jsx)("p",{className:"text-center text-sm text-default-700",children:t("googleLoginTurnstile.autoLoginContinue")})]})]})})},W=t(53302),_=t(82135);let U=(0,_.Pi)(()=>{let{t:e}=(0,u.Z)("get-started"),{userStore:s}=(0,p.o)();return s.refCode?(0,r.jsxs)("div",{className:"mb-4 flex items-center gap-2 rounded-lg bg-gradient-to-r from-primary-50 to-secondary-50 px-4 py-3 text-sm dark:from-primary-900/20 dark:to-secondary-900/20",children:[(0,r.jsx)(w.JO,{icon:"mdi:gift-outline",className:"h-5 w-5 flex-shrink-0 text-primary"}),(0,r.jsx)("span",{className:"text-default-700",children:e("referralBanner.message")})]}):null}),G=(0,_.Pi)(e=>{let{loginSuccessCallback:s}=e,{userStore:t}=(0,p.o)(),a={initial:(0,r.jsx)(N,{loginSuccessCallback:s}),login:(0,r.jsx)(R,{loginSuccessCallback:s}),register:(0,r.jsx)(I,{loginSuccessCallback:s}),resetPassword:(0,r.jsx)(E,{loginSuccessCallback:s}),verifyCode:(0,r.jsx)(Y,{loginSuccessCallback:s}),verify:(0,r.jsx)(B,{loginSuccessCallback:s}),mobileLogin:(0,r.jsx)(W.Z,{loginSuccessCallback:s})};return(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,r.jsxs)("div",{className:"w-full max-w-sm px-2 py-6",children:[(0,r.jsx)(U,{}),a[t.loginModalType||"initial"],t.openGoogleOneTapLogin&&(0,r.jsx)(P.Z,{loginSuccessCallback:s})]})})});function F(e){return(0,r.jsx)(h.Provider,{children:(0,r.jsx)(G,{...e})})}var H=(0,_.Pi)(function(e){let{isOpen:s,onClose:t,onLoginSuccess:a}=e,{userStore:n}=(0,p.o)(),d=(0,j.useRouter)(),c=()=>{n.setLoginModalType("initial")};return(0,r.jsx)(l.R,{isOpen:s||n.googleLoginTurnstileLoading,onClose:()=>{c(),t&&t()},isDismissable:!0,hideCloseButton:!1,placement:"center",backdrop:"blur",size:"md",children:(0,r.jsx)(o.A,{children:(0,r.jsx)(i.I,{className:"py-4",children:(0,r.jsx)(F,{loginSuccessCallback:()=>{c(),a&&a(),t&&t(),"/"===d.pathname&&d.push("/market")}})})})})})},53302:function(e,s,t){var r=t(39696),a=t(90170),l=t(82045),o=t(32324),i=t(84140),n=t(82135),d=t(56156),c=t(8722),u=t(27220),m=t(18492);let f=/^(1[2-9]\d{9}|[5-9]\d{7})$/,x=(0,n.Pi)(e=>{var s,t;let{loginSuccessCallback:n}=e,{t:x}=(0,d.Z)("get-started"),{userStore:g}=(0,u.o)(),[h,p]=(0,a.useState)((null===(s=g.user)||void 0===s?void 0:s.phone)||(null===(t=g.user)||void 0===t?void 0:t.mobile)||""),[w,v]=(0,a.useState)(""),[y,b]=(0,a.useState)(!1),[j,C]=(0,a.useState)(!1),[N,P]=(0,a.useState)(!1),[S,k]=(0,a.useState)(0),L=h.length>0&&!f.test(h.trim()),O=y&&!w.trim();(0,a.useEffect)(()=>{let e;return S>0&&(e=setTimeout(()=>k(S-1),1e3)),()=>clearTimeout(e)},[S]);let Z=async()=>{let e=h.trim();if(!e){m.ZP.error(x("mobile.errors.phoneRequired"));return}if(!f.test(e)){m.ZP.error(x("mobile.errors.phoneInvalid"));return}try{P(!0);let s=await c.i.sendPhoneCaptcha({phone:e});200===s.code&&(m.ZP.success(x("forgotPassword.messages.codeSent")),k(60))}catch(e){}finally{P(!1)}},M=async e=>{e.preventDefault();let s=h.trim(),t=w.trim();if(!s){m.ZP.error(x("mobile.errors.phoneRequired"));return}if(!f.test(s)){m.ZP.error(x("mobile.errors.phoneInvalid"));return}if(!t){b(!0),m.ZP.error(x("mobile.errors.codeRequired"));return}try{C(!0);let e=await c.i.verifyPhoneCaptcha({phone:s,verificationCode:t});200===e.code&&(g.setLoginUserInfo(e.data),m.ZP.success(x("messages.loginSuccess")),n&&n())}catch(e){}finally{C(!1)}};return(0,r.jsxs)("div",{className:"flex w-full flex-col gap-4 roun
1ded-large",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,r.jsx)("div",{className:"bg-primary/10 flex h-12 w-12 items-center justify-center rounded-full text-primary",children:(0,r.jsx)(i.JO,{icon:"mdi:cellphone",className:"h-6 w-6"})}),(0,r.jsx)("p",{className:"mt-4 text-xl font-medium",children:x("mobile.initial.title")}),(0,r.jsx)("p",{className:"text-small text-default-500",children:x("mobile.initial.subtitle")})]}),(0,r.jsxs)("form",{noValidate:!0,onSubmit:M,className:"mt-2 flex flex-col gap-3",children:[(0,r.jsx)(l.Y,{isRequired:!0,label:x("mobile.initial.phoneLabel"),placeholder:x("mobile.initial.phonePlaceholder"),value:h,onValueChange:p,variant:"bordered",isInvalid:L,errorMessage:L?x("mobile.errors.phoneInvalid"):void 0,startContent:(0,r.jsx)(i.JO,{icon:"mdi:cellphone",className:"text-default-400"})}),(0,r.jsx)(l.Y,{isRequired:!0,label:x("mobile.initial.codeLabel"),placeholder:x("mobile.initial.codePlaceholder"),value:w,onValueChange:e=>{v(e)},onBlur:()=>b(!0),variant:"bordered",isInvalid:O,errorMessage:O?x("mobile.errors.codeRequired"):void 0,startContent:(0,r.jsx)(i.JO,{width:22,icon:"mdi:shield-check-outline",className:"text-default-400"}),endContent:(0,r.jsx)(o.A,{className:"min-w-[100px] bg-default-100",size:"sm",variant:"flat",onPress:Z,isDisabled:S>0||N||!h||L,isLoading:N,children:S>0?"".concat(S,"s"):x("mobile.initial.getCode")})}),(0,r.jsx)(o.A,{fullWidth:!0,color:"primary",type:"submit",isLoading:j,className:"mt-2 h-12 text-medium font-medium",children:x("mobile.initial.continue")})]}),(0,r.jsxs)("button",{onClick:()=>{setTimeout(()=>{g.setLoginModalType("initial")},150)},className:"flex items-center justify-center gap-1 text-small text-default-500 transition-colors hover:text-primary",children:[(0,r.jsx)(i.JO,{icon:"mdi:arrow-left"}),x("forgotPassword.backToLogin")]})]})});s.Z=x}}]);
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.