PageSourceSearch

https://ipass.com.br/_next/static/chunks/pages/complementar-cadastro-a779f0ff063e3bb3.js

js ipass.com.br collected 2026-10-06 01:33:49 UTC 13,177 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[865],{1752:function(e,o,n){e.exports=n(8027)},6267:function(e,o,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/complementar-cadastro",function(){return n(5906)}])},5906:function(e,o,n){"use strict";n.r(o),n.d(o,{default:function(){return P}});var r=n(5893),t=n(1163),i=n(7294),a=n(8520),l=n.n(a),c=n(3122),s=n(4495),d=n(1403),u=n(6310),f=n(336),m=n(2686),p=n(7994),v=n(6005),h=n(9556),b=n(1157),g=n(1047);function x(e,o,n,r,t,i,a){try{var l=e[i](a),c=l.value}catch(s){return void n(s)}l.done?o(c):Promise.resolve(c).then(r,t)}function y(e){return function(){var o=this,n=arguments;return new Promise((function(r,t){var i=e.apply(o,n);function a(e){x(i,r,t,a,l,"next",e)}function l(e){x(i,r,t,a,l,"throw",e)}a(void 0)}))}}function j(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}function C(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(o){j(e,o,n[o])}))}return e}function k(e){return function(e){if(Array.isArray(e)){for(var o=0,n=new Array(e.length);o<e.length;o++)n[o]=e[o];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function w(e){var o=e.collapse,n=void 0!==o&&o,t=(0,i.useRef)(),a=(0,i.useContext)(f.V).buscarPessoa,x=(0,i.useState)(!1),j=x[0],w=x[1],I=(0,i.useState)(null),_=I[0],E=I[1],F=(0,i.useState)(null),N=F[0],S=F[1],Z=(0,i.useState)([]),T=Z[0],V=Z[1],z=(0,i.useState)(!1),O=z[0],P=z[1],R=(0,i.useState)(null),J=R[0],M=R[1],X=(0,i.useRef)(null),A=(0,i.useRef)(null),B=(0,i.useState)({}),D=B[0],Y=B[1],q=y(l().mark((function e(o){var n,r,i;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,E((function(){return null})),w((function(){return!0})),t.current.setErrors({}),n=C({},o),N&&(n.cidade=N.value),r=u.Ry().shape({cep:u.Z_().test("valid_cep","CEP inv\xe1lido",(function(e){return 8==e.length&&(0,d.cT)("".concat(e.substring(0,5),"-").concat(e.substring(5,8)))})).required("Campo obrigat\xf3rio"),logradouro:u.Z_().required("Campo obrigat\xf3rio"),numero:u.Z_().required("Campo obrigat\xf3rio"),bairro:u.Z_().required("Campo obrigat\xf3rio"),cidade:u.Z_().required("Campo obrigat\xf3rio")}),e.next=9,r.validate(n,{abortEarly:!1});case 9:return e.next=11,(0,p.y$)({zipCode:n.cep,street:n.logradouro,number:n.numero,neighborhood:n.bairro,city:n.cidade,complement:n.complemento,reference:n.referencia});case 11:return e.next=13,a();case 13:s.toast.notify("Endere\xe7o cadastrado com sucesso",{duration:5,type:"success",title:"Sucesso"}),w((function(){return!1})),e.next=22;break;case 17:e.prev=17,e.t0=e.catch(0),i={},l=e.t0,(null!=(c=u.p8)&&"undefined"!==typeof Symbol&&c[Symbol.hasInstance]?c[Symbol.hasInstance](l):l instanceof c)?(e.t0.inner.forEach((function(e){i[e.path]=e.message})),t.current.setErrors(i)):E((function(){return(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Ocorreu um erro"})),w((function(){return!1}));case 22:case"end":return e.stop()}var l,c}),e,null,[[0,17]])})));return(0,r.jsxs)(h.Z,{title:"Endere\xe7o",openedDefault:!n,arrowHidden:!n,children:[(0,r.jsxs)(c.l,{ref:t,onSubmit:q,children:[(0,r.jsxs)("div",{style:{position:"relative"},children:[(0,r.jsx)(b.Z,{id:"dec-cep",mask:"cep",name:"cep",placeholder:"CEP",label:"CEP",size:22,color:"#313131",onChange:function(e){try{var o,n,r=(null===e||void 0===e||null===(o=e.target)||void 0===o?void 0:o.value)||"",i=String(r).replace(/\D/g,"").slice(0,8);if(X.current&&clearTimeout(X.current),A.current!==i)S(null),Y({}),(null===t||void 0===t||null===(n=t.current)||void 0===n?void 0:n.setFieldValue)&&(t.current.setFieldValue("logradouro",""),t.current.setFieldValue("bairro",""),t.current.setFieldValue("complemento",""),t.current.setFieldValue("cidade",""));if(8!==i.length)return P(!1),void M(null);P(!0),M(null),X.current=setTimeout(y(l().mark((function e(){var o,n,r,a,c,s;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,i&&(0,d.cT)("".concat(i.substring(0,5),"-").concat(i.substring(5,8)))){e.next=4;break}return M("CEP inv\xe1lido"),e.abrupt("return");case 4:return A.current!==i&&(t.current.setFieldValue("numero",""),t.current.setFieldValue("complemento",""),t.current.setFieldValue("referencia",""),S(null),A.current=i),e.next=7,(0,m.NB)(i);case 7:o=e.sent,n={},(null===o||void 0===o?void 0:o.logradouro)&&(t.current.setFieldValue("logradouro",o.logradouro),n.logradouro=!0),(null===o||void 0===o?void 0:o.bairro)&&(t.current.setFieldValue("bairro",o.bairro),n.bairro=!0),(null===o||void 0===o?void 0:o.complemento)&&(t.current.setFieldValue("complemento",o.complemento),n.complemento=!0),Y(n),(null===o||void 0===o?void 0:o.logradouro)&&t.current.setFieldValue("logradouro",o.logradouro),(null===o||void 0===o?void 0:o.bairro)&&t.current.setFieldValue("bairro",o.bairro),(null===o||void 0===o?void 0:o.complemento)&&t.current.setFieldValue("complemento",o.complemento),(null===o||void 0===o?void 0:o.cidade_id)&&(null===o||void 0===o?void 0:o.cidade_nome)&&(null===o||void 0===o?void 0:o.estado_sigla)?(a={value:o.cidade_id,label:"".concat(o.cidade_nome," / ").concat(o.estado_sigla)},T.some((function(e){return e.value===a.value}))||V((function(e){return[a].concat(k(e))})),S(a),(null===t||void 0===t||null===(r=t.current)||void 0===r?void 0:r.setFieldValue)&&t.current.setFieldValue("cidade",a.value),Y((function(e){return C({},e,{cidade:!0})}))):(S(null),(null===t||void 0===t||null===(c=t.current)||void 0===c?void 0:c.setFieldValue)&&t.current.setFieldValue("cidade","")),M(null),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(0),M((null===e.t0||void 0===e.t0||null===(s=e.t0.data)||void 0===s?void 0:s.message)||"N\xe3o foi poss\xedvel buscar o CEP");case 24:return e.prev=24,P(!1),e.finish(24);case 27:case"end":return e.stop()}}),e,null,[[0,20,24,27]])}))),400)}catch(a){P(!1),M("N\xe3o foi poss\xedvel buscar o CEP")}},style:J?{borderColor:"#ff6b6b"}:O?{borderColor:"#339af0"}:void 0}),(0,r.jsx)("div",{style:{fontSize:"14px",fontWeight:"500",marginTop:"4px",minHeight:18},children:J?(0,r.jsx)("span",{style:{color:"#ff6b6b"},children:J}):O?(0,r.jsx)("span",{style:{color:"#339af0"},children:"Buscando..."}):(0,r.jsx)("span",{style:{visibility:"hidden"},children:"Buscando..."})})]}),(0,r.jsxs)(g.X,{children:[(0,r.jsx)(g.J,{md:8,sm:12,children:(0,r.jsx)(b.Z,{id:"dec-logradouro",name:"logradouro",placeholder:"Logradouro",label:"Logradouro",size:22,color:"#313131",disabled:D.logradouro})}),(0,r.jsx)(g.J,{md:4,sm:12,children:(0,r.jsx)(b.Z,{id:"dec-numero",name:"numero",placeholder:"N\xfamero",label:"N\xfamero",size:22,color:"#313131"})})]}),(0,r.jsxs)(g.X,{children:[(0,r.jsx)(g.J,{md:6,sm:12,children:(0,r.jsx)(b.Z,{id:"dec-bairro",name:"bairro",placeholder:"Bairro",label:"Bairro",size:22,color:"#313131",disabled:D.bairro})}),(0,r.jsx)(g.J,{md:6,sm:12,children:(0,r.jsx)(b.Z,{id:"dec-complemento",name:"complemento",placeholder:"Complemento",label:"Complemento",size:22,color:"#313131",disabled:D.complemento})})]}),(0,r.jsx)(g.X,{children:(0,r.jsx)(g.J,{md:12,sm:12,children:(0,r.jsx)(b.Z,{id:"dec-cidade",type:"select",name:"cidade",options:T,placeholder:"Cidade",label:"Cidade",size:22,color:"#313131",value:N||void 0,onChange:function(e){return S(e)},noOptionsText:"Digite o CEP para buscar a cidade",isDisabled:!0})})}),(0,r.jsx)(g.X,{children:(0,r.jsx)(g.J,{md:12,sm:12,children:(0,r.jsx)(b.Z,{id:"dec-referencia",name:"referencia",placeholder:"Refer\xeancia",label:"Refer\xeancia",size:22,color:"#313131"})})})]}),(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginTop:20},children:[(0,r.jsx)("div",{children:_&&(0,r.jsx)("p",{style:{fontWeight:"300",color:"tomato",fontSize:16},children:_})}),(0,r.jsx)(v.Z,{id:"dec-submit",backgroundColor:"#02ab89",color:"#ffffff",onClick:function(){return t.current.submitForm(
1)},loading:j,disabled:j,children:"Avan\xe7ar"})]})]})}var I=n(5048),_=n(5912),E=n(2583),F=n(1436),N=n(1752),S=(n(5544),n(3419));function Z(e){var o=e.checkoutToken,n=e.sessionToken,t=e.onClose,a=(e.label,e.isDisabled,e.style,(0,N.default)()),l=(a.serverRuntimeConfig,a.publicRuntimeConfig,(0,i.useContext)(f.V).pessoa),c=(0,i.useState)(!1),s=c[0],d=c[1];(0,i.useEffect)((function(){if(!s){var e,o="id-".concat(n),r=document.getElementById(o);null===r||void 0===r||null===(e=r.parentNode)||void 0===e||e.removeChild(r),t&&t()}}),[s]);var u=(0,i.useCallback)((function(){var e=null===l||void 0===l?void 0:l.faceURL,o=document.createElement("div");o.id="load-lightbox-checkout",o.innerHTML="Carregando...",o.style.cssText="position:fixed;top:0;z-index:998;left:0;width:100%;height:100%;background:rgba(4, 173, 138, 0.6);display:flex;justify-content:center;align-items:center;color:#FFF;font-size:32px;font-weight:600;",document.body.appendChild(o);var r=document.createElement("iframe"),t="id-".concat(n);r.src=e,r.id=t,r.style.cssText="position:fixed;z-index:999;top:0;left:0;right:0;bottom:0;border:0;width:100%;height:100%;",r.onload=function(){var e=document.getElementById("load-lightbox-checkout");e&&document.body.removeChild(e)},document.body.appendChild(r),window.onmessage=function(e){try{var o=JSON.parse((null===e||void 0===e?void 0:e.data)||"{}")||{};if(null===o||void 0===o?void 0:o.action)if("close-lightbox-checkout"===o.action&&!0===o.value){var n,r=document.getElementById(t);null===r||void 0===r||null===(n=r.parentNode)||void 0===n||n.removeChild(r),o.href&&window.open(o.href,"_blank").focus()}else"ipass-lightbox-session"===o.action&&(document.cookie="token=".concat(o.value))}catch(i){}},d(!0)}),[o,n]);return(0,r.jsxs)(r.Fragment,{children:[s&&(0,r.jsx)("div",{style:{width:50,height:50,zIndex:1e7,position:"absolute",top:20,right:40,cursor:"pointer"},onClick:function(){return d(!1)},children:(0,r.jsx)(S.Z,{icon:F.NBC,color:"white",size:36})}),(0,r.jsx)(v.Z,{backgroundColor:"#02ab89",color:"#ffffff",style:{fontSize:24},onClick:u,children:"Cadastar minha face"})]})}function T(){var e=(0,i.useContext)(f.V),o=e.tokenAuth,n=e.buscarPessoa;return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,r.jsx)("p",{style:{textAlign:"center",fontSize:24,marginTop:30,marginBottom:30},children:"Para acessar \u201cMinha \xe1rea\u201d fa\xe7a seu cadastro de reconhecimento facial, nossa nova forma de valida\xe7\xe3o de ingressos"}),(0,r.jsx)(Z,{sessionToken:o,isDisabled:!1,label:"Cadastar",style:{opacity:0,height:0},onClose:n})]})}var V=n(9074),z=n(9816),O=n.n(z);function P(){var e=(0,t.useRouter)(),o=(0,i.useContext)(f.V),n=o.pessoa,a=o.loadingPessoa,l=(0,i.useState)(null),c=l[0],s=l[1];(0,i.useEffect)((function(){d()}),[a]),(0,i.useEffect)((function(){n&&d()}),[n]);var d=function(){var o,r,t,i;a||(n&&1==(null===n||void 0===n||null===(o=n.endereco)||void 0===o?void 0:o.status)&&1==(null===n||void 0===n||null===(r=n.telefone)||void 0===r?void 0:r.status)&&!(null===n||void 0===n?void 0:n.faceURL)?e.push("/minha-area/dados-pessoais"):n?n.endereco&&1==(null===n||void 0===n||null===(t=n.endereco)||void 0===t?void 0:t.status)?n.telefone&&1==(null===n||void 0===n||null===(i=n.telefone)||void 0===i?void 0:i.status)?n.faceURL&&s("reconhecimento"):s("telefone"):s("endereco"):s("dados-pessoais"))};return(0,r.jsx)(V.Z,{header:{backgroundColor:"#02ab89"},title:"Complementar Cadastro",children:(0,r.jsx)("div",{className:O().container,children:(0,r.jsxs)("div",{className:O().main,children:[!c&&(0,r.jsx)(E.Z,{}),"dados-pessoais"==c&&(0,r.jsx)(I.Z,{}),"endereco"==c&&(0,r.jsx)(w,{}),"telefone"==c&&(0,r.jsx)(_.Z,{}),"reconhecimento"==c&&(0,r.jsx)(T,{})]})})})}},5544:function(e,o,n){"use strict";n.d(o,{r:function(){return i}});var r=n(7066),t=n(4155),i="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJpcGFzcyIsImludGVncmFjYW9faWQiOiIxNTc0YmRkYjc1Yzc4YTZmZDIyNTFkNjFlMjk5M2I1MTQ2MjAxMzE5IiwiaWF0IjoxNjE0NzA2MDE1fQ.RqWSS2AXc7ryhFMeXsSrY03mN4ny1Qo4vGj7qCNf8nw",a=t.env.NEXT_PUBLIC_API_TOKEN,l=r.Z.create({baseURL:"https://api.ipass.com.br",params:{token:i},headers:{"x-api-token":a}});l.interceptors.request.use((function(e){if("string"===typeof e.url&&e.url.includes("/v1/")&&(e.baseURL="https://api-produtor.ipass.com.br/",e.headers["x-access-token"]="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJpcGFzcyIsImludGVncmFjYW9faWQiOiIxZjBlM2RhZDk5OTA4MzQ1Zjc0MzlmOGZmYWJkZmZjNCIsImlhdCI6MTYxNDcwNjAxNX0.g_YY8TGYKPH-rvYLTt8-Xg96VRurEdIQb-RcCXqq2BU"),window.localStorage){var o=window.localStorage.getItem("x-access-token");e.headers["x-access-token"]=o}return e})),l.interceptors.response.use((function(e){return e}),(function(e){throw e.response}))},9816:function(e){e.exports={container:"ComplementarCadastro_container__dGvE8",main:"ComplementarCadastro_main__0Xt_t"}}},function(e){e.O(0,[885,112,488,403,74,954,741,774,888,179],(function(){return o=6267,e(e.s=o);var o}));var o=e.O();_N_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.