PageSourceSearch

https://b2b.cafe/assets/login-BTd3aF9F.js

js b2b.cafe collected 2026-10-02 01:20:36 UTC 2,951 bytes, 1 lines download raw bytes

1import{u as e,bF as x,bD as b}from"./vendor-DzWMmZj2.js";import{p as j,d as y,u as F,o as S}from"./vendor-tanstack-D-s8FawA.js";import{z as v,l as w,M as _,N,a,L as n,p as m,B as V}from"./index-DzzETE43.js";import{s as C,A as L,a as p,c as k,i as A}from"./validators-k24gHutN.js";import{u as M}from"./useForm-C-xi49lB.js";import{u as E}from"./vendor-i18n-C7hD56hb.js";import"./vendor-socket-CdJ84v18.js";import"./vendor-phone-CDRp5aFf.js";import"./date-picker-C_qz5VcR.js";const R=j({defaultValues:{login:"",password:""}}),{securityLogin:T}=v();function z(){var u,d;const l=y({from:"/login"}),r=(u=F().state)==null?void 0:u.from,{t:s}=E("auth"),o=M({...R,validators:{onSubmit:()=>null},onSubmit:async({value:t})=>{try{const i=await T(t);if(w.debug("Success auth:",i),!_(i.result))return;const h=N(r);l({to:h,replace:!0})}catch(i){C(o,i==null?void 0:i.data)}}}),{isSubmitting:c,isValid:g}=S(o.store,t=>({isSubmitting:t.isSubmitting,isValid:o.state.isValid,isFieldsValidating:o.state.isFieldsValidating,fieldMeta:t.fieldMeta,errors:Object.values(t.fieldMeta).flatMap(i=>i.errors)})),f=async t=>{t.preventDefault(),await k(o),A(o.state.fieldMeta)&&o.handleSubmit()};return e.jsx(L,{title:s("auth.login.title"),subtitle:((d=m)==null?void 0:d.id)==="conteb2b"?s("auth.login.subtitle"):void 0,globalError:e.jsx(o.AppForm,{children:e.jsx(o.FormError,{})}),onBack:()=>l({to:"/"}),footer:e.jsxs("div",{className:a("w-full text-conte-body-l flex justify-between tablet:justify-center gap-2 text-center text-foreground mt-10.5"),children:[s("auth.login.sign_up_mobile.no_account"),e.jsxs(n,{to:"/register",children:[e.jsx(b,{strokeWidth:2.5,className:a("size-4 inline-block")}),s("auth.login.sign_up_mobile.register")]})]}),children:e.jsxs("form",{onSubmit:f,className:a("flex-1 flex flex-col gap-6"),children:[e.jsx(o.AppField,{name:"login",validators:{onChange:({value:t})=>{if(p(t))return s("common:common.errors.required")}},children:t=>e.jsx(t.FormInput,{placeholder:s("auth.login.email"),id:"email",autoComplete:"email"})}),e.jsx(o.AppField,{name:"password",validators:{onChange:({value:t})=>{if(p(t))return s("common:common.errors.required");if(t.length<6||t.length>20)return s("auth.errors.password_bad_strlen")}},children:t=>e.jsx(t.FormPassword,{placeholder:s("auth.login.password"),autoComplete:"current-password"})}),e.jsx("div",{className:a("text-conte-body-l w-full flex justify-center tablet:justify-end text-right"),children:e.jsxs(n,{to:"/reset",variant:"muted",children:[e.jsx(x,{className:a("size-4")})," ",s("auth.login.forgot_password")]})}),e.jsxs("div",{className:a("flex flex-col items-center mt-4.5 gap-4.5"),children:[e.jsx(V,{type:"submit",loading:c,disabled:!g,children:s(c?"auth.login.submit.loading":"auth.login.submit")}),m.features.auth.showPhoneLogin&&e.jsx(n,{to:"/login_phone",state:r?{from:r}:void 0,className:a("text-conte-body-l text-center"),children:s("auth.login.login_phone")})]})]})})}const J=z;export{J as component};

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.