1"use strict";(self.webpackChunkcomfama_portalservicios_archetype=self.webpackChunkcomfama_portalservicios_archetype||[]).push([[1433],{68315:function(e,a,t){t.d(a,{A:function(){return v}});var o=t(96540),n=t(64810),i=t(4240),s=t(45871),l=t(19871),r=t(29390),c=t(74848);var d=()=>{const e=(0,n.useStaticQuery)("8872584"),[a,t]=(0,o.useState)(5),[d,u]=(0,o.useState)(!1),{isBrowser:m,localStorage:v}=(0,l.A)(),g=e.allContentfulTemplate.nodes[0],p={renderNode:{[s.BLOCKS.PARAGRAPH]:(e,a)=>(0,c.jsx)("p",{children:a}),[s.BLOCKS.HEADING_1]:(e,a)=>(0,c.jsx)("h1",{children:a})}},f=(0,o.useCallback)(()=>setInterval(()=>{a>0?t(a-1):u(!0)},1e3),[a]);return(0,o.useEffect)(()=>{const e=f();return 0===a&&(u(!0),clearInterval(e),(()=>{var e,a;const t=null===(e=v.getItem("CURRENT_TAB"))||void 0===e?void 0:e.toString(),o=null===(a=window)||void 0===a?void 0:a.location.hostname;window.location.href="empresas"===t?"localhost"===o?"/empresas":"/portal-servicios/empresas":"localhost"===o?"/personas":"/portal-servicios/personas"})()),()=>{clearInterval(e)}},[d,a]),(0,c.jsx)(c.Fragment,{children:m&&(0,c.jsxs)("section",{className:"o-head404",children:[(0,c.jsxs)("article",{className:"o-head404__container",children:[g.tituloEnriquecido&&(0,i.i)(JSON.parse(g.tituloEnriquecido.raw),p),(0,c.jsxs)("p",{children:["Seras Redirigido a la pagina inicial en: ",a," Segundos"]})]}),(0,c.jsx)("figure",{className:"o-head404__cover",children:(0,c.jsx)("img",{loading:"lazy",className:"o-head404__cover__img",src:g.imagen[0]&&(0,r.s)(g.imagen[0]),alt:g.imagen[0].title})})]})})},u=t(92490),m=t(59039);var v=({data:e,children:a,hasLoader:t,isPrivate:o,hideSide:n,sideMenu:i,isMain:s,isActive:l,serviceId:r})=>{var v;const{metaTitulo:g,metaDescripcion:p,metaImagen:f,noIndex:h,urlCanonical:A}=e;return(0,c.jsx)(u.A,{hasLoader:t,isPrivate:o,hideSide:n,sideMenu:i,isMain:s,serviceId:r,children:l?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(m.A,{title:g,description:p,image:null==f||null===(v=f.file)||void 0===v?void 0:v.url,noIndex:h,urlCanonical:A,noCanonical:!1,lang:"es"}),a]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(m.A,{title:"Pagina no encontrada",noIndex:!0}),(0,c.jsx)(d,{})]})})}},74394:function(e,a,t){t.r(a),t.d(a,{default:function(){return N}});var o=t(96540),n=t(20320),i=t(1038),s=t(37048),l=t(64691),r=t(44460),c=t(54460),d=t(5290),u=t(19871),m=t(48596),v=t(18395),g=t(88767),p=t(17325),f=t(98839),h=t(9613),A=t(6515),x=t(99996),y=t(62514),b=t(74848);var j=e=>{const{contentInfo:a}=e,[t,j]=(0,o.useState)(""),[C,S]=(0,o.useState)(""),[N,_]=(0,o.useState)([]),[I,P]=(0,o.useState)(!1),[M,T]=(0,o.useState)(!1),[D,E]=(0,o.useState)(!1),[w,L]=(0,o.useState)(!1),[B,F]=(0,o.useState)(!1),[R,k]=(0,o.useState)(!1),[$,H]=(0,o.useState)(!1),[q,G]=(0,o.useState)(!1),{business:O,checkPermissionPage:J,userInfoContext:Q,gigyaContext:U}=(0,o.useContext)(l.A),{localStorage:K,window:V}=(0,u.A)();(0,o.useEffect)(()=>{var e;null==J||J.set(null!==(e=null==a?void 0:a.serviceId)&&void 0!==e?e:null)},[null==a?void 0:a.serviceId]);return(0,o.useEffect)(()=>{U.gigyaAccount||F(!0),null!=O&&O.get||!U.gigyaAccount||k(!0)},[]),(0,o.useEffect)(()=>{(0,s.Q)(a.referencias[0].lista,_)},[]),(0,b.jsx)(b.Fragment,{children:B?(0,b.jsx)(y.A,{}):(0,b.jsxs)("div",{className:"o-collaborator-pac-credential",children:[(0,b.jsx)(g.A,{content:a.migaDePan}),(0,b.jsx)("h1",{className:"o-collaborator-pac-credential__title",children:a.nombre}),(0,b.jsxs)("div",{className:"o-collaborator-pac-credential__content",children:[(0,b.jsx)(n.A,{image:a.imagen[0],content:a.descripcion}),(0,b.jsxs)("div",{className:"form-pac-credential-collaborator",children:[(0,b.jsx)("h3",{className:"form-pac-credential-collaborator__sub type-doc",children:a.referencias[0].nombre}),(0,b.jsx)(f.A,{typeDocument:C,setTypeDocument:S,placeHolder:a.referencias[0].subtitulo?a.referencias[0].subtitulo:a.referencias[0].nombre,options:N}),(0,b.jsx)("h3",{className:"form-pac-credential-collaborator__sub num-doc",children:a.referencias[1].nombre}),(0,b.jsx)(h.A,{required:!0,type:"number",placeHolder:a.referencias[0].subtitulo?a.referencias[0].subtitulo:a.referencias[0].nombre,value:t,setValue:j,errorValue:M}),(0,b.jsxs)("div",{className:"form-pac-credential-collaborator__btn",children:[(0,b.jsx)(p.A,{type:"button",classname:"secondary btn-certificate",text:a.referencias[2].copyBoton,isDisabled:!1,onClickAction:()=>
1{if(U.gigyaAccount&&null!=O&&O.get)if(L(!0),""!==t&&""!==C&&null!=O&&O.get){var e,o,n;const i=v.filter(e=>{var a;return e.typaDocSAP===(null==O||null===(a=O.get)||void 0===a?void 0:a.companyDocType)})[0].id,s=(null==O||null===(e=O.get)||void 0===e?void 0:e.companyDocID)+("CO1N"===(null==O||null===(o=O.get)||void 0===o?void 0:o.companyDocType)?(0,c.A)(String(null==O||null===(n=O.get)||void 0===n?void 0:n.companyDocID)):"");(0,d.uJ)(t,C,s,i).then(e=>{var t,o,n,i,s;(L(!1),null!=U&&U.gigyaAccount)&&(0,r.A)(`${null==U||null===(t=U.gigyaAccount)||void 0===t?void 0:t.profile.firstName} ${U.gigyaAccount.data.secondName?`${U.gigyaAccount.data.secondName} `:""}${U.gigyaAccount.profile.lastName}${U.gigyaAccount.data.secondLastName?` ${U.gigyaAccount.data.secondLastName}`:""}`,null==U||null===(o=U.gigyaAccount)||void 0===o?void 0:o.data.docNumber,null==U||null===(n=U.gigyaAccount)||void 0===n?void 0:n.data.docType,null==U||null===(i=U.gigyaAccount)||void 0===i?void 0:i.profile.email,"click",`CertificadosYConsultas :: ${(0,m.Hn)(a.nombre)} :: } ${a.referencias?a.referencias[2].copyBoton:"GenerarCertificado"}`,null===(s=Q.data)||void 0===s?void 0:s.userJwt);200===e.data.status?e.data.data.certificadoB64&&(V.dataLayer=V.dataLayer||[],V.dataLayer.push({event:"pushEventGA",category:"personas"===K.getItem("CURRENT_TAB")?"HomePersonas":"HomeEmpresas",action:"ClicCertificado",label:"Carnet de afiliacion para trabajador"}),G((0,b.jsx)(x.A,{base64:e.data.data.certificadoB64,setActiveModal:G,selectedFileName:"Carnet de afiliación colaborador",setActiveToast:P}))):400===e.data.status?E((0,b.jsx)(A.A,{title:"¡Ups! No encontramos una coincidencia",subtitle:"Por favor, revise los datos ingresados y la empresa con la que inició sesión e inténtelo de nuevo.",closeModal:()=>E(!1),isMobile:!0,buttonCopy:"ACEPTAR"})):E((0,b.jsx)(A.A,{closeModal:()=>E(!1),isMobile:!0,buttonCopy:"ACEPTAR"}))}).catch(e=>{console.log(e),L(!1),E((0,b.jsx)(A.A,{closeModal:()=>E(!1),isMobile:!0}))})}else T(""===t);else U.gigyaAccount||F(!0),null!=O&&O.get||k(!0)},loader:w}),!(null!=O&&O.get)&&(0,b.jsx)("p",{className:"o-form-and-note-template__error",children:"* debes elegir una empresa en el menú"})]})]})]}),D&&(0,b.jsx)(b.Fragment,{children:D}),I&&(0,b.jsx)(b.Fragment,{children:I}),q&&(0,b.jsx)(b.Fragment,{children:q}),R&&(0,b.jsx)(i.A,{closeModal:()=>k(!1),isMobile:!0,setShowConfirmation:H,isPrivate:!1,closeModalPermissionPage:()=>k(!1),serviceId:a.serviceId}),$&&(0,b.jsx)(b.Fragment,{children:$})]})})},C=t(64810),S=t(68315);var N=()=>{var e;const a=(0,C.useStaticQuery)("3241660506"),t=null==a||null===(e=a.allContentfulTemplate)||void 0===e?void 0:e.nodes[0],o=null==t?void 0:t.metaInfo[0],n=null==t?void 0:t.serviceId;return(0,b.jsx)(S.A,{data:o,hasLoader:!0,isPrivate:!1,isActive:t.estaActivo,serviceId:n,children:(0,b.jsx)(j,{contentInfo:t})})}}}]); 2//# sourceMappingURL=component---src-pages-empresas-certificados-carnet-de-afiliacion-pac-tsx-0684cb58857b16fb8b73.js.map
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.