PageSourceSearch

https://dumpstercontrols.io/assets/Login-BaBXmtNg.js

js dumpstercontrols.io collected 2026-09-24 14:25:52 UTC 14,675 bytes, 1 lines download raw bytes

1import{r as d,u as ce,j as e}from"./vendor-react-BZE6wSbZ.js";import{I as f}from"./input-CPRcq4Mq.js";import{L as g}from"./label-BdVoReUu.js";import{u as de,f as ue,L as k,B as D,H as me,c as P,C as he,l as c,s as xe,P as pe,o as fe}from"./index-BHxCMQCy.js";import{S as ge,a as be,b as je,c as ye,d as ve}from"./select-DlZm8Hd1.js";import{l as Ne}from"./logo-dc-white-DrmSwQjG.js";import{s as we}from"./emailSuggest-CQxvNXew.js";import{a as U}from"./signupOnboardingFlags-BjF0Rw7D.js";import{E as X}from"./eye-off-CnkBK3yR.js";import{E as Z}from"./eye-BSedJ_Lb.js";import"./vendor-shared-BX-e1btJ.js";import"./index-BdQq_4o_.js";import"./index-C39pvbTH.js";import"./index-jOKYf_8M.js";import"./index-D3Zdq0oI.js";import"./chevron-down-CvE1o0oO.js";import"./chevron-up-Gpuo3T0-.js";import"./check-Dk7x8bFW.js";const Se="/assets/aerial-road-B74tBaQn.webp";function Oe(){const q=new URLSearchParams(window.location.search),N=q.get("redirect"),B=N&&N.startsWith("/")&&!N.startsWith("//")?N:null,[l,b]=d.useState(q.get("signup")==="true"),[h,z]=d.useState(!1),[i,x]=d.useState(!1),[ee,H]=d.useState(!1),[u,w]=d.useState(null),[S,I]=d.useState(null),{t,i18n:L}=de(),{user:E,isAuthenticated:M,isLoading:A,login:te,loginWithMfa:ae}=ue(),j=ce();d.useEffect(()=>{const a=new URLSearchParams(window.location.search);if(a.get("ref")==="directory-claim"&&a.get("company"))try{localStorage.setItem("dc_claim_intent",a.get("company")),localStorage.setItem("dc_claim_intent_ts",String(Date.now()))}catch{}},[]);const T=a=>{if(B)return B;if(a.role==="platform_admin")return"/app/admin-global";if(["vendor_admin","vendor_member"].includes(a.role))return"/vendor/dashboard";if(a.isDriverOnly){let s=!1;try{s=window.localStorage.getItem("dc:driver:web-ok")==="1"}catch{}return he.isNativePlatform()||s?"/app/driver/tasks":"/driver/get-app"}return"/app/dashboard"};d.useEffect(()=>{!A&&M&&E&&j(T(E),{replace:!0})},[M,A,E,j]);const se=a=>{L.changeLanguage(a),localStorage.setItem("dc_lang",a)},O=a=>{const s=Array.from(a.querySelectorAll("input[required]"));for(const n of s){if(!n.value.trim())return n.focus(),c.error(t("auth.fieldRequired")),!1;if(n.type==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.value))return n.focus(),c.error(t("auth.invalidEmail")),!1}return!0},re=async a=>{a.preventDefault();const s=a.currentTarget;if(!O(s))return;const n=s.elements.namedItem("si-email").value,y=s.elements.namedItem("si-pass").value;x(!0);try{const o=await te(n,y),p=T(o);j(p,{replace:!0})}catch(o){o.mfaRequired?w({factorId:o.factorId,code:""}):/invalid login credentials/i.test(String((o==null?void 0:o.message)??""))?c.error(t("auth.loginFailedHint")):/bloqueada pela administra/i.test(String((o==null?void 0:o.message)??""))?c.error(t("auth.accountBlocked")):c.error(t("auth.loginFailed"))}finally{x(!1)}},ne=async a=>{if(a.preventDefault(),!!u){x(!0);try{const s=await ae(u.factorId,u.code);w(null);const n=T(s);j(n,{replace:!0})}catch(s){c.error(s.message||"MFA verification failed")}finally{x(!1)}}},oe=async a=>{var v;a.preventDefault();const s=a.currentTarget;if(!O(s))return;if((v=s.elements.namedItem("website"))==null?void 0:v.value){c.success(t("auth.accountCreated"));return}const y=s.elements.namedItem("su-name").value,o=s.elements.namedItem("su-email").value,p=s.elements.namedItem("su-pass").value;if(p.length<6){c.error(t("auth.passwordMinLength"));return}x(!0);try{const r=new URLSearchParams(window.location.search),m=localStorage.getItem("dc_referral_code"),_=localStorage.getItem("dc_referral_code_ts"),C=m&&_&&Date.now()-Number(_)<24*60*60*1e3,F=r.get("ref"),J=(C?m:null)||(F&&F!=="directory-claim"?F:void 0)||void 0;m&&!C&&(localStorage.removeItem("dc_referral_code"),localStorage.removeItem("dc_referral_code_ts"));const{data:R,error:K}=await xe.auth.signUp({email:o,password:p,options:{data:{full_name:y,preferred_language:L.language,...J?{referral_code:J}:{}},emailRedirectTo:pe}});if(K)throw K;localStorage.removeItem("dc_referral_code"),localStorage.removeItem("dc_referral_code_ts"),R!=null&&R.session||c.message(t("auth.accountCreated")),H(!0),setTimeout(()=>H(!1),3e3)}catch(r){const m=String((r==null?void 0:r.message)||""),_=(r==null?void 0:r.code)==="user_already_exists"||/already (been )?registered/i.test(m),C=(r==null?void 0:r.code)==="weak_password"||/password/i.test(m);console.error("signUp failed",r==null?void 0:r.code,m),c.error(t(_?"auth.emailAlreadyRegistered":C?"auth.passwordMinLength":"auth.signUpFailed"))}finally{x(!1)}},le=()=>{j("/forgot-password")};d.useEffect(()=>{I(null)},[l]);const V=a=>s=>{if(!U())return;const n=we(s.currentTarget.value);I(n?{field:a,suggestion:n.suggestion}:null)},W=()=>{S&&I(null)},G=a=>{if(!U()||!S||S.field!==a)return null;const{suggestion:s}=S,[n,y]=t("auth.emailDidYouMean",{suggestion:s}).split(s),o=p=>{var r;const v=(r=p.currentTarget.form)==null?void 0:r.elements.namedItem(`${a}-email`);v&&(v.value=s),I(null)};return e.jsxs("p",{className:"text-[11px] leading-tight min-h-[14px] text-muted-foreground",children:[n,e.jsx("button",{type:"button",onClick:o,className:"text-primary font-medium hover:underline",children:s}),y]})},ie=U()?e.jsx("p",{className:"text-[11px] leading-tight min-h-[14px]","aria-hidden":"true"}):null;if(A)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx(k,{className:"w-8 h-8 animate-spin text-primary"})});if(u)return e.jsx("div",{className:"min-h-screen flex flex-col items-center justify-center bg-gradient-to-br from-[hsl(213,80%,96%)] via-background to-[hsl(213,80%,92%)]",children:e.jsxs("div",{className:"w-full max-w-sm mx-4 bg-card rounded-2xl shadow-xl border border-border/50 p-8 space-y-4",children:[e.jsx("h2",{className:"text-2xl font-bold text-center",children:t("auth.mfaTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground text-center",children:t("auth.mfaSubtitle")}),e.jsxs("form",{onSubmit:ne,className:"space-y-4",children:[e.jsx(f,{autoFocus:!0,maxLength:6,placeholder:"000000",className:"h-12 text-center text-xl tracking-[0.3em] font-mono",value:u.code,onChange:a=>w({...u,code:a.target.value.replace(/\D/g,"")}),required:!0}),e.jsx(D,{type:"submit",className:"w-full h-10 font-semibold",disabled:i||u.code.length!==6,children:i?e.jsx(k,{className:"w-4 h-4 animate-spin"}):t("auth.verify")}),e.jsx("button",{type:"button",onClick:()=>w(null),className:"text-xs text-muted-foreground hover:text-foreground mx-auto block",children:t("auth.backToLogin")})]})]})});const $=()=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{className:"text-xs text-muted-foreground",children:t("auth.preferredLanguage")}),e.jsxs(ge,{value:L.language,onValueChange:se,children:[e.jsx(be,{className:"h-10 bg-muted/40 border-border/60",children:e.jsx(je,{})}),e.jsx(ye,{children:fe.map(a=>e.jsx(ve,{value:a.code,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{children:a.flag}),e.jsx("span",{children:a.label})]})},a.code))})]})]}),Q=()=>e.jsxs("form",{onSubmit:re,noValidate:!0,className:"flex flex-col h-full justify-center space-y-4 p-6 md:p-10",children:[e.jsxs("div",{className:"text-center mb-2",children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight text-foreground",children:t("auth.signIn")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t("auth.signInToAccount")}
1)]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"si-email",className:"text-xs text-muted-foreground",children:t("auth.email")}),e.jsx(f,{id:"si-email",name:"si-email",type:"email",placeholder:t("auth.emailPlaceholder"),className:"h-10 bg-muted/40 border-border/60",required:!0,disabled:i,onBlur:V("si"),onInput:W}),G("si")??ie]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"si-pass",className:"text-xs text-muted-foreground",children:t("auth.password")}),e.jsxs("div",{className:"relative",children:[e.jsx(f,{id:"si-pass",name:"si-pass",type:h?"text":"password",placeholder:t("auth.passwordPlaceholder"),className:"h-10 pr-10 bg-muted/40 border-border/60",required:!0,disabled:i}),e.jsx("button",{type:"button",onClick:()=>z(!h),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:h?e.jsx(X,{className:"w-4 h-4"}):e.jsx(Z,{className:"w-4 h-4"})})]})]}),e.jsx($,{}),e.jsx(D,{type:"submit",className:"w-full h-10 font-semibold",disabled:i,children:i?e.jsx(k,{className:"w-4 h-4 animate-spin"}):t("auth.signIn")}),e.jsx("button",{type:"button",onClick:le,className:"text-xs text-primary hover:underline mx-auto",disabled:i,children:t("auth.forgotPassword")}),e.jsxs("button",{type:"button",onClick:()=>b(!0),className:"md:hidden text-xs text-muted-foreground mt-2 mx-auto",children:[t("auth.noAccount")," ",e.jsx("span",{className:"text-primary font-medium",children:t("auth.createAccount")})]})]}),Y=()=>e.jsxs("form",{onSubmit:oe,noValidate:!0,className:"flex flex-col h-full justify-center space-y-4 p-6 md:p-10",children:[e.jsxs("div",{className:"text-center mb-2",children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight text-foreground",children:t("auth.createAccount")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t("auth.createAccountSubtitle")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"su-name",className:"text-xs text-muted-foreground",children:t("auth.fullName")}),e.jsx(f,{id:"su-name",name:"su-name",type:"text",placeholder:t("auth.fullNamePlaceholder"),className:"h-10 bg-muted/40 border-border/60",required:!0,disabled:i})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"su-email",className:"text-xs text-muted-foreground",children:t("auth.signupEmailLabel")}),e.jsx(f,{id:"su-email",name:"su-email",type:"email",placeholder:t("auth.emailPlaceholder"),className:"h-10 bg-muted/40 border-border/60",required:!0,disabled:i,onBlur:V("su"),onInput:W}),G("su")??e.jsx("p",{className:"text-[11px] leading-tight text-muted-foreground",children:t("auth.signupEmailHint")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(g,{htmlFor:"su-pass",className:"text-xs text-muted-foreground",children:t("auth.signupPasswordLabel")}),e.jsxs("div",{className:"relative",children:[e.jsx(f,{id:"su-pass",name:"su-pass",type:h?"text":"password",placeholder:t("auth.minCharsPassword"),className:"h-10 pr-10 bg-muted/40 border-border/60",required:!0,disabled:i}),e.jsx("button",{type:"button",onClick:()=>z(!h),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:h?e.jsx(X,{className:"w-4 h-4"}):e.jsx(Z,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-[11px] leading-tight text-muted-foreground",children:t("auth.signupPasswordHint")})]}),e.jsx($,{}),e.jsx("div",{className:"absolute opacity-0 -z-10 h-0 overflow-hidden","aria-hidden":"true",children:e.jsx("input",{name:"website",tabIndex:-1,autoComplete:"off"})}),e.jsx(D,{type:"submit",className:"w-full h-10 font-semibold",disabled:i||ee,children:i?e.jsx(k,{className:"w-4 h-4 animate-spin"}):t("auth.createAccount")}),e.jsxs("p",{className:"text-[11px] leading-relaxed text-muted-foreground text-center",children:[t("auth.planEligibilityNote")," ",e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]}),e.jsxs("button",{type:"button",onClick:()=>b(!1),className:"md:hidden text-xs text-muted-foreground mt-2 mx-auto",children:[t("auth.hasAccount")," ",e.jsx("span",{className:"text-primary font-medium",children:t("auth.signIn")})]})]});return e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-start pt-4 pb-6 md:justify-center md:pt-0 md:pb-0 relative overflow-hidden",children:[e.jsx(me,{children:e.jsx("meta",{name:"apple-itunes-app",content:"app-id=6476944277"})}),e.jsx("img",{src:Se,alt:"","aria-hidden":"true",className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-[#1a1714]/75 via-[#2a2520]/60 to-[#1a1714]/85"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-[#3d2e1e]/15 via-trans
1parent to-[#1a1714]/30"}),e.jsx("div",{className:"md:hidden w-full max-w-md px-4 relative z-10",children:e.jsxs("div",{className:"bg-card rounded-2xl shadow-xl border border-border/50 overflow-hidden",children:[e.jsxs("div",{className:"flex border-b border-border/50",children:[e.jsx("button",{onClick:()=>b(!1),className:P("flex-1 py-3 text-sm font-medium transition-colors",l?"text-muted-foreground":"text-primary border-b-2 border-primary"),children:t("auth.signIn")}),e.jsx("button",{onClick:()=>b(!0),className:P("flex-1 py-3 text-sm font-medium transition-colors",l?"text-primary border-b-2 border-primary":"text-muted-foreground"),children:t("auth.createAccount")})]}),l?Y():Q()]})}),e.jsx("div",{className:"hidden md:block relative z-10 w-full max-w-[820px] mx-4",children:e.jsxs("div",{className:"bg-card rounded-2xl shadow-2xl border border-border/50 overflow-hidden relative",style:{minHeight:680},children:[e.jsx("div",{className:P("absolute top-0 left-0 w-1/2 h-full transition-opacity duration-300",l?"opacity-0 pointer-events-none z-0":"opacity-100 pointer-events-auto z-[5]"),style:{minHeight:680},children:Q()}),e.jsx("div",{className:P("absolute top-0 right-0 w-1/2 h-full transition-opacity duration-300",l?"opacity-100 pointer-events-auto z-[5]":"opacity-0 pointer-events-none z-0"),style:{minHeight:680},children:Y()}),e.jsxs("div",{className:"absolute top-0 h-full w-1/2 bg-gradient-to-br from-primary via-primary/90 to-[hsl(213,80%,35%)] flex flex-col items-center justify-center text-primary-foreground p-10 transition-all duration-500 ease-in-out rounded-2xl shadow-lg z-10",style:{left:l?0:"50%"},children:[e.jsx("img",{src:Ne,alt:"Dumpster Controls",className:"h-14 mb-6 object-contain"}),e.jsx("h3",{className:"text-2xl font-bold mb-3 text-center",children:t(l?"auth.signupPanelTitle":"auth.heyThere")}),e.jsx("p",{className:"text-sm text-primary-foreground/80 text-center max-w-[220px] mb-6 leading-relaxed",children:t(l?"auth.signupPanelSubtitle":"auth.heyThereSubtitle")}),l&&e.jsx("p",{className:"text-[13px] text-primary-foreground/80 text-center mb-3",children:t("auth.welcomeBackSubtitle")}),e.jsx("button",{type:"button",className:"border border-primary-foreground/50 text-primary-foreground bg-transparent hover:bg-primary-foreground/10 rounded-full px-8 py-2 text-sm font-medium transition-colors",onClick:()=>b(!l),children:t(l?"auth.signIn":"auth.createAccount")})]})]})}),e.jsx("p",{className:"text-center text-xs text-muted-foreground mt-6 relative z-10",children:t("auth.copyright")})]})}export{Oe 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.