1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9344],{36407:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth/login",function(){return s(33781)}])},43832:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});let r=(0,s(31134).Z)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},15928:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});let r=(0,s(31134).Z)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},98604:function(e,t,s){"use strict";s.d(t,{d:function(){return f}});var r=s(85893),n=s(68414),a=s(98869),i=s(92394),l=s(4206),o=s(28128),c=s(25675),u=s.n(c),d=s(41664),m=s.n(d),h=s(11163);function f(e){var t,s;let c,{children:d,backUrl:f,className:x,navBarClassName:p}=e,g=(0,h.useRouter)(),v=(0,a.I)(e=>e.step),w=(0,a.I)(e=>e.setStep),j=(0,i.F)(e=>e.returnUrl)||"/",y=!!(g.pathname&&"/"!==g.pathname&&!(null===(t=g.pathname)||void 0===t?void 0:t.includes("/auth/callback"))&&!(null===(s=g.pathname)||void 0===s?void 0:s.includes("/auth/login"))),N=v===l.$p.DefinicaoDeSenha&&"/auth/register"===g.pathname?()=>w(l.$p.InformaçõesPessoais):void 0;return c=N?(0,r.jsxs)(n.z,{onClick:N,variant:"ghost",className:"flex items-center",children:[(0,r.jsx)(u(),{src:"/images/icons/arrow-left.svg",alt:"Back",width:16,height:16,className:"mr-2 size-[16px]"}),"Voltar"]}):y?(0,r.jsx)(m(),{href:null!=f?f:j,children:(0,r.jsxs)(n.z,{variant:"ghost",className:"flex items-center",children:[(0,r.jsx)(u(),{src:"/images/icons/arrow-left.svg",alt:"Back",width:16,height:16,className:"mr-2 size-[16px]"}),"Voltar"]})}):(0,r.jsx)("div",{}),(0,r.jsxs)("div",{className:(0,o.cn)("flex flex-col items-center min-h-screen bg-white md:bg-slate-50",x),children:[(0,r.jsx)("div",{className:(0,o.cn)("w-full bg-white md:bg-white flex justify-center items-center max-h-[78px] md:h-[78px]",p),children:(0,r.jsxs)("div",{className:"w-full max-w-[1000px] flex justify-center items-center h-full px-4 py-4",children:[c,(0,r.jsx)(u(),{src:"/images/logo.svg",alt:"Mavielo",width:120,height:18,onClick:()=>g.push("/"),className:"cursor-pointer max-h-[18px]"})]})}),d]})}},92688:function(e,t,s){"use strict";s.d(t,{G:function(){return m}}),s(85893);var r=s(98029),n=s(54876),a=s(42425),i=s(11163),l=s(67294),o=s(10205);let c=()=>new Promise((e,t)=>{try{var s,r;window.fbAsyncInit=()=>{var t;null===(t=window.FB)||void 0===t||t.init({appId:o.v.facebookClientId,cookie:!0,xfbml:!1,version:"v20.0"}),e("")},null===(s=(r=window).fbAsyncInit)||void 0===s||s.call(r)}catch(e){console.error(e),t(e)}}),u=()=>new Promise((e,t)=>{try{window.FB.login(t=>{e(t)},{scope:"openid, public_profile, email"})}catch(e){t(e)}});var d=s(92394);function m(e){let{target:t="login"}=e,{mutate:s}=function(e){let t=(0,i.useRouter)(),s=(0,d.F)(e=>e.returnUrl);return(0,l.useEffect)(()=>{(async()=>{console.log("initFacebookSdk"),await c(),console.log("iniciou",window.FB)})()},[]),(0,r.D)({mutationKey:["facebook-login/".concat(e)],mutationFn:async()=>{var r;let i=n.t.getState();i.setIsLoading(!0);let l=await u();if(console.log({response:l}),!(null===(r=l.authResponse)||void 0===r?void 0:r.accessToken))return;console.log(l);let o=await (0,a.g7)(l.authResponse.accessToken,"facebook",e);i.setAccessToken(o.accessToken);let c=await (0,a.jo)();i.update(c),i.setIsLoading(!1),s?t.push("".concat(s,"?accessToken=").concat(o.accessToken)):t.push("/")},onError(){n.t.getState().setIsLoading(!1)}})}(t);return null}s(37945)},37034:function(e,t,s){"use strict";s.d(t,{C:function(){return d}});var r=s(85893),n=s(86426),a=s(98029),i=s(54876),l=s(42425),o=s(92394),c=s(11163),u=s(37945);function d(e){let{target:t="login"}=e,{mutate:s}=function(e){let t=(0,o.F)(e=>e.returnUrl),s=(0,o.F)(e=>e.returnUrlWithToken),r=(0,c.useRouter)(),u=(0,n.Nq)({onSuccess:async n=>{let a=await (0,l.g7)(n.access_token,"google",e),o=i.t.getState();o.setAccessToken(a.accessToken),o.setRefreshToken(a.refreshToken);let c=await (0,l.jo)();o.update(c),t?r.push(s({accessToken:a.accessToken,refreshToken:a.refreshToken}
1)):r.push("/")},onError:()=>{console.log("error")}});return(0,a.D)({mutationKey:["google-login/".concat(e)],mutationFn:async()=>u()})}(t);return(0,r.jsx)(u.E,{onClick:()=>s(),cursor:"pointer",alt:"google",src:"/images/icons/google.svg"})}},89346:function(e,t,s){"use strict";s.d(t,{Ol:function(){return l},Zb:function(){return i},aY:function(){return o}});var r=s(85893),n=s(67294),a=s(28128);let i=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,a.cn)("rounded-xl border bg-card text-card-foreground shadow",s),...n})});i.displayName="Card";let l=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,a.cn)("flex flex-col space-y-1.5 p-6",s),...n})});l.displayName="CardHeader",n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)("h3",{ref:t,className:(0,a.cn)("font-semibold leading-none tracking-tight",s),...n})}).displayName="CardTitle",n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)("p",{ref:t,className:(0,a.cn)("text-sm text-muted-foreground",s),...n})}).displayName="CardDescription";let o=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,a.cn)("p-6 pt-0",s),...n})});o.displayName="CardContent",n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,a.cn)("flex items-center p-6 pt-0",s),...n})}).displayName="CardFooter"},88860:function(e,t,s){"use strict";s.d(t,{I:function(){return o}});var r=s(85893),n=s(67294),a=s(28128),i=s(43832),l=s(15928);let o=n.forwardRef((e,t)=>{let{className:s,type:o,...c}=e,[u,d]=n.useState(!1),m=n.useRef(null);return(0,r.jsxs)("div",{className:"relative flex w-full items-center",children:[(0,r.jsx)("input",{type:u&&"password"===o?"text":o,className:(0,a.cn)("flex w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm h-[48px]",s),ref:t||m,...c}),"password"===o&&(0,r.jsx)("button",{type:"button",onClick:()=>{d(e=>!e)},className:"absolute right-1 px-3 py-2",children:u?(0,r.jsx)(i.Z,{className:"h-4 w-4 text-muted-foreground"}):(0,r.jsx)(l.Z,{className:"h-4 w-4 text-muted-foreground"})}),"date"===o&&(0,r.jsx)("button",{type:"button",onClick:()=>{var e,t;null===(t=m.current)||void 0===t||null===(e=t.showPicker)||void 0===e||e.call(t)},className:"absolute right-0 w-[48px] h-[48px]",children:(0,r.jsx)("i",{className:"ri-calendar-line"})})]})});o.displayName="Input"},120:function(e,t,s){"use strict";s.d(t,{B:function(){return u}});var r=s(98029),n=s(54876),a=s(42425),i=s(11163),l=s(86455),o=s.n(l),c=s(92394);function u(e){let t=(0,i.useRouter)(),s=(0,c.F)(e=>e.returnUrl),l=(0,c.F)(e=>e.returnUrlWithToken);return(0,r.D)({mutationKey:["email-login/".concat(e)],mutationFn:async e=>{if(!e.username)return o().fire("Informe o email");if(!e.password)return o().fire("Informe a senha");let r=n.t.getState();r.setIsLoading(!0);let i=await (0,a.Nc)("login",e);if(!(null==i?void 0:i.accessToken))return;r.setAccessToken(i.accessToken),r.setRefreshToken(i.refreshToken);let c=await (0,a.jo)();if(r.update(c),r.setIsLoading(!1),console.log("email login return url",s),s){var u;if(!(null==c?void 0:null===(u=c.dataCollectProgress)||void 0===u?void 0:u.profile)){t.push("/data");return}t.push(l(i));return}window.alert("ALGO DEU ERRADO! Tente novamente")},onError(){o().fire("Login ou senha incorretos!",void 0,"error"),n.t.getState().setIsLoading(!1)}})}},98869:function(e,t,s){"use strict";s.d(t,{I:function(){return i}});var r=s(4206),n=s(31993),a=s(782);let i=(0,n.U)((0,a.tJ)(e=>({form:{acceptedWhatsapp:!0,acceptedNewsletter:!0},step:r.$p.InformaçõesPessoais,setForm:t=>{e({form:t})},setStep:t=>{e({step:t})}}),{name:"register-storage",storage:(0,a.FL)(()=>localStorage)}))},33781:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var r=s(85893),n=s(98604),a=s(92688),i=s(37034),l=s(68414),o=s(89346),c=s(88860),u=s(120),d=s(25675),m=s.n(d),h=s(41664),f=s.n(h),x=s(67294);function p(){let[e,t]=(0,x.useState)({password:"",username:""}),s=(e,s)=>{t(t=>({...t,[e]:s}))},{mutate:n,isPending:d}=(0,u.B)("login"),h=(0,r.jsx)("div",{className:"flex flex-col md:items-center md:justify-center w-screen md:w-auto md:min-w-[400px] space-y-2",children:(0,r.jsx)(o.aY,{className:"p-6 flex flex-col w-full h-screen md:h-auto",children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex flex-col md:hidden text-center gap-1.5",children:[(0,r.jsx)("p",{className:"text-2xl text-primary-800 font-bold",children:"Entrar"}),(0,r.jsx)("p",{className:"text-sm leading-5 font-normal text-primary-800",children:"Insira seu e-mail e senha para realizar o login"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("label",{htmlFor:"email",className:"text-sm font-medium",children:"Email*"}),(0,r.jsx)(c.I,{id:"username",type:"username",placeholder:"Digite seu e-mail",value:e.username,onChange:e=>s("username",e.target.value),className:"h-12"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("label",{htmlFor:"password",className:"text-sm font-medium",children:"Senha*"}),(0,r.jsx)(f(),{href:"/auth/recover",className:"text-sm text-gray-600 hover:underline",children:"Esqueceu a senha?"})]}),(0,r.jsx)(c.I,{id:"password",type:"password",placeholder:"Digite sua senha",value:e.password,onChange:e=>s("password",e.target.value),className:"h-12"})]}),(0,r.jsx)(l.z,{onClick:()=>{n(e)},loading:d,className:"w-full h-12 bg-primary-800 hover:bg-primary-950 text-white",children:"Entrar"}),(0,r.jsxs)("div",{className:"relative flex items-center justify-center py-0",children:[(0,r.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,r.jsx)("div",{className:"w-full border-t border-gray-300"})}),(0,r.jsx)("div",{className:"relative bg-white px-4 text-sm text-gray-500",children:"ou"})]}),(0,r.jsxs)("div",{className:"flex justify-center space-x-4",children:[(0,r.jsx)(i.C,{}),(0,r.jsx)(a.G,{})]}),(0,r.jsx)("div",{className:"flex md:hidden flex-col",children:(0,r.jsx)("div",{className:"text-center",children:(0,r.jsxs)("p",{className:"text-sm text-primary-800 font-light",children:["N\xe3o possui uma conta?"," ",(0,r.jsx)(f(),{href:"/auth/register",className:"text-primary-700 font-medium underline",children:"Cadastre-se!"})]})})})]})})});return(0,r.jsx)("div",{className:"flex flex-1 w-full flex-col bg-white md:bg-slate-50 md:justify-center md:min-h-auto",children:(0,r.jsxs)("div",{className:"w-full h-full md:p-0 flex flex-1 flex-col justify-center md:justify-center md:items-center p-0 m-0",children:[(0,r.jsx)("div",{className:"md:hidden py-6 flex flex-col w-full",children:h}),(0,r.jsx)("div",{className:"hidden md:flex justify-center mt-[-64px] items-center",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-10 justify-center items-center",children:[(0,r.jsx)("div",{className:"items-center justify-center",children:(0,r.jsx)("div",{className:"relative min-w-[500px] items-center justify-center w-full min-h-[700px] max-h-[700px]",children:(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,r.jsx)(m(),{src:"/images/mockup-login.png",alt:"MAVIELO App Preview",fill:!0,className:"object-contain mt-2"})})})}),(0,r.jsxs)("div",{className:"flex flex-col md:items-center md:justify-center w-screen md:w-auto md:min-w-[400px] space-y-2",children:[(0,r.jsx)(o.Zb,{className:"w-full h-screen md:h-auto max-w-md border-slate-200 shadow-sm rounded-lg bg-white",children:h}),(0,r.jsx)(o.Zb,{className:"flex flex-col w-full max-w-md border-slate-200 shadow-sm bg-white rounded-lg",children:(0,r.jsx)(o.aY,{className:"p-6 space-y-6",children:(0,r.jsx)("div",{className:"text-center",children:(0,r.jsxs)("p",{className:"text-sm text-primary-800 font-light",children:["N\xe3o possui uma conta?"," ",(0,r.jsx)(f(),{href:"/auth/register",className:"text-primary-800 font-medium underline",children:"Cadastre-se!"})]})})})}),(0,r.jsx)(o.Zb,{className:"flex flex-col w-full max-w-md border-slate-200 shadow-sm bg-white rounded-lg",children:(0,r.jsx)(o.aY,{className:"p-6 space-y-6",children:(0,r.jsxs)("div",{className:" space-y-3",children:[(0,r.jsx)("p",{className:"text-center text-sm font-medium text-primary-800",children:"Baixe o app"}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)("div",{className:"h-24 w-24 relative",children:(0,r.jsx)(m(),{src:"/images/icons/qr-code.svg",alt:"QR Code para download",width:96,height:96,className:"object-contain"})})})]})})})]})]})})]})})}p.getLayout=function(e){return(0,r.jsx)(n.d,{className:"md:bg-slate-50",navBarClassName:"md:bg-slate-50",children:e})}},98029:function(e,t,s){"use strict";s.d(t,{D:function(){return d}});var r=s(67294),n=s(59289),a=s(27037),i=s(7506),l=s(24139),o=class extends i.l{#e;#t=void 0;#s;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,l.VS)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.Ym)(t.mutationKey)!==(0,l.Ym)(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#a()}mutate(e,t){return this.#r=t,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(e)}#n(){let e=this.#s?.state??(0,n.R)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#a(e){a.V.batch(()=>
1{if(this.#r&&this.hasListeners()){let t=this.#t.variables,s=this.#t.context;e?.type==="success"?(this.#r.onSuccess?.(e.data,t,s),this.#r.onSettled?.(e.data,null,t,s)):e?.type==="error"&&(this.#r.onError?.(e.error,t,s),this.#r.onSettled?.(void 0,e.error,t,s))}this.listeners.forEach(e=>{e(this.#t)})})}},c=s(30202),u=s(86290);function d(e,t){let s=(0,c.NL)(t),[n]=r.useState(()=>new o(s,e));r.useEffect(()=>{n.setOptions(e)},[n,e]);let i=r.useSyncExternalStore(r.useCallback(e=>n.subscribe(a.V.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),l=r.useCallback((e,t)=>{n.mutate(e,t).catch(u.Z)},[n]);if(i.error&&(0,u.L)(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:l,mutateAsync:i.mutate}}},86290:function(e,t,s){"use strict";function r(e,t){return"function"==typeof e?e(...t):!!e}function n(){}s.d(t,{L:function(){return r},Z:function(){return n}})}},function(e){e.O(0,[5675,2888,9774,179],function(){return e(e.s=36407)}),_N_E=e.O()}]);
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.