PageSourceSearch

https://gunzito.com/assets/Register-DXzH_nvt.js

js gunzito.com collected 2026-10-04 23:31:08 UTC 15,285 bytes, 20 lines download raw bytes

1import{r as t,j as e,c as X,a as be,L as We,b as J,t as _e}from"./index-DdG4Nupj.js";import{m as Ge}from"./inboxMilestones-pIVLvSDZ.js";import{A as we,B as le,L as oe,I as se}from"./AuthLayout-BslhEb5z.js";import{M as He}from"./minus-DsWvFa52.js";import{G as Ve}from"./GoogleIcon-BUPdPhi1.js";import{L as je}from"./loader-circle-L6dVC0Z8.js";import{M as $e}from"./mail-CaRZHVHl.js";import"./index-B2mZozfS.js";var qe=Object.defineProperty,ze=Object.defineProperties,Je=Object.getOwnPropertyDescriptors,Y=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,ye=(n,r,l)=>r in n?qe(n,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[r]=l,Ze=(n,r)=>{for(var l in r||(r={}))Ce.call(r,l)&&ye(n,l,r[l]);if(Y)for(var l of Y(r))Se.call(r,l)&&ye(n,l,r[l]);return n},Ke=(n,r)=>ze(n,Je(r)),Qe=(n,r)=>{var l={};for(var s in n)Ce.call(n,s)&&r.indexOf(s)<0&&(l[s]=n[s]);if(n!=null&&Y)for(var s of Y(n))r.indexOf(s)<0&&Se.call(n,s)&&(l[s]=n[s]);return l};function Ue(n){let r=setTimeout(n,0),l=setTimeout(n,10),s=setTimeout(n,50);return[r,l,s]}function Xe(n){let r=t.useRef();return t.useEffect(()=>{r.current=n}),r.current}var Ye=18,Ee=40,et=`${Ee}px`,tt=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function nt({containerRef:n,inputRef:r,pushPasswordManagerStrategy:l,isFocused:s}){let[b,d]=t.useState(!1),[w,h]=t.useState(!1),[C,N]=t.useState(!1),F=t.useMemo(()=>l==="none"?!1:(l==="increase-width"||l==="experimental-no-flickering")&&b&&w,[b,w,l]),O=t.useCallback(()=>{let f=n.current,P=r.current;if(!f||!P||C||l==="none")return;let g=f,S=g.getBoundingClientRect().left+g.offsetWidth,R=g.getBoundingClientRect().top+g.offsetHeight/2,i=S-Ye,c=R;document.querySelectorAll(tt).length===0&&document.elementFromPoint(i,c)===f||(d(!0),N(!0))},[n,r,C,l]);return t.useEffect(()=>{let f=n.current;if(!f||l==="none")return;function P(){let S=window.innerWidth-f.getBoundingClientRect().right;h(S>=Ee)}P();let g=setInterval(P,1e3);return()=>{clearInterval(g)}},[n,l]),t.useEffect(()=>{let f=s||document.activeElement===r.current;if(l==="none"||!f)return;let P=setTimeout(O,0),g=setTimeout(O,2e3),S=setTimeout(O,5e3),R=setTimeout(()=>{N(!0)},6e3);return()=>{clearTimeout(P),clearTimeout(g),clearTimeout(S),clearTimeout(R)}},[r,s,l,O]),{hasPWMBadge:b,willPushPWMBadge:F,PWM_BADGE_SPACE_WIDTH:et}}var Ne=t.createContext({}),Pe=t.forwardRef((n,r)=>{var l=n,{value:s,onChange:b,maxLength:d,textAlign:w="left",pattern:h,placeholder:C,inputMode:N="numeric",onComplete:F,pushPasswordManagerStrategy:O="increase-width",pasteTransformer:f,containerClassName:P,noScriptCSSFallback:g=at,render:S,children:R}=l,i=Qe(l,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),c,K,ie,ue,ce;let[Oe,Re]=t.useState(typeof i.defaultValue=="string"?i.defaultValue:""),p=s??Oe,A=Xe(p),V=t.useCallback(a=>{b==null||b(a),Re(a)},[b]),k=t.useMemo(()=>h?typeof h=="string"?new RegExp(h):h:null,[h]),m=t.useRef(null),ee=t.useRef(null),te=t.useRef({value:p,onChange:V,isIOS:typeof window<"u"&&((K=(c=window==null?void 0:window.CSS)==null?void 0:c.supports)==null?void 0:K.call(c,"-webkit-touch-callout","none"))}),Q=t.useRef({prev:[(ie=m.current)==null?void 0:ie.selectionStart,(ue=m.current)==null?void 0:ue.selectionEnd,(ce=m.current)==null?void 0:ce.selectionDirection]});t.useImperativeHandle(r,()=>m.current,[]),t.useEffect(()=>{let a=m.current,o=ee.current;if(!a||!o)return;te.current.value!==a.value&&te.current.onChange(a.value),Q.current.prev=[a.selectionStart,a.selectionEnd,a.selectionDirection];function v(){if(document.activeElement!==a){q(null),z(null);return}let u=a.selectionStart,x=a.selectionEnd,U=a.selectionDirection,E=a.maxLength,B=a.value,M=Q.current.prev,T=-1,I=-1,L;if(B.length!==0&&u!==null&&x!==null){let De=u===x,Be=u===B.length&&B.length<E;if(De&&!Be){let W=u;if(W===0)T=0,I=1,L="forward";else if(W===E)T=W-1,I=W,L="backward";else if(E>1&&B.length>1){let re=0;if(M[0]!==null&&M[1]!==null){L=W<M[1]?"backward":"forward";let Le=M[0]===M[1]&&M[0]<E;L==="backward"&&!Le&&(re=-1)}T=re+W,I=re+W+1}}T!==-1&&I!==-1&&T!==I&&m.current.setSelectionRange(T,I,L)}let ge=T!==-1?T:u,xe=I!==-1?I:x,Ae=L??U;q(ge),z(xe),Q.current.prev=[ge,xe,Ae]}if(document.addEventListener("selectionchange",v,{capture:!0}),v(),document.activeElement===a&&ne(!0),!document.getElementById("input-otp-style")){let u=document.createElement("style");if(u.id="input-otp-style",document.head.appendChild(u),u.sheet){let x="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";Z(u.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Z(u.sheet,`[data-input-otp]:autofill { ${x} }`),Z(u.sheet,`[data-input-otp]:-webkit-autofill { ${x} }
1`),Z(u.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),Z(u.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let j=()=>{o&&o.style.setProperty("--root-height",`${a.clientHeight}px`)};j();let y=new ResizeObserver(j);return y.observe(a),()=>{document.removeEventListener("selectionchange",v,{capture:!0}),y.disconnect()}},[]);let[de,pe]=t.useState(!1),[$,ne]=t.useState(!1),[D,q]=t.useState(null),[G,z]=t.useState(null);t.useEffect(()=>{Ue(()=>{var a,o,v,j;(a=m.current)==null||a.dispatchEvent(new Event("input"));let y=(o=m.current)==null?void 0:o.selectionStart,u=(v=m.current)==null?void 0:v.selectionEnd,x=(j=m.current)==null?void 0:j.selectionDirection;y!==null&&u!==null&&(q(y),z(u),Q.current.prev=[y,u,x])})},[p,$]),t.useEffect(()=>{A!==void 0&&p!==A&&A.length<d&&p.length===d&&(F==null||F(p))},[d,F,A,p]);let H=nt({containerRef:ee,inputRef:m,pushPasswordManagerStrategy:O,isFocused:$}),me=t.useCallback(a=>{let o=a.currentTarget.value.slice(0,d);if(o.length>0&&k&&!k.test(o)){a.preventDefault();return}typeof A=="string"&&o.length<A.length&&document.dispatchEvent(new Event("selectionchange")),V(o)},[d,V,A,k]),he=t.useCallback(()=>{var a;if(m.current){let o=Math.min(m.current.value.length,d-1),v=m.current.value.length;(a=m.current)==null||a.setSelectionRange(o,v),q(o),z(v)}ne(!0)},[d]),fe=t.useCallback(a=>{var o,v;let j=m.current;if(!f&&(!te.current.isIOS||!a.clipboardData||!j))return;let y=a.clipboardData.getData("text/plain"),u=f?f(y):y;a.preventDefault();let x=(o=m.current)==null?void 0:o.selectionStart,U=(v=m.current)==null?void 0:v.selectionEnd,E=(x!==U?p.slice(0,x)+u+p.slice(U):p.slice(0,x)+u+p.slice(x)).slice(0,d);if(E.length>0&&k&&!k.test(E))return;j.value=E,V(E);let B=Math.min(E.length,d-1),M=E.length;j.setSelectionRange(B,M),q(B),z(M)},[d,V,k,p]),Te=t.useMemo(()=>({position:"relative",cursor:i.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[i.disabled]),ve=t.useMemo(()=>({position:"absolute",inset:0,width:H.willPushPWMBadge?`calc(100% + ${H.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:H.willPushPWMBadge?`inset(0 ${H.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:w,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[H.PWM_BADGE_SPACE_WIDTH,H.willPushPWMBadge,w]),Ie=t.useMemo(()=>t.createElement("input",Ke(Ze({autoComplete:i.autoComplete||"one-time-code"},i),{"data-input-otp":!0,"data-input-otp-placeholder-shown":p.length===0||void 0,"data-input-otp-mss":D,"data-input-otp-mse":G,inputMode:N,pattern:k==null?void 0:k.source,"aria-placeholder":C,style:ve,maxLength:d,value:p,ref:m,onPaste:a=>{var o;fe(a),(o=i.onPaste)==null||o.call(i,a)},onChange:me,onMouseOver:a=>{var o;pe(!0),(o=i.onMouseOver)==null||o.call(i,a)},onMouseLeave:a=>{var o;pe(!1),(o=i.onMouseLeave)==null||o.call(i,a)},onFocus:a=>{var o;he(),(o=i.onFocus)==null||o.call(i,a)},onBlur:a=>{var o;ne(!1),(o=i.onBlur)==null||o.call(i,a)}})),[me,he,fe,N,ve,d,G,D,i,k==null?void 0:k.source,p]),ae=t.useMemo(()=>({slots:Array.from({length:d}).map((a,o)=>{var v;let j=$&&D!==null&&G!==null&&(D===G&&o===D||o>=D&&o<G),y=p[o]!==void 0?p[o]:null,u=p[0]!==void 0?null:(v=C==null?void 0:C[o])!=null?v:null;return{char:y,placeholderChar:u,isActive:j,hasFakeCaret:j&&y===null}}),isFocused:$,isHovering:!i.disabled&&de}),[$,de,d,G,D,i.disabled,p]),Fe=t.useMemo(()=>S?S(ae):t.createElement(Ne.Provider,{value:ae},R),[R,ae,S]);return t.createElement(t.Fragment,null,g!==null&&t.createElement("noscript",null,t.createElement("style",null,g)),t.createElement("div",{ref:ee,"data-input-otp-container":!0,style:Te,className:P},Fe,t.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},Ie)))});Pe.displayName="Input";function Z(n,r){try{n.insertRule(r)}catch{console.error("input-otp could not insert CSS rule:",r)}}var at=`
2[data-input-otp] {
3  --nojs-bg: white !important;
4  --nojs-fg: black !important;
5
6  background-color: var(--nojs-bg) !important;
7  color: var(--nojs-fg) !important;
8  caret-color: var(--nojs-fg) !important;
9  letter-spacing: .25em !important;
10  text-align: center !important;
11  border: 1px solid var(--nojs-fg) !important;
12  border-radius: 4px !important;
13  width: 100% !important;
14}
15@media (prefers-color-scheme: dark) {
16  [data-input-otp] {
17    --nojs-bg: black !important;
18    --nojs-fg: white !important;
19  }
20}`;const ke=t.forwardRef(({className:n,containerClassName:r,...l},s)=>e.jsx(Pe,{ref:s,containerClassName:X("flex items-center gap-2 has-[:disabled]:opacity-50",r),className:X("disabled:cursor-not-allowed",n),...l}));ke.displayName="InputOTP";const Me=t.forwardRef(({className:n,...r},l)=>e.jsx("div",{ref:l,className:X("flex items-center",n),...r}));Me.displayName="InputOTPGroup";const _=t.forwardRef(({index:n,className:r,...l},s)=>{const b=t.useContext(Ne),{char:d,hasFakeCaret:w,isActive:h}=b.slots[n];return e.jsxs("div",{ref:s,className:X("relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",h&&"z-10 ring-1 ring-ring",r),...l,children:[d,w&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});_.displayName="InputOTPSlot";const rt=t.forwardRef(({...n},r)=>e.jsx("div",{ref:r,role:"separator",...n,children:e.jsx(He,{})}));rt.displayName="InputOTPSeparator";function mt(){const[n,r]=t.useState(""),[l,s]=t.useState(""),[b,d]=t.useState(""),[w,h]=t.useState(""),[C,N]=t.useState(!1),[F,O]=t.useState(!1),[f,P]=t.useState(""),g=async c=>{if(c.preventDefault(),h(""),l!==b){h("As senhas não conferem");return}N(!0);try{await J.auth.register({email:n,password:l}),O(!0)}catch(K){h(K.message||"Falha no cadastro")}finally{N(!1)}},S=async()=>{h(""),N(!0);try{const c=await J.auth.verifyOtp({email:n,otpCode:f});c!=null&&c.access_token&&J.auth.setToken(c.access_token);try{await Ge("register")}catch{}window.location.href="/"}catch(c){h(c.message||"Código inválido")}finally{N(!1)}},R=async()=>{h("");try{await J.auth.resendOtp(n),_e({title:"Código reenviado",description:"Verifique seu email para o novo código."})}catch(c){h(c.message||"Falha ao reenviar código")}},i=()=>{J.auth.loginWithProvider("google","/")};return F?e.jsxs(we,{title:"Verifique seu email",subtitle:`Enviamos um código para ${n}`,children:[w&&e.jsx("div",{className:"mb-4 p-3 rounded-lg bg-destructive/10 text-destructive dark:text-red-400 text-sm",children:w}),e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx(ke,{maxLength:6,value:f,onChange:P,autoF
20ocus:!0,autoComplete:"one-time-code",children:e.jsxs(Me,{children:[e.jsx(_,{index:0}),e.jsx(_,{index:1}),e.jsx(_,{index:2}),e.jsx(_,{index:3}),e.jsx(_,{index:4}),e.jsx(_,{index:5})]})})}),e.jsx(le,{className:"w-full h-12 font-medium",onClick:S,disabled:C||f.length<6,children:C?e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2 animate-spin"}),"Verificando..."]}):"Verificar"}),e.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-4",children:["Não recebeu o código?"," ",e.jsx("button",{onClick:R,className:"text-primary font-medium hover:underline",children:"Reenviar"})]})]}):e.jsxs(we,{title:"Criar conta",subtitle:"Cadastre-se para começar",footer:e.jsxs(e.Fragment,{children:["Já tem uma conta?"," ",e.jsx(We,{to:"/login",className:"text-white font-medium hover:underline",children:"Entrar"})]}),children:[e.jsxs(le,{variant:"outline",className:"w-full h-12 text-sm font-medium mb-6",onClick:i,children:[e.jsx(Ve,{className:"w-5 h-5 mr-2"}),"Continuar com Google"]}),e.jsxs("div",{className:"relative mb-6",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-border"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-3 text-muted-foreground",children:"ou"})})]}),w&&e.jsx("div",{className:"mb-4 p-3 rounded-lg bg-destructive/10 text-destructive dark:text-red-400 text-sm",children:w}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(oe,{htmlFor:"email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx($e,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(se,{id:"email",type:"email",autoComplete:"email",autoFocus:!0,placeholder:"[email protected]",value:n,onChange:c=>r(c.target.value),className:"pl-10 h-12",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(oe,{htmlFor:"password",children:"Senha"}),e.jsxs("div",{className:"relative",children:[e.jsx(be,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(se,{id:"password",type:"password",autoComplete:"new-password",placeholder:"••••••••",value:l,onChange:c=>s(c.target.value),className:"pl-10 h-12",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(oe,{htmlFor:"confirm",children:"Confirmar Senha"}),e.jsxs("div",{className:"relative",children:[e.jsx(be,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(se,{id:"confirm",type:"password",autoComplete:"new-password",placeholder:"••••••••",value:b,onChange:c=>d(c.target.value),className:"pl-10 h-12",required:!0})]})]}),e.jsx(le,{type:"submit",className:"w-full h-12 font-medium",disabled:C,children:C?e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2 animate-spin"}),"Criando conta..."]}):"Criar conta"})]})]})}export{mt 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.