1"use strict";(self.webpackChunkb2c_checkout=self.webpackChunkb2c_checkout||[]).push([[266],{71570:function(e,r,n){n.d(r,{q:function(){return Z}});var t=n(1413),o=n(34578),a=n(75590),c=n(74165),i=n(15861),u=n(29439),s=n(97158),l=n(85115),d=n(84656),p=function(){var e=(0,i.Z)((0,c.Z)().mark((function e(r){var n,t,o,a;return(0,c.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.emailOrCpf,t=r.captchaToken,e.prev=1,e.next=4,d.K.post("/canais/recuperar-senha",{email_cpf:n},{headers:t?{"captcha-token":t}:void 0});case 4:return o=e.sent,a=o.data,e.abrupt("return",[a,null]);case 9:return e.prev=9,e.t0=e.catch(1),e.abrupt("return",[null,e.t0]);case 12:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(r){return e.apply(this,arguments)}}(),f=n(30831),v=n(49517),m=n(42199),h=n(47397),w=n.n(h),x=n(47313),b=n(75627),g=n(46417),y=function(e){var r,n=e.email,d=(0,s.d)().isEnableFeatureFlag,h=(0,x.useState)(!1),y=(0,u.Z)(h,2),Z=y[0],k=y[1],E=(0,x.useState)(!1),T=(0,u.Z)(E,2),C=T[0],R=T[1],S=(0,x.useRef)(null),A=(0,x.useState)(null),I=(0,u.Z)(A,2),O=I[0],j=I[1],L=(0,x.useState)(null),B=(0,u.Z)(L,2),z=B[0],N=B[1],F=(0,x.useState)(!1),U=(0,u.Z)(F,2),K=U[0],P=U[1],$=(0,x.useState)(!1),_=(0,u.Z)($,2),D=_[0],q=_[1];(0,x.useEffect)((function(){var e=function(){var e=(0,i.Z)((0,c.Z)().mark((function e(){var r;return(0,c.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d(l.Nr.CLOUDFLARE_TURNSTILE);case 2:r=e.sent,N(!r||r.situacao===l.Bv.ATIVO);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]);var M=!D&&(null===z||!0===z&&!O&&!K),G=(0,x.useState)("Caso o e-mail ou CPF informado esteja cadastrado, voc\xea receber\xe1 um link por e-mail para criar uma nova senha."),W=(0,u.Z)(G,2),V=W[0],H=W[1],J=(0,o.l0L)(),Y=(0,a.$G)().t,Q=w().object({emailOrCpf:w().string().pattern(new RegExp("([0-9]{3}\\.[0-9]{3}\\.[0-9]{3}-[0-9]{2})|([a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6})")).messages({"string.empty":Y("components.passwordRecovery.requiredEmailOrCpf"),"string.pattern.base":Y("components.passwordRecovery.invalidEmailOrCpf")}).required()}),X=(0,b.cI)({resolver:(0,f.L)(Q),defaultValues:{emailOrCpf:n||""}}),ee=X.register,re=X.handleSubmit,ne=X.formState.errors,te=function(){var e;null===(e=S.current)||void 0===e||e.reset(),j(null),P(!1)},oe=function(){var e=(0,i.Z)((0,c.Z)().mark((function e(r){var n,t,o,a,i,s,l,d,f;return(0,c.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!z||O){e.next=2;break}return e.abrupt("return",J({description:Y(D?"components.passwordRecovery.captchaUnavailable":"components.passwordRecovery.captchaRequired"),status:"error"}));case 2:return R(!0),e.next=5,p({emailOrCpf:r.emailOrCpf,captchaToken:z?O:void 0});case 5:if(n=e.sent,t=(0,u.Z)(n,2),o=t[0],a=t[1],o||!a){e.next=22;break}if(R(!1),z&&te(),d=null===(i=a.response)||void 0===i?void 0:i.status,f=null===(s=a.response)||void 0===s||null===(l=s.data)||void 0===l?void 0:l.errors,400!==d&&422!==d){e.next=16;break}return e.abrupt("return",J({description:null!==f&&void 0!==f&&f["captcha-token"]?Y("components.passwordRecovery.captchaRequired"):Y("components.passwordRecovery.errorToast"),status:"error"}));case 16:if(!(a.response&&a.response.data&&a.response.data.message&&500!==a.response.status&&429!==a.response.status)){e.next=21;break}return H(a.response.data.message),k(a),R(!1),e.abrupt("return");case 21:return e.abrupt("return",J({description:Y("components.passwordRecovery.errorToast"),status:"error"}));case 22:k(!a),R(!1);case 24:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();return Z?(0,g.jsxs)(o.M5Y,{flexDirection:"column",margin:"1rem",children:[(0,g.jsx)(o.meu,{}),(0,g.jsx)(o.xvT,{color:"neutral.500",fontSize:"sm",marginTop:"2rem",children:V})]}):(0,g.jsxs)("form",{onSubmit:re(oe),children:[(0,g.jsx)(o.xvT,{color:"neutral.500",fontSize:"sm",children:Y("components.passwordRecovery.instructions")}),(0,g.jsx)(o.Icd,(0,t.Z)((0,t.Z)({},ee("emailOrCpf")),{},{errorMessage:null===ne||void 0===ne||null===(r=ne.emailOrCpf)||void 0===r?void 0:r.message,isInvalid:Boolean(null===ne||void 0===ne?void 0:ne.emailOrCpf),onChange:function(e){var r=e.target.value;if(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/.test(r))return e.target.value=r;var n=r.replace(/[.-]/g,"");return/^[0-9]+$/.test(n)?n.length>11?e.target.value=r.slice(0,-1):e.target.value=r.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4"):void 0},marginY:"1rem",name:"emailOrCpf",type:"text",label:Y("components.passwordRecovery.label"),formLabelProps:{color:"neutral.700",fontWeight:"normal",fontSize:".875rem"},placeholder:Y("components.passwordRecovery.placeholder"),inputProps:{height:"3rem"}})),z&&(0,g.jsx)(o.kCb,{margin:K?"1rem 0":"0 !important",justifyContent:"center",children:(0,g.jsx)(v.Nc,{ref:S,siteKey:"0x4AAAAAAEBDGagnGRTP0hOt",options:{action:"password-recovery",appearance:"interaction-only"},onBeforeInteractive:function(){return P(!0)},onSuccess:function(e){j(e),q(!1)},onExpire:function(){return j(null)},onError:function(){j(null),q(!0),m.uT("Turnstile: falha ao carregar o widget",{level:"error",tags:{escopo:"captcha",reason:"widget_error",fluxo:"password-recovery"}})}})}),(0,g.jsx)(o.Jiv,{label:Y("components.passwordRecovery.submitButton"),width:"100%",loadingText:Y("components.passwordRecovery.loadingText"),height:"3rem",variant:"success",type:"submit",isLoading:C||M})]})},Z=function(e){var r=(0,a.$G)().t;return(0,g.jsx)(o.sv8,(0,t.Z)((0,t.Z)({},e),{},{modalBody:(0,g.jsx)(y,{email:e.email}),modalTitle:r("components.passwordRecovery.title"),propsModal:{isCentered:!0}}))}},46978:function(e,r,n){n.d(r,{Bl:function(){return d},HD:function(){return l},fI:function(){return i},fO:function(){return s},mJ:function(){return u}});var t=n(74165),o=n(15861),a=n(49448),c=n(84656);function i(e,r){var n="cart"===r?"entrega":"home";window.location.href="".concat(a.O.apiUriV2,"/canais/social/").concat(e,"/redirect?canal=gazin-ecommerce&redirect_to=").concat(n)}var u=function(){var e=(0,o.Z)((0,t.Z)().mark((function e(r){var n,o,a,i,u,s,l,d;return(0,t.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.K.post("/canais/social/vincular",r);case 3:return n=e.sent,e.abrupt("return",[n.data,null]);case 7:return e.prev=7,e.t0=e.catch(0),d=e.t0,e.abrupt("return",[null,{message:null!==(o=null!==(a=null===(i=d.response)||void 0===i||null===(u=i.data)||void 0===u?void 0:u.message)&&void 0!==a?a:null===(s=d.response)||void 0===s||null===(l=s.data)||void 0===l?void 0:l[0])&&void 0!==o?o:"Erro ao vincular conta."}]);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(r){return e.apply(this,arguments)}}(),s=function(){var e=(0,o.Z)((0,t.Z)().mark((function e(r){var n,o,a;return(0,t.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.K.post("/canais/social/criar-conta",r);case 3:return n=e.sent,e.abrupt("return",[n.data,null]);case 7:return e.prev=7,e.t0=e.catch(0),a=e.t0,e.abrupt("return",[null,{status:null===(o=a.response)||void 0===o?void 0:o.status}]);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(r){return e.apply(this,arguments)}}(),l=function(){var e=(0,o.Z)((0,t.Z)().mark((function e(r){var n,o,a,i,u;return(0,t.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.K.post("/canais/social/exchange-new-user",{code:r});case 3:return n=e.sent,e.abrupt("return",[n.data,null]);case 7:return e.prev=7,e.t0=e.catch(0),u=e.t0,e.abrupt("return",[null,{message:null!==(o=null===(a=u.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)&&void 0!==o?o:"C\xf3digo social inv\xe1lido ou expirado."}]);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(r){return e.apply(this,arguments)}}(),d=function(){var e=(0,o.Z)((0,t.Z)().mark((function e(r){var n,o,a,i,u;return(0,t.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.K.post("/canais/social/exchange",{code:r});case 3:return n=e.sent,e.abrupt("return",[n.data,null]);case 7:return e.prev=7,e.t0=e.catch(0),u=e.t0,e.abrupt("return",[null,{message:null!==(o=null===(a=u.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)&&void 0!==o?o:"Erro ao finalizar autentica\xe7\xe3o."}]);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(r){return e.apply(this,arguments)}}()},49517:function(e,r,n){n.d(r,{Nc:function(){return E}});var t=n(74165),o=n(15861),a=n(29439),c=n(1413),i=n(44925),u=n(47313),s=n(46417),l=["as"],d=["scriptOptions","options","siteKey","onWidgetLoad","onSuccess","onExpire","onError","onBeforeInteractive","onAfterInteractive","onUnsupported","onTimeout","onLoadScript","id","style","as","injectScript","rerenderOnCallbackChange"],p=(0,u.forwardRef)((function(e,r){var n=e.as,t=void 0===n?"div":n,o=(0,i.Z)(e,l);return(0,s.jsx)(t,(0,c.Z)((0,c.Z)({},o),{},{ref:r}))})),f="cf-turnstile-script",v="onloadTurnstileCallback",m=function(e){return!!document.getElementById(e)},h=function(e){var r=e.render,n=void 0===r?"explicit":r,t=e.onLoadCallbackName,o=void 0===t?v:t,a=e.scriptOptions,c=void 0===a?{}:a,i=c.nonce,u=void 0===i?"":i,s=c.defer,l=void 0===s||s,d=c.async,p=void 0===d||d,f=c.id,h=void 0===f?"":f,w=c.appendTo,x=c.onError,b=c.crossOrigin,g=void 0===b?"":b,y=h||"cf-turnstile-script";if(!m(y)){var Z=document.createElement("script");Z.id=y,Z.src="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(o,"&render=").concat(n),!document.querySelector('script[src="'.concat(Z.src,'"]'))&&(Z.defer=!!l,Z.async=!!p,u&&Z.setAttribute("nonce",u),g&&(Z.crossOrigin=g),x&&(Z.onerror=x,delete window[o]),("body"===w?document.body:document.getElementsByTagName("head")[0]).appendChild(Z))}},w={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65}};function x(e){if("invisible"!==e)return e}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=(0,u.useState)(!1),n=(0,a.Z)(r,2),t=n[0],o=n[1];return(0,u.useEffect)((function(){var r=function(){m(e)&&o(!0)},n=new MutationObserver(r);return n.observe(document,{childList:!0,subtree:!0}),r(),function(){n.disconnect()}}),[e]),t}var g,y="unloaded",Z=new Promise((function(e,r){g={resolve:e,reject:r},"ready"===y&&e(void 0)})),k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;return"unloaded"===y&&(y="loading",window[e]=function(){g.resolve(),y="ready",delete window[e]}),Z},E=(0,u.forwardRef)((function(e,r){var n=e.scriptOptions,l=e.options,f=void 0===l?{}:l,v=e.siteKey,m=e.onWidgetLoad,g=e.onSuccess,Z=e.onExpire,E=e.onError,T=e.onBeforeInteractive,C=e.onAfterInteractive,R=e.onUnsupported,S=e.onTimeout,A=e.onLoadScript,I=e.id,O=e.style,j=e.as,L=void 0===j?"div":j,B=e.injectScript,z=void 0===B||B,N=e.rerenderOnCallbackChange,F=void 0!==N&&N,U=(0,i.Z)(e,d),K=f.size,P=(0,u.useCallback)((function(){if(void 0===K)return{};if("execute"===f.execution)return w.invisible;var e=w[K];return"interaction-only"===f.appearance?(0,c.Z)((0,c.Z)({},e),{},{height:"auto"}):e}),[f.execution,K,f.appearance]),$=(0,u.useState)(P()),_=(0,a.Z)($,2),D=_[0],q=_[1],M=(0,u.useRef)(null),G=(0,u.useState)(!1),W=(0,a.Z)(G,2),V=W[0],H=W[1],J=(0,u.useRef)(void 0),Y=(0,u.useRef)(!1),Q=I||"cf-turnstile",X=(0,u.useRef)({onSuccess:g,onError:E,onExpire:Z,onBeforeInteractive:T,onAfterInteractive:C,onUnsupported:R,onTimeout:S});(0,u.useEffect)((function(){F||(X.current={onSuccess:g,onError:E,onExpire:Z,onBeforeInteractive:T,onAfterInteractive:C,onUnsupported:R,onTimeout:S})}));var ee=(null===n||void 0===n?void 0:n.id)||"cf-turnstile-script",re=b(ee),ne=(null===n||void 0===n?void 0:n.onLoadCallbackName)||"onloadTurnstileCallback",te=f.appearance||"always",oe=(0,u.useMemo)((function(){var e;return{sitekey:v,action:f.action,cData:f.cData,theme:f.theme||"auto",language:f.language||"auto",tabindex:f.tabIndex,"response-field":f.responseField,"response-field-name":f.responseFieldName,size:x(K),retry:f.retry||"auto","retry-interval":f.retryInterval||8e3,"refresh-expired":f.refreshExpired||"auto","refresh-timeout":f.refreshTimeout||"auto",execution:f.execution||"render",appearance:f.appearance||"always","feedback-enabled":null===(e=f.feedbackEnabled)||void 0===e||e,callback:function(e){var r,n;Y.current=!0,F?null===g||void 0===g||g(e):null===(r=(n=X.current).onSuccess)||void 0===r||r.call(n,e)},"error-callback":F?E:function(){for(var e,r,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];return null===(e=(r=X.current).onError)||void 0===e?void 0:e.call.apply(e,[r].concat(t))},"expired-callback":F?Z:function(){for(var e,r,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];return null===(e=(r=X.current).onExpire)||void 0===e?void 0:e.call.apply(e,[r].concat(t))},"before-interactive-callback":F?T:function(){for(var e,r,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];return null===(e=(r=X.current).onBeforeInteractive)||void 0===e?void 0:e.call.apply(e,[r].concat(t))},"after-interactive-callback":F?C:function(){for(var e,r,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];return null===(e=(r=X.current).onAfterInteractive)||void 0===e?void 0:e.call.apply(e,[r].concat(t))},"unsupported-callback":F?R:function(){for(var e,r,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];return null===(e=(r=X.current).onUnsupported)||void 0===e?void 0:e.call.apply(e,[r].concat(t))},"timeout-callback":F?S:function(){for(var e,r,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];return null===(e=(r=X.current).onTimeout)||void 0===e?void 0:e.call.apply(e,[r].concat(t))}}}),[f.action,f.appearance,f.cData,f.execution,f.language,f.refreshExpired,f.responseField,f.responseFieldName,f.retry,f.retryInterval,f.tabIndex,f.theme,f.feedbackEnabled,f.refreshTimeout,v,K,F,F?g
1:null,F?E:null,F?Z:null,F?T:null,F?C:null,F?R:null,F?S:null]),ae=(0,u.useCallback)((function(){return typeof window<"u"&&!!window.turnstile}),[]);return(0,u.useEffect)((function(){z&&!V&&(k(ne),h({onLoadCallbackName:ne,scriptOptions:(0,c.Z)((0,c.Z)({},n),{},{id:ee})}))}),[z,V,n,ee,ne]),(0,u.useEffect)((function(){"ready"!==y&&k(ne).then((function(){return H(!0)})).catch(console.error)}),[ne]),(0,u.useEffect)((function(){if(M.current&&V){var e=!1;return(0,o.Z)((0,t.Z)().mark((function r(){return(0,t.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e||!M.current||(J.current=window.turnstile.render(M.current,oe),J.current&&(null===m||void 0===m||m(J.current)));case 1:case"end":return r.stop()}}),r)})))(),function(){e=!0,J.current&&(window.turnstile.remove(J.current),Y.current=!1)}}}),[Q,V,oe]),(0,u.useImperativeHandle)(r,(function(){var e=window.turnstile;return{getResponse:function(){if(null!==e&&void 0!==e&&e.getResponse&&J.current&&ae())return e.getResponse(J.current);console.warn("Turnstile has not been loaded")},getResponsePromise:function(){var e=arguments;return(0,o.Z)((0,t.Z)().mark((function r(){var n,a;return(0,t.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.length>0&&void 0!==e[0]?e[0]:3e4,a=e.length>1&&void 0!==e[1]?e[1]:100,r.abrupt("return",new Promise((function(e,r){var c,i=function(){var u=(0,o.Z)((0,t.Z)().mark((function o(){var u;return(0,t.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(Y.current&&window.turnstile&&J.current)){t.next=9;break}return t.prev=1,u=window.turnstile.getResponse(J.current),t.abrupt("return",(c&&clearTimeout(c),u?e(u):r(Error("No response received"))));case 6:return t.prev=6,t.t0=t.catch(1),t.abrupt("return",(c&&clearTimeout(c),console.warn("Failed to get response",t.t0),r(Error("Failed to get response"))));case 9:return c||(c=setTimeout((function(){c&&clearTimeout(c),r(Error("Timeout"))}),n)),t.next=12,new Promise((function(e){return setTimeout(e,a)}));case 12:return t.next=14,i();case 14:case"end":return t.stop()}}),o,null,[[1,6]])})));return function(){return u.apply(this,arguments)}}();i()})));case 3:case"end":return r.stop()}}),r)})))()},reset:function(){if(null!==e&&void 0!==e&&e.reset&&J.current&&ae()){"execute"===f.execution&&q(w.invisible);try{Y.current=!1,e.reset(J.current)}catch(e){console.warn("Failed to reset Turnstile widget ".concat(J.current),e)}}else console.warn("Turnstile has not been loaded")},remove:function(){null!==e&&void 0!==e&&e.remove&&J.current&&ae()?(q(w.invisible),Y.current=!1,e.remove(J.current),J.current=null):console.warn("Turnstile has not been loaded")},render:function(){if(null!==e&&void 0!==e&&e.render&&M.current&&ae()&&!J.current){var r=e.render(M.current,oe);return J.current=r,J.current&&null!==m&&void 0!==m&&m(J.current),"execute"!==f.execution&&q(P()),r}console.warn("Turnstile has not been loaded or container not found")},execute:function(){"execute"===f.execution?null!==e&&void 0!==e&&e.execute&&M.current&&J.current&&ae()?(e.execute(M.current),q(P())):console.warn("Turnstile has not been loaded or container not found"):console.warn('Execution mode is not set to "execute"')},isExpired:function(){return null!==e&&void 0!==e&&e.isExpired&&J.current&&ae()?e.isExpired(J.current):(console.warn("Turnstile has not been loaded"),!1)}}}),[J,f.execution,K,oe,M,ae,V,m,P]),(0,u.useEffect)((function(){if(!V&&re){if(!window.turnstile){var e=setInterval((function(){window.turnstile&&(H(!0),clearInterval(e))}),50);return function(){clearInterval(e)}}H(!0)}}),[V,re]),(0,u.useEffect)((function(){q(P())}),[f.execution,K,te]),(0,u.useEffect)((function(){!re||"function"!=typeof A||A()}),[re]),(0,s.jsx)(p,(0,c.Z)({ref:M,as:L,id:Q,style:(0,c.Z)((0,c.Z)({},D),O)},U))}));E.displayName="Turnstile"}}]);
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.