PageSourceSearch

https://evatolab.com/assets/DistributorLoginPage-BeIVVpdo.js

js evatolab.com collected 2026-10-09 22:04:53 UTC 5,052 bytes, 1 lines download raw bytes

1import{b as v,u as N,k as _,x as k,r as n,b8 as S,b9 as P,bb as E,j as e,aj as I,m as A,L as X,a7 as C,e as z}from"./index-CR8jIHGL.js";import{n as D}from"./phoneInput-B-iDMV9i.js";import{c as R}from"./auth-BUl0x90n.js";import{haptics as c}from"./haptics-YKMSwVex.js";import{U as M}from"./users-DCvaygis.js";import{L as O}from"./lock-CZskgewM.js";const f="easypay_distributor_last_phone",G=()=>{const l=v(),{t}=N(),{isAuthenticated:d,loading:x}=_(),{roles:u,loading:p}=k(),[r,j]=n.useState(()=>typeof window>"u"?"":window.localStorage.getItem(f)||""),[o,m]=n.useState(""),[h,i]=n.useState(null),[g,b]=n.useState(!1);n.useEffect(()=>{x||p||!d||S("distributor",u)&&l(P.distributor,{replace:!0})},[d,x,p,u,l]);const y=async a=>{if(a.preventDefault(),i(null),!/^01[3-9]\d{8}$/.test(r)){i(t("distLoginInvalidPhone"));return}if(o.length!==4){i(t("distLoginInvalidPin"));return}b(!0);try{await R(r,o);try{localStorage.setItem(f,r)}catch{}localStorage.setItem("mfs_has_authenticated","1"),c.success(),z.success(t("distLoginSignedIn"))}catch(s){c.error();const L=s instanceof Error&&s.message.includes("Invalid login credentials")?t("distLoginInvalidCreds"):s instanceof Error?s.message:t("distLoginGenericErr");i(L),m("")}finally{b(!1)}},w=`${E.distributor} — ${t("distLoginSignInSuffix")}`;return e.jsxs("div",{className:"min-h-screen bg-[#0b1220] text-white flex flex-col",children:[e.jsxs(I,{children:[e.jsx("title",{children:w}),e.jsx("meta",{name:"description",content:t("distLoginMetaDesc")}),e.jsx("link",{rel:"icon",href:"/icons/role-distributor.png"}),e.jsx("link",{rel:"apple-touch-icon",href:"/icons/role-distributor.png"})]}),e.jsxs("header",{className:"relative overflow-hidden bg-gradient-to-br from-blue-600 via-cyan-500 to-sky-500 px-6 pt-8 pb-8 text-center rounded-b-[28px]",children:[e.jsx("div",{className:"absolute inset-0 opacity-20 pointer-events-none [background-image:radial-gradient(circle_at_20%_20%,white_1px,transparent_1px)] [background-size:22px_22px]"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-white/20 backdrop-blur-sm flex items-center justify-center mx-auto mb-2 shadow-lg",children:e.jsx(M,{size:26})}),e.jsx("p",{className:"text-[10px] uppercase tracking-[0.25em] opacity-80",children:"EasyPay"}),e.jsx("h1",{className:"text-xl font-extrabold mt-0.5",children:t("distLoginTitle")}),e.jsx("p",{className:"text-xs opacity-90 mt-1 max-w-[280px] mx-auto",children:t("distLoginTagline")})]})]}),e.jsx("div",{className:"flex-1 px-5 pt-5",children:e.jsxs(A.form,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{duration:.35},onSubmit:y,className:"bg-[#111c2b] border border-white/10 rounded-[22px] p-5 space-y-4 shadow-2xl",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider",children:t("distLoginMobileLabel")}),e.jsx("div",{className:"relative",children:e.jsx("input",{type:"tel",inputMode:"numeric",autoComplete:"tel",placeholder:"01XXXXXXXXX",maxLength:11,value:r,onChange:a=>{i(null),j(D(a.target.value))},className:"w-full h-12 px-3 rounded-xl bg-black/30 border border-white/10 text-white text-base tracking-[0.3em] text-center placeholder:text-white/30 placeholder:tracking-wider focus:outline-none focus:border-cyan-400"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider",children:t("distLoginPinLabel")}),e.jsxs("div",{className:"relative",children:[e.jsx(O,{size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-cyan-400"}),e.jsx("input",{type:"password",inputMode:"numeric",autoComplete:"current-password",pattern:"[0-9]*",maxLength:4,value:o,onChange:a=>{i(null);const s=a.target.value.replace(/\D/g,"").slice(0,4);s.length>o.length&&c.light(),m(s)},className:"w-full h-12 pl-10 pr-3 rounded-xl bg-black/30 border border-white/10 text-white text-2xl text-center tracking-[0.8rem] focus:outline-none focus:border-cyan-400",placeholder:"••••"})]})]}),h&&e.jsx("p",{role:"alert",className:"text-sm text-red-400 bg-red-500/10 border border-red-500/30 rounded-lg px-3 py-2",children:h}),e.jsx("button",{type:"submit",disabled:g,className:"w-full h-12 rounded-xl bg-gradient-to-r from-blue-600 to-cyan-500 text-white font-bold flex items-center justify-center gap-2 shadow-lg shadow-cyan-500/30 disabled:opacity-60",children:g?e.jsxs(e.Fragment,{children:[e.jsx(X,{size:18,className:"animate-spin"})," ",t("distLoginSubmitting")]}):e.jsxs(e.Fragment,{children:[t("distLoginSubmit")," ",e.jsx(C,{size:18})]})}),e.jsxs("div",{className:"flex items-center justify-between text-xs pt-1",children:[e.jsx("button",{type:"button",onClick:()=>l("/forgot-pin"),className:"text-cyan-400 font-semibold hover:underline",children:t("distLoginForgotPin")}),e.jsx("span",{className:"text-white/40",children:t("distLoginOnlyNote")})]}),e.jsx("p",{className:"text-[11px] text-white/50 text-center pt-1",children:t("distLoginProvisioned")})]})})]})};export{G as default};

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.