(this.webpackJsonpcertika=this.webpackJsonpcertika||[]).push([[0],{10:function(e,t,a){"use strict";a.d(t,"h",(function(){return d})),a.d(t,"i",(function(){return u})),a.d(t,"b",(function(){return m})),a.d(t,"d",(function(){return b})),a.d(t,"a",(function(){return p})),a.d(t,"c",(function(){return j})),a.d(t,"l",(function(){return f})),a.d(t,"q",(function(){return h})),a.d(t,"n",(function(){return g})),a.d(t,"k",(function(){return x})),a.d(t,"o",(function(){return O})),a.d(t,"m",(function(){return v})),a.d(t,"A",(function(){return _})),a.d(t,"v",(function(){return y})),a.d(t,"B",(function(){return w})),a.d(t,"p",(function(){return C})),a.d(t,"u",(function(){return k})),a.d(t,"y",(function(){return N})),a.d(t,"t",(function(){return B})),a.d(t,"w",(function(){return S})),a.d(t,"C",(function(){return T})),a.d(t,"D",(function(){return A})),a.d(t,"z",(function(){return E})),a.d(t,"r",(function(){return I})),a.d(t,"H",(function(){return D})),a.d(t,"F",(function(){return z})),a.d(t,"G",(function(){return P})),a.d(t,"x",(function(){return R})),a.d(t,"s",(function(){return M})),a.d(t,"E",(function(){return L})),a.d(t,"I",(function(){return F})),a.d(t,"j",(function(){return U})),a.d(t,"g",(function(){return W})),a.d(t,"f",(function(){return q})),a.d(t,"J",(function(){return H})),a.d(t,"e",(function(){return K}));var n=a(4),i=a(9),r=a(32),c=a.n(r),o=a(1034),s=a(20),l=new o.a("logout"),d=function(e){return{type:"LOGIN_REQUEST",payload:e}},u=function(e){return{type:"LOGOUT_REQUEST",payload:e}},m=function(e){return{type:"PAGE",payload:e}},b=function(e){return{type:"ROWS_PER_PAGE",payload:e}},p=function(e){return{type:"BREADCRUMP",payload:e}},j=function(e){return{type:"PERMISSION",payload:e}},f=function(e){return{type:"BADGES",payload:e}},h=function(e){return{type:"CERTIFICATES",payload:e}},g=function(e){return{type:"CARNETS",payload:e}},x=function(e){return{type:"BADGE",payload:e}},O=function(e){return{type:"CERTIFICATE",payload:e}},v=function(e){return{type:"CARNET",payload:e}},_=function(e){return{type:"LOADING",payload:e}},y=function(e){return{type:"ERROR",payload:e}},w=function(e){return{type:"ORGANIZATION_ID",payload:e}},C=function(e){return{type:"CERTIFICATE_FIELDS",payload:e}},k=function(e){return{type:"DOCUMENTS_FIELDS",payload:e}},N=function(e){return{type:"FORM_DOCUMENTS",payload:e}},B=function(e){return{type:"DOCUMENT",payload:e}},S=function(e){return{type:"FORM",payload:e}},T=function(e){return{type:"RETURN_ROUTE",payload:e}},A=function(e){return{type:"SAVE_DESIGN",payload:e}},E=function(e){return{type:"LENGUAGE",payload:e}},I=function(e){return{type:"DETAILS",payload:e}},D=function(e){return{type:"STYLES",payload:e}},z=function(e){return{type:"SIGNATORIESINGUP",payload:e}},P=function(e){return{type:"SIGNED_DOCUMENTS",payload:e}},R=function(e){return{type:"FORM_DIPLOMAS",payload:e}},M=function(e){return{type:"DIPLOMA_FIELDS",payload:e}},L=function(e){return{type:"SEARCH_VALUE",payload:e}},F=function(e){return{type:"VIEW",payload:e}},U=function(e){return{type:"ACTIVE",payload:e}},W=function(e,t){return function(a){a(y(null)),a(_(!0)),Object(i.a)({url:"/user/sign-in",method:"post",auth:{username:e.correo,password:e.password}}).then((function(e){var n,r,c=e.data,o=null===(n=c.data_user)||void 0===n?void 0:n.gruposUsuariosOrganizaciones[0].id_grupos_usuarios;if(1!==o&&3!==o&&window.location.origin===s.a.mincienciasURL&&(null===(r=c.data_user)||void 0===r?void 0:r.gruposUsuariosOrganizaciones[0].id_organizaciones)!==s.a.idMinciencias)return a(y("Usuario no autorizado"));a(d(c)),1===o&&(t="/templates/published"),i.a.post("/permission/getPermissions").then((function(e){var t=e.data;return a(j(t.permissions.permissions))})).then((function(){return a(_(!1))})).then((function(){window.location.href=t,l.postMessage("IniciaSesi\xf3n")})).catch((function(e){a(_(!1)),a(y(e)),t="/500",window.location.href=t}))})).catch((function(e){a(_(!1)),a(y(e))}))}};function Y(e,t,a){if(a.includes(".")){var n="",i="",r="",c=a.split(".");if(c.length>2){n=c[2];var o=t[c[0]],s=e[c[0]];i=o[c[1]],r=s[c[1]]}else n=c[1],i=t[c[0]],r=e[c[0]];return"".concat(i[n]).toLowerCase()<"".concat(r[n]).toLowerCase()?-1:"".concat(i[n]).toLowerCase()>"".concat(r[n]).toLowerCase()?1:0}if(t[a],"number"===typeof e[a]){if(t[a]<e[a])return-1;if(t[a]>e[a])return 1}else{if("".concat(t[a]).toLowerCase()<"".concat(e[a]).toLowerCase())return-1;if("".concat(t[a]).toLowerCase()>"".concat(e[a]).toLowerCase())return 1}return 0}function q(e,t){return"desc"===e?function(e,a){return Y(e,a,t)}:function(e,a){return-Y(e,a,t)}}function H(e,t){var a=e.map((function(e,t){return[e,t]}));return a.sort((function(e,a){var n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((function(e){return e[0]}))}var K=function(e){return function(t){c()({url:"".concat(s.a.apiURL,"/organization/backoffice/").concat(e),method:"get"}).then((function(a){t(D(Object(n.a)(Object(n.a)({},a.data.organization.styles),{},{organizationName:"".concat(e===s.a.idMinciencias?"Minciencias":"Certika")})))}))}}},1013:function(e,t,a){"use strict";a.r(t);var n=a(0),i=a(1),r=a.n(i),c=a(61),o=a.n(c),s=(a(700),a(701),a(15)),l=a(28),d=a(3),u=a(87),m=a(4),b=a(11),p=a(14),j=a(2),f=a.n(j),h=a(6),g=a(654),x=a(180),O=a(1112),v=a(1108),_=a(1113),y=a(415),w=a(644),C=a(315),k=a(1030),N=a(544),B=a.n(N),S=a(1018),T=a(648),A=a(1102),E=a(5),I=a(10),D=a(651);var z=function(e){return e.replace(/\s+/g," ").trim().split(" ").map((function(e){return"".concat(e[0].toUpperCase()).concat(e.slice(1).toLowerCase())})).join(" ").trim()};var P=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"space-between",margin:"10px 2.5%",padding:"0 2% 8px 2%"},container__buttons:{display:"flex",justifyContent:"space-between",width:function(e){return e.user?600:400},"& button":Object(b.a)({border:"none",borderRadius:8,padding:"2px 10px"},e.breakpoints.up("sm"),{padding:"2px 20px"}),"& button:focus":{outlineStyle:"none"}},container__buttons_inactive:{backgroundColor:"transparent"},container__buttons_active:{backgroundColor:e.palette.tertiary.main},container__search:Object(b.a)({display:"flex",justifyContent:"flex-end",alignItems:"center",width:"100vw","& input":{width:"100%",borderRadius:8,border:"1px solid ".concat(e.palette.tertiary.main),paddingLeft:"14px",backgroundColor:e.palette.tertiary.main},"& input:focus":{outlineStyle:"none"}},e.breakpoints.up("sm"),{width:"30vw"}),container__search_icon:{position:"absolute",color:E.a.primary,"&:hover":{backgroundColor:"transparent"}},container__subbar:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"10px 2.5%",borderBottom:"2px solid #bfbfbf",padding:"0 2% 8px 2%","& p":{marginBottom:0},"& span":{fontWeight:"bold"}},container__subbar_orderby:Object(b.a)({display:"none",alignItems:"center"},e.breakpoints.up("sm"),{display:"flex"}),container__subbar_orderby_label:{marginRight:15},container__subbar_orderby_select:{"&:focus":{outlineStyle:"none"},"&:hover:before":{borderBottom:"none !important"},"&:before":{borderBottom:"none !important"},"&:after":{borderBottom:"none !important"}}}})),R={setBadges:I.l,setCarnets:I.n,setCertificates:I.q,setSignedDocuments:I.G,setActive:I.j},M=Object(s.b)((function(e){return{badges:e.badges||[],certificates:e.certificates||[],carnets:e.carnets||[],signedDocuments:e.signedDocuments||[],user:e.user,active:e.active}}),R)((function(e){var t=e.badges,a=e.certificates,r=e.carnets,c=e.signedDocuments,o=e.handleSearch,s=e.setBadges,l=e.setCertificates,u=e.setCarnets,m=e.setSignedDocuments,b=e.orderBy,p=void 0===b||b,j=e.setView,f=e.view,h=e.organization,g=void 0!==h&&h,x=e.user,O=e.active,v=e.setActive,_=P({user:x}),y=Object(D.a)(["dashboard","search"]),w=Object(d.a)(y,1)[0];Object(i.useEffect)((function(){v(0===f?"insignias":1===f?"certificados":2===f?"carnets":"documentos")}),[f]);var C=function(e){v(e.target.name),"insignias"===e.target.name?j(0):"certificados"===e.target.name?j(1):"carnets"===e.target.name?j(2):"documentos"===e.target.name&&j(3)};return Object(n.jsxs)("div",{children:[Object(n.jsxs)("div",{className:_.container,children:[Object(n.jsx)("div",{className:_.container__buttons}),Object(n.jsxs)("div",{className:_.container__search,children:[Object(n.jsx)("input",{name:"search",type:"text",placeholder:w("search:search.search"),onChange:o}),Object(n.jsx)(S.a,{"aria-label":"search",className:_.container__search_icon,children:Object(n.jsx)(A.a,{})})]})]}),Object(n.jsxs)("div",{className:_.container__subbar,children:[Object(n.jsxs)("div",{className:_.container__buttons,children:[Object(n.jsxs)("button",{name:"insignias",className:"insignias"===O?_.container__buttons_active:_.container__buttons_inactive,onClick:C,children:[Object(n.jsx)("b",{children:t.length})," ",z(w("dashboard:badges"))]}),Object(n.jsxs)("button",{name:"certificados",className:"certificados"===O?_.container__buttons_active:_.container__buttons_inactive,onClick:C,children:[Object(n.jsx)("b",{children:a.length})," ",z(w("dashboard:certificates"))]}),!0!==g?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)("button",{name:"carnets",className:"carnets"===O?_.container__buttons_active:_.container__buttons_inactive,onClick:C,children:[Object(n.jsx)("b",{children:r.length})," ",z(w("dashboard:carnets"))]})}):"",!0!==g&&x?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)("button",{name:"documentos",className:"documentos"===O?_.container__buttons_active:_.container__buttons_inactive,onClick:C,children:[Object(n.jsx)("b",{children:c.length})," ",z(w("dashboard:signedDocuments"))]})}):""]}),p&&Object(n.jsxs)("div",{className:_.container__subbar_orderby,children:[Object(n.jsx)("p",{className:_.container__subbar_orderby_label,children:w("dashboard:order-by")}),Object(n.jsxs)(T.a,{native:!0,inputProps:{name:"orderBy",id:"orderBy"},className:_.container__subbar_orderby_select,onChange:function(e){"date"===e.target.value&&(s(t.sort((function(e,t){return e.insigniasEmitidas.fecha_emision>t.insigniasEmitidas.fecha_emision?-1:1}))),l(a.sort((function(e,t){return e.certificadosEmitidos.fecha_emision>t.certificadosEmitidos.fecha_emision?-1:1}))),u(r.sort((function(e,t){return e.carnetsEmitidos.fecha_emision>t.carnetsEmitidos.fecha_emision?-1:1}))),m(c.sort((function(e,t){return e.documentosEmitidos.fecha_emision>t.documentosEmitidos.fecha_emision?-1:1})))),"popular"===e.target.value&&(s(t.sort((function(e,t){return e.insigniasEmitidas.popular<t.insigniasEmitidas.popular?-1:1}))),l(a.sort((function(e,t){return e.certificadosEmitidos.popular<t.certificadosEmitidos.popular?-1:1}))),u(r.sort((function(e,t){return e.carnetsEmitidos.popular<t.carnetsEmitidos.popular?-1:1}))),m(c.sort((function(e,t){return e.documentosEmitidos.popular>t.documentosEmitidos.popular?-1:1}))))},children:[Object(n.jsx)("option",{value:"date",children:w("dashboard:most-recent")}),Object(n.jsx)("option",{value:"popular",children:w("dashboard:most-popular")})]})]})]})]})})),L=a(8),F=a.n(L),U=a(633),W=a(641),Y=a(337),q=a(1139),H=a(1119),K=a(1110),V=a(1143),G=a(1133),Q=a(1134),J=a(1135),X=a(1136),Z=a(1137),$=a(1138),ee=a(1140),te=a(1141),ae=a(1109),ne=a(1142),ie=a(334),re=a(1126),ce=a(338),oe=a(1121),se=a(1122),le=a(1124),de=a(1127),ue=a(1123),me=a(1128),be=a(1129),pe=a(1130),je=a(20),fe=a(1252),he=Object(C.a)((function(e){return{chip:{backgroundColor:E.a.primary,color:"white",fontSize:"1em",display:"flex",justifyContent:"center",marginTop:"1em",flexWrap:"wrap","& > *":{margin:e.spacing(.5)}}}})),ge=function(){var e=he(),t=Object(D.a)(["dialogs"]),a=Object(d.a)(t,1)[0];return Object(n.jsx)(fe.a,{label:a("dialogs:dialog.version"),className:e.chip})},xe=a(23),Oe=a(1117),ve=a(642),_e=a(643),ye=a(86),we=a(100),Ce=a(9),ke=a(19),Ne=a.n(ke),Be=a(1114),Se=a(126),Te=a(653),Ae=a(1116),Ee=a(1253),Ie=a(13),De=function(e){var t=e.formData,a=void 0===t?null:t,i=e.action,r=e.location;if(!a)return null;return Object(n.jsxs)("form",{method:"post",action:"https://checkout.payulatam.com/ppp-web-gateway-payu/",ref:i,children:[Object(n.jsx)("input",{name:"merchantId",type:"hidden",value:je.a.merchantId}),Object(n.jsx)("input",{name:"referenceCode",type:"hidden",value:null===a||void 0===a?void 0:a.referenceCode}),Object(n.jsx)("input",{name:"description",type:"hidden",value:"Compra de ".concat(null===a||void 0===a?void 0:a.cantidad," emisiones")}),Object(n.jsx)("input",{name:"amount",type:"hidden",value:null===a||void 0===a?void 0:a.amount}),Object(n.jsx)("input",{name:"tax",type:"hidden",value:"0"}),Object(n.jsx)("input",{name:"taxReturnBase",type:"hidden",value:"0"}),Object(n.jsx)("input",{name:"signature",type:"hidden",value:null===a||void 0===a?void 0:a.signature}),Object(n.jsx)("input",{name:"accountId",type:"hidden",value:je.a.accountId}),Object(n.jsx)("input",{name:"currency",type:"hidden",value:null===a||void 0===a?void 0:a.currency}),Object(n.jsx)("input",{name:"buyerFullName",type:"hidden",value:null===a||void 0===a?void 0:a.buyerFullName}),Object(n.jsx)("input",{name:"buyerEmail",type:"hidden",value:null===a||void 0===a?void 0:a.buyerEmail}),Object(n.jsx)("input",{name:"confirmationUrl",type:"hidden",value:"".concat(je.a.apiURL,"/payment/confirmationPage")}),je.a.TEST_PAYU&&Object(n.jsx)("input",{name:"test",type:"hidden",value:"1"}),Object(n.jsx)("input",{name:"responseUrl",type:"hidden",value:"".concat(r)})]})},ze=a(51),Pe=a.n(ze),Re=a(541),Me=a.n(Re),Le=Object(xe.a)((function(e){return{root:{margin:0,padding:e.spacing(2)},closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]}}}))((function(e){var t=e.children,a=e.classes,i=e.onClose,r=Object(Se.a)(e,["children","classes","onClose"]);return Object(n.jsxs)(v.a,Object(m.a)(Object(m.a)({disableTypography:!0,className:a.root},r),{},{children:[Object(n.jsx)(we.a,{variant:"h6",children:t}),i?Object(n.jsx)(S.a,{"aria-label":"close",className:a.closeButton,onClick:i,children:Object(n.jsx)(ae.a,{})}):null]}))})),Fe=Object(C.a)((function(e){return{grid:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center"},div:{width:"60vh"},div_m:{justifyContent:"space-between",width:"60vh",display:"flex",whiteSpace:"pre-line"},input:{color:e.palette.primary.main,fontWeight:"bold",fontSize:"1.5em",textAlign:"center"},container__input_root:{borderRadius:"50px",color:e.palette.primary.main,fontSize:"1.5em",textAlign:"center"}}})),Ue=Object(xe.a)((function(e){return{root:{color:e.palette.primary.main,height:8},thumb:{height:24,width:24,backgroundColor:"#fff",border:"2px solid currentColor",marginTop:-8,marginLeft:-12,"&:focus, &:hover, &$active":{boxShadow:"inherit"}},active:{},valueLabel:{left:"calc(-50% + 4px)"},track:{height:8,borderRadius:4},rail:{height:8,borderRadius:4}}}))(Ee.a),We=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId}}),null)((function(e){var t=e.user,a=e.organizationId,r=Fe(),c=Object(u.g)(),o=Object(i.useState)(!1),s=Object(d.a)(o,2),l=s[0],p=s[1],j=Object(i.useState)(!1),g=Object(d.a)(j,2),v=g[0],y=g[1],w=Object(i.useState)({cantidad:500,amount:5e6,unit_amountText:"10,000",amountText:"5,000,000",currency:"COP"}),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)({}),T=Object(d.a)(B,2),A=T[0],I=T[1],z=Object(i.useState)(null),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)([]),U=Object(d.a)(L,2),q=U[0],H=U[1],V=Object(i.useState)("1"),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(D.a)(["alerts","buttons","contracts"]),Z=Object(d.a)(X,1)[0];Object(i.useEffect)((function(){var e="Certika".concat(Object(Ie.c)(10));N(Object(m.a)(Object(m.a)({},k),{},{referenceCode:e,signature:Pe()("".concat(je.a.API_KEY_PAYU,"~").concat(je.a.merchantId,"~").concat(e,"~5000000~COP")).toString()})),$().catch((function(){c.push("/500"),window.location.reload()}))}),[]),Object(i.useEffect)((function(){var e=null===q||void 0===q?void 0:q.filter((function(e){return e.id===parseInt(Q)}));e.length>0&&(N(Object(m.a)(Object(m.a)({},k),{},{cantidad:"4"===Q?10:e[0].cantidad_emisiones})),I({}))}),[Q]),Object(i.useEffect)((function(){ee()}),[k.cantidad,k.currency]);var $=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.get("/others/getPlans");case 2:t=e.sent,a=t.data,H(a.plans);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=0,t="",a=null===q||void 0===q?void 0:q.filter((function(e){return e.id===parseInt(Q)}));if(a.length>0){"COP"===k.currency?(e=k.cantidad*a[0].precio_unitario_cop,t=a[0].precio_unitario_cop.toLocaleString("es-MX")):"USD"===k.currency&&(e=k.cantidad*a[0].precio_unitario,t=a[0].precio_unitario.toLocaleString("es-MX"));var n="Certika".concat(Object(Ie.c)(10)),i=Pe()("".concat(je.a.API_KEY_PAYU,"~").concat(je.a.merchantId,"~").concat(n,"~").concat(e,"~").concat(k.currency)).toString();N(Object(m.a)(Object(m.a)({},k),{},{amount:e,amountText:e.toLocaleString("es-MX"),unit_amountText:t,referenceCode:n,signature:i}))}},te=function(){M(null),y(!1),J("1")},ae=function(e){N(Object(m.a)(Object(m.a)({},k),{},Object(b.a)({},e.target.name,e.target.value))),"cantidad"===e.target.name&&(J("4"),0===e.target.value||e.target.value<10||e.target.value>2e3||!/^[0-9]*$/.test(e.target.value)?I(Object(m.a)(Object(m.a)({},A),{},Object(b.a)({},e.target.name,!0))):I(Object(m.a)(Object(m.a)({},A),{},Object(b.a)({},e.target.name,!1))))},ne=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:p(!0),Ce.a.post("/payment/",Object(m.a)(Object(m.a)({},k),{},{id_usuarios:t.data_user.id,id_organizaciones:a,id_planes:parseInt(Q)})).then((function(e){var a;(null===(a=e.data)||void 0===a?void 0:a.paymentId)&&(p(!1),y(!1),M(Object(m.a)(Object(m.a)({},k),{},{amount:parseFloat(k.amount),buyerFullName:"".concat(t.data_user.primer_nombre," ").concat(t.data_user.primer_apellido),buyerEmail:t.correo})))})).catch((function(e){F.a.fire({icon:"error",iconColor:E.a.primary,text:Z("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:3e3}),p(!1),y(!1)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"573012479849","Hola, quiero comprar m\xe1s emisiones",t="https://wa.me/".concat("573012479849","?text=").concat(encodeURIComponent("Hola, quiero comprar m\xe1s emisiones")),window.open(t,"_blank");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(K.a,{title:"Recargar emisiones",children:Object(n.jsx)(S.a,{"aria-label":"recharge",color:"secondary",size:"small",onClick:function(){return ie()},children:Object(n.jsx)(Me.a,{})})}),Object(n.jsxs)(O.a,{open:v,onClose:te,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(Le,{align:"center",onClose:te}),Object(n.jsx)(_.a,{children:l?Object(n.jsx)(Be.a,{}):Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(ye.a,{container:!0,className:r.container,spacing:1,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:12,align:"center",children:[Object(n.jsx)(we.a,{variant:"h6",component:"h6",className:r.title,children:Z("contracts:select-issue")}),Object(n.jsx)("div",{style:{width:"10em"},className:r.grid,children:Object(n.jsx)(Te.a,{required:!0,id:"cantidad",label:"",name:"cantidad",type:"number",size:"large",value:k.cantidad,onChange:ae,error:A.cantidad,helperText:A.cantidad&&"Digite una cantidad v\xe1lida.",InputProps:{classes:{root:r.container__input_root},inputProps:{style:{textAlign:"center"}}}})})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,align:"center",children:Object(n.jsx)("div",{className:r.div,children:Object(n.jsx)(Ue,{name:"cantidad",value:k.cantidad,onChange:function(e,t){J(500===t?"1":1e3===t?"2":2e3===t?"3":"4")},valueLabelDisplay:"off","aria-label":"pretto slider",defaultValue:500,marks:[{value:10,label:"10"},{value:500,label:""},{value:1e3,label:""},{value:2e3,label:"2,000"}],step:null,min:10,max:2e3})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,align:"center",children:Object(n.jsxs)("div",{className:r.div_m,children:[Object(n.jsx)(we.a,{align:"left",className:r.title,children:Z("1"===Q?"contracts:lite":"2"===Q?"contracts:plus":"3"===Q?"contracts:premium":"contracts:on-demand")}),Object(n.jsx)("span",{children:Object(n.jsxs)(we.a,{align:"left",className:r.title,children:["V/".concat(Z("contracts:unit")," \n $").concat(k.unit_amountText)," ",Object(n.jsx)(Te.a,{select:!0,size:"small",label:"",name:"currency",value:k.currency,onChange:ae,children:[{value:"COP",label:"$"},{value:"USD",label:"$"}].map((function(e){return Object(n.jsx)(Y.a,{value:e.value,children:e.value},e.value)}))})]})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,align:"center",children:Object(n.jsx)("div",{className:r.div,children:Object(n.jsx)(W.a,{})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,align:"center",children:Object(n.jsxs)("div",{className:r.div_m,children:[Object(n.jsx)(we.a,{align:"left",className:r.title,children:Z("contracts:total-pay")}),Object(n.jsx)(we.a,{align:"left",className:r.title,children:Object(n.jsx)("b",{children:"$".concat(k.amountText," ").concat(k.currency," / ").concat(Z("contracts:year"))})})]})})]})})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,onClick:function(){y(!1),F.a.fire({text:"\xbf".concat(Z("alerts:alerts.buy-issues")," ").concat(k.cantidad," ").concat(Z("alerts:alerts.issues-for")," $").concat(k.amountText," ").concat(k.currency,"?"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Z("buttons:buttons.accept"),cancelButtonText:Z("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?ne():y(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},disabled:0===k.cantidad||0===k.amount||A.cantidad,color:"primary",variant:"contained",style:{margin:".5em 1em"},children:Z("contracts:pay")})})]}),Object(n.jsx)(De,{location:"".concat(je.a.certikaURL,"/responsePage"),formData:R,action:function(e){e&&R&&e.submit()}})]})})),Ye=Object(C.a)((function(){return{root:{marginTop:"1rem"},title:{fontSize:18,fontWeight:"bold"},pos:{fontSize:12}}})),qe=Object(xe.a)((function(){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:E.a.secondary},bar:{borderRadius:5,backgroundColor:E.a.primary}}}))(Oe.a);var He=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),null)((function(e){var t=Ye(),a=e.user,r=e.organizationId,c=Object(i.useState)([null]),o=Object(d.a)(c,2),s=o[0],l=o[1],u=Object(i.useState)(!0),b=Object(d.a)(u,2),p=b[0],j=b[1],g=Object(D.a)("contracts"),x=Object(d.a)(g,1)[0],O=a.data_user.gruposUsuariosOrganizaciones.find((function(e){return e.id_organizaciones===r})),v=O.id,_=O.id_grupos_usuarios;Object(i.useEffect)((function(){y()}),[]);var y=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,c,o,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1===_){e.next=21;break}return e.next=3,Ce.a.post("/contract/validContract/".concat(r));case 3:return e.next=5,Ce.a.get("/contract/card/".concat(r));case 5:if(t=e.sent,a=t.data,4!==_||!a.contract){e.next=17;break}return e.next=10,Ce.a.get("/userGroup/organizations/".concat(v));case 10:if(n=e.sent,i=n.data,c=i.group,o=c.limit_issued,s=c.user_total_issueds,!o){e.next=17;break}return l(Object(m.a)(Object(m.a)({},a.contract),{},{user_cantidad_emisiones:o,user_total_emisiones:s||0})),j(!1),e.abrupt("return");case 17:l(a.contract),j(!1),e.next=23;break;case 21:l(null),j(!1);case 23:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsx)(ve.a,{className:t.root,elevation:0,children:Object(n.jsx)(_e.a,{children:s?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:11,children:Object(n.jsx)(we.a,{variant:"h6",component:"h6",className:t.title,children:p?Object(n.jsx)(Be.a,{}):5===(null===s||void 0===s?void 0:s.id_planes)?x("contracts:total-users"):x("contracts:total-issue")})}),Object(n.jsx)(ye.a,{item:!0,xs:1,children:p?Object(n.jsx)(Be.a,{}):4!==_&&Object(n.jsx)(We,{})})]}),4!==_?Object(n.jsx)(we.a,{className:t.pos,color:"textSecondary",children:p?Object(n.jsx)(Be.a,{}):"".concat(new Intl.NumberFormat("de-DE").format(null===s||void 0===s?void 0:s.total_emisiones)," ").concat(x("contracts:of")," ").concat(new Intl.NumberFormat("de-DE").format(null===s||void 0===s?void 0:s.cantidad_emisiones))}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(we.a,{className:t.pos,color:"textSecondary",children:p?Object(n.jsx)(Be.a,{}):"".concat((null===s||void 0===s?void 0:s.user_cantidad_emisiones)&&null!==(null===s||void 0===s?void 0:s.user_total_emisiones)?x("contracts:organitation"):""," ").concat(new Intl.NumberFormat("de-DE").format(null===s||void 0===s?void 0:s.total_emisiones)," ").concat(x("contracts:of")," ").concat(new Intl.NumberFormat("de-DE").format(null===s||void 0===s?void 0:s.cantidad_emisiones))}),(null===s||void 0===s?void 0:s.user_cantidad_emisiones)&&null!==(null===s||void 0===s?void 0:s.user_total_emisiones)&&Object(n.jsx)(we.a,{className:t.pos,color:"textSecondary",children:p?Object(n.jsx)(Be.a,{}):"".concat(x("contracts:user"),": ").concat(new Intl.NumberFormat("de-DE").format(null===s||void 0===s?void 0:s.user_total_emisiones)," ").concat(x("contracts:of")," ").concat(new Intl.NumberFormat("de-DE").format(null===s||void 0===s?void 0:s.user_cantidad_emisiones))})]}),p?Object(n.jsx)(Be.a,{}):Object(n.jsx)(qe,{variant:"determinate",value:(null===s||void 0===s?void 0:s.total_emisiones)/(null===s||void 0===s?void 0:s.cantidad_emisiones)*100}),Object(n.jsx)(we.a,{className:t.pos,color:"textSecondary",children:p?Object(n.jsx)(Be.a,{}):(null===s||void 0===s?void 0:s.vencimiento)?"".concat(x("contracts:expiration"),"  ").concat(Ne()(null===s||void 0===s?void 0:s.vencimiento).format("DD/MM/YYYY")):x("contracts:without-expiration")})]}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:11}),Object(n.jsx)(ye.a,{item:!0,xs:1,children:p?Object(n.jsx)(Be.a,{}):Object(n.jsx)(We,{})})]}),Object(n.jsx)(we.a,{align:"center",variant:"h6",component:"h6",className:t.title,color:"textSecondary",children:x("contracts:without-contract")})]})})})})),Ke=a(112),Ve=a(1238),Ge=a(1125),Qe=a(630),Je=Object(xe.a)((function(e){return{root:{margin:0,padding:e.spacing(2)},closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]}}}))((function(e){var t=e.children,a=e.classes,i=e.onClose,r=Object(Se.a)(e,["children","classes","onClose"]);return Object(n.jsxs)(v.a,Object(m.a)(Object(m.a)({disableTypography:!0,className:a.root},r),{},{children:[Object(n.jsx)(we.a,{variant:"h6",children:t}),i?Object(n.jsx)(S.a,{"aria-label":"close",className:a.closeButton,onClick:i,children:Object(n.jsx)(ae.a,{})}):null]}))})),Xe=Object(C.a)((function(e){return{container:{marginTop:"1.5em",marginBottom:"1em"},title:{fontWeight:"bold"},text:{marginTop:".5em"},divider:{margin:"0 -0.1em"},avatar:{width:e.spacing(7),height:e.spacing(7)}}})),Ze=function(e){var t=e.count,a=e.open,i=void 0!==a&&a,r=e.setOpen,c=e.selectedYear,o=e.setSelectedYear,s=e.loading,l=Xe(),u=Object(D.a)(["contracts","alerts","menu"]),m=Object(d.a)(u,1)[0],b=function(){r(!1)};return Object(n.jsxs)(O.a,{open:i,onClose:b,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(Je,{align:"center",onClose:b}),Object(n.jsxs)(_.a,{children:[s?Object(n.jsx)(Be.a,{}):Object(n.jsxs)(ye.a,{container:!0,className:l.container,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:5,sm:5,className:l.grid,align:"right",children:Object(n.jsx)(we.a,{variant:"h6",component:"h6",className:l.title,children:m("contracts:total-issue")})}),Object(n.jsx)(ye.a,{item:!0,xs:5,sm:5,className:l.grid,align:"left",children:Object(n.jsx)(we.a,{variant:"h5",component:"h5",children:new Intl.NumberFormat("de-DE").format(t.total)})}),Object(n.jsx)(ye.a,{item:!0,xs:2,sm:2,children:Object(n.jsx)(Ve.a,{autoOk:!0,disableFuture:!0,size:"small",views:["year"],value:c,onChange:o,cancelLabel:m("alerts:alerts.cancel")})})]}),Object(n.jsxs)(ye.a,{container:!0,className:l.container,spacing:0,children:[Object(n.jsxs)(ye.a,{item:!0,xs:3,sm:3,className:l.grid,align:"center",children:[s?Object(n.jsx)(Be.a,{variant:"circle",width:56,height:56}):Object(n.jsx)(g.a,{className:l.avatar,children:Object(n.jsx)(oe.a,{fontSize:"large"})}),Object(n.jsx)(we.a,{variant:"h5",component:"h5",className:l.text,children:s?Object(n.jsx)(Be.a,{}):new Intl.NumberFormat("de-DE").format(t.totalBadges)}),Object(n.jsx)(we.a,{variant:"h6",component:"h6",color:"textSecondary",children:s?Object(n.jsx)(Be.a,{}):m("menu:badges")})]}),Object(n.jsx)(W.a,{orientation:"vertical",flexItem:!0,className:l.divider}),Object(n.jsxs)(ye.a,{item:!0,xs:3,sm:3,className:l.grid,align:"center",children:[s?Object(n.jsx)(Be.a,{variant:"circle",width:56,height:56}):Object(n.jsx)(g.a,{className:l.avatar,children:Object(n.jsx)(se.a,{fontSize:"large"})}),Object(n.jsx)(we.a,{variant:"h5",component:"h5",className:l.text,children:s?Object(n.jsx)(Be.a,{}):new Intl.NumberFormat("de-DE").format(t.totalCertificates)}),Object(n.jsx)(we.a,{variant:"h6",component:"h6",color:"textSecondary",children:s?Object(n.jsx)(Be.a,{}):m("menu:certificates")})]}),Object(n.jsx)(W.a,{orientation:"vertical",flexItem:!0,className:l.divider}),Object(n.jsxs)(ye.a,{item:!0,xs:3,sm:3,className:l.grid,align:"center",children:[s?Object(n.jsx)(Be.a,{variant:"circle",width:56,height:56}):Object(n.jsx)(g.a,{className:l.avatar,children:Object(n.jsx)(ue.a,{fontSize:"large"})}),Object(n.jsx)(we.a,{variant:"h5",component:"h5",className:l.text,children:s?Object(n.jsx)(Be.a,{}):new Intl.NumberFormat("de-DE").format(t.totalCarnets)}),Object(n.jsx)(we.a,{variant:"h6",component:"h6",color:"textSecondary",children:s?Object(n.jsx)(Be.a,{}):m("menu:carnets")})]}),Object(n.jsx)(W.a,{orientation:"vertical",flexItem:!0,className:l.divider}),Object(n.jsxs)(ye.a,{item:!0,xs:3,sm:3,className:l.grid,align:"center",children:[s?Object(n.jsx)(Be.a,{variant:"circle",width:56,height:56}):Object(n.jsx)(g.a,{className:l.avatar,children:Object(n.jsx)(le.a,{fontSize:"large"})}),Object(n.jsx)(we.a,{variant:"h5",component:"h5",className:l.text,children:s?Object(n.jsx)(Be.a,{}):new Intl.NumberFormat("de-DE").format(t.totalDocuments)}),Object(n.jsx)(we.a,{variant:"h6",component:"h6",color:"textSecondary",children:s?Object(n.jsx)(Be.a,{}):m("menu:documents")})]})]})]})]})},$e=a(543),et=a.n($e),tt=a(542),at=a.n(tt);var nt=Object(C.a)((function(){return{root:{marginTop:"1rem"},title:{fontSize:18,fontWeight:"bold"},container_typography:{marginTop:".5em",marginBottom:"-1em",display:"flex",flexDirection:"column",alignItems:"center"}}})),it=function(){var e=nt(),t=Object(i.useState)(!0),a=Object(d.a)(t,2),r=a[0],c=a[1],o=Object(i.useState)({}),s=Object(d.a)(o,2),l=s[0],u=s[1],m=Object(i.useState)(new Date),b=Object(d.a)(m,2),p=b[0],j=b[1],g=Object(i.useState)(!1),x=Object(d.a)(g,2),O=x[0],v=x[1],_=Object(i.useState)(!1),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(D.a)(["contracts","tables","alerts"]),N=Object(d.a)(k,1)[0];Object(i.useEffect)((function(){B()}),[p]);var B=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.next=3,Ce.a.post("/contract/getContractsCountForYears",{selectedYear:p});case 3:t=e.sent,a=t.data,u(a.contracts),c(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(Ke.a,{utils:Qe.a,children:[Object(n.jsx)(ve.a,{className:e.root,elevation:0,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:10,children:Object(n.jsx)(we.a,{variant:"h6",component:"h6",className:e.title,children:r?Object(n.jsx)(Be.a,{}):N("contracts:total-issue")})}),Object(n.jsx)(ye.a,{item:!0,xs:2,children:r?Object(n.jsx)(Be.a,{height:30}):Object(n.jsx)(Ve.a,{autoOk:!0,disableFuture:!0,size:"small",views:["year"],value:p,onChange:j,cancelLabel:N("alerts:alerts.cancel")})})]}),Object(n.jsx)("div",{className:e.container_typography,children:r?Object(n.jsx)(Be.a,{width:200,height:50}):Object(n.jsxs)(we.a,{variant:"h5",component:"h5",children:[Object(n.jsx)(K.a,{title:N("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"view",onClick:function(){return C((function(e){return!e}))},children:w?Object(n.jsx)(at.a,{}):Object(n.jsx)(et.a,{})})})," ",w?new Intl.NumberFormat("de-DE").format(l.total):"*".repeat(l.total.toString().length)," ",Object(n.jsx)(K.a,{title:N("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"view",onClick:function(){return v(!0)},children:Object(n.jsx)(Ge.a,{})})})]})})]})}),Object(n.jsx)(Ze,{count:l,open:O,setOpen:v,selectedYear:p,setSelectedYear:j,loading:r})]})},rt=a(32),ct=a.n(rt),ot=Object(C.a)((function(e){return{root:{height:"3.5em",justifyContent:"space-between",alignItems:"center",border:"none"},text:{marginTop:"1em",marginBottom:"1em",color:"black",fontWeight:"bold",fontSize:"14px"},avatar:{width:"54px",height:"54px","& img":{height:"min-content"},marginLeft:".5em"},nombre:{textAlign:"left"}}}));var st=Object(s.b)((function(e){return{organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),null)((function(e){var t=ot(),a=e.organizationId,r=Object(i.useState)(!0),c=Object(d.a)(r,2),o=c[0],s=c[1],l=Object(i.useState)({nombre:"",logo:null}),u=Object(d.a)(l,2),b=u[0],p=u[1];Object(i.useEffect)((function(){j()}),[]);var j=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.get("/organization/".concat(a));case 2:t=e.sent,n=t.data,i=n.organization.organizations,p(Object(m.a)(Object(m.a)({},i),{},{logo:i.linkPhoto})),s(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsx)(ve.a,{className:t.root,variant:"outlined",children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:4,lg:3,children:o?Object(n.jsx)(Be.a,{variant:"circle",className:t.avatar}):Object(n.jsx)(g.a,{"aria-label":"profile",src:b.logo,className:t.avatar})}),Object(n.jsx)(ye.a,{item:!0,xs:8,lg:9,className:!o&&t.nombre,children:o?Object(n.jsx)(Be.a,{variant:"rect",height:"3.5em"}):Object(n.jsx)(we.a,{className:t.text,children:b.nombre})})]})})})),lt=Object(C.a)((function(e){return{root:{backgroundColor:"#ffffff"},icon:{marginRight:".1em"},new:{color:E.a.primary,fontSize:"30px",width:"200px"},iconsButtons:{width:"24px",height:"24px",borderRadius:"4px"}}})),dt={changePage:I.b,setFormDocuments:I.y,setDocumentsFields:I.u,setSearchValue:I.E},ut=Object(s.b)((function(e){return{permission:e.permission,user:e.user,formDocuments:e.formDocuments}}),dt)((function(e){var t,a,r,c,o,s,l,m,b=e.permission,p=e.changePage,j=e.user,g=e.setFormDocuments,x=e.setDocumentsFields,O=e.formDocuments,v=e.setSearchValue,_=lt(),C=Object(u.g)(),k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],S=N[1],T=Object(i.useState)(!1),A=Object(d.a)(T,2),E=A[0],I=A[1],z=Object(i.useState)(!1),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)(!1),F=Object(d.a)(L,2),U=F[0],W=F[1],Y=Object(i.useState)(!1),q=Object(d.a)(Y,2),H=q[0],K=q[1],V=Object(i.useState)(!1),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)(!1),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)(!1),ae=Object(d.a)(te,2),ne=ae[0],fe=ae[1],he=Object(i.useState)([]),xe=Object(d.a)(he,2),Oe=xe[0],ve=xe[1],_e=Object(i.useState)(!0),ye=Object(d.a)(_e,2),we=ye[0],Ce=ye[1],ke=Object(D.a)(["menu"]),Ne=Object(d.a)(ke,1)[0];Object(i.useEffect)((function(){ve(b.filter((function(e){return"leer"===e.acciones.nombre.toLowerCase()}))),setTimeout((function(){Ce(!1)}),1e3)}),[]);var Se=function(e,t){switch(t){case 1:S(!B),I(!1),M(!1),W(!1),K(!1),J(!1),ee(!1),fe(!1);break;case 2:I(!E),S(!1),M(!1),W(!1),K(!1),J(!1),ee(!1),fe(!1);break;case 3:M(!R),S(!1),I(!1),W(!1),K(!1),J(!1),ee(!1),fe(!1);break;case 4:W(!U),S(!1),I(!1),M(!1),K(!1),J(!1),ee(!1),fe(!1);break;case 5:K(!H),S(!1),I(!1),M(!1),W(!1),J(!1),ee(!1),fe(!1);break;case 6:J(!Q),S(!1),I(!1),M(!1),W(!1),K(!1),ee(!1),fe(!1);break;case 7:ee(!$),S(!1),I(!1),M(!1),W(!1),K(!1),J(!1),fe(!1);break;case 8:fe(!ne),S(!1),I(!1),M(!1),W(!1),K(!1),J(!1),ee(!1)}},Te=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!window.location.pathname.includes("certify")&&"/certify"===a||!window.location.pathname.includes("/templates/documents/published")&&"/templates/documents/published"===a||!window.location.pathname.includes("sign")&&"/documents/sign"===a)){e.next=9;break}if(!(null===O||void 0===O?void 0:O.fileName)){e.next=7;break}return(n=new FormData).append("fileName",null===O||void 0===O?void 0:O.fileName),n.append("numPages",null===O||void 0===O?void 0:O.pages),e.next=7,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/delete-files-local"),headers:{"Content-Type":"multipart/form-data"},data:n});case 7:g(null),x(null);case 9:p(0),v(""),C.push(a);case 12:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Ae=function(){var e="";return Oe.map((function(t){e="".concat(e).concat(t.acciones.modulos.nombre.toLowerCase())})),Object(n.jsxs)("div",{children:[e.includes("plantillas")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/templates/published")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:templates")})})}),e.includes("recomendaciones")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/recommendations")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:recommendations")})})}),e.includes("emitir")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/issue")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:issue")})})}),e.includes("insignias emitidas")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/badgesIssued")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:badge-issued")})})}),e.includes("insignias reportes")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/reports/badge")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:reports")})})}),e.includes("ids plantillas")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/developers/template-ids/badges")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:id-templates-badges")})})})]})},Ee=function(){var e="";return Oe.map((function(t){e="".concat(e).concat(t.acciones.modulos.nombre.toLowerCase())})),Object(n.jsxs)("div",{children:[e.includes("certificados")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/certificates/published")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:templates")})})}),e.includes("recomendaciones certificados")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/recommendations/certificate")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:recommendations")})})}),e.includes("emitir certificados")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/certificates/issue")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:issue")})})}),e.includes("certificados emitidos")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/certificates/issued")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:certificate-issued")})})}),e.includes("certificados reportes")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/reports/certificate")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:reports")})})}),e.includes("ids plantillas certificados")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/developers/template-ids/certificates")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:id-templates-certificates")})})})]})},De=function(){var e="";return Oe.map((function(t){e="".concat(e).concat(t.acciones.modulos.nombre.toLowerCase())})),Object(n.jsxs)("div",{children:[e.includes("plantillas documentos")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/templates/documents/published")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:templates")})})}),e.includes("certificar")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/certify")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:certify")})})}),e.includes("archivos")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/documents/files")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:archives")})})}),e.includes("ids plantillas documentos")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/developers/template-ids/documents")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:id-templates-documents")})})})]})},ze=function(){var e="";return Oe.map((function(t){e="".concat(e).concat(t.acciones.modulos.nombre.toLowerCase())})),Object(n.jsx)("div",{children:e.includes("firma digital")&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/documents/sign")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:sign")})})}),Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/documents/sign/files")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:archives")})})})]})})},Pe=function(){var e="";return Oe.map((function(t){e="".concat(e).concat(t.acciones.modulos.nombre.toLowerCase())})),Object(n.jsxs)("div",{children:[e.includes("carnets")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/carnets/published")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:templates")})})}),e.includes("colecciones carnets")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"#")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:collections")})})}),e.includes("emitir carnets")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/carnets/issue")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:issue")})})}),e.includes("carnets emitidos")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/carnets/issued")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:carnet-issued")})})}),e.includes("carnets reportes")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/reports/carnet")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:reports")})})})]})},Re=function(){var e="";return Oe.map((function(t){e="".concat(e).concat(t.acciones.modulos.nombre.toLowerCase())})),Object(n.jsxs)("div",{children:[e.includes("plantillas diplomas")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/diplomas/templates/published")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:templates")})})}),e.includes("emitir diplomas")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/diplomas/issue")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:issue")})})}),e.includes("firmar diplomas")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/diplomas/sign")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:sign")})})}),e.includes("diplomas emitidos")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/diplomas/groupsIssued")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:diplomas-issued")})})})]})},Me=function(){var e="";return Oe.map((function(t){e="".concat(e).concat(t.acciones.modulos.nombre.toLowerCase())})),Object(n.jsxs)("div",{children:[e.includes("valores par\xe1metros")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/valueParameters")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:parameter-values")})})}),e.includes("m\xf3dulos")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/modules")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:modules")})})}),e.includes("grupos de usuarios")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/userGroups")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:user-groups")})})}),e.includes("acciones")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/actions")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:actions")})})}),e.includes("permisos")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/permissions")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:permits")})})}),e.includes("usuarios")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/users")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:users")})})}),e.includes("organizaciones")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/organizations")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:organizations")})})}),e.includes("grupos usuarios organizaciones")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/userGroupsOrganization")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:user-groups-organizations")})})}),e.includes("redes sociales")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/socialNetworks")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:social-media")})})}),e.includes("contratos")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){var t,a,n,i;return Te(e,1===(null===j||void 0===j||null===(t=j.data_user)||void 0===t||null===(a=t.gruposUsuariosOrganizaciones[0])||void 0===a?void 0:a.id_grupos_usuarios)||14===(null===j||void 0===j||null===(n=j.data_user)||void 0===n||null===(i=n.gruposUsuariosOrganizaciones[0])||void 0===i?void 0:i.id_grupos_usuarios)?"/contracts":"/contracts/".concat(Object(Ie.b)(null===j||void 0===j?void 0:j.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones)))},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:contracts")})})}),e.includes("habilidades")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/skills")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:skills")})})}),e.includes("recordatorios")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/reminders")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:reminders")})})}),e.includes("pagos")&&Object(n.jsx)(ie.a,{component:"div",disablePadding:!0,children:Object(n.jsx)(y.a,{button:!0,onClick:function(e){return Te(e,"/payments")},children:Object(n.jsx)(w.a,{inset:!0,primary:Ne("menu:payments")})})})]})};return Object(n.jsxs)(i.Fragment,{children:[1!==(null===j||void 0===j||null===(t=j.data_user)||void 0===t||null===(a=t.gruposUsuariosOrganizaciones[0])||void 0===a?void 0:a.id_grupos_usuarios)&&14!==(null===j||void 0===j||null===(r=j.data_user)||void 0===r||null===(c=r.gruposUsuariosOrganizaciones[0])||void 0===c?void 0:c.id_grupos_usuarios)&&Object(n.jsx)(st,{}),we?Object(n.jsx)(Be.a,{variant:"rect",height:224}):Object(n.jsxs)(ie.a,{component:"nav",className:_.root,children:[function(){var e=0;if(Oe.map((function(t){return("plantillas"===t.acciones.modulos.nombre.toLowerCase()||"recomendaciones"===t.acciones.modulos.nombre.toLowerCase()||"insignias emitidas"===t.acciones.modulos.nombre.toLowerCase()||"colecciones"===t.acciones.modulos.nombre.toLowerCase()||"emitir"===t.acciones.modulos.nombre.toLowerCase())&&(e+=1)})),e>0)return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(y.a,{button:!0,onClick:function(e){return Se(0,1)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)(oe.a,{})}),Object(n.jsx)(w.a,{primary:Ne("menu:badges")})]}),Object(n.jsx)(ce.a,{in:B,timeout:"auto",unmountOnExit:!0,children:Ae()})]})}(),function(){var e=0;if(Oe.map((function(t){return("certificados"===t.acciones.modulos.nombre.toLowerCase()||"recomendaciones certificados"===t.acciones.modulos.nombre.toLowerCase()||"certificados emitidos"===t.acciones.modulos.nombre.toLowerCase()||"colecciones certificados"===t.acciones.modulos.nombre.toLowerCase()||"emitir certificados"===t.acciones.modulos.nombre.toLowerCase())&&(e+=1)})),e>0)return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(y.a,{button:!0,onClick:function(e){return Se(0,4)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)(se.a,{})}),Object(n.jsx)(w.a,{primary:Ne("menu:certificates")})]}),Object(n.jsx)(ce.a,{in:U,timeout:"auto",unmountOnExit:!0,children:Ee()})]})}(),function(){var e=0;if(Oe.map((function(t){return("carnets"===t.acciones.modulos.nombre.toLowerCase()||"carnets emitidos"===t.acciones.modulos.nombre.toLowerCase()||"colecciones carnets"===t.acciones.modulos.nombre.toLowerCase()||"carnets reportes"===t.acciones.modulos.nombre.toLowerCase()||"emitir carnets"===t.acciones.modulos.nombre.toLowerCase())&&(e+=1)})),e>0)return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(y.a,{button:!0,onClick:function(e){return Se(0,6)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)(ue.a,{})}),Object(n.jsx)(w.a,{primary:Ne("menu:carnets")}),Object(n.jsx)(re.a,{})]}),Object(n.jsx)(ce.a,{in:Q,timeout:"auto",unmountOnExit:!0,children:Pe()})]})}(),function(){var e=0;if(Oe.map((function(t){return("plantillas documentos"===t.acciones.modulos.nombre.toLowerCase()||"archivos"===t.acciones.modulos.nombre.toLowerCase()||"firmar"===t.acciones.modulos.nombre.toLowerCase()||"certificar"===t.acciones.modulos.nombre.toLowerCase())&&(e+=1)})),e>0)return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(y.a,{button:!0,onClick:function(e){return Se(0,5)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)(le.a,{})}),Object(n.jsx)(w.a,{primary:Ne("menu:documents")})]}),Object(n.jsx)(ce.a,{in:H,timeout:"auto",unmountOnExit:!0,children:De()})]})}(),function(){var e=0;if(Oe.map((function(t){return"firma digital"===t.acciones.modulos.nombre.toLowerCase()&&(e+=1)})),e>0)return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(y.a,{button:!0,onClick:function(e){return Se(0,8)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)("img",{className:_.iconsButtons,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAzVJREFUaEPtWV2OGjEMTibco+xNdk/S5Q4E8dblDRHuUHqScpPSewBpPUpGicdOPFpl0EpE4mny48/25z+0+uJLf3H51cMBrNfrV1DiYrG47Pf7y1SFPgQACK21/qGU6oVP1lkp9cs5d5ICmR3AZrP58N6D8OzSWu+6rjtJLDIrAGvtT6XUu0S7AOJwOHzU9s4GILjN75pA6XdjzEvNCrMA2G63y9vt9ocQvvd57/2l67pX7FoSK8wCgPH7s3PuLQVlrQWQy5TUeA9WwiwArLUePXxxzr1gYQiOkPvSc80BUNr33r8dj0dwn2xZa4HgQPRh1XjQHIC1FoibxntWqxTRnXNFGZsCoMhbIiZhrce6EOU+JZcgODAi+qwknqLRqdaKQJq6EKHRk3NuRSUzJtSuanVRawAZgTn/ZxJd1f9BEa0BZImJA0BEKpCtqv05AOAENhKKcR2R9psCoNwCJzCuwOMSHcWd1i6UWSAVjBNeUsDNVkoQxVnvQoXSmo1SXBlOWgBIZYxZ4VocHoayV9JowIMEgJPW+i/TkVWTlsiF0oiQZs1Ua1IzM9GFkmNE2vDe0hhzLjU1mQWolg9AXK/XpdY666YkICT97/9Cj9R8Yr2+6eGADABC1AAh04ai1AFWTS5oI8k7KOBcVZpZYAKIqvCBA6UmniQsBzoCgO/pDGlEYgGIqvBUY4JMeTLG7KgggV01nOs5gjjV38FFoVFnFAUolcOFgRXligMIUNr9fn8vzItgYge/bBAGsowACPxWUSAEWi/xafK3GEQyABLhS5ZgBlcX7/2KGpsUpI4zUi6gDG4siUIQxuCi0WU4MmD+4FArDKs9uQt7s5yRWSAc+p4I2yOliM0VXOGObxRJQ2QCfsU3shmQ936XTiuIRDgKICMOJCAA6TB4SkFMqRZLzh1H69SIJZ6rZWQ2ClGtHICArFx6cDIbP3mgaTn9SdlEx58ARGpquIm0APg6fhOnfbyn9h3uq+2pfafuEGVinHlrEzRJP1y7I4RctiWNCn4CCJrIEszTAkEr+I8RKoGS/QAkq5TEOHHFDBr3UH9S4z0t7oD3n3mgYYgXXf20gEhNDTf9AyP/vl+mCOBYAAAAAElFTkSuQmCC",alt:"Signatue"})}),Object(n.jsx)(w.a,{primary:Ne("menu:digital_signature")}),Object(n.jsx)(re.a,{children:Object(n.jsx)(de.a,{className:_.new})})]}),Object(n.jsx)(ce.a,{in:ne,timeout:"auto",unmountOnExit:!0,children:ze()})]})}(),function(){var e=0;if(Oe.map((function(t){return("plantillas diplomas"===t.acciones.modulos.nombre.toLowerCase()||"diplomas emitidos"===t.acciones.modulos.nombre.toLowerCase()||"firmar diplomas"===t.acciones.modulos.nombre.toLowerCase()||"emitir diplomas"===t.acciones.modulos.nombre.toLowerCase())&&(e+=1)})),e>0)return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(y.a,{button:!0,onClick:function(e){return Se(0,7)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)(me.a,{})}),Object(n.jsx)(w.a,{primary:"Diplomas"}),Object(n.jsx)(re.a,{children:Object(n.jsx)(de.a,{className:_.new})})]}),Object(n.jsx)(ce.a,{in:$,timeout:"auto",unmountOnExit:!0,children:Re()})]})}(),function(){var e=0;if(Oe.map((function(t){return"anal\xedtica"===t.acciones.modulos.nombre.toLowerCase()&&(e+=1)})),e>0)return Object(n.jsxs)(y.a,{button:!0,onClick:function(e){return Te(e,"/analytics")},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)(be.a,{})}),Object(n.jsx)(w.a,{primary:Ne("menu:analytics")})]})}(),function(){var e=0;if(Oe.map((function(t){return("modulos"===t.acciones.modulos.nombre.toLowerCase()||"acciones"===t.acciones.modulos.nombre.toLowerCase()||"permisos"===t.acciones.modulos.nombre.toLowerCase()||"grupos de usuarios"===t.acciones.modulos.nombre.toLowerCase()||"usuarios"===t.acciones.modulos.nombre.toLowerCase()||"organizaciones"===t.acciones.modulos.nombre.toLowerCase()||"grupos usuarios organizaciones"===t.acciones.modulos.nombre.toLowerCase()||"valores par\xe1metros"===t.acciones.modulos.nombre.toLowerCase()||"redes sociales"===t.acciones.modulos.nombre.toLowerCase()||"contratos"===t.acciones.modulos.nombre.toLowerCase()||"habilidades"===t.acciones.modulos.nombre.toLowerCase()||"recordatorios"===t.acciones.modulos.nombre.toLowerCase())&&(e+=1)})),e>0)return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(y.a,{button:!0,onClick:function(e){return Se(0,3)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)(pe.a,{})}),Object(n.jsx)(w.a,{primary:Ne("menu:settings")})]}),Object(n.jsx)(ce.a,{in:R,timeout:"auto",unmountOnExit:!0,children:Me()})]})}()]}),1!==(null===j||void 0===j||null===(o=j.data_user)||void 0===o||null===(s=o.gruposUsuariosOrganizaciones[0])||void 0===s?void 0:s.id_grupos_usuarios)&&14!==(null===j||void 0===j||null===(l=j.data_user)||void 0===l||null===(m=l.gruposUsuariosOrganizaciones[0])||void 0===m?void 0:m.id_grupos_usuarios)?Object(n.jsx)(He,{}):Object(n.jsx)(it,{}),Object(n.jsx)(ge,{})]})})),mt=a(336),bt=a(1034),pt=Object(C.a)((function(e){return{textSelect:{"& .MuiSelect-select":{borderBottom:"none"},color:"#000",border:"none",".MuiOutlinedInput-notchedOutline":{border:0}},textMenu:{color:"#000"},formControl:Object(b.a)({textAlign:"center",minWidth:50,border:"none",".MuiOutlinedInput-notchedOutline":{border:0}},e.breakpoints.up("sm"),{minWidth:50,marginLeft:".8em",boder:0,".MuiOutlinedInput-notchedOutline":{border:0}})}})),jt=function(){var e=Object(D.a)(),t=e.i18n,a=e.t,r=Object(i.useState)(t.language||"es"),c=Object(d.a)(r,2),o=c[0],s=c[1],l=new bt.a("lenguage"),u=pt();Object(i.useEffect)((function(){s(t.language)}),[a]);return Object(n.jsx)(mt.a,{className:u.formControl,children:Object(n.jsxs)(T.a,{value:o,onChange:function(e){var t=e.target.value;o!==t&&(s(t),l.postMessage("".concat(t)))},className:u.textSelect,inputProps:{disableUnderline:!0},children:[Object(n.jsx)(Y.a,{className:u.textMenu,value:"es",children:"ES"}),Object(n.jsx)(Y.a,{className:u.textMenu,value:"en",children:"EN"})]})})},ft=a(1131),ht=a(1132),gt=a(1268),xt=a(640),Ot=a(1118),vt=Object(C.a)((function(e){return{backdrop:{zIndex:3e3,color:"#fff"}}})),_t=function(e){var t=e.loading,a=void 0!==t&&t,i=vt();return Object(n.jsx)(xt.a,{className:i.backdrop,open:a,children:Object(n.jsx)(Ot.a,{color:"inherit"})})},yt=a(317),wt=a.n(yt),Ct=Object(C.a)((function(e){return{container__msg:Object(b.a)({display:"flex",flexDirection:"row",alignItems:"center"},e.breakpoints.up("sm"),{flexDirection:"row",justifyContent:"initial",alignItems:"initial"}),container__text:{display:"flex",flexDirection:"column",justifyContent:"center",margin:"-1em .5em -1em .6em"},container__img:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},date_hour:{fontSize:"12px",color:e.palette.primary.main},img_org:{width:e.spacing(8),height:"auto"},img_org_dialog:{width:"auto",height:e.spacing(5)},img_cred:{width:e.spacing(5),height:"auto"},img_cred_certificate:{height:e.spacing(5),minWidth:"auto"},img_cred_dialog:{width:e.spacing(15),height:"auto"},img_cred_dialog_certificate:{height:e.spacing(25),width:"auto"},container__clear:{display:"flex",flexDirection:"row",alignItems:"right",justifyContent:"right",marginRight:"1em"},text_message:{color:"#999999",fontSize:"20px"},container_center:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}}})),kt={setBadges:I.l,setCertificates:I.q,setCarnets:I.n,setView:I.I,setActive:I.j},Nt=Object(s.b)((function(e){return{userId:e.user.data_user.id}}),kt)((function(e){var t,a,r,c=e.userId,o=e.setBadges,s=e.setCertificates,l=e.setCarnets,m=e.setView,b=e.setActive,p=Ct(),j=Object(u.g)(),y=Object(i.useState)(null),w=Object(d.a)(y,2),C=w[0],k=w[1],N=Object(i.useState)([]),B=Object(d.a)(N,2),T=B[0],A=B[1],I=Object(i.useState)(!1),z=Object(d.a)(I,2),P=z[0],R=z[1],M=Object(i.useState)({}),L=Object(d.a)(M,2),W=L[0],q=L[1],H=Object(i.useState)(!1),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!1),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=window.location.origin===je.a.mincienciasURL?je.a.idMinciencias:1,te=Object(D.a)(["alerts","buttons"]),ae=Object(d.a)(te,1)[0];Object(i.useEffect)((function(){ie().catch((function(){}))}),[]);var ne=function(){k(null)},ie=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/alertNotifications/getAlerts",{id_usuarios:c});case 2:t=e.sent,a=t.data,n=[],a.alerts.map((function(e){n=2===parseInt(e.tipo)?a.alerts.filter((function(e){return 2===parseInt(e.tipo)&&(null!==e.insigniasEmitidas||null!==e.certificadosEmitidos||null!==e.carnetsEmitidos)})):a.alerts})),A(n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),re=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/alertNotifications/clear/".concat(c));case 2:t=e.sent,t.data&&(A([]),ne());case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,e.next=3,Ce.a.post("badgesIssued/getBadgesIssuedByUser",{idOrganizationBackoffice:ee});case 3:return a=e.sent,n=a.data,t=n.issued.length,o(n.issued),m(0),b("insignias"),e.abrupt("return",t);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),oe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,e.next=3,Ce.a.post("certificatesIssued/getCertificatesIssuedByUser",{idOrganizationBackoffice:ee});case 3:return a=e.sent,n=a.data,t=n.issued.length,s(n.issued),m(1),b("certificados"),e.abrupt("return",t);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),se=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,e.next=3,Ce.a.post("carnetsIssued/getCarnetsIssuedByUser",{idOrganizationBackoffice:ee});case 3:return a=e.sent,n=a.data,t=n.issued.length,l(n.issued),m(2),b("carnets"),e.abrupt("return",t);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/alertNotifications/".concat(t),{estado:2});case 2:a=e.sent,a.data;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)("div",{children:[Object(n.jsx)(S.a,{onClick:function(e){k(e.currentTarget)},children:Object(n.jsx)(ft.a,{badgeContent:T.length,color:"primary",children:Object(n.jsx)(gt.a,{})})}),T.length>0&&Object(n.jsxs)(U.a,{id:"simple-menu",anchorEl:C,keepMounted:!0,open:Boolean(C),onClose:ne,children:[Object(n.jsx)("div",{className:p.container__clear,children:Object(n.jsx)(K.a,{title:ae("alerts:notifications.clear"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:re,children:Object(n.jsx)(wt.a,{fontSize:"small"})})})}),T.map((function(e){var t,a,i,r,c;return 1===parseInt(e.tipo)?Object(n.jsx)(Y.a,{style:{width:"27em",minHeight:"6em"},children:Object(n.jsxs)("div",{className:p.container__msg,children:[Object(n.jsx)("div",{className:p.container__img,children:Object(n.jsx)(g.a,{variant:"square",src:e.organizationPhoto,className:p.img_org})}),Object(n.jsxs)("div",{className:p.container__text,children:[Object(n.jsx)(we.a,{style:{whiteSpace:"initial",fontSize:"16px"},children:"".concat(ae("alerts:notifications.organization")," ").concat(null===(t=e.organizaciones)||void 0===t?void 0:t.nombre," ").concat(ae("alerts:notifications.issued")," ").concat(e.cant_emisiones," ").concat(1===parseInt(e.tipo_producto)?ae("alerts:notifications.badges"):2===parseInt(e.tipo_producto)?ae("alerts:notifications.certificates"):(parseInt(e.tipo_producto),ae("alerts:notifications.carnets")),".")}),Object(n.jsx)(we.a,{className:p.date_hour,children:Ne()(e.fecha_hora).format("DD/MM/YYYY h:mm a")})]})]})}):Object(n.jsx)(Y.a,{onClick:function(){return function(e){Q(!0),R(!0),q(e),Q(!1)}(e)},style:{width:"25em",minHeight:"5em"},children:Object(n.jsxs)("div",{className:p.container__msg,children:[Object(n.jsx)("div",{className:p.container__img,children:Object(n.jsx)(g.a,{variant:"square",src:1===parseInt(e.tipo_producto)?null===(a=e.insigniasEmitidas)||void 0===a?void 0:a.photoBadge:2===parseInt(e.tipo_producto)?null===(i=e.certificadosEmitidos)||void 0===i?void 0:i.photoCertificate:3===parseInt(e.tipo_producto)?null===(r=e.carnetsEmitidos)||void 0===r?void 0:r.photoCarnet:"",className:2===parseInt(W.tipo_producto)?p.img_cred_certificate:p.img_cred})}),Object(n.jsxs)("div",{className:p.container__text,children:[Object(n.jsx)(we.a,{style:{whiteSpace:"initial",fontSize:"16px"},children:"".concat(ae("alerts:notifications.received")," ").concat(1===parseInt(e.tipo_producto)?ae("alerts:notifications.new-badge"):2===parseInt(e.tipo_producto)?ae("alerts:notifications.new-certificate"):(parseInt(e.tipo_producto),ae("alerts:notifications.new-carnet"))," ").concat(ae("alerts:notifications.from")," ").concat(null===(c=e.organizaciones)||void 0===c?void 0:c.nombre,".")}),Object(n.jsx)(we.a,{className:p.date_hour,children:Ne()(e.fecha_hora).format("DD/MM/YYYY h:mm a")})]})]})})}))]}),Object(n.jsxs)(O.a,{fullWidth:!0,maxWidth:"md",open:P,onClose:function(){R(!1),q({})},"aria-labelledby":"max-width-dialog-title",children:[G?Object(n.jsx)("div",{style:{margin:"1em"},children:Object(n.jsx)(Be.a,{variant:"rect",height:35})}):Object(n.jsx)(v.a,{id:"max-width-dialog-title",children:"".concat(ae("alerts:notifications.received")," ").concat(1===parseInt(W.tipo_producto)?ae("alerts:notifications.new-badge"):2===parseInt(W.tipo_producto)?ae("alerts:notifications.new-certificate"):ae("alerts:notifications.new-carnet"))}),Object(n.jsxs)(_.a,{children:[Object(n.jsx)("div",{className:p.container_center,children:G?Object(n.jsx)(Be.a,{variant:"rect",width:600}):Object(n.jsx)(ht.a,{className:p.text_message,children:"".concat(ae("alerts:notifications.msg-invite")," ").concat(1===parseInt(W.tipo_producto)?ae("alerts:notifications.badge"):2===parseInt(W.tipo_producto)?ae("alerts:notifications.certificate"):ae("alerts:notifications.carnet"))})}),Object(n.jsx)("div",{className:p.container__img,children:G?Object(n.jsx)("div",{style:{margin:"1em"},children:Object(n.jsx)(Be.a,{variant:1===parseInt(W.tipo_producto)?"circle":"rect",width:110,height:110})}):Object(n.jsx)(g.a,{variant:"square",src:1===parseInt(W.tipo_producto)?null===(t=W.insigniasEmitidas)||void 0===t?void 0:t.photoBadge:2===parseInt(W.tipo_producto)?null===(a=W.certificadosEmitidos)||void 0===a?void 0:a.photoCertificate:3===parseInt(W.tipo_producto)?null===(r=W.carnetsEmitidos)||void 0===r?void 0:r.photoCarnet:"",className:2===parseInt(W.tipo_producto)?p.img_cred_dialog_certificate:p.img_cred_dialog})}),Object(n.jsx)("br",{}),Object(n.jsx)("div",{className:p.container_center,children:G?Object(n.jsx)(Be.a,{variant:"rect",height:60,width:200}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ht.a,{className:p.text_message,children:ae("alerts:notifications.issued-by")}),Object(n.jsx)(g.a,{variant:"square",src:W.organizationPhoto,className:p.img_org_dialog})]})}),Object(n.jsx)("br",{}),Object(n.jsx)("div",{className:"text-center",children:G?Object(n.jsx)(Be.a,{variant:"rect",width:800,height:50}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(p.button),type:"submit",onClick:function(){$(!0),1===parseInt(W.tipo_producto)?Ce.a.get("/badgesIssued/accept/".concat(W.id_insignias)).then((function(e){R(!1),ne(),q({}),ce(),le(W.id),A(T.filter((function(e){return e.id!==W.id}))),$(!1),F.a.fire({text:e.data.message,icon:"success",iconColor:E.a.primary,confirmButtonText:ae("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}})})).catch((function(e){R(!1),ne(),q({}),$(!1),F.a.fire({text:ae("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})})):2===parseInt(W.tipo_producto)?Ce.a.get("/certificatesIssued/accept/".concat(W.id_certificados)).then((function(e){R(!1),ne(),q({}),oe(),le(W.id),A(T.filter((function(e){return e.id!==W.id}))),$(!1),F.a.fire({text:e.data.message,icon:"success",iconColor:E.a.primary,confirmButtonText:ae("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}})})).catch((function(){R(!1),ne(),q({}),$(!1),F.a.fire({text:ae("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})})):3===parseInt(W.tipo_producto)&&Ce.a.get("/carnetsIssued/accept/".concat(W.id_carnets)).then((function(e){R(!1),ne(),q({}),se(),le(W.id),A(T.filter((function(e){return e.id!==W.id}))),$(!1),F.a.fire({text:e.data.message,icon:"success",iconColor:E.a.primary,confirmButtonText:ae("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}})})).catch((function(){R(!1),ne(),q({}),$(!1),F.a.fire({text:ae("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})}))},children:3===parseInt(W.tipo_producto)?ae("alerts:notifications.see-card"):ae("alerts:notifications.accept")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(p.button),onClick:function(){$(!0),1===parseInt(W.tipo_producto)?Ce.a.get("/badgesIssued/reject/".concat(W.id_insignias)).then((function(e){R(!1),ne(),q({}),le(W.id),A(T.filter((function(e){return e.id!==W.id}))),$(!1),F.a.fire({text:e.data.message,icon:"success",iconColor:E.a.primary,confirmButtonText:ae("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}})})).catch((function(){R(!1),ne(),q({}),$(!1),F.a.fire({text:ae("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})})):2===parseInt(W.tipo_producto)?Ce.a.get("/certificatesIssued/reject/".concat(W.id_certificados)).then((function(e){R(!1),ne(),q({}),le(W.id),A(T.filter((function(e){return e.id!==W.id}))),$(!1),F.a.fire({text:e.data.message,icon:"success",iconColor:E.a.primary,confirmButtonText:ae("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}})})).catch((function(){R(!1),ne(),q({}),$(!1),F.a.fire({text:ae("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})})):3===parseInt(W.tipo_producto)&&(le(W.id),$(!1),j.push("/helpCenter/carnet/".concat(Object(Ie.b)(W.id_carnets))))},children:3===parseInt(W.tipo_producto)?ae("alerts:notifications.report-error"):ae("alerts:notifications.reject")})]})})]})]}),Object(n.jsx)(_t,{loading:Z})]})})),Bt={fontSize:"1em",marginRight:".5em"},St=Object(C.a)((function(e){return{appbar:{backgroundColor:e.palette.background.main},appbar__toolbar_logocontainer:{width:"100%",marginLeft:"0px"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:5,padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},buttonOrganization:{color:E.a.primary,backgroundColor:"white",borderRadius:5,margin:"8px 100px"},menuButton:{marginRight:e.spacing(2)},appbar__toolbar_logocontainer_img:Object(b.a)({display:"block",width:"8em"},e.breakpoints.up("sm"),{display:"block",width:"12em"}),appbar__toolbar_sectionDesktop:Object(b.a)({color:"#ffffff",display:"none"},e.breakpoints.up("md"),{display:"flex",right:"2vw"}),appbar__toolbar_sectionMobile:Object(b.a)({display:"flex",color:"#ffffff"},e.breakpoints.up("md"),{display:"none"}),appbar__toolbar_button_session:Object(b.a)({display:"none"},e.breakpoints.up("md"),{display:"block",width:"10em",height:32,color:e.palette.primary.main,border:"2px solid",borderRadius:20,background:"transparent",fontWeight:"bold","&:hover":{color:"#4a4a4a"}}),icon:{fontSize:"1em",marginRight:".5em"},textMenu:{},drawer:{width:240,flexShrink:0},drawer__paper:{width:240,backgroundColor:E.a.background},buttonClose:{margin:".9em .1em .9em 0",float:"right",color:"#ffffff",backgroundColor:E.a.secondary},buttonClose_setionDesktop:Object(b.a)({display:"none"},e.breakpoints.up("md"),{display:"flex",margin:".9em .1em 0.9em 0",float:"right",color:"#ffffff",backgroundColor:E.a.secondary}),mySwal:{zIndex:3e3},accountCircle:{"&:focus":{outline:"none"},"&:hover":{backgroundColor:"transparent"}},container__profile:Object(b.a)({display:"flex",flexDirection:"column",alignItems:"center"},e.breakpoints.up("sm"),{flexDirection:"row",justifyContent:"initial",alignItems:"initial"}),container__avatar:Object(b.a)({borderRadius:"100%",margin:".5em"},e.breakpoints.up("sm"),{marginBottom:0}),container__welcome:{display:"flex",flexDirection:"column",justifyContent:"center",margin:"0 .5em -1em .5em"},container__welcome_message:{margin:0},container__welcome_name:{fontWeight:"bold",textTransform:"uppercase",marginLeft:"1px"}}})),Tt={changePermissions:I.c,setOrganizationId:I.B},At=Object(s.b)((function(e){return{user:e.user,styles:e.styles}}),Tt)((function(e){var t,a,r,c,o,s,l,m,b,p,j,x,O,v,_,y,w,C,k,N=e.changePermissions,B=e.user,T=e.setOrganizationId,A=e.closeButton,z=e.handleClose,P=e.styles,R=e.signature,M=St(),L=Object(u.g)(),ie=Object(i.useState)(null),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)(null),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Boolean(ce),be=Boolean(de),pe=Object(i.useState)(!1),fe=Object(d.a)(pe,2),he=fe[0],ge=fe[1],xe=Object(i.useState)(null),Oe=Object(d.a)(xe,2),ve=Oe[0],_e=Oe[1],ye=new bt.a("logout"),we=Object(D.a)(["appBar","alerts","buttons"]),ke=Object(d.a)(we,1)[0],Ne=function(){ue(null)},Be=function(){oe(null),_e(null),Ne()},Se=function(e){_e(e.currentTarget)},Te=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/permission/getPermissions",{id_organizacion:t});case 2:i=e.sent,r=i.data,N(r.permissions.permissions),T(t),oe(null),_e(null),4===(null===B||void 0===B||null===(a=B.data_user)||void 0===a||null===(n=a.gruposUsuariosOrganizaciones[0])||void 0===n?void 0:n.id_grupos_usuarios)?L.push("/issue"):t===je.a.idMinciencias||31===t||38===t?L.push("/certificates/published"):L.push("/templates/published");case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ae=function(e){var t=document.createElement("a");t.href=e,t.click()},Ee=function(){oe(!1),F.a.fire({text:ke("alerts:alerts.exit"),icon:"question",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ke("buttons:buttons.exit"),cancelButtonText:ke("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:M.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value&&(window.location.pathname.includes("dashboard")||window.location.pathname.includes("organization")?(Object(I.i)(),N(),L.push("/"),ye.postMessage("CerrarSesion")):ye.postMessage("CerrarSesion"));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},Ie="primary-search-account-menu",De=Object(n.jsxs)(U.a,{anchorEl:ce,anchorOrigin:{vertical:"top",horizontal:"right"},id:Ie,keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:me,onClose:Be,children:[Object(n.jsxs)("div",{className:M.container__profile,children:[Object(n.jsx)(g.a,{src:null===B||void 0===B||null===(t=B.data_user)||void 0===t?void 0:t.linkPhoto,className:M.container__avatar}),Object(n.jsxs)("div",{className:M.container__welcome,children:[Object(n.jsx)("p",{className:M.container__welcome_message,children:ke("appBar.welcome")}),Object(n.jsx)("p",{className:M.container__welcome_name,children:"".concat(null===B||void 0===B||null===(a=B.data_user)||void 0===a?void 0:a.primer_nombre," ").concat(null===B||void 0===B||null===(r=B.data_user)||void 0===r?void 0:r.primer_apellido)})]})]}),Object(n.jsx)(W.a,{}),Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:function(e){return Ae("/dashboard")},children:[Object(n.jsx)(G.a,{sx:Bt}),ke("appBar.dashboard")]}),Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:function(e){return Ae("/account/changePassword")},children:[Object(n.jsx)(Q.a,{sx:Bt}),ke("appBar.change-password")]}),Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:function(e){return Ae("/profileSettings")},children:[Object(n.jsx)(J.a,{sx:Bt}),ke("appBar.edit-profile")]}),Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:function(e){return Ae("/account/combine")},children:[Object(n.jsx)(X.a,{sx:Bt}),ke("appBar.combination")]}),(null===B||void 0===B||null===(c=B.data_user)||void 0===c?void 0:c.gruposUsuariosOrganizaciones.some((function(e){return e.id_organizaciones>0})))&&3!==(null===B||void 0===B||null===(o=B.data_user)||void 0===o?void 0:o.gruposUsuariosOrganizaciones[0].id_grupos_usuarios)&&Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:1===(null===B||void 0===B||null===(s=B.data_user)||void 0===s||null===(l=s.gruposUsuariosOrganizaciones[0])||void 0===l?void 0:l.id_grupos_usuarios)?function(){return Ae("/templates/published")}:(null===B||void 0===B||null===(m=B.data_user)||void 0===m?void 0:m.gruposUsuariosOrganizaciones.length)>1?Se:function(){var e,t;return Te(null===B||void 0===B||null===(e=B.data_user)||void 0===e||null===(t=e.gruposUsuariosOrganizaciones[0])||void 0===t?void 0:t.id_organizaciones)},children:[Object(n.jsx)(Z.a,{sx:Bt}),ke("appBar.admin")]}),Object(n.jsx)(W.a,{}),Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:Ee,children:[Object(n.jsx)($.a,{sx:Bt}),ke("appBar.logout")]})]}),ze="primary-search-account-menu-mobile",Pe=Object(n.jsx)(U.a,{anchorEl:de,anchorOrigin:{vertical:"top",horizontal:"right"},id:ze,keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:be,onClose:Ne,children:B?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("div",{className:M.container__profile,children:[Object(n.jsx)(g.a,{src:null===B||void 0===B||null===(b=B.data_user)||void 0===b?void 0:b.linkPhoto,className:M.container__avatar}),Object(n.jsxs)("div",{className:M.container__welcome,children:[Object(n.jsx)("p",{className:M.container__welcome_message,children:ke("appBar.welcome")}),Object(n.jsx)("p",{className:M.container__welcome_name,children:"".concat(null===B||void 0===B||null===(p=B.data_user)||void 0===p?void 0:p.primer_nombre," ").concat(null===B||void 0===B||null===(j=B.data_user)||void 0===j?void 0:j.primer_apellido)})]})]}),Object(n.jsx)(W.a,{}),Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:function(e){return Ae("/dashboard")},children:[Object(n.jsx)(G.a,{sx:Bt}),ke("appBar.dashboard")]}),Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:function(e){return Ae("/account/changePassword")},children:[Object(n.jsx)(Q.a,{sx:Bt}),ke("appBar.change-password")]}),Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:function(e){return Ae("/profileSettings")},children:[Object(n.jsx)(J.a,{sx:Bt}),ke("appBar.edit-profile")]}),Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:function(e){return Ae("/account/combine")},children:[Object(n.jsx)(X.a,{sx:Bt}),ke("appBar.combination")]}),(null===B||void 0===B||null===(x=B.data_user)||void 0===x?void 0:x.gruposUsuariosOrganizaciones.some((function(e){return e.id_organizaciones>0})))&&Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:1===(null===B||void 0===B||null===(O=B.data_user)||void 0===O||null===(v=O.gruposUsuariosOrganizaciones[0])||void 0===v?void 0:v.id_grupos_usuarios)?function(){return Ae("/templates/published")}:(null===B||void 0===B||null===(_=B.data_user)||void 0===_?void 0:_.gruposUsuariosOrganizaciones.length)>1?Se:function(){var e,t;return Te(null===B||void 0===B||null===(e=B.data_user)||void 0===e||null===(t=e.gruposUsuariosOrganizaciones[0])||void 0===t?void 0:t.id_organizaciones)},children:[Object(n.jsx)(Z.a,{sx:Bt}),ke("appBar.admin")]}),Object(n.jsx)(W.a,{}),Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:Ee,children:[Object(n.jsx)($.a,{sx:Bt}),ke("appBar.logout")]})]}):Object(n.jsxs)(Y.a,{className:M.textMenu,onClick:function(){return L.push("/sign-in")},children:[Object(n.jsx)($.a,{sx:Bt}),ke("buttons:buttons.sign-in")]})}),Re=Object(n.jsx)(U.a,{id:"simple-menu",anchorEl:ve,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(ve),onClose:Be,children:null===B||void 0===B||null===(y=B.data_user)||void 0===y?void 0:y.gruposUsuariosOrganizaciones.map((function(e){var t;return Object(n.jsx)(Y.a,{className:M.textMenu,onClick:function(){return Te(e.id_organizaciones)},children:null===(t=e.organizaciones)||void 0===t?void 0:t.nombre},"menu-".concat(e.id))}))}),Me=function(){ge(!he)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(q.a,{className:M.appbar,position:"static",elevation:0,children:Object(n.jsxs)(H.a,{children:[B&&3!==(null===(w=B.data_user)||void 0===w||null===(C=w.gruposUsuariosOrganizaciones[0])||void 0===C?void 0:C.id_grupos_usuarios)&&Object(n.jsx)("div",{className:M.appbar__toolbar_sectionMobile,children:Object(n.jsx)(S.a,{edge:"start",onClick:Me,color:"#000","aria-label":"menu",children:Object(n.jsx)(ee.a,{})})}),Object(n.jsx)("div",{className:M.appbar__toolbar_logocontainer,children:Object(n.jsx)("img",{src:null===P||void 0===P?void 0:P.logo_blanco,alt:"logo",className:M.appbar__toolbar_logocontainer_img})}),Object(n.jsx)(jt,{}),B?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Nt,{}),Object(n.jsxs)("div",{className:M.appbar__toolbar_sectionDesktop,children:[Object(n.jsxs)(S.a,{className:M.accountCircle,"aria-label":"account of current user","aria-controls":Ie,"aria-haspopup":"true",onClick:function(e){oe(e.currentTarget)},color:"#000",children:[Object(n.jsx)(g.a,{src:null===B||void 0===B||null===(k=B.data_user)||void 0===k?void 0:k.linkPhoto}),Object(n.jsx)(te.a,{})]}),A&&Object(n.jsx)(K.a,{title:"Cerrar",children:Object(n.jsx)(S.a,{className:M.buttonClose,onClick:function(){return z(!1)},children:Object(n.jsx)(ae.a,{})})})]})]}):A?Object(n.jsx)(K.a,{title:"Cerrar",children:Object(n.jsx)(S.a,{className:M.buttonClose_setionDesktop,onClick:function(){return z(!1)},children:Object(n.jsx)(ae.a,{})})}):!R&&Object(n.jsx)("button",{className:M.appbar__toolbar_button_session,onClick:function(){return L.push("/sign-in")},children:ke("buttons:buttons.sign-in")}),Object(n.jsx)("div",{className:M.appbar__toolbar_sectionMobile,children:A?Object(n.jsx)(K.a,{title:"Cerrar",children:Object(n.jsx)(S.a,{className:M.buttonClose,onClick:function(){return z(!1)},children:Object(n.jsx)(ae.a,{})})}):Object(n.jsx)(S.a,{"aria-label":"show more","aria-controls":ze,"aria-haspopup":"true",onClick:function(e){ue(e.currentTarget)},children:Object(n.jsx)(ne.a,{})})})]})}),Pe,De,Re,Object(n.jsx)(V.a,{className:M.drawer,variant:"temporary",anchor:"left",open:he,onClose:Me,classes:{paper:M.drawer__paper},color:"#000",children:Object(n.jsx)(ut,{})})]})}));var Et=Object(C.a)((function(e){return{badge:{display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:e.palette.tertiary.main,borderRadius:"10px",height:280,width:230,cursor:"pointer"},badge__image:{width:120,height:120,borderRadius:"100%",margin:"25px 0px"},badge__name:{fontSize:"1.3em",marginBottom:0,color:"#676767",textAlign:"center"},badge__name_font_small:{fontSize:"0.8em",marginBottom:0,color:"#676767",textAlign:"center"},badge__name_private:{marginBottom:0,color:"#676767",textAlign:"center"},badge__organization_name_font_small:{fontSize:"0.8em",color:e.palette.primary.main,textAlign:"center",marginBottom:"1em"}}})),It=function(e){var t=Et(),a=e.badgeImage,i=e.badgeName,r=e.badgePrivateName,c=e.organizationName,o=e.issuedId,s=e.publicBadge,l=e.templateBadge,d=void 0!==l&&l,m=e.templateCertificate,b=void 0!==m&&m,p=Object(u.g)();return Object(n.jsxs)("div",{className:t.badge,onClick:function(){s?d?(p.push("/template/".concat(o)),window.location.reload()):p.push("/badges/".concat(o)):d?(p.push("/templates/published/details/".concat(o)),window.location.reload()):b?(p.push("/certificates/details/".concat(o)),window.location.reload()):p.push("/badge/".concat(o))},children:[Object(n.jsx)("img",{src:a,alt:"badge",className:t.badge__image}),Object(n.jsx)("p",{className:t.badge__organization_name_font_small,children:c}),Object(n.jsx)("h3",{className:(null===i||void 0===i?void 0:i.length)>30?t.badge__name_font_small:t.badge__name,children:i}),Object(n.jsx)("h6",{className:t.badge__name_private,children:r})]})};var Dt=Object(C.a)((function(e){return{certificate:Object(b.a)({display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:e.palette.tertiary.main,borderRadius:"10px",height:343,width:253,cursor:"pointer"},e.breakpoints.up("sm"),{display:"flex",flexDirection:"column",alignItems:"center",borderRadius:"10px",height:400,width:323,cursor:"pointer"}),certificate__image_horizontal:Object(b.a)({marginTop:"0.5em",marginBottom:"2em",height:"150px","& img":{height:"min-content"}},e.breakpoints.up("md"),{marginTop:"0.5em",marginBottom:"2em",height:"200px","& img":{height:"min-content"}}),certificate__image_Vertical:Object(b.a)({border:function(e){return e.isDocument&&"1px solid #F3F3F3"},borderRadius:function(e){return e.isDocument&&"10px"},margin:".5em .5em",height:"150px","& img":{height:"min-content"}},e.breakpoints.up("sm"),{margin:".5em .5em",height:"260px","& img":{height:"min-content"}}),certificate__image_template:Object(b.a)({marginTop:"0.5em",marginBottom:"2em",height:"150px",maxWidth:"-webkit-fill-available","& img":{height:"min-content"}},e.breakpoints.up("sm"),{marginTop:"0.5em",marginBottom:"2em",height:"225px",maxWidth:"-webkit-fill-available","& img":{height:"min-content"}}),certificate__name:{fontSize:"1.3em",marginBottom:0,color:"#676767",textAlign:"center"},certificate__name_font_small:{fontSize:"0.8em",marginBottom:0,color:"#676767",textAlign:"center"},certificate__name_private:{marginBottom:0,color:"#676767",textAlign:"center"},certificate__organization_name_font_small:{fontSize:"0.8em",color:e.palette.primary.main,textAlign:"center",marginBottom:"1em"},nameWait:{color:"rgba(0, 0, 0, 0.54)",fontSize:"0.875rem"}}})),zt=function(e){var t=e.certificateImage,a=e.certificateName,i=e.certificatePrivateName,r=e.organizationName,c=e.issuedId,o=e.publicCertificate,s=e.templateCertificate,l=void 0!==s&&s,d=e.format,m=e.open,b=e.certificateId,p=e.openDialogCertificate,j=e.setRecommendation,f=e.isCarnets,h=e.isDocument,g=void 0!==h&&h,x=e.waitDocument,O=Dt({isDocument:g}),v=Object(u.g)(),_=function(){m(!0)};return Object(n.jsxs)("div",{className:O.certificate,onClick:function(){if(c)if(o)if(l)p?(j(c),m(!1),setTimeout((function(){_()}),300)):(m(!0),b(c));else{var e=document.createElement("a");e.href="/".concat(f?"carnet":"certificate","/").concat(c),e.target="blank",e.click()}else l?(v.push("/".concat(f?"carnets":"certificates","/details/").concat(c)),window.location.reload()):(m(!0),b(c))},children:[l?Object(n.jsx)("img",{src:t,alt:"certificate",className:O.certificate__image_template}):Object(n.jsx)(n.Fragment,{children:Object(n.jsx)("img",{src:t,alt:"certificate",className:0===d?O.certificate__image_Vertical:O.certificate__image_horizontal})}),Object(n.jsx)("p",{className:O.certificate__organization_name_font_small,children:r}),Object(n.jsx)("h3",{className:a.length>75?O.certificate__name_font_small:O.certificate__name,children:a}),""!==x&&Object(n.jsx)("p",{className:O.nameWait,children:x}),Object(n.jsx)("h6",{className:O.certificate__name_private,children:i})]})},Pt=a(89),Rt=a(1144),Mt=a(1147),Lt=a(1237),Ft=a(1145),Ut=a(1146),Wt=a(1148),Yt=a(1149),qt=a(50),Ht=a(66),Kt=a(79),Vt=a(239),Gt=a.p+"static/media/icon_revocado.31c761a7.png",Qt=a.p+"static/media/icon_expirado.e0cba703.png",Jt=a.p+"static/media/icon_verified.41b5e4ac.png",Xt=a.p+"static/media/icon_revoked.f86fb3b5.png",Zt=a.p+"static/media/icon_expired.3317b845.png",$t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAvCAYAAABzJ5OsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAWuSURBVHgB7Zl5bBRVHMe/Mzul3YJLtwItSoV6QQuWSoGAFTlMbw7jFVTiEaIGL2iRAkFwkEMpSIES0UQjKhhDjCYC2opIFUJIhFoUSgkmIFaBSmgp7RbK7nv8Zuix5+zuzLT9p59kZt+1M9+8fcfvfRfooXsQ0BnIcjSssbFgLgmi1ILmuIuQn2yByZgjft3GNHBk0+PGg7HREIQ4P61q6DpB7fZBYGUozK+AQfSLl4tjYBVmk9BZlEtF+FQD0ho4HN9DXlALHYQv/u1NNtiEfLhYAeVsMIxwmW4lcFxaRcPtaljfDKcxiorTAfEDSqXAfE7THJmGRQXHQ/2CGGpDFG16i5ofQOcIV0iEaDmGtRsXh/qF4D0vyyL62NeBIR9dhYAVaKqT6d1Mq5mEYFjtcpcKV+BYiuhYpWOXajWzaFVizebFEPg76B4eQkauC3t++DVQg8DD5r31w9UxGIC8uxLxYspw9LNG4TpjYJzDyejiDE4XUz+VcheVtSh5xm7WMxfVcZxtaMCGw5XUyUFgUjoWvXowdPGyHIVoexWUSeSH50YkYWtOBoywveokqi/VYeORSlxp0dx8/0CTMAHL32jwrvC/2ljttLL4F66wZPwYGOXM5QZsPVaFwrFpEAXNdSMF0bzAX4Wv+FUb4mjXfA0a3BMTA6PYrZGIliQcuVCLr2fkaDcWaMFQdnQvfFcbScil6d4XncwrqSnqFSI2WC2z6fN990Jf8QIKYZC/6i/jqtOpppVJGhMViSG2W2AIgSsxlIb4os2jANcwGOTlsr34+WxNe35W8jB8kZcJg6Sq0eubc4+0FXiOecGVBRPwnoAuzmAKnGV7vMezEpNhApLo+VjGgq7mocEs492z3qtNEkxA9Fr5XNwk8QLSPN7TnpLlXnQfBBMQBc8+UXZXc+DxHu9pT0m2/jDIR0eP4amdpais/d+j/NC5C5j2zXf4kOpN+g1UOsRbhAgY5HkKG2odDtRcafQoP9/UpMY+L1EsZOaJv0O8aHHCIJEWC76anoOsxMEe5RmDE/BZbmawMCBsOsTv//ESTKC/1Ypdj05D7p1D1PzkOwZh9+MzKPq0wmw6xO/a5aD7eZiAslRum5qFZQ+Mxfap2YgQQz9tBqHGPeP9VMNeShv2yEgsTx+Hgb2jYRqcfB83vHZYdhA6UQ8jdPHWNV1Js9Y0b827l+lkn3tG8lJQRsvBSujg8+PVePfQb4iNikLRpAdRWH4AtsheGNm/H56lVShjx7cYHR+H+WPux6QEnduJ4rS54dnzCwsO070SOnk6aSjmpqVix8lTar7siUdwgk5L/15pwhSauJ/S6Uu3cMVh87IIfWeSyLdBJ9uqqrHl6J94fdTI9rK+1PvKMe/QufNYUL4f9deuQRccRd5FvuIt/BMaOg3QgRL6/jLzMdxrv3no2V/zH/V6I+6m/JSEBLXnY2gihw9Zgs29dnuX+orPz68nn6YYGii7qDcpNLYnJNzenn/hvmT8dOYsNkyZiNv69FbdhkCcqqtHEEogz/ExY/37NtNzK+BEHqX8WdXqKaltE2pjIAlM7Nvhu6bFD1A3qHhaKntHRGDYrXYEYj4Np6O1FwNVn4ajbibKy30igMD79eqSdEjsQKDqZ5KHUu8OJ2HBTbdAXGhqRklFJfb+/U/gRpJrBAr8m6/awYZqrvIV6Db4EhTOWx2oVtvuU6y2zGyafcI4dDWczNaF8zStRm3xCntKy5CZo7SbiC6DryThy4K1Ci5eYU/pPmRkX6df4GF0NhzLSLgcStPwAuz1ZL46LTuhYQXqRiBP0oU5WDQ35PgqvFhVmfUOWzL1zqrW/5LMoIGetxyNZKaGIVxB/9Fm7ZYBYC15rQ5b+EaVIPxOIeiXcLCPIecH3aX8PgJmUFQ8ClzMIktuMriQRE/1F33RQYdXkOiDVF/q7nz10EMXcgOJDNES0wJKEAAAAABJRU5ErkJggg==",ea=a(152),ta=a(1257),aa=a(318),na=a.n(aa);ea.c.GlobalWorkerOptions.workerSrc=na.a;var ia=Object(C.a)((function(e){return{container:Object(b.a)({display:"flex",justifyContent:"center"},e.breakpoints.down("xs"),{display:"none"}),pagination:{marginTop:"3px",position:"absolute"},mobile:Object(b.a)({display:"none",justifyContent:"center"},e.breakpoints.down("xs"),{display:"flex"}),img:{maxWidth:"50vh"},document:{"& div .react-pdf__Page__annotations":{display:"none"},"& canvas":{marginTop:"2em"}},documentNoPagination:{"& div .react-pdf__Page__annotations":{display:"none"}}}})),ra=function(e){var t=e.pdf,a=e.img,r=ia(),c=Object(i.useState)(null),o=Object(d.a)(c,2),s=o[0],l=o[1],u=Object(i.useState)(0),m=Object(d.a)(u,2),b=m[0],p=m[1];return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(Rt.a,{className:r.container,children:[Object(n.jsx)(ea.a,{file:t,options:{workerSrc:"/pdf.worker.js"},onLoadSuccess:function(e){var t=e.numPages;l(t),p(1)},className:s>1?r.document:r.documentNoPagination,children:Object(n.jsx)(ea.b,{pageNumber:b},"page_".concat(b))}),s>1&&Object(n.jsx)("div",{className:r.pagination,children:Object(n.jsx)(Lt.a,{component:"span",display:"flex",justifyContent:"center",children:Object(n.jsx)(ta.a,{orientation:"vertical",color:"secondary",count:s,page:b,onChange:function(e,t){p(t)},defaultPage:1,size:"small"})})})]}),Object(n.jsx)("div",{className:r.mobile,children:Object(n.jsx)("img",{src:a,alt:"certificate-img",className:r.img})})]})},ca=function(e){return Object(n.jsx)("ul",{children:e.split("-").slice(1).map((function(e){return Object(n.jsx)("li",{children:e})}))})},oa=a.p+"static/media/icons8-twitterx.e389721d.svg";var sa={color:"#ffffff",float:"right"},la=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"1em"},img_verificado:{display:"inline-block",height:e.spacing(5),margin:"auto"},img:{maxWidth:"-webkit-fill-available"},textBolder:{marginTop:"1em",color:"#000000",fontWeight:"bold",display:"inline"},textTitle:{color:"#000000",fontWeight:"bold",marginLeft:"2em"},textName:{color:"#000000",fontWeight:"bold"},textNameOrganization:{color:"#000000",fontWeight:"bold",marginLeft:"4em"},text:{color:"#000000"},textParagraph:{textAlign:"justify",color:"#000000",margin:"1em 0 1em 0"},link:{color:E.a.primary,marginLeft:"2em",textDecoration:"underline"},linkOrganization:{color:E.a.primary,marginLeft:"4em",textDecoration:"underline"},button:Object(b.a)({margin:"0px 5px",display:"block",textAlign:"center",backgroundColor:E.a.primary,marginBottom:"1em",borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}},e.breakpoints.up("sm"),{display:"inline",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",marginTop:"1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}}),buttonVerificate:Object(b.a)({display:"block",textAlign:"center",marginBottom:"1em",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}},e.breakpoints.up("sm"),{marginBottom:"0",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}}),container_redes:Object(b.a)({marginBottom:"1em"},e.breakpoints.up("sm"),{marginBottom:"0"}),containerButtonToCopy:Object(b.a)({borderColor:E.a.primary,marginTop:"1em",marginBottom:"1em",padding:".4em 3em",maxWidth:"-webkit-fill-available"},e.breakpoints.up("sm"),{borderColor:E.a.primary,margin:"1em",padding:".4em 1em"}),WhatsAppIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00d954",marginLeft:".7em","&:hover":{backgroundColor:"#009B3C"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#00d954",marginLeft:".7em","&:hover":{backgroundColor:"#009B3C"}}),LinkedInIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#018ec5",marginLeft:".7em","&:hover":{backgroundColor:"#005374"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#018ec5",marginLeft:".7em","&:hover":{backgroundColor:"#005374"}}),LinkedInIconMenu:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#018ec5","&:hover":{backgroundColor:"#018ec5"}},textLinkedMenu:{fontSize:".8em",marginLeft:".5em"},TwitterIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0080A0"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0080A0"}}),FacebookIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#0080ff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#0080ff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}}),TelegramIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}}),PdfIcon:Object(b.a)({width:e.spacing(0),height:e.spacing(0),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}}),PdfIconImage:{height:"45px"},grid:{backgroundColor:E.a.footer,marginBottom:"1em"},skeleton:{marginLeft:"auto",marginRight:"auto"},card:{borderRadius:"10px",borderColor:"#ffffff",backgroundColor:"white",paddingBottom:2,marginTop:"1.5em"},img_user:{width:e.spacing(10),height:e.spacing(10)},img_org:{width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},cardContent:{padding:"0"},textBolderDate:{marginTop:"2.7em",color:"#000000",fontWeight:"bold",marginLeft:".4em"},menuItem:{borderRadius:10,padding:10,marginBottom:10,cursor:"pointer",backgroundColor:E.a.primary},textMenuItem:{color:"#ffffff",fontWeight:"bold"},expandeMenuItem:{color:"#ffffff",float:"right"},descriptions:{justifyContent:"center",borderRadius:10,backgroundColor:"#fafafa",textAlign:"center"},content_descriptions:{margin:"1em"},descriptions_fields:{justifyContent:"left",borderRadius:10,backgroundColor:"#fafafa",textAlign:"center"},content_descriptions_fields:{margin:"1em",whiteSpace:"pre-line",textAlign:"left",justifyContent:"left"},footer:{justifyContent:"center",marginTop:10,padding:10,backgroundColor:"#fafafa",textAlign:"center"},linkAdicional:{float:"right",marginRight:"5em"},mySwal:{zIndex:3e3},container_text_chip_right:Object(b.a)({textAlign:"center"},e.breakpoints.up("lg"),{textAlign:"right"}),container_text_chip_left:Object(b.a)({textAlign:"center"},e.breakpoints.up("lg"),{textAlign:"left"}),xtwitterIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#2f3136",marginLeft:".7em","&:hover":{backgroundColor:"#000"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5)})}})),da={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},ua={setCertificate:I.o},ma=Object(s.b)((function(e){return{user:e.user,certificate:e.certificate||{},styles:e.styles}}),ua)((function(e){var t,a,r,c,o,s,l,b,p,j,x,O,v,_,y,w,C,k,N,B,T,A,I,z,P,R,M,L,W,q,H,K,V,G,Q,J=e.user,X=e.certificate,Z=e.setCertificate,$=e.certificateId,ee=e.setOpenDialog,te=e.styles,ae=la(),ne=Object(u.g)(),ie=Object(i.useState)([!1,""]),re=Object(d.a)(ie,2),oe=re[0],se=re[1],le=Object(i.useState)(!1),de=Object(d.a)(le,2),ue=de[0],me=de[1],be=Object(i.useState)({}),pe=Object(d.a)(be,2),he=pe[0],ge=pe[1],xe=Object(i.useState)({}),Oe=Object(d.a)(xe,2),ke=Oe[0],Se=Oe[1],Te=Object(i.useState)({}),Ae=Object(d.a)(Te,2),Ee=Ae[0],De=Ae[1],ze=Object(i.useState)([]),Pe=Object(d.a)(ze,2),Re=Pe[0],Me=Pe[1],Le=Object(i.useState)([]),Fe=Object(d.a)(Le,2),Ue=Fe[0],We=Fe[1],Ye=Object(i.useState)([]),qe=Object(d.a)(Ye,2),He=qe[0],Ke=qe[1],Ve=Object(i.useState)(""),Ge=Object(d.a)(Ve,2),Qe=Ge[0],Je=Ge[1],Xe=Object(i.useState)(!1),Ze=Object(d.a)(Xe,2),$e=Ze[0],et=Ze[1],tt=Object(i.useState)(!1),at=Object(d.a)(tt,2),nt=at[0],it=at[1],rt=Object(i.useState)(!1),ct=Object(d.a)(rt,2),ot=ct[0],st=ct[1],lt=Object(i.useState)(!1),dt=Object(d.a)(lt,2),ut=dt[0],mt=dt[1],bt=Object(i.useState)(!1),pt=Object(d.a)(bt,2),jt=pt[0],ft=pt[1],ht=Object(i.useState)(null),gt=Object(d.a)(ht,2),xt=gt[0],Ot=gt[1],vt=Boolean(xt),_t=Object(i.useState)({}),yt=Object(d.a)(_t,2),wt=yt[0],Ct=yt[1],kt="primary-search-account-menu",Nt="",Bt="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2)),St=Object(D.a)(["certificateBadgeTemplate","buttons"]),Tt=Object(d.a)(St,1)[0];null===J&&ne.push("/"),Object(i.useEffect)((function(){Et().catch((function(){ne.push("/500"),window.location.reload()}))}),[]),Object(i.useEffect)((function(){!ue&&window.GS&&GS.reset()}),[ue]);var Et=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o,s,l,d,u,b,p,j,h,g,x,O,v,_,y,w,C,k,N,B,S,T,A,E;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return me(!0),T=Object(Ie.a)($),e.next=4,Ce.a.get("/certificates/getCertificate/".concat(T));case 4:A=e.sent,E=A.data.data,Z(Object(m.a)(Object(m.a)({},E.certificate),{},{pdfCertificate:E.pdfCertificate,photoUser:E.photoUser,photoOrganization:E.photoOrganization,resizingPhotoCertificate:E.resizingPhotoCertificate})),It(null===(t=E.certificate)||void 0===t||null===(a=t.certificadosEmitidos)||void 0===a?void 0:a.plantillasCertificados.nivel_vp),Dt(null===(n=E.certificate)||void 0===n||null===(i=n.certificadosEmitidos)||void 0===i?void 0:i.plantillasCertificados.tiempo_vp),zt(null===(r=E.certificate)||void 0===r||null===(c=r.certificadosEmitidos)||void 0===c?void 0:c.plantillasCertificados.costo_vp),Me(null===(o=E.certificate)||void 0===o||null===(s=o.certificadosEmitidos)||void 0===s||null===(l=s.plantillasCertificados)||void 0===l?void 0:l.plantillasHabilidades),We(null===(d=E.certificate)||void 0===d||null===(u=d.certificadosEmitidos)||void 0===u||null===(b=u.plantillasCertificados)||void 0===b?void 0:b.criterios),Ke(null===(p=E.certificate)||void 0===p||null===(j=p.certificadosEmitidos)||void 0===j||null===(h=j.plantillasCertificados)||void 0===h?void 0:h.certificadoCamposAdicionales),Ct(null!==(null===(g=E.certificate)||void 0===g||null===(x=g.certificadosEmitidos)||void 0===x||null===(O=x.plantillasCertificados)||void 0===O?void 0:O.id_organizacion_hija)?null===(v=E.certificate)||void 0===v||null===(_=v.certificadosEmitidos)||void 0===_||null===(y=_.plantillasCertificados)||void 0===y?void 0:y.organizacionesHijas:null===(w=E.certificate)||void 0===w||null===(C=w.certificadosEmitidos)||void 0===C||null===(k=C.plantillasCertificados)||void 0===k?void 0:k.organizaciones),0===(null===(N=E.certificate.certificadosEmitidos)||void 0===N?void 0:N.estado)?Je("Revoked"):null!==(null===(B=E.certificate.certificadosEmitidos)||void 0===B?void 0:B.fecha_expiracion)&&Object(Vt.a)(new Date(null===(S=E.certificate.certificadosEmitidos)||void 0===S?void 0:S.fecha_expiracion),new Date)?Je("Expired"):Je("Verified"),me(!1);case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),It=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:a=e.sent,n=a.data,i=n.levels.filter((function(e){return e.id===t})),ge(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Dt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:a=e.sent,n=a.data,i=n.time.filter((function(e){return e.id===t})),Se(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),zt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:a=e.sent,n=a.data,i=n.costs.filter((function(e){return e.id===t})),De(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();Ee||he||ke||(Nt="No hay atributos");var ea=function(e){Ce.a.post("/share/statisticSocialNetwork",{id_redes_sociales:e,id_certificados_emitidos:X.id_certificados_emitidos,id_usuarios:J.id})};return!0===oe[0]&&F.a.fire({icon:"success",iconColor:E.a.primary,title:Tt("certificateBadgeTemplate:details.copied"),text:"".concat(oe[1]," ").concat(Tt("certificateBadgeTemplate:details.copied-certificate")),buttonsStyling:!1,customClass:{container:ae.mySwal,confirmButton:"custom-button-confirm"}}).then((function(){se(!1,"")})),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{closeButton:!0,handleClose:function(){ee(!1)}}),Object(n.jsx)(ye.a,{container:!0,className:ae.grid,children:Object(n.jsx)(ye.a,{item:!0,xs:12,className:"text-center",children:ue?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:500,className:ae.skeleton}):Object(n.jsx)(ra,{pdf:null===X||void 0===X?void 0:X.pdfCertificate,img:null===X||void 0===X?void 0:X.resizingPhotoCertificate})})}),Object(n.jsx)(Rt.a,{className:ae.container,maxWidth:"lg",children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{container:!0,justify:"space-between",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:7,lg:7,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:ae.textName,children:ue?Object(n.jsx)(Be.a,{variant:"h3"}):Object(n.jsxs)(n.Fragment,{children:[null===(r=X.certificadosEmitidos)||void 0===r||null===(c=r.plantillasCertificados)||void 0===c?void 0:c.nombre,Bt?Object(n.jsx)("img",{alt:"img_verificado",src:"Verified"===Qe?Jt:"Revoked"===Qe?Xt:Zt,className:ae.img_verificado}):Object(n.jsx)("img",{alt:"img_verificado",src:"Verified"===Qe?te.icon_verificado:"Revoked"===Qe?Gt:Qt,className:ae.img_verificado})]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:5,lg:4,className:ae.container_redes,children:ue?Object(n.jsx)(Be.a,{variant:"circle",width:40,height:40,display:"inline"}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(S.a,{className:ae.LinkedInIcon,"aria-controls":kt,"aria-haspopup":"true",onClick:function(e){Ot(e.currentTarget)},children:Object(n.jsx)(qt.a,{icon:Kt.e,size:"xs"})}),Object(n.jsx)("a",{id:"linkedinShare",href:"https://www.linkedin.com/sharing/share-offsite",className:"gs-foreign-tracking gs-provider-linkedin","data-url":"".concat("Certika"===te.organizationName?je.a.certificatesURL:je.a.certificatesURLMin).concat($),"data-title":"".concat(Tt("certificateBadgeTemplate:sharing.certificate-sharing")," ").concat(null===(o=X.certificadosEmitidos)||void 0===o||null===(s=o.plantillasCertificados)||void 0===s||null===(l=s.organizaciones)||void 0===l||null===(b=l.redesSociales[0])||void 0===b?void 0:b.username," ").concat(null===wt||void 0===wt?void 0:wt.nombre).concat("Certika"===te.organizationName?" v\xeda @certikaco":"."),onClick:function(){return ea(3)},style:{display:"none"},children:"Linkedin"}),Object(n.jsx)("a",{href:"https://twitter.com/intent/tweet",className:"gs-foreign-tracking gs-provider-twitter","data-url":"".concat("Certika"===te.organizationName?je.a.certificatesURL:je.a.certificatesURLMin).concat($),"data-title":"".concat(Tt("certificateBadgeTemplate:sharing.certificate-sharing")," ").concat((null===wt||void 0===wt||null===(p=wt.redesSociales)||void 0===p||null===(j=p.find((function(e){return 5===e.id_redes_sociales})))||void 0===j?void 0:j.username)||(null===wt||void 0===wt?void 0:wt.nombre)).concat("Certika"===te.organizationName?" v\xeda @certikaco":"."),onClick:function(){return ea(5)},children:Object(n.jsx)(S.a,{className:ae.xtwitterIcon,children:Object(n.jsx)("img",{src:oa,alt:"XTwitter",height:23})})}),Object(n.jsx)("a",{href:"https://www.facebook.com/sharer/sharer.php",className:"gs-foreign-tracking gs-provider-facebook","data-url":"".concat("Certika"===te.organizationName?je.a.certificatesURL:je.a.certificatesURLMin).concat($),onClick:function(){return ea(4)},children:Object(n.jsx)(S.a,{className:ae.FacebookIcon,children:Object(n.jsx)(qt.a,{icon:Kt.a,size:"sm"})})}),Object(n.jsx)("a",{href:"https://www.messenger.com/sharer/sharer.php",className:"gs-foreign-tracking gs-provider-fbm","data-url":"".concat("Certika"===te.organizationName?je.a.certificatesURL:je.a.certificatesURLMin).concat($),onClick:function(){return ea(7)},children:Object(n.jsx)(S.a,{className:ae.TwitterIcon,children:Object(n.jsx)(qt.a,{icon:Kt.b,size:"sm"})})}),Object(n.jsx)("a",{href:"https://api.whatsapp.com/send",className:"gs-foreign-tracking gs-provider-whatsapp","data-url":"".concat("Certika"===te.organizationName?je.a.certificatesURL:je.a.certificatesURLMin,"whatsapp/").concat($),"data-title":"".concat(Tt("certificateBadgeTemplate:sharing.certificate-sharing")," ").concat(null===wt||void 0===wt?void 0:wt.nombre).concat("Certika"===te.organizationName?" v\xeda Certika":"."),onClick:function(){return ea(2)},children:Object(n.jsx)(S.a,{className:ae.WhatsAppIcon,children:Object(n.jsx)(Ft.a,{})})}),Object(n.jsx)("a",{href:"https://telegram.me/share",className:"gs-foreign-tracking gs-provider-telegram","data-url":"".concat("Certika"===te.organizationName?je.a.certificatesURL:je.a.certificatesURLMin).concat($),"data-title":"".concat(Tt("certificateBadgeTemplate:sharing.certificate-sharing")," ").concat(null===wt||void 0===wt?void 0:wt.nombre).concat("Certika"===te.organizationName?" v\xeda Certika":"."),onClick:function(){return ea(6)},children:Object(n.jsx)(S.a,{className:ae.TelegramIcon,children:Object(n.jsx)(Ut.a,{viewBox:"0 0 26 24"})})}),Object(n.jsx)("a",{href:X.pdfCertificate,download:X.pdfCertificate,children:Object(n.jsx)(S.a,{className:ae.PdfIcon,children:Object(n.jsx)("img",{src:$t,alt:"pdf",className:ae.PdfIconImage})})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:1,children:ue?Object(n.jsx)(Be.a,{variant:"rect",height:30}):Object(n.jsx)(Mt.a,{href:"/certificate/verify/".concat($),target:"_blank",underline:"none",variant:"inherit",className:ae.buttonVerificate,children:Tt("buttons:buttons.verify")})})]}),Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,className:ae.container_text_chip_left,children:[Object(n.jsx)(we.a,{className:ae.textBolder,children:ue?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:33}):"".concat(Tt("certificateBadgeTemplate:details.certificate-link"),":")}),!ue&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(fe.a,{variant:"outlined",label:"".concat(window.location.origin,"/certificate/").concat($),color:"default",className:ae.containerButtonToCopy}),Object(n.jsx)(Pt.CopyToClipboard,{text:"".concat(window.location.origin,"/certificate/").concat($),onCopy:function(){return se([!0,"Link"])},className:ae.button,children:Object(n.jsx)("span",{children:Tt("certificateBadgeTemplate:details.copy")})})]})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,className:ae.container_text_chip_right,children:[Object(n.jsx)(we.a,{className:ae.textBolder,children:ue?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:33}):"".concat(Tt("certificateBadgeTemplate:details.certificate-code"),":")}),!ue&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(fe.a,{variant:"outlined",label:null===(x=X.certificadosEmitidos)||void 0===x?void 0:x.codigo_certificado,color:"default",className:ae.containerButtonToCopy}),Object(n.jsx)(Pt.CopyToClipboard,{text:null===(O=X.certificadosEmitidos)||void 0===O?void 0:O.codigo_certificado,onCopy:function(){return se([!0,"C\xf3digo"])},className:ae.button,children:Object(n.jsx)("span",{children:Tt("certificateBadgeTemplate:details.copy")})})]})]})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:ue?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:100,className:ae.root}):Object(n.jsx)(we.a,{className:ae.textParagraph,gutterBottom:!0,children:null===(v=X.certificadosEmitidos)||void 0===v||null===(_=v.plantillasCertificados)||void 0===_?void 0:_.descripcion})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:5,lg:5,children:Object(n.jsx)(ve.a,{variant:"outlined",className:ae.card,children:Object(n.jsx)(_e.a,{className:ae.cardContent,children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,lg:2,children:ue?Object(n.jsx)(Be.a,{variant:"circle",className:ae.img_user}):Object(n.jsx)(g.a,{"aria-label":"img_certificate",src:X.photoUser,className:ae.img_user})}),Object(n.jsxs)(ye.a,{item:!0,lg:10,children:[Object(n.jsx)(we.a,{className:ae.textTitle,children:ue?Object(n.jsx)(Be.a,{variant:"text",width:250}):"".concat(null===(y=X.cuentas)||void 0===y||null===(w=y.usuarios)||void 0===w?void 0:w.primer_nombre," ").concat((null===(C=X.cuentas)||void 0===C||null===(k=C.usuarios)||void 0===k?void 0:k.segundo_nombre)||""," ").concat(null===(N=X.cuentas)||void 0===N||null===(B=N.usuarios)||void 0===B?void 0:B.primer_apellido," ").concat((null===(T=X.cuentas)||void 0===T||null===(A=T.usuarios)||void 0===A?void 0:A.segundo_apellido)||"")}),ue?Object(n.jsx)(Be.a,{variant:"text",width:150,className:ae.link}):Object(n.jsxs)(Mt.a,{href:"/dashboard/".concat(null===X||void 0===X||null===(I=X.cuentas)||void 0===I||null===(z=I.usuarios)||void 0===z?void 0:z.url_perfil),target:"_blank",rel:"noreferrer",className:ae.link,children:[Tt("certificateBadgeTemplate:details.credencials"),Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]})]})})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:2,lg:2,children:[Object(n.jsx)(we.a,{className:ae.textBolderDate,children:ue?Object(n.jsx)(Be.a,{}):"".concat(Tt("certificateBadgeTemplate:details.issued"),":")}),Object(n.jsx)(we.a,{className:ae.text,children:ue?Object(n.jsx)(Be.a,{}):Ne()(null===(P=X.certificadosEmitidos)||void 0===P?void 0:P.fecha_emision).format("DD-MM-YYYY")})]}),(null===(R=X.certificadosEmitidos)||void 0===R?void 0:R.fecha_expiracion)&&Object(n.jsxs)(ye.a,{item:!0,xs:12,md:2,lg:2,children:[Object(n.jsx)(we.a,{className:ae.textBolderDate,children:ue?Object(n.jsx)(Be.a,{}):"".concat(Tt("certificateBadgeTemplate:details.expiration"),":")}),Object(n.jsx)(we.a,{className:ae.text,children:ue?Object(n.jsx)(Be.a,{}):Ne()(null===(M=X.certificadosEmitidos)||void 0===M?void 0:M.fecha_expiracion).format("DD-MM-YYYY")})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:3,lg:3,children:Object(n.jsx)(ve.a,{variant:"outlined",className:ae.card,children:Object(n.jsx)(_e.a,{className:ae.cardContent,children:Object(n.jsxs)(ye.a,{container:!0,justify:"flex-end",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:1,children:ue?Object(n.jsx)(Be.a,{variant:"circle",className:ae.img_user}):Object(n.jsx)(g.a,{variant:"square","aria-label":"img_certificate",src:X.photoOrganization,className:ae.img_org})}),Object(n.jsxs)(ye.a,{item:!0,xs:11,children:[Object(n.jsx)(we.a,{className:ae.textNameOrganization,children:ue?Object(n.jsx)(Be.a,{variant:"text",width:250}):null===wt||void 0===wt?void 0:wt.nombre}),ue?Object(n.jsx)(Be.a,{variant:"text",width:150,className:ae.linkOrganization}):Object(n.jsx)(Mt.a,{className:ae.linkOrganization,href:"/organization/".concat(null===wt||void 0===wt?void 0:wt.url_perfil),target:"_blank",children:Tt("certificateBadgeTemplate:details.more-information")})]})]})})})}),ue?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:ae.root}):Ue.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:ae.menuItem,justify:"space-between",onClick:function(){return et(!$e)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:ae.textMenuItem,children:Tt("certificateBadgeTemplate:details.requirements")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:$e?Object(n.jsx)(Wt.a,{sx:sa}):Object(n.jsx)(Yt.a,{sx:sa})})]}),Object(n.jsx)(ye.a,{container:!0,className:ae.descriptions,children:Object(n.jsx)(ce.a,{in:$e,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:ae.content_descriptions,children:Ue.map((function(e,t){return null===e.link||""===e.link?Object(n.jsx)(we.a,{className:ae.text,children:e.descripcion_criterio},"criteria".concat(t)):Object(n.jsx)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:ae.link,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))}))})})}),ue?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:ae.root}):0===Nt.length&&Object(n.jsxs)(ye.a,{container:!0,className:ae.menuItem,justify:"space-between",onClick:function(){return st(!ot)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:ae.textMenuItem,children:Tt("certificateBadgeTemplate:details.attributes")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:ot?Object(n.jsx)(Wt.a,{sx:sa}):Object(n.jsx)(Yt.a,{sx:sa})})]}),Object(n.jsx)(ye.a,{container:!0,className:ae.descriptions,children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:Object(n.jsx)(ce.a,{in:ot,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:ae.content_descriptions,children:Object(n.jsxs)(ye.a,{container:!0,justify:"space-evenly",spacing:2,align:"center",children:[void 0!==he&&Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:ae.textName,children:Bt?he.valor_parametro_en:he.valor_parametro}),Object(n.jsx)(we.a,{children:he?Tt("certificateBadgeTemplate:details.level"):""})]}),null!==(null===X||void 0===X||null===(L=X.certificadosEmitidos)||void 0===L||null===(W=L.plantillasCertificados)||void 0===W?void 0:W.cantidad_tiempo)&&void 0!==(null===ke||void 0===ke?void 0:ke.valor_parametro)?Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:ae.textName,children:"".concat(null===(q=X.certificadosEmitidos)||void 0===q||null===(H=q.plantillasCertificados)||void 0===H?void 0:H.cantidad_tiempo," ").concat(Bt?ke.valor_parametro_en:ke.valor_parametro)}),Object(n.jsx)(we.a,{children:Tt("certificateBadgeTemplate:details.time")})]}):"",void 0!==Ee&&Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsxs)(we.a,{variant:"h5",className:ae.textName,children:[Bt?Ee.valor_parametro_en:Ee.valor_parametro," "]}),Object(n.jsx)(we.a,{children:Ee?Tt("certificateBadgeTemplate:details.cost"):""})]})]})})})})}),ue?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:ae.root}):Re.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:ae.menuItem,justify:"space-between",onClick:function(){return mt(!ut)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:ae.textMenuItem,children:Tt("certificateBadgeTemplate:details.skills")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:ut?Object(n.jsx)(Wt.a,{sx:sa}):Object(n.jsx)(Yt.a,{sx:sa})})]}),Object(n.jsx)(ye.a,{container:!0,className:ae.descriptions,children:Object(n.jsx)(ce.a,{in:ut,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:ae.content_descriptions,children:Re.map((function(e,t){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},da),{},{children:Object(n.jsx)(we.a,{className:"text-left",children:e.habilidades.descripcion})}))},"skill".concat(t))}))})})}),ue?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:ae.root}):He.length>0&&He.map((function(e,t){return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(ye.a,{container:!0,className:ae.menuItem,justify:"space-between",onClick:function(){return it(!nt&&t+1)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:ae.textMenuItem,children:e.titulo_campo},"field-title".concat(t))}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:nt===t+1?Object(n.jsx)(Wt.a,{sx:sa}):Object(n.jsx)(Yt.a,{sx:sa})})]}),Object(n.jsx)(ye.a,{container:!0,className:ae.descriptions_fields,children:Object(n.jsx)(ce.a,{in:nt===t+1,timeout:"auto",children:Object(n.jsxs)(ye.a,{item:!0,lg:12,className:ae.content_descriptions_fields,children:[Object(n.jsx)(we.a,{className:ae.text,children:e.descripcion_campo.includes("-")?ca(e.descripcion_campo):e.descripcion_campo},"field-description".concat(t)),e.link&&Object(n.jsxs)(Mt.a,{href:e.link,target:"_blank",rel:"noreferrer",className:ae.link,children:[Tt("details.additional")," ",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]})})})]})})),ue?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:ae.root}):(null===(K=X.certificadosEmitidos)||void 0===K||null===(V=K.plantillasCertificados)||void 0===V?void 0:V.url)&&Object(n.jsxs)(ye.a,{container:!0,className:ae.menuItem,justify:"space-between",onClick:function(){return ft(!jt)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsxs)(we.a,{className:ae.textMenuItem,children:[Tt("certificateBadgeTemplate:details.additional"),Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:jt?Object(n.jsx)(Wt.a,{sx:sa}):Object(n.jsx)(Yt.a,{sx:sa})})]}),Object(n.jsx)(ye.a,{container:!0,className:ae.descriptions,children:Object(n.jsx)(ce.a,{in:jt,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:ae.content_descriptions,children:Object(n.jsxs)(Mt.a,{href:null===(G=X.certificadosEmitidos)||void 0===G||null===(Q=G.plantillasCertificados)||void 0===Q?void 0:Q.url,target:"_blank",rel:"noreferrer",className:ae.link,children:[Tt("certificateBadgeTemplate:details.additional"),Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})})})})]})]})}),Object(n.jsxs)(U.a,{anchorEl:xt,anchorOrigin:{vertical:"top",horizontal:"right"},id:kt,keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:vt,onClose:function(){Ot(null)},children:[Object(n.jsxs)(Y.a,{onClick:function(){return function(){var e,t,a,n,i,r,c,o,s,l=document.createElement("a");l.href="https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name=".concat(null===(e=X.certificadosEmitidos)||void 0===e||null===(t=e.plantillasCertificados)||void 0===t?void 0:t.nombre,"&organizationName=").concat((null===wt||void 0===wt||null===(a=wt.redesSociales)||void 0===a||null===(n=a.find((function(e){return 3===e.id_redes_sociales})))||void 0===n?void 0:n.username)||(null===wt||void 0===wt?void 0:wt.nombre),"&issueYear=").concat(Ne()(null===(i=X.certificadosEmitidos)||void 0===i?void 0:i.fecha_emision).format("YYYY"),"&issueMonth=").concat(Ne()(null===(r=X.certificadosEmitidos)||void 0===r?void 0:r.fecha_emision).format("M"),"&expirationYear=").concat(Ne()(null===(c=X.certificadosEmitidos)||void 0===c?void 0:c.fecha_expiracion).format("YYYY"),"&expirationMonth=").concat(Ne()(null===(o=X.certificadosEmitidos)||void 0===o?void 0:o.fecha_expiracion).format("M"),"&certUrl=").concat(window.location.origin,"/certificate/").concat($,"&certId=").concat(null===(s=X.certificadosEmitidos)||void 0===s?void 0:s.codigo_certificado),l.target="_blank",ea(3),Ot(null),l.click()}()},children:[Object(n.jsx)(S.a,{className:ae.LinkedInIconMenu,children:Object(n.jsx)(qt.a,{icon:Kt.e,size:"xs"})}),Object(n.jsx)("spam",{className:ae.textLinkedMenu,children:"Agregar en el perfil"})]}),Object(n.jsxs)(Y.a,{onClick:function(){return document.getElementById("linkedinShare").click()},children:[Object(n.jsx)(S.a,{className:ae.LinkedInIconMenu,children:Object(n.jsx)(qt.a,{icon:Kt.e,size:"xs"})}),Object(n.jsx)("spam",{className:ae.textLinkedMenu,children:"Agregar como publicaci\xf3n"})]})]}),Object(n.jsx)(ye.a,{container:!0,className:ae.footer,children:Object(n.jsxs)(ye.a,{item:!0,lg:12,children:[Object(n.jsx)("span",{className:ae.textParagraph,children:Tt("certificateBadgeTemplate:details.right-reserved")}),Object(n.jsx)("p",{className:ae.textName,children:te.organizationName}),Object(n.jsx)("span",{className:ae.textParagraph,children:Ne()().format("YYYY")})]})})]})}));var ba={color:"#ffffff",float:"right"},pa=Object(C.a)((function(e){var t;return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"1em"},img:{width:"95%",height:"95%",maxWidth:"-webkit-fill-available"},img_verificado:{display:"inline-block",height:e.spacing(5),margin:"auto"},textBolder:{marginTop:"1em",color:"#000000",fontWeight:"bold",display:"inline"},textTitle:{color:"#000000",fontWeight:"bold"},textName:{color:"#000000",fontWeight:"bold"},textNameOrganization:{color:"#000000",fontWeight:"bold"},text:{color:"#000000"},textParagraph:{textAlign:"justify",color:"#000000",margin:"1em 0 1em 0"},link:{color:E.a.primary,marginLeft:"2em",textDecoration:"underline"},linkOrganization:{color:E.a.primary,textDecoration:"underline"},header:(t={marginTop:"3em",display:"flex",justifyContent:"flex-end",textAlign:"center"},Object(b.a)(t,e.breakpoints.up("sm"),{marginTop:"1em"}),Object(b.a)(t,e.breakpoints.up("xl"),{marginTop:"1em"}),t),buttonVerificate:Object(b.a)({display:"block",textAlign:"center",marginBottom:"1em",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase",width:"90%","&:hover":{backgroundColor:E.a.secondary,textDecoration:"none",color:"#ffffff"}},e.breakpoints.up("sm"),{marginBottom:"0",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}}),container_redes:Object(b.a)({marginBottom:"1em"},e.breakpoints.up("sm"),{marginBottom:"0"}),LinkedInIconMenu:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#018ec5","&:hover":{backgroundColor:"#018ec5"}},textLinkedMenu:{fontSize:".8em",marginLeft:".5em"},img_user:{width:e.spacing(10),height:e.spacing(10)},img_org:Object(b.a)({marginLeft:"0em",width:e.spacing(13),height:e.spacing(13),"& img":{height:"min-content"}},e.breakpoints.up("sm"),{marginLeft:"2em"}),textBolderDate:{color:"#000000",fontWeight:"bold",marginLeft:".4em"},menuItem:{borderRadius:10,padding:10,cursor:"pointer",backgroundColor:E.a.primary},textMenuItem:{color:"#ffffff",fontWeight:"bold"},descriptions:{justifyContent:"left",borderRadius:10,backgroundColor:"#fafafa",marginBottom:10,textAlign:"center"},content_descriptions:{margin:"1em"},footer:{justifyContent:"center",marginTop:10,padding:10,backgroundColor:"#fafafa",textAlign:"center"},mySwal:{zIndex:3e3},contentCenter:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}}})),ja={setCarnet:I.m},fa=Object(s.b)((function(e){return{user:e.user,carnet:e.carnet||{},styles:e.styles}}),ja)((function(e){var t,a,r,c,o,s,l,b,p,j,x,O,v,_,y,w=e.user,C=e.carnet,k=e.setCarnet,N=e.carnetId,B=e.setOpenDialog,T=e.styles,A=pa(),I=Object(u.g)(),z=Object(i.useState)([!1,""]),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)(!1),W=Object(d.a)(L,2),q=W[0],H=W[1],K=Object(i.useState)(null),V=Object(d.a)(K,2),G=V[0],Q=V[1],J=Boolean(G),X=Object(i.useState)(""),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)(!1),ae=Object(d.a)(te,2),ne=ae[0],ie=ae[1],re=Object(i.useState)(!1),oe=Object(d.a)(re,2),se=oe[0],le=oe[1],de=Object(i.useState)([]),ue=Object(d.a)(de,2),me=ue[0],be=ue[1],pe=Object(i.useState)([]),je=Object(d.a)(pe,2),fe=je[0],he=je[1],ge=Object(D.a)(["certificateBadgeTemplate","buttons"]),xe=Object(d.a)(ge,1)[0];null===w&&I.push("/"),Object(i.useEffect)((function(){Oe().catch((function(){I.push("/500"),window.location.reload()}))}),[]),Object(i.useEffect)((function(){!q&&window.GS&&GS.reset()}),[q]);var Oe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o,s,l,d,u,b;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(!0),d=Object(Ie.a)(N),e.next=4,Ce.a.get("/carnets/getCarnet/".concat(d));case 4:u=e.sent,b=u.data.data,k(Object(m.a)(Object(m.a)({},b.carnet),{},{pdfCarnet:null===b||void 0===b?void 0:b.pdfCarnet,photoOrganization:null===b||void 0===b?void 0:b.photoOrganization,photoCarnet:null===b||void 0===b?void 0:b.photoCarnet,resizingPhotoCarnet:null===b||void 0===b?void 0:b.resizingPhotoCarnet})),be(null===(t=b.carnet)||void 0===t||null===(a=t.carnetsEmitidos)||void 0===a||null===(n=a.plantillasCarnets)||void 0===n?void 0:n.carnetCamposAdicionales.filter((function(e){return 50===e.privacidad_vp}))),he(null===(i=b.carnet)||void 0===i||null===(r=i.carnetsEmitidos)||void 0===r||null===(c=r.plantillasCarnets)||void 0===c?void 0:c.carnetCamposAdicionales.filter((function(e){return 49===e.privacidad_vp}))),0===(null===(o=b.carnet.carnetsEmitidos)||void 0===o?void 0:o.estado)?ee("Revoked"):null!==(null===(s=b.carnet.carnetsEmitidos)||void 0===s?void 0:s.fecha_expiracion)&&Object(Vt.a)(new Date(null===(l=b.carnet.carnetsEmitidos)||void 0===l?void 0:l.fecha_expiracion),new Date)?ee("Expired"):ee("Verified"),H(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return!0===R[0]&&F.a.fire({customClass:{container:A.mySwal,confirmButton:"custom-button-confirm"},icon:"success",iconColor:E.a.primary,buttonsStyling:!1,title:xe("certificateBadgeTemplate:details.copied"),text:"".concat(R[1]," ").concat(xe("certificateBadgeTemplate:details.copied-document"))}).then((function(){M(!1,"")})),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{closeButton:!0,handleClose:function(){B(!1)}}),Object(n.jsx)(Rt.a,{className:(A.container,A.root),maxWidth:"xl",children:Object(n.jsxs)(ye.a,{container:!0,spacing:6,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:4,className:"text-center",children:Object(n.jsx)("img",{src:null===C||void 0===C?void 0:C.photoCarnet,alt:"",className:A.img})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:8,children:!q&&Object(n.jsx)("div",{className:A.header,children:Object(n.jsxs)(ye.a,{container:!0,spacing:2,alignItems:"center",justify:"space-between",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,xl:5,children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:A.textTitle,children:q?Object(n.jsx)(Be.a,{variant:"text",width:250}):"".concat(null===(t=C.cuentas)||void 0===t||null===(a=t.usuarios)||void 0===a?void 0:a.primer_nombre," ").concat((null===(r=C.cuentas)||void 0===r||null===(c=r.usuarios)||void 0===c?void 0:c.segundo_nombre)||""," ").concat(null===(o=C.cuentas)||void 0===o||null===(s=o.usuarios)||void 0===s?void 0:s.primer_apellido," ").concat((null===(l=C.cuentas)||void 0===l||null===(b=l.usuarios)||void 0===b?void 0:b.segundo_apellido)||"")}),Object(n.jsx)("img",{alt:"img_verificado",src:"Verified"===$?T.icon_verificado:"Revoked"===$?Gt:Qt,className:A.img_verificado})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,children:q?Object(n.jsx)(Be.a,{variant:"rect",height:30}):Object(n.jsx)("div",{className:A.contentCenter,children:Object(n.jsx)(Mt.a,{href:"/carnet/verify/".concat(N),target:"_blank",underline:"none",variant:"inherit",className:A.buttonVerificate,children:xe("buttons:buttons.verify")})})}),Object(n.jsx)(ye.a,{item:!0,xs:2,md:2,children:q?Object(n.jsx)(Be.a,{variant:"circle",className:A.img_user}):Object(n.jsx)(g.a,{variant:"square","aria-label":"img_certificate",src:null===C||void 0===C?void 0:C.photoOrganization,className:A.img_org})}),Object(n.jsxs)(ye.a,{item:!0,xs:10,md:5,children:[Object(n.jsx)(we.a,{className:A.textNameOrganization,children:q?Object(n.jsx)(Be.a,{variant:"text",width:250}):null===C||void 0===C||null===(p=C.carnetsEmitidos)||void 0===p||null===(j=p.plantillasCarnets)||void 0===j||null===(x=j.organizaciones)||void 0===x?void 0:x.nombre}),q?Object(n.jsx)(Be.a,{variant:"text",width:150,className:A.linkOrganization}):Object(n.jsx)(Mt.a,{className:A.linkOrganization,href:"/organization/".concat(null===C||void 0===C||null===(O=C.carnetsEmitidos)||void 0===O||null===(v=O.plantillasCarnets)||void 0===v||null===(_=v.organizaciones)||void 0===_?void 0:_.url_perfil),target:"_blank",children:xe("certificateBadgeTemplate:details.more-information")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:5,className:"text-center",children:[Object(n.jsx)(we.a,{className:A.textBolderDate,children:q?Object(n.jsx)(Be.a,{}):"".concat(xe("certificateBadgeTemplate:details.date-certification"),":")}),Object(n.jsx)(we.a,{className:A.text,children:q?Object(n.jsx)(Be.a,{}):Ne()(null===C||void 0===C||null===(y=C.carnetsEmitidos)||void 0===y?void 0:y.fecha_emision).format("DD-MM-YYYY")})]}),q?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:A.root}):fe.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:A.menuItem,justify:"space-between",onClick:function(){return le(!se)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:A.textMenuItem,children:xe("certificateBadgeTemplate:details.information-public")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:se?Object(n.jsx)(Wt.a,{sx:ba}):Object(n.jsx)(Yt.a,{sx:ba})})]}),Object(n.jsx)(ye.a,{container:!0,className:A.descriptions,children:Object(n.jsx)(ce.a,{in:se,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:A.content_descriptions,children:fe.map((function(e,t){var a;return null===C||void 0===C||null===(a=C.carnetsEmitidos)||void 0===a?void 0:a.carnetsCamposValores.map((function(a){return e.id===a.id_carnets_campos_adicionales?Object(n.jsxs)(we.a,{className:A.text,children:[Object(n.jsxs)("b",{children:[e.nombre_campo,": "]}),a.valor]},"fieldsAdditionals".concat(t)):""}))}))})})}),q?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:A.root}):me.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:A.menuItem,justify:"space-between",onClick:function(){return ie(!ne)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:A.textMenuItem,children:xe("certificateBadgeTemplate:details.information-private")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:ne?Object(n.jsx)(Wt.a,{sx:ba}):Object(n.jsx)(Yt.a,{sx:ba})})]}),Object(n.jsx)(ye.a,{container:!0,className:A.descriptions,children:Object(n.jsx)(ce.a,{in:ne,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:A.content_descriptions,children:me.map((function(e,t){var a;return null===C||void 0===C||null===(a=C.carnetsEmitidos)||void 0===a?void 0:a.carnetsCamposValores.map((function(a){return e.id===a.id_carnets_campos_adicionales?Object(n.jsxs)(we.a,{className:A.text,children:[Object(n.jsxs)("b",{children:[e.nombre_campo,": "]}),a.valor]},"fieldsAdditionals".concat(t)):""}))}))})})})]})})})]})}),Object(n.jsx)(U.a,{anchorEl:G,anchorOrigin:{vertical:"top",horizontal:"right"},id:"primary-search-account-menu",keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:J,onClose:function(){Q(null)},children:Object(n.jsxs)(Y.a,{onClick:function(){return document.getElementById("linkedinShare").click()},children:[Object(n.jsx)(S.a,{className:A.LinkedInIconMenu,children:Object(n.jsx)(qt.a,{icon:Kt.e,size:"xs"})}),Object(n.jsx)("spam",{className:A.textLinkedMenu,children:" Agregar a las actividades"})]})}),Object(n.jsx)(ye.a,{container:!0,className:A.footer,children:Object(n.jsxs)(ye.a,{item:!0,lg:12,children:[Object(n.jsx)("span",{className:A.textParagraph,children:xe("certificateBadgeTemplate:details.right-reserved")}),Object(n.jsx)("p",{className:A.textName,children:T.organizationName}),Object(n.jsx)("span",{className:A.textParagraph,children:Ne()().format("YYYY")})]})})]})})),ha=a(1154),ga=a(1150),xa=a(1151),Oa=a(1152),va=a(1153);ea.c.GlobalWorkerOptions.workerSrc=na.a;var _a=Object(C.a)((function(e){return{container:Object(b.a)({display:"flex",justifyContent:"center"},e.breakpoints.down("xs"),{display:"none"}),pagination:{marginTop:"3px",position:"absolute"},mobile:Object(b.a)({display:"none",justifyContent:"center"},e.breakpoints.down("xs"),{display:"flex"}),img:{maxWidth:"80vh"},document:{"& div .react-pdf__Page__annotations":{display:"none"},"& canvas":{marginTop:"2em"}},documentNoPagination:{"& div .react-pdf__Page__annotations":{display:"none"}}}})),ya=function(e){var t=e.pdf,a=e.download,r=e.handleClose,c=e.fullView,o=_a(),s=Object(i.useState)(null),l=Object(d.a)(s,2),u=l[0],m=l[1],b=Object(i.useState)(0),p=Object(d.a)(b,2),j=p[0],f=p[1],h=Object(i.useState)(0),g=Object(d.a)(h,2),x=g[0],O=g[1],v=function(e){var t=e.numPages;m(t),O(1),f(window.innerWidth<960?window.innerWidth:600)},_=function(e,t){O(t)},y=function(e){f(e)};return Object(n.jsxs)(n.Fragment,{children:[c&&Object(n.jsx)(At,{closeButton:!0,handleClose:r}),Object(n.jsxs)(Rt.a,{className:o.container,children:[Object(n.jsx)(ea.a,{file:t,options:{workerSrc:"/pdf.worker.js"},onLoadSuccess:v,className:o.document,children:Object(n.jsx)(ea.b,{pageNumber:x,width:j},"page_".concat(x))}),Object(n.jsx)("div",{className:o.pagination,children:Object(n.jsxs)(Lt.a,{component:"span",display:"flex",justifyContent:"center",children:[u>1&&Object(n.jsx)(ta.a,{orientation:"vertical",color:"secondary",count:u,page:x,onChange:_,defaultPage:1,size:"small"}),0!==j&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(S.a,{size:"small",children:Object(n.jsx)(ga.a,{onClick:function(){return y(j+100<window.innerWidth-50?j+100:window.innerWidth-50)}})}),Object(n.jsx)(S.a,{size:"small",children:Object(n.jsx)(xa.a,{onClick:function(){return y(j-100>600?j-100:600)}})}),Object(n.jsx)(S.a,{size:"small",children:Object(n.jsx)(Oa.a,{onClick:function(){return y(600)}})}),a&&Object(n.jsx)("a",{href:t,download:t,children:Object(n.jsx)(S.a,{size:"small",children:Object(n.jsx)(va.a,{})})})]})]})})]}),Object(n.jsxs)(Rt.a,{className:o.mobile,children:[Object(n.jsx)(ea.a,{file:t,options:{workerSrc:"/pdf.worker.js"},onLoadSuccess:v,className:u>1?o.document:o.documentNoPagination,children:Object(n.jsx)(ea.b,{pageNumber:x,width:j},"page_".concat(x))}),Object(n.jsx)("div",{className:o.pagination,children:Object(n.jsx)(Lt.a,{component:"span",display:"flex",justifyContent:"center",children:u>1&&Object(n.jsx)(ta.a,{orientation:"vertical",color:"secondary",count:u,page:x,onChange:_,defaultPage:1,size:"small"})})})]})]})};var wa=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),Ca={color:"#ffffff",float:"right"},ka=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"2em"},img_verificado:{display:"inline-block",height:e.spacing(5),margin:"auto"},img:{maxWidth:"-webkit-fill-available"},textBolder:{marginTop:"1em",color:"#000000",fontWeight:"bold",display:"inline"},textTitle:{color:"#000000",fontWeight:"bold",marginLeft:"2em"},textName:{color:"#000000",fontWeight:"bold"},textNameOrganization:{color:"#000000",fontWeight:"bold",marginLeft:"4em"},text:{color:"#000000"},textParagraph:{textAlign:"justify",color:"#000000",margin:"1em 0 1em 0"},link:{color:E.a.primary,marginLeft:"2em",textDecoration:"underline"},linkAdditionals:{color:"white",textDecoration:"none",cursor:"pointer"},previewTrail:{color:"white",textTransform:"none",transitionProperty:"none","&:hover":{textDecoration:"underline"}},linkOrganization:{color:E.a.primary,marginLeft:"4em",textDecoration:"underline"},button:Object(b.a)({margin:"0px 5px",display:"block",textAlign:"center",backgroundColor:E.a.primary,marginBottom:"1em",borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}},e.breakpoints.up("sm"),{display:"inline",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",marginTop:"1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}}),buttonVerificate:Object(b.a)({display:"block",textAlign:"center",marginBottom:"1em",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary,textDecoration:"none",color:"#ffffff"}},e.breakpoints.up("sm"),{marginBottom:"0",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}}),container_redes:Object(b.a)({marginBottom:"1em"},e.breakpoints.up("sm"),{marginBottom:"0"}),container_redes_signatories:{display:"flex",justifyContent:"right"},containerButtonToCopy:Object(b.a)({borderColor:E.a.primary,marginTop:"1em",marginBottom:"1em",padding:".4em 3em",maxWidth:"-webkit-fill-available"},e.breakpoints.up("sm"),{borderColor:E.a.primary,margin:"1em",padding:".4em 1em"}),WhatsAppIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00d954",marginLeft:".7em","&:hover":{backgroundColor:"#009B3C"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#00d954",marginLeft:".7em","&:hover":{backgroundColor:"#009B3C"}}),LinkedInIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#018ec5",marginLeft:".7em","&:hover":{backgroundColor:"#005374"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#018ec5",marginLeft:".7em","&:hover":{backgroundColor:"#005374"}}),LinkedInIconMenu:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#018ec5","&:hover":{backgroundColor:"#018ec5"}},textLinkedMenu:{fontSize:".8em",marginLeft:".5em"},TwitterIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0080A0"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0080A0"}}),xtwitterIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#2f3136",marginLeft:".7em","&:hover":{backgroundColor:"#000"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5)}),FacebookIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#0080ff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#0080ff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}}),TelegramIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}}),EmailIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#FF5733",marginLeft:".7em","&:hover":{backgroundColor:"#CF4325"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"FF5733",marginLeft:".7em","&:hover":{backgroundColor:"#CF4325"}}),PdfIcon:Object(b.a)({width:e.spacing(0),height:e.spacing(0),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}}),PdfIconImage:Object(b.a)({height:"35px",marginLeft:"8px"},e.breakpoints.up("sm"),{height:"45px",marginLeft:"auto"}),grid:{backgroundColor:E.a.footer,marginBottom:"1em"},skeleton:{marginLeft:"auto",marginRight:"auto"},card:{borderRadius:"10px",borderColor:"#ffffff",backgroundColor:"white",paddingBottom:2,marginTop:"1.5em"},img_user:{width:e.spacing(10),height:e.spacing(10)},img_org:{width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},cardContent:{padding:"0"},textBolderDate:{marginTop:"2.7em",color:"#000000",fontWeight:"bold",marginLeft:".4em"},menuItem:{borderRadius:10,padding:10,cursor:"pointer",backgroundColor:E.a.primary},textMenuItem:{color:"#ffffff",fontWeight:"bold"},expandeMenuItem:{color:"#ffffff",float:"right"},descriptions:{justifyContent:"center",borderRadius:10,backgroundColor:"#fafafa",marginBottom:10,textAlign:"center"},content_descriptions:{margin:"1em"},footer:{justifyContent:"center",marginTop:10,padding:10,backgroundColor:"#fafafa",textAlign:"center"},linkAdicional:{float:"right",marginRight:"5em"},mySwal:{zIndex:3e3},container_text_chip_right:Object(b.a)({textAlign:"center"},e.breakpoints.up("lg"),{textAlign:"right"}),container_text_chip_left:Object(b.a)({textAlign:"center"},e.breakpoints.up("lg"),{textAlign:"left"})}})),Na={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},Ba={setDocument:I.t},Sa=Object(s.b)((function(e){return{user:e.user,document:e.document||{},styles:e.styles}}),Ba)((function(e){var t,a,r,c,o,s,l,b,j,v,_,y,w,C,k,N,B,T,A,I,z,P,R,M,L,W,q,H,K,V,G,Q,J,X,Z,$,ee,te,ae,ne,ie,re,oe,se=e.documentId,de=e.setOpenDialog,ue=e.styles,me=e.user,be=ka(),pe=Object(u.g)(),he=Object(i.useState)([!1,""]),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ke=Object(i.useState)(!1),Se=Object(d.a)(ke,2),Te=Se[0],Ae=Se[1],Ee=Object(i.useState)(null),De=Object(d.a)(Ee,2),ze=De[0],Pe=De[1],Re=Object(i.useState)(!1),Me=Object(d.a)(Re,2),Le=Me[0],Fe=Me[1],Ue=Object(i.useState)(!1),We=Object(d.a)(Ue,2),Ye=We[0],qe=We[1],He=Boolean(ze),Ke="primary-search-account-menu",Ve=Object(i.useState)([]),Ge=Object(d.a)(Ve,2),Qe=Ge[0],Je=Ge[1],Xe=Object(i.useState)([]),Ze=Object(d.a)(Xe,2),$e=Ze[0],et=Ze[1],tt=Object(i.useState)([]),at=Object(d.a)(tt,2),nt=at[0],it=at[1],rt=Object(i.useState)(null),ot=Object(d.a)(rt,2),st=ot[0],lt=ot[1],dt=Object(i.useState)(!1),ut=Object(d.a)(dt,2),mt=ut[0],bt=ut[1],pt=Object(D.a)(["certificateBadgeTemplate","buttons","certifyDocuments"]),jt=Object(d.a)(pt,1)[0];Object(i.useEffect)((function(){ft().catch((function(){pe.push("/500"),window.location.reload()}))}),[]),Object(i.useEffect)((function(){!Te&&window.GS&&GS.reset()}),[Te]);var ft=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ae(!0),t=Object(Ie.a)(se),e.next=4,Ce.a.get("/documents/getDocument/".concat(t));case 4:return a=e.sent,n=a.data,Je(n.data),e.next=9,ht(t);case 9:return e.next=11,gt(t);case 11:Ae(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ht=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/documentsFieldAdditionals/getDocumentFieldAdditionals",{tipo:1,id_documentos_emitidos:t});case 2:return a=e.sent,n=a.data,e.next=6,Ce.a.post("/documentsFieldAdditionals/getDocumentFieldAdditionals",{tipo:3,id_documentos_emitidos:t});case 6:i=e.sent,r=i.data,et([].concat(Object(p.a)(null===n||void 0===n?void 0:n.documentFieldAdditionals),Object(p.a)(null===r||void 0===r?void 0:r.documentFieldAdditionals)));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),gt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/documentsFieldAdditionals/getDocumentFieldAdditionals",{tipo:2,id_documentos_emitidos:t});case 2:a=e.sent,n=a.data,it(null===n||void 0===n?void 0:n.documentFieldAdditionals);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();!0===xe[0]&&F.a.fire({customClass:{container:be.mySwal,confirmButton:"custom-button-confirm"},buttonsStyling:!1,icon:"success",iconColor:E.a.primary,title:jt("certificateBadgeTemplate:details.copied"),text:"".concat(xe[1]," ").concat(jt("certificateBadgeTemplate:details.copied-document"))}).then((function(){Oe(!1,"")}));var xt=function(){de(!1)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{closeButton:!0,handleClose:xt}),Object(n.jsx)(ye.a,{container:!0,className:be.grid,children:Object(n.jsx)(ye.a,{item:!0,xs:12,className:"text-center",children:Te?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:500,className:be.skeleton}):Object(n.jsx)(ya,{pdf:null===Qe||void 0===Qe?void 0:Qe.pdfDocument,download:!0})})}),Object(n.jsx)(Rt.a,{className:be.container,maxWidth:"lg",children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{container:!0,justify:"space-between",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,lg:6,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:be.textName,children:Te?Object(n.jsx)(Be.a,{variant:"h3"}):Object(n.jsx)(n.Fragment,{children:null===Qe||void 0===Qe||null===(t=Qe.document)||void 0===t||null===(a=t.documentosEmitidos)||void 0===a?void 0:a.nombre})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,lg:5,className:(null===Qe||void 0===Qe?void 0:Qe.thereSignatories)?be.container_redes_signatories:be.container_redes,children:Te?Object(n.jsx)(Be.a,{variant:"circle",width:40,height:40,display:"inline"}):Object(n.jsxs)(n.Fragment,{children:[!(null===Qe||void 0===Qe?void 0:Qe.thereSignatories)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(S.a,{className:be.LinkedInIcon,"aria-controls":Ke,"aria-haspopup":"true",onClick:function(e){Pe(e.currentTarget)},children:Object(n.jsx)(qt.a,{icon:Kt.e,size:"xs"})}),Object(n.jsx)("a",{id:"linkedinShare",href:"https://www.linkedin.com/sharing/share-offsite",className:"gs-foreign-tracking gs-provider-linkedin","data-url":"".concat(je.a.documentURL).concat(se),"data-title":"".concat(jt("certificateBadgeTemplate:sharing.document-sharing")," ").concat(null===Qe||void 0===Qe||null===(r=Qe.document)||void 0===r||null===(c=r.documentosEmitidos)||void 0===c||null===(o=c.coleccionesDocumentos)||void 0===o||null===(s=o.organizaciones)||void 0===s||null===(l=s.redesSociales[0])||void 0===l?void 0:l.username," ").concat(null===Qe||void 0===Qe||null===(b=Qe.document)||void 0===b||null===(j=b.documentosEmitidos)||void 0===j||null===(v=j.coleccionesDocumentos)||void 0===v||null===(_=v.organizaciones)||void 0===_?void 0:_.nombre).concat("Certika"===ue.organizationName?" v\xeda @certikaco":"."),style:{display:"none"},children:"Linkedin"}),Object(n.jsx)("a",{href:"https://twitter.com/intent/tweet",className:"gs-foreign-tracking gs-provider-twitter","data-url":"".concat(je.a.documentURL).concat(se),"data-title":"".concat(jt("certificateBadgeTemplate:sharing.document-sharing")," ").concat((null===Qe||void 0===Qe||null===(y=Qe.document)||void 0===y||null===(w=y.documentosEmitidos)||void 0===w||null===(C=w.coleccionesDocumentos)||void 0===C||null===(k=C.organizaciones)||void 0===k||null===(N=k.redesSociales)||void 0===N||null===(B=N.find((function(e){return 5===e.id_redes_sociales})))||void 0===B?void 0:B.username)||(null===Qe||void 0===Qe||null===(T=Qe.document)||void 0===T||null===(A=T.documentosEmitidos)||void 0===A||null===(I=A.coleccionesDocumentos)||void 0===I||null===(z=I.organizaciones)||void 0===z?void 0:z.nombre)).concat("Certika"===ue.organizationName?" v\xeda @certikaco":"."),children:Object(n.jsx)(S.a,{className:be.xtwitterIcon,children:Object(n.jsx)("img",{src:oa,alt:"XTwitter",height:23})})}),Object(n.jsx)("a",{href:"https://www.facebook.com/sharer/sharer.php",className:"gs-foreign-tracking gs-provider-facebook","data-url":"".concat(je.a.documentURL).concat(se),children:Object(n.jsx)(S.a,{className:be.FacebookIcon,children:Object(n.jsx)(qt.a,{icon:Kt.a,size:"sm"})})}),Object(n.jsx)("a",{href:"https://www.messenger.com/sharer/sharer.php",className:"gs-foreign-tracking gs-provider-fbm","data-url":"".concat(je.a.documentURL).concat(se),children:Object(n.jsx)(S.a,{className:be.TwitterIcon,children:Object(n.jsx)(qt.a,{icon:Kt.b,size:"sm"})})}),Object(n.jsx)("a",{href:"https://api.whatsapp.com/send",className:"gs-foreign-tracking gs-provider-whatsapp","data-url":"".concat(je.a.documentURL,"whatsapp/").concat(se),"data-title":"".concat(jt("certificateBadgeTemplate:sharing.document-sharing")," ").concat(null===Qe||void 0===Qe||null===(P=Qe.document)||void 0===P||null===(R=P.documentosEmitidos)||void 0===R||null===(M=R.coleccionesDocumentos)||void 0===M||null===(L=M.organizaciones)||void 0===L?void 0:L.nombre).concat("Certika"===ue.organizationName?" v\xeda Certika":"."),children:Object(n.jsx)(S.a,{className:be.WhatsAppIcon,children:Object(n.jsx)(Ft.a,{})})}),Object(n.jsx)("a",{href:"https://telegram.me/share",className:"gs-foreign-tracking gs-provider-telegram","data-url":"".concat(je.a.documentURL).concat(se),"data-title":"".concat(jt("certificateBadgeTemplate:sharing.document-sharing")," ").concat(null===Qe||void 0===Qe||null===(W=Qe.document)||void 0===W||null===(q=W.documentosEmitidos)||void 0===q||null===(H=q.coleccionesDocumentos)||void 0===H||null===(K=H.organizaciones)||void 0===K?void 0:K.nombre).concat("Certika"===ue.organizationName?" v\xeda Certika":"."),children:Object(n.jsx)(S.a,{className:be.TelegramIcon,children:Object(n.jsx)(Ut.a,{viewBox:"0 0 26 24"})})}),Object(n.jsx)(S.a,{className:be.EmailIcon,onClick:function(){var e;return function(e){xt(),F.a.fire({title:jt("alerts:alerts.email-send-document"),input:"email",inputPlaceholder:"email@example.com",validationMessage:jt("alerts:alerts.email-send-invalid"),showCancelButton:!0,confirmButtonText:jt("alerts:alerts.send"),cancelButtonText:jt("alerts:alerts.cancel"),showLoaderOnConfirm:!0,preConfirm:function(t){var a=new FormData;return a.append("id",e.id),a.append("email_receptor",t),a.append("nombre",e.nombre),a.append("share",!0),a.append("sub",me.data_user.id),ct()({method:"post",url:"".concat(je.a.apiURL,"/share/sendDocumentsCertify"),headers:{"Content-Type":"multipart/form-data"},data:a}).then((function(e){return 201===e.status&&F.a.showValidationMessage("El correo electr\xf3nico ha rebotado"),e.data.mensaje})).catch((function(){F.a.showValidationMessage(jt("alerts:alerts.error-ocurred"))}))},allowEscapeKey:!1,allowOutsideClick:!1}).then((function(e){e.isConfirmed?F.a.fire({customClass:{container:be.mySwal},title:jt("alerts:alerts.send-successfully"),icon:"success",showConfirmButton:!1,timer:2e3,iconColor:E.a.primary}).then((function(){de(!0)})):e.isDismissed&&de(!0)}))}(null===Qe||void 0===Qe||null===(e=Qe.document)||void 0===e?void 0:e.documentosEmitidos)},children:Object(n.jsx)(ha.a,{viewBox:"0 0 26 24"})})]}),Object(n.jsx)("a",{href:null===Qe||void 0===Qe?void 0:Qe.pdfDocument,download:null===Qe||void 0===Qe?void 0:Qe.pdfDocument,style:(null===Qe||void 0===Qe?void 0:Qe.thereSignatories)?{margin:"6px"}:{},children:Object(n.jsx)(S.a,{className:be.PdfIcon,children:Object(n.jsx)("img",{src:$t,alt:"pdf",className:be.PdfIconImage})})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:1,children:Te?Object(n.jsx)(Be.a,{variant:"rect",height:30}):Object(n.jsx)(Mt.a,{href:"/documents/verify/".concat(se),target:"_blank",underline:"none",variant:"inherit",className:be.buttonVerificate,children:jt("buttons:buttons.verify")})})]}),Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,className:be.container_text_chip_left,children:!(null===Qe||void 0===Qe?void 0:Qe.thereSignatories)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(we.a,{className:be.textBolder,children:Te?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:33}):"".concat(jt("certificateBadgeTemplate:details.document-link"),":")}),!Te&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(fe.a,{variant:"outlined",label:"".concat(window.location.origin,"/document/").concat(se),color:"default",className:be.containerButtonToCopy}),Object(n.jsx)(Pt.CopyToClipboard,{text:"".concat(window.location.origin,"/document/").concat(se),onCopy:function(){return Oe([!0,"Link"])},className:be.button,children:Object(n.jsx)("span",{children:jt("certificateBadgeTemplate:details.copy")})})]})]})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,className:be.container_text_chip_right,children:[Object(n.jsx)(we.a,{className:be.textBolder,children:Te?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:33}):"".concat(jt("certificateBadgeTemplate:details.document-code"),":")}),!Te&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(fe.a,{variant:"outlined",label:null===Qe||void 0===Qe||null===(V=Qe.document)||void 0===V||null===(G=V.documentosEmitidos)||void 0===G?void 0:G.codigo_documento,color:"default",className:be.containerButtonToCopy}),Object(n.jsx)(Pt.CopyToClipboard,{text:null===Qe||void 0===Qe||null===(Q=Qe.document)||void 0===Q||null===(J=Q.documentosEmitidos)||void 0===J?void 0:J.codigo_documento,onCopy:function(){return Oe([!0,"C\xf3digo"])},className:be.button,children:Object(n.jsx)("span",{children:jt("certificateBadgeTemplate:details.copy")})})]})]})]}),Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:1,lg:1,children:Object(n.jsx)(we.a,{className:be.textBolderDate,children:Te?Object(n.jsx)(Be.a,{}):"".concat(jt("certificateBadgeTemplate:details.created"),":")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:9,lg:10,children:Object(n.jsx)(ve.a,{variant:"outlined",className:be.card,children:Object(n.jsx)(_e.a,{className:be.cardContent,children:Object(n.jsxs)(ye.a,{container:!0,justify:"flex-end",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:1,children:Te?Object(n.jsx)(Be.a,{variant:"circle",className:be.img_user}):Object(n.jsx)(g.a,{variant:"square","aria-label":"img_certificate",src:null===Qe||void 0===Qe?void 0:Qe.photoOrganization,className:be.img_org})}),Object(n.jsxs)(ye.a,{item:!0,xs:11,children:[Object(n.jsx)(we.a,{className:be.textNameOrganization,children:Te?Object(n.jsx)(Be.a,{variant:"text",width:250}):null===Qe||void 0===Qe||null===(X=Qe.document)||void 0===X||null===(Z=X.documentosEmitidos)||void 0===Z||null===($=Z.coleccionesDocumentos)||void 0===$||null===(ee=$.organizaciones)||void 0===ee?void 0:ee.nombre}),Te?Object(n.jsx)(Be.a,{variant:"text",width:150,className:be.linkOrganization}):Object(n.jsx)(Mt.a,{className:be.linkOrganization,href:"/organization/".concat(null===Qe||void 0===Qe||null===(te=Qe.document)||void 0===te||null===(ae=te.documentosEmitidos)||void 0===ae||null===(ne=ae.coleccionesDocumentos)||void 0===ne||null===(ie=ne.organizaciones)||void 0===ie?void 0:ie.url_perfil),target:"_blank",children:jt("certificateBadgeTemplate:details.more-information")})]})]})})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:2,lg:1,className:"text-center",children:[Object(n.jsx)(we.a,{className:be.textBolderDate,children:Te?Object(n.jsx)(Be.a,{}):"".concat(jt("certificateBadgeTemplate:details.date-certification"),":")}),Object(n.jsx)(we.a,{className:be.text,children:Te?Object(n.jsx)(Be.a,{}):Ne()(null===Qe||void 0===Qe||null===(re=Qe.document)||void 0===re||null===(oe=re.documentosEmitidos)||void 0===oe?void 0:oe.fecha_certificacion).format("DD-MM-YYYY")})]})]})}),Te?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:be.root}):(null===$e||void 0===$e?void 0:$e.length)>0&&Object(n.jsxs)(ye.a,{container:!0,className:be.menuItem,justify:"space-between",onClick:function(){return Fe(!Le)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:be.textMenuItem,children:jt("certifyDocuments:document.additional-documents")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:Le?Object(n.jsx)(Wt.a,{sx:Ca}):Object(n.jsx)(Yt.a,{sx:Ca})})]}),Object(n.jsx)(ye.a,{container:!0,className:be.descriptions,children:Object(n.jsx)(ce.a,{in:Le,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:be.content_descriptions,children:null===$e||void 0===$e?void 0:$e.map((function(e,t){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Na),{},{children:Object(n.jsxs)(we.a,{className:"text-left",children:[Object(n.jsx)(le.a,{sx:{marginRight:"1em"}}),Object(n.jsx)(x.a,{onClick:function(){return t=null===e||void 0===e?void 0:e.linkPdf,lt(t),void bt(!0);var t},className:be.previewTrail,children:null===e||void 0===e?void 0:e.descripcion})]})}))},"skill".concat(t))}))})})}),Te?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:be.root}):nt.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:be.menuItem,justify:"space-between",onClick:function(){return qe(!Ye)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:be.textMenuItem,children:jt("certifyDocuments:document.additional-links")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:Ye?Object(n.jsx)(Wt.a,{sx:Ca}):Object(n.jsx)(Yt.a,{sx:Ca})})]}),Object(n.jsx)(ye.a,{container:!0,className:be.descriptions,children:Object(n.jsx)(ce.a,{in:Ye,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:be.content_descriptions,children:null===nt||void 0===nt?void 0:nt.map((function(e,t){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Na),{},{children:Object(n.jsx)(we.a,{className:"text-left",children:Object(n.jsxs)(Mt.a,{href:null===e||void 0===e?void 0:e.link,target:"_blank",rel:"noreferrer",className:be.linkAdditionals,children:[(null===e||void 0===e?void 0:e.descripcion)?null===e||void 0===e?void 0:e.descripcion:null===e||void 0===e?void 0:e.link," ",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})})}))},"skill".concat(t))}))})})})]})]})}),Object(n.jsx)(U.a,{anchorEl:ze,anchorOrigin:{vertical:"top",horizontal:"right"},id:Ke,keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:He,onClose:function(){Pe(null)},children:Object(n.jsxs)(Y.a,{onClick:function(){return document.getElementById("linkedinShare").click()},children:[Object(n.jsx)(S.a,{className:be.LinkedInIconMenu,children:Object(n.jsx)(qt.a,{icon:Kt.e,size:"xs"})}),Object(n.jsx)("spam",{className:be.textLinkedMenu,children:" Agregar a las actividades"})]})}),Object(n.jsx)(ye.a,{container:!0,className:be.footer,children:Object(n.jsxs)(ye.a,{item:!0,lg:12,children:[Object(n.jsx)("span",{className:be.textParagraph,children:jt("certificateBadgeTemplate:details.right-reserved")}),Object(n.jsx)("p",{className:be.textName,children:ue.organizationName}),Object(n.jsx)("span",{className:be.textParagraph,children:Ne()().format("YYYY")})]})}),Object(n.jsx)(O.a,{fullScreen:!0,open:mt,TransitionComponent:wa,children:Object(n.jsx)(ya,{pdf:st,download:!1,handleClose:function(){bt(!1)},fullView:!0})})]})}));var Ta=Object(C.a)((function(e){return{container:Object(b.a)({display:"flex",flexDirection:"column",alignItems:"center",margin:"1em 2em",marginBottom:"0"},e.breakpoints.up("lg"),{flexDirection:"row",justifyContent:"initial",alignItems:"initial",margin:"1em 4em",marginBottom:"0"}),container_button:Object(b.a)({display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"3em"},e.breakpoints.up("lg"),{flexDirection:"row",justifyContent:"initial",alignItems:"initial",margin:"4em",marginBottom:"4em",marginTop:"1em"}),container_noBadges:Object(b.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},e.breakpoints.up("lg"),{marginTop:"10%"}),container__avatar:Object(b.a)({width:"120px",height:"120px",borderRadius:"100%",marginBottom:10},e.breakpoints.up("lg"),{marginBottom:0}),imagen:Object(b.a)({maxWidth:"330px"},e.breakpoints.up("1850"),{maxWidth:"600px"}),imagenPublicUser:Object(b.a)({maxWidth:"290px"},e.breakpoints.up("1850"),{maxWidth:"540px"}),container__welcome:Object(b.a)({display:"flex",flexDirection:"column",justifyContent:"center"},e.breakpoints.up("lg"),{marginLeft:"3em"}),container__buttonEdit:{display:"flex",flexDirection:"row"},buttons:{border:"none",borderRadius:8,padding:"2px 20px"},container__welcome_message:{fontSize:"1.3em",margin:0},container__welcome_name:Object(b.a)({fontSize:"1.4em",fontWeight:"bold",textTransform:"uppercase",marginLeft:"10px"},e.breakpoints.up("lg"),{marginLeft:"1px"}),badges:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}},certificate:Object(b.a)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}},e.breakpoints.up("lg"),{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(335px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}}),container_text:{maxWidth:"40rem",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center","& p":{margin:0}},text:{fontSize:"2em",fontWeight:"bold",color:E.a.primary,textAlign:"center"},text_secondary:{fontWeight:"bold",textAlign:"center"},button:{margin:"1em 5em 1em 5em",color:"white",backgroundColor:E.a.primary,borderRadius:10,textTransform:"none",fontWeight:"bold","&:hover":{backgroundColor:E.a.secondary}},editPerfilButton:{fontSize:"1em",textAlign:"center",color:E.a.primary,textTransform:"none",transitionProperty:"none","&:hover":{backgroundColor:"white",textDecoration:"underline"}}}})),Aa=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),Ea={setBadges:I.l,setCertificates:I.q,setCarnets:I.n,setSignedDocuments:I.G,setView:I.I},Ia=Object(s.b)((function(e){return{user:e.user,badges:e.badges||[],certificates:e.certificates||[],carnets:e.carnets||[],signedDocuments:e.signedDocuments||[],view:e.view||0,permission:(e.permission||[]).filter((function(e){var t,a;return"dashboard"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Ea)((function(e){var t=e.user,a=e.permission,r=e.badges,c=e.setBadges,o=e.certificates,s=e.setCertificates,l=e.carnets,u=e.setCarnets,m=e.signedDocuments,b=e.setSignedDocuments,j=e.history,C=e.view,k=e.setView,N=Ta(),S=Object(i.useState)(""),T=Object(d.a)(S,2),A=T[0],I=T[1],z=Object(i.useState)(null),P=Object(d.a)(z,2),R=P[0],L=P[1],U=Object(i.useState)(null),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(!1),K=Object(d.a)(H,2),V=K[0],G=K[1],Q=Object(i.useState)(!1),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(!0),ee=Object(d.a)($,2),te=ee[0],ae=ee[1],ne=Object(i.useState)(!1),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)(!1),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)(!1),me=Object(d.a)(ue,2),be=me[0],pe=me[1],fe=Object(i.useState)(""),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Object(i.useState)(""),ve=Object(d.a)(Oe,2),_e=ve[0],ye=ve[1],we=Object(i.useState)(""),ke=Object(d.a)(we,2),Ne=ke[0],Se=ke[1],Te=new bt.a("logout"),Ae=Object(D.a)(["dashboard","dialogs","alerts","certifyDocuments"]),Ee=Object(d.a)(Ae,1)[0],De=window.location.origin===je.a.mincienciasURL?je.a.idMinciencias:1;Object(i.useEffect)((function(){var a,n,i,r;return 1!==(null===t||void 0===t||null===(a=t.data_user)||void 0===a||null===(n=a.gruposUsuariosOrganizaciones[0])||void 0===n?void 0:n.id_grupos_usuarios)&&14!==(null===t||void 0===t||null===(i=t.data_user)||void 0===i||null===(r=i.gruposUsuariosOrganizaciones[0])||void 0===r?void 0:r.id_grupos_usuarios)||(j.push("/templates/published"),window.location.reload()),ze().then((function(){var a;e.match.params.userUrl||e.match.params.documentTemplateId||!t||j.push("/dashboard/".concat(null===t||void 0===t||null===(a=t.data_user)||void 0===a?void 0:a.url_perfil));ae(!1)})).catch((function(){j.push("/500"),window.location.reload()})),function(){c([]),s([]),u([]),b([])}}),[]);var ze=function(){var n=Object(h.a)(f.a.mark((function n(){var i,c,s,d,u,m,b,p,g,x,O,v,_,y,w,C,N,B,S,T,A,I,D,z,P,R,M,U,W,Y,H,K,V,G;return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(i=e.match.params.userUrl)||0!==a.length){n.next=20;break}return n.next=4,Ue(i);case 4:return c=n.sent,n.next=7,Ye(i);case 7:return s=n.sent,n.next=10,We(i);case 10:return d=n.sent,n.next=13,Ce.a.get("/user/public/url/".concat(i));case 13:u=n.sent,m=u.data,L(m.user),k(c>0?0:d>0?1:s>0?2:0),1!==r&&1!==o&&1!==l||F.a.fire({icon:"error",iconColor:E.a.primary,text:Ee("alerts:alerts.user-no-found"),showConfirmButton:!1,timer:1500}).then((function(){j.push("/"),window.location.reload()})),n.next=99;break;case 20:if(!a.includes("Leer")||!i||i===(null===t||void 0===t||null===(b=t.data_user)||void 0===b?void 0:b.url_perfil)){n.next=39;break}return n.next=23,Ue(i);case 23:return p=n.sent,n.next=26,Ye(i);case 26:return g=n.sent,n.next=29,We(i);case 29:return x=n.sent,n.next=32,Ce.a.get("/user/public/url/".concat(i));case 32:O=n.sent,v=O.data,L(v.user),k(p>0?0:x>0?1:g>0?2:0),1!==r&&1!==o&&1!==l||F.a.fire({icon:"error",iconColor:E.a.primary,text:Ee("alerts:alerts.user-no-found"),showConfirmButton:!1,timer:1500}).then((function(){j.push("/"),window.location.reload()})),n.next=99;break;case 39:if(!a.includes("Leer")){n.next=98;break}return n.next=42,Ce.a.post("/user/profile");case 42:return y=n.sent,w=y.data,Z(null===w||void 0===w?void 0:w.user),q(null===w||void 0===w||null===(_=w.user)||void 0===_?void 0:_.linkPhoto),n.next=48,Me();case 48:return C=n.sent,n.next=51,Re();case 51:return N=n.sent,n.next=54,Le();case 54:return B=n.sent,n.next=57,Fe();case 57:if(S=n.sent,k(N>0?0:C>0?1:B>0?2:S>0?3:0),!e.match.params.badgeId){n.next=69;break}return n.next=62,Pe();case 62:return I=n.sent,n.next=65,Ge(null===I||void 0===I||null===(T=I.issued)||void 0===T?void 0:T.email_receptor);case 65:D=n.sent,1===(null===I||void 0===I||null===(A=I.issued)||void 0===A?void 0:A.alertAcept)?F.a.fire({icon:"success",iconColor:E.a.primary,text:Ee("alerts:alerts.badge-accepted"),showConfirmButton:!1,timer:1500}):F.a.fire({title:Ee("alerts:alerts.badge-accepted"),text:Ee("alerts:alerts.close-session"),icon:"success",iconColor:E.a.primary,showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:Ee("buttons:buttons.logout"),cancelButtonText:Ee("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&(D.length>0?(j.push("/sign-in/".concat(e.match.params.badgeId)),Te.postMessage("CerrarSesion")):(j.push("/sign-up/".concat(e.match.params.badgeId)),Te.postMessage("CerrarSesion")));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),n.next=96;break;case 69:if(!e.match.params.certificateId){n.next=79;break}return n.next=72,Pe();case 72:return R=n.sent,n.next=75,Ge(null===R||void 0===R||null===(z=R.issued)||void 0===z?void 0:z.email_receptor);case 75:M=n.sent,1===(null===R||void 0===R||null===(P=R.issued)||void 0===P?void 0:P.alertAcept)?F.a.fire({icon:"success",iconColor:E.a.primary,text:Ee("alerts:alerts.certificate-accepted"),showConfirmButton:!1,timer:1500}):F.a.fire({title:Ee("alerts:alerts.certificate-accepted"),text:Ee("alerts:alerts.close-session"),icon:"success",iconColor:E.a.primary,showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:Ee("buttons:buttons.logout"),cancelButtonText:Ee("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value?M.length>0?(j.push("/sign-in/certificate/".concat(e.match.params.certificateId)),Te.postMessage("CerrarSesion")):(j.push("/sign-up/certificate/".concat(e.match.params.certificateId)),Te.postMessage("CerrarSesion")):window.location.reload();case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),n.next=96;break;case 79:if(!e.match.params.carnetId){n.next=89;break}return n.next=82,Pe();case 82:return Y=n.sent,n.next=85,Ge(null===Y||void 0===Y||null===(U=Y.issued)||void 0===U?void 0:U.email_receptor);case 85:H=n.sent,1===(null===Y||void 0===Y||null===(W=Y.issued)||void 0===W?void 0:W.alertAcept)?F.a.fire({icon:"success",iconColor:E.a.primary,text:Ee("alerts:alerts.carnet-accepted"),showConfirmButton:!1,timer:1500}):F.a.fire({title:Ee("alerts:alerts.carnet-accepted"),text:Ee("alerts:alerts.close-session"),icon:"success",iconColor:E.a.primary,showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:Ee("buttons:buttons.logout"),cancelButtonText:Ee("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&(H.length>0?(j.push("/sign-in/carnet/".concat(e.match.params.carnetId)),Te.postMessage("CerrarSesion")):(j.push("/sign-up/carnet/".concat(e.match.params.carnetId)),Te.postMessage("CerrarSesion")));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),n.next=96;break;case 89:if(!e.match.params.documentTemplateId||!e.match.params.idSignature){n.next=96;break}return K=e.match.params.idSignature,n.next=93,Ce.a.get("/signature/receiver/".concat(K));case 93:V=n.sent,null!==(null===(G=V.data)||void 0===G?void 0:G.signature)?t.correo===G.signature.cuentas.correo?j.push("/document/signature/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature)):F.a.fire({text:Ee("alerts:alerts.user-no-is-signatorie"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Ee("buttons:buttons.logout"),cancelButtonText:Ee("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value?(j.push("/signatorie/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature)),Te.postMessage("CerrarSesion")):j.push("/");case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()):(F.a.fire({icon:"warning",iconColor:E.a.primary,text:Ee("alerts:alerts.document-already"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}),j.push("/"));case 96:n.next=99;break;case 98:t?F.a.fire({text:Ee("alerts:alerts.access-denied"),icon:"error",iconColor:E.a.primary,confirmButtonColor:E.a.primary,confirmButtonText:Ee("buttons:buttons.logout"),confirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(e){e.isConfirmed?(Te.postMessage("CerrarSesion"),j.push("/")):j.push("/")})):j.push("/");case 99:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),Pe=function(){var t=Object(h.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.match.params.certificateId){t.next=4;break}return t.next=3,Ke();case 3:return t.abrupt("return",t.sent);case 4:if(!e.match.params.badgeId){t.next=8;break}return t.next=7,Ve();case 7:return t.abrupt("return",t.sent);case 8:if(!e.match.params.carnetId){t.next=12;break}return t.next=11,He();case 11:return t.abrupt("return",t.sent);case 12:if(!e.match.params.documentId){t.next=16;break}return t.next=15,qe();case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Re=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,e.next=3,Ce.a.post("badgesIssued/getBadgesIssuedByUser",{idOrganizationBackoffice:De});case 3:return a=e.sent,n=a.data,t=n.issued.length,c(n.issued),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,e.next=3,Ce.a.post("certificatesIssued/getCertificatesIssuedByUser",{idOrganizationBackoffice:De});case 3:return a=e.sent,n=a.data,t=n.issued.length,s(n.issued),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,e.next=3,Ce.a.post("carnetsIssued/getCarnetsIssuedByUser",{idOrganizationBackoffice:De});case 3:return a=e.sent,n=a.data,t=n.issued.length,u(n.issued),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,e.next=3,Ce.a.post("documentsCertify/getSignedDocumentsByUser",{idOrganizationBackoffice:De});case 3:return a=e.sent,n=a.data,t=n.signedDocuments.length,b(n.signedDocuments),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=0,e.next=3,Ce.a.post("badgesIssued/public/getBadgesIssuedByUser",{url:t,idOrganizationBackoffice:De});case 3:return n=e.sent,i=n.data,a=i.issued.length,c(i.issued),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),We=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=0,e.next=3,Ce.a.post("certificatesIssued/public/getCertificatesIssuedByUser",{url:t,idOrganizationBackoffice:De});case 3:return n=e.sent,i=n.data,a=i.issued.length,s(i.issued),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ye=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=0,e.next=3,Ce.a.post("carnetsIssued/public/getCarnetsIssuedByUser",{url:t,idOrganizationBackoffice:De});case 3:return n=e.sent,i=n.data,a=i.issued.length,u(i.issued),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),qe=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.documentId),t.next=3,Ce.a.get("documentsCertify/".concat(a));case 3:return n=t.sent,i=n.data,k(3),t.abrupt("return",i.documentCertify);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),He=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.carnetId),t.next=3,Ce.a.get("carnetsIssued/".concat(a));case 3:return n=t.sent,i=n.data,k(2),t.abrupt("return",i.issued);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ke=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.certificateId),t.next=3,Ce.a.get("certificatesIssued/".concat(a));case 3:return n=t.sent,i=n.data,k(1),t.abrupt("return",i.issued);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ve=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.badgeId),t.next=3,Ce.a.get("badgesIssued/".concat(a));case 3:return n=t.sent,i=n.data,k(0),t.abrupt("return",i.issued);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ge=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("user/getAccounts",{correo:t});case 2:return a=e.sent,n=a.data,e.abrupt("return",n.accounts);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Qe=function(e){j.push("/organization/".concat(e)),window.location.reload()};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsx)("div",{className:N.container,children:R&&Object(n.jsxs)(n.Fragment,{children:[te?Object(n.jsx)(Be.a,{variant:"circle",children:Object(n.jsx)(g.a,{variant:"rounded",className:N.container__avatar})}):Object(n.jsx)(g.a,{src:(null===R||void 0===R?void 0:R.linkPhoto)||Y,variant:"rounded",className:N.container__avatar}),Object(n.jsxs)("div",{className:N.container__welcome,children:[!R&&te?Object(n.jsx)(Be.a,{variant:"text",width:250,height:30}):"",Object(n.jsx)("p",{className:N.container__welcome_name,children:R?te?Object(n.jsx)(Be.a,{variant:"text",width:250,height:30}):"".concat(R.primer_nombre," ").concat(R.primer_apellido):te?Object(n.jsx)(Be.a,{variant:"text",width:250,height:30}):"".concat(null===X||void 0===X?void 0:X.primer_nombre," ").concat(null===X||void 0===X?void 0:X.primer_apellido)}),Object(n.jsx)("div",{align:"left",children:(null===R||void 0===R?void 0:R.pagina_web)?Object(n.jsx)("a",{href:R.pagina_web,target:"_blank",rel:"noreferrer",children:Object(n.jsx)(B.a,{})}):""})]})]})}),te?Object(n.jsx)(Be.a,{variant:"rect",height:50}):Object(n.jsx)(M,{view:r.length>0?0:o.length>0?1:l.length>0?2:m.length>0?3:0,setView:k,handleSearch:function(e){I(e.target.value)}}),te?Object(n.jsx)("div",{className:N.badges,children:Object(p.a)(Array(6)).map((function(){return Object(n.jsx)(Be.a,{variant:"rect",children:Object(n.jsx)(It,{})})}))}):0===C&&r.length>0||1===C&&o.length>0||2===C&&l.length>0||3===C&&m.length>0?0===C?Object(n.jsx)("div",{className:N.badges,children:r.filter((function(e){var t,a,n,i,r;return(null===(t=e.insigniasEmitidas)||void 0===t||null===(a=t.plantillasInsignias)||void 0===a?void 0:a.nombre.toLowerCase().includes(A.toLowerCase()))||(null===(n=e.insigniasEmitidas)||void 0===n||null===(i=n.plantillasInsignias)||void 0===i||null===(r=i.organizaciones)||void 0===r?void 0:r.nombre.toLowerCase().includes(A.toLowerCase()))})).map((function(e,t){var a,i,r,c,o,s,l,d,u,m;return Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(It,{badgeImage:null===(a=e.insigniasEmitidas)||void 0===a||null===(i=a.plantillasInsignias)||void 0===i?void 0:i.linkPhoto,badgeName:null===(r=e.insigniasEmitidas)||void 0===r||null===(c=r.plantillasInsignias)||void 0===c?void 0:c.nombre,organizationName:null!==(null===(o=e.insigniasEmitidas)||void 0===o||null===(s=o.plantillasInsignias)||void 0===s?void 0:s.id_organizacion_hija)?null===(l=e.insigniasEmitidas)||void 0===l||null===(d=l.plantillasInsignias)||void 0===d?void 0:d.organizacionesHijas.nombre:null===(u=e.insigniasEmitidas)||void 0===u||null===(m=u.plantillasInsignias)||void 0===m?void 0:m.organizaciones.nombre,issuedId:Object(Ie.b)(e.id_insignias_emitidas),publicBadge:null!==R},"badge".concat(t))})}))}):1===C?Object(n.jsx)("div",{className:N.certificate,children:o.filter((function(e){var t,a,n,i,r;return(null===(t=e.certificadosEmitidos)||void 0===t||null===(a=t.plantillasCertificados)||void 0===a?void 0:a.nombre.toLowerCase().includes(A.toLowerCase()))||(null===(n=e.certificadosEmitidos)||void 0===n||null===(i=n.plantillasCertificados)||void 0===i||null===(r=i.organizaciones)||void 0===r?void 0:r.nombre.toLowerCase().includes(A.toLowerCase()))})).map((function(e,t){var a,i,r,c,o,s,l,d,u,m,b,p,j,f,h,g;return Object(n.jsx)(zt,{format:(null===(a=e.certificadosEmitidos)||void 0===a||null===(i=a.plantillasCertificados)||void 0===i?void 0:i.width)<(null===(r=e.certificadosEmitidos)||void 0===r||null===(c=r.plantillasCertificados)||void 0===c?void 0:c.height)?0:1,certificateImage:null===(o=e.certificadosEmitidos)||void 0===o||null===(s=o.plantillasCertificados)||void 0===s?void 0:s.linkPhoto,certificateName:null===(l=e.certificadosEmitidos)||void 0===l||null===(d=l.plantillasCertificados)||void 0===d?void 0:d.nombre,organizationName:null!==(null===(u=e.certificadosEmitidos)||void 0===u||null===(m=u.plantillasCertificados)||void 0===m?void 0:m.id_organizacion_hija)?null===(b=e.certificadosEmitidos)||void 0===b||null===(p=b.plantillasCertificados)||void 0===p||null===(j=p.organizacionesHijas)||void 0===j?void 0:j.nombre:null===(f=e.certificadosEmitidos)||void 0===f||null===(h=f.plantillasCertificados)||void 0===h||null===(g=h.organizaciones)||void 0===g?void 0:g.nombre,issuedId:Object(Ie.b)(e.id_certificados_emitidos),publicCertificate:null!==R,open:ce,certificateId:xe},"certificate".concat(t))}))}):2===C?Object(n.jsx)("div",{className:N.certificate,children:l.filter((function(e){var t,a,n,i,r;return(null===(t=e.carnetsEmitidos)||void 0===t||null===(a=t.plantillasCarnets)||void 0===a?void 0:a.nombre.toLowerCase().includes(A.toLowerCase()))||(null===(n=e.carnetsEmitidos)||void 0===n||null===(i=n.plantillasCarnets)||void 0===i||null===(r=i.organizaciones)||void 0===r?void 0:r.nombre.toLowerCase().includes(A.toLowerCase()))})).map((function(e,t){var a,i,r,c,o,s,l,d,u,m,b;return Object(n.jsx)(zt,{format:(null===(a=e.carnetsEmitidos)||void 0===a||null===(i=a.plantillasCarnets)||void 0===i?void 0:i.width)<(null===(r=e.carnetsEmitidos)||void 0===r||null===(c=r.plantillasCarnets)||void 0===c?void 0:c.height)?0:1,certificateImage:null===(o=e.carnetsEmitidos)||void 0===o||null===(s=o.plantillasCarnets)||void 0===s?void 0:s.linkPhoto,certificateName:null===(l=e.carnetsEmitidos)||void 0===l||null===(d=l.plantillasCarnets)||void 0===d?void 0:d.nombre,organizationName:null===(u=e.carnetsEmitidos)||void 0===u||null===(m=u.plantillasCarnets)||void 0===m||null===(b=m.organizaciones)||void 0===b?void 0:b.nombre,issuedId:Object(Ie.b)(e.id_carnets_emitidos),publicCertificate:null!==R,open:de,certificateId:ye,isCarnets:!0},"carnet".concat(t))}))}):Object(n.jsx)("div",{className:N.certificate,children:m.filter((function(e){var t,a,n,i;return(null===(t=e.documentosEmitidos)||void 0===t?void 0:t.nombre.toLowerCase().includes(A.toLowerCase()))||(null===(a=e.documentosEmitidos)||void 0===a||null===(n=a.coleccionesDocumentos)||void 0===n||null===(i=n.organizaciones)||void 0===i?void 0:i.nombre.toLowerCase().includes(A.toLowerCase()))})).map((function(e,t){var a,i,r,c,o;return Object(n.jsx)(zt,{format:0,certificateImage:null===(a=e.documentosEmitidos)||void 0===a?void 0:a.photoDocument,certificateName:null===(i=e.documentosEmitidos)||void 0===i?void 0:i.nombre,organizationName:null===(r=e.documentosEmitidos)||void 0===r||null===(c=r.coleccionesDocumentos)||void 0===c||null===(o=c.organizaciones)||void 0===o?void 0:o.nombre,issuedId:Object(Ie.b)(e.id_documentos_emitidos),publicCertificate:null!==R,open:pe,certificateId:Se,isDocument:!0,waitDocument:2===e.documentosEmitidos.estado?Ee("certifyDocuments:document.waiting-for-signatories"):""},"document".concat(t))}))}):(null===t||void 0===t?void 0:t.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones)?Object(n.jsx)("div",{className:N.container_noBadges,children:Object(n.jsxs)("div",{className:N.container_text,children:[Object(n.jsx)("p",{className:N.text,children:"".concat(Ee("dashboard:have-badges-certificates"),"\n              ").concat(Ee(0===C?"dashboard:badges":1===C?"dashboard:certificates":2===C?"dashboard:carnets":"dashboard:signedDocuments"),"!")}),Object(n.jsx)("p",{className:N.text_secondary,children:"".concat(3!==C?Ee("dashboard:can-know"):"","\n              ").concat(0===C?Ee("dashboard:badges-2"):1===C?Ee("dashboard:certificates-2"):2===C?Ee("dashboard:carnets-2"):"","\n              ").concat(3!==C?Ee("dashboard:organization-offered"):"")}),(null===t||void 0===t?void 0:t.data_user.gruposUsuariosOrganizaciones.length)>1&&3!==C?Object(n.jsx)(x.a,{variant:"outlined",component:"span",className:N.button,onClick:function(e){G(!0)},children:Ee("buttons:buttons.click-here")}):3!==C?Object(n.jsx)(x.a,{variant:"outlined",component:"span",className:N.button,onClick:function(e){var a;return Qe(null===(a=t.data_user.gruposUsuariosOrganizaciones[0].organizaciones)||void 0===a?void 0:a.url_perfil)},children:Ee("buttons:buttons.click-here")}):""]})}):R?Object(n.jsx)("div",{className:N.container_noBadges,children:Object(n.jsx)("div",{className:N.container_text,children:Object(n.jsxs)("p",{className:N.text,children:[Ee("dashboard:this-user")," ",Ee(0===C?"dashboard:badges":1===C?"dashboard:certificates":"dashboard:carnets"),"!"]})})}):Object(n.jsx)("div",{className:N.container_noBadges,children:Object(n.jsxs)("div",{className:N.container_text,children:[Object(n.jsxs)("p",{className:N.text,children:[Ee("dashboard:have-badges-certificates")," ",Ee(0===C?"dashboard:badges":1===C?"dashboard:certificates":"dashboard:carnets"),"!"]}),Object(n.jsxs)("p",{className:N.text_secondary,children:[Ee("dashboard:wait")," "]}),Object(n.jsx)(x.a,{className:N.editPerfilButton,onClick:function(e){return j.push("/profileSettings")},children:Ee("dashboard:edit-profile")})]})}),Object(n.jsxs)(O.a,{open:V,onClose:function(){G(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:Ee("dialogs:dialog.select-organization")}),Object(n.jsx)(_.a,{align:"center",children:null===t||void 0===t?void 0:t.data_user.gruposUsuariosOrganizaciones.map((function(e){var t;return Object(n.jsx)(y.a,{button:!0,onClick:function(){return Qe(e.id_organizaciones)},children:Object(n.jsx)(w.a,{primary:null===(t=e.organizaciones)||void 0===t?void 0:t.nombre})})}))})]}),Object(n.jsx)(O.a,{fullScreen:!0,open:re,TransitionComponent:Aa,children:Object(n.jsx)(ma,{certificateId:ge,setOpenDialog:ce})}),Object(n.jsx)(O.a,{fullScreen:!0,open:le,TransitionComponent:Aa,children:Object(n.jsx)(fa,{carnetId:_e,setOpenDialog:de})}),Object(n.jsx)(O.a,{fullScreen:!0,open:be,TransitionComponent:Aa,children:Object(n.jsx)(Sa,{documentId:Ne,setOpenDialog:pe})})]})})),Da=a.p+"static/media/cadena.24278006.png";var za=Object(C.a)((function(e){var t;return{container:Object(b.a)({display:"flex",flexDirection:"column",alignItems:"center",margin:"4em 0"},e.breakpoints.up("sm"),{flexDirection:"row",justifyContent:"initial",alignItems:"initial",margin:"1em 4em"}),container_noBadges:Object(b.a)({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%"},e.breakpoints.up("sm"),{flexDirection:"row",alignItems:"center"}),imagen:Object(b.a)({width:"340px",height:"340px",margin:"1rem"},e.breakpoints.up("sm"),{marginBottom:0}),container_text:{maxWidth:"40rem",display:"flex",flexDirection:"column",justifyContent:"center","& p":{margin:0}},text:{fontSize:"2em",fontWeight:"bold",color:E.a.primary,textAlign:"center"},container__avatar:(t={width:"250px",height:"250px",marginBottom:10},Object(b.a)(t,e.breakpoints.up("sm"),{marginBottom:0}),Object(b.a)(t,"& img",{height:"100%",objectFit:"contain"}),t),container__welcome:Object(b.a)({display:"flex",flexDirection:"column",justifyContent:"center",margin:"0 10px","& p":{margin:0,textAlign:"justify"}},e.breakpoints.up("sm"),{margin:0,marginLeft:"3em"}),container__welcome_message:{fontSize:"1.3em"},container__welcome_name:{fontSize:"1.4em",fontWeight:"bold",textTransform:"uppercase"},container__social:{display:"flex","& > *":{margin:0},"& div":{margin:"6px 12px"}},container__social_icons:{display:"flex","& > *":{width:e.spacing(4),height:e.spacing(4),borderRadius:"auto"}},badges:{display:"flex",justifyContent:"center",marginBottom:"1em"}}})),Pa={setBadges:I.l,setCertificates:I.q},Ra=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,badges:e.badges||[],certificates:e.certificates||[],permission:(e.permission||[]).filter((function(e){var t,a;return"dashboard"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Pa)((function(e){var t,a,c,o,s,l,u=e.badges,m=e.setBadges,b=e.certificates,j=e.setCertificates,x=e.history,O=za(),v=Object(i.useState)(!0),_=Object(d.a)(v,2),y=_[0],w=_[1],C=r.a.useState(1),k=Object(d.a)(C,2),N=k[0],B=k[1],S=Object(i.useState)(""),T=Object(d.a)(S,2),A=T[0],E=T[1],I=Object(i.useState)({}),z=Object(d.a)(I,2),P=z[0],R=z[1],L=Object(i.useState)([]),F=Object(d.a)(L,2),U=F[0],W=F[1],Y=Object(i.useState)(),q=Object(d.a)(Y,2),H=q[0],K=q[1],V=Object(D.a)(["dashboard"]),G=Object(d.a)(V,1)[0],Q=Object(i.useState)(""),J=Object(d.a)(Q,2),X=J[0],Z=J[1];Object(i.useEffect)((function(){var e,t=null===(e=JSON.parse(window.localStorage.state))||void 0===e?void 0:e.styles;return Z(t.no_insignias),$().catch((function(){x.push("/500"),window.location.reload()})),function(){m([]),j([])}}),[]);var $=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u,m;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=e.match.params.id,!e.match.params.id){t.next=13;break}return t.next=4,Ce.a.get("/organization/url/".concat(a));case 4:l=t.sent,d=l.data,R(d.organization),u=null===(n=d.organization)||void 0===n?void 0:n.socialNetworkUserOrganizations.filter((function(e){return 1===e.id_redes_sociales})),(m=null===(i=d.organization)||void 0===i?void 0:i.socialNetworkUserOrganizations.filter((function(e){return 1!==e.id_redes_sociales}))).push(u[0]),W(m.filter((function(e){return void 0!==e}))),ee(null===(r=d.organization)||void 0===r||null===(c=r.organizations)||void 0===c?void 0:c.id),te(null===(o=d.organization)||void 0===o||null===(s=o.organizations)||void 0===s?void 0:s.id);case 13:w(!1);case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ee=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/templateBadge/getTemplatesBadgesDashboard",{id_organizaciones:t});case 2:a=e.sent,0===(n=a.data).templatesBadges.length?K(1):K(0),m(n.templatesBadges);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),te=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/certificateTemplate/getCertificateTemplatesDashboard",{id_organizaciones:t});case 2:a=e.sent,0===(n=a.data).certificateTemplates.length?K(2):K(0),j(n.certificateTemplates);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsxs)("div",{className:O.container,children:[y?Object(n.jsx)(Be.a,{variant:"circle",children:Object(n.jsx)(g.a,{variant:"rounded",className:O.container__avatar})}):Object(n.jsx)(g.a,{variant:"rounded",className:O.container__avatar,src:null===P||void 0===P||null===(t=P.organizations)||void 0===t?void 0:t.linkPhoto}),Object(n.jsxs)("div",{className:O.container__welcome,children:[y?Object(n.jsx)(Be.a,{variant:"text",width:"30%",height:30}):Object(n.jsx)("p",{className:O.container__welcome_name,children:null===P||void 0===P||null===(a=P.organizations)||void 0===a?void 0:a.nombre}),y?Object(n.jsx)(Be.a,{variant:"rect",width:"80vw",height:150}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("p",{children:null===P||void 0===P||null===(c=P.organizations)||void 0===c?void 0:c.biografia}),Object(n.jsxs)("div",{className:O.container__social,children:[null===U||void 0===U?void 0:U.map((function(e,t){return Object(n.jsx)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:O.link,children:Object(n.jsx)(g.a,{variant:"rounded",className:O.container__social_icons,src:e.linkIcons})},"socialmedia".concat(t))})),(null===P||void 0===P||null===(o=P.organizations)||void 0===o?void 0:o.sitio_web)&&""!==(null===P||void 0===P||null===(s=P.organizations)||void 0===s?void 0:s.sitio_web)&&Object(n.jsx)("a",{href:null===P||void 0===P||null===(l=P.organizations)||void 0===l?void 0:l.sitio_web,target:"_blank",rel:"noreferrer",className:O.link,children:Object(n.jsx)(g.a,{variant:"rounded",className:O.container__social_icons,src:Da})})]})]})]})]}),y?Object(n.jsx)(Be.a,{variant:"rect",height:50}):Object(n.jsx)(M,{view:u.length>0?0:b.length>0?1:0,setView:K,handleSearch:function(e){E(e.target.value)},organization:!0}),y?Object(n.jsx)("div",{children:Object(p.a)(Array(6)).map((function(){return Object(n.jsx)(Be.a,{variant:"rect",children:Object(n.jsx)(It,{})})}))}):0===H&&u.length>0||1===H&&b.length>0?Object(n.jsxs)("div",{children:[Object(n.jsx)("div",{children:Object(n.jsx)(Rt.a,{maxWidth:"xl",children:Object(n.jsx)(ye.a,{container:!0,justify:"center",spacing:3,children:0===H?u.filter((function(e){var t,a,n;return(null===e||void 0===e||null===(t=e.nombre)||void 0===t?void 0:t.toLowerCase().includes(A))||(null===e||void 0===e||null===(a=e.organizaciones)||void 0===a||null===(n=a.nombre)||void 0===n?void 0:n.toLowerCase().includes(A))})).slice(10*(N-1),10*N).map((function(e,t){var a;return Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,md:4,lg:3,xl:2,className:O.badges,children:Object(n.jsx)(It,{badgeImage:null===e||void 0===e?void 0:e.linkPhoto,badgeName:null===e||void 0===e?void 0:e.nombre,organizationName:null===e||void 0===e||null===(a=e.organizaciones)||void 0===a?void 0:a.nombre,issuedId:Object(Ie.b)(null===e||void 0===e?void 0:e.id),publicBadge:!0,templateBadge:!0},"badge".concat(t))})})):1===H?b.filter((function(e){var t,a,n;return(null===e||void 0===e||null===(t=e.nombre)||void 0===t?void 0:t.toLowerCase().includes(A))||(null===e||void 0===e||null===(a=e.organizaciones)||void 0===a||null===(n=a.nombre)||void 0===n?void 0:n.toLowerCase().includes(A))})).slice(10*(N-1),10*N).map((function(e,t){var a;return Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,md:4,lg:3,xl:2,className:O.badges,children:Object(n.jsx)(zt,{format:e.width<e.height?0:1,certificateImage:e.linkPhoto,certificateName:e.nombre,organizationName:null===(a=e.organizaciones)||void 0===a?void 0:a.nombre},"certificate".concat(t))})})):""})})}),Object(n.jsx)(Lt.a,{component:"span",display:"flex",justifyContent:"center",children:Object(n.jsx)(ta.a,{count:function(e,t){return 0===t?Math.ceil((null===u||void 0===u?void 0:u.length)/e):Math.ceil((null===b||void 0===b?void 0:b.length)/e)}(10,H),page:N,onChange:function(e,t){B(t)},defaultPage:1,size:"large",className:O.pagination})})]}):Object(n.jsxs)("div",{className:O.container_noBadges,children:[Object(n.jsx)("img",{className:O.imagen,alt:"imagen sin badges",src:X}),Object(n.jsx)("div",{className:O.container_text,children:Object(n.jsxs)("p",{className:O.text,children:[" ",G("dashboard:this-organization"),G("dashboard:badges"),"!"]})})]})]})}));var Ma=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"1em"},img:{width:e.spacing(30),height:e.spacing(30)},img_verificado:Object(b.a)({display:"none"},e.breakpoints.up("sm"),{display:"inline",height:e.spacing(5)}),img_org:{width:"auto",height:e.spacing(6)},container_org:{display:"flex",justifyContent:"center",textAlign:"center",alignItems:"center"},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},textParagraph:{textAlign:"justify",color:"#5c5c5c",margin:"1em 0 1em 0"},textCode:{color:"#808080",textAlign:"left"},link:{color:E.a.primary,textDecoration:"underline"},button:{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".5em 3em","&:hover":{backgroundColor:E.a.secondary,color:"#ffffff"}},containerButtonToCopy:{display:"flex",alignItems:"center","& svg":{color:E.a.primary,marginLeft:15,cursor:"pointer"}},header:Object(b.a)({marginTop:"3em",display:"flex",justifyContent:"center",textAlign:"center"},e.breakpoints.up("sm"),{marginTop:"0"}),divider:{marginRight:"2em"},linkUser:{color:"#ffffff","&:hover":{color:"#ffffff"}}}})),La={bgcolor:"background.paper",borderColor:"#808080",m:1,border:1,padding:1},Fa={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},Ua=function(e){var t,a,r,c,o,s,l,u,b,p,j,g,x,O,v,_,y,w,C,k,N,B,S,T,A,E,I,z,P,R,M,L,F,U,Y,q,H,K,V,G,Q,J,X,Z,$,ee,te,ae,ne=Ma(),ie=Object(i.useState)({}),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)({}),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(i.useState)({}),be=Object(d.a)(me,2),pe=be[0],je=be[1],fe=Object(i.useState)({}),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Object(i.useState)([]),ve=Object(d.a)(Oe,2),_e=ve[0],ke=ve[1],Be=Object(i.useState)([]),Se=Object(d.a)(Be,2),Te=Se[0],Ae=Se[1],Ee=Object(i.useState)(!1),De=Object(d.a)(Ee,2),ze=De[0],Pe=De[1],Re=Object(i.useState)(!1),Me=Object(d.a)(Re,2),Le=Me[0],Fe=Me[1],Ue=Object(i.useState)(!1),We=Object(d.a)(Ue,2),Ye=We[0],qe=We[1],He=Object(i.useState)(""),Ke=Object(d.a)(He,2),Ve=Ke[0],Ge=Ke[1],Qe=Object(i.useState)({}),Je=Object(d.a)(Qe,2),Xe=Je[0],Ze=Je[1],$e=Object(i.useState)(""),et=Object(d.a)($e,2),tt=et[0],at=et[1],nt=Object(i.useState)(null),it=Object(d.a)(nt,2),rt=it[0],ct=it[1],ot="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2)),st=Object(D.a)(["certificateBadgeTemplate","buttons"]),lt=Object(d.a)(st,1)[0];Object(i.useEffect)((function(){var t,a=null===(t=JSON.parse(window.localStorage.state))||void 0===t?void 0:t.styles;at(a.icon_verificado),dt().catch((function(){e.history.push("/500"),window.location.reload()}))}),[]);var dt=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u,m,b,p,j,h,g,x,O,v,_,y,w,C,k,N,B,S,T;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Pe(!0),B=Object(Ie.a)(e.match.params.issuedBadgeId),t.next=4,Ce.a.get("/badgesIssued/badges/".concat(B));case 4:S=t.sent,T=S.data,oe(null===T||void 0===T?void 0:T.issued),ut(null===T||void 0===T||null===(a=T.issued)||void 0===a||null===(n=a.badge)||void 0===n?void 0:n.plantillasInsignias.nivel_vp),mt(null===T||void 0===T||null===(i=T.issued)||void 0===i||null===(r=i.badge)||void 0===r?void 0:r.plantillasInsignias.tiempo_vp),bt(null===T||void 0===T||null===(c=T.issued)||void 0===c||null===(o=c.badge)||void 0===o?void 0:o.plantillasInsignias.costo_vp),ke(null===T||void 0===T||null===(s=T.issued)||void 0===s||null===(l=s.badge)||void 0===l||null===(d=l.plantillasInsignias)||void 0===d?void 0:d.plantillasHabilidades),Ae(null===T||void 0===T||null===(u=T.issued)||void 0===u||null===(m=u.badge)||void 0===m||null===(b=m.plantillasInsignias)||void 0===b?void 0:b.criterios),Ze(null!==(null===T||void 0===T||null===(p=T.issued)||void 0===p||null===(j=p.badge.plantillasInsignias)||void 0===j?void 0:j.id_organizacion_hija)?null===T||void 0===T||null===(h=T.issued)||void 0===h||null===(g=h.badge.plantillasInsignias)||void 0===g?void 0:g.organizacionesHijas:null===T||void 0===T||null===(x=T.issued)||void 0===x||null===(O=x.badge.plantillasInsignias)||void 0===O?void 0:O.organizaciones),ct(null===T||void 0===T||null===(v=T.issued)||void 0===v?void 0:v.photoOrganization),0===(null===T||void 0===T||null===(_=T.issued)||void 0===_||null===(y=_.badge)||void 0===y?void 0:y.estado)?Ge("Revoked"):null!==(null===T||void 0===T||null===(w=T.issued)||void 0===w||null===(C=w.badge)||void 0===C?void 0:C.fecha_expiracion)&&Object(Vt.a)(new Date(null===T||void 0===T||null===(k=T.issued)||void 0===k||null===(N=k.badge)||void 0===N?void 0:N.fecha_expiracion),new Date)?Ge("Expired"):Ge("Verified"),Pe(!1);case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ut=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:a=e.sent,n=a.data,i=n.levels.filter((function(e){return e.id===t})),ue(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),mt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:a=e.sent,n=a.data,i=n.time.filter((function(e){return e.id===t})),je(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),bt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:a=e.sent,n=a.data,i=n.costs.filter((function(e){return e.id===t})),xe(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return ze?Object(n.jsx)(_t,{loading:ze}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsx)(Rt.a,{className:ne.container,maxWidth:"xl",children:Object(n.jsxs)(ye.a,{container:!0,spacing:0,className:ne.root,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,className:"text-center",children:[Object(n.jsx)("img",{alt:"img-badge",src:null===ce||void 0===ce?void 0:ce.photoBadge,className:ne.img}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:ne.textTitle,children:[lt("certificateBadgeTemplate:details.issued-by"),":"]}),Object(n.jsx)("div",{className:"container_org",children:Object(n.jsx)("a",{href:"/organization/".concat(null===Xe||void 0===Xe?void 0:Xe.url_perfil),target:"_blank",rel:"noreferrer",children:Object(n.jsx)("img",{"aria-label":"img_organization",className:ne.img_org,src:rt})})})]}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:ne.textBolder,children:[lt("certificateBadgeTemplate:details.issued"),":"]}),Object(n.jsx)(we.a,{className:ne.text,children:Ne()(null===ce||void 0===ce||null===(r=ce.badge)||void 0===r?void 0:r.fecha_emision).format("DD-MM-YYYY")})]}),null!==(null===ce||void 0===ce||null===(c=ce.badge)||void 0===c?void 0:c.fecha_expiracion)&&"0000-00-00"!==(null===ce||void 0===ce||null===(o=ce.badge)||void 0===o?void 0:o.fecha_expiracion)&&Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:ne.textBolder,children:[lt("certificateBadgeTemplate:details.expiration"),":"]}),Object(n.jsx)(we.a,{className:ne.text,children:Ne()(null===ce||void 0===ce||null===(s=ce.badge)||void 0===s?void 0:s.fecha_expiracion).format("DD-MM-YYYY")})]}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:ne.textBolder,children:[lt("certificateBadgeTemplate:details.badge-link"),":"]}),Object(n.jsx)(Lt.a,{display:"flex",justifyContent:"center",children:Object(n.jsxs)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},La),{},{className:ne.containerButtonToCopy,children:[Object(n.jsx)(we.a,{className:ne.textCode,children:"".concat(window.location.origin,"/badges/").concat(e.match.params.issuedBadgeId)}),Object(n.jsx)(Pt.CopyToClipboard,{text:"".concat(window.location.origin,"/badges/").concat(e.match.params.issuedBadgeId),onCopy:function(){return qe(!0)},children:Object(n.jsx)(qt.a,{icon:Ht.a,size:"lg"})})]}))}),Ye&&Object(n.jsx)(we.a,{className:ne.text,children:lt("certificateBadgeTemplate:details.copied")})]}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:ne.textBolder,children:[lt("certificateBadgeTemplate:details.badge-code"),":"]}),Object(n.jsx)(Lt.a,{display:"flex",justifyContent:"center",children:Object(n.jsxs)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},La),{},{className:ne.containerButtonToCopy,children:[Object(n.jsx)(we.a,{className:ne.textCode,children:"".concat(null===ce||void 0===ce||null===(l=ce.badge)||void 0===l?void 0:l.codigo_insignia)}),Object(n.jsx)(Pt.CopyToClipboard,{text:"".concat(null===ce||void 0===ce||null===(u=ce.badge)||void 0===u?void 0:u.codigo_insignia),onCopy:function(){return Fe(!0)},children:Object(n.jsx)(qt.a,{icon:Ht.a,size:"lg"})})]}))}),Le&&Object(n.jsx)(we.a,{className:ne.text,children:lt("certificateBadgeTemplate:details.copied")})]})]}),Object(n.jsx)(W.a,{orientation:"vertical",flexItem:!0,className:ne.divider}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:7,children:[Object(n.jsx)("div",{className:ne.header,children:Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:9,children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:ne.textTitle,children:null===ce||void 0===ce||null===(b=ce.badge)||void 0===b||null===(p=b.plantillasInsignias)||void 0===p?void 0:p.nombre}),ot?Object(n.jsx)("img",{alt:"img_verificado",src:"Verified"===Ve?Jt:"Revoked"===Ve?Xt:Zt,className:ne.img_verificado}):Object(n.jsx)("img",{alt:"img_verificado",src:"Verified"===Ve?tt:"Revoked"===Ve?Gt:Qt,className:ne.img_verificado})]})}),2===(null===ce||void 0===ce||null===(j=ce.badge)||void 0===j?void 0:j.estado)&&(null===ce||void 0===ce||null===(g=ce.badge)||void 0===g?void 0:g.insignias.length)>0?Object(n.jsx)(ye.a,{item:!0,xs:12,sm:3,children:Object(n.jsx)(Mt.a,{href:"/certificates/verify/".concat(e.match.params.issuedBadgeId),target:"_blank",underline:"none",variant:"inherit",className:"my-2 ".concat(ne.button),children:lt("buttons:buttons.verify")})}):""]})}),Object(n.jsx)(we.a,{className:ne.textParagraph,gutterBottom:!0,children:null===ce||void 0===ce||null===(x=ce.badge)||void 0===x||null===(O=x.plantillasInsignias)||void 0===O?void 0:O.descripcion}),Object(n.jsxs)(we.a,{className:ne.text,gutterBottom:!0,children:[lt("certificateBadgeTemplate:details.coffered"),":"]}),Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Fa),{},{children:2===(null===ce||void 0===ce||null===(v=ce.badge)||void 0===v?void 0:v.estado)&&(null===ce||void 0===ce||null===(_=ce.badge)||void 0===_?void 0:_.insignias.length)>0?Object(n.jsx)(Mt.a,{href:"/dashboard/".concat(null===(y=ce.badge)||void 0===y||null===(w=y.insignias[0])||void 0===w||null===(C=w.cuentas)||void 0===C||null===(k=C.usuarios)||void 0===k?void 0:k.url_perfil),target:"_blank",underline:"none",className:ne.linkUser,children:Object(n.jsx)(we.a,{children:"".concat(null===ce||void 0===ce||null===(N=ce.badge)||void 0===N||null===(B=N.primer_nombre_receptor)||void 0===B?void 0:B.toUpperCase()," ").concat((null===ce||void 0===ce||null===(S=ce.badge)||void 0===S||null===(T=S.segundo_nombre_receptor)||void 0===T?void 0:T.toUpperCase())||""," ").concat(null===ce||void 0===ce||null===(A=ce.badge)||void 0===A||null===(E=A.primer_apellido_receptor)||void 0===E?void 0:E.toUpperCase()," ").concat((null===ce||void 0===ce||null===(I=ce.badge)||void 0===I||null===(z=I.segundo_apellido_receptor)||void 0===z?void 0:z.toUpperCase())||"")})}):Object(n.jsx)(we.a,{children:"".concat(null===ce||void 0===ce||null===(P=ce.badge)||void 0===P||null===(R=P.primer_nombre_receptor)||void 0===R?void 0:R.toUpperCase()," ").concat((null===ce||void 0===ce||null===(M=ce.badge)||void 0===M||null===(L=M.segundo_nombre_receptor)||void 0===L?void 0:L.toUpperCase())||""," ").concat(null===ce||void 0===ce||null===(F=ce.badge)||void 0===F||null===(U=F.primer_apellido_receptor)||void 0===U?void 0:U.toUpperCase()," ").concat((null===ce||void 0===ce||null===(Y=ce.badge)||void 0===Y||null===(q=Y.segundo_apellido_receptor)||void 0===q?void 0:q.toUpperCase())||"")})}))}),Object(n.jsxs)(we.a,{className:ne.textBolder,gutterBottom:!0,children:[lt("certificateBadgeTemplate:details.met-requirements"),":"]}),Te.map((function(e,t){return null===e.link||""===e.link?Object(n.jsx)(we.a,{className:ne.text,children:e.descripcion_criterio},"criteria".concat(t)):Object(n.jsx)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:ne.link,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))})),(null===ce||void 0===ce||null===(H=ce.badge)||void 0===H?void 0:H.merito)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{className:ne.textBolder,gutterBottom:!0,children:[lt("certificateBadgeTemplate:details.merit"),":"]}),Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Fa),{},{children:Object(n.jsx)(we.a,{children:null===ce||void 0===ce||null===(K=ce.badge)||void 0===K?void 0:K.merito})}))}),(null===ce||void 0===ce||null===(V=ce.badge)||void 0===V?void 0:V.link_merito)&&Object(n.jsxs)(Mt.a,{href:null===ce||void 0===ce||null===(G=ce.badge)||void 0===G?void 0:G.link_merito,target:"_blank",rel:"noreferrer",className:ne.link,children:[lt("certificateBadgeTemplate:details.merit-link"),":",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,align:"center",className:ne.root,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:ne.textTitle,children:ot?de.valor_parametro_en:de.valor_parametro}),Object(n.jsx)(we.a,{className:ne.text,children:lt("certificateBadgeTemplate:details.level")})]}),null!==(null===ce||void 0===ce||null===(Q=ce.badge)||void 0===Q||null===(J=Q.plantillasInsignias)||void 0===J?void 0:J.cantidad_tiempo)&&void 0!==(null===pe||void 0===pe?void 0:pe.valor_parametro)?Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:ne.textTitle,children:"".concat(null===ce||void 0===ce||null===(X=ce.badge)||void 0===X||null===(Z=X.plantillasInsignias)||void 0===Z?void 0:Z.cantidad_tiempo," ").concat(ot?pe.valor_parametro_en:pe.valor_parametro)}),Object(n.jsxs)(we.a,{className:ne.text,children:[" ",lt("certificateBadgeTemplate:details.time")]})]}):"",Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:ne.textTitle,children:ot?ge.valor_parametro_en:ge.valor_parametro}),Object(n.jsxs)(we.a,{className:ne.text,children:[" ",lt("certificateBadgeTemplate:details.cost")]})]})]}),Object(n.jsxs)(ye.a,{container:!0,className:ne.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:2,children:Object(n.jsxs)(we.a,{className:ne.textBolder,children:[lt("certificateBadgeTemplate:details.skills"),":"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:10,children:Object(n.jsx)(ye.a,{container:!0,children:_e.map((function(e){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Fa),{},{children:Object(n.jsx)(we.a,{children:e.habilidades.descripcion})}))},e.id)}))})})]}),(null===ce||void 0===ce||null===($=ce.badge)||void 0===$||null===(ee=$.plantillasInsignias)||void 0===ee?void 0:ee.url)&&Object(n.jsxs)(Mt.a,{href:null===ce||void 0===ce||null===(te=ce.badge)||void 0===te||null===(ae=te.plantillasInsignias)||void 0===ae?void 0:ae.url,target:"_blank",className:ne.link,children:[lt("certificateBadgeTemplate:details.additional"),":",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]})]})})]})},Wa=a(639),Ya=a(1158),qa=a(1155),Ha=a(1156),Ka=a(1157),Va=a(1159),Ga=a(1160),Qa=a(1161),Ja=a(219),Xa=a.n(Ja),Za=a.p+"static/media/logo_pdf.4524a10a.svg",$a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAEYCAYAAACHjumMAAAbLklEQVR4nOydf4wcZ32Hv+/s7d3FDeHsK6gSAfwjom2iUvvOSLSF3pydBFJBCC2kMa0q+uuPIqUmUDWtKL49VLW0VQv0D0QrtY2oSBOCqkqhIhFJdq8kCJuc3YLUCuqLTUObBOLcJQT77nZ33mpmd3b39nbenXd33nm/M/N5pGvMGZu3CXqY9/PseieklAQAACZwbB8AAJBfIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIA5lpaWbB8BRFA94izK+amPL9g+CFOqc+V3VeemPmr7HGAwvlvwBMOQhRmalMcm7nZ/dOqLtK90d21+6pOQzE58ubj7yp93Z0sfkzfuqS3MOPttnwnsBoJhhi+X2vzkA1Sa/DiR2BN8c1/ppC+ZJSJh+3wcCOVCgiaDbwhaqB2drkIy/IBgGNGRizNx666f3Fc6Wblpz9nqXucnrRyOAQszYo88Pv1nO+QSImg/JMMPCIYJSrl0OewenX6siJLx5VKbn/4iOc7v75JLCCTDDgiGCbW5ibuGyCXkx9yj0/cW7bpUm59aIkcsDv03tiRzTyqHAkOBYBhQPeIsUql8SuOXHK7MT32iKMNvda78LhLOB2P/AkEL1bmpitFDgVhAMBbZUYvCQTcu7eE375LZNejGxJ0tLaEu2QeCscTAWqRLzuvSqHLpgLpkHQjGAjEH3XjksC4pa5EuGH6tAsGkTKJy6ZKbuhSrFukCyVgDgkkZjVqkSy7qUuxapAvqkhUgmBQZoRbpkum6pF2LdEFdSh0IJgXGqkW6ZLQuVefLtyayuQwBdSldIBjDJFKLdMlYXQrksrf8gGm5dEBdSg0IxiCGBt14ZKAuLewVe+SN0x9PVS4hGH5TAYIxhFW5dGFbl3y51OanHyTh3J26XEIgGeNAMIYwWIt0YVmXavNTp0iIY7bPgbpkFgjGACnUIl1Y1aXqfPlWIucu2+fogLpkDAgmQVKtRbowqUupD7oxQV0yAwSTEFZqkS6W6xJXuXRAXUocCCYBmAy68bBQl6zWIl0w/CYKBDMmmZJLl9TqEotapAskkxgQzJgwqkW6pFKX2NQiXVCXEgGCGQOGtUgXo3WJXS3SBXVpbCCYEWBdi3QxVJfYD7oxQV0aDwhGk0zUIl0Srkt5kUsH1KWRgWA0yOigG48E6lKmapEuGH5HAoKJSa7l0mXkupTJWqQLJKMNBBOTDNciXUaqS7X5qVOSMliLdEFd0gKCiUEOapEuWnWpOl++tSGduxpSkicNn4wDqEuxgWAU5KoW6RKzLvlyefMrJx7YlnLSI0FNKYMvyrloUJfiAcFEkMtapMuQuuTL5U2vnHhgU9Kk/+QSyMWXTPCVc8MQ6lIcIJgBFGTQjceAuhTWorlrJh643GzLhXzBEHn+NcmTwY+bBXAMhl81EMwACjToxuVw7/Bbm586dakp7v5hkyZ9h3iy9SVJtH5M7R+3fy73YPiNBILpo4CDblyC4bc6V771hYa463KjJY9mWyjhFam1w7R/HFyZKPd7TACG34FAMG0KPejGZV/ppLtv4p/3OK3XuYTXoGb7itSVTO/PSaqTJFkAyWD43Q0Ew33QlfIcSfqh7WN0EKI0XRJ07ZSg6VJ3e2nKwT8Or08NMrTJSHmGJL1s4HceDQy/Oyi8YFgPuh494T65tVB7YfMdrCQTeIbo1WVBVzm9VyTqXJFCsfQ+yXhJD7+e95D/96dyfusAefKxBH/n8cDw26HQgmErF0kNkvTX7urmLSsb3g8Wz3q1tmS+b/toO2hLZtrpXpEaPSJpDrhGdV4nMy6+XFa3372y4W0uX2w+765uvhOS4UehBcO4Fn1aPHL5pC+X8Bu+ZEhe/imOknlVufUymaAedSpSWJbCr9aL8MLSNJZjpNyorDVO+HIJv7WyIS9X1rZ/mdl1qfB1qbCCYVuLJD3hrm7+0aCfEo/Sc7UXNm/neV3qyqWzv7SlE16RZG9pGnX4lXKjdql5YvliY6P/p/wnmdql+vtI0nYy/58lQMHrUuEEw7oWteRyy8p698mln57rEivJTJcEvbr9Hur+/WX3lUnuKE+x8byHKufrBxbPbT8U9W9ZPFd/sHap/h5OkilyXSqUYHjXouFyCeEsmaAuObuLUvDU4u0chMM9piljvFamvbkMenLpp0cynK5LhaxLhREM20GX9OQSwlUyomf47X89TCAdr/d77fctBT+nMEzPoBv3HL5kUJfsUwjBsJVLby3SkEtIFuqS13Nl8vo2mt5X+4ZXqV2eGUEuIahL9imEYNjXohHkEsK9Lgnqjr2dL0kkRfu9SiRIStGqTO2f7zCgFumCumSX3Asmi7VIF8516VVhXZJ9713yZPt7srPFeO23GQR1SVGLdEFdskduBZP1WqQL102mty41aWdR8ga9GC/4w6q8h4fVIl1Ql+yQS8HkpRbpwlkynbrUn629ndenspQPL65u35bEk0s/qEvpkzvBsB10yaxcQrhKplOXwjdI0u43RV5F8uFjZ7dvG2dzGQbqUrrkSjBs5TJmLdIlC3UpyNVtuUgieoUjHz5uWC4hqEvpkSvB5LkW6cK9LjmiNeb6X1eX6MU/fqpxRxpyCUFdSofcCKYItUgX7nVJENHMBL14Zr15h4nNZRioS+bJvGCKVot04brJTJcEvWZSPvwXF+r7k6xFuqAumSXTgilqLdKFq2TEhvw2XWy8aPscqEvmyKxg2A66xEMuCzNiz9LB8q8uzFCZuEpmX+nOcT9wPylQl8yQScGwlUvKtSgKXy61+ekHK4fK/1ibn7pvgGQ4Db8jf+B+0qAuJU8mBYNapKY2N/VRctofRO+UfrE2V74z/DmmdWmkD9w3AepSsmROMKhFaqpHyu8kx/nQjm865eXqEefnw3/JtC5pfeC+SVCXkiMzgkEtGo4vF3e2/AUSNLnjJwRd7c5O/2uvZJhuMrE+cD8NUJeSIROCQS0aTqRcQjImGQ7XJdSl8WEvGLaDLvGQy8KM2COPTf+pUi4hbcnIY+UPMa9Luz5w3xaoS+PBWjBs5cKsFlHJ+YOhcgkRdDWVyn+JuhQf1KXRYS0Y1CI1O2qRLqhLWqAujQZbwaAWqRlYi3RBXdICdUkfdoJBLRrO0EE3LhkbfjlIBnVJD1aCYV2LvJzJJSRjkuFwXUJdig8bwbAddKkjl7fbHnRj1yJdUJe0QV2KBxvBsB10JW1U1urvXdnwrP6vVTDo6tQiXcK6tGv4rX/MyH/e6BzmMvwuX2w+j+FXDQvBsB10PXqicr5+/fLF+jM2j5HIoBuXvuHXXa1/grz63ayeZDD8qmE0/FoVDOtBt30t4iAXI9eiKPo2mZUNqotH63/O8bqE4TcaLsOvNcFkYNB9u+1rUepyCcHwqw2G38FYEUwmBl2LcjE66MYlQ5LB8KvA8vCbumDYykVSg5rBy/+ty0X75f+mUNclTq/4xdsKVFiUTOqCYVuLPPq0eOzySdvXorFe/m+CyLqEtxVEgbcVdElVMGxrkaTH3bObH7F9jFRrkQ5SbtTWxX/2fgtvK1CDutQiFcGwrkW+XJ7cvMX2k4u1QXcYnvdQ1AfRc91kUJeiSbsuGRcM61oEuajxvIfc1e13qz4UjbNkOFyXil6XjAqG7aBLPOTCohZF0ZZLnI9z5SoZ1CUFKQ2/xgTDWC518uhTHOTCphb1oyGXENQlNUWtS8YEw7oWPXr5g7avRexqUYiUG5W1xolRPogedUlNEeuSEcGwrkV5+cOiTCDlRu1S88Q4H0SPuqSmaHUpUcGgFg2H86AbVYt04brJoC5FY6ouJSYY1KLhcJbLsFqkC2fJcLguFaUuJSIYxoMuC7nkpRbpwlUyqEsKEh5+xxYMY7mgFg3DoFxCUJfU5L0ujS0Y1CI1eaxFuqAuqclzXRpLMKhFavJci3RBXVKT17o0kmBQi4bDedBNqhbpwnWTQV2KZty6pC0Y1KLhcJZL0rVIF86S4XBdyltd0hIM40GXhVyKWot04SoZ1CUFIw6/sQXDWC6oRcNgJJcQ1CU1ealLsQWDWqQGtUgf1CU1eahLsQSDWqQGtWh0UJfUZL0uKQXDuxZ51jcXYj7o2qpFunDdZFCXoolblyIFw7sW+XLZglyiYFCLdOEsGQ7XpazWpYGCYTzo9shFohYNguGgGxeukkFdUjBk+N0lGMZyqZPX/BQHuaAWmQN1SU3W6tIuwfCtRc1Pi0e3PmhTLoRalAqoS2qyVJd2CIZvLfIed1e3UYuiyEAt0gV1SU1W6lIgGP61yO61iJgPupW1+v4s1CJduG4yqEvR9Nclx81ELYJcBiKDzeW25QuNF20fxRQdyZC8bPssHVqS+YTtYxDzuuTudV7nuHudAyQm3mL7TIOorcvHbcvFx51x7mAnl+Dvj1db2fC2bJ/DPKWriUTJ9ik6SClrJL9l+xgdhPgRIsnrv5/C+x4RvViin1645H5n5XvklG6zfaZ+9l/l+OL7ysq6d8HqQRrNL7mvKv8mEV1t9Rx97J8WNxLRgyvr3jO2z2KKpQOl2fdfO/kVIuL0dH3/gSe2/tD2IXyWDk5c+/7XlB8jIaZsn6WL/GFlrbF48Q1vfS7YYNyz9c9Ss/7rJOkF20frp3Kw/PcL/lOWRZa/S1dqz26+l4jRYygF/8tFlYMT9y4dnJizfRQTLMyIqyqHJu8nolfYPksHKb/prm7dafsYPgt7nWsqB8ufJyJGcvHOVNbqNyw/1fgOhSPvygZ54rH6PbVLmzexk4yg19fmp6u2JbP4Te/x2rObt/CTjPPjlYPl1er85F22j5Ik/pNL7ej0gyTEcdtn6dCSy7GVde9520fx5VKbn3qIhPgZ22fp4p1xn9y+OZQL9WfqxXPeWc6SWTpYtvr6E76SEeTuLf1VXiRTnSu/o3Ld1AXIZTALMwzlIr0z7te3b15Z93YEh10vtOMsmcqh8qPV+allm8fokcyzNs+xi5xIxpdLUOy4XIuklCTlfVzksnRg4traUYZyeXL75pUNb1fNHPheJLaSISJ3X+kUB8lU/uvyQWo2v2DzHLvIuGR65MJjU5BS1tabHxCPXDnBQS7Vuck7KtdNns+KXEj1bmpfMuTVP2z0cCPiS8b2dWn5u3Sl8u2tX+P6JJO14XfpQGnWnS3fy0YuLe5fXN3+jO1DUPvJxZ2duIfX35+gFt0eJRca9ufBoC6pQV1KBtQiNQszzjWVQ8xqkfTOVM7Xb1i+0B10B6EUDOrScPgOv9moS6hFaoJBl+nmMkwuFPePzGS7yaAuqWG+yaAWqeEsF9W1qJfYf+g3Z8mgLilgKhnUIjVZq0VRaH0uElvJoC6pYSYZ1CI1QS06VM5ULYpC+5MdUZfUoC6pQS1SE9SifaV7GL63SFmLohjps6lRl9SgLg0GtUhNUIsOlj/PSi4xa1EUIwkGdWk4fIdfO3UJtUhN5+X/Dr9r0ahyoVEFE8J2k0FdUpPyJoNapIazXEa5FvUylmCIuWRQlxSkJBnUIjVBLcqpXCgJwRBnyaAuqTEsGdQiNZ1alFO5UFKCIdSloRStLqEWqclbLYoiMcEQ6tJQilKXUIvU5LEWRZGoYFCXhsN3+E2mLqEWqeE86CYtF0paMCFsNxnUJTVjbjKoRWo4yyXJa1EvRgRDzCWDuqRgRMmgFqnJey2KwphgiLNkUJfUaEoGtUhNEWpRFEYFQ6hLQ8l6XUItUlOUWhSFccEQ6tJQslqXUIvUFKkWRZGKYFCXhsN3+B1cl5b2k1M7OvUvGHQHw3nQTUsulJZgQthuMqhLagZsMssXyau94H2OpGzaPVwbyEVNSptLP6kKhphLBnVJwQDJLJ7d/mztheZvWJUMatFwLMmFbAiGOEsGdUkNN8nwq0UnGNai07bkQrYEQ6hLQ+Fel+SN078dfsuXDEl5j4XTcKpFr3X3lf6B1aCbYi2KwppgCHVpKJzrEpH4294nGXd1+/fI855M7QyoRWqkd7pyvn798oXG/9g8hlXBZKEu2X6Sycrwu7Lhbbir2zeR5/2d8esSv0H3YXLEm22fpUPrWvQ223Ih24IJYbvJYPhVM0Ay4tHN3zK2yfAbdF/LVS42r0W9sBAMcZYMhl81aQ2/PAfd/4Zc1LARDGH4HQr34bf3Fb8Ghl8MukrsD7qDYCUYwvA7FM7Db//bChIbfjHoqmEy6A6CnWCyMPzalgzf4Xfn2wp6ht/RJYNBVw2jQXcQ7AQTwnaTQV1Sk2RdglzUMNxc+mErGGIuGdQlBePWJdSi4WRALsRdMMRZMqhLakatS6hFw8mIXCgLgiHUpaHkrC6hFqmQ8mWOtSiKTAiGUJeGkou6hFqkxvNOV9aCPyyK5aA7iMwIBnVpOHyH3xh1CYOuGs877a7yrUVRZEYwIWw3GdQlNeq69O+Qi4K2XLJyLeolc4Ih5pJBXVIQUZfcM1fexEEuLGtRhuVCWRUMcZYM6pKaAXVp5SVq2D0U01qUcblQlgVDqEtDyVJdsgnbWvRUdmpRFJkWDKEuDeWRl51XPrvlvdSUNk8xgIQ/cH9UUIvMknnBoC5Fc/eBicMPvHGqui3FG57blsRPMsl84P6ocB508yAXyoNgQthuMpbq0hcPT5788OvK5wTRT5SIqCGJnt3iKJnxPnB/VDjLJevXol5yIxhiLpk069KXjkye/NmZ0icdQeR/lfwvImoS0XNbkra9NE6hQcqSQS1Kj1wJhjhLJqW69OW5yZNvacvFl0pJ7PxqENEzW5Jest5t+khJMqhF6ZI7wVCB69KpgxOH3zoz8UnHEeSI1pcvFf8fstP+a6n9VLPe4PskY2r4RS1Kn1wKhgpYl4IPoj9Q/pwjJDlSkkOSBMngH7AIJRPc1lqCEZLo+yyHXzN1CbXIDrkVTJHq0tKB0mzt6PSDwhHXl9pPLa0vEfwDnui/KrX/tf8AU4S6xHLQlfK0ezY/tSiK3AomhO0mk1Bdqs6V31G5buoCCXGcKBx1RUciwdXI6V6PStQdfv3vNTyiZ1lKJplNhq1cVrfetrKez2tRL7kXDDGXzDh1yZeLO1v+AhG9ovf7vVvLLtn0jb4lx39Sb0mG6yYzqmSW9jOsRQWSCxVFMMRZMiPWpR657N4UgqcTQRPCvx7J1lWpczUSnT3G6Xmi8Z9gntmW9FKD2aPMiJKpHpk8UbmOWS0qmFyoSIKhHNWlpQOlWXe2fO9AuYSIcNAVweBbEmFZklRyxI5rUkc0RLReJ7ZPMnGHX//JxZ3lWIvqtxdJLlQ0wVAO6lJQiw5N3t9/LYoiKEjhU4toVSVHyl35WvT89Xmmm0ycuhTUokPMapGUpytP1W9Yfirfg+4gCieYLNelsBaFg25cOk8rncIkuk8uvWXJ6b4YL4t1ifOgW0S5UBEFE8J2k4moS/21SJdOrqbesVfskIwjuwk7a+9d4iyXol2LeimsYIi5ZHrrUlQt0vw9u1Wps7/InXXJ6e4xnfcuZaAuoRbxZcL2AWzjS6Z6ZPMmd3b6yyRon+3z9OLuK52SN06/gYTzbuWgq4HTHn9b/1cGr+gNB+Fmz48DZOtJ5pktSXvLRNdMiCSOkAxtycjj0/MkxHu4bS6QS4tCP8GEcK5LJJw7kpJL57eknlf6trcZQeHTjeg80ThO73uXeNYlcpxfYSaXQtaiKCCYNpzrkgn8J5fg/Uq+UGQrY4v2+5cEdd+71ClNMniD5P+y+7QCThS4FkUBwbRhXZdMEL4Yr/MqX9nzql+x40V4/l8nHXr6l/5ja4HlR6JwoOC1KAoIpg+2w68JOn+Eg+j5s2P8a1J3/G3L5avv+cbW4hMb3hrbj0SxCTaXSCCYARRWMuGTTLsiTQiir7/U/JPZ2pWfe3zDWwt/CduPRLEB5KIEgomA9fCbND2p2gmvR46gsqCv/sK57Y8M+iVsPxIlTTDoDgWCUVC04Td8oV1r3JVPv/1cIJBI2H7gfhpg0I0FBKOgkMOvCK5GT7/t7Nbiv613r0VRsP0sbJNg0I0NBBODQm0yUn5j8cmt+ZUYcgkplGSwuWgBwcQk95KRUpKU/+Subh1f2fC+r/vLC1GXIBdtIBgNcisZKWVtvfk74pEr71tZ954f9bfJdV2CXEYCgtEkp3XpvsXV7b9J4jfKZV1CLRoZCGYEclWXpPyGu7r1u0n+lrmqS6hFYwHBjEBu6lJLLsfHuRZFkYvhF7VobCCYMcj0JmNQLiGZlgw2l0SAYMYkc5LprUUG5RKSybrkQS5JAcEkQGYkk1At0iVTdakll5shl2SAYBIiI3Xp/qRqkS6ZqEtSvlxZq793ZcN7yfZR8gIEkyCs65KU33RXt+60eQTWdcmTpyvn69cvX2w8bfsoeQKCSRC2dakll2NpXouiYDn8tq9FkEvyQDAGYLXJMJJLCCvJhJsLrkVGgGAMYV0yrVp0Hze5hLCoS5CLcSAYg1iTTKsWfUA8cuUER7mEWK1LkEsqQDCGsVSX7l9c3f5Myv+ZI2GlLqEWpQYEkwKp1iUGtUiXVOsSalGqQDApkFpdYjjoxiWV4Re1KHUgmBQxuslkWC4hRiWDzcUKEEzKJC4Z5rVIFyN1CXKxBgRjgcQkk5FapEuidQlysQoEY4mE6lJmapEuidQl1CLrQDAWGasuZbAW6TJWXfLk11CL7APBWGTkupSDQTcuIw2/nvxa8CfRQS7WgWAYoLXJFEguIVqSacsF1yIeQDBMGCqZnNUiXWLVJciFHRAMIyIlk9NapIuyLkEuLIFgmBFRl3Jbi3QZWJek/EFlrX475MIPCIYhO+pSAWqRLjvqUqsW3YBBlyeiWq1SrVazfQ4wgMqB0htrG/L/agW+FqmovN55U+1F+lYNTy4scV2XhJTS9jkAADkFVyQAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDEgGACAMSAYAIAxIBgAgDH+PwAA//+w6+vkfP1ThwAAAABJRU5ErkJggg==",en="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAolBMVEX///8AS60AQaoAP6kASawARasAQ6rG1eqNqNUAQKrN2e1cg8UAR6zo8fmKpdMAPakAOaiZrdbi6PR5lcylt9uovN4AN6cATa7C0elxjcf0+Py7zObn7vfv9fu1x+QAULDZ4/FUfsMaWLNMeMApYrcnXrU8bbuctNsbWbODoNK2x+M5abpLecB2nNBagcMAMaVoish0kcoATblOe8g+ecEwbLwnnuoeAAARMElEQVR4nO1da3uquBaWEFAwNahFLSIgXtDadvDMmf//146yAgQCbm/Bznl4P8zsEoG85Laybul0WrRo0aJFixYtWrRo0aJFixYtWrRo0aJFixYtWrRo0QwC+z3BrLp4DqV2UFnqsps9p7K4C6Xv5pPqehc+/lIB1toVS4PQglI62VfcHFmUFZMKEs5qwp49+ar+Ak1gQJUU+lYodTZaVmxFQvHcwmkpoQuheImym2kspfZXYOFndTxVo1su9nL+CtkId29JXqz2yqWjv/JSZVLRQRrBSOcYqu/l4kHeCgr2hUryn0cXWmnGfZ6Kr9cQGEM/qQUS+uFeP1+fQrHIECo/Tf6r9culc1XJn63WTGTSYRpJ86wTnkjoaOOEoZ8UYzIqlTrJ58GbpCnJqnyzDW0Iz6af0jhcxjDphtp3MqDIV7l4nVwPj8l8o3qlUjOhQOJDQtQvT5dx8nkUeLY+lkfiImCuoF2cVFIr9cMg6Wdk7RmV/RBaGEXL5CFoXix1wuSZ0zk825fKoxbzpBWw2llVfui/Nbi6mCQ/M4prngtjmAbQEUhpsenB1XVnQ6oHeRNYTJM66v10zFiFGc+2YBqcdQ7Qi9eFjrhK+J8WkUAFqoVhHMBKigadfUIVk6ABRiW4By3lxdZFzIsmHoyjMy/2ARA/m8Swkhi9tK9jlWumIIRrxqgTQFuTTXmmkg4vBILJLNgDDlgbsHZ6+zZgtaP26S/oaYq+TgdbdwsEsXKSZboT+DeN04EcEXbDeZXss/dMhfVWGhzTnO3XBlQCq+d2c3bsL+R/fHa7XqwgIEgO5zvm0GEVgg69rtkdbhETZ0CW+2GSgU5+7K45H+/Y39g4y3KLCWbP3u3npvkmn+B4YlGaVlGhw+QirIzneuj0BD39C0GzjFMBhSCqnm5m0gyCBWYRsqdhTT0Vp4IStqDJvVR+PT/bmvRli+EflBO2FPrBLnsWfzklSFNZ5AeJpQo6sMoGUyKW4mzuGRReqQrr7nMRIO5t2MrFSZsKtSR6Lor80HKpom6zDYWpaEKxlU+ug8LNE7kinM29TGNdFDDzjUIzYrrhV8C9VfwCZHLkutvoQIs365SXgWxDy4sR/1YJDFVWhVMdVsUJ3Bkb2QjDBOmD4p3mIRthpwFHd6XtQqSo3M1GXNwwuj9qPnqbYIgJCY/ivtwdrImKTlDJYSjuaWexj87FquEv50KpE20VI7lZ3+wDoTgYbwhwbIKhv/6e18xowXw4GETzmuV5Ydq9Qe/dFNknGM2iwWDoBTXvnn+v/eZ6qX8YNCtkuMOt3+w4PA20uKYpJMAZ49MSjBthmM+lWBf2fLIwI9x6Kpmhya+HilWlJHw+osJSYomz1FNRXLoboVgkiES15XPh9CeUqtkCnOwd5GKWEjyJrSqdrOSP/tHcs+Mp661YCyS/zknlBET6tjeX/bocQ4Xt4ZaSX3SESYZo+6Z1+2wfrlC5hpMRDAjiv8A+M4L9gPZRuu4E5v0Iym9hinP9JQYoWBsxKlx0jr6O7oe+KymWQY2FSmJ8UzgwfSl3yUQIV+yFrwYmdMPrXaGTYqVpagyg1FS5BSPAFbv1G6GvuVeATlYvj4SmANoZxK36P/rl2l8FXnUaJR+RNiUelgG2J/2YX6CP9NAUvA6fdZNX2Z6C5PWcNt/OdWr3zDJpD1eD7Img86evYviZbKW4eS5iil602g9ux37NdhBqPne9J68Qra8NAcxH3CAZgtr0bmEVjBQ8wy7Y4ATzYjNg5goaZFeA4QMzH6w/HEM3Mf9g1LjVIgEzC3HzAjBU79/AwSM5hsxyJ1rBm4AHFhXeug0MH5gXegJDpjahcjf2lXhnKwNv+pXA0GGWO7Vhuc2ZrZgtRuV3+RIYnnb4MD8b28+mNF/uPl6GqfGpaNmVwbDDLLEKMcKvOO7Jdx4KDKSRTD1f3NVIYegqqSSAiaYjXfrqv+Zka1IiI4VhyfhGNMmddcFZmPRpiYschp1gx5sfpSu/sh5KrGV5TIBcagV3P7yaYWcRc7Y5Q/bCsbfwCQRN1hX2o1DDWH1AxKphePZtmCCCm7A9nbBXCPa3FQawE0Zbjfw8oBOrZXh69HCVmJ4aYNhZBG49idHl2dxbHfYXZooLDDtBFDdhXXsQkUWIeqj/PrUMF8M1RVpDvfQBgF8Jrd/t1TG0/cy/5XczHIFeqd6Xspqh88NrR9SXePFdifsYOlt+OcQPLEbycR/DVUbwvExZgi/yb8JdDDOXMY2SMFy9yiH6OtzD0JykItSx+7rIkmtxD0Mm6aPtq2IubsIdDFlUAnpZ2MxtuIMh+OyXXKh/L25nuEh89iWo9R27F30GF3+y8PbxTzy2bzFd3s4wMKAJb3jJVXB9ihC1/HFQ94vuklKka7quWv7+6jngdoaw4xTjcR7FCoxkWKfLoKo8WNHc4RMj/ftKxcLtDJll5tlOQm95WJmuVXy+iBRdejEKr6vC7QwlWdcKcYWq4KITi1ZCQq9S2P6aNswFpURYQoXJZBTyYmL2T7q9oqfezhCiNNHznctipNLMYIkpt1+xtfQyUbUpUTNPPj38cxjkHXNp8nyye4hNdV263mCdOZSpK/bOoJ9doytv5I66+1BlV4gx/tOkejtDZwfroSRD/qefdkiCDgPbi5bZFKPj9J1OL41DwEhZDu3ZBenjDpnmCDJNKEsNnDcZOTuhZ5oEyk8/QT4yT7+iSn1vvYOhCRpobStLbIvUynCW4sh3+ipXSnDt975nb7FiHoLl8IWnoRuiMkFdEUZFT+c+RL33yz0Mg3R/SJd24F7QY96NgkYdppgKo7q5o9cwTNqac8Apo2qP37PSznGavKcbGZq22c7S2cqHCVVqDCNDnYI3PdHrIuhGLIivXsys1NP0s4+Hz00pJep5FofaOX8FUr4uTNv2l6KffoTrBJC3bNKldRSrtYlFIeovSY6Ywcyz53XBLikWwcz2amMgV5nTGybxR4Yj1ylqNMJ7fr57TdTzNeAD+/Bp35WB5q4kdTrv7oH+C3TeUVWUZQIr6/r1lhlvZam/3W7xXcsQZZPHJduT00xk1wPo1TLMc7fUM3Rmx50//d1tOFdrCGpKJrHXMrTXNF2xfi9Dh9tXEyvDxDrk038Nw9GWPt2Of5r1u38IfTeH++N+OL9eFW1naYO0f9xFDu4n1Qy7Ba3JU3wxFjtLpXSyG9RWP4iRhZB+1shthtfKintoCYx2dc+tZDgvRMJr4TNEUxY+Twx6rKyLG+dRyydxEfeufOlpNKmIkrj251UM83WUnL/oJriBSB1yTRRGVekoPL84LWK6vlKScrpRz77gDVvFkAmziqYexoNeTW63G8Hr2jAVvvi4QtdmPEeUqmDIsooo1k/wlFcAYpXjgPzCR3f/yQv5D/EUL16R4QLWCIye6+vlrFQVZSONGNzTZ9m8RgxDQ2r2K7QOHn+xyDCCBADG01VRphcdw6w30n4Al91xrms7REEQeMdprq3qPawuEhlCfp4Lm+ZH4Lwr6X5HJ8to1v3k6OjpwHO/s+wqKPywZw/t3gSGrgJZtmSp2hbbgq6tpkt2tSwfja4a6JHpXGAI8Rbaz/2P/BP2lZFMpVSNi5XBb/38+z+4wBCGoVSXUm8qhKPlPTTDmN+EPxAwX2N7khv3NFqVmpEeAvFXcz/fwT8QS/cShme3OZqnjlH1ajF08Z1mp8HG/X4hr+ilCbyVbqgInRbJdVQrNS2G69MvDPWR6ggMIclnE0FBjmlHQ3v2h9ZxZ/YweiQIS1wtsNzVonHUrfjoVckvnw6RIZi5MfrdDnvXQ2T4xrL5af8nFCt2TwOmwLL6r4myfDKqdsBpzkGdbvfDqC4F178FVQzNTCQ8R4jTZ2zSXohKTdRnQajSd//qVqzWJs4Rb6O1XpVg4Smo0QgHh+drhF+EWq1+tKHar9fqX4MLlpnPuDHLjLvvx715jaA4jz8eUWNcsq51PhuyrgUW0nREJ9uqAX+c6PrkgSQW9QznX5OmLKRpHDCha2FfalpKRXL2G1DH0Nw2Z+Xm4oBFxw8wZFvPjgPu9Br1VCCc0qkcECsp0rmYnXkiO+1Xz+IcZ1GRohyGH7nHEMakgSNZBj7WssSJxY4qheEw8/oydIzDJvJjLEbB+w8TpHCBjgyGo8xzbxUFo1FzQqnJUh5BXnkGGQzhEAVFDxvPFeWwwEfej14Cw9SD9kJ4tDzAkQd8DqeHGQ7qvKAfsBQ8ADgpBtP86wLDBxasWCsxdDZSPdn/BHBQ5poMGOK7vSVMWGwbiUa4CiDCcE3Gsplp67n7djvcdx8m6CYiSq4DhM5xbtuRmq1cdwClxh3u0J1IUlTQlRglVdJyC3Q3XZzP0sftSO9F+bTy6ryJ5TZMT2N5DBp3RoesyK4rYcPUyTltv4sHddwOPmkCi7B8leICopALh6J9WJdr/2eQwg7ahIO/DuVXNwMYhgotbHh7J6n8Aei0GKzJIp1fdDzgUqv6vm/vx/79OH6W1tK+/rpG3MOYk2yBfl3GgUUMrxbP9Xsy0qwRq2azRgSD1F1KuhMBO7RM0fRxQ1nLzZ9dqFip+IEkeisxHNNjUXRK/HAlfWm0LZ3TRWkb+bsaLsXQSe7RLMlr41shh6Emnp8qAYtDMYuSXFswf8avQg8NnGTXOasTeF92KldfamdhIRiR5jI2vSuNZTNjDAmi4XeT0/disElPFWyC4XT306vN2fQ2ci/0XccduRcmp4U7eqt5sGMO+5umzuya+oefYVBR6r731/506q9ju4qGOVjtfGUabvdVYqbjxQd/qvibr2FV7xi997fhtKlees7uSbdCdFJsGEkCXkx0VRuXW/JznfQzfPY3pruyoODssXpeh06PJoaxDErF5pdhNHSyXD6XEuunuKug/EHkGBVVbqNVISSclLxGPFw4OlKz+NMRO85xkufDkcxwzq8Wus8ldNqW/aUx5TKZzvXyKZXE4PaBR+GQT8QdjxtsGsyyW9RTkEwr5mwqzu5AWaoHTy0zUPg863GFakALg5Sgz78T65LFqEA97XDzXMLpWctp0u3z4Y8kK06Nb92sC2KuFKetMVb5m7PPx7J9LHKChGhI9rFr51wm/eXKL2UsT6Vjgsh2uTyQlBEE3md11FC4Wq52aTgOtpKBbKeaD6Stl8tttrizw7K2evrs6XbZvz7t1mNYzLfpoc1ne16XdUJ9FyUVGPX8NJdW0MmO3VLUJaR2MfvsC2jnNl6wSYRgyE38Zq9ZRvvE+4nxx8bBa9h2MWQzC3Gz/CNqfuajyyxT54OnA4t5uOfGhzkT4M9qQnZsh37IphaHZXEi4etODjiDfVy1x0w0JU0D2P2wPmLmo6ItNYDRqC07DnAtms/YCcDUy05/eEnW0jE4KIfsNBayKRb/B9bnXgf6s1qsY3oorevBP5Tinuhv0HKt0hM8ZJ9fV430FJYRGBLLqnfgQFbsqJhNSd5kB3550MLlY8fg0HgcBv4rT2FhbWfY8L3LuQ0dOCJmB4p5IWMLfAB9nzjjY61MAS7jKG3L1+AT0jb+N2lKMXPQz7l22P8vRBCW1UguNO0/u+R/gj4UvosCz35ZOhM40QrvlOpawCQ5Ba31VFjHYI4Mk0zyYvgdEw+ZyvtVtic4lSw9pldkyNbE5D+iRkfhbhbDfpgmGIpfZl1z+YMAxYi1IZcIA4uuBryEK3ZxkzfxvC6F9zbfMGAsNFLAidtIjM3ac+L2X2IjcTpL4gulTSHIJExS5VU6mLBqYqSI4qSzZh6Vp5srrBLzdEuI9RdZnhK4fTgOfLqtHCneP9AI4bFKpHT2MI8o60qfW/MrcXpW/GXwxBq3aNGiRYsWLVq0aNGiRYsWLVq0aNGiRYsWLVq0aNGiFv8DHCEhts8im6YAAAAASUVORK5CYII=";var tn=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"1em"},img_badge:{width:e.spacing(10),height:e.spacing(10)},img_org:{width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},img_security:{marginRight:"1em",width:e.spacing(5),height:e.spacing(5)},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},textVerify:{fontWeight:"bold"},textParagraph:{textAlign:"justify",color:"#5c5c5c",margin:"1em 0 1em 0"},textCode:{color:"#808080",textAlign:"left"},button:{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".5em 3em","&:hover":{backgroundColor:E.a.secondary}},header:{display:"flex",justifyContent:"space-between",alignItems:"center"},divider:{backgroundColor:"#5c5c5c"},link:{color:E.a.primary,underline:"none"},linkVerify:{color:E.a.primary,marginLeft:20,"& svg":{width:18}},grid:{backgroundColor:E.a.tertiary,borderRadius:"10px",padding:"1em",marginBottom:"1em"},card:{borderRadius:"10px",padding:".5em",backgroundColor:"white",paddingBottom:0},cardBig:{borderRadius:"10px",padding:".5em",backgroundColor:"white",height:"100%"},cardHeader:{padding:".5em"},grid_dates:{padding:".3em 0 .3em 0"},text_dates:{color:"#5c5c5c",marginLeft:".5em"},circularProgress:{color:E.a.primary},container__bitcoin:{marginTop:15},container_file_blockchain:{display:"flex",alignItems:"center"},img_file_blockchain:{marginRight:10},logo_fontawesome_blockchain:{display:"flex",width:40,alignItems:"center",justifyContent:"center",marginRight:10},transaction:{display:"flex",marginBottom:5,"& p:first-child":{marginBottom:0,marginRight:5,minWidth:90,width:90},"& span":{marginRight:5,fontSize:"0.9em"}},textCodeTransaction:{wordBreak:"break-word",margin:0},closeButton:{margin:".5em .5em 0 0",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}}}})),an=function(e){var t,a,c,o,s,l,m,b,p,j,x,O,v,_,y,w,C,k,N,B,T,A,I,z,P,R,M,L,F,U,W,Y,q,H,K,V,G,Q,J,X,Z,$,ee,te,ae,ne,ie,re,ce,oe,se,le,de,ue,me,be,pe,je,fe,he,ge,xe,Oe,ke,Be,Se,Te,Ae,Ee,De,ze,Pe,Re,Me,Le=tn(),Fe=Object(u.g)(),Ue=Object(i.useState)({}),We=Object(d.a)(Ue,2),Ye=We[0],qe=We[1],He=Object(i.useState)(null===(t=e.match.params)||void 0===t?void 0:t.verificationType),Ke=Object(d.a)(He,1)[0],Ve=Object(i.useState)(!1),Ge=Object(d.a)(Ve,2),Qe=Ge[0],Je=Ge[1],Xe=Object(i.useState)(""),Ze=Object(d.a)(Xe,2),$e=Ze[0],et=Ze[1],tt=Object(i.useState)(!1),at=Object(d.a)(tt,2),nt=at[0],it=at[1],rt=r.a.useState(!0),ct=Object(d.a)(rt,2),ot=ct[0],st=ct[1],lt=Object(i.useState)({}),dt=Object(d.a)(lt,2),ut=dt[0],mt=dt[1],bt=null===(a=JSON.parse(window.localStorage.state))||void 0===a?void 0:a.styles,pt=Object(D.a)(["verify"]),jt=Object(d.a)(pt,1)[0];Object(i.useEffect)((function(){var t=Ke&&Ke.length>0;Je(!t),ft().catch((function(){e.history.push("/500"),window.location.reload()}))}),[]);var ft=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u,m,b,p,j,h;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return it(!0),p=Object(Ie.a)(e.match.params.issuedBadgeId),t.next=4,Ce.a.get("/badges/verifyBadge/".concat(p));case 4:j=t.sent,h=j.data,qe(h.badge),mt(null!==(null===(a=h.badge.badge)||void 0===a||null===(n=a.insigniasEmitidas)||void 0===n||null===(i=n.plantillasInsignias)||void 0===i?void 0:i.id_organizacion_hija)?null===(r=h.badge.badge)||void 0===r||null===(c=r.insigniasEmitidas)||void 0===c||null===(o=c.plantillasInsignias)||void 0===o?void 0:o.organizacionesHijas:null===(s=h.badge.badge)||void 0===s||null===(l=s.insigniasEmitidas)||void 0===l||null===(d=l.plantillasInsignias)||void 0===d?void 0:d.organizaciones),it(!1),setTimeout((function(){st(!1)}),2e3),0===(null===(u=h.badge.insigniasEmitidas)||void 0===u?void 0:u.estado)?et("Revoked"):null!==(null===(m=h.badge.insigniasEmitidas)||void 0===m?void 0:m.fecha_expiracion)&&Object(Vt.a)(new Date(null===(b=h.badge.insigniasEmitidas)||void 0===b?void 0:b.fecha_expiracion),new Date)?et("Expired"):et("Verified");case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ht=function(){return Object(n.jsx)(qa.a,{sx:{color:E.a.primary}})},gt=function(){return Object(n.jsx)(Ha.a,{sx:{color:"#fced47"}})};return Object(n.jsxs)(n.Fragment,{children:[Qe?Object(n.jsx)(At,{}):Object(n.jsx)(S.a,{className:Le.closeButton,onClick:function(){return Fe.push("/verify/".concat(Ke))},children:Object(n.jsx)(Xa.a,{})}),Object(n.jsx)(Rt.a,{maxWidth:"lg",className:Le.container,children:Object(n.jsxs)(ye.a,{container:!0,spacing:0,className:Le.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,className:"text-center ".concat(Le.grid),children:!1===ot?Object(n.jsxs)(n.Fragment,{children:["Verified"===$e?ht():"Revoked"===$e?Object(n.jsx)(Ka.a,{sx:{color:"#d33"}}):gt(),Object(n.jsx)(we.a,{variant:"h6",className:Le.textVerify,children:jt("Verified"===$e?"verify:verify-success":"Revoked"===$e?"verify:message-badge.badge-revoked":"verify:message-badge.badge-expired")}),Object(n.jsx)(we.a,{className:Le.text,children:"Verified"===$e?"".concat(jt("verify:message-badge.badge-issued")," ").concat(bt.organizationName," ").concat(jt("verify:information")):"Revoked"===$e?"".concat(jt("verify:message-badge.badge-issued")," ").concat(bt.organizationName," ").concat(jt("verify:message-badge.badge-information-revoked")):"".concat(jt("verify:message-badge.badge-issued")," ").concat(bt.organizationName," ").concat(jt("verify:message-badge.badge-information-expired"))})]}):Object(n.jsx)(Wa.a,{in:ot,style:{transitionDelay:ot?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:50,className:Le.circularProgress})})}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ye.a,{container:!0,direction:"column",spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:Le.card,children:[Object(n.jsx)(Ya.a,{className:Le.cardHeader,avatar:!1===ot?ht():Object(n.jsx)(Wa.a,{in:ot,style:{transitionDelay:ot?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:Le.circularProgress})}),title:Object(n.jsx)(we.a,{className:Le.text,children:jt("verify:message-badge.badge-name")})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(g.a,{variant:"rounded","aria-label":"img_badge",className:Le.img_badge,src:Ye.photoBadge})}),Object(n.jsx)(ye.a,{item:!0,xs:8,sm:10,children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(we.a,{className:Le.textTitle,children:null===(c=Ye.badge)||void 0===c||null===(o=c.insigniasEmitidas)||void 0===o||null===(s=o.plantillasInsignias)||void 0===s?void 0:s.nombre}),!1===ot?ht():Object(n.jsx)(Wa.a,{in:ot,style:{transitionDelay:ot?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:Le.circularProgress})})]})})]})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:Le.card,children:[Object(n.jsx)(Ya.a,{className:Le.cardHeader,avatar:!1===ot?ht():Object(n.jsx)(Wa.a,{in:ot,style:{transitionDelay:ot?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:Le.circularProgress})}),title:Object(n.jsx)(we.a,{className:Le.text,children:jt("verify:message-badge.badge-headline")})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(g.a,{"aria-label":"img_badge",className:Le.img_badge,src:Ye.photoUser})}),Object(n.jsxs)(ye.a,{item:!0,xs:8,sm:10,children:[Object(n.jsx)(we.a,{className:Le.textTitle,children:"".concat(null===(l=Ye.badge)||void 0===l||null===(m=l.insigniasEmitidas)||void 0===m?void 0:m.primer_nombre_receptor," ").concat((null===(b=Ye.badge)||void 0===b||null===(p=b.insigniasEmitidas)||void 0===p?void 0:p.segundo_nombre_receptor)||""," ").concat(null===(j=Ye.badge)||void 0===j||null===(x=j.insigniasEmitidas)||void 0===x?void 0:x.primer_apellido_receptor," ").concat((null===(O=Ye.badge)||void 0===O||null===(v=O.insigniasEmitidas)||void 0===v?void 0:v.segundo_apellido_receptor)||"")}),Object(n.jsxs)(Mt.a,{href:"/dashboard/".concat(null===(_=Ye.badge)||void 0===_||null===(y=_.cuentas)||void 0===y||null===(w=y.usuarios)||void 0===w?void 0:w.url_perfil),target:"_blank",rel:"noreferrer",className:Le.link,children:[jt("verify:credentials")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})]})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:Le.cardBig,children:[Object(n.jsx)(Ya.a,{className:Le.cardHeader,avatar:!1===ot?ht():Object(n.jsx)(Wa.a,{in:ot,style:{transitionDelay:ot?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:Le.circularProgress})}),title:Object(n.jsxs)(we.a,{className:Le.text,children:[jt("verify:issued-verified")," ",bt.organizationName,"."]})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(g.a,{variant:"square","aria-label":"img_organization",className:Le.img_org,src:Ye.photoOrganization})}),Object(n.jsxs)(ye.a,{item:!0,xs:8,sm:10,children:[Object(n.jsx)(we.a,{className:Le.textTitle,children:null===ut||void 0===ut?void 0:ut.nombre}),Object(n.jsxs)(Mt.a,{href:"/organization/".concat(null===ut||void 0===ut?void 0:ut.url_perfil),target:"_blank",rel:"noreferrer",className:Le.link,children:[jt("verify:more-information")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})}),Object(n.jsxs)(_e.a,{children:[Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:Le.grid_dates,children:[Object(n.jsx)(we.a,{className:Le.textTitle,children:jt("verify:issued")}),Object(n.jsx)(we.a,{className:Le.text_dates,children:Ne()(null===(C=Ye.badge)||void 0===C||null===(k=C.insigniasEmitidas)||void 0===k?void 0:k.fecha_emision).format("DD-MM-YYYY")}),!1===ot?ht():Object(n.jsx)(Wa.a,{in:ot,style:{transitionDelay:ot?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:Le.circularProgress})})]}),null!==(null===(N=Ye.badge)||void 0===N||null===(B=N.insigniasEmitidas)||void 0===B?void 0:B.fecha_expiracion)&&"0000-00-00"!==(null===(T=Ye.badge)||void 0===T||null===(A=T.insigniasEmitidas)||void 0===A?void 0:A.fecha_expiracion)&&Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:Le.grid_dates,children:[Object(n.jsx)(we.a,{className:Le.textTitle,children:jt("verify:expired")}),Object(n.jsx)(we.a,{className:Le.text_dates,children:Ne()(null===(I=Ye.badge)||void 0===I||null===(z=I.insigniasEmitidas)||void 0===z?void 0:z.fecha_expiracion).format("DD-MM-YYYY")}),!1===ot?Object(n.jsx)(n.Fragment,{children:"Expired"===$e?gt():ht()}):Object(n.jsx)(Wa.a,{in:ot,style:{transitionDelay:ot?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:Le.circularProgress})})]})]})]})})]}),(null===(P=Ye.badge)||void 0===P||null===(R=P.insigniasEmitidas)||void 0===R?void 0:R.blockchain)&&Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:Le.container__bitcoin,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:Le.cardBig,children:[Object(n.jsx)(Ya.a,{className:Le.cardHeader,avatar:!1===ot?ht():Object(n.jsx)(Wa.a,{in:ot,style:{transitionDelay:ot?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:Le.circularProgress})}),title:Object(n.jsx)(we.a,{className:Le.text,children:jt("verify:blockchain.information-blockchain")})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,children:Object(n.jsxs)(ye.a,{item:!0,xs:12,children:["CONFIRMED"!==(null===(M=Ye.badge)||void 0===M||null===(L=M.insigniasEmitidas)||void 0===L||null===(F=L.blockchain)||void 0===F?void 0:F.estado_anchor)&&Object(n.jsxs)("div",{className:Le.transaction,children:[Object(n.jsxs)("p",{className:Le.textTitle,children:[jt("verify:blockchain.state-register"),":"]}),Object(n.jsx)("p",{className:Le.textCodeTransaction,children:jt("verify:blockchain.state-wait")})]}),(null===(U=Ye.badge)||void 0===U||null===(W=U.insigniasEmitidas)||void 0===W||null===(Y=W.blockchain)||void 0===Y?void 0:Y.hash_archivo_metadata)&&Object(n.jsxs)("div",{className:Le.transaction,children:[Object(n.jsxs)("p",{className:Le.textTitle,children:[jt("verify:blockchain.hash"),":"]}),Object(n.jsx)("p",{className:Le.textCodeTransaction,children:null===(q=Ye.badge)||void 0===q||null===(H=q.insigniasEmitidas)||void 0===H||null===(K=H.blockchain)||void 0===K?void 0:K.hash_archivo_metadata})]}),"CONFIRMED"===(null===(V=Ye.badge)||void 0===V||null===(G=V.insigniasEmitidas)||void 0===G||null===(Q=G.blockchain)||void 0===Q?void 0:Q.estado_anchor)&&Object(n.jsxs)(n.Fragment,{children:[(null===(J=Ye.badge)||void 0===J||null===(X=J.insigniasEmitidas)||void 0===X||null===(Z=X.blockchain)||void 0===Z?void 0:Z.codigo_transaccion)&&Object(n.jsxs)("div",{className:Le.transaction,children:[Object(n.jsx)("p",{className:Le.textTitle,children:"txid:"}),Object(n.jsx)("p",{className:Le.textCodeTransaction,children:null===($=Ye.badge)||void 0===$||null===(ee=$.insigniasEmitidas)||void 0===ee||null===(te=ee.blockchain)||void 0===te?void 0:te.codigo_transaccion})]}),(null===(ae=Ye.badge)||void 0===ae||null===(ne=ae.insigniasEmitidas)||void 0===ne||null===(ie=ne.blockchain)||void 0===ie?void 0:ie.altura_block)&&Object(n.jsxs)("div",{className:Le.transaction,children:[Object(n.jsxs)("p",{className:Le.textTitle,children:[jt("verify:blockchain.block"),":"]}),Object(n.jsx)("p",{className:Le.textCodeTransaction,children:null===(re=Ye.badge)||void 0===re||null===(ce=re.insigniasEmitidas)||void 0===ce||null===(oe=ce.blockchain)||void 0===oe?void 0:oe.altura_block})]}),(null===(se=Ye.badge)||void 0===se||null===(le=se.insigniasEmitidas)||void 0===le||null===(de=le.blockchain)||void 0===de?void 0:de.merkle_root)&&Object(n.jsxs)("div",{className:Le.transaction,children:[Object(n.jsx)("p",{className:Le.textTitle,children:"Merkle root:"}),Object(n.jsx)("p",{className:Le.textCodeTransaction,children:null===(ue=Ye.badge)||void 0===ue||null===(me=ue.insigniasEmitidas)||void 0===me||null===(be=me.blockchain)||void 0===be?void 0:be.merkle_root})]}),Object(n.jsxs)("div",{className:Le.transaction,children:[Object(n.jsxs)("p",{className:Le.textTitle,children:[jt("verify:blockchain.type-register"),":"]}),Object(n.jsx)("p",{className:Le.textCodeTransaction,children:Object(n.jsx)("span",{children:"BTCOpReturn"})})]}),Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:Le.grid_dates,children:[Object(n.jsxs)(we.a,{className:Le.textTitle,children:[jt("verify:blockchain.date-signature"),":"]}),Object(n.jsx)(we.a,{className:Le.text_dates,children:Ne()(null===(pe=Ye.badge)||void 0===pe||null===(je=pe.insigniasEmitidas)||void 0===je||null===(fe=je.blockchain)||void 0===fe?void 0:fe.fecha_firma_blockchain).format("DD-MM-YYYY hh:mm:ss a")})]}),(null===(he=Ye.badge)||void 0===he||null===(ge=he.insigniasEmitidas)||void 0===ge||null===(xe=ge.blockchain)||void 0===xe?void 0:xe.codigo_transaccion)&&Object(n.jsxs)(Mt.a,{href:"https://blockstream.info/tx/".concat(null===(Oe=Ye.badge)||void 0===Oe||null===(ke=Oe.insigniasEmitidas)||void 0===ke||null===(Be=ke.blockchain)||void 0===Be?void 0:Be.codigo_transaccion),target:"_blank",rel:"noreferrer",className:Le.link,children:[jt("verify:blockchain.link")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]}),(null===(Se=Ye.badge)||void 0===Se||null===(Te=Se.insigniasEmitidas)||void 0===Te||null===(Ae=Te.blockchain)||void 0===Ae?void 0:Ae.altura_block)&&Object(n.jsxs)(Mt.a,{href:"https://blockstream.info/block-height/".concat(null===(Ee=Ye.badge)||void 0===Ee||null===(De=Ee.insigniasEmitidas)||void 0===De||null===(ze=De.blockchain)||void 0===ze?void 0:ze.altura_block),target:"_blank",rel:"noreferrer",className:Le.link,children:[jt("verify:blockchain.link")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:Le.cardBig,children:[Object(n.jsx)(Ya.a,{className:Le.cardHeader,avatar:!1===ot?ht():Object(n.jsx)(Wa.a,{in:ot,style:{transitionDelay:ot?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:Le.circularProgress})}),title:Object(n.jsxs)(we.a,{className:Le.text,children:[" ",jt("verify:blockchain.files")]})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:Le.container_file_blockchain,children:[Object(n.jsx)("div",{className:Le.logo_fontawesome_blockchain,children:Object(n.jsx)(qt.a,{icon:Ht.b,size:"2x"})}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:Le.textTitle,children:"Metadata"}),Object(n.jsxs)(Mt.a,{href:Ye.metadata,target:"_blank",rel:"noreferrer",className:Le.link,children:[jt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})}),"CONFIRMED"===(null===(Pe=Ye.badge)||void 0===Pe||null===(Re=Pe.insigniasEmitidas)||void 0===Re||null===(Me=Re.blockchain)||void 0===Me?void 0:Me.estado_anchor)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:Le.container_file_blockchain,children:[Object(n.jsx)("div",{className:Le.logo_fontawesome_blockchain,children:Object(n.jsx)("img",{src:Za,alt:"PDF Proof",width:35})}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:Le.textTitle,children:"Proof"}),Object(n.jsxs)(Mt.a,{href:Ye.certikaProof,target:"_blank",rel:"noreferrer",className:Le.link,children:[jt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})}),Ye.chainpoint&&Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:Le.container_file_blockchain,children:[Object(n.jsx)(g.a,{"aria-label":"img_organization",className:Le.img_file_blockchain,src:$a}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:Le.textTitle,children:"Chainpoint"}),Object(n.jsxs)(Mt.a,{href:Ye.chainpoint,target:"_blank",rel:"noreferrer",className:Le.link,children:[jt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:Le.container_file_blockchain,children:[Object(n.jsx)(g.a,{"aria-label":"img_organization",className:Le.img_file_blockchain,src:en}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:Le.textTitle,children:"Opentimestamp"}),Object(n.jsxs)(Mt.a,{href:"",onClick:function(e){var t,a,n,i,r,c;e.preventDefault();var o=document.createElement("a");o.href=Ye.openTimestampFile?Ye.openTimestampFile:"https://app.woleet.io/api/receipt/".concat(null===(t=Ye.badge)||void 0===t||null===(a=t.insigniasEmitidas)||void 0===a||null===(n=a.blockchain)||void 0===n?void 0:n.id_anchor,"/ots"),o.download=null===(i=Ye.badge)||void 0===i||null===(r=i.insigniasEmitidas)||void 0===r||null===(c=r.blockchain)||void 0===c?void 0:c.hash_archivo_metadata,document.getElementById("root").appendChild(o),o.click(),document.getElementById("root").removeChild(o)},className:Le.link,children:[jt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]}),Object(n.jsxs)(Mt.a,{href:"",onClick:function(e){e.preventDefault(),window.open("https://opentimestamps.org/")},className:Le.linkVerify,children:[jt("verify:blockchain.verify")," ",Object(n.jsx)(Qa.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})})]})]})})]})]})}),Object(n.jsx)(_t,{loading:nt})]})};var nn=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"1em"},img_certificate:{maxWidth:"-webkit-fill-available",marginRight:".5em"},img_user:{width:e.spacing(10),height:e.spacing(10)},img_org:{width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},img_verified:{width:e.spacing(5),height:e.spacing(5)},img_status_small:{width:e.spacing(4),height:e.spacing(4)},img_security:{marginRight:"1em",width:e.spacing(5),height:e.spacing(5)},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},textVerify:{fontWeight:"bold"},textParagraph:{textAlign:"justify",color:"#5c5c5c",margin:"1em 0 1em 0"},textCode:{color:"#808080",textAlign:"left"},button:{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".5em 3em","&:hover":{backgroundColor:E.a.secondary}},header:{display:"flex",justifyContent:"space-between",alignItems:"center"},divider:{backgroundColor:"#5c5c5c"},link:{color:E.a.primary},linkVerify:{color:E.a.primary,marginLeft:20,"& svg":{width:18}},grid:{backgroundColor:E.a.tertiary,borderRadius:"10px",padding:"1em",marginBottom:"1em"},card:{borderRadius:"10px",padding:".5em",backgroundColor:"white",paddingBottom:0},cardBig:{borderRadius:"10px",padding:".5em",backgroundColor:"white",height:"100%"},cardHeader:{padding:".5em"},grid_dates:{padding:".3em 0 .3em 0"},text_dates:{color:"#5c5c5c",marginLeft:".5em"},circularProgress:{color:E.a.primary},container__bitcoin:{marginTop:15},container_file_blockchain:{display:"flex",alignItems:"center"},img_file_blockchain:{marginRight:10},logo_fontawesome_blockchain:{display:"flex",width:40,alignItems:"center",justifyContent:"center",marginRight:10},transaction:{display:"flex",marginBottom:5,"& p:first-child":{marginBottom:0,marginRight:5,minWidth:90,width:90},"& span":{marginRight:5,fontSize:"0.9em"}},textCodeTransaction:{wordBreak:"break-word",margin:0},closeButton:{margin:".5em .5em 0 0",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}}}})),rn=function(e){var t,a,c,o,s,l,m,b,p,j,x,O,v,_,y,w,C,k,N,B,T,A,I,z,P,R,M,L,F,U,W,Y,q,H,K,V,G,Q,J,X,Z,$,ee,te,ae,ne,ie,re,ce,oe,se,le,de,ue,me,be,pe,je,fe,he,ge,xe,Oe,ke,Be,Se,Te,Ae,Ee,De,ze,Pe,Re,Me,Le,Fe,Ue,We,Ye,qe,He,Ke,Ve,Ge,Qe,Je,Xe,Ze,$e,et=nn(),tt=Object(u.g)(),at=Object(i.useState)({}),nt=Object(d.a)(at,2),it=nt[0],rt=nt[1],ct=Object(i.useState)(null===(t=e.match.params)||void 0===t?void 0:t.verificationType),ot=Object(d.a)(ct,1)[0],st=Object(i.useState)(!1),lt=Object(d.a)(st,2),dt=lt[0],ut=lt[1],mt=Object(i.useState)(""),bt=Object(d.a)(mt,2),pt=bt[0],jt=bt[1],ft=Object(i.useState)(!1),ht=Object(d.a)(ft,2),gt=ht[0],xt=ht[1],vt=r.a.useState(!0),yt=Object(d.a)(vt,2),wt=yt[0],Ct=yt[1],kt=null===(a=JSON.parse(window.localStorage.state))||void 0===a?void 0:a.styles,Nt=Object(D.a)(["verify"]),Bt=Object(d.a)(Nt,1)[0];Object(i.useEffect)((function(){var e=ot&&ot.length>0;ut(!e),St()}),[]);var St=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return xt(!0),r=Object(Ie.a)(e.match.params.certificateId),t.next=4,Ce.a.get("/certificates/verifyCertificates/".concat(r));case 4:c=t.sent,o=c.data,rt(o.certificate),xt(!1),setTimeout((function(){Ct(!1)}),2e3),0===(null===(a=o.certificate.certificate.certificadosEmitidos)||void 0===a?void 0:a.estado)?jt("Revoked"):null!==(null===(n=o.certificate.certificate.certificadosEmitidos)||void 0===n?void 0:n.fecha_expiracion)&&Object(Vt.a)(new Date(null===(i=o.certificate.certificate.certificadosEmitidos)||void 0===i?void 0:i.fecha_expiracion),new Date)?jt("Expired"):jt("Verified");case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Tt=function(){return Object(n.jsx)(qa.a,{sx:{color:E.a.primary}})},Et=function(){return Object(n.jsx)(Ha.a,{sx:{color:"#fced47"}})};return Object(n.jsxs)(n.Fragment,{children:[dt?Object(n.jsx)(At,{}):Object(n.jsx)(S.a,{className:et.closeButton,onClick:function(){return tt.push("/verify/".concat(ot))},children:Object(n.jsx)(Xa.a,{})}),Object(n.jsx)(Rt.a,{maxWidth:"lg",className:et.container,children:Object(n.jsxs)(ye.a,{container:!0,spacing:0,className:et.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,className:"text-center ".concat(et.grid),children:!1===wt?Object(n.jsxs)(n.Fragment,{children:["Verified"===pt?Tt():"Revoked"===pt?Object(n.jsx)(Ka.a,{sx:{color:"#d33"}}):Et(),Object(n.jsx)(we.a,{variant:"h6",className:et.textVerify,children:Bt("Verified"===pt?"verify:verify-success":"Revoked"===pt?"verify:message-certificate.certificate-revoked":"verify:message-certificate.certificate-expired")}),Object(n.jsx)(we.a,{className:et.text,children:"Verified"===pt?"".concat(Bt("verify:message-certificate.certificate-issued")," ").concat(kt.organizationName," ").concat(Bt("verify:information")):"Revoked"===pt?"".concat(Bt("verify:message-certificate.certificate-issued")," ").concat(kt.organizationName," ").concat(Bt("verify:message-certificate.certificate-information-revoked")):"".concat(Bt("verify:message-certificate.certificate-issued")," ").concat(kt.organizationName," ").concat(Bt("verify:message-certificate.certificate-information-expired"))})]}):Object(n.jsx)(Wa.a,{in:wt,style:{transitionDelay:wt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:50,className:et.circularProgress})})}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ye.a,{container:!0,direction:"column",spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:et.card,children:[Object(n.jsx)(Ya.a,{className:et.cardHeader,avatar:!1===wt?Tt():Object(n.jsx)(Wa.a,{in:wt,style:{transitionDelay:wt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:et.circularProgress})}),title:Object(n.jsx)(we.a,{className:et.text,children:Bt("verify:message-certificate.certificate-name")})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)("img",{"aria-label":"img_certificate",className:et.img_certificate,src:it.photoCertificate})}),Object(n.jsx)(ye.a,{item:!0,xs:8,sm:10,children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(we.a,{className:et.textTitle,children:null===(c=it.certificate)||void 0===c||null===(o=c.certificadosEmitidos)||void 0===o||null===(s=o.plantillasCertificados)||void 0===s?void 0:s.nombre}),!1===wt?Tt():Object(n.jsx)(Wa.a,{in:wt,style:{transitionDelay:wt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:et.circularProgress})})]})})]})})]})}),(null===(l=it.certificate)||void 0===l||null===(m=l.cuentas)||void 0===m||null===(b=m.usuarios)||void 0===b?void 0:b.url_perfil)&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:et.card,children:[Object(n.jsx)(Ya.a,{className:et.cardHeader,avatar:!1===wt?Tt():Object(n.jsx)(Wa.a,{in:wt,style:{transitionDelay:wt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:et.circularProgress})}),title:Object(n.jsx)(we.a,{className:et.text,children:Bt("verify:message-certificate.certificate-headline")})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(g.a,{"aria-label":"img_user",className:et.img_user,src:it.photoUser})}),Object(n.jsxs)(ye.a,{item:!0,xs:8,sm:10,children:[Object(n.jsx)(we.a,{className:et.textTitle,children:"".concat(null===(p=it.certificate)||void 0===p||null===(j=p.cuentas)||void 0===j||null===(x=j.usuarios)||void 0===x?void 0:x.primer_nombre," ").concat((null===(O=it.certificate)||void 0===O||null===(v=O.cuentas)||void 0===v||null===(_=v.usuarios)||void 0===_?void 0:_.segundo_nombre)||""," ").concat(null===(y=it.certificate)||void 0===y||null===(w=y.cuentas)||void 0===w||null===(C=w.usuarios)||void 0===C?void 0:C.primer_apellido," ").concat((null===(k=it.certificate)||void 0===k||null===(N=k.cuentas)||void 0===N||null===(B=N.usuarios)||void 0===B?void 0:B.segundo_apellido)||"")}),Object(n.jsxs)(Mt.a,{href:"/dashboard/".concat(null===(T=it.certificate)||void 0===T||null===(A=T.cuentas)||void 0===A||null===(I=A.usuarios)||void 0===I?void 0:I.url_perfil),target:"_blank",rel:"noreferrer",className:et.link,children:[Bt("verify:credentials")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})]})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:et.cardBig,children:[Object(n.jsx)(Ya.a,{className:et.cardHeader,avatar:!1===wt?Tt():Object(n.jsx)(Wa.a,{in:wt,style:{transitionDelay:wt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:et.circularProgress})}),title:Object(n.jsxs)(we.a,{className:et.text,children:[Bt("verify:issued-verified")," ",kt.organizationName,"."]})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(g.a,{variant:"square","aria-label":"img_organization",className:et.img_org,src:it.photoOrganization})}),Object(n.jsxs)(ye.a,{item:!0,xs:8,sm:10,children:[Object(n.jsx)(we.a,{className:et.textTitle,children:null===(z=it.certificate)||void 0===z||null===(P=z.certificadosEmitidos)||void 0===P||null===(R=P.plantillasCertificados)||void 0===R||null===(M=R.organizaciones)||void 0===M?void 0:M.nombre}),Object(n.jsxs)(Mt.a,{href:"/organization/".concat(null===(L=it.certificate)||void 0===L||null===(F=L.certificadosEmitidos)||void 0===F||null===(U=F.plantillasCertificados)||void 0===U||null===(W=U.organizaciones)||void 0===W?void 0:W.url_perfil),target:"_blank",rel:"noreferrer",className:et.link,children:[Bt("verify:more-information")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})}),Object(n.jsxs)(_e.a,{children:[Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:et.grid_dates,children:[Object(n.jsx)(we.a,{className:et.textTitle,children:Bt("verify:issued")}),Object(n.jsx)(we.a,{className:et.text_dates,children:Ne()(null===(Y=it.certificate)||void 0===Y||null===(q=Y.certificadosEmitidos)||void 0===q?void 0:q.fecha_emision).format("DD-MM-YYYY")}),!1===wt?Tt():Object(n.jsx)(Wa.a,{in:wt,style:{transitionDelay:wt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:et.circularProgress})})]}),null!==(null===(H=it.certificate)||void 0===H||null===(K=H.certificadosEmitidos)||void 0===K?void 0:K.fecha_expiracion)&&"0000-00-00"!==(null===(V=it.certificate)||void 0===V||null===(G=V.certificadosEmitidos)||void 0===G?void 0:G.fecha_expiracion)&&Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:et.grid_dates,children:[Object(n.jsx)(we.a,{className:et.textTitle,children:Bt("verify:expired")}),Object(n.jsx)(we.a,{className:et.text_dates,children:Ne()(null===(Q=it.certificate)||void 0===Q||null===(J=Q.certificadosEmitidos)||void 0===J?void 0:J.fecha_expiracion).format("DD-MM-YYYY")}),!1===wt?Object(n.jsx)(n.Fragment,{children:"Expired"===pt?Et():Tt()}):Object(n.jsx)(Wa.a,{in:wt,style:{transitionDelay:wt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:et.circularProgress})})]})]})]})})]}),(null===(X=it.certificate)||void 0===X||null===(Z=X.certificadosEmitidos)||void 0===Z?void 0:Z.blockchain)&&Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:et.container__bitcoin,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:et.cardBig,children:[Object(n.jsx)(Ya.a,{className:et.cardHeader,avatar:!1===wt?Tt():Object(n.jsx)(Wa.a,{in:wt,style:{transitionDelay:wt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:et.circularProgress})}),title:Object(n.jsx)(we.a,{className:et.text,children:Bt("verify:blockchain.information-blockchain")})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,children:Object(n.jsxs)(ye.a,{item:!0,xs:12,children:["CONFIRMED"!==(null===($=it.certificate)||void 0===$||null===(ee=$.certificadosEmitidos)||void 0===ee||null===(te=ee.blockchain)||void 0===te?void 0:te.estado_anchor)&&Object(n.jsxs)("div",{className:et.transaction,children:[Object(n.jsxs)("p",{className:et.textTitle,children:[Bt("verify:blockchain.state-register"),":"]}),Object(n.jsx)("p",{className:et.textCodeTransaction,children:Bt("verify:blockchain.state-wait")})]}),(null===(ae=it.certificate)||void 0===ae||null===(ne=ae.certificadosEmitidos)||void 0===ne||null===(ie=ne.blockchain)||void 0===ie?void 0:ie.hash_certificado)&&Object(n.jsxs)("div",{className:et.transaction,children:[Object(n.jsxs)("p",{className:et.textTitle,children:[Bt("verify:blockchain.hash"),":"]}),Object(n.jsx)("p",{className:et.textCodeTransaction,children:null===(re=it.certificate)||void 0===re||null===(ce=re.certificadosEmitidos)||void 0===ce||null===(oe=ce.blockchain)||void 0===oe?void 0:oe.hash_certificado})]}),"CONFIRMED"===(null===(se=it.certificate)||void 0===se||null===(le=se.certificadosEmitidos)||void 0===le||null===(de=le.blockchain)||void 0===de?void 0:de.estado_anchor)&&Object(n.jsxs)(n.Fragment,{children:[(null===(ue=it.certificate)||void 0===ue||null===(me=ue.certificadosEmitidos)||void 0===me||null===(be=me.blockchain)||void 0===be?void 0:be.codigo_transaccion)&&Object(n.jsxs)("div",{className:et.transaction,children:[Object(n.jsx)("p",{className:et.textTitle,children:"txid:"}),Object(n.jsx)("p",{className:et.textCodeTransaction,children:null===(pe=it.certificate)||void 0===pe||null===(je=pe.certificadosEmitidos)||void 0===je||null===(fe=je.blockchain)||void 0===fe?void 0:fe.codigo_transaccion})]}),(null===(he=it.certificate)||void 0===he||null===(ge=he.certificadosEmitidos)||void 0===ge||null===(xe=ge.blockchain)||void 0===xe?void 0:xe.altura_block)&&Object(n.jsxs)("div",{className:et.transaction,children:[Object(n.jsxs)("p",{className:et.textTitle,children:[Bt("verify:blockchain.block"),":"]}),Object(n.jsx)("p",{className:et.textCodeTransaction,children:null===(Oe=it.certificate)||void 0===Oe||null===(ke=Oe.certificadosEmitidos)||void 0===ke||null===(Be=ke.blockchain)||void 0===Be?void 0:Be.altura_block})]}),(null===(Se=it.certificate)||void 0===Se||null===(Te=Se.certificadosEmitidos)||void 0===Te||null===(Ae=Te.blockchain)||void 0===Ae?void 0:Ae.merkle_root)&&Object(n.jsxs)("div",{className:et.transaction,children:[Object(n.jsx)("p",{className:et.textTitle,children:"Merkle root:"}),Object(n.jsx)("p",{className:et.textCodeTransaction,children:null===(Ee=it.certificate)||void 0===Ee||null===(De=Ee.certificadosEmitidos)||void 0===De||null===(ze=De.blockchain)||void 0===ze?void 0:ze.merkle_root})]}),Object(n.jsxs)("div",{className:et.transaction,children:[Object(n.jsxs)("p",{className:et.textTitle,children:[Bt("verify:blockchain.type-register"),":"]}),Object(n.jsx)("p",{className:et.textCodeTransaction,children:Object(n.jsx)("span",{children:"BTCOpReturn"})})]}),Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:et.grid_dates,children:[Object(n.jsxs)(we.a,{className:et.textTitle,children:[Bt("verify:blockchain.date-signature"),":"]}),Object(n.jsx)(we.a,{className:et.text_dates,children:Ne()(null===(Pe=it.certificate)||void 0===Pe||null===(Re=Pe.certificadosEmitidos)||void 0===Re||null===(Me=Re.blockchain)||void 0===Me?void 0:Me.fecha_firma_blockchain).format("DD-MM-YYYY hh:mm:ss a")})]}),(null===(Le=it.certificate)||void 0===Le||null===(Fe=Le.certificadosEmitidos)||void 0===Fe||null===(Ue=Fe.blockchain)||void 0===Ue?void 0:Ue.codigo_transaccion)&&Object(n.jsxs)(Mt.a,{href:"https://blockstream.info/tx/".concat(null===(We=it.certificate)||void 0===We||null===(Ye=We.certificadosEmitidos)||void 0===Ye||null===(qe=Ye.blockchain)||void 0===qe?void 0:qe.codigo_transaccion),target:"_blank",rel:"noreferrer",className:et.link,children:[Bt("verify:blockchain.link")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]}),(null===(He=it.certificate)||void 0===He||null===(Ke=He.certificadosEmitidos)||void 0===Ke||null===(Ve=Ke.blockchain)||void 0===Ve?void 0:Ve.altura_block)&&Object(n.jsxs)(Mt.a,{href:"https://blockstream.info/block-height/".concat(null===(Ge=it.certificate)||void 0===Ge||null===(Qe=Ge.certificadosEmitidos)||void 0===Qe||null===(Je=Qe.blockchain)||void 0===Je?void 0:Je.altura_block),target:"_blank",rel:"noreferrer",className:et.link,children:[Bt("verify:blockchain.link")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:et.cardBig,children:[Object(n.jsx)(Ya.a,{className:et.cardHeader,avatar:!1===wt?Tt():Object(n.jsx)(Wa.a,{in:wt,style:{transitionDelay:wt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:et.circularProgress})}),title:Object(n.jsx)(we.a,{className:et.text,children:Bt("verify:blockchain.files")})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:et.container_file_blockchain,children:[Object(n.jsx)("div",{className:et.logo_fontawesome_blockchain,children:Object(n.jsx)("img",{src:Za,alt:"PDF Proof",width:35})}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:et.textTitle,children:Bt("verify:blockchain.certificate")}),Object(n.jsxs)(Mt.a,{href:it.pdfCertificate,target:"_blank",rel:"noreferrer",className:et.link,children:[Bt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})}),"CONFIRMED"===(null===(Xe=it.certificate)||void 0===Xe||null===(Ze=Xe.certificadosEmitidos)||void 0===Ze||null===($e=Ze.blockchain)||void 0===$e?void 0:$e.estado_anchor)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:et.container_file_blockchain,children:[Object(n.jsx)("div",{className:et.logo_fontawesome_blockchain,children:Object(n.jsx)("img",{src:Za,alt:"PDF Proof",width:35})}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:et.textTitle,children:"Proof"}),Object(n.jsxs)(Mt.a,{href:it.certikaProof,target:"_blank",rel:"noreferrer",className:et.link,children:[Bt("verify:blockchain.download"),Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})}),it.chainpoint&&Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:et.container_file_blockchain,children:[Object(n.jsx)(g.a,{"aria-label":"img_organization",className:et.img_file_blockchain,src:$a}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:et.textTitle,children:"Chainpoint"}),Object(n.jsxs)(Mt.a,{href:it.chainpoint,target:"_blank",rel:"noreferrer",className:et.link,children:[Bt("verify:blockchain.download"),Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:et.container_file_blockchain,children:[Object(n.jsx)(g.a,{"aria-label":"img_organization",className:et.img_file_blockchain,src:en}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:et.textTitle,children:"Opentimestamp"}),Object(n.jsxs)(Mt.a,{href:"",onClick:function(e){var t,a,n,i,r,c;e.preventDefault();var o=document.createElement("a");o.href=it.openTimestampFile?it.openTimestampFile:"https://app.woleet.io/api/receipt/".concat(null===(t=it.certificate)||void 0===t||null===(a=t.certificadosEmitidos)||void 0===a||null===(n=a.blockchain)||void 0===n?void 0:n.id_anchor,"/ots"),o.download=null===(i=it.certificate)||void 0===i||null===(r=i.certificadosEmitidos)||void 0===r||null===(c=r.blockchain)||void 0===c?void 0:c.hash_certificado,document.getElementById("root").appendChild(o),o.click(),document.getElementById("root").removeChild(o)},className:et.link,children:[Bt("verify:blockchain.download"),Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]}),Object(n.jsxs)(Mt.a,{href:"",onClick:function(e){e.preventDefault(),window.open("https://opentimestamps.org/")},className:et.linkVerify,children:[Bt("verify:blockchain.verify")," ",Object(n.jsx)(Qa.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})})]})]})})]})]})}),Object(n.jsx)(_t,{loading:gt})]})},cn=a(1162);var on=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),sn=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"1em"},img_document:{width:e.spacing(10),height:e.spacing(10),"&:hover":{cursor:"pointer",backgroundColor:"#f5f5f5"}},img_document_view:Object(b.a)({maxWidth:"auto"},e.breakpoints.down("xs"),{maxWidth:"-webkit-fill-available"}),img_org:{width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},img_verified:{width:e.spacing(5),height:e.spacing(5)},img_status_small:{width:e.spacing(4),height:e.spacing(4)},img_security:{marginRight:"1em",width:e.spacing(5),height:e.spacing(5)},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},textVerify:{fontWeight:"bold"},textParagraph:{textAlign:"justify",color:"#5c5c5c",margin:"1em 0 1em 0"},textCode:{color:"#808080",textAlign:"left"},button:{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".5em 3em","&:hover":{backgroundColor:E.a.secondary}},header:{display:"flex",justifyContent:"space-between",alignItems:"center"},link:{color:E.a.primary},linkVerify:{color:E.a.primary,marginLeft:20,"& svg":{width:18}},grid:{backgroundColor:E.a.tertiary,borderRadius:"10px",padding:"1em",marginBottom:"1em"},card:{borderRadius:"10px",padding:".5em",backgroundColor:"white",paddingBottom:0},cardBig:{borderRadius:"10px",padding:".5em",backgroundColor:"white",height:"100%"},cardHeader:{padding:".5em"},grid_dates:{padding:".3em 0 .3em 0"},text_dates:{color:"#5c5c5c",marginLeft:".5em"},circularProgress:{color:E.a.primary},container__bitcoin:{marginTop:15},container_file_blockchain:{display:"flex",alignItems:"center"},img_file_blockchain:{marginRight:10},logo_fontawesome_blockchain:{display:"flex",width:40,alignItems:"center",justifyContent:"center",marginRight:10},transaction:{display:"flex",marginBottom:5,"& p:first-child":{marginBottom:0,marginRight:5,minWidth:90,width:90},"& span":{marginRight:5,fontSize:"0.9em"}},textCodeTransaction:{wordBreak:"break-word",margin:0},closeButton:{margin:".5em .5em 0 0",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}},btnClose:Object(b.a)({position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},e.breakpoints.down("xs"),{display:"none"})}})),ln=function(e){var t,a,c,o,s,l,m,b,p,j,x,v,_,y,w,C,k,N,B,T,A,I,z,P,R,M,L,F,U,W,Y,q,H,V,G,Q,J,X,Z,$,ee,te,ne,ie,re,ce,oe,se,le,de,ue,me,be,pe,je,fe,he,ge,xe,Oe,ke,Be,Se,Te,Ae,Ee,De,ze,Pe,Re,Me,Le,Fe,Ue,We,Ye,qe,He,Ke,Ve,Ge,Qe,Je,Xe,Ze,$e,et,tt,at,nt,it=sn(),rt=Object(u.g)(),ct=Object(i.useState)({}),ot=Object(d.a)(ct,2),st=ot[0],lt=ot[1],dt=Object(i.useState)(null===(t=e.match.params)||void 0===t?void 0:t.verificationType),ut=Object(d.a)(dt,1)[0],mt=Object(i.useState)(!1),bt=Object(d.a)(mt,2),pt=bt[0],jt=bt[1],ht=Object(i.useState)(""),gt=Object(d.a)(ht,2),xt=gt[0],vt=gt[1],yt=Object(i.useState)(!1),wt=Object(d.a)(yt,2),Ct=wt[0],kt=wt[1],Nt=Object(i.useState)(!1),Bt=Object(d.a)(Nt,2),St=Bt[0],Tt=Bt[1],Et=r.a.useState(!0),It=Object(d.a)(Et,2),Dt=It[0],zt=It[1],Pt=Object(i.useState)([]),Lt=Object(d.a)(Pt,2),Ft=Lt[0],Ut=Lt[1],Wt=Object(i.useState)([]),Yt=Object(d.a)(Wt,2),qt=Yt[0],Ht=Yt[1],Kt=null===(a=JSON.parse(window.localStorage.state))||void 0===a?void 0:a.styles,Gt=Object(D.a)(["verify"]),Qt=Object(d.a)(Gt,1)[0];Object(i.useEffect)((function(){var e=ut&&ut.length>0;jt(!e),Jt()}),[]);var Jt=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return kt(!0),r=Object(Ie.a)(e.match.params.documentId),t.next=4,Ce.a.get("/documents/verifyDocuments/".concat(r));case 4:return c=t.sent,o=c.data,lt(o.document),kt(!1),setTimeout((function(){zt(!1)}),2e3),-1===(null===(a=o.document.document.documentosEmitidos)||void 0===a?void 0:a.estado)?vt("Revoked"):null!==(null===(n=o.document.document.documentosEmitidos)||void 0===n?void 0:n.fecha_expiracion)&&Object(Vt.a)(new Date(null===(i=o.document.document.documentosEmitidos)||void 0===i?void 0:i.fecha_expiracion),new Date)?vt("Expired"):vt("Verified"),t.next=12,Xt(r);case 12:return t.next=14,Zt(r);case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Xt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/documentsFieldAdditionals/getDocumentFieldAdditionals",{tipo:1,id_documentos_emitidos:t});case 2:a=e.sent,n=a.data,Ut(null===n||void 0===n?void 0:n.documentFieldAdditionals);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Zt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/documentsFieldAdditionals/getDocumentFieldAdditionals",{tipo:3,id_documentos_emitidos:t});case 2:a=e.sent,n=a.data,Ht(null===n||void 0===n?void 0:n.documentFieldAdditionals);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$t=function(){Tt(!0)},ea=function(){return Object(n.jsx)(qa.a,{sx:{color:E.a.primary}})},ta=function(){return Object(n.jsx)(Ha.a,{sx:{color:"#fced47"}})};return Object(n.jsxs)(n.Fragment,{children:[pt?Object(n.jsx)(At,{}):Object(n.jsx)(S.a,{className:it.closeButton,onClick:function(){return rt.push("/verify/".concat(ut))},children:Object(n.jsx)(ae.a,{})}),Object(n.jsx)(Rt.a,{maxWidth:"lg",className:it.container,children:Object(n.jsxs)(ye.a,{container:!0,spacing:0,className:it.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,className:"text-center ".concat(it.grid),children:!1===Dt?Object(n.jsxs)(n.Fragment,{children:["Verified"===xt?ea():"Revoked"===xt?Object(n.jsx)(Ka.a,{sx:{color:"#d33"}}):ta(),Object(n.jsx)(we.a,{variant:"h6",className:it.textVerify,children:Qt("Verified"===xt?"verify:verify-success":"Revoked"===xt?"verify:message-document.document-revoked":"verify:message-document.document-expired")}),Object(n.jsx)(we.a,{className:it.text,children:"Verified"===xt?"".concat(Qt("verify:message-document.document-issued")," ").concat(Kt.organizationName," ").concat(Qt("verify:information")):"Revoked"===xt?"".concat(Qt("verify:message-document.document-issued")," ").concat(Kt.organizationName," ").concat(Qt("verify:message-document.document-information-revoked")):"".concat(Qt("verify:message-document.document-issued")," ").concat(Kt.organizationName," ").concat(Qt("verify:message-document.document-information-expired"))})]}):Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:50,className:it.circularProgress})})}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ye.a,{container:!0,direction:"column",spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:it.card,children:[Object(n.jsx)(Ya.a,{className:it.cardHeader,avatar:!1===Dt?ea():Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:it.circularProgress})}),title:Object(n.jsx)(we.a,{className:it.text,children:Qt("verify:message-document.document-name")})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(K.a,{title:"Ver documento",children:Object(n.jsx)(ft.a,{anchorOrigin:{vertical:"bottom",horizontal:"right"},badgeContent:Object(n.jsx)(cn.a,{onClick:$t}),children:Object(n.jsx)("img",{"aria-label":"img_document",className:it.img_document,src:st.photoDocument,onClick:$t})})})}),Object(n.jsx)(ye.a,{item:!0,xs:8,sm:10,children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(we.a,{className:it.textTitle,children:null===(c=st.document)||void 0===c||null===(o=c.documentosEmitidos)||void 0===o?void 0:o.nombre}),!1===Dt?ea():Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:it.circularProgress})})]})})]})})]})}),qt.length>0&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:it.cardBig,children:[Object(n.jsx)(Ya.a,{className:it.cardHeader,avatar:!1===Dt?ea():Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:it.circularProgress})}),title:Object(n.jsx)(we.a,{className:it.text,children:Qt("verify:message-document.document-signature")})}),qt.map((function(e){return Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:it.container_file_blockchain,children:[Object(n.jsx)("div",{className:it.logo_fontawesome_blockchain,children:Object(n.jsx)("img",{src:Za,alt:"PDF Proof",width:35})}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:it.textTitle,children:null===e||void 0===e?void 0:e.descripcion}),Object(n.jsxs)(Mt.a,{href:null===e||void 0===e?void 0:e.linkPdf,target:"_blank",rel:"noreferrer",className:it.link,children:[Qt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})})}))]})}),(null===(s=st.document)||void 0===s||null===(l=s.documentosEmitidos)||void 0===l?void 0:l.email_receptor)&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:it.card,children:[Object(n.jsx)(Ya.a,{className:it.cardHeader,avatar:!1===Dt?ea():Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:it.circularProgress})}),title:Object(n.jsx)(we.a,{className:it.text,children:Qt("verify:message-document.document-headline")})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(g.a,{"aria-label":"img_document",className:it.img_document,src:st.photoUser})}),Object(n.jsxs)(ye.a,{item:!0,xs:8,sm:10,children:[Object(n.jsx)(we.a,{className:it.textTitle,children:"".concat(null===(m=st.document)||void 0===m||null===(b=m.cuentas)||void 0===b||null===(p=b.usuarios)||void 0===p?void 0:p.primer_nombre," ").concat((null===(j=st.document)||void 0===j||null===(x=j.cuentas)||void 0===x||null===(v=x.usuarios)||void 0===v?void 0:v.segundo_nombre)||""," ").concat(null===(_=st.document)||void 0===_||null===(y=_.cuentas)||void 0===y||null===(w=y.usuarios)||void 0===w?void 0:w.primer_apellido," ").concat((null===(C=st.document)||void 0===C||null===(k=C.cuentas)||void 0===k||null===(N=k.usuarios)||void 0===N?void 0:N.segundo_apellido)||"")}),Object(n.jsxs)(Mt.a,{href:"/dashboard/".concat(null===(B=st.document)||void 0===B||null===(T=B.cuentas)||void 0===T||null===(A=T.usuarios)||void 0===A?void 0:A.url_perfil),target:"_blank",rel:"noreferrer",className:it.link,children:[Qt("verify:credentials")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})]})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:it.cardBig,children:[Object(n.jsx)(Ya.a,{className:it.cardHeader,avatar:!1===Dt?ea():Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:it.circularProgress})}),title:Object(n.jsxs)(we.a,{className:it.text,children:[Qt("verify:issued-verified")," ",Kt.organizationName,"."]})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(g.a,{variant:"square","aria-label":"img_organization",className:it.img_org,src:st.photoOrganization})}),Object(n.jsxs)(ye.a,{item:!0,xs:8,sm:10,children:[Object(n.jsx)(we.a,{className:it.textTitle,children:null===(I=st.document)||void 0===I||null===(z=I.documentosEmitidos)||void 0===z||null===(P=z.coleccionesDocumentos)||void 0===P||null===(R=P.organizaciones)||void 0===R?void 0:R.nombre}),Object(n.jsxs)(Mt.a,{href:"/organization/".concat(null===(M=st.document)||void 0===M||null===(L=M.documentosEmitidos)||void 0===L||null===(F=L.coleccionesDocumentos)||void 0===F||null===(U=F.organizaciones)||void 0===U?void 0:U.url_perfil),target:"_blank",rel:"noreferrer",className:it.link,children:[Qt("verify:more-information")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})}),Object(n.jsxs)(_e.a,{children:[Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:it.grid_dates,children:[Object(n.jsx)(we.a,{className:it.textTitle,children:Qt("verify:certificate")}),Object(n.jsx)(we.a,{className:it.text_dates,children:Ne()(null===(W=st.document)||void 0===W||null===(Y=W.documentosEmitidos)||void 0===Y?void 0:Y.fecha_certificacion).format("DD-MM-YYYY")}),!1===Dt?ea():Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:it.circularProgress})})]}),null!==(null===(q=st.document)||void 0===q||null===(H=q.documentosEmitidos)||void 0===H?void 0:H.fecha_expiracion)&&"0000-00-00"!==(null===(V=st.document)||void 0===V||null===(G=V.documentosEmitidos)||void 0===G?void 0:G.fecha_expiracion)&&Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:it.grid_dates,children:[Object(n.jsx)(we.a,{className:it.textTitle,children:Qt("verify:expired")}),Object(n.jsx)(we.a,{className:it.text_dates,children:Ne()(null===(Q=st.document)||void 0===Q||null===(J=Q.documentosEmitidos)||void 0===J?void 0:J.fecha_expiracion).format("DD-MM-YYYY")})," ",!1===Dt?Object(n.jsx)(n.Fragment,{children:"Expired"===xt?ta():ea()}):Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:it.circularProgress})})]})]})]})})]}),(null===(X=st.document)||void 0===X||null===(Z=X.documentosEmitidos)||void 0===Z?void 0:Z.blockchain)&&Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:it.container__bitcoin,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:"CONFIRMED"!==(null===($=st.document)||void 0===$||null===(ee=$.documentosEmitidos)||void 0===ee||null===(te=ee.blockchain)||void 0===te?void 0:te.estado_anchor)?12:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:it.cardBig,children:[Object(n.jsx)(Ya.a,{className:it.cardHeader,avatar:!1===Dt?ea():Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:it.circularProgress})}),title:Object(n.jsx)(we.a,{className:it.text,children:Qt("verify:blockchain.information-blockchain")})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,children:Object(n.jsxs)(ye.a,{item:!0,xs:12,children:["CONFIRMED"!==(null===(ne=st.document)||void 0===ne||null===(ie=ne.documentosEmitidos)||void 0===ie||null===(re=ie.blockchain)||void 0===re?void 0:re.estado_anchor)&&Object(n.jsxs)("div",{className:it.transaction,children:[Object(n.jsxs)("p",{className:it.textTitle,children:[Qt("verify:blockchain.state-register"),":"]}),Object(n.jsx)("p",{className:it.textCodeTransaction,children:Qt("verify:blockchain.state-wait")})]}),(null===(ce=st.document)||void 0===ce||null===(oe=ce.documentosEmitidos)||void 0===oe||null===(se=oe.blockchain)||void 0===se?void 0:se.hash_certificado)&&Object(n.jsxs)("div",{className:it.transaction,children:[Object(n.jsxs)("p",{className:it.textTitle,children:[Qt("verify:blockchain.hash"),":"]}),Object(n.jsx)("p",{className:it.textCodeTransaction,children:null===(le=st.document)||void 0===le||null===(de=le.documentosEmitidos)||void 0===de||null===(ue=de.blockchain)||void 0===ue?void 0:ue.hash_certificado})]}),"CONFIRMED"===(null===(me=st.document)||void 0===me||null===(be=me.documentosEmitidos)||void 0===be||null===(pe=be.blockchain)||void 0===pe?void 0:pe.estado_anchor)&&Object(n.jsxs)(n.Fragment,{children:[(null===(je=st.document)||void 0===je||null===(fe=je.documentosEmitidos)||void 0===fe||null===(he=fe.blockchain)||void 0===he?void 0:he.codigo_transaccion)&&Object(n.jsxs)("div",{className:it.transaction,children:[Object(n.jsx)("p",{className:it.textTitle,children:"txid:"}),Object(n.jsx)("p",{className:it.textCodeTransaction,children:null===(ge=st.document)||void 0===ge||null===(xe=ge.documentosEmitidos)||void 0===xe||null===(Oe=xe.blockchain)||void 0===Oe?void 0:Oe.codigo_transaccion})]}),(null===st||void 0===st||null===(ke=st.document)||void 0===ke||null===(Be=ke.documentosEmitidos)||void 0===Be||null===(Se=Be.blockchain)||void 0===Se?void 0:Se.altura_block)&&Object(n.jsxs)("div",{className:it.transaction,children:[Object(n.jsxs)("p",{className:it.textTitle,children:[Qt("verify:blockchain.block"),":"]}),Object(n.jsx)("p",{className:it.textCodeTransaction,children:null===(Te=st.document)||void 0===Te||null===(Ae=Te.documentosEmitidos)||void 0===Ae||null===(Ee=Ae.blockchain)||void 0===Ee?void 0:Ee.altura_block})]}),(null===(De=st.document)||void 0===De||null===(ze=De.documentosEmitidos)||void 0===ze||null===(Pe=ze.blockchain)||void 0===Pe?void 0:Pe.merkle_root)&&Object(n.jsxs)("div",{className:it.transaction,children:[Object(n.jsx)("p",{className:it.textTitle,children:"Merkle root:"}),Object(n.jsx)("p",{className:it.textCodeTransaction,children:null===(Re=st.document)||void 0===Re||null===(Me=Re.documentosEmitidos)||void 0===Me||null===(Le=Me.blockchain)||void 0===Le?void 0:Le.merkle_root})]}),Object(n.jsxs)("div",{className:it.transaction,children:[Object(n.jsxs)("p",{className:it.textTitle,children:[Qt("verify:blockchain.type-register"),":"]}),Object(n.jsx)("p",{className:it.textCodeTransaction,children:Object(n.jsx)("span",{children:"BTCOpReturn"})})]}),Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:it.grid_dates,children:[Object(n.jsxs)(we.a,{className:it.textTitle,children:[Qt("verify:blockchain.date-signature"),":"]}),Object(n.jsx)(we.a,{className:it.text_dates,children:Ne()(null===(Fe=st.document)||void 0===Fe||null===(Ue=Fe.documentosEmitidos)||void 0===Ue||null===(We=Ue.blockchain)||void 0===We?void 0:We.fecha_firma_blockchain).format("DD-MM-YYYY hh:mm:ss a")})]}),(null===(Ye=st.document)||void 0===Ye||null===(qe=Ye.documentosEmitidos)||void 0===qe||null===(He=qe.blockchain)||void 0===He?void 0:He.codigo_transaccion)&&Object(n.jsxs)(Mt.a,{href:"https://blockstream.info/tx/".concat(null===(Ke=st.document)||void 0===Ke||null===(Ve=Ke.documentosEmitidos)||void 0===Ve||null===(Ge=Ve.blockchain)||void 0===Ge?void 0:Ge.codigo_transaccion),target:"_blank",rel:"noreferrer",className:it.link,children:[Qt("verify:blockchain.link")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]}),(null===(Qe=st.document)||void 0===Qe||null===(Je=Qe.documentosEmitidos)||void 0===Je||null===(Xe=Je.blockchain)||void 0===Xe?void 0:Xe.altura_block)&&Object(n.jsxs)(Mt.a,{href:"https://blockstream.info/block-height/".concat(null===(Ze=st.document)||void 0===Ze||null===($e=Ze.documentosEmitidos)||void 0===$e||null===(et=$e.blockchain)||void 0===et?void 0:et.altura_block),target:"_blank",rel:"noreferrer",className:it.link,children:[Qt("verify:blockchain.link")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})})]})}),"CONFIRMED"===(null===(tt=st.document)||void 0===tt||null===(at=tt.documentosEmitidos)||void 0===at||null===(nt=at.blockchain)||void 0===nt?void 0:nt.estado_anchor)&&Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:it.cardBig,children:[Object(n.jsx)(Ya.a,{className:it.cardHeader,avatar:!1===Dt?ea():Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:it.circularProgress})}),title:Object(n.jsx)(we.a,{className:it.text,children:Qt("verify:blockchain.files")})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:it.container_file_blockchain,children:[Object(n.jsx)("div",{className:it.logo_fontawesome_blockchain,children:Object(n.jsx)("img",{src:Za,alt:"PDF Proof",width:35})}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:it.textTitle,children:"Proof"}),Object(n.jsxs)(Mt.a,{href:st.certikaProof,target:"_blank",rel:"noreferrer",className:it.link,children:[Qt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})}),(null===st||void 0===st?void 0:st.chainpoint)&&Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:it.container_file_blockchain,children:[Object(n.jsx)(g.a,{"aria-label":"img_organization",className:it.img_file_blockchain,src:$a}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:it.textTitle,children:"Chainpoint"}),Object(n.jsxs)(Mt.a,{href:st.chainpoint,target:"_blank",rel:"noreferrer",className:it.link,children:[Qt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:it.container_file_blockchain,children:[Object(n.jsx)(g.a,{"aria-label":"img_organization",className:it.img_file_blockchain,src:en}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:it.textTitle,children:"Opentimestamp"}),Object(n.jsxs)(Mt.a,{href:"",onClick:function(e){var t,a,n,i,r,c;e.preventDefault();var o=document.createElement("a");o.href=st.openTimestampFile?st.openTimestampFile:"https://app.woleet.io/api/receipt/".concat(null===(t=st.document)||void 0===t||null===(a=t.documentosEmitidos)||void 0===a||null===(n=a.blockchain)||void 0===n?void 0:n.id_anchor,"/ots"),o.download=null===(i=st.document)||void 0===i||null===(r=i.documentosEmitidos)||void 0===r||null===(c=r.blockchain)||void 0===c?void 0:c.hash_certificado,document.getElementById("root").appendChild(o),o.click(),document.getElementById("root").removeChild(o)},className:it.link,children:[Qt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]}),Object(n.jsxs)(Mt.a,{href:"",onClick:function(e){e.preventDefault(),window.open("https://opentimestamps.org/")},className:it.linkVerify,children:[Qt("verify:blockchain.verify")," ",Object(n.jsx)(Qa.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})})]})})]}),Ft.length>0&&Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,style:{marginTop:"1em"},children:Object(n.jsxs)(ve.a,{variant:"outlined",className:it.cardBig,children:[Object(n.jsx)(Ya.a,{className:it.cardHeader,avatar:!1===Dt?ea():Object(n.jsx)(Wa.a,{in:Dt,style:{transitionDelay:Dt?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:it.circularProgress})}),title:Object(n.jsx)(we.a,{className:it.text,children:Qt("verify:additional-documents")})}),Ft.map((function(e){return Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:it.container_file_blockchain,children:[Object(n.jsx)("div",{className:it.logo_fontawesome_blockchain,children:Object(n.jsx)("img",{src:Za,alt:"PDF Proof",width:35})}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:it.textTitle,children:null===e||void 0===e?void 0:e.descripcion}),Object(n.jsxs)(Mt.a,{href:null===e||void 0===e?void 0:e.linkPdf,target:"_blank",rel:"noreferrer",className:it.link,children:[Qt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})})}))]})}),Object(n.jsx)(O.a,{fullScreen:!0,open:St,TransitionComponent:on,children:Object(n.jsx)(ya,{pdf:null===st||void 0===st?void 0:st.pdfDocument,download:!1,handleClose:function(){Tt(!1)},fullView:!0})})]})}),Object(n.jsx)(_t,{loading:Ct})]})};var dn={color:"#ffffff",float:"right"},un=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"2em"},img_verificado:{display:"inline-block",height:e.spacing(5),margin:"auto"},img:{maxWidth:"-webkit-fill-available"},textBolder:{marginTop:"1em",color:"#000000",fontWeight:"bold",display:"inline"},textTitle:{color:"#000000",fontWeight:"bold",marginLeft:"2em"},textName:{color:"#000000",fontWeight:"bold"},textNameOrganization:{color:"#000000",fontWeight:"bold",marginLeft:"4em"},text:{color:"#000000"},textParagraph:{textAlign:"justify",color:"#000000",margin:"1em 0 1em 0"},link:{color:E.a.primary,marginLeft:"2em",textDecoration:"underline"},linkAdditionals:{color:"white",textDecoration:"none",cursor:"pointer"},linkOrganization:{color:E.a.primary,marginLeft:"4em",textDecoration:"underline"},button:Object(b.a)({margin:"0px 5px",display:"block",textAlign:"center",backgroundColor:E.a.primary,marginBottom:"1em",borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}},e.breakpoints.up("sm"),{display:"inline",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",marginTop:"1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}}),buttonVerificate:Object(b.a)({display:"block",textAlign:"center",marginBottom:"1em",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary,textDecoration:"none",color:"#ffffff"}},e.breakpoints.up("sm"),{marginBottom:"0",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}}),container_redes:Object(b.a)({marginBottom:"1em"},e.breakpoints.up("sm"),{marginBottom:"0"}),containerButtonToCopy:Object(b.a)({borderColor:E.a.primary,marginTop:"1em",marginBottom:"1em",padding:".4em 3em",maxWidth:"-webkit-fill-available"},e.breakpoints.up("sm"),{borderColor:E.a.primary,margin:"1em",padding:".4em 1em"}),WhatsAppIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00d954",marginLeft:".7em","&:hover":{backgroundColor:"#009B3C"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#00d954",marginLeft:".7em","&:hover":{backgroundColor:"#009B3C"}}),LinkedInIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#018ec5",marginLeft:".7em","&:hover":{backgroundColor:"#005374"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#018ec5",marginLeft:".7em","&:hover":{backgroundColor:"#005374"}}),LinkedInIconMenu:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#018ec5","&:hover":{backgroundColor:"#018ec5"}},textLinkedMenu:{fontSize:".8em",marginLeft:".5em"},TwitterIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0080A0"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0080A0"}}),FacebookIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#0080ff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#0080ff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}}),TelegramIcon:Object(b.a)({width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}}),PdfIcon:Object(b.a)({width:e.spacing(0),height:e.spacing(0),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},e.breakpoints.up("sm"),{width:e.spacing(5),height:e.spacing(5),marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}}),PdfIconImage:{height:"45px"},grid:{backgroundColor:E.a.footer,marginBottom:"1em"},skeleton:{marginLeft:"auto",marginRight:"auto"},card:{borderRadius:"10px",borderColor:"#ffffff",backgroundColor:"white",paddingBottom:2,marginTop:"1.5em"},img_user:{width:e.spacing(10),height:e.spacing(10)},img_org:{width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},cardContent:{padding:"0"},textBolderDate:{marginTop:"2.7em",color:"#000000",fontWeight:"bold",marginLeft:".4em"},menuItem:{borderRadius:10,padding:10,cursor:"pointer",backgroundColor:E.a.primary},textMenuItem:{color:"#ffffff",fontWeight:"bold"},expandeMenuItem:{color:"#ffffff",float:"right"},descriptions:{justifyContent:"center",borderRadius:10,backgroundColor:"#fafafa",marginBottom:10,textAlign:"center"},content_descriptions:{margin:"1em"},footer:{justifyContent:"center",marginTop:10,padding:10,backgroundColor:"#fafafa",textAlign:"center"},linkAdicional:{float:"right",marginRight:"5em"},mySwal:{zIndex:3e3},container_text_chip_right:Object(b.a)({textAlign:"center"},e.breakpoints.up("lg"),{textAlign:"right"}),container_text_chip_left:Object(b.a)({textAlign:"center"},e.breakpoints.up("lg"),{textAlign:"left"})}})),mn={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},bn=function(e){var t,a,r,c,o,s,l,u,b,p,j,x,O,v,_,y,w,C=un(),k=Object(i.useState)([!1,""]),N=Object(d.a)(k,2),B=N[0],S=N[1],T=Object(i.useState)(!1),A=Object(d.a)(T,2),I=A[0],z=A[1],P=Object(i.useState)(!1),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!1),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)([]),K=Object(d.a)(H,2),V=K[0],G=K[1],Q=Object(i.useState)([]),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)([]),ee=Object(d.a)($,2),te=ee[0],ae=ee[1],ne=null===(t=JSON.parse(window.localStorage.state))||void 0===t?void 0:t.styles,ie=Object(D.a)(["certificateBadgeTemplate","buttons","certifyDocuments"]),re=Object(d.a)(ie,1)[0];Object(i.useEffect)((function(){oe()}),[]),Object(i.useEffect)((function(){!I&&window.GS&&GS.reset()}),[I]);var oe=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return z(!0),a=Object(Ie.a)(e.match.params.documentId),t.next=4,Ce.a.get("/documents/getDocument/".concat(a));case 4:return n=t.sent,i=n.data,G(i.data),t.next=9,se(a);case 9:return t.next=11,de(a);case 11:z(!1);case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),se=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/documentsFieldAdditionals/getDocumentFieldAdditionals",{tipo:1,id_documentos_emitidos:t});case 2:a=e.sent,n=a.data,Z(null===n||void 0===n?void 0:n.documentFieldAdditionals);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),de=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/documentsFieldAdditionals/getDocumentFieldAdditionals",{tipo:2,id_documentos_emitidos:t});case 2:a=e.sent,n=a.data,ae(null===n||void 0===n?void 0:n.documentFieldAdditionals);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return!0===B[0]&&F.a.fire({customClass:{container:C.mySwal,confirmButton:"custom-button-confirm"},icon:"success",iconColor:E.a.primary,title:re("certificateBadgeTemplate:details.copied"),text:"".concat(B[1]," ").concat(re("certificateBadgeTemplate:details.copied-document"))}).then((function(){S(!1,"")})),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{closeButton:!1}),Object(n.jsx)(ye.a,{container:!0,className:C.grid,children:Object(n.jsx)(ye.a,{item:!0,xs:12,className:"text-center",children:I?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:500,className:C.skeleton}):Object(n.jsx)(ya,{pdf:null===V||void 0===V?void 0:V.pdfDocument,img:null===V||void 0===V?void 0:V.photoDocument})})}),Object(n.jsx)(Rt.a,{className:C.container,maxWidth:"lg",children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{container:!0,justify:"space-between",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:7,lg:7,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:C.textName,children:I?Object(n.jsx)(Be.a,{variant:"h3"}):Object(n.jsx)(n.Fragment,{children:null===V||void 0===V||null===(a=V.document)||void 0===a||null===(r=a.documentosEmitidos)||void 0===r?void 0:r.nombre})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:1,children:I?Object(n.jsx)(Be.a,{variant:"rect",height:30}):Object(n.jsx)(Mt.a,{href:"/documents/verify/".concat(e.match.params.documentId),target:"_blank",underline:"none",variant:"inherit",className:C.buttonVerificate,children:re("buttons:buttons.verify")})})]}),Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,className:C.container_text_chip_left,children:[Object(n.jsx)(we.a,{className:C.textBolder,children:I?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:33}):"".concat(re("certificateBadgeTemplate:details.document-link"),":")}),!I&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(fe.a,{variant:"outlined",label:"".concat(window.location.origin,"/document/").concat(e.match.params.documentId),color:"default",className:C.containerButtonToCopy}),Object(n.jsx)(Pt.CopyToClipboard,{text:"".concat(window.location.origin,"/document/").concat(e.match.params.documentId),onCopy:function(){return S([!0,"Link"])},className:C.button,children:Object(n.jsx)("span",{children:re("certificateBadgeTemplate:details.copy")})})]})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,className:C.container_text_chip_right,children:[Object(n.jsx)(we.a,{className:C.textBolder,children:I?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:33}):"".concat(re("certificateBadgeTemplate:details.document-code"),":")}),!I&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(fe.a,{variant:"outlined",label:null===V||void 0===V||null===(c=V.document)||void 0===c||null===(o=c.documentosEmitidos)||void 0===o?void 0:o.codigo_documento,color:"default",className:C.containerButtonToCopy}),Object(n.jsx)(Pt.CopyToClipboard,{text:null===V||void 0===V||null===(s=V.document)||void 0===s||null===(l=s.documentosEmitidos)||void 0===l?void 0:l.codigo_documento,onCopy:function(){return S([!0,"C\xf3digo"])},className:C.button,children:Object(n.jsx)("span",{children:re("certificateBadgeTemplate:details.copy")})})]})]})]}),Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:1,lg:1,children:Object(n.jsx)(we.a,{className:C.textBolderDate,children:I?Object(n.jsx)(Be.a,{}):"".concat(re("certificateBadgeTemplate:details.created"),":")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:9,lg:10,children:Object(n.jsx)(ve.a,{variant:"outlined",className:C.card,children:Object(n.jsx)(_e.a,{className:C.cardContent,children:Object(n.jsxs)(ye.a,{container:!0,justify:"flex-end",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:1,children:I?Object(n.jsx)(Be.a,{variant:"circle",className:C.img_user}):Object(n.jsx)(g.a,{variant:"square","aria-label":"img_certificate",src:null===V||void 0===V?void 0:V.photoOrganization,className:C.img_org})}),Object(n.jsxs)(ye.a,{item:!0,xs:11,children:[Object(n.jsx)(we.a,{className:C.textNameOrganization,children:I?Object(n.jsx)(Be.a,{variant:"text",width:250}):null===V||void 0===V||null===(u=V.document)||void 0===u||null===(b=u.documentosEmitidos)||void 0===b||null===(p=b.coleccionesDocumentos)||void 0===p||null===(j=p.organizaciones)||void 0===j?void 0:j.nombre}),I?Object(n.jsx)(Be.a,{variant:"text",width:150,className:C.linkOrganization}):Object(n.jsx)(Mt.a,{className:C.linkOrganization,href:"/organization/".concat(null===V||void 0===V||null===(x=V.document)||void 0===x||null===(O=x.documentosEmitidos)||void 0===O||null===(v=O.coleccionesDocumentos)||void 0===v||null===(_=v.organizaciones)||void 0===_?void 0:_.url_perfil),target:"_blank",children:re("certificateBadgeTemplate:details.more-information")})]})]})})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:2,lg:1,className:"text-center",children:[Object(n.jsx)(we.a,{className:C.textBolderDate,children:I?Object(n.jsx)(Be.a,{}):"".concat(re("certificateBadgeTemplate:details.date-certification"),":")}),Object(n.jsx)(we.a,{className:C.text,children:I?Object(n.jsx)(Be.a,{}):Ne()(null===V||void 0===V||null===(y=V.document)||void 0===y||null===(w=y.documentosEmitidos)||void 0===w?void 0:w.fecha_certificacion).format("DD-MM-YYYY")})]})]})}),I?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:C.root}):(null===X||void 0===X?void 0:X.length)>0&&Object(n.jsxs)(ye.a,{container:!0,className:C.menuItem,justify:"space-between",onClick:function(){return L(!M)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:C.textMenuItem,children:re("certifyDocuments:document.additional-documents")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:M?Object(n.jsx)(Wt.a,{sx:dn}):Object(n.jsx)(Yt.a,{sx:dn})})]}),Object(n.jsx)(ye.a,{container:!0,className:C.descriptions,children:Object(n.jsx)(ce.a,{in:M,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:C.content_descriptions,children:null===X||void 0===X?void 0:X.map((function(e,t){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},mn),{},{children:Object(n.jsxs)(we.a,{className:"text-left",children:[Object(n.jsx)(le.a,{sx:{marginRight:"1em"}}),Object(n.jsx)(Mt.a,{href:null===e||void 0===e?void 0:e.linkPdf,target:"_blank",rel:"noreferrer",className:C.linkAdditionals,children:null===e||void 0===e?void 0:e.descripcion})]})}))},"skill".concat(t))}))})})}),I?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:C.root}):te.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:C.menuItem,justify:"space-between",onClick:function(){return q(!Y)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:C.textMenuItem,children:re("certifyDocuments:document.additional-links")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:Y?Object(n.jsx)(Wt.a,{sx:dn}):Object(n.jsx)(Yt.a,{sx:dn})})]}),Object(n.jsx)(ye.a,{container:!0,className:C.descriptions,children:Object(n.jsx)(ce.a,{in:Y,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:C.content_descriptions,children:null===te||void 0===te?void 0:te.map((function(e,t){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},mn),{},{children:Object(n.jsx)(we.a,{className:"text-left",children:Object(n.jsxs)(Mt.a,{href:null===e||void 0===e?void 0:e.link,target:"_blank",rel:"noreferrer",className:C.linkAdditionals,children:[(null===e||void 0===e?void 0:e.descripcion)?null===e||void 0===e?void 0:e.descripcion:null===e||void 0===e?void 0:e.link," ",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})})}))},"skill".concat(t))}))})})})]})]})}),Object(n.jsx)(ye.a,{container:!0,className:C.footer,children:Object(n.jsxs)(ye.a,{item:!0,lg:12,children:[Object(n.jsx)("span",{className:C.textParagraph,children:re("certificateBadgeTemplate:details.right-reserved")}),Object(n.jsx)("p",{className:C.textName,children:ne.organizationName}),Object(n.jsx)("span",{className:C.textParagraph,children:Ne()().format("YYYY")})]})})]})};var pn={color:"#ffffff",float:"right"},jn=Object(C.a)((function(e){var t;return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"1em"},img:{width:"95%",height:"95%",maxWidth:"-webkit-fill-available"},img_verificado:Object(b.a)({display:"none"},e.breakpoints.up("sm"),{display:"inline",height:e.spacing(5)}),textBolder:{marginTop:"1em",color:"#000000",fontWeight:"bold",display:"inline"},textTitle:{color:"#000000",fontWeight:"bold"},textName:{color:"#000000",fontWeight:"bold"},textNameOrganization:{color:"#000000",fontWeight:"bold"},text:{color:"#000000"},textParagraph:{textAlign:"justify",color:"#000000",margin:"1em 0 1em 0"},link:{color:E.a.primary,marginLeft:"2em",textDecoration:"underline"},linkOrganization:{color:E.a.primary,textDecoration:"underline"},header:(t={marginTop:"3em",display:"flex",justifyContent:"flex-end",textAlign:"center"},Object(b.a)(t,e.breakpoints.up("sm"),{marginTop:"1em"}),Object(b.a)(t,e.breakpoints.up("xl"),{marginTop:"1em"}),t),button:{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".5em 3em","&:hover":{backgroundColor:E.a.secondary,color:"#ffffff"}},img_user:{width:e.spacing(10),height:e.spacing(10)},img_org:{marginLeft:"2em",width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},textBolderDate:{color:"#000000",fontWeight:"bold",marginLeft:".4em"},menuItem:{borderRadius:10,padding:10,cursor:"pointer",backgroundColor:E.a.primary},textMenuItem:{color:"#ffffff",fontWeight:"bold"},expandeMenuItem:{color:"#ffffff",float:"right"},descriptions:{justifyContent:"left",borderRadius:10,backgroundColor:"#fafafa",marginBottom:10,textAlign:"center"},content_descriptions:{margin:"1em"},footer:{justifyContent:"center",marginTop:10,padding:10,backgroundColor:"#fafafa",textAlign:"center"},mySwal:{zIndex:3e3}}})),fn={setCarnet:I.m},hn=Object(s.b)((function(e){return{user:e.user,carnet:e.carnet||{},styles:e.styles}}),fn)((function(e){var t,a,r,c,o,s,l,b,p,j,x,O,v,_,y,w,C,k,N=e.user,B=e.styles,S=jn(),T=Object(u.g)(),A=Object(i.useState)([]),I=Object(d.a)(A,2),z=I[0],P=I[1],R=Object(i.useState)([!1,""]),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)(!1),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],K=Object(i.useState)(""),V=Object(d.a)(K,2),G=V[0],Q=V[1],J=Object(i.useState)(!1),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(!1),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ie=Object(i.useState)([]),re=Object(d.a)(ie,2),oe=re[0],se=re[1],le=Object(i.useState)([]),de=Object(d.a)(le,2),ue=de[0],me=de[1],be=Object(i.useState)(""),pe=Object(d.a)(be,2),je=pe[0],fe=pe[1],he=Object(D.a)(["certificateBadgeTemplate","buttons"]),ge=Object(d.a)(he,1)[0];null===N&&T.push("/"),Object(i.useEffect)((function(){var e,t=null===(e=JSON.parse(window.localStorage.state))||void 0===e?void 0:e.styles;fe(t.icon_verificado),ve().catch((function(){T.push("/500"),window.location.reload()}))}),[]),Object(i.useEffect)((function(){!q&&window.GS&&GS.reset()}),[q]);var xe=void 0!==N&&!!(null===(t=N.data_user)||void 0===t?void 0:t.gruposUsuariosOrganizaciones.find((function(e){return 2===e.id_grupos_usuarios}))),Oe=void 0!==N&&!!(null===(a=N.data_user)||void 0===a?void 0:a.gruposUsuariosOrganizaciones.find((function(e){return 1===e.id_grupos_usuarios}))),ve=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u,b,p;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return H(!0),s=Object(Ie.a)(e.match.params.carnetId),t.next=4,Ce.a.get("/carnets/getCarnet/".concat(s));case 4:l=t.sent,d=l.data.data,P(Object(m.a)(Object(m.a)({},d.carnet),{},{pdfCarnet:null===d||void 0===d?void 0:d.pdfCarnet,photoOrganization:null===d||void 0===d?void 0:d.photoOrganization,photoCarnet:null===d||void 0===d?void 0:d.photoCarnet,resizingPhotoCarnet:null===d||void 0===d?void 0:d.resizingPhotoCarnet})),(Oe||xe)&&se(null===(u=d.carnet)||void 0===u||null===(b=u.carnetsEmitidos)||void 0===b||null===(p=b.plantillasCarnets)||void 0===p?void 0:p.carnetCamposAdicionales.filter((function(e){return 50===e.privacidad_vp}))),me(null===(a=d.carnet)||void 0===a||null===(n=a.carnetsEmitidos)||void 0===n||null===(i=n.plantillasCarnets)||void 0===i?void 0:i.carnetCamposAdicionales.filter((function(e){return 49===e.privacidad_vp}))),0===(null===(r=d.carnet.carnetsEmitidos)||void 0===r?void 0:r.estado)?Q("Revoked"):null!==(null===(c=d.carnet.carnetsEmitidos)||void 0===c?void 0:c.fecha_expiracion)&&Object(Vt.a)(new Date(null===(o=d.carnet.carnetsEmitidos)||void 0===o?void 0:o.fecha_expiracion),new Date)?Q("Expired"):Q("Verified"),H(!1);case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();!0===L[0]&&F.a.fire({customClass:{container:S.mySwal,confirmButton:"custom-button-confirm"},icon:"success",iconColor:E.a.primary,buttonsStyling:!1,title:ge("certificateBadgeTemplate:details.copied"),text:"".concat(L[1]," ").concat(ge("certificateBadgeTemplate:details.copied-document"))}).then((function(){U(!1,"")}));var _e=void 0!==N&&(!!Oe||(null===z||void 0===z||null===(r=z.carnetsEmitidos)||void 0===r?void 0:r.plantillasCarnets.id_organizaciones)===N.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones);return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsx)(Rt.a,{className:(S.container,S.root),maxWidth:"xl",children:Object(n.jsxs)(ye.a,{container:!0,spacing:6,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:4,className:"text-center",children:Object(n.jsx)("img",{src:null===z||void 0===z?void 0:z.photoCarnet,alt:"",className:S.img})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:8,children:!q&&Object(n.jsx)("div",{className:S.header,children:Object(n.jsxs)(ye.a,{container:!0,spacing:2,alignItems:"center",justify:"space-between",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:9,children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:S.textTitle,children:q?Object(n.jsx)(Be.a,{variant:"text",width:250}):"".concat(null===(c=z.cuentas)||void 0===c||null===(o=c.usuarios)||void 0===o?void 0:o.primer_nombre," ").concat((null===(s=z.cuentas)||void 0===s||null===(l=s.usuarios)||void 0===l?void 0:l.segundo_nombre)||""," ").concat(null===(b=z.cuentas)||void 0===b||null===(p=b.usuarios)||void 0===p?void 0:p.primer_apellido," ").concat((null===(j=z.cuentas)||void 0===j||null===(x=j.usuarios)||void 0===x?void 0:x.segundo_apellido)||"")}),Object(n.jsx)("img",{alt:"img_verificado",src:"Verified"===G?je:"Revoked"===G?Gt:Qt,className:S.img_verificado})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:3,children:q?Object(n.jsx)(Be.a,{variant:"rect",height:30}):Object(n.jsx)(Mt.a,{href:"/carnet/verify/".concat(Object(Ie.b)(z.id_carnets_emitidos)),target:"_blank",underline:"none",variant:"inherit",className:"my-2 ".concat(S.button),children:ge("buttons:buttons.verify")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:2,children:q?Object(n.jsx)(Be.a,{variant:"circle",className:S.img_user}):Object(n.jsx)(g.a,{variant:"square","aria-label":"img_certificate",src:null===z||void 0===z?void 0:z.photoOrganization,className:S.img_org})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:5,children:[Object(n.jsx)(we.a,{className:S.textNameOrganization,children:q?Object(n.jsx)(Be.a,{variant:"text",width:250}):null===z||void 0===z||null===(O=z.carnetsEmitidos)||void 0===O||null===(v=O.plantillasCarnets)||void 0===v||null===(_=v.organizaciones)||void 0===_?void 0:_.nombre}),q?Object(n.jsx)(Be.a,{variant:"text",width:150,className:S.linkOrganization}):Object(n.jsx)(Mt.a,{className:S.linkOrganization,href:"/organization/".concat(null===z||void 0===z||null===(y=z.carnetsEmitidos)||void 0===y||null===(w=y.plantillasCarnets)||void 0===w||null===(C=w.organizaciones)||void 0===C?void 0:C.url_perfil),target:"_blank",children:ge("certificateBadgeTemplate:details.more-information")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:5,className:"text-center",children:[Object(n.jsx)(we.a,{className:S.textBolderDate,children:q?Object(n.jsx)(Be.a,{}):"".concat(ge("certificateBadgeTemplate:details.date-certification"),":")}),Object(n.jsx)(we.a,{className:S.text,children:q?Object(n.jsx)(Be.a,{}):Ne()(null===z||void 0===z||null===(k=z.carnetsEmitidos)||void 0===k?void 0:k.fecha_emision).format("DD-MM-YYYY")})]}),q?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:S.root}):ue.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:S.menuItem,justify:"space-between",onClick:function(){return ne(!ae)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:S.textMenuItem,children:ge("certificateBadgeTemplate:details.information-public")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:ae?Object(n.jsx)(Wt.a,{sx:pn}):Object(n.jsx)(Yt.a,{sx:pn})})]}),Object(n.jsx)(ye.a,{container:!0,className:S.descriptions,children:Object(n.jsx)(ce.a,{in:ae,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:S.content_descriptions,children:ue.map((function(e,t){var a;return null===z||void 0===z||null===(a=z.carnetsEmitidos)||void 0===a?void 0:a.carnetsCamposValores.map((function(a){return e.id===a.id_carnets_campos_adicionales?Object(n.jsxs)(we.a,{className:S.text,children:[Object(n.jsxs)("b",{children:[e.nombre_campo,": "]}),a.valor]},"fieldsAdditionals".concat(t)):""}))}))})})}),q?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:S.root}):oe.length>0&&_e&&Object(n.jsxs)(ye.a,{container:!0,className:S.menuItem,justify:"space-between",onClick:function(){return $(!Z)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:S.textMenuItem,children:ge("certificateBadgeTemplate:details.information-private")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:Z?Object(n.jsx)(Wt.a,{sx:pn}):Object(n.jsx)(Yt.a,{sx:pn})})]}),Object(n.jsx)(ye.a,{container:!0,className:S.descriptions,children:Object(n.jsx)(ce.a,{in:Z,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:S.content_descriptions,children:oe.map((function(e,t){var a;return null===z||void 0===z||null===(a=z.carnetsEmitidos)||void 0===a?void 0:a.carnetsCamposValores.map((function(a){return e.id===a.id_carnets_campos_adicionales?Object(n.jsxs)(we.a,{className:S.text,children:[Object(n.jsxs)("b",{children:[e.nombre_campo,": "]}),a.valor]},"fieldsAdditionals".concat(t)):""}))}))})})})]})})})]})}),Object(n.jsx)(ye.a,{container:!0,className:S.footer,children:Object(n.jsxs)(ye.a,{item:!0,lg:12,children:[Object(n.jsx)("span",{className:S.textParagraph,children:ge("certificateBadgeTemplate:details.right-reserved")}),Object(n.jsx)("p",{className:S.textName,children:B.organizationName}),Object(n.jsx)("span",{className:S.textParagraph,children:Ne()().format("YYYY")})]})})]})}));var gn=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"1em"},img_carnet:{width:"90px",height:"180px","&:hover":{cursor:"pointer",backgroundColor:"#f5f5f5"}},img_carnet_view:Object(b.a)({maxWidth:"auto"},e.breakpoints.down("xs"),{maxWidth:"-webkit-fill-available"}),img_user:{width:e.spacing(10),height:e.spacing(10)},img_org:{width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},img_verified:{width:e.spacing(5),height:e.spacing(5)},img_status_small:{width:e.spacing(4),height:e.spacing(4)},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},textVerify:{fontWeight:"bold"},textCode:{color:"#808080",textAlign:"left"},button:{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".5em 3em","&:hover":{backgroundColor:E.a.secondary}},header:{display:"flex",justifyContent:"space-between",alignItems:"center"},divider:{backgroundColor:"#5c5c5c"},link:{color:E.a.primary},linkVerify:{color:E.a.primary,marginLeft:20,"& svg":{width:18}},grid:{backgroundColor:E.a.tertiary,borderRadius:"10px",padding:"1em",marginBottom:"1em"},card:{borderRadius:"10px",padding:".5em",backgroundColor:"white",paddingBottom:0},cardBig:{borderRadius:"10px",padding:".5em",backgroundColor:"white",height:"100%"},cardHeader:{padding:".5em"},grid_dates:{padding:".3em 0 .3em 0"},text_dates:{color:"#5c5c5c",marginLeft:".5em"},circularProgress:{color:E.a.primary},container__bitcoin:{marginTop:15},container_file_blockchain:{display:"flex",alignItems:"center"},img_file_blockchain:{marginRight:10},logo_fontawesome_blockchain:{display:"flex",width:40,alignItems:"center",justifyContent:"center",marginRight:10},transaction:{display:"flex",marginBottom:5,"& p:first-child":{marginBottom:0,marginRight:5,minWidth:90,width:150},"& span":{marginRight:5,fontSize:"0.9em"}},textCodeTransaction:{wordBreak:"break-word",margin:0},closeButton:{margin:".5em .5em 0 0",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}},btnClose:Object(b.a)({position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},e.breakpoints.down("xs"),{display:"none"})}})),xn=function(e){var t,a,c,o,s,l,b,p,j,v,y,w,C,k,N,B,T,A,I,z,P,R,M,L,F,U,W,Y,q,H,V,G,Q,J,X,Z,$,ee,te,ne,ie,re,ce,oe,se,le,de,ue,me,be,pe,je,fe,he,ge,xe,Oe,ke,Be,Se,Te,Ee,De,ze,Pe,Re,Me,Le,Fe,Ue,We,Ye,qe,He,Ke,Ve,Ge,Qe,Je,Xe,Ze,$e,et,tt,at,nt,it,rt,ct,ot,st=gn(),lt=Object(u.g)(),dt=Object(i.useState)({}),ut=Object(d.a)(dt,2),mt=ut[0],bt=ut[1],pt=Object(i.useState)(null===(t=e.match.params)||void 0===t?void 0:t.verificationType),jt=Object(d.a)(pt,1)[0],ht=Object(i.useState)(!1),gt=Object(d.a)(ht,2),xt=gt[0],vt=gt[1],yt=Object(i.useState)(""),wt=Object(d.a)(yt,2),Ct=wt[0],kt=wt[1],Nt=Object(i.useState)(!1),Bt=Object(d.a)(Nt,2),St=Bt[0],Tt=Bt[1],Et=Object(i.useState)(!1),It=Object(d.a)(Et,2),Dt=It[0],zt=It[1],Pt=r.a.useState(!0),Lt=Object(d.a)(Pt,2),Ft=Lt[0],Ut=Lt[1],Wt=null===(a=JSON.parse(window.localStorage.state))||void 0===a?void 0:a.styles,Yt=Object(D.a)(["verify"]),qt=Object(d.a)(Yt,1)[0];Object(i.useEffect)((function(){var e=jt&&jt.length>0;vt(!e),Ht()}),[]);var Ht=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Tt(!0),a=Object(Ie.a)(e.match.params.carnetId),t.next=4,Ce.a.get("/carnets/verifyCarnets/".concat(a));case 4:n=t.sent,(i=n.data).carnet.carnet.carnetsEmitidos?(bt(i.carnet),Tt(!1),setTimeout((function(){Ut(!1)}),2e3),0===(null===(r=i.carnet.carnet.carnetsEmitidos)||void 0===r?void 0:r.estado)?kt("Revoked"):null!==(null===(c=i.carnet.carnet.carnetsEmitidos)||void 0===c?void 0:c.fecha_expiracion)&&Object(Vt.a)(new Date(null===(o=i.carnet.carnet.carnetsEmitidos)||void 0===o?void 0:o.fecha_expiracion),new Date)?kt("Expired"):kt("Verified")):(u={carnet:{carnetsEmitidos:Object(m.a)({},i.carnet.carnet)},pdfCarnet:i.carnet.pdfCarnet,photoCarnet:i.carnet.photoCarnet,resizingPhotoCarnet:i.carnet.resizingPhotoCarnet,photoOrganization:i.carnet.photoOrganization},bt(u),Tt(!1),setTimeout((function(){Ut(!1)}),2e3),0===(null===(s=i.carnet.carnet)||void 0===s?void 0:s.estado)?kt("Revoked"):null!==(null===(l=i.carnet.carnet)||void 0===l?void 0:l.fecha_expiracion)&&Object(Vt.a)(new Date(null===(d=i.carnet.carnet)||void 0===d?void 0:d.fecha_expiracion),new Date)?kt("Expired"):kt("Verified"));case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Kt=function(){zt(!0)},Gt=function(){zt(!1)},Qt=function(){return Object(n.jsx)(qa.a,{sx:{color:E.a.primary}})},Jt=function(){return Object(n.jsx)(Ha.a,{sx:{color:"#fced47"}})};return Object(n.jsxs)(n.Fragment,{children:[xt?Object(n.jsx)(At,{}):Object(n.jsx)(S.a,{className:st.closeButton,onClick:function(){return lt.push("/verify/".concat(jt))},children:Object(n.jsx)(ae.a,{})}),Object(n.jsx)(Rt.a,{maxWidth:"lg",className:st.container,children:Object(n.jsxs)(ye.a,{container:!0,spacing:0,className:st.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,className:"text-center ".concat(st.grid),children:!1===Ft?Object(n.jsxs)(n.Fragment,{children:["Verified"===Ct?Qt():"Revoked"===Ct?Object(n.jsx)(Ka.a,{sx:{color:"#d33"}}):Jt(),Object(n.jsx)(we.a,{variant:"h6",className:st.textVerify,children:qt("Verified"===Ct?"verify:verify-success":"Revoked"===Ct?"verify:message-carnet.carnet-revoked":"verify:message-carnet.carnet-expired")}),Object(n.jsx)(we.a,{className:st.text,children:"Verified"===Ct?"".concat(qt("verify:message-carnet.carnet-issued")," ").concat(Wt.organizationName," ").concat(qt("verify:information")):"Revoked"===Ct?"".concat(qt("verify:message-carnet.carnet-issued")," ").concat(Wt.organizationName," ").concat(qt("verify:message-carnet.carnet-information-revoked")):"".concat(qt("verify:message-carnet.carnet-issued")," ").concat(Wt.organizationName," ").concat(qt("verify:message-carnet.carnet-information-expired"))})]}):Object(n.jsx)(Wa.a,{in:Ft,style:{transitionDelay:Ft?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:50,className:st.circularProgress})})}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ye.a,{container:!0,direction:"column",spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:st.card,children:[Object(n.jsx)(Ya.a,{className:st.cardHeader,avatar:!1===Ft?Qt():Object(n.jsx)(Wa.a,{in:Ft,style:{transitionDelay:Ft?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:st.circularProgress})}),title:Object(n.jsx)(we.a,{className:st.text,children:qt("verify:message-carnet.carnet-name")})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(K.a,{title:"Ver Carnet",children:Object(n.jsx)(ft.a,{anchorOrigin:{vertical:"bottom",horizontal:"right"},badgeContent:Object(n.jsx)(cn.a,{onClick:Kt}),children:Object(n.jsx)("img",{"aria-label":"img_carnet",className:st.img_carnet,src:mt.photoCarnet,onClick:Kt})})})}),Object(n.jsx)(ye.a,{item:!0,xs:8,sm:10,children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(we.a,{className:st.textTitle,children:null===(c=mt.carnet)||void 0===c||null===(o=c.carnetsEmitidos)||void 0===o||null===(s=o.plantillasCarnets)||void 0===s?void 0:s.nombre}),!1===Ft?Qt():Object(n.jsx)(Wa.a,{in:Ft,style:{transitionDelay:Ft?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:st.circularProgress})})]})})]})})]})}),(null===(l=mt.carnet)||void 0===l?void 0:l.cuentas)&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:st.card,children:[Object(n.jsx)(Ya.a,{className:st.cardHeader,avatar:!1===Ft?Qt():Object(n.jsx)(Wa.a,{in:Ft,style:{transitionDelay:Ft?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:st.circularProgress})}),title:Object(n.jsx)(we.a,{className:st.text,children:qt("verify:message-carnet.carnet-headline")})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(g.a,{"aria-label":"img_carnet",className:st.img_user,src:mt.photoUser})}),Object(n.jsxs)(ye.a,{item:!0,xs:8,sm:10,children:[Object(n.jsx)(we.a,{className:st.textTitle,children:"".concat(null===(b=mt.carnet)||void 0===b||null===(p=b.cuentas)||void 0===p||null===(j=p.usuarios)||void 0===j?void 0:j.primer_nombre," ").concat((null===(v=mt.carnet)||void 0===v||null===(y=v.cuentas)||void 0===y||null===(w=y.usuarios)||void 0===w?void 0:w.segundo_nombre)||""," ").concat(null===(C=mt.carnet)||void 0===C||null===(k=C.cuentas)||void 0===k||null===(N=k.usuarios)||void 0===N?void 0:N.primer_apellido," ").concat((null===(B=mt.carnet)||void 0===B||null===(T=B.cuentas)||void 0===T||null===(A=T.usuarios)||void 0===A?void 0:A.segundo_apellido)||"")}),Object(n.jsxs)(Mt.a,{href:"/dashboard/".concat(null===(I=mt.carnet)||void 0===I||null===(z=I.cuentas)||void 0===z||null===(P=z.usuarios)||void 0===P?void 0:P.url_perfil),target:"_blank",rel:"noreferrer",className:st.link,children:[qt("verify:credentials")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})]})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:st.cardBig,children:[Object(n.jsx)(Ya.a,{className:st.cardHeader,avatar:!1===Ft?Qt():Object(n.jsx)(Wa.a,{in:Ft,style:{transitionDelay:Ft?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:st.circularProgress})}),title:Object(n.jsxs)(we.a,{className:st.text,children:[qt("verify:issued-verified")," ",Wt.organizationName,"."]})}),Object(n.jsx)(_e.a,{children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:4,sm:2,children:Object(n.jsx)(g.a,{variant:"square","aria-label":"img_organization",className:st.img_org,src:mt.photoOrganization})}),Object(n.jsxs)(ye.a,{item:!0,xs:8,sm:10,children:[Object(n.jsx)(we.a,{className:st.textTitle,children:null===(R=mt.carnet)||void 0===R||null===(M=R.carnetsEmitidos)||void 0===M||null===(L=M.plantillasCarnets)||void 0===L||null===(F=L.organizaciones)||void 0===F?void 0:F.nombre}),Object(n.jsxs)(Mt.a,{href:"/organization/".concat(null===(U=mt.carnet)||void 0===U||null===(W=U.carnetsEmitidos)||void 0===W||null===(Y=W.plantillasCarnets)||void 0===Y||null===(q=Y.organizaciones)||void 0===q?void 0:q.url_perfil),target:"_blank",rel:"noreferrer",className:st.link,children:[qt("verify:more-information")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})}),Object(n.jsxs)(_e.a,{children:[Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:st.grid_dates,children:[Object(n.jsx)(we.a,{className:st.textTitle,children:qt("verify:issued")}),Object(n.jsx)(we.a,{className:st.text_dates,children:Ne()(null===(H=mt.carnet)||void 0===H||null===(V=H.carnetsEmitidos)||void 0===V?void 0:V.fecha_emision).format("DD-MM-YYYY")}),!1===Ft?Qt():Object(n.jsx)(Wa.a,{in:Ft,style:{transitionDelay:Ft?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:st.circularProgress})})]}),null!==(null===(G=mt.carnet)||void 0===G||null===(Q=G.carnetsEmitidos)||void 0===Q?void 0:Q.fecha_expiracion)&&"0000-00-00"!==(null===(J=mt.carnet)||void 0===J||null===(X=J.carnetsEmitidos)||void 0===X?void 0:X.fecha_expiracion)&&Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:st.grid_dates,children:[Object(n.jsx)(we.a,{className:st.textTitle,children:qt("verify:expired")}),Object(n.jsx)(we.a,{className:st.text_dates,children:Ne()(null===(Z=mt.carnet)||void 0===Z||null===($=Z.carnetsEmitidos)||void 0===$?void 0:$.fecha_expiracion).format("DD-MM-YYYY")}),!1===Ft?Object(n.jsx)(n.Fragment,{children:"Expired"===Ct?Jt():Qt()}):Object(n.jsx)(Wa.a,{in:Ft,style:{transitionDelay:Ft?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:st.circularProgress})})]})]})]})})]}),(null===(ee=mt.carnet)||void 0===ee||null===(te=ee.carnetsEmitidos)||void 0===te?void 0:te.blockchain)&&Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:st.container__bitcoin,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:"CONFIRMED"===(null===(ne=mt.carnet)||void 0===ne||null===(ie=ne.carnetsEmitidos)||void 0===ie||null===(re=ie.blockchain)||void 0===re?void 0:re.estado_anchor)?6:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:st.cardBig,children:[Object(n.jsx)(Ya.a,{className:st.cardHeader,avatar:!1===Ft?Qt():Object(n.jsx)(Wa.a,{in:Ft,style:{transitionDelay:Ft?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:st.circularProgress})}),title:Object(n.jsx)(we.a,{className:st.text,children:qt("verify:blockchain.information-blockchain")})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,children:Object(n.jsxs)(ye.a,{item:!0,xs:12,children:["CONFIRMED"!==(null===(ce=mt.carnet)||void 0===ce||null===(oe=ce.carnetsEmitidos)||void 0===oe||null===(se=oe.blockchain)||void 0===se?void 0:se.estado_anchor)&&Object(n.jsxs)("div",{className:st.transaction,children:[Object(n.jsxs)("p",{className:st.textTitle,children:[qt("verify:blockchain.state-register"),":"]}),Object(n.jsx)("p",{className:st.textCodeTransaction,children:qt("verify:blockchain.state-wait")})]}),(null===(le=mt.carnet)||void 0===le||null===(de=le.carnetsEmitidos)||void 0===de||null===(ue=de.blockchain)||void 0===ue?void 0:ue.hash_certificado)&&Object(n.jsxs)("div",{className:st.transaction,children:[Object(n.jsxs)("p",{className:st.textTitle,children:[qt("verify:blockchain.hash"),":"]}),Object(n.jsx)("p",{className:st.textCodeTransaction,children:null===(me=mt.carnet)||void 0===me||null===(be=me.carnetsEmitidos)||void 0===be||null===(pe=be.blockchain)||void 0===pe?void 0:pe.hash_certificado})]}),"CONFIRMED"===(null===(je=mt.carnet)||void 0===je||null===(fe=je.carnetsEmitidos)||void 0===fe||null===(he=fe.blockchain)||void 0===he?void 0:he.estado_anchor)&&Object(n.jsxs)(n.Fragment,{children:[(null===(ge=mt.carnet)||void 0===ge||null===(xe=ge.carnetsEmitidos)||void 0===xe||null===(Oe=xe.blockchain)||void 0===Oe?void 0:Oe.codigo_transaccion)&&Object(n.jsxs)("div",{className:st.transaction,children:[Object(n.jsx)("p",{className:st.textTitle,children:"txid:"}),Object(n.jsx)("p",{className:st.textCodeTransaction,children:null===(ke=mt.carnet)||void 0===ke||null===(Be=ke.carnetsEmitidos)||void 0===Be||null===(Se=Be.blockchain)||void 0===Se?void 0:Se.codigo_transaccion})]}),(null===(Te=mt.carnet)||void 0===Te||null===(Ee=Te.carnetsEmitidos)||void 0===Ee||null===(De=Ee.blockchain)||void 0===De?void 0:De.altura_block)&&Object(n.jsxs)("div",{className:st.transaction,children:[Object(n.jsxs)("p",{className:st.textTitle,children:[qt("verify:blockchain.block"),":"]}),Object(n.jsx)("p",{className:st.textCodeTransaction,children:null===(ze=mt.carnet)||void 0===ze||null===(Pe=ze.carnetsEmitidos)||void 0===Pe||null===(Re=Pe.blockchain)||void 0===Re?void 0:Re.altura_block})]}),(null===(Me=mt.carnet)||void 0===Me||null===(Le=Me.carnetsEmitidos)||void 0===Le||null===(Fe=Le.blockchain)||void 0===Fe?void 0:Fe.merkle_root)&&Object(n.jsxs)("div",{className:st.transaction,children:[Object(n.jsx)("p",{className:st.textTitle,children:"Merkle root:"}),Object(n.jsx)("p",{className:st.textCodeTransaction,children:null===(Ue=mt.carnet)||void 0===Ue||null===(We=Ue.carnetsEmitidos)||void 0===We||null===(Ye=We.blockchain)||void 0===Ye?void 0:Ye.merkle_root})]}),Object(n.jsxs)("div",{className:st.transaction,children:[Object(n.jsxs)("p",{className:st.textTitle,children:[qt("verify:blockchain.type-register"),":"]}),Object(n.jsx)("p",{className:st.textCodeTransaction,children:Object(n.jsx)("span",{children:"BTCOpReturn"})})]}),Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:st.grid_dates,children:[Object(n.jsxs)(we.a,{className:st.textTitle,children:[qt("verify:blockchain.date-signature"),":"]}),Object(n.jsx)(we.a,{className:st.text_dates,children:Ne()(null===(qe=mt.carnet)||void 0===qe||null===(He=qe.carnetsEmitidos)||void 0===He||null===(Ke=He.blockchain)||void 0===Ke?void 0:Ke.fecha_firma_blockchain).format("DD-MM-YYYY hh:mm:ss a")})]}),(null===(Ve=mt.carnet)||void 0===Ve||null===(Ge=Ve.carnetsEmitidos)||void 0===Ge||null===(Qe=Ge.blockchain)||void 0===Qe?void 0:Qe.codigo_transaccion)&&Object(n.jsxs)(Mt.a,{href:"https://blockstream.info/tx/".concat(null===(Je=mt.carnet)||void 0===Je||null===(Xe=Je.carnetsEmitidos)||void 0===Xe||null===(Ze=Xe.blockchain)||void 0===Ze?void 0:Ze.codigo_transaccion),target:"_blank",rel:"noreferrer",className:st.link,children:[qt("verify:blockchain.link")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]}),(null===($e=mt.carnet)||void 0===$e||null===(et=$e.carnetsEmitidos)||void 0===et||null===(tt=et.blockchain)||void 0===tt?void 0:tt.altura_block)&&Object(n.jsxs)(Mt.a,{href:"https://blockstream.info/block-height/".concat(null===(at=mt.carnet)||void 0===at||null===(nt=at.carnetsEmitidos)||void 0===nt||null===(it=nt.blockchain)||void 0===it?void 0:it.altura_block),target:"_blank",rel:"noreferrer",className:st.link,children:[qt("verify:blockchain.link")," ",Object(n.jsx)(Va.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})})]})}),"CONFIRMED"===(null===(rt=mt.carnet)||void 0===rt||null===(ct=rt.carnetsEmitidos)||void 0===ct||null===(ot=ct.blockchain)||void 0===ot?void 0:ot.estado_anchor)&&Object(n.jsx)(ye.a,{item:!0,xs:12,md:6,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:st.cardBig,children:[Object(n.jsx)(Ya.a,{className:st.cardHeader,avatar:!1===Ft?Qt():Object(n.jsx)(Wa.a,{in:Ft,style:{transitionDelay:Ft?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:30,className:st.circularProgress})}),title:Object(n.jsx)(we.a,{className:st.text,children:qt("verify:blockchain.files")})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:st.container_file_blockchain,children:[Object(n.jsx)("div",{className:st.logo_fontawesome_blockchain,children:Object(n.jsx)("img",{src:Za,alt:"PDF Proof",width:35})}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:st.textTitle,children:"Proof"}),Object(n.jsxs)(Mt.a,{href:mt.certikaProof,target:"_blank",rel:"noreferrer",className:st.link,children:[qt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})}),mt.chainpoint&&Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:st.container_file_blockchain,children:[Object(n.jsx)(g.a,{"aria-label":"img_organization",className:st.img_file_blockchain,src:$a}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:st.textTitle,children:"Chainpoint"}),Object(n.jsxs)(Mt.a,{href:mt.chainpoint,target:"_blank",rel:"noreferrer",className:st.link,children:[qt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})}),Object(n.jsx)(_e.a,{children:Object(n.jsx)(ye.a,{container:!0,alignItems:"center",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:st.container_file_blockchain,children:[Object(n.jsx)(g.a,{"aria-label":"img_organization",className:st.img_file_blockchain,src:en}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:st.textTitle,children:"Opentimestamp"}),Object(n.jsxs)(Mt.a,{href:"",onClick:function(e){var t,a,n,i,r,c;e.preventDefault();var o=document.createElement("a");o.href=mt.openTimestampFile?mt.openTimestampFile:"https://app.woleet.io/api/receipt/".concat(null===(t=mt.carnet)||void 0===t||null===(a=t.carnetsEmitidos)||void 0===a||null===(n=a.blockchain)||void 0===n?void 0:n.id_anchor,"/ots"),o.download=null===(i=mt.carnet)||void 0===i||null===(r=i.carnetsEmitidos)||void 0===r||null===(c=r.blockchain)||void 0===c?void 0:c.hash_certificado,document.getElementById("root").appendChild(o),o.click(),document.getElementById("root").removeChild(o)},className:st.link,children:[qt("verify:blockchain.download")," ",Object(n.jsx)(Ga.a,{sx:{color:E.a.primary,fontSize:15}})]}),Object(n.jsxs)(Mt.a,{href:"",onClick:function(e){e.preventDefault(),window.open("https://opentimestamps.org/")},className:st.linkVerify,children:[qt("verify:blockchain.verify")," ",Object(n.jsx)(Qa.a,{sx:{color:E.a.primary,fontSize:15}})]})]})]})})})]})})]}),Object(n.jsxs)(O.a,{open:Dt,onClose:Gt,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(st.btnClose),onClick:Gt,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:mt.photoCarnet,className:st.img_carnet_view})})]})]})}),Object(n.jsx)(_t,{loading:St})]})};var On=Object(s.b)((function(e){return{user:e.user,permission:e.permission}}),null)((function(e){var t=e.children,a=e.user,r=e.permission,c=Object(u.g)();return null!=a&&null!=r||(c.push("/"),window.location.reload()),Object(n.jsxs)(i.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsx)(Rt.a,{maxWidth:"false",children:Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:3,children:Object(n.jsx)("div",{id:"sidebar",children:Object(n.jsx)(ut,{})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:9,children:Object(n.jsx)(u.d,{children:t})})]})})]})})),vn=a(1169),_n=a(1167),yn=a(1163),wn=a(645),Cn=a(1168),kn=a(266),Nn=a(1164),Bn=a(1165),Sn=a(1166),Tn=a(1254),An=a(1255),En=Object(xe.a)((function(){return{head:{fontWeight:"bold",fontSize:16}}}))(yn.a),In=Object(C.a)({table:{minWidth:650}}),Dn={changePage:I.b,changeRowsPerPage:I.d},zn=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),Dn)((function(e){var t=e.rows,a=e.columns,r=e.children,c=e.page,o=e.rowsPerPage,s=e.setDirection,l=e.setOrderBy,u=e.loading,m=e.tableSmall,b=e.changePagination,p=In(),j=Object(D.a)("tables"),f=Object(d.a)(j,1)[0],h=Object(i.useState)(""),g=Object(d.a)(h,2),x=g[0],O=g[1],v=Object(i.useState)("name"),_=Object(d.a)(v,2),y=_[0],w=_[1],C=function(e){return function(t){!function(e,t){var a=y===t&&"asc"===x;w(t),O(a?"desc":"asc"),l(t),s(a?"desc":"asc")}(0,e)}};return Object(n.jsxs)(kn.a,{elevation:0,children:[Object(n.jsx)(Nn.a,{children:Object(n.jsxs)(Bn.a,{className:m?"":p.table,"aria-label":"simple table",children:[Object(n.jsx)(Sn.a,{children:Object(n.jsx)(_n.a,{children:a.map((function(e){return u?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(En,{align:e.align,style:{minWidth:e.minWidth,width:e.width},colSpan:e.colSpan,children:Object(n.jsx)(Be.a,{})})}):Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(En,{align:e.align,style:{minWidth:e.minWidth,width:e.width},colSpan:e.colSpan,children:e.orden?Object(n.jsx)(Tn.a,{active:"".concat(y)==="".concat(e.orden),direction:"".concat(y)==="".concat(e.orden)?x:"asc",onClick:C("".concat(e.orden)),children:e.label}):e.label},e.id)})}))})}),r]})}),Object(n.jsx)(An.a,{rowsPerPageOptions:[10,25,100],component:"div",count:"undefined"===typeof t||"number"===typeof t?t||0:t.length,rowsPerPage:o,page:c,labelRowsPerPage:f("table.rows-per-page"),onChangePage:function(t,a){e.changePage(a),void 0!==b&&b(a,o)},onChangeRowsPerPage:function(t){var a=t.target.value;e.changeRowsPerPage(a),e.changePage(0),void 0!==b&&b(0,a)}})]})})),Pn=a(25),Rn=a(1120),Mn=Object(C.a)((function(){return{header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:6,marginBottom:".5em"},input:{width:"100%",margin:10,backgroundColor:"white"}}})),Ln={setSearchValue:I.E},Fn=Object(s.b)((function(e){return{searchValue:e.searchValue}}),Ln)((function(e){var t=e.tableName,a=e.items,r=e.setItems,c=e.groupId,o=e.setCountItems,s=e.changePage,l=e.organizationId,u=e.deparmentCreater,m=e.userGroupId,b=e.setLoading,p=e.type,j=e.columns,g=e.setSearchValue,O=e.searchValue,v=Mn(),_=Object(D.a)(["search","alerts","buttons"]),y=Object(d.a)(_,1)[0];Object(i.useEffect)((function(){O&&""!==O&&w()}),[]);var w=function(){var e=Object(h.a)(f.a.mark((function e(n){var i,d,h=arguments;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=h.length>1&&void 0!==h[1]?h[1]:null,s&&s(0),b&&b(!0),d=i?"":O,e.t0=t,e.next="BadgesIssued"===e.t0?7:"groupIssued"===e.t0?10:"templateBadge"===e.t0?13:"collections"===e.t0?16:"badgeCollectionTemplates"===e.t0?19:"recomendations"===e.t0?22:"badgeTemplateRecomendations"===e.t0?25:"certificateTemplateRecomendations"===e.t0?28:"templateCertificate"===e.t0?31:"certificateCollectionTemplates"===e.t0?34:"CertificatesIssued"===e.t0?37:"templateDocument"===e.t0?40:"groupDocuments"===e.t0?43:"filesDocuments"===e.t0?46:"templateCarnets"===e.t0?49:"CarnetIssued"===e.t0?52:"helpCenterCarnets"===e.t0?55:"valueParameters"===e.t0?58:"Permissions"===e.t0?61:"users"===e.t0?64:"organizations"===e.t0?67:"userGroupsOrganization"===e.t0?70:"contracts"===e.t0?73:"Habilities"===e.t0?76:"Payments"===e.t0?79:82;break;case 7:return e.next=9,Ce.a.post("/badgesIssued/getIssuedSearch",{id_grupos_insignias_emitidas:c,id_organizaciones:l,filtro:d}).then((function(e){var t,a,n;r(null===(t=e.data)||void 0===t?void 0:t.issued),o(null===(a=e.data)||void 0===a||null===(n=a.issued)||void 0===n?void 0:n.length),b(!1)})).catch((function(e){k()}));case 9:return e.abrupt("break",85);case 10:return e.next=12,Ce.a.post("/groupsBadgesIssued/getGroups/search",{type:p,filtro:d,id_organizaciones:l}).then((function(e){var t,a,n;r(null===(t=e.data)||void 0===t?void 0:t.groups),o(null===(a=e.data)||void 0===a||null===(n=a.groups)||void 0===n?void 0:n.length),b(!1)})).catch((function(e){k()}));case 12:return e.abrupt("break",85);case 13:return e.next=15,Ce.a.post("/templateBadge/search",{filtro:d,type:p,id_organizaciones:l}).then((function(e){if((null===u||void 0===u?void 0:u.isDeparmentCreater)||(null===u||void 0===u?void 0:u.isDeparmentCreaterRoll)){var t,a=null===(t=e.data.templatesBadges)||void 0===t?void 0:t.filter((function(e){return e.plantillasInsigniasHistorial[0].id_usuarios===(null===u||void 0===u?void 0:u.userId)}));r(a),o(a.length),b(!1)}else{var n,i,c;r(null===(n=e.data)||void 0===n?void 0:n.templatesBadges),o(null===(i=e.data)||void 0===i||null===(c=i.templatesBadges)||void 0===c?void 0:c.length),b(!1)}})).catch((function(e){k()}));case 15:return e.abrupt("break",85);case 16:return e.next=18,Ce.a.post("/collections/getCollections/search",{filtro:d,tipo:c}).then((function(e){var t;1===m?r(null===(t=e.data)||void 0===t?void 0:t.collections):r(e.data.collections.filter((function(e){return e.id_organizaciones===l})));b(!1)})).catch((function(e){F.a.fire({icon:"error",iconColor:E.a.primary,text:y("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}),b(!1)}));case 18:return e.abrupt("break",85);case 19:return e.next=21,Ce.a.post("/badgesTemplatesGroupsTemplates/getBadgesTemplatesGroupsTemplates/search",{filtro:d,id_grupos_plantillas:c,estado:1}).then((function(e){var t;1===m?r(null===(t=e.data)||void 0===t?void 0:t.plantillasInsigniasGruposPlantillas):r(e.data.plantillasInsigniasGruposPlantillas.filter((function(e){var t;return(null===(t=e.plantillasInsignias)||void 0===t?void 0:t.id_organizaciones)===l})));b(!1)})).catch((function(e){F.a.fire({icon:"error",iconColor:E.a.primary,text:y("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}),b(!1)}));case 21:return e.abrupt("break",85);case 22:return e.next=24,Ce.a.post("/recommendation/getRecommendations/search",{filtro:d,type:p}).then((function(e){var t;1===m?r(null===(t=e.data)||void 0===t?void 0:t.recommendations):"badges"===p?r(e.data.recommendations.filter((function(e){var t;return(null===(t=e.plantillasInsignias)||void 0===t?void 0:t.id_organizaciones)===l}))):"certificates"===p&&r(e.data.recommendations.filter((function(e){var t;return(null===(t=e.plantillasCertificados)||void 0===t?void 0:t.id_organizaciones)===l})));b(!1)})).catch((function(e){k()}));case 24:return e.abrupt("break",85);case 25:return e.next=27,Ce.a.post("/recommendation/getRecommendationTemplate/search",{filtro:d,type:"badges",id_plantillas:c}).then((function(e){var t;1===m?r(null===(t=e.data)||void 0===t?void 0:t.recommendations):r(e.data.recommendations.filter((function(e){var t;return(null===(t=e.plantillasInsignias)||void 0===t?void 0:t.id_organizaciones)===l})));b(!1)})).catch((function(e){k()}));case 27:return e.abrupt("break",85);case 28:return e.next=30,Ce.a.post("/recommendation/getRecommendationTemplate/search",{filtro:d,type:"certificates",id_plantillas_certificados:c}).then((function(e){var t;1===m?r(null===(t=e.data)||void 0===t?void 0:t.recommendations):r(e.data.recommendations.filter((function(e){var t;return(null===(t=e.plantillasCertificados)||void 0===t?void 0:t.id_organizaciones)===l})));b(!1)})).catch((function(e){k()}));case 30:return e.abrupt("break",85);case 31:return e.next=33,Ce.a.post("/certificateTemplate/search",{filtro:d,type:p,id_organizaciones:l}).then((function(e){if((null===u||void 0===u?void 0:u.isDeparmentCreater)||(null===u||void 0===u?void 0:u.isDeparmentCreaterRoll)){var t,a=null===(t=e.data.certificateTemplates)||void 0===t?void 0:t.filter((function(e){return e.plantillasCertificadosHistorial[0].id_usuarios===(null===u||void 0===u?void 0:u.userId)}));r(a),o(a.length)}else{var n,i,c;r(null===(n=e.data)||void 0===n?void 0:n.certificateTemplates),o(null===(i=e.data)||void 0===i||null===(c=i.certificateTemplates)||void 0===c?void 0:c.length)}b(!1)})).catch((function(e){k()}));case 33:return e.abrupt("break",85);case 34:return e.next=36,Ce.a.post("/certificatesTemplatesGroupsTemplates/getCertificatesTemplatesGroupsTemplates/search",{filtro:d,id_grupos_plantillas:c,estado:1}).then((function(e){var t;1===m?r(null===(t=e.data)||void 0===t?void 0:t.plantillasCertificadosGruposPlantillas):r(e.data.plantillasCertificadosGruposPlantillas.filter((function(e){var t;return(null===(t=e.plantillasCertificados)||void 0===t?void 0:t.id_organizaciones)===l})));b(!1)})).catch((function(e){k()}));case 36:return e.abrupt("break",85);case 37:return e.next=39,Ce.a.post("/certificatesIssued/getIssuedSearch",{id_grupos_certificados_emitidos:c,id_organizaciones:l,filtro:d}).then((function(e){var t;if((null===(t=e.data)||void 0===t?void 0:t.issued.length)>0){var a,n,i,c,s=[];null===(a=e.data)||void 0===a||a.issued[0].certificadosCamposValores.map((function(e){var t,a,n,i,r;48!==(null===(t=e.certificadoCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)&&s.push({id:"".concat(null===(n=e.certificadoCampos)||void 0===n?void 0:n.nombre),label:"".concat(null===(i=e.certificadoCampos)||void 0===i?void 0:i.nombre),align:"center",orden:"".concat(null===(r=e.certificadoCampos)||void 0===r?void 0:r.nombre)})}));var l=j.startColumns.concat(s).concat(j.finalColumns);j.setColumns(l),r(null===(n=e.data)||void 0===n?void 0:n.issued),o(null===(i=e.data)||void 0===i||null===(c=i.issued)||void 0===c?void 0:c.length)}b(!1)})).catch((function(e){k()}));case 39:return e.abrupt("break",85);case 40:return e.next=42,Ce.a.post("/documentTemplate/search",{filtro:d,type:p,id_organizaciones:l}).then((function(e){if((null===u||void 0===u?void 0:u.isDeparmentCreater)||(null===u||void 0===u?void 0:u.isDeparmentCreaterRoll)){var t,a=null===(t=e.data.documentTemplates)||void 0===t?void 0:t.filter((function(e){return e.plantillasDocumentosHistorial[0].id_usuarios===(null===u||void 0===u?void 0:u.userId)}));r(a)}else{var n;r(null===(n=e.data)||void 0===n?void 0:n.documentTemplates)}b(!1)})).catch((function(e){k()}));case 42:return e.abrupt("break",85);case 43:return e.next=45,Ce.a.post("/documentsCollections/getDocumentsCollections/search",{filtro:d,id_organizaciones:l}).then((function(e){var t;r(null===(t=e.data)||void 0===t?void 0:t.documentsCollections),b(!1)})).catch((function(e){k()}));case 45:return e.abrupt("break",85);case 46:return e.next=48,Ce.a.post("/documentsCertify/getDocumentsCertifyByFiles/search",{filtro:d,id_organizaciones:l,id_colecciones_documentos:c}).then((function(e){var t;r(null===(t=e.data)||void 0===t?void 0:t.documentsCertify),b(!1)})).catch((function(e){k()}));case 48:return e.abrupt("break",85);case 49:return e.next=51,Ce.a.post("/carnetTemplate/search",{filtro:d,type:p,id_organizaciones:l}).then((function(e){if((null===u||void 0===u?void 0:u.isDeparmentCreater)||(null===u||void 0===u?void 0:u.isDeparmentCreaterRoll)){var t,a=null===(t=e.data.carnetTemplates)||void 0===t?void 0:t.filter((function(e){return e.plantillasCarnetsHistorial[0].id_usuarios===(null===u||void 0===u?void 0:u.userId)}));r(a),o(a.length)}else{var n,i;r(null===(n=e.data)||void 0===n?void 0:n.carnetTemplates),o(null===(i=e.data)||void 0===i?void 0:i.carnetTemplates.length)}b(!1)})).catch((function(e){k()}));case 51:return e.abrupt("break",85);case 52:return e.next=54,Ce.a.post("/carnetsIssued/getCarnetsIssued/search",{id_grupos_carnets_emitidos:c,id_organizaciones:l,filtro:d}).then((function(e){var t;if((null===(t=e.data)||void 0===t?void 0:t.issued.length)>0){var a,n,i,c,s=[];null===(a=e.data)||void 0===a||a.issued[0].carnetsCamposValores.map((function(e){var t,a,n,i,r;48!==(null===(t=e.carnetCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)&&s.push({id:"".concat(null===(n=e.carnetCampos)||void 0===n?void 0:n.nombre),label:"".concat(null===(i=e.carnetCampos)||void 0===i?void 0:i.nombre),align:"center",orden:"".concat(null===(r=e.carnetCampos)||void 0===r?void 0:r.nombre)})}));var l=j.startColumns.concat(s).concat(j.finalColumns);j.setColumns(l),r(null===(n=e.data)||void 0===n?void 0:n.issued),o(null===(i=e.data)||void 0===i||null===(c=i.issued)||void 0===c?void 0:c.length)}b(!1)})).catch((function(e){k()}));case 54:return e.abrupt("break",85);case 55:return e.next=57,Ce.a.post("/helpCenter/getHelpCenters/search",{filtro:d}).then((function(e){var t;r(null===(t=e.data)||void 0===t?void 0:t.helpCenters),b(!1)})).catch((function(e){k()}));case 57:return e.abrupt("break",85);case 58:return r(a.filter((function(e){var t;return null===(t=e.parametros)||void 0===t?void 0:t.nombre.toLowerCase().includes(d.toLowerCase())}))),b(!1),e.abrupt("break",85);case 61:return e.next=63,Ce.a.post("/permission/getPermissions/search",{filtro:d}).then((function(e){var t;r(null===(t=e.data)||void 0===t?void 0:t.permissions.sort((function(e,t){var a,n,i,r,c,o;return"".concat(null===(a=e.gruposUsuarios)||void 0===a?void 0:a.nombre.toLowerCase()).concat(null===(n=e.acciones)||void 0===n||null===(i=n.modulos)||void 0===i?void 0:i.nombre.toLowerCase())<"".concat(null===(r=t.gruposUsuarios)||void 0===r?void 0:r.nombre.toLowerCase()).concat(null===(c=t.acciones)||void 0===c||null===(o=c.modulos)||void 0===o?void 0:o.nombre.toLowerCase())?-1:1}))),b(!1)})).catch((function(e){k()}));case 63:return e.abrupt("break",85);case 64:return e.next=66,Ce.a.post("/user/getUsers/search",{filtro:d,id_organizaciones:l}).then((function(e){var t,a,n;r(null===(t=e.data)||void 0===t?void 0:t.users),o(null===(a=e.data)||void 0===a||null===(n=a.users)||void 0===n?void 0:n.length),b(!1)})).catch((function(e){k()}));case 66:return e.abrupt("break",85);case 67:return e.next=69,Ce.a.post("/organization/getOrganizations/search",{filtro:d,id:l}).then((function(e){var t,a,n,i;if(1===m)r(null===(t=e.data)||void 0===t?void 0:t.organizations),o(null===(a=e.data)||void 0===a||null===(n=a.organizations)||void 0===n?void 0:n.length);else if((null===(i=e.data)||void 0===i?void 0:i.organizations.length)>0){var c,s,d=null===(c=e.data.organizations)||void 0===c?void 0:c.filter((function(e){return e.id===l}))[0].organizacionesRelaciones.map((function(e){return e.organizacionesRelacionadas})),u=null===(s=e.data.organizations)||void 0===s?void 0:s.filter((function(e){return e.id===l})).concat(d);r(u),o(u.length)}b(!1)})).catch((function(e){k()}));case 69:return e.abrupt("break",85);case 70:return e.next=72,Ce.a.post("/userGroup/organizations/getUserGroupsOrganization/search",{filtro:d}).then((function(e){if(1===m){var t;r(null===(t=e.data)||void 0===t?void 0:t.groups)}else{var a=e.data.groups.filter((function(e){return e.id_organizaciones===l}));r(a)}b(!1)})).catch((function(e){k()}));case 72:return e.abrupt("break",85);case 73:return e.next=75,Ce.a.post("/contract/getContractsCountForOrganizations/search",{filtro:d}).then((function(e){var t;r(null===(t=e.data)||void 0===t?void 0:t.contracts),b(!1)})).catch((function(e){k()}));case 75:return e.abrupt("break",85);case 76:return e.next=78,Ce.a.post("/hability/getHabilities/search",{filtro:d}).then((function(e){var t;r(null===(t=e.data)||void 0===t?void 0:t.habilities),b(!1)})).catch((function(e){k()}));case 78:return e.abrupt("break",85);case 79:return e.next=81,Ce.a.post("/payment/getPayments/search",{id_organizaciones:l,filtro:d}).then((function(e){var t,a;(null===(t=e.data)||void 0===t?void 0:t.payments.length)>0&&r(null===(a=e.data)||void 0===a?void 0:a.payments);b(!1)})).catch((function(e){k()}));case 81:return e.abrupt("break",85);case 82:return r(a.filter((function(e){var t,a,n,i,r,c,o,s,l,u;return(null===(t=e.nombre)||void 0===t?void 0:t.toLowerCase().includes(d.toLowerCase()))||(null===(a=e.organizaciones)||void 0===a?void 0:a.nombre.toLowerCase().includes(d.toLowerCase()))||(null===(n=e.modulos)||void 0===n?void 0:n.nombre.toLowerCase().includes(d.toLowerCase()))||(null===(i=e.vencimiento)||void 0===i?void 0:i.toLowerCase().includes(d.toLowerCase()))||(null===(r=e.codigo)||void 0===r?void 0:r.toLowerCase().includes(d.toLowerCase()))||(null===(c=e.fecha_certificacion)||void 0===c?void 0:c.toLowerCase().includes(d.toLowerCase()))||(null===(o=e.nombre_privado)||void 0===o?void 0:o.toLowerCase().includes(d.toLowerCase()))||(null===(s=e.planes)||void 0===s||null===(l=s.nombre)||void 0===l?void 0:l.toLowerCase().includes(d.toLowerCase()))||(null===e||void 0===e||null===(u=e.valor_estado)||void 0===u?void 0:u.toLowerCase().includes(d.toLowerCase()))||Ne()(e.fecha_inicio).format("DD/MM/YYYY").toLowerCase().includes(d.toLowerCase())||Ne()(e.vencimiento).format("DD/MM/YYYY").toLowerCase().includes(d.toLowerCase())}))),b&&b(!1),e.abrupt("break",85);case 85:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),C=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(""),e.next=3,w(t,"clear");case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),k=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:F.a.fire({icon:"error",iconColor:E.a.primary,text:y("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:3e3}),b(!1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:13===t.charCode&&w(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)("div",{className:v.header,children:[Object(n.jsx)(Te.a,{id:"filtro",label:y("search.search"),variant:"outlined",type:"text",name:"filtro",size:"small",value:O,onChange:function(e){g(e.target.value)},onKeyPress:N,className:v.input,InputProps:{endAdornment:Object(n.jsx)(Rn.a,{position:"end",children:O&&Object(n.jsx)(K.a,{title:y("buttons:buttons.cancel"),children:Object(n.jsx)(S.a,{onClick:function(){return C()},children:Object(n.jsx)(ae.a,{})})})})}}),Object(n.jsx)(K.a,{title:y("search.search"),children:Object(n.jsx)(x.a,{color:"primary",variant:"contained",onClick:w,disableElevation:!0,children:Object(n.jsx)(A.a,{})})})]})})),Un=a(312);var Wn=function(){return Object(n.jsx)(Un.a,{children:Object(n.jsx)("path",{d:"M5,3C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19H5V5H12V3H5M17.78,4C17.61,4 17.43,4.07 17.3,4.2L16.08,5.41L18.58,7.91L19.8,6.7C20.06,6.44 20.06,6 19.8,5.75L18.25,4.2C18.12,4.07 17.95,4 17.78,4M15.37,6.12L8,13.5V16H10.5L17.87,8.62L15.37,6.12Z"})})},Yn=Object(C.a)((function(e){return{large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"}}})),qn=function(e){var t=e.columns,a=e.photo,i=Yn();return Object(n.jsx)(n.Fragment,{children:t.map((function(e,r){return Object(n.jsxs)(_n.a,{children:[1===a&&Object(n.jsxs)(yn.a,{children:[" ",Object(n.jsx)(Be.a,{variant:"circle",children:Object(n.jsx)(g.a,{className:i.large})})," "]}),t.length>0&&t.map((function(e,t){return Object(n.jsx)(yn.a,{children:Object(n.jsx)(Be.a,{})})}))]},r)}))})},Hn=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},table:{cursor:"pointer"}}}));var Kn={changeBreadcrump:I.a},Vn=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"m\xf3dulos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Kn)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=Object(u.g)(),s=Hn(),l=Object(i.useState)([]),m=Object(d.a)(l,2),b=m[0],j=m[1],g=Object(i.useState)([]),v=Object(d.a)(g,2),C=v[0],k=v[1],N=Object(i.useState)([]),B=Object(d.a)(N,2),T=B[0],A=B[1],z=Object(i.useState)([]),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)(!1),U=Object(d.a)(L,2),Y=U[0],q=U[1],H=Object(i.useState)(""),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(""),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(!1),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ce=Object(i.useState)(),oe=Object(d.a)(ce,2),se=oe[0],le=oe[1],de=Object(D.a)(["alerts","tables","buttons","breadCrumps"]),ue=Object(d.a)(de,1)[0];Object(i.useEffect)((function(){me().catch((function(){o.push("/500"),window.location.reload()}))}),[]);var me=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.includes("Leer")){e.next=10;break}return ne(!0),e.next=4,pe();case 4:return e.next=6,je();case 6:c(ue("breadCrumps:breadCrumps.modules",{returnObjects:!0})),ne(!1),e.next=12;break;case 10:o.push("/dashboard"),window.location.reload();case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),be=function(e,t){return{limit:t||10,offset:e?e*t:0}},pe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=be(0,a),e.next=3,Ce.a.post("/module/getModules",r);case 3:c=e.sent,o=c.data,j(null===(t=o.modules)||void 0===t?void 0:t.rows),M(null===(n=o.modules)||void 0===n?void 0:n.rows),le(null===(i=o.modules)||void 0===i?void 0:i.count);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),je=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/action/getActions");case 2:t=e.sent,a=t.data,k(a.actions);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),fe=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ne(!0),i=be(t,a),e.next=4,Ce.a.post("/module/getModules",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(b),Object(p.a)(null===(n=c.modules)||void 0===n?void 0:n.rows.filter((function(e){return!b.find((function(t){return t.id===e.id}))})))),j(o),M(o),ne(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),he=function(e){if(r.includes("Editar"))return Object(n.jsx)(K.a,{title:ue("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return xe(t,e,"edit")},children:Object(n.jsx)(Wn,{})})})},ge=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(K.a,{title:ue("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return xe(t,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})},xe=function(e,t,a){switch(a){case"delete":Oe(t);break;case"create":o.push("/modules/create");break;case"edit":o.push("/modules/edit/".concat(Object(Ie.b)(t)));break;case"view":q(!0),A(C.filter((function(e){return e.id_modulos===t&&e.nombre})))}},Oe=function(e){F.a.fire({text:ue("alerts:alerts.delete-button-module"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ue("buttons:buttons.accept"),cancelButtonText:ue("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ve(e).catch((function(){o.push("/500"),window.location.reload()}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ve=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/module/".concat(t));case 2:a=e.sent,n=a.data,j(b.filter((function(e){return e.id!==t}))),M(b.filter((function(e){return e.id!==t}))),n&&F.a.fire({text:ue("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_e=function(){return ue("tables:table.columns-modules",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:s.button,onClick:function(e){return xe(e,0,"create")},children:Object(n.jsx)("span",{children:ue("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{items:b,setItems:M,loadData:me,setLoading:ne}),Object(n.jsx)(zn,{columns:_e(),rows:se,loading:ae,setDirection:Q,setOrderBy:$,changePagination:fe,children:Object(n.jsx)(vn.a,{children:ae?Object(n.jsx)(qn,{columns:_e(),photo:0}):R.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(R,Object(I.f)(G,Z)).slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsxs)("span",{children:[null===e||void 0===e?void 0:e.acciones.length,Object(n.jsx)(K.a,{title:ue("tables:table.tooltip.view-all"),children:Object(n.jsx)(S.a,{"aria-label":"view",onClick:function(t){return xe(t,e.id,"view")},children:Object(n.jsxs)(Ge.a,{children:[" ",null===e||void 0===e?void 0:e.acciones.length]})})})]})})," ",Object(n.jsx)(yn.a,{align:"center",children:he(null===e||void 0===e?void 0:e.id)}),Object(n.jsx)(yn.a,{align:"center",children:ge(null===e||void 0===e?void 0:e.id)})]},"row".concat(t))}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:ue("tables:table.empty-table")})})}),Object(n.jsx)(O.a,{open:Y,onClose:function(){q(!1)},fullWidth:!1,maxWidth:"xs",children:Object(n.jsx)(_.a,{children:T?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(ie.a,{children:[Object(n.jsxs)(y.a,{children:[Object(n.jsx)(re.a,{children:"Id"}),Object(n.jsx)(w.a,{children:ue("form:actions")})]}),Object(n.jsx)(W.a,{}),T.sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})).map((function(e){return Object(n.jsxs)(y.a,{children:[Object(n.jsx)(wn.a,{children:e.id}),Object(n.jsx)(w.a,{children:e.nombre})]})}))]})}):""})})]})})),Gn=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.5em"},iconMargin:{margin:e.spacing(2)},"a\xf1adir":{marginTop:"1em"},"a\xf1adirButton":{color:"#0056b3",textTransform:"none",transitionProperty:"none","&:hover":{backgroundColor:"white",textDecoration:"underline"}}}}));var Qn={changeBreadcrump:I.a},Jn=Object(s.b)(null,Qn)((function(e){var t=e.changeBreadcrump,a=Gn(),r=Object(u.g)(),c=Object(i.useState)({nombre:""}),o=Object(d.a)(c,2),s=o[0],l=o[1],j=Object(i.useState)([{index:1,action:""}]),g=Object(d.a)(j,2),O=g[0],v=g[1],_=Object(i.useState)(""),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(D.a)(["alerts","tables","buttons","breadCrumps","forms"]),I=Object(d.a)(A,1)[0];Object(i.useEffect)((function(){R().catch((function(){r.push("/500"),window.location.reload()})),e.match.params.id?(z().catch((function(){r.push("/500"),window.location.reload()})),t(I("breadCrumps:breadCrumps.modules-edit",{returnObjects:!0}))):t(I("breadCrumps:breadCrumps.modules-create",{returnObjects:!0}))}),[]);var z=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.get("/module/".concat(a));case 3:n=t.sent,i=n.data,l(i.module),P(i.module);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),P=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/action/getActions",{id_modulos:t.id});case 2:a=e.sent,n=a.data,v(Object(p.a)(n.actions.sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})).map((function(e){return{index:e.id,action:e.nombre}}))));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),R=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/action/getActions");case 2:t=e.sent,a=t.data,C(a.actions[a.actions.length-1].id);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(){T(!1)},L=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:v([].concat(Object(p.a)(O),[{index:w+1,action:""}])),C(w+1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),U=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/permission/getPermissions",{id_acciones:t}).catch((function(){r.push("/500"),window.location.reload()}));case 2:i=e.sent,c=i.data,!(null===(n=c.permissions)||void 0===n?void 0:n.length)>0?1!==O.length?(o=O.filter((function(e){return e.index!==t})),v(o)):(v([{index:w+1,action:""}]),C(w+1)):F.a.fire({icon:"error",iconColor:E.a.primary,text:I("forms:module-error-delete"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}});case 5:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsxs)(_e.a,{className:"p-3",children:[Object(n.jsx)(we.a,{align:"center",component:"h6",variant:"h6",children:I("forms:modules")}),Object(n.jsxs)("form",{className:a.root,onSubmit:function(t){if(t.preventDefault(),T(!B),e.match.params.id){var a=Object(Ie.a)(e.match.params.id);Ce.a.put("/module/".concat(a),Object(m.a)(Object(m.a)({},s),{},{acciones:O})).then((function(e){M(),r.push("/modules"),F.a.fire({icon:"success",iconColor:E.a.primary,text:I("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})})).catch((function(e){M(),F.a.fire({icon:"error",iconColor:E.a.primary,text:I("alerts:alerts.edited-error"),showConfirmButton:!1,timer:1500}),r.push("/500"),window.location.reload()}))}else Ce.a.post("/module/",Object(m.a)(Object(m.a)({},s),{},{acciones:O})).then((function(e){M(),r.push("/modules"),F.a.fire({icon:"success",iconColor:E.a.primary,text:I("alerts:alerts.created"),showConfirmButton:!1,timer:1500})})).catch((function(e){M(),F.a.fire({icon:"error",iconColor:E.a.primary,text:I("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500}),r.push("/500"),window.location.reload()}))},children:[Object(n.jsx)(ye.a,{container:!0,spacing:2,children:Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:Object(n.jsx)(Te.a,{label:I("forms:module-name"),required:!0,variant:"outlined",value:s.nombre,onChange:function(e){l(Object(m.a)(Object(m.a)({},s),{},Object(b.a)({},e.target.name,e.target.value)))},name:"nombre"})})})}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,lg:12,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(we.a,{align:"center",component:"h6",variant:"h6",children:I("forms:actions")})}),O.map((function(e){return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:10,lg:11,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:I("forms:action"),variant:"outlined",name:"action",value:e.action,onChange:function(t){return a=t,n=e.index,O.map((function(e){return e.index===n&&(e[a.target.name]=a.target.value),e})),void v(Object(p.a)(O));var a,n}})})},e.id),Object(n.jsx)(ye.a,{item:!0,xs:2,lg:1,children:Object(n.jsx)(K.a,{title:I("forms:action-delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",className:a.iconMargin,size:"small",onClick:function(t){return U(e.index)},children:Object(n.jsx)(ae.a,{fontSize:"small"})})})},e.id)]})}))]}),Object(n.jsx)("div",{className:"text-right ".concat(a.a\u00f1adir),children:Object(n.jsx)(x.a,{onClick:L,className:a.a\u00f1adirButton,children:I("forms:action-add")})}),Object(n.jsxs)("div",{className:"text-center ".concat(a.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(a.button),type:"submit",children:I("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(a.button),onClick:function(){r.push("/modules")},children:I("buttons:buttons.cancel")})]})]})]})})]})}));var Xn=[{id:"nombre",label:"Nombre",align:"center"},{id:"modulos",label:"M\xf3dulo",align:"center"}],Zn={changeBreadcrump:I.a},$n=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"acciones"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Zn)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=Object(u.g)(),s=Object(i.useState)([]),l=Object(d.a)(s,2),m=l[0],b=l[1],p=Object(i.useState)([]),j=Object(d.a)(p,2),g=j[0],x=j[1];Object(i.useEffect)((function(){r.includes("Leer")?(O(),c([{name:"Ajustes"},{name:"Acciones"}])):(o.push("/dashboard"),window.location.reload())}),[]);var O=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/action/getActions");case 2:t=e.sent,a=t.data,b(a.actions),x(a.actions);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{items:m,setItems:x}),Object(n.jsx)(zn,{columns:Xn,rows:g,children:Object(n.jsx)(vn.a,{children:g.length>0?Object(n.jsx)(n.Fragment,{children:g.slice(t*a,t*a+a).map((function(e,t){var a;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(a=e.modulos)||void 0===a?void 0:a.nombre})]},"row".concat(t))}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:"No hay datos registrados"})})})]})})),ei=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var ti={changeBreadcrump:I.a,changePage:I.b},ai=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"permisos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),ti)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=e.changePage,s=ei(),l=Object(u.g)(),m=Object(i.useState)([]),b=Object(d.a)(m,2),p=b[0],j=b[1],g=Object(i.useState)([]),v=Object(d.a)(g,2),C=v[0],k=v[1],N=Object(i.useState)([]),B=Object(d.a)(N,2),T=B[0],A=B[1],z=Object(i.useState)([]),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)(!1),U=Object(d.a)(L,2),Y=U[0],q=U[1],H=Object(i.useState)(""),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(""),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(!0),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],re={},ce=Object(D.a)(["alerts","tables","buttons","breadCrumps","forms"]),oe=Object(d.a)(ce,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?(se().then((function(){ne(!1)})).catch((function(){l.push("/500"),window.location.reload()})),c(oe("breadCrumps:breadCrumps.permissions",{returnObjects:!0}))):(l.push("/dashboard"),window.location.reload())}),[]);var se=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/permission/getPermissions");case 2:t=e.sent,a=t.data,k(a.permissions.permissions),a.permissions.permissions=a.permissions.permissions.filter((function(e){var t,a,n,i;return!re["".concat(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.id).concat(e.id_grupos)]&&(re["".concat(null===(n=e.acciones)||void 0===n||null===(i=n.modulos)||void 0===i?void 0:i.id).concat(e.id_grupos)]=!0)})),j(a.permissions.permissions.sort((function(e,t){var a,n,i,r,c,o;return"".concat(null===(a=e.gruposUsuarios)||void 0===a?void 0:a.nombre.toLowerCase()).concat(null===(n=e.acciones)||void 0===n||null===(i=n.modulos)||void 0===i?void 0:i.nombre.toLowerCase())<"".concat(null===(r=t.gruposUsuarios)||void 0===r?void 0:r.nombre.toLowerCase()).concat(null===(c=t.acciones)||void 0===c||null===(o=c.modulos)||void 0===o?void 0:o.nombre.toLowerCase())?-1:1}))),A(a.permissions.permissions.sort((function(e,t){var a,n,i,r,c,o;return"".concat(null===(a=e.gruposUsuarios)||void 0===a?void 0:a.nombre.toLowerCase()).concat(null===(n=e.acciones)||void 0===n||null===(i=n.modulos)||void 0===i?void 0:i.nombre.toLowerCase())<"".concat(null===(r=t.gruposUsuarios)||void 0===r?void 0:r.nombre.toLowerCase()).concat(null===(c=t.acciones)||void 0===c||null===(o=c.modulos)||void 0===o?void 0:o.nombre.toLowerCase())?-1:1})));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(e,t,a){switch(a){case"delete":de(t);break;case"create":l.push("/permissions/create");break;case"edit":l.push("/permissions/edit/".concat(Object(Ie.b)(t)))}},de=function(e){F.a.fire({text:oe("alerts:alerts.delete-button-permission"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:oe("buttons:buttons.accept"),cancelButtonText:oe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ue(e).catch((function(){l.push("/500"),window.location.reload()}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ue=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/permission/".concat(t));case 2:a=e.sent,n=a.data,j(p.filter((function(e){return e.id!==t}))),A(p.filter((function(e){return e.id!==t}))),n&&F.a.fire({text:oe("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),me=function(e){if(r.includes("Editar"))return Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return le(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})},be=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return le(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})},pe=function(e,t){var a;return a=C.filter((function(a){var n,i;return a.id_grupos===t&&(null===(n=a.acciones)||void 0===n||null===(i=n.modulos)||void 0===i?void 0:i.id)===e})).length,Object(n.jsxs)(yn.a,{align:"center",children:[a,Object(n.jsx)(K.a,{title:oe("buttons:tooltips.view-actions"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(a){return je(a,e,t)},children:Object(n.jsx)(Ge.a,{})})})]})},je=function(e,t,a){q(!0),M(C.filter((function(e){var n,i;return e.id_grupos===a&&(null===(n=e.acciones)||void 0===n||null===(i=n.modulos)||void 0===i?void 0:i.id)===t})).sort((function(e,t){var a,n;return(null===(a=e.acciones)||void 0===a?void 0:a.nombre.toLowerCase())<(null===(n=t.acciones)||void 0===n?void 0:n.nombre.toLowerCase())?-1:1})))},fe=function(){return oe("tables:table.columns-permissions",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:s.button,onClick:function(e){return le(0,0,"create")},children:Object(n.jsx)("span",{children:oe("buttons:buttons.to-manage")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"Permissions",items:p,setItems:A,loadData:se,setLoading:ne,changePage:o}),Object(n.jsx)(zn,{columns:fe(),rows:T,setDirection:Q,setOrderBy:$,children:Object(n.jsx)(vn.a,{children:ae?Object(n.jsx)(qn,{columns:fe(),photo:0}):T.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(T,Object(I.f)(G,Z)).slice(t*a,t*a+a).map((function(e,t){var a,i,r,c,o,s,l,d;return Object(n.jsxs)(_n.a,{children:[Object(n.jsxs)(yn.a,{align:"center",children:[null===(a=e.gruposUsuarios)||void 0===a?void 0:a.nombre,null!==(null===(i=e.gruposUsuarios)||void 0===i?void 0:i.id_organizaciones)?" - ".concat(null===(r=e.gruposUsuarios)||void 0===r||null===(c=r.organizaciones)||void 0===c?void 0:c.nombre):""]}),Object(n.jsx)(yn.a,{align:"center",children:null===(o=e.acciones)||void 0===o||null===(s=o.modulos)||void 0===s?void 0:s.nombre}),pe(null===(l=e.acciones)||void 0===l||null===(d=l.modulos)||void 0===d?void 0:d.id,e.id_grupos),Object(n.jsx)(yn.a,{align:"center",children:me(null===e||void 0===e?void 0:e.id)}),Object(n.jsx)(yn.a,{align:"center",children:be(e.id)})]},"row".concat(t))}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"5",children:oe("tables:table.empty-table")})})}),Object(n.jsx)(O.a,{open:Y,onClose:function(){q(!1)},fullWidth:!1,maxWidth:"xs",children:Object(n.jsx)(_.a,{children:R?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(ie.a,{children:[Object(n.jsx)(y.a,{children:Object(n.jsx)(w.a,{children:oe("forms:actions")})}),Object(n.jsx)(W.a,{}),R.map((function(e){var t;return Object(n.jsx)(y.a,{children:Object(n.jsx)(w.a,{children:null===(t=e.acciones)||void 0===t?void 0:t.nombre})})}))]})}):""})})]})})),ni=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},mySwal:{zIndex:3e3}}}));var ii={changeBreadcrump:I.a,changePage:I.b},ri=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"usuarios"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,superAdmin:"Super administrador"===e.user.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios.nombre}}),ii)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.superAdmin,m=e.changePage,b=ni(),j=Object(u.g)(),g=Object(i.useState)([]),v=Object(d.a)(g,2),C=v[0],k=v[1],N=Object(i.useState)([]),B=Object(d.a)(N,2),T=B[0],A=B[1],z=Object(i.useState)(""),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)(""),U=Object(d.a)(L,2),Y=U[0],q=U[1],H=Object(i.useState)(!0),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!1),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)([]),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ce=Object(i.useState)(),oe=Object(d.a)(ce,2),se=oe[0],le=oe[1],de=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),ue=Object(d.a)(de,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?(pe().then((function(){Q(!1)})).catch((function(){j.push("/500"),window.location.reload()})),c(ue("breadCrumps:breadCrumps.settings-users",{returnObjects:!0}))):(j.push("/dashboard"),window.location.reload())}),[]);var me=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,be=function(e,t){var a={limit:t||10,offset:e?e*t:0};return me||(a.id_organizaciones=s),a},pe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=be(0,a),e.next=3,Ce.a.post("/user/getUsers",r);case 3:c=e.sent,o=c.data,k(null===(t=o.users)||void 0===t?void 0:t.rows),A(null===(n=o.users)||void 0===n?void 0:n.rows),le(null===(i=o.users)||void 0===i?void 0:i.count);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),je=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(!0),i=be(t,a),e.next=4,Ce.a.post("/user/getUsers",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(C),Object(p.a)(null===(n=c.users)||void 0===n?void 0:n.rows.filter((function(e){return!C.find((function(t){return t.id===e.id}))})))),k(o),A(o),Q(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),fe=function(e,t,a){switch(a){case"delete":he(t);break;case"edit":j.push("/users/edit/".concat(Object(Ie.b)(t)));break;case"create":j.push("/users/create");break;case"view":$(!0),ne(T.filter((function(e){return e.id===t})));break;case"uncombine":xe(t)}},he=function(e){F.a.fire({text:ue("alerts:alerts.delete-button-user"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ue("buttons:buttons.accept"),cancelButtonText:ue("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ge(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ge=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/user/".concat(t));case 3:a=e.sent,n=a.data,k(C.filter((function(e){return e.id!==t}))),A(C.filter((function(e){return e.id!==t}))),n&&F.a.fire({text:ue("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(0),F.a.fire({text:ue("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),j.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t){return e.apply(this,arguments)}}(),xe=function(e){F.a.fire({customClass:{container:b.mySwal},text:"\xbfEst\xe1 seguro que desea descombinar este usuario?",icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:ue("buttons:buttons.accept"),cancelButtonText:ue("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Oe(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Oe=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.post("/user/uncombine",{correo:t}).then((function(){F.a.fire({customClass:{container:b.mySwal},text:"Cuentas descombinadas exitosamente.",icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),window.location.reload()}));case 3:e.next=10;break;case 5:e.prev=5,e.t0=e.catch(0),F.a.fire({customClass:{container:b.mySwal},text:"No se pudo descombinar.",icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),j.push("/500"),window.location.reload();case 10:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}(),ve=function(e){if(r.includes("Editar"))return Object(n.jsx)(K.a,{title:ue("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return fe(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})},_e=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(K.a,{title:ue("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return fe(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})},ye=function(){return ue(l?"tables:table.columns-users-super":"tables:table.columns-users",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:b.button,onClick:function(e){return fe(0,0,"create")},children:Object(n.jsx)("span",{children:ue("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"users",items:C,changePage:m,setItems:A,setCountItems:le,loadData:pe,setLoading:Q,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,userGroupId:o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios}),Object(n.jsx)(zn,{columns:ye(),rows:se,setDirection:M,setOrderBy:q,changePagination:je,children:Object(n.jsx)(vn.a,{children:G?Object(n.jsx)(qn,{columns:ye(),photo:0}):T.sort((function(e,t){return e.id<t.id?1:-1})).length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(T,Object(I.f)(R,Y)).slice(t*a,t*a+a).map((function(e,t){var a,i,r,c,o;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.primer_nombre," ").concat(e.segundo_nombre||"")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.primer_apellido," ").concat(e.segundo_apellido||"")}),Object(n.jsx)(yn.a,{align:"center",children:(null===(a=e.cuentas[0])||void 0===a?void 0:a.correo)||""}),Object(n.jsx)(yn.a,{align:"center",children:null===(i=e.gruposUsuariosOrganizaciones[0])||void 0===i||null===(r=i.gruposUsuarios)||void 0===r?void 0:r.nombre}),l&&Object(n.jsx)(yn.a,{align:"center",children:(null===(c=e.gruposUsuariosOrganizaciones[0])||void 0===c||null===(o=c.organizaciones)||void 0===o?void 0:o.nombre)||ue("tables:table.without-organization")}),Object(n.jsxs)(yn.a,{align:"center",children:[e.cuentas.length,Object(n.jsx)(K.a,{title:ue("tables:table.tooltip.view-accounts"),children:Object(n.jsx)(S.a,{"aria-label":"view",onClick:function(t){return fe(0,e.id,"view")},children:Object(n.jsx)(Ge.a,{})})})]}),Object(n.jsx)(yn.a,{align:"center",children:ve(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:_e(e.id)})]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:ue("tables:table.empty-table")})})})}),Object(n.jsx)(O.a,{open:Z,onClose:function(){$(!1)},fullWidth:!1,maxWidth:"xs",children:Object(n.jsx)(_.a,{children:ae?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(ie.a,{children:[Object(n.jsxs)(y.a,{children:[Object(n.jsx)(re.a,{children:"N\xb0"}),Object(n.jsxs)(w.a,{children:[ue("dialogs:dialog.accounts"),"."]}),Object(n.jsx)(re.a,{})]}),Object(n.jsx)(W.a,{}),ae.map((function(e){return e.cuentas.map((function(e,t){return Object(n.jsxs)(y.a,{children:[Object(n.jsx)(wn.a,{children:t+1}),Object(n.jsx)(w.a,{children:e.correo}),l&&Object(n.jsx)(wn.a,{children:0!==t&&Object(n.jsx)(K.a,{title:"Descombinar",children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return fe(0,e.correo,"uncombine")},children:Object(n.jsx)(Cn.a,{})})})})]})}))}))]})}):""})})]})})),ci=a(1170),oi=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},container__avatar:{"& img":{height:"100%",objectFit:"contain"}}}}));var si={changePage:I.b,changeBreadcrump:I.a},li=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"organizaciones"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),si)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.changePage,m=oi(),b=Object(u.g)(),j=Object(i.useState)([]),O=Object(d.a)(j,2),v=O[0],_=O[1],y=Object(i.useState)([]),w=Object(d.a)(y,2),C=w[0],k=w[1],N=Object(i.useState)(""),B=Object(d.a)(N,2),T=B[0],A=B[1],z=Object(i.useState)(""),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)(!0),U=Object(d.a)(L,2),W=U[0],Y=U[1],q=Object(i.useState)(),H=Object(d.a)(q,2),V=H[0],G=H[1],Q=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),J=Object(d.a)(Q,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?(X(),c(J("breadCrumps:breadCrumps.settings-organizations",{returnObjects:!0}))):(b.push("/dashboard"),window.location.reload())}),[]);var X=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Y(!0),e.next=3,ee().then((function(){Y(!1)})).catch((function(){b.push("/500"),window.location.reload()}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Z=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,$=function(e,t){var a={limit:t||10,offset:e?e*t:0};return Z||(a.id=s),a},ee=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i,r,c,o,l,d,u,m;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=$(0,a),e.next=3,Ce.a.post("/organization/getOrganizations",t);case 3:n=e.sent,i=n.data,Z?(_(null===(r=i.organizations)||void 0===r?void 0:r.rows),k(null===(c=i.organizations)||void 0===c?void 0:c.rows),G(null===(o=i.organizations)||void 0===o?void 0:o.count)):(u=null===(l=i.organizations)||void 0===l?void 0:l.rows.filter((function(e){return e.id===s}))[0].organizacionesRelaciones.map((function(e){return e.organizacionesRelacionadas})),m=null===(d=i.organizations)||void 0===d?void 0:d.rows.filter((function(e){return e.id===s})).concat(u),_(m),k(m),G(m.length));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),te=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Y(!0),i=$(t,a),e.next=4,Ce.a.post("/organization/getOrganizations",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(v),Object(p.a)(null===(n=c.organizations)||void 0===n?void 0:n.rows.filter((function(e){return!v.find((function(t){return t.id===e.id}))})))),_(o),k(o),Y(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),ae=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getIssuedBadge",{id:t});case 2:return a=e.sent,n=a.data,e.abrupt("return",n.issuedBadge);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ne=function(e,t,a){switch(a){case"delete":re(t);break;case"aprove":ie(t);break;case"edit":b.push("/organizations/edit/".concat(Object(Ie.b)(t)));break;case"create":b.push("/organizations/create")}},ie=function(e){F.a.fire({text:J("alerts:alerts.aprove-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:J("buttons:buttons.accept"),cancelButtonText:J("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ce(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},re=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae(t).catch((function(){b.push("/500"),window.location.reload()}));case 2:null!==e.sent?F.a.fire({icon:"error",iconColor:E.a.primary,text:J("alerts:alerts.organization-issue-error"),showConfirmButton:!1,timer:2500}):F.a.fire({text:J("alerts:alerts.delete-button-organization"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:J("buttons:buttons.accept"),cancelButtonText:J("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.value&&oe(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ce=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/acceptOrganization/".concat(t)).catch((function(){b.push("/500"),window.location.reload()}));case 2:a=e.sent,a.data&&F.a.fire({text:J("alerts:alerts.aproved"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){X()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),oe=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/organization/".concat(t));case 3:a=e.sent,!1===a.data.organizationId.success?F.a.fire({text:"No se puede eliminar la organizacion porque ya tiene usuarios asignados",icon:"error",showConfirmButton:!1,timer:1500,iconColor:E.a.primary}):(_(v.filter((function(e){return e.id!==t}))),k(v.filter((function(e){return e.id!==t}))),F.a.fire({text:J("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})),e.next=13;break;case 8:e.prev=8,e.t0=e.catch(0),F.a.fire({text:J("alerts:alerts.deleted-error"),icon:"error",showConfirmButton:!1,timer:1500,iconColor:E.a.primary}),b.push("/500"),window.location.reload();case 13:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),se=function(e){if(r.includes("Editar"))return Object(n.jsx)(K.a,{title:J("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return ne(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})},le=function(e){if(Z)return Object(n.jsx)(K.a,{title:J("tables:table.tooltip.aprove"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return ne(0,e,"aprove")},className:m.iconButton,children:Object(n.jsx)(ci.a,{})})})},de=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(K.a,{title:J("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return ne(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})},ue=function(){return J("tables:table.columns-organizations",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:m.button,onClick:function(e){return ne(0,0,"create")},children:Object(n.jsx)("span",{children:J("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"organizations",items:v,setItems:k,setCountItems:G,changePage:l,loadData:ee,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,userGroupId:o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,setLoading:Y}),Object(n.jsx)(zn,{columns:ue(),rows:V,setDirection:A,setOrderBy:M,loading:W,changePagination:te,children:Object(n.jsx)(vn.a,{children:W?Object(n.jsx)(qn,{columns:ue(),photo:0}):C.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(C,Object(I.f)(T,R)).slice(t*a,t*a+a).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:e.identificacion}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:null===e||void 0===e?void 0:e.linkPhoto,className:m.container__avatar})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.telefono}),Object(n.jsx)(yn.a,{align:"center",children:e.direccion}),Object(n.jsx)(yn.a,{align:"center",children:e.sitio_web}),Object(n.jsx)(yn.a,{align:"center",children:e.estado?J("tables:table.state.approved"):J("tables:table.state.pending")}),Object(n.jsx)(yn.a,{align:"center",children:e.estado?"":le(Object(Ie.b)(e.id))}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:"Ver DashBoard",children:Object(n.jsx)(Mt.a,{href:"/organization/".concat(e.url_perfil),target:"_blank",rel:"noreferrer",children:Object(n.jsx)(S.a,{children:Object(n.jsx)(Ge.a,{})})})})}),Object(n.jsx)(yn.a,{align:"center",children:se(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:de(e.id)})]},e.id)}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:J("tables:table.empty-table")})})})]})})),di=a(1115),ui=a(1171),mi=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.1em",padding:"10px 40px"},input:{display:"none"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},avatar:{padding:5,width:"auto",height:"auto"},icon:{fontSize:"4em"},small:{width:e.spacing(4),height:e.spacing(4)},"a\xf1adir":{marginTop:"1em",marginRight:"5rem"},iconMargin:{margin:e.spacing(2)},"a\xf1adirButton":{color:"#0056b3",textTransform:"none",transitionProperty:"none","&:hover":{backgroundColor:"white",textDecoration:"underline"}}}}));var bi={changeBreadcrump:I.a},pi=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),bi)((function(e){var t,a,r,c,o=e.organizationId,s=e.changeBreadcrump,l=e.user,j=Object(u.g)(),O=mi(),v=Object(i.useState)({identificacion:"",nombre:"",logo:null,telefono:"",celular:"",correo:"",direccion:"",sitio_web:"",biografia:"",id_paises:null,id_ciudades:null,url_perfil:"",prefijo_telefono:null,img_prev:"",id_organizaciones:o===je.a.idCmlogica||o===je.a.idOrquidea?o:"",email_usuario:(null===l||void 0===l||null===(t=l.data_user)||void 0===t||null===(a=t.gruposUsuariosOrganizaciones[0])||void 0===a?void 0:a.id_organizaciones)?"":null===l||void 0===l||null===(r=l.data_user)||void 0===r||null===(c=r.cuentas[0])||void 0===c?void 0:c.correo}),_=Object(d.a)(v,2),y=_[0],w=_[1],C=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps","users"]),k=Object(d.a)(C,1)[0],N=Object(i.useState)(!1),B=Object(d.a)(N,2),A=B[0],I=B[1],z=Object(i.useState)([]),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)([]),U=Object(d.a)(L,2),W=U[0],q=U[1],H=Object(i.useState)([{index:1,id_redes_sociales:"",link:""}]),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)([]),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)([]),te=Object(d.a)(ee,2),ne=te[0],ie=te[1],re=new RegExp(/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/);Object(i.useEffect)((function(){ce().catch((function(){j.push("/500"),window.location.reload()}))}),[]);var ce=function(){var t=Object(h.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,se();case 2:return t.next=4,le();case 4:if(ie(""),!e.match.params.id){t.next=11;break}return t.next=8,oe();case 8:s(k("breadCrumps:breadCrumps.settings-organizations-edit",{returnObjects:!0})),t.next=12;break;case 11:s(k("breadCrumps:breadCrumps.settings-organizations-create",{returnObjects:!0}));case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();Object(i.useEffect)((function(){de(y.id_paises).catch((function(){j.push("/500"),window.location.reload()}))}),[y.id_paises]);var oe=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.get("/organization/".concat(a));case 3:if(n=t.sent,i=n.data,r=i.organization,c=r.organizations,o=r.socialNetworkUserOrganizations,w(Object(m.a)(Object(m.a)({},c),{},{logo:null===c||void 0===c?void 0:c.linkPhoto,img_prev:null===c||void 0===c?void 0:c.linkPhoto})),(null===o||void 0===o?void 0:o.length)>0&&((s=o.filter((function(e){return e.link!==c.sitio_web}))).length>0?Q(s.map((function(e,t){return{index:t,id_redes_sociales:e.id_redes_sociales,user_name:e.username,icono:e.linkIcons,link:e.link}}))):Q([{index:1,id_redes_sociales:"",link:"",icono:""}])),!c.id_paises){t.next=14;break}return t.next=11,me(c.id_paises).catch((function(){j.push("/500"),window.location.reload()}));case 11:l=t.sent,d=l.find((function(e){return e.id===c.id_ciudades})),ie("(".concat(d.prefijo_telefono,")"));case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),se=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCountries");case 2:t=e.sent,a=t.data,M(a.countries);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/socialNetworks/getSocialNetworks");case 2:return t=e.sent,a=t.data,q(a.socialNetworks),e.abrupt("return",a.socialNetworks);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),de=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=8;break}return e.next=3,Ce.a.post("/others/getCities",{idPais:t});case 3:a=e.sent,n=a.data,$(n.cities),e.next=9;break;case 8:$([""]);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ue=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getNit",{identificacion:t});case 2:return a=e.sent,n=a.data,e.abrupt("return",n.nit);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),me=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCities",{idPais:t});case 2:return a=e.sent,n=a.data,e.abrupt("return",n.cities);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),be=function(e){w(Object(m.a)(Object(m.a)({},y),{},Object(b.a)({},e.target.name,e.target.value)))},pe=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==t.target.value){e.next=5;break}w(Object(m.a)(Object(m.a)({},y),{},Object(b.a)({},t.target.name,t.target.value))),ie(""),e.next=11;break;case 5:return w(Object(m.a)(Object(m.a)({},y),{},Object(b.a)({},t.target.name,t.target.value))),e.next=8,me(y.id_paises).catch((function(){j.push("/500"),window.location.reload()}));case 8:a=e.sent,(n=a.find((function(e){return e.id===t.target.value}))).prefijo_telefono?ie("(".concat(n.prefijo_telefono,")")):ie("");case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),fe=function(e,t){"id_redes_sociales"===e.target.name&&(G[t].icono=W.find((function(t){return t.id===e.target.value})).linkIcons),G[t][e.target.name]=e.target.value,Q(Object(p.a)(G))},he=function(){I(!1)},ge=G.filter((function(e){if("link"in e&&2!==e.id_redes_sociales&&6!==e.id_redes_sociales)return!re.test(e.link)&&0!==e.link.length})),xe=function(){var t=Object(h.a)(f.a.mark((function t(a){var n,i,r,c,o,s,l,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a.preventDefault(),I(!A),n="",!y.identificacion){t.next=7;break}return t.next=6,ue(y.identificacion).catch((function(e){j.push("/500"),window.location.reload()}));case 6:n=t.sent;case 7:ge.length>0?(I(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:k("alerts:alerts.url-social-invalid"),showConfirmButton:!1,timer:1500})):("",i="".validador,r="".mensage,G.map((function(e,t){if(""===e.id_redes_sociales&&""!==e.link&&(i=!1,r=k("alerts:alerts.select-social-network")),""===e.link&&""!==e.id_redes_sociales&&(i=!1,r=k("alerts:alerts.link-social-network")),2!==e.id_redes_sociales||e.link.includes("https://"))if(6!==e.id_redes_sociales||e.link.includes("https://")){if(e.link.includes("https://")||(G[t].link="https://".concat(e.link)),e.link.includes("twitter")){var a=e.link.split("https://twitter.com/");return e.user_name="@".concat(a[1]),e}}else if(e.link.includes("@")){var n=e.link.split("@");G[t].link="https://telegram.me/".concat(n[1])}else G[t].link="https://telegram.me/".concat(e.link);else G[t].link="https://api.whatsapp.com/send?phone=".concat(e.link)})),!1===i?(I(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:"".concat(r),showConfirmButton:!1,timer:1500})):!re.test(y.sitio_web)&&y.sitio_web?(I(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:k("alerts:alerts.url-website-error"),showConfirmButton:!1,timer:1500})):(!y.sitio_web||y.sitio_web.includes("https://")||y.sitio_web.includes("http://")||(y.sitio_web="https://".concat(y.sitio_web)),y.logo?e.match.params.id?(l=Object(Ie.a)(e.match.params.id),(d=new FormData).append("file",y.logo),Ce.a.put("/organization/".concat(l),Object(m.a)(Object(m.a)({},y),{},{logo:null===(s=y.logo)||void 0===s?void 0:s.name,redesSociales:G})).then((function(e){if(y.logo.name){var t=Pe()("certika-organization-".concat(l)).toString();ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-organization-image/").concat(t),headers:{"Content-Type":"multipart/form-data"},data:d}).then((function(){he(),j.push("/organizations"),F.a.fire({icon:"success",iconColor:E.a.primary,text:k("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})}))}else he(),j.push("/organizations"),F.a.fire({icon:"success",iconColor:E.a.primary,text:k("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})})).catch((function(e){he(),F.a.fire({icon:"error",iconColor:E.a.primary,text:k("alerts:alerts.edited-error"),showConfirmButton:!1,timer:1500}),j.push("/500"),window.location.reload()}))):((c=new FormData).append("file",y.logo),y.identificacion&&null!==n?F.a.fire({icon:"error",iconColor:E.a.primary,text:k("alerts:alerts.nit-error"),showConfirmButton:!1,timer:2500}):Ce.a.post("/organization/",Object(m.a)(Object(m.a)({},y),{},{logo:null===(o=y.logo)||void 0===o?void 0:o.name,redesSociales:G})).then((function(e){var t;if(null===(t=y.logo)||void 0===t?void 0:t.name){var a=Pe()("certika-organization-".concat(e.data.organizationId.id)).toString();ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-organization-image/").concat(a),headers:{"Content-Type":"multipart/form-data"},data:c}).then((function(){he(),j.push("/organizations"),F.a.fire({icon:"success",iconColor:E.a.primary,text:k("alerts:alerts.created"),showConfirmButton:!1,timer:1500})}))}else he(),j.push("/organizations"),F.a.fire({icon:"success",iconColor:E.a.primary,text:k("alerts:alerts.created"),showConfirmButton:!1,timer:1500})})).catch((function(e){he(),F.a.fire({icon:"error",iconColor:E.a.primary,text:k("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500}),j.push("/500"),window.location.reload()}))):F.a.fire({icon:"error",iconColor:E.a.primary,text:k("alerts:alerts.logo-error"),showConfirmButton:!1,timer:1500})));case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Oe=function(e,t){var a=String(e.target.value);/^([1-9][0-9]*(?:[\.][0-9]*)?|\.[0-9]+)$/.test(a)||2!==t||(e.target.value=a.substr(a.length))};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:O.root,onSubmit:xe,children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:k("users:organization.logo")}),Object(n.jsxs)(ye.a,{container:!0,spacing:4,className:O.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:Object(n.jsx)(g.a,{alt:"img-prev",src:y.img_prev,variant:"rounded",className:O.avatar,children:Object(n.jsx)(ui.a,{sx:{fontSize:"4em"}})})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:7,children:[Object(n.jsx)(we.a,{variant:"body2",className:O.text,children:k("users:users.message-photo")}),Object(n.jsx)("input",{accept:"image/*",className:O.input,id:"contained-button-file",name:"logo",type:"file",onChange:function(e){return function(e){var t=e.target.files[0];w(Object(m.a)(Object(m.a)({},y),{},{logo:t,img_prev:URL.createObjectURL(t)}))}(e)}}),Object(n.jsx)("label",{htmlFor:"contained-button-file",children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"outlined",component:"span",className:O.button,children:k("buttons:buttons.upload-logo")})})]})]}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:k("users:organization.nit"),variant:"outlined",name:"identificacion",value:y.identificacion,onChange:be,disabled:e.match.params.id>0})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:k("users:organization.name"),variant:"outlined",name:"nombre",value:y.nombre,onChange:be})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:k("users:users.email"),variant:"outlined",name:"correo",type:"email",value:y.correo,onChange:be})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:k("users:organization.address"),variant:"outlined",name:"direccion",value:y.direccion,onChange:be})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:k("users:users.biography"),name:"biografia",value:y.biografia,variant:"outlined",size:"small",multiline:!0,rows:4,onChange:be})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsxs)(di.a,{children:[k("users:users.country")," *"]}),Object(n.jsxs)(T.a,{id:"pais",name:"id_paises",required:!0,label:k("users:users.country"),onChange:function(e){var t;(ie(""),""===e.target.value)?w(Object(m.a)(Object(m.a)({},y),{},Object(b.a)({},e.target.name,e.target.value))):w(Object(m.a)(Object(m.a)({},y),{},(t={},Object(b.a)(t,e.target.name,e.target.value),Object(b.a)(t,"id_ciudades",""),t)))},value:e.match.params.id?y.id_paises+"":y.id_paises,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:k("selects:selects-autocompletes.select-option")})}),R.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},e.id)}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsxs)(di.a,{id:"ciudadesLabel",children:[k("users:users.city")," *"]}),Object(n.jsxs)(T.a,{id:"ciudades",name:"id_ciudades",required:!0,labelId:"ciudadesLabel",value:e.match.params.id?y.id_ciudades+"":y.id_ciudades,onChange:pe,label:k("users:users.city"),children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:k("selects:selects-autocompletes.select-option")})}),Z.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},e.id)}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:k("users:users.phone"),variant:"outlined",name:"telefono",type:"number",value:"".concat(y.telefono),onChange:be,onKeyUp:function(e){return Oe(e,2)},InputProps:ne?{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:ne})}:""})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:k("users:users.cellphone"),variant:"outlined",name:"celular",type:"number",value:"".concat(y.celular),onChange:be,onKeyUp:function(e){return Oe(e,2)}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:k("users:users.web-site"),variant:"outlined",name:"sitio_web",placeholder:"https://",value:y.sitio_web,onChange:be,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:Object(n.jsx)(g.a,{alt:"Remy Sharp",src:Da,className:O.small})})}})})})]}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:O.root,children:k("users:organization.social-media")}),G.map((function(e,t){return Object(n.jsxs)(ye.a,{container:!0,spacing:1,className:O.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:2,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{id:"redesSocialesLabel",children:k("selects:selects-autocompletes.social-network-select")}),Object(n.jsxs)(T.a,{id:"redesSociales",name:"id_redes_sociales",labelId:"redesSocialesLabel",value:e.id_redes_sociales,onChange:function(e){return fe(e,t)},label:"Redes sociales",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:k("selects:selects-autocompletes.select-option")})}),W.filter((function(e){return"Link"!==e.nombre})).sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})).map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},e.id)}))]})]})},"red-social-".concat(t)),Object(n.jsx)(ye.a,{item:!0,xs:3===e.id_redes_sociales?5:9,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:2===e.id_redes_sociales?k("users:organization.number-wpp"):6===e.id_redes_sociales?k("users:organization.name-user"):k("users:organization.url-social"),variant:"outlined",name:"link",placeholder:2===e.id_redes_sociales?k("users:organization.number-wpp"):6===e.id_redes_sociales?k("users:organization.name-user"):"https://",value:2===e.id_redes_sociales?e.link.split("=")[1]:6===e.id_redes_sociales?e.link.split("me/")[1]:e.link,onChange:function(e){return fe(e,t)},onKeyUp:function(t){return Oe(t,e.id_redes_sociales)},InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:e.icono?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(g.a,{alt:"Remy Sharp",src:e.icono,className:O.small})}):Object(n.jsx)("span",{children:" "})})}})})},"link-red-social-".concat(t)),3===e.id_redes_sociales&&Object(n.jsx)(ye.a,{item:!0,xs:4,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Usuario",variant:"outlined",name:"user_name",placeholder:"Usuario",value:e.user_name,onChange:function(e){return fe(e,t)}})})},"user-name".concat(t)),Object(n.jsx)(ye.a,{item:!0,xs:1,children:Object(n.jsx)(K.a,{title:"Eliminar Red Social",children:Object(n.jsx)(S.a,{"aria-label":"delete",className:O.iconMargin,size:"small",onClick:function(t){return function(e,t){if(1!==G.length){var a=G.filter((function(t){return t.index!==e}));Q(a)}else Q([{index:1,id_redes_sociales:"",link:""}])}(e.index)},children:Object(n.jsx)(ae.a,{fontSize:"small"})})})},"delete-red-social-".concat(t))]},"grid-red-social-".concat(t))})),Object(n.jsx)("div",{className:"text-right ".concat(O.a\u00f1adir),children:Object(n.jsx)(x.a,{onClick:function(){var e=G[G.length-1];Q([].concat(Object(p.a)(G),[{index:e.index+1,id_redes_sociales:"",link:""}]))},className:O.a\u00f1adirButton,children:k("users:organization.add-social-media")})}),Object(n.jsxs)("div",{className:"text-center ".concat(O.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(O.button),type:"submit",children:k("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(O.button),onClick:function(){j.push("/organizations")},children:k("buttons:buttons.cancel")})]})]})})})]})})),ji=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var fi={changePage:I.b,changeBreadcrump:I.a},hi=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"grupos usuarios organizaciones"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),fi)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.changePage,m=ji(),b=Object(u.g)(),j=Object(i.useState)([]),g=Object(d.a)(j,2),O=g[0],v=g[1],_=Object(i.useState)([]),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(i.useState)(""),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)(""),z=Object(d.a)(A,2),P=z[0],R=z[1],M=Object(i.useState)(!0),L=Object(d.a)(M,2),U=L[0],W=L[1],Y=Object(i.useState)(),q=Object(d.a)(Y,2),H=q[0],V=q[1],G=Object(D.a)(["alerts","tables","buttons","breadCrumps"]),Q=Object(d.a)(G,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?(Z().then((function(){W(!1)})).catch((function(){b.push("/500"),window.location.reload()})),c(Q("breadCrumps:breadCrumps.user-groups-organizations",{returnObjects:!0}))):(b.push("/dashboard"),window.location.reload())}),[]);var J=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,X=function(e,t){var a={limit:t||10,offset:e?e*t:0};return J||(a.id_organizaciones=s),a},Z=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=X(0,a),e.next=3,Ce.a.post("/userGroup/organizations/getUserGroupsOrganization",n);case 3:i=e.sent,r=i.data,v(r.groups.rows),C(r.groups.rows),V(null===(t=r.groups)||void 0===t?void 0:t.count);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return W(!0),i=X(t,a),e.next=4,Ce.a.post("/userGroup/organizations/getUserGroupsOrganization",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(O),Object(p.a)(null===(n=c.groups)||void 0===n?void 0:n.rows.filter((function(e){return!O.find((function(t){return t.id===e.id}))})))),v(o),C(o),W(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),ee=function(e,t,a){switch(a){case"delete":te(t);break;case"edit":b.push("/userGroupsOrganization/edit/".concat(Object(Ie.b)(t)));break;case"create":b.push("/userGroupsOrganization/create")}},te=function(e){F.a.fire({text:Q("alerts:alerts.delete-register"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Q("buttons:buttons.accept"),cancelButtonText:Q("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ae(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ae=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/userGroup/organizations/".concat(t));case 3:a=e.sent,n=a.data,v(O.filter((function(e){return e.id!==t}))),C(O.filter((function(e){return e.id!==t}))),n&&F.a.fire({text:Q("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(0),F.a.fire({text:Q("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),b.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t){return e.apply(this,arguments)}}(),ne=function(e){if(r.includes("Editar"))return Object(n.jsx)(K.a,{title:Q("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return ee(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})},ie=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(K.a,{title:Q("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return ee(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})},re=function(){return Q("tables:table.columns-user-groups-organizations",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:m.button,onClick:function(e){return ee(0,0,"create")},children:Object(n.jsx)("span",{children:Q("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"userGroupsOrganization",items:O,setItems:C,changePage:l,loadData:Z,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,userGroupId:o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,setLoading:W}),Object(n.jsx)(zn,{columns:re(),rows:H,setDirection:T,setOrderBy:R,changePagination:$,children:Object(n.jsx)(vn.a,{children:U?Object(n.jsx)(qn,{columns:re(),photo:0}):w.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(w,Object(I.f)(B,P)).slice(t*a,t*a+a).map((function(e){var t,a,i,r,c,o,s;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(t=e.usuarios)||void 0===t?void 0:t.primer_nombre," ").concat(null===(a=e.usuarios)||void 0===a?void 0:a.primer_apellido)}),Object(n.jsx)(yn.a,{align:"center",children:null===(i=e.organizaciones)||void 0===i?void 0:i.nombre}),Object(n.jsxs)(yn.a,{align:"center",children:[null===(r=e.gruposUsuarios)||void 0===r?void 0:r.nombre,null!==(null===(c=e.gruposUsuarios)||void 0===c?void 0:c.id_organizaciones)?" - ".concat(null===(o=e.gruposUsuarios)||void 0===o||null===(s=o.organizaciones)||void 0===s?void 0:s.nombre):""]}),Object(n.jsx)(yn.a,{align:"center",children:ne(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:ie(e.id)})]},e.id)}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:Q("tables:table.empty-table")})})})})]})})),gi=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.1em"},input:{display:"none"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},avatar:{padding:5,width:"auto",height:"auto"},icon:{fontSize:"4em"}}}));var xi={changeBreadcrump:I.a},Oi=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),xi)((function(e){var t=e.changeBreadcrump,a=e.user,r=e.organizationId,c=Object(u.g)(),o=gi(),s=Object(i.useState)({id_usuarios:"",id_organizaciones:1!==a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?r:"",id_grupos_usuarios:""}),l=Object(d.a)(s,2),p=l[0],j=l[1],g=Object(i.useState)(!1),O=Object(d.a)(g,2),v=O[0],_=O[1],y=Object(i.useState)([]),w=Object(d.a)(y,2),C=w[0],k=w[1],N=Object(i.useState)([]),B=Object(d.a)(N,2),S=B[0],A=B[1],I=Object(i.useState)([]),P=Object(d.a)(I,2),R=P[0],M=P[1],L=Object(D.a)(["alerts","tables","buttons","breadCrumps"]),U=Object(d.a)(L,1)[0];Object(i.useEffect)((function(){W().catch((function(){c.push("/500"),window.location.reload()}))}),[]);var W=function(){var a=Object(h.a)(f.a.mark((function a(){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:H(),K(),V(),e.match.params.id?(q(),t(U("breadCrumps:breadCrumps.user-groups-organizations-edit",{returnObjects:!0}))):t(U("breadCrumps:breadCrumps.user-groups-organizations-create",{returnObjects:!0}));case 4:case"end":return a.stop()}}),a)})));return function(){return a.apply(this,arguments)}}(),q=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.get("/userGroup/organizations/".concat(a));case 3:n=t.sent,i=n.data,j(i.group);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),H=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/userGroup/getGroups");case 2:t=e.sent,n=t.data,1===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?k(n.groups):k(n.groups.filter((function(e){return 1!==e.id&&3!==e.id&&null===e.id_organizaciones||e.id_organizaciones===r})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations");case 2:t=e.sent,a=t.data,A(a.organizations.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},1!==a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&(n.id_organizaciones=r),e.next=4,Ce.a.post("/user/getUsers",n);case 4:i=e.sent,c=i.data,M(null===(t=c.users)||void 0===t?void 0:t.rows);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(e){j(Object(m.a)(Object(m.a)({},p),{},Object(b.a)({},e.target.name,e.target.value)))},Q=function(){_(!1)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:o.root,onSubmit:function(t){if(t.preventDefault(),_(!v),e.match.params.id){var a=Object(Ie.a)(e.match.params.id);Ce.a.put("/userGroup/organizations/".concat(a),p).then((function(e){Q(),c.push("/userGroupsOrganization"),F.a.fire({icon:"success",iconColor:E.a.primary,text:U("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})})).catch((function(e){Q(),F.a.fire({icon:"error",iconColor:E.a.primary,text:U("alerts:alerts.edited-error"),showConfirmButton:!1,timer:1500}),c.push("/500"),window.location.reload()}))}else Ce.a.post("/userGroup/organizations/",p).then((function(e){_(!1),c.push("/userGroupsOrganization"),F.a.fire({icon:"success",iconColor:E.a.primary,text:U("alerts:alerts.created"),showConfirmButton:!1,timer:1500})})).catch((function(e){_(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:U("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500}),c.push("/500"),window.location.reload()}))},children:[Object(n.jsxs)(ye.a,{container:!0,spacing:4,className:o.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{children:U("forms:user")}),Object(n.jsxs)(T.a,{id:"usuario",name:"id_usuarios",label:U("forms:user"),onChange:G,value:p.id_usuarios,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:U("forms:selected-option")})}),R.sort((function(e,t){return e.primer_nombre.toLowerCase()<t.primer_nombre.toLowerCase()?-1:1})).map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:"".concat(e.primer_nombre," ").concat(e.primer_apellido)},e.id)}))]})]})}),1===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(mt.a,{required:3!==p.id_grupos_usuarios,variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{children:U("forms:organization")}),Object(n.jsxs)(T.a,{id:"organizacion",name:"id_organizaciones",label:U("forms:organization"),onChange:G,value:p.id_organizaciones,children:[Object(n.jsx)(Y.a,{value:0,children:Object(n.jsx)("em",{children:U("forms:selected-option")})}),S.sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})).map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},e.id)}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{children:U("forms:userGroup")}),Object(n.jsxs)(T.a,{id:"grupo_usuario",name:"id_grupos_usuarios",label:"grupo_usuario",onChange:G,value:p.id_grupos_usuarios,children:[Object(n.jsx)(Y.a,{value:0,children:Object(n.jsx)("em",{children:U("forms:selected-option")})}),C.map((function(e){return Object(n.jsxs)(Y.a,{value:e.id,children:[e.nombre,null!==e.id_organizaciones?" - ".concat(e.organizaciones.nombre):""]},e.id)}))]})]})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(o.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(o.button),type:"submit",children:U("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(o.button),onClick:function(){c.push("/userGroupsOrganization")},children:U("buttons:buttons.cancel")})]})]})})})]})})),vi=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var _i={changeBreadcrump:I.a},yi=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"grupos de usuarios"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),_i)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=vi(),s=Object(u.g)(),l=Object(i.useState)([]),m=Object(d.a)(l,2),b=m[0],p=m[1],j=Object(i.useState)([]),g=Object(d.a)(j,2),O=g[0],v=g[1],_=Object(i.useState)(""),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(i.useState)(""),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)(!0),z=Object(d.a)(A,2),P=z[0],R=z[1],M=Object(D.a)(["alerts","tables","buttons","breadCrumps"]),L=Object(d.a)(M,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?(U().then((function(){R(!1)})).catch((function(){s.push("/500"),window.location.reload()})),c(L("breadCrumps:breadCrumps.userGroup",{returnObjects:!0}))):(s.push("/dashboard"),window.location.reload())}),[]);var U=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n=arguments;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.length>0&&void 0!==n[0]&&n[0],e.next=3,Ce.a.post("/userGroup/getGroups");case 3:t=e.sent,a=t.data,p(a.groups),v(a.groups);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),W=function(e,t,a){switch(a){case"delete":Y(t);break;case"edit":s.push("/userGroups/edit/".concat(Object(Ie.b)(t)));break;case"create":s.push("/userGroups/create")}},Y=function(e){F.a.fire({text:L("alerts:alerts.delete-button-userGroup"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:L("buttons:buttons.accept"),cancelButtonText:L("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&q(e).catch((function(){s.push("/500"),window.location.reload()}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},q=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/userGroup/organizations/getUserGroupsOrganization",{id_grupos_usuarios:t});case 2:if(a=e.sent,!(a.data.groups.length>0)){e.next=8;break}F.a.fire({text:L("alerts:alerts.error-delete-userGroup"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),e.next=15;break;case 8:return e.next=10,Ce.a.delete("/userGroup/".concat(t));case 10:n=e.sent,i=n.data,p(b.filter((function(e){return e.id!==t}))),v(b.filter((function(e){return e.id!==t}))),i&&F.a.fire({text:L("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),H=function(e){if(r.includes("Editar"))return Object(n.jsx)(K.a,{title:L("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return W(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})},V=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(K.a,{title:L("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return W(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})},G=function(){return L("tables:table.columns-userGroup",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:o.button,onClick:function(e){return W(0,0,"create")},children:Object(n.jsx)("span",{children:L("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{items:b,setItems:v,loadData:U,setLoading:R}),Object(n.jsx)(zn,{columns:G(),rows:O,setDirection:C,setOrderBy:T,children:Object(n.jsx)(vn.a,{children:P?Object(n.jsx)(qn,{columns:G(),photo:0}):O.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(O,Object(I.f)(w,B)).slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{children:[Object(n.jsxs)(yn.a,{align:"center",children:[e.nombre,null!==e.id_organizaciones?" - ".concat(e.organizaciones.nombre):""]}),Object(n.jsx)(yn.a,{align:"center",children:H(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:V(e.id)})]},"row".concat(t))}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:L("tables:table.empty-table")})})})]})})),wi=a(646),Ci=a(1242),ki=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.5em"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},check:{color:E.a.primary}}}));var Ni={changeBreadcrump:I.a},Bi=Object(s.b)(null,Ni)((function(e){var t=e.changeBreadcrump,a=ki(),r=Object(u.g)(),c=Object(i.useState)({nombre:"",id_organizaciones:null,rol:null}),o=Object(d.a)(c,2),s=o[0],l=o[1],j=Object(i.useState)(!1),g=Object(d.a)(j,2),O=g[0],v=g[1],_=Object(i.useState)([0]),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(i.useState)([]),N=Object(d.a)(k,2),B=N[0],S=N[1],A=Object(i.useState)([]),I=Object(d.a)(A,2),P=I[0],R=I[1],M=Object(D.a)(["alerts","buttons","breadCrumps","forms"]),L=Object(d.a)(M,1)[0],U=function(e){l(Object(m.a)(Object(m.a)({},s),{},Object(b.a)({},e.target.name,e.target.value)))};Object(i.useEffect)((function(){W().catch((function(){r.push("/500"),window.location.reload()})),e.match.params.id?(q().catch((function(){r.push("/500"),window.location.reload()})),t(L("breadCrumps:breadCrumps.userGroup-edit",{returnObjects:!0}))):t(L("breadCrumps:breadCrumps.userGroup-create",{returnObjects:!0}))}),[]);var W=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,H();case 2:return e.next=4,K();case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.get("/userGroup/".concat(a));case 3:n=t.sent,i=n.data,l(i.group),null!==i.group.id_organizaciones&&C([1]);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),H=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations");case 2:t=e.sent,a=t.data,S(a.organizations.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/userGroup/getGroups");case 2:t=e.sent,a=t.data,R(a.groups);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){v(!1)},G=function(e){return function(){0===e&&l(Object(m.a)(Object(m.a)({},s),{},{id_organizaciones:null,rol:null}));var t=w.indexOf(e),a=Object(p.a)(w);-1===t&&(a.splice(t,1),a.push(e),C(a))}};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsxs)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:[Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:a.root,onSubmit:function(t){if(t.preventDefault(),v(!O),e.match.params.id){var a=Object(Ie.a)(e.match.params.id);Ce.a.put("/userGroup/".concat(a),s).then((function(e){V(),r.push("/userGroups"),F.a.fire({icon:"success",iconColor:E.a.primary,text:L("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})})).catch((function(e){V(),F.a.fire({icon:"error",iconColor:E.a.primary,text:L("alerts:alerts.edited-error"),showConfirmButton:!1,timer:1500}),r.push("/500"),window.location.reload()}))}else Ce.a.post("/userGroup/",s).then((function(e){V(),r.push("/userGroups"),F.a.fire({icon:"success",iconColor:E.a.primary,text:L("alerts:alerts.created"),showConfirmButton:!1,timer:1500})})).catch((function(e){V(),F.a.fire({icon:"error",iconColor:E.a.primary,text:L("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500}),r.push("/500"),window.location.reload()}))},children:[Object(n.jsx)(we.a,{align:"center",component:"h6",variant:"h6",children:L("forms:userGroup-define")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:4,children:[Object(n.jsx)(wi.a,{control:Object(n.jsx)(Ci.a,{className:a.check,color:"default",checked:w.includes(0),onClick:G(0),disabled:e.match.params.id&&null!==s.id_organizaciones}),label:"Normal"}),Object(n.jsx)(wi.a,{control:Object(n.jsx)(Ci.a,{className:a.check,color:"default",checked:w.includes(1),onClick:G(1),disabled:e.match.params.id&&null===s.id_organizaciones}),label:L("forms:advanced")})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:L("forms:name"),name:"nombre",value:s.nombre,variant:"outlined",onChange:U})})}),w.includes(1)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{children:L("forms:organizations")}),Object(n.jsxs)(T.a,{id:"id_organizaciones",name:"id_organizaciones",label:"id_organizaciones",onChange:U,value:s.id_organizaciones,children:[Object(n.jsx)(Y.a,{children:Object(n.jsx)("em",{children:L("forms:selected-option")})}),B.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},e.id)}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{children:"Rol"}),Object(n.jsxs)(T.a,{id:"rol",name:"rol",label:"rol",onChange:U,value:s.rol,children:[Object(n.jsx)(Y.a,{children:Object(n.jsx)("em",{children:L("forms:selected-option")})}),P.map((function(e){return Object(n.jsxs)(Y.a,{value:e.id,children:[e.nombre,null!==e.id_organizaciones?" - ".concat(e.organizaciones.nombre):""]},e.id)}))]})]})})]})]}),Object(n.jsxs)("div",{className:"text-center ".concat(a.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(a.button),type:"submit",children:L("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(a.button),onClick:function(){r.push("/userGroups")},children:L("buttons:buttons.cancel")})]})]})}),Object(n.jsx)(xt.a,{className:a.backdrop,open:O,children:Object(n.jsx)(Ot.a,{color:"inherit"})})]})]})})),Si=a(1179),Ti=a(546),Ai=a.n(Ti),Ei=a(1260),Ii=a(1262),Di=a(1249),zi=a(1177),Pi=a(1239),Ri=a(1263),Mi=a(1264),Li=a(1250),Fi=a(1235),Ui=a(148);var Wi=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.5em",padding:"9px 40px"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},avatar:{padding:5,width:"auto",height:"auto"},input:{display:"none"},icon:{fontSize:"4em"},text:{marginTop:"1em",marginBottom:"1em"},link:{color:E.a.primary,"&:hover":{color:E.a.secondary}}}})),Yi={changeBreadcrump:I.a,changePage:I.b},qi=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,page:e.page,rowsPerPage:e.rowsPerPage}}),Yi)((function(e){var t=e.changeBreadcrump,a=e.user,c=e.organizationId,o=e.changePage,s=e.page,l=e.rowsPerPage,p=Object(u.g)(),j=Wi(),O=Object(i.useState)({primer_nombre:"",segundo_nombre:"",primer_apellido:"",segundo_apellido:"",documento:"",telefono:"",celular:"",correo:"",password:"",fecha_nacimiento:null,biografia:"",pagina_web:"",url_perfil:"",id_paises:null,id_ciudades:null,img_prev:"",imagen:null,id_organizaciones:1!==a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?c:"",id_grupos_usuarios:"",limit_issued:0,user_total_issueds:0}),v=Object(d.a)(O,2),_=v[0],y=v[1],w=Object(i.useState)(!1),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),A=Object(d.a)(B,2),P=A[0],R=A[1],M=Object(i.useState)([]),L=Object(d.a)(M,2),U=L[0],W=L[1],q=Object(i.useState)([]),H=Object(d.a)(q,2),K=H[0],V=H[1],G=Object(i.useState)([]),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(i.useState)([]),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ae=Object(i.useState)(!1),ne=Object(d.a)(ae,2),ie=ne[0],re=ne[1],ce=new RegExp(/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/),oe=Object(i.useState)(!1),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)(!1),me=Object(d.a)(ue,2),be=me[0],pe=me[1],fe=Object(i.useState)([]),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Object(i.useState)([]),ke=Object(d.a)(Oe,2),Ne=ke[0],Be=ke[1],Se=Object(i.useState)([]),Ae=Object(d.a)(Se,2),Ee=Ae[0],De=Ae[1],ze=Object(i.useState)([]),Re=Object(d.a)(ze,2),Me=Re[0],Le=Re[1],Fe=Object(i.useState)(!1),Ue=Object(d.a)(Fe,2),We=Ue[0],Ye=Ue[1],qe=Object(i.useState)(!1),He=Object(d.a)(qe,2),Ke=He[0],Ve=He[1],Ge=Object(i.useState)(""),Qe=Object(d.a)(Ge,2),Je=Qe[0],Xe=Qe[1],Ze=Object(i.useState)(""),$e=Object(d.a)(Ze,2),et=$e[0],tt=$e[1],at=r.a.createRef(),nt=Object(i.useState)(""),it=Object(d.a)(nt,2),rt=it[0],ot=it[1],st=Object(D.a)(["alerts","tables","buttons","breadCrumps","dialogs","users","selects"]),lt=Object(d.a)(st,1)[0];Object(i.useEffect)((function(){dt().catch((function(){p.push("/500"),window.location.reload()}))}),[]);var dt=function(){var n=Object(h.a)(f.a.mark((function n(){var i,r,o,s,l,d,u;return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:bt(),1!==a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&jt(c),ft(),e.match.params.id?(ut(),t(lt("breadCrumps:breadCrumps.settings-users-edit",{returnObjects:!0}))):t(lt("breadCrumps:breadCrumps.settings-users-create",{returnObjects:!0})),d=null===(i=window.navigator)||void 0===i||null===(r=i.userAgentData)||void 0===r||null===(o=r.platform)||void 0===o?void 0:o.toLowerCase(),u=null===(s=window.navigator)||void 0===s||null===(l=s.platform)||void 0===l?void 0:l.toLowerCase(),d?d.includes("windows")?ot("ISO-8859-3"):ot("UTF-8"):u.includes("win")?ot("ISO-8859-3"):ot("UTF-8");case 7:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();Object(i.useEffect)((function(){""!==_.id_paises?pt(_.id_paises).catch((function(){p.push("/500"),window.location.reload()})):W([""])}),[_.id_paises]);var ut=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.get("/user/".concat(a));case 3:n=t.sent,i=n.data,y(Object(m.a)(Object(m.a)({},i.user),{},{correo:i.user.cuentas[0].correo,id_organizaciones:i.user.gruposUsuariosOrganizaciones[0].id_organizaciones,id_grupos_usuarios:i.user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,imagen:i.user.linkPhoto,img_prev:i.user.linkPhoto,url_static:i.user.url_perfil,limit_issued:i.user.gruposUsuariosOrganizaciones[0].limit_issued,user_total_issueds:i.user.gruposUsuariosOrganizaciones[0].user_total_issueds||0})),4===i.user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&Ve(!0),i.user.id_paises&&V(Object(m.a)(Object(m.a)({},K),{},{country:null===(r=i.user)||void 0===r||null===(c=r.paises)||void 0===c?void 0:c.prefijo_telefono,city:null===(o=i.user)||void 0===o||null===(s=o.ciudades)||void 0===s?void 0:s.prefijo_telefono})),jt(i.user.gruposUsuariosOrganizaciones[0].id_organizaciones||null);case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),bt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCountries");case 2:t=e.sent,a=t.data,R(a.countries);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCities",{idPais:t});case 2:a=e.sent,n=a.data,W(n.cities);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),jt=function(){var e=Object(h.a)(f.a.mark((function e(t){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/userGroup/getGroups");case 2:n=e.sent,i=n.data,1===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?X(i.groups.filter((function(e){return null===e.id_organizaciones||e.id_organizaciones===t}))):X(i.groups.filter((function(e){return 1!==e.id&&3!==e.id&&14!==e.id&&null===e.id_organizaciones||e.id_organizaciones===c})));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ft=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations");case 2:t=e.sent,a=t.data,te(a.organizations.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ht=function(e){"id_grupos_usuarios"===e.target.name&&(4===e.target.value?Ve(!0):Ve(!1)),y(Object(m.a)(Object(m.a)({},_),{},Object(b.a)({},e.target.name,e.target.value)))},gt=function(e){var t=e.target.files[0];y(Object(m.a)(Object(m.a)({},_),{},{imagen:t,img_prev:URL.createObjectURL(t)}))},xt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:""===t.target.value?(y(Object(m.a)(Object(m.a)({},_),{},(a={},Object(b.a)(a,t.target.name,""),Object(b.a)(a,"id_ciudades",""),a))),V("")):(y(Object(m.a)(Object(m.a)({},_),{},(n={},Object(b.a)(n,t.target.name,t.target.value),Object(b.a)(n,"id_ciudades",""),n))),(i=P.find((function(e){return e.id===t.target.value}))).prefijo_telefono&&V(Object(m.a)(Object(m.a)({},K),{},{country:i.prefijo_telefono})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ot=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:""===t.target.value?(y(Object(m.a)(Object(m.a)({},_),{},Object(b.a)({},t.target.name,""))),V("")):(y(Object(m.a)(Object(m.a)({},_),{},Object(b.a)({},t.target.name,t.target.value))),(a=U.find((function(e){return e.id===t.target.value}))).prefijo_telefono&&V(Object(m.a)(Object(m.a)({},K),{},{city:a.prefijo_telefono})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),vt=function(){var t=Object(h.a)(f.a.mark((function t(a){var n,i,r,c,o,s,l,d,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a.preventDefault(),N(!0),t.next=4,Ce.a.post("/user/getUserUrl",{url_perfil:_.url_perfil});case 4:if(n=t.sent,i=n.data,_.password===_.password2){t.next=9;break}return N(!1),t.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:lt("alerts:alerts.password-match"),showConfirmButton:!1,timer:1500}));case 9:if(!ie){t.next=12;break}return N(!1),t.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:lt("alerts:alerts.birthdate-invalid"),showConfirmButton:!1,timer:1500}));case 12:if(_.url_static===_.url_perfil||!i){t.next=15;break}return N(!1),t.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:lt("alerts:alerts.url-profile-error"),showConfirmButton:!1,timer:1500}));case 15:if(ce.test(_.pagina_web)||!_.pagina_web){t.next=18;break}return N(!1),t.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:lt("alerts:alerts.url-website-error"),showConfirmButton:!1,timer:1500}));case 18:if(!_.limit_issued){t.next=29;break}return t.next=21,Ce.a.post("/contract/validations/",{id_organizaciones:null===_||void 0===_?void 0:_.id_organizaciones,issued:_.limit_issued});case 21:if(r=t.sent,c=r.data,!(_.user_total_issueds&&parseInt(_.user_total_issueds)>parseInt(_.limit_issued))){t.next=26;break}return N(!1),t.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:"".concat(lt("alerts:alerts.issued-limit-error-1")," ").concat(_.user_total_issueds," ").concat(lt("alerts:alerts.issued-limit-error-2")),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 26:if(!(c.contracts.cantidad_emisiones-c.contracts.total_emisiones<_.limit_issued)){t.next=29;break}return N(!1),t.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:lt("alerts:alerts.issued-limit-error-3"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 29:if(_.limit_issued||0===_.user_total_issueds){t.next=32;break}return N(!1),t.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:"".concat(lt("alerts:alerts.issued-limit-error-1")," ").concat(_.user_total_issueds," ").concat(lt("alerts:alerts.issued-limit-error-4")),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 32:e.match.params.id?(d=e.match.params.id,(u=new FormData).append("file",_.imagen),Ce.a.put("/user/".concat(d),Object(m.a)(Object(m.a)({},_),{},{imagen:null===(l=_.imagen)||void 0===l?void 0:l.name,whatsapp:"+".concat(K.country).concat(_.celular)})).then((function(e){if(_.imagen.name){var t=Pe()("certika-user-".concat(e.data.userId)).toString();ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-photo/").concat(t),headers:{"Content-Type":"multipart/form-data"},data:u}).then((function(){N(!1),p.push("/users"),F.a.fire({icon:"success",iconColor:E.a.primary,text:lt("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})}))}else N(!1),p.push("/users"),F.a.fire({icon:"success",iconColor:E.a.primary,text:lt("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})})).catch((function(e){N(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:lt("alerts:alerts.edited-error"),showConfirmButton:!1,timer:1500}),p.push("/500"),window.location.reload()}))):((s=new FormData).append("file",_.imagen),Ce.a.post("/user/",Object(m.a)(Object(m.a)({},_),{},{imagen:null===(o=_.imagen)||void 0===o?void 0:o.name})).then((function(e){var t;if(!e.data.userId)return N(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:lt("alerts:alerts.email-error"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}});if(null===(t=_.imagen)||void 0===t?void 0:t.name){var a=Pe()("certika-user-".concat(e.data.userId)).toString();ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-photo/").concat(a),headers:{"Content-Type":"multipart/form-data"},data:s}).then((function(){N(!1),p.push("/users"),F.a.fire({icon:"success",iconColor:E.a.primary,text:lt("alerts:alerts.created"),showConfirmButton:!1,timer:1500})}))}else N(!1),p.push("/users"),F.a.fire({icon:"success",iconColor:E.a.primary,text:lt("alerts:alerts.created"),showConfirmButton:!1,timer:1500})})).catch((function(e){N(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:lt("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500}),p.push("/500"),window.location.reload()})));case 33:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),yt=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,s,l,d;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],i=[],r=[],c=[],s=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,l=/^[A-Z\xd1a-z\xf1\xe1\xe9\xed\xf3\xfa\xc1\xc9\xcd\xd3\xda'\xb0 ]+$/,d=["documento","email","celular","primer_nombre","segundo_nombre","primer_apellido","segundo_apellido"],t.map((function(e){0===e.errors.length&&7===e.meta.fields.length&&JSON.stringify(e.meta.fields.sort())===JSON.stringify(d.sort())&&i.push(e.data)})),i.map((function(e,t){var a=[];i.map((function(t){t.email===e.email&&a.push(!0)})),""!==e.celular.trim()&&""!==e.email.trim()&&""!==e.primer_nombre.trim()&&""!==e.primer_apellido.trim()?(r.push(Object(m.a)({index:t},e)),l.test(e.primer_nombre)||n.push({index:t,msg:"".concat(lt("alerts:alerts.first-name-invalid"))}),""!==e.segundo_nombre&&(l.test(e.segundo_nombre)||n.push({index:t,msg:"".concat(lt("alerts:alerts.midle-name-invalid"))})),l.test(e.primer_apellido)||n.push({index:t,msg:"".concat(lt("alerts:alerts.last-name-invalid"))}),""!==e.segundo_apellido&&(l.test(e.segundo_apellido)||n.push({index:t,msg:"".concat(lt("alerts:alerts.second-last-name-invalid"))})),a.length>1&&n.push({index:t,msg:"".concat(lt("alerts:alerts.user-assigned")," ").concat(e.email," ").concat(lt("alerts:alerts.for-user")," ").concat(e.primer_nombre)}),s.test(e.email.trim())||n.push({index:t,msg:"".concat(lt("alerts:alerts.email-invalid"))})):c.push(t+2)})),de(!1),o(0),pe(!0),xe(r),Be(i),De(n),Le(c);case 16:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),wt=function(e){at.current&&at.current.open(e)},Ct=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/file/getFile",{keyFile:"files/template_users_batch.csv"});case 2:t=e.sent,a=t.data,window.open(a.url);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),kt=function(){Ye(!0)},Nt=function(){return lt("tables:table.columns-template-user-batch",{returnObjects:!0})},Bt=function(e){e.preventDefault(),pe(!1),F.a.fire({text:"".concat(lt("alerts:alerts.user-create-batch")," ").concat(Ne.length," ").concat(lt("alerts:alerts.user-create-batch-2")," ?"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,showDenyButton:!0,confirmButtonColor:E.a.primary,cancelButtonColor:"#d33",denyButtonColor:E.a.secondary,confirmButtonText:lt("buttons:buttons.create"),cancelButtonText:lt("buttons:buttons.cancel"),denyButtonText:"Atr\xe1s"}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){var n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.isDenied&&pe(!0),t.isDismissed&&St(),t.value&&(N(!0),n={usuarios:ge,id_organizaciones:_.id_organizaciones,id_usuarios_emisores:a.data_user.id},Ce.a.post("/user/batch",n).then((function(e){var t=e.data;N(!1),t.response.length>0?(De(t.response.map((function(e){return{index:e,msg:"".concat(lt("alerts:alerts.user-register"))}}))),pe(!0)):(St(),F.a.fire({icon:"success",iconColor:E.a.primary,text:"Usuarios creados correctamente",showConfirmButton:!0}))})).catch((function(e){N(!1),St(),F.a.fire({icon:"error",iconColor:E.a.primary,text:lt("alerts:alerts.try-again"),showConfirmButton:!1,timer:1500})})));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},St=function(e){at.current&&at.current.removeFile(e),pe(!1),Ye(!1),xe([]),De([])};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsxs)(_e.a,{className:"p-3",children:[Object(n.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:Object(n.jsx)(Fi.a,{title:"Cargar csv",children:Object(n.jsx)(S.a,{onClick:function(){return de(!0)},children:Object(n.jsx)(Ai.a,{})})})}),Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Ei.a,{open:le,onClose:function(){return de(!1)},children:Object(n.jsxs)(Ii.a,{children:[Object(n.jsx)(Ui.a,{ref:at,onFileLoad:yt,noClick:!0,noDrag:!0,progressBarColor:E.a.primary,config:{header:!0,encoding:rt,skipEmptyLines:!0},children:function(e){var t=e.file;return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",marginBottom:10},children:[Object(n.jsx)(x.a,{variant:"contained",color:"primary",component:"span",className:j.button,onClick:wt,children:lt("buttons:buttons.choose-csv")}),Object(n.jsx)("div",{style:{borderWidth:1,height:45,lineHeight:2.5,marginTop:5,marginBottom:5,paddingLeft:13,paddingTop:3,width:"60%"},children:t&&t.name})]})}}),Object(n.jsx)(we.a,{variant:"body1",className:j.text,children:lt("users:users.choose-csv")}),Object(n.jsx)(Di.a,{to:"#",onClick:Ct,sx:j.link,children:Object(n.jsxs)(we.a,{variant:"body1",style:{cursor:"pointer"},className:j.text,children:[Object(n.jsx)(va.a,{}),lt("buttons:buttons.download")]})})]})})}),Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(Ei.a,{open:be,fullWidth:!0,maxWidth:"xl",scroll:"body",children:[Object(n.jsxs)(zi.a,{children:[Object(n.jsxs)("div",{className:j.alert,children:[Object(n.jsxs)(Pi.a,{severity:"info",children:[lt("alerts:alerts.preloaded")," ",ge.length," ",lt("alerts:alerts.of")," "," ".concat(Ne.length),lt("alerts:alerts.rows")]}),0===ge.length&&Object(n.jsx)(Pi.a,{severity:"error",children:"No hay usuarios por crear, revise que el archvio tenga el formato correcto."}),Me.length>0&&Object(n.jsxs)(Pi.a,{severity:"error",children:[lt("alerts:alerts.rows-2")," ",Object(n.jsx)("b",{children:Me.toString()})," ",lt("alerts:alerts.no-requirements")]}),Ee.length>5&&!We?Object(n.jsxs)(n.Fragment,{children:[Ee.map((function(e,t){return t<5&&Object(n.jsx)("div",{children:Object(n.jsxs)(Pi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:[lt("alerts:alerts.row")," ",e.index+2,":"]}),e.msg]})},"row".concat(t))})),Object(n.jsx)("div",{children:Object(n.jsxs)(Pi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:["5 ",lt("alerts:alerts.of")," ",Ee.length," ",lt("alerts:alerts.errors"),"."]}),Object(n.jsx)(x.a,{onClick:kt,className:j.a\u00f1adirButton,children:lt("buttons:buttons.see-all")})]})})]}):Object(n.jsx)(n.Fragment,{children:Ee.map((function(e,t){return Object(n.jsx)("div",{children:Object(n.jsxs)(Pi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:[lt("alerts:alerts.row")," ",e.index+2,":"]}),e.msg,"."]})},"row".concat(t))}))})]}),Object(n.jsx)(x.a,{variant:"contained",color:"primary",component:"span",className:j.button,onClick:Bt,disabled:(ge.length!==Ne.length||Ee.length>0||0===ge.length)&&!0,children:lt("buttons:buttons.create")}),Object(n.jsx)(x.a,{variant:"contained",color:"primary",component:"span",className:j.button,onClick:St,children:lt("buttons:buttons.cancel")})]}),Object(n.jsx)(Ii.a,{dividers:!0,children:ge.length>0&&Object(n.jsx)(zn,{columns:Nt(),rows:ge,setDirection:Xe,setOrderBy:tt,children:Object(n.jsx)(Ri.a,{children:Object(I.J)(ge,Object(I.f)(Je,et)).slice(s*l,s*l+l).map((function(e,t){return Object(n.jsxs)(Mi.a,{children:[Object(n.jsx)(Li.a,{align:"center",children:Object(n.jsx)("b",{children:e.index+2})}),Object(n.jsx)(Li.a,{align:"center",children:e.documento}),Object(n.jsx)(Li.a,{align:"center",children:e.email}),Object(n.jsx)(Li.a,{align:"center",children:e.indicativo_pais}),Object(n.jsx)(Li.a,{align:"center",children:e.celular}),Object(n.jsx)(Li.a,{align:"center",children:e.primer_nombre}),Object(n.jsx)(Li.a,{align:"center",children:e.segundo_nombre}),Object(n.jsx)(Li.a,{align:"center",children:e.primer_apellido}),Object(n.jsx)(Li.a,{align:"center",children:e.segundo_apellido})]},"row".concat(t))}))})})})]})}),Object(n.jsxs)("form",{className:j.root,onSubmit:vt,children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:lt("users:users.photo-profile")}),Object(n.jsxs)(ye.a,{container:!0,spacing:4,className:j.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:Object(n.jsx)(g.a,{alt:"img-prev",src:_.img_prev,variant:"rounded",className:j.avatar,children:Object(n.jsx)(Si.a,{sx:{fontSize:"4em"}})})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:7,children:[Object(n.jsx)(we.a,{variant:"body2",className:j.text,children:lt("users:users.message-photo")}),Object(n.jsx)("input",{accept:"image/*",className:j.input,id:"contained-button-file",name:"imagen",type:"file",onChange:function(e){return gt(e)}}),Object(n.jsx)("label",{htmlFor:"contained-button-file",children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"outlined",component:"span",className:j.button,children:lt("buttons:buttons.upload-image")})})]})]}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:lt("users:users.first-name"),variant:"outlined",name:"primer_nombre",value:_.primer_nombre,onChange:ht})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:lt("users:users.second-name"),variant:"outlined",name:"segundo_nombre",value:_.segundo_nombre,onChange:ht})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:lt("users:users.last-name"),variant:"outlined",name:"primer_apellido",value:_.primer_apellido,onChange:ht})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:lt("users:users.second-last-name"),variant:"outlined",name:"segundo_apellido",value:_.segundo_apellido,onChange:ht})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{type:"number",label:lt("users:users.document"),variant:"outlined",name:"documento",value:_.documento,onChange:ht})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{error:ie,label:lt("users:users.birthdate"),type:"date",variant:"outlined",name:"fecha_nacimiento",value:_.fecha_nacimiento,onChange:function(e){var t=new Date,a=e.target.value.split("-"),n=new Date;t.setFullYear(a[0],a[1]-1,a[2]),t>=n||a[0]>n.getFullYear()-18?re(!0):parseInt(a[0])===n.getFullYear()-18?a[1]-1>n.getMonth()?re(!0):a[1]-1===n.getMonth()?re(a[2]>n.getDate()):re(!1):re(!1),y(Object(m.a)(Object(m.a)({},_),{},Object(b.a)({},e.target.name,e.target.value)))},InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start"})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:lt("users:users.email"),variant:"outlined",name:"correo",type:"email",value:_.correo,onChange:ht,disabled:e.match.params.id&&Object(Ie.a)(e.match.params.id)>0})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:lt("users:users.url-profile"),variant:"outlined",name:"url_perfil",onChange:ht,value:_.url_perfil})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsxs)(di.a,{children:[lt("users:users.country")," "," *"]}),Object(n.jsxs)(T.a,{required:!0,id:"pais",name:"id_paises",label:lt("users:users.country"),onChange:xt,value:_.id_paises?_.id_paises:"",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:lt("selects:selects-autocompletes.select-option")})}),P.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},"countrie-".concat(e.id))}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsxs)(di.a,{id:"ciudadesLabel",children:[lt("users:users.city")," "," *"]}),Object(n.jsxs)(T.a,{required:!0,id:"ciudades",name:"id_ciudades",labelId:"ciudadesLabel",value:_.id_ciudades?_.id_ciudades:"",onChange:Ot,label:lt("users:users.city"),children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:lt("selects:selects-autocompletes.select-option")})}),U.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},"city-".concat(e.id))}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:lt("users:users.phone"),variant:"outlined",name:"telefono",type:"number",value:_.telefono,onChange:gt,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:"(".concat(K.country?K.country:"",")")})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:lt("users:users.cellphone"),variant:"outlined",name:"celular",type:"number",value:_.celular,onChange:ht,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:"(".concat(K.city?K.city:"",")")})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:lt("users:users.web-site"),variant:"outlined",name:"pagina_web",onChange:ht,value:_.pagina_web,placeholder:"https://"})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:lt("users:users.biography"),name:"biografia",variant:"outlined",size:"small",multiline:!0,rows:4,onChange:ht,value:_.biografia})})}),1===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{required:null===_||void 0===_?void 0:_.id_organizaciones,variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{children:lt("users:users.organization")}),Object(n.jsxs)(T.a,{id:"organizacion",name:"id_organizaciones",label:"organizacion",onChange:function(e){y(Object(m.a)(Object(m.a)({},_),{},Object(b.a)({},e.target.name,e.target.value))),jt(e.target.value)},value:_.id_organizaciones,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:lt("selects:selects-autocompletes.select-option")})}),ee.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},"organization-".concat(e.id))}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:1===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?Ke?3:6:Ke?6:12,children:Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{children:lt("users:users.user-group")}),Object(n.jsxs)(T.a,{id:"grupo_usuario",name:"id_grupos_usuarios",label:"grupo_usuario",onChange:ht,value:_.id_grupos_usuarios,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:lt("selects:selects-autocompletes.select-option")})}),J.map((function(e){return Object(n.jsxs)(Y.a,{value:e.id,children:[e.nombre,null!==e.id_organizaciones?" - ".concat(e.organizaciones.nombre):""]},"group-".concat(e.id))}))]})]})}),Ke&&Object(n.jsx)(ye.a,{item:!0,xs:12,lg:1===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?3:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:lt("users:users.issue-limit"),variant:"outlined",type:"number",name:"limit_issued",value:_.limit_issued,onKeyUp:function(e){var t=String(e.target.value);/^([1-9][0-9]*(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t)||(e.target.value=t.substr(t.length)),t.length>11&&(e.target.value=t.substr(t.length))},onChange:ht})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!e.match.params.id,label:lt("users:users.password"),variant:"outlined",type:"password",name:"password",autoComplete:"on",value:_.password,onChange:ht})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!e.match.params.id,label:lt("users:users.confirm-password"),variant:"outlined",type:"password",name:"password2",autoComplete:"on",onChange:ht})})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(j.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(j.button),type:"submit",children:lt("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(j.button),onClick:function(){p.push("/users")},children:lt("buttons:buttons.cancel")})]})]})]})}),Object(n.jsx)(_t,{loading:k})]})})),Hi=a(649),Ki=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.5em",padding:"9px 40px"},check:{padding:"5px",color:E.a.primary}}}));var Vi={changeBreadcrump:I.a},Gi=Object(s.b)(null,Vi)((function(e){var t=e.changeBreadcrump,a=Ki(),r=Object(u.g)(),c=Object(i.useState)({id_grupos:"",id_acciones:[],id_modulos:""}),o=Object(d.a)(c,2),s=o[0],l=o[1],j=Object(i.useState)(!1),g=Object(d.a)(j,2),O=g[0],v=g[1],_=Object(i.useState)([]),C=Object(d.a)(_,2),k=C[0],N=C[1],B=Object(i.useState)([]),S=Object(d.a)(B,2),A=S[0],I=S[1],z=Object(i.useState)([]),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)([]),U=Object(d.a)(L,2),q=U[0],H=U[1],K=Object(D.a)(["alerts","tables","buttons","breadCrumps","forms"]),V=Object(d.a)(K,1)[0];Object(i.useEffect)((function(){G().catch((function(){r.push("/500"),window.location.reload()}))}),[]);var G=function(){var a=Object(h.a)(f.a.mark((function a(){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:X(),Z(),e.match.params.id&&J(),t(V("breadCrumps:breadCrumps.permissions-manage",{returnObjects:!0}));case 4:case"end":return a.stop()}}),a)})));return function(){return a.apply(this,arguments)}}();Object(i.useEffect)((function(){$(s.id_modulos).catch((function(){r.push("/500"),window.location.reload()})),Q(s).catch((function(){r.push("/500"),window.location.reload()}))}),[s.id_modulos]),Object(i.useEffect)((function(){Q(s).catch((function(){r.push("/500"),window.location.reload()}))}),[s.id_grupos]);var Q=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/permission/getPermissions");case 2:a=e.sent,n=a.data,i=[],n.permissions.permissions.filter((function(e){return e.gruposUsuarios.id===t.id_grupos})).map((function(e){e.acciones.id_modulos===t.id_modulos&&i.push(e.id_acciones)})),H(i),l(Object(m.a)(Object(m.a)({},s),{},{id_acciones:i}));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.get("/permission/".concat(a));case 3:n=t.sent,i=n.data,l({id_grupos:i.permission.id_grupos,id_modulos:i.permission.acciones.id_modulos});case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),X=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/userGroup/getGroups");case 2:t=e.sent,a=t.data,N(a.groups);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/module/getModules");case 2:t=e.sent,a=t.data,M(a.modules.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/action/getActions",{id_modulos:t});case 2:a=e.sent,n=a.data,I(n.actions);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ee=function(e){l(Object(m.a)(Object(m.a)({},s),{},Object(b.a)({},e.target.name,e.target.value)))},te=function(){v(!1)},ae=function(e){return function(){var t=q.indexOf(e),a=Object(p.a)(q);-1===t?a.push(e):a.splice(t,1),H(a),l(Object(m.a)(Object(m.a)({},s),{},{id_acciones:a}))}};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsxs)(_e.a,{className:"p-3",children:[Object(n.jsx)(we.a,{align:"center",component:"h6",variant:"h6",children:V("forms:permissions-definition")}),Object(n.jsxs)("form",{className:a.root,onSubmit:function(e){e.preventDefault(),v(!O),!s.id_acciones.length>0?(te(),F.a.fire({icon:"error",iconColor:E.a.primary,text:V("alerts:alerts.no-actions"),showConfirmButton:!1,timer:1500})):Ce.a.post("/permission/",s).then((function(e){te(),r.push("/permissions"),F.a.fire({icon:"success",iconColor:E.a.primary,text:V("alerts:alerts.successful-definition"),showConfirmButton:!1,timer:1500})})).catch((function(e){te(),F.a.fire({icon:"error",iconColor:E.a.primary,text:V("alerts:alerts.no-defined"),showConfirmButton:!1,timer:1500}),r.push("/500"),window.location.reload()}))},children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{id:"gruposLabel",children:V("forms:userGroup")}),Object(n.jsxs)(T.a,{labelId:"gruposLabel",label:V("forms:userGroup"),value:s.id_grupos,onChange:ee,name:"id_grupos",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:V("forms:selected-option")})}),k.map((function(e){return Object(n.jsxs)(Y.a,{value:e.id,children:[e.nombre,null!==e.id_organizaciones?" - ".concat(e.organizaciones.nombre):""]},e.id)}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{id:"modulosLabel",children:V("forms:modules")}),Object(n.jsxs)(T.a,{labelId:"modulosLabel",label:V("forms:modules"),value:s.id_modulos,onChange:ee,name:"id_modulos",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:V("forms:selected-option")})}),R.sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})).map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},e.id)}))]})]})})]}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,lg:12,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:12,children:[Object(n.jsx)(we.a,{align:"center",component:"h6",variant:"h6",children:V("forms:actions")}),Object(n.jsx)(W.a,{})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(ie.a,{children:A.sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})).map((function(e){return Object(n.jsxs)(y.a,{role:void 0,dense:!0,button:!0,onClick:ae(e.id),children:[Object(n.jsx)(w.a,{id:"nombre",primary:e.nombre}),Object(n.jsx)(Hi.a,{className:a.check,color:"default",edge:"start",checked:-1!==q.indexOf(e.id),tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":e.nombre}})]},e.id)}))})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(a.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(a.button),type:"submit",children:V("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(a.button),onClick:function(){r.push("/permissions")},children:V("buttons:buttons.cancel")})]})]})]})})]})})),Qi=a(1243);function Ji(e){return!!e.match(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/)}function Xi(e){var t=e.data,a=e.onClose,i=e.handleAccept,r=e.checked;return Object(n.jsx)("div",{children:Object(n.jsxs)(O.a,{open:t.open,onClose:a,scroll:"paper",fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{children:t.title}),Object(n.jsx)("embed",{src:"".concat(t.url,"#toolbar=0"),type:"application/pdf",width:"100%",height:600}),Object(n.jsxs)(Ae.a,{children:[Object(n.jsx)(x.a,{onClick:a,color:"primary",children:"Cancelar"}),Object(n.jsx)(x.a,{onClick:function(){return 1===t.index?t.viewTerms&&r.includes(1)?a():i(t.index):t.viewPPT&&r.includes(2)?a():i(t.index)},color:"primary",children:"Aceptar"})]})]})})}var Zi=Object(C.a)((function(e){return{container:function(t){return Object(b.a)({display:"flex",minHeight:"100vh",justifyContent:"center",alignItems:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"},e.breakpoints.up("md"),{marginLeft:window.location.origin===t.env.mincienciasURL?"20px":0,height:"100vh",justifyContent:"space-around"})},container_card:Object(b.a)({padding:"20px",borderRadius:"15px",margin:"5px 10px"},e.breakpoints.up("md"),{padding:"5px 40px",margin:"0 10px",width:"600px"}),container__login:{"& h2":{fontWeight:700},"& img":{width:"85%"}},container__logo:{display:"flex",justifyContent:"center",alignItems:"center"},button:function(e){return{marginTop:window.location.origin===e.env.mincienciasURL?"1em":0,margin:"0.5em",width:"100%",padding:"9px 40px"}},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},signin_span:{cursor:"pointer",color:e.palette.primary.main},text_password_error:{marginBottom:"5px",color:"#f4443b",fontSize:"0.9em",maxWidth:"fit-content",textAlign:"justify"},container__image:function(t){return Object(b.a)({display:"none"},e.breakpoints.up("md"),{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:window.location.origin===t.env.mincienciasURL?"80vw":"50vw"})},img:{height:"100%"},checked:{margin:0},checkedSpam:{cursor:"pointer",fontSize:13,"&:hover":{textDecoration:"underline"}},classes__login_buttons_paragraph:{justifyContent:"center",alignItems:"center","& p":{marginTop:".5em",marginBottom:".5em",textAlign:"center",cursor:"pointer",fontWeight:500,"&:hover":{textDecoration:"underline"}}}}})),$i={login:I.g,setSignatorieSignUp:I.F},er=Object(s.b)((function(e){return{user:e.user}}),$i)((function(e){var t=Zi({env:je.a}),a=Object(i.useState)({firstName:"",secondName:"",lastName:"",secondSurname:"",email:"",password:"",issued:!1,backoficceId:""}),r=Object(d.a)(a,2),c=r[0],o=r[1],s=Object(i.useState)(!1),l=Object(d.a)(s,2),u=l[0],j=l[1],g=Object(i.useRef)(),O=Object(i.useState)({password:{error:!1}}),v=Object(d.a)(O,2),_=v[0],y=v[1],w=Object(i.useState)({}),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),S=Object(d.a)(B,2),T=S[0],A=S[1],I=Object(i.useState)({open:!1,title:"",url:"",viewTerms:!1,viewPPT:!1}),z=Object(d.a)(I,2),P=z[0],R=z[1],M=Object(i.useState)({}),L=Object(d.a)(M,2),U=L[0],W=L[1],Y=e.user,q=e.history,H=new bt.a("logout"),K=Object(D.a)(["loginRegister","buttons","alerts"]),V=Object(d.a)(K,1)[0];Object(i.useEffect)((function(){var t,a=null===(t=JSON.parse(window.localStorage.state))||void 0===t?void 0:t.styles;if(W({Logo:a.logo435x149,LoginLogo:a.icono_login,LoginBackground:a.login_background,Register:a.register}),window.location.origin===je.a.certikaURL?o(Object(m.a)(Object(m.a)({},c),{},{backoficceId:1})):window.location.origin===je.a.mincienciasURL&&o(Object(m.a)(Object(m.a)({},c),{},{backoficceId:2})),Y&&(j(!0),Q()),e.match.params.badgeId){j(!0),G().catch((function(){e.history.push("/500"),window.location.reload()}));var n=Object(Ie.a)(e.match.params.badgeId);e.match.params.reject||Ce.a.get("/badgesIssued/accept/".concat(n)).then((function(e){j(!1),N({message:e.data.message,severity:e.data.severity})})).catch((function(t){j(!1),N(V("alerts:alerts.try-again")),e.history.push("/500"),window.location.reload()}))}else if(e.match.params.certificateId){j(!0),G().catch((function(){e.history.push("/500"),window.location.reload()}));var i=Object(Ie.a)(e.match.params.certificateId);e.match.params.reject||Ce.a.get("/certificatesIssued/accept/".concat(i)).then((function(e){j(!1),N({message:e.data.message,severity:e.data.severity})})).catch((function(t){j(!1),N(V("alerts:alerts.try-again")),e.history.push("/500"),window.location.reload()}))}else if(e.match.params.carnetId){j(!0),G().catch((function(){e.history.push("/500"),window.location.reload()}));var r=Object(Ie.a)(e.match.params.carnetId);e.match.params.reject||Ce.a.get("/carnetsIssued/accept/".concat(r)).then((function(e){j(!1),N({message:e.data.message,severity:e.data.severity})})).catch((function(t){j(!1),N(V("alerts:alerts.try-again")),e.history.push("/500"),window.location.reload()}))}else e.match.params.documentTemplateId&&e.match.params.idSignature&&(j(!0),G())}),[]);var G=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,s,l,d,u,m,b,p;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.match.params.badgeId){t.next=9;break}return a=Object(Ie.a)(e.match.params.badgeId),t.next=4,Ce.a.get("/badgesIssued/receiver/".concat(a));case 4:n=t.sent,null!==(i=n.data).data&&o({firstName:i.data.primer_nombre_receptor,secondName:i.data.segundo_nombre_receptor,lastName:i.data.primer_apellido_receptor,secondSurname:i.data.segundo_apellido_receptor,email:i.data.email_receptor,issued:!0,backoficceId:window.location.origin===je.a.mincienciasURL?2:1}),t.next=45;break;case 9:if(!e.match.params.certificateId){t.next=18;break}return r=Object(Ie.a)(e.match.params.certificateId),t.next=13,Ce.a.get("/certificatesIssued/receiver/".concat(r));case 13:c=t.sent,null!==(s=c.data).data&&o({email:s.data.email_receptor,issued:!0,backoficceId:window.location.origin===je.a.mincienciasURL?2:1}),t.next=45;break;case 18:if(!e.match.params.carnetId){t.next=27;break}return l=Object(Ie.a)(e.match.params.carnetId),t.next=22,Ce.a.get("/carnetsIssued/receiver/".concat(l));case 22:d=t.sent,null!==(u=d.data).data&&o({email:u.data.email_receptor,issued:!0,backoficceId:window.location.origin===je.a.mincienciasURL?2:1}),t.next=45;break;case 27:if(!e.match.params.documentTemplateId||!e.match.params.idSignature){t.next=45;break}return m=e.match.params.idSignature,t.next=31,Ce.a.get("/signature/receiver/".concat(m));case 31:if(b=t.sent,null===(p=b.data).signature){t.next=43;break}if(null!==p.signature.cuentas){t.next=36;break}return t.abrupt("return",q.push("/"));case 36:if(!0!==p.signature.cuentas.estado&&1!==p.signature.cuentas.estado){t.next=38;break}return t.abrupt("return",window.location.href="/signatorie/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature));case 38:o({firstName:p.signature.usuarios.primer_nombre,secondName:p.signature.usuarios.segundo_nombre,lastName:p.signature.usuarios.primer_apellido,secondSurname:p.signature.usuarios.segundo_apellido,email:p.signature.cuentas.correo,signatorie:!0,issued:!0,backoficceId:window.location.origin===je.a.mincienciasURL?2:1}),N({message:V("alerts:alerts.sing-up-signatorie"),severity:"info"}),j(!1),t.next=45;break;case 43:q.push("/"),F.a.fire({icon:"warning",iconColor:E.a.primary,text:V("alerts:alerts.document-have-signature"),confirmButtonText:V("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}});case 45:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Q=function(){var t=Object(h.a)(f.a.mark((function t(){var a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ce.a.get("/user/".concat(null===Y||void 0===Y||null===(a=Y.data_user)||void 0===a?void 0:a.id)).then((function(t){j(!1),e.match.params.badgeId?q.push("/dashboard/badge/".concat(e.match.params.badgeId)):e.match.params.certificateId?q.push("/dashboard/certificate/".concat(e.match.params.certificateId)):e.match.params.carnetId?q.push("/dashboard/carnet/".concat(e.match.params.carnetId)):e.match.params.documentTemplateId&&e.match.params.idSignature?q.push("/dashboard/document/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature)):q.push("/dashboard")})).catch((function(){j(!1),H.postMessage("CerrarSesion")}));case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),J=function(e){"password"===e.target.name&&(""===e.target.value||Ji(e.target.value)?(g.current.disabled=!1,y(Object(m.a)(Object(m.a)({},_),{},{password:{error:!1}})),F.a.close()):(g.current.disabled=!0,y(Object(m.a)(Object(m.a)({},_),{},{password:{error:!0}})),!_.password.error&&F.a.mixin({toast:!0,position:"bottom-start"}).fire({icon:"error",iconColor:E.a.primary,title:V("alerts:alerts.password-lenght"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}))),o(Object(m.a)(Object(m.a)({},c),{},Object(b.a)({},e.target.name,e.target.value)))},X=function(e,t,a){R(Object(m.a)(Object(m.a)({},P),{},{open:!0,title:t,url:a,index:e}))},Z=function(e){var t=T.includes(e),a=Object(p.a)(T);t?A(a.filter((function(t){return t!==e}))):(a.push(e),A(a)),R({open:!1,title:"",url:"",viewTerms:1===e||P.viewTerms,viewPPT:2===e||P.viewPPT})};return Object(n.jsxs)("div",{className:t.container,style:{backgroundImage:window.location.origin===je.a.mincienciasURL?"none":"url(".concat(null===U||void 0===U?void 0:U.LoginBackground,")")},children:[Object(n.jsx)(kn.a,{elevation:0,className:t.container_card,children:Object(n.jsxs)("div",{className:t.container__login,children:[Object(n.jsx)("div",{className:t.container__logo,children:Object(n.jsx)("img",{src:null===U||void 0===U?void 0:U.Logo,alt:"logo",style:{width:"70%"}})}),!e.match.params.reject&&(e.match.params.badgeId||e.match.params.certificateId||e.match.params.carnetId||e.match.params.documentTemplateId&&e.match.params.idSignature)&&Object(n.jsx)(Qi.a,{style:{maxWidth:"32em"},severity:k.severity,children:k.message}),Object(n.jsx)("h3",{style:{marginBottom:".5em"},children:V("buttons:buttons.register")}),Object(n.jsxs)("form",{onSubmit:function(t){if(t.preventDefault(),c.password!==c.passwordConfirmation)return F.a.fire({icon:"info",iconColor:E.a.primary,text:V("alerts:alerts.password-match"),showConfirmButton:!1,timer:3e3});j(!0),Object(Ce.a)({url:"/user/sign-up",method:"post",data:{primer_nombre:c.firstName,segundo_nombre:c.secondName,primer_apellido:c.lastName,segundo_apellido:c.secondSurname,correo:c.email,password:c.password,issued:c.issued,backoficceId:c.backoficceId}}).then((function(t){if(j(!1),t.data){if(null===c||void 0===c?void 0:c.signatorie)return F.a.fire({icon:"success",iconColor:E.a.primary,text:V("alerts:alerts.successful-sign-up"),showConfirmButton:!1,timer:2e3}).then((function(){e.setSignatorieSignUp({email:null===c||void 0===c?void 0:c.email,pass:Object(Ie.b)(c.password)}),e.history.push("/sign-in/signatorie/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature))}));if(c.issued)return F.a.fire({icon:"success",iconColor:E.a.primary,text:V("alerts:alerts.thanks-register"),showConfirmButton:!1,timer:3e3}).then((function(){e.history.push("/sign-in")}));F.a.fire({icon:"success",iconColor:E.a.primary,text:V("alerts:alerts.email-confirm-account"),showConfirmButton:!1,timer:7e3}).then((function(){e.history.push("/sign-in")}))}})).catch((function(){j(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:V("alerts:alerts.account-exist"),showConfirmButton:!1,timer:3e3})}))},children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:null===c||void 0===c?void 0:c.signatorie,required:!0,label:V("loginRegister:first-name"),name:"firstName",variant:"outlined",onChange:J,value:c.firstName})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:null===c||void 0===c?void 0:c.signatorie,label:V("loginRegister:second-name"),name:"secondName",variant:"outlined",onChange:J,value:c.secondName})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:null===c||void 0===c?void 0:c.signatorie,required:!0,label:V("loginRegister:last-name"),name:"lastName",variant:"outlined",onChange:J,value:c.lastName})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:null===c||void 0===c?void 0:c.signatorie,label:V("loginRegister:second-last-name"),name:"secondSurname",variant:"outlined",onChange:J,value:c.secondSurname})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:V("loginRegister:email"),name:"email",type:"email",variant:"outlined",onChange:J,value:c.email,disabled:!!e.match.params.badgeId||(!!e.match.params.certificateId||(null===c||void 0===c?void 0:c.signatorie))})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:V("loginRegister:password"),name:"password",variant:"outlined",onChange:J,error:_.password.error,type:"password"})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsxs)(mt.a,{className:"w-100",children:[_.password.error&&Object(n.jsx)("span",{className:t.text_password_error,children:_.password.message}),Object(n.jsx)(Te.a,{required:!0,label:V("loginRegister:confirm-password"),name:"passwordConfirmation",variant:"outlined",onChange:J,type:"password"})]})})]}),window.location.origin!==je.a.mincienciasURL&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsx)(wi.a,{className:t.checked,control:Object(n.jsx)(Hi.a,{checked:T.includes(1),name:"checkedE",onClick:function(){return Z(1)}})}),Object(n.jsx)("span",{className:t.checkedSpam,onClick:function(){return X(1,"T\xc9RMINOS Y CONDICIONES DE USO DE SOFTWARE CERTIKA S.A.S.","https://certika.co/wp-content/uploads/2022/08/Terminos-y-Condiciones-de-Uso-de-Softwre-y-ANS-1.pdf")},children:V("loginRegister:accept-terms")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsx)(wi.a,{className:t.checked,control:Object(n.jsx)(Hi.a,{checked:T.includes(2),name:"checkedE",onClick:function(){return Z(2)}})}),Object(n.jsx)("span",{className:t.checkedSpam,onClick:function(){return X(2,"POL\xcdTICA DE PRIVACIDAD Y TRATAMIENTO DE DATOS PERSONALES CERTIKA S.A.S","https://certika.co/wp-content/uploads/2022/07/Politica-de-Tratamiento-de-Datos-Personales-Responsable_Certika-1.pdf")},children:V("loginRegister:accept-privacy")})]})]}),Object(n.jsxs)("div",{className:"text-center",children:[Object(n.jsx)(x.a,{disabled:window.location.origin!==je.a.mincienciasURL&&!(T.includes(1)&&T.includes(2)),ref:g,variant:"contained",size:"small",className:t.button,type:"submit",color:"primary",disableElevation:!0,children:V("buttons:buttons.register")}),Object(n.jsx)("br",{})]}),Object(n.jsx)("div",{className:t.classes__login_buttons_paragraph,children:!(null===c||void 0===c?void 0:c.signatorie)&&Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)("p",{onClick:function(){e.history.push("/sign-in")},children:["".concat(V("loginRegister:have-account"),", "),Object(n.jsx)("span",{className:t.signin_span,children:V("loginRegister:sign-in")})]})})})]})]})}),Object(n.jsx)("div",{className:t.container__image,children:Object(n.jsx)("img",{src:window.location.origin===je.a.certikaURL?null===U||void 0===U?void 0:U.Register:null===U||void 0===U?void 0:U.LoginLogo,className:t.img,alt:"login-logo"})}),Object(n.jsx)(xt.a,{className:t.backdrop,open:u,children:Object(n.jsx)(Ot.a,{color:"inherit"})}),Object(n.jsx)(Xi,{data:P,onClose:function(){R(Object(m.a)(Object(m.a)({},P),{},{open:!1,title:"",url:""}))},handleAccept:Z,checked:T})]})})),tr=Object(C.a)((function(e){return{container:function(t){return Object(b.a)({display:"flex",minHeight:"100vh",justifyContent:"center",alignItems:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"},e.breakpoints.up("md"),{marginLeft:window.location.origin===t.env.mincienciasURL?"20px":0,height:"100vh",justifyContent:"space-around"})},container_card:Object(b.a)({padding:"20px",borderRadius:"15px",margin:"0 10px"},e.breakpoints.up("md"),{padding:"40px",margin:"0"}),container__form:{"& h1":{margin:"25px 0px"},"& img":{width:"90%"}},root:{marginTop:"2em"},card:{minWidth:275},img:{height:"100%"},button:{margin:"0.5em",width:"100%",padding:"9px 40px"},container__image:function(t){return Object(b.a)({display:"none"},e.breakpoints.up("md"),{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:window.location.origin===t.env.mincienciasURL?"83.5vw":"50vw"})}}}));var ar=function(e){var t=tr({env:je.a}),a=Object(u.g)(),r=Object(i.useState)(!1),c=Object(d.a)(r,2),o=c[0],s=c[1],l=Object(i.useState)(""),m=Object(d.a)(l,2),b=m[0],p=m[1],j=Object(D.a)(["loginRegister","buttons"]),f=Object(d.a)(j,1)[0];return Object(i.useEffect)((function(){var t,a=null===(t=JSON.parse(window.localStorage.state))||void 0===t?void 0:t.styles;p({Logo:a.logo435x149,LoginLogo:a.icono_login,LoginBackground:a.login_background}),s(!0);var n=Object(Ie.a)(e.match.params.accountId);Ce.a.get("user/verify/".concat(n)),s(!1)}),[]),Object(n.jsxs)("div",{className:t.container,style:{backgroundImage:window.location.origin===je.a.mincienciasURL?"none":"url(".concat(null===b||void 0===b?void 0:b.LoginBackground,")")},children:[Object(n.jsx)(kn.a,{elevation:0,className:t.container_card,children:Object(n.jsxs)("div",{className:t.container__form,children:[Object(n.jsx)("img",{src:b.Logo,alt:"logo"}),Object(n.jsx)("h3",{style:{textAlign:"center"},children:f("loginRegister:message-verify")}),Object(n.jsx)("form",{onSubmit:function(e){a.push("/sign-in")},children:Object(n.jsx)("div",{className:"text-center ".concat(t.root),children:Object(n.jsx)(x.a,{color:"primary",variant:"contained",size:"small",className:t.button,type:"submit",disableElevation:!0,children:f("buttons:buttons.sign-in")})})})]})}),Object(n.jsx)("div",{className:t.container__image,children:Object(n.jsx)("img",{src:b.LoginLogo,className:t.img,alt:"login-logo"})}),Object(n.jsx)(_t,{loading:o})]})},nr=a(548),ir=a.n(nr),rr=a(547),cr=a.n(rr);var or=Object(C.a)((function(e){return{container:function(t){return Object(b.a)({display:"flex",minHeight:"100vh",justifyContent:"center",alignItems:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"},e.breakpoints.up("md"),{marginLeft:window.location.origin===t.env.mincienciasURL?"20px":0,height:"100vh",justifyContent:"space-around"})},container_card:Object(b.a)({padding:"20px",borderRadius:"15px",margin:"0 10px"},e.breakpoints.up("md"),{padding:"40px",margin:"0"}),container__login:{"& h2":{fontWeight:700},"& img":{width:"90%"}},container__logo:{display:"flex",justifyContent:"center",alignItems:"center"},classes__login_buttons:{display:"flex",marginTop:"1em"},classes__login_buttons_paragraph:{justifyContent:"center",alignItems:"center","& p":{marginTop:".5em",marginBottom:0,textAlign:"center",cursor:"pointer",fontWeight:500,"&:hover":{textDecoration:"underline"}}},container__image:function(t){return Object(b.a)({display:"none"},e.breakpoints.up("md"),{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:window.location.origin===t.env.mincienciasURL?"83.5vw":"50vw"})},img:{height:"100%"},button:{margin:"0.5em",width:"100%",padding:"7px 40px"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"}}})),sr={login:I.g,setError:I.v,setSignatorieSignUp:I.F},lr=Object(s.b)((function(e){return{user:e.user,error:e.error,signatorieSignUp:e.signatorieSignUp}}),sr)((function(e){var t=Object(i.useState)({correo:""}),a=Object(d.a)(t,2),r=a[0],c=a[1],o=e.error,s=e.setError,l=e.user,u=e.history,p=e.signatorieSignUp,j=e.setSignatorieSignUp,g=Object(i.useState)({}),O=Object(d.a)(g,2),v=O[0],_=O[1],y=Object(i.useState)(!1),w=Object(d.a)(y,2),C=w[0],k=w[1],N=Object(i.useState)({}),B=Object(d.a)(N,2),T=B[0],A=B[1],I=Object(i.useState)(!1),z=Object(d.a)(I,2),P=z[0],R=z[1],M=new bt.a("logout"),L=Object(D.a)(["loginRegister","buttons","alerts"]),U=Object(d.a)(L,1)[0],W=or({env:je.a});Object(i.useEffect)((function(){var t,a=null===(t=JSON.parse(window.localStorage.state))||void 0===t?void 0:t.styles;if(A({Logo:a.logo435x149,LoginLogo:a.icono_login,LoginBackground:a.login_background}),l&&(k(!0),Y()),e.match.params.badgeId){k(!0),q();var n=Object(Ie.a)(e.match.params.badgeId);e.match.params.reject||Ce.a.get("/badgesIssued/accept/".concat(n)).then((function(e){k(!1),_({message:e.data.message,severity:e.data.severity})})).catch((function(e){k(!1),_(U("alerts:alerts.try-again"))})),k(!1)}else if(e.match.params.certificateId){k(!0),q();var i=Object(Ie.a)(e.match.params.certificateId);if(!e.match.params.reject)(function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.get("/certificatesIssued/accept/".concat(i)).then((function(e){k(!1),_({message:e.data.message,severity:e.data.severity})})).catch((function(e){k(!1),_(U("alerts:alerts.try-again"))}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}})()();k(!1)}else if(e.match.params.carnetId){k(!0),q();var r=Object(Ie.a)(e.match.params.carnetId);e.match.params.reject||Ce.a.get("/carnetsIssued/accept/".concat(r)).then((function(e){k(!1),_({message:e.data.message,severity:e.data.severity})})).catch((function(e){k(!1),_(U("alerts:alerts.try-again"))})),k(!1)}else e.match.params.documentTemplateId&&e.match.params.idSignature&&(k(!0),q())}),[]);var Y=function(){var t=Object(h.a)(f.a.mark((function t(){var a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ce.a.post("/user/isTokensNew").catch((function(){k(!1),M.postMessage("CerrarSesion")}));case 2:return t.next=4,Ce.a.get("/user/".concat(null===l||void 0===l||null===(a=l.data_user)||void 0===a?void 0:a.id)).then((function(t){k(!1),e.match.params.badgeId?u.push("/dashboard/badge/".concat(e.match.params.badgeId)):e.match.params.certificateId?u.push("/dashboard/certificate/".concat(e.match.params.certificateId)):e.match.params.carnetId?u.push("/dashboard/carnet/".concat(e.match.params.carnetId)):e.match.params.documentTemplateId&&e.match.params.idSignature?u.push("/dashboard/document/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature)):u.push("/dashboard")})).catch((function(){k(!1),M.postMessage("CerrarSesion")}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),q=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,o,s,l,d,m,b,h,g,x;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.match.params.badgeId){t.next=9;break}return a=Object(Ie.a)(e.match.params.badgeId),t.next=4,Ce.a.get("/badgesIssued/receiver/".concat(a));case 4:n=t.sent,null!==(i=n.data).data&&c({correo:i.data.email_receptor}),t.next=45;break;case 9:if(!e.match.params.certificateId){t.next=18;break}return o=Object(Ie.a)(e.match.params.certificateId),t.next=13,Ce.a.get("/certificatesIssued/receiver/".concat(o));case 13:s=t.sent,null!==(l=s.data).data&&c({correo:l.data.email_receptor}),t.next=45;break;case 18:if(!e.match.params.carnetId){t.next=27;break}return d=Object(Ie.a)(e.match.params.carnetId),t.next=22,Ce.a.get("/carnetsIssued/receiver/".concat(d));case 22:m=t.sent,null!==(b=m.data).data&&c({correo:b.data.email_receptor}),t.next=45;break;case 27:if(!e.match.params.documentTemplateId||!e.match.params.idSignature){t.next=45;break}return h=e.match.params.idSignature,t.next=31,Ce.a.get("/signature/receiver/".concat(h));case 31:if(g=t.sent,null===(x=g.data).signature){t.next=42;break}if(null!==x.signature.cuentas){t.next=36;break}return t.abrupt("return",u.push("/"));case 36:if(!1!==x.signature.cuentas.estado&&0!==x.signature.cuentas.estado){t.next=38;break}return t.abrupt("return",window.location.href="/signatorie/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature));case 38:c({correo:x.signature.cuentas.correo}),_({message:U("alerts:alerts.sign-in-signatorie"),severity:"info"}),t.next=43;break;case 42:F.a.fire({icon:"warning",iconColor:E.a.primary,text:U("alerts:alerts.document-have-signature")}).then((function(){window.location.href="/"}));case 43:p&&(r.correo=p.email,r.password=Object(Ie.a)(p.pass),j(null),K()),k(!1);case 45:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();Object(i.useEffect)((function(){o&&F.a.fire({icon:"error",iconColor:E.a.primary,title:"Error",text:U("alerts:alerts.user-incorrect"),showConfirmButton:!1,timer:3e3}).then((function(){s(null)}))}),[o]);var H=function(e){c(Object(m.a)(Object(m.a)({},r),{},Object(b.a)({},e.target.name,e.target.value)))},K=function(t){t&&t.preventDefault(),e.login(r,e.match.params.documentTemplateId&&e.match.params.idSignature?"/document/signature/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature):"/dashboard")};return Object(n.jsxs)("div",{className:W.container,style:{backgroundImage:window.location.origin===je.a.mincienciasURL?"none":"url(".concat(null===T||void 0===T?void 0:T.LoginBackground,")")},children:[Object(n.jsx)(kn.a,{elevation:0,className:W.container_card,children:Object(n.jsxs)("div",{className:W.container__login,children:[Object(n.jsx)("div",{className:W.container__logo,children:Object(n.jsx)("img",{src:null===T||void 0===T?void 0:T.Logo,alt:"logo"})}),(!e.match.params.reject&&(e.match.params.badgeId||e.match.params.certificateId||e.match.params.carnetId)||e.match.params.documentTemplateId&&e.match.params.idSignature)&&Object(n.jsx)(Qi.a,{severity:v.severity,children:v.message}),Object(n.jsx)("h3",{style:{marginBottom:".5em"},children:U("loginRegister:sign-in")}),Object(n.jsxs)("form",{onSubmit:K,children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:e.match.params.documentTemplateId&&e.match.params.idSignature,required:!0,label:U("loginRegister:email"),name:"correo",variant:"outlined",onChange:H,value:r.correo})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:U("loginRegister:password"),name:"password",autoComplete:"on",variant:"outlined",onChange:H,type:P?"text":"password",InputProps:{endAdornment:Object(n.jsx)(Rn.a,{position:"end",children:Object(n.jsx)(S.a,{"aria-label":"toggle password visibility",onClick:function(){return R((function(e){return!e}))},onMouseDown:function(e){e.preventDefault()},children:P?Object(n.jsx)(cr.a,{}):Object(n.jsx)(ir.a,{})})})},autoFocus:(e.match.params.badgeId||e.match.params.certificateId)&&!0})})})]}),Object(n.jsx)("div",{className:W.classes__login_buttons,children:Object(n.jsx)(x.a,{color:"primary",variant:"contained",className:W.button,type:"submit",disableElevation:!0,children:U("buttons:buttons.sign-in")})}),Object(n.jsxs)("div",{className:W.classes__login_buttons_paragraph,children:[Object(n.jsx)("p",{style:{textDecoration:"underline"},onClick:function(){return e.history.push("/account/forget")},children:U("loginRegister:forget-password")}),Object(n.jsxs)("p",{onClick:function(){return e.history.push("/sign-up")},children:[U("loginRegister:register-yet")," ",Object(n.jsx)("span",{style:{color:E.a.primary},children:U("loginRegister:register")})]})]})]})]})}),Object(n.jsx)("div",{className:W.container__image,children:Object(n.jsx)("img",{src:null===T||void 0===T?void 0:T.LoginLogo,className:W.img,alt:"login-logo"})}),Object(n.jsx)(xt.a,{className:W.backdrop,open:C||!1,children:Object(n.jsx)(Ot.a,{color:"inherit"})})]})})),dr=a(1180),ur=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},lista:{backgroundColor:"#F8F9F9"}}}));var mr={changePage:I.b,changeBreadcrump:I.a},br=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"recomendaciones"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),mr)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.permission,o=e.changePage,s=e.changeBreadcrump,l=e.user,m=e.organizationId,b=e.searchValue,p=ur(),j=Object(u.g)(),O=Object(i.useState)([]),v=Object(d.a)(O,2),_=v[0],y=v[1],w=Object(i.useState)([]),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)([]),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(""),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(""),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!0),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)([]),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ie=6===l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,re=6===(null===(t=l.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),ce=Object(D.a)(["tables","buttons","alerts","breadCrumps"]),oe=Object(d.a)(ce,1)[0];Object(i.useEffect)((function(){c.includes("Leer")?se().catch((function(){j.push("/500"),window.location.reload()})):(j.push("/dashboard"),window.location.reload())}),[]);var se=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(b&&""!==b){e.next=3;break}return e.next=3,le();case 3:return e.next=5,de();case 5:s(oe("breadCrumps:breadCrumps.badge-recommendation",{returnObjects:!0})),$(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/recommendation/getRecommendations");case 2:a=e.sent,n=a.data,1===l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?(y(null===(i=n.recommendations)||void 0===i?void 0:i.recommendations),L(null===(r=n.recommendations)||void 0===r?void 0:r.recommendations)):(s=n.recommendations.history.filter((function(e){return e.id_usuarios===l.data_user.id&&39===parseInt(e.accion)})).map((function(e){if(e.id_campo)return e.id_campo})),ne(s),y(null===(c=n.recommendations)||void 0===c?void 0:c.recommendations.filter((function(e){var t;return(null===(t=e.plantillasInsignias)||void 0===t?void 0:t.id_organizaciones)===m}))),L(null===(o=n.recommendations)||void 0===o?void 0:o.recommendations.filter((function(e){var t;return(null===(t=e.plantillasInsignias)||void 0===t?void 0:t.id_organizaciones)===m})))),N(null===(t=n.recommendations)||void 0===t?void 0:t.recommendations);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),de=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/templateBadge/getTemplatesBadges");case 2:t=e.sent,a=t.data,z(a.templatesBadges);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ue=function(e,t,a){switch(a){case"delete":me(t);break;case"edit":j.push("/recommendations/edit/".concat(Object(Ie.b)(t)));break;case"create":j.push("/recommendations/create")}},me=function(e){F.a.fire({text:oe("alerts:alerts.delete-register"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:oe("buttons:buttons.accept"),cancelButtonText:oe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&be(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},be=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/recommendation/".concat(t),{data:{id_usuarios:null===(a=l.data_user)||void 0===a?void 0:a.id}});case 3:n=e.sent,i=n.data,le(),i&&F.a.fire({text:oe("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),e.next=14;break;case 9:e.prev=9,e.t0=e.catch(0),F.a.fire({text:oe("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),j.push("/500"),window.location.reload();case 14:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}(),pe=function(e,t){if(c.includes("Editar")){var a=!1;return(ie||re)&&(a=!ae.includes(t)),Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"edit",onClick:function(t){return ue(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})}},je=function(e,t){if(c.includes("Eliminar")){var a=!1;return(ie||re)&&(a=!ae.includes(t)),Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"delete",onClick:function(t){return ue(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})}},fe=function(e){var t=0;if(k.map((function(a){return a.id_plantillas===e&&(t+=1)})),0!==t)return Object(n.jsxs)(yn.a,{align:"center",children:[t,Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.recommended-templates"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return he(t,e)},children:Object(n.jsx)(Ge.a,{})})})]})},he=function(t,a){o(0),e.history.push("/recommendations/templatesRecommendations/".concat(Object(Ie.b)(a)))},ge=function(){return oe("tables:table.columns-recommendations",{returnObjects:!0})};function xe(e){var t,a,i,r,c,s=e.row,l=null;return A.map((function(e){e.id===s.id_plantillas&&(l=e.linkPhoto)})),Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(_n.a,{align:"center",children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{alt:"Remy Sharp",src:l,className:p.large})}),Object(n.jsx)(yn.a,{align:"center",children:null===(t=s.plantillasInsignias)||void 0===t?void 0:t.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(a=s.plantillasInsignias)||void 0===a?void 0:a.nombre_privado}),fe(null===(i=s.plantillasInsignias)||void 0===i?void 0:i.id),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.history"),children:Object(n.jsx)(S.a,{"aria-label":"history",children:Object(n.jsx)(dr.a,{onClick:function(e){var t,a;return a=null===(t=s.plantillasInsignias)||void 0===t?void 0:t.id,o(0),void j.push("/recommendations/history/".concat(Object(Ie.b)(a)))}})})})}),Object(n.jsx)(yn.a,{align:"center",children:pe(null===(r=s.plantillasInsignias)||void 0===r?void 0:r.id,s.id)}),Object(n.jsx)(yn.a,{align:"center",children:je(null===(c=s.plantillasInsignias)||void 0===c?void 0:c.id,s.id)})]},s.id)})}return Object(n.jsxs)(n.Fragment,{children:[c.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:p.button,onClick:function(e){return ue(0,0,"create")},children:Object(n.jsx)("span",{children:oe("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"recomendations",type:"badges",items:_,setItems:L,changePage:o,loadData:se,userGroupId:l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,organizationId:m,setLoading:$}),Object(n.jsx)(zn,{columns:ge(),rows:M,setDirection:q,setOrderBy:Q,loading:Z,children:Object(n.jsx)(vn.a,{children:Z?Object(n.jsx)(qn,{columns:ge(),photo:1}):M.length>0?Object(n.jsx)(n.Fragment,{children:function(e){var t={};return e=e.filter((function(e){return!t[e.id_plantillas]&&(t[e.id_plantillas]=!0)})),Object(I.J)(e,Object(I.f)(Y,G)).slice(a*r,a*r+r).map((function(e,t){return Object(n.jsx)(xe,{row:e},e.id)}))}(M)}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:oe("tables:table.empty-table")})})})})]})})),pr=a(404),jr=Object(C.a)((function(e){return{large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:5,padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var fr={changePage:I.b,changeBreadcrump:I.a},hr=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"recomendaciones"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),fr)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=e.permission,o=e.user,s=e.organizationId,l=e.changePage,m=e.searchValue,b=Object(u.g)(),p=jr(),j=Object(i.useState)([]),x=Object(d.a)(j,2),O=x[0],v=x[1],_=Object(i.useState)([]),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(i.useState)([]),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)(""),E=Object(d.a)(A,2),z=E[0],P=E[1],R=Object(i.useState)(""),M=Object(d.a)(R,2),L=M[0],F=M[1],U=Object(i.useState)(!0),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(D.a)(["tables","buttons","alerts","breadCrumps"]),V=Object(d.a)(H,1)[0];Object(i.useEffect)((function(){c.includes("Leer")?G().catch((function(){b.push("/500"),window.location.reload()})):(b.push("/dashboard"),window.location.reload())}),[]);var G=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m&&""!==m){e.next=3;break}return e.next=3,Q();case 3:return e.next=5,J();case 5:r(V("breadCrumps:breadCrumps.badge-recommendation-assigned",{returnObjects:!0})),q(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,l,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/recommendation/getRecommendations",{id_plantillas:a});case 3:n=t.sent,i=n.data,1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?(v(null===(r=i.recommendations)||void 0===r?void 0:r.recommendations),C(null===(c=i.recommendations)||void 0===c?void 0:c.recommendations)):(v(null===(l=i.recommendations)||void 0===l?void 0:l.recommendations.filter((function(e){var t;return(null===(t=e.plantillasInsignias)||void 0===t?void 0:t.id_organizaciones)===s}))),C(null===(d=i.recommendations)||void 0===d?void 0:d.recommendations.filter((function(e){var t;return(null===(t=e.plantillasInsignias)||void 0===t?void 0:t.id_organizaciones)===s}))));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),J=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/templateBadge/getTemplatesBadges");case 2:t=e.sent,a=t.data,T(a.templatesBadges);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(e){var t=null;return B.map((function(a){a.id===e&&(t=a.linkPhoto)})),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{alt:"Remy Sharp",src:t,className:p.large})})},Z=function(e){var t=null;return B.map((function(a){a.id===e&&(t=a.organizaciones.nombre)})),Object(n.jsx)(yn.a,{align:"center",children:t})},$=function(){return V("tables:table.columns-recommended-assigned",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"badgeTemplateRecomendations",items:O,setItems:C,changePage:l,loadData:G,userGroupId:o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,organizationId:s,groupId:Object(Ie.a)(e.match.params.id),setLoading:q}),Object(n.jsx)(zn,{columns:$(),rows:w,setDirection:P,setOrderBy:F,loading:Y,children:Object(n.jsx)(vn.a,{children:Y?Object(n.jsx)(qn,{columns:$(),photo:1}):w.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(w,Object(I.f)(z,L)).slice(t*a,t*a+a).map((function(t){var a,i,r,c,o;return Object(n.jsxs)(_n.a,{children:[X(null===(i=t.plantillasInsigniasRecomendadas)||void 0===i?void 0:i.id),Object(n.jsx)(yn.a,{align:"center",children:null===(r=t.plantillasInsigniasRecomendadas)||void 0===r?void 0:r.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(c=t.plantillasInsigniasRecomendadas)||void 0===c?void 0:c.nombre_privado}),Z(null===(o=t.plantillasInsigniasRecomendadas)||void 0===o?void 0:o.id),Object(n.jsx)(yn.a,{align:"center",children:Ne()(t.plantillasInsigniasRecomendadas.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm")}),Object(n.jsx)(yn.a,{align:"center",children:1===t.plantillasInsigniasRecomendadas.estado?V("tables:table.state.published"):2===t.plantillasInsigniasRecomendadas.estado?V("tables:table.state.archived"):0===t.plantillasInsigniasRecomendadas.estado?V("tables:table.state.edited"):""}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:V("tables:table.tooltip.view-template"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(a){var n,i;return i=null===(n=t.plantillasInsigniasRecomendadas)||void 0===n?void 0:n.id,void e.history.push("/templates/published/details/".concat(Object(Ie.b)(i)))},children:Object(n.jsx)(Ge.a,{})})})})]},null===(a=t.plantillasInsigniasRecomendadas)||void 0===a?void 0:a.id)}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:V("tables:table.empty-table")})})})]})}));var gr=Object(C.a)((function(){return{root:{display:"flex",alignItems:"center",border:"2.8px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",marginTop:"1rem"},badges:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}}}})),xr={changeBreadcrump:I.a},Or=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage}}),xr)((function(e){var t,a,r,c,o,s=e.page,l=e.rowsPerPage,u=e.changeBreadcrump,m=gr(),b=Object(i.useState)({}),p=Object(d.a)(b,2),j=p[0],g=p[1],x=Object(i.useState)({}),y=Object(d.a)(x,2),w=y[0],C=y[1],k=Object(i.useState)(""),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)(!1),E=Object(d.a)(A,2),z=E[0],P=E[1],R=Object(i.useState)([]),M=Object(d.a)(R,2),L=M[0],F=M[1],U=Object(i.useState)(""),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(""),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!0),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(D.a)(["tables","breadCrumps","dialogs"]),te=Object(d.a)(ee,1)[0];Object(i.useEffect)((function(){ae().catch((function(){j.push("/500"),window.location.reload()}))}),[]);var ae=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ie();case 2:return e.next=4,ne();case 4:u(te("breadCrumps:breadCrumps.badge-recommendation-history",{returnObjects:!0})),$(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/parameterValueParameter/getParameterValueParameter");case 2:t=e.sent,a=t.data,F(a.parametersValueParameters);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/recommendation/getRecommendations",{id_plantillas:n});case 3:i=t.sent,r=i.data,g(null===(a=r.recommendations)||void 0===a?void 0:a.history.filter((function(e){return e.campo_actual.split(",")[0]==="id_plantillas = ".concat(n.toString())})));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),re=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split(",")[1].split("=")[1],e.next=3,Ce.a.get("/templateHability/".concat(parseInt(n)));case 3:i=e.sent,r=i.data,C(r.templateHability),"39"===a?T(te("dialogs:dialog.state-added")):"38"===a&&T(te("dialogs:dialog.state-deleted")),P(!0);case 8:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),ce=function(){return te("tables:table.columns-history",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(zn,{columns:ce(),rows:j,setDirection:q,setOrderBy:Q,children:Object(n.jsx)(vn.a,{children:Z?Object(n.jsx)(qn,{columns:ce(),photo:0}):j.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(j,Object(I.f)(Y,G)).slice(s*l,s*l+l).map((function(e){var t,a,i;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(t=e.usuarios)||void 0===t?void 0:t.primer_nombre," ").concat(null===(a=e.usuarios)||void 0===a?void 0:a.primer_apellido)}),(i=e.accion,L.map((function(e){if(e.id===parseInt(i))return Object(n.jsx)(yn.a,{align:"center",children:e.valor_parametro})}))),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:te("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return re(e.campo_actual,e.accion)},children:Object(n.jsx)(Ge.a,{})})})})]},e.id)}))}):Object(n.jsx)(qn,{columns:ce(),photo:0})})}),Object(n.jsxs)(O.a,{open:z,onClose:function(){P(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.details")}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsxs)(ye.a,{container:!0,xs:12,className:m.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(Qi.a,{severity:"info",children:B})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:m.badges,children:Object(n.jsx)(It,{badgeImage:w.linkPhoto,badgeName:null===(t=w.templateBadge)||void 0===t?void 0:t.nombre,badgePrivateName:null===(a=w.templateBadge)||void 0===a?void 0:a.nombre_privado,organizationName:null===(r=w.templateBadge)||void 0===r||null===(c=r.organizaciones)||void 0===c?void 0:c.nombre,issuedId:Object(Ie.b)(null===(o=w.templateBadge)||void 0===o?void 0:o.id),publicBadge:!1,templateBadge:!0})})})]})})]})]})})),vr=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},large:{width:"auto",height:e.spacing(10),margin:"auto"},lista:{backgroundColor:"#F8F9F9"}}}));var _r={changePage:I.b,changeBreadcrump:I.a},yr=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"recomendaciones certificados"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),_r)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.permission,o=e.changeBreadcrump,s=e.changePage,l=e.user,m=e.organizationId,b=e.searchValue,p=vr(),j=Object(u.g)(),O=Object(i.useState)([]),v=Object(d.a)(O,2),_=v[0],y=v[1],w=Object(i.useState)([]),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)([]),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(""),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(""),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!0),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)([]),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ie=6===l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,re=6===(null===(t=l.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),ce=Object(D.a)(["tables","buttons","alerts","breadCrumps"]),oe=Object(d.a)(ce,1)[0];Object(i.useEffect)((function(){c.includes("Leer")?se().catch((function(){j.push("/500"),window.location.reload()})):(j.push("/dashboard"),window.location.reload())}),[]);var se=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(b&&""!==b){e.next=3;break}return e.next=3,le();case 3:return e.next=5,de();case 5:o(oe("breadCrumps:breadCrumps.certificate-recommendation",{returnObjects:!0})),$(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/recommendation/getRecommendations");case 2:a=e.sent,n=a.data,1===l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?(y(null===(i=n.recommendations)||void 0===i?void 0:i.recommendationsCertificate),L(null===(r=n.recommendations)||void 0===r?void 0:r.recommendationsCertificate)):(s=n.recommendations.history.filter((function(e){return e.id_usuarios===l.data_user.id&&39===parseInt(e.accion)})).map((function(e){if(e.id_campo)return e.id_campo})),ne(s),y(null===(c=n.recommendations)||void 0===c?void 0:c.recommendationsCertificate.filter((function(e){var t;return(null===(t=e.plantillasCertificados)||void 0===t?void 0:t.id_organizaciones)===m}))),L(null===(o=n.recommendations)||void 0===o?void 0:o.recommendationsCertificate.filter((function(e){var t;return(null===(t=e.plantillasCertificados)||void 0===t?void 0:t.id_organizaciones)===m})))),N(null===(t=n.recommendations)||void 0===t?void 0:t.recommendationsCertificate);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),de=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/certificateTemplate/getCertificateTemplates");case 2:t=e.sent,a=t.data,z(a.certificateTemplates);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ue=function(e,t,a){switch(a){case"delete":me(t);break;case"edit":j.push("/recommendations/certificate/edit/".concat(Object(Ie.b)(t)));break;case"create":j.push("/recommendations/certificate/create")}},me=function(e){F.a.fire({text:oe("alerts:alerts.delete-register"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:oe("buttons:buttons.accept"),cancelButtonText:oe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&be(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},be=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/recommendation/".concat(t),{data:{id_usuarios:null===(a=l.data_user)||void 0===a?void 0:a.id}});case 3:n=e.sent,i=n.data,le(),i&&F.a.fire({text:oe("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),e.next=14;break;case 9:e.prev=9,e.t0=e.catch(0),F.a.fire({text:oe("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),j.push("/500"),window.location.reload();case 14:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}(),pe=function(e,t){if(c.includes("Editar")){var a=!1;return(ie||re)&&(a=!ae.includes(t)),Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"edit",onClick:function(t){return ue(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})}},je=function(e,t){if(c.includes("Eliminar")){var a=!1;return(ie||re)&&(a=!ae.includes(t)),Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"delete",onClick:function(t){return ue(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})}},fe=function(e){var t=0;if(k.map((function(a){return a.id_plantillas_certificados===e&&(t+=1)})),0!==t)return Object(n.jsxs)(yn.a,{align:"center",children:[t,Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.recommended-templates"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return he(t,e)},children:Object(n.jsx)(Ge.a,{})})})]})},he=function(t,a){e.history.push("/recommendations/certificate/templatesRecommendations/".concat(Object(Ie.b)(a)))},ge=function(){return oe("tables:table.columns-certificate-recommendations",{returnObjects:!0})};function xe(e){var t,a,i,r,c,o=e.row,l=null;return A.map((function(e){e.id===o.id_plantillas_certificados&&(l=e.linkPhoto)})),Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(_n.a,{align:"center",children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:l,className:p.large})}),Object(n.jsx)(yn.a,{align:"center",children:null===(t=o.plantillasCertificados)||void 0===t?void 0:t.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(a=o.plantillasCertificados)||void 0===a?void 0:a.nombre_privado}),fe(null===(i=o.plantillasCertificados)||void 0===i?void 0:i.id),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.history"),children:Object(n.jsx)(S.a,{"aria-label":"history",children:Object(n.jsx)(dr.a,{onClick:function(e){var t,a;return a=null===(t=o.plantillasCertificados)||void 0===t?void 0:t.id,s(0),void j.push("/recommendations/certificate/history/".concat(Object(Ie.b)(a)))}})})})}),Object(n.jsx)(yn.a,{align:"center",children:pe(null===(r=o.plantillasCertificados)||void 0===r?void 0:r.id,o.id)}),Object(n.jsx)(yn.a,{align:"center",children:je(null===(c=o.plantillasCertificados)||void 0===c?void 0:c.id,o.id)})]},o.id)})}return Object(n.jsxs)(n.Fragment,{children:[c.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:p.button,onClick:function(e){return ue(0,0,"create")},children:Object(n.jsx)("span",{children:oe("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"recomendations",type:"certificates",items:_,setItems:L,changePage:s,loadData:se,userGroupId:l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,organizationId:m,setLoading:$}),Object(n.jsx)(zn,{columns:ge(),rows:M,setDirection:q,setOrderBy:Q,loading:Z,children:Object(n.jsx)(vn.a,{children:Z?Object(n.jsx)(qn,{columns:ge(),photo:1}):M.length>0?Object(n.jsx)(n.Fragment,{children:function(e){var t={};return e=e.filter((function(e){return!t[e.id_plantillas_certificados]&&(t[e.id_plantillas_certificados]=!0)})),Object(I.J)(e,Object(I.f)(Y,G)).slice(a*r,a*r+r).map((function(e,t){return Object(n.jsx)(xe,{row:e},e.id)}))}(M)}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:oe("tables:table.empty-table")})})})})]})})),wr=a(405),Cr=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var kr={changePage:I.b,changeBreadcrump:I.a},Nr=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"recomendaciones certificados"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),kr)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=e.permission,o=e.user,s=e.organizationId,l=e.changePage,m=e.searchValue,b=Object(u.g)(),p=Cr(),j=Object(i.useState)([]),x=Object(d.a)(j,2),O=x[0],v=x[1],_=Object(i.useState)([]),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(i.useState)([]),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)(""),E=Object(d.a)(A,2),z=E[0],P=E[1],R=Object(i.useState)(""),M=Object(d.a)(R,2),L=M[0],F=M[1],U=Object(i.useState)(!0),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(D.a)(["tables","buttons","alerts","breadCrumps"]),V=Object(d.a)(H,1)[0];Object(i.useEffect)((function(){c.includes("Leer")?G():(b.push("/dashboard"),window.location.reload())}),[]);var G=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m&&""!==m){e.next=3;break}return e.next=3,Q();case 3:return e.next=5,J();case 5:r(V("breadCrumps:breadCrumps.certificate-recommendation-assigned",{returnObjects:!0})),q(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,l,d;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/recommendation/getRecommendations",{id_plantillas_certificados:a});case 3:n=t.sent,i=n.data,1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?(v(null===(r=i.recommendations)||void 0===r?void 0:r.recommendationsCertificate),C(null===(c=i.recommendations)||void 0===c?void 0:c.recommendationsCertificate)):(v(null===(l=i.recommendations)||void 0===l?void 0:l.recommendationsCertificate.filter((function(e){var t;return(null===(t=e.plantillasCertificados)||void 0===t?void 0:t.id_organizaciones)===s}))),C(null===(d=i.recommendations)||void 0===d?void 0:d.recommendationsCertificate.filter((function(e){var t;return(null===(t=e.plantillasCertificados)||void 0===t?void 0:t.id_organizaciones)===s}))));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),J=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/certificateTemplate/getCertificateTemplates");case 2:t=e.sent,a=t.data,T(a.certificateTemplates);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(e){var t=null;return B.map((function(a){a.id===e&&(t=a.linkPhoto)})),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:t,className:p.large})})},Z=function(e){var t=null;return B.map((function(a){a.id===e&&(t=a.organizaciones.nombre)})),Object(n.jsx)(yn.a,{align:"center",children:t})},$=function(){return V("tables:table.columns-certificate-recommended-assigned",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"certificateTemplateRecomendations",items:O,setItems:C,changePage:l,loadData:G,userGroupId:o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,organizationId:s,groupId:Object(Ie.a)(e.match.params.id),setLoading:q}),Object(n.jsx)(zn,{columns:$(),rows:w,setDirection:P,setOrderBy:F,loading:Y,children:Object(n.jsx)(vn.a,{children:Y?Object(n.jsx)(qn,{columns:$(),photo:1}):w.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(w,Object(I.f)(z,L)).slice(t*a,t*a+a).map((function(t){var a,i,r,c,o;return Object(n.jsxs)(_n.a,{children:[X(null===(i=t.plantillasCertificadosRecomendadas)||void 0===i?void 0:i.id),Object(n.jsx)(yn.a,{align:"center",children:null===(r=t.plantillasCertificadosRecomendadas)||void 0===r?void 0:r.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(c=t.plantillasCertificadosRecomendadas)||void 0===c?void 0:c.nombre_privado}),Z(null===(o=t.plantillasCertificadosRecomendadas)||void 0===o?void 0:o.id),Object(n.jsx)(yn.a,{align:"center",children:Ne()(t.plantillasCertificadosRecomendadas.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm")}),Object(n.jsx)(yn.a,{align:"center",children:1===t.plantillasCertificadosRecomendadas.estado?V("tables:table.state.published"):2===t.plantillasCertificadosRecomendadas.estado?V("tables:table.state.archived"):0===t.plantillasCertificadosRecomendadas.estado?V("tables:table.state.edited"):""}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:V("tables:table.tooltip.view-template"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(a){var n,i;return i=null===(n=t.plantillasCertificadosRecomendadas)||void 0===n?void 0:n.id,void e.history.push("/certificates/details/".concat(Object(Ie.b)(i)))},children:Object(n.jsx)(Ge.a,{})})})})]},null===(a=t.plantillasCertificadosRecomendadas)||void 0===a?void 0:a.id)}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:V("tables:table.empty-table")})})})]})}));var Br=Object(C.a)((function(){return{root:{display:"flex",alignItems:"center",border:"2.8px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",marginTop:"1rem"},badges:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}}}})),Sr={changeBreadcrump:I.a},Tr=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage}}),Sr)((function(e){var t,a,r,c,o,s=e.page,l=e.rowsPerPage,u=e.changeBreadcrump,m=Br(),b=Object(i.useState)({}),p=Object(d.a)(b,2),j=p[0],g=p[1],x=Object(i.useState)({}),y=Object(d.a)(x,2),w=y[0],C=y[1],k=Object(i.useState)(""),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)(!1),E=Object(d.a)(A,2),z=E[0],P=E[1],R=Object(i.useState)([]),M=Object(d.a)(R,2),L=M[0],F=M[1],U=Object(i.useState)(""),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(""),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!0),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(D.a)(["tables","breadCrumps","dialogs"]),te=Object(d.a)(ee,1)[0];Object(i.useEffect)((function(){ae().catch((function(){j.push("/500"),window.location.reload()}))}),[]);var ae=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ie();case 2:return e.next=4,ne();case 4:u(te("breadCrumps:breadCrumps.certificate-recommendation-history",{returnObjects:!0})),$(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/parameterValueParameter/getParameterValueParameter");case 2:t=e.sent,a=t.data,F(a.parametersValueParameters);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/recommendation/getRecommendations",{id_plantillas_certificados:n});case 3:i=t.sent,r=i.data,g(null===(a=r.recommendations)||void 0===a?void 0:a.history.filter((function(e){return e.campo_actual.split(",")[0]==="id_plantillas_certificados = ".concat(n.toString())})));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),re=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split(",")[1].split("=")[1],e.next=3,Ce.a.get("/certificateTemplate/".concat(parseInt(n)));case 3:i=e.sent,r=i.data,C(r.certificateTemplate),"39"===a?T(te("dialogs:dialog.state-added")):"38"===a&&T(te("dialogs:dialog.state-deleted")),P(!0);case 8:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),ce=function(){return te("tables:table.columns-history",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(zn,{columns:ce(),rows:j,setDirection:q,setOrderBy:Q,children:Object(n.jsx)(vn.a,{children:Z?Object(n.jsx)(qn,{columns:ce(),photo:0}):j.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(j,Object(I.f)(Y,G)).slice(s*l,s*l+l).map((function(e){var t,a,i;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(t=e.usuarios)||void 0===t?void 0:t.primer_nombre," ").concat(null===(a=e.usuarios)||void 0===a?void 0:a.primer_apellido)}),(i=e.accion,L.map((function(e){if(e.id===parseInt(i))return Object(n.jsx)(yn.a,{align:"center",children:e.valor_parametro})}))),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:te("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return re(e.campo_actual,e.accion)},children:Object(n.jsx)(Ge.a,{})})})})]},e.id)}))}):Object(n.jsx)(qn,{columns:ce,photo:0})})}),Object(n.jsxs)(O.a,{open:z,onClose:function(){P(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.details")}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsxs)(ye.a,{container:!0,xs:12,className:m.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(Qi.a,{severity:"info",children:B})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)("div",{className:m.badges,children:Object(n.jsx)(It,{badgeImage:w.linkPhoto,badgeName:null===w||void 0===w||null===(t=w.certificateTemplate)||void 0===t?void 0:t.nombre,badgePrivateName:null===w||void 0===w||null===(a=w.certificateTemplate)||void 0===a?void 0:a.nombre_privado,organizationName:null===w||void 0===w||null===(r=w.certificateTemplate)||void 0===r||null===(c=r.organizaciones)||void 0===c?void 0:c.nombre,issuedId:Object(Ie.b)(null===w||void 0===w||null===(o=w.certificateTemplate)||void 0===o?void 0:o.id),publicBadge:!1,templateBadge:!1,templateCertificate:!0})})})]})})]})]})})),Ar=a(1182),Er=a(1183),Ir=a(1184),Dr=a(1240),zr=a(1181),Pr=Object(C.a)((function(e){return{root:{flexGrow:1},paper:{backgroundColor:"#ffffff"},tab:{color:"#000000"},indicator:{backgroundColor:E.a.primary,color:E.a.primary},link:{padding:"0",textAlign:"center"}}}));var Rr=function(e){var t=e.Index,a=e.TabsHeader,r=Pr(),c=Object(i.useState)(t),o=Object(d.a)(c,2),s=o[0],u=o[1];return Object(n.jsx)("div",{className:r.root,children:Object(n.jsx)(kn.a,{className:r.paper,elevation:0,children:Object(n.jsx)(Dr.a,{value:s,variant:"scrollable",scrollButtons:"on",onChange:function(e,t){u(t)},classes:{indicator:r.indicator},indicatorColor:"primary",textColor:"primary",centered:!0,children:a.map((function(e){return Object(n.jsx)(l.b,{id:"linkMenu",className:"list-group-item list-group-item-action ".concat(r.link),to:e.route,children:Object(n.jsx)(zr.a,{className:r.tab,label:e.label,selected:!0})})}))})})})},Mr=Object(C.a)((function(){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var Lr=Object(s.b)((function(e){return{permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),null)((function(e){var t=e.children,a=e.Index,i=e.permission,r=Mr(),c=Object(u.g)(),o=Object(D.a)(["tabs","buttons"]),s=Object(d.a)(o,1)[0],l=s("tabs:tabs.tabs-badge",{returnObjects:!0});return Object(n.jsxs)(n.Fragment,{children:[i.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:r.button,onClick:function(){return c.push("/templates/create")},disableElevation:!0,children:Object(n.jsx)("span",{children:s("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),function(){if(i.includes("Leer"))return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Rr,{Index:a,TabsHeader:l}),t]});c.push("/dashboard"),window.location.reload()}()]})}));var Fr=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"2em"},img:{width:e.spacing(30),height:e.spacing(30)},img_verificado:Object(b.a)({display:"none"},e.breakpoints.up("sm"),{display:"inline",height:e.spacing(5)}),divider:{marginRight:"2em"},badges:{pointerEvents:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}},textTitle:{color:"#5d5d5d",fontWeight:"bold"},textParagraph:{textAlign:"justify",color:"#5c5c5c"},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},avatar:{width:"auto",height:"auto"},icon:{margin:20,fontSize:"4em"},link:{color:E.a.primary,textDecoration:"underline"}}})),Ur={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},Wr=Object(s.b)((function(e){return{styles:e.styles}}),null)((function(e){var t,a,i,r,c,o,s=e.vista,l=e.children,u=e.styles,b=Fr(),p=Object(D.a)(["certificateBadgeTemplate"]),j=Object(d.a)(p,1)[0],f="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2));return Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Rt.a,{className:b.container,children:Object(n.jsxs)(ye.a,{container:!0,spacing:0,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,className:"text-center",children:[Object(n.jsx)("img",{alt:"img-badge",src:null===s||void 0===s?void 0:s.img_prev,className:b.img}),Object(n.jsxs)("div",{children:[Object(n.jsx)(we.a,{className:b.textTitle,children:j("details.issued-by")}),null!==s.id_organizacion_hija?Object(n.jsx)(we.a,{className:b.text,children:null===s||void 0===s||null===(i=s.organizacionesHijas)||void 0===i?void 0:i.nombre}):Object(n.jsx)(we.a,{className:b.text,children:null===s||void 0===s||null===(r=s.organizaciones)||void 0===r?void 0:r.nombre})]}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:b.textBolder,children:[j("details.created"),":"]}),Object(n.jsx)(we.a,{className:b.text,children:Ne()(s.fecha_creacion).format("DD-MM-YYYY")})]})]}),Object(n.jsx)(W.a,{orientation:"vertical",flexItem:!0,className:b.divider}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:7,children:[Object(n.jsx)("div",{className:b.header,children:Object(n.jsxs)(ye.a,{container:!0,spacing:0,children:[Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:b.textTitle,children:s.nombre}),Object(n.jsx)("img",{alt:"img_verificado",src:f?Jt:u.icon_verificado,className:b.img_verificado})]})}),Object(n.jsx)(we.a,{className:b.textParagraph,gutterBottom:!0,children:s.descripcion}),Object(n.jsx)(we.a,{className:b.textBolder,gutterBottom:!0,children:j("details.criteria")}),null===s||void 0===s||null===(c=s.criterios)||void 0===c?void 0:c.map((function(e,t){return Object(n.jsx)(we.a,{className:b.text,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))})),Object(n.jsxs)(ye.a,{container:!0,spacing:2,align:"center",className:b.root,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:b.textTitle,children:s.niveles}),Object(n.jsxs)(we.a,{className:b.text,children:[" ",j("details.level")]})]}),null!==(null===s||void 0===s?void 0:s.cantidad_tiempo)&&void 0!==(null===s||void 0===s?void 0:s.tiempos)?Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:b.textTitle,children:"".concat(null===s||void 0===s?void 0:s.cantidad_tiempo," ").concat(s.tiempos)}),Object(n.jsxs)(we.a,{className:b.text,children:[" ",j("details.time")]})]}):"",Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:b.textTitle,children:s.costos}),Object(n.jsxs)(we.a,{className:b.text,children:[" ",j("details.cost")]})]})]}),Object(n.jsxs)(ye.a,{container:!0,className:b.root,children:[Object(n.jsxs)(ye.a,{item:!0,lg:12,sm:12,xs:12,children:[Object(n.jsxs)(we.a,{className:b.textBolder,children:[" ",j("details.skills")]}),Object(n.jsx)(ye.a,{container:!0,children:null===s||void 0===s?void 0:s.id_habilidades.map((function(e){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Ur),{},{children:Object(n.jsx)(we.a,{children:e.descripcion})}))})}))})]}),Object(n.jsx)(ye.a,{item:!0,lg:12,sm:12,xs:12,children:(null===(o=s.id_plantillas_recomendadas)||void 0===o?void 0:o.length)>0?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{className:b.textBolder,children:[" ",j("details.recommendations"),":"]}),Object(n.jsx)("div",{className:b.badges,children:l})]}):""}),(null===s||void 0===s?void 0:s.url)&&Object(n.jsxs)(we.a,{className:b.link,children:[j("details.additional")," ",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]})]})]})})})})),Yr=Object(C.a)((function(e){return{large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},buttonForm:{margin:"0.5em",padding:"9px 40px"},iconButton:{margin:"0em -.4em"}}}));var qr={changeBreadcrump:I.a,changePage:I.b},Hr=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),qr)((function(e){var t,a,r,c,o,s,l=e.page,b=e.rowsPerPage,j=e.changeBreadcrump,y=e.user,w=e.organizationId,C=e.permission,k=e.changePage,N=e.searchValue,B=Object(u.g)(),T=Object(i.useState)(!1),A=Object(d.a)(T,2),z=A[0],P=A[1],R=Object(i.useState)([]),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)([]),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],V=Object(i.useState)(L),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)({}),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)({}),ae=Object(d.a)(te,2),ne=ae[0],ie=ae[1],re=Object(i.useState)({}),ce=Object(d.a)(re,2),oe=ce[0],se=ce[1],le=Object(i.useState)({}),de=Object(d.a)(le,2),ue=de[0],me=de[1],be=Object(i.useState)(!1),pe=Object(d.a)(be,2),fe=pe[0],he=pe[1],ge=Object(i.useState)(""),xe=Object(d.a)(ge,2),Oe=xe[0],ve=xe[1],_e=Object(i.useState)(""),ye=Object(d.a)(_e,2),we=ye[0],ke=ye[1],Be=Object(i.useState)(),Se=Object(d.a)(Be,2),Te=Se[0],Ee=Se[1],De=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),ze=Object(d.a)(De,1)[0],Pe=Yr();Object(i.useEffect)((function(){k(0),Me().catch((function(){B.push("/500"),window.location.reload()})),j(Re())}),[]);var Re=function(){return ze("breadCrumps:breadCrumps.badge-published",{returnObjects:!0})},Me=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(P(!0),N&&""!==N){e.next=4;break}return e.next=4,Ve();case 4:return P(!1),e.next=7,Qe();case 7:return e.next=9,Le();case 9:return e.next=11,Fe();case 11:return e.next=13,Ue();case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,ie(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,me(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,se(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),We=1===y.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===y.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Ye=6===y.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,qe=6===(null===(t=y.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),He=(null===y||void 0===y||null===(a=y.data_user)||void 0===a||null===(r=a.gruposUsuariosOrganizaciones[0])||void 0===r||null===(c=r.organizaciones)||void 0===c||null===(o=c.organizacionesRelaciones)||void 0===o?void 0:o.length)>0,Ke=function(e,t){var a={limit:t||10,offset:e?e*t:0};return We||(a.id_organizaciones=w),(Ye||qe)&&(a.id_usuarios=y.data_user.id),a},Ve=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Ke(0,b),e.next=3,Ce.a.post("/templateBadge/getTemplatesBadgesPublished",i);case 3:r=e.sent,c=r.data,U(null===(t=c.templatesBadges)||void 0===t?void 0:t.rows),J(null===(a=c.templatesBadges)||void 0===a?void 0:a.rows),Ee(null===(n=c.templatesBadges)||void 0===n?void 0:n.count);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Qe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!We){e.next=8;break}return e.next=3,Ce.a.post("/templateBadge/getTemplatesBadges");case 3:t=e.sent,a=t.data,H(a.templatesBadges),e.next=13;break;case 8:return e.next=10,Ce.a.post("/templateBadge/getTemplatesBadges",{id_organizaciones:w});case 10:n=e.sent,i=n.data,H(Ye||qe?i.templatesBadges.filter((function(e){return e.plantillasInsigniasHistorial[0].id_usuarios===y.data_user.id})):i.templatesBadges);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Je=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P(!0),i=Ke(t,a),e.next=4,Ce.a.post("/templateBadge/getTemplatesBadgesPublished",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(L),Object(p.a)(null===(n=c.templatesBadges)||void 0===n?void 0:n.rows.filter((function(e){return!L.find((function(t){return t.id===e.id}))})))),U(o),J(o),P(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Xe=function(e){var t=null;return q.map((function(a){a.id===e&&(t=a.linkPhoto)})),t},Ze=function(e,t,a,n){switch(a){case"copy":$e(e,t,n);break;case"edit":B.push("/templates/edit/".concat(Object(Ie.b)(t)));break;case"archive":et(t);break;case"delete":tt(t)}},$e=function(e,t,a){F.a.fire({text:ze("alerts:alerts.copy-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var n=Object(h.a)(f.a.mark((function n(i){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i.value&&at(t,e,a);case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())},et=function(e){F.a.fire({text:ze("alerts:alerts.archive-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&nt(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},tt=function(e){F.a.fire({text:ze("alerts:alerts.delete-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&it(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},at=function(e,t,a){var n,i,r,c,o;t.preventDefault(),P(!0);var s,l=null===L||void 0===L?void 0:L.filter((function(t){return t.id===e})),d=Object(m.a)(Object(m.a)({},l[0]),{},{nombre:"".concat(null===(n=l[0])||void 0===n?void 0:n.nombre," copia"),nombre_privado:"".concat(null===(i=l[0])||void 0===i?void 0:i.nombre_privado," copia"),id_plantillas_recomendadas:null===(r=l[0])||void 0===r?void 0:r.recomendaciones.map((function(e){return{id_plantillas_recomendadas:e.id_plantillas_recomendadas}})),id_habilidades:null===(c=l[0])||void 0===c?void 0:c.plantillasHabilidades.map((function(e){return{id_habilidades:e.id_habilidades}})),id_usuarios:null===(o=y.data_user)||void 0===o?void 0:o.id,id_organizaciones:w});(Ce.a.post("/templateHability/",d).then((function(e){P(!1),B.push("/templates/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:ze("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){P(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:ze("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500}),B.push("/500"),window.location.reload()})),w===je.a.idEan&&a)&&Ce.a.put("/templateBadge/".concat(e),{estado:2,id_usuarios:null===(s=y.data_user)||void 0===s?void 0:s.id,fecha_ultima_modificacion:Date.now()}).catch((function(){B.push("/500"),window.location.reload()}))},nt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/templateBadge/".concat(t),{estado:2,id_usuarios:null===(a=y.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){B.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:ze("alerts:alerts.archived"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){B.push("/templates/archived")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),it=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/templateBadge/".concat(t),{data:{id_usuarios:null===(a=y.data_user)||void 0===a?void 0:a.id}}).catch((function(){B.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:ze("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){Me()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),rt=function(e,t){if(C.includes("Editar")){var a=!1;return(Ye||qe)&&(a=t!==y.data_user.id),Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"edit",onClick:function(t){return Ze(t,e,"edit")},className:Pe.iconButton,children:Object(n.jsx)(Wn,{})})})}},ct=function(e,t){if(C.includes("Copiar")){var a=!1;return(Ye||qe)&&(a=t!==y.data_user.id),Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.copy"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"copy",onClick:function(t){return Ze(t,e,"copy")},className:Pe.iconButton,children:Object(n.jsx)(Ar.a,{})})})}},ot=function(e,t){if(C.includes("Archivar")){var a=!1;return(Ye||qe)&&(a=t!==y.data_user.id),Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.archive"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"archive",onClick:function(t){return Ze(t,e,"archive")},className:Pe.iconButton,children:Object(n.jsx)(Er.a,{})})})}},st=function(e,t){if(C.includes("Eliminar")){var a=!1;return(Ye||qe)&&(a=t!==y.data_user.id),Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"delete",onClick:function(t){return Ze(t,e,"delete")},className:Pe.iconButton,children:Object(n.jsx)(Cn.a,{})})})}},lt=function(){he(!1)},dt=function(){return ze(We||He?"tables:table.columns-published-archived-super":"tables:table.columns-published-archived",{returnObjects:!0})},ut=function(e){return We?Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre}):e.organizacionesHijas?Object(n.jsx)(yn.a,{align:"center",children:e.organizacionesHijas.nombre}):void 0};return Object(n.jsxs)(Lr,{Index:0,children:[Object(n.jsx)(Fn,{tableName:"templateBadge",type:"published",items:L,setItems:J,setCountItems:Ee,changePage:k,loadData:Me,organizationId:1===y.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===y.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:w,deparmentCreater:{isDeparmentCreater:Ye,isDeparmentCreaterRoll:qe,userId:y.data_user.id},setLoading:P}),Object(n.jsx)(zn,{columns:dt(),rows:Te,setDirection:ve,setOrderBy:ke,loading:z,changePagination:Je,children:Object(n.jsx)(vn.a,{children:Q.length>0?z?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:dt(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(Q,Object(I.f)(Oe,we)).slice(l*b,l*b+b).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{variant:"rounded",alt:"Badges",src:e.linkPhoto,className:Pe.large})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),ut(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.insigniasEmitidas}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado?ze("tables:table.state.published"):" "}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return B.push("/templates/published/details/".concat(Object(Ie.b)(e.id)))},className:Pe.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:rt(e.id,e.plantillasInsigniasHistorial[0].id_usuarios)}),Object(n.jsx)(yn.a,{align:"center",children:(e.insigniasEmitidas,ct(e.id,e.plantillasInsigniasHistorial[0].id_usuarios))}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t,a,n,i,r,c,o,s=null===L||void 0===L?void 0:L.filter((function(t){return t.id===e})),l=ne.filter((function(e){return e.id===s[0].nivel_vp})),d=oe.filter((function(e){return e.id===s[0].tiempo_vp})),u=ue.filter((function(e){return e.id===s[0].costo_vp}));ee(Object(m.a)(Object(m.a)({},s[0]),{},{id_habilidades:null===(t=s[0])||void 0===t?void 0:t.plantillasHabilidades.map((function(e){return{id_habilidades:e.id_habilidades,descripcion:e.habilidades.descripcion}})),id_plantillas_recomendadas:null===(a=s[0])||void 0===a?void 0:a.recomendaciones.map((function(e){var t;return{id_plantillas_recomendadas:e.id_plantillas_recomendadas,nombre:null===(t=e.plantillasInsigniasRecomendadas)||void 0===t?void 0:t.nombre}})),criterios:null===(n=s[0])||void 0===n?void 0:n.criterios,img_prev:null===(i=s[0])||void 0===i?void 0:i.linkPhoto,niveles:null===(r=l[0])||void 0===r?void 0:r.valor_parametro,tiempos:null===(c=d[0])||void 0===c?void 0:c.valor_parametro,costos:null===(o=u[0])||void 0===o?void 0:o.valor_parametro})),he(!0)}(e.id)},className:Pe.iconButton,children:Object(n.jsx)(Ir.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:e.insigniasEmitidas>0?ot(e.id,e.plantillasInsigniasHistorial[0].id_usuarios):st(e.id,e.plantillasInsigniasHistorial[0].id_usuarios)})]},e.id)}))}):z?Object(n.jsx)(qn,{columns:dt(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:ze("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:fe,onClose:lt,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:lt,children:ze("dialogs:dialog.preview-title")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(Wr,{vista:$,children:null===$||void 0===$||null===(s=$.id_plantillas_recomendadas)||void 0===s?void 0:s.map((function(e,t){var a;return Object(n.jsx)(It,{badgeImage:Xe(e.id_plantillas_recomendadas),badgeName:e.nombre,organizationName:null===(a=$.organizaciones)||void 0===a?void 0:a.nombre,publicBadge:!1,templateBadge:!0},"badge".concat(t))}))})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(Pe.buttonForm),onClick:lt,children:ze("buttons:buttons.close")})})]})]})})),Kr=a(1185);var Vr=function(e){var t=e.children,a=e.Index,i=e.Buttons,r=e.BadgeId,c=Object(D.a)("tabs"),o=(0,Object(d.a)(c,1)[0])("tabs.tabs-details",{returnObjects:!0}),s=[{label:"Detalle",route:"/templates/published/details/".concat(Object(Ie.b)(r))},{label:"Historial",route:"/templates/published/history/".concat(Object(Ie.b)(r))}];return s.map((function(e,t){return o.filter((function(a,n){return t===n?e.label=a.label:""}))})),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:i}),Object(n.jsx)(Rr,{Index:a,TabsHeader:s}),t]})};var Gr=Object(C.a)((function(e){return{root:{marginTop:"2em",marginBottom:"2em"},icon:{margin:20,fontSize:"4em"},avatar:{width:"auto",height:"auto"},img:{marginLeft:"4em"},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textParagraph:{textAlign:"justify",color:"#5c5c5c",margin:"1em 0 1em 0"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 30px","&:hover":{backgroundColor:E.a.footer}},badges:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}},buttonForm:{margin:"0.5em",padding:"9px 40px"}}})),Qr={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},Jr={changeBreadcrump:I.a},Xr=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Jr)((function(e){var t,a,r,c,o,s,l,b,p,j=e.user,y=e.changeBreadcrump,w=e.permission,C=Object(u.g)(),k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],S=N[1],T=Object(i.useState)(!1),A=Object(d.a)(T,2),I=A[0],z=A[1],P=Object(i.useState)({}),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)([]),Y=Object(d.a)(U,2),q=Y[0],H=Y[1],V=Object(i.useState)([]),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)({}),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)({}),ae=Object(d.a)(te,2),ne=ae[0],ie=ae[1],re=Object(i.useState)({}),ce=Object(d.a)(re,2),oe=ce[0],se=ce[1],le=Object(i.useState)({}),de=Object(d.a)(le,2),ue=de[0],me=de[1],be=Object(i.useState)([]),pe=Object(d.a)(be,2),je=pe[0],fe=pe[1],he=Object(i.useState)([]),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ke=Object(i.useState)({}),Se=Object(d.a)(ke,2),Te=Se[0],Ee=Se[1],De=Object(i.useState)({}),ze=Object(d.a)(De,2),Pe=ze[0],Re=ze[1],Me=Object(i.useState)(!1),Le=Object(d.a)(Me,2),Fe=Le[0],Ue=Le[1],We=Object(D.a)(["certificateBadgeTemplate","tables","alerts","buttons","breadCrumps"]),Ye=Object(d.a)(We,1)[0],qe=Gr();Object(i.useEffect)((function(){He().catch((function(){C.push("/500"),window.location.reload()}))}),[]);var He=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(!0),e.next=3,Ke();case 3:S(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ke=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u,b,p,h,g,x,O,v,_,y,w,C,k,N,B,S,T,A,E,I,D,z,P,R,M,F,U,W;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return D=Object(Ie.a)(e.match.params.id),z=6===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,P=6===(null===(a=j.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===a?void 0:a.rol),t.next=5,Ce.a.get("/templateHability/".concat(D));case 5:R=t.sent,M=R.data,L(M.templateHability),H(null===(n=M.templateHability)||void 0===n||null===(i=n.templateBadge)||void 0===i?void 0:i.insigniasEmitidas),Ve(null===(r=M.templateHability)||void 0===r||null===(c=r.templateBadge)||void 0===c?void 0:c.tiempo_vp),Ge(null===(o=M.templateHability)||void 0===o||null===(s=o.templateBadge)||void 0===s?void 0:s.nivel_vp),Qe(null===(l=M.templateHability)||void 0===l||null===(d=l.templateBadge)||void 0===d?void 0:d.costo_vp),Je(null===(u=M.templateHability)||void 0===u||null===(b=u.templateBadge)||void 0===b?void 0:b.tipo_vp),J(null===(p=M.templateHability)||void 0===p?void 0:p.templateHability),fe(null===(h=M.templateHability)||void 0===h?void 0:h.criterion),Oe(null===(g=M.templateHability)||void 0===g?void 0:g.recommendation),Xe(null===(x=M.templateHability)||void 0===x||null===(O=x.templateBadge)||void 0===O?void 0:O.estado),Ee(Object(m.a)(Object(m.a)({},null===(v=M.templateHability)||void 0===v?void 0:v.templateBadge),{},{nombre:"".concat(null===(_=M.templateHability)||void 0===_||null===(y=_.templateBadge)||void 0===y?void 0:y.nombre," copia"),nombre_privado:"".concat(null===(w=M.templateHability)||void 0===w||null===(C=w.templateBadge)||void 0===C?void 0:C.nombre_privado," copia"),linkPhoto:null===(k=M.templateHability)||void 0===k?void 0:k.linkPhoto,id_plantillas_recomendadas:null===(N=M.templateHability)||void 0===N||null===(B=N.recommendation)||void 0===B?void 0:B.map((function(e){return{id_plantillas_recomendadas:e.id_plantillas_recomendadas}})),id_habilidades:null===(S=M.templateHability)||void 0===S||null===(T=S.templateHability)||void 0===T?void 0:T.map((function(e){return{id_habilidades:e.id_habilidades}})),criterios:null===(A=M.templateHability)||void 0===A||null===(E=A.criterion)||void 0===E?void 0:E.map((function(e){return{tipo_criterio_vp:e.tipo_criterio_vp,descripcion_criterio:null===e||void 0===e?void 0:e.descripcion_criterio,link:e.link}})),id_usuarios:null===(I=j.data_user)||void 0===I?void 0:I.id})),(z||P)&&((null===(F=M.templateHability)||void 0===F||null===(U=F.templateBadgeHistory)||void 0===U?void 0:U.filter((function(e){return 34===parseInt(e.accion)}))[0].id_usuarios)===(null===(W=j.data_user)||void 0===W?void 0:W.id)?Ue(!1):Ue(!0));case 19:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ve=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:a=e.sent,n=a.data,i=n.time.filter((function(e){return e.id===t})),ie(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ge=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:a=e.sent,n=a.data,i=n.levels.filter((function(e){return e.id===t})),ee(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Qe=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:a=e.sent,n=a.data,i=n.costs.filter((function(e){return e.id===t})),se(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Je=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTypes");case 2:a=e.sent,n=a.data,i=n.types.filter((function(e){return e.id===t})),me(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Xe=function(e){y(Ye(1===e?"breadCrumps:breadCrumps.badge-details-published":0===e?"breadCrumps:breadCrumps.badge-details-edited":"breadCrumps:breadCrumps.badge-details-archived",{returnObjects:!0}))},Ze=function(e,t,a){switch(a){case"archive":$e(t);break;case"publish":et(t);break;case"delete":tt(t)}},$e=function(e){F.a.fire({text:Ye("alerts:alerts:archive-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Ye("buttons:buttons.accept"),cancelButtonText:Ye("buttons:buttons:cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&rt(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},et=function(e){F.a.fire({text:Ye("alerts:alerts:publish-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Ye("buttons:buttons.accept"),cancelButtonText:Ye("buttons:buttons:cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&it(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},tt=function(e){F.a.fire({text:Ye("alerts:alerts:delete-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Ye("buttons:buttons.accept"),cancelButtonText:Ye("buttons:buttons:cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ct(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},at=function(e,t){F.a.fire({text:Ye("alerts:alerts:copy-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Ye("buttons:buttons.accept"),cancelButtonText:Ye("buttons:buttons:cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&nt(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},nt=function(e,t){t.preventDefault(),S(!0),Ce.a.post("/templateHability/",e).then((function(e){S(!1),C.push("/templates/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:Ye("alerts:alerts:copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){S(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:Ye("alerts:alerts:copied-error"),showConfirmButton:!1,timer:1500}),C.push("/500"),window.location.reload()}))},it=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/templateBadge/".concat(M.templateBadge.id),{estado:1,id_usuarios:null===(a=j.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){C.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:Ye("alerts:alerts:published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){C.push("/templates/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),rt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/templateBadge/".concat(M.templateBadge.id),{estado:2,id_usuarios:null===(a=j.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){C.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:Ye("alerts:alerts:archived"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){C.push("/templates/archived")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ct=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/templateBadge/".concat(M.templateBadge.id),{data:{id_usuarios:null===(a=j.data_user)||void 0===a?void 0:a.id}}).catch((function(){C.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&(0===M.templateBadge.estado?F.a.fire({text:Ye("alerts:alerts:deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){C.push("/templates/edited")})):F.a.fire({text:Ye("alerts:alerts:deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){C.push("/templates/published")})));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ot=function(){e.history.push("/templates/edit/".concat(Object(Ie.b)(M.templateBadge.id)))},st=function(){Re(Object(m.a)(Object(m.a)({},null===M||void 0===M?void 0:M.templateBadge),{},{tipos:null===ue||void 0===ue?void 0:ue.valor_parametro,costos:null===oe||void 0===oe?void 0:oe.valor_parametro,tiempos:null===ne||void 0===ne?void 0:ne.valor_parametro,niveles:null===$||void 0===$?void 0:$.valor_parametro,img_prev:null===M||void 0===M?void 0:M.linkPhoto,id_plantillas_recomendadas:null===xe||void 0===xe?void 0:xe.map((function(e){var t;return{linkPhoto:e.linkPhoto,id_plantillas_recomendadas:e.id_plantillas_recomendadas,nombre:null===(t=e.plantillasInsigniasRecomendadas)||void 0===t?void 0:t.nombre}})),id_habilidades:null===Q||void 0===Q?void 0:Q.map((function(e){return{id_habilidades:e.id_habilidades,descripcion:e.habilidades.descripcion}}))})),z(!0)},lt=function(){z(!1)};return Object(n.jsxs)(Vr,{Index:0,Buttons:function(){var e,t,a;return 0===(null===(e=M.templateBadge)||void 0===e?void 0:e.estado)?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{className:qe.button,onClick:function(e){return st()},children:Object(n.jsx)(Ir.a,{})})})}),w.includes("Publicar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.publish"),children:Object(n.jsx)(x.a,{className:qe.button,onClick:function(e){return Ze(e,M.id,"publish")},children:Object(n.jsx)(ci.a,{})})})}),w.includes("Editar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.edit"),children:Object(n.jsx)(x.a,{className:qe.button,onClick:ot,children:Object(n.jsx)(Wn,{})})})}),w.includes("Copiar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.copy"),children:Object(n.jsx)(x.a,{className:qe.button,onClick:function(e){return at(e,Te)},children:Object(n.jsx)(Ar.a,{})})})}),w.includes("Eliminar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.delete"),children:Object(n.jsx)(x.a,{className:qe.button,onClick:function(e){return Ze(e,M.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]}):1===(null===(t=M.templateBadge)||void 0===t?void 0:t.estado)?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{className:qe.button,onClick:function(e){return st()},children:Object(n.jsx)(Ir.a,{})})})}),w.includes("Editar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.edit"),children:Object(n.jsx)(x.a,{disabled:Fe,className:qe.button,onClick:ot,children:Object(n.jsx)(Wn,{})})})}),w.includes("Copiar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.copy"),children:Object(n.jsx)(x.a,{disabled:Fe,className:qe.button,onClick:function(e){return at(e,Te)},children:Object(n.jsx)(Ar.a,{})})})}),0!==q?w.includes("Archivar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.archive"),children:Object(n.jsx)(x.a,{disabled:Fe,className:qe.button,onClick:function(e){return Ze(e,M.id,"archive")},children:Object(n.jsx)(Er.a,{})})})}):w.includes("Eliminar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.delete"),children:Object(n.jsx)(x.a,{disabled:Fe,className:qe.button,onClick:function(e){return Ze(e,M.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]})}):2===(null===(a=M.templateBadge)||void 0===a?void 0:a.estado)?Object(n.jsx)(n.Fragment,{children:w.includes("Publicar")&&Object(n.jsx)(ye.a,{item:!0,lg:2,md:2,xs:5,children:Object(n.jsx)(K.a,{title:Ye("tables:table.tooltip.publish"),children:Object(n.jsx)(x.a,{className:qe.button,onClick:function(e){return Ze(e,M.id,"publish")},children:Object(n.jsx)(ci.a,{})})})})}):void 0}(),BadgeId:Object(Ie.a)(e.match.params.id),children:[Object(n.jsx)(ve.a,{elevation:0,children:Object(n.jsxs)(_e.a,{className:qe.root,maxWidth:"lg",children:[Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:12,children:Object(n.jsx)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:B?Object(n.jsx)(Be.a,{variant:"circle",children:Object(n.jsx)(g.a,{className:qe.avatar})}):Object(n.jsx)(g.a,{alt:"img-prev",src:M.linkPhoto,variant:"rounded",className:qe.avatar,children:Object(n.jsx)(Kr.a,{sx:{margin:3,fontSize:"4em"}})})})}),Object(n.jsx)(ye.a,{item:!0,lg:9,md:9,xs:12,children:Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:qe.textTitle,children:B?Object(n.jsx)(Be.a,{}):"".concat(null===(t=M.templateBadge)||void 0===t?void 0:t.nombre)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:Object(n.jsx)(we.a,{variant:"h6",gutterBottom:!0,className:qe.textTitle,children:B?Object(n.jsx)(Be.a,{}):"".concat((null===(a=M.templateBadge)||void 0===a?void 0:a.nombre_privado)||"")})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:Object(n.jsx)(we.a,{className:qe.textParagraph,children:B?Object(n.jsx)(Be.a,{}):"".concat(null===(r=M.templateBadge)||void 0===r?void 0:r.descripcion)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:qe.textBolder,children:[Ye("certificateBadgeTemplate:details.issued-by"),": "]}),Object(n.jsx)("span",{className:qe.text,children:null===(c=M.templateBadge)||void 0===c||null===(o=c.organizaciones)||void 0===o?void 0:o.nombre})]})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:qe.textBolder,children:[Ye("certificateBadgeTemplate:details.created"),": "]}),Object(n.jsx)("span",{className:qe.text,children:Ne()(null===(s=M.templateBadge)||void 0===s?void 0:s.fecha_creacion).format("DD-MM-YYYY")})]})})]})})]}),Object(n.jsx)(W.a,{className:qe.root}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsxs)(ye.a,{item:!0,lg:6,md:6,xs:12,justify:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:B?Object(n.jsx)(Be.a,{}):Object(n.jsxs)("span",{className:qe.textBolder,children:[Ye("certificateBadgeTemplate:details.skills"),":"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(ye.a,{container:!0,children:B?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:"5em"}):Object(n.jsx)(n.Fragment,{children:Q.map((function(e){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Qr),{},{children:Object(n.jsx)(we.a,{children:e.habilidades.descripcion})}))})}))})})})]}),Object(n.jsx)(W.a,{orientation:"vertical",flexItem:!0,className:qe.divider}),Object(n.jsx)(ye.a,{item:!0,lg:5,md:5,xs:12,children:Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:qe.textBolder,children:[Ye("certificateBadgeTemplate:details.type"),": "]}),Object(n.jsx)("span",{className:qe.text,children:ue.valor_parametro})]})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:qe.textBolder,children:[Ye("certificateBadgeTemplate:details.level"),": "]}),Object(n.jsx)("span",{className:qe.text,children:$.valor_parametro})]})}),B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:Object(n.jsx)(Be.a,{variant:"text"})})}):Object(n.jsx)(n.Fragment,{children:null!==(null===M||void 0===M||null===(l=M.templateBadge)||void 0===l?void 0:l.cantidad_tiempo)&&void 0!==(null===ne||void 0===ne?void 0:ne.valor_parametro)?Object(n.jsxs)(ye.a,{item:!0,lg:12,md:6,xs:6,children:[Object(n.jsxs)("span",{className:qe.textBolder,children:[Ye("certificateBadgeTemplate:details.time"),": "]}),Object(n.jsx)("span",{className:qe.text,children:"".concat(null===M||void 0===M||null===(b=M.templateBadge)||void 0===b?void 0:b.cantidad_tiempo," ").concat(null===ne||void 0===ne?void 0:ne.valor_parametro)})]}):""}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:qe.textBolder,children:[Ye("certificateBadgeTemplate:details.cost"),": "]}),Object(n.jsx)("span",{className:qe.text,children:oe.valor_parametro})]})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:Object(n.jsx)(we.a,{className:qe.textBolder,children:B?Object(n.jsx)(Be.a,{}):"".concat(Ye("certificateBadgeTemplate:details.criteria"),":")})}),Object(n.jsx)(ye.a,{children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{variant:"text",width:200})}):Object(n.jsx)(n.Fragment,{children:je.map((function(e,t){return Object(n.jsx)(we.a,{className:qe.text,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))}))})})]})})]}),Object(n.jsx)(W.a,{className:qe.root}),Object(n.jsx)(ye.a,{container:!0,spacing:1,children:Object(n.jsx)(ye.a,{item:!0,lg:12,md:12,xs:12,children:(null===xe||void 0===xe?void 0:xe.length)>0?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{className:qe.textBolder,children:[Ye("certificateBadgeTemplate:details.recommendations"),":"]}),Object(n.jsx)("div",{className:qe.badges,children:xe.map((function(e,t){var a,i,r,c;return Object(n.jsx)(It,{badgeImage:null===e||void 0===e?void 0:e.linkPhoto,badgeName:null===e||void 0===e||null===(a=e.plantillasInsigniasRecomendadas)||void 0===a?void 0:a.nombre,organizationName:null===e||void 0===e||null===(i=e.plantillasInsigniasRecomendadas)||void 0===i||null===(r=i.organizaciones)||void 0===r?void 0:r.nombre,issuedId:Object(Ie.b)(null===e||void 0===e||null===(c=e.plantillasInsigniasRecomendadas)||void 0===c?void 0:c.id),publicBadge:!1,templateBadge:!0},"badge".concat(t))}))})]}):""})})]})}),Object(n.jsxs)(O.a,{open:I,onClose:lt,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:lt,children:Ye("dialogs:dialog.preview-title")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(Wr,{vista:Pe,children:null===Pe||void 0===Pe||null===(p=Pe.id_plantillas_recomendadas)||void 0===p?void 0:p.map((function(e,t){var a;return Object(n.jsx)(It,{badgeImage:e.linkPhoto,badgeName:e.nombre,organizationName:null===(a=Pe.organizaciones)||void 0===a?void 0:a.nombre,publicBadge:!1,templateBadge:!0},"badge".concat(t))}))})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(qe.buttonForm),onClick:lt,children:Ye("buttons:buttons.close")})})]})]})})),Zr=a(178),$r=a.n(Zr),ec=Object(C.a)((function(e){return{formControl:{margin:e.spacing(1),minWidth:120},margin:{marginTop:20}}}));var tc={changeBreadcrump:I.a},ac=Object(s.b)(null,tc)((function(e){var t=e.changeBreadcrump,a=ec();return Object(i.useEffect)((function(){t([{name:"Insignias"},{name:"Plantillas",route:"/templates/published"},{name:"Percepciones"}])}),[]),Object(n.jsx)(Vr,{Index:1,BadgeId:e.match.params.id,children:Object(n.jsx)(ve.a,{children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{color:"textPrimary",gutterBottom:!0,children:"Mostrando Resultados por"}),Object(n.jsxs)(ye.a,{container:!0,spacing:3,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:a.formControl,children:Object(n.jsxs)(T.a,{defaultValue:30,inputProps:{name:"name",id:"uncontrolled-native"},children:[Object(n.jsx)("option",{value:10,children:"Estados Unidos"}),Object(n.jsx)("option",{value:20,children:"Estados Unidos"}),Object(n.jsx)("option",{value:30,children:"Estados Unidos"})]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:a.formControl,children:Object(n.jsxs)(T.a,{defaultValue:10,inputProps:{name:"name",id:"uncontrolled-native"},children:[Object(n.jsx)("option",{value:10,children:"Todos los estados"}),Object(n.jsx)("option",{value:20,children:"Estados Unidos"}),Object(n.jsx)("option",{value:30,children:"Estados Unidos"})]})})})]}),Object(n.jsx)(we.a,{className:a.margin,color:"textPrimary",gutterBottom:!0,align:"center",children:"454566 Vacantes de trabajo"}),Object(n.jsx)(we.a,{className:a.margin,color:"textPrimary",gutterBottom:!0,align:"center",children:"Titulos"}),Object(n.jsx)($r.a,{}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{className:a.margin,color:"textPrimary",gutterBottom:!0,align:"center",children:"Localizaciones"}),Object(n.jsx)($r.a,{}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{className:a.margin,color:"textPrimary",gutterBottom:!0,align:"center",children:"Empleadores"}),Object(n.jsx)($r.a,{}),Object(n.jsx)(W.a,{})]})})})}));var nc=Object(C.a)((function(){return{root:{display:"flex",alignItems:"center",border:"2.8px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",marginTop:"1rem"},badge:{display:"flex",flexDirection:"column",alignItems:"center",border:"1px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",height:280,width:230,margin:"1rem"},badge__image:{width:120,height:120,borderRadius:"100%",margin:"25px 0px"},badge__name:{fontSize:"1.3em",marginBottom:0,color:"#676767",textAlign:"center"},badge__name_private:{color:"#676767",textAlign:"center"},badge__organization_name:{color:"#7a7a7a",textAlign:"center"}}})),ic={changeBreadcrump:I.a,changePage:I.b},rc=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage}}),ic)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=e.changePage,o=nc(),s=Object(i.useState)(!1),l=Object(d.a)(s,2),u=l[0],m=l[1],b=Object(i.useState)(!1),p=Object(d.a)(b,2),j=p[0],g=p[1],x=Object(i.useState)(!1),y=Object(d.a)(x,2),w=y[0],C=y[1],k=Object(i.useState)([]),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)([]),E=Object(d.a)(A,2),z=E[0],P=E[1],R=Object(i.useState)([{descripcion:"",valor:"",nuevoValor:"",tipo:"",recomendacion:""}]),M=Object(d.a)(R,2),L=M[0],F=M[1],U=Object(i.useState)(""),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(""),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)({}),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(D.a)(["tables","breadCrumps","dialogs"]),te=Object(d.a)(ee,1)[0];Object(i.useEffect)((function(){ae().catch((function(){e.history.push("/500"),window.location.reload()}))}),[]);var ae=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return m(!0),c(0),e.next=4,ie();case 4:return e.next=6,ne();case 6:return m(!1),e.next=9,Ce.a.post("/templateBadge/getTemplatesBadges");case 9:t=e.sent,a=t.data,T(a.templatesBadges);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/parameterValueParameter/getParameterValueParameter");case 2:t=e.sent,a=t.data,P(a.parametersValueParameters);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/templateBadgeHistory/getTemplatesBadgesHistory",{id_plantillas:i});case 3:r=t.sent,c=r.data,$(c.templatesBadgesHistory),re(null===(a=c.templatesBadgesHistory[0])||void 0===a||null===(n=a.plantillasInsignias)||void 0===n?void 0:n.estado);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),re=function(e){r(te(1===e?"breadCrumps:breadCrumps.badge-history-published":0===e?"breadCrumps:breadCrumps.badge-history-edited":"breadCrumps:breadCrumps.badge-history-archived",{returnObjects:!0}))},ce=function(e){Z.map(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.id===e&&(""!==a.nuevoValor?F([{descripcion:te("dialogs:dialog.state-created"),valor:B.filter((function(e){return e.id===parseInt(a.nuevoValor)}))}]):F([{descripcion:te("dialogs:dialog.state-created"),valor:""}]));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),C(!0)},oe=function(e){var t=0,a="";return z.map((function(n){n.id===parseInt(e)&&(t=1,a=n.valor_parametro)})),0===t?e:a},se=te("tables:table.columns-history",{returnObjects:!0});return Object(n.jsxs)(Vr,{Index:2,BadgeId:Object(Ie.a)(e.match.params.id),children:[Object(n.jsx)(ve.a,{elevation:0,children:Object(n.jsx)(zn,{columns:se,rows:Z,setDirection:q,setOrderBy:Q,loading:u,children:u?Object(n.jsx)(qn,{columns:se,photo:0}):Object(n.jsx)(vn.a,{children:Z.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(Z,Object(I.f)(Y,G)).slice(t*a,t*a+a).map((function(e){var t,a;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(t=e.usuarios)||void 0===t?void 0:t.primer_nombre," ").concat(null===(a=e.usuarios)||void 0===a?void 0:a.primer_apellido)}),Object(n.jsx)(yn.a,{align:"center",children:oe(e.accion)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:te("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t="",a=[];Z.map(function(){var n=Object(h.a)(f.a.mark((function n(i){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i.id===e&&("34"===i.accion?ce(e):"36"===i.accion||"37"===i.accion?(F([{descripcion:"36"===i.accion?te("dialogs:dialog.state-published"):te("dialogs:dialog.state-archived"),valor:i.valor,nuevoValor:i.nuevoValor,tipo:"info"}]),g(!0)):(t=i.valor.split("\xbf?")).length>0&&(t.map(function(){var e=Object(h.a)(f.a.mark((function e(t,n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0!==n&&((t=t.split("$%&"))[0].includes("esta")?a.push({descripcion:t[0],valor:t[1],nuevoValor:t[2],tipo:"info",recomendacion:B.filter((function(e){return e.id===parseInt(t[1])}))}):a.push({descripcion:t[0],valor:t[1],nuevoValor:t[2],tipo:"info"}));case 1:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}()),F(a),g(!0)));case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())}(e.id)},children:Object(n.jsx)(Ge.a,{})})})})]},e.id)}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:te("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:j,onClose:function(){g(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.details")}),Object(n.jsx)(_.a,{children:L.length>0?Object(n.jsx)(n.Fragment,{children:L.map((function(e){var t,a,i,r,c;return Object(n.jsxs)(ye.a,{container:!0,xs:12,className:o.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(Qi.a,{severity:e.tipo,children:e.descripcion})}),"Se a\xf1adi\xf3 esta plantilla como recomendaci\xf3n."===e.descripcion||"Se elimin\xf3 esta plantilla recomendada."===e.descripcion?e.recomendacion.length>0?Object(n.jsx)(_.a,{align:"center",children:Object(n.jsxs)("div",{className:o.badge,children:[Object(n.jsx)("img",{src:e.recomendacion[0].linkPhoto,alt:"badge",className:o.badge__image}),Object(n.jsx)("h3",{className:o.badge__name,children:null===(t=e.recomendacion[0])||void 0===t?void 0:t.nombre}),Object(n.jsx)("p",{className:o.badge__organization_name,children:null===(a=e.recomendacion[0])||void 0===a||null===(i=a.organizaciones)||void 0===i?void 0:i.nombre})]})}):"":Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:6,lg:6,children:null!==e.valor&&(null===(r=e.valor)||void 0===r?void 0:r.length)>0?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.previous")}),Object(n.jsx)(_.a,{align:"center",children:e.descripcion.includes("atributo 'cantidad de tiempo'")?e.valor:oe(e.valor)})]}):""}),Object(n.jsx)(ye.a,{item:!0,xs:6,lg:6,children:null!==e.valor&&(null===(c=e.valor)||void 0===c?void 0:c.length)>0?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.current")}),Object(n.jsx)(_.a,{align:"center",children:e.descripcion.includes("atributo 'cantidad de tiempo'")?e.nuevoValor:oe(e.nuevoValor)})]}):""})]})]})}))}):""})]}),Object(n.jsxs)(O.a,{open:w,onClose:function(){C(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.details")}),L.length>0?Object(n.jsx)(n.Fragment,{children:L.map((function(e){var t,a,i,r,c,s;return Object(n.jsxs)(_.a,{align:"center",children:[Object(n.jsx)(Qi.a,{severity:"info",children:e.descripcion}),""!==e.valor&&(null===(t=e.valor[0])||void 0===t?void 0:t.linkPhoto)?Object(n.jsxs)("div",{className:o.badge,children:[Object(n.jsx)("img",{src:null===(a=e.valor[0])||void 0===a?void 0:a.linkPhoto,alt:"badge",className:o.badge__image}),Object(n.jsx)("h3",{className:o.badge__name,children:null===(i=e.valor[0])||void 0===i?void 0:i.nombre}),Object(n.jsx)("h6",{className:o.badge__name_private,children:null===(r=e.valor[0])||void 0===r?void 0:r.nombre_privado}),Object(n.jsx)("p",{className:o.badge__organization_name,children:null===(c=e.valor[0])||void 0===c||null===(s=c.organizaciones)||void 0===s?void 0:s.nombre})]}):""]})}))}):Object(n.jsx)(yn.a,{align:"center",children:te("tables:table.empty-table")})]})]})})),cc=Object(C.a)((function(e){return{large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},buttonForm:{margin:"0.5em",padding:"9px 40px"},iconButton:{margin:"0em -.4em"}}}));var oc={changeBreadcrump:I.a,changePage:I.b},sc=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),searchValue:e.searchValue}}),oc)((function(e){var t,a,r,c,o,s=e.page,l=e.rowsPerPage,b=e.changeBreadcrump,j=e.user,y=e.organizationId,w=e.permission,C=e.changePage,k=e.searchValue,N=Object(u.g)(),B=Object(i.useState)(!1),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)([]),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)([]),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(M),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)({}),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)({}),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ie=Object(i.useState)({}),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)({}),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(i.useState)(!1),be=Object(d.a)(me,2),pe=be[0],je=be[1],fe=Object(i.useState)(""),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Object(i.useState)(""),ve=Object(d.a)(Oe,2),_e=ve[0],ye=ve[1],we=Object(i.useState)(),ke=Object(d.a)(we,2),Be=ke[0],Se=ke[1],Te=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),Ee=Object(d.a)(Te,1)[0],De=cc();Object(i.useEffect)((function(){C(0),ze().catch((function(){N.push("/500"),window.location.reload()})),b(Pe())}),[]);var ze=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(z(!0),k&&""!==k){e.next=4;break}return e.next=4,He();case 4:return z(!1),e.next=7,Ke();case 7:return e.next=9,Re();case 9:return e.next=11,Me();case 11:return e.next=13,Le();case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pe=function(){return Ee("breadCrumps:breadCrumps.badge-edition",{returnObjects:!0})},Re=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,ne(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,ue(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,oe(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=1===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Ue=6===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,We=6===(null===(t=j.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),Ye=(null===j||void 0===j||null===(a=j.data_user)||void 0===a||null===(r=a.gruposUsuariosOrganizaciones[0])||void 0===r||null===(c=r.organizaciones)||void 0===c?void 0:c.organizacionesRelaciones.length)>0,qe=function(e,t){var a={limit:t||10,offset:e?e*t:0};return Fe||(a.id_organizaciones=y),(Ue||We)&&(a.id_usuarios=j.data_user.id),a},He=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=qe(0,l),e.next=3,Ce.a.post("/templateBadge/getTemplatesBadgesEdited",i);case 3:r=e.sent,c=r.data,L(null===(t=c.templatesBadges)||void 0===t?void 0:t.rows),Q(null===(a=c.templatesBadges)||void 0===a?void 0:a.rows),Se(null===(n=c.templatesBadges)||void 0===n?void 0:n.count);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ke=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Fe){e.next=8;break}return e.next=3,Ce.a.post("/templateBadge/getTemplatesBadges");case 3:t=e.sent,a=t.data,q(a.templatesBadges),e.next=13;break;case 8:return e.next=10,Ce.a.post("/templateBadge/getTemplatesBadges",{id_organizaciones:y});case 10:n=e.sent,i=n.data,q(Ue||We?i.templatesBadges.filter((function(e){return e.plantillasInsigniasHistorial[0].id_usuarios===j.data_user.id})):i.templatesBadges);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ve=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return z(!0),i=qe(t,a),e.next=4,Ce.a.post("/templateBadge/getTemplatesBadgesEdited",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(M),Object(p.a)(null===(n=c.templatesBadges)||void 0===n?void 0:n.rows.filter((function(e){return!M.find((function(t){return t.id===e.id}))})))),L(o),Q(o),z(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Qe=function(e){var t=null;return Y.map((function(a){a.id===e&&(t=a.linkPhoto)})),t},Je=function(e,t,a){switch(a){case"copy":Xe(e,t);break;case"edit":N.push("/templates/edit/".concat(Object(Ie.b)(t)));break;case"publish":Ze(t);break;case"delete":$e(t)}},Xe=function(e,t){F.a.fire({text:Ee("alerts:alerts.copy-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Ee("buttons:buttons.accept"),cancelButtonText:Ee("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&et(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},Ze=function(e){F.a.fire({text:Ee("alerts:alerts.publish-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Ee("buttons:buttons.accept"),cancelButtonText:Ee("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&tt(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},$e=function(e){F.a.fire({text:Ee("alerts:alerts.delete-button"),icon:"warning",showCancelButton:!0,iconColor:E.a.primary,confirmButtonText:Ee("buttons:buttons.accept"),cancelButtonText:Ee("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&at(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},et=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o,s,l,d;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===M||void 0===M?void 0:M.filter((function(e){return e.id===t})),l=Object(m.a)(Object(m.a)({},s[0]),{},{nombre:"".concat(null===(n=s[0])||void 0===n?void 0:n.nombre," copia"),nombre_privado:"".concat(null===(i=s[0])||void 0===i?void 0:i.nombre_privado," copia"),id_plantillas_recomendadas:null===(r=s[0])||void 0===r?void 0:r.recomendaciones.map((function(e){return{id_plantillas_recomendadas:e.id_plantillas_recomendadas}})),id_habilidades:null===(c=s[0])||void 0===c?void 0:c.plantillasHabilidades.map((function(e){return{id_habilidades:e.id_habilidades}})),id_usuarios:null===(o=j.data_user)||void 0===o?void 0:o.id,id_organizaciones:y}),e.prev=2,e.next=5,Ce.a.post("/templateHability/",l);case 5:d=e.sent,d.data&&(ze(),F.a.fire({icon:"success",iconColor:E.a.primary,text:Ee("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(2),F.a.fire({icon:"error",iconColor:E.a.primary,text:Ee("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500}),N.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t,a){return e.apply(this,arguments)}}(),tt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/templateBadge/".concat(t),{estado:1,id_usuarios:null===(a=j.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){N.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:Ee("alerts:alerts.published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){N.push("/templates/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),at=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/templateBadge/".concat(t),{data:{id_usuarios:null===(a=j.data_user)||void 0===a?void 0:a.id}}).catch((function(){N.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:Ee("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){ze()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),nt=function(e){if(w.includes("Editar"))return Object(n.jsx)(K.a,{title:Ee("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return Je(t,e,"edit")},className:De.iconButton,children:Object(n.jsx)(Wn,{})})})},it=function(e){if(w.includes("Copiar"))return Object(n.jsx)(K.a,{title:Ee("tables:table.tooltip.copy"),children:Object(n.jsx)(S.a,{"aria-label":"copy",onClick:function(t){return Je(t,e,"copy")},className:De.iconButton,children:Object(n.jsx)(Ar.a,{})})})},rt=function(e){if(w.includes("Publicar"))return Object(n.jsx)(K.a,{title:Ee("tables:table.tooltip.publish"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return Je(t,e,"publish")},className:De.iconButton,children:Object(n.jsx)(ci.a,{})})})},ct=function(e){if(w.includes("Eliminar"))return Object(n.jsx)(K.a,{title:Ee("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return Je(t,e,"delete")},className:De.iconButton,children:Object(n.jsx)(Cn.a,{})})})},ot=function(){je(!1)},st=function(){return Ee(Fe||Ye?"tables:table.columns-edited-super":"tables:table.columns-edited",{returnObjects:!0})},lt=function(e){return Fe?Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre}):e.organizacionesHijas?Object(n.jsx)(yn.a,{align:"center",children:e.organizacionesHijas.nombre}):void 0};return Object(n.jsxs)(Lr,{Index:1,children:[Object(n.jsx)(Fn,{tableName:"templateBadge",type:"edited",items:M,setItems:Q,setCountItems:Se,changePage:C,loadData:ze,organizationId:1===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:y,deparmentCreater:{isDeparmentCreater:Ue,isDeparmentCreaterRoll:We,userId:j.data_user.id},setLoading:z}),Object(n.jsx)(zn,{columns:st(),rows:Be,setDirection:xe,setOrderBy:ye,loading:A,changePagination:Ve,children:Object(n.jsx)(vn.a,{children:G.length>0?A?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:st(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(G,Object(I.f)(ge,_e)).slice(s*l,s*l+l).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{variant:"rounded",alt:"Badges",src:e.linkPhoto,className:De.large})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),lt(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:0===e.estado?Ee("tables:table.state.edited"):""}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:Ee("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return N.push("/templates/edited/details/".concat(Object(Ie.b)(e.id)))},className:De.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:nt(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:rt(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:it(e.id)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:Ee("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t,a,n,i,r,c,o,s=null===M||void 0===M?void 0:M.filter((function(t){return t.id===e})),l=ae.filter((function(e){return e.id===s[0].nivel_vp})),d=ce.filter((function(e){return e.id===s[0].tiempo_vp})),u=de.filter((function(e){return e.id===s[0].costo_vp}));$(Object(m.a)(Object(m.a)({},s[0]),{},{id_habilidades:null===(t=s[0])||void 0===t?void 0:t.plantillasHabilidades.map((function(e){return{id_habilidades:e.id_habilidades,descripcion:e.habilidades.descripcion}})),id_plantillas_recomendadas:null===(a=s[0])||void 0===a?void 0:a.recomendaciones,criterios:null===(n=s[0])||void 0===n?void 0:n.criterios,img_prev:null===(i=s[0])||void 0===i?void 0:i.linkPhoto,niveles:null===(r=l[0])||void 0===r?void 0:r.valor_parametro,tiempos:null===(c=d[0])||void 0===c?void 0:c.valor_parametro,costos:null===(o=u[0])||void 0===o?void 0:o.valor_parametro})),je(!0)}(e.id)},className:De.iconButton,children:Object(n.jsx)(Ir.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:ct(e.id)})]},e.id)}))}):A?Object(n.jsx)(qn,{columns:st(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:Ee("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:pe,onClose:ot,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:ot,children:Ee("dialogs:dialog.preview-title")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(Wr,{vista:Z,children:null===Z||void 0===Z||null===(o=Z.id_plantillas_recomendadas)||void 0===o?void 0:o.map((function(e,t){var a;return Object(n.jsx)(It,{badgeImage:Qe(e.id_plantillas_recomendadas),badgeName:e.plantillasInsigniasRecomendadas.nombre,organizationName:null===(a=Z.organizaciones)||void 0===a?void 0:a.nombre,publicBadge:!1,templateBadge:!0},"badge".concat(t))}))})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(De.buttonForm),onClick:ot,children:Ee("buttons:buttons.close")})})]})]})})),lc=Object(C.a)((function(e){return{large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},buttonForm:{margin:"0.5em",padding:"9px 40px"},iconButton:{margin:"0em -.4em"}}}));var dc={changeBreadcrump:I.a,changePage:I.b},uc=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),searchValue:e.searchValue}}),dc)((function(e){var t,a,r,c,o,s=e.page,l=e.rowsPerPage,b=e.changeBreadcrump,j=e.user,y=e.organizationId,w=e.changePage,C=e.permission,k=e.searchValue,N=Object(u.g)(),B=Object(i.useState)(!1),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)([]),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)([]),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(M),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)({}),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)({}),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ie=Object(i.useState)({}),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)({}),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(i.useState)(!1),be=Object(d.a)(me,2),pe=be[0],je=be[1],fe=Object(i.useState)(""),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Object(i.useState)(""),ve=Object(d.a)(Oe,2),_e=ve[0],ye=ve[1],we=Object(i.useState)(),ke=Object(d.a)(we,2),Be=ke[0],Se=ke[1],Te=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),Ee=Object(d.a)(Te,1)[0],De=lc();Object(i.useEffect)((function(){w(0),ze().catch((function(){N.push("/500"),window.location.reload()})),b(Pe())}),[]);var ze=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(z(!0),k&&""!==k){e.next=4;break}return e.next=4,He();case 4:return z(!1),e.next=7,Ve();case 7:return e.next=9,Re();case 9:return e.next=11,Me();case 11:return e.next=13,Le();case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pe=function(){return Ee("breadCrumps:breadCrumps.badge-archived",{returnObjects:!0})},Re=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,ne(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,ue(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,oe(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=1===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Ue=6===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,We=6===(null===(t=j.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),Ye=(null===j||void 0===j||null===(a=j.data_user)||void 0===a||null===(r=a.gruposUsuariosOrganizaciones[0])||void 0===r||null===(c=r.organizaciones)||void 0===c?void 0:c.organizacionesRelaciones.length)>0,qe=function(e,t){var a={limit:t||10,offset:e?e*t:0};return Fe||(a.id_organizaciones=y),(Ue||We)&&(a.id_usuarios=j.data_user.id),a},He=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=qe(0,l),e.next=3,Ce.a.post("/templateBadge/getTemplatesBadgesArchived",i);case 3:r=e.sent,c=r.data,L(null===(t=c.templatesBadges)||void 0===t?void 0:t.rows),Q(null===(a=c.templatesBadges)||void 0===a?void 0:a.rows),Se(null===(n=c.templatesBadges)||void 0===n?void 0:n.count);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ke=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return z(!0),i=qe(t,a),e.next=4,Ce.a.post("/templateBadge/getTemplatesBadgesArchived",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(M),Object(p.a)(null===(n=c.templatesBadges)||void 0===n?void 0:n.rows.filter((function(e){return!M.find((function(t){return t.id===e.id}))})))),L(o),Q(o),z(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Ve=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Fe){e.next=8;break}return e.next=3,Ce.a.post("/templateBadge/getTemplatesBadges");case 3:t=e.sent,a=t.data,q(a.templatesBadges),e.next=13;break;case 8:return e.next=10,Ce.a.post("/templateBadge/getTemplatesBadges",{id_organizaciones:y});case 10:n=e.sent,i=n.data,q(Ue||We?i.templatesBadges.filter((function(e){return e.plantillasInsigniasHistorial[0].id_usuarios===j.data_user.id})):i.templatesBadges);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Qe=function(e){var t=null;return Y.map((function(a){a.id===e&&(t=a.linkPhoto)})),t},Je=function(e){if(C.includes("Publicar"))return Object(n.jsx)(K.a,{title:Ee("tables:table.tooltip.publish"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return function(e,t,a){switch(a){case"publish":Xe(t)}}(0,e,"publish")},className:De.iconButton,children:Object(n.jsx)(ci.a,{})})})},Xe=function(e){F.a.fire({text:Ee("alerts:alerts.publish-button"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Ee("buttons:buttons.accept"),cancelButtonText:Ee("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Ze(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Ze=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/templateBadge/".concat(t),{estado:1,id_usuarios:null===(a=j.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){N.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({iconColor:E.a.primary,text:Ee("alerts:alerts.published"),icon:"success",showConfirmButton:!1,timer:1500}).then((function(){N.push("/templates/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$e=function(){je(!1)},et=function(){return Ee(Fe||Ye?"tables:table.columns-published-archived-super":"tables:table.columns-published-archived",{returnObjects:!0})},tt=function(e){return Fe?Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre}):e.organizacionesHijas?Object(n.jsx)(yn.a,{align:"center",children:e.organizacionesHijas.nombre}):void 0};return Object(n.jsxs)(Lr,{Index:2,children:[Object(n.jsx)(Fn,{tableName:"templateBadge",type:"archived",items:M,setItems:Q,setCountItems:Se,changePage:w,loadData:ze,organizationId:1===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:y,deparmentCreater:{isDeparmentCreater:Ue,isDeparmentCreaterRoll:We,userId:j.data_user.id},setLoading:z}),Object(n.jsx)(zn,{columns:et(),rows:Be,setDirection:xe,setOrderBy:ye,loading:A,changePagination:Ke,children:Object(n.jsx)(vn.a,{children:G.length>0?A?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:et(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(G,Object(I.f)(ge,_e)).slice(s*l,s*l+l).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{variant:"rounded",alt:"Badges",src:e.linkPhoto,className:De.large})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),tt(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.insigniasEmitidas}),Object(n.jsx)(yn.a,{align:"center",children:2===e.estado?Ee("tables:table.state.archived"):""}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:Ee("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return N.push("/templates/archived/details/".concat(Object(Ie.b)(e.id)))},className:De.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Je(e.id)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:Ee("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t,a,n,i,r,c,o,s=null===M||void 0===M?void 0:M.filter((function(t){return t.id===e})),l=ae.filter((function(e){return e.id===s[0].nivel_vp})),d=ce.filter((function(e){return e.id===s[0].tiempo_vp})),u=de.filter((function(e){return e.id===s[0].costo_vp}));$(Object(m.a)(Object(m.a)({},s[0]),{},{id_habilidades:null===(t=s[0])||void 0===t?void 0:t.plantillasHabilidades.map((function(e){return{id_habilidades:e.id_habilidades,descripcion:e.habilidades.descripcion}})),id_plantillas_recomendadas:null===(a=s[0])||void 0===a?void 0:a.recomendaciones,criterios:null===(n=s[0])||void 0===n?void 0:n.criterios,img_prev:null===(i=s[0])||void 0===i?void 0:i.linkPhoto,niveles:null===(r=l[0])||void 0===r?void 0:r.valor_parametro,tiempos:null===(c=d[0])||void 0===c?void 0:c.valor_parametro,costos:null===(o=u[0])||void 0===o?void 0:o.valor_parametro})),je(!0)}(e.id)},className:De.iconButton,children:Object(n.jsx)(Ir.a,{})})})})]},e.id)}))}):A?Object(n.jsx)(qn,{columns:et(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:Ee("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:pe,onClose:$e,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:$e,children:Ee("dialogs:dialog.preview-title")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(Wr,{vista:Z,children:null===Z||void 0===Z||null===(o=Z.id_plantillas_recomendadas)||void 0===o?void 0:o.map((function(e,t){var a;return Object(n.jsx)(It,{badgeImage:Qe(e.id_plantillas_recomendadas),badgeName:e.plantillasInsigniasRecomendadas.nombre,organizationName:null===(a=Z.organizaciones)||void 0===a?void 0:a.nombre,publicBadge:!1,templateBadge:!0},"badge".concat(t))}))})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(De.buttonForm),onClick:$e,children:Ee("buttons:buttons.close")})})]})]})})),mc=Object(C.a)((function(){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var bc={setForm:I.w,setCertificateFields:I.p,setReturnRoute:I.C},pc=Object(s.b)((function(e){return{permission:(e.permission||[]).filter((function(e){var t,a;return"certificados"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),bc)((function(e){var t=e.children,a=e.Index,i=e.permission,r=e.setForm,c=e.setCertificateFields,o=e.setReturnRoute,s=mc(),l=Object(u.g)(),m=Object(u.h)(),b=Object(D.a)(["tabs","buttons"]),p=Object(d.a)(b,1)[0],j=p("tabs:tabs.tabs-certificate",{returnObjects:!0});return Object(n.jsxs)(n.Fragment,{children:[i.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:s.button,onClick:function(){o(m.pathname),r(null),c(null),l.push("/certificates/create")},children:Object(n.jsx)("span",{children:p("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),function(){if(i.includes("Leer"))return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Rr,{Index:a,TabsHeader:j}),t]});l.push("/dashboard"),window.location.reload()}()]})}));var jc={color:"#ffffff",float:"right"},fc=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"2em"},img_verificado:{display:"inline-block",height:e.spacing(5),margin:"auto"},img:{maxWidth:"-webkit-fill-available"},textBolder:{marginTop:"1em",color:"#000000",fontWeight:"bold"},textTitle:{color:"#000000",fontWeight:"bold",marginLeft:"2em"},textName:{color:"#000000",fontWeight:"bold"},textNameOrganization:Object(b.a)({color:"#000000",fontWeight:"bold",marginLeft:"4em"},e.breakpoints.up("sm"),{color:"#000000",fontWeight:"bold",marginLeft:"1em"}),text:{color:"#000000"},textParagraph:{textAlign:"justify",color:"#000000",margin:"1em 0 1em 0"},link:{color:E.a.primary,marginLeft:"2em",textDecoration:"underline"},linkOrganization:Object(b.a)({color:E.a.primary,marginLeft:"4em",textDecoration:"underline"},e.breakpoints.up("sm"),{color:E.a.primary,marginLeft:"1em",textDecoration:"underline"}),button:{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",marginTop:"1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}},grid:{backgroundColor:E.a.footer,marginBottom:"1em"},skeleton:{marginLeft:"auto",marginRight:"auto"},card:{borderRadius:"10px",borderColor:"#ffffff",backgroundColor:"white",paddingBottom:2,marginTop:"1em"},img_user:{width:e.spacing(10),height:e.spacing(10)},img_org:{width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},cardContent:{padding:"0"},textBolderDate:{marginTop:"2em",color:"#000000",fontWeight:"bold"},menuItem:{borderRadius:10,padding:10,marginBottom:10,cursor:"pointer",backgroundColor:E.a.primary},textMenuItem:{color:"#ffffff",fontWeight:"bold"},descriptions:{justifyContent:"center",borderRadius:10,backgroundColor:"#fafafa",textAlign:"center"},content_descriptions:{margin:"1em"},descriptions_fields:{justifyContent:"left",borderRadius:10,backgroundColor:"#fafafa",textAlign:"center"},content_descriptions_fields:{margin:"1em",whiteSpace:"pre-line",textAlign:"left"},footer:{justifyContent:"center",marginTop:10,padding:10,backgroundColor:"#fafafa",textAlign:"center"},certificate:Object(b.a)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(190px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}},e.breakpoints.up("sm"),{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(323px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}})}})),hc={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},gc=Object(s.b)((function(e){return{styles:e.styles}}),null)((function(e){var t,a,r,c,o,s,l,u,b,p,j=e.vista,f=e.styles,h=fc(),x=Object(i.useState)(!1),O=Object(d.a)(x,2),v=O[0],_=O[1],y=Object(i.useState)(!1),w=Object(d.a)(y,2),C=w[0],k=w[1],N=Object(i.useState)(!1),B=Object(d.a)(N,2),S=B[0],T=B[1],A=Object(i.useState)(!1),E=Object(d.a)(A,2),I=E[0],z=E[1],P=Object(i.useState)(!1),R=Object(d.a)(P,2),M=R[0],L=R[1],F=Object(i.useState)(!1),U=Object(d.a)(F,2),W=U[0],Y=U[1],q=Object(D.a)(["certificateBadgeTemplate"]),H=Object(d.a)(q,1)[0],K="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2)),V="";return j.costos||j.niveles||j.tiempos||(V="No hay atributos"),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{container:!0,className:h.grid,children:Object(n.jsx)(ye.a,{item:!0,xs:12,className:"text-center",children:Object(n.jsx)("img",{src:j.linkPhotoTemplate,alt:"certificate-img",className:h.img})})}),Object(n.jsx)(Rt.a,{className:h.container,maxWidth:"lg",children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{container:!0,justify:"space-between",alignItems:"center",children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:7,lg:7,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:h.textName,children:Object(n.jsxs)(n.Fragment,{children:[j.nombre,Object(n.jsx)("img",{alt:"img_verificado",src:K?Jt:f.icon_verificado,className:h.img_verificado})," "]})})})}),Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:Object(n.jsx)(we.a,{className:h.textParagraph,gutterBottom:!0,children:null===j||void 0===j?void 0:j.descripcion})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:1,lg:1,children:Object(n.jsxs)(we.a,{className:h.textBolderDate,children:[H("certificateBadgeTemplate:details.created-by"),":"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:9,lg:10,children:Object(n.jsx)(ve.a,{variant:"outlined",className:h.card,children:Object(n.jsx)(_e.a,{className:h.cardContent,children:j.id_organizacion_hija?Object(n.jsxs)(ye.a,{container:!0,justify:"flex-end",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:1,children:Object(n.jsx)(g.a,{variant:"square","aria-label":"img_certificate",src:j.photoOrganizationHija,className:h.img_org})}),Object(n.jsxs)(ye.a,{item:!0,xs:11,children:[Object(n.jsx)(we.a,{className:h.textNameOrganization,children:null===(r=j.organizacionesHijas)||void 0===r?void 0:r.nombre}),Object(n.jsx)(Mt.a,{className:h.linkOrganization,href:"/organization/".concat(null===(c=j.organizacionesHijas)||void 0===c?void 0:c.url_perfil),target:"_blank",children:H("certificateBadgeTemplate:details.more-information")})]})]}):Object(n.jsxs)(ye.a,{container:!0,justify:"flex-end",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:1,children:Object(n.jsx)(g.a,{variant:"square","aria-label":"img_certificate",src:j.photoOrganization,className:h.img_org})}),Object(n.jsxs)(ye.a,{item:!0,xs:11,children:[Object(n.jsx)(we.a,{className:h.textNameOrganization,children:null===(o=j.organizaciones)||void 0===o?void 0:o.nombre}),Object(n.jsx)(Mt.a,{className:h.linkOrganization,href:"/organization/".concat(null===(s=j.organizaciones)||void 0===s?void 0:s.url_perfil),target:"_blank",children:H("certificateBadgeTemplate:details.more-information")})]})]})})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:2,lg:1,className:"text-center",children:[Object(n.jsxs)(we.a,{className:h.textBolderDate,children:[H("details.date-create"),":"]}),Object(n.jsx)(we.a,{className:h.text,children:Ne()(j.fecha_creacion).format("DD-MM-YYYY")})]}),j.criterios.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:h.menuItem,justify:"space-between",onClick:function(){return _(!v)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:h.textMenuItem,children:H("details.requirements")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:v?Object(n.jsx)(Wt.a,{sx:jc}):Object(n.jsx)(Yt.a,{sx:jc})})]}),Object(n.jsx)(ye.a,{container:!0,className:h.descriptions,children:Object(n.jsx)(ce.a,{in:v,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:h.content_descriptions,children:j.criterios.map((function(e,t){return null===e.link||""===e.link?Object(n.jsx)(we.a,{className:h.text,children:e.descripcion_criterio},"criteria".concat(t)):Object(n.jsx)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:h.link,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))}))})})}),0===V.length&&Object(n.jsxs)(ye.a,{container:!0,className:h.menuItem,justify:"space-between",onClick:function(){return k(!C)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:h.textMenuItem,children:H("details.attributes")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:C?Object(n.jsx)(Wt.a,{sx:jc}):Object(n.jsx)(Yt.a,{sx:jc})})]}),Object(n.jsx)(ye.a,{container:!0,className:h.descriptions,children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:Object(n.jsx)(ce.a,{in:C,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:h.content_descriptions,children:Object(n.jsxs)(ye.a,{container:!0,justify:"space-evenly",spacing:2,align:"center",children:[void 0!==j.niveles&&Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:h.textName,children:j.niveles}),Object(n.jsx)(we.a,{children:j.niveles?H("details.level"):""})]}),null!==j.cantidad_tiempo&&void 0!==(null===j||void 0===j?void 0:j.tiempos)?Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:h.textName,children:"".concat(null===j||void 0===j?void 0:j.cantidad_tiempo," ").concat(null===j||void 0===j?void 0:j.tiempos)}),Object(n.jsx)(we.a,{children:H("details.time")})]}):"",void 0!==j.costos&&Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:h.textName,children:null===j||void 0===j?void 0:j.costos}),Object(n.jsx)(we.a,{children:j.costos?H("details.cost"):""})]})]})})})})}),j.plantillasHabilidades.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:h.menuItem,justify:"space-between",onClick:function(){return T(!S)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:h.textMenuItem,children:H("details.skills")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:S?Object(n.jsx)(Wt.a,{sx:jc}):Object(n.jsx)(Yt.a,{sx:jc})})]}),Object(n.jsx)(ye.a,{container:!0,className:h.descriptions,children:Object(n.jsx)(ce.a,{in:S,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:h.content_descriptions,children:j.plantillasHabilidades.map((function(e,t){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},hc),{},{children:Object(n.jsx)(we.a,{className:"text-left",children:e.habilidades.descripcion})}))},"skill".concat(t))}))})})}),(null===j||void 0===j||null===(l=j.recomendaciones)||void 0===l?void 0:l.length)>0&&Object(n.jsxs)(ye.a,{container:!0,className:h.menuItem,justify:"space-between",onClick:function(){return z(!I)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:h.textMenuItem,children:H("details.recommendations")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:I?Object(n.jsx)(Wt.a,{sx:jc}):Object(n.jsx)(Yt.a,{sx:jc})})]}),(null===j||void 0===j||null===(u=j.recomendaciones)||void 0===u?void 0:u.length)>0&&Object(n.jsx)(ye.a,{container:!0,className:h.descriptions,children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:Object(n.jsx)(ce.a,{in:I,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,className:h.content_descriptions,children:Object(n.jsx)(ye.a,{container:!0,justify:"flex-start",spacing:2,children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:Object(n.jsx)("div",{className:h.certificate,children:j.recomendaciones.map((function(e){var t,a;return Object(n.jsx)(zt,{publicCertificate:!0,templateCertificate:!0,certificateImage:null===e||void 0===e?void 0:e.linkPhotoCertificate,certificateName:null===e||void 0===e||null===(t=e.plantillasCertificadosRecomendadas)||void 0===t?void 0:t.nombre,organizationName:null===j||void 0===j||null===(a=j.organizaciones)||void 0===a?void 0:a.nombre})}))})})})})})})}),(null===j||void 0===j||null===(b=j.camposAdicionales)||void 0===b?void 0:b.length)>0&&(null===j||void 0===j||null===(p=j.camposAdicionales)||void 0===p?void 0:p.map((function(e,t){return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(ye.a,{container:!0,className:h.menuItem,justify:"space-between",onClick:function(){return L(!M&&t+1)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:h.textMenuItem,children:e.titulo_campo},"field-title".concat(t))}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:M===t+1?Object(n.jsx)(Wt.a,{sx:jc}):Object(n.jsx)(Yt.a,{sx:jc})})]}),Object(n.jsx)(ye.a,{container:!0,className:h.descriptions_fields,children:Object(n.jsx)(ce.a,{in:M===t+1,timeout:"auto",children:Object(n.jsxs)(ye.a,{item:!0,lg:12,className:h.content_descriptions_fields,children:[Object(n.jsx)(we.a,{className:h.text,children:e.descripcion_campo.includes("-")?ca(e.descripcion_campo):e.descripcion_campo},"field-description".concat(t)),e.link&&Object(n.jsxs)(Mt.a,{href:e.link,target:"_blank",rel:"noreferrer",className:h.link,children:[H("details.additional")," ",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]})})})]})}))),(null===j||void 0===j?void 0:j.url)&&Object(n.jsxs)(ye.a,{container:!0,className:h.menuItem,justify:"space-between",onClick:function(){return Y(!W)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsxs)(we.a,{className:h.textMenuItem,children:[H("details.additional")," ",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})," "]})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:W?Object(n.jsx)(Wt.a,{sx:jc}):Object(n.jsx)(Yt.a,{sx:jc})})]}),Object(n.jsx)(ye.a,{container:!0,className:h.descriptions,children:Object(n.jsx)(ce.a,{in:W,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:h.content_descriptions,children:Object(n.jsxs)(Mt.a,{href:j.url,target:"_blank",rel:"noreferrer",className:h.link,children:[H("details.additional")," ",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})})})})]})]})}),Object(n.jsx)(ye.a,{container:!0,className:h.footer,children:Object(n.jsxs)(ye.a,{item:!0,lg:12,children:[Object(n.jsx)("span",{className:h.textParagraph,children:H("details.right-reserved")}),Object(n.jsx)("p",{className:h.textName,children:f.organizationName}),Object(n.jsx)("span",{className:h.textParagraph,children:Ne()().format("YYYY")})]})})]})}));var xc=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:"50px",padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},buttonForm:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:"50px",padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}},img_vertical:{maxWidth:"30vw",height:"auto"},img_horizontal:{maxWidth:"70vw",height:"auto"},iconButton:{margin:"0em -.4em"}}})),Oc={changeBreadcrump:I.a,changePage:I.b,setReturnRoute:I.C},vc=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"certificados"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),Oc)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.permission,b=e.changePage,j=e.setReturnRoute,y=e.searchValue,w=Object(u.g)(),C=xc(),k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)([]),z=Object(d.a)(A,2),P=z[0],R=z[1],M=Object(i.useState)(P),L=Object(d.a)(M,2),U=L[0],W=L[1],Y=Object(i.useState)(""),q=Object(d.a)(Y,2),H=q[0],V=q[1],G=Object(i.useState)(""),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(i.useState)(!1),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ne=Object(i.useState)(!1),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)(""),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)({}),me=Object(d.a)(ue,2),be=me[0],pe=me[1],fe=Object(i.useState)({}),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Object(i.useState)({}),ve=Object(d.a)(Oe,2),_e=ve[0],ye=ve[1],we=Object(i.useState)({}),ke=Object(d.a)(we,2),Be=ke[0],Se=ke[1],Te=Object(i.useState)(),Ee=Object(d.a)(Te,2),De=Ee[0],ze=Ee[1],Pe=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),Re=Object(d.a)(Pe,1)[0];Object(i.useEffect)((function(){return Me().catch((function(){w.push("/500"),window.location.reload()})),c(Re("breadCrumps:breadCrumps.certificates-published",{returnObjects:!0})),function(){b(0)}}),[]);var Me=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T(!0),y&&""!==y){e.next=4;break}return e.next=4,Ke();case 4:return e.next=6,Le();case 6:return e.next=8,Fe();case 8:return e.next=10,Ue();case 10:T(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,xe(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,Se(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,ye(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),We=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Ye=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,qe=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),He=function(e,t){var a={limit:t||10,offset:e?e*t:0};return We||(a.id_organizaciones=s),(Ye||qe)&&(a.id_usuarios=o.data_user.id),a},Ke=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=He(0,r),e.next=4,Ce.a.post("/certificateTemplate/getCertificateTemplatesPublished",i);case 4:c=e.sent,o=c.data,R(null===(t=o.certificateTemplates)||void 0===t?void 0:t.rows),W(null===(a=o.certificateTemplates)||void 0===a?void 0:a.rows),ze(null===o||void 0===o||null===(n=o.certificateTemplates)||void 0===n?void 0:n.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),w.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Ve=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),i=He(t,a),e.next=4,Ce.a.post("/certificateTemplate/getCertificateTemplatesPublished",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(P),Object(p.a)(null===(n=c.certificateTemplates)||void 0===n?void 0:n.rows.filter((function(e){return!P.find((function(t){return t.id===e.id}))})))),R(o),W(o),T(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Qe=function(e,t,a,n){switch(a){case"copy":Je(e,t,n);break;case"edit":j("/certificates/published"),w.push("/certificates/edit/".concat(Object(Ie.b)(t)));break;case"archive":Xe(t);break;case"delete":Ze(t)}},Je=function(e,t,a){F.a.fire({text:Re("alerts:alerts.copy-button-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Re("buttons:buttons.accept"),cancelButtonText:Re("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var n=Object(h.a)(f.a.mark((function n(i){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i.value&&$e(t,e,a);case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())},Xe=function(e){F.a.fire({text:Re("alerts:alerts.archive-button-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Re("buttons:buttons.accept"),cancelButtonText:Re("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&et(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Ze=function(e){F.a.fire({text:Re("alerts:alerts.delete-button-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Re("buttons:buttons.accept"),cancelButtonText:Re("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&tt(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},$e=function(e,t,a){var n,i,r,c,l,d,u;t.preventDefault(),T(!0);var b,p=null===P||void 0===P?void 0:P.filter((function(t){return t.id===e})),j=Object(m.a)(Object(m.a)({},p[0]),{},{copy:!0,nombre:"".concat(null===(n=p[0])||void 0===n?void 0:n.nombre," copia"),nombre_privado:"".concat(null===(i=p[0])||void 0===i?void 0:i.nombre_privado," copia"),id_plantillas_recomendadas:null===(r=p[0])||void 0===r?void 0:r.recomendaciones.map((function(e){return{id_plantillas_certificados_recomendadas:e.id_plantillas_certificados_recomendadas}})),id_habilidades:null===(c=p[0])||void 0===c?void 0:c.plantillasHabilidades.map((function(e){return{id_habilidades:e.id_habilidades}})),id_usuarios:null===(l=o.data_user)||void 0===l?void 0:l.id,id_organizaciones:s,camposAdicionales:null===(d=p[0])||void 0===d?void 0:d.certificadoCamposAdicionales.map((function(e){return{titulo_campo:e.titulo_campo,descripcion_campo:e.descripcion_campo,url:e.url}})),certificateFields:null===(u=p[0])||void 0===u?void 0:u.certificadoCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseInt(e.x),y:parseInt(e.y),width:e.width,height:e.height,page:e.page,align:e.formato_letra||"center"}}))});(Ce.a.post("/certificateTemplate",j).then((function(e){T(!1),w.push("/certificates/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:Re("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){T(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:Re("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500})})),s===je.a.idEan&&a)&&Ce.a.put("/certificateTemplate/updateState/".concat(e),{estado:2,id_usuarios:null===(b=o.data_user)||void 0===b?void 0:b.id,fecha_ultima_modificacion:Date.now()}).catch((function(){w.push("/500"),window.location.reload()}))},et=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/certificateTemplate/updateState/".concat(t),{estado:2,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){w.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:Re("alerts:alerts.archived"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){w.push("/certificates/archived")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),tt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/certificateTemplate/".concat(t),{data:{id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id}}).catch((function(){w.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:Re("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){Me()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),at=function(e,t){if(l.includes("Editar")){var a=!1;return(Ye||qe)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:Re("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"edit",onClick:function(t){return Qe(t,e,"edit")},className:C.iconButton,children:Object(n.jsx)(Wn,{})})})}},nt=function(e,t){if(l.includes("Archivar")){var a=!1;return(Ye||qe)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:Re("tables:table.tooltip.archive"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"archive",onClick:function(t){return Qe(t,e,"archive")},className:C.iconButton,children:Object(n.jsx)(Er.a,{})})})}},it=function(e,t){if(l.includes("Eliminar")){var a=!1;return(Ye||qe)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:Re("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"delete",onClick:function(t){return Qe(t,e,"delete")},className:C.iconButton,children:Object(n.jsx)(Cn.a,{})})})}},rt=function(){return Re(We?"tables:table.columns-certificate-published-archived-super":"tables:table.columns-certificate-published-archived",{returnObjects:!0})},ct=function(e){if(We)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})},ot=function(e,t,a){if(l.includes("Copiar")){var i=!1;return(Ye||qe)&&(i=t!==o.data_user.id),Object(n.jsx)(K.a,{title:Re("tables:table.tooltip.copy"),children:Object(n.jsx)(S.a,{disabled:i,"aria-label":"copy",onClick:function(t){return Qe(t,e,"copy",a)},className:C.iconButton,children:Object(n.jsx)(Ar.a,{})})})}},st=function(){te(!1),de("")},lt=function(){ce(!1)};return Object(n.jsxs)(pc,{Index:0,children:[Object(n.jsx)(Fn,{tableName:"templateCertificate",type:"published",items:P,setItems:W,setCountItems:ze,changePage:b,loadData:Me,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:Ye,isDeparmentCreaterRoll:qe,userId:o.data_user.id},setLoading:T}),Object(n.jsx)(zn,{columns:rt(),rows:De,setDirection:V,setOrderBy:X,loading:B,changePagination:Ve,children:Object(n.jsx)(vn.a,{children:U.length>0?B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:rt(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(U,Object(I.f)(H,J)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:Re("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:C.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,de({photo:t,width:a,height:n}),void te(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),ct(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.certificadosEmitidos}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado?Re("tables:table.state.published"):" "}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:Re("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return w.push("/certificates/details/".concat(Object(Ie.b)(e.id)))},className:C.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:at(e.id,e.plantillasCertificadosHistorial[0].id_usuarios)}),Object(n.jsx)(yn.a,{align:"center",children:e.certificadosEmitidos>0?ot(e.id,e.plantillasCertificadosHistorial[0].id_usuarios,!0):ot(e.id,e.plantillasCertificadosHistorial[0].id_usuarios)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:Re("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t=null===P||void 0===P?void 0:P.find((function(t){return t.id===e})),a=ge.find((function(e){return e.id===t.nivel_vp})),n=_e.find((function(e){return e.id===t.tiempo_vp})),i=Be.find((function(e){return e.id===t.costo_vp}));pe(Object(m.a)(Object(m.a)({},t),{},{camposAdicionales:null===t||void 0===t?void 0:t.certificadoCamposAdicionales,niveles:null===a||void 0===a?void 0:a.valor_parametro,tiempos:null===n||void 0===n?void 0:n.valor_parametro,costos:null===i||void 0===i?void 0:i.valor_parametro})),ce(!0)}(e.id)},className:C.iconButton,children:Object(n.jsx)(Ir.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:e.certificadosEmitidos>0?nt(e.id,e.plantillasCertificadosHistorial[0].id_usuarios):it(e.id,e.plantillasCertificadosHistorial[0].id_usuarios)})]},e.id)}))}):B?Object(n.jsx)(qn,{columns:rt(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:Re("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:ee,onClose:st,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.btnClose),onClick:st,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:le.photo,className:le.width>le.height?C.img_horizontal:C.img_vertical})})]}),Object(n.jsxs)(O.a,{open:re,onClose:lt,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:lt,children:Re("dialogs:dialog.preview-title-template-certificate")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:be})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),onClick:lt,children:Re("buttons:buttons.close")})})]})]})})),_c=a(1187),yc=a(1188),wc=a(1189),Cc=a(1186),kc=a(1190);var Nc=function(e){var t=e.children,a=e.Index,i=e.Buttons,r=e.certificateId,c=Object(D.a)("tabs"),o=(0,Object(d.a)(c,1)[0])("tabs.tabs-details",{returnObjects:!0}),s=[{label:"Detalle",route:"/certificates/details/".concat(Object(Ie.b)(r))},{label:"Historial",route:"/certificates/history/".concat(Object(Ie.b)(r))}];return s.map((function(e,t){return o.filter((function(a,n){return t===n?e.label=a.label:""}))})),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:i}),Object(n.jsx)(Rr,{Index:a,TabsHeader:s}),t]})},Bc=a(549),Sc=a(406),Tc=function(e,t){if(e.length>0){var a={Sheets:{Hoja1:Sc.a.json_to_sheet(e)},SheetNames:["Hoja1"]},n=Sc.b(a,{bookType:"xlsx",type:"array"}),i=new Blob([n],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"});Bc.saveAs(i,t+".xlsx")}};var Ac=Object(C.a)((function(e){var t;return{root:{marginTop:"2em",marginBottom:"2em"},icon:{margin:20,fontSize:"4em"},avatar:{width:"auto",height:"auto","&:hover":{cursor:"pointer"}},img:function(e){var t,a;return{maxWidth:"70vw",height:null===(t=e.certificateTemplate)||void 0===t||null===(a=t.certificateTemplate)||void 0===a?void 0:a.height}},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textParagraph:{textAlign:"justify",color:"#5c5c5c",margin:"1em 0 1em 0"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 30px","&:hover":{backgroundColor:E.a.footer}},certificate:(t={display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(195px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}},Object(b.a)(t,e.breakpoints.up("sm"),{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(323px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}}),Object(b.a)(t,e.breakpoints.up("lg"),{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(423px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}}),t),buttonForm:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"}}})),Ec={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},Ic={changeBreadcrump:I.a,setReturnRoute:I.C},Dc=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"certificados"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Ic)((function(e){var t,a,r,c,o,s,l,b,p=e.user,j=e.changeBreadcrump,y=e.permission,w=e.setReturnRoute,C=Object(u.g)(),k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)(!1),I=Object(d.a)(A,2),z=I[0],P=I[1],R=Object(i.useState)({}),M=Object(d.a)(R,2),L=M[0],U=M[1],Y=Object(i.useState)([]),q=Object(d.a)(Y,2),H=q[0],V=q[1],G=Object(i.useState)([]),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(i.useState)({}),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ne=Object(i.useState)({}),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)({}),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)({}),me=Object(d.a)(ue,2),be=me[0],pe=me[1],je=Object(i.useState)([]),fe=Object(d.a)(je,2),he=fe[0],ge=fe[1],xe=Object(i.useState)([]),Oe=Object(d.a)(xe,2),ke=Oe[0],Se=Oe[1],Te=Object(i.useState)([]),Ee=Object(d.a)(Te,2),De=Ee[0],ze=Ee[1],Pe=Object(i.useState)([]),Re=Object(d.a)(Pe,2),Me=Re[0],Le=Re[1],Fe=Object(i.useState)(!1),Ue=Object(d.a)(Fe,2),We=Ue[0],Ye=Ue[1],qe=Object(i.useState)(!1),He=Object(d.a)(qe,2),Ke=He[0],Ve=He[1],Ge=Object(i.useState)(!1),Qe=Object(d.a)(Ge,2),Je=Qe[0],Xe=Qe[1],Ze=Ac({certificateTemplate:L}),$e=Object(i.useState)({}),et=Object(d.a)($e,2),tt=et[0],at=et[1],nt=Object(i.useState)({}),it=Object(d.a)(nt,2),rt=it[0],ct=it[1],ot=Object(i.useState)(!1),st=Object(d.a)(ot,2),lt=st[0],dt=st[1],ut=Object(i.useState)([]),mt=Object(d.a)(ut,2),bt=mt[0],pt=mt[1],jt=Object(D.a)(["certificateBadgeTemplate","tables","alerts","buttons","breadCrumps"]),ft=Object(d.a)(jt,1)[0];Object(i.useEffect)((function(){ht()}),[]);var ht=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),e.next=3,gt();case 3:T(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),gt=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u,b,j,h,g,x,O,v,_,y,w,k,N,B,S,T,A,E,I,D,z,P,R,M,L,F,W,Y;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,z=Object(Ie.a)(e.match.params.id),P=6===p.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,R=6===(null===(a=p.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===a?void 0:a.rol),t.next=6,Ce.a.get("/certificateTemplate/".concat(z));case 6:M=t.sent,L=M.data,U(L.certificateTemplate),V(null===(n=L.certificateTemplate)||void 0===n||null===(i=n.certificateTemplate)||void 0===i?void 0:i.certificadosEmitidos),xt(null===(r=L.certificateTemplate)||void 0===r||null===(c=r.certificateTemplate)||void 0===c?void 0:c.tiempo_vp),Ot(null===(o=L.certificateTemplate)||void 0===o||null===(s=o.certificateTemplate)||void 0===s?void 0:s.nivel_vp),vt(null===(l=L.certificateTemplate)||void 0===l||null===(d=l.certificateTemplate)||void 0===d?void 0:d.costo_vp),yt(null===(u=L.certificateTemplate)||void 0===u||null===(b=u.certificateTemplate)||void 0===b?void 0:b.tipo_vp),X(null===(j=L.certificateTemplate)||void 0===j?void 0:j.skillsTemplate),ge(null===(h=L.certificateTemplate)||void 0===h?void 0:h.criterion),Se(null===(g=L.certificateTemplate)||void 0===g?void 0:g.recommendations),pt(null===(x=L.certificateTemplate)||void 0===x?void 0:x.certificateFieldsAdditionals),wt(null===(O=L.certificateTemplate)||void 0===O||null===(v=O.certificateTemplate)||void 0===v?void 0:v.estado),ze(L.certificateTemplate.certificateModules),ct(Object(m.a)(Object(m.a)({},null===(_=L.certificateTemplate)||void 0===_?void 0:_.certificateTemplate),{},{copy:!0,nombre:"".concat(null===(y=L.certificateTemplate)||void 0===y||null===(w=y.certificateTemplate)||void 0===w?void 0:w.nombre," copia"),nombre_privado:"".concat(null===(k=L.certificateTemplate)||void 0===k||null===(N=k.certificateTemplate)||void 0===N?void 0:N.nombre_privado," copia"),id_plantillas_recomendadas:null===(B=L.certificateTemplate)||void 0===B?void 0:B.recommendations.map((function(e){return{id_plantillas_certificados_recomendadas:e.id_plantillas_certificados_recomendadas}})),criterios:null===(S=L.certificateTemplate)||void 0===S?void 0:S.criterion,id_habilidades:null===(T=L.certificateTemplate)||void 0===T?void 0:T.skillsTemplate.map((function(e){return{id_habilidades:e.id_habilidades}})),id_usuarios:null===(A=p.data_user)||void 0===A?void 0:A.id,camposAdicionales:null===(E=L.certificateTemplate)||void 0===E?void 0:E.certificateFieldsAdditionals.map((function(e){return{titulo_campo:e.titulo_campo,descripcion_campo:e.descripcion_campo,url:e.url}})),certificateFields:null===(I=L.certificateTemplate)||void 0===I||null===(D=I.certificateTemplate)||void 0===D?void 0:D.certificadoCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseInt(e.x),y:parseInt(e.y),width:e.width,height:e.height,page:e.page,align:e.formato_letra||"center"}}))})),(P||R)&&((null===(F=L.certificateTemplate)||void 0===F||null===(W=F.templatesCertificatesHistory)||void 0===W?void 0:W.filter((function(e){return 34===parseInt(e.accion)}))[0].id_usuarios)===(null===(Y=p.data_user)||void 0===Y?void 0:Y.id)?dt(!1):dt(!0)),t.next=27;break;case 24:t.prev=24,t.t0=t.catch(0),C.push("/500");case 27:case"end":return t.stop()}}),t,null,[[0,24]])})));return function(){return t.apply(this,arguments)}}(),xt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:a=e.sent,n=a.data,i=n.time.filter((function(e){return e.id===t})),ce(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ot=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:a=e.sent,n=a.data,i=n.levels.filter((function(e){return e.id===t})),te(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),vt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:a=e.sent,n=a.data,i=n.costs.filter((function(e){return e.id===t})),de(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),yt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTypes");case 2:a=e.sent,n=a.data,i=n.types.filter((function(e){return e.id===t})),pe(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),wt=function(e){j(ft(1===e?"breadCrumps:breadCrumps.certificate-details-published":0===e?"breadCrumps:breadCrumps.certificate-details-edited":"breadCrumps:breadCrumps.certificate-details-archived",{returnObjects:!0}))},Ct=function(e,t,a){switch(a){case"archive":kt(t);break;case"publish":Nt(t);break;case"delete":Bt(t)}},kt=function(e){F.a.fire({text:ft("alerts:alerts.archive-button-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ft("buttons:buttons.accept"),cancelButtonText:ft("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Tt(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Nt=function(e){F.a.fire({text:ft("alerts:alerts.publish-button-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ft("buttons:buttons.accept"),cancelButtonText:ft("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&St(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Bt=function(e){F.a.fire({text:ft("alerts:alerts.delete-button-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ft("buttons:buttons.accept"),cancelButtonText:ft("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&At(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},St=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.put("/certificateTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=p.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()});case 3:n=e.sent,n.data&&F.a.fire({text:ft("alerts:alerts.published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){C.push("/certificates/published")})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),C.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),Tt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.put("/certificateTemplate/updateState/".concat(t),{estado:2,id_usuarios:null===(a=p.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()});case 3:n=e.sent,n.data&&F.a.fire({text:ft("alerts:alerts.archived"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){C.push("/certificates/archived")})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),C.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),At=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/certificateTemplate/".concat(t),{data:{id_usuarios:null===(a=p.data_user)||void 0===a?void 0:a.id}});case 3:n=e.sent,n.data&&(0===L.certificateTemplate.estado?F.a.fire({text:ft("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){C.push("/certificates/edited")})):F.a.fire({text:ft("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){C.push("/certificates/published")}))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),C.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),Et=function(){w("/certificates/details/".concat(e.match.params.id)),C.push("/certificates/edit/".concat(Object(Ie.b)(L.certificateTemplate.id)))},It=function(e,t){F.a.fire({text:ft("alerts:alerts.copy-button-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ft("buttons:buttons.accept"),cancelButtonText:ft("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&Dt(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},Dt=function(e,t){t.preventDefault(),P(!0),Ce.a.post("/certificateTemplate",e).then((function(e){T(!1),C.push("/certificates/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:ft("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){P(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:ft("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500})}))},Pt=function(){at(Object(m.a)(Object(m.a)({},null===L||void 0===L?void 0:L.certificateTemplate),{},{criterios:null===L||void 0===L?void 0:L.criterion,plantillasHabilidades:null===L||void 0===L?void 0:L.skillsTemplate,recomendaciones:null===L||void 0===L?void 0:L.recommendations,camposAdicionales:null===L||void 0===L?void 0:L.certificateFieldsAdditionals,linkPhotoTemplate:null===L||void 0===L?void 0:L.linkPhotoTemplate[0],photoOrganization:null===L||void 0===L?void 0:L.linkPhotoOrganization,niveles:null===ee||void 0===ee?void 0:ee.valor_parametro,costos:null===le||void 0===le?void 0:le.valor_parametro,tiempos:null===re||void 0===re?void 0:re.valor_parametro,tipos:null===be||void 0===be?void 0:be.valor_parametro})),Ve(!0)},Rt=function(){Ve(!1)},Mt=function(){Ye(!1)},Ft=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Xe(!0),e.next=3,Ce.a.post("session/generateQR",{sessions:t,id_plantillas:null===L||void 0===L||null===(a=L.certificateTemplate)||void 0===a?void 0:a.id,id_organizaciones:null===L||void 0===L||null===(n=L.certificateTemplate)||void 0===n?void 0:n.id_organizaciones});case 3:i=e.sent,r=i.data,Le(null===r||void 0===r?void 0:r.sessions);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ut=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),e.prev=1,e.next=4,Ce.a.post("sessionUser/getSessionsUsser",{id_sesiones:t.id});case 4:a=e.sent,n=a.data,i=null===n||void 0===n?void 0:n.sessions.map((function(e){var a,n,i,r,c,o,s;return{Sesion:null===t||void 0===t?void 0:t.titulo_sesion,Nombres:"".concat(null===e||void 0===e||null===(a=e.usuarios)||void 0===a?void 0:a.primer_nombre," ").concat((null===e||void 0===e||null===(n=e.usuarios)||void 0===n?void 0:n.segundo_nombre)||""),Apellidos:"".concat(null===e||void 0===e||null===(i=e.usuarios)||void 0===i?void 0:i.primer_apellido," ").concat((null===e||void 0===e||null===(r=e.usuarios)||void 0===r?void 0:r.segundo_apellido)||""),Email:"".concat(null===e||void 0===e||null===(c=e.usuarios)||void 0===c||null===(o=c.cuentas[0])||void 0===o?void 0:o.correo),Telefono:"".concat((null===e||void 0===e||null===(s=e.usuarios)||void 0===s?void 0:s.telefono)||""),Observaciones:"".concat((null===e||void 0===e?void 0:e.observaciones)||""),Calificaciones:"".concat(null===e||void 0===e?void 0:e.calificacion),Fecha:"".concat(null===e||void 0===e?void 0:e.fecha_hora)}})),Tc(i,null===t||void 0===t?void 0:t.titulo_sesion),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(1),F.a.fire({icon:"error",iconColor:E.a.primary,text:ft("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}),T(!1);case 14:T(!1);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(Nc,{Index:0,Buttons:function(){var e,t,a;return 0===(null===(e=L.certificateTemplate)||void 0===e?void 0:e.estado)?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{className:Ze.button,onClick:function(e){return Pt()},children:Object(n.jsx)(Ir.a,{})})})}),y.includes("Publicar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.publish"),children:Object(n.jsx)(x.a,{className:Ze.button,onClick:function(e){var t;return Ct(e,null===(t=L.certificateTemplate)||void 0===t?void 0:t.id,"publish")},children:Object(n.jsx)(ci.a,{})})})}),y.includes("Editar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.edit"),children:Object(n.jsx)(x.a,{className:Ze.button,onClick:Et,children:Object(n.jsx)(Wn,{})})})}),y.includes("Copiar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.copy"),children:Object(n.jsx)(x.a,{disabled:lt,className:Ze.button,onClick:function(e){return It(e,rt)},children:Object(n.jsx)(Ar.a,{})})})}),y.includes("Eliminar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.delete"),children:Object(n.jsx)(x.a,{className:Ze.button,onClick:function(e){var t;return Ct(e,null===(t=L.certificateTemplate)||void 0===t?void 0:t.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]}):1===(null===(t=L.certificateTemplate)||void 0===t?void 0:t.estado)?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{className:Ze.button,onClick:function(e){return Pt()},children:Object(n.jsx)(Ir.a,{})})})}),y.includes("Editar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.edit"),children:Object(n.jsx)(x.a,{disabled:lt,className:Ze.button,onClick:Et,children:Object(n.jsx)(Wn,{})})})}),y.includes("Copiar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.copy"),children:Object(n.jsx)(x.a,{disabled:lt,className:Ze.button,onClick:function(e){return It(e,rt)},children:Object(n.jsx)(Ar.a,{})})})}),0!==H?y.includes("Archivar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.archive"),children:Object(n.jsx)(x.a,{disabled:lt,className:Ze.button,onClick:function(e){var t;return Ct(e,null===(t=L.certificateTemplate)||void 0===t?void 0:t.id,"archive")},children:Object(n.jsx)(Er.a,{})})})}):y.includes("Eliminar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.delete"),children:Object(n.jsx)(x.a,{disabled:lt,className:Ze.button,onClick:function(e){var t;return Ct(e,null===(t=L.certificateTemplate)||void 0===t?void 0:t.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]})}):2===(null===(a=L.certificateTemplate)||void 0===a?void 0:a.estado)?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{className:Ze.button,onClick:function(e){return Pt()},children:Object(n.jsx)(Ir.a,{})})})}),y.includes("Publicar")&&Object(n.jsx)(ye.a,{item:!0,lg:2,md:2,xs:5,children:Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.publish"),children:Object(n.jsx)(x.a,{className:Ze.button,onClick:function(e){var t;return Ct(e,null===(t=L.certificateTemplate)||void 0===t?void 0:t.id,"publish")},children:Object(n.jsx)(ci.a,{})})})})]}):void 0}(),certificateId:Object(Ie.a)(e.match.params.id),children:[Object(n.jsx)(ve.a,{children:Object(n.jsxs)(_e.a,{className:Ze.root,maxWidth:"lg",children:[Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:5,md:5,xs:12,children:Object(n.jsx)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:B?Object(n.jsx)(Be.a,{variant:"circle",children:Object(n.jsx)(g.a,{className:Ze.avatar})}):Object(n.jsx)(K.a,{title:ft("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"img-prev",src:L.linkPhotoTemplate?L.linkPhotoTemplate[0]:L.linkPhoto&&L.linkPhoto[0],variant:"square",className:Ze.avatar,onClick:function(){return Ye(!0)},children:Object(n.jsx)(Cc.a,{sx:{margin:4,fontSize:"4em"}})})})})}),Object(n.jsx)(ye.a,{item:!0,lg:7,md:7,xs:12,children:Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:Ze.textTitle,children:B?Object(n.jsx)(Be.a,{}):"".concat(null===(t=L.certificateTemplate)||void 0===t?void 0:t.nombre)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{variant:"h6",gutterBottom:!0,className:Ze.textTitle,children:B?Object(n.jsx)(Be.a,{}):"".concat(null===(a=L.certificateTemplate)||void 0===a?void 0:a.nombre_privado)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{className:Ze.textParagraph,children:B?Object(n.jsx)(Be.a,{}):"".concat(null===(r=L.certificateTemplate)||void 0===r?void 0:r.descripcion)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Ze.textBolder,children:[ft("certificateBadgeTemplate:details.issued-by"),": "]}),Object(n.jsx)("span",{className:Ze.text,children:null===(c=L.certificateTemplate)||void 0===c||null===(o=c.organizaciones)||void 0===o?void 0:o.nombre})]})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Ze.textBolder,children:[ft("certificateBadgeTemplate:details.created"),": "]}),Object(n.jsx)("span",{className:Ze.text,children:Ne()(null===(s=L.certificateTemplate)||void 0===s?void 0:s.fecha_creacion).format("DD-MM-YYYY")})]})})]})})]}),Object(n.jsx)(W.a,{className:Ze.root}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsxs)(ye.a,{item:!0,lg:6,md:6,xs:12,justify:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:B?Object(n.jsx)(Be.a,{}):Object(n.jsx)("span",{className:Ze.textBolder,children:J.length>0?"".concat(ft("certificateBadgeTemplate:details.skills"),":"):""})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(ye.a,{container:!0,children:B?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:"5em"}):Object(n.jsx)(n.Fragment,{children:J.map((function(e){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Ec),{},{children:Object(n.jsx)(we.a,{children:e.habilidades.descripcion})}))})}))})})})]}),Object(n.jsx)(W.a,{orientation:"vertical",flexItem:!0,className:Ze.divider}),Object(n.jsx)(ye.a,{item:!0,lg:5,md:5,xs:12,children:Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[(null===be||void 0===be?void 0:be.valor_parametro)&&Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Ze.textBolder,children:[ft("certificateBadgeTemplate:details.type"),": "]}),Object(n.jsx)("span",{className:Ze.text,children:be.valor_parametro})]})}),(null===ee||void 0===ee?void 0:ee.valor_parametro)&&Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Ze.textBolder,children:[ft("certificateBadgeTemplate:details.level"),": "]}),Object(n.jsx)("span",{className:Ze.text,children:ee.valor_parametro})]})}),B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:Object(n.jsx)(Be.a,{variant:"text"})})}):Object(n.jsx)(n.Fragment,{children:null!==(null===L||void 0===L||null===(l=L.certificateTemplate)||void 0===l?void 0:l.cantidad_tiempo)&&void 0!==(null===re||void 0===re?void 0:re.valor_parametro)?Object(n.jsxs)(ye.a,{item:!0,lg:12,md:6,xs:6,children:[Object(n.jsxs)("span",{className:Ze.textBolder,children:[ft("certificateBadgeTemplate:details.time"),": "]}),Object(n.jsx)("span",{className:Ze.text,children:"".concat(null===L||void 0===L||null===(b=L.certificateTemplate)||void 0===b?void 0:b.cantidad_tiempo," ").concat(null===re||void 0===re?void 0:re.valor_parametro)})]}):""}),(null===le||void 0===le?void 0:le.valor_parametro)&&Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Ze.textBolder,children:[ft("certificateBadgeTemplate:details.cost"),": "]}),Object(n.jsx)("span",{className:Ze.text,children:le.valor_parametro})]})}),(null===he||void 0===he?void 0:he.length)>0&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{className:Ze.textBolder,children:B?Object(n.jsx)(Be.a,{}):"".concat(ft("certificateBadgeTemplate:details.requirements-certificate"),": ")})}),Object(n.jsx)(ye.a,{item:!0,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{variant:"text",width:200})}):Object(n.jsx)(n.Fragment,{children:he.map((function(e,t){return Object(n.jsx)(we.a,{className:Ze.text,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))}))})})]}),(null===bt||void 0===bt?void 0:bt.length)>0&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{className:Ze.textBolder,children:B?Object(n.jsx)(Be.a,{}):"".concat(ft("certificateBadgeTemplate:details.fields-additionals"),": ")})}),Object(n.jsx)(ye.a,{item:!0,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{variant:"text",width:200})}):Object(n.jsx)(n.Fragment,{children:bt.map((function(e,t){return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Ze.textBolder,children:[e.titulo_campo,": "]}),Object(n.jsx)("span",{className:Ze.text,children:e.descripcion_campo})]})}))})})]})]})})]}),(null===De||void 0===De?void 0:De.length)>0&&Object(n.jsx)(W.a,{}),(null===De||void 0===De?void 0:De.length)>0&&Object(n.jsx)(ye.a,{container:!0,spacing:2,children:Object(n.jsxs)(ye.a,{item:!0,lg:12,md:12,xs:12,children:[Object(n.jsx)(we.a,{className:Ze.textBolder,children:"M\xf3dulos"}),Object(n.jsx)(ye.a,{container:!0,spacing:2,children:De.map((function(e,t){return Object(n.jsx)(ye.a,{item:!0,xs:12,md:4,lg:4,children:Object(n.jsx)(ve.a,{children:Object(n.jsx)(_c.a,{onClick:function(){return Ft(e.sessions)},children:Object(n.jsxs)(_e.a,{children:[Object(n.jsxs)(we.a,{sx:{fontSize:14},color:"text.secondary",gutterBottom:!0,children:["M\xf3dulo ",t+1]}),Object(n.jsx)(we.a,{variant:"h5",component:"div",children:null===e||void 0===e?void 0:e.titulo_modulo}),Object(n.jsx)(we.a,{variant:"body2",children:null===e||void 0===e?void 0:e.descripcion_modulo})]})})})},"modulo".concat(t))}))})]})}),(null===ke||void 0===ke?void 0:ke.length)>0&&Object(n.jsx)(W.a,{className:Ze.root}),Object(n.jsx)(ye.a,{container:!0,spacing:1,children:Object(n.jsx)(ye.a,{item:!0,lg:12,md:12,xs:12,children:(null===ke||void 0===ke?void 0:ke.length)>0?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{className:Ze.textBolder,children:[ft("certificateBadgeTemplate:details.recommendations"),":"]}),Object(n.jsx)("div",{className:Ze.certificate,children:ke.map((function(e){var t,a,i,r;return Object(n.jsx)(zt,{publicCertificate:!1,templateCertificate:!0,issuedId:Object(Ie.b)(null===e||void 0===e||null===(t=e.plantillasCertificadosRecomendadas)||void 0===t?void 0:t.id),certificateImage:null===e||void 0===e?void 0:e.linkPhotoCertificate,certificateName:null===e||void 0===e||null===(a=e.plantillasCertificadosRecomendadas)||void 0===a?void 0:a.nombre,organizationName:null===e||void 0===e||null===(i=e.plantillasCertificadosRecomendadas)||void 0===i||null===(r=i.organizaciones)||void 0===r?void 0:r.nombre})}))})]}):""})})]})}),Object(n.jsxs)(O.a,{open:We,onClose:Mt,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(Ze.buttonForm),onClick:Mt,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:L.linkPhotoTemplate?L.linkPhotoTemplate[0]:L.linkPhoto&&L.linkPhoto[0],className:Ze.img})})]}),Object(n.jsxs)(O.a,{open:Ke,onClose:Rt,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:Rt,children:ft("dialogs:dialog.preview-title-template-certificate")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:tt})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(Ze.buttonForm),onClick:Rt,children:ft("buttons:buttons.close")})})]}),Object(n.jsx)(O.a,{open:Je,onClose:function(){Xe(!1)},fullWidth:!0,maxWidth:"lg",children:Object(n.jsx)(_.a,{children:Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,style:{display:"flex"},children:Object(n.jsx)(we.a,{className:Ze.textBolder,style:{marginTop:"12px"},children:"Sesiones"})}),Me.length>0&&Me.map((function(e){return Object(n.jsx)(ye.a,{item:!0,xs:12,md:3,lg:3,children:Object(n.jsx)(ve.a,{style:{backgroundColor:"#f2f2f2"},children:Object(n.jsxs)(_e.a,{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[Object(n.jsx)(we.a,{className:Ze.textBolder,children:null===e||void 0===e?void 0:e.titulo_sesion}),Object(n.jsx)(yc.a,{style:{width:"150px",height:"fit-content"},component:"img",image:e.imagen,alt:"qr"}),Object(n.jsxs)(wc.a,{children:[Object(n.jsx)(K.a,{title:"Descargar",children:Object(n.jsx)(S.a,{onClick:function(){return function(e){var t=document.createElement("a");t.download=e,t.href=e,t.click()}(null===e||void 0===e?void 0:e.imagen)},children:Object(n.jsx)(va.a,{})})}),Object(n.jsx)(K.a,{title:"Descargar",children:Object(n.jsx)(S.a,{onClick:function(){return Ut(e)},children:Object(n.jsx)(kc.a,{})})})]})]})})},"session".concat(null===e||void 0===e?void 0:e.id))}))]})})}),Object(n.jsx)(_t,{loading:z})]})})),zc=Object(C.a)((function(e){return{formControl:{margin:e.spacing(1),minWidth:120},margin:{marginTop:20}}}));var Pc={changeBreadcrump:I.a},Rc=Object(s.b)(null,Pc)((function(e){var t=e.changeBreadcrump,a=zc();return Object(i.useEffect)((function(){t([{name:"Insignias"},{name:"Plantillas",route:"/templates/published"},{name:"Percepciones"}])}),[]),Object(n.jsx)(Nc,{Index:1,BadgeId:e.match.params.id,children:Object(n.jsx)(ve.a,{children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{color:"textPrimary",gutterBottom:!0,children:"Mostrando Resultados por"}),Object(n.jsxs)(ye.a,{container:!0,spacing:3,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:a.formControl,children:Object(n.jsxs)(T.a,{defaultValue:30,inputProps:{name:"name",id:"uncontrolled-native"},children:[Object(n.jsx)("option",{value:10,children:"Estados Unidos"}),Object(n.jsx)("option",{value:20,children:"Estados Unidos"}),Object(n.jsx)("option",{value:30,children:"Estados Unidos"})]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:a.formControl,children:Object(n.jsxs)(T.a,{defaultValue:10,inputProps:{name:"name",id:"uncontrolled-native"},children:[Object(n.jsx)("option",{value:10,children:"Todos los estados"}),Object(n.jsx)("option",{value:20,children:"Estados Unidos"}),Object(n.jsx)("option",{value:30,children:"Estados Unidos"})]})})})]}),Object(n.jsx)(we.a,{className:a.margin,color:"textPrimary",gutterBottom:!0,align:"center",children:"454566 Vacantes de trabajo"}),Object(n.jsx)(we.a,{className:a.margin,color:"textPrimary",gutterBottom:!0,align:"center",children:"Titulos"}),Object(n.jsx)($r.a,{}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{className:a.margin,color:"textPrimary",gutterBottom:!0,align:"center",children:"Localizaciones"}),Object(n.jsx)($r.a,{}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{className:a.margin,color:"textPrimary",gutterBottom:!0,align:"center",children:"Empleadores"}),Object(n.jsx)($r.a,{}),Object(n.jsx)(W.a,{})]})})})}));var Mc=Object(C.a)((function(){return{root:{display:"flex",alignItems:"center",border:"2.8px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",marginTop:"1rem"}}})),Lc={changePage:I.b,changeBreadcrump:I.a},Fc=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage}}),Lc)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=e.changePage,o=Mc(),s=Object(i.useState)(!1),l=Object(d.a)(s,2),u=l[0],m=l[1],b=Object(i.useState)(!1),p=Object(d.a)(b,2),j=p[0],g=p[1],x=Object(i.useState)(!1),y=Object(d.a)(x,2),w=y[0],C=y[1],k=Object(i.useState)([]),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)([]),E=Object(d.a)(A,2),z=E[0],P=E[1],R=Object(i.useState)([{descripcion:"",valor:"",nuevoValor:"",tipo:"",recomendacion:""}]),M=Object(d.a)(R,2),L=M[0],F=M[1],U=Object(i.useState)(""),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(""),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)({}),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(D.a)(["tables","breadCrumps","dialogs"]),te=Object(d.a)(ee,1)[0];Object(i.useEffect)((function(){ae()}),[]);var ae=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,m(!0),c(0),t.next=5,ie();case 5:return t.next=7,ne();case 7:return m(!1),t.next=10,Ce.a.post("/certificateTemplate/getCertificateTemplates",{estado:1});case 10:a=t.sent,n=a.data,T(n.certificateTemplates),t.next=18;break;case 15:t.prev=15,t.t0=t.catch(0),e.history.push("/500");case 18:case"end":return t.stop()}}),t,null,[[0,15]])})));return function(){return t.apply(this,arguments)}}(),ne=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/parameterValueParameter/getParameterValueParameter");case 2:t=e.sent,a=t.data,P(a.parametersValueParameters);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/certificateTemplateHistory/getCertificateTemplatesHistory",{id_plantillas_certificados:i});case 3:r=t.sent,c=r.data,$(c.certificateTemplatesHistory),re(null===(a=c.certificateTemplatesHistory[0])||void 0===a||null===(n=a.plantillasCertificados)||void 0===n?void 0:n.estado);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),re=function(e){r(te(1===e?"breadCrumps:breadCrumps.certificate-history-published":0===e?"breadCrumps:breadCrumps.certificate-history-edited":"breadCrumps:breadCrumps.certificate-history-archived",{returnObjects:!0}))},ce=function(e){Z.map(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.id===e&&(""!==a.nuevoValor?F([{descripcion:"Creaci\xf3n",valor:B.filter((function(e){return e.id===parseInt(a.nuevoValor)}))}]):F([{descripcion:"Creaci\xf3n",valor:""}]));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),C(!0)},oe=function(e){var t=0,a="";return z.map((function(n){n.id===parseInt(e)&&(t=1,a=n.valor_parametro)})),0===t?e:a},se=te("tables:table.columns-history",{returnObjects:!0});return Object(n.jsxs)(Nc,{Index:2,certificateId:Object(Ie.a)(e.match.params.id),children:[Object(n.jsx)(ve.a,{children:Object(n.jsx)(zn,{columns:se,rows:Z,setDirection:q,setOrderBy:Q,loading:u,children:u?Object(n.jsx)(qn,{columns:se,photo:0}):Object(n.jsx)(vn.a,{children:Z.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(Z,Object(I.f)(Y,G)).slice(t*a,t*a+a).map((function(e){var t,a;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(t=e.usuarios)||void 0===t?void 0:t.primer_nombre," ").concat(null===(a=e.usuarios)||void 0===a?void 0:a.primer_apellido)}),Object(n.jsx)(yn.a,{align:"center",children:oe(e.accion)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:te("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t="",a=[];Z.map(function(){var n=Object(h.a)(f.a.mark((function n(i){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i.id===e&&(34===i.accion?ce(e):36===i.accion||37===i.accion?(F([{descripcion:36===i.accion?"Publicado":"Archivado",valor:i.valor,nuevoValor:i.nuevoValor,tipo:"info"}]),g(!0)):(t=i.valor.split("\xbf?")).length>0&&(t.map(function(){var e=Object(h.a)(f.a.mark((function e(t,n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0!==n&&((t=t.split("$%&"))[0].includes("esta")?a.push({descripcion:t[0],valor:t[1],nuevoValor:t[2],tipo:"info",recomendacion:B.filter((function(e){return e.id===parseInt(t[1])}))}):a.push({descripcion:t[0],valor:t[1],nuevoValor:t[2],tipo:"info"}));case 1:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}()),F(a),g(!0)));case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())}(e.id)},children:Object(n.jsx)(Ge.a,{})})})})]},e.id)}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:te("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:j,onClose:function(){g(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.details")}),Object(n.jsx)(_.a,{children:L.length>0?Object(n.jsx)(n.Fragment,{children:L.map((function(e){var t,a,i,r,c,s,l;return Object(n.jsxs)(ye.a,{container:!0,xs:12,className:o.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(Qi.a,{severity:e.tipo,children:e.descripcion})}),"Se a\xf1adi\xf3 esta plantilla como recomendaci\xf3n."===e.descripcion||"Se elimin\xf3 esta plantilla recomendada."===e.descripcion?e.recomendacion.length>0?Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)(zt,{format:(null===(t=e.recomendacion[0])||void 0===t?void 0:t.width)<(null===(a=e.recomendacion[0])||void 0===a?void 0:a.height)?0:1,certificateImage:e.recomendacion[0].linkPhoto,certificateName:null===(i=e.recomendacion[0])||void 0===i?void 0:i.nombre,organizationName:null===(r=e.recomendacion[0])||void 0===r||null===(c=r.organizaciones)||void 0===c?void 0:c.nombre})}):"":Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:6,lg:6,children:null!==e.valor&&(null===(s=e.valor)||void 0===s?void 0:s.length)>0?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.previous")}),Object(n.jsx)(_.a,{align:"center",children:e.descripcion.includes("atributo 'cantidad de tiempo'")||e.descripcion.includes("tama\xf1o de fuente")?e.valor:oe(e.valor)})]}):""}),Object(n.jsx)(ye.a,{item:!0,xs:6,lg:6,children:null!==e.valor&&(null===(l=e.valor)||void 0===l?void 0:l.length)>0?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.current")}),Object(n.jsx)(_.a,{align:"center",children:e.descripcion.includes("atributo 'cantidad de tiempo'")||e.descripcion.includes("tama\xf1o de fuente")?e.nuevoValor:oe(e.nuevoValor)})]}):""})]})]})}))}):""})]}),Object(n.jsxs)(O.a,{open:w,onClose:function(){C(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.details")}),L.length>0?Object(n.jsx)(n.Fragment,{children:L.map((function(e){var t,a,i,r,c,o,s;return Object(n.jsxs)(_.a,{align:"center",children:[Object(n.jsx)(Qi.a,{severity:"info",children:e.descripcion}),""!==e.valor&&(null===(t=e.valor[0])||void 0===t?void 0:t.linkPhoto)?Object(n.jsx)(zt,{format:(null===(a=e.valor[0])||void 0===a?void 0:a.width)<(null===(i=e.valor[0])||void 0===i?void 0:i.height)?0:1,certificateImage:null===(r=e.valor[0])||void 0===r?void 0:r.linkPhoto,certificateName:null===(c=e.valor[0])||void 0===c?void 0:c.nombre,organizationName:null===(o=e.valor[0])||void 0===o||null===(s=o.organizaciones)||void 0===s?void 0:s.nombre}):""]})}))}):Object(n.jsx)(yn.a,{align:"center",children:te("tables:table.empty-table")})]})]})})),Uc=a(1191),Wc=a(83),Yc=a(110),qc=a(223),Hc=a.n(qc),Kc=a(559),Vc=a.n(Kc),Gc=a(558),Qc=a.n(Gc);function Jc(e){var t=e.children,a=e.value,i=e.index,r=Object(Se.a)(e,["children","value","index"]);return Object(n.jsx)("div",Object(m.a)(Object(m.a)({role:"tabpanel",hidden:a!==i,id:"full-width-tabpanel-".concat(i),"aria-labelledby":"full-width-tab-".concat(i)},r),{},{children:a===i&&Object(n.jsx)(Lt.a,{p:2,children:t})}))}function Xc(e){return{id:"full-width-tab-".concat(e),"aria-controls":"full-width-tabpanel-".concat(e)}}var Zc=Object(xe.a)((function(e){return{root:{margin:0,padding:e.spacing(2)},closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]}}}))((function(e){var t=e.children,a=e.classes,i=e.onClose,r=Object(Se.a)(e,["children","classes","onClose"]);return Object(n.jsxs)(v.a,Object(m.a)(Object(m.a)({disableTypography:!0,className:a.root},r),{},{children:[Object(n.jsx)(we.a,{variant:"h6",children:t}),i?Object(n.jsx)(S.a,{"aria-label":"close",className:a.closeButton,onClick:i,children:Object(n.jsx)(ae.a,{})}):null]}))})),$c=Object(C.a)((function(e){return{root:{display:"flex",border:"2.8px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",marginBottom:"1rem"},text:{marginTop:"1em"},container:{marginTop:".5em",marginBottom:".5em"},alert:{backgroundColor:e.palette.primary.light},divider:{marginTop:"-.5rem"},grid:Object(b.a)({paddingRight:".8em"},e.breakpoints.up("sm"),{paddingRight:"5em"}),button:{margin:"0.5em",padding:".5em 1em",borderRadius:"10px"},container__input_root:{borderRadius:"10px"},dropzone:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",borderColor:e.palette.primary.main,borderRadius:15,"& .MuiGrid-container":{justifyContent:"center"}},dropzoneParagraph:{color:"gray",fontSize:"1.1em"},paper:{flexGrow:1,width:"100%",backgroundColor:"#F5F5F5"}}})),eo=function(e){var t=e.open,a=void 0!==t&&t,r=e.setOpen,c=e.organizationId,o=e.idCertificateTemplate,s=e.loadData,l=e.fieldAdditionals,u=$c(),b=Object(Wc.a)(),p=Object(i.useState)([]),j=Object(d.a)(p,2),g=j[0],v=j[1],C=Object(i.useState)(!1),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)(0),A=Object(d.a)(T,2),I=A[0],z=A[1],P=Object(D.a)(["alerts","certificateBadgeTemplate","buttons"]),R=Object(d.a)(P,1)[0];console.log("fieldAdditionals -> ",l);var M=function(){v([]),r(!1)},L=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(a=t)&&v(a);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),U=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(g.length>0)){e.next=8;break}return B(!0),t=new FormData,g.map(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.append("file",a);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t.append("id_plantillas_certificados",o),t.append("id_organizaciones",c),e.next=8,ct()({method:"post",url:"".concat(je.a.apiURL,"/certificatesFieldsAdditionals/uploadSignature"),headers:{"Content-Type":"multipart/form-data"},data:t}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.data&&(B(!1),r(!1),F.a.fire({icon:"success",iconColor:E.a.primary,text:R("alerts:alerts.saved"),showConfirmButton:!1,timer:1500}).then((function(){s()})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){B(!1),r(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:R("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500})}));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),W=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,Ce.a.delete("/certificatesFieldsAdditionals/".concat(t));case 3:a=e.sent,a.data&&(B(!1),r(!1),F.a.fire({text:R("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){s()})));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(O.a,{open:a,onClose:M,fullWidth:!0,maxWidth:"md",children:[Object(n.jsx)(Zc,{align:"center",onClose:M}),Object(n.jsx)(_.a,{children:Object(n.jsxs)(ye.a,{container:!0,className:u.container,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,className:u.grid,align:"center",children:Object(n.jsx)(kn.a,{children:Object(n.jsxs)(Dr.a,{className:u.paper,value:I,onChange:function(e,t){z(t)},indicatorColor:"primary",textColor:"primary",centered:!0,children:[Object(n.jsx)(zr.a,Object(m.a)({label:"Subir firma"},Xc(0))),Object(n.jsx)(zr.a,Object(m.a)({label:"Firmas"},Xc(1)))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,className:u.grid,align:"center",children:Object(n.jsxs)(Hc.a,{axis:"rtl"===b.direction?"x-reverse":"x",index:I,onChangeIndex:function(e){z(e)},children:[Object(n.jsx)(Jc,{value:I,index:0,dir:b.direction,children:Object(n.jsx)(Yc.a,{filesLimit:1,acceptedFiles:["image/jpeg","image/jpg","image/png","image/bmp","image/gif","image/tiff","image/heif","image/raw","image/psd","image/webp","image/svg+xml","image/x-icon","image/jp2"],dropzoneText:R("certificateBadgeTemplate:badges-certificate-form.documents-dropzoneArea"),dropzoneClass:u.dropzone,dropzoneParagraphClass:u.dropzoneParagraph,showAlerts:!1,showPreviews:!0,showPreviewsInDropzone:!1,useChipsForPreview:!0,previewGridProps:{container:{spacing:1,direction:"row"}},previewChipProps:{classes:{root:u.previewChip}},previewText:R("certificateBadgeTemplate:badges-certificate-form.documents-selected-files"),onChange:L})}),Object(n.jsx)(Jc,{value:I,index:1,dir:b.direction,children:Object(n.jsx)(ie.a,{"aria-label":"contacts",children:l.length>0?l.map((function(e){return Object(n.jsxs)(y.a,{children:[Object(n.jsx)(re.a,{children:Object(n.jsx)(Qc.a,{fontSize:"small"})}),Object(n.jsx)(w.a,{children:e.titulo_campo}),Object(n.jsx)(re.a,{children:Object(n.jsx)(K.a,{title:"Descargar",children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(){return function(e){var t=document.createElement("a");t.download=e,t.href=e,t.click()}(e.signatureFile)},children:Object(n.jsx)(Vc.a,{})})})}),Object(n.jsx)(re.a,{children:Object(n.jsx)(K.a,{title:"Eliminar",children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(){return t=e.id,r(!1),void F.a.fire({text:"\xbfEst\xe1 seguro que desea eliminar este archivo?",icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:R("buttons:buttons.accept"),cancelButtonText:R("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.value?W(t).catch((function(e){B(!1),r(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:R("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500})})):r(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var t},children:Object(n.jsx)(wt.a,{})})})})]})})):Object(n.jsx)(y.a,{children:Object(n.jsx)(w.a,{children:"No hay firmas cargadas"})})})})]})})]})}),Object(n.jsx)(Ae.a,{children:g.length>0&&Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",onClick:U,color:"primary",children:R("buttons:buttons.save")})}),Object(n.jsx)(_t,{loading:N})]})};var to=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:"50px",padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},buttonForm:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:"50px",padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}},img_vertical:{maxWidth:"30vw",height:"auto"},img_horizontal:{maxWidth:"70vw",height:"auto"},iconButton:{margin:"0em -.4em"}}})),ao={changeBreadcrump:I.a,changePage:I.b,setReturnRoute:I.C},no=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"certificados"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),ao)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.permission,b=e.changePage,j=e.setReturnRoute,y=e.searchValue,w=Object(u.g)(),C=to(),k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)([]),z=Object(d.a)(A,2),P=z[0],R=z[1],M=Object(i.useState)(P),L=Object(d.a)(M,2),U=L[0],W=L[1],Y=Object(i.useState)(""),q=Object(d.a)(Y,2),H=q[0],V=q[1],G=Object(i.useState)(""),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(i.useState)(!1),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ne=Object(i.useState)(!1),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)(""),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)({}),me=Object(d.a)(ue,2),be=me[0],pe=me[1],je=Object(i.useState)({}),fe=Object(d.a)(je,2),he=fe[0],ge=fe[1],xe=Object(i.useState)({}),Oe=Object(d.a)(xe,2),ve=Oe[0],_e=Oe[1],ye=Object(i.useState)({}),we=Object(d.a)(ye,2),ke=we[0],Be=we[1],Se=Object(i.useState)(),Te=Object(d.a)(Se,2),Ee=Te[0],De=Te[1],ze=Object(i.useState)(null),Pe=Object(d.a)(ze,2),Re=Pe[0],Me=Pe[1],Le=Object(i.useState)(!1),Fe=Object(d.a)(Le,2),Ue=Fe[0],We=Fe[1],Ye=Object(i.useState)([]),qe=Object(d.a)(Ye,2),He=qe[0],Ke=qe[1],Ve=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),Qe=Object(d.a)(Ve,1)[0];Object(i.useEffect)((function(){return Je().catch((function(){w.push("/500"),window.location.reload()})),c(Qe("breadCrumps:breadCrumps.certificates-edition",{returnObjects:!0})),function(){b(0)}}),[]);var Je=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T(!0),y&&""!==y){e.next=4;break}return e.next=4,tt();case 4:return e.next=6,nt();case 6:return e.next=8,it();case 8:return e.next=10,rt();case 10:T(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Xe=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Ze=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,$e=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),et=function(e,t){var a={limit:t||10,offset:e?e*t:0};return Xe||(a.id_organizaciones=s),(Ze||$e)&&(a.id_usuarios=o.data_user.id),a},tt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=et(0,r),e.next=4,Ce.a.post("/certificateTemplate/getCertificateTemplatesEdited",i);case 4:c=e.sent,o=c.data,R(null===(t=o.certificateTemplates)||void 0===t?void 0:t.rows),W(null===(a=o.certificateTemplates)||void 0===a?void 0:a.rows),De(null===o||void 0===o||null===(n=o.certificateTemplates)||void 0===n?void 0:n.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),w.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),at=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),i=et(t,a),e.next=4,Ce.a.post("/certificateTemplate/getCertificateTemplatesEdited",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(P),Object(p.a)(null===(n=c.certificateTemplates)||void 0===n?void 0:n.rows.filter((function(e){return!P.find((function(t){return t.id===e.id}))})))),R(o),W(o),T(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),nt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,ge(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),it=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,Be(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),rt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,_e(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ct=function(e,t,a){switch(a){case"copy":ot(e,t);break;case"edit":j("/certificates/edited"),w.push("/certificates/edit/".concat(Object(Ie.b)(t)));break;case"publish":st(t);break;case"delete":lt(t)}},ot=function(e,t){F.a.fire({text:Qe("alerts:alerts.copy-button-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Qe("buttons:buttons.accept"),cancelButtonText:Qe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&dt(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},st=function(e){F.a.fire({text:Qe("alerts:alerts.publish-button-certificate"),icon:"warning",showCancelButton:!0,iconColor:E.a.primary,confirmButtonText:Qe("buttons:buttons.accept"),cancelButtonText:Qe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ut(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},lt=function(e){F.a.fire({text:Qe("alerts:alerts.delete-button-certificate"),icon:"warning",showCancelButton:!0,iconColor:E.a.primary,confirmButtonText:Qe("buttons:buttons.accept"),cancelButtonText:Qe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&mt(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},dt=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,l,d,u,b,p,j;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.preventDefault(),T(!0),b=null===P||void 0===P?void 0:P.filter((function(e){return e.id===t})),p=Object(m.a)(Object(m.a)({},b[0]),{},{copy:!0,nombre:"".concat(null===(n=b[0])||void 0===n?void 0:n.nombre," copia"),nombre_privado:"".concat(null===(i=b[0])||void 0===i?void 0:i.nombre_privado," copia"),id_plantillas_recomendadas:null===(r=b[0])||void 0===r?void 0:r.recomendaciones.map((function(e){return{id_plantillas_certificados_recomendadas:e.id_plantillas_certificados_recomendadas}})),id_habilidades:null===(c=b[0])||void 0===c?void 0:c.plantillasHabilidades.map((function(e){return{id_habilidades:e.id_habilidades}})),id_usuarios:null===(l=o.data_user)||void 0===l?void 0:l.id,id_organizaciones:s,camposAdicionales:null===(d=b[0])||void 0===d?void 0:d.certificadoCamposAdicionales.map((function(e){return{titulo_campo:e.titulo_campo,descripcion_campo:e.descripcion_campo,url:e.url}})),certificateFields:null===(u=b[0])||void 0===u?void 0:u.certificadoCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseInt(e.x),y:parseInt(e.y),width:e.width,height:e.height,page:e.page,align:e.formato_letra||"center"}}))}),e.prev=4,e.next=7,Ce.a.post("/certificateTemplate",p);case 7:j=e.sent,j.data&&(T(!1),Je(),F.a.fire({icon:"success",iconColor:E.a.primary,text:Qe("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(4),T(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:Qe("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500});case 16:case"end":return e.stop()}}),e,null,[[4,12]])})));return function(t,a){return e.apply(this,arguments)}}(),ut=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/certificateTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){w.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:Qe("alerts:alerts.published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){w.push("/certificates/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),mt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/certificateTemplate/".concat(t),{data:{id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id}}).catch((function(){w.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:Qe("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){Je()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),bt=function(e){if(l.includes("Editar"))return Object(n.jsx)(K.a,{title:Qe("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return ct(t,e,"edit")},className:C.iconButton,children:Object(n.jsx)(Wn,{})})})},pt=function(e){if(l.includes("Editar"))return Object(n.jsx)(K.a,{title:"Subir firma",children:Object(n.jsx)(S.a,{"aria-label":"upload",onClick:function(t){return jt(e)},className:C.iconButton,children:Object(n.jsx)(Uc.a,{})})})},jt=function(e){Me(e),We(!0);var t=P.find((function(t){return t.id===e}));Ke(t.certificadoCamposAdicionales.filter((function(e){return 0===e.estado})))},ft=function(e){if(l.includes("Publicar"))return Object(n.jsx)(K.a,{title:Qe("tables:table.tooltip.publish"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return ct(t,e,"publish")},className:C.iconButton,children:Object(n.jsx)(ci.a,{})})})},ht=function(e){if(l.includes("Eliminar"))return Object(n.jsx)(K.a,{title:Qe("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return ct(t,e,"delete")},className:C.iconButton,children:Object(n.jsx)(Cn.a,{})})})},gt=function(){return Qe(Xe?"tables:table.columns-certificate-edited-super":"tables:table.columns-certificate-edited",{returnObjects:!0})},xt=function(e){if(Xe)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})},Ot=function(e){if(l.includes("Copiar"))return Object(n.jsx)(K.a,{title:Qe("tables:table.tooltip.copy"),children:Object(n.jsx)(S.a,{"aria-label":"copy",onClick:function(t){return ct(t,e,"copy")},className:C.iconButton,children:Object(n.jsx)(Ar.a,{})})})},vt=function(){te(!1),de("")},_t=function(){ce(!1)};return Object(n.jsxs)(pc,{Index:1,children:[Object(n.jsx)(Fn,{tableName:"templateCertificate",type:"edited",items:P,setItems:W,setCountItems:De,changePage:b,loadData:Je,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:Ze,isDeparmentCreaterRoll:$e,userId:o.data_user.id},setLoading:T}),Object(n.jsx)(zn,{columns:gt(),rows:Ee,setDirection:V,setOrderBy:X,loading:B,changePagination:at,children:Object(n.jsx)(vn.a,{children:U.length>0?B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:gt(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(U,Object(I.f)(H,J)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:Qe("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:C.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,de({photo:t,width:a,height:n}),void te(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),xt(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:0===e.estado?Qe("tables:table.state.edited"):""}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:Qe("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return w.push("/certificates/details/".concat(Object(Ie.b)(e.id)))},className:C.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:bt(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:pt(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:ft(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:Ot(e.id)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:Qe("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t=null===P||void 0===P?void 0:P.find((function(t){return t.id===e})),a=he.find((function(e){return e.id===t.nivel_vp})),n=ve.find((function(e){return e.id===t.tiempo_vp})),i=ke.find((function(e){return e.id===t.costo_vp}));pe(Object(m.a)(Object(m.a)({},t),{},{camposAdicionales:null===t||void 0===t?void 0:t.certificadoCamposAdicionales,niveles:null===a||void 0===a?void 0:a.valor_parametro,tiempos:null===n||void 0===n?void 0:n.valor_parametro,costos:null===i||void 0===i?void 0:i.valor_parametro})),ce(!0)}(e.id)},className:C.iconButton,children:Object(n.jsx)(Ir.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:ht(e.id)})]},e.id)}))}):B?Object(n.jsx)(qn,{columns:gt(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:Qe("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:ee,onClose:vt,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.btnClose),onClick:vt,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:le.photo,className:le.width>le.height?C.img_horizontal:C.img_vertical})})]}),Object(n.jsxs)(O.a,{open:re,onClose:_t,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:_t,children:Qe("dialogs:dialog.preview-title-template-certificate")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:be})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),onClick:_t,children:Qe("buttons:buttons.close")})})]}),Object(n.jsx)(eo,{open:Ue,setOpen:We,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?1:s,idCertificateTemplate:Re,loadData:Je,fieldAdditionals:He})]})}));var io=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:"50px",padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},buttonForm:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:"50px",padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}},img_vertical:{maxWidth:"30vw",height:"auto"},img_horizontal:{maxWidth:"70vw",height:"auto"},iconButton:{margin:"0em -.4em"}}})),ro={changeBreadcrump:I.a,changePage:I.b},co=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"certificados"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),ro)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.changePage,b=e.permission,j=e.searchValue,y=Object(u.g)(),w=io(),C=Object(i.useState)(!1),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)([]),A=Object(d.a)(T,2),z=A[0],P=A[1],R=Object(i.useState)(z),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)(""),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],V=Object(i.useState)(""),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)(!1),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)(!1),ne=Object(d.a)(te,2),ie=ne[0],re=ne[1],ce=Object(i.useState)(""),oe=Object(d.a)(ce,2),se=oe[0],le=oe[1],de=Object(i.useState)({}),ue=Object(d.a)(de,2),me=ue[0],be=ue[1],pe=Object(i.useState)({}),je=Object(d.a)(pe,2),fe=je[0],he=je[1],ge=Object(i.useState)({}),xe=Object(d.a)(ge,2),Oe=xe[0],ve=xe[1],_e=Object(i.useState)({}),ye=Object(d.a)(_e,2),we=ye[0],ke=ye[1],Be=Object(i.useState)(),Se=Object(d.a)(Be,2),Te=Se[0],Ee=Se[1],De=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),ze=Object(d.a)(De,1)[0];Object(i.useEffect)((function(){return Pe().catch((function(){y.push("/500"),window.location.reload()})),c(ze("breadCrumps:breadCrumps.certificates-archived",{returnObjects:!0})),function(){l(0)}}),[]);var Pe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(B(!0),j&&""!==j){e.next=4;break}return e.next=4,Ue();case 4:return e.next=6,Ye();case 6:return e.next=8,qe();case 8:return e.next=10,He();case 10:B(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Re=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Me=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Le=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),Fe=function(e,t){var a={limit:t||10,offset:e?e*t:0};return Re||(a.id_organizaciones=s),(Me||Le)&&(a.id_usuarios=o.data_user.id),a},Ue=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=Fe(0,r),e.next=4,Ce.a.post("/certificateTemplate/getCertificateTemplatesArchived",i);case 4:c=e.sent,o=c.data,P(null===(t=o.certificateTemplates)||void 0===t?void 0:t.rows),U(null===(a=o.certificateTemplates)||void 0===a?void 0:a.rows),Ee(null===o||void 0===o||null===(n=o.certificateTemplates)||void 0===n?void 0:n.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),y.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),We=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),i=Fe(t,a),e.next=4,Ce.a.post("/certificateTemplate/getCertificateTemplatesArchived",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(z),Object(p.a)(null===(n=c.certificateTemplates)||void 0===n?void 0:n.rows.filter((function(e){return!z.find((function(t){return t.id===e.id}))})))),P(o),U(o),B(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Ye=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,he(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,ke(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),He=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,ve(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ke=function(e){if(b.includes("Publicar"))return Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.publish"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return function(e,t,a){switch(a){case"publish":Ve(t)}}(0,e,"publish")},className:w.iconButton,children:Object(n.jsx)(ci.a,{})})})},Ve=function(e){F.a.fire({text:ze("alerts:alerts.publish-button-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Qe(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Qe=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/certificateTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){y.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:ze("alerts:alerts.published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){y.push("/certificates/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Je=function(){return ze(Re?"tables:table.columns-certificate-published-archived-super":"tables:table.columns-certificate-published-archived",{returnObjects:!0})},Xe=function(e){if(Re)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})},Ze=function(){re(!1)},$e=function(){ee(!1),le("")};return Object(n.jsxs)(pc,{Index:2,children:[Object(n.jsx)(Fn,{tableName:"templateCertificate",type:"archived",items:z,setItems:U,setCountItems:Ee,changePage:l,loadData:Pe,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:Me,isDeparmentCreaterRoll:Le,userId:o.data_user.id},setLoading:B}),Object(n.jsx)(zn,{columns:Je(),rows:Te,setDirection:H,setOrderBy:J,loading:N,changePagination:We,children:Object(n.jsx)(vn.a,{children:L.length>0?N?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:Je(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(L,Object(I.f)(q,Q)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:w.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,le({photo:t,width:a,height:n}),void ee(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),Xe(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.certificadosEmitidos}),Object(n.jsx)(yn.a,{align:"center",children:2===e.estado?ze("tables:table.state.archived"):""}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return y.push("/certificates/details/".concat(Object(Ie.b)(e.id)))},className:w.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Ke(e.id)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t=null===z||void 0===z?void 0:z.find((function(t){return t.id===e})),a=fe.find((function(e){return e.id===t.nivel_vp})),n=Oe.find((function(e){return e.id===t.tiempo_vp})),i=we.find((function(e){return e.id===t.costo_vp}));be(Object(m.a)(Object(m.a)({},t),{},{camposAdicionales:null===t||void 0===t?void 0:t.certificadoCamposAdicionales,niveles:null===a||void 0===a?void 0:a.valor_parametro,tiempos:null===n||void 0===n?void 0:n.valor_parametro,costos:null===i||void 0===i?void 0:i.valor_parametro})),re(!0)}(e.id)},className:w.iconButton,children:Object(n.jsx)(Ir.a,{})})})})]},e.id)}))}):N?Object(n.jsx)(qn,{columns:Je(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:ze("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:$,onClose:$e,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(w.btnClose),onClick:$e,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:se.photo,className:se.width>se.height?w.img_horizontal:w.img_vertical})})]}),Object(n.jsxs)(O.a,{open:ie,onClose:Ze,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:Ze,children:ze("dialogs:dialog.preview-title-template-certificate")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:me})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(w.buttonForm),onClick:Ze,children:ze("buttons:buttons.close")})})]})]})})),oo=a(650);var so=function(){var e,t,a,n;return{dataQr:{fieldType:48,exampleText:"qr-certika-600x600.png",fieldName:"qr",align:"center",fontColor:{hex:"#000000"},fontSize:0,fontFamily:{family:"ABeeZee",files:'{italic: "http://fonts.gstatic.com/s/abeezee/v14/es\u2026}'},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:150,height:150,page:1},dataImg:{fieldType:48,exampleText:"Certika-435x149.png",fieldName:"logo",align:"center",fontColor:{hex:"#000000"},fontSize:0,fontFamily:{family:"ABeeZee",files:'{italic: "http://fonts.gstatic.com/s/abeezee/v14/es\u2026}'},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:200,y:50,width:"Minciencias"===(null===(e=JSON.parse(window.localStorage.state))||void 0===e||null===(t=e.styles)||void 0===t?void 0:t.organizationName)?270:200,height:"Minciencias"===(null===(a=JSON.parse(window.localStorage.state))||void 0===a||null===(n=a.styles)||void 0===n?void 0:n.organizationName)?50:68,page:1},dataCode:{fieldType:41,fontSize:"14",fieldName:"certificateCode",align:"center",exampleText:"C\xf3digo",fontColor:{hex:"#000000"},fontFamily:{family:"Source Code Pro",files:'{200: "http://fonts.gstatic.com/s/sourcecodepro/v14\u2026}'},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:150,y:230,width:180,height:18,page:1},dataButtonVerify:{fieldType:48,exampleText:"button-verify.png",fieldName:"buttonVerify",align:"center",fontColor:{hex:"#ffffff"},rectColor:{hex:E.a.primary},fontSize:11,fontFamily:{family:"ABeeZee",files:'{italic: "http://fonts.gstatic.com/s/abeezee/v14/es\u2026}'},x:60,y:220,width:80,height:33,page:1},dataSignature:{fieldType:48,exampleText:"",fieldName:"signature_1",align:"center",fontColor:{hex:"#000000"},fontSize:0,fontFamily:{family:"ABeeZee",files:'{italic: "http://fonts.gstatic.com/s/abeezee/v14/es\u2026}'},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:250,y:300,width:260,height:100},dataModules:{fieldType:48,exampleText:"modules",fieldName:"modules",align:"left",fontColor:{hex:"#000000"},rectColor:{hex:E.a.primary},fontSize:11,fontFamily:{family:"ABeeZee",files:'{italic: "http://fonts.gstatic.com/s/abeezee/v14/es\u2026}'},x:165,y:160,width:80,height:33,page:1}}},lo=function(e){var t=String(e.target.value);/^([1-9][0-9]*(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t)||(e.target.value=t.substr(t.length))},uo=a(1251),mo=a(1194),bo=a(1195),po=a(1196),jo=a(1197),fo=a(1198),ho=a(1199),go=a(1200),xo=a(1201),Oo=a(111),vo=a.n(Oo),_o=a(629);var yo=Object(C.a)((function(){return{color:{width:"36px",height:"14px",borderRadius:"2px",boxShadow:"0 0 0 1px rgba(0,0,0,.20)"},swatch:{padding:"5px",backgroundColor:"#fff",borderRadius:"1px",boxShadow:"0 0 0 1px rgba(0,0,0,.30)",display:"inline-block",cursor:"pointer"},popover:{},cover:{position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}}})),wo=function(e){var t=e.color,a=e.changeColor,r=yo({color:t}),c=Object(i.useState)(!1),o=Object(d.a)(c,2),s=o[0],l=o[1];return Object(n.jsxs)("div",{children:[Object(n.jsx)("div",{className:r.swatch,onClick:function(){l(!s)},children:Object(n.jsx)("div",{className:r.color,style:{backgroundColor:t}})}),s?Object(n.jsxs)("div",{className:r.popover,children:[Object(n.jsx)("div",{className:r.cover,onClick:function(){l(!1)}}),Object(n.jsx)(_o.a,{color:t,onChange:a})]}):null]})},Co=a(45),ko=a(116),No=a.n(ko),Bo=a.p+"static/media/Certika-435x149.ccfec5bd.png",So=a.p+"static/media/MinCiencias-435x149.83cca8ed.png",To=a.p+"static/media/qr-certika-600x600.96df543b.png",Ao="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAK1CAIAAABZwoEWAAAABmJLR0QA/wD/AP+gvaeTAAAOhUlEQVR4nO3aMW7kOhZA0eGgQvcGev9r8wqc86eDmwy6aPh9ts7JC3yiKPlC8Np7/wcA4H/8d3oAAOBfRx8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AADqNbv8Wmt2AN6z9z75+eF9v3r1Q1c/Mk++cbOuPjZPNntofT8AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBAvaYHgD+21jr5+d77uybhOZw6nub6Pvj8/Pz4+Jie4iZfX1+/f/+engK4iTftn/oL3rTX98HHx8evX7+mpwD4m3nTPpD/PwAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAA9ZoeYNJaa3qE9+29p0fgHU7d1OqHO3/16rOc+Uv5fgAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIB6TQ/AE+29B1dfa538/HD4q699dusOVz80uzr8PN8PAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUK/pAXiitdb0CO87HH7v/djVDz15ePh5vh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCgXtMDTNp7T4/wUIc7v9YaXP1qT9662eHtPNfx/QAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAA1Gt6gFNfX1/TI1zGjgF/ynvjT/0FO7b23pPLrzW4Om+7+tjMDn9o9pG5eutmzR5ab9pLzT5x138/4EZXvyufvPqhq69dG/E0/v8AACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAAtfbe0zPAn1lrnfz8yWf+yVv35GuHN/h+AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgHrNLr/WOvn53vu7JnnD4fA809XH5urhD18Xsy+rJ78qZ7du1uyN8/0AACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAA9ZoegBl77+kR3rfWeuzqhzfucHjHZsrszl+9dbOufmR8PwAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEC9Zpffew+uvtYaXP3w2g+HP/z57I2Dnzf7wM568vP+5Gv3/QAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAD1mh7gyFrr5Od77++a5DqH136484euHv5qs0/c1atf7eprn33PX/1HyvcDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAA1Gt2+bXW7ACPdbjze+/B1WcdXvuh2a2bvfarV3/yEzd743ib7wcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AACo1/QAk9ZaJz/fe3/XJD/vcPirt+7qa7/61B063PlDT975Q7M3jrf5fgAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIB6zS6/9z75+Vrruyb5+dUPr/3Q7PBXb92hq3f+0OyNu3rrZnniplaf5fsBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAA6jW7/Frr5Od77++a5OcdXvuhw62bHX529VlPPjZXP++Hrn7innzjrub7AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAOo1PcDF1lrTI7zvcPi993dN8vOuvnGzO3/1sbl6+Fmzj8zVN+7qY+P7AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAGrtvSeXX2tw9dlrfzL3nZ83e+oOXX1oD3f+8Nq9bd7m+wEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABq7b0nl19rcPVDs1t36HDnn3xsXPvbnnzqrn5dHLr60B66+tj4fgAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIB6TQ9wsbXW9Ajv23uf/Pzw2g9XPzS7+qzZ+/5ks4/M7Oqzw1997bN8PwAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAECtvffk8msNrj7ryTt/9bUb/lJPftsw5eonzvcDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAA1Gt2+b337ACPNbvza63B1Zly9X0/fGQOr/3qV+Xsfb9662b5fgAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIB6zS6/1podgPfsvadHuNXVZ352+NlT9+Qb53l/Jt8PAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUK/pAeCn7b2nR7jV4dattb5rkutWn3X1mZ8d/vDYXL3z1/fB5+fnx8fH9BQ3+fr6+v379/QUAPyrXd8HHx8fv379mp4CAP4q/v8AACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AANRreoBJa63pEd63954e4aEOj83hjZs9tFevbucvNXvfn8z3AwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AANRregD4Y3vv6RHet9Y6+fnhtVv90tUPXf3IMMX3AwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AANRregCeaO998vO11uDqs8PPXvuTHe781WavffaJO3T1A+v7AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAOo1PcCkvff0CDzO4albaw3+/NDsE/fk5332vh+6+tBevfO+HwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCAek0PcOrr62t6hMvYMQD+r7X3nlx+rcHVedvVx2Z2+ENXPzJX7/zVrj42sw4P7dUvq+u/H3Cjq5+ZQ66dN8ze96tP3ayrt87/HwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKDW3nt6BgDg38X3AwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD0AQBQ+gAAKH0AAJQ+AABKHwAApQ8AgNIHAEDpAwCg9AEAUPoAACh9AACUPgAASh8AAKUPAIDSBwBA6QMAoPQBAFD6AAAofQAAlD4AAEofAAClDwCA0gcAQOkDAKD+AYcyQq09QypNAAAAAElFTkSuQmCC",Eo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIEAAAA1CAYAAABm+4gzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAXeSURBVHgB7Z19T1tVHMd/91Jiq5S0S5gZy2jHfNbYZupfi/IgC2b/FHgBFnwDjDcg8ArmfAFC34AU/9Awx0ZjjDHzoSxjuplB0WwomNGICsmA6/n+2nO5belcwkNL7++T3HAfzr3ncM73/B5O4dag3Zi4HqBntuKGRe1ERpTICpNwVEmrLWMRJam7K7FbAaPkzOdTPYanbowsCpBQa0AMI8ViMAsOpqYvGXV1EyKAmiWsZv24+eX0sPOkbQmUAIYtskZIcAWGaXy0ff7dId7nM19c6TdMc4wEV2FtUS9d6EqyCIypqwvqR5gEt5G1/q07XcdWwDD6SXAjXvJs/2EqNxAjwc20m7l1AMGtKC8QMWUhyPWETRJcj4hAEBEIIgKBRAQCiQgEEhEIJCIQSEQgkIhAUHjIRQQ8Hor4G2hxfYMyGxsF19qCAeo5flyVqePj9NrfNLm8UlKuFqmYCNqCQRo+c5r3J1dW6PLibyVlxl59mUI+H+/3pW9SdnOT9sKn0dep/ViQMkoErV99bZ8fPtNqt0UTV1ug3kOj9xao1qmYCGbX1ija6OfZGVYDXSyCsNdL8ZPNvD+zurpnAZQD9WgBQByY/SDS2MDWwA1UTAQY1JmHq8oENykReHnDIGgwYzWJ+0u0H3wwd5siDX5KKVFpYqp+TV961jUD76SiMQFmf09+EDAYTmvwfvMJe985aLAccXUtqnw7mFnN8uzVlgI+Xz8T4hkMtbCfH5j7idqVCwpBcE97ua7BllMFIog3N1Ns8xG7gH5VRygvzMSDpYL6B0On2ILo+p3Xd2tjdnNL1ferHV/oZ4Dk8p+qXQEuOzq/UDARDgvDmLpqUYVAZ8y/c45/wip0fveDff5hZxvvY4B7VTwA0PHX3nqDrYYTdFznje+5kzF4n7z2in1elzWvTNO1N88WxATzb58reVZxWbiizhu5dkFg11X9aF9x/We/+ZaFWK6NuNahngM3iGuoG8wqyxPJi6VD/Q4pJarDpqIpIjomcf8B76PDdef2OGZnMu+jge5cdPrQz3d54473eTm4K4bLKmE4n+EE9zuvXVTHA7duUzkmohFuI+pHOW25UI+e2RCgbmPvjzd54NFG3HfpxedLngkBsGt0WLvDpuIpIswhTDaAaYZpReYAWCR5U4tzenaN3pu3zwfq6zmwiz2rhDNX+OyhO7+wGS4HspJo4477+EwdlzPHsaYmu/6BW3M8YxO0xC4D9yO9hBuBMNC2xY11Zd1ysxrWDO7BGedoUPZxwjsMKi6CVD7yx0xpPxbgTuEBJbIjdYBrGogFfhToFDKXZRSa4MnlZdovIBbNrCN47Mu7KrtOJSSsOcAtfdjamr/XT+XIrK9TpamKxSK4BFiDmJpNbcHfbbdQzow73UUleFy66lxzSCv/n4sBfCVxRDVRFS3TLoH95ksv8Dlnzg6yj3Y6HoHi7F9rJc/h6DtIB4Kzfmc6i0AwlLdAcBFaAE4zP8ZxwgmqVqris4OUYzFIp1WpokDJmYbpIBCDjvt2Cwr3G5h5zWBLLoaBaBGsImMYfq61wB1p0aBMyOujaqZqbBQCKufS7Xg+a9BgsBF4oQyEgtTSmQJiNuoU8yBAXby2oLIAbPGTuZmtzfzH6hrKwAVE/X4ug8hfr4pWM1XzKSLWCTTozN3yZWQFSOtsU+zTCzarvBp40AzduWunhRhYbBAngkMdv2Bftw/ZACyC04q1Bavvv/4ruli0F/SKHQbhoD5XeJL6y33K+H/Xq4kjKwJh/5A/KhFEBIKIQCARgUAiAoFEBAKJCAQSEQjEIjAyJLgXw0rjnUVpElyLtU2LpmVZKRLci2FMmPSUZ5wMOvw/cRWqgQzeeG5SR0fWsmiABNfBr70nnR10dyWVEC6T4Bosskb19x7spIjvdV20ttUFoebhCd99fkQfl37zSe619/hShDAJtYWK/azNrQG60J0sPF0OJQbKvfwa35Yh7z8+oli8DqSWAQyaoX/WEtTbW5IE/AcznYXOwdcwQgAAAABJRU5ErkJggg==",Io="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAAAuCAIAAABVtvs0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAPmSURBVGhD7ZrbTxNBFMb9n3z2D/AF44OJLyY+GGKMl5hoiBKCaKIYFERNlKAIGO/wYngAomK9hKjcS1NKKb1AkZbS7YWl99YPZjI5XVvXlQ0J7nz50sye3dnu/HrmTJvOvpKUQUlkhiWRGZZEZlhVkY25Ek09vkP19v21YxZxTb29qcc77kpwBFVUGdm1Xp/mdpYyhs9BVFIFZKfb5zW3sKABgeP4TVpkFs8v6mq5VoYM01jTzeKuWNfKkKHea/pY3FgNOBqiMmRYMjR9LG4A4WiIypBpOkjDHA2RRKZjjoZIItMxR0MkkemYoyGSyHTM0RBJZDrmaIjMRFZ7y3XhwQKNHKybOdVm+OcX7uNe3iwWS9lcsd8W1pzdZXM0RKYhO9ww61tNzQXUA2cnRbB78GdczTc/94tINbe8DGyk8sM/omgPfl9fT+QaurwXH3rejUdTmULv0Cq9eDfN0RCZmWUYanIzf6XbKyLTC0lPcJNC/IOPXnWwK785E56VlIgfu+4U7d03R0NkJrL6R4vxjRzAscO6Do+SzPXZwkcaZ0cdccwyzDV/KN3weBFnOwdWcHZkUkESBULpO33LOEQQvPjTlEoAxy5DxqHLjWf+4FoaNykUihPzSUTwC49FcJNgJMNA42J0+TilIMGRrefvuxH8Z/NHITITGXIEExPTE5MUh4CFRwc423QMjduvAihSTr+KOoULwCKdLWDAlzoXccjGieDJVtfUQnKLbJf33D23QIYquR7POnzqmbtuGId4DSnZSXfyeLMTd3YFVIEsoeajiVzbmyX2JDsxR0NkJjIYxQuPe/NFAPgwJZELJ1rmQtHM0HaRgnEqrGSRj2CB1Hg6zIuUQIY2nZgC2auRcGwjh44sDmsiohcuVlN58Y47NEdDZDIyfPLIBduUgpKP8WDASCJA5G+wLYwHoxIsWEddZF/sMeQUcpDF4fcTCo1QZOJWOzd/aCKTkcGfZ2IrkcyHCQXFBVOGZdlXewwjYQZEfPkwiqz/0xoKJc0yTWQPI2vvX0ZaIZWQayyCWoaVtONtEKQan2xRQ9AoMoAGIJRClC3kMgo/IkhkVsvQRlnER4X23kPGvqCp6YL4OiZWTLwF6hcmFIJGkaHd+nopEs+yFdPh3ai5bBcRLI4DoxGUfJSwvYfsPzNHQySR6ZijIZLIdMzREElkOuZoiCQyHXM0RBKZjjkaIolMxxwNkUSmY46GqAyZ/OtXY/2/fuUGA431NxjIbSwa629jgeRmKeG/2izFJLfkwQa25DFZPNeq5RdTZWQQpjGKn6XWUAwWC2DF+kVVFZlUNUlkhiWRGZZEZlCl0i8L0pASE7pDdgAAAABJRU5ErkJggg==",Do=function(e){var t=e.shapeProps,a=e.isSelected,r=e.onSelect,c=e.onChange,o=e.layoutWidth,s=e.layoutHeight,l=e.isDraggable,u=e.handleOnDragStart,b=e.modifyField,j=e.index,f=e.documentsFields,h=e.setDocumentsFields,g=No()(function(){var e,a,n,i,r,c;return"qr"===t.fieldName?"Minciencias"===(null===(e=JSON.parse(window.localStorage.state))||void 0===e||null===(a=e.styles)||void 0===a?void 0:a.organizationName)?Ao:To:"logo"===t.fieldName?"Minciencias"===(null===(n=JSON.parse(window.localStorage.state))||void 0===n||null===(i=n.styles)||void 0===i?void 0:i.organizationName)?So:Bo:"buttonVerify"===t.fieldName?"Minciencias"===(null===(r=JSON.parse(window.localStorage.state))||void 0===r||null===(c=r.styles)||void 0===c?void 0:c.organizationName)?Io:Eo:t.img?t.imgBlod?t.imgBlod:t.img:t.exampleText}(),"anonymous"),x=Object(d.a)(g,1)[0],O=Object(i.useRef)(),v=Object(i.useRef)();return Object(i.useEffect)((function(){a&&(v.current.setNode(O.current),v.current.getLayer().batchDraw())}),[a]),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Co.b,Object(m.a)(Object(m.a)({image:x,onClick:r,ref:O},t),{},{onDragStart:u,draggable:l,dragBoundFunc:function(e,a){var n=e.x,i=e.y;return n<0&&(n=0),i<0&&(i=0),n>o-t.width&&(n=o-t.width),i>s-t.height&&(i=s-t.height),{x:n,y:i}},onDragEnd:function(e){c(Object(m.a)(Object(m.a)({},t),{},{x:Math.round(e.target.x()),y:Math.round(e.target.y()),transform:!1}))},onTransformEnd:function(e){var a=O.current,n=a.scaleX(),i=a.scaleY();a.scaleX(1),a.scaleY(1),a.width(Math.max(5,a.width()*n)),a.height("qr"===t.fieldName?Math.max(a.width()*i):Math.max(a.height()*i)),c(Object(m.a)(Object(m.a)({},t),{},{x:Math.round(a.x()),y:Math.round(a.y()),fontSize:0,width:Math.round(a.width()),height:"qr"===t.fieldName?Math.round(a.width()):Math.round(a.height()),transform:!0}))},onDblClick:function(e){t.img&&!t.routeImg&&b(j)}})),a&&"qr"===t.fieldName&&Object(n.jsx)(Co.h,{ref:v,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){if(t.width<=50||t.height<=50)return e;return t.width>=200||t.height>=200?e:t}}),a&&"qr"!==t.fieldName&&Object(n.jsx)(Co.h,{ref:v,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){return t.width<=30||t.height<=30?e:t}}),a&&"logo"===t.fieldName&&Object(n.jsx)(Co.h,{ref:v,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){if(t.width<=30||t.height<=30)return e;return t.width>=500||t.height>=500?e:t}}),a&&"buttonVerify"===t.fieldName&&Object(n.jsx)(Co.h,{ref:v,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){if(t.width<=25||t.height<=25)return e;return t.width>=150||t.height>=150?e:t}}),a&&t.fieldName.includes("signature")&&Object(n.jsx)(Co.h,{ref:v,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){f.find((function(e){return"deleteSign"===e.fieldName}))&&h(Object(p.a)(f.filter((function(e){return"deleteSign"!==e.fieldName&&"addSign"!==e.fieldName}))));if(t.width<=50||t.height<=50)return e;return t.width>=500||t.height>=500?e:t}})]})},zo=function(e){var t,a,r=e.shapeProps,c=e.isSelected,o=e.onSelect,s=e.onChange,l=e.layoutWidth,d=e.layoutHeight,u=e.isDraggable,b=e.handleOnDragStart,p=e.modifyField,j=e.index,f=Object(i.useRef)(),h=Object(i.useRef)();return Object(i.useEffect)((function(){c&&(h.current.setNode(f.current),h.current.getLayer().batchDraw())}),[c]),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(Co.a,Object(m.a)(Object(m.a)({ref:f,onClick:o},r),{},{onDragStart:b,draggable:u,dragBoundFunc:function(e,t){var a=e.x,n=e.y;return a<0&&(a=0),n<0&&(n=0),a>l-r.width&&(a=l-r.width),n>d-r.height&&(n=d-r.height),{x:a,y:n}},onTransformEnd:function(e){var t=f.current,a=t.scaleX(),n=t.scaleY(),i=Math.max(t.height()*n)>Math.round(f.current.height()),c=i?Math.max(t.height()*n)-Math.round(f.current.height()):Math.round(f.current.height())-Math.max(t.height()*n);t.scaleX(1),t.scaleY(1),t.width(Math.max(5,t.width()*a)),t.height(Math.max(t.height()*n)),s(Object(m.a)(Object(m.a)({},r),{},{fontSize:i?Math.abs(Math.round(.32*(0===c?1:c)+r.fontSize)):Math.abs(Math.round(.32*(0===c?1:c)-r.fontSize)),x:Math.round(t.x()),y:Math.round(t.y()),width:Math.round(t.width()),height:Math.round(t.height())}))},onDragEnd:function(e){s(Object(m.a)(Object(m.a)({},r),{},{x:Math.round(e.target.x()),y:Math.round(e.target.y())}))},onDblClick:function(e){p(j)},children:[Object(n.jsx)(Co.e,{width:r.width,height:r.height,fill:null===(t=r.rectColor)||void 0===t?void 0:t.hex,cornerRadius:8}),Object(n.jsx)(Co.g,{width:r.width,height:r.height,fill:null===(a=r.fontColor)||void 0===a?void 0:a.hex,align:"center",fontSize:r.fontSize,padding:r.fontSize,fontFamily:r.fontFamily.family,text:"Verificar"})]})),c&&Object(n.jsx)(Co.h,{ref:h,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){if(t.width<60)return e;return t.width>=150?e:t}})]})},Po=function(e){var t,a,r,c=e.shapeProps,o=e.isSelected,s=e.onSelect,l=e.onChange,d=e.layoutWidth,u=e.layoutHeight,b=e.isDraggable,p=e.handleOnDragStart,j=e.modifyField,f=e.index,h=e.form,g=Object(i.useRef)(),x=Object(i.useRef)();return Object(i.useEffect)((function(){o&&(x.current.setNode(g.current),x.current.getLayer().batchDraw())}),[o]),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Co.a,Object(m.a)(Object(m.a)({ref:g,onClick:s},c),{},{onDragStart:p,draggable:b,dragBoundFunc:function(e,t){var a=e.x,n=e.y;return a<0&&(a=0),n<0&&(n=0),a>d-c.width&&(a=d-c.width),n>u-c.height&&(n=u-c.height),{x:a,y:n}},onTransformEnd:function(e){var t=g.current,a=t.scaleX(),n=t.scaleY();t.scaleX(1),t.scaleY(1),t.width(Math.max(5,t.width()*a)),t.height(Math.max(t.height()*n)),l(Object(m.a)(Object(m.a)({},c),{},{x:Math.round(t.x()),y:Math.round(t.y()),width:Math.round(t.width()),height:Math.round(t.height())}))},onDragEnd:function(e){l(Object(m.a)(Object(m.a)({},c),{},{x:Math.round(e.target.x()),y:Math.round(e.target.y())}))},onDblClick:function(e){j(f)},children:Object(n.jsx)(Co.g,{width:c.width,fill:null===(t=c.fontColor)||void 0===t?void 0:t.hex,align:c.align,fontSize:c.fontSize,padding:c.fontSize,fontFamily:c.fontFamily.family,text:c.modulos?(null===(a=c.modulos[0])||void 0===a?void 0:a.titulo_modulo)&&(null===(r=c.modulos)||void 0===r?void 0:r.map((function(e){return" - ".concat(e.titulo_modulo)})).toString().replaceAll(",","\n\n")):c.exampleText})})),o&&Object(n.jsx)(Co.h,{ref:x,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){if(t.width<300)return e;var a=h.width-200;return t.width>=a?e:t}})]})};var Ro=Object(C.a)((function(e){return{container:function(e){return{marginTop:32,backgroundImage:"url(".concat(e.imageRoute,")"),backgroundRepeat:"no-repeat",width:"fit-content",maxWidth:"68vw"}},pagination:{marginTop:"3px",position:"absolute"},button:{color:E.a.secondary},mySwal:{zIndex:3e3}}})),Mo={setCertificateFields:I.p},Lo=Object(s.b)((function(e){return{certificateFields:e.certificateFields||[],imageRoute:e.form.img_prev[e.form.page-1],width:e.form.width,height:e.form.height}}),Mo)((function(e){var t=e.imageRoute,a=e.width,r=e.height,c=e.modifyField,o=e.certificateFields,s=e.setCertificateFields,l=e.stageRef,u=e.selectedId,b=e.selectShape,p=e.isSelected,j=e.setIsSelected,f=e.form,h=e.setForm,g=Ro({imageRoute:t}),x=Object(i.useRef)(),O=Object(i.useRef)(),v=Object(i.useState)([]),_=Object(d.a)(v,2),y=_[0],w=_[1];Object(i.useEffect)((function(){p&&(null===y||void 0===y?void 0:y.index)?(x.current.setNode(y),x.current.getLayer().batchDraw()):p&&O&&(x.current.setNode(O.current),x.current.getLayer().batchDraw())}),[p]);var C=function(){var e=No()(t,"Anonymous"),a=Object(d.a)(e,1)[0];return Object(n.jsx)(Co.b,{image:a})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("div",{className:g.pagination,children:Object(n.jsx)(Lt.a,{component:"span",display:"flex",justifyContent:"center",children:Object(n.jsx)(ta.a,{color:"secondary",count:(null===f||void 0===f?void 0:f.pages)||0,page:(null===f||void 0===f?void 0:f.page)||1,onChange:function(e,t){var a,n=null===l||void 0===l||null===(a=l.current)||void 0===a?void 0:a.toDataURL(),i=(null===f||void 0===f?void 0:f.img_template)||[];i[(null===f||void 0===f?void 0:f.page)-1]=n,h(Object(m.a)(Object(m.a)({},f),{},{page:t,img_template:i}))},size:"small"})})}),Object(n.jsx)("div",{className:g.container,children:Object(n.jsx)(Co.f,{width:a,height:r,ref:l,onMouseDown:function(e){e.target.attrs.image&&(b(null),j(!1),w(null))},onMouseLeave:function(){b(null),j(!1),w(null)},children:Object(n.jsxs)(Co.c,{children:[Object(n.jsx)(C,{}),null===o||void 0===o?void 0:o.map((function(e,t){var i,l,d,h,g;return 48!==e.fieldType?(e.page===(null===f||void 0===f?void 0:f.page)||0===e.page)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Co.g,{ref:O,text:"certificateCode"===e.fieldName?"".concat(e.exampleText).concat(""===e.exampleText?"":":","CK09aABbAz"):e.exampleText,x:e.x,y:e.y,width:e.width,height:parseInt(e.fontSize),align:e.align,ellipsis:!0,onClick:function(t){j(!1),w(t.target),b(e.exampleText),j(!0)},draggable:!0,dragBoundFunc:function(t,n){var i=t.x,c=t.y;return i<0&&(i=0),c<0&&(c=0),i>a-e.width&&(i=a-e.width),c>r-e.height&&(c=r-e.height),{x:i,y:c}},fill:null===(i=e.fontColor)||void 0===i?void 0:i.hex,fontStyle:"".concat((null===(l=e.fontStyle)||void 0===l?void 0:l.bold)?"bold":""," ").concat((null===(d=e.fontStyle)||void 0===d?void 0:d.italic)?"italic":""),textDecoration:"".concat((null===(h=e.fontStyle)||void 0===h?void 0:h.underline)?"underline":""," ").concat((null===(g=e.fontStyle)||void 0===g?void 0:g.strikethrough)?"line-through":""),fontSize:parseInt(e.fontSize),fontFamily:e.fontFamily.family,onDragEnd:function(e){return function(e,t){o[t]=Object(m.a)(Object(m.a)({},o[t]),{},{x:e.target.x(),y:e.target.y()}),j(!1),w(e.target),j(!0),s(o)}(e,t)},onDblClick:function(e){w(e.target),c(t)},onTransformEnd:function(a){var n=y,i=n.scaleX();n.scaleX(1),n.scaleY(1),n.width(Math.max(5,n.width()*i)),function(e,t){var a=o.slice();a[t]=e,s(a)}(Object(m.a)(Object(m.a)({},e),{},{width:Math.round(n.width())}),t)}},"field".concat(t+1)),p&&Object(n.jsx)(Co.h,{ref:x,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){if(t.width<=150)return e;var n=a;return t.width>=n?e:t}})]}):"buttonVerify"===e.fieldName?(e.page===(null===f||void 0===f?void 0:f.page)||0===e.page)&&Object(n.jsx)(zo,{index:t,shapeProps:e,isSelected:e.exampleText===u,isDraggable:!0,onSelect:function(){b(e.exampleText)},onChange:function(e){var a=o.slice();a[t]=e,s(a)},layoutWidth:a,layoutHeight:r,modifyField:c},t):"modules"===e.fieldName?(e.page===(null===f||void 0===f?void 0:f.page)||0===e.page)&&Object(n.jsx)(Po,{index:t,shapeProps:e,isSelected:e.exampleText===u,isDraggable:!0,onSelect:function(){b(e.exampleText)},onChange:function(e){var a=o.slice();a[t]=e,s(a)},layoutWidth:a,layoutHeight:r,modifyField:c,form:f},t):(e.page===(null===f||void 0===f?void 0:f.page)||0===e.page)&&Object(n.jsx)(Do,{shapeProps:e,isSelected:e.exampleText===u,isDraggable:!0,onSelect:function(){b(e.exampleText)},onChange:function(e){var a=o.slice();a[t]=e,s(a)},layoutWidth:a,layoutHeight:r},t)}))]})})})]})})),Fo=a(1192),Uo=a(1193);var Wo=Object(C.a)((function(){return{container:{display:"flex",justifyContent:"space-between",alignItems:"center",marginLeft:10,marginRight:10,paddingTop:15,"& p":{margin:0}},buttons:{display:"flex"}}})),Yo=function(e){var t,a,i,c,o,s,l,u,m,b=e.index,p=e.exampleText,j=e.fieldName,f=e.modifyField,h=e.deleteField,g=e.type,x=e.addDefaultField,O=e.fieldImage,v=e.addField,_=e.addOrDelete,y=e.page,w=e.deleteForAllPages,C=e.multyField,k=e.multyPages,N=e.noEdit,B=void 0!==N&&N,T=Wo(),A=r.a.useState(null),E=Object(d.a)(A,2),I=E[0],z=E[1],P=Boolean(I),R=Object(D.a)("tables"),M=Object(d.a)(R,1)[0],L=null===(t=JSON.parse(window.localStorage.state))||void 0===t||null===(a=t.styles)||void 0===a?void 0:a.logo435x149,F="Minciencias"===(null===(i=JSON.parse(window.localStorage.state))||void 0===i||null===(c=i.styles)||void 0===c?void 0:c.organizationName)?Io:Eo,W="Minciencias"===(null===(o=JSON.parse(window.localStorage.state))||void 0===o||null===(s=o.styles)||void 0===s?void 0:s.organizationName)?Ao:To,q=function(e){"one"===e?h(b):w(b),z(null)};return 0===g?Object(n.jsxs)("div",{className:T.container,children:[Object(n.jsxs)(Lt.a,{display:"flex",flexDirection:"column",children:[Object(n.jsx)("p",{children:p}),Object(n.jsx)(we.a,{variant:"caption",children:"modules"!==j&&j}),Object(n.jsx)(we.a,{variant:"caption",children:y||0===y?0===y?"".concat(M("tables:pagination.all-pages")):"".concat(M("tables:pagination.one-page"),": ").concat(y):""})]}),Object(n.jsx)("div",{className:T.buttons,children:"add"===_?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(K.a,{title:M("tables:table.tooltip.add"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return v(b)},children:Object(n.jsx)(Fo.a,{})})}),"modules"!==j&&Object(n.jsx)(K.a,{title:M("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(){return h(b)},children:Object(n.jsx)(Ka.a,{})})})]}):"modules"!==j?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(K.a,{title:M("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return f(b)},children:Object(n.jsx)(Wn,{})})}),k&&Object(n.jsx)(K.a,{title:M("tables:table.tooltip.multy"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return C(b)},children:Object(n.jsx)(Uo.a,{color:0===y?"primary":"default"})})}),Object(n.jsx)(K.a,{title:M("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(){return h(b)},children:Object(n.jsx)(Ka.a,{})})})]}):Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(K.a,{title:M("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(){return h(b)},children:Object(n.jsx)(Ka.a,{})})})})})]}):Object(n.jsxs)("div",{className:T.container,children:[Object(n.jsx)(Lt.a,{display:"flex",flexDirection:"column",children:"certificateCode"===j?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("p",{children:p}),Object(n.jsx)(we.a,{variant:"caption",children:"C\xf3digo"}),(null===y||void 0===y?void 0:y.length)>0&&Object(n.jsxs)(we.a,{variant:"caption",children:["P\xe1gina",y.length>1||0===(null===(l=y[0])||void 0===l?void 0:l.page)?"s":"",":",y.sort((function(e,t){return e.page<t.page?-1:1})).map((function(e,t){return t+1===y.length?0===e.page?"Todas":e.page:"".concat(e.page,",")}))]})]}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("img",{src:O||("qr"===j?W:"logo"===j?L:F),alt:"exampleImage",width:"qr"===j?"50":"logo"===j?"80":"100"}),Object(n.jsx)(we.a,{variant:"caption",children:p}),(null===y||void 0===y?void 0:y.length)>0&&Object(n.jsxs)(we.a,{variant:"caption",children:["P\xe1gina",y.length>1||0===(null===(u=y[0])||void 0===u?void 0:u.page)?"s":"",":",y.sort((function(e,t){return e.page<t.page?-1:1})).map((function(e,t){return t+1===y.length?0===e.page?"Todas":e.page:"".concat(e.page,",")}))]})]})}),Object(n.jsxs)("div",{children:[("certificateCode"===j||"buttonVerify"===j)&&"delete"===_&&Object(n.jsx)(K.a,{title:M("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return f(b)},children:Object(n.jsx)(Wn,{})})}),"add"===_?Object(n.jsx)(K.a,{title:M("tables:table.tooltip.add"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return x(b)},children:Object(n.jsx)(Fo.a,{})})}):Object(n.jsxs)(n.Fragment,{children:[1===(null===y||void 0===y?void 0:y.length)&&k&&Object(n.jsx)(K.a,{title:M("tables:table.tooltip.multy"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return C(b)},children:Object(n.jsx)(Uo.a,{color:0===(null===(m=y[0])||void 0===m?void 0:m.page)?"primary":"default"})})}),O&&!B&&Object(n.jsx)(K.a,{title:M("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return f(b)},children:Object(n.jsx)(Wn,{})})}),(null===y||void 0===y?void 0:y.length)>1?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(K.a,{title:M("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete","aria-controls":"primary-search-account-menu","aria-haspopup":"true",onClick:function(e){z(e.currentTarget)},children:Object(n.jsx)(Ka.a,{})})})}):Object(n.jsx)(K.a,{title:M("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(){return h(b)},children:Object(n.jsx)(Ka.a,{})})})]})]}),Object(n.jsxs)(U.a,{anchorEl:I,anchorOrigin:{vertical:"top",horizontal:"right"},id:"primary-search-account-menu",keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:P,onClose:function(){z(null)},children:[Object(n.jsx)(Y.a,{onClick:function(){return q("one")},children:Object(n.jsx)("spam",{children:"Eliminar de esta p\xe1gina"})}),Object(n.jsx)(Y.a,{onClick:function(){return q("all")},children:Object(n.jsx)("spam",{children:"Eliminar todas"})})]})]})};var qo=Object(C.a)((function(){return{menuItem:{display:"grid",gridTemplateColumns:"15% 80% 5%",justifyContent:"center",alignItems:"center",borderRadius:10,margin:10,padding:10,cursor:"pointer",backgroundColor:E.a.primary,"& p":{marginBottom:0,color:"white",fontWeight:"bold"},"& span":{color:"white",fontWeight:"bold"}}}})),Ho=function(e){var t=qo(),a=e.title,i=e.logo,r=e.expand,c=void 0!==r&&r,o=e.onClick;return Object(n.jsxs)("div",{className:t.menuItem,onClick:o,children:[Object(n.jsx)("img",{src:i,alt:"Logo menu item"}),Object(n.jsx)("p",{children:a}),Object(n.jsx)("span",{children:c?"-":"+"})]})},Ko=a.p+"static/media/carbon_text-creation.1dc4dd4f.svg",Vo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAYAAAAe2bNZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAILSURBVHgBzViBccIwDFQ6QUbwCB0h3YANaCeATkA6AWxAO0G6QdggIyQbwAaqfZEbxSg4jg3H3/nMWbL8fgvFCcATIfM5IKKCNLhkWXaBUGgChW61bmdMCxOvMvGldTOByF53WzbUQRrk1CwOWqnPSW9DhO2g1C2HhDBHTnEt9lOOBXN6hTvCxMchBQrJoSJjCQ8AU6iWjJapuhFAkYIK4snkNiXmGQa7IdA4/4w6lpSe314JQDs2aIUJrzj+a9ZMxTaG0BIydsLB8W/c8buSYapIJNWto11C5sXjb+tM5xp0weocn2j4yHTUG4VGi+JQizp4BBna/Qn63ddWTuwLVUVuP5ASngRW7GxdNBjxyAjNGavOG/QK2CuA6b/MuHQtwL5ubbCvsmsIwS1lQmEWx+urR4tCPQpWJpBIobtv6HPsF3r1Ot0UsJzzBYlWBsdP4pKN5zgUyFGOYWgFnkmEJ/nBY/8nlJyMs1A10++YnAwdwdWOPYTsUe6TkXFyocWZT28ntzAVmWMoETZ3lYwMDhf3YCIsxns0Ge2zI18jddTFXSRDBnuO+QwiBiuII2IFQMlYk62cmLxmRLYQCbaxRjIWU/Lj+J2qhEjg+F69nnI6MKcdSSmW+YUkcop7llSR3rVNOd9MxOsgDor9Pun2wa6vMuhYKkz/FcKgnjqaOd9n3K8Hi+FV4ZnwB5It1RhT+5TuAAAAAElFTkSuQmCC";var Go=Object(C.a)((function(){return{container:{minHeight:"70vh"},container__header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:8,paddingBottom:8,"& h6":{marginLeft:10,fontWeight:"bold",color:"#888"}},container__header_button:{display:"flex",justifyContent:"center",alignItems:"center",width:40,height:40,border:"none",borderRadius:20,color:"white",backgroundColor:E.a.primary,marginRight:20,fontWeight:"bold",fontSize:"1.5em","&:hover":{backgroundColor:E.a.secondary}},container__fields:{}}})),Qo={setCertificateFields:I.p},Jo=Object(s.b)((function(e){return{certificateFields:e.certificateFields||[]}}),Qo)((function(e){var t=e.certificateFields,a=e.setCertificateFields,r=e.modifyField,c=e.openModal,o=e.form,s=Go(),l=Object(i.useState)(!0),u=Object(d.a)(l,2),b=u[0],j=u[1],f=Object(i.useState)(!0),h=Object(d.a)(f,2),g=h[0],x=h[1],O=Object(i.useState)(!0),v=Object(d.a)(O,2),_=v[0],y=v[1],w=[{fieldType:48,fieldName:"qr"},{fieldType:48,fieldName:"logo"},{fieldType:41,fieldName:"certificateCode"},{fieldType:48,fieldName:"buttonVerify"}],C=Object(D.a)(["certificateBadgeTemplate"]),k=Object(d.a)(C,1)[0],N=function(e){t.splice(e,1),a(Object(p.a)(t))},B=function(e,n){if(n)a(Object(p.a)(t.filter((function(t){return t.fieldName!==e}))));else{var i=t.findIndex((function(t){return t.fieldName===e&&(t.page===(null===o||void 0===o?void 0:o.page)||0===t.page)}));a(Object(p.a)(t.filter((function(e,t){return t!==i}))))}},S=function(e){var n=so(),i=n.dataQr,r=n.dataImg,c=n.dataCode,s=n.dataButtonVerify,l=n.dataModules;0===e?t.push(Object(m.a)(Object(m.a)({},i),{},{page:null===o||void 0===o?void 0:o.page})):1===e?t.push(Object(m.a)(Object(m.a)({},r),{},{page:null===o||void 0===o?void 0:o.page})):-1===e?(e=2,t.push(Object(m.a)(Object(m.a)({},c),{},{page:null===o||void 0===o?void 0:o.page}))):-2===e?t.push(Object(m.a)(Object(m.a)({},l),{},{page:null===o||void 0===o?void 0:o.page,width:o.width-300,modulos:o.modules})):-3===e&&t.push(Object(m.a)(Object(m.a)({},s),{},{page:null===o||void 0===o?void 0:o.page})),a(Object(p.a)(t))},T=function(e){var n=t.findIndex((function(t){return t.fieldName===e&&(t.page===(null===o||void 0===o?void 0:o.page)||0===t.page)}));0===t[n].page?t[n].page=null===o||void 0===o?void 0:o.page:t[n].page=0,a(Object(p.a)(t))},A=function(e){0===t[e].page?t[e].page=null===o||void 0===o?void 0:o.page:t[e].page=0,a(Object(p.a)(t))},E=function(e){var n=Object(m.a)({},t[e]);n.id&&delete n.id,t.push(Object(m.a)(Object(m.a)({},n),{},{page:null===o||void 0===o?void 0:o.page})),a(Object(p.a)(t))},I=function(e){return(null===t||void 0===t?void 0:t.find((function(t){return t.fieldName===e&&(t.page===(null===o||void 0===o?void 0:o.page)||0===t.page)})))?"delete":"add"},z=function(e){return t.filter((function(t){return t.fieldName===e}))};return Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)("div",{className:s.container,children:[Object(n.jsxs)("div",{className:s.container__header,children:[Object(n.jsx)("h6",{children:k("certificateBadgeTemplate:certificate-design.title-design")}),Object(n.jsx)("button",{className:s.container__header_button,onClick:c,children:"+"})]}),Object(n.jsxs)("div",{className:s.container__fields,children:[Object(n.jsx)(Ho,{title:k("certificateBadgeTemplate:certificate-design.texts"),logo:Ko,expand:b,onClick:function(){return j(!b)}}),b&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Yo,{index:-1,exampleText:function(){var e,a=null===(e=t.find((function(e){return"certificateCode"===e.fieldName})))||void 0===e?void 0:e.exampleText;return void 0===a?"C\xf3digo:CK09aABbAz":"".concat(a).concat(""===a?"":":","CK09aABbAz")}(),fieldName:w[2].fieldName,addOrDelete:I(w[2].fieldName),addDefaultField:S,modifyField:r,deleteField:function(){return B(w[2].fieldName)},deleteForAllPages:function(){return B(w[2].fieldName,"all")},page:z(w[2].fieldName),multyField:function(){return T(w[2].fieldName)},multyPages:(null===o||void 0===o?void 0:o.pages)>1},"field".concat(2)),null===t||void 0===t?void 0:t.map((function(e,t){if(48!==e.fieldType&&"certificateCode"!==e.fieldName)return Object(n.jsx)(Yo,{index:t,exampleText:e.exampleText,fieldName:e.fieldName,addField:E,modifyField:r,deleteField:N,type:0,addOrDelete:e.page===(null===o||void 0===o?void 0:o.page)||0===e.page?"delete":"add",page:null===e||void 0===e?void 0:e.page,multyField:A,multyPages:(null===o||void 0===o?void 0:o.pages)>1},"field".concat(t))}))]}),Object(n.jsx)(Ho,{title:k("certificateBadgeTemplate:certificate-design.images"),logo:Vo,expand:g,onClick:function(){return x(!g)}}),g&&(null===w||void 0===w?void 0:w.map((function(e,t){if(48===e.fieldType&&3!==t)return Object(n.jsx)(Yo,{index:t,exampleText:"",fieldName:e.fieldName,addOrDelete:I(e.fieldName),addDefaultField:S,deleteField:function(){return B(e.fieldName)},deleteForAllPages:function(){return B(e.fieldName,"all")},page:z(e.fieldName),multyField:function(){return T(e.fieldName)},multyPages:(null===o||void 0===o?void 0:o.pages)>1},"field".concat(t))}))),g&&(null===t||void 0===t?void 0:t.map((function(e,t){if(e.img)return Object(n.jsx)(Yo,{index:t,fieldImage:e.img,multyField:function(){return T(e.fieldName)},multyPages:(null===o||void 0===o?void 0:o.pages)>1,modifyField:r,deleteField:N,noEdit:!0},"field".concat(t))}))),Object(n.jsx)(Ho,{title:k("certificateBadgeTemplate:certificate-design.buttons"),logo:Ko,expand:_,onClick:function(){return y(!_)}}),_&&Object(n.jsx)(Yo,{index:-3,exampleText:k("certificateBadgeTemplate:certificate-design.button-verify"),fieldName:w[3].fieldName,modifyField:r,addOrDelete:I(w[3].fieldName),addDefaultField:S,deleteField:function(){return B(w[3].fieldName)},deleteForAllPages:function(){return B(w[3].fieldName,"all")},page:z(w[3].fieldName),multyField:function(){return T(w[3].fieldName)},multyPages:(null===o||void 0===o?void 0:o.pages)>1},"field".concat(3))]})]})})}));var Xo=function(e){return Object(n.jsx)(oo.a,{id:e.id,componentname:e.name,multiple:e.multiple,getOptionLabel:e.getOptionLabel,getOptionSelected:e.getOptionSelected,filterSelectedOptions:!0,value:e.value,onChange:e.onChange,options:e.options,renderInput:function(t){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},t),{},{variant:"outlined",placeholder:e.placeholder}))}})};function Zo(e){var t=e.children,a=e.onClick,i=e.type,r=void 0===i?"button":i,c=e.isInline,o=$o({isInline:void 0===c||c});return Object(n.jsx)("button",{className:o.button,onClick:a,type:r,children:t})}var $o=Object(C.a)((function(e){return{button:Object(b.a)({display:"inline-flex",width:"100%",minWidth:"max-content",justifyContent:"center",alignItems:"center",backgroundColor:E.a.primary,color:"white",border:"none",borderRadius:"50px",padding:"10px 50px","&:hover":{backgroundColor:E.a.secondary}},e.breakpoints.up("md"),{maxWidth:function(e){return e.isInline?"max-content":""}})}}));Zo.defaultProps={onClick:function(){}};var es=Zo,ts=function(e){return/[ a-zA-Z\xe1-\xfa\xc1-\xda]+/g.test(e.nativeEvent.data)},as=function(e){if(e.match("^#([A-Fa-f0-9]{6})$")){var t=e.replace("#","");return{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16)}}};var ns=Object(C.a)((function(e){return{container:Object(b.a)({display:"grid",gridTemplateColumns:"70% 30%",backgroundColor:"#E5E5E5"},e.breakpoints.up("xl"),{height:"100vh"}),container__certificate:{display:"flex",justifyContent:"center",overflow:"auto"},container__fields:{backgroundColor:"white"},container__button_fields:{display:"flex",justifyContent:"space-evenly",marginTop:20},content_modal:{display:"grid",gridTemplateColumns:"30% 70%",gridTemplateRows:""},dialog__title:{backgroundColor:e.palette.primary.main},sweetModal:{zIndex:1300},fieldButtonDisabled:{display:"none"},contentInput:Object(b.a)({marginTop:"1em",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},e.breakpoints.up("lg"),{display:"block",alignItems:"left"}),avatar:{width:"auto",height:"auto"},avatarSquare:{width:"50%",height:"50%",objectFit:"cover"}}})),is={setCertificateFields:I.p,setForm:I.w,setSaveDesign:I.D},rs=Object(s.b)((function(e){return{certificateFields:e.certificateFields||[],form:e.form,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),is)((function(e){var t,a,r,c,o,s,l,u,j,x,y,w,C,k,N,B,S,A=e.certificateFields,I=e.setCertificateFields,z=e.form,P=e.setForm,R=e.setSaveDesign,M=e.setOpenDesignCertificate,L=e.organizationId,U=ns(),W=Object(i.useRef)(),q=Object(i.useRef)(),H=Object(i.useState)(!0),K=Object(d.a)(H,2),V=K[0],G=K[1],Q=Object(i.useState)(!0),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(!1),ee=Object(d.a)($,2),te=ee[0],ae=ee[1],ne=Object(i.useState)(null),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)({fieldType:41,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0}),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=A.findIndex((function(e){return"certificateCode"===e.fieldName})),me=A.findIndex((function(e){return"buttonVerify"===e.fieldName})),be="certificateCode"===le.fieldName,pe="buttonVerify"===le.fieldName,fe=Object(i.useState)([].concat(Object(p.a)(A.map((function(e){var t;return null===(t=e.fontFamily)||void 0===t?void 0:t.family}))),["ABeeZee"])||["ABeeZee"]),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Object(i.useState)([]),ve=Object(d.a)(Oe,2),_e=ve[0],ye=ve[1],ke=Object(i.useState)([]),Ne=Object(d.a)(ke,2),Be=Ne[0],Se=Ne[1],Te=Object(i.useState)(!1),Ee=Object(d.a)(Te,2),Ie=Ee[0],De=Ee[1],ze=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","tables"]),Re=Object(d.a)(ze,1)[0],Me="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2));Object(i.useEffect)((function(){R(!1),Z(!0),Ce.a.get("/others/getFieldTypes").then((function(e){var t=e.data;Se(t.fieldTypes.filter((function(e){return 51!==e.id&&52!==e.id})).map((function(e){return{id:e.id,value:Me?e.valor_parametro_en:e.valor_parametro}})))})),ge.length>0?vo.a.load({google:{families:ge},active:function(){Z(!1)}}):Z(!1),ct.a.get("https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyAiqPGRASVurt5YfOdCCDOljv0nqATgCSc&fields=items.family,items.files&sort=alpha").then((function(e){var t=e.data;ye(t.items)}))}),[]);var Le,Fe=function(){ae(!1),de({fieldType:41,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0})},Ue=function(e){de(Object(m.a)(Object(m.a)({},le),{},{fontStyle:e}))},We=function(e){de(Object(m.a)(Object(m.a)({},le),{},{fontColor:e}))},Ye=function(e){"fontSize"===e.target.name&&e.target.value>100||de(Object(m.a)(Object(m.a)({},le),{},Object(b.a)({},e.target.name,e.target.value)))},qe=function(){var e,t;return!be&&!pe&&(48===le.fieldType?!W.current:!(null===(e=le.fieldName)||void 0===e?void 0:e.length)>0||!(null===(t=le.exampleText)||void 0===t?void 0:t.length)>0||!le.fontSize>0||!le.fontFamily||!le.fieldType)},He=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o=arguments;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(o.length>0&&void 0!==o[0])||o[0],!qe()){e.next=3;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Re("alerts:alerts.certificate-all-fields"),showConfirmButton:!1,timer:1500,customClass:{container:U.sweetModal}}));case 3:if(!(a=!(le.index>=0))||48!==le.fieldType||!t){e.next=13;break}return n=new FormData,Z(!0),n.append("file",V),n.append("route",le.routeImg),e.next=11,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:n});case 11:return setTimeout(Object(h.a)(f.a.mark((function e(){var t,a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/file/getFile",{keyFile:le.routeImg,headers:{"Content-Type":"multipart/form-data"}});case 2:return t=e.sent,a=t.data,e.next=6,fetch(null===a||void 0===a?void 0:a.url);case 6:return n=e.sent,e.next=9,n.blob();case 9:return i=e.sent,r=URL.createObjectURL(i),le.img=null===a||void 0===a?void 0:a.url,le.imgBlod=r,e.next=15,He(!1);case 15:case"end":return e.stop()}}),e)}))),3e3),e.abrupt("return");case 13:be&&(le.exampleText=le.exampleText.trim()),a?(48===le.fieldType?A.push(Object(m.a)(Object(m.a)({},le),{},{page:null===z||void 0===z?void 0:z.page,width:(null===(i=W.current)||void 0===i?void 0:i.naturalWidth)/100*20,height:(null===(r=W.current)||void 0===r?void 0:r.naturalHeight)/100*20})):A.push(Object(m.a)(Object(m.a)({},le),{},{page:null===z||void 0===z?void 0:z.page,width:430,height:le.fontSize})),ce(le.exampleText),De(!0)):(c=le.index,delete le.index,A[c]=le),I(Object(p.a)(A)),de({fieldType:41,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0}),Z(!1),ae(!1);case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ke=function(e){de(-1===e?Object(m.a)(Object(m.a)({},A[ue]),{},{index:ue}):-3===e?Object(m.a)(Object(m.a)({},A[me]),{},{index:me}):Object(m.a)(Object(m.a)({},A[e]),{},{index:e})),ae(!0)},Ve=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]'),Array.prototype.forEach.call(a,(function(e){return e.remove()})),!(A.filter((function(e){return 41===e.fieldType&&"certificateCode"!==e.fieldName||42===e.fieldType||e.img})).length<=0)){e.next=5;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Re("alerts:alerts.certificate-field"),showConfirmButton:!1,timer:1500,customClass:{container:U.sweetModal}}));case 5:return e.next=7,null===q||void 0===q||null===(t=q.current)||void 0===t?void 0:t.toDataURL();case 7:if(n=e.sent,(i=(null===z||void 0===z?void 0:z.img_template)||[]).length===(null===z||void 0===z?void 0:z.pages)?i[(null===z||void 0===z?void 0:z.page)-1]=n:i.push(n),!((null===z||void 0===z?void 0:z.pages)>1)){e.next=19;break}r=0;case 12:if(!(r<(null===z||void 0===z?void 0:z.pages))){e.next=19;break}if(i[r]){e.next=16;break}return i=null,e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Re("alerts:alerts.certificate-no-design-page"),showConfirmButton:!1,timer:2e3,customClass:{container:U.sweetModal}}));case 16:r++,e.next=12;break;case 19:void 0!==ue&&-1!==ue&&(A[ue].exampleText="".concat(A[ue].exampleText).concat(""===A[ue].exampleText?"":":","CK09aABbAz")),P(Object(m.a)(Object(m.a)({},z),{},{img_template:i})),R(!0),M(!1);case 23:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ge=function(){return!(!le.img||!A.find((function(e){return e.img===le.img})))||be};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsxs)("div",{className:U.container,children:[Object(n.jsx)("div",{className:U.container__certificate,children:Object(n.jsx)(Lo,{isSelected:Ie,setIsSelected:De,selectedId:re,selectShape:ce,stageRef:q,modifyField:Ke,form:z,setForm:P})}),Object(n.jsxs)("div",{className:U.container__fields,children:[Object(n.jsx)(Jo,{openModal:function(e){ae(!0)},modifyField:Ke,selectShape:ce,form:z}),Object(n.jsxs)("div",{className:U.container__button_fields,children:[Object(n.jsx)(es,{onClick:Ve,children:Re("buttons:buttons.accept")}),Object(n.jsx)(es,{onClick:function(){var e,t=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]');Array.prototype.forEach.call(t,(function(e){return e.remove()})),void 0!==ue&&-1!==ue&&(A[ue].exampleText="".concat(A[ue].exampleText).concat(""===A[ue].exampleText?"":":","CK09aABbAz"));var a=null===q||void 0===q||null===(e=q.current)||void 0===e?void 0:e.toDataURL(),n=(null===z||void 0===z?void 0:z.img_template)||[];n.length===(null===z||void 0===z?void 0:z.pages)?(n[(null===z||void 0===z?void 0:z.page)-1]=a,P(Object(m.a)(Object(m.a)({},z),{},{img_template:n}))):(delete z.img_template,P(Object(m.a)({},z))),M(!1)},children:Re("buttons:buttons.cancel")})]})]})]}),Object(n.jsxs)(O.a,{open:te,onClose:Fe,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(_t,{loading:X}),Object(n.jsx)(v.a,{align:"center",className:!pe&&function(e){var t=as(e);return t.r>230&&t.g>230&&t.b>230?U.dialog__title:""}(null===(r=le.fontColor)||void 0===r?void 0:r.hex),style:pe?{backgroundColor:null===le||void 0===le||null===(c=le.rectColor)||void 0===c?void 0:c.hex}:{},children:48!==le.fieldType||pe?Object(n.jsx)(we.a,{style:{fontSize:"".concat(le.fontSize||18,"px"),color:null===(o=le.fontColor)||void 0===o?void 0:o.hex,fontFamily:null===(s=le.fontFamily)||void 0===s?void 0:s.family,fontWeight:(null===(l=le.fontStyle)||void 0===l?void 0:l.bold)?"bold":"",fontStyle:(null===(u=le.fontStyle)||void 0===u?void 0:u.italic)?"italic":"",textDecoration:"".concat((null===(j=le.fontStyle)||void 0===j?void 0:j.underline)?"underline":""," ").concat((null===(x=le.fontStyle)||void 0===x?void 0:x.strikethrough)?"line-through":""),textAlign:le.align},children:be?"".concat(le.exampleText).concat(""===le.exampleText?"":":","CK09aABbAz"):pe?"Verificar":le.exampleText||Re("certificateBadgeTemplate:certificate-design.example")}):Object(n.jsx)(g.a,{alt:"img-prev",src:null===le||void 0===le?void 0:le.img,variant:"rounded",className:(Le=null===le||void 0===le?void 0:le.img,void 0===Le?U.avatar:U.avatarSquare),imgProps:{ref:W},children:Object(n.jsx)(mo.a,{sx:{margin:4,fontSize:"2em"}})})}),Object(n.jsx)(_.a,{dividers:!0,className:pe&&U.fieldButtonDisabled,children:Object(n.jsxs)("div",{className:U.content_modal,children:[48!==le.fieldType&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.name-field"),"*"]}),Object(n.jsx)("input",{type:"text",name:"fieldName",value:le.fieldName||"",onChange:Ye,disabled:Ge(),style:{borderRadius:"16px",border:"1px solid #C4C4C4",paddingLeft:"1em"}})]}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.type-field"),"*"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(T.a,{name:"fieldType",value:le.fieldType,onChange:Ye,disabled:Ge(),children:Be.map((function(e,t){return Object(n.jsx)(Y.a,{value:e.id,children:Object(n.jsx)("em",{children:"imagen"==="".concat(e.value).toLowerCase()?"Firma":e.value})},"field-type-option".concat(t))}))})}),48!==le.fieldType&&Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.example"),"*"]}),42===le.fieldType&&Object(n.jsx)("input",{type:"number",name:"exampleText",value:le.exampleText||"",onChange:Ye,onKeyUp:lo,style:{borderRadius:"16px",border:"1px solid #C4C4C4"}}),42!==le.fieldType&&48!==le.fieldType&&Object(n.jsx)(uo.a,{type:"text",name:"exampleText",value:le.exampleText||"",style:{borderRadius:"16px"},onChange:be?function(e){ts(e)&&de(Object(m.a)(Object(m.a)({},le),{},Object(b.a)({},e.target.name,e.target.value)))}:Ye,endAdornment:Object(n.jsx)(Rn.a,{position:"end",children:be?"".concat(""===le.exampleText?"":":","CK09aABbAz"):""})}),48===le.fieldType&&Object(n.jsx)("div",{className:U.contentInput,children:Object(n.jsx)("input",{accept:"image/*",id:"contained-button-file",name:"imagen",type:"file",onChange:function(e){return function(e){var t=e.target.files[0];if(t){G(t);var a=Pe()("certika-organization-".concat(L)).toString();de(Object(m.a)(Object(m.a)({},le),{},{img:URL.createObjectURL(t),exampleText:t.name,isNewImage:"newImg",routeImg:"".concat(a,"/fieldTemp/").concat(t.name)}))}}(e)}})}),48!==le.fieldType&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.align-letter"),"*"]}),Object(n.jsxs)("div",{children:[Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(bo.a,{}),checkedIcon:Object(n.jsx)(bo.a,{}),name:"align",value:"center",checked:"center"===le.align,onChange:Ye}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(po.a,{}),checkedIcon:Object(n.jsx)(po.a,{}),name:"align",value:"left",checked:"left"===(null===le||void 0===le?void 0:le.align),onChange:Ye}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(jo.a,{}),checkedIcon:Object(n.jsx)(jo.a,{}),name:"align",value:"right",checked:"right"===(null===le||void 0===le?void 0:le.align),onChange:Ye})]}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.font"),"*"]}),Object(n.jsx)(Xo,{name:"fontFamily",value:le.fontFamily||null,placeholder:"Selecciona un tipo de letra",options:_e,getOptionLabel:function(e){return e.family},getOptionSelected:function(e){return e.family},onChange:function(e,t){return function(e){if((null===e||void 0===e?void 0:e.family)&&!ge.includes(e.family)){var t=[].concat(Object(p.a)(ge),[e.family]);xe(t),vo.a.load({google:{families:[e.family]},active:function(){de(Object(m.a)(Object(m.a)({},le),{},{fontFamily:e}))}})}else de(Object(m.a)(Object(m.a)({},le),{},{fontFamily:e}))}(t)}}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.size-letter"),"*"]}),Object(n.jsx)("input",{type:"number",name:"fontSize",value:le.fontSize||"",onChange:Ye,onKeyUp:lo,style:{borderRadius:"16px",border:"1px solid #C4C4C4",paddingLeft:"1em"}}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.style-letter"),"*"]}),Object(n.jsxs)("div",{children:[Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(fo.a,{}),checkedIcon:Object(n.jsx)(fo.a,{}),name:"bold",checked:null===le||void 0===le||null===(y=le.fontStyle)||void 0===y?void 0:y.bold,onChange:function(e){return Ue(Object(m.a)(Object(m.a)({},le.fontStyle),{},{bold:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(ho.a,{}),checkedIcon:Object(n.jsx)(ho.a,{}),name:"italic",checked:null===le||void 0===le||null===(w=le.fontStyle)||void 0===w?void 0:w.italic,onChange:function(e){return Ue(Object(m.a)(Object(m.a)({},le.fontStyle),{},{italic:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(go.a,{}),checkedIcon:Object(n.jsx)(go.a,{}),name:"underline",checked:null===le||void 0===le||null===(C=le.fontStyle)||void 0===C?void 0:C.underline,onChange:function(e){return Ue(Object(m.a)(Object(m.a)({},le.fontStyle),{},{underline:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(xo.a,{}),checkedIcon:Object(n.jsx)(xo.a,{}),name:"strikethrough",checked:null===le||void 0===le||null===(k=le.fontStyle)||void 0===k?void 0:k.strikethrough,onChange:function(e){return Ue(Object(m.a)(Object(m.a)({},le.fontStyle),{},{strikethrough:e.target.checked}))}})]}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.colour"),"*"]}),Object(n.jsx)(wo,{color:(null===(N=le.fontColor)||void 0===N?void 0:N.hex)||"#000000",changeColor:We})]})]})}),Object(n.jsx)(_.a,{dividers:!0,className:!pe&&U.fieldButtonDisabled,children:Object(n.jsxs)("div",{className:U.content_modal,children:[Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.colour-text"),"*"]}),Object(n.jsx)(wo,{color:(null===(B=le.fontColor)||void 0===B?void 0:B.hex)||"#000000",changeColor:We}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.colour-background"),"*"]}),Object(n.jsx)(wo,{color:(null===(S=le.rectColor)||void 0===S?void 0:S.hex)||"#000000",changeColor:function(e){de(Object(m.a)(Object(m.a)({},le),{},{rectColor:e}))}})]})}),Object(n.jsxs)(Ae.a,{children:[Object(n.jsx)(es,{color:"primary",variant:"contained",onClick:He,children:Re("buttons:buttons.save")}),Object(n.jsx)(es,{color:"primary",variant:"contained",onClick:Fe,children:Re("buttons:buttons.close")})]})]})]})}));var cs=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),os=Object(C.a)((function(e){return{root:{marginTop:"1em"},input:{display:"none"},avatar:{width:"auto",height:"auto","&:hover":{cursor:"pointer"}},icon:{margin:20,fontSize:"4em"},card:{backgroundColor:E.a.background},fieldCard:{backgroundColor:"#ffffff"},contentInput:Object(b.a)({marginTop:"1em",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},e.breakpoints.up("lg"),{display:"block",alignItems:"left"}),text:Object(b.a)({display:"flex"},e.breakpoints.up("lg"),{display:"block"}),autocomplete:{width:590,"& > * + *":{marginTop:e.spacing(3)},marginBottom:10},skills:{whiteSpace:"normal"},chip:{height:"100%",marginBottom:"0.5em"},img:function(e){var t,a,n,i,r,c;return{maxWidth:"70vw",height:(null===(t=e.form)||void 0===t?void 0:t.img_prev)&&"blob"===(null===(a=e.form)||void 0===a||null===(n=a.img_prev[0])||void 0===n?void 0:n.split(":",1)[0])?null===(i=e.imageRef)||void 0===i||null===(r=i.current)||void 0===r?void 0:r.naturalHeight:null===(c=e.form)||void 0===c?void 0:c.height}},buttonForm:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:"50px",padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},buttonDialog:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:"50px",padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}},mySwal:{zIndex:3e3}}})),ss={setCertificateFields:I.p,changeBreadcrump:I.a,setForm:I.w,setSaveDesign:I.D},ls=Object(s.b)((function(e){var t,a,n,i,r,c,o;return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,form:e.form?Object(m.a)(Object(m.a)({},e.form),{},{activities:(null===(t=e.form.activities)||void 0===t?void 0:t.length)>0?e.form.activities:[{index:1}],fieldsAdditionals:(null===(a=e.form)||void 0===a||null===(n=a.fieldsAdditionals)||void 0===n?void 0:n.length)>0?null===(i=e.form)||void 0===i?void 0:i.fieldsAdditionals:[{index:1}],modules:(null===(r=e.form)||void 0===r||null===(c=r.modules)||void 0===c?void 0:c.length)>0?null===(o=e.form)||void 0===o?void 0:o.modules:[{index:1,sessions:[]}]}):{activities:[{index:1}],fieldsAdditionals:[{index:1}],modules:[{index:1,sessions:[]}],skills:[]},certificateFields:e.certificateFields,returnRoute:e.returnRoute,saveDesign:e.saveDesign}}),ss)((function(e){var t,a,r,c,o=e.user,s=e.organizationId,l=e.form,j=e.returnRoute,v=e.setForm,y=e.certificateFields,w=e.setCertificateFields,C=e.changeBreadcrump,k=e.saveDesign,N=e.setSaveDesign,B=Object(u.g)(),S=os({form:l}),A=Object(i.useRef)(),I=Object(i.useState)(!1),P=Object(d.a)(I,2),R=P[0],M=P[1],L=Object(i.useState)(),U=Object(d.a)(L,2),q=U[0],H=U[1],V=Object(i.useState)([]),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)([]),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)([]),ne=Object(d.a)(te,2),ie=ne[0],re=ne[1],ce=Object(i.useState)([]),oe=Object(d.a)(ce,2),le=oe[0],de=oe[1],ue=Object(i.useState)([]),me=Object(d.a)(ue,2),be=me[0],pe=me[1],he=Object(i.useState)([]),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ke=Object(i.useState)([]),Ne=Object(d.a)(ke,2),Be=Ne[0],Se=Ne[1],Ee=Object(i.useState)([]),De=Object(d.a)(Ee,2),ze=De[0],Re=De[1],Me=Object(i.useState)([]),Le=Object(d.a)(Me,2),Fe=Le[0],Ue=Le[1],We=Object(i.useState)(!1),Ye=Object(d.a)(We,2),qe=Ye[0],He=Ye[1],Ke=Object(i.useState)(!1),Ve=Object(d.a)(Ke,2),Ge=Ve[0],Qe=Ve[1],Je=Object(i.useState)(!1),Xe=Object(d.a)(Je,2),Ze=Xe[0],$e=Xe[1],et=Object(i.useState)({}),tt=Object(d.a)(et,2),at=tt[0],nt=tt[1],it=!!e.match.params.id,rt=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","breadCrumps","tables"]),ot=Object(d.a)(rt,1)[0],st="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2));Object(i.useEffect)((function(){lt()}),[]);var lt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,M(!0),e.next=4,bt();case 4:return e.next=6,pt();case 6:return e.next=8,jt();case 8:return e.next=10,ft();case 10:return e.next=12,ht();case 12:return e.next=14,gt();case 14:return e.next=16,Ot();case 16:if(!it){e.next=23;break}return e.next=19,vt();case 19:C(ot("breadCrumps:breadCrumps.certificate-template-edit",{returnObjects:!0})),N(!0),e.next=25;break;case 23:v(Object(m.a)(Object(m.a)({},l),{},{img_prev:(null===l||void 0===l?void 0:l.img_prev)&&"blob"===(null===l||void 0===l||null===(t=l.img_prev[0])||void 0===t?void 0:t.split(":",1)[0])?null:l.img_prev,id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"",id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,page:1})),C(ot("breadCrumps:breadCrumps.certificate-template-create",{returnObjects:!0}));case 25:M(!1),e.next=31;break;case 28:e.prev=28,e.t0=e.catch(0),B.push("/500");case 31:case"end":return e.stop()}}),e,null,[[0,28]])})));return function(){return e.apply(this,arguments)}}();Object(i.useEffect)((function(){xt(l.id_organizaciones)}),[l.id_organizaciones]);var dt,ut=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,bt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/hability/getHabilities");case 2:t=e.sent,a=t.data,Oe(a.habilities.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTypes");case 2:t=e.sent,a=t.data,J(a.types);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),jt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,ee(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ft=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,re(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ht=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,de(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),gt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTypeCriteria");case 2:t=e.sent,a=t.data,pe(a.typeCriteria);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),xt=function(){var t=Object(h.a)(f.a.mark((function t(a){var n,i,r,c,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ce.a.post("/certificateTemplate/getCertificateTemplatesPublished/names",{id_organizaciones:a});case 2:n=t.sent,i=n.data,r=!!e.match.params.id,c=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,r?(s=parseInt(Object(Ie.a)(e.match.params.id),10),Se(c?i.certificateTemplates.filter((function(e){return e.id!==s&&e.plantillasCertificadosHistorial[0].id_usuarios===o.data_user.id})):i.certificateTemplates.filter((function(e){return e.id!==s})))):Se(c?i.certificateTemplates.filter((function(e){return e.plantillasCertificadosHistorial[0].id_usuarios===o.data_user.id})):i.certificateTemplates);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ot=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ut){e.next=8;break}return e.next=3,Ce.a.post("/organization/getOrganizations");case 3:t=e.sent,a=t.data,Re(a.organizations.rows),e.next=13;break;case 8:return e.next=10,Ce.a.get("/organization/".concat(s));case 10:n=e.sent,i=n.data,Re(i.organization.organizations);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),vt=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,s,l,d,u,b,p,j,g,x,O,_,y,C,k,N,S,T,A;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,p=Object(Ie.a)(e.match.params.id),t.next=4,Ce.a.get("/certificateTemplate/".concat(p));case 4:return j=t.sent,g=j.data,x=g.certificateTemplate,O=x.certificateTemplate,_=x.criterion,y=x.skillsTemplate,C=x.linkPhoto,k=x.linkPhotoTemplate,N=x.certificateFieldsAdditionals,S=x.certificateModules,t.next=9,Promise.all(null===(a=g.certificateTemplate)||void 0===a||null===(n=a.certificateTemplate)||void 0===n?void 0:n.certificadoCampos.filter((function(e){return e.img})).map(function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t.img);case 2:return a=e.sent,e.next=5,a.blob();case 5:return n=e.sent,e.abrupt("return",t.imgBlod=URL.createObjectURL(n));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:return T=[],A=[],t.next=13,Promise.all(k.map(function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return a=e.sent,e.t0=T,e.t1=URL,e.next=7,a.blob();case 7:e.t2=e.sent,e.t3=e.t1.createObjectURL.call(e.t1,e.t2),e.t0.push.call(e.t0,e.t3);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 13:return t.next=15,Promise.all(C.map(function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return a=e.sent,e.t0=A,e.t1=URL,e.next=7,a.blob();case 7:e.t2=e.sent,e.t3=e.t1.createObjectURL.call(e.t1,e.t2),e.t0.push.call(e.t0,e.t3);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 15:Ue(null===(i=g.certificateTemplate)||void 0===i||null===(r=i.certificateTemplate)||void 0===r?void 0:r.certificadosEmitidos),w(null===(c=g.certificateTemplate)||void 0===c||null===(s=c.certificateTemplate)||void 0===s?void 0:s.certificadoCampos.map((function(e){return{id:e.id,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fieldName:e.nombre,img:e.img?e.img:null,align:e.formato_letra?e.formato_letra:"center",fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontSize:e.tamano_letra,fontFamily:{family:e.tipo_letra},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseFloat(e.x),y:parseFloat(e.y),width:0===e.width?430:e.width,height:0===e.height?e.tamano_letra:e.height,page:e.page}}))),null===(l=g.certificateTemplate)||void 0===l||(null===(d=l.certificateTemplate)||void 0===d||delete d.certificadoCampos),v(Object(m.a)(Object(m.a)({},O),{},{id_plantillas_recomendadas:null===(u=g.certificateTemplate)||void 0===u?void 0:u.recommendations.map((function(e){return{id:e.id,nombre:e.plantillasCertificadosRecomendadas.nombre,nombre_privado:e.plantillasCertificadosRecomendadas.nombre_privado,id_plantillas_certificados:e.id_plantillas_certificados,id_plantillas_certificados_recomendadas:e.id_plantillas_certificados_recomendadas}})),img_prev:A,img_template:T,id_usuarios:null===(b=o.data_user)||void 0===b?void 0:b.id,skills:y.map((function(e,t){return{index:t,id:e.id,id_habilidades:e.id_habilidades,id_plantillas_certificados:e.id_plantillas,descripcion:e.habilidades.descripcion}})),activities:_.map((function(e,t){return{index:t,id:e.id,tipo_criterio_vp:e.tipo_criterio_vp,descripcion_criterio:e.descripcion_criterio,link:e.link}})),fieldsAdditionals:N.map((function(e,t){return{index:t,id:e.id,titulo_campo:e.titulo_campo,descripcion_campo:e.descripcion_campo,link:e.link}})),modules:S.map((function(e,t){return{index:t,id:e.id,titulo_modulo:e.titulo_modulo,descripcion_modulo:e.descripcion_modulo,fecha_inicio:e.fecha_inicio?e.fecha_inicio.split(" ")[0]:"",fecha_fin:e.fecha_fin?e.fecha_fin.split(" ")[0]:"",sessions:e.sessions.map((function(e){return Object(m.a)(Object(m.a)({},e),{},{id_modulo:t,fecha_inicio:e.fecha_inicio.split(" ")[0],fecha_fin:e.fecha_fin.split(" ")[0]})}))}})),estado:O.estado,page:1})),t.next=24;break;case 21:t.prev=21,t.t0=t.catch(0),B.push("/500");case 24:case"end":return t.stop()}}),t,null,[[0,21]])})));return function(){return t.apply(this,arguments)}}(),yt=function(){return!(0===Fe||!e.match.params.id)},wt=function(e){v(Object(m.a)(Object(m.a)({},l),{},Object(b.a)({},e.target.name,e.target.value)))},Ct=function(e,t){var a;null===(a=l.activities)||void 0===a||a.map((function(a){return a.index===t&&(a[e.target.name]=e.target.value),a})),v(Object(m.a)(Object(m.a)({},l),{},{activities:l.activities}))},kt=function(e,t){var a;null===(a=l.fieldsAdditionals)||void 0===a||a.map((function(a){return a.index===t&&(a[e.target.name]=e.target.value),a})),v(Object(m.a)(Object(m.a)({},l),{},{fieldsAdditionals:l.fieldsAdditionals}))},Nt=function(e){return""!==e.nombre_privado?"".concat(e.nombre," (").concat(e.nombre_privado,")"):e.nombre},Bt=function(e){return!(e>1)&&(l.cantidad_tiempo=null,!0)},St=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o,d,u,b,p,j,h,g,x,O,_,C,k,N,B,S,T,I,D,z,P,R,L,U,W,Y,H,K,V,G;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!!l.img_prev){e.next=3;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ot("alerts:alerts.template-certificate-alert"),showConfirmButton:!1,timer:1500}));case 3:if(r=Pe()("certika-organization-".concat(s)).toString(),c=!(!q||!(null===q||void 0===q||null===(t=q.imagen[0])||void 0===t?void 0:t.name)),o="blob"===(null===l||void 0===l||null===(a=l.img_prev[0])||void 0===a?void 0:a.split(":",1)[0]),d=(null===(n=A.current)||void 0===n?void 0:n.naturalWidth)>(null===(i=A.current)||void 0===i?void 0:i.naturalHeight),u=l.width>l.height,!c){e.next=48;break}if(!(o&&d&&((null===(b=A.current)||void 0===b?void 0:b.naturalWidth)>950||(null===(p=A.current)||void 0===p?void 0:p.naturalHeight)>700||(null===(j=A.current)||void 0===j?void 0:j.naturalWidth)<750||(null===(h=A.current)||void 0===h?void 0:h.naturalHeight)<550))){e.next=11;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ot("alerts:alerts.horizontal-certificates"),showConfirmButton:!0,confirmButtonText:ot("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 11:if(!o||d||!((null===(g=A.current)||void 0===g?void 0:g.naturalWidth)>668||(null===(x=A.current)||void 0===x?void 0:x.naturalHeight)>900||(null===(O=A.current)||void 0===O?void 0:O.naturalWidth)<420||(null===(_=A.current)||void 0===_?void 0:_.naturalHeight)<690)){e.next=13;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ot("alerts:alerts.vertical-certificates"),showConfirmButton:!0,confirmButtonText:ot("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 13:if(o||!u||!(l.width>950||l.height>700||l.width<750||l.height<550)){e.next=15;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ot("alerts:alerts.horizontal-certificates"),showConfirmButton:!0,confirmButtonText:ot("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 15:if(o||u||!(l.width>668||l.height>900||l.width<420||l.height<690)){e.next=17;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ot("alerts:alerts.vertical-certificates"),showConfirmButton:!0,confirmButtonText:ot("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 17:N=1;case 18:if(!(N<l.img_prev.length)){e.next=24;break}if((null===q||void 0===q||null===(B=q.elements[0])||void 0===B?void 0:B.naturalWidth)===(null===q||void 0===q||null===(S=q.elements[N])||void 0===S?void 0:S.naturalWidth)&&(null===q||void 0===q||null===(T=q.elements[0])||void 0===T?void 0:T.naturalHeight)===(null===q||void 0===q||null===(I=q.elements[N])||void 0===I?void 0:I.naturalHeight)){e.next=21;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:ot("alerts:alerts.no-equals-format"),showConfirmButton:!0,confirmButtonText:ot("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 21:N++,e.next=18;break;case 24:M(!0),D=0;case 26:if(!(D<l.img_prev.length)){e.next=35;break}return(z=new FormData).append("file",null===q||void 0===q?void 0:q.imagen[D]),z.append("route","".concat(r,"/certificateTemplate/certificate-temp/temp").concat((null===l||void 0===l?void 0:l.pages)>1?D:"")),e.next=32,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:z});case 32:D++,e.next=26;break;case 35:!(null===y||void 0===y?void 0:y.length)>0&&(P=so(),R=P.dataQr,L=P.dataImg,U=P.dataCode,W=P.dataButtonVerify,w([R,L,U,W])),Y=[],H=0;case 38:if(!(H<l.img_prev.length)){e.next=47;break}return e.next=41,Ce.a.post("/file/getFile",{keyFile:"".concat(r,"/certificateTemplate/certificate-temp/temp").concat((null===l||void 0===l?void 0:l.pages)>1?H:""),headers:{"Content-Type":"multipart/form-data"}});case 41:K=e.sent,V=K.data,Y.push(null===V||void 0===V?void 0:V.url);case 44:H++,e.next=38;break;case 47:v(Object(m.a)(Object(m.a)({},l),{},{img_prev:Y,width:null===(C=A.current)||void 0===C?void 0:C.naturalWidth,height:null===(k=A.current)||void 0===k?void 0:k.naturalHeight}));case 48:void 0!==(G=null===y||void 0===y?void 0:y.findIndex((function(e){return"certificateCode"===e.fieldName})))&&-1!==G&&(y[G].exampleText=y[G].exampleText.includes(":")?y[G].exampleText.split(":")[0]:""),Qe(!0),M(!1);case 52:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Tt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),!!l.img_prev){e.next=4;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ot("alerts:alerts.template-certificate-alert"),showConfirmButton:!1,timer:1500}));case 4:if((null===y||void 0===y?void 0:y.length)>0){e.next=7;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ot("alerts:alerts.no-design-certificate"),showConfirmButton:!1,timer:1500}));case 7:if(k){e.next=9;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ot("alerts:alerts.no-accepted-design-certificate"),showConfirmButton:!1,timer:1500}));case 9:if(a={},l.modules.map((function(e){e.fecha_inicio&&e.fecha_fin&&e.fecha_inicio>e.fecha_fin&&(a={valid:!0,modulo:e.index+1})})),!a.valid){e.next=13;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:"La fecha de inicio del m\xf3dulo ".concat(a.modulo," debe ser menor a la fecha de finalizaci\xf3n"),showConfirmButton:!1,timer:3e3}));case 13:if(n=!l.id,M(!0),delete l.img_template,e.prev=16,!n){e.next=22;break}return e.next=20,Ce.a.post("/certificateTemplate",Object(m.a)(Object(m.a)({},l),{},{criterios:l.activities,id_habilidades:l.skills,camposAdicionales:l.fieldsAdditionals,width:null===(i=A.current)||void 0===i?void 0:i.naturalWidth,height:null===(r=A.current)||void 0===r?void 0:r.naturalHeight,certificateFields:y}));case 20:e.next=24;break;case 22:return e.next=24,Ce.a.put("/certificateTemplate/".concat(l.id),Object(m.a)(Object(m.a)({},l),{},{criterios:l.activities,id_habilidades:l.skills,camposAdicionales:l.fieldsAdditionals,width:null===(c=A.current)||void 0===c?void 0:c.naturalWidth,height:null===(o=A.current)||void 0===o?void 0:o.naturalHeight,certificateFields:y}));case 24:e.next=30;break;case 26:return e.prev=26,e.t0=e.catch(16),M(!1),e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:ot("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}));case 30:M(!1),F.a.fire({icon:"success",iconColor:E.a.primary,text:ot("alerts:alerts.saved"),showConfirmButton:!1,timer:1500}).then((function(){n?B.push("/certificates/edited"):B.push(j),v(null),w(null)}));case 32:case"end":return e.stop()}}),e,null,[[16,26]])})));return function(t){return e.apply(this,arguments)}}(),At=function(){He(!1)},Et=function(){$e(!1)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:S.root,onSubmit:Tt,children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:ot("certificateBadgeTemplate:badges-certificate-form.details-certificate")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:S.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:[Object(n.jsx)(K.a,{title:ot("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{imgProps:{ref:A},alt:"img-prev",src:(null===l||void 0===l?void 0:l.img_template)?null===l||void 0===l?void 0:l.img_template[(null===l||void 0===l?void 0:l.page)-1]:(null===l||void 0===l?void 0:l.img_prev)?null===l||void 0===l?void 0:l.img_prev[(null===l||void 0===l?void 0:l.page)-1]:null,variant:"rounded",className:S.avatar,onClick:function(){return He(!!(null===l||void 0===l?void 0:l.img_prev))},children:Object(n.jsx)(se.a,{sx:{margin:4,fontSize:"4em"}})})}),Object(n.jsx)(Lt.a,{component:"span",display:"flex",justifyContent:"center",children:Object(n.jsx)(ta.a,{color:"secondary",count:(null===l||void 0===l?void 0:l.pages)||0,page:(null===l||void 0===l?void 0:l.page)||1,onChange:function(e,t){v(Object(m.a)(Object(m.a)({},l),{},{page:t}))},size:"small"})})]})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:8,children:[Object(n.jsxs)(we.a,{variant:"body2",children:[ot("certificateBadgeTemplate:badges-certificate-form.certificate-img"),Object(n.jsx)("br",{}),ot("certificateBadgeTemplate:badges-certificate-form.certificate-img-max-file"),Object(n.jsx)("br",{}),ot("certificateBadgeTemplate:badges-certificate-form.recommended-size"),Object(n.jsx)("b",{children:ot("certificateBadgeTemplate:badges-certificate-form.horizontal")}),ot("certificateBadgeTemplate:badges-certificate-form.least"),Object(n.jsx)("b",{children:"950 x 660 "}),ot("certificateBadgeTemplate:badges-certificate-form.pixels"),Object(n.jsx)("br",{}),ot("certificateBadgeTemplate:badges-certificate-form.certificates"),Object(n.jsxs)("b",{children:[ot("certificateBadgeTemplate:badges-certificate-form.vertical")," 668 x 890 "]}),ot("certificateBadgeTemplate:badges-certificate-form.pixels")]}),Object(n.jsxs)("div",{className:S.contentInput,children:[Object(n.jsx)("input",{multiple:!0,accept:"image/*",className:S.input,id:"contained-button-file",name:"imagen",type:"file",onChange:function(e){return function(e){var t=e.target.files;if(t.length>3)return F.a.fire({icon:"error",iconColor:E.a.primary,text:ot("alerts:alerts.max-template-certificate-alert"),showConfirmButton:!0,confirmButtonText:ot("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}});if(t.length>0){for(var a=[],n=[],i=0;i<t.length;i++){var r=URL.createObjectURL(t[i]);a.push(r);var c=document.createElement("img");c.src=r,n.push(c)}H({imagen:t,elements:n}),v(Object(m.a)(Object(m.a)({},l),{},{img_prev:a,img_template:null,imagen:"newImage",pages:a.length,page:1})),y&&w(y.map((function(e){return Object(m.a)(Object(m.a)({},e),{},{x:50,y:50})}))),N(!1)}}(e)},disabled:yt()}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,children:Object(n.jsx)("label",{htmlFor:"contained-button-file",children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",component:"span",disabled:yt(),children:ot("buttons:buttons.upload-image")})})}),Object(n.jsx)(ye.a,{item:!0,children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",component:"span",disabled:yt(),onClick:St,children:ot("buttons:buttons.design-certificate")})})]})]})]})]}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:S.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:S.text,align:"right",children:[ot("certificateBadgeTemplate:badges-certificate-form.certificate-public-name"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:yt(),required:!0,label:"",name:"nombre",variant:"outlined",size:"small",onChange:wt,value:null===l||void 0===l?void 0:l.nombre})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:S.text,align:"right",children:[ot("certificateBadgeTemplate:badges-certificate-form.certificate-private-name"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"",name:"nombre_privado",variant:"outlined",size:"small",onChange:wt,value:null===l||void 0===l?void 0:l.nombre_privado})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:S.text,align:"right",children:[ot("certificateBadgeTemplate:badges-certificate-form.description"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:yt(),required:!0,label:"",name:"descripcion",variant:"outlined",size:"small",multiline:!0,rows:4,value:null===l||void 0===l?void 0:l.descripcion,onChange:wt})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:S.text,align:"right",children:ot("certificateBadgeTemplate:badges-certificate-form.additional")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:yt(),label:"",name:"url",variant:"outlined",size:"small",placeholder:"http://",onChange:wt,value:null===l||void 0===l?void 0:l.url,type:"url"})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:S.text,align:"right",children:ot("certificateBadgeTemplate:badges-certificate-form.skills")})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:8,children:[Object(n.jsx)(mt.a,{children:Object(n.jsx)(oo.a,{disabled:yt(),multiple:!0,disableClearable:!0,freeSolo:!0,className:S.autocomplete,onChange:function(e,t){return function(e,t){v(Object(m.a)(Object(m.a)({},l),{},{skills:[].concat(Object(p.a)(l.skills),[t.pop()])})),Oe(xe.filter((function(t){return t.descripcion.trim()!==e.target.innerText})))}(e,t)},options:xe.sort((function(e,t){return e.descripcion.trim()<t.descripcion.trim()?-1:1})).map((function(e){return{id_habilidades:e.id,descripcion:e.descripcion}})),getOptionLabel:function(e){return e.descripcion},renderTags:function(){return null},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{multiline:!0,variant:"outlined",label:ot("selects:selects-autocompletes.skill-select")}))}})}),(null===l||void 0===l||null===(r=l.skills)||void 0===r?void 0:r.length)>0?Object(n.jsx)(ve.a,{variant:"outlined",className:S.card,children:Object(n.jsx)(_e.a,{children:l.skills.map((function(e,t){return Object(n.jsx)(ye.a,{children:Object(n.jsx)(fe.a,{disabled:yt(),onDelete:function(){return function(e){v(Object(m.a)(Object(m.a)({},l),{},{skills:null===l||void 0===l?void 0:l.skills.filter((function(t){return t!==e}))})),e.id_habilidades&&Oe([].concat(Object(p.a)(xe),[e]))}(e)},onClick:function(){return function(e,t){"string"===typeof e&&($e(!0),nt({value:e,index:t}))}(e,t)},variant:"outlined",label:Object(n.jsx)(we.a,{className:S.skills,children:"string"===typeof e?e:e.descripcion}),className:S.chip})},"skill-chip-".concat(t))}))})}):""]}),1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:S.text,align:"right",children:ot("certificateBadgeTemplate:badges-certificate-form.organization")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"organizacion",name:"id_organizaciones",value:l.id_organizaciones||"",disabled:yt(),onChange:wt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:ot("selects:selects-autocompletes.select-option")})}),ze.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},"organization-".concat(e.id))}))]})})})]}),(null===ze||void 0===ze||null===(c=ze.organizacionesRelaciones)||void 0===c?void 0:c.length)>0&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:S.text,align:"right",children:ot("certificateBadgeTemplate:badges-certificate-form.organization")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:yt(),id:"organizacion",name:"id_organizacion_hija",onChange:wt,value:l.id_organizacion_hija,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:ot("selects:selects-autocompletes.select-option")})}),(null===ze||void 0===ze?void 0:ze.organizacionesRelaciones.map((function(e){return e.organizacionesRelacionadas}))).map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},e.id)}))]})})})]})]}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:S.root,children:ot("certificateBadgeTemplate:badges-certificate-form.criteria-certificate-title")}),l.activities.map((function(e,t){var a;return Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:S.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:S.text,align:"right",children:"".concat(ot("certificateBadgeTemplate:badges-certificate-form.criterion")," ").concat(t+1)})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:S.card,children:[Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{variant:"body1",align:"left",children:"".concat(ot("certificateBadgeTemplate:badges-certificate-form.type")).concat(e.descripcion_criterio?"*":"")}),Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100 ".concat(S.fieldCard),size:"small",children:Object(n.jsxs)(T.a,{name:"tipo_criterio_vp",value:e.tipo_criterio_vp||"",required:!!e.descripcion_criterio,disabled:yt(),onChange:function(t){return Ct(t,e.index)},children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:ot("selects:selects-autocompletes.select-option")})}),be.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:st?e.valor_parametro_en:e.valor_parametro},"type-criteria-".concat(e.id))}))]})}),Object(n.jsx)(we.a,{variant:"body1",align:"left",className:S.root,children:"".concat(ot("certificateBadgeTemplate:badges-certificate-form.description")).concat(e.tipo_criterio_vp?"*":"")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!!e.tipo_criterio_vp,disabled:yt(),name:"descripcion_criterio",variant:"outlined",size:"small",multiline:!0,value:e.descripcion_criterio||"",rows:4,onChange:function(t){return Ct(t,e.index)},className:S.fieldCard})}),Object(n.jsx)(we.a,{variant:"body1",align:"left",className:S.root,children:ot("certificateBadgeTemplate:badges-certificate-form.criterion-url")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:yt(),type:"url",name:"link",variant:"outlined",size:"small",placeholder:"http://",value:e.link||"",onChange:function(t){return Ct(t,e.index)},className:S.fieldCard})})]}),Object(n.jsx)(wc.a,{children:(null===(a=l.activities)||void 0===a?void 0:a.length)>0&&Object(n.jsx)(x.a,{disabled:yt(),size:"small",onClick:function(t){return function(e,t){var a,n;a=0===l.activities.length?[{index:1}]:null===(n=l.activities)||void 0===n?void 0:n.filter((function(e){return e.index!==t})),v(Object(m.a)(Object(m.a)({},l),{},{activities:a}))}(0,e.index)},children:Object(n.jsxs)(we.a,{color:"textSecondary",variant:"body2",children:[Object(n.jsx)(ae.a,{}),ot("buttons:buttons.delete")]})})})]})})]},"grid-activity-".concat(t))})),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",onClick:function(){var e,t=l.activities[(null===(e=l.activities)||void 0===e?void 0:e.length)-1];v(Object(m.a)(Object(m.a)({},l),{},{activities:[].concat(Object(p.a)(l.activities),[{index:t.index+1}])}))},disabled:yt(),children:ot("buttons:buttons.add-criterion")})})]}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:S.root,children:ot("certificateBadgeTemplate:badges-certificate-form.additional-fields")}),l.fieldsAdditionals.map((function(e,t){var a;return Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:S.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:S.text,align:"right",children:"".concat(ot("certificateBadgeTemplate:badges-certificate-form.field")," ").concat(t+1)})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:S.card,children:[Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{variant:"body1",align:"left",className:S.root,children:"".concat(ot("certificateBadgeTemplate:badges-certificate-form.field-title")).concat(e.descripcion_campo?"*":"")}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(Te.a,{required:!!e.descripcion_campo,disabled:yt(),name:"titulo_campo",variant:"outlined",size:"small",value:e.titulo_campo||"",rows:4,onChange:function(t){return kt(t,e.index)},className:S.fieldCard})}),Object(n.jsx)(we.a,{variant:"body1",align:"left",className:S.root,children:"".concat(ot("certificateBadgeTemplate:badges-certificate-form.field-description")).concat(e.titulo_campo?"*":"")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{multiline:!0,required:!!e.titulo_campo,disabled:yt(),name:"descripcion_campo",variant:"outlined",size:"small",value:e.descripcion_campo||"",rows:4,onChange:function(t){return kt(t,e.index)},className:S.fieldCard})}),Object(n.jsx)(we.a,{variant:"body1",align:"left",className:S.root,children:ot("certificateBadgeTemplate:badges-certificate-form.field-url")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:yt(),label:"",name:"link",variant:"outlined",size:"small",placeholder:"http://",onChange:function(t){return kt(t,e.index)},value:e.link||"",className:S.fieldCard,type:"url"})})]}),Object(n.jsx)(wc.a,{children:(null===(a=l.fieldsAdditionals)||void 0===a?void 0:a.length)>0&&Object(n.jsx)(x.a,{disabled:yt(),size:"small",onClick:function(t){return function(e,t){var a,n;a=0===l.fieldsAdditionals.length?[{index:1}]:null===(n=l.fieldsAdditionals)||void 0===n?void 0:n.filter((function(e){return e.index!==t})),v(Object(m.a)(Object(m.a)({},l),{},{fieldsAdditionals:a}))}(0,e.index)},children:Object(n.jsxs)(we.a,{color:"textSecondary",variant:"body2",children:[Object(n.jsx)(ae.a,{}),ot("buttons:buttons.delete")]})})})]})})]},"grid-activity-".concat(t))})),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",onClick:function(){var e,t=l.fieldsAdditionals[(null===(e=l.fieldsAdditionals)||void 0===e?void 0:e.length)-1];v(Object(m.a)(Object(m.a)({},l),{},{fieldsAdditionals:[].concat(Object(p.a)(l.fieldsAdditionals),[{index:t.index+1}])}))},disabled:yt(),children:ot("buttons:buttons.add-field")})})]}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:S.root,children:ot("certificateBadgeTemplate:badges-certificate-form.attributes")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:S.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:S.text,children:ot("certificateBadgeTemplate:badges-certificate-form.type")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"tipo",name:"tipo_vp",defaultValue:"",value:l.tipo_vp||"",disabled:yt(),onChange:wt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:ot("selects:selects-autocompletes.select-option")})}),Q.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:st?e.valor_parametro_en:e.valor_parametro},"type-".concat(e.id))}))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:S.text,children:ot("certificateBadgeTemplate:badges-certificate-form.level")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"nivel",name:"nivel_vp",value:l.nivel_vp||"",disabled:yt(),onChange:wt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:ot("selects:selects-autocompletes.select-option")})}),$.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:st?e.valor_parametro_en:e.valor_parametro},"level-".concat(e.id))}))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:S.text,children:ot("certificateBadgeTemplate:badges-certificate-form.time")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"tiempo",name:"tiempo_vp",value:(null===l||void 0===l?void 0:l.tiempo_vp)||"",disabled:yt(),onChange:wt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:ot("selects:selects-autocompletes.select-option")})}),le.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:st?e.valor_parametro_en:e.valor_parametro},"time-".concat(e.id))}))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:S.text,children:ot("certificateBadgeTemplate:badges-certificate-form.amount-time")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(Te.a,{disabled:Bt(l.tiempo_vp)||yt(),required:!Bt(l.tiempo_vp),type:"number",name:"cantidad_tiempo",value:(dt=l.cantidad_tiempo,""===dt||dt<1?(l.cantidad_tiempo=null,l.cantidad_tiempo):dt),variant:"outlined",size:"small",onKeyUp:lo,onChange:wt})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:S.text,children:ot("certificateBadgeTemplate:badges-certificate-form.cost")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"costo",name:"costo_vp",value:(null===l||void 0===l?void 0:l.costo_vp)||"",disabled:yt(),onChange:wt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:ot("selects:selects-autocompletes.select-option")})}),ie.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:st?e.valor_parametro_en:e.valor_parametro},"cost-".concat(e.id))}))]})})})]}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:S.root,children:ot("certificateBadgeTemplate:badges-certificate-form.recommendation-title")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:S.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(oo.a,{disabled:yt(),multiple:!0,filterSelectedOptions:!0,className:S.autocomplete,value:l.id_plantillas_recomendadas||[],onChange:function(e,t){v(Object(m.a)(Object(m.a)({},l),{},{id_plantillas_recomendadas:t}))},options:Be.map((function(e){return{linkphoto:e.linkPhoto,id_plantillas_certificados_recomendadas:e.id,nombre:e.nombre,nombre_privado:e.nombre_privado}}))||[],getOptionLabel:function(e){return Nt(e)},getOptionSelected:function(e,t){return e.id_plantillas_certificados_recomendadas===t.id_plantillas_certificados_recomendadas},renderTags:function(e,t){return e.map((function(e,a){return Object(n.jsx)(fe.a,Object(m.a)({variant:"outlined",label:Nt(e)},t({index:a})),"chip-".concat(a))}))},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{variant:"outlined",label:ot("selects:selects-autocompletes.recommendation-select")}))}})})})]}),Object(n.jsx)(W.a,{}),Object(n.jsxs)(ye.a,{container:!0,spacing:1,justify:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:"auto",children:Object(n.jsx)(x.a,{disableElevation:!0,type:"submit",color:"primary",variant:"contained",fullWidth:!0,children:ot("buttons:buttons.save")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:"auto",children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",onClick:function(){v(null),w(null),B.push(j)},fullWidth:!0,children:ot("buttons:buttons.cancel")})})]})]})})}),Object(n.jsxs)(O.a,{open:qe,onClose:At,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(S.buttonForm),onClick:At,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:(null===l||void 0===l?void 0:l.img_template)?null===l||void 0===l?void 0:l.img_template[(null===l||void 0===l?void 0:l.page)-1]:(null===l||void 0===l?void 0:l.img_prev)?null===l||void 0===l?void 0:l.img_prev[(null===l||void 0===l?void 0:l.page)-1]:null,className:S.img})})]}),Object(n.jsx)(_t,{loading:R}),Object(n.jsx)(O.a,{open:Ge,fullScreen:!0,TransitionComponent:cs,children:Object(n.jsx)(rs,{setOpenDesignCertificate:Qe})}),Object(n.jsxs)(O.a,{open:Ze,onClose:Et,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{autoFocus:!0,required:!0,multiline:!0,id:"nombre",label:ot("dialogs:dialog.skill"),variant:"outlined",onChange:function(e){return nt(Object(m.a)(Object(m.a)({},at),{},{value:e.target.value}))},defaultValue:at.value})})}),Object(n.jsxs)(Ae.a,{center:!0,children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(S.buttonDialog),onClick:function(){var e;null===l||void 0===l||null===(e=l.skills)||void 0===e||e.splice(at.index,1,at.value),$e(!1)},children:ot("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(S.buttonDialog),onClick:Et,children:ot("buttons:buttons.cancel")})]})]})]})}));var ds={color:"#ffffff",float:"right"},us=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"2em"},img_verificado:{display:"inline-block",height:e.spacing(5),margin:"auto"},img:{maxWidth:"-webkit-fill-available"},textBolder:{marginTop:"1em",color:"#000000",fontWeight:"bold"},textTitle:{color:"#000000",fontWeight:"bold",marginLeft:"2em"},textName:{color:"#000000",fontWeight:"bold"},textNameOrganization:Object(b.a)({color:"#000000",fontWeight:"bold",marginLeft:"4em"},e.breakpoints.up("sm"),{color:"#000000",fontWeight:"bold",marginLeft:"1em"}),text:{color:"#000000"},textParagraph:{textAlign:"justify",color:"#000000",margin:"1em 0 1em 0"},link:{color:E.a.primary,marginLeft:"2em",textDecoration:"underline"},linkOrganization:Object(b.a)({color:E.a.primary,marginLeft:"4em",textDecoration:"underline"},e.breakpoints.up("sm"),{color:E.a.primary,marginLeft:"1em",textDecoration:"underline"}),button:{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",marginTop:"1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}},grid:{backgroundColor:E.a.footer,marginBottom:"1em"},skeleton:{marginLeft:"auto",marginRight:"auto"},card:{borderRadius:"10px",borderColor:"#ffffff",backgroundColor:"white",paddingBottom:2,marginTop:"1em"},img_user:{width:e.spacing(10),height:e.spacing(10)},img_org:{width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},cardContent:{padding:"0"},textBolderDate:{marginTop:"2em",color:"#000000",fontWeight:"bold"},menuItem:{borderRadius:10,padding:10,cursor:"pointer",backgroundColor:E.a.primary},textMenuItem:{color:"#ffffff",fontWeight:"bold"},expandeMenuItem:{color:"#ffffff",float:"right"},descriptions:{justifyContent:"center",borderRadius:10,backgroundColor:"#fafafa",marginBottom:10,textAlign:"center"},content_descriptions:{margin:"1em"},footer:{justifyContent:"center",marginTop:10,padding:10,backgroundColor:"#fafafa",textAlign:"center"},certificate:Object(b.a)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(190px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}},e.breakpoints.up("sm"),{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(323px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}})}})),ms={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},bs=Object(s.b)((function(e){return{user:e.user,styles:e.styles}}),null)((function(e){var t,a,r,c,o,s,l,u,b,p,j,x=e.certificateId,O=e.setOpenDialog,v=e.openDialogCertificate,_=e.setRecommendation,y=e.styles,w=us(),C=Object(i.useState)(!1),k=Object(d.a)(C,2),N=k[0],B=k[1],S=Object(i.useState)({}),T=Object(d.a)(S,2),A=T[0],E=T[1],I=Object(i.useState)({}),z=Object(d.a)(I,2),P=z[0],R=z[1],M=Object(i.useState)({}),L=Object(d.a)(M,2),F=L[0],U=L[1],W=Object(i.useState)({}),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],K=Object(i.useState)([]),V=Object(d.a)(K,2),G=V[0],Q=V[1],J=Object(i.useState)([]),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)([]),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ie=Object(i.useState)(!1),re=Object(d.a)(ie,2),oe=re[0],se=re[1],le=Object(i.useState)(!1),de=Object(d.a)(le,2),ue=de[0],me=de[1],be=Object(i.useState)(!1),pe=Object(d.a)(be,2),je=pe[0],fe=pe[1],he=Object(i.useState)(!1),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ke=Object(i.useState)(!1),Se=Object(d.a)(ke,2),Te=Se[0],Ae=Se[1],Ee="",De=Object(D.a)(["certificateBadgeTemplate","buttons"]),ze=Object(d.a)(De,1)[0];Object(i.useEffect)((function(){Pe().catch((function(){e.history.push("/500"),window.location.reload()}))}),[]);var Pe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,Re();case 3:B(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Re=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o,s,l,d,u,m;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),d=Object(Ie.a)(x),e.next=4,Ce.a.get("/certificateTemplate/getCertificateTemplate/".concat(d));case 4:u=e.sent,m=u.data,E(m.certificateTemplate),Le(null===(t=m.certificateTemplate)||void 0===t||null===(a=t.certificateTemplate)||void 0===a?void 0:a.tiempo_vp),Me(null===(n=m.certificateTemplate)||void 0===n||null===(i=n.certificateTemplate)||void 0===i?void 0:i.nivel_vp),Fe(null===(r=m.certificateTemplate)||void 0===r||null===(c=r.certificateTemplate)||void 0===c?void 0:c.costo_vp),Q(null===(o=m.certificateTemplate)||void 0===o?void 0:o.skillsTemplate),$(null===(s=m.certificateTemplate)||void 0===s?void 0:s.criterion),ne(null===(l=m.certificateTemplate)||void 0===l?void 0:l.recommendations),B(!1);case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:a=e.sent,n=a.data,i=n.levels.filter((function(e){return e.id===t})),R(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Le=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:a=e.sent,n=a.data,i=n.time.filter((function(e){return e.id===t})),U(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Fe=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:a=e.sent,n=a.data,i=n.costs.filter((function(e){return e.id===t})),H(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return q||P||F||(Ee="No hay atributos"),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{closeButton:x&&!0,handleClose:function(){O(!1)}}),Object(n.jsx)(ye.a,{container:!0,className:w.grid,children:Object(n.jsx)(ye.a,{item:!0,xs:12,className:"text-center",children:N?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:500,className:w.skeleton}):Object(n.jsx)("img",{src:A.linkPhoto,alt:"certificate-img",className:w.img})})}),Object(n.jsx)(Rt.a,{className:w.container,maxWidth:"lg",children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{container:!0,justify:"space-between",alignItems:"center",children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:7,lg:7,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:w.textName,children:N?Object(n.jsx)(Be.a,{variant:"h3"}):Object(n.jsxs)(n.Fragment,{children:[null===(t=A.certificateTemplate)||void 0===t?void 0:t.nombre,Object(n.jsx)("img",{alt:"img_verificado",src:y.icon_verificado,className:w.img_verificado})]})})})}),Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:N?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:100,className:w.root}):Object(n.jsx)(we.a,{className:w.textParagraph,gutterBottom:!0,children:null===(a=A.certificateTemplate)||void 0===a?void 0:a.descripcion})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:1,lg:1,children:Object(n.jsx)(we.a,{className:w.textBolderDate,children:N?Object(n.jsx)(Be.a,{}):"".concat(ze("certificateBadgeTemplate:details.created"),":")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:9,lg:10,children:Object(n.jsx)(ve.a,{variant:"outlined",className:w.card,children:Object(n.jsx)(_e.a,{className:w.cardContent,children:Object(n.jsxs)(ye.a,{container:!0,justify:"flex-end",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:1,children:N?Object(n.jsx)(Be.a,{variant:"circle",className:w.img_user}):Object(n.jsx)(g.a,{variant:"square","aria-label":"img_certificate",src:A.linkPhotoOrganization,className:w.img_org})}),Object(n.jsxs)(ye.a,{item:!0,xs:11,children:[Object(n.jsx)(we.a,{className:w.textNameOrganization,children:N?Object(n.jsx)(Be.a,{variant:"text",width:250}):null===(r=A.certificateTemplate)||void 0===r||null===(c=r.organizaciones)||void 0===c?void 0:c.nombre}),N?Object(n.jsx)(Be.a,{variant:"text",width:150,className:w.linkOrganization}):Object(n.jsx)(Mt.a,{className:w.linkOrganization,href:"/organization/".concat(null===(o=A.certificateTemplate)||void 0===o||null===(s=o.organizaciones)||void 0===s?void 0:s.url_perfil),target:"_blank",children:ze("certificateBadgeTemplate:details.more-information")})]})]})})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:2,lg:1,className:"text-center",children:[Object(n.jsx)(we.a,{className:w.textBolderDate,children:N?Object(n.jsx)(Be.a,{}):"".concat(ze("certificateBadgeTemplate:details.date-create"),":")}),Object(n.jsx)(we.a,{className:w.text,children:N?Object(n.jsx)(Be.a,{}):Ne()(null===(l=A.certificateTemplate)||void 0===l?void 0:l.fecha_creacion).format("DD-MM-YYYY")})]}),N?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:w.root}):Z.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:w.menuItem,justify:"space-between",onClick:function(){return se(!oe)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:w.textMenuItem,children:ze("certificateBadgeTemplate:details.requirements")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:oe?Object(n.jsx)(Wt.a,{sx:ds}):Object(n.jsx)(Yt.a,{sx:ds})})]}),Object(n.jsx)(ye.a,{container:!0,className:w.descriptions,children:Object(n.jsx)(ce.a,{in:oe,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:w.content_descriptions,children:Z.map((function(e,t){return null===e.link||""===e.link?Object(n.jsx)(we.a,{className:w.text,children:e.descripcion_criterio},"criteria".concat(t)):Object(n.jsx)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:w.link,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))}))})})}),N?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:w.root}):0===Ee.length&&Object(n.jsxs)(ye.a,{container:!0,className:w.menuItem,justify:"space-between",onClick:function(){return me(!ue)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:w.textMenuItem,children:ze("certificateBadgeTemplate:details.attributes")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:ue?Object(n.jsx)(Wt.a,{sx:ds}):Object(n.jsx)(Yt.a,{sx:ds})})]}),Object(n.jsx)(ye.a,{container:!0,className:w.descriptions,children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:Object(n.jsx)(ce.a,{in:ue,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:w.content_descriptions,children:Object(n.jsxs)(ye.a,{container:!0,justify:"space-evenly",spacing:2,align:"center",children:[void 0!==P&&Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:w.textName,children:null===P||void 0===P?void 0:P.valor_parametro}),Object(n.jsx)(we.a,{children:P?ze("certificateBadgeTemplate:details.level"):""})]}),null!==(null===A||void 0===A||null===(u=A.certificateTemplate)||void 0===u?void 0:u.cantidad_tiempo)&&void 0!==(null===F||void 0===F?void 0:F.valor_parametro)?Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:w.textName,children:"".concat(null===A||void 0===A||null===(b=A.certificateTemplate)||void 0===b?void 0:b.cantidad_tiempo," ").concat(F.valor_parametro)}),Object(n.jsx)(we.a,{children:ze("certificateBadgeTemplate:details.time")})]}):"",void 0!==q&&Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:w.textName,children:null===q||void 0===q?void 0:q.valor_parametro}),Object(n.jsx)(we.a,{children:q?ze("certificateBadgeTemplate:details.cost"):""})]})]})})})})}),N?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:w.root}):G.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:w.menuItem,justify:"space-between",onClick:function(){return fe(!je)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:w.textMenuItem,children:ze("certificateBadgeTemplate:details.skills")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:je?Object(n.jsx)(Wt.a,{sx:ds}):Object(n.jsx)(Yt.a,{sx:ds})})]}),Object(n.jsx)(ye.a,{container:!0,className:w.descriptions,children:Object(n.jsx)(ce.a,{in:je,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:w.content_descriptions,children:G.map((function(e,t){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},ms),{},{children:Object(n.jsx)(we.a,{className:"text-left",children:e.habilidades.descripcion})}))},"skill".concat(t))}))})})}),N?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:w.root}):ae.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:w.menuItem,justify:"space-between",onClick:function(){return Oe(!xe)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:w.textMenuItem,children:ze("certificateBadgeTemplate:details.recommendations")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:xe?Object(n.jsx)(Wt.a,{sx:ds}):Object(n.jsx)(Yt.a,{sx:ds})})]}),ae.length>0&&Object(n.jsx)(ye.a,{container:!0,className:w.descriptions,children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:Object(n.jsx)(ce.a,{in:xe,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,className:w.content_descriptions,children:Object(n.jsx)(ye.a,{container:!0,justify:"flex-start",spacing:2,children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:Object(n.jsx)("div",{className:w.certificate,children:ae.map((function(e){var t,a,i,r;return Object(n.jsx)(zt,{publicCertificate:!0,templateCertificate:!0,certificateImage:null===e||void 0===e?void 0:e.linkPhotoCertificate,certificateName:null===e||void 0===e||null===(t=e.plantillasCertificadosRecomendadas)||void 0===t?void 0:t.nombre,organizationName:null===e||void 0===e||null===(a=e.plantillasCertificadosRecomendadas)||void 0===a||null===(i=a.organizaciones)||void 0===i?void 0:i.nombre,issuedId:Object(Ie.b)(null===e||void 0===e||null===(r=e.plantillasCertificadosRecomendadas)||void 0===r?void 0:r.id),openDialogCertificate:v,open:O,setRecommendation:_})}))})})})})})})}),N?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:w.root}):(null===(p=A.certificateTemplate)||void 0===p?void 0:p.url)&&Object(n.jsxs)(ye.a,{container:!0,className:w.menuItem,justify:"space-between",onClick:function(){return Ae(!Te)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsxs)(we.a,{className:w.textMenuItem,children:[ze("certificateBadgeTemplate:details.additional"),Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:Te?Object(n.jsx)(Wt.a,{sx:ds}):Object(n.jsx)(Yt.a,{sx:ds})})]}),Object(n.jsx)(ye.a,{container:!0,className:w.descriptions,children:Object(n.jsx)(ce.a,{in:Te,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:w.content_descriptions,children:Object(n.jsxs)(Mt.a,{href:null===(j=A.certificateTemplate)||void 0===j?void 0:j.url,target:"_blank",rel:"noreferrer",className:w.link,children:[ze("certificateBadgeTemplate:details.additional"),Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})})})})]})]})}),Object(n.jsx)(ye.a,{container:!0,className:w.footer,children:Object(n.jsxs)(ye.a,{item:!0,lg:12,children:[Object(n.jsx)("span",{className:w.textParagraph,children:ze("certificateBadgeTemplate:details.right-reserved")}),Object(n.jsx)("p",{className:w.textName,children:y.organizationName}),Object(n.jsx)("span",{className:w.textParagraph,children:Ne()().format("YYYY")})]})})]})}));var ps={color:"#ffffff",float:"right"},js=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"1em"},img_verificado:{display:"inline-block",height:e.spacing(5),margin:"auto"},img:{maxWidth:"-webkit-fill-available"},textBolder:{marginTop:"1em",color:"#000000",fontWeight:"bold",display:"inline"},textTitle:{color:"#000000",fontWeight:"bold",marginLeft:"2em"},textName:{color:"#000000",fontWeight:"bold"},textNameOrganization:{color:"#000000",fontWeight:"bold",marginLeft:"4em"},text:{color:"#000000"},textParagraph:{textAlign:"justify",color:"#000000",margin:"1em 0 1em 0"},link:{color:E.a.primary,marginLeft:"2em",textDecoration:"underline"},linkOrganization:{color:E.a.primary,marginLeft:"4em",textDecoration:"underline"},button:Object(b.a)({display:"block",textAlign:"center",backgroundColor:E.a.primary,marginBottom:"1em",borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}},e.breakpoints.up("sm"),{display:"inline",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",marginTop:"1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}}),buttonVerificate:Object(b.a)({display:"block",textAlign:"center",marginBottom:"1em",backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}},e.breakpoints.up("sm"),{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".4em 1em",cursor:"pointer",textTransform:"uppercase","&:hover":{backgroundColor:E.a.secondary}}),containerButtonToCopy:Object(b.a)({borderColor:E.a.primary,marginTop:"1em",marginBottom:"1em",padding:".4em 3em",maxWidth:"-webkit-fill-available"},e.breakpoints.up("sm"),{borderColor:E.a.primary,margin:"1em",padding:".4em 1em"}),PdfIcon:{width:"30px",height:"30px",color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},PdfIconImage:{height:"45px"},grid:{backgroundColor:E.a.footer,marginBottom:"1em"},skeleton:{marginLeft:"auto",marginRight:"auto"},card:{borderRadius:"10px",borderColor:"#ffffff",backgroundColor:"white",paddingBottom:2,marginTop:"1.5em"},img_user:{width:e.spacing(10),height:e.spacing(10)},img_org:{width:e.spacing(10),height:e.spacing(10),"& img":{height:"min-content"}},cardContent:{padding:"0"},textBolderDate:{marginTop:"2.7em",color:"#000000",fontWeight:"bold",marginLeft:".4em"},menuItem:{borderRadius:10,padding:10,marginBottom:10,cursor:"pointer",backgroundColor:E.a.primary},textMenuItem:{color:"#ffffff",fontWeight:"bold"},expandeMenuItem:{color:"#ffffff",float:"right"},descriptions:{justifyContent:"center",borderRadius:10,backgroundColor:"#fafafa",textAlign:"center"},content_descriptions:{margin:"1em"},descriptions_fields:{justifyContent:"left",borderRadius:10,backgroundColor:"#fafafa",textAlign:"center"},content_descriptions_fields:{margin:"1em",whiteSpace:"pre-line",textAlign:"left",justifyContent:"left"},footer:{justifyContent:"center",marginTop:10,padding:10,backgroundColor:"#fafafa",textAlign:"center"},linkAdicional:{float:"right",marginRight:"5em"},container_text_chip_right:Object(b.a)({textAlign:"center"},e.breakpoints.up("lg"),{textAlign:"right"}),container_text_chip_left:Object(b.a)({textAlign:"center"},e.breakpoints.up("lg"),{textAlign:"left"}),container_redes:Object(b.a)({marginBottom:"1em",marginLeft:"19em"},e.breakpoints.down("sm"),{marginBottom:"1em",marginLeft:"-0em"})}})),fs={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},hs=function(e){var t,a,r,c,o,s,l,u,b,p,j,x,O,v,_,y,w,C,k,N,B,T,A,I,z,P,R,M,L,U,W,Y,q,H,K,V,G,Q,J,X,Z,$,ee,te,ae,ne,ie,re,oe,se,le,de,ue,me,be,pe,je,he,ge,xe,Oe,ke,Se,Te,Ae=js(),Ee=Object(i.useState)({}),De=Object(d.a)(Ee,2),ze=De[0],Pe=De[1],Re=Object(i.useState)({}),Me=Object(d.a)(Re,2),Le=Me[0],Fe=Me[1],Ue=Object(i.useState)({}),We=Object(d.a)(Ue,2),Ye=We[0],qe=We[1],He=Object(i.useState)({}),Ke=Object(d.a)(He,2),Ve=Ke[0],Ge=Ke[1],Qe=Object(i.useState)([]),Je=Object(d.a)(Qe,2),Xe=Je[0],Ze=Je[1],$e=Object(i.useState)([]),et=Object(d.a)($e,2),tt=et[0],at=et[1],nt=Object(i.useState)([]),it=Object(d.a)(nt,2),rt=it[0],ct=it[1],ot=Object(i.useState)(!1),st=Object(d.a)(ot,2),lt=st[0],dt=st[1],ut=Object(i.useState)([!1,""]),mt=Object(d.a)(ut,2),bt=mt[0],pt=mt[1],jt=Object(i.useState)(""),ft=Object(d.a)(jt,2),ht=ft[0],gt=ft[1],xt=Object(i.useState)(!1),Ot=Object(d.a)(xt,2),vt=Ot[0],_t=Ot[1],yt=Object(i.useState)(!1),wt=Object(d.a)(yt,2),Ct=wt[0],kt=wt[1],Nt=Object(i.useState)(!1),Bt=Object(d.a)(Nt,2),St=Bt[0],Tt=Bt[1],Et=Object(i.useState)(!1),It=Object(d.a)(Et,2),Dt=It[0],zt=It[1],Ft=Object(i.useState)(!1),Ut=Object(d.a)(Ft,2),Kt=Ut[0],ea=Ut[1],ta=Object(i.useState)(""),aa=Object(d.a)(ta,2),na=aa[0],ia=aa[1],oa="",sa=null===(t=JSON.parse(window.localStorage.state))||void 0===t?void 0:t.styles,la="en"===(null===(a=window.localStorage.state)||void 0===a||null===(r=a.split('"lenguage":"')[1])||void 0===r?void 0:r.slice(0,2)),da=Object(D.a)(["certificateBadgeTemplate","buttons"]),ua=Object(d.a)(da,1)[0];Object(i.useEffect)((function(){ia(sa.icon_verificado),ma().catch((function(){e.history.push("/500"),window.location.reload()}))}),[]);var ma=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u,m,b,p,j,h,g,x,O,v,_,y,w,C,k;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return dt(!0),w=Object(Ie.a)(e.match.params.certificateId),t.next=4,Ce.a.get("/certificatesIssued/certificates/".concat(w));case 4:C=t.sent,k=C.data,Pe(null===k||void 0===k?void 0:k.issued),ba(null===k||void 0===k||null===(a=k.issued)||void 0===a||null===(n=a.certificate)||void 0===n?void 0:n.plantillasCertificados.nivel_vp),pa(null===k||void 0===k||null===(i=k.issued)||void 0===i||null===(r=i.certificate)||void 0===r?void 0:r.plantillasCertificados.tiempo_vp),ja(null===k||void 0===k||null===(c=k.issued)||void 0===c||null===(o=c.certificate)||void 0===o?void 0:o.plantillasCertificados.costo_vp),Ze(null===k||void 0===k||null===(s=k.issued)||void 0===s||null===(l=s.certificate)||void 0===l||null===(d=l.plantillasCertificados)||void 0===d?void 0:d.plantillasHabilidades),at(null===k||void 0===k||null===(u=k.issued)||void 0===u||null===(m=u.certificate)||void 0===m||null===(b=m.plantillasCertificados)||void 0===b?void 0:b.criterios),ct(null===k||void 0===k||null===(p=k.issued)||void 0===p||null===(j=p.certificate)||void 0===j||null===(h=j.plantillasCertificados)||void 0===h?void 0:h.certificadoCamposAdicionales),0===(null===k||void 0===k||null===(g=k.issued)||void 0===g||null===(x=g.certificate)||void 0===x?void 0:x.estado)?gt("Revoked"):null!==(null===k||void 0===k||null===(O=k.issued)||void 0===O||null===(v=O.certificate)||void 0===v?void 0:v.fecha_expiracion)&&Object(Vt.a)(new Date(null===k||void 0===k||null===(_=k.issued)||void 0===_||null===(y=_.certificate)||void 0===y?void 0:y.fecha_expiracion),new Date)?gt("Expired"):gt("Verified"),dt(!1);case 15:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ba=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:a=e.sent,n=a.data,i=n.levels.filter((function(e){return e.id===t})),Fe(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pa=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:a=e.sent,n=a.data,i=n.time.filter((function(e){return e.id===t})),qe(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ja=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:a=e.sent,n=a.data,i=n.costs.filter((function(e){return e.id===t})),Ge(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Ve||Le||Ye||(oa="No hay atributos"),!0===bt[0]&&F.a.fire({customClass:{container:Ae.mySwal,confirmButton:"custom-button-confirm"},icon:"success",iconColor:E.a.primary,buttonsStyling:!1,title:ua("certificateBadgeTemplate:details.copied"),text:"".concat(bt[1]," ").concat(ua("certificateBadgeTemplate:details.copied-certificate"))}).then((function(){pt(!1,"")})),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsx)(ye.a,{container:!0,className:Ae.grid,children:Object(n.jsx)(ye.a,{item:!0,xs:12,className:"text-center",children:lt?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:500,className:Ae.skeleton}):Object(n.jsx)(ra,{pdf:null===ze||void 0===ze?void 0:ze.pdfCertificate,img:2===(null===ze||void 0===ze||null===(c=ze.certificate)||void 0===c?void 0:c.estado)&&(null===(o=ze.certificate)||void 0===o?void 0:o.certificados.length)>0?null===ze||void 0===ze?void 0:ze.resizingPhotoCertificate:null===ze||void 0===ze?void 0:ze.photoCertificate})})}),Object(n.jsx)(Rt.a,{className:Ae.container,maxWidth:"lg",children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{container:!0,justify:"space-between",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,md:7,lg:7,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:Ae.textName,children:lt?Object(n.jsx)(Be.a,{variant:"h3"}):Object(n.jsxs)(n.Fragment,{children:[null===(s=ze.certificate)||void 0===s||null===(l=s.plantillasCertificados)||void 0===l?void 0:l.nombre,la?Object(n.jsx)("img",{alt:"img_verificado",src:"Verified"===ht?Jt:"Revoked"===ht?Xt:Zt,className:Ae.img_verificado}):Object(n.jsx)("img",{alt:"img_verificado",src:"Verified"===ht?na:"Revoked"===ht?Gt:Qt,className:Ae.img_verificado})]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:1,className:Ae.container_redes,children:lt?Object(n.jsx)(Be.a,{variant:"circle",width:40,height:40,display:"inline"}):Object(n.jsx)(n.Fragment,{children:Object(n.jsx)("a",{href:ze.pdfCertificate,download:ze.pdfCertificate,children:Object(n.jsx)(S.a,{className:Ae.PdfIcon,children:Object(n.jsx)("img",{src:$t,alt:"pdf",className:Ae.PdfIconImage})})})})}),2===(null===ze||void 0===ze||null===(u=ze.certificate)||void 0===u?void 0:u.estado)&&(null===(b=ze.certificate)||void 0===b?void 0:b.certificados.length)>0?Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:1,children:lt?Object(n.jsx)(Be.a,{variant:"rect",height:30}):Object(n.jsx)(Mt.a,{href:"/certificate/verify/".concat(e.match.params.certificateId),target:"_blank",underline:"none",variant:"inherit",className:Ae.buttonVerificate,children:ua("buttons:buttons.verify")})}):""]}),Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,className:Ae.container_text_chip_left,children:[Object(n.jsx)(we.a,{className:Ae.textBolder,children:lt?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:33}):"".concat(ua("certificateBadgeTemplate:details.certificate-link"),":")}),!lt&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(fe.a,{variant:"outlined",label:"".concat(window.location.origin,"/certificate/").concat(e.match.params.certificateId),color:"default",className:Ae.containerButtonToCopy}),Object(n.jsx)(Pt.CopyToClipboard,{text:"".concat(window.location.origin,"/certificate/").concat(e.match.params.certificateId),onCopy:function(){return pt([!0,"Link"])},className:Ae.button,children:Object(n.jsx)("span",{children:ua("certificateBadgeTemplate:details.copy")})})]})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,className:Ae.container_text_chip_right,children:[Object(n.jsx)(we.a,{className:Ae.textBolder,children:lt?Object(n.jsx)(Be.a,{variant:"rect",width:500,height:33}):"".concat(ua("certificateBadgeTemplate:details.certificate-code"),":")}),!lt&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(fe.a,{variant:"outlined",label:null===(p=ze.certificate)||void 0===p?void 0:p.codigo_certificado,color:"default",className:Ae.containerButtonToCopy}),Object(n.jsx)(Pt.CopyToClipboard,{text:null===(j=ze.certificate)||void 0===j?void 0:j.codigo_certificado,onCopy:function(){return pt([!0,"C\xf3digo"])},className:Ae.button,children:Object(n.jsx)("span",{children:ua("certificateBadgeTemplate:details.copy")})})]})]})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:lt?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:100,className:Ae.root}):Object(n.jsx)(we.a,{className:Ae.textParagraph,gutterBottom:!0,children:null===(x=ze.certificate)||void 0===x||null===(O=x.plantillasCertificados)||void 0===O?void 0:O.descripcion})}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:5,lg:5,children:2===(null===ze||void 0===ze||null===(v=ze.certificate)||void 0===v?void 0:v.estado)&&(null===(_=ze.certificate)||void 0===_?void 0:_.certificados.length)>0?Object(n.jsx)(ve.a,{variant:"outlined",className:Ae.card,children:Object(n.jsx)(_e.a,{className:Ae.cardContent,children:Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,lg:2,children:lt?Object(n.jsx)(Be.a,{variant:"circle",className:Ae.img_user}):(null===(y=ze.certificate)||void 0===y||null===(w=y.certificados[0])||void 0===w||null===(C=w.cuentas)||void 0===C||null===(k=C.usuarios)||void 0===k?void 0:k.primer_nombre)&&Object(n.jsx)(g.a,{"aria-label":"img_certificate",src:ze.photoUser,className:Ae.img_user})}),Object(n.jsxs)(ye.a,{item:!0,lg:10,children:[Object(n.jsx)(we.a,{className:Ae.textTitle,children:lt?Object(n.jsx)(Be.a,{variant:"text",width:250}):(null===(N=ze.certificate)||void 0===N||null===(B=N.certificados[0])||void 0===B||null===(T=B.cuentas)||void 0===T||null===(A=T.usuarios)||void 0===A?void 0:A.primer_nombre)&&"".concat(null===(I=ze.certificate)||void 0===I||null===(z=I.certificados[0])||void 0===z||null===(P=z.cuentas)||void 0===P||null===(R=P.usuarios)||void 0===R?void 0:R.primer_nombre," ").concat((null===(M=ze.certificate)||void 0===M||null===(L=M.certificados[0])||void 0===L||null===(U=L.cuentas)||void 0===U||null===(W=U.usuarios)||void 0===W?void 0:W.segundo_nombre)||""," ").concat(null===(Y=ze.certificate)||void 0===Y||null===(q=Y.certificados[0])||void 0===q||null===(H=q.cuentas)||void 0===H||null===(K=H.usuarios)||void 0===K?void 0:K.primer_apellido," ").concat((null===(V=ze.certificate)||void 0===V||null===(G=V.certificados[0])||void 0===G||null===(Q=G.cuentas)||void 0===Q||null===(J=Q.usuarios)||void 0===J?void 0:J.segundo_apellido)||"")}),lt?Object(n.jsx)(Be.a,{variant:"text",width:150,className:Ae.link}):(null===(X=ze.certificate)||void 0===X||null===(Z=X.certificados[0])||void 0===Z||null===($=Z.cuentas)||void 0===$||null===(ee=$.usuarios)||void 0===ee?void 0:ee.url_perfil)&&Object(n.jsxs)(Mt.a,{href:"/dashboard/".concat(null===(te=ze.certificate)||void 0===te||null===(ae=te.certificados[0])||void 0===ae||null===(ne=ae.cuentas)||void 0===ne||null===(ie=ne.usuarios)||void 0===ie?void 0:ie.url_perfil),target:"_blank",rel:"noreferrer",className:Ae.link,children:[ua("certificateBadgeTemplate:details.credencials"),Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]})]})})}):""}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:2,lg:2,children:[Object(n.jsx)(we.a,{className:Ae.textBolderDate,children:lt?Object(n.jsx)(Be.a,{}):"".concat(ua("certificateBadgeTemplate:details.issued"),":")}),Object(n.jsx)(we.a,{className:Ae.text,children:lt?Object(n.jsx)(Be.a,{}):Ne()(null===(re=ze.certificate)||void 0===re?void 0:re.fecha_emision).format("DD-MM-YYYY")})]}),(null===ze||void 0===ze||null===(oe=ze.certificate)||void 0===oe?void 0:oe.fecha_expiracion)&&Object(n.jsxs)(ye.a,{item:!0,xs:12,md:2,lg:2,children:[Object(n.jsx)(we.a,{className:Ae.textBolderDate,children:lt?Object(n.jsx)(Be.a,{}):"".concat(ua("certificateBadgeTemplate:details.expiration"),":")}),Object(n.jsx)(we.a,{className:Ae.text,children:lt?Object(n.jsx)(Be.a,{}):Ne()(null===(se=ze.certificate)||void 0===se?void 0:se.fecha_expiracion).format("DD-MM-YYYY")})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:3,lg:3,children:Object(n.jsx)(ve.a,{variant:"outlined",className:Ae.card,children:Object(n.jsx)(_e.a,{className:Ae.cardContent,children:Object(n.jsxs)(ye.a,{container:!0,justify:"flex-end",alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:1,children:lt?Object(n.jsx)(Be.a,{variant:"circle",className:Ae.img_user}):Object(n.jsx)(g.a,{variant:"square","aria-label":"img_certificate",src:ze.photoOrganization,className:Ae.img_org})}),Object(n.jsxs)(ye.a,{item:!0,xs:11,children:[Object(n.jsx)(we.a,{className:Ae.textNameOrganization,children:lt?Object(n.jsx)(Be.a,{variant:"text",width:250}):null===(le=ze.certificate)||void 0===le||null===(de=le.plantillasCertificados)||void 0===de||null===(ue=de.organizaciones)||void 0===ue?void 0:ue.nombre}),lt?Object(n.jsx)(Be.a,{variant:"text",width:150,className:Ae.linkOrganization}):Object(n.jsx)(Mt.a,{className:Ae.linkOrganization,href:"/organization/".concat(null===(me=ze.certificate)||void 0===me||null===(be=me.plantillasCertificados)||void 0===be||null===(pe=be.organizaciones)||void 0===pe?void 0:pe.url_perfil),target:"_blank",children:ua("certificateBadgeTemplate:details.more-information")})]})]})})})}),lt?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:Ae.root}):tt.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:Ae.menuItem,justify:"space-between",onClick:function(){return _t(!vt)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:Ae.textMenuItem,children:ua("certificateBadgeTemplate:details.requirements")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:vt?Object(n.jsx)(Wt.a,{sx:ps}):Object(n.jsx)(Yt.a,{sx:ps})})]}),Object(n.jsx)(ye.a,{container:!0,className:Ae.descriptions,children:Object(n.jsx)(ce.a,{in:vt,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:Ae.content_descriptions,children:tt.map((function(e,t){return null===e.link||""===e.link?Object(n.jsx)(we.a,{className:Ae.text,children:e.descripcion_criterio},"criteria".concat(t)):Object(n.jsx)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:Ae.link,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))}))})})}),lt?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:Ae.root}):0===oa.length&&Object(n.jsxs)(ye.a,{container:!0,className:Ae.menuItem,justify:"space-between",onClick:function(){return kt(!Ct)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:Ae.textMenuItem,children:ua("certificateBadgeTemplate:details.attributes")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:Ct?Object(n.jsx)(Wt.a,{sx:ps}):Object(n.jsx)(Yt.a,{sx:ps})})]}),Object(n.jsx)(ye.a,{container:!0,className:Ae.descriptions,children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:Object(n.jsx)(ce.a,{in:Ct,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:Ae.content_descriptions,children:Object(n.jsxs)(ye.a,{container:!0,justify:"space-evenly",spacing:2,align:"center",children:[void 0!==Le&&Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:Ae.textName,children:la?Le.valor_parametro_en:Le.valor_parametro}),Object(n.jsx)(we.a,{children:Le?ua("certificateBadgeTemplate:details.level"):""})]}),null!==(null===(je=ze.certificate)||void 0===je||null===(he=je.plantillasCertificados)||void 0===he?void 0:he.cantidad_tiempo)&&void 0!==(null===Ye||void 0===Ye?void 0:Ye.valor_parametro)?Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:Ae.textName,children:"".concat(null===(ge=ze.certificate)||void 0===ge||null===(xe=ge.plantillasCertificados)||void 0===xe?void 0:xe.cantidad_tiempo,"  ").concat(la?Ye.valor_parametro_en:Ye.valor_parametro)}),Object(n.jsx)(we.a,{children:ua("certificateBadgeTemplate:details.time")})]}):"",void 0!==Ve&&Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,lg:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:Ae.textName,children:la?Ve.valor_parametro_en:Ve.valor_parametro}),Object(n.jsx)(we.a,{children:Ve?ua("certificateBadgeTemplate:details.cost"):""})]})]})})})})}),lt?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:Ae.root}):Xe.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:Ae.menuItem,justify:"space-between",onClick:function(){return zt(!Dt)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:Ae.textMenuItem,children:ua("certificateBadgeTemplate:details.skills")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:Dt?Object(n.jsx)(Wt.a,{sx:ps}):Object(n.jsx)(Yt.a,{sx:ps})})]}),Object(n.jsx)(ye.a,{container:!0,className:Ae.descriptions,children:Object(n.jsx)(ce.a,{in:Dt,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:Ae.content_descriptions,children:Xe.map((function(e,t){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},fs),{},{children:Object(n.jsx)(we.a,{className:"text-left",children:e.habilidades.descripcion})}))},"skill".concat(t))}))})})}),lt?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:Ae.root}):rt.length>0&&rt.map((function(e,t){return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(ye.a,{container:!0,className:Ae.menuItem,justify:"space-between",onClick:function(){return Tt(!St&&t+1)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:Ae.textMenuItem,children:e.titulo_campo},"field-title".concat(t))}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:St===t+1?Object(n.jsx)(Wt.a,{sx:ps}):Object(n.jsx)(Yt.a,{sx:ps})})]}),Object(n.jsx)(ye.a,{container:!0,className:Ae.descriptions_fields,children:Object(n.jsx)(ce.a,{in:St===t+1,timeout:"auto",children:Object(n.jsxs)(ye.a,{item:!0,lg:12,className:Ae.content_descriptions_fields,children:[Object(n.jsx)(we.a,{className:Ae.text,children:e.descripcion_campo.includes("-")?ca(e.descripcion_campo):e.descripcion_campo},"field-description".concat(t)),e.link&&Object(n.jsxs)(Mt.a,{href:e.link,target:"_blank",rel:"noreferrer",className:Ae.link,children:[ua("details.additional")," ",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]})})})]})})),lt?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:Ae.root}):(null===(Oe=ze.certificate)||void 0===Oe||null===(ke=Oe.plantillasCertificados)||void 0===ke?void 0:ke.url)&&Object(n.jsxs)(ye.a,{container:!0,className:Ae.menuItem,justify:"space-between",onClick:function(){return ea(!Kt)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsxs)(we.a,{className:Ae.textMenuItem,children:[ua("certificateBadgeTemplate:details.additional"),Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:Kt?Object(n.jsx)(Wt.a,{sx:ps}):Object(n.jsx)(Yt.a,{sx:ps})})]}),Object(n.jsx)(ye.a,{container:!0,className:Ae.descriptions,children:Object(n.jsx)(ce.a,{in:Kt,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:Ae.content_descriptions,children:Object(n.jsxs)(Mt.a,{href:null===(Se=ze.certificate)||void 0===Se||null===(Te=Se.plantillasCertificados)||void 0===Te?void 0:Te.url,target:"_blank",rel:"noreferrer",className:Ae.link,children:[ua("certificateBadgeTemplate:details.additional"),Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})})})})]})]})}),Object(n.jsx)(ye.a,{container:!0,className:Ae.footer,children:Object(n.jsxs)(ye.a,{item:!0,lg:12,children:[Object(n.jsx)("span",{className:Ae.textParagraph,children:ua("certificateBadgeTemplate:details.right-reserved")}),Object(n.jsx)("p",{className:Ae.textName,children:sa.organizationName}),Object(n.jsx)("span",{className:Ae.textParagraph,children:Ne()().format("YYYY")})]})})]})},gs=Object(C.a)((function(e){return{root:{marginTop:"2em"},card:{minWidth:275},img:Object(b.a)({width:e.spacing(40)},e.breakpoints.up("sm"),{width:"auto"}),button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}}}}));var xs=function(e){var t=gs(),a=Object(u.g)(),r=Object(i.useState)(""),c=Object(d.a)(r,2),o=c[0],s=c[1],l=Object(i.useState)(!1),m=Object(d.a)(l,2),b=m[0],p=m[1],j=Object(i.useState)(!1),f=Object(d.a)(j,2),h=f[0],g=f[1],O=Object(i.useState)(""),v=Object(d.a)(O,2),_=v[0],y=v[1];return Object(i.useEffect)((function(){var t,n=null===(t=JSON.parse(window.localStorage.state))||void 0===t?void 0:t.styles;y(n.logo435x149),p(!0);var i=Object(Ie.a)(e.match.params.certificateId);Ce.a.get("/certificatesIssued/reject/".concat(i)).then((function(e){p(!1),s(e.data.message),g(e.data.account)})).catch((function(){a.push("/500"),window.location.reload()}))}),[]),Object(n.jsx)("div",{className:"App",children:Object(n.jsxs)("div",{className:"App-header",children:[Object(n.jsx)(ve.a,{className:t.card,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)("img",{src:_,alt:"logo",className:t.img}),Object(n.jsx)(we.a,{children:o}),Object(n.jsx)("form",{className:t.root,onSubmit:function(t){var n=e.match.params.certificateId;h?a.push("/sign-in"):a.push("/sign-up/".concat(n,"/reject"))},children:Object(n.jsx)("div",{className:"text-center ".concat(t.root),children:Object(n.jsx)(x.a,{variant:"contained",size:"small",className:"my-2 ".concat(t.button),type:"submit",children:h?"Iniciar sesi\xf3n":"Registrarme"})})})]})}),Object(n.jsx)(_t,{loading:b})]})})},Os=Object(C.a)((function(){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var vs={setForm:I.w,setCertificateFields:I.p,setReturnRoute:I.C},_s=Object(s.b)((function(e){return{permission:(e.permission||[]).filter((function(e){var t,a;return"carnets"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),vs)((function(e){var t=e.children,a=e.Index,i=e.permission,r=e.setForm,c=e.setCertificateFields,o=e.setReturnRoute,s=Os(),l=Object(u.g)(),m=Object(u.h)(),b=Object(D.a)(["tabs","buttons"]),p=Object(d.a)(b,1)[0],j=p("tabs:tabs.tabs-carnets",{returnObjects:!0});return Object(n.jsxs)(n.Fragment,{children:[i.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:s.button,onClick:function(){o(m.pathname),r(null),c(null),l.push("/carnets/create")},children:Object(n.jsx)("span",{children:p("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),function(){if(i.includes("Leer"))return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Rr,{Index:a,TabsHeader:j}),t]});l.push("/dashboard"),window.location.reload()}()]})}));var ys=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"},buttonForm:{margin:"0.5em",padding:"9px 40px"},img_vertical:{maxWidth:"30vw",height:"auto"},img_horizontal:{maxWidth:"70vw",height:"auto"},iconButton:{margin:"0em -.4em"}}})),ws={changeBreadcrump:I.a,changePage:I.b,setReturnRoute:I.C},Cs=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"carnets"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),ws)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.permission,b=e.changePage,j=e.setReturnRoute,y=e.searchValue,w=Object(u.g)(),C=ys(),k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)([]),z=Object(d.a)(A,2),P=z[0],R=z[1],M=Object(i.useState)(P),L=Object(d.a)(M,2),U=L[0],W=L[1],Y=Object(i.useState)(""),q=Object(d.a)(Y,2),H=q[0],V=q[1],G=Object(i.useState)(""),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(i.useState)(!1),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ne=Object(i.useState)(!1),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)(""),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)({}),me=Object(d.a)(ue,2),be=me[0],pe=me[1],je=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),fe=Object(d.a)(je,1)[0],he=Object(i.useState)(),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1];Object(i.useEffect)((function(){b(0),ve().catch((function(){w.push("/500"),window.location.reload()})),c(fe("breadCrumps:breadCrumps.carnets-published",{returnObjects:!0}))}),[]);var ve=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T(!0),y&&""!==y){e.next=4;break}return e.next=4,Be();case 4:T(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_e=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,ye=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,we=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),ke=function(e,t){var a={limit:t||10,offset:e?e*t:0};return _e||(a.id_organizaciones=s),(ye||we)&&(a.id_usuarios=o.data_user.id),a},Be=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=ke(0,r),e.next=4,Ce.a.post("/carnetTemplate/getCarnetTemplatesPublished",t);case 4:a=e.sent,n=a.data,R(n.carnetTemplates.rows),W(n.carnetTemplates.rows),Oe(n.carnetTemplates.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),w.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),i=ke(t,a),e.next=4,Ce.a.post("/carnetTemplate/getCarnetTemplatesPublished",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(P),Object(p.a)(null===(n=c.carnetTemplates.rows)||void 0===n?void 0:n.rows.filter((function(e){return!P.find((function(t){return t.id===e.id}))})))),R(o),W(o),T(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Te=function(e,t,a){switch(a){case"copy":Ee(e,t);break;case"edit":j("/carnets/published"),w.push("/carnets/edit/".concat(Object(Ie.b)(t)));break;case"archive":De(t);break;case"delete":ze(t)}},Ee=function(e,t){F.a.fire({text:fe("alerts:alerts.copy-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:fe("buttons:buttons.accept"),cancelButtonText:fe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&Pe(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},De=function(e){F.a.fire({text:fe("alerts:alerts.archive-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:fe("buttons:buttons.accept"),cancelButtonText:fe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Re(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ze=function(e){F.a.fire({text:fe("alerts:alerts.delete-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:fe("buttons:buttons.accept"),cancelButtonText:fe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Me(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Pe=function(e,t){var a,n,i,r,c;t.preventDefault(),T(!0);var l=null===P||void 0===P?void 0:P.filter((function(t){return t.id===e})),d=Object(m.a)(Object(m.a)({},l[0]),{},{copy:!0,nombre:"".concat(null===(a=l[0])||void 0===a?void 0:a.nombre," copia"),nombre_privado:"".concat(null===(n=l[0])||void 0===n?void 0:n.nombre_privado," copia"),id_usuarios:null===(i=o.data_user)||void 0===i?void 0:i.id,id_organizaciones:s,carnetFields:null===(r=l[0])||void 0===r?void 0:r.carnetCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,align:e.align||"center",img:e.img?e.img:null,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseInt(e.x),y:parseInt(e.y),width:e.width,height:e.height}})),camposAdicionales:null===(c=l[0])||void 0===c?void 0:c.carnetCamposAdicionales.map((function(e){return{nombre_campo:e.nombre_campo,privacidad_vp:e.privacidad_vp}}))});Ce.a.post("/carnetTemplate",d).then((function(e){T(!1),w.push("/carnets/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:fe("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){T(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:fe("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500})}))},Re=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/carnetTemplate/updateState/".concat(t),{estado:2,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){w.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:fe("alerts:alerts.archived"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){w.push("/carnets/archived")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Me=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/carnetTemplate/".concat(t),{data:{id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id}}).catch((function(){w.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:fe("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){ve()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Le=function(e,t){if(l.includes("Editar")){var a=!1;return(ye||we)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:fe("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"edit",onClick:function(t){return Te(t,e,"edit")},className:C.iconButton,children:Object(n.jsx)(Wn,{})})})}},Fe=function(e,t){if(l.includes("Archivar")){var a=!1;return(ye||we)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:fe("tables:table.tooltip.archive"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"archive",onClick:function(t){return Te(t,e,"archive")},className:C.iconButton,children:Object(n.jsx)(Er.a,{})})})}},Ue=function(e,t){if(l.includes("Eliminar")){var a=!1;return(ye||we)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:fe("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"delete",onClick:function(t){return Te(t,e,"delete")},className:C.iconButton,children:Object(n.jsx)(Cn.a,{})})})}},We=function(){return fe(_e?"tables:table.columns-carnet-published-archived-super":"tables:table.columns-carnet-published-archived",{returnObjects:!0})},Ye=function(e){if(_e)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})},qe=function(e,t){if(l.includes("Copiar")){var a=!1;return(ye||we)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:fe("tables:table.tooltip.copy"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"copy",onClick:function(t){return Te(t,e,"copy")},className:C.iconButton,children:Object(n.jsx)(Ar.a,{})})})}},He=function(){te(!1),de("")},Ke=function(){ce(!1)};return Object(n.jsxs)(_s,{Index:0,children:[Object(n.jsx)(Fn,{tableName:"templateCarnets",type:"published",items:P,setItems:W,setCountItems:Oe,changePage:b,loadData:ve,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:ye,isDeparmentCreaterRoll:we,userId:o.data_user.id},setLoading:T}),Object(n.jsx)(zn,{columns:We(),rows:xe,setDirection:V,setOrderBy:X,loading:B,changePagination:Se,children:Object(n.jsx)(vn.a,{children:U.length>0?B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:We(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(U,Object(I.f)(H,J)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:fe("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:C.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,de({photo:t,width:a,height:n}),void te(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),Ye(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.carnetsEmitidos}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado?fe("tables:table.state.published"):" "}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:fe("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return w.push("/carnets/details/".concat(Object(Ie.b)(e.id)))},className:C.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Le(e.id,e.plantillasCarnetsHistorial[0].id_usuarios)}),Object(n.jsx)(yn.a,{align:"center",children:qe(e.id,e.plantillasCarnetsHistorial[0].id_usuarios)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:fe("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{disabled:!0,"aria-label":"detalles",onClick:function(t){return function(e){var t=null===P||void 0===P?void 0:P.find((function(t){return t.id===e}));pe(Object(m.a)({},t)),ce(!0)}(e.id)},className:C.iconButton,children:Object(n.jsx)(Ir.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:e.carnetsEmitidos>0?Fe(e.id,e.plantillasCarnetsHistorial[0].id_usuarios):Ue(e.id,e.plantillasCarnetsHistorial[0].id_usuarios)})]},e.id)}))}):B?Object(n.jsx)(qn,{columns:We(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:fe("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:ee,onClose:He,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.btnClose),onClick:He,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:le.photo,className:le.width>le.height?C.img_horizontal:C.img_vertical})})]}),Object(n.jsxs)(O.a,{open:re,onClose:Ke,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:Ke,children:fe("dialogs:dialog.preview-title-template-certificate")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:be})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),onClick:Ke,children:fe("buttons:buttons.close")})})]})]})}));var ks=function(e){var t=e.children,a=e.Index,i=e.Buttons,r=e.carnetId,c=Object(D.a)("tabs"),o=(0,Object(d.a)(c,1)[0])("tabs.tabs-details",{returnObjects:!0}),s=[{label:"Detalle",route:"/carnets/details/".concat(Object(Ie.b)(r))},{label:"Historial",route:"/carnets/history/".concat(Object(Ie.b)(r))}];return s.map((function(e,t){return o.filter((function(a,n){return t===n?e.label=a.label:""}))})),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:i}),Object(n.jsx)(Rr,{Index:a,TabsHeader:s}),t]})};var Ns={color:"#ffffff",float:"right"},Bs=Object(C.a)((function(e){return{root:{marginTop:"2em",marginBottom:"2em"},icon:{margin:20,fontSize:"4em"},avatar:{width:"auto",height:"auto","&:hover":{cursor:"pointer"}},img:function(e){var t,a;return{maxWidth:"70vw",height:null===(t=e.carnetTemplate)||void 0===t||null===(a=t.carnetTemplate)||void 0===a?void 0:a.height}},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},descriptions:{justifyContent:"center",borderRadius:10,backgroundColor:"#fafafa",marginBottom:10,textAlign:"center"},content_descriptions:{margin:"1em"},textMenuItem:{color:"#ffffff",fontWeight:"bold"},menuItem:{marginTop:10,borderRadius:10,padding:10,cursor:"pointer",backgroundColor:E.a.primary},expandeMenuItem:{color:"#ffffff",float:"right"},text:{color:"#5c5c5c"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 30px","&:hover":{backgroundColor:E.a.footer}},buttonForm:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"}}})),Ss={changeBreadcrump:I.a,setReturnRoute:I.C},Ts=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"carnets"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Ss)((function(e){var t,a,r,c,o,s=e.user,l=e.changeBreadcrump,b=e.permission,p=e.setReturnRoute,j=Object(u.g)(),y=Object(i.useState)(!1),w=Object(d.a)(y,2),C=w[0],k=w[1],N=Object(i.useState)(!1),B=Object(d.a)(N,2),S=B[0],T=B[1],A=Object(i.useState)([]),I=Object(d.a)(A,2),z=I[0],P=I[1],R=Object(i.useState)([]),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)({}),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],V=Object(i.useState)(!1),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)(!1),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)(!1),ne=Object(d.a)(te,2),ie=ne[0],re=ne[1],oe=Object(i.useState)(!1),se=Object(d.a)(oe,2),le=se[0],de=se[1],me=Object(i.useState)(!1),be=Object(d.a)(me,2),pe=be[0],je=be[1],fe=Object(i.useState)({}),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Bs({carnetTemplate:q}),ke=Object(i.useState)({}),Se=Object(d.a)(ke,2),Te=Se[0],Ee=Se[1],De=Object(D.a)(["certificateBadgeTemplate","tables","alerts","buttons","breadCrumps"]),ze=Object(d.a)(De,1)[0];Object(i.useEffect)((function(){Pe()}),[]);var Pe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k(!0),e.next=3,Re();case 3:k(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Re=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,l,d,u,b,p,h,g,x,O,v,_,y,w,C,k,N;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,O=Object(Ie.a)(e.match.params.id),v=6===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,_=6===(null===(a=s.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===a?void 0:a.rol),t.next=6,Ce.a.get("/carnetTemplate/".concat(O));case 6:y=t.sent,w=y.data,H(w.carnetTemplate),P(null===(n=w.carnetTemplate)||void 0===n?void 0:n.fieldsAdditionals.filter((function(e){return 50===e.privacidad_vp}))),U(null===(i=w.carnetTemplate)||void 0===i?void 0:i.fieldsAdditionals.filter((function(e){return 49===e.privacidad_vp}))),Me(null===(r=w.carnetTemplate)||void 0===r||null===(c=r.carnetTemplate)||void 0===c?void 0:c.estado),xe(Object(m.a)(Object(m.a)({},null===(o=w.carnetTemplate)||void 0===o?void 0:o.carnetTemplate),{},{copy:!0,nombre:"".concat(null===(l=w.carnetTemplate)||void 0===l||null===(d=l.carnetTemplate)||void 0===d?void 0:d.nombre," copia"),nombre_privado:"".concat(null===(u=w.carnetTemplate)||void 0===u||null===(b=u.carnetTemplate)||void 0===b?void 0:b.nombre_privado," copia"),id_usuarios:null===(p=s.data_user)||void 0===p?void 0:p.id,carnetFields:null===(h=w.carnetTemplate)||void 0===h||null===(g=h.carnetTemplate)||void 0===g?void 0:g.carnetCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,align:e.align||"center",img:e.img?e.img:null,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseInt(e.x),y:parseInt(e.y),width:e.width,height:e.height}})),camposAdicionales:null===(x=w.carnetTemplate)||void 0===x?void 0:x.fieldsAdditionals.map((function(e){return{nombre_campo:e.nombre_campo,privacidad_vp:e.privacidad_vp}}))})),(v||_)&&((null===(C=w.carnetTemplate)||void 0===C||null===(k=C.templatesCarnetsHistory)||void 0===k?void 0:k.filter((function(e){return 34===parseInt(e.accion)}))[0].id_usuarios)===(null===(N=s.data_user)||void 0===N?void 0:N.id)?je(!1):je(!0)),t.next=19;break;case 16:t.prev=16,t.t0=t.catch(0),j.push("/500");case 19:case"end":return t.stop()}}),t,null,[[0,16]])})));return function(){return t.apply(this,arguments)}}(),Me=function(e){l(ze(1===e?"breadCrumps:breadCrumps.carnet-details-published":0===e?"breadCrumps:breadCrumps.carnet-details-edited":"breadCrumps:breadCrumps.carnet-details-archived",{returnObjects:!0}))},Le=function(e,t,a){switch(a){case"archive":Fe(t);break;case"publish":Ue(t);break;case"delete":We(t)}},Fe=function(e){F.a.fire({text:ze("alerts:alerts.archive-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&qe(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Ue=function(e){F.a.fire({text:ze("alerts:alerts.publish-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Ye(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},We=function(e){F.a.fire({text:ze("alerts:alerts.delete-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&He(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Ye=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.put("/carnetTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=s.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()});case 3:n=e.sent,n.data&&F.a.fire({text:ze("alerts:alerts.published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){j.push("/carnets/published")})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),j.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),qe=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.put("/carnetTemplate/updateState/".concat(t),{estado:2,id_usuarios:null===(a=s.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()});case 3:n=e.sent,n.data&&F.a.fire({text:ze("alerts:alerts.archived"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){j.push("/carnets/archived")})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),j.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),He=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/carnetTemplate/".concat(t),{data:{id_usuarios:null===(a=s.data_user)||void 0===a?void 0:a.id}});case 3:n=e.sent,n.data&&(0===q.carnetTemplate.estado?F.a.fire({text:ze("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){j.push("/carnets/edited")})):F.a.fire({text:ze("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){j.push("/carnets/published")}))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),j.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),Ke=function(){p("/carnets/details/".concat(e.match.params.id)),j.push("/carnets/edit/".concat(Object(Ie.b)(q.carnetTemplate.id)))},Ve=function(e,t){F.a.fire({text:ze("alerts:alerts.copy-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&Ge(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},Ge=function(e,t){t.preventDefault(),T(!0),Ce.a.post("/carnetTemplate",e).then((function(e){T(!1),j.push("/carnets/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:ze("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){T(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:ze("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500})}))},Qe=function(){Ee(Object(m.a)(Object(m.a)({},null===q||void 0===q?void 0:q.carnetTemplate),{},{linkPhotoTemplate:null===q||void 0===q?void 0:q.linkPhotoTemplate,photoOrganization:null===q||void 0===q?void 0:q.linkPhotoOrganization})),ee(!0)},Je=function(){ee(!1)},Xe=function(){J(!1)};return Object(n.jsxs)(ks,{Index:0,Buttons:function(){var e,t,a;return 0===(null===(e=q.carnetTemplate)||void 0===e?void 0:e.estado)?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{disabled:!0,className:Oe.button,onClick:function(e){return Qe()},children:Object(n.jsx)(Ir.a,{})})})}),b.includes("Publicar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.publish"),children:Object(n.jsx)(x.a,{className:Oe.button,onClick:function(e){var t;return Le(e,null===(t=q.carnetTemplate)||void 0===t?void 0:t.id,"publish")},children:Object(n.jsx)(ci.a,{})})})}),b.includes("Editar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.edit"),children:Object(n.jsx)(x.a,{className:Oe.button,onClick:Ke,children:Object(n.jsx)(Wn,{})})})}),b.includes("Copiar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.copy"),children:Object(n.jsx)(x.a,{disabled:pe,className:Oe.button,onClick:function(e){return Ve(e,ge)},children:Object(n.jsx)(Ar.a,{})})})}),b.includes("Eliminar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.delete"),children:Object(n.jsx)(x.a,{className:Oe.button,onClick:function(e){var t;return Le(e,null===(t=q.carnetTemplate)||void 0===t?void 0:t.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]}):1===(null===(t=q.carnetTemplate)||void 0===t?void 0:t.estado)?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{disabled:!0,className:Oe.button,onClick:function(e){return Qe()},children:Object(n.jsx)(Ir.a,{})})})}),b.includes("Editar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.edit"),children:Object(n.jsx)(x.a,{disabled:pe,className:Oe.button,onClick:Ke,children:Object(n.jsx)(Wn,{})})})}),b.includes("Copiar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.copy"),children:Object(n.jsx)(x.a,{disabled:pe,className:Oe.button,onClick:function(e){return Ve(e,ge)},children:Object(n.jsx)(Ar.a,{})})})}),b.includes("Archivar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.archive"),children:Object(n.jsx)(x.a,{disabled:pe,className:Oe.button,onClick:function(e){var t;return Le(e,null===(t=q.carnetTemplate)||void 0===t?void 0:t.id,"archive")},children:Object(n.jsx)(Er.a,{})})})}),b.includes("Eliminar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.delete"),children:Object(n.jsx)(x.a,{disabled:pe,className:Oe.button,onClick:function(e){var t;return Le(e,null===(t=q.carnetTemplate)||void 0===t?void 0:t.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]})}):2===(null===(a=q.carnetTemplate)||void 0===a?void 0:a.estado)?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{disabled:!0,className:Oe.button,onClick:function(e){return Qe()},children:Object(n.jsx)(Ir.a,{})})})}),b.includes("Publicar")&&Object(n.jsx)(ye.a,{item:!0,lg:2,md:2,xs:5,children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.publish"),children:Object(n.jsx)(x.a,{className:Oe.button,onClick:function(e){var t;return Le(e,null===(t=q.carnetTemplate)||void 0===t?void 0:t.id,"publish")},children:Object(n.jsx)(ci.a,{})})})})]}):void 0}(),carnetId:Object(Ie.a)(e.match.params.id),children:[Object(n.jsx)(ve.a,{children:Object(n.jsx)(_e.a,{className:Oe.root,maxWidth:"lg",children:Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:5,md:5,xs:12,children:Object(n.jsx)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:C?Object(n.jsx)(Be.a,{variant:"circle",children:Object(n.jsx)(g.a,{className:Oe.avatar})}):Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"img-prev",src:q.linkPhotoTemplate?q.linkPhotoTemplate:q.linkPhoto,variant:"square",className:Oe.avatar,onClick:function(){return J(!0)},children:Object(n.jsx)(ue.a,{sx:{margin:4,fontSize:"3em"}})})})})}),Object(n.jsxs)(ye.a,{item:!0,lg:7,md:7,xs:12,children:[Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:Oe.textTitle,children:C?Object(n.jsx)(Be.a,{}):"".concat(null===(t=q.carnetTemplate)||void 0===t?void 0:t.nombre)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{variant:"h6",gutterBottom:!0,className:Oe.textTitle,children:C?Object(n.jsx)(Be.a,{}):"".concat(null===(a=q.carnetTemplate)||void 0===a?void 0:a.nombre_privado)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:C?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Oe.textBolder,children:[ze("certificateBadgeTemplate:details.issued-by"),": "]}),Object(n.jsx)("span",{className:Oe.text,children:null===(r=q.carnetTemplate)||void 0===r||null===(c=r.organizaciones)||void 0===c?void 0:c.nombre})]})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:C?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Oe.textBolder,children:[ze("certificateBadgeTemplate:details.created"),": "]}),Object(n.jsx)("span",{className:Oe.text,children:Ne()(null===(o=q.carnetTemplate)||void 0===o?void 0:o.fecha_creacion).format("DD-MM-YYYY")})]})})]}),C?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:Oe.root}):L.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:Oe.menuItem,justify:"space-between",onClick:function(){return de(!le)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:Oe.textMenuItem,children:ze("certificateBadgeTemplate:details.fields-publics")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:le?Object(n.jsx)(Wt.a,{sx:Ns}):Object(n.jsx)(Yt.a,{sx:Ns})})]}),Object(n.jsx)(ye.a,{container:!0,className:Oe.descriptions,children:Object(n.jsx)(ce.a,{in:le,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:Oe.content_descriptions,children:L.map((function(e,t){return Object(n.jsx)(we.a,{className:Oe.text,children:e.nombre_campo},"fieldsAdditionals".concat(t))}))})})}),C?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:50,className:Oe.root}):z.length>0&&Object(n.jsxs)(ye.a,{container:!0,className:Oe.menuItem,justify:"space-between",onClick:function(){return re(!ie)},children:[Object(n.jsx)(ye.a,{item:!0,lg:11,children:Object(n.jsx)(we.a,{className:Oe.textMenuItem,children:ze("certificateBadgeTemplate:details.fields-privates")})}),Object(n.jsx)(ye.a,{item:!0,lg:1,children:ie?Object(n.jsx)(Wt.a,{sx:Ns}):Object(n.jsx)(Yt.a,{sx:Ns})})]}),Object(n.jsx)(ye.a,{container:!0,className:Oe.descriptions,children:Object(n.jsx)(ce.a,{in:ie,timeout:"auto",children:Object(n.jsx)(ye.a,{item:!0,lg:12,className:Oe.content_descriptions,children:z.map((function(e,t){return Object(n.jsx)(we.a,{className:Oe.text,children:e.nombre_campo},"fieldsAdditionals".concat(t))}))})})})]})]})})}),Object(n.jsxs)(O.a,{open:Q,onClose:Xe,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(Oe.buttonForm),onClick:Xe,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:q.linkPhotoTemplate?q.linkPhotoTemplate:q.linkPhoto,className:Oe.img})})]}),Object(n.jsxs)(O.a,{open:$,onClose:Je,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:Je,children:ze("dialogs:dialog.preview-title-template-certificate")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:Te})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(Oe.buttonForm),onClick:Je,children:ze("buttons:buttons.close")})})]}),Object(n.jsx)(_t,{loading:S})]})}));var As=Object(C.a)((function(){return{root:{display:"flex",alignItems:"center",border:"2.8px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",marginTop:"1rem"}}})),Es={changeBreadcrump:I.a},Is=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage}}),Es)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=As(),o=Object(i.useState)(!1),s=Object(d.a)(o,2),l=s[0],u=s[1],m=Object(i.useState)(!1),b=Object(d.a)(m,2),p=b[0],j=b[1],g=Object(i.useState)(!1),x=Object(d.a)(g,2),y=x[0],w=x[1],C=Object(i.useState)([]),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)([]),A=Object(d.a)(T,2),E=A[0],z=A[1],P=Object(i.useState)([{descripcion:"",valor:"",nuevoValor:"",tipo:"",recomendacion:""}]),R=Object(d.a)(P,2),M=R[0],L=R[1],F=Object(i.useState)(""),U=Object(d.a)(F,2),W=U[0],Y=U[1],q=Object(i.useState)(""),H=Object(d.a)(q,2),V=H[0],G=H[1],Q=Object(i.useState)({}),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(D.a)(["tables","breadCrumps","dialogs"]),ee=Object(d.a)($,1)[0];Object(i.useEffect)((function(){te()}),[]);var te=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,u(!0),t.next=4,ne();case 4:return t.next=6,ae();case 6:return u(!1),t.next=9,Ce.a.post("/carnetTemplate/getCarnetTemplates",{estado:1});case 9:a=t.sent,n=a.data,B(n.carnetTemplates),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(0),e.history.push("/500");case 17:case"end":return t.stop()}}),t,null,[[0,14]])})));return function(){return t.apply(this,arguments)}}(),ae=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/parameterValueParameter/getParameterValueParameter");case 2:t=e.sent,a=t.data,z(a.parametersValueParameters);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/carnetTemplateHistory/getCarnetTemplatesHistory",{id_plantillas_carnets:i});case 3:r=t.sent,c=r.data,Z(c.carnetTemplatesHistory),ie(null===(a=c.carnetTemplatesHistory[0])||void 0===a||null===(n=a.plantillasCarnets)||void 0===n?void 0:n.estado);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ie=function(e){r(ee(1===e?"breadCrumps:breadCrumps.carnet-history-published":0===e?"breadCrumps:breadCrumps.carnet-history-edited":"breadCrumps:breadCrumps.carnet-history-archived",{returnObjects:!0}))},re=function(e){X.map(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.id===e&&(""!==a.nuevoValor?L([{descripcion:"Creaci\xf3n",valor:N.filter((function(e){return e.id===parseInt(a.nuevoValor)}))}]):L([{descripcion:"Creaci\xf3n",valor:""}]));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),w(!0)},ce=function(e){var t=0,a="";return E.map((function(n){n.id===parseInt(e)&&(t=1,a=n.valor_parametro)})),0===t?e:a},oe=ee("tables:table.columns-history",{returnObjects:!0});return Object(n.jsxs)(ks,{Index:2,carnetId:Object(Ie.a)(e.match.params.id),children:[Object(n.jsx)(ve.a,{children:Object(n.jsx)(zn,{columns:oe,rows:X,setDirection:Y,setOrderBy:G,loading:l,children:l?Object(n.jsx)(qn,{columns:oe,photo:0}):Object(n.jsx)(vn.a,{children:X.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(X,Object(I.f)(W,V)).slice(t*a,t*a+a).map((function(e){var t,a;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(t=e.usuarios)||void 0===t?void 0:t.primer_nombre," ").concat(null===(a=e.usuarios)||void 0===a?void 0:a.primer_apellido)}),Object(n.jsx)(yn.a,{align:"center",children:ce(e.accion)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:ee("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t="",a=[];X.map(function(){var n=Object(h.a)(f.a.mark((function n(i){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i.id===e&&(34===i.accion?re(e):36===i.accion||37===i.accion?(L([{descripcion:36===i.accion?"Publicado":"Archivado",valor:i.valor,nuevoValor:i.nuevoValor,tipo:"info"}]),j(!0)):(t=i.valor.split("\xbf?")).length>0&&(t.map(function(){var e=Object(h.a)(f.a.mark((function e(t,n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0!==n&&((t=t.split("$%&"))[0].includes("esta")?a.push({descripcion:t[0],valor:t[1],nuevoValor:t[2],tipo:"info",recomendacion:N.filter((function(e){return e.id===parseInt(t[1])}))}):a.push({descripcion:t[0],valor:t[1],nuevoValor:t[2],tipo:"info"}));case 1:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}()),L(a),j(!0)));case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())}(e.id)},children:Object(n.jsx)(Ge.a,{})})})})]},e.id)}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:ee("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:p,onClose:function(){j(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:ee("dialogs:dialog.details")}),Object(n.jsx)(_.a,{children:M.length>0?Object(n.jsx)(n.Fragment,{children:M.map((function(e){return Object(n.jsx)(ye.a,{container:!0,xs:12,className:c.root,children:Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(Qi.a,{severity:e.tipo,children:e.descripcion})})})}))}):""})]}),Object(n.jsxs)(O.a,{open:y,onClose:function(){w(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:ee("dialogs:dialog.details")}),M.length>0?Object(n.jsx)(n.Fragment,{children:M.map((function(e){return Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)(Qi.a,{severity:"info",children:e.descripcion})})}))}):Object(n.jsx)(yn.a,{align:"center",children:ee("tables:table.empty-table")})]})]})}));var Ds=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"},buttonForm:{margin:"0.5em",padding:"9px 40px"},img_vertical:{maxWidth:"30vw",height:"auto"},img_horizontal:{maxWidth:"70vw",height:"auto"},iconButton:{margin:"0em -.4em"}}})),zs={changeBreadcrump:I.a,changePage:I.b,setReturnRoute:I.C},Ps=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"carnets"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),zs)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.permission,b=e.changePage,j=e.setReturnRoute,y=e.searchValue,w=Object(u.g)(),C=Ds(),k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)([]),z=Object(d.a)(A,2),P=z[0],R=z[1],M=Object(i.useState)(P),L=Object(d.a)(M,2),U=L[0],W=L[1],Y=Object(i.useState)(""),q=Object(d.a)(Y,2),H=q[0],V=q[1],G=Object(i.useState)(""),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(i.useState)(!1),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ne=Object(i.useState)(!1),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)(""),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)({}),me=Object(d.a)(ue,2),be=me[0],pe=me[1],je=Object(i.useState)(),fe=Object(d.a)(je,2),he=fe[0],ge=fe[1],xe=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),Oe=Object(d.a)(xe,1)[0];Object(i.useEffect)((function(){b(0),ve().catch((function(){w.push("/500"),window.location.reload()})),c(Oe("breadCrumps:breadCrumps.carnets-edition",{returnObjects:!0}))}),[]);var ve=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T(!0),y&&""!==y){e.next=4;break}return e.next=4,Be();case 4:T(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_e=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,ye=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,we=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),ke=function(e,t){var a={limit:t||10,offset:e?e*t:0};return _e||(a.id_organizaciones=s),(ye||we)&&(a.id_usuarios=o.data_user.id),a},Be=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=ke(0,r),e.next=4,Ce.a.post("/carnetTemplate/getCarnetTemplatesEdited",t);case 4:a=e.sent,n=a.data,R(n.carnetTemplates.rows),W(n.carnetTemplates.rows),ge(n.carnetTemplates.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),w.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),i=ke(t,a),e.next=4,Ce.a.post("/carnetTemplate/getCarnetTemplatesEdited",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(P),Object(p.a)(null===(n=c.carnetTemplates.rows)||void 0===n?void 0:n.rows.filter((function(e){return!P.find((function(t){return t.id===e.id}))})))),R(o),W(o),T(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Te=function(e,t,a){switch(a){case"copy":Ee(e,t);break;case"edit":j("/carnets/edited"),w.push("/carnets/edit/".concat(Object(Ie.b)(t)));break;case"publish":De(t);break;case"delete":ze(t)}},Ee=function(e,t){F.a.fire({text:Oe("alerts:alerts.copy-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Oe("buttons:buttons.accept"),cancelButtonText:Oe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&Pe(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},De=function(e){F.a.fire({text:Oe("alerts:alerts.publish-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Oe("buttons:buttons.accept"),cancelButtonText:Oe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Re(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ze=function(e){F.a.fire({text:Oe("alerts:alerts.delete-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Oe("buttons:buttons.accept"),cancelButtonText:Oe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Me(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Pe=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,l,d,u,b;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.preventDefault(),T(!0),d=null===P||void 0===P?void 0:P.filter((function(e){return e.id===t})),u=Object(m.a)(Object(m.a)({},d[0]),{},{copy:!0,nombre:"".concat(null===(n=d[0])||void 0===n?void 0:n.nombre," copia"),nombre_privado:"".concat(null===(i=d[0])||void 0===i?void 0:i.nombre_privado," copia"),id_usuarios:null===(r=o.data_user)||void 0===r?void 0:r.id,id_organizaciones:s,carnetFields:null===(c=d[0])||void 0===c?void 0:c.carnetCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,align:e.align||"center",img:e.img?e.img:null,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseInt(e.x),y:parseInt(e.y),width:e.width,height:e.height}})),camposAdicionales:null===(l=d[0])||void 0===l?void 0:l.carnetCamposAdicionales.map((function(e){return{nombre_campo:e.nombre_campo,privacidad_vp:e.privacidad_vp}}))}),e.prev=4,e.next=7,Ce.a.post("/carnetTemplate",u);case 7:b=e.sent,b.data&&(T(!1),ve(),F.a.fire({icon:"success",iconColor:E.a.primary,text:Oe("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(4),T(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:Oe("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500});case 16:case"end":return e.stop()}}),e,null,[[4,12]])})));return function(t,a){return e.apply(this,arguments)}}(),Re=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/carnetTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){w.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:Oe("alerts:alerts.published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){w.push("/carnets/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Me=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/carnetTemplate/".concat(t),{data:{id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id}}).catch((function(){w.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:Oe("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){ve()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Le=function(e){if(l.includes("Editar"))return Object(n.jsx)(K.a,{title:Oe("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return Te(t,e,"edit")},className:C.iconButton,children:Object(n.jsx)(Wn,{})})})},Fe=function(e){if(l.includes("Publicar"))return Object(n.jsx)(K.a,{title:Oe("tables:table.tooltip.publish"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return Te(t,e,"publish")},className:C.iconButton,children:Object(n.jsx)(ci.a,{})})})},Ue=function(e){if(l.includes("Eliminar"))return Object(n.jsx)(K.a,{title:Oe("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return Te(t,e,"delete")},className:C.iconButton,children:Object(n.jsx)(Cn.a,{})})})},We=function(){return Oe(_e?"tables:table.columns-carnet-edited-super":"tables:table.columns-carnet-edited",{returnObjects:!0})},Ye=function(e){if(_e)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})},qe=function(e){if(l.includes("Copiar"))return Object(n.jsx)(K.a,{title:Oe("tables:table.tooltip.copy"),children:Object(n.jsx)(S.a,{"aria-label":"copy",onClick:function(t){return Te(t,e,"copy")},className:C.iconButton,children:Object(n.jsx)(Ar.a,{})})})},He=function(){te(!1),de("")},Ke=function(){ce(!1)};return Object(n.jsxs)(_s,{Index:1,children:[Object(n.jsx)(Fn,{tableName:"templateCarnets",type:"edited",items:P,setItems:W,setCountItems:ge,changePage:b,loadData:ve,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:ye,isDeparmentCreaterRoll:we,userId:o.data_user.id},setLoading:T}),Object(n.jsx)(zn,{columns:We(),rows:he,setDirection:V,setOrderBy:X,loading:B,changePagination:Se,children:Object(n.jsx)(vn.a,{children:U.length>0?B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:We(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(U,Object(I.f)(H,J)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:Oe("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:C.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,de({photo:t,width:a,height:n}),void te(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),Ye(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:0===e.estado?Oe("tables:table.state.edited"):""}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:Oe("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return w.push("/carnets/details/".concat(Object(Ie.b)(e.id)))},className:C.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Le(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:Fe(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:qe(e.id)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:Oe("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{disabled:!0,"aria-label":"detalles",onClick:function(t){return function(e){var t=null===P||void 0===P?void 0:P.find((function(t){return t.id===e}));pe(Object(m.a)({},t)),ce(!0)}(e.id)},className:C.iconButton,children:Object(n.jsx)(Ir.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Ue(e.id)})]},e.id)}))}):B?Object(n.jsx)(qn,{columns:We(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:Oe("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:ee,onClose:He,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.btnClose),onClick:He,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:le.photo,className:le.width>le.height?C.img_horizontal:C.img_vertical})})]}),Object(n.jsxs)(O.a,{open:re,onClose:Ke,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:Ke,children:Oe("dialogs:dialog.preview-title-template-certificate")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:be})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),onClick:Ke,children:Oe("buttons:buttons.close")})})]})]})}));var Rs=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"},buttonForm:{margin:"0.5em",padding:"9px 40px"},img_vertical:{maxWidth:"30vw",height:"auto"},img_horizontal:{maxWidth:"70vw",height:"auto"},iconButton:{margin:"0em -.4em"}}})),Ms={changeBreadcrump:I.a,changePage:I.b},Ls=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"carnets"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),Ms)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.changePage,b=e.permission,j=e.searchValue,y=Object(u.g)(),w=Rs(),C=Object(i.useState)(!1),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)([]),A=Object(d.a)(T,2),z=A[0],P=A[1],R=Object(i.useState)(z),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)(""),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],V=Object(i.useState)(""),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)(!1),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)(!1),ne=Object(d.a)(te,2),ie=ne[0],re=ne[1],ce=Object(i.useState)(""),oe=Object(d.a)(ce,2),se=oe[0],le=oe[1],de=Object(i.useState)({}),ue=Object(d.a)(de,2),me=ue[0],be=ue[1],pe=Object(i.useState)(),je=Object(d.a)(pe,2),fe=je[0],he=je[1],ge=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),xe=Object(d.a)(ge,1)[0];Object(i.useEffect)((function(){l(0),Oe().catch((function(){y.push("/500"),window.location.reload()})),c(xe("breadCrumps:breadCrumps.carnets-archived",{returnObjects:!0}))}),[]);var Oe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(B(!0),j&&""!==j){e.next=4;break}return e.next=4,ke();case 4:B(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ve=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,_e=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,ye=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),we=function(e,t){var a={limit:t||10,offset:e?e*t:0};return ve||(a.id_organizaciones=s),(_e||ye)&&(a.id_usuarios=o.data_user.id),a},ke=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=we(0,r),e.next=4,Ce.a.post("/carnetTemplate/getCarnetTemplatesArchived",t);case 4:a=e.sent,n=a.data,P(n.carnetTemplates.rows),U(n.carnetTemplates.rows),he(n.carnetTemplates.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),y.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Be=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),i=we(t,a),e.next=4,Ce.a.post("/carnetTemplate/getCarnetTemplatesArchived",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(z),Object(p.a)(null===(n=c.carnetTemplates.rows)||void 0===n?void 0:n.rows.filter((function(e){return!z.find((function(t){return t.id===e.id}))})))),P(o),U(o),B(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Se=function(e){if(b.includes("Publicar"))return Object(n.jsx)(K.a,{title:xe("tables:table.tooltip.publish"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return function(e,t,a){switch(a){case"publish":Te(t)}}(0,e,"publish")},className:w.iconButton,children:Object(n.jsx)(ci.a,{})})})},Te=function(e){F.a.fire({text:xe("alerts:alerts.publish-button-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:xe("buttons:buttons.accept"),cancelButtonText:xe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Ee(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Ee=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/carnetTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){y.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:xe("alerts:alerts.published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){y.push("/carnets/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),De=function(){return xe(ve?"tables:table.columns-carnet-published-archived-super":"tables:table.columns-carnet-published-archived",{returnObjects:!0})},ze=function(e){if(ve)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})},Pe=function(){re(!1)},Re=function(){ee(!1),le("")};return Object(n.jsxs)(_s,{Index:2,children:[Object(n.jsx)(Fn,{tableName:"templateCarnets",type:"archived",items:z,setItems:U,setCountItems:he,changePage:l,loadData:Oe,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:_e,isDeparmentCreaterRoll:ye,userId:o.data_user.id},setLoading:B}),Object(n.jsx)(zn,{columns:De(),rows:fe,setDirection:H,setOrderBy:J,loading:N,changePagination:Be,children:Object(n.jsx)(vn.a,{children:L.length>0?N?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:De(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(L,Object(I.f)(q,Q)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:xe("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:w.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,le({photo:t,width:a,height:n}),void ee(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),ze(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.carnetsEmitidos}),Object(n.jsx)(yn.a,{align:"center",children:2===e.estado?xe("tables:table.state.archived"):""}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:xe("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return y.push("/carnets/details/".concat(Object(Ie.b)(e.id)))},className:w.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Se(e.id)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:xe("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{disabled:!0,"aria-label":"detalles",onClick:function(t){return function(e){var t=null===z||void 0===z?void 0:z.find((function(t){return t.id===e}));be(Object(m.a)({},t)),re(!0)}(e.id)},className:w.iconButton,children:Object(n.jsx)(Ir.a,{})})})})]},e.id)}))}):N?Object(n.jsx)(qn,{columns:De(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:xe("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:$,onClose:Re,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(w.btnClose),onClick:Re,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:se.photo,className:se.width>se.height?w.img_horizontal:w.img_vertical})})]}),Object(n.jsxs)(O.a,{open:ie,onClose:Pe,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:Pe,children:xe("dialogs:dialog.preview-title-template-certificate")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:me})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(w.buttonForm),onClick:Pe,children:xe("buttons:buttons.close")})})]})]})}));var Fs=Object(C.a)((function(e){return{container:function(e){return{marginTop:32,backgroundImage:"url(".concat(e.imageRoute,")"),backgroundRepeat:"no-repeat",width:"fit-content",maxWidth:"68vw"}}}})),Us={setCertificateFields:I.p},Ws=Object(s.b)((function(e){return{certificateFields:e.certificateFields||[],imageRoute:e.form.img_prev,width:e.form.width,height:e.form.height}}),Us)((function(e){var t=e.imageRoute,a=e.width,r=e.height,c=e.modifyField,o=e.certificateFields,s=e.setCertificateFields,l=e.stageRef,u=e.selectedId,b=e.selectShape,p=e.isSelected,j=e.setIsSelected,f=Fs({imageRoute:t}),h=Object(i.useRef)(),g=Object(i.useRef)(),x=Object(i.useState)([]),O=Object(d.a)(x,2),v=O[0],_=O[1];Object(i.useEffect)((function(){p&&(null===v||void 0===v?void 0:v.index)?(h.current.setNode(v),h.current.getLayer().batchDraw()):p&&g&&(h.current.setNode(g.current),h.current.getLayer().batchDraw())}),[p]);var y=function(){var e=No()(t,"Anonymous"),a=Object(d.a)(e,1)[0];return Object(n.jsx)(Co.b,{image:a})};return Object(n.jsx)("div",{className:f.container,children:Object(n.jsx)(Co.f,{width:a,height:r,ref:l,onMouseDown:function(e){e.target.attrs.image&&(b(null),j(!1),_(null))},onMouseLeave:function(){b(null),j(!1),_(null)},children:Object(n.jsxs)(Co.c,{children:[Object(n.jsx)(y,{}),null===o||void 0===o?void 0:o.map((function(e,t){var i,l,d,f,x;return 48!==e.fieldType?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Co.g,{ref:g,text:"certificateCode"===e.fieldName?"".concat(e.exampleText).concat(""===e.exampleText?"":":","CK09aABbAz"):e.exampleText,x:e.x,y:e.y,width:e.width,height:parseInt(e.fontSize),align:e.align,ellipsis:!0,onClick:function(t){j(!1),_(t.target),b(e.exampleText),j(!0)},draggable:!0,dragBoundFunc:function(t,n){var i=t.x,c=t.y;return i<0&&(i=0),c<0&&(c=0),i>a-e.width&&(i=a-e.width),c>r-e.height&&(c=r-e.height),{x:i,y:c}},fill:null===(i=e.fontColor)||void 0===i?void 0:i.hex,fontStyle:"".concat((null===(l=e.fontStyle)||void 0===l?void 0:l.bold)?"bold":""," ").concat((null===(d=e.fontStyle)||void 0===d?void 0:d.italic)?"italic":""),textDecoration:"".concat((null===(f=e.fontStyle)||void 0===f?void 0:f.underline)?"underline":""," ").concat((null===(x=e.fontStyle)||void 0===x?void 0:x.strikethrough)?"line-through":""),fontSize:parseInt(e.fontSize),fontFamily:e.fontFamily.family,onDragEnd:function(e){return function(e,t){o[t]=Object(m.a)(Object(m.a)({},o[t]),{},{x:e.target.x(),y:e.target.y()}),j(!1),_(e.target),j(!0),s(o)}(e,t)},onDblClick:function(e){_(e.target),c(t)},onTransformEnd:function(a){var n=v,i=n.scaleX();n.scaleX(1),n.scaleY(1),n.width(Math.max(5,n.width()*i)),function(e,t){var a=o.slice();a[t]=e,s(a)}(Object(m.a)(Object(m.a)({},e),{},{width:Math.round(n.width())}),t)}},"field".concat(t+1)),p&&Object(n.jsx)(Co.h,{ref:h,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){if(t.width<=150)return e;var n=a;return t.width>=n?e:t}})]}):"buttonVerify"===e.fieldName?Object(n.jsx)(zo,{index:t,shapeProps:e,isSelected:e.exampleText===u,isDraggable:!0,onSelect:function(){j(!1),_(null),b(e.exampleText)},onChange:function(e){var a=o.slice();a[t]=e,s(a)},layoutWidth:a,layoutHeight:r,modifyField:c},t):Object(n.jsx)(Do,{shapeProps:e,index:t,isSelected:e.exampleText===u,isDraggable:!0,onSelect:function(){b(e.exampleText)},onChange:function(e){var a=o.slice();a[t]=e,s(a)},modifyField:c,layoutWidth:a,layoutHeight:r},t)}))]})})})}));var Ys=Object(C.a)((function(){return{container:{minHeight:"70vh"},container__header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:8,paddingBottom:8,"& h6":{marginLeft:10,fontWeight:"bold",color:"#888"}},container__header_button:{display:"flex",justifyContent:"center",alignItems:"center",width:40,height:40,border:"none",borderRadius:20,color:"white",backgroundColor:E.a.primary,marginRight:20,fontWeight:"bold",fontSize:"1.5em","&:hover":{backgroundColor:E.a.secondary}},container__fields:{}}})),qs={setCertificateFields:I.p},Hs=Object(s.b)((function(e){return{certificateFields:e.certificateFields||[]}}),qs)((function(e){var t=e.certificateFields,a=e.setCertificateFields,r=e.modifyField,c=e.openModal,o=Ys(),s=Object(i.useState)(!0),l=Object(d.a)(s,2),u=l[0],m=l[1],b=Object(i.useState)(!0),j=Object(d.a)(b,2),f=j[0],h=j[1],g=Object(i.useState)(!0),x=Object(d.a)(g,2),O=x[0],v=x[1],_=Object(i.useState)([{fieldType:48,fieldName:"qr",valida:t.find((function(e){return"qr"===e.fieldName}))?1:0},{fieldType:48,fieldName:"logo",valida:t.find((function(e){return"logo"===e.fieldName}))?1:0},{fieldType:41,fieldName:"certificateCode",valida:t.find((function(e){return"certificateCode"===e.fieldName}))?1:0},{fieldType:48,fieldName:"buttonVerify",valida:t.find((function(e){return"buttonVerify"===e.fieldName}))?1:0}]),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(D.a)(["certificateBadgeTemplate"]),N=Object(d.a)(k,1)[0],B=function(e){t.splice(e,1),a(Object(p.a)(t))},S=function(e,n){a(Object(p.a)(t.filter((function(t){return t.fieldName!==e})))),w[n].valida=0,C(w)},T=function(e){var n=so(),i=n.dataQr,r=n.dataImg,c=n.dataCode,o=n.dataButtonVerify;0===e?t.push(i):1===e?t.push(r):-1===e?(e=2,t.push(c)):-3===e&&t.push(o),w[e].valida=1,a(Object(p.a)(t)),C(w)};return Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)("div",{className:o.container,children:[Object(n.jsxs)("div",{className:o.container__header,children:[Object(n.jsx)("h6",{children:N("certificateBadgeTemplate:certificate-design.title-design")}),Object(n.jsx)("button",{className:o.container__header_button,onClick:c,children:"+"})]}),Object(n.jsxs)("div",{className:o.container__fields,children:[Object(n.jsx)(Ho,{title:N("certificateBadgeTemplate:certificate-design.texts"),logo:Ko,expand:u,onClick:function(){return m(!u)}}),u&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Yo,{index:-1,exampleText:function(){var e,a=null===(e=t.find((function(e){return"certificateCode"===e.fieldName})))||void 0===e?void 0:e.exampleText;return void 0===a?"C\xf3digo:CK09aABbAz":"".concat(a).concat(""===a?"":":","CK09aABbAz")}(),fieldName:w[2].fieldName,addOrDelete:0===w[2].valida?"add":"delete",addDefaultField:T,modifyField:r,deleteField:function(){return S(w[2].fieldName,2)}},"field".concat(2)),null===t||void 0===t?void 0:t.map((function(e,t){if(48!==e.fieldType&&"certificateCode"!==e.fieldName)return Object(n.jsx)(Yo,{index:t,exampleText:e.exampleText,fieldName:e.fieldName,modifyField:r,deleteField:B,type:0},"field".concat(t))}))]}),Object(n.jsx)(Ho,{title:N("certificateBadgeTemplate:certificate-design.images"),logo:Vo,expand:f,onClick:function(){return h(!f)}}),f&&(null===w||void 0===w?void 0:w.map((function(e,t){if(48===e.fieldType&&3!==t)return Object(n.jsx)(Yo,{index:t,exampleText:"",fieldName:e.fieldName,addOrDelete:0===e.valida?"add":"delete",addDefaultField:T,deleteField:function(){return S(e.fieldName,t)}},"field".concat(t))}))),f&&(null===t||void 0===t?void 0:t.map((function(e,t){if(e.img)return Object(n.jsx)(Yo,{index:t,fieldImage:e.img,modifyField:r,deleteField:B},"field".concat(t))}))),Object(n.jsx)(Ho,{title:N("certificateBadgeTemplate:certificate-design.buttons"),logo:Ko,expand:O,onClick:function(){return v(!O)}}),O&&Object(n.jsx)(Yo,{index:-3,exampleText:N("certificateBadgeTemplate:certificate-design.button-verify"),fieldName:w[3].fieldName,modifyField:r,addOrDelete:0===w[3].valida?"add":"delete",addDefaultField:T,deleteField:function(){return S(w[3].fieldName,3)}},"field".concat(3))]})]})})}));var Ks=Object(C.a)((function(e){return{container:Object(b.a)({display:"grid",gridTemplateColumns:"70% 30%",backgroundColor:"#E5E5E5"},e.breakpoints.up("xl"),{height:"100vh"}),container__certificate:{display:"flex",justifyContent:"center",overflow:"auto"},container__fields:{backgroundColor:"white"},container__button_fields:{display:"flex",justifyContent:"space-evenly",marginTop:20},content_modal:{display:"grid",gridTemplateColumns:"30% 70%",gridTemplateRows:""},dialog__title:{backgroundColor:e.palette.primary.main},sweetModal:{zIndex:1300},contentInput:Object(b.a)({marginTop:"1em",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},e.breakpoints.up("lg"),{display:"block",alignItems:"left"}),avatar:{width:"auto",height:"auto"},avatarSquare:{width:"50%",height:"50%",objectFit:"cover"},fieldButtonDisabled:{display:"none"}}})),Vs={setCertificateFields:I.p,setForm:I.w,setSaveDesign:I.D},Gs=Object(s.b)((function(e){return{certificateFields:e.certificateFields||[],form:e.form,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),Vs)((function(e){var t,a,r,c,o,s,l,u,j,x,y,w,C,k,N,B,S,A=e.certificateFields,I=e.setCertificateFields,z=e.form,P=e.setForm,R=e.setSaveDesign,M=e.setOpenDesignCarnet,L=e.organizationId,U=Ks(),W=Object(i.useRef)(),q=Object(i.useRef)(),H=Object(i.useState)(!0),K=Object(d.a)(H,2),V=K[0],G=K[1],Q=Object(i.useState)(!0),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(!1),ee=Object(d.a)($,2),te=ee[0],ae=ee[1],ne=Object(i.useState)(null),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)({fieldType:41,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0}),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=A.findIndex((function(e){return"certificateCode"===e.fieldName})),me=A.findIndex((function(e){return"buttonVerify"===e.fieldName})),be="certificateCode"===le.fieldName,pe="buttonVerify"===le.fieldName,fe=Object(i.useState)([].concat(Object(p.a)(A.map((function(e){var t;return null===(t=e.fontFamily)||void 0===t?void 0:t.family}))),["ABeeZee"])||["ABeeZee"]),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Object(i.useState)([]),ve=Object(d.a)(Oe,2),_e=ve[0],ye=ve[1],ke=Object(i.useState)([]),Ne=Object(d.a)(ke,2),Be=Ne[0],Se=Ne[1],Te=Object(i.useState)(!1),Ee=Object(d.a)(Te,2),Ie=Ee[0],De=Ee[1],ze=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","tables"]),Re=Object(d.a)(ze,1)[0],Me="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2));Object(i.useEffect)((function(){R(!1),Z(!0),Ce.a.get("/others/getFieldTypes").then((function(e){var t=e.data;Se(t.fieldTypes.filter((function(e){return 51!==e.id&&52!==e.id})).map((function(e){return{id:e.id,value:Me?e.valor_parametro_en:e.valor_parametro}})))})),ge.length>0?vo.a.load({google:{families:ge},active:function(){Z(!1)}}):Z(!1),ct.a.get("https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyAiqPGRASVurt5YfOdCCDOljv0nqATgCSc&fields=items.family,items.files&sort=alpha").then((function(e){var t=e.data;ye(t.items)}))}),[]);var Le,Fe=function(){ae(!1),de({fieldType:41,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0})},Ue=function(e){de(Object(m.a)(Object(m.a)({},le),{},{fontStyle:e}))},We=function(e){de(Object(m.a)(Object(m.a)({},le),{},{fontColor:e}))},Ye=function(e){"fontSize"===e.target.name&&e.target.value>100||de(Object(m.a)(Object(m.a)({},le),{},Object(b.a)({},e.target.name,e.target.value)))},qe=function(){var e,t;return!be&&!pe&&(48===le.fieldType?!le.fieldName:!(null===(e=le.fieldName)||void 0===e?void 0:e.length)>0||!(null===(t=le.exampleText)||void 0===t?void 0:t.length)>0||!le.fontSize>0||!le.fontFamily||!le.fieldType)},He=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o,s,l,d;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(le.index>=0),a=Pe()("certika-organization-".concat(L)).toString(),n=new FormData,!qe()){e.next=5;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Re("alerts:alerts.certificate-all-fields"),showConfirmButton:!1,timer:1500,customClass:{container:U.sweetModal}}));case 5:if(48!==le.fieldType||pe){e.next=40;break}if(le.img){e.next=8;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Re("alerts:alerts.template-carnet-alert-field-image"),showConfirmButton:!1,timer:1500,customClass:{container:U.sweetModal}}));case 8:if(!t){e.next=26;break}if(!A.find((function(e){return e.fieldName===le.fieldName}))){e.next=13;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Re("alerts:alerts.certificate-field-name-exists"),showConfirmButton:!1,timer:1500,customClass:{container:U.sweetModal}}));case 13:return Z(!0),n.append("file",V),n.append("route","".concat(a,"/carnetTemplate/carnet-temp/fieldTemp/").concat(le.fieldName,".png")),e.next=18,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:n});case 18:return e.next=20,Ce.a.post("/file/getFile",{keyFile:"".concat(a,"/carnetTemplate/carnet-temp/fieldTemp/").concat(le.fieldName,".png"),headers:{"Content-Type":"multipart/form-data"}});case 20:i=e.sent,r=i.data,le.img=null===r||void 0===r?void 0:r.url,Z(!1);case 24:e.next=40;break;case 26:if(!A.find((function(e,t){return e.fieldName===le.fieldName&&t!==le.index}))){e.next=28;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Re("alerts:alerts.certificate-field-name-exists"),showConfirmButton:!1,timer:1500,customClass:{container:U.sweetModal}}));case 28:if(A[le.index].exampleText===le.exampleText){e.next=40;break}return Z(!0),n.append("file",V),n.append("route","".concat(a,"/carnetTemplate/carnet-temp/fieldTemp/").concat(le.fieldName,".png")),e.next=34,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:n});case 34:return e.next=36,Ce.a.post("/file/getFile",{keyFile:"".concat(a,"/carnetTemplate/carnet-temp/fieldTemp/").concat(le.fieldName,".png"),headers:{"Content-Type":"multipart/form-data"}});case 36:c=e.sent,o=c.data,le.img=null===o||void 0===o?void 0:o.url,Z(!1);case 40:be&&(le.exampleText=le.exampleText.trim()),t?(48===le.fieldType?A.push(Object(m.a)(Object(m.a)({},le),{},{width:(null===(s=W.current)||void 0===s?void 0:s.naturalWidth)/100*20,height:(null===(l=W.current)||void 0===l?void 0:l.naturalHeight)/100*20})):A.push(Object(m.a)(Object(m.a)({},le),{},{width:200,height:le.fontSize})),ce(le.exampleText),De(!0)):(d=le.index,delete le.index,A[d]=le),I(Object(p.a)(A)),de({fieldType:41,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0}),ae(!1);case 45:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ke=function(e){de(-1===e?Object(m.a)(Object(m.a)({},A[ue]),{},{index:ue}):-3===e?Object(m.a)(Object(m.a)({},A[me]),{},{index:me}):Object(m.a)(Object(m.a)({},A[e]),{},{index:e})),ae(!0)},Ve=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]'),Array.prototype.forEach.call(a,(function(e){return e.remove()})),void 0!==ue&&-1!==ue&&(A[ue].exampleText="".concat(A[ue].exampleText).concat(""===A[ue].exampleText?"":":","CK09aABbAz")),!(A.filter((function(e){return 41===e.fieldType&&"certificateCode"!==e.fieldName||42===e.fieldType})).length<=0)){e.next=6;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Re("alerts:alerts.certificate-field"),showConfirmButton:!1,timer:1500,customClass:{container:U.sweetModal}}));case 6:n=null===q||void 0===q||null===(t=q.current)||void 0===t?void 0:t.toDataURL(),P(Object(m.a)(Object(m.a)({},z),{},{img_template:n})),R(!0),M(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ge=function(){return be};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsxs)("div",{className:U.container,children:[Object(n.jsx)("div",{className:U.container__certificate,children:Object(n.jsx)(Ws,{isSelected:Ie,setIsSelected:De,selectedId:re,selectShape:ce,stageRef:q,modifyField:Ke})}),Object(n.jsxs)("div",{className:U.container__fields,children:[Object(n.jsx)(Hs,{openModal:function(e){ae(!0)},modifyField:Ke,selectShape:ce}),Object(n.jsxs)("div",{className:U.container__button_fields,children:[Object(n.jsx)(es,{onClick:Ve,children:Re("buttons:buttons.accept")}),Object(n.jsx)(es,{onClick:function(){var e=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]');Array.prototype.forEach.call(e,(function(e){return e.remove()})),void 0!==ue&&-1!==ue&&(A[ue].exampleText="".concat(A[ue].exampleText).concat(""===A[ue].exampleText?"":":","CK09aABbAz")),M(!1)},children:Re("buttons:buttons.cancel")})]})]})]}),Object(n.jsxs)(O.a,{open:te,onClose:Fe,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(_t,{loading:X}),Object(n.jsx)(v.a,{align:"center",className:!pe&&function(e){var t=as(e);return t.r>230&&t.g>230&&t.b>230?U.dialog__title:""}(null===(r=le.fontColor)||void 0===r?void 0:r.hex),style:pe?{backgroundColor:null===le||void 0===le||null===(c=le.rectColor)||void 0===c?void 0:c.hex}:{},children:48!==le.fieldType||pe?Object(n.jsx)(we.a,{style:{fontSize:"".concat(le.fontSize||18,"px"),color:null===(o=le.fontColor)||void 0===o?void 0:o.hex,fontFamily:null===(s=le.fontFamily)||void 0===s?void 0:s.family,fontWeight:(null===(l=le.fontStyle)||void 0===l?void 0:l.bold)?"bold":"",fontStyle:(null===(u=le.fontStyle)||void 0===u?void 0:u.italic)?"italic":"",textDecoration:"".concat((null===(j=le.fontStyle)||void 0===j?void 0:j.underline)?"underline":""," ").concat((null===(x=le.fontStyle)||void 0===x?void 0:x.strikethrough)?"line-through":""),textAlign:le.align},children:be?"".concat(le.exampleText).concat(""===le.exampleText?"":":","CK09aABbAz"):pe?"Verificar":le.exampleText||Re("certificateBadgeTemplate:certificate-design.example")}):Object(n.jsx)(g.a,{alt:"img-prev",src:null===le||void 0===le?void 0:le.img,variant:"rounded",className:(Le=null===le||void 0===le?void 0:le.img,void 0===Le?U.avatar:U.avatarSquare),imgProps:{ref:W},children:Object(n.jsx)(mo.a,{sx:{margin:4,fontSize:"2em"}})})}),Object(n.jsx)(_.a,{dividers:!0,className:pe&&U.fieldButtonDisabled,children:Object(n.jsxs)("div",{className:U.content_modal,children:[Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.name-field"),"*"]}),Object(n.jsx)("input",{type:"text",name:"fieldName",value:le.fieldName||"",onChange:Ye,disabled:Ge(),style:{borderRadius:"16px",border:"1px solid #C4C4C4",paddingLeft:"1em"}}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.type-field"),"*"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(T.a,{name:"fieldType",value:le.fieldType,onChange:Ye,disabled:Ge(),children:Be.map((function(e,t){return Object(n.jsx)(Y.a,{value:e.id,children:Object(n.jsx)("em",{children:e.value})},"field-type-option".concat(t))}))})}),Object(n.jsxs)("p",{children:[48!==le.fieldType&&Re("certificateBadgeTemplate:certificate-design.example"),"*"]}),42===le.fieldType&&Object(n.jsx)("input",{type:"number",name:"exampleText",value:le.exampleText||"",onChange:Ye,onKeyUp:lo,style:{borderRadius:"16px",border:"1px solid #C4C4C4"}}),42!==le.fieldType&&48!==le.fieldType&&Object(n.jsx)(uo.a,{type:"text",name:"exampleText",value:le.exampleText||"",style:{borderRadius:"16px"},onChange:be?function(e){ts(e)&&de(Object(m.a)(Object(m.a)({},le),{},Object(b.a)({},e.target.name,e.target.value)))}:Ye,endAdornment:Object(n.jsx)(Rn.a,{position:"end",children:be?"".concat(""===le.exampleText?"":":","CK09aABbAz"):""})}),48===le.fieldType&&Object(n.jsx)("div",{className:U.contentInput,children:Object(n.jsx)("input",{accept:"image/*",id:"contained-button-file",name:"imagen",type:"file",onChange:function(e){return function(e){var t=e.target.files[0];t&&(G(t),de(Object(m.a)(Object(m.a)({},le),{},{img:URL.createObjectURL(t),exampleText:t.name,isNewImage:"newImg"})))}(e)}})}),48!==le.fieldType&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.align-letter"),"*"]}),Object(n.jsxs)("div",{children:[Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(bo.a,{}),checkedIcon:Object(n.jsx)(bo.a,{}),name:"align",value:"center",checked:"center"===le.align,onChange:Ye}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(po.a,{}),checkedIcon:Object(n.jsx)(po.a,{}),name:"align",value:"left",checked:"left"===(null===le||void 0===le?void 0:le.align),onChange:Ye}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(jo.a,{}),checkedIcon:Object(n.jsx)(jo.a,{}),name:"align",value:"right",checked:"right"===(null===le||void 0===le?void 0:le.align),onChange:Ye})]}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.font"),"*"]}),Object(n.jsx)(Xo,{name:"fontFamily",value:le.fontFamily||null,placeholder:"Selecciona un tipo de letra",options:_e,getOptionLabel:function(e){return e.family},getOptionSelected:function(e){return e.family},onChange:function(e,t){return function(e){if((null===e||void 0===e?void 0:e.family)&&!ge.includes(e.family)){var t=[].concat(Object(p.a)(ge),[e.family]);xe(t),vo.a.load({google:{families:[e.family]},active:function(){de(Object(m.a)(Object(m.a)({},le),{},{fontFamily:e}))}})}else de(Object(m.a)(Object(m.a)({},le),{},{fontFamily:e}))}(t)}}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.size-letter"),"*"]}),Object(n.jsx)("input",{type:"number",name:"fontSize",value:le.fontSize||"",onChange:Ye,onKeyUp:lo,style:{borderRadius:"16px",border:"1px solid #C4C4C4",paddingLeft:"1em"}}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.style-letter"),"*"]}),Object(n.jsxs)("div",{children:[Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(fo.a,{}),checkedIcon:Object(n.jsx)(fo.a,{}),name:"bold",checked:null===le||void 0===le||null===(y=le.fontStyle)||void 0===y?void 0:y.bold,onChange:function(e){return Ue(Object(m.a)(Object(m.a)({},le.fontStyle),{},{bold:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(ho.a,{}),checkedIcon:Object(n.jsx)(ho.a,{}),name:"italic",checked:null===le||void 0===le||null===(w=le.fontStyle)||void 0===w?void 0:w.italic,onChange:function(e){return Ue(Object(m.a)(Object(m.a)({},le.fontStyle),{},{italic:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(go.a,{}),checkedIcon:Object(n.jsx)(go.a,{}),name:"underline",checked:null===le||void 0===le||null===(C=le.fontStyle)||void 0===C?void 0:C.underline,onChange:function(e){return Ue(Object(m.a)(Object(m.a)({},le.fontStyle),{},{underline:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(xo.a,{}),checkedIcon:Object(n.jsx)(xo.a,{}),name:"strikethrough",checked:null===le||void 0===le||null===(k=le.fontStyle)||void 0===k?void 0:k.strikethrough,onChange:function(e){return Ue(Object(m.a)(Object(m.a)({},le.fontStyle),{},{strikethrough:e.target.checked}))}})]}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.colour"),"*"]}),Object(n.jsx)(wo,{color:(null===(N=le.fontColor)||void 0===N?void 0:N.hex)||"#000000",changeColor:We})]})]})}),Object(n.jsx)(_.a,{dividers:!0,className:!pe&&U.fieldButtonDisabled,children:Object(n.jsxs)("div",{className:U.content_modal,children:[Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.colour-text"),"*"]}),Object(n.jsx)(wo,{color:(null===(B=le.fontColor)||void 0===B?void 0:B.hex)||"#000000",changeColor:We}),Object(n.jsxs)("p",{children:[Re("certificateBadgeTemplate:certificate-design.colour-background"),"*"]}),Object(n.jsx)(wo,{color:(null===(S=le.rectColor)||void 0===S?void 0:S.hex)||"#000000",changeColor:function(e){de(Object(m.a)(Object(m.a)({},le),{},{rectColor:e}))}})]})}),Object(n.jsxs)(Ae.a,{children:[Object(n.jsx)(es,{color:"primary",variant:"contained",onClick:He,children:Re("buttons:buttons.save")}),Object(n.jsx)(es,{color:"primary",variant:"contained",onClick:Fe,children:Re("buttons:buttons.close")})]})]})]})}));var Qs=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),Js=Object(C.a)((function(e){return{root:{marginTop:"1em"},input:{display:"none"},avatar:{width:"auto",height:"auto","&:hover":{cursor:"pointer"}},icon:{margin:20,fontSize:"4em"},contentInput:Object(b.a)({marginTop:"1em",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},e.breakpoints.up("lg"),{display:"block",alignItems:"left"}),text:Object(b.a)({display:"flex"},e.breakpoints.up("lg"),{display:"block"}),img:function(e){var t,a,n,i,r;return{maxWidth:"70vw",height:"blob"===(null===(t=e.form)||void 0===t||null===(a=t.img_prev)||void 0===a?void 0:a.split(":",1)[0])?null===(n=e.imageRef)||void 0===n||null===(i=n.current)||void 0===i?void 0:i.naturalHeight:null===(r=e.form)||void 0===r?void 0:r.height}},buttonForm:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}}}})),Xs={setCertificateFields:I.p,changeBreadcrump:I.a,setForm:I.w,setSaveDesign:I.D},Zs=Object(s.b)((function(e){var t,a,n;return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,form:e.form?Object(m.a)(Object(m.a)({},e.form),{},{fieldsAdditionals:(null===(t=e.form)||void 0===t||null===(a=t.fieldsAdditionals)||void 0===a?void 0:a.length)>0?null===(n=e.form)||void 0===n?void 0:n.fieldsAdditionals:[{index:1}]}):{fieldsAdditionals:[{index:1}],skills:[]},certificateFields:e.certificateFields,returnRoute:e.returnRoute,saveDesign:e.saveDesign}}),Xs)((function(e){var t,a,r=e.user,c=e.organizationId,o=e.form,s=e.returnRoute,l=e.setForm,j=e.certificateFields,v=e.setCertificateFields,y=e.changeBreadcrump,w=e.saveDesign,C=e.setSaveDesign,k=Object(u.g)(),N=Js({form:o}),B=Object(i.useRef)(),S=Object(i.useState)(!1),A=Object(d.a)(S,2),I=A[0],P=A[1],R=Object(i.useState)(),M=Object(d.a)(R,2),L=M[0],U=M[1],q=Object(i.useState)([]),H=Object(d.a)(q,2),V=H[0],G=H[1],Q=Object(i.useState)(!1),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(!1),ee=Object(d.a)($,2),te=ee[0],ne=ee[1],ie=Object(i.useState)([]),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)([]),le=Object(d.a)(se,2),de=le[0],me=le[1],be=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","breadCrumps","tables"]),pe=Object(d.a)(be,1)[0],fe="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2));Object(i.useEffect)((function(){he()}),[]);var he=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,P(!0),t.next=4,ge();case 4:return t.next=6,Oe();case 6:if(!!!e.match.params.id){t.next=14;break}return t.next=10,xe();case 10:y(pe("breadCrumps:breadCrumps.carnet-template-edit",{returnObjects:!0})),C(!0),t.next=16;break;case 14:l(Object(m.a)(Object(m.a)({},o),{},{img_prev:"blob"===(null===o||void 0===o||null===(a=o.img_prev)||void 0===a?void 0:a.split(":",1)[0])?null:o.img_prev,id_organizaciones:1!==r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?c:"",id_usuarios:null===(n=r.data_user)||void 0===n?void 0:n.id})),y(pe("breadCrumps:breadCrumps.carnet-template-create",{returnObjects:!0}));case 16:P(!1),t.next=22;break;case 19:t.prev=19,t.t0=t.catch(0),k.push("/500");case 22:case"end":return t.stop()}}),t,null,[[0,19]])})));return function(){return t.apply(this,arguments)}}(),ge=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations/names");case 2:t=e.sent,a=t.data,G(a.organizations);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),xe=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,c,o,s,d,u,b,p,j,h,g,x,O;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,u=Object(Ie.a)(e.match.params.id),t.next=4,Ce.a.get("/carnetTemplate/".concat(u));case 4:b=t.sent,p=b.data,j=p.carnetTemplate,h=j.carnetTemplate,g=j.linkPhoto,x=j.linkPhotoTemplate,O=j.fieldsAdditionals,oe(null===(a=p.carnetTemplate)||void 0===a||null===(n=a.carnetTemplate)||void 0===n?void 0:n.carnetsEmitidos),v(null===(i=p.carnetTemplate)||void 0===i||null===(c=i.carnetTemplate)||void 0===c?void 0:c.carnetCampos.map((function(e){return{id:e.id,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,img:e.img?e.img:null,fieldName:e.nombre,align:e.formato_letra?e.formato_letra:"center",fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontSize:e.tamano_letra,fontFamily:{family:e.tipo_letra},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseFloat(e.x),y:parseFloat(e.y),width:0===e.width?430:e.width,height:0===e.height?e.tamano_letra:e.height}}))),null===(o=p.carnetTemplate)||void 0===o||(null===(s=o.carnetTemplate)||void 0===s||delete s.carnetsCampos),l(Object(m.a)(Object(m.a)({},h),{},{img_prev:g,img_template:x,id_usuarios:null===(d=r.data_user)||void 0===d?void 0:d.id,estado:h.estado,fieldsAdditionals:O.map((function(e,t){return{index:t,id:e.id,privacidad_vp:e.privacidad_vp,nombre_campo:e.nombre_campo}}))})),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(0),k.push("/500");case 16:case"end":return t.stop()}}),t,null,[[0,13]])})));return function(){return t.apply(this,arguments)}}(),Oe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getPrivacy");case 2:t=e.sent,a=t.data,me(a.privacy);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=function(){return!(0===ce||!e.match.params.id)},Ne=function(e){l(Object(m.a)(Object(m.a)({},o),{},Object(b.a)({},e.target.name,e.target.value)))},Be=function(e,t){var a;null===(a=o.fieldsAdditionals)||void 0===a||a.map((function(a){return a.index===t&&(a[e.target.name]=e.target.value),a})),l(Object(m.a)(Object(m.a)({},o),{},{fieldsAdditionals:o.fieldsAdditionals}))},Se=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,s,d,u,b,p,h,g;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!!o.img_prev){e.next=3;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:pe("alerts:alerts.template-certificate-alert"),showConfirmButton:!1,timer:1500}));case 3:if(t=Pe()("certika-organization-".concat(c)).toString(),!!!(null===L||void 0===L?void 0:L.name)){e.next=18;break}return P(!0),(i=new FormData).append("file",L),i.append("route","".concat(t,"/carnetTemplate/carnet-temp/temp")),e.next=12,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:i});case 12:return!(null===j||void 0===j?void 0:j.length)>0&&(r=so(),s=r.dataQr,d=r.dataImg,u=r.dataCode,b=r.dataButtonVerify,v([s,d,u,b])),e.next=15,Ce.a.post("/file/getFile",{keyFile:"".concat(t,"/carnetTemplate/carnet-temp/temp"),headers:{"Content-Type":"multipart/form-data"}});case 15:p=e.sent,h=p.data,l(Object(m.a)(Object(m.a)({},o),{},{img_prev:null===h||void 0===h?void 0:h.url,width:null===(a=B.current)||void 0===a?void 0:a.naturalWidth,height:null===(n=B.current)||void 0===n?void 0:n.naturalHeight}));case 18:void 0!==(g=null===j||void 0===j?void 0:j.findIndex((function(e){return"certificateCode"===e.fieldName})))&&-1!==g&&(j[g].exampleText=j[g].exampleText.includes(":")?j[g].exampleText.split(":")[0]:""),ne(!0),P(!1);case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),!!o.img_prev){e.next=4;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:pe("alerts:alerts.template-certificate-alert"),showConfirmButton:!1,timer:1500}));case 4:if((null===j||void 0===j?void 0:j.length)>0){e.next=7;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:pe("alerts:alerts.no-design-certificate"),showConfirmButton:!1,timer:1500}));case 7:if(w){e.next=9;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:pe("alerts:alerts.no-accepted-design-certificate"),showConfirmButton:!1,timer:1500}));case 9:if(a=!o.id,P(!0),e.prev=11,!a){e.next=18;break}return delete o.img_template,e.next=16,Ce.a.post("/carnetTemplate",Object(m.a)(Object(m.a)({},o),{},{width:null===(n=B.current)||void 0===n?void 0:n.naturalWidth,height:null===(i=B.current)||void 0===i?void 0:i.naturalHeight,carnetFields:j,camposAdicionales:o.fieldsAdditionals}));case 16:e.next=20;break;case 18:return e.next=20,Ce.a.put("/carnetTemplate/".concat(o.id),Object(m.a)(Object(m.a)({},o),{},{width:null===(r=B.current)||void 0===r?void 0:r.naturalWidth,height:null===(c=B.current)||void 0===c?void 0:c.naturalHeight,carnetFields:j,camposAdicionales:o.fieldsAdditionals}));case 20:e.next=26;break;case 22:return e.prev=22,e.t0=e.catch(11),P(!1),e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:pe("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}));case 26:P(!1),F.a.fire({icon:"success",iconColor:E.a.primary,text:pe("alerts:alerts.saved"),showConfirmButton:!1,timer:1500}).then((function(){a?k.push("/carnets/edited"):k.push(s),l(null),v(null)}));case 28:case"end":return e.stop()}}),e,null,[[11,22]])})));return function(t){return e.apply(this,arguments)}}(),De=function(){Z(!1)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:N.root,onSubmit:Ee,children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:pe("certificateBadgeTemplate:badges-certificate-form.details-carnet")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:N.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:Object(n.jsx)(K.a,{title:pe("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{imgProps:{ref:B},alt:"img-prev",src:(null===o||void 0===o?void 0:o.img_template)?null===o||void 0===o?void 0:o.img_template:null===o||void 0===o?void 0:o.img_prev,variant:"rounded",className:N.avatar,onClick:function(){return Z(!!(null===o||void 0===o?void 0:o.img_prev))},children:Object(n.jsx)(ue.a,{sx:{margin:4,fontSize:"4em"}})})})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:8,children:[Object(n.jsx)(we.a,{variant:"body2"}),Object(n.jsxs)("div",{className:N.contentInput,children:[Object(n.jsx)("input",{accept:"image/*",className:N.input,id:"contained-button-file",name:"imagen",type:"file",disabled:ke(),onChange:function(e){return function(e){var t=e.target.files[0];t&&(U(t),l(Object(m.a)(Object(m.a)({},o),{},{img_prev:URL.createObjectURL(t),img_template:null,imagen:"newImage"})),j&&v(j.map((function(e){return Object(m.a)(Object(m.a)({},e),{},{x:50,y:50})}))),C(!1))}(e)}}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,children:Object(n.jsx)("label",{htmlFor:"contained-button-file",children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",component:"span",disabled:ke(),children:pe("buttons:buttons.upload-image")})})}),Object(n.jsx)(ye.a,{item:!0,children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",component:"span",onClick:Se,disabled:ke(),children:pe("buttons:buttons.design-carnet")})})]})]})]})]}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:N.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:N.text,align:"right",children:[pe("certificateBadgeTemplate:badges-certificate-form.carnet-public-name"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"",name:"nombre",variant:"outlined",size:"small",onChange:Ne,value:null===o||void 0===o?void 0:o.nombre,disabled:ke()})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:N.text,align:"right",children:[pe("certificateBadgeTemplate:badges-certificate-form.carnet-private-name"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"",name:"nombre_privado",variant:"outlined",size:"small",onChange:Ne,value:null===o||void 0===o?void 0:o.nombre_privado})})}),1===r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:N.text,align:"right",children:pe("certificateBadgeTemplate:badges-certificate-form.organization")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"organizacion",name:"id_organizaciones",value:o.id_organizaciones||"",onChange:Ne,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:pe("selects:selects-autocompletes.select-option")})}),V.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},"organization-".concat(e.id))}))]})})})]})]}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:N.root,children:pe("certificateBadgeTemplate:badges-certificate-form.additional-fields")}),o.fieldsAdditionals.map((function(e,t){var a;return Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:N.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:N.text,align:"right",children:"".concat(pe("certificateBadgeTemplate:badges-certificate-form.field")," ").concat(t+1)})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:N.card,children:[Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{variant:"body1",align:"left",className:N.root,children:"".concat(pe("certificateBadgeTemplate:badges-certificate-form.field-type")).concat(e.nombre_campo?"*":"")}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:ke(),id:"privacidad",name:"privacidad_vp",value:e.privacidad_vp||"",required:!!e.nombre_campo,onChange:function(t){return Be(t,e.index)},children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:pe("selects:selects-autocompletes.select-option")})}),de.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:fe?e.valor_parametro_en:e.valor_parametro},"privacy-".concat(e.id))}))]})}),Object(n.jsx)(we.a,{variant:"body1",align:"left",className:N.root,children:"".concat(pe("certificateBadgeTemplate:badges-certificate-form.field-name")).concat(e.privacidad_vp?"*":"")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!!e.privacidad_vp,disabled:ke(),name:"nombre_campo",variant:"outlined",size:"small",value:e.nombre_campo||"",rows:4,onChange:function(t){return Be(t,e.index)},className:N.fieldCard})})]}),Object(n.jsx)(wc.a,{children:(null===(a=o.fieldsAdditionals)||void 0===a?void 0:a.length)>0&&Object(n.jsx)(x.a,{disabled:ke(),size:"small",onClick:function(t){return function(e,t){var a,n;a=0===o.fieldsAdditionals.length?[{index:1}]:null===(n=o.fieldsAdditionals)||void 0===n?void 0:n.filter((function(e){return e.index!==t})),l(Object(m.a)(Object(m.a)({},o),{},{fieldsAdditionals:a}))}(0,e.index)},children:Object(n.jsxs)(we.a,{color:"textSecondary",variant:"body2",children:[Object(n.jsx)(ae.a,{}),pe("buttons:buttons.delete")]})})})]})})]},"grid-activity-".concat(t))})),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",onClick:function(){var e,t=o.fieldsAdditionals[(null===(e=o.fieldsAdditionals)||void 0===e?void 0:e.length)-1];l(Object(m.a)(Object(m.a)({},o),{},{fieldsAdditionals:[].concat(Object(p.a)(o.fieldsAdditionals),[{index:t.index+1}])}))},disabled:ke(),children:pe("buttons:buttons.add-field")})})]}),Object(n.jsx)(W.a,{}),Object(n.jsxs)(ye.a,{container:!0,spacing:1,justify:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:"auto",children:Object(n.jsx)(x.a,{disableElevation:!0,type:"submit",color:"primary",variant:"contained",fullWidth:!0,children:pe("buttons:buttons.save")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:"auto",children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",onClick:function(){l(null),v(null),k.push(s)},fullWidth:!0,children:pe("buttons:buttons.cancel")})})]})]})})}),Object(n.jsxs)(O.a,{open:X,onClose:De,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(N.buttonForm),onClick:De,children:Object(n.jsx)(ue.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:(null===o||void 0===o?void 0:o.img_template)?null===o||void 0===o?void 0:o.img_template:null===o||void 0===o?void 0:o.img_prev,className:N.img})})]}),Object(n.jsx)(_t,{loading:I}),Object(n.jsx)(O.a,{open:te,fullScreen:!0,TransitionComponent:Qs,children:Object(n.jsx)(Gs,{setOpenDesignCarnet:ne})})]})})),$s=a(316),el=Object(C.a)((function(e){return{root:{marginTop:".5em",marginBottom:".5em"},export:{margin:"0.5em",color:"white",backgroundColor:"#28a745",borderRadius:5,"&:hover":{backgroundColor:"#28a745"}},cards:{borderColor:E.a.secondary,borderRadius:"5%"},check1:{color:"#ffc107"},check2:{color:"#28a745"},check3:{color:"#dc3545"},avatar:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},namePrivate:{color:"rgba(0, 0, 0, 0.54)",fontSize:"0.875rem"},row:{color:"#dc2626",fontWeight:"bold"},buttonDialog:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}}}}));var tl={changeBreadcrump:I.a},al=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"insignias emitidas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),tl)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=e.filtro,o=e.dataToExportExcel,s=e.setFiltradas,l=e.setDataExcel,u=e.tipo,j=e.where,v=e.countItems,y=Object(D.a)(["tables","breadCrumps"]),w=Object(d.a)(y,1)[0],C=el(),k=Object(i.useState)(""),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)(""),z=Object(d.a)(A,2),P=z[0],R=z[1],M=Object(i.useState)(!1),L=Object(d.a)(M,2),U=L[0],W=L[1],Y=Object(i.useState)(null),q=Object(d.a)(Y,2),H=q[0],V=q[1],G=w("tables:table.columns-certificate-issued.columns-start",{returnObjects:!0}),Q=w("tables:table.columns-certificate-issued.columns-end",{returnObjects:!0}),J=w("tables:table.columns-carnet-issued.columns-start",{returnObjects:!0}),X=w("tables:table.columns-carnet-issued.columns-end",{returnObjects:!0}),Z=Object(i.useState)(!1),$=Object(d.a)(Z,2),ee=$[0],te=$[1];Object(i.useEffect)((function(){r(w("breadCrumps:breadCrumps.analytics-list",{returnObjects:!0}))}),[]);var ne=function(){var e,t,a,n,i=[];return 1===u?(null===(e=c[0])||void 0===e||null===(t=e.certificadosCamposValores)||void 0===t||t.map((function(e){var t,a,n,r,c;48!==(null===(t=e.certificadoCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)&&i.push({id:"".concat(null===e||void 0===e||null===(n=e.certificadoCampos)||void 0===n?void 0:n.nombre),label:"".concat(null===e||void 0===e||null===(r=e.certificadoCampos)||void 0===r?void 0:r.nombre),align:"center",orden:"".concat(null===e||void 0===e||null===(c=e.certificadoCampos)||void 0===c?void 0:c.nombre)})})),G.concat(i).concat(Q)):(null===(a=c[0])||void 0===a||null===(n=a.carnetsCamposValores)||void 0===n||n.map((function(e){var t,a,n,r,c;48!==(null===(t=e.carnetCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)&&i.push({id:"".concat(null===e||void 0===e||null===(n=e.carnetCampos)||void 0===n?void 0:n.nombre),label:"".concat(null===e||void 0===e||null===(r=e.carnetCampos)||void 0===r?void 0:r.nombre),align:"center",orden:"".concat(null===e||void 0===e||null===(c=e.carnetCampos)||void 0===c?void 0:c.nombre)})})),J.concat(i).concat(X))},ie=function(e){return e?"Si":"No"},re=function(e,t){var a=e.filter((function(e){return e.id_redes_sociales===t}));return a.length>0?a.length:0},ce=function(){return w("tables:table.columns-badges-issued",{returnObjects:!0}).filter((function(e){return"badgename"!==e.id&&"badgenamePrivate"!==e.id&&"delete"!==e.id}))},oe=function(){return w("tables:table.columns-contracts",{returnObjects:!0})},se=function(){W(!1)},le=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,o,l,d,m,b,h,g,x,O,v,_,y,w;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(te(!0),j.limit=a||10,j.offset=t?t*a:0,0!==u){e.next=12;break}return e.next=6,Ce.a.post("/badgesIssued/getBadgesIssued",j);case 6:i=e.sent,r=i.data,o=[].concat(Object(p.a)(c),Object(p.a)(null===r||void 0===r||null===(n=r.issued)||void 0===n?void 0:n.rows.filter((function(e){return!c.find((function(t){return t.id===e.id}))})))),s(o),e.next=37;break;case 12:if(1!==u){e.next=21;break}return e.next=15,Ce.a.post("/certificatesIssued/getCertificatesIssued",j);case 15:d=e.sent,m=d.data,b=[].concat(Object(p.a)(c),Object(p.a)(null===m||void 0===m||null===(l=m.issued)||void 0===l?void 0:l.rows.filter((function(e){return!c.find((function(t){return t.id===e.id}))})))),s(b),e.next=37;break;case 21:if(2!==u){e.next=30;break}return e.next=24,Ce.a.post("/carnetsIssued/getCarnetsIssued",j);case 24:g=e.sent,x=g.data,O=[].concat(Object(p.a)(c),Object(p.a)(null===x||void 0===x||null===(h=x.issued)||void 0===h?void 0:h.rows.filter((function(e){return!c.find((function(t){return t.id===e.id}))})))),s(O),e.next=37;break;case 30:if(3!==u){e.next=37;break}return e.next=33,Ce.a.post("/contract/getContracts",j);case 33:_=e.sent,y=_.data,w=[].concat(Object(p.a)(c),Object(p.a)(null===y||void 0===y||null===(v=y.contracts)||void 0===v?void 0:v.rows.filter((function(e){return!c.find((function(t){return t.id===e.id}))})))),s(w);case 37:te(!1);case 38:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}();return 0===u?Object(n.jsx)(zn,{columns:ce(),rows:v,setDirection:T,setOrderBy:R,changePagination:le,children:Object(n.jsx)(vn.a,{children:ee?Object(n.jsx)(qn,{columns:ce(),photo:1}):c.length>0?Object(n.jsxs)(n.Fragment,{children:[Object(I.J)(c,Object(I.f)(B,P)).slice(t*a,t*a+a).map((function(e,t){var a,i,r;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:e.gruposInsigniasEmitidas.nombre}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("span",{className:4===e.estado&&C.row,children:1===e.estado?w("tables:table.state-issue.pending"):2===e.estado?w("tables:table.state-issue.accepted"):3===e.estado?w("tables:table.state-issue.rejected"):4===e.estado?w("tables:table.state-issue.bounced-mail"):w("tables:table.state-issue.revoked")})}),Object(n.jsxs)(yn.a,{align:"center",children:[Object(n.jsx)(g.a,{"aria-label":"img_badge",src:null===(a=e.plantillasInsignias)||void 0===a?void 0:a.linkPhoto,className:C.avatar}),null===(i=e.plantillasInsignias)||void 0===i?void 0:i.nombre,Object(n.jsx)("p",{className:C.namePrivate,children:null===(r=e.plantillasInsignias)||void 0===r?void 0:r.nombre_privado})]}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.primer_nombre_receptor," ").concat(e.segundo_nombre_receptor||"")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.primer_apellido_receptor," ").concat(e.segundo_apellido_receptor||"")}),Object(n.jsx)(yn.a,{align:"center",children:e.email_receptor}),Object(n.jsx)(yn.a,{align:"center",children:e.tipo_identificacion}),Object(n.jsx)(yn.a,{align:"center",children:e.identificacion}),Object(n.jsx)(yn.a,{align:"center",children:2!==e.estado&&0!==e.estado||"Si"!==ie(e.account)?e.codigo_insignia:Object(n.jsx)(K.a,{title:w("tables:table.tooltip.view-badge"),children:Object(n.jsx)("a",{href:"".concat(window.location.origin,"/badges/").concat(Object(Ie.b)(e.id)),target:"blank",children:e.codigo_insignia})})}),Object(n.jsx)(yn.a,{align:"center",children:null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))&&Ne()(e.fecha_expiracion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:e.numero_celular}),Object(n.jsx)(yn.a,{align:"center",children:e.numero_whatsapp}),Object(n.jsx)(yn.a,{align:"center",children:e.numero_telegram}),Object(n.jsx)(yn.a,{align:"center",children:e.merito}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("a",{href:e.link_merito,target:"blank",children:e.link_merito})}),Object(n.jsx)(yn.a,{align:"center",children:ie(e.account)}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_emision||1}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_aceptar_insignia||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_crear_cuenta||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_compartir_insignia||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_revocar||0}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,4)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,3)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,5)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,2)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,6)})]},"row".concat(t))})),function(){Object(I.A)(!0);try{var e,t,a=o.map((function(e){var t,a,n;return{Grupo:null===(t=e.gruposInsigniasEmitidas)||void 0===t?void 0:t.nombre,Estado:1===e.estado?w("tables:table.state-issue.issued"):2===e.estado?w("tables:table.state-issue.accepted"):3===e.estado?w("tables:table.state-issue.rejected"):4===e.estado?w("tables:table.state-issue.bounced-mail"):w("tables:table.state-issue.revoked"),"Fecha emisi\xf3n":Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss"),Nombres:"".concat(e.primer_nombre_receptor," ").concat(e.segundo_nombre_receptor||""),Apellidos:"".concat(e.primer_apellido_receptor," ").concat(e.segundo_apellido_receptor||""),Email:e.email_receptor,"Tipo de identificaci\xf3n":e.tipo_identificacion,"Identificaci\xf3n":e.identificacion,"C\xf3digo insignia":e.codigo_insignia,"Nombre p\xfablico insignia":null===(a=e.plantillasInsignias)||void 0===a?void 0:a.nombre,"Nombre privado insignia":null===(n=e.plantillasInsignias)||void 0===n?void 0:n.nombre_privado,"Fecha expiraci\xf3n":null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))?Ne()(e.fecha_expiracion).format("DD/MM/YYYY"):"",Celular:e.numero_celular,WhatsApp:e.numero_whatsapp,Telegram:e.numero_telegram,Merito:e.merito,"Link merito":e.link_merito,Cuenta:ie(e.account),"No. correos emisi\xf3n":e.correos_emision||1,"No. correos aceptar insignia":e.correos_aceptar_insignia||0,"No. correos crear cuenta":e.correos_crear_cuenta||0,"No. correos compartir insignia":e.correos_compartir_insignia||0,"No. correos revocar":e.correos_revocar||0,"No. veces compartidas en Facebook":re(e.estadisticasRedesSociales,4),"No. veces compartidas en LinkedIn":re(e.estadisticasRedesSociales,3),"No. veces compartidas en Twitter":re(e.estadisticasRedesSociales,5),"No. veces compartidas en WhatsApp":re(e.estadisticasRedesSociales,2),"No. veces compartidas en Telegram":re(e.estadisticasRedesSociales,6)}})),n=null===(e=o[0])||void 0===e||null===(t=e.gruposInsigniasEmitidas)||void 0===t?void 0:t.nombre;l({rows:a,filename:n})}catch(i){F.a.fire({icon:"error",iconColor:E.a.primary,text:w("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}),Object(I.A)(!1)}Object(I.A)(!1)}()]}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"22",children:w("tables:table.empty-table")})})})}):1===u?Object(n.jsx)(zn,{columns:ne(),rows:v,setDirection:T,setOrderBy:R,changePagination:le,children:Object(n.jsx)(vn.a,{children:ee?Object(n.jsx)(qn,{columns:ne(),photo:0}):c.length>0?Object(n.jsxs)(n.Fragment,{children:[Object(I.J)(c,Object(I.f)(B,P)).slice(t*a,t*a+a).map((function(e,t){var a,i,r;return Object(n.jsxs)(_n.a,{children:[" ",Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:w("tables:table.tooltip.view-certificate"),children:Object(n.jsx)(S.a,{onClick:function(){return t=e.linkPhoto,V(t),void W(!0);var t},children:Object(n.jsx)(cn.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:e.gruposInsigniasEmitidas.nombre}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("span",{className:4===e.estado&&C.row,children:1===e.estado?w("tables:table.state-issue-certificate.issued"):2===e.estado?w("tables:table.state-issue-certificate.accepted"):3===e.estado?w("tables:table.state-issue-certificate.rejected"):4===e.estado?w("tables:table.state-issue-certificate.bounced-mail"):w("tables:table.state-issue-certificate.revoked")})}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.email_receptor}),null===(a=e.certificadosCamposValores)||void 0===a?void 0:a.map((function(e){var t,a;return 48!==(null===(t=e.certificadoCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)&&Object(n.jsx)(yn.a,{align:"center",children:e.valor})})),Object(n.jsx)(yn.a,{align:"center",children:2!==e.estado&&0!==e.estado||"Si"!==ie(e.account)?e.codigo_certificado:Object(n.jsx)(K.a,{title:w("tables:table.tooltip.view-certificate"),children:Object(n.jsx)("a",{href:"".concat(window.location.origin,"/certificate/").concat(Object(Ie.b)(e.id)),target:"blank",children:e.codigo_certificado})})}),Object(n.jsx)(yn.a,{align:"center",children:null===(i=e.plantillasCertificados)||void 0===i?void 0:i.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(r=e.plantillasCertificados)||void 0===r?void 0:r.nombre_privado}),Object(n.jsx)(yn.a,{align:"center",children:null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))&&Ne()(e.fecha_expiracion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:ie(e.account)}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_emision||1}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_aceptar_certificado||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_crear_cuenta||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_compartir_certificado||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_revocar||0}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,4)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,3)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,5)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,2)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,6)})]},"row".concat(t))})),function(){Object(I.A)(!0);try{var e,t,a=o.map((function(e){var t,a,n,i=e.certificadosCamposValores.sort((function(e,t){var a,n;return(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)<(null===(n=t.certificadoCampos)||void 0===n?void 0:n.nombre)?-1:1})).filter((function(e){var t,a;return 48!==(null===(t=e.certificadoCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)})).map((function(e){return Object(b.a)({},e.certificadoCampos.nombre,e.valor)})),r={};return i.map((function(e){return r=Object(m.a)(Object(m.a)({},r),e)})),Object(m.a)(Object(m.a)({Grupo:null===(t=e.gruposInsigniasEmitidas)||void 0===t?void 0:t.nombre,Estado:1===e.estado?w("tables:table.state-issue-certificate.issued"):2===e.estado?w("tables:table.state-issue-certificate.accepted"):3===e.estado?w("tables:table.state-issue-certificate.rejected"):4===e.estado?w("tables:table.state-issue-certificate.bounced-mail"):w("tables:table.state-issue-certificate.revoked"),"Fecha emisi\xf3n":Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss"),Email:e.email_receptor},r),{},{"C\xf3digo certificado":e.codigo_certificado,"Nombre p\xfablico certificado":null===(a=e.plantillasCertificados)||void 0===a?void 0:a.nombre,"Nombre privado certificado":null===(n=e.plantillasCertificados)||void 0===n?void 0:n.nombre_privado,"Fecha expiraci\xf3n":null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))?Ne()(e.fecha_expiracion).format("DD/MM/YYYY"):"",Cuenta:ie(e.account),"No. correos emisi\xf3n":e.correos_emision||1,"No. correos aceptar certificado":e.correos_aceptar_certificado||0,"No. correos crear cuenta":e.correos_crear_cuenta||0,"No. correos compartir certificado":e.correos_compartir_certificado||0,"No. correos revocar":e.correos_revocar||0,"No. veces compartidas en Facebook":re(e.estadisticasRedesSociales,4),"No. veces compartidas en LinkedIn":re(e.estadisticasRedesSociales,3),"No. veces compartidas en Twitter":re(e.estadisticasRedesSociales,5),"No. veces compartidas en WhatsApp":re(e.estadisticasRedesSociales,2),"No. veces compartidas en Telegram":re(e.estadisticasRedesSociales,6)})})),n=null===(e=o[0])||void 0===e||null===(t=e.gruposInsigniasEmitidas)||void 0===t?void 0:t.nombre;l({rows:a,filename:n})}catch(i){F.a.fire({icon:"error",iconColor:E.a.primary,text:w("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}),Object(I.A)(!1)}Object(I.A)(!1)}(),Object(n.jsxs)(O.a,{open:U,onClose:se,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(C.buttonDialog),onClick:se,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:H,className:C.img})})]})]}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"22",children:w("tables:table.empty-table")})})})}):2===u?Object(n.jsx)(zn,{columns:ne(),rows:v,setDirection:T,setOrderBy:R,changePagination:le,children:Object(n.jsx)(vn.a,{children:ee?Object(n.jsx)(qn,{columns:ne(),photo:0}):c.length>0?Object(n.jsxs)(n.Fragment,{children:[Object(I.J)(c,Object(I.f)(B,P)).slice(t*a,t*a+a).map((function(e,t){var a,i,r;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:e.gruposInsigniasEmitidas.nombre}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("span",{className:4===e.estado&&C.row,children:1===e.estado?w("tables:table.state-reports-carnets.issued"):2===e.estado?w("tables:table.state-reports-carnets.viewed"):3===e.estado?w("tables:table.state-reports-carnets.report"):4===e.estado?w("tables:table.state-reports-carnets.bounced-mail"):w("tables:table.state-reports-carnets.revoked")})}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.email_receptor}),null===(a=e.carnetsCamposValores)||void 0===a?void 0:a.map((function(e){var t,a;return 48!==(null===(t=e.carnetCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)&&Object(n.jsx)(yn.a,{align:"center",children:e.valor})})),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:w("tables:table.tooltip.view-carnet"),children:Object(n.jsx)("a",{href:"".concat(window.location.origin,"/carnet/verify/").concat(Object(Ie.b)(e.id)),target:"blank",children:e.codigo_carnet})})}),Object(n.jsx)(yn.a,{align:"center",children:null===(i=e.plantillasCarnets)||void 0===i?void 0:i.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(r=e.plantillasCarnets)||void 0===r?void 0:r.nombre_privado}),Object(n.jsx)(yn.a,{align:"center",children:null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))&&Ne()(e.fecha_expiracion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:ie(e.account)}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_emision||1}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_aceptar_certificado||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_crear_cuenta||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_compartir_certificado||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_revocar||0}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,4)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,3)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,5)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,2)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.estadisticasRedesSociales,6)})]},"row".concat(t))})),function(){Object(I.A)(!0);try{var e,t,a=c.map((function(e){var t,a,n,i=e.carnetsCamposValores.sort((function(e,t){var a,n;return(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)<(null===(n=t.carnetCampos)||void 0===n?void 0:n.nombre)?-1:1})).filter((function(e){var t,a;return 48!==(null===(t=e.carnetCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)})).map((function(e){var t,a,n;return(null===e||void 0===e||null===(t=e.carnetCampos)||void 0===t?void 0:t.nombre)?Object(b.a)({},null===e||void 0===e||null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre,null===e||void 0===e?void 0:e.valor):Object(b.a)({},null===e||void 0===e||null===(n=e.carnetCamposAdicionales)||void 0===n?void 0:n.nombre_campo,null===e||void 0===e?void 0:e.valor)})),r={};return i.map((function(e){return r=Object(m.a)(Object(m.a)({},r),e)})),Object(m.a)(Object(m.a)({Grupo:null===(t=e.gruposInsigniasEmitidas)||void 0===t?void 0:t.nombre,Estado:1===e.estado?w("tables:table.state-reports-carnets.issued"):2===e.estado?w("tables:table.state-reports-carnets.viewed"):3===e.estado?w("tables:table.state-reports-carnets.report"):4===e.estado?w("tables:table.state-reports-carnets.bounced-mail"):w("tables:table.state-reports-carnets.revoked"),"Fecha emisi\xf3n":Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss"),Email:e.email_receptor},r),{},{"C\xf3digo carnet":e.codigo_carnet,"Nombre p\xfablico carnet":null===(a=e.plantillasCarnets)||void 0===a?void 0:a.nombre,"Nombre privado carnet":null===(n=e.plantillasCarnets)||void 0===n?void 0:n.nombre_privado,"Fecha expiraci\xf3n":null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))?Ne()(e.fecha_expiracion).format("DD/MM/YYYY"):"",Cuenta:ie(e.account),"No. correos emisi\xf3n":e.correos_emision||1,"No. correos aceptar carnet":e.correos_aceptar_carnet||0,"No. correos crear cuenta":e.correos_crear_cuenta||0,"No. correos compartir carnet":e.correos_compartir_carnet||0,"No. correos revocar":e.correos_revocar||0,"No. veces compartidas en Facebook":re(e.estadisticasRedesSociales,4),"No. veces compartidas en LinkedIn":re(e.estadisticasRedesSociales,3),"No. veces compartidas en Twitter":re(e.estadisticasRedesSociales,5),"No. veces compartidas en WhatsApp":re(e.estadisticasRedesSociales,2),"No. veces compartidas en Telegram":re(e.estadisticasRedesSociales,6)})})),n=null===(e=c[0])||void 0===e||null===(t=e.gruposInsigniasEmitidas)||void 0===t?void 0:t.nombre;l({rows:a,filename:n})}catch(i){F.a.fire({icon:"error",iconColor:E.a.primary,text:w("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}),Object(I.A)(!1)}Object(I.A)(!1)}()]}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"22",children:w("tables:table.empty-table")})})})}):Object(n.jsx)(zn,{columns:oe(),rows:v,setDirection:T,setOrderBy:R,changePagination:le,children:Object(n.jsx)(vn.a,{children:ee?Object(n.jsx)(qn,{columns:oe(),photo:0}):c.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(c,Object(I.f)(B,P)).slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.planes.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.valor_estado}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_inicio).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.vencimiento).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:e.cantidad_emisiones}),Object(n.jsx)(yn.a,{align:"center",children:e.cantidad_insignias_emitidas}),Object(n.jsx)(yn.a,{align:"center",children:e.cantidad_certificados_emitidos}),Object(n.jsx)(yn.a,{align:"center",children:e.cantidad_carnets_emitidos}),Object(n.jsx)(yn.a,{align:"center",children:e.cantidad_documentos_emitidos}),Object(n.jsx)(yn.a,{align:"center",children:e.total_emisiones})]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"22",children:w("tables:table.empty-table")})})})})})),nl=a(1203),il=a(331),rl=function(e){var t=e.series,a=e.tipo,r=Object(D.a)(["analytics"]),c=Object(d.a)(r,1)[0],o=c(3!==a?"analytics:analytics-index.state-checkbox":"analytics:analytics-index.count-checkbox",{returnObjects:!0}),s={labels:["".concat(o[2].estado,": ").concat(t[0]),"".concat(o[1].estado,": ").concat(t[1]),"".concat(o[3].estado,": ").concat(t[2]),"".concat(o[0].estado,": ").concat(t[3])],datasets:[{data:t,backgroundColor:["#21C700","#D3D300","#C70000","#ff9900"]}]};return Object(n.jsx)(i.Fragment,{children:Object(n.jsx)("div",{className:"d-flex justify-content-center",children:Object(n.jsx)(il.a,{data:s,height:400,width:580,options:{maintainAspectRatio:!1,interaction:{intersect:!1,mode:"dataset"},plugins:{legend:{position:"bottom",labels:{color:"#000",font:{size:18}}},tooltip:{callbacks:{label:function(e){var t=0;e.dataset.data.map((function(e){t+=e}));var a=(100*e.parsed/t).toFixed(),n="".concat(e.label.split(":")[0],": ").concat(a,"%");return n}}}}}})})})},cl=a.p+"static/media/twitter-x-square.c087c3b2.svg",ol=Object(C.a)((function(){return{root:{marginTop:".5em"},title:{marginTop:".5em",textAlign:"center"},progress:{height:20,backgroundColor:E.a.footer},bar:{backgroundColor:"#000000"},barFacebook:{backgroundColor:"#4064ac"},barMessenger:{backgroundColor:"#0080f7"},barTwitter:{backgroundColor:"#2f3136"},barLinkedIn:{backgroundColor:"#2563ac"},barWhatsApp:{backgroundColor:"#42e35f"},barTelegram:{backgroundColor:"#34b3f7"},percentage:{marginLeft:".6em",backgroundColor:E.a.footer,padding:5},icon:{color:"#000000",marginRight:".6em"},iconFacebook:{color:"#4064ac",marginRight:".6em"},iconMessenger:{color:"#0080f7",marginRight:".6em"},iconLinkedin:{color:"#2563ac",marginRight:".6em"},iconTwitter:{color:"#34b3f7",marginRight:".6em",marginLeft:"-.5em"},iconWhatsapp:{color:"#42e35f",marginRight:".6em"},iconTelegram:{color:"#34b3f7",marginRight:".6em"},divider:{marginTop:".6em"},text:{width:"5em"}}})),sl=function(e){var t,a,i,r,c,o,s,l,u,m,b,p,j,f,h,g=ol(),x=e.socialNetworks,O=e.totalCompartidas,v=Object(D.a)(["analytics"]),_=Object(d.a)(v,1)[0];return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{component:"h6",variant:"h6",className:g.title,children:[_("times-share")," ",O]}),Object(n.jsxs)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(g.root),children:[Object(n.jsx)(qt.a,{icon:Kt.c,className:g.iconFacebook,size:"lg"}),Object(n.jsx)("div",{className:g.text,children:"Facebook"}),Object(n.jsx)(Oe.a,{className:"flex-grow-1 mx-2 ".concat(g.progress),classes:{bar:g.barFacebook},variant:"determinate",value:null===x||void 0===x||null===(t=x.facebook)||void 0===t?void 0:t.porcen}),Object(n.jsx)("div",{className:"font-weight-bold font-size-lg",children:null===x||void 0===x||null===(a=x.facebook)||void 0===a?void 0:a.cant}),Object(n.jsxs)("div",{className:"font-size-lg ".concat(g.percentage),children:[null===x||void 0===x||null===(i=x.facebook)||void 0===i?void 0:i.porcen,"%"]})]}),Object(n.jsx)(W.a,{className:g.divider}),Object(n.jsxs)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(g.root),children:[Object(n.jsx)(qt.a,{icon:Kt.d,className:g.iconLinkedin,size:"lg"}),Object(n.jsx)("div",{className:g.text,children:"LinkedIn"}),Object(n.jsx)(Oe.a,{className:"flex-grow-1 mx-2 ".concat(g.progress),classes:{bar:g.barLinkedIn},variant:"determinate",value:null===x||void 0===x||null===(r=x.linkedin)||void 0===r?void 0:r.porcen}),Object(n.jsx)("div",{className:"font-weight-bold font-size-lg",children:null===x||void 0===x||null===(c=x.linkedin)||void 0===c?void 0:c.cant}),Object(n.jsxs)("div",{className:"font-size-lg ".concat(g.percentage),children:[null===x||void 0===x||null===(o=x.linkedin)||void 0===o?void 0:o.porcen,"%"]})]}),Object(n.jsx)(W.a,{className:g.divider}),Object(n.jsxs)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(g.root),children:[Object(n.jsx)("img",{src:cl,alt:"XTwitter",height:23,className:g.iconTwitter}),Object(n.jsx)("div",{className:g.text,children:"Twitter"}),Object(n.jsx)(Oe.a,{className:"flex-grow-1 mx-2 ".concat(g.progress),classes:{bar:g.barTwitter},variant:"determinate",value:null===x||void 0===x||null===(s=x.twitter)||void 0===s?void 0:s.porcen}),Object(n.jsx)("div",{className:"font-weight-bold font-size-lg",children:null===x||void 0===x||null===(l=x.twitter)||void 0===l?void 0:l.cant}),Object(n.jsxs)("div",{className:"font-size-lg ".concat(g.percentage),children:[null===x||void 0===x||null===(u=x.twitter)||void 0===u?void 0:u.porcen,"%"]})]}),Object(n.jsx)(W.a,{className:g.divider}),Object(n.jsxs)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(g.root),children:[Object(n.jsx)(qt.a,{icon:Kt.g,className:g.iconWhatsapp,size:"lg"}),Object(n.jsx)("div",{className:g.text,children:"WhatsApp"}),Object(n.jsx)(Oe.a,{className:"flex-grow-1 mx-2 ".concat(g.progress),classes:{bar:g.barWhatsApp},variant:"determinate",value:null===x||void 0===x||null===(m=x.whatsapp)||void 0===m?void 0:m.porcen}),Object(n.jsx)("div",{className:"font-weight-bold font-size-lg",children:null===x||void 0===x||null===(b=x.whatsapp)||void 0===b?void 0:b.cant}),Object(n.jsxs)("div",{className:"font-size-lg ".concat(g.percentage),children:[null===x||void 0===x||null===(p=x.whatsapp)||void 0===p?void 0:p.porcen,"%"]})]}),Object(n.jsx)(W.a,{className:g.divider}),Object(n.jsxs)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(g.root),children:[Object(n.jsx)(qt.a,{icon:Kt.f,className:g.iconTelegram,size:"lg"}),Object(n.jsx)("div",{className:g.text,children:"Telegram"}),Object(n.jsx)(Oe.a,{className:"flex-grow-1 mx-2 ".concat(g.progress),classes:{bar:g.barTelegram},variant:"determinate",value:null===x||void 0===x||null===(j=x.telegram)||void 0===j?void 0:j.porcen}),Object(n.jsx)("div",{className:"font-weight-bold font-size-lg",children:null===x||void 0===x||null===(f=x.telegram)||void 0===f?void 0:f.cant}),Object(n.jsxs)("div",{className:"font-size-lg ".concat(g.percentage),children:[null===x||void 0===x||null===(h=x.telegram)||void 0===h?void 0:h.porcen,"%"]})]})]})},ll=Object(C.a)((function(e){return{root:{marginTop:".5em"},button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,"&:hover":{backgroundColor:E.a.secondary}}}}));var dl={changeBreadcrump:I.a},ul=Object(s.b)(null,dl)((function(e){var t,a,r,c,o=e.changeBreadcrump,s=e.filtro,l=e.setData,u=e.tipo,m=ll(),b=Object(D.a)(["breadCrumps","analytics"]),p=Object(d.a)(b,1)[0];Object(i.useEffect)((function(){o(p("breadCrumps:breadCrumps.analytics-statistics",{returnObjects:!0}))}),[]);var j=s.issued,f=0,h=0,g=0,x=0,O=0,v=0,_=0,y=0,w=0,C=0;null===(t=s.statsByState)||void 0===t||t.map((function(e){0===(null===e||void 0===e?void 0:e.estado)&&(g=null===e||void 0===e?void 0:e.total,x=null===e||void 0===e?void 0:e.porcentaje),1===(null===e||void 0===e?void 0:e.estado)&&(f=null===e||void 0===e?void 0:e.total,h=null===e||void 0===e?void 0:e.porcentaje),2===(null===e||void 0===e?void 0:e.estado)&&(O=null===e||void 0===e?void 0:e.total,v=null===e||void 0===e?void 0:e.porcentaje),3===(null===e||void 0===e?void 0:e.estado)&&(_=null===e||void 0===e?void 0:e.total,y=null===e||void 0===e?void 0:e.porcentaje),4===(null===e||void 0===e?void 0:e.estado)&&(w=null===e||void 0===e?void 0:e.total,C=null===e||void 0===e?void 0:e.porcentaje)}));var k=null===(a=s.accounts)||void 0===a?void 0:a.total,N=null===(r=s.accounts)||void 0===r?void 0:r.porcentaje,B=s.shared,S=0,T=0,A=0,E=0,I=0,z=0,P=0,R=0,M=0,L=0;null===(c=s.sharedBySocial)||void 0===c||c.map((function(e){2===(null===e||void 0===e?void 0:e.id_redes_sociales)&&(E=null===e||void 0===e?void 0:e.total,M=null===e||void 0===e?void 0:e.porcentaje),3===(null===e||void 0===e?void 0:e.id_redes_sociales)&&(T=null===e||void 0===e?void 0:e.total,P=null===e||void 0===e?void 0:e.porcentaje),4===(null===e||void 0===e?void 0:e.id_redes_sociales)&&(S=null===e||void 0===e?void 0:e.total,z=null===e||void 0===e?void 0:e.porcentaje),5===(null===e||void 0===e?void 0:e.id_redes_sociales)&&(A=null===e||void 0===e?void 0:e.total,R=null===e||void 0===e?void 0:e.porcentaje),6===(null===e||void 0===e?void 0:e.id_redes_sociales)&&(I=null===e||void 0===e?void 0:e.total,L=null===e||void 0===e?void 0:e.porcentaje)}));var F={facebook:{cant:S,porcen:z},linkedin:{cant:T,porcen:P},twitter:{cant:A,porcen:R},whatsapp:{cant:E,porcen:M},telegram:{cant:I,porcen:L}};return l([j,f,h,g,x,O,v,_,y,k,N,B,S,T,A,E,I,z,P,R,M,L,u,w,C]),Object(n.jsxs)(n.Fragment,{children:[3!==u?Object(n.jsx)(rl,{series:[O,f,_,g],tipo:u}):Object(n.jsx)(rl,{series:[s.badges.total,s.certificates.total,s.carnets.total,s.documents.total],tipo:u}),Object(n.jsx)(W.a,{}),Object(n.jsxs)(ye.a,{container:!0,spacing:1,justify:"space-evenly",className:m.root,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:12,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:3!==u?j:s.issuedTotal}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:0===u?p(1!==j?"analytics:analytics-statistics.badges-issued":"analytics:analytics-statistics.badge-issued"):1===u?p(1!==j?"analytics:analytics-statistics.certificates-issued":"analytics:analytics-statistics.certificate-issued"):2===u?p(1!==j?"analytics:analytics-statistics.carnets-issued":"analytics:analytics-statistics.carnet-issued"):"Emisiones"})]}),3!==u?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:O}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p(0===u?"analytics:analytics-statistics.badges-accepted":"analytics:analytics-statistics.certificates-accepted")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[v,"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.badge-certificate-accepted-porcen")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:f}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.pending")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[h,"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.pending")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:_}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p(0===u?"analytics:analytics-statistics.badges-rejected":"analytics:analytics-statistics.certificates-rejected")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[y,"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.badge-certificate-jected-porcen")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:g}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p(0===u?"analytics:analytics-statistics.badges-revoked":"analytics:analytics-statistics.certificates-revoked")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[x,"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p(0===u?"analytics:analytics-statistics.badges-revoked":"analytics:analytics-statistics.certificates-revoked")})]})]}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(W.a,{}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:12,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:s.restIssueds}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.issues-available")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:s.badges.total}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.badges-issued")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[s.badges.porcentaje,"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.percent-issued")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:s.certificates.total}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.certificates-issued")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[s.certificates.porcentaje,"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.percent-issued")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:s.carnets.total}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.carnets-issued")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[s.carnets.porcentaje,"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.percent-issued")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:s.documents.total}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.carnets-issued")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[s.documents.porcentaje,"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.percent-issued")})]})]})]}),3!==u?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(W.a,{}),Object(n.jsxs)(ye.a,{container:!0,spacing:1,justify:"space-evenly",className:m.root,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:k}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.account")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[N,"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:p("analytics:analytics-statistics.account-porcen")})]})]}),Object(n.jsx)(W.a,{}),Object(n.jsx)(sl,{socialNetworks:F,totalCompartidas:B})]}):""]})})),ml=a(1202),bl=Object(C.a)((function(){return{containerButton:{display:"flex",justifyContent:"space-between"},button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"10px 40px","&:hover":{backgroundColor:E.a.secondary}}}})),pl=function(e){var t=e.openDialog,a=void 0!==t&&t,i=e.setOpenDialog,r=e.setLoadingBackdrop,c=e.groupId,o=bl(),s=Object(D.a)(["alerts","buttons"]),l=Object(d.a)(s,1)[0],u=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r(!0),e.next=4,Ce.a.get("/badgesIssued/forwardEmail/".concat(c));case 4:t=e.sent,t.data.issued.length>0?(r(!1),F.a.fire({text:l("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(r(!1),F.a.fire({text:l("alerts:alerts.badges-to-accept"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),r(!1),F.a.fire({text:l("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),m=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r(!0),e.next=4,Ce.a.get("/badgesIssued/forwardEmail/signup/".concat(c));case 4:t=e.sent,t.data.issued>0?(r(!1),F.a.fire({text:l("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(r(!1),F.a.fire({text:l("alerts:alerts.no-accouts"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),r(!1),F.a.fire({text:l("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),b=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r(!0),e.next=4,Ce.a.get("/badgesIssued/forwardEmail/share/".concat(c));case 4:t=e.sent,t.data.issued>0?(r(!1),F.a.fire({text:l("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(r(!1),F.a.fire({text:l("alerts:alerts.no-share-badge"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),r(!1),F.a.fire({text:l("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();return Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(O.a,{open:a,onClose:function(){i(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{children:l("dialogs:dialog.choose-option")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsxs)("div",{className:"text-center ".concat(o.containerButton),children:[Object(n.jsxs)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(o.button),onClick:function(){i(!1),F.a.fire({title:l("alerts:alerts.badge-no-accepted"),text:l("alerts:alerts.resend"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:l("buttons:buttons.accept"),cancelButtonText:l("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?u():t.isDismissed&&i(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[l("buttons:buttons.reminder"),Object(n.jsx)("br",{}),l("buttons:buttons.badge-no-accepted")]}),Object(n.jsxs)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(o.button),onClick:function(){i(!1),F.a.fire({title:l("alerts:alerts.create-account"),text:l("alerts:alerts.email-account"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:l("buttons:buttons.accept"),cancelButtonText:l("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?m():t.isDismissed&&i(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[l("buttons:buttons.reminder"),Object(n.jsx)("br",{}),l("buttons:buttons.create-account")]}),Object(n.jsxs)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(o.button),onClick:function(){i(!1),F.a.fire({title:l("alerts:alerts.share-badge"),text:l("alerts:alerts.email-share"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:l("buttons:buttons.accept"),cancelButtonText:l("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?b():t.isDismissed&&i(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[l("buttons:buttons.reminder"),Object(n.jsx)("br",{}),l("buttons:buttons.share-badge")]})]})})]})})},jl=Object(C.a)((function(){return{containerButton:{display:"flex",justifyContent:"space-between"},button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"10px 40px","&:hover":{backgroundColor:E.a.secondary}}}})),fl=function(e){var t=e.openDialog,a=void 0!==t&&t,i=e.setOpenDialog,r=e.setLoadingBackdrop,c=e.groupId,o=jl(),s=Object(D.a)(["alerts","buttons"]),l=Object(d.a)(s,1)[0],u=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r(!0),e.next=4,Ce.a.get("/certificatesIssued/forwardEmail/".concat(c));case 4:t=e.sent,t.data.issued.length>0?(r(!1),F.a.fire({text:l("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(r(!1),F.a.fire({text:l("alerts:alerts.certificates-to-accept"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),r(!1),F.a.fire({text:l("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),m=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r(!0),e.next=4,Ce.a.get("/certificatesIssued/forwardEmail/signup/".concat(c));case 4:t=e.sent,t.data.issued>0?(r(!1),F.a.fire({text:l("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(r(!1),F.a.fire({text:l("alerts:alerts.no-accouts"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),r(!1),F.a.fire({text:l("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),b=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r(!0),e.next=4,Ce.a.get("/certificatesIssued/forwardEmail/share/".concat(c));case 4:t=e.sent,t.data.issued>0?(r(!1),F.a.fire({text:l("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(r(!1),F.a.fire({text:l("alerts:alerts.no-share-certificate"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),r(!1),F.a.fire({text:l("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();return Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(O.a,{open:a,onClose:function(){i(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{children:l("dialogs:dialog.choose-option")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsxs)("div",{className:"text-center ".concat(o.containerButton),children:[Object(n.jsxs)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(o.button),onClick:function(){i(!1),F.a.fire({title:l("alerts:alerts.certificate-no-accepted"),text:l("alerts:alerts.resend-certificate"),icon:"warning",showCancelButton:!0,iconColor:E.a.primary,confirmButtonText:l("buttons:buttons.accept"),cancelButtonText:l("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?u():t.isDismissed&&i(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[l("buttons:buttons.reminder"),Object(n.jsx)("br",{}),l("buttons:buttons.certificate-no-accepted")]}),Object(n.jsxs)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(o.button),onClick:function(){i(!1),F.a.fire({title:l("alerts:alerts.create-account"),text:l("alerts:alerts.email-account"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:l("buttons:buttons.accept"),cancelButtonText:l("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?m():t.isDismissed&&i(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[l("buttons:buttons.reminder"),Object(n.jsx)("br",{}),l("buttons:buttons.create-account")]}),Object(n.jsxs)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(o.button),onClick:function(){i(!1),F.a.fire({title:l("alerts:alerts.share-certificate"),text:l("alerts:alerts.email-share-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:l("buttons:buttons.accept"),cancelButtonText:l("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?b():t.isDismissed&&i(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[l("buttons:buttons.reminder"),Object(n.jsx)("br",{}),l("buttons:buttons.share-certificate")]})]})})]})})},hl=Object(C.a)((function(e){return{button:{margin:"0.5em"}}})),gl=function(e){var t=e.selectLoading,a=void 0!==t&&t,r=e.issuedType,c=e.groupId,o=e.setLoadingBackdrop,s=hl(),l=Object(D.a)(["alerts","buttons"]),u=Object(d.a)(l,1)[0],m=Object(i.useState)(!1),b=Object(d.a)(m,2),p=b[0],j=b[1],g=Object(i.useState)(!1),O=Object(d.a)(g,2),v=O[0],_=O[1],y=function(){F.a.fire({title:u("alerts:alerts.see-carnet"),text:u("alerts:alerts.resend-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:u("buttons:buttons.accept"),cancelButtonText:u("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value&&w();case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},w=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o(!0),e.next=4,Ce.a.get("/carnetsIssued/forwardEmail/".concat(c));case 4:t=e.sent,t.data.issued.length>0?(o(!1),F.a.fire({text:u("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(o(!1),F.a.fire({text:u("alerts:alerts.carnets-to-see"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),o(!1),F.a.fire({text:u("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(x.a,{disableElevation:!0,color:"primary",disabled:a,variant:"contained",className:"my-2 ".concat(s.button),onClick:function(){0===r[0]?j(!0):1===r[0]?_(!0):2===r[0]&&y()},children:[Object(n.jsx)(ml.a,{sx:{marginRight:"0.3em"}})," ",u("buttons:buttons.reminders")]}),Object(n.jsx)(pl,{openDialog:p,setOpenDialog:j,setLoadingBackdrop:o,groupId:c}),Object(n.jsx)(fl,{openDialog:v,setOpenDialog:_,setLoadingBackdrop:o,groupId:c})]})},xl=Object(C.a)((function(e){return{root:{marginTop:".5em",marginBottom:".5em"},button:{margin:"0.5em"},avatar:{marginRight:".4em",width:"20px",height:"20px",borderRadius:"5%","& img":{height:"min-content"}},check:{color:E.a.primary},icon:{marginRight:"0.3em"},tab:{color:"#000000"},indicator:{backgroundColor:"#000000"},circular:{color:E.a.primary},buttonsRight:{display:"flex",justifyContent:"right",alignItems:"right"}}}));var Ol={changePage:I.b},vl=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"anal\xedtica"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),rowsPerPage:e.rowsPerPage}}),Ol)((function(e){var t=e.permission,a=e.organizationId,r=e.user,c=e.rowsPerPage,o=e.changePage,s=Object(u.g)(),l=xl(),j=Object(i.useState)([]),g=Object(d.a)(j,2),O=g[0],v=g[1],_=Object(i.useState)([]),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(i.useState)([]),N=Object(d.a)(k,2),B=N[0],S=N[1],T=Object(i.useState)(0),A=Object(d.a)(T,2),I=A[0],z=A[1],P=Object(i.useState)({groupsBadgesIssued:"",email_receptor:"",templates:"",estado:[],cuenta:[],typeAnalysis:[1],fecha_inicio:"",fecha_fin:"",id_organizaciones:1!==r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?a:"",tipo:[0]}),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!0),Y=Object(d.a)(U,2),q=Y[0],H=Y[1],K=Object(i.useState)(!1),V=Object(d.a)(K,2),G=V[0],Q=V[1],J=Object(i.useState)(!1),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(!1),te=Object(d.a)(ee,2),ne=te[0],ie=te[1],re=Object(i.useState)([]),oe=Object(d.a)(re,2),se=oe[0],le=oe[1],de=Object(D.a)(["analytics","alerts","buttons","selects"]),ue=Object(d.a)(de,1)[0],me=ue("analytics:analytics-index.state-checkbox",{returnObjects:!0}),be=Object(i.useState)(!0),pe=Object(d.a)(be,2),fe=pe[0],he=pe[1],ge=Object(i.useState)([{}]),xe=Object(d.a)(ge,2),ke=xe[0],Be=xe[1],Se=Object(i.useState)([{}]),Ae=Object(d.a)(Se,2),Ee=Ae[0],Ie=Ae[1],De=Object(i.useState)([{}]),ze=Object(d.a)(De,2),Pe=ze[0],Re=ze[1],Me=Object(i.useState)(""),Le=Object(d.a)(Me,2),Fe=Le[0],Ue=Le[1],We=Object(i.useState)(),Ye=Object(d.a)(We,2),qe=Ye[0],He=Ye[1],Ke=Object(i.useState)(""),Ve=Object(d.a)(Ke,2),Ge=Ve[0],Qe=Ve[1],Je=Object(i.useState)(""),Xe=Object(d.a)(Je,2),Ze=Xe[0],$e=Xe[1],et=Object(i.useState)(null),tt=Object(d.a)(et,2),at=tt[0],nt=tt[1],it=Object(i.useState)(null),rt=Object(d.a)(it,2),ct=rt[0],ot=rt[1],st=Object(i.useState)(null),lt=Object(d.a)(st,2),dt=lt[0],ut=lt[1],bt=Object(i.useState)([{}]),pt=Object(d.a)(bt,2),jt=pt[0],ft=pt[1],ht=Object(i.useState)(null),gt=Object(d.a)(ht,2),xt=gt[0],vt=gt[1];Object(i.useEffect)((function(){yt().catch((function(){s.push("/500"),window.location.reload()}))}),[]),Object(i.useEffect)((function(){L(Object(m.a)(Object(m.a)({},M),{},{groupsBadgesIssued:"",templates:"",id_organizaciones:1!==r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?a:""})),yt().catch((function(){s.push("/500"),window.location.reload()}))}),[M.tipo]),Object(i.useEffect)((function(){""===M.groupsBadgesIssued&&L(Object(m.a)(Object(m.a)({},M),{},{templates:""})),""!==M.templates&&M.tipo.includes(0)&&L(Object(m.a)(Object(m.a)({},M),{},{templates:""}))}),[M.groupsBadgesIssued]),Object(i.useEffect)((function(){L(Object(m.a)(Object(m.a)({},M),{},{groupsBadgesIssued:""})),yt()}),[M.id_organizaciones]);var yt=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(he(!0),1!==r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios){e.next=4;break}return e.next=4,wt();case 4:return e.next=6,kt();case 6:return e.next=8,Nt();case 8:if(!(null===M||void 0===M?void 0:M.tipo.includes(3))){e.next=11;break}return e.next=11,Ct();case 11:he(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),wt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.get("/organization/analytics/".concat(M.tipo[0]));case 2:t=e.sent,a=t.data,Be(a.organizations);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ct=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/contract/getContracts",""!==M.id_organizaciones?{id_organizaciones:M.id_organizaciones}:{});case 2:t=e.sent,a=t.data,ft(a.contracts.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),kt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/groupsBadgesIssued/getGroups/analytics/".concat(M.tipo[0]),""!==M.id_organizaciones?{id:M.id_organizaciones}:{});case 2:t=e.sent,a=t.data,Ie(a.groups);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Nt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(3===M.tipo[0]){e.next=6;break}return e.next=3,Ce.a.post("/templateBadge/getTemplates/analytics/".concat(M.tipo[0]),""!==M.id_organizaciones?{id:M.id_organizaciones}:{});case 3:t=e.sent,a=t.data,Re(a.templatesBadges);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Bt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,s,l,d,u,m,b;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(M.fecha_inicio&&!M.fecha_fin||!M.fecha_inicio&&M.fecha_fin)){e.next=2;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-range-dates-invalid"),showConfirmButton:!1,timer:1500}));case 2:if(""===M.fecha_inicio||M.fecha_inicio!==M.fecha_fin){e.next=4;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-range-dates-invalid"),showConfirmButton:!1,timer:1500}));case 4:if(!(M.fecha_inicio>M.fecha_fin)){e.next=6;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-range-dates-invalid"),showConfirmButton:!1,timer:1500}));case 6:if(0!==M.typeAnalysis.length){e.next=8;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:"Debe seleccionar un tipo de anal\xedtica.",showConfirmButton:!1,timer:1500}));case 8:if(0!==M.typeAnalysis[0]||0===M.tipo[0]||3===M.tipo[0]||""!==M.groupsBadgesIssued||""!==M.templates||M.id_organizaciones===je.a.idEan){e.next=10;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:"Para la anal\xedtica de tipo 'Listado' debe seleccionar un grupo de emisi\xf3n o una plantilla.",showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 10:if(Q(!1),ie(!0),e.prev=12,0!==M.tipo[0]||0!==M.typeAnalysis[0]){e.next=24;break}return e.next=16,St();case 16:if(0!==(t=e.sent).length){e.next=20;break}return ie(!1),e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-no-datas"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 20:v(t),z(M.tipo[0]),e.next=99;break;case 24:if(0!==M.tipo[0]||1!==M.typeAnalysis[0]){e.next=35;break}return e.next=27,At();case 27:if(n=e.sent,$e(null===n||void 0===n?void 0:n.statistics),z(M.tipo[0]),0!==(null===n||void 0===n||null===(a=n.statistics)||void 0===a?void 0:a.issued)){e.next=33;break}return ie(!1),e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-no-datas"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 33:e.next=99;break;case 35:if(1!==M.tipo[0]||0!==M.typeAnalysis[0]){e.next=46;break}return e.next=38,Et();case 38:if(0!==(i=e.sent).length){e.next=42;break}return ie(!1),e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-no-datas"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 42:v(i),z(M.tipo[0]),e.next=99;break;case 46:if(1!==M.tipo[0]||1!==M.typeAnalysis[0]){e.next=57;break}return e.next=49,Dt();case 49:if(c=e.sent,$e(null===c||void 0===c?void 0:c.statistics),z(M.tipo[0]),0!==(null===c||void 0===c||null===(r=c.statistics)||void 0===r?void 0:r.issued)){e.next=55;break}return ie(!1),e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-no-datas"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 55:e.next=99;break;case 57:if(2!==M.tipo[0]||0!==M.typeAnalysis[0]){e.next=68;break}return e.next=60,zt();case 60:if(0!==(s=e.sent).length){e.next=64;break}return ie(!1),e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-no-datas"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 64:v(s),z(M.tipo[0]),e.next=99;break;case 68:if(2!==M.tipo[0]||1!==M.typeAnalysis[0]){e.next=79;break}return e.next=71,Pt();case 71:if(d=e.sent,$e(null===d||void 0===d?void 0:d.statistics),z(M.tipo[0]),0!==(null===d||void 0===d||null===(l=d.statistics)||void 0===l?void 0:l.issued)){e.next=77;break}return ie(!1),e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-no-datas"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 77:e.next=99;break;case 79:if(3!==M.tipo[0]||0!==M.typeAnalysis[0]){e.next=90;break}return e.next=82,Rt();case 82:if(0!==(u=e.sent).length){e.next=86;break}return ie(!1),e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-no-datas"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 86:v(u),z(M.tipo[0]),e.next=99;break;case 90:if(3!==M.tipo[0]||1!==M.typeAnalysis[0]){e.next=99;break}return e.next=93,Mt();case 93:if(b=e.sent,$e(null===b||void 0===b?void 0:b.statistics),0!==(null===b||void 0===b||null===(m=b.statistics)||void 0===m?void 0:m.issuedTotal)){e.next=98;break}return ie(!1),e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:ue("alerts:alerts.analytics-index-alert-no-datas"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 98:z(M.tipo[0]);case 99:o(0),1===M.typeAnalysis[0]?Ue("statistical"):Ue("list"),ie(!1),Q(!0),e.next=109;break;case 105:e.prev=105,e.t0=e.catch(12),ie(!1),F.a.fire({text:ue("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}});case 109:case"end":return e.stop()}}),e,null,[[12,105]])})));return function(){return e.apply(this,arguments)}}(),St=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,o,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},M.id_organizaciones&&(n.id_organizaciones=M.id_organizaciones),M.groupsBadgesIssued&&(n.id_grupos_insignias_emitidas=M.groupsBadgesIssued),M.templates&&(n.id_plantilla_insignias=M.templates),M.fecha_inicio&&(i=Ne()(M.fecha_inicio).format("YYYY-MM-DD hh:mm:ss"),r=Ne()(M.fecha_fin).format("YYYY-MM-DD hh:mm:ss"),n.fecha_ini=i,n.fecha_fin=r),M.estado.length>0&&(n.estado=M.estado),M.cuenta.length>0&&(n.cuentas=M.cuenta),0===M.typeAnalysis[0]?(n.limit=c||10,n.offset=0):(n.limit&&delete n.limit,n.offset&&delete n.offset),e.next=10,Ce.a.post("/badgesIssued/getBadgesIssued",n);case 10:return o=e.sent,s=o.data,Qe(n),He(null===s||void 0===s||null===(t=s.issued)||void 0===t?void 0:t.count),Tt(n),e.abrupt("return",null===(a=s.issued)||void 0===a?void 0:a.rows);case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Tt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.limit&&delete t.limit,t.offset&&delete t.offset,e.next=4,Ce.a.post("/badgesIssued/getBadgesIssued",t);case 4:n=e.sent,i=n.data,S(null===i||void 0===i||null===(a=i.issued)||void 0===a?void 0:a.rows);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),At=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},M.id_organizaciones&&(t.id_organizaciones=M.id_organizaciones),M.groupsBadgesIssued&&(t.id_grupos_insignias_emitidas=M.groupsBadgesIssued),M.templates&&(t.id_plantilla_insignias=M.templates),M.fecha_inicio&&(t.fecha_ini=M.fecha_inicio,t.fecha_fin=M.fecha_fin),M.estado.length>0&&(t.estado=M.estado),M.cuenta.length>0&&(t.cuentas=M.cuenta),e.next=9,Ce.a.post("/badgesIssued/getStatistics",t);case 9:return a=e.sent,n=a.data,Qe(t),e.abrupt("return",n);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Et=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,o,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},M.id_organizaciones&&(n.id_organizaciones=M.id_organizaciones),M.groupsBadgesIssued&&(n.id_grupos_certificados_emitidos=M.groupsBadgesIssued),M.templates&&(n.id_plantillas_certificados=M.templates),M.email_receptor&&(n.email_receptor=M.email_receptor),M.fecha_inicio&&(i=Ne()(M.fecha_inicio).format("YYYY-MM-DD hh:mm:ss"),r=Ne()(M.fecha_fin).format("YYYY-MM-DD hh:mm:ss"),n.fecha_ini=i,n.fecha_fin=r),M.estado.length>0&&(n.estado=M.estado),M.cuenta.length>0&&(n.cuentas=M.cuenta),0===M.typeAnalysis[0]?(n.limit=c||10,n.offset=0):(n.limit&&delete n.limit,n.offset&&delete n.offset),e.next=11,Ce.a.post("/certificatesIssued/getCertificatesIssued",n);case 11:return o=e.sent,s=o.data,Qe(n),He(null===s||void 0===s||null===(t=s.issued)||void 0===t?void 0:t.count),It(n),e.abrupt("return",null===s||void 0===s||null===(a=s.issued)||void 0===a?void 0:a.rows);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),It=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.limit&&delete t.limit,t.offset&&delete t.offset,e.next=4,Ce.a.post("/certificatesIssued/getCertificatesIssued",t);case 4:n=e.sent,i=n.data,S(null===i||void 0===i||null===(a=i.issued)||void 0===a?void 0:a.rows);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Dt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o,s,l,d,u;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},M.id_organizaciones&&(t.id_organizaciones=M.id_organizaciones),M.groupsBadgesIssued&&(t.id_grupos_certificados_emitidos=M.groupsBadgesIssued),M.templates&&(t.id_plantillas_certificados=M.templates),M.fecha_inicio&&(t.fecha_ini=M.fecha_inicio,t.fecha_fin=M.fecha_fin),M.email_receptor&&(t.email_receptor=M.email_receptor),M.estado.length>0&&(t.estado=M.estado),M.cuenta.length>0&&(t.cuentas=M.cuenta),e.next=10,Ce.a.post("/certificatesIssued/getStatistics/v2",{where:t,type:"totalIssued"});case 10:return a=e.sent,n=a.data,t.totalIssued=n.statistics,e.next=15,Ce.a.post("/certificatesIssued/getStatistics/v2",{where:t,type:"statsByState"});case 15:return i=e.sent,r=i.data,e.next=19,Ce.a.post("/certificatesIssued/getStatistics/v2",{where:t,type:"accounts"});case 19:return c=e.sent,o=c.data,e.next=23,Ce.a.post("/certificatesIssued/getStatistics/v2",{where:t,type:"shared"});case 23:return s=e.sent,l=s.data,t.sharedTotal=l.statistics,e.next=28,Ce.a.post("/certificatesIssued/getStatistics/v2",{where:t,type:"sharedBySocial"});case 28:return d=e.sent,u=d.data,Qe(t),e.abrupt("return",{statistics:{issued:n.statistics,statsByState:r.statistics,accounts:o.statistics,shared:l.statistics,sharedBySocial:u.statistics}});case 32:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),zt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,o,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},M.id_organizaciones&&(n.id_organizaciones=M.id_organizaciones),M.groupsBadgesIssued&&(n.id_grupos_carnets_emitidos=M.groupsBadgesIssued),M.templates&&(n.id_plantillas_carnets=M.templates),M.fecha_inicio&&(i=Ne()(M.fecha_inicio).format("YYYY-MM-DD hh:mm:ss"),r=Ne()(M.fecha_fin).format("YYYY-MM-DD hh:mm:ss"),n.fecha_ini=i,n.fecha_fin=r),M.estado.length>0&&(n.estado=M.estado),M.cuenta.length>0&&(n.cuentas=M.cuenta),0===M.typeAnalysis[0]?(n.limit=c||10,n.offset=0):(n.limit&&delete n.limit,n.offset&&delete n.offset),e.next=10,Ce.a.post("/carnetsIssued/getCarnetsIssued",n);case 10:return o=e.sent,s=o.data,Qe(n),He(null===s||void 0===s||null===(t=s.issued)||void 0===t?void 0:t.count),e.abrupt("return",null===(a=s.issued)||void 0===a?void 0:a.rows);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},M.id_organizaciones&&(t.id_organizaciones=M.id_organizaciones),M.groupsBadgesIssued&&(t.id_grupos_carnets_emitidos=M.groupsBadgesIssued),M.templates&&(t.id_plantillas_carnets=M.templates),M.fecha_inicio&&(t.fecha_ini=M.fecha_inicio,t.fecha_fin=M.fecha_fin),M.estado.length>0&&(t.estado=M.estado),M.cuenta.length>0&&(t.cuentas=M.cuenta),e.next=9,Ce.a.post("/carnetsIssued/getStatistics",t);case 9:return a=e.sent,n=a.data,Qe(t),e.abrupt("return",n);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Rt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},M.id_organizaciones&&(n.id_organizaciones=M.id_organizaciones),M.contracts&&(n.id=M.contracts),0===M.typeAnalysis[0]?(n.limit=c||10,n.offset=0):(n.limit&&delete n.limit,n.offset&&delete n.offset),e.next=6,Ce.a.post("/contract/getContracts",n);case 6:return i=e.sent,r=i.data,Qe(n),He(null===r||void 0===r||null===(t=r.contracts)||void 0===t?void 0:t.count),e.abrupt("return",null===(a=r.contracts)||void 0===a?void 0:a.rows);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Mt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},M.id_organizaciones&&(t.id_organizaciones=M.id_organizaciones),M.contracts&&(t.id=M.contracts),e.next=5,Ce.a.post("/contract/getStatistics",t);case 5:return a=e.sent,n=a.data,Qe(t),e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Lt=function(e){if(!M.tipo.includes(1)||"groupsBadgesIssued"!==e.target.name&&"email_receptor"!==e.target.name)if(M.tipo.includes(2)&&"groupsBadgesIssued"===e.target.name){var t,a,n,i=Ee.find((function(t){return!e.target.value||t.id===e.target.value.id}));nt(e.target.value),L(Object(m.a)(Object(m.a)({},M),{},(n={},Object(b.a)(n,e.target.name,e.target.value.id),Object(b.a)(n,"templates","".concat(null===i||void 0===i||null===(t=i.carnetsEmitidos[0])||void 0===t||null===(a=t.plantillasCarnets)||void 0===a?void 0:a.id)),n)))}else M.tipo.includes(3)&&"id_organizaciones"===e.target.name?(ut(e.target.value),L(Object(m.a)(Object(m.a)({},M),{},Object(b.a)({},e.target.name,e.target.value.id)))):"id_organizaciones"===e.target.name||"groupsBadgesIssued"===e.target.name||"contracts"===e.target.name||"templates"===e.target.name&&!M.groupsBadgesIssued?("groupsBadgesIssued"===e.target.name?(nt(e.target.value),L(Object(m.a)(Object(m.a)({},M),{},Object(b.a)({},e.target.name,e.target.value.id)))):"templates"===e.target.name?ot(e.target.value):"id_organizaciones"===e.target.name?ut(e.target.value):"contracts"===e.target.name&&vt(e.target.value),L(Object(m.a)(Object(m.a)({},M),{},Object(b.a)({},e.target.name,e.target.value.id)))):"templates"===e.target.name?ot(e.target.value):"fecha_inicio"===e.target.name||"fecha_fin"===e.target.name?L(Object(m.a)(Object(m.a)({},M),{},Object(b.a)({},e.target.name,e.target.value))):L(Object(m.a)(Object(m.a)({},M),{},Object(b.a)({},e.target.name,e.target.value.id)));else{var r,c,o,s=Ee.find((function(t){return!e.target.value||t.id===e.target.value.id}));if(nt(e.target.value),je.a.idEan===(null===M||void 0===M?void 0:M.id_organizaciones))L(Object(m.a)(Object(m.a)({},M),{},Object(b.a)({},e.target.name,e.target.value)));else L(Object(m.a)(Object(m.a)({},M),{},(o={},Object(b.a)(o,e.target.name,e.target.value.id),Object(b.a)(o,"templates","".concat(null===s||void 0===s||null===(r=s.certificadosEmitidos[0])||void 0===r||null===(c=r.plantillasCertificados)||void 0===c?void 0:c.id)),o)))}},Ft=function(e){return function(){var t=M.estado.indexOf(e),a=Object(p.a)(M.estado);-1===t?a.push(e):a.splice(t,1),L(Object(m.a)(Object(m.a)({},M),{},{estado:a}))}},Ut=function(e){return function(){var t=M.cuenta.includes(e),a=Object(p.a)(M.cuenta);t?L(Object(m.a)(Object(m.a)({},M),{},{cuenta:a.filter((function(t){return t!==e}))})):(a.push(e),L(Object(m.a)(Object(m.a)({},M),{},{cuenta:a})))}},Wt=function(e){(1===e||0===e)&&L(Object(m.a)(Object(m.a)({},M),{},{typeAnalysis:[e]}))},Yt=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:M.tipo.includes(t)||((1===t||0===t||2===t||3===t)&&(L(Object(m.a)(Object(m.a)({},M),{},{tipo:[t]})),nt(null),ot(null),ut(null),Q(!1)),Ue(""));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),function(){if(t.includes("Leer"))return Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(ve.a,{className:l.root,elevation:0,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",align:"center",children:ue("analytics:analytics-index.title")}),Object(n.jsxs)(ye.a,{container:!0,spacing:3,className:l.root,children:[Object(n.jsxs)(ye.a,{item:!0,lg:12,children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:ue("analytics:analytics-index.type")}),Object(n.jsx)(wi.a,{control:Object(n.jsx)(Ci.a,{disabled:fe,className:l.check,color:"default",checked:-1!==M.tipo.indexOf(0),onClick:function(){return Yt(0)}}),label:ue("analytics:analytics-index.radio-buttons-badges")}),Object(n.jsx)(wi.a,{control:Object(n.jsx)(Ci.a,{disabled:fe,className:l.check,color:"default",checked:-1!==M.tipo.indexOf(1),onClick:function(){return Yt(1)}}),label:ue("analytics:analytics-index.radio-buttons-certificates")}),Object(n.jsx)(wi.a,{control:Object(n.jsx)(Ci.a,{disabled:fe,className:l.check,color:"default",checked:-1!==M.tipo.indexOf(2),onClick:function(){return Yt(2)}}),label:ue("analytics:analytics-index.radio-buttons-carnets")}),1===r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&Object(n.jsx)(wi.a,{control:Object(n.jsx)(Ci.a,{disabled:fe,className:l.check,color:"default",checked:-1!==M.tipo.indexOf(3),onClick:function(){return Yt(3)}}),label:"Contratos"})]}),1===r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(oo.a,{value:dt,onChange:function(e,t){Lt({target:{name:"id_organizaciones",value:null!==t?t:""}})},id:"id_organizaciones",options:ke,getOptionLabel:function(e){return e.nombre},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{label:fe?"Cargando...":ue("analytics:analytics-index.select-organizations"),variant:"outlined",InputProps:Object(m.a)(Object(m.a)({},e.InputProps),{},{endAdornment:Object(n.jsx)(n.Fragment,{children:e.InputProps.endAdornment})})}))}}),fe&&Object(n.jsx)(Oe.a,{})]})}),(null===M||void 0===M?void 0:M.tipo.includes(3))&&Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(oo.a,{value:xt,onChange:function(e,t){Lt({target:{name:"contracts",value:null!==t?t:""}})},id:"contracts",options:jt,getOptionLabel:function(e){var t,a;return"".concat(null===e||void 0===e||null===(t=e.planes)||void 0===t?void 0:t.nombre," (").concat(null===e||void 0===e||null===(a=e.organizaciones)||void 0===a?void 0:a.nombre,") (").concat(null===e||void 0===e?void 0:e.valor_estado,")")},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{label:fe?"Cargando...":"Contratos",variant:"outlined",InputProps:Object(m.a)(Object(m.a)({},e.InputProps),{},{endAdornment:Object(n.jsx)(n.Fragment,{children:e.InputProps.endAdornment})})}))}}),fe&&Object(n.jsx)(Oe.a,{})]})})]}),!(null===M||void 0===M?void 0:M.tipo.includes(3))&&Object(n.jsxs)(n.Fragment,{children:[M.id_organizaciones!==je.a.idEan?Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(oo.a,{className:l.autocomplete,value:at,onChange:function(e,t){Lt({target:{name:"groupsBadgesIssued",value:t}})},options:Ee,getOptionLabel:function(e){var t;return"".concat(null===e||void 0===e?void 0:e.nombre," ").concat(1===r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?"(".concat(null===e||void 0===e||null===(t=e.organizaciones)||void 0===t?void 0:t.nombre,")"):""," ").concat(0===(null===e||void 0===e?void 0:e.estado)?"(Grupo revocado)":2===(null===e||void 0===e?void 0:e.estado)?"(Grupo en emisi\xf3n)":"")},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{label:fe?"Cargando...":ue("analytics:analytics-index.select-groups-issued"),variant:"outlined"}))}}),fe&&Object(n.jsx)(Oe.a,{})]})}):Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(oo.a,{className:l.autocomplete,value:at,onChange:function(e,t){Lt({target:{name:"email_receptor",value:t}})},options:Ee,getOptionLabel:function(e){return"".concat(e)},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{label:fe?"Cargando...":ue("Usuarios Emitidos"),variant:"outlined"}))}}),fe&&Object(n.jsx)(Oe.a,{})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{aling:"center",variant:"outlined",className:"w-100",children:[Object(n.jsx)(oo.a,{value:ct,onChange:function(e,t){Lt({target:{name:"templates",value:t}})},label:"templates",options:Pe,getOptionLabel:function(e){var t;return"".concat(e.nombre," ").concat(null!==e.nombre_privado?"(".concat(e.nombre_privado,")"):""," ").concat(1===r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?"(".concat(null===(t=e.organizaciones)||void 0===t?void 0:t.nombre,")"):"")},renderInput:function(e){return Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{label:fe?"Cargando...":ue("analytics:analytics-index.select-templates"),variant:"outlined"}))})}}),fe&&Object(n.jsx)(Oe.a,{})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:ue("analytics:analytics-index.date-start"),type:"date",variant:"outlined",name:"fecha_inicio",value:M.fecha_inicio,onChange:Lt,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start"})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:ue("analytics:analytics-index.date-end"),type:"date",variant:"outlined",name:"fecha_fin",value:M.fecha_fin,onChange:Lt,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start"})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:1,children:Object(n.jsx)(we.a,{component:"h8",variant:"h8",children:ue("analytics:analytics-index.states-title")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:7,children:me.sort((function(e,t){return e.orden<t.orden?-1:1})).map((function(e){return Object(n.jsx)(wi.a,{control:Object(n.jsx)(Hi.a,{className:l.check,color:"default",checked:-1!==M.estado.indexOf(e.id),onClick:Ft(e.id)}),label:e.estado})}))}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:4,children:[Object(n.jsxs)("p",{children:[" ",ue("analytics:analytics-index.account-title")]}),Object(n.jsx)(wi.a,{control:Object(n.jsx)(Hi.a,{className:l.check,color:"default",checked:M.cuenta.includes("Si"),onClick:Ut("Si")}),label:ue("analytics:analytics-index.account-checkbox-yes")}),Object(n.jsx)(wi.a,{control:Object(n.jsx)(Hi.a,{className:l.check,color:"default",checked:M.cuenta.includes("No"),onClick:Ut("No")}),label:ue("analytics:analytics-index.account-checkbox-no")})]})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)("spam",{children:[" ",ue("analytics:analytics-index.type-analytics"),": "]}),Object(n.jsx)(wi.a,{control:Object(n.jsx)(Ci.a,{className:l.check,color:"default",checked:-1!==M.typeAnalysis.indexOf(0),onClick:function(){return Wt(0)}}),label:ue("analytics:analytics-index.list")}),Object(n.jsx)(wi.a,{control:Object(n.jsx)(Ci.a,{className:l.check,color:"default",checked:-1!==M.typeAnalysis.indexOf(1),onClick:function(){return Wt(1)}}),label:ue("analytics:analytics-index.statistics")})]})]}),Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:7,children:[Object(n.jsxs)(x.a,{disableElevation:!0,color:"primary",disabled:fe,variant:"contained",className:"my-2 ".concat(l.button),onClick:function(){return Bt()},children:[Object(n.jsx)(nl.a,{sx:{marginRight:"0.3em"}})," ",ue("buttons:buttons.filter")]}),Object(n.jsxs)(x.a,{disableElevation:!0,color:"primary",disabled:fe,variant:"contained",className:"my-2 ".concat(l.button),onClick:function(){F.a.fire({text:ue("alerts:alerts.analytics-index-alert-delete-filter"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ue("buttons:buttons.accept"),cancelButtonText:ue("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.value&&(L({groupsBadgesIssued:"",templates:"",estado:[],cuenta:[],fecha_inicio:"",fecha_fin:"",tipo:[M.tipo[0]],typeAnalysis:[1]}),Q(!1),H(q),ie(!1),nt(null),ot(null),ut(null),vt(null),Ue(""))}))},children:[Object(n.jsx)(ae.a,{sx:{marginRight:"0.3em"}})," ",ue("buttons:buttons.delete")]})]}),G&&Object(n.jsx)(ye.a,{item:!0,xs:12,lg:5,children:Object(n.jsxs)("div",{className:l.buttonsRight,children:[(null===M||void 0===M?void 0:M.groupsBadgesIssued)&&Object(n.jsx)(gl,{selectLoading:fe,issuedType:null===M||void 0===M?void 0:M.tipo,groupId:null===M||void 0===M?void 0:M.groupsBadgesIssued,setLoadingBackdrop:$}),3!==I?Object(n.jsxs)(x.a,{disableElevation:!0,color:"primary",disabled:fe,variant:"contained",className:"my-2 ".concat(l.button),onClick:function(){return 0===M.typeAnalysis[0]?void Tc(w.rows,w.filename):void window.open("/analytics/exportStatistics/".concat(se))},children:[Object(n.jsx)(va.a,{sx:{marginRight:"0.3em"}})," ",ue("buttons:buttons.export")]}):""]})})]}),Object(n.jsx)(ce.a,{in:ne,children:Object(n.jsx)(ye.a,{container:!0,direction:"row",alignItems:" center",justify:"space-evenly",children:Object(n.jsx)(ye.a,{item:!0,xs:1,lg:1,children:Object(n.jsx)(Ot.a,{className:l.circular,color:"default"})})})}),Object(n.jsx)(W.a,{}),Object(n.jsx)(ce.a,{in:G,children:"list"===Fe?Object(n.jsx)(al,{filtro:O,dataToExportExcel:B,setFiltradas:v,setDataExcel:C,tipo:I,countItems:qe,where:Ge}):"statistical"===Fe&&Object(n.jsx)(ul,{filtro:Ze,setData:le,tipo:I})})]})})});s.push("/dashboard"),window.location.reload()}(),Object(n.jsx)(_t,{loading:Z})]})})),_l=a(567),yl=a.n(_l),wl=Object(C.a)((function(e){return{cortina:{padding:"30%"},chart:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},root:{marginTop:".5em"},title:{marginTop:".5em",textAlign:"center"},progress:{height:20,backgroundColor:E.a.footer},bar:{backgroundColor:"#000000"},barFacebook:{backgroundSize:"50%",backgroundColor:"#4064ac"},barMessenger:{backgroundColor:"#0080f7"},barTwitter:{backgroundColor:"#2f3136"},barLinkedIn:{backgroundColor:"#2563ac"},barWhatsApp:{backgroundColor:"#42e35f"},barTelegram:{backgroundColor:"#34b3f7"},percentage:{marginLeft:".6em",backgroundColor:E.a.footer,padding:5},icon:{color:"#000000",marginRight:".6em"},iconFacebook:{color:"#4064ac",marginRight:".6em"},iconMessenger:{color:"#0080f7",marginRight:".6em"},iconLinkedin:{color:"#2563ac",marginRight:".6em"},iconTwitter:{color:"#34b3f7",marginRight:".6em",marginLeft:"-.5em"},iconWhatsapp:{color:"#42e35f",marginRight:".6em"},iconTelegram:{color:"#34b3f7",marginRight:".6em"},divider:{marginTop:".6em"},text:{width:"5em"}}}));var Cl=function(e){var t=wl(),a=[];e.match.params.series.split(",").map((function(e){return a.push(parseInt(e))}));var r=[a[5],a[1],a[7],a[3],a[23]],c=Object(i.useState)(!0),o=Object(d.a)(c,2),s=o[0],l=o[1],u=Object(D.a)(["analytics"]),m=Object(d.a)(u,1)[0];Object(i.useEffect)((function(){s?yl()(document.querySelector("#contenedor")).then((function(e){var t=document.createElement("a");t.download=m("analytics:analytics-statistics.name-document-export-png"),t.href=e.toDataURL(),t.click()})).then((function(){l(!1)})):window.close()}),[s]);var b={labels:["".concat(0===a[22]?m("analytics:analytics-statistics.badges-accepted"):m("analytics:analytics-statistics.certificates-accepted"),": ").concat(r[0]," - ").concat(a[6],"%"),"".concat(m("analytics:analytics-statistics.pending"),": ").concat(r[1]," - ").concat(a[2],"%"),"".concat(0===a[22]?m("analytics:analytics-statistics.badges-rejected"):m("analytics:analytics-statistics.certificates-rejected"),": ").concat(r[2]," - ").concat(a[8],"%"),"".concat(0===a[22]?m("analytics:analytics-statistics.badges-revoked"):m("analytics:analytics-statistics.certificates-revoked"),": ")],datasets:[{data:r,backgroundColor:["#21C700","#D3D300","#C70000","#ff9900"]}]},p={animation:!1,events:[""],maintainAspectRatio:!1,plugins:{legend:{title:{display:!0,text:m("analytics:analytics-statistics.title-document-export"),color:"#000",font:{size:30,weight:"bold"},padding:{bottom:30}},position:"top",labels:{color:"#000",font:{size:18}}}}};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("div",{className:t.cortina}),Object(n.jsxs)("div",{id:"contenedor",children:[Object(n.jsx)("div",{className:"d-flex justify-content-center",children:Object(n.jsx)(il.a,{className:t.chart,data:b,height:400,width:580,options:p})}),Object(n.jsx)(W.a,{}),Object(n.jsxs)(ye.a,{container:!0,spacing:1,justify:"space-evenly",className:t.root,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:12,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:a[0]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:0===a[22]?1!==a[0]?m("analytics:analytics-statistics.badges-issued"):m("analytics:analytics-statistics.badge-issued"):1===a[22]?1!==a[0]?m("analytics:analytics-statistics.certificates-issued"):m("analytics:analytics-statistics.certificate-issued"):1!==a[0]?m("analytics:analytics-statistics.carnets-issued"):m("analytics:analytics-statistics.carnet-issued")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:a[5]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:0===a[22]?m("analytics:analytics-statistics.badges-accepted"):m("analytics:analytics-statistics.certificates-accepted")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[a[6],"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:m("analytics:analytics-statistics.badge-certificate-accepted-porcen")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:a[1]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:m("analytics:analytics-statistics.pending")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[a[2],"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:m("analytics:analytics-statistics.pending")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:a[7]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:0===a[22]?m("analytics:analytics-statistics.badges-rejected"):m("analytics:analytics-statistics.certificates-rejected")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[a[8],"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:m("analytics:analytics-statistics.badge-certificate-jected-porcen")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:a[3]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:0===a[22]?m("analytics:analytics-statistics.badges-revoked"):m("analytics:analytics-statistics.certificates-revoked")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[a[4],"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:0===a[22]?m("analytics:analytics-statistics.badges-revoked"):m("analytics:analytics-statistics.certificates-revoked")})]})]}),Object(n.jsx)(W.a,{}),Object(n.jsxs)(ye.a,{container:!0,spacing:1,justify:"space-evenly",className:t.root,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",align:"center",children:a[9]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:m("analytics:analytics-statistics.account")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:6,children:[Object(n.jsxs)(we.a,{component:"h4",variant:"h4",align:"center",children:[a[10],"%"]}),Object(n.jsx)(we.a,{align:"center",gutterBottom:!0,children:m("analytics:analytics-statistics.account-porcen")})]})]}),Object(n.jsx)(W.a,{}),Object(n.jsxs)("div",{className:"container",children:[Object(n.jsxs)(we.a,{component:"h6",variant:"h6",className:t.title,children:[m("times-share")," ",a[11]]}),Object(n.jsxs)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(t.root),children:[Object(n.jsx)(qt.a,{icon:Kt.c,className:t.iconFacebook,size:"lg"}),Object(n.jsx)("div",{className:t.text,children:"Facebook"}),Object(n.jsx)(Oe.a,{className:"flex-grow-1 mx-2 ".concat(t.progress),classes:{bar:t.barFacebook},variant:"determinate",value:50*(a[17]-0)/100+50}),Object(n.jsx)("div",{className:"font-weight-bold font-size-lg",children:a[12]}),Object(n.jsxs)("div",{className:"font-size-lg ".concat(t.percentage),children:[a[17],"%"]})]}),Object(n.jsx)(W.a,{className:t.divider}),Object(n.jsxs)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(t.root),children:[Object(n.jsx)(qt.a,{icon:Kt.d,className:t.iconLinkedin,size:"lg"}),Object(n.jsx)("div",{className:t.text,children:"LinkedIn"}),Object(n.jsx)(Oe.a,{className:"flex-grow-1 mx-2 ".concat(t.progress),classes:{bar:t.barLinkedIn},variant:"determinate",value:50*(a[18]-0)/100+50}),Object(n.jsx)("div",{className:"font-weight-bold font-size-lg",children:a[13]}),Object(n.jsxs)("div",{className:"font-size-lg ".concat(t.percentage),children:[a[18],"%"]})]}),Object(n.jsx)(W.a,{className:t.divider}),Object(n.jsxs)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(t.root),children:[Object(n.jsx)("img",{src:cl,alt:"XTwitter",height:23}),Object(n.jsx)("div",{className:t.text,children:"Twitter"}),Object(n.jsx)(Oe.a,{className:"flex-grow-1 mx-2 ".concat(t.progress),classes:{bar:t.barTwitter},variant:"determinate",value:50*(a[19]-0)/100+50}),Object(n.jsx)("div",{className:"font-weight-bold font-size-lg",children:a[14]}),Object(n.jsxs)("div",{className:"font-size-lg ".concat(t.percentage),children:[a[19],"%"]})]}),Object(n.jsx)(W.a,{className:t.divider}),Object(n.jsxs)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(t.root),children:[Object(n.jsx)(qt.a,{icon:Kt.g,className:t.iconWhatsapp,size:"lg"}),Object(n.jsx)("div",{className:t.text,children:"WhatsApp"}),Object(n.jsx)(Oe.a,{className:"flex-grow-1 mx-2 ".concat(t.progress),classes:{bar:t.barWhatsApp},variant:"determinate",value:50*(a[20]-0)/100+50}),Object(n.jsx)("div",{className:"font-weight-bold font-size-lg",children:a[15]}),Object(n.jsxs)("div",{className:"font-size-lg ".concat(t.percentage),children:[a[20],"%"]})]}),Object(n.jsx)(W.a,{className:t.divider}),Object(n.jsxs)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(t.root),children:[Object(n.jsx)(qt.a,{icon:Kt.f,className:t.iconTelegram,size:"lg"}),Object(n.jsx)("div",{className:t.text,children:"Telegram"}),Object(n.jsx)(Oe.a,{className:"flex-grow-1 mx-2 ".concat(t.progress),classes:{bar:t.barTelegram},variant:"determinate",value:50*(a[21]-0)/100+50}),Object(n.jsx)("div",{className:"font-weight-bold font-size-lg",children:a[16]}),Object(n.jsxs)("div",{className:"font-size-lg ".concat(t.percentage),children:[a[21],"%"]})]}),Object(n.jsx)(W.a,{className:t.divider}),Object(n.jsx)("div",{className:"d-flex flex-grow-1 pl-0 pl-xl-3 align-items-center ".concat(t.root)})]})]})]})},kl=Object(C.a)((function(e){return{cellCopy:{textTransform:"none",transitionProperty:"none","&:hover":{color:"#0056b3",backgroundColor:"white",textDecoration:"underline",cursor:"pointer"}},large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},namePrivate:{color:"rgba(0, 0, 0, 0.54)",fontSize:"0.875rem"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var Nl={changeBreadcrump:I.a,changePage:I.b},Bl=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"ids plantillas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),Nl)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.permission,o=e.changeBreadcrump,s=e.user,l=e.organizationId,m=e.changePage,b=Object(u.g)(),j=Object(i.useState)([]),O=Object(d.a)(j,2),v=O[0],_=O[1],y=Object(i.useState)(v),w=Object(d.a)(y,2),C=w[0],k=w[1],N=kl(),B=Object(i.useState)(""),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)(""),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!1),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(D.a)(["alerts","tables","breadCrumps"]),X=Object(d.a)(J,1)[0];Object(i.useEffect)((function(){m(0),Z().catch((function(){b.push("/500"),window.location.reload()})),o(X("breadCrumps:breadCrumps.ids-templates-badges",{returnObjects:!0}))}),[]);var Z=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return q(!0),e.next=3,ne();case 3:q(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,ee=6===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,te=6===(null===(t=s.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),ae=function(e,t){var a={limit:t||10,offset:e?e*t:0};return $||(a.id_organizaciones=l),a},ne=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,c,o,l,d;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ae(0,r),e.next=3,Ce.a.post("/templateBadge/getTemplatesBadgesPublished",t);case 3:a=e.sent,n=a.data,ee||te?(c=null===(i=n.templatesBadges)||void 0===i?void 0:i.rows.filter((function(e){return e.plantillasCertificadosHistorial[0].id_usuarios===s.data_user.id})),_(c),k(c),Q(c.length)):(_(null===(o=n.templatesBadges)||void 0===o?void 0:o.rows),k(null===(l=n.templatesBadges)||void 0===l?void 0:l.rows),Q(null===(d=n.templatesBadges)||void 0===d?void 0:d.count));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){F.a.fire({icon:"success",iconColor:E.a.primary,text:X("alerts:alerts.template-copy"),showConfirmButton:!1,timer:1500})},re=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:q(!0),t=null===C||void 0===C?void 0:C.map((function(e){return{"Id Plantilla":e.codigo,"Nombre P\xfablico Plantilla":e.nombre,"Nombre Privado Plantilla":e.nombre_privado,Estado:1===e.estado?"Publicada":0===e.estado?"En Edici\xf3n":2===e.estado?"Archivada":"Eliminada","Fecha de Creaci\xf3n":Ne()(e.fecha_creacion).format("DD/MM/YYYY HH:mm:ss"),"\xdaltima Actualizaci\xf3n":Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}})),Tc(t,"ID Plantillas Insignias"),q(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return q(!0),i=ae(t,a),e.next=4,Ce.a.post("/templateBadge/getTemplatesBadgesPublished",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(v),Object(p.a)(null===(n=c.templatesBadges)||void 0===n?void 0:n.rows.filter((function(e){return!v.find((function(t){return t.id===e.id}))})))),_(o),k(o),q(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),oe=function(){return X("tables:table.columns-ids-templates-badges",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:v.length>0&&Object(n.jsx)(x.a,{className:N.button,onClick:re,children:Object(n.jsx)(K.a,{title:X("tables:table.tooltip.export"),children:Object(n.jsx)(va.a,{})})})}),function(){if(c.includes("Leer"))return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Fn,{tableName:"templateBadge",type:"published",items:v,setItems:k,setCountItems:Q,changePage:m,loadData:Z,organizationId:1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:l,deparmentCreater:{isDeparmentCreater:ee,isDeparmentCreaterRoll:te,userId:s.data_user.id},setLoading:q}),Object(n.jsx)(zn,{columns:oe(),rows:G,setDirection:z,setOrderBy:L,loading:Y,changePagination:ce,children:Object(n.jsx)(vn.a,{children:C.length>0?Y?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:oe(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(C,Object(I.f)(A,M)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(Pt.CopyToClipboard,{text:e.codigo,onCopy:ie,children:Object(n.jsx)(yn.a,{align:"center",className:N.cellCopy,children:e.codigo})}),Object(n.jsxs)(yn.a,{align:"center",children:[Object(n.jsx)(g.a,{alt:"Remy Sharp",src:null===e||void 0===e?void 0:e.linkPhoto,className:N.large}),e.nombre,Object(n.jsx)("p",{className:N.namePrivate,children:e.nombre_privado})]}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado?X("tables:table.state.published"):" "}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_creacion).format("DD/MM/YYYY HH:mm")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYY HH:mm")}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:X("tables:table.tooltip.view-template"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return a=e.id,m(0),void b.push("/templates/published/details/".concat(Object(Ie.b)(a)));var a},children:Object(n.jsx)(Ge.a,{})})})})]},"row".concat(e.id))}))}):Y?Object(n.jsx)(qn,{columns:oe(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:X("tables:table.empty-table")})})})]});b.push("/dashboard"),window.location.reload()}()]})})),Sl=Object(C.a)((function(){return{btnClose:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"},img_vertical:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"},img_horizontal:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"}}})),Tl=function(e){var t=e.open,a=e.setOpen,i=e.setImgTemplate,r=e.imgTemplate,c=Sl(),o=function(){a(!1),i("")};return Object(n.jsxs)(O.a,{open:t,onClose:o,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(c.btnClose),onClick:o,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:r.photo,className:r.width>r.height?c.img_horizontal:c.img_vertical})})]})},Al=Object(C.a)((function(e){return{cellCopy:{textTransform:"none",transitionProperty:"none","&:hover":{color:"#0056b3",backgroundColor:"white",textDecoration:"underline",cursor:"pointer"}},large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},namePrivate:{color:"rgba(0, 0, 0, 0.54)",fontSize:"0.875rem"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var El={changeBreadcrump:I.a,changePage:I.b,setDetails:I.r},Il=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"ids plantillas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),El)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.permission,o=e.changeBreadcrump,s=e.user,l=e.organizationId,m=e.changePage,b=e.setDetails,j=Object(u.g)(),O=Object(i.useState)([]),v=Object(d.a)(O,2),_=v[0],y=v[1],w=Object(i.useState)(_),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Al(),T=Object(i.useState)(""),A=Object(d.a)(T,2),z=A[0],P=A[1],R=Object(i.useState)(""),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)(!1),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],V=Object(i.useState)(),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)(""),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)(!1),ae=Object(d.a)(te,2),ne=ae[0],ie=ae[1],re=Object(D.a)(["alerts","tables","breadCrumps"]),ce=Object(d.a)(re,1)[0];Object(i.useEffect)((function(){m(0),oe().catch((function(){j.push("/500"),window.location.reload()})),o(ce("breadCrumps:breadCrumps.ids-templates-documents",{returnObjects:!0}))}),[]);var oe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(!0),e.next=3,me();case 3:H(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),se=1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,le=6===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,de=6===(null===(t=s.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),ue=function(){var e={};return se||(e.id_organizaciones=l),e},me=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ue(),e.next=3,Ce.a.post("/documentTemplate/getDocumentTemplatesPublished",t);case 3:a=e.sent,n=a.data,le||de?(r=null===(i=n.documentTemplates)||void 0===i?void 0:i.rows.filter((function(e){return e.plantillasDocumentosHistorial[0].id_usuarios===s.data_user.id})),y(r),N(r),J(r.length)):(y(n.documentTemplates),N(n.documentTemplates),J(null===(c=n.documentTemplates)||void 0===c?void 0:c.length));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),be=function(){F.a.fire({icon:"success",iconColor:E.a.primary,text:ce("alerts:alerts.template-copy"),showConfirmButton:!1,timer:1500})},pe=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:H(!0),t=null===k||void 0===k?void 0:k.map((function(e){return{"Id Plantilla":e.codigo,"Nombre P\xfablico Plantilla":e.nombre,"Nombre Privado Plantilla":e.nombre_privado,Estado:1===e.estado?"Publicada":0===e.estado?"En Edici\xf3n":2===e.estado?"Archivada":"Eliminada","Fecha de Creaci\xf3n":Ne()(e.fecha_creacion).format("DD/MM/YYYY HH:mm:ss"),"\xdaltima Actualizaci\xf3n":Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}})),Tc(t,"ID Plantillas Documentos"),H(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),je=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(!0),i=ue(),e.next=4,Ce.a.post("/documentTemplate/getDocumentTemplatesPublished",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(_),Object(p.a)(null===(n=c.documentTemplates)||void 0===n?void 0:n.filter((function(e){return!_.find((function(t){return t.id===e.id}))})))),y(o),N(o),H(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),fe=function(){return ce("tables:table.columns-ids-templates-documents",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:_.length>0&&Object(n.jsx)(x.a,{className:B.button,onClick:pe,children:Object(n.jsx)(K.a,{title:ce("tables:table.tooltip.export"),children:Object(n.jsx)(va.a,{})})})}),function(){if(c.includes("Leer"))return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Fn,{tableName:"templateDocument",type:"published",items:_,setItems:N,changePage:m,loadData:oe,organizationId:1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:l,deparmentCreater:{isDeparmentCreater:le,isDeparmentCreaterRoll:de,userId:s.data_user.id},setLoading:H}),Object(n.jsx)(zn,{columns:fe(),rows:Q,setDirection:P,setOrderBy:U,loading:q,changePagination:je,children:Object(n.jsx)(vn.a,{children:k.length>0?q?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:fe(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(k,Object(I.f)(z,L)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(Pt.CopyToClipboard,{text:e.codigo,onCopy:be,children:Object(n.jsx)(yn.a,{align:"center",className:B.cellCopy,children:e.codigo})}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:ce("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{variant:"square",src:e.linkPhotoTemplate,className:B.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,ee({photo:t,width:a,height:n}),void ie(!0);var t,a,n}})})}),Object(n.jsxs)(yn.a,{align:"center",children:[e.nombre,Object(n.jsx)("p",{className:B.namePrivate,children:e.nombre_privado})]}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado?ce("tables:table.state.published"):" "}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_creacion).format("DD/MM/YYYY HH:mm")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYY HH:mm")}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:ce("tables:table.tooltip.view-template"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e,t){m(0),b(t),j.push("/templates/documents/published/details/".concat(Object(Ie.b)(t.id)))}(0,e)},children:Object(n.jsx)(Ge.a,{})})})})]},"row".concat(e.id))}))}):q?Object(n.jsx)(qn,{columns:fe(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:ce("tables:table.empty-table")})})})]});j.push("/dashboard"),window.location.reload()}(),Object(n.jsx)(Tl,{open:ne,setOpen:ie,setImgTemplate:ee,imgTemplate:$})]})}));var Dl=Object(C.a)((function(e){return{cellCopy:{textTransform:"none",transitionProperty:"none","&:hover":{color:"#0056b3",backgroundColor:"white",textDecoration:"underline",cursor:"pointer"}},large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},namePrivate:{color:"rgba(0, 0, 0, 0.54)",fontSize:"0.875rem"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}})),zl={changeBreadcrump:I.a,changePage:I.b,setDetails:I.r},Pl=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"ids plantillas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),zl)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.permission,o=e.changeBreadcrump,s=e.user,l=e.organizationId,m=e.changePage,b=e.setDetails,j=Object(u.g)(),O=Object(i.useState)([]),v=Object(d.a)(O,2),_=v[0],y=v[1],w=Object(i.useState)(_),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Dl(),T=Object(i.useState)(""),A=Object(d.a)(T,2),z=A[0],P=A[1],R=Object(i.useState)(""),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)(!1),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],V=Object(i.useState)(),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)(""),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)(!1),ae=Object(d.a)(te,2),ne=ae[0],ie=ae[1],re=Object(D.a)(["alerts","tables","breadCrumps"]),ce=Object(d.a)(re,1)[0];Object(i.useEffect)((function(){m(0),oe().catch((function(){j.push("/500"),window.location.reload()})),o(ce("breadCrumps:breadCrumps.ids-templates-certificates",{returnObjects:!0}))}),[]);var oe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(!0),e.next=3,me();case 3:H(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),se=1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,le=6===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,de=6===(null===(t=s.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),ue=function(){var e={};return se||(e.id_organizaciones=l),e},me=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o,l;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ue(),e.next=3,Ce.a.post("/certificateTemplate/getCertificateTemplatesPublished",t);case 3:a=e.sent,n=a.data,le||de?(r=null===(i=n.certificateTemplates)||void 0===i?void 0:i.rows.filter((function(e){return e.plantillasCertificadosHistorial[0].id_usuarios===s.data_user.id})),y(r),N(r),J(r.length)):(y(null===(c=n.certificateTemplates)||void 0===c?void 0:c.rows),N(null===(o=n.certificateTemplates)||void 0===o?void 0:o.rows),J(null===(l=n.certificateTemplates)||void 0===l?void 0:l.count));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),be=function(){F.a.fire({icon:"success",iconColor:E.a.primary,text:ce("alerts:alerts.template-copy"),showConfirmButton:!1,timer:1500})},pe=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:H(!0),t=null===k||void 0===k?void 0:k.map((function(e){return{"Id Plantilla":e.codigo,"Nombre P\xfablico Plantilla":e.nombre,"Nombre Privado Plantilla":e.nombre_privado,Estado:1===e.estado?"Publicada":0===e.estado?"En Edici\xf3n":2===e.estado?"Archivada":"Eliminada","Fecha de Creaci\xf3n":Ne()(e.fecha_creacion).format("DD/MM/YYYY HH:mm:ss"),"\xdaltima Actualizaci\xf3n":Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}})),Tc(t,"ID Plantillas Certificados"),H(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),je=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(!0),i=ue(),e.next=4,Ce.a.post("/certificateTemplate/getCertificateTemplatesPublished",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(_),Object(p.a)(null===(n=c.certificateTemplates)||void 0===n?void 0:n.filter((function(e){return!_.find((function(t){return t.id===e.id}))})))),y(o),N(o),H(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),fe=function(){return ce("tables:table.columns-ids-templates-certificates",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:_.length>0&&Object(n.jsx)(x.a,{className:B.button,onClick:pe,children:Object(n.jsx)(K.a,{title:ce("tables:table.tooltip.export"),children:Object(n.jsx)(va.a,{})})})}),function(){if(c.includes("Leer"))return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Fn,{tableName:"templateCertificate",type:"published",items:_,setItems:N,setCountItems:J,changePage:m,loadData:oe,organizationId:1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:l,deparmentCreater:{isDeparmentCreater:le,isDeparmentCreaterRoll:de,userId:s.data_user.id},setLoading:H}),Object(n.jsx)(zn,{columns:fe(),rows:Q,setDirection:P,setOrderBy:U,loading:q,changePagination:je,children:Object(n.jsx)(vn.a,{children:k.length>0?q?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:fe(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(k,Object(I.f)(z,L)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(Pt.CopyToClipboard,{text:e.codigo,onCopy:be,children:Object(n.jsx)(yn.a,{align:"center",className:B.cellCopy,children:e.codigo})}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:ce("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{variant:"square",src:e.linkPhotoTemplate,className:B.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,ee({photo:t,width:a,height:n}),void ie(!0);var t,a,n}})})}),Object(n.jsxs)(yn.a,{align:"center",children:[e.nombre,Object(n.jsx)("p",{className:B.namePrivate,children:e.nombre_privado})]}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado?ce("tables:table.state.published"):" "}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_creacion).format("DD/MM/YYYY HH:mm")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYY HH:mm")}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:ce("tables:table.tooltip.view-template"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e,t){m(0),b(t),j.push("/certificates/details/".concat(Object(Ie.b)(t.id)))}(0,e)},children:Object(n.jsx)(Ge.a,{})})})})]},"row".concat(e.id))}))}):q?Object(n.jsx)(qn,{columns:fe(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:ce("tables:table.empty-table")})})})]});j.push("/dashboard"),window.location.reload()}(),Object(n.jsx)(Tl,{open:ne,setOpen:ie,setImgTemplate:ee,imgTemplate:$})]})})),Rl=a(1204);var Ml=Object(C.a)((function(){return{containerButton:{display:"flex",justifyContent:"space-between"},button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"10px 40px","&:hover":{backgroundColor:E.a.secondary}}}})),Ll={changePage:I.b,changeBreadcrump:I.a},Fl=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"insignias emitidas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),Ll)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changePage,o=e.changeBreadcrump,s=e.user,l=e.organizationId,j=e.searchValue,g=Object(u.g)(),y=Ml(),w=Object(i.useState)([]),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)(!1),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!1),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(!1),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!1),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(0),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ie=Object(i.useState)({}),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)(""),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(i.useState)(""),be=Object(d.a)(me,2),pe=be[0],je=be[1],fe=Object(i.useState)(),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Object(D.a)(["alerts","tables","buttons","breadCrumps","dialogs"]),ve=Object(d.a)(Oe,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?_e().catch((function(){g.push("/500"),window.location.reload()})):(g.push("/dashboard"),window.location.reload())}),[]);var _e=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(L(!0),j&&""!==j){e.next=4;break}return e.next=4,Be();case 4:o(ve("breadCrumps:breadCrumps.groups-badge-issued",{returnObjects:!0})),L(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ye=1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,ke=function(e,t){var a={limit:t||10,offset:e?e*t:0};return ye||(a.id_organizaciones=l),a},Be=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(r=ke(0,a)).estado=1,e.next=5,Ce.a.post("/groupsBadgesIssued/getGroups",r);case 5:c=e.sent,o=c.data,N(null===(t=o.groups)||void 0===t?void 0:t.rows),z(null===(n=o.groups)||void 0===n?void 0:n.rows),xe(null===(i=o.groups)||void 0===i?void 0:i.count),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),g.push("/500"),window.location.reload();case 16:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),i=ke(t,a),e.next=4,Ce.a.post("/groupsBadgesIssued/getGroups",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(k),Object(p.a)(null===(n=c.groups)||void 0===n?void 0:n.rows.filter((function(e){return!k.find((function(t){return t.id===e.id}))})))),N(o),z(o),L(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Ae=function(e){F.a.fire({text:ve("alerts:alerts.revoke-group"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ve("buttons:buttons.accept"),cancelButtonText:ve("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Ee(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Ee=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,F.a.fire({text:ve("alerts:alerts.revoke-message"),input:"textarea",inputPlaceholder:ve("alerts:alerts.message-here"),inputAttributes:{"aria-label":ve("alerts:alerts.message-here")},showCancelButton:!0,confirmButtonText:ve("buttons:buttons.send"),cancelButtonText:ve("buttons:buttons.cancel"),showLoaderOnConfirm:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"},inputValidator:function(e){if(!e)return ve("alerts:alerts.write-message")}});case 3:if(a=e.sent,!(n=a.value)){e.next=14;break}return q(!0),e.next=9,Ce.a.delete("/badgesIssued/revoke/".concat(t),{data:{mensaje:n}});case 9:i=e.sent,r=i.data,N(k.filter((function(e){return e.id!==t}))),z(k.filter((function(e){return e.id!==t}))),r&&(q(!1),F.a.fire({text:ve("alerts:alerts.revoke"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}));case 14:e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),q(!1),F.a.fire({text:ve("alerts:alerts.revoke-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 20:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(t){return e.apply(this,arguments)}}(),De=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,q(!0),e.next=4,Ce.a.get("/badgesIssued/forwardEmail/".concat(ae));case 4:t=e.sent,t.data.issued.length>0?(q(!1),F.a.fire({text:ve("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(q(!1),F.a.fire({text:ve("alerts:alerts.badges-to-accept"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),q(!1),F.a.fire({text:ve("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),ze=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,q(!0),e.next=4,Ce.a.get("/badgesIssued/forwardEmail/signup/".concat(ae));case 4:t=e.sent,t.data.issued>0?(q(!1),F.a.fire({text:ve("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(q(!1),F.a.fire({text:ve("alerts:alerts.no-accouts"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),q(!1),F.a.fire({text:ve("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),Pe=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,q(!0),e.next=4,Ce.a.get("/badgesIssued/forwardEmail/share/".concat(ae));case 4:t=e.sent,t.data.issued>0?(q(!1),F.a.fire({text:ve("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(q(!1),F.a.fire({text:ve("alerts:alerts.no-share-badge"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),q(!1),F.a.fire({text:ve("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),Re=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:ve("tables:table.tooltip.revoke"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return function(e,t,a){switch(a){case"delete":Ae(t)}}(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})})},Me=function(e){if(r.includes("Enviar correos"))return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:ve("tables:table.tooltip.sent-email"),children:Object(n.jsx)(S.a,{"aria-label":"emails",onClick:function(){return Fe(e)},children:Object(n.jsx)(Rl.a,{})})})})},Le=function(e){if(r.includes("Editar"))return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:ve("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return Ue(e)},children:Object(n.jsx)(Wn,{})})})})},Fe=function(e){ne(e),Q(!0)},Ue=function(e){var t=null===k||void 0===k?void 0:k.filter((function(t){return t.id===e}));oe(Object(m.a)({},t[0])),$(!0)},We=function(){$(!1)},Ye=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),We(),e.prev=2,e.next=5,Ce.a.put("/groupsBadgesIssued/".concat(ce.id),{nombre:ce.nombre});case 5:a=e.sent,a.data&&F.a.fire({text:ve("alerts:alerts.edited"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),Be(),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),F.a.fire({text:ve("alerts:alerts.edited-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),g.push("/500"),window.location.reload();case 16:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(t){return e.apply(this,arguments)}}(),qe=function(){return ve("tables:table.columns-group-badges-issued",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"groupIssued",type:"badges",items:k,setItems:z,setCountItems:xe,changePage:c,loadData:_e,setLoading:L,organizationId:1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:l}),Object(n.jsx)(zn,{columns:qe(),rows:ge,setDirection:ue,setOrderBy:je,loading:M,changePagination:Se,children:Object(n.jsx)(vn.a,{children:M?Object(n.jsx)(qn,{columns:qe(),photo:0}):A.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(A,Object(I.f)(de,pe)).slice(t*a,t*a+a).map((function(e,t){var a,i,r;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.nombre)}),Object(n.jsx)(yn.a,{align:"center",children:"".concat((null===(a=e.organizaciones)||void 0===a?void 0:a.nombre)||e.nombre_organizacion)}),Object(n.jsx)(yn.a,{align:"center",children:"".concat((null===(i=e.usuarios)||void 0===i?void 0:i.primer_nombre)||e.primer_nombre," ").concat((null===(r=e.usuarios)||void 0===r?void 0:r.primer_apellido)||e.primer_apellido)}),Object(n.jsxs)(yn.a,{align:"center",children:[e.BadgesIssued,Object(n.jsx)(K.a,{title:ve("tables:table.tooltip.view-badge"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return a=Object(Ie.b)(e.id),c(0),void g.push("/badgesIssued/badges/".concat(a));var a},children:Object(n.jsx)(Ge.a,{})})})]}),Le(e.id),Me(e.id),Re(e.id)]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"8",children:ve("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:G,onClose:function(){Q(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{children:ve("dialogs:dialog.choose-option")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsxs)("div",{className:"text-center ".concat(y.containerButton),children:[Object(n.jsxs)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(y.button),onClick:function(){Q(!1),F.a.fire({title:ve("alerts:alerts.badge-no-accepted"),text:ve("alerts:alerts.resend"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ve("buttons:buttons.accept"),cancelButtonText:ve("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?De():t.isDismissed&&Q(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[ve("buttons:buttons.reminder"),Object(n.jsx)("br",{}),ve("buttons:buttons.badge-no-accepted")]}),Object(n.jsxs)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(y.button),onClick:function(){Q(!1),F.a.fire({title:ve("alerts:alerts.create-account"),text:ve("alerts:alerts.email-account"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ve("buttons:buttons.accept"),cancelButtonText:ve("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?ze():t.isDismissed&&Q(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[ve("buttons:buttons.reminder"),Object(n.jsx)("br",{}),ve("buttons:buttons.create-account")]}),Object(n.jsxs)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(y.button),onClick:function(){Q(!1),F.a.fire({title:ve("alerts:alerts.share-badge"),text:ve("alerts:alerts.email-share"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ve("buttons:buttons.accept"),cancelButtonText:ve("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?Pe():t.isDismissed&&Q(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[ve("buttons:buttons.reminder"),Object(n.jsx)("br",{}),ve("buttons:buttons.share-badge")]})]})})]}),Object(n.jsxs)(O.a,{open:Z,onClose:We,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{children:ve("dialogs:dialog.edit-group-badge-issue")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsxs)("form",{onSubmit:Ye,children:[Object(n.jsx)(we.a,{gutterBottom:!0,children:ve("dialogs:dialog.badge-group-issue-name")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{autoFocus:!0,required:!0,id:"nombre",name:"nombre",variant:"outlined",onChange:function(e){oe(Object(m.a)(Object(m.a)({},ce),{},Object(b.a)({},e.target.name,e.target.value)))},value:ce.nombre})}),Object(n.jsxs)("div",{className:"text-center ".concat(y.root),style:{marginTop:"1.5em"},children:[Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(y.button),type:"submit",children:ve("buttons:buttons.edit")}),Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(y.button),onClick:We,children:ve("buttons:buttons.cancel")})]})]})})]}),Object(n.jsx)(_t,{loading:Y})]})})),Ul=a(1205),Wl=a(1206),Yl=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",margin:"5px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},row:{color:"#dc2626",fontWeight:"bold"}}}));var ql={changeBreadcrump:I.a,changePage:I.b},Hl=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"insignias emitidas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),ql)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=e.permission,o=e.user,s=e.organizationId,l=e.changePage,m=e.searchValue,b=Object(i.useState)([]),j=Object(d.a)(b,2),O=j[0],v=j[1],_=Object(i.useState)([]),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Yl(),N=Object(u.g)(),B=Object(i.useState)(""),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)(""),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!0),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(D.a)(["alerts","tables","buttons","breadCrumps","dialogs"]),X=Object(d.a)(J,1)[0];Object(i.useEffect)((function(){c.includes("Leer")?Z().catch((function(){N.push("/500"),window.location.reload()})):(N.push("/dashboard"),window.location.reload())}),[]);var Z=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m&&""!==m){e.next=3;break}return e.next=3,te();case 3:r(X("breadCrumps:breadCrumps.groups-badge-issued-badges-issued",{returnObjects:!0})),q(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,ee=function(e,t){var a={limit:t||10,offset:e?e*t:0};return $||(a.id_organizaciones=s),a},te=function(){var t=Object(h.a)(f.a.mark((function t(){var n,i,r,c,o,s,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,c=ee(0,a),o=Object(Ie.a)(e.match.params.id),c.id_grupos_insignias_emitidas=o,t.next=6,Ce.a.post("/badgesIssued/getBadgesIssued",c);case 6:s=t.sent,l=s.data,v(null===(n=l.issued)||void 0===n?void 0:n.rows),C(null===(i=l.issued)||void 0===i?void 0:i.rows),Q(null===(r=l.issued)||void 0===r?void 0:r.count),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(0),N.push("/500"),window.location.reload();case 17:case"end":return t.stop()}}),t,null,[[0,13]])})));return function(){return t.apply(this,arguments)}}(),ae=function(){var t=Object(h.a)(f.a.mark((function t(a,n){var i,r,c,o,s,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return q(!0),r=ee(a,n),c=Object(Ie.a)(e.match.params.id),r.id_grupos_insignias_emitidas=c,t.next=6,Ce.a.post("/badgesIssued/getBadgesIssued",r);case 6:o=t.sent,s=o.data,l=[].concat(Object(p.a)(O),Object(p.a)(null===(i=s.issued)||void 0===i?void 0:i.rows.filter((function(e){return!O.find((function(t){return t.id===e.id}))})))),v(l),C(l),q(!1);case 12:case"end":return t.stop()}}),t)})));return function(e,a){return t.apply(this,arguments)}}(),ne=function(e,t,a){F.a.fire({text:"".concat(X("alerts:alerts.revoke-undo-1")," ").concat(a," ").concat(X("alerts:alerts.revoke-undo-2")),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:X("buttons:buttons.accept"),cancelButtonText:X("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.value&&ie(t,a);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},ie=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("revocar"!==a){e.next=21;break}return e.prev=1,e.next=4,F.a.fire({text:X("alerts:alerts.revoke-message"),input:"textarea",inputPlaceholder:X("alerts:alerts.message-here"),inputAttributes:{"aria-label":X("alerts:alerts.message-here")},showCancelButton:!0,confirmButtonText:X("buttons:buttons.send"),cancelButtonText:X("buttons:buttons.cancel"),showLoaderOnConfirm:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"},inputValidator:function(e){if(!e)return X("alerts:alerts.write-message")}});case 4:if(n=e.sent,!(i=n.value)){e.next=13;break}return q(!0),e.next=10,Ce.a.delete("/badgesIssued/revoke/badge/".concat(t),{data:{mensaje:i}});case 10:r=e.sent,r.data&&(O.map((function(e){return e.id===t&&te()})),q(!1),F.a.fire({text:X("alerts:alerts.revoke"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}));case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(1),q(!1),F.a.fire({text:X("alerts:alerts.revoke-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 19:e.next=34;break;case 21:return e.prev=21,q(!0),e.next=25,Ce.a.delete("/badgesIssued/undo/badge/".concat(t));case 25:c=e.sent,c.data&&(O.map((function(e){return e.id===t&&te()})),q(!1),F.a.fire({text:X("alerts:alerts.undo-revoke"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})),e.next=34;break;case 30:e.prev=30,e.t1=e.catch(21),q(!1),F.a.fire({text:X("alerts:alerts.undo-revoke-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 34:case"end":return e.stop()}}),e,null,[[1,15],[21,30]])})));return function(t,a){return e.apply(this,arguments)}}(),re=function(e){var t=O.find((function(t){return 0===t.estado&&t.id===e}));if(c.includes("Eliminar"))return t?Object(n.jsx)(K.a,{title:X("tables:table.tooltip.undo-revoke"),children:Object(n.jsx)(S.a,{"aria-label":"delete",children:Object(n.jsx)(Ul.a,{onClick:function(t){return ne(0,e,"desrevocar")}})})}):Object(n.jsx)(K.a,{title:X("tables:table.tooltip.revoke"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return ne(0,e,"revocar")},children:Object(n.jsx)(Cn.a,{})})})},ce=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return q(!0),t.prev=1,t.next=4,Ce.a.post("/badgesIssued/getBadgesIssued",{id_grupos_insignias_emitidas:Object(Ie.a)(e.match.params.id)});case 4:o=t.sent,s=o.data,l=null===s||void 0===s||null===(a=s.issued)||void 0===a||null===(n=a.rows)||void 0===n?void 0:n.map((function(e){var t,a,n;return{Grupo:null===(t=e.gruposInsigniasEmitidas)||void 0===t?void 0:t.nombre,Estado:1===e.estado?X("tables:table.state-issue.issued"):2===e.estado?X("tables:table.state-issue.accepted"):3===e.estado?X("tables:table.state-issue.rejected"):4===e.estado?X("tables:table.state-issue.bounced-mail"):X("tables:table.state-issue.revoked"),"Fecha emisi\xf3n":Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss"),Nombres:"".concat(e.primer_nombre_receptor," ").concat(e.segundo_nombre_receptor||""),Apellidos:"".concat(e.primer_apellido_receptor," ").concat(e.segundo_apellido_receptor||""),Email:e.email_receptor,"Tipo de identificaci\xf3n":e.tipo_identificacion,"Identificaci\xf3n":e.identificacion,"C\xf3digo insignia":e.codigo_insignia,"Nombre p\xfablico insignia":null===(a=e.plantillasInsignias)||void 0===a?void 0:a.nombre,"Nombre privado insignia":null===(n=e.plantillasInsignias)||void 0===n?void 0:n.nombre_privado,"Fecha expiraci\xf3n":null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))?Ne()(e.fecha_expiracion).format("DD/MM/YYYY"):"",Celular:e.numero_celular,WhatsApp:e.numero_whatsapp,Telegram:e.numero_telegram,Merito:e.merito,"Link merito":e.link_merito,Cuenta:oe(e.account),"No. correos emisi\xf3n":e.correos_emision||1,"No. correos aceptar insignia":e.correos_aceptar_insignia||0,"No. correos crear cuenta":e.correos_crear_cuenta||0,"No. correos compartir insignia":e.correos_compartir_insignia||0,"No. correos revocar":e.correos_revocar||0,"No. veces compartidas en Facebook":se(e.estadisticasRedesSociales,4),"No. veces compartidas en LinkedIn":se(e.estadisticasRedesSociales,3),"No. veces compartidas en Twitter":se(e.estadisticasRedesSociales,5),"No. veces compartidas en WhatsApp":se(e.estadisticasRedesSociales,2),"No. veces compartidas en Telegram":se(e.estadisticasRedesSociales,6)}})),Tc(l,null===s||void 0===s||null===(i=s.issued)||void 0===i||null===(r=i.rows[0])||void 0===r||null===(c=r.gruposInsigniasEmitidas)||void 0===c?void 0:c.nombre),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(1),F.a.fire({icon:"error",iconColor:E.a.primary,text:X("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}),q(!1);case 14:q(!1);case 15:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(){return t.apply(this,arguments)}}(),oe=function(e){return e?"Si":"No"},se=function(e,t){var a=e.filter((function(e){return e.id_redes_sociales===t}));return a.length>0?a.length:0},le=function(){return X("tables:table.columns-badges-issued",{returnObjects:!0})},de=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return q(!0),e.next=3,ct()({method:"post",url:"".concat(je.a.apiURL,"/badgesIssued/downloadCodesByGroupId"),data:{groupId:O[0].id_grupos_insignias_emitidas},responseType:"blob"});case 3:t=e.sent,a=t.data,n=window.URL.createObjectURL(new Blob([a])),(i=document.createElement("a")).href=n,i.setAttribute("download","".concat(O[0].gruposInsigniasEmitidas.nombre,".zip")),document.body.appendChild(i),i.click(),q(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:O.length>0&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",className:k.button,onClick:de,children:Object(n.jsx)(K.a,{title:X("tables:table.tooltip.download-code"),children:Object(n.jsx)(kc.a,{})})}),Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",className:k.button,onClick:ce,children:Object(n.jsx)(K.a,{title:X("tables:table.tooltip.export"),children:Object(n.jsx)(va.a,{})})}),Object(n.jsx)(K.a,{title:X("tables:table.tooltip.upgrade"),children:Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",className:k.button,onClick:function(){q(!0),Z()},children:Object(n.jsx)(Wl.a,{})})})]})}),Object(n.jsx)(Fn,{tableName:"BadgesIssued",items:O,setItems:C,groupId:Object(Ie.a)(e.match.params.id),setCountItems:Q,changePage:l,loadData:Z,setLoading:q,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s}),Object(n.jsx)(zn,{columns:le(),rows:G,setDirection:z,setOrderBy:L,changePagination:ae,children:Object(n.jsx)(vn.a,{children:Y?Object(n.jsx)(qn,{columns:le(),photo:0}):w.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(w,Object(I.f)(A,M)).slice(t*a,t*a+a).map((function(e,t){var a,i,r;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:e.gruposInsigniasEmitidas.nombre}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("span",{className:4===e.estado&&k.row,children:1===e.estado?X("tables:table.state-issue.pending"):2===e.estado?X("tables:table.state-issue.accepted"):3===e.estado?X("tables:table.state-issue.rejected"):4===e.estado?X("tables:table.state-issue.bounced-mail"):X("tables:table.state-issue.revoked")})}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{"aria-label":"img_badge",src:null===(a=e.plantillasInsignias)||void 0===a?void 0:a.linkPhoto,className:k.large})}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.primer_nombre_receptor," ").concat(e.segundo_nombre_receptor||"")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.primer_apellido_receptor," ").concat(e.segundo_apellido_receptor||"")}),Object(n.jsx)(yn.a,{align:"center",children:e.email_receptor}),Object(n.jsx)(yn.a,{align:"center",children:e.tipo_identificacion}),Object(n.jsx)(yn.a,{align:"center",children:e.identificacion}),Object(n.jsx)(yn.a,{align:"center",children:2!==e.estado&&0!==e.estado||"Si"!==oe(e.account)?e.codigo_insignia:Object(n.jsx)(K.a,{title:X("tables:table.tooltip.view-badge"),children:Object(n.jsx)("a",{href:"".concat(window.location.origin,"/badges/").concat(Object(Ie.b)(e.id)),target:"blank",children:e.codigo_insignia})})}),Object(n.jsx)(yn.a,{align:"center",children:null===(i=e.plantillasInsignias)||void 0===i?void 0:i.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(r=e.plantillasInsignias)||void 0===r?void 0:r.nombre_privado}),Object(n.jsx)(yn.a,{align:"center",children:null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))&&Ne()(e.fecha_expiracion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:e.numero_celular}),Object(n.jsx)(yn.a,{align:"center",children:e.numero_whatsapp}),Object(n.jsx)(yn.a,{align:"center",children:e.numero_telegram}),Object(n.jsx)(yn.a,{align:"justify",children:e.merito}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("a",{href:e.link_merito,target:"blank",children:e.link_merito})}),Object(n.jsx)(yn.a,{align:"center",children:oe(e.account)}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_emision||1}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_aceptar_insignia||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_crear_cuenta||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_compartir_insignia||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_revocar||0}),Object(n.jsx)(yn.a,{align:"center",children:se(e.estadisticasRedesSociales,4)}),Object(n.jsx)(yn.a,{align:"center",children:se(e.estadisticasRedesSociales,3)}),Object(n.jsx)(yn.a,{align:"center",children:se(e.estadisticasRedesSociales,5)}),Object(n.jsx)(yn.a,{align:"center",children:se(e.estadisticasRedesSociales,2)}),Object(n.jsx)(yn.a,{align:"center",children:se(e.estadisticasRedesSociales,6)}),Object(n.jsx)(yn.a,{align:"center",children:re(e.id)})]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"22",children:X("tables:table.empty-table")})})})})]})})),Kl=a(1207),Vl=a(333),Gl=Object(C.a)((function(e){return{container_center:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},option:{display:"flex",alignItems:"center"},avatar:{marginRight:e.spacing(2)}}})),Ql=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),null)((function(e){var t=e.user,a=e.open,r=e.setOpen,c=e.organizationId,o=Gl(),s=Object(i.useState)([]),l=Object(d.a)(s,2),u=l[0],p=l[1],j=Object(i.useState)(!0),y=Object(d.a)(j,2),w=y[0],C=y[1],k=Object(i.useState)({}),N=Object(d.a)(k,2),B=N[0],S=N[1],T=Object(i.useState)({id_plantilla:"",email_receptor:"",indicativo_pais:"",whatsapp_receptor:"",tipo_identificacion:"",identificacion:"",primer_nombre_receptor:"",segundo_nombre_receptor:"",primer_apellido_receptor:"",segundo_apellido_receptor:"",numero_celular:"",numero_telegram:"",merito:"",link_merito:"",fecha_expiracion:""}),A=Object(d.a)(T,2),E=A[0],I=A[1],z=Object(D.a)(["alerts","tables","buttons","certificateBadgeIssued","breadCrumps","dialogs","selects"]),P=Object(d.a)(z,1)[0],R=1===t.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===t.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,M=6===t.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios;Object(i.useEffect)((function(){L()}),[]);var L=function(){var e=Object(h.a)(f.a.mark((function e(){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!R){e.next=9;break}return e.next=3,Ce.a.post("/templateBadge/getTemplatesBadgesPublished/names");case 3:a=e.sent,n=a.data,p(n.templatesBadges),n&&C(!1),e.next=15;break;case 9:return e.next=11,Ce.a.post("/templateBadge/getTemplatesBadgesPublished/names",{id_organizaciones:c});case 11:i=e.sent,r=i.data,p(M?r.templatesBadges.filter((function(e){return e.plantillasInsigniasHistorial[0].id_usuarios===t.data_user.id})):r.templatesBadges),r&&C(!1);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),F=function(e){"email_receptor"===e.target.name&&(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e.target.value)||""===e.target.value?S(Object(m.a)(Object(m.a)({},B),{},Object(b.a)({},e.target.name,!1))):S(Object(m.a)(Object(m.a)({},B),{},Object(b.a)({},e.target.name,!0)))),"primer_nombre_receptor"!==e.target.name&&"segundo_nombre_receptor"!==e.target.name&&"primer_apellido_receptor"!==e.target.name&&"segundo_apellido_receptor"!==e.target.name||(/^[a-zA-Z\xc0-\xff\u00f1\u00d1 ]+$/.test(e.target.value)||""===e.target.value?S(Object(m.a)(Object(m.a)({},B),{},Object(b.a)({},e.target.name,!1))):S(Object(m.a)(Object(m.a)({},B),{},Object(b.a)({},e.target.name,!0)))),"identificacion"===e.target.name&&(document.test(e.target.value)||""===e.target.value?S(Object(m.a)(Object(m.a)({},B),{},Object(b.a)({},e.target.name,!1))):S(Object(m.a)(Object(m.a)({},B),{},Object(b.a)({},e.target.name,!0)))),"whatsapp_receptor"!==e.target.name&&"numero_celular"!==e.target.name&&"numero_telegram"!==e.target.name||(/^([0-9]{7,15})+$/.test(e.target.value)||""===e.target.value?S(Object(m.a)(Object(m.a)({},B),{},Object(b.a)({},e.target.name,!1))):S(Object(m.a)(Object(m.a)({},B),{},Object(b.a)({},e.target.name,!0)))),I(Object(m.a)(Object(m.a)({},E),{},Object(b.a)({},e.target.name,e.target.value)))};return Object(n.jsxs)(O.a,{fullWidth:!0,maxWidth:"md",open:a,onClose:function(){r(!1)},"aria-labelledby":"form-dialog-title",children:[Object(n.jsx)(v.a,{id:"form-dialog-title",children:"Agregar receptor"}),Object(n.jsx)(_.a,{children:Object(n.jsxs)("form",{children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(oo.a,{options:u.sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})),getOptionLabel:function(e){return"".concat(e.nombre," (").concat(e.nombre_privado,")")},renderOption:function(e){return Object(n.jsxs)(ye.a,{container:!0,alignItems:"center",className:o.option,children:[Object(n.jsx)(ye.a,{item:!0,children:Object(n.jsx)(g.a,{src:e.linkPhoto,className:o.avatar,variant:"square"})}),Object(n.jsx)(ye.a,{item:!0,children:"".concat(e.nombre," (").concat(e.nombre_privado,")")})]})},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{label:w?"Cargando...":"Seleccione una plantilla",variant:"outlined",InputProps:Object(m.a)(Object(m.a)({},e.InputProps),{},{endAdornment:Object(n.jsx)(n.Fragment,{children:e.InputProps.endAdornment})})}))}}),w&&Object(n.jsx)(Oe.a,{})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Email receptor",variant:"outlined",name:"email_receptor",type:"email",value:E.email_receptor,onChange:F,error:B.email_receptor,helperText:B.email_receptor&&"El correo electr\xf3nico es inv\xe1lido."})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Indicativo pa\xeds",variant:"outlined",name:"indicativo_pais",value:E.indicativo_pais,onChange:F})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"WhatsApp receptor",variant:"outlined",type:"number",name:"whatsapp_receptor",value:E.whatsapp_receptor,onChange:F})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(oo.a,{options:["CC","CE","CI","CIC","CIE","CIP","CURP","DNI","DPI","DUI","ID","NIT","PA","TI"],getOptionLabel:function(e){return"".concat(e)},renderOption:function(e){return Object(n.jsx)(ye.a,{container:!0,alignItems:"center",className:o.option,children:Object(n.jsx)(ye.a,{item:!0,children:"".concat(e)})})},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{label:w?"Cargando...":"Seleccione un tipo de identificaci\xf3n",variant:"outlined",InputProps:Object(m.a)(Object(m.a)({},e.InputProps),{},{endAdornment:Object(n.jsx)(n.Fragment,{children:e.InputProps.endAdornment})})}))}}),w&&Object(n.jsx)(Oe.a,{})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Identificaci\xf3n",variant:"outlined",name:"identificacion",value:E.identificacion,onChange:F})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Primer nombre",variant:"outlined",name:"primer_nombre_receptor",value:E.primer_nombre_receptor,onChange:F,error:B.primer_nombre_receptor,helperText:B.primer_nombre_receptor&&"Solo se permiten letras."})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Segundo nombre",variant:"outlined",name:"segundo_nombre_receptor",value:E.segundo_nombre_receptor,onChange:F,error:B.segundo_nombre_receptor,helperText:B.segundo_nombre_receptor&&"Solo se permiten letras."})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Primer apellido",variant:"outlined",name:"primer_apellido_receptor",value:E.primer_apellido_receptor,onChange:F,error:B.primer_apellido_receptor,helperText:B.primer_apellido_receptor&&"Solo se permiten letras."})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Segundo apellido",variant:"outlined",name:"segundo_apellido_receptor",value:E.segundo_apellido_receptor,onChange:F,error:B.segundo_apellido_receptor,helperText:B.segundo_apellido_receptor&&"Solo se permiten letras."})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"N\xfamero de Celular",variant:"outlined",name:"numero_celular",value:E.numero_celular,onChange:F})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"N\xfamero de Telegram",variant:"outlined",name:"numero_telegram",value:E.numero_telegram,onChange:F})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Merito",variant:"outlined",name:"merito",value:E.merito,onChange:F})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Link Merito",variant:"outlined",name:"link_merito",value:E.link_merito,onChange:F})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Fecha de expiraci\xf3n",type:"date",variant:"outlined",name:"fecha_expiracion",value:E.fecha_expiracion,onChange:F,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start"})}})})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(o.container_center),children:[Object(n.jsx)(x.a,{color:"primary",variant:"contained",type:"submit",disableElevation:!0,children:P("buttons:buttons.save")}),Object(n.jsx)(x.a,{color:"primary",variant:"contained",disableElevation:!0,children:P("buttons:buttons.cancel")})]})]})})]})})),Jl=r.a.createRef();var Xl=Object(C.a)((function(e){return{text:{marginTop:"1em",marginBottom:"1em"},button:{padding:"9px 40px"},input:{display:"none"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},alert:{width:"100%","& > * + *":{marginTop:e.spacing(1)}},link:{color:E.a.primary,"&:hover":{color:E.a.secondary}},closeButton:{margin:".5em .5em 0 0",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}},"a\xf1adirButton":{color:"#0056b3",textTransform:"none",transitionProperty:"none","&:hover":{backgroundColor:"none",textDecoration:"underline"}}}})),Zl={changePage:I.b,changeBreadcrump:I.a},$l=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"emitir"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,styles:e.styles}}),Zl)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changePage,o=e.user,s=e.organizationId,p=e.changeBreadcrump,j=e.styles,g=Xl(),y=Object(u.g)(),w=Object(i.useState)([]),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),A=Object(d.a)(B,2),P=A[0],R=A[1],M=Object(i.useState)([]),L=Object(d.a)(M,2),U=L[0],W=L[1],q=Object(i.useState)([]),H=Object(d.a)(q,2),K=H[0],V=H[1],G=Object(i.useState)([]),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(i.useState)(!1),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ne=Object(i.useState)(!1),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)(!1),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)(!1),me=Object(d.a)(ue,2),be=me[0],pe=me[1],je=Object(i.useState)([]),fe=Object(d.a)(je,2),he=fe[0],ge=fe[1],xe=Object(i.useState)({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"0",file:null}),Oe=Object(d.a)(xe,2),ke=Oe[0],Ne=Oe[1],Be=Object(i.useState)(""),Se=Object(d.a)(Be,2),Ae=Se[0],Ee=Se[1],De=Object(i.useState)(""),ze=Object(d.a)(De,2),Pe=ze[0],Re=ze[1],Me=Object(i.useState)(""),Le=Object(d.a)(Me,2),Fe=Le[0],Ue=Le[1],We=Object(i.useState)(!1),Ye=Object(d.a)(We,2),qe=Ye[0],He=Ye[1],Ke=Object(D.a)(["alerts","tables","buttons","certificateBadgeIssued","breadCrumps","dialogs"]),Ve=Object(d.a)(Ke,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?Ge().catch((function(){y.push("/500"),window.location.reload()})):(y.push("/dashboard"),window.location.reload())}),[]);var Ge=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qe();case 2:return e.next=4,Je();case 4:p(Ve("breadCrumps:breadCrumps.badge-issue",{returnObjects:!0})),c=null===(t=window.navigator)||void 0===t||null===(a=t.userAgentData)||void 0===a||null===(n=a.platform)||void 0===n?void 0:n.toLowerCase(),o=null===(i=window.navigator)||void 0===i||null===(r=i.platform)||void 0===r?void 0:r.toLowerCase(),c?c.includes("windows")?Ue("ISO-8859-3"):Ue("UTF-8"):o.includes("win")?Ue("ISO-8859-3"):Ue("UTF-8");case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Qe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/templateBadge/getTemplatesBadgesPublished/names");case 2:t=e.sent,a=t.data,X(a.templatesBadges);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Je=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations");case 2:t=e.sent,a=t.data,ge(a.organizations.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Xe=function(e){if("mensaje"===e.target.name&&!e.target.value.includes("Hola (nombre usuario), "))return Ne(Object(m.a)(Object(m.a)({},ke),{},Object(b.a)({},e.target.name,"Hola (nombre usuario), ")));Ne(Object(m.a)(Object(m.a)({},ke),{},Object(b.a)({},e.target.name,e.target.value)))},Ze=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/file/getFile",{keyFile:"files/issue_template.csv"});case 2:t=e.sent,a=t.data,window.open(a.url);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$e=function(e){Jl.current&&Jl.current.open(e)},et=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,l,d,u,b,p,j,h,g,x,O,v,_,y,w,C,k,B,S,T,A,I;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],i=[],r=[],l=[],d=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,u=/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/,b=/^([0-9]{6,12})+$/,p=/^([a-zA-Z0-9]{6,10})+$/,j=/^([0-9]{8,15})+$/,h=/^([0-9]{0,5})+$/,g=["CC","CE","TI","PA","NIT","DNI","CI","DUI","DPI","CIE","CIC","CIP","ID","CURP"],x=/^[A-Z\xd1a-z\xf1\xe1\xe9\xed\xf3\xfa\xc1\xc9\xcd\xd3\xda'\xb0 ]+$/,O=["id_plantilla","email_receptor","indicativo_pais","whatsapp_receptor","tipo_identificacion","identificacion","primer_nombre_receptor","segundo_nombre_receptor","primer_apellido_receptor","segundo_apellido_receptor","numero_celular","numero_telegram","merito","link_merito","fecha_expiracion"],t.map((function(e){0===e.errors.length&&15===e.meta.fields.length&&JSON.stringify(e.meta.fields.sort())===JSON.stringify(O.sort())&&i.push(e.data)})),i.map((function(e,t){var a=[],c=[];if(i.map((function(t){t.id_plantilla===e.id_plantilla&&t.email_receptor===e.email_receptor&&a.push(!0),""!=="".concat(e.indicativo_pais).concat(e.whatsapp_receptor)&&"".concat(t.indicativo_pais).concat(t.whatsapp_receptor)==="".concat(e.indicativo_pais).concat(e.whatsapp_receptor)&&c.push(!0)})),""!==e.id_plantilla.trim()&&""!==e.email_receptor.trim()&&""!==e.primer_nombre_receptor.trim()&&""!==e.primer_apellido_receptor.trim()||"NIT"===e.tipo_identificacion&&""!==e.id_plantilla.trim()&&""!==e.email_receptor.trim()&&""!==e.identificacion.trim()&&""!==e.primer_nombre_receptor.trim()){if(r.push(Object(m.a)({index:t},e)),1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?J.find((function(t){return t.codigo===e.id_plantilla.trim()}))||n.push({index:t,msg:"".concat(Ve("alerts:alerts.does-exit-template")," ").concat(e.id_plantilla)}):J.find((function(t){return t.codigo===e.id_plantilla.trim()&&t.id_organizaciones===s}))||n.push({index:t,msg:"".concat(Ve("alerts:alerts.does-exit-template")," ").concat(e.id_plantilla)}),x.test(e.primer_nombre_receptor)||n.push({index:t,msg:"".concat(Ve("alerts:alerts.first-name-invalid"))}),""!==e.segundo_nombre_receptor&&(x.test(e.segundo_nombre_receptor)||n.push({index:t,msg:"".concat(Ve("alerts:alerts.midle-name-invalid"))})),x.test(e.primer_apellido_receptor)||"NIT"===e.tipo_identificacion||n.push({index:t,msg:"".concat(Ve("alerts:alerts.last-name-invalid"))}),""!==e.segundo_apellido_receptor&&(x.test(e.segundo_apellido_receptor)||n.push({index:t,msg:"".concat(Ve("alerts:alerts.second-last-name-invalid"))})),a.length>1&&n.push({index:t,msg:"".concat(Ve("alerts:alerts.template-assigned")," ").concat(e.id_plantilla," ").concat(Ve("alerts:alerts.for-user")," ").concat(e.email_receptor)}),c.length>1&&n.push({index:t,msg:"".concat(Ve("alerts:alerts.template-assigned")," ").concat(e.id_plantilla," ").concat(Ve("alerts:alerts.for-user")," ").concat(e.indicativo_pais).concat(e.whatsapp_receptor)}),d.test(e.email_receptor.trim())||n.push({index:t,msg:"".concat(Ve("alerts:alerts.email-invalid"))}),""!==e.tipo_identificacion.trim()&&(g.includes(e.tipo_identificacion.trim())||n.push({index:t,msg:"".concat(Ve("alerts:alerts.identification-type-invalid"))})),""!==e.tipo_identificacion.trim()&&("PA"!==e.tipo_identificacion.trim()?b.test(e.identificacion.trim())||n.push({index:t,msg:"".concat(Ve("alerts:alerts.identification-invalid"))}):p.test(e.identificacion.trim())||n.push({index:t,msg:"".concat(Ve("alerts:alerts.identification-invalid"))})),""!==e.numero_celular.trim()&&(j.test(e.numero_celular.trim())||n.push({index:t,msg:"".concat(Ve("alerts:alerts.phone-number-invalid"))})),""!==e.indicativo_pais.trim()&&(h.test(e.indicativo_pais.trim())||n.push({index:t,msg:"".concat(Ve("alerts:alerts.indicative-invalid"))})),""!==e.whatsapp_receptor.trim()&&(j.test(e.whatsapp_receptor.trim())||n.push({index:t,msg:"".concat(Ve("alerts:alerts.whatsapp-invalid"))}),""===e.indicativo_pais.trim()&&n.push({index:t,msg:"".concat(Ve("alerts:alerts.indicative-invalid"))})),""!==e.link_merito.trim()&&(u.test(e.link_merito.trim())?e.link_merito.includes("https://")||e.link_merito.includes("http://")||(e.link_merito="https://".concat(e.link_merito)):n.push({index:t,msg:"".concat(Ve("alerts:alerts.link-merit"))}),""===e.merito&&n.push({index:t,msg:"".concat(Ve("alerts:alerts.empty-merit"))})),""!==e.fecha_expiracion.trim()){var f=e.fecha_expiracion.trim().split("/"),O=new Date(f[2],f[1]-1,f[0]);Object(Kl.a)(parseInt(f[2]),parseInt(f[1])-1,parseInt(f[0]))&&Object(Vl.a)(O,new Date)||n.push({index:t,msg:"".concat(Ve("alerts:alerts.expiration-date-invalid"))})}}else l.push(t+2)})),e.next=17,Ce.a.post("/contract/validations/",{id_organizaciones:null===ke||void 0===ke?void 0:ke.id_organizaciones,issued:r});case 17:if(v=e.sent,_=v.data,!(y=_.contracts).thereContrat){e.next=37;break}if(w=o.data_user.gruposUsuariosOrganizaciones.find((function(e){return e.id_organizaciones===s})),C=w.id,k=w.id_grupos_usuarios,!(4===k)){e.next=31;break}return e.next=26,Ce.a.get("/userGroup/organizations/".concat(C));case 26:if(B=e.sent,S=B.data,T=S.group,A=T.limit_issued,I=T.user_total_issueds,!(A&&r.length>A-I)){e.next=31;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:Ve("alerts:alerts.exceeds-contract"),showConfirmButton:!0,confirmButtonText:Ve("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){tt()})));case 31:if(!y.exceeds){e.next=33;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:Ve("alerts:alerts.exceeds-contract"),showConfirmButton:!0,confirmButtonText:Ve("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){tt()})));case 33:if(!y.vencido){e.next=35;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:Ve("alerts:alerts.expired-contract"),showConfirmButton:!0,confirmButtonText:Ve("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){tt()})));case 35:e.next=38;break;case 37:return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:Ve("alerts:alerts.no-contract-error"),showConfirmButton:!0,confirmButtonText:Ve("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){tt()})));case 38:c(0),te(!0),N(r),R(i),W(n),V(l),Ne(Object(m.a)(Object(m.a)({},ke),{},{file:a}));case 45:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),tt=function(e){Jl.current&&Jl.current.removeFile(e),te(!1),ce(!1),de(!1),N([]),W([]),Ne({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"",file:null})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(ve.a,{elevation:0,style:{backgroundColor:"transparent"},children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{variant:"body1",className:g.text,children:Ve("certificateBadgeIssued:issue.complete-badge")}),Object(n.jsxs)(we.a,{variant:"body1",className:g.text,children:[Ve("certificateBadgeIssued:issue.text-issued-1")," ",Object(n.jsxs)("b",{children:[Ve("certificateBadgeIssued:issue.rows")," "]}),"Certika"===j.organizationName?Ve("certificateBadgeIssued:issue.text-issued-2"):Ve("certificateBadgeIssued:issue.text-issued-2-min")]}),Object(n.jsxs)(we.a,{variant:"body1",className:g.text,children:[Ve("certificateBadgeIssued:issue.access"),Object(n.jsxs)(l.b,{to:"/developers/template-ids/badges",className:g.link,children:[" ",Ve("certificateBadgeIssued:issue.view-id")]})]}),Object(n.jsx)(Ui.a,{ref:Jl,onFileLoad:et,noClick:!0,noDrag:!0,progressBarColor:E.a.primary,config:{header:!0,encoding:Fe,skipEmptyLines:!0},children:function(e){var t=e.file;return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",marginBottom:10},children:[Object(n.jsx)(x.a,{variant:"contained",color:"primary",component:"span",className:g.button,onClick:$e,disableElevation:!0,children:Ve("buttons:buttons.choose-csv")}),Object(n.jsx)("div",{style:{borderWidth:1,height:45,lineHeight:2.5,marginTop:5,marginBottom:5,paddingLeft:13,paddingTop:3,width:"60%"},children:t&&t.name})]})}}),Object(n.jsx)(we.a,{variant:"body1",className:g.text,children:Ve("certificateBadgeIssued:issue.uses-csv")}),Object(n.jsx)(l.b,{to:"#",onClick:Ze,className:g.link,children:Object(n.jsxs)(we.a,{variant:"body1",className:g.text,children:[Object(n.jsx)(va.a,{}),Ve("certificateBadgeIssued:issue.dowload-template")]})})]})}),Object(n.jsxs)(O.a,{open:ee,fullWidth:!0,maxWidth:"xl",scroll:"body",children:[Object(n.jsx)(ye.a,{container:!0,justify:"flex-end",children:Object(n.jsx)(S.a,{className:g.closeButton,onClick:tt,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsxs)(v.a,{children:[Object(n.jsxs)("div",{className:g.alert,children:[Object(n.jsxs)(Qi.a,{severity:"info",children:[Ve("alerts:alerts.preloaded")," ",k.length," ",Ve("alerts:alerts.of")," ",P.length," ",Ve("alerts:alerts.rows")]}),0===k.length&&Object(n.jsx)(Qi.a,{severity:"error",children:Ve("alerts:alerts.no-badge-issue")}),k.length>500&&Object(n.jsx)(Qi.a,{severity:"error",children:Ve("alerts:alerts.exceeded-limit")}),K.length>0&&Object(n.jsxs)(Qi.a,{severity:"error",children:[Ve("alerts:alerts.rows-2")," ",Object(n.jsx)("b",{children:K.toString()})," ",Ve("alerts:alerts.no-requirements")]}),U.length>5&&!le?Object(n.jsxs)(n.Fragment,{children:[U.map((function(e,t){return t<5&&Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:[Ve("alerts:alerts.row")," ",e.index+2,":"]}),e.msg]})},"row".concat(t))})),Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:["5 ",Ve("alerts:alerts.of")," ",U.length," ",Ve("alerts:alerts.errors"),"."]}),Object(n.jsx)(x.a,{onClick:function(){de(!0)},className:g.a\u00f1adirButton,children:Ve("buttons:buttons.see-all")})]})})]}):Object(n.jsx)(n.Fragment,{children:U.map((function(e,t){return Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:[Ve("alerts:alerts.row")," ",e.index+2,":"]}),e.msg,"."]})},"row".concat(t))}))})]}),Object(n.jsx)(x.a,{variant:"contained",color:"primary",component:"span",className:g.button,onClick:function(e){e.preventDefault(),te(!1),ce(!0)},disabled:(k.length!==P.length||U.length>0||0===k.length||k.length>500)&&!0,disableElevation:!0,children:Ve("buttons:buttons.issue")}),Object(n.jsx)(x.a,{variant:"contained",color:"primary",component:"span",className:g.button,onClick:tt,disableElevation:!0,children:Ve("buttons:buttons.cancel")})]}),Object(n.jsx)(_.a,{dividers:!0,children:k.length>0&&Object(n.jsx)(zn,{columns:Ve("tables:table.columns-template-badge-issue",{returnObjects:!0}),rows:k,setDirection:Ee,setOrderBy:Re,children:Object(n.jsx)(vn.a,{children:Object(I.J)(k,Object(I.f)(Ae,Pe)).slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("b",{children:e.index+2})}),Object(n.jsx)(yn.a,{align:"center",children:e.id_plantilla}),Object(n.jsx)(yn.a,{align:"center",children:e.email_receptor}),Object(n.jsx)(yn.a,{align:"center",children:e.indicativo_pais}),Object(n.jsx)(yn.a,{align:"center",children:e.whatsapp_receptor}),Object(n.jsx)(yn.a,{align:"center",children:e.tipo_identificacion}),Object(n.jsx)(yn.a,{align:"center",children:e.identificacion}),Object(n.jsx)(yn.a,{align:"center",children:e.primer_nombre_receptor}),Object(n.jsx)(yn.a,{align:"center",children:e.segundo_nombre_receptor}),Object(n.jsx)(yn.a,{align:"center",children:e.primer_apellido_receptor}),Object(n.jsx)(yn.a,{align:"center",children:e.segundo_apellido_receptor}),Object(n.jsx)(yn.a,{align:"center",children:e.numero_celular}),Object(n.jsx)(yn.a,{align:"center",children:e.numero_telegram}),Object(n.jsx)(yn.a,{align:"center",children:e.merito}),Object(n.jsx)(yn.a,{align:"center",children:e.link_merito}),Object(n.jsx)(yn.a,{align:"center",children:e.fecha_expiracion})]},"row".concat(t))}))})})})]}),Object(n.jsx)(O.a,{open:re,fullWidth:!0,maxWidth:"sm",style:{zIndex:100},children:Object(n.jsx)(_.a,{children:Object(n.jsxs)("form",{onSubmit:function(e){if(e.preventDefault(),(null===ke||void 0===ke?void 0:ke.mensaje)&&(ke.mensaje.length<60||ke.mensaje.length>300))return F.a.fire({title:"Error",iconColor:E.a.primary,text:Ve("alerts:alerts.message-size"),icon:"error",timer:4e3,confirmButtonColor:E.a.primary}),!1;ce(!1),F.a.fire({text:"".concat(Ve("alerts:alerts.button-emit-1")," ").concat(P.length," ").concat(Ve("alerts:alerts.button-emit-2")),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,showDenyButton:!0,confirmButtonText:Ve("buttons:buttons.issue"),cancelButtonText:Ve("buttons:buttons.cancel"),denyButtonText:Ve("buttons:buttons.back"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel",denyButton:"custom-button-back"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.isDenied&&ce(!0),t.isDismissed&&(Ne({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"",file:null}),tt()),t.value&&(pe(!0),a={insignias:k,nombre:ke.nombre,mensaje:ke.mensaje||"".concat(Ve("alerts:alerts.message-issue-badge")),id_organizaciones:ke.id_organizaciones,id_usuarios_emisores:o.data_user.id,archivo:ke.file.name},Ce.a.post("/badgesIssued/",a).then((function(e){var t=e.data;pe(!1),tt(),F.a.fire({icon:"success",iconColor:E.a.primary,text:Ve("alerts:alerts.badges-issued"),showConfirmButton:!0,confirmButtonText:Ve("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then(Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:y.push("/badgesIssued/badges/".concat(Object(Ie.b)(t.issuedId.groupId))),Ne({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:""});case 2:case"end":return e.stop()}}),e)}))))})).catch((function(e){pe(!1),tt(),F.a.fire({icon:"error",iconColor:E.a.primary,text:Ve("alerts:alerts.template-issued-error"),showConfirmButton:!1,timer:1500})})));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[Object(n.jsx)(we.a,{gutterBottom:!0,children:Ve("dialogs:dialog.groups-issue-badges-name")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{autoFocus:!0,required:!0,id:"nombre",name:"nombre",variant:"outlined",onChange:Xe,value:ke.nombre})}),Object(n.jsx)(we.a,{gutterBottom:!0,children:Ve("dialogs:dialog.notification-message")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{id:"message",name:"mensaje",variant:"outlined",onChange:Xe,value:ke.mensaje||"".concat(Ve("alerts:alerts.message-issue-badge"),"."),required:!0,multiline:!0})}),(1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{gutterBottom:!0,style:{marginTop:"1.5em"},children:[Ve("dialogs:dialog.select-organization")," *"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:Object(n.jsxs)(T.a,{id:"id_organizaciones",name:"id_organizaciones",onChange:Xe,value:ke.id_organizaciones,children:[Object(n.jsx)(Y.a,{children:Object(n.jsx)("em",{children:Ve("selects:selects-autocompletes.select-option")})}),he.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},e.id)}))]})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(g.root),style:{marginTop:"1.5em"},children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(g.button),type:"submit",children:Ve("buttons:buttons.issue")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(g.button),onClick:tt,children:Ve("buttons:buttons.cancel")})]})]})})}),Object(n.jsx)(Ql,{open:qe,setOpen:He}),Object(n.jsx)(xt.a,{className:g.backdrop,open:be,children:Object(n.jsx)(Ot.a,{color:"inherit"})})]})})),ed=a(225),td=function(e,t){var a,n,i,r;window.Blob&&(window.URL||window.webkitURL)?(a=new Blob(["\ufeff",e],{type:"text/csv"}),(n=new FileReader).onload=function(e){(i=document.createElement("a")).href=e.target.result,i.target="_blank",i.download="".concat((null===t||void 0===t?void 0:t.nombre)||"issue_certificates",".csv");try{r=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0})}catch(a){(r=document.createEvent("MouseEvent")).initEvent("click",!0,!0)}i.dispatchEvent(r),(window.URL||window.webkitURL).revokeObjectURL(i.href)},n.readAsDataURL(a)):alert("Su navegador no permite esta acci\xf3n")},ad=r.a.createRef();var nd=Object(C.a)((function(e){return{text:{marginTop:"1em",marginBottom:"1em"},button:{padding:"9px 40px"},input:{display:"none"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},alert:{width:"100%","& > * + *":{marginTop:e.spacing(1)}},link:{color:E.a.primary,border:"none",marginTop:"-1em",backgroundColor:"#fff","&:hover":{color:E.a.secondary}},linkDisabled:{display:"none",border:"none",marginTop:"-1em"},closeButton:{margin:".5em .5em 0 0",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}},"a\xf1adirButton":{color:"#0056b3",textTransform:"none",transitionProperty:"none","&:hover":{backgroundColor:"none",textDecoration:"underline"}}}})),id={changePage:I.b,changeBreadcrump:I.a},rd=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"emitir certificados"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,styles:e.styles}}),id)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changePage,o=e.user,s=e.organizationId,p=e.changeBreadcrump,j=e.styles,g=nd(),y=Object(u.g)(),w=Object(i.useState)([]),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),A=Object(d.a)(B,2),P=A[0],R=A[1],M=Object(i.useState)([]),L=Object(d.a)(M,2),U=L[0],W=L[1],q=Object(i.useState)([]),H=Object(d.a)(q,2),K=H[0],V=H[1],G=Object(i.useState)([]),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(i.useState)(!1),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ne=Object(i.useState)(!1),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)(!1),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)([]),me=Object(d.a)(ue,2),be=me[0],pe=me[1],fe=Object(i.useState)(!1),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],ke=Object(i.useState)(!0),Ne=Object(d.a)(ke,2),Be=Ne[0],Se=Ne[1],Ae=Object(i.useState)({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"0",file:null}),Ee=Object(d.a)(Ae,2),De=Ee[0],ze=Ee[1],Re=Object(i.useState)(""),Me=Object(d.a)(Re,2),Le=Me[0],Fe=Me[1],Ue=Object(i.useState)(""),We=Object(d.a)(Ue,2),Ye=We[0],qe=We[1],He=Object(i.useState)([]),Ke=Object(d.a)(He,2),Ve=Ke[0],Ge=Ke[1],Qe=Object(i.useState)([]),Je=Object(d.a)(Qe,2),Xe=Je[0],Ze=Je[1],$e=Object(i.useState)(null),et=Object(d.a)($e,2),tt=et[0],at=et[1],nt=["email_receptor","indicativo_pais","whatsapp_receptor"],it=["","",""],rt=Object(i.useState)(),ot=Object(d.a)(rt,2),st=ot[0],lt=ot[1],dt=Object(i.useState)([{id:"index",label:"#",minWidth:50,align:"center"}]),ut=Object(d.a)(dt,2),bt=ut[0],pt=ut[1],jt=Object(i.useState)(""),ft=Object(d.a)(jt,2),ht=ft[0],gt=ft[1],vt=Object(D.a)(["alerts","tables","buttons","certificateBadgeIssued","breadCrumps","dialogs","selects"]),_t=Object(d.a)(vt,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?yt().catch((function(){y.push("/500"),window.location.reload()})):(y.push("/dashboard"),window.location.reload())}),[]);var yt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nt();case 2:return e.next=4,kt();case 4:p(_t("breadCrumps:breadCrumps.certificate-issue",{returnObjects:!0})),c=null===(t=window.navigator)||void 0===t||null===(a=t.userAgentData)||void 0===a||null===(n=a.platform)||void 0===n?void 0:n.toLowerCase(),o=null===(i=window.navigator)||void 0===i||null===(r=i.platform)||void 0===r?void 0:r.toLowerCase(),c?c.includes("windows")?gt("ISO-8859-3"):gt("UTF-8"):o.includes("win")?gt("ISO-8859-3"):gt("UTF-8");case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(i.useEffect)((function(){if(null===tt||void 0===tt?void 0:tt.id){var e,t,a=null===Ve||void 0===Ve?void 0:Ve.filter((function(e){return e.id===tt.id}));Ze(null===(e=a[0])||void 0===e?void 0:e.certificadoCampos),lt(null===(t=a[0])||void 0===t?void 0:t.codigo),tt&&F.a.fire({icon:"info",iconColor:E.a.primary,text:_t("alerts:alerts.download-template"),confirmButtonText:_t("buttons:buttons.download"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value&&St(null===(n=a[0])||void 0===n?void 0:n.certificadoCampos,null===(i=a[0])||void 0===i?void 0:i.codigo);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}}),[tt]);var wt=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Ct=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,kt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!wt){e.next=9;break}return e.next=3,Ce.a.post("/certificateTemplate/getCertificateTemplatesPublished/names");case 3:t=e.sent,a=t.data,Ge(a.certificateTemplates),a&&Se(!1),e.next=15;break;case 9:return e.next=11,Ce.a.post("/certificateTemplate/getCertificateTemplatesPublished/names",{id_organizaciones:s});case 11:n=e.sent,i=n.data,Ge(Ct?i.certificateTemplates.filter((function(e){return e.plantillasCertificadosHistorial[0].id_usuarios===o.data_user.id})):i.certificateTemplates),i&&Se(!1);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Nt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations");case 2:t=e.sent,a=t.data,pe(a.organizations.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Bt=function(e){ze(Object(m.a)(Object(m.a)({},De),{},Object(b.a)({},e.target.name,e.target.value)))},St=function(e,t){var a=[],n=[];e.sort((function(e,t){return e.id<t.id?-1:1})).map((function(e){"qr"!==e.nombre&&"logo"!==e.nombre&&"certificateCode"!==e.nombre&&"buttonVerify"!==e.nombre&&(a.includes(e.nombre)?n.push("P\xe1gina ".concat(e.page)):n.push(""),a.push(e.nombre))}));var i=nt.concat(a),r=it.concat(n);i.push("fecha_expiracion"),r.push("20/09/2050"),i.unshift("codigo_certificado"),r.unshift(t);var c=Object(ed.convertArrayToCSV)([r],{header:i,separator:";"});td(c,tt)},Tt=function(e){ad.current&&ad.current.open(e)},At=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,l,d,u,b,p,j,h,g,x,O,v,_,y,w,C,k,B,S,T,A;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],i=[],r=[],l=[],d=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,u=/^([0-9]{5,13})+$/,b=/^([0-9])*$/,p=/^([0-9]{1,5})+$/,j=["codigo_certificado","email_receptor","indicativo_pais","whatsapp_receptor","fecha_expiracion"],h=[],t[0].meta.fields.map((function(e){bt.push({id:"".concat(e),label:"".concat(e),align:"center",orden:"data.".concat(e)})})),pt(bt),Xe.map((function(e){"qr"!==e.nombre&&"logo"!==e.nombre&&"certificateCode"!==e.nombre&&"buttonVerify"!==e.nombre?(j.push(e.nombre),h.push({nombre:e.nombre,tipo:e.tipo_campo_vp})):j.includes(e.nombre)||(j.push(e.nombre),h.push({nombre:e.nombre,tipo:e.tipo_campo_vp}))})),t.map((function(e){j.includes("qr")&&!e.meta.fields.includes("qr")&&e.meta.fields.push("qr"),j.includes("logo")&&!e.meta.fields.includes("logo")&&e.meta.fields.push("logo"),j.includes("certificateCode")&&!e.meta.fields.includes("certificateCode")&&e.meta.fields.push("certificateCode"),j.includes("buttonVerify")&&!e.meta.fields.includes("buttonVerify")&&e.meta.fields.push("buttonVerify"),0===e.errors.length&&e.meta.fields.length===j.length&&JSON.stringify(e.meta.fields.sort())===JSON.stringify(j.sort())&&(j.includes("qr")&&(e.data=Object(m.a)({qr:"qr-certika-600x600.png"},e.data)),j.includes("logo")&&(e.data=Object(m.a)({logo:"Certika-435x149.png"},e.data)),j.includes("certificateCode")&&(e.data=Object(m.a)({certificateCode:"certificateCode"},e.data)),j.includes("buttonVerify")&&(e.data=Object(m.a)({buttonVerify:"buttonVerify"},e.data)),i.push(e.data))})),g=i.map((function(e){return e.fecha_expiracion})),x=g.filter((function(e,t){return g.indexOf(e)===t})),X(x),i.map((function(e,t){if(""!==e.codigo_certificado.trim()&&""!==e.email_receptor.trim()){if(r.push(Object(m.a)({index:t},e)),1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?Ve.find((function(t){return t.codigo===e.codigo_certificado.trim()}))||n.push({index:t,msg:"".concat(_t("alerts:alerts.does-exit-template")," ").concat(e.codigo_certificado)}):Ve.find((function(t){return t.codigo===e.codigo_certificado.trim()&&t.id_organizaciones===s}))||n.push({index:t,msg:"".concat(_t("alerts:alerts.does-exit-template")," ").concat(e.codigo_certificado)}),d.test(e.email_receptor.trim())||n.push({index:t,msg:_t("alerts:alerts.email-invalid")}),""!==e.indicativo_pais.trim()&&(p.test(e.indicativo_pais.trim())||n.push({index:t,msg:"".concat(_t("alerts:alerts.indicative-invalid"))})),""!==e.whatsapp_receptor.trim()&&(u.test(e.whatsapp_receptor.trim())||n.push({index:t,msg:"".concat(_t("alerts:alerts.whatsapp-invalid"))}),""===e.indicativo_pais.trim()&&n.push({index:t,msg:"".concat(_t("alerts:alerts.indicative-invalid"))})),e.codigo_certificado.trim()!==st&&n.push({index:t,msg:_t("alerts:alerts.certificate-code-error")}),h.map((function(a){""!==e[a.nombre]?41===a.tipo?0!==e[a.nombre].replace(/[^\\#+()$~%*?<>{}\xef\u017c\xbd]/g,"").length&&n.push({index:t,msg:"".concat(_t("alerts:alerts.field-invalid")," ").concat(a.nombre)}):42===a.tipo?b.test(e[a.nombre].trim())||n.push({index:t,msg:"".concat(_t("alerts:alerts.field-invalid")," ").concat(a.nombre)}):44===a.tipo?u.test(e[a.nombre].trim())||n.push({index:t,msg:"".concat(_t("alerts:alerts.field-invalid")," ").concat(a.nombre)}):43===a.tipo&&(d.test(e[a.nombre].trim())||n.push({index:t,msg:"".concat(_t("alerts:alerts.field-invalid")," ").concat(a.nombre)})):l.push(t+2)})),""!==e.fecha_expiracion.trim()){var a=e.fecha_expiracion.trim().split("/"),i=new Date(a[2],a[1]-1,a[0]);Object(Kl.a)(parseInt(a[2]),parseInt(a[1])-1,parseInt(a[0]))&&Object(Vl.a)(i,new Date)||n.push({index:t,msg:_t("alerts:alerts.expiration-date-invalid")})}}else l.push(t+2)})),e.next=20,Ce.a.post("/contract/validations/",{id_organizaciones:null===De||void 0===De?void 0:De.id_organizaciones,issued:r});case 20:if(O=e.sent,v=O.data,!(_=v.contracts).thereContrat){e.next=40;break}if(y=o.data_user.gruposUsuariosOrganizaciones.find((function(e){return e.id_organizaciones===s})),w=y.id,C=y.id_grupos_usuarios,!(4===C)){e.next=34;break}return e.next=29,Ce.a.get("/userGroup/organizations/".concat(w));case 29:if(k=e.sent,B=k.data,S=B.group,T=S.limit_issued,A=S.user_total_issueds,!(T&&r.length>T-A)){e.next=34;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:_t("alerts:alerts.exceeds-contract"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){Et()})));case 34:if(!_.exceeds){e.next=36;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:_t("alerts:alerts.exceeds-contract"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){Et()})));case 36:if(!_.vencido){e.next=38;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:_t("alerts:alerts.expired-contract"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){Et()})));case 38:e.next=41;break;case 40:return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:_t("alerts:alerts.no-contract-error"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){Et()})));case 41:c(0),te(!0),N(r),R(i),W(n),V(l),ze(Object(m.a)(Object(m.a)({},De),{},{file:a}));case 48:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Et=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ad.current&&ad.current.removeFile(t),te(!1),ce(!1),de(!1),N([]),W([]),ze({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"",file:null}),pt([{id:"index",label:"#",minWidth:50,align:"center"}]);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(ve.a,{elevation:0,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{variant:"body1",className:g.text,children:_t("certificateBadgeIssued:issue.complete-certificate")}),Object(n.jsxs)(we.a,{variant:"body1",className:g.text,children:[_t("certificateBadgeIssued:issue.text-issued-1")," ",Object(n.jsxs)("b",{children:[_t("certificateBadgeIssued:issue.rows-certificate")," "]}),"Certika"===j.organizationName?_t("certificateBadgeIssued:issue.text-issued-certificate-2"):_t("certificateBadgeIssued:issue.text-issued-certificate-2-min")]}),Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(oo.a,{options:Ve.sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})),getOptionLabel:function(e){return"".concat(e.nombre," (").concat(e.nombre_privado,")")},onChange:function(e,t){at({id:null===t||void 0===t?void 0:t.id,nombre:null===t||void 0===t?void 0:t.nombre})},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{label:Be?"Cargando...":_t("selects:selects-autocompletes.certificate-select"),variant:"outlined",InputProps:Object(m.a)(Object(m.a)({},e.InputProps),{},{endAdornment:Object(n.jsx)(n.Fragment,{children:e.InputProps.endAdornment})})}))}}),Be&&Object(n.jsx)(Oe.a,{})]}),Object(n.jsx)(Ui.a,{ref:ad,onFileLoad:At,noClick:!0,noDrag:!0,progressBarColor:E.a.primary,config:{header:!0,encoding:ht,skipEmptyLines:!0},children:function(e){var t=e.file;return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",marginBottom:10},children:[Object(n.jsx)(x.a,{disabled:!tt,variant:"contained",color:"primary",component:"span",className:g.button,onClick:Tt,disableElevation:!0,children:_t("buttons:buttons.choose-csv")}),Object(n.jsx)("div",{style:{borderWidth:1,height:45,lineHeight:2.5,marginTop:5,marginBottom:5,paddingLeft:13,paddingTop:3,width:"60%"},children:t&&t.name})]})}}),Object(n.jsx)(we.a,{variant:"body1",className:g.text,children:_t("certificateBadgeIssued:issue.uses-csv")}),Object(n.jsx)(l.b,{disabled:!tt,component:"button",to:"#",onClick:function(){return St(Xe,st)},className:tt?g.link:g.linkDisabled,children:Object(n.jsxs)(we.a,{variant:"body1",className:g.text,children:[Object(n.jsx)(va.a,{}),_t("certificateBadgeIssued:issue.dowload-template")]})})]})}),Object(n.jsxs)(O.a,{open:ee,fullWidth:!0,maxWidth:"xl",scroll:"body",children:[Object(n.jsx)(ye.a,{container:!0,justify:"flex-end",children:Object(n.jsx)(S.a,{className:g.closeButton,onClick:Et,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsxs)(v.a,{children:[Object(n.jsxs)("div",{className:g.alert,children:[Object(n.jsxs)(Qi.a,{severity:"info",children:[_t("alerts:alerts.preloaded")," ",k.length," ",_t("alerts:alerts.of")," ",P.length," ",_t("alerts:alerts.rows")]}),0===k.length&&Object(n.jsx)(Qi.a,{severity:"error",children:_t("alerts:alerts.no-certificate-to-issue")}),k.length>5e3&&Object(n.jsx)(Qi.a,{severity:"error",children:_t("alerts:alerts.exceeded-limit")}),J.length>1&&Object(n.jsx)(Qi.a,{severity:"error",children:_t("alerts:alerts.expiration-date-equal")}),K.length>0&&Object(n.jsxs)(Qi.a,{severity:"error",children:[_t("alerts:alerts.rows-2")," ",Object(n.jsx)("b",{children:K.toString()})," ",_t("alerts:alerts.no-requirements")]}),U.length>5&&!le?Object(n.jsxs)(n.Fragment,{children:[U.map((function(e,t){return t<5&&Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:[_t("alerts:alerts.row")," ",e.index+2,":"]})," ",e.msg,"."]})},"row".concat(t))})),Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:["5 ",_t("alerts:alerts.of")," ",U.length," ",_t("alerts:alerts.errors"),"."]}),Object(n.jsx)(x.a,{disableElevation:!0,onClick:function(){de(!0)},className:g.a\u00f1adirButton,children:_t("buttons:buttons.see-all")})]})})]}):Object(n.jsx)(n.Fragment,{children:U.map((function(e,t){return Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:[_t("alerts:alerts.row")," ",e.index+2,":"]}),e.msg,"."]})},"row".concat(t))}))})]}),Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",color:"primary",component:"span",className:g.button,onClick:function(e){e.preventDefault(),te(!1),ce(!0)},disabled:(k.length!==P.length||U.length>0||0===k.length||k.length>5e3||J.length>1||K.length>0)&&!0,children:_t("buttons:buttons.issue")}),Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",color:"primary",component:"span",className:g.button,onClick:Et,children:_t("buttons:buttons.cancel")})]}),Object(n.jsx)(_.a,{dividers:!0,children:k.length>0&&Object(n.jsx)(zn,{columns:bt,rows:k,setDirection:Fe,setOrderBy:qe,children:Object(n.jsx)(vn.a,{children:Object(I.J)(k,Object(I.f)(Le,Ye)).slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("b",{children:e.index+2})}),bt.filter((function(e){return"#"!==e.label})).map((function(t){return Object(n.jsx)(yn.a,{align:"center",children:e[t.label]})}))]},"row".concat(t))}))})})})]}),Object(n.jsx)(O.a,{open:re,fullWidth:!0,maxWidth:"sm",style:{zIndex:100},children:Object(n.jsx)(_.a,{children:Object(n.jsxs)("form",{onSubmit:function(e){if(e.preventDefault(),(null===De||void 0===De?void 0:De.mensaje)&&(De.mensaje.length<60||De.mensaje.length>300))return F.a.fire({title:"Error",text:_t("alerts:alerts.message-size"),icon:"error",iconColor:E.a.primary,timer:4e3,confirmButtonColor:E.a.primary}),!1;ce(!1),F.a.fire({text:"".concat(_t("alerts:alerts.button-emit-1")," ").concat(P.length," ").concat(_t("alerts:alerts.button-emit-certificate-2")),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,showDenyButton:!0,confirmButtonText:_t("buttons:buttons.issue"),cancelButtonText:_t("buttons:buttons.cancel"),denyButtonText:_t("buttons:buttons.back"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel",denyButton:"custom-button-back"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.isDenied&&ce(!0),t.isDismissed&&Et(),!t.value){e.next=26;break}return a={nombre:De.nombre,mensaje:De.mensaje||"".concat(_t("alerts:alerts.message-issue"),' "').concat(null===tt||void 0===tt?void 0:tt.nombre,'".'),codigoCertificado:st,certificados:k,id_organizaciones:De.id_organizaciones,id_usuarios_emisores:o.data_user.id,archivo:De.file.name},e.prev=4,xe(!0),e.next=8,Ce.a.post("/certificatesIssued/",a);case 8:return n=e.sent,i=n.data,r=Pe()("certika-organization-".concat(De.id_organizaciones)).toString(),c=Pe()("certika-issued-group-".concat(i.groupId)).toString(),(s=new FormData).append("file",De.file),s.append("route","".concat(r,"/issue-files/").concat(c,"/").concat(c)),e.next=17,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-file"),headers:{"Content-Type":"multipart/form-data"},data:s});case 17:xe(!1),F.a.fire({icon:"info",iconColor:E.a.primary,text:_t("alerts:alerts.certificates-issued"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then(Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Et(),y.push("/certificates/issued/".concat(Object(Ie.b)(i.groupId)));case 2:case"end":return e.stop()}}),e)})))),e.next=26;break;case 21:e.prev=21,e.t0=e.catch(4),xe(!1),Et(),F.a.fire({icon:"error",iconColor:E.a.primary,text:_t("alerts:alerts.certificate-issued-error"),showConfirmButton:!1,timer:1500});case 26:case"end":return e.stop()}}),e,null,[[4,21]])})));return function(t){return e.apply(this,arguments)}}())},children:[Object(n.jsx)(we.a,{gutterBottom:!0,children:_t("dialogs:dialog.certificate-group-issue-name")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{autoFocus:!0,required:!0,id:"nombre",name:"nombre",variant:"outlined",onChange:Bt,value:De.nombre})}),Object(n.jsx)(we.a,{gutterBottom:!0,children:_t("dialogs:dialog.notification-message")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{id:"message",name:"mensaje",variant:"outlined",onChange:Bt,value:De.mensaje||"".concat(_t("alerts:alerts.message-issue"),' "').concat(null===tt||void 0===tt?void 0:tt.nombre,'".'),required:!0,multiline:!0})}),(1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{gutterBottom:!0,style:{marginTop:"1.5em"},children:[_t("dialogs:dialog.select-organization")," *"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:Object(n.jsxs)(T.a,{id:"id_organizaciones",name:"id_organizaciones",onChange:Bt,value:De.id_organizaciones,children:[Object(n.jsx)(Y.a,{children:Object(n.jsx)("em",{children:_t("selects:selects-autocompletes.select-option")})}),be.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},e.id)}))]})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(g.root),style:{marginTop:"1.5em"},children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(g.button),type:"submit",children:_t("buttons:buttons.issue")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(g.button),onClick:Et,children:_t("buttons:buttons.cancel")})]})]})})}),Object(n.jsx)(xt.a,{className:g.backdrop,open:ge,children:Object(n.jsx)(Ot.a,{color:"inherit"})})]})})),cd=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/file/getFile",{keyFile:t});case 2:a=e.sent,n=a.data,window.open(n.url);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var od=Object(C.a)((function(){return{containerButton:{display:"flex",justifyContent:"space-between"},button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"10px 40px","&:hover":{backgroundColor:E.a.secondary}}}})),sd={changePage:I.b,changeBreadcrump:I.a},ld=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"certificados emitidos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),sd)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changePage,o=e.changeBreadcrump,s=e.user,l=e.organizationId,j=e.searchValue,g=Object(u.g)(),y=od(),w=Object(i.useState)([]),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)(!1),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!1),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(!1),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!1),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(0),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ie=Object(i.useState)({}),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)(""),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(i.useState)(""),be=Object(d.a)(me,2),pe=be[0],fe=be[1],he=Object(i.useState)(),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ve=Object(D.a)(["alerts","tables","buttons","breadCrumps","dialogs"]),_e=Object(d.a)(ve,1)[0];Object(i.useEffect)((function(){return r.includes("Leer")?ye():g.push("/dashboard"),function(){c(0)}}),[]);var ye=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,L(!0),j&&""!==j){e.next=5;break}return e.next=5,Se();case 5:o(_e("breadCrumps:breadCrumps.groups-certificate-issued",{returnObjects:!0})),L(!1),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),g.push("/500");case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),ke=1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Be=function(e,t){var a={limit:t||10,offset:e?e*t:0};return ke||(a.id_organizaciones=l),a},Se=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=Be(0,a),e.next=4,Ce.a.post("/groupsBadgesIssued/getGroups/certificates",r);case 4:c=e.sent,o=c.data,N(null===(t=o.groups)||void 0===t?void 0:t.rows),z(null===(n=o.groups)||void 0===n?void 0:n.rows),Oe(null===(i=o.groups)||void 0===i?void 0:i.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),g.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Ae=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),i=Be(t,a),e.next=4,Ce.a.post("/groupsBadgesIssued/getGroups/certificates",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(k),Object(p.a)(null===(n=c.groups)||void 0===n?void 0:n.rows.filter((function(e){return!k.find((function(t){return t.id===e.id}))})))),N(o),z(o),L(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Ee=function(e){F.a.fire({text:_e("alerts:alerts.revoke-certificate-group"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:_e("buttons:buttons.send"),cancelButtonText:_e("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&De(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},De=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,F.a.fire({text:_e("alerts:alerts.revoke-message"),input:"textarea",inputPlaceholder:_e("alerts:alerts.message-here"),inputAttributes:{"aria-label":_e("alerts:alerts.message-here")},showCancelButton:!0,confirmButtonText:_e("buttons:buttons.send"),cancelButtonText:_e("buttons:buttons.cancel"),showLoaderOnConfirm:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"},inputValidator:function(e){if(!e)return _e("alerts:alerts.write-message")}});case 3:if(a=e.sent,!(n=a.value)){e.next=14;break}return q(!0),e.next=9,Ce.a.delete("/certificatesIssued/revoke/".concat(t),{data:{mensaje:n}});case 9:i=e.sent,r=i.data,N(k.filter((function(e){return e.id!==t}))),z(k.filter((function(e){return e.id!==t}))),r&&(q(!1),F.a.fire({text:_e("alerts:alerts.revoke"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}));case 14:e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),q(!1),F.a.fire({text:_e("alerts:alerts.revoke-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 20:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(t){return e.apply(this,arguments)}}(),ze=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,q(!0),e.next=4,Ce.a.get("/certificatesIssued/forwardEmail/".concat(ae));case 4:t=e.sent,t.data.issued.length>0?(q(!1),F.a.fire({text:_e("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(q(!1),F.a.fire({text:_e("alerts:alerts.certificates-to-accept"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),q(!1),F.a.fire({text:_e("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),Pe=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,q(!0),e.next=4,Ce.a.get("/certificatesIssued/forwardEmail/signup/".concat(ae));case 4:t=e.sent,t.data.issued>0?(q(!1),F.a.fire({text:_e("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(q(!1),F.a.fire({text:_e("alerts:alerts.no-accouts"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),q(!1),F.a.fire({text:_e("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),Re=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,q(!0),e.next=4,Ce.a.get("/certificatesIssued/forwardEmail/share/".concat(ae));case 4:t=e.sent,t.data.issued>0?(q(!1),F.a.fire({text:_e("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(q(!1),F.a.fire({text:_e("alerts:alerts.no-share-certificate"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),q(!1),F.a.fire({text:_e("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),Me=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:_e("tables:table.tooltip.revoke"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return function(e,t,a){switch(a){case"delete":Ee(t)}}(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})})},Le=function(e){if(r.includes("Enviar correos"))return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:_e("tables:table.tooltip.sent-email"),children:Object(n.jsx)(S.a,{"aria-label":"emails",onClick:function(){return Ue(e)},children:Object(n.jsx)(Rl.a,{})})})})},Fe=function(e){if(r.includes("Editar"))return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:_e("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return We(e)},children:Object(n.jsx)(Wn,{})})})})},Ue=function(e){ne(e),Q(!0)},We=function(e){var t=null===k||void 0===k?void 0:k.filter((function(t){return t.id===e}));oe(Object(m.a)({},t[0])),$(!0)},Ye=function(){$(!1)},qe=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),Ye(),e.prev=2,e.next=5,Ce.a.put("/groupsBadgesIssued/".concat(ce.id),{nombre:ce.nombre});case 5:a=e.sent,a.data&&F.a.fire({text:_e("alerts:alerts.edited"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),Se(),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),F.a.fire({text:_e("alerts:alerts.edited-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),g.push("/500"),window.location.reload();case 16:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(t){return e.apply(this,arguments)}}(),He=function(){return _e("tables:table.columns-group-certificates-issued",{returnObjects:!0})},Ke=function(){var e=Object(h.a)(f.a.mark((function e(t,a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),e.prev=1,e.next=4,ct()({method:"post",url:"".concat(je.a.apiURL,"/certificatesIssued/generateCertificatesByGroupId"),data:{groupId:t}});case 4:return L(!1),e.abrupt("return",F.a.fire({icon:"success",iconColor:E.a.primary,text:"Certificados descargados exitosamente",showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then(Object(h.a)(f.a.mark((function e(){var n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),e.next=3,ct()({method:"post",url:"".concat(je.a.apiURL,"/certificatesIssued/downloadCertificatesByGroupId"),data:{groupId:t}});case 3:n=e.sent,i=n.data,L(!1),(r=document.createElement("a")).download=a,r.href=i,r.click();case 10:case"end":return e.stop()}}),e)})))));case 8:return e.prev=8,e.t0=e.catch(1),L(!1),e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:_e("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}));case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,a){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"groupIssued",type:"certificates",items:k,setItems:z,setCountItems:Oe,changePage:c,loadData:ye,setLoading:L,organizationId:1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:l}),Object(n.jsx)(zn,{columns:He(),rows:xe,setDirection:ue,setOrderBy:fe,loading:M,changePagination:Ae,children:Object(n.jsx)(vn.a,{children:M?Object(n.jsx)(qn,{columns:He(),photo:0}):A.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(A,Object(I.f)(de,pe)).slice(t*a,t*a+a).map((function(e,t){var a,i,o;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.nombre)}),Object(n.jsx)(yn.a,{align:"center",children:"".concat((null===(a=e.organizaciones)||void 0===a?void 0:a.nombre)||e.nombre_organizacion)}),Object(n.jsx)(yn.a,{align:"center",children:"".concat((null===(i=e.usuarios)||void 0===i?void 0:i.primer_nombre)||e.primer_nombre," ").concat((null===(o=e.usuarios)||void 0===o?void 0:o.primer_apellido)||e.primer_apellido)}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado?Object(n.jsxs)(n.Fragment,{children:[e.certificateIssued,Object(n.jsx)(K.a,{title:_e("tables:table.tooltip.view-certificates"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return a=e.id,c(0),void g.push("/certificates/issued/".concat(Object(Ie.b)(a)));var a},children:Object(n.jsx)(Ge.a,{})})})]}):"En emision"}),Fe(e.id),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:_e("tables:table.tooltip.download-certificate"),children:Object(n.jsx)(S.a,{"aria-label":"download",onClick:function(){return Ke(e.id,e.nombre)},children:Object(n.jsx)(kc.a,{})})})}),Le(e.id),r.includes("Descargar")&&Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:_e("tables:table.tooltip.to-download"),children:Object(n.jsx)(S.a,{"aria-label":"download",onClick:function(){return cd(e.archivo)},children:Object(n.jsx)(va.a,{})})})}),Me(e.id)]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:_e("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:G,onClose:function(){Q(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{children:_e("dialogs:dialog.choose-option")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsxs)("div",{className:"text-center ".concat(y.containerButton),children:[Object(n.jsxs)(x.a,{variant:"contained",className:"my-2 ".concat(y.button),onClick:function(){Q(!1),F.a.fire({title:_e("alerts:alerts.certificate-no-accepted"),text:_e("alerts:alerts.resend-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:_e("buttons:buttons.accept"),cancelButtonText:_e("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?ze():t.isDismissed&&Q(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[_e("buttons:buttons.reminder"),Object(n.jsx)("br",{}),_e("buttons:buttons.certificate-no-accepted")]}),Object(n.jsxs)(x.a,{variant:"contained",className:"my-2 ".concat(y.button),onClick:function(){Q(!1),F.a.fire({title:_e("alerts:alerts.create-account"),text:_e("alerts:alerts.email-account"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:_e("buttons:buttons.accept"),cancelButtonText:_e("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?Pe():t.isDismissed&&Q(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[_e("buttons:buttons.reminder"),Object(n.jsx)("br",{}),_e("buttons:buttons.create-account")]}),Object(n.jsxs)(x.a,{variant:"contained",className:"my-2 ".concat(y.button),onClick:function(){Q(!1),F.a.fire({title:_e("alerts:alerts.share-certificate"),text:_e("alerts:alerts.email-share-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:_e("buttons:buttons.accept"),cancelButtonText:_e("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value?Re():t.isDismissed&&Q(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:[_e("buttons:buttons.reminder"),Object(n.jsx)("br",{}),_e("buttons:buttons.share-certificate")]})]})})]}),Object(n.jsxs)(O.a,{open:Z,onClose:Ye,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{children:_e("dialogs:dialog.edit-group-certificate-issue")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsxs)("form",{onSubmit:qe,children:[Object(n.jsx)(we.a,{gutterBottom:!0,children:_e("dialogs:dialog.certificate-group-issue-name")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{autoFocus:!0,required:!0,id:"nombre",name:"nombre",variant:"outlined",onChange:function(e){oe(Object(m.a)(Object(m.a)({},ce),{},Object(b.a)({},e.target.name,e.target.value)))},value:ce.nombre})}),Object(n.jsxs)("div",{className:"text-center ".concat(y.root),style:{marginTop:"1.5em"},children:[Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(y.button),type:"submit",children:_e("buttons:buttons.edit")}),Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(y.button),onClick:Ye,children:_e("buttons:buttons.cancel")})]})]})})]}),Object(n.jsx)(_t,{loading:Y})]})}));var dd=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",margin:"5px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},row:{color:"#dc2626",fontWeight:"bold"},buttonDialog:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"}}})),ud={changePage:I.b,changeBreadcrump:I.a},md=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"certificados emitidos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),ud)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=e.permission,o=e.user,s=e.organizationId,l=e.changePage,j=e.searchValue,g=Object(i.useState)([]),v=Object(d.a)(g,2),y=v[0],w=v[1],C=Object(i.useState)([]),k=Object(d.a)(C,2),N=k[0],B=k[1],T=dd(),A=Object(u.g)(),z=Object(i.useState)(""),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)(""),U=Object(d.a)(L,2),W=U[0],Y=U[1],q=Object(i.useState)(!0),H=Object(d.a)(q,2),V=H[0],G=H[1],Q=Object(i.useState)([]),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(!1),ee=Object(d.a)($,2),te=ee[0],ne=ee[1],ie=Object(i.useState)(null),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)(),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(D.a)(["alerts","tables","buttons","breadCrumps","dialogs"]),be=Object(d.a)(me,1)[0],pe=be("tables:table.columns-certificate-issued.columns-start",{returnObjects:!0}),fe=be("tables:table.columns-certificate-issued.columns-end",{returnObjects:!0});Object(i.useEffect)((function(){return c.includes("Leer")?(he().catch((function(){A.push("/500"),window.location.reload()})),r(ge())):(A.push("/dashboard"),window.location.reload()),function(){l(0)}}),[]);var he=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(G(!0),j&&""!==j){e.next=4;break}return e.next=4,ve();case 4:G(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ge=function(){return be("breadCrumps:breadCrumps.groups-certificate-issued-certificates-issued",{returnObjects:!0})},xe=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Oe=function(e,t){var a={limit:t||10,offset:e?e*t:0};return xe||(a.id_organizaciones=s),a},ve=function(){var t=Object(h.a)(f.a.mark((function t(){var n,i,r,c,o,s,l,d,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Oe(0,a),i=Object(Ie.a)(e.match.params.id),n.id_grupos_certificados_emitidos=i,t.next=5,Ce.a.post("/certificatesIssued/getCertificatesIssued",n);case 5:r=t.sent,(c=r.data).issued.rows.length>0&&(d=[],c.issued.rows[0].certificadosCamposValores.sort((function(e,t){var a,n;return(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)<(null===(n=t.certificadoCampos)||void 0===n?void 0:n.nombre)?-1:1})).map((function(e){var t,a,n,i,r,c;48!==(null===(t=e.certificadoCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)&&"vencimiento"!==(null===(n=e.certificadoCampos)||void 0===n?void 0:n.nombre)&&d.push({id:"".concat(null===(i=e.certificadoCampos)||void 0===i?void 0:i.nombre),label:"".concat(null===(r=e.certificadoCampos)||void 0===r?void 0:r.nombre),align:"center",orden:"".concat(null===(c=e.certificadoCampos)||void 0===c?void 0:c.nombre)})})),u=pe.concat(d).concat(fe),Z(u),w(null===c||void 0===c||null===(o=c.issued)||void 0===o?void 0:o.rows),B(null===c||void 0===c||null===(s=c.issued)||void 0===s?void 0:s.rows),ue(null===c||void 0===c||null===(l=c.issued)||void 0===l?void 0:l.count)),0!==c.issued.rows.length&&0!==c.issued.rows[0].gruposInsigniasEmitidas.estado||setTimeout(Be,15e3);case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),_e=function(){var t=Object(h.a)(f.a.mark((function t(a,n){var i,r,c,o,s,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return G(!0),r=Oe(a,n),c=Object(Ie.a)(e.match.params.id),r.id_grupos_certificados_emitidos=c,t.next=6,Ce.a.post("/certificatesIssued/getCertificatesIssued",r);case 6:o=t.sent,s=o.data,l=[].concat(Object(p.a)(y),Object(p.a)(null===s||void 0===s||null===(i=s.issued)||void 0===i?void 0:i.rows.filter((function(e){return!y.find((function(t){return t.id===e.id}))})))),w(l),B(l),G(!1);case 12:case"end":return t.stop()}}),t)})));return function(e,a){return t.apply(this,arguments)}}(),ye=function(e,t,a){F.a.fire({text:"".concat(be("alerts:alerts.revoke-undo-1")," ").concat(a," ").concat(be("alerts:alerts.revoke-undo-2-certificate")),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:be("buttons:buttons.send"),cancelButtonText:be("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.value&&we(t,a);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},we=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("revocar"!==a){e.next=21;break}return e.prev=1,e.next=4,F.a.fire({title:be("alerts:alerts.revoke-message"),input:"textarea",inputPlaceholder:be("alerts:alerts.message-here"),inputAttributes:{"aria-label":be("alerts:alerts.message-here")},showCancelButton:!0,confirmButtonText:be("buttons:buttons.send"),cancelButtonText:be("buttons:buttons.cancel"),showLoaderOnConfirm:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"},inputValidator:function(e){if(!e)return be("alerts:alerts.write-message")}});case 4:if(n=e.sent,!(i=n.value)){e.next=13;break}return G(!0),e.next=10,Ce.a.delete("/certificatesIssued/revoke/certificate/".concat(t),{data:{mensaje:i}});case 10:r=e.sent,r.data&&(y.map((function(e){return e.id===t&&ve()})),G(!1),F.a.fire({text:be("alerts:alerts.revoke"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}));case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(1),G(!1),F.a.fire({text:be("alerts:alerts.revoke-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 19:e.next=34;break;case 21:return e.prev=21,G(!0),e.next=25,Ce.a.delete("/certificatesIssued/undo/certificate/".concat(t));case 25:c=e.sent,c.data&&(y.map((function(e){return e.id===t&&ve()})),G(!1),F.a.fire({text:be("alerts:alerts.undo-revoke"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})),e.next=34;break;case 30:e.prev=30,e.t1=e.catch(21),G(!1),F.a.fire({text:be("alerts:alerts.undo-revoke-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 34:case"end":return e.stop()}}),e,null,[[1,15],[21,30]])})));return function(t,a){return e.apply(this,arguments)}}(),ke=function(e){var t=y.find((function(t){return 0===t.estado&&t.id===e}));if(c.includes("Eliminar"))return t?Object(n.jsx)(K.a,{title:be("tables:table.tooltip.undo-revoke"),children:Object(n.jsx)(S.a,{"aria-label":"delete",children:Object(n.jsx)(Ul.a,{onClick:function(t){return ye(0,e,"desrevocar")}})})}):Object(n.jsx)(K.a,{title:be("tables:table.tooltip.revoke"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return ye(0,e,"revocar")},children:Object(n.jsx)(Cn.a,{})})})},Be=function(){G(!0),he()},Se=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return G(!0),t.prev=1,t.next=4,Ce.a.post("/certificatesIssued/getCertificatesIssued",{id_grupos_certificados_emitidos:Object(Ie.a)(e.match.params.id)});case 4:o=t.sent,s=o.data,l=null===s||void 0===s||null===(a=s.issued)||void 0===a||null===(n=a.rows)||void 0===n?void 0:n.map((function(e){var t,a,n,i=e.certificadosCamposValores.sort((function(e,t){var a,n;return(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)<(null===(n=t.certificadoCampos)||void 0===n?void 0:n.nombre)?-1:1})).filter((function(e){var t,a,n;return 48!==(null===(t=e.certificadoCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)&&"vencimiento"!==(null===(n=e.certificadoCampos)||void 0===n?void 0:n.nombre)})).map((function(e){return Object(b.a)({},e.certificadoCampos.nombre,e.valor)})),r={};return i.map((function(e){return r=Object(m.a)(Object(m.a)({},r),e)})),Object(m.a)(Object(m.a)({"Url Certificado":"".concat(window.location.origin,"/certificate/").concat(Object(Ie.b)(e.id)),Grupo:null===(t=e.gruposInsigniasEmitidas)||void 0===t?void 0:t.nombre,Estado:1===e.estado?be("tables:table.state-issue-certificate.issued"):2===e.estado?be("tables:table.state-issue-certificate.accepted"):3===e.estado?be("tables:table.state-issue-certificate.rejected"):4===e.estado?be("tables:table.state-issue-certificate.bounced-mail"):be("tables:table.state-issue-certificate.revoked"),"Fecha emisi\xf3n":Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss"),Email:e.email_receptor},r),{},{"C\xf3digo certificado":e.codigo_certificado,"Nombre p\xfablico certificado":null===(a=e.plantillasCertificados)||void 0===a?void 0:a.nombre,"Nombre privado certificado":null===(n=e.plantillasCertificados)||void 0===n?void 0:n.nombre_privado,"Fecha expiraci\xf3n":null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))?Ne()(e.fecha_expiracion).format("DD/MM/YYYY"):"",Cuenta:Te(e.account),"No. correos emisi\xf3n":e.correos_emision||1,"No. correos aceptar certificado":e.correos_aceptar_certificado||0,"No. correos crear cuenta":e.correos_crear_cuenta||0,"No. correos compartir certificado":e.correos_compartir_certificado||0,"No. correos revocar":e.correos_revocar||0,"No. veces compartidas en Facebook":Ee(e.estadisticasRedesSociales,4),"No. veces compartidas en LinkedIn":Ee(e.estadisticasRedesSociales,3),"No. veces compartidas en Twitter":Ee(e.estadisticasRedesSociales,5),"No. veces compartidas en WhatsApp":Ee(e.estadisticasRedesSociales,2),"No. veces compartidas en Telegram":Ee(e.estadisticasRedesSociales,6)})})),Tc(l,null===s||void 0===s||null===(i=s.issued)||void 0===i||null===(r=i.rows[0])||void 0===r||null===(c=r.gruposInsigniasEmitidas)||void 0===c?void 0:c.nombre),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(1),F.a.fire({icon:"error",iconColor:E.a.primary,text:be("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}),G(!1);case 14:G(!1);case 15:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(){return t.apply(this,arguments)}}(),Te=function(e){return e?"Si":"No"},Ee=function(e,t){var a=e.filter((function(e){return e.id_redes_sociales===t}));return a.length>0?a.length:0},De=function(){ne(!1)},ze=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,G(!0),e.next=4,Ce.a.get("/certificatesIssued/forwardEmail/issue/".concat(t));case 4:a=e.sent,a.data.issued?(G(!1),F.a.fire({text:be("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(G(!1),F.a.fire({text:be("alerts:alerts.certificates-to-accept"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),G(!1),F.a.fire({text:be("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}(),Pe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return G(!0),e.prev=1,e.next=4,ct()({method:"post",url:"".concat(je.a.apiURL,"/certificatesIssued/generateCertificatesByGroupId"),data:{groupId:y[0].id_grupos_certificados_emitidos}});case 4:return G(!1),e.abrupt("return",F.a.fire({icon:"success",iconColor:E.a.primary,text:"Certificados descargados exitosamente",showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then(Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return G(!0),e.next=3,ct()({method:"post",url:"".concat(je.a.apiURL,"/certificatesIssued/downloadCertificatesByGroupId"),data:{groupId:y[0].id_grupos_certificados_emitidos}});case 3:t=e.sent,a=t.data,G(!1),(n=document.createElement("a")).download="".concat(y[0].gruposInsigniasEmitidas.nombre),n.href=a,n.click();case 10:case"end":return e.stop()}}),e)})))));case 8:return e.prev=8,e.t0=e.catch(1),G(!1),e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:be("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:3e3}));case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:y.length>0&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(K.a,{title:be("tables:table.tooltip.download-certificate"),children:Object(n.jsx)(x.a,{className:T.button,onClick:Pe,children:Object(n.jsx)(kc.a,{})})}),Object(n.jsx)(K.a,{title:be("tables:table.tooltip.export"),children:Object(n.jsx)(x.a,{className:T.button,onClick:Se,children:Object(n.jsx)(va.a,{})})}),Object(n.jsx)(K.a,{title:be("tables:table.tooltip.upgrade"),children:Object(n.jsx)(x.a,{className:T.button,onClick:Be,children:Object(n.jsx)(Wl.a,{})})})]})}),Object(n.jsx)(Fn,{tableName:"CertificatesIssued",items:y,setItems:B,groupId:Object(Ie.a)(e.match.params.id),setCountItems:ue,changePage:l,loadData:he,setLoading:G,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,columns:{startColumns:pe,finalColumns:fe,setColumns:Z}}),Object(n.jsx)(zn,{columns:X,rows:de,setDirection:M,setOrderBy:Y,loading:V,changePagination:_e,children:Object(n.jsx)(vn.a,{children:V?Object(n.jsx)(qn,{columns:X,photo:0}):N.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(N,Object(I.f)(R,W)).slice(t*a,t*a+a).map((function(e,t){var a,i,r;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:be("tables:table.tooltip.view-certificate"),children:Object(n.jsx)(S.a,{onClick:function(){return t=e.linkPhoto,oe(t),void ne(!0);var t},children:Object(n.jsx)(cn.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:e.gruposInsigniasEmitidas.nombre}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("span",{className:4===e.estado&&T.row,children:1===e.estado?be("tables:table.state-issue-certificate.issued"):2===e.estado?be("tables:table.state-issue-certificate.accepted"):3===e.estado?be("tables:table.state-issue-certificate.rejected"):4===e.estado?be("tables:table.state-issue-certificate.bounced-mail"):be("tables:table.state-issue-certificate.revoked")})}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.email_receptor}),null===(a=e.certificadosCamposValores)||void 0===a?void 0:a.sort((function(e,t){var a,n;return(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)<(null===(n=t.certificadoCampos)||void 0===n?void 0:n.nombre)?-1:1})).map((function(e){var t,a,i;return 48!==(null===(t=e.certificadoCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.certificadoCampos)||void 0===a?void 0:a.nombre)&&"vencimiento"!==(null===(i=e.certificadoCampos)||void 0===i?void 0:i.nombre)&&Object(n.jsx)(yn.a,{align:"center",children:e.valor})})),Object(n.jsx)(yn.a,{align:"center",children:2!==e.estado&&0!==e.estado||"Si"!==Te(e.account)?e.codigo_certificado:Object(n.jsx)(K.a,{title:be("tables:table.tooltip.view-certificate"),children:Object(n.jsx)("a",{href:"".concat(window.location.origin,"/certificate/").concat(Object(Ie.b)(e.id)),target:"blank",children:e.codigo_certificado})})}),Object(n.jsx)(yn.a,{align:"center",children:null===(i=e.plantillasCertificados)||void 0===i?void 0:i.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(r=e.plantillasCertificados)||void 0===r?void 0:r.nombre_privado}),Object(n.jsx)(yn.a,{align:"center",children:null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))&&Ne()(e.fecha_expiracion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:Te(e.account)}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_emision||1}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_aceptar_certificado||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_crear_cuenta||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_compartir_certificado||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_revocar||0}),Object(n.jsx)(yn.a,{align:"center",children:Ee(e.estadisticasRedesSociales,4)}),Object(n.jsx)(yn.a,{align:"center",children:Ee(e.estadisticasRedesSociales,3)}),Object(n.jsx)(yn.a,{align:"center",children:Ee(e.estadisticasRedesSociales,5)}),Object(n.jsx)(yn.a,{align:"center",children:Ee(e.estadisticasRedesSociales,2)}),Object(n.jsx)(yn.a,{align:"center",children:Ee(e.estadisticasRedesSociales,6)}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:be("tables:table.tooltip.sent-email"),children:Object(n.jsx)(S.a,{"aria-label":"emails",onClick:function(){return t=e.id,void F.a.fire({title:be("alerts:alerts.certificate-no-accepted"),text:be("alerts:alerts.resend-issue-certificate"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:be("buttons:buttons.accept"),cancelButtonText:be("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.value&&ze(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var t},children:Object(n.jsx)(ml.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:ke(e.id)})]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"30",children:be("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:te,onClose:De,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(T.buttonDialog),onClick:De,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:ce,className:T.img})})]})]})})),bd=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{},buttonForm:{padding:"7px 40px"},input:{display:"none"},avatar:{width:"auto",height:"auto"},icon:{margin:20,fontSize:"4em"},card:{backgroundColor:E.a.background},fieldCard:{backgroundColor:"#ffffff"},contentInput:Object(b.a)({marginTop:"1em",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},e.breakpoints.up("lg"),{display:"block",alignItems:"left"}),text:Object(b.a)({display:"flex"},e.breakpoints.up("lg"),{display:"block"}),autocomplete:{width:590,"& > * + *":{marginTop:e.spacing(3)},marginBottom:10},skills:{whiteSpace:"normal"},chip:{height:"100%",marginBottom:"0.5em"}}}));var pd={changeBreadcrump:I.a},jd=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),pd)((function(e){var t,a,r,c,o,s,l=e.user,j=e.organizationId,y=e.changeBreadcrump,w=Object(u.g)(),C=bd(),k=Object(i.useState)([{index:1}]),N=Object(d.a)(k,2),B=N[0],S=N[1],A=Object(i.useState)(!1),I=Object(d.a)(A,2),P=I[0],R=I[1],M=Object(i.useState)(!1),L=Object(d.a)(M,2),U=L[0],q=L[1],H=Object(i.useState)(!1),K=Object(d.a)(H,2),V=K[0],G=K[1],Q=Object(i.useState)([]),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)([]),ee=Object(d.a)($,2),te=ee[0],ne=ee[1],ie=Object(i.useState)([]),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)([]),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(i.useState)([]),be=Object(d.a)(me,2),pe=be[0],he=be[1],ge=Object(i.useState)([]),xe=Object(d.a)(ge,2),Oe=xe[0],ke=xe[1],Ne=Object(i.useState)([]),Be=Object(d.a)(Ne,2),Se=Be[0],Ee=Be[1],De=Object(i.useState)([]),ze=Object(d.a)(De,2),Re=ze[0],Me=ze[1],Le=Object(i.useState)([]),Fe=Object(d.a)(Le,2),Ue=Fe[0],We=Fe[1],Ye=Object(i.useState)({imagen:null,nombre:"",nombre_privado:"",descripcion:"",tipo_vp:"",nivel_vp:"",tiempo_vp:null,cantidad_tiempo:null,costo_vp:"",id_organizaciones:1!==l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?j:"",id_plantillas_recomendadas:[],url:"",img_prev:"",id_usuarios:null===(t=l.data_user)||void 0===t?void 0:t.id,estado:"",id_organizacion_hija:null}),qe=Object(d.a)(Ye,2),He=qe[0],Ke=qe[1],Ve=Object(i.useState)({imagen:null,nombre:"",nombre_privado:"",descripcion:"",tipo_vp:"",nivel_vp:"",tiempo_vp:null,cantidad_tiempo:null,costo_vp:"",id_organizaciones:1!==l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?j:"",id_plantillas_recomendadas:[],url:"",img_prev:"",id_usuarios:null===(a=l.data_user)||void 0===a?void 0:a.id,estado:"",id_organizacion_hija:null}),Ge=Object(d.a)(Ve,2),Qe=Ge[0],Je=Ge[1],Xe=Object(i.useState)([]),Ze=Object(d.a)(Xe,2),$e=Ze[0],et=Ze[1],tt=Object(i.useState)({}),at=Object(d.a)(tt,2),nt=at[0],it=at[1],rt=new RegExp(/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/),ot=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","breadCrumps"]),st=Object(d.a)(ot,1)[0],lt="en"===(null===(r=window.localStorage.state)||void 0===r||null===(c=r.split('"lenguage":"')[1])||void 0===c?void 0:c.slice(0,2));Object(i.useEffect)((function(){dt().catch((function(){w.push("/500"),window.location.reload()}))}),[]);var dt=function(){var t=Object(h.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return R(!0),t.next=3,ut();case 3:return t.next=5,bt();case 5:return t.next=7,pt();case 7:return t.next=9,jt();case 9:return t.next=11,ft();case 11:return t.next=13,ht();case 13:return t.next=15,yt();case 15:if(!e.match.params.id){t.next=21;break}return t.next=18,wt();case 18:y(st("breadCrumps:breadCrumps.badge-template-edit",{returnObjects:!0})),t.next=22;break;case 21:y(st("breadCrumps:breadCrumps.badge-template-create",{returnObjects:!0}));case 22:R(!1);case 23:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();Object(i.useEffect)((function(){vt(He.id_organizaciones).catch((function(){w.push("/500"),window.location.reload()}))}),[He.id_organizaciones]);var ut=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/hability/getHabilities");case 2:t=e.sent,a=t.data,ke(a.habilities.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),bt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTypes");case 2:t=e.sent,a=t.data,Z(a.types);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,ne(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),jt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,oe(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ft=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,ue(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ht=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTypeCriteria");case 2:t=e.sent,a=t.data,he(a.typeCriteria);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),gt=6===l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,xt=6===(null===(o=l.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===o?void 0:o.rol),Ot=1===l.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,vt=function(){var t=Object(h.a)(f.a.mark((function t(a){var n,i,r;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ce.a.post("/templateBadge/getTemplatesBadgesPublished/names",{id_organizaciones:a});case 2:n=t.sent,i=n.data,e.match.params.id?(r=parseInt(Object(Ie.a)(e.match.params.id),10),Ee(xt?i.templatesBadges.filter((function(e){return e.id!==r&&e.plantillasInsigniasHistorial[0].id_usuarios===l.data_user.id})):i.templatesBadges.filter((function(e){return e.id!==r})))):Ee(gt||xt?i.templatesBadges.filter((function(e){return e.plantillasInsigniasHistorial[0].id_usuarios===l.data_user.id})):i.templatesBadges);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),yt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Ot){e.next=8;break}return e.next=3,Ce.a.post("/organization/getOrganizations");case 3:t=e.sent,a=t.data,Me(a.organizations.rows),e.next=13;break;case 8:return e.next=10,Ce.a.get("/organization/".concat(j));case 10:n=e.sent,i=n.data,Me(i.organization.organizations);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),wt=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,d,u,b,j,h;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.get("/templateHability/".concat(c));case 3:o=t.sent,s=o.data,d=s.templateHability,u=d.templateBadge,b=d.criterion,j=d.templateHability,h=d.linkPhoto,We(null===(a=s.templateHability)||void 0===a||null===(n=a.templateBadge)||void 0===n?void 0:n.insigniasEmitidas),Ke(Object(m.a)(Object(m.a)({},u),{},{id_plantillas_recomendadas:null===(i=s.templateHability)||void 0===i?void 0:i.recommendation.map((function(e){return{id:e.id,linkphoto:e.linkPhoto,id_plantillas_recomendadas:e.id_plantillas_recomendadas,id_plantillas:e.id_plantillas,nombre:e.plantillasInsigniasRecomendadas.nombre,nombre_privado:e.plantillasInsigniasRecomendadas.nombre_privado}})),imagen:h,img_prev:h,id_usuarios:null===(r=l.data_user)||void 0===r?void 0:r.id,estado:u.estado})),S(Object(p.a)(b.map((function(e,t){return{index:t,id:e.id,tipo_criterio_vp:e.tipo_criterio_vp,descripcion_criterio:e.descripcion_criterio,link:e.link}})))),et(Object(p.a)(j.map((function(e,t){return{index:t,id:e.id,id_habilidades:e.id_habilidades,id_plantillas:e.id_plantillas,descripcion:e.habilidades.descripcion}}))));case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ct=function(){return!(0===Ue||!e.match.params.id)},kt=function(e){Ke(Object(m.a)(Object(m.a)({},He),{},Object(b.a)({},e.target.name,e.target.value)))},Nt=function(e,t){B.map((function(a){return a.index===t&&(a[e.target.name]=e.target.value),a})),S(Object(p.a)(B))},Bt=function(e){return""!==e.nombre_privado&&null!==e.nombre_privado?"".concat(e.nombre," (").concat(e.nombre_privado,")"):e.nombre},St=B.filter((function(e){var t;if("link"in e)return!rt.test(e.link)&&""!==e.link&&null!==e.link&&0!==(null===(t=e.link)||void 0===t?void 0:t.length)})),Tt=function(e){return!(e>1)&&(He.cantidad_tiempo=null,!0)},At=function(){q(!1)};if(P)return Object(n.jsx)(_t,{loading:P});var Et,Dt=function(e,t){"string"===typeof e&&(G(!0),it({value:e,index:t}))},zt=function(){G(!1)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:C.root,onSubmit:function(t){if(t.preventDefault(),R(!0),$e<=0)R(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:st("alerts:alerts.skill-alert"),showConfirmButton:!1,timer:1500});else if(null===He.imagen)R(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:st("alerts:alerts.img-alert"),showConfirmButton:!1,timer:1500});else if(!rt.test(He.url)&&""!==He.url||St.length>0)rt.test(He.url)||""===He.url||(R(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:st("alerts:alerts.url-alert"),showConfirmButton:!1,timer:1500})),St.length>0&&(R(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:st("alerts:alerts.url-criteria-alert"),showConfirmButton:!1,timer:1500}));else if(""!==He.url&&(He.url.includes("https://")||He.url.includes("http://")||(He.url="https://".concat(He.url))),B.map((function(e){return""!==e.link&&null!==e.link&&void 0!==e.link&&(e.link.includes("https://")||e.link.includes("http://")||(e.link="https://".concat(e.link))),e})),e.match.params.id){var a=Object(Ie.a)(e.match.params.id),n=new FormData;n.append("file",He.imagen),Ce.a.put("/templateHability/".concat(a),Object(m.a)(Object(m.a)({},He),{},{imagen:He.imagen.name,criterios:B,id_habilidades:$e})).then((function(e){var t=Pe()("certika-organization-".concat(j)).toString(),i=Pe()("certika-badge-".concat(a)).toString();He.imagen.name?ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-badge/").concat(t,"/").concat(i),headers:{"Content-Type":"multipart/form-data"},data:n}).then((function(e){0===He.estado?(R(!1),w.push("/templates/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:st("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})):(R(!1),w.push("/templates/published"),F.a.fire({icon:"success",iconColor:E.a.primary,text:st("alerts:alerts.edited"),showConfirmButton:!1,timer:1500}))})):0===He.estado?(R(!1),w.push("/templates/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:st("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})):(R(!1),w.push("/templates/published"),F.a.fire({icon:"success",iconColor:E.a.primary,text:st("alerts:alerts.edited"),showConfirmButton:!1,timer:1500}))})).catch((function(e){R(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:st("alerts:alerts.edited-error"),showConfirmButton:!1,timer:1500}),w.push("/500"),window.location.reload()}))}else{var i=new FormData;i.append("file",He.imagen),Ce.a.post("/templateHability/",Object(m.a)(Object(m.a)({},He),{},{imagen:He.imagen.name,criterios:B,id_habilidades:$e})).then((function(e){var t=Pe()("certika-organization-".concat(j)).toString(),a=Pe()("certika-badge-".concat(e.data.templateHabilityId)).toString();ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-badge/").concat(t,"/").concat(a),headers:{"Content-Type":"multipart/form-data"},data:i}).then((function(e){R(!1),w.push("/templates/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:st("alerts:alerts.created"),showConfirmButton:!1,timer:1500})}))})).catch((function(e){R(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:st("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500}),w.push("/500"),window.location.reload()}))}},children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:st("certificateBadgeTemplate:badges-certificate-form.details-badge")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:C.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:Object(n.jsx)(g.a,{alt:"img-prev",src:null===He||void 0===He?void 0:He.img_prev,variant:"rounded",className:C.avatar,children:Object(n.jsx)(Kr.a,{sx:{margin:3,fontSize:"4em"}})})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:8,children:[Object(n.jsx)(we.a,{variant:"body2",className:C.text,children:st("certificateBadgeTemplate:badges-certificate-form.badge-img")}),Object(n.jsxs)("div",{className:C.contentInput,children:[Object(n.jsx)("input",{accept:"image/*",className:C.input,id:"contained-button-file",name:"imagen",type:"file",onChange:function(e){return function(e){var t=e.target.files[0];Ke(Object(m.a)(Object(m.a)({},He),{},{imagen:t,img_prev:URL.createObjectURL(t)}))}(e)},disabled:Ct()}),Object(n.jsx)("label",{htmlFor:"contained-button-file",children:Object(n.jsx)(x.a,{color:"primary",variant:"outlined",component:"span",className:C.button,disabled:Ct(),children:st("buttons:buttons.upload-image")})})]})]})]}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:C.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:C.text,align:"right",children:[st("certificateBadgeTemplate:badges-certificate-form.badge-public-name"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:Ct(),required:!0,label:"",name:"nombre",variant:"outlined",size:"small",onChange:kt,value:null===He||void 0===He?void 0:He.nombre})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:C.text,align:"right",children:[st("certificateBadgeTemplate:badges-certificate-form.badge-private-name"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"",name:"nombre_privado",variant:"outlined",size:"small",onChange:kt,value:null===He||void 0===He?void 0:He.nombre_privado})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:C.text,align:"right",children:[st("certificateBadgeTemplate:badges-certificate-form.description"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:Ct(),required:!0,label:"",name:"descripcion",variant:"outlined",size:"small",multiline:!0,rows:4,value:null===He||void 0===He?void 0:He.descripcion,onChange:kt})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:C.text,align:"right",children:st("certificateBadgeTemplate:badges-certificate-form.additional")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:Ct(),label:"",name:"url",variant:"outlined",size:"small",placeholder:"http://",onChange:kt,value:null===He||void 0===He?void 0:He.url})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:C.text,align:"right",children:[st("certificateBadgeTemplate:badges-certificate-form.skills"),"*"]})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:8,children:[Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(oo.a,{disabled:Ct(),multiple:!0,disableClearable:!0,freeSolo:!0,id:"tags-filled",className:C.autocomplete,value:$e,onChange:function(e,t){return function(e,t){et(t),ke(Oe.filter((function(t){return t.descripcion.trim()!==e.target.innerText})))}(e,t)},options:Oe.sort((function(e,t){return e.descripcion.trim()<t.descripcion.trim()?-1:1})).map((function(e){return{id_habilidades:e.id,descripcion:e.descripcion}})),getOptionLabel:function(e){return e.descripcion},renderTags:function(e,t){return et(e)},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{multiline:!0,variant:"outlined",label:st("selects:selects-autocompletes.skill-select"),fullWidth:!0}))}})}),$e.length>0?Object(n.jsx)(ve.a,{variant:"outlined",className:C.card,children:Object(n.jsx)(_e.a,{children:$e.map((function(e,t){return Object(n.jsx)(ye.a,{children:Object(n.jsx)(fe.a,{disabled:Ct(),onDelete:function(){return function(e){et($e.filter((function(t){return t!==e}))),e.id_habilidades&&ke([].concat(Object(p.a)(Oe),[e]))}(e)},onClick:function(){return Dt(e,t)},variant:"outlined",label:Object(n.jsx)(we.a,{className:C.skills,children:"string"===typeof e?e:e.descripcion}),className:C.chip},t)})}))})}):""]}),Ot&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:C.text,align:"right",children:st("certificateBadgeTemplate:badges-certificate-form.organization")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:Ct(),id:"organizacion",name:"id_organizaciones",onChange:kt,value:He.id_organizaciones,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:st("selects:selects-autocompletes.select-option")})}),Re.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},e.id)}))]})})})]}),(null===Re||void 0===Re||null===(s=Re.organizacionesRelaciones)||void 0===s?void 0:s.length)>0&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:C.text,align:"right",children:st("certificateBadgeTemplate:badges-certificate-form.organization")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:Ct(),id:"organizacion",name:"id_organizacion_hija",onChange:kt,value:He.id_organizacion_hija,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:st("selects:selects-autocompletes.select-option")})}),function(){var e=null===Re||void 0===Re?void 0:Re.organizacionesRelaciones.map((function(e){return e.organizacionesRelacionadas}));return e.push(Re),e.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},e.id)}))}()]})})})]})]}),Object(n.jsx)(W.a,{className:C.root}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:C.root,children:st("certificateBadgeTemplate:badges-certificate-form.criteria-title")}),B.map((function(e,t){return Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:C.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:C.text,align:"right",children:"".concat(st("certificateBadgeTemplate:badges-certificate-form.criterion")," ").concat(t+1)})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:C.card,children:[Object(n.jsxs)(_e.a,{children:[Object(n.jsxs)(we.a,{variant:"body1",align:"left",children:[st("certificateBadgeTemplate:badges-certificate-form.type"),"*"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100 ".concat(C.fieldCard),size:"small",children:Object(n.jsxs)(T.a,{disabled:Ct(),name:"tipo_criterio_vp",id:"tipo_criterio_vp",onChange:function(t){return Nt(t,e.index)},value:e.tipo_criterio_vp,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:st("selects:selects-autocompletes.select-option")})}),pe.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:lt?e.valor_parametro_en:e.valor_parametro},e.id)}))]})}),Object(n.jsxs)(we.a,{variant:"body1",align:"left",className:C.root,children:[st("certificateBadgeTemplate:badges-certificate-form.description"),"*"]}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:Ct(),required:!0,label:"",name:"descripcion_criterio",variant:"outlined",size:"small",multiline:!0,value:e.descripcion_criterio,rows:4,onChange:function(t){return Nt(t,e.index)},className:C.fieldCard})}),Object(n.jsx)(we.a,{variant:"body1",align:"left",className:C.root,children:st("certificateBadgeTemplate:badges-certificate-form.criterion-url")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:Ct(),label:"",name:"link",variant:"outlined",size:"small",placeholder:"http://",value:e.link,onChange:function(t){return Nt(t,e.index)},className:C.fieldCard})})]}),Object(n.jsx)(wc.a,{children:B.length>1&&Object(n.jsx)(x.a,{disabled:Ct(),size:"small",onClick:function(t){return function(e,t){var a=B.filter((function(e){return e.index!==t}));S(a)}(0,e.index)},children:Object(n.jsxs)(we.a,{color:"textSecondary",variant:"body2",children:[Object(n.jsx)(ae.a,{}),st("buttons:buttons.delete")]})})})]})})]},e.id)})),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(x.a,{color:"primary",variant:"outlined",className:C.button,onClick:function(){var e=B[B.length-1];S([].concat(Object(p.a)(B),[{index:e.index+1}]))},disabled:Ct(),children:st("buttons:buttons.add-criterion")})})]}),Object(n.jsx)(W.a,{className:C.root}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:C.root,children:st("certificateBadgeTemplate:badges-certificate-form.attributes")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:C.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",align:"right",className:C.text,children:[st("certificateBadgeTemplate:badges-certificate-form.type"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:Ct(),inputProps:{name:"tipo_vp",id:"tipo"},value:He.tipo_vp,onChange:kt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:st("selects:selects-autocompletes.select-option")})}),X.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:lt?e.valor_parametro_en:e.valor_parametro},e.id)}))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",align:"right",className:C.text,children:[st("certificateBadgeTemplate:badges-certificate-form.level"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:Ct(),inputProps:{name:"nivel_vp",id:"nivel"},value:null===He||void 0===He?void 0:He.nivel_vp,onChange:kt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:st("selects:selects-autocompletes.select-option")})}),te.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:lt?e.valor_parametro_en:e.valor_parametro},e.id)}))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:C.text,children:st("certificateBadgeTemplate:badges-certificate-form.time")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:Ct(),inputProps:{name:"tiempo_vp",id:"tiempo"},value:null===He||void 0===He?void 0:He.tiempo_vp,onChange:kt,children:[Object(n.jsx)(Y.a,{value:null,children:Object(n.jsx)("em",{children:st("selects:selects-autocompletes.select-option")})}),de.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:lt?e.valor_parametro_en:e.valor_parametro},e.id)}))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:C.text,children:st("certificateBadgeTemplate:badges-certificate-form.amount-time")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(Te.a,{disabled:Tt(He.tiempo_vp)||Ct(),required:!Tt(He.tiempo_vp),type:"number",name:"cantidad_tiempo",defaultValue:null,value:(Et=He.cantidad_tiempo,""===Et||Et<1?(He.cantidad_tiempo=null,He.cantidad_tiempo):Et),variant:"outlined",size:"small",onKeyUp:function(e){var t=String(e.target.value);/^([1-9][0-9]*(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t)||(e.target.value=t.substr(t.length))},onChange:kt})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",align:"right",className:C.text,children:[st("certificateBadgeTemplate:badges-certificate-form.cost"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:Ct(),inputProps:{name:"costo_vp",id:"costo"},value:null===He||void 0===He?void 0:He.costo_vp,onChange:kt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:st("selects:selects-autocompletes.select-option")})}),ce.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:lt?e.valor_parametro_en:e.valor_parametro},e.id)}))]})})})]}),Object(n.jsx)(W.a,{className:C.root}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:C.root,children:st("certificateBadgeTemplate:badges-certificate-form.recommendation-title")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:C.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(oo.a,{disabled:Ct(),multiple:!0,filterSelectedOptions:!0,id:"tags-filled",className:C.autocomplete,value:He.id_plantillas_recomendadas,onChange:function(e,t){Ke(Object(m.a)(Object(m.a)({},He),{},{id_plantillas_recomendadas:t}))},options:Se.map((function(e){return{linkphoto:e.linkPhoto,id_plantillas_recomendadas:e.id,nombre:e.nombre,nombre_privado:e.nombre_privado}})),getOptionLabel:function(e){return Bt(e)},getOptionSelected:function(e,t){return e.id_plantillas_recomendadas===t.id_plantillas_recomendadas},renderTags:function(e,t){return e.map((function(e,a){return Object(n.jsx)(fe.a,Object(m.a)(Object(m.a)({variant:"outlined",label:Bt(e)},t({index:a})),{},{onClick:Dt}))}))},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{variant:"outlined",label:st("selects:selects-autocompletes.recommendation-select")}))}})})})]}),Object(n.jsx)(W.a,{className:C.root}),Object(n.jsxs)("div",{className:"text-center ".concat(C.root),children:[Object(n.jsx)(x.a,{color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),type:"submit",disableElevation:!0,children:st("buttons:buttons.save")}),Object(n.jsx)(x.a,{color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),onClick:function(e){return function(e){var t,a,n,i,r,c,o,s,l,d,u,b,p,j,f,h,g=X.filter((function(t){return t.id===e.tipo_vp})),x=ce.filter((function(t){return t.id===e.costo_vp})),O=e.tiempo_vp?de.filter((function(t){return t.id===e.tiempo_vp})):"",v=te.filter((function(t){return t.id===e.nivel_vp})),_=Re.id;e.id?Je(Object(m.a)(Object(m.a)({},e),{},{tipos:lt?null===(t=g[0])||void 0===t?void 0:t.valor_parametro_en:null===(a=g[0])||void 0===a?void 0:a.valor_parametro,costos:lt?null===(n=x[0])||void 0===n?void 0:n.valor_parametro_en:null===(i=x[0])||void 0===i?void 0:i.valor_parametro,tiempos:lt?null===(r=O[0])||void 0===r?void 0:r.valor_parametro_en:null===(c=O[0])||void 0===c?void 0:c.valor_parametro,niveles:lt?null===(o=v[0])||void 0===o?void 0:o.valor_parametro_en:null===(s=v[0])||void 0===s?void 0:s.valor_parametro,criterios:B,id_habilidades:$e.map((function(e){return{descripcion:e.descripcion||e}}))})):Je(Object(m.a)(Object(m.a)({},e),{},{tipos:lt?null===(l=g[0])||void 0===l?void 0:l.valor_parametro_en:null===(d=g[0])||void 0===d?void 0:d.valor_parametro,costos:lt?null===(u=x[0])||void 0===u?void 0:u.valor_parametro_en:null===(b=x[0])||void 0===b?void 0:b.valor_parametro,tiempos:lt?null===(p=O[0])||void 0===p?void 0:p.valor_parametro_en:null===(j=O[0])||void 0===j?void 0:j.valor_parametro,niveles:lt?null===(f=v[0])||void 0===f?void 0:f.valor_parametro_en:null===(h=v[0])||void 0===h?void 0:h.valor_parametro,imagen:"",criterios:B,id_habilidades:$e.map((function(e){return{descripcion:e.descripcion||e}})),fecha_creacion:Date.now(),organizaciones:{nombre:_.nombre}})),q(!0)}(He)},disableElevation:!0,children:st("buttons:buttons.preview")}),Object(n.jsx)(x.a,{color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),onClick:function(){e.match.params.id&&0===He.estado?w.push("/templates/edited"):w.push("/templates/published")},disableElevation:!0,children:st("buttons:buttons.cancel")})]})]})})}),Object(n.jsxs)(O.a,{open:U,onClose:At,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:At,children:st("dialogs:dialog.preview-title")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(Wr,{vista:Qe,children:Qe.id_plantillas_recomendadas.map((function(e,t){var a;return Object(n.jsx)(It,{badgeImage:e.linkphoto,badgeName:e.nombre,organizationName:null===(a=Qe.organizaciones)||void 0===a?void 0:a.nombre,publicBadge:!1,templateBadge:!0},"badge".concat(t))}))})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),onClick:At,children:st("buttons:buttons.close")})})]}),Object(n.jsxs)(O.a,{open:V,onClose:zt,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{autoFocus:!0,required:!0,multiline:!0,id:"nombre",label:st("dialogs:dialog.skill"),variant:"outlined",onChange:function(e){return it(Object(m.a)(Object(m.a)({},nt),{},{value:e.target.value}))},defaultValue:nt.value})})}),Object(n.jsxs)(Ae.a,{center:!0,children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),onClick:function(){$e.splice(nt.index,1,nt.value),G(!1)},children:st("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),onClick:zt,children:st("buttons:buttons.cancel")})]})]})]})})),fd=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var hd=[{id:"habilities",label:"Habilidades",align:"center",orden:"descripcion"},{id:"templates",label:"Plantillas",align:"center"},{id:"",label:"",align:""},{id:"",label:"",align:""}],gd={changePage:I.b,changeBreadcrump:I.a},xd=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"habilidades"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),gd)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.changePage,m=Object(u.g)(),b=fd(),j=Object(i.useState)([]),g=Object(d.a)(j,2),O=g[0],v=g[1],_=Object(i.useState)([]),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(i.useState)([]),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)(""),D=Object(d.a)(A,2),z=D[0],P=D[1],R=Object(i.useState)(""),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)(!0),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],V=Object(i.useState)(),G=Object(d.a)(V,2),Q=G[0],J=G[1];Object(i.useEffect)((function(){r.includes("Leer")?X().catch((function(){m.push("/500"),window.location.reload()})):(m.push("/dashboard"),window.location.reload())}),[]);var X=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$();case 2:return e.next=4,te();case 4:c([{name:"Insignias"},{name:"Habilidades"}]),H(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Z=function(e,t){return{limit:t||10,offset:e?e*t:0}},$=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Z(0,a),e.next=3,Ce.a.post("/hability/getHabilities",r);case 3:c=e.sent,o=c.data,v(null===(t=o.habilities)||void 0===t?void 0:t.rows),T(null===(n=o.habilities)||void 0===n?void 0:n.rows),J(null===(i=o.habilities)||void 0===i?void 0:i.count);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(!0),i=Z(t,a),e.next=4,Ce.a.post("/hability/getHabilities",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(O),Object(p.a)(null===(n=c.habilities)||void 0===n?void 0:n.rows.filter((function(e){return!O.find((function(t){return t.id===e.id}))})))),v(o),T(o),H(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),te=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/templateHability/getTemplateHabilities/");case 2:t=e.sent,a=t.data,1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?C(a.templateHabilities):C(a.templateHabilities.filter((function(e){var t;return(null===(t=e.plantillasInsignias)||void 0===t?void 0:t.id_organizaciones)===s})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=function(e,t,a){switch(a){case"delete":ne(t);break;case"edit":m.push("/skills/edit/".concat(Object(Ie.b)(t)));break;case"create":m.push("/skills/create/")}},ne=function(e){F.a.fire({text:"\xbfEst\xe1 seguro que desea eliminar este registro?",icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:"Aceptar",cancelButtonText:"Cancelar",buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ie(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ie=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/hability/".concat(t));case 3:a=e.sent,n=a.data,v(O.filter((function(e){return e.id!==t}))),T(O.filter((function(e){return e.id!==t}))),n&&F.a.fire({text:"Eliminado exitosamente.",icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(0),F.a.fire({text:"No se pudo eliminar.",icon:"error",iconColor:E.a.primary}),m.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t){return e.apply(this,arguments)}}(),re=function(e){var t=0;return w.map((function(a){return a.id_habilidades===e&&(t+=1)})),0===t?Object(n.jsx)(yn.a,{align:"center",children:"No Asignada"}):Object(n.jsxs)(yn.a,{align:"center",children:[t,Object(n.jsx)(K.a,{title:"Ver Plantillas Asignadas",children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return ce(t,e)},children:Object(n.jsx)(Ge.a,{})})})]})},ce=function(t,a){e.history.push("/skills/templates/".concat(Object(Ie.b)(a)))},oe=function(e){if(r.includes("Editar"))return Object(n.jsx)(K.a,{title:"Editar",children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return ae(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})},se=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(K.a,{title:"Eliminar",children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return ae(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:b.button,onClick:function(e){return ae(0,0,"create")},children:Object(n.jsx)("span",{children:"Crear"})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"Habilities",items:O,setItems:T,changePage:l,loadData:X,setLoading:H}),Object(n.jsx)(zn,{columns:hd,rows:Q,setDirection:P,setOrderBy:U,changePagination:ee,children:Object(n.jsx)(vn.a,{children:q?Object(n.jsx)(qn,{columns:hd,photo:0}):B.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(B,Object(I.f)(z,L)).slice(t*a,t*a+a).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:e.descripcion}),re(e.id),Object(n.jsx)(yn.a,{align:"center",children:oe(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:se(e.id)})]},e.id)}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:"No hay datos registrados"})})})})]})})),Od=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.1em",padding:"8px 40px"},input:{display:"none"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},avatar:{padding:5,width:"auto",height:"auto"},icon:{fontSize:"4em"}}}));var vd={changeBreadcrump:I.a},_d=Object(s.b)(null,vd)((function(e){var t=e.changeBreadcrump,a=Object(u.g)(),r=Od(),c=Object(i.useState)({descripcion:""}),o=Object(d.a)(c,2),s=o[0],l=o[1],p=Object(i.useState)(!1),j=Object(d.a)(p,2),g=j[0],O=j[1];Object(i.useEffect)((function(){e.match.params.id?(v().catch((function(){a.push("/500"),window.location.reload()})),t([{name:"Insignias"},{name:"Habilidades",route:"/skills"},{name:"Editar"}])):t([{name:"Insignias"},{name:"Habilidades",route:"/skills"},{name:"Crear"}])}),[]);var v=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.get("/hability/".concat(a));case 3:n=t.sent,i=n.data,l(i.hability);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),_=function(){O(!1)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:r.root,onSubmit:function(t){if(t.preventDefault(),O(!g),e.match.params.id){var n=e.match.params.id;Ce.a.put("/hability/".concat(n),s).then((function(e){_(),a.push("/skills"),F.a.fire({icon:"success",iconColor:E.a.primary,text:"Editado exitosamente.",showConfirmButton:!1,timer:1500})})).catch((function(e){_(),F.a.fire({icon:"error",iconColor:E.a.primary,text:"No se ha podido editar.",showConfirmButton:!1,timer:1500}),a.push("/500"),window.location.reload()}))}else Ce.a.post("/hability/",s).then((function(e){O(!1),a.push("/skills"),F.a.fire({icon:"success",iconColor:E.a.primary,text:"Creado exitosamente.",showConfirmButton:!1,timer:1500})})).catch((function(e){O(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:"No se ha podido crear.",showConfirmButton:!1,timer:1500}),a.push("/500"),window.location.reload()}))},children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:"Descripci\xf3n de la Habilidad."}),Object(n.jsx)(ye.a,{container:!0,spacing:4,className:r.root,children:Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Describa la habilidad",name:"descripcion",variant:"outlined",value:s.descripcion,onChange:function(e){l(Object(m.a)(Object(m.a)({},s),{},Object(b.a)({},e.target.name,e.target.value)))}})})})}),Object(n.jsxs)("div",{className:"text-center ".concat(r.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(r.button),type:"submit",children:"Guardar"}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(r.button),onClick:function(){a.push("/skills")},children:"Cancelar"})]})]})})})]})})),yd=Object(C.a)((function(e){return{large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var wd=[{id:"insignia",label:"Insignia",align:"center"},{id:"name",label:"Nombre P\xfablico",align:"center",orden:"plantillasInsignias.nombre"},{id:"private_name",label:"Nombre Privado",align:"center",orden:"plantillasInsignias.nombre_privado"},{id:"tipo",label:"Organizaci\xf3n",align:"center"},{id:"date",label:"\xdaltima Actualizaci\xf3n",align:"center",orden:"plantillasInsignias.fecha_ultima_modificacion"},{id:"state",label:"Estado",align:"center"},{id:"",label:"",align:"center"}],Cd={changePage:I.b,changeBreadcrump:I.a},kd=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"habilidades"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),Cd)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=e.permission,o=e.user,s=e.organizationId,l=e.changePage,m=Object(u.g)(),b=Object(i.useState)([]),p=Object(d.a)(b,2),j=p[0],O=p[1],v=Object(i.useState)([]),_=Object(d.a)(v,2),y=_[0],w=_[1],C=Object(i.useState)([]),k=Object(d.a)(C,2),N=k[0],B=k[1],T=yd(),A=Object(i.useState)(""),E=Object(d.a)(A,2),D=E[0],z=E[1],P=Object(i.useState)(""),R=Object(d.a)(P,2),M=R[0],L=R[1],F=Object(i.useState)(!0),U=Object(d.a)(F,2),W=U[0],Y=U[1];Object(i.useEffect)((function(){c.includes("Leer")?q().catch((function(){m.push("/500"),window.location.reload()})):(m.push("/dashboard"),window.location.reload())}),[]);var q=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,V();case 2:return e.next=4,H();case 4:r([{name:"Insignias"},{name:"Habilidades",route:"/skills"},{name:"Plantillas Asignadas"}]),Y(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/templateHability/getTemplateHabilities/",{id_habilidades:a});case 3:n=t.sent,i=n.data,1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?(O(i.templateHabilities),w(i.templateHabilities)):(O(i.templateHabilities.filter((function(e){var t;return(null===(t=e.plantillasInsignias)||void 0===t?void 0:t.id_organizaciones)===s}))),w(i.templateHabilities.filter((function(e){var t;return(null===(t=e.plantillasInsignias)||void 0===t?void 0:t.id_organizaciones)===s}))));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),V=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/templateBadge/getTemplatesBadges");case 2:t=e.sent,a=t.data,B(a.templatesBadges);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(e){var t=null;return N.map((function(a){a.id===e&&(t=a.linkPhoto)})),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{alt:"Remy Sharp",src:t,className:T.large})})},Q=function(e){var t=null;return N.map((function(a){a.id===e&&(t=a.organizaciones.nombre)})),Object(n.jsx)(yn.a,{align:"center",children:t})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:T.button,onClick:function(e){return m.push("/skills")},children:Object(n.jsx)("span",{children:"Regresar"})})}),Object(n.jsx)(Fn,{items:j,setItems:w,changePage:l,loadData:q,setLoading:Y}),Object(n.jsx)(zn,{columns:wd,rows:y,setDirection:z,setOrderBy:L,children:Object(n.jsx)(vn.a,{children:W?Object(n.jsx)(qn,{columns:wd,photo:1}):y.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(y,Object(I.f)(D,M)).slice(t*a,t*a+a).map((function(t){var a,i,r,c,o;return Object(n.jsxs)(_n.a,{children:[G(null===(i=t.plantillasInsignias)||void 0===i?void 0:i.id),Object(n.jsx)(yn.a,{align:"center",children:null===(r=t.plantillasInsignias)||void 0===r?void 0:r.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(c=t.plantillasInsignias)||void 0===c?void 0:c.nombre_privado}),Q(null===(o=t.plantillasInsignias)||void 0===o?void 0:o.id),Object(n.jsx)(yn.a,{align:"center",children:Ne()(t.plantillasInsignias.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm")}),Object(n.jsx)(yn.a,{align:"center",children:1===t.plantillasInsignias.estado?"Publicada":2===t.plantillasInsignias.estado?"Archivada":0===t.plantillasInsignias.estado?"En Edici\xf3n":-1===t.plantillasInsignias.estado?"Eliminada":""}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:"Ver Plantilla",children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(a){var n,i;return i=null===(n=t.plantillasInsignias)||void 0===n?void 0:n.id,void e.history.push("/templates/published/details/".concat(Object(Ie.b)(i)))},children:Object(n.jsx)(Ge.a,{})})})})]},null===(a=t.plantillasInsignias)||void 0===a?void 0:a.id)}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:"No hay datos registrados"})})})]})})),Nd=Object(C.a)((function(e){return{root:{marginTop:"2em"},card:{minWidth:275},img:Object(b.a)({width:e.spacing(40)},e.breakpoints.up("sm"),{width:"auto"}),button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}}}}));var Bd=function(e){var t=Nd(),a=Object(u.g)(),r=Object(i.useState)(""),c=Object(d.a)(r,2),o=c[0],s=c[1],l=Object(i.useState)(!1),m=Object(d.a)(l,2),b=m[0],p=m[1],j=Object(i.useState)(!1),f=Object(d.a)(j,2),h=f[0],g=f[1],O=Object(i.useState)(""),v=Object(d.a)(O,2),_=v[0],y=v[1];return Object(i.useEffect)((function(){var t,n=null===(t=JSON.parse(window.localStorage.state))||void 0===t?void 0:t.styles;y(n.logo435x149),p(!0);var i=Object(Ie.a)(e.match.params.badgeId);Ce.a.get("/badgesIssued/reject/".concat(i)).then((function(e){p(!1),s(e.data.message),g(e.data.account)})).catch((function(){a.push("/500"),window.location.reload()}))}),[]),Object(n.jsx)("div",{className:"App",children:Object(n.jsxs)("div",{className:"App-header",children:[Object(n.jsx)(ve.a,{className:t.card,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)("img",{src:_,alt:"logo",className:t.img}),Object(n.jsx)(we.a,{children:o}),Object(n.jsx)("form",{className:t.root,onSubmit:function(t){var n=e.match.params.badgeId;h?a.push("/sign-in"):a.push("/sign-up/".concat(n,"/reject"))},children:Object(n.jsx)("div",{className:"text-center ".concat(t.root),children:Object(n.jsx)(x.a,{variant:"contained",size:"small",className:"my-2 ".concat(t.button),type:"submit",children:h?"Iniciar sesi\xf3n":"Registrarme"})})})]})}),Object(n.jsx)(_t,{loading:b})]})})},Sd=Object(C.a)((function(e){return{root:{marginTop:"2em"},card:{minWidth:275},img:Object(b.a)({width:e.spacing(40)},e.breakpoints.up("sm"),{width:"auto"}),button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}}}}));var Td={setStyles:I.H},Ad=Object(s.b)(null,Td)((function(e){var t=Sd(),a=Object(u.g)(),r=Object(i.useState)(""),c=Object(d.a)(r,2),o=c[0],s=c[1],l=Object(i.useState)(!1),m=Object(d.a)(l,2),b=m[0],p=m[1],j=Object(i.useState)(""),f=Object(d.a)(j,2),h=f[0],g=f[1];return Object(i.useEffect)((function(){var t,n=null===(t=JSON.parse(window.localStorage.state))||void 0===t?void 0:t.styles;g(n.logo435x149),p(!0);var i=Object(Ie.a)(e.match.params.badgeId);Ce.a.get("/badgesIssued/accept/".concat(i)).then((function(e){p(!1),s(e.data.message)})).catch((function(){a.push("/500"),window.location.reload()}))}),[]),Object(n.jsx)("div",{className:"App",children:Object(n.jsxs)("div",{className:"App-header",children:[Object(n.jsx)(ve.a,{className:t.card,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)("img",{src:h,alt:"logo",className:t.img}),Object(n.jsx)(we.a,{children:o}),Object(n.jsx)("form",{className:t.root,onSubmit:function(e){a.push("/sign-in")},children:Object(n.jsx)("div",{className:"text-center ".concat(t.root),children:Object(n.jsx)(x.a,{variant:"contained",size:"small",className:"my-2 ".concat(t.button),type:"submit",children:"Iniciar sesi\xf3n"})})})]})}),Object(n.jsx)(_t,{loading:b})]})})}));var Ed=Object(C.a)((function(e){var t;return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"1em"},img:{width:e.spacing(30),height:e.spacing(30)},img_verificado:{display:"inline-block",height:e.spacing(5),margin:"auto"},img_org:{width:"auto",height:e.spacing(6)},container_org:{display:"flex",justifyContent:"center",textAlign:"center",alignItems:"center"},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},textParagraph:{textAlign:"justify",color:"#5c5c5c",margin:"1em 0 1em 0"},textCode:{color:"#808080",textAlign:"left"},link:{color:E.a.primary,textDecoration:"underline"},button:{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".5em 3em","&:hover":{backgroundColor:E.a.secondary}},containerButtonToCopy:{display:"flex",alignItems:"center","& svg":{color:E.a.primary,marginLeft:15,cursor:"pointer"}},header:(t={marginTop:"3em",display:"flex",justifyContent:"center",textAlign:"center"},Object(b.a)(t,e.breakpoints.up("sm"),{marginTop:"0"}),Object(b.a)(t,e.breakpoints.up("xl"),{marginTop:"1em"}),t),WhatsAppIcon:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00d954",marginLeft:".7em","&:hover":{backgroundColor:"#009B3C"}},LinkedInIcon:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#018ec5",marginLeft:".7em","&:hover":{backgroundColor:"#005374"}},LinkedInIconMenu:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#018ec5","&:hover":{backgroundColor:"#018ec5"}},textLinkedMenu:{fontSize:".8em",marginLeft:".5em"},TwitterIcon:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0080A0"}},FacebookIcon:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#0080ff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},TelegramIcon:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#00ccff",marginLeft:".7em","&:hover":{backgroundColor:"#0055A9"}},ShareIcon:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#888888",marginLeft:".7em","&:hover":{backgroundColor:"#545454"}},divider:{marginRight:"2em"},closeButton:{margin:".5em .5em 0 0",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}},xtwitterIcon:{width:e.spacing(4),height:e.spacing(4),color:"#ffffff",backgroundColor:"#2f3136",marginLeft:".7em","&:hover":{backgroundColor:"#000"}}}})),Id={bgcolor:"background.paper",borderColor:"#808080",m:1,border:1,padding:1},Dd={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},zd={setBadge:I.k},Pd=Object(s.b)((function(e){return{user:e.user,badge:e.badge||{},styles:e.styles}}),zd)((function(e){var t,a,r,c,o,s,l,b,p,j,g,x,O,v,_,y,w,C,k,N,B,T,A,E,I,z,P,R,M,L,F=e.user,q=e.badge,H=e.setBadge,K=e.styles,V=Ed(),G=Object(u.g)(),Q=Object(i.useState)(!1),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(!1),ee=Object(d.a)($,2),te=ee[0],ne=ee[1],ie=Object(i.useState)(!1),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)({}),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(i.useState)({}),be=Object(d.a)(me,2),pe=be[0],fe=be[1],he=Object(i.useState)({}),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ve=Object(i.useState)([]),_e=Object(d.a)(ve,2),ke=_e[0],Be=_e[1],Se=Object(i.useState)([]),Te=Object(d.a)(Se,2),Ae=Te[0],Ee=Te[1],De=Object(i.useState)({}),ze=Object(d.a)(De,2),Pe=ze[0],Re=ze[1],Me=Object(i.useState)(""),Le=Object(d.a)(Me,2),Fe=Le[0],Ue=Le[1],We=Object(i.useState)(null),Ye=Object(d.a)(We,2),qe=Ye[0],He=Ye[1],Ke=Object(i.useState)(null),Ve=Object(d.a)(Ke,2),Ge=Ve[0],Qe=Ve[1],Je=Boolean(qe),Xe="primary-search-account-menu",Ze="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2)),$e=Object(D.a)(["certificateBadgeTemplate","buttons"]),et=Object(d.a)($e,1)[0];null==F&&G.push("/"),Object(i.useEffect)((function(){tt().catch((function(){G.push("/500"),window.location.reload()}))}),[]),Object(i.useEffect)((function(){!ce&&window.GS&&GS.reset()}),[ce]);var tt=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u,b,p,j,h,g,x,O,v,_,y,w,C,k,N,B;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return oe(!0),C=Object(Ie.a)(e.match.params.badgeId),t.next=4,Ce.a.get("/badges/getBadge/".concat(C));case 4:k=t.sent,N=k.data.data,F.data_user.id!==N.badge.cuentas.usuarios.id&&G.push("/badges/".concat(Object(Ie.b)(null===N||void 0===N||null===(B=N.badge)||void 0===B?void 0:B.id_insignias_emitidas))),H(Object(m.a)(Object(m.a)({},N.badge),{},{photoBadge:N.photoBadge})),at(null===(a=N.badge)||void 0===a||null===(n=a.insigniasEmitidas)||void 0===n?void 0:n.plantillasInsignias.nivel_vp),nt(null===(i=N.badge)||void 0===i||null===(r=i.insigniasEmitidas)||void 0===r?void 0:r.plantillasInsignias.tiempo_vp),it(null===(c=N.badge)||void 0===c||null===(o=c.insigniasEmitidas)||void 0===o?void 0:o.plantillasInsignias.costo_vp),Be(null===(s=N.badge)||void 0===s||null===(l=s.insigniasEmitidas)||void 0===l||null===(d=l.plantillasInsignias)||void 0===d?void 0:d.plantillasHabilidades),Ee(null===(u=N.badge)||void 0===u||null===(b=u.insigniasEmitidas)||void 0===b||null===(p=b.plantillasInsignias)||void 0===p?void 0:p.criterios),Re(null!==(null===(j=N.badge.insigniasEmitidas)||void 0===j||null===(h=j.plantillasInsignias)||void 0===h?void 0:h.id_organizacion_hija)?null===(g=N.badge.insigniasEmitidas)||void 0===g||null===(x=g.plantillasInsignias)||void 0===x?void 0:x.organizacionesHijas:null===(O=N.badge.insigniasEmitidas)||void 0===O||null===(v=O.plantillasInsignias)||void 0===v?void 0:v.organizaciones),Qe(N.photoOrganization),0===(null===(_=N.badge.insigniasEmitidas)||void 0===_?void 0:_.estado)?Ue("Revoked"):null!==(null===(y=N.badge.insigniasEmitidas)||void 0===y?void 0:y.fecha_expiracion)&&Object(Vt.a)(new Date(null===(w=N.badge.insigniasEmitidas)||void 0===w?void 0:w.fecha_expiracion),new Date)?Ue("Expired"):Ue("Verified"),oe(!1);case 17:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),at=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:a=e.sent,n=a.data,i=n.levels.filter((function(e){return e.id===t})),ue(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),nt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:a=e.sent,n=a.data,i=n.time.filter((function(e){return e.id===t})),fe(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),it=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:a=e.sent,n=a.data,i=n.costs.filter((function(e){return e.id===t})),Oe(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),rt=function(e){Ce.a.post("/share/statisticSocialNetwork",{id_redes_sociales:e,id_insignias_emitidas:q.id_insignias_emitidas,id_usuarios:F.id})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsx)(S.a,{className:V.closeButton,onClick:function(){return G.push("/dashboard")},children:Object(n.jsx)(ae.a,{})}),Object(n.jsxs)(Rt.a,{className:V.container,maxWidth:"xl",children:[Object(n.jsxs)(ye.a,{container:!0,spacing:0,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,className:"text-center",children:[Object(n.jsx)("img",{alt:"img-badge",src:q.photoBadge,className:V.img}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:V.textTitle,children:[et("certificateBadgeTemplate:details.issued-by"),":"]}),Object(n.jsx)("div",{className:"container_org",children:Object(n.jsx)("a",{href:"/organization/".concat(null===Pe||void 0===Pe?void 0:Pe.url_perfil),target:"_blank",rel:"noreferrer",children:Object(n.jsx)("img",{"aria-label":"img_organization",className:V.img_org,src:Ge})})})]}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:V.textBolder,children:[et("certificateBadgeTemplate:details.issued"),":"]}),Object(n.jsx)(we.a,{className:V.text,children:Ne()(null===(r=q.insigniasEmitidas)||void 0===r?void 0:r.fecha_emision).format("DD-MM-YYYY")})]}),null!==(null===(c=q.insigniasEmitidas)||void 0===c?void 0:c.fecha_expiracion)&&"0000-00-00"!==(null===q||void 0===q||null===(o=q.insigniasEmitidas)||void 0===o?void 0:o.fecha_expiracion)&&Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:V.textBolder,children:[et("certificateBadgeTemplate:details.expiration"),":"]}),Object(n.jsx)(we.a,{className:V.text,children:Ne()(null===(s=q.insigniasEmitidas)||void 0===s?void 0:s.fecha_expiracion).format("DD-MM-YYYY")})]}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:V.textBolder,children:[et("certificateBadgeTemplate:details.badge-link"),":"]}),Object(n.jsx)(Lt.a,{display:"flex",justifyContent:"center",children:Object(n.jsxs)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Id),{},{className:V.containerButtonToCopy,children:[Object(n.jsx)(we.a,{className:V.textCode,children:"".concat(window.location.origin,"/badges/").concat(e.match.params.badgeId)}),Object(n.jsx)(Pt.CopyToClipboard,{text:"".concat(window.location.origin,"/badges/").concat(e.match.params.badgeId),onCopy:function(){return ne(!0)},children:Object(n.jsx)(qt.a,{icon:Ht.a,size:"lg"})})]}))}),te&&Object(n.jsx)(we.a,{className:V.text,children:et("certificateBadgeTemplate:details.copied")})]}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:V.textBolder,children:[et("certificateBadgeTemplate:details.badge-code"),":"]}),Object(n.jsx)(Lt.a,{display:"flex",justifyContent:"center",children:Object(n.jsxs)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Id),{},{className:V.containerButtonToCopy,children:[Object(n.jsx)(we.a,{className:V.textCode,children:"".concat(null===q||void 0===q||null===(l=q.insigniasEmitidas)||void 0===l?void 0:l.codigo_insignia)}),Object(n.jsx)(Pt.CopyToClipboard,{text:"".concat(null===q||void 0===q||null===(b=q.insigniasEmitidas)||void 0===b?void 0:b.codigo_insignia),onCopy:function(){return Z(!0)},children:Object(n.jsx)(qt.a,{icon:Ht.a,size:"lg"})})]}))}),X&&Object(n.jsx)(we.a,{className:V.text,children:et("certificateBadgeTemplate:details.copied")})]})]}),Object(n.jsx)(W.a,{orientation:"vertical",flexItem:!0,className:V.divider}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:7,children:[!ce&&Object(n.jsx)("div",{className:V.header,children:Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,xl:12,children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:V.textTitle,children:null===(p=q.insigniasEmitidas)||void 0===p||null===(j=p.plantillasInsignias)||void 0===j?void 0:j.nombre}),Ze?Object(n.jsx)("img",{alt:"img_verificado",src:"Verified"===Fe?Jt:"Revoked"===Fe?Xt:Zt,className:V.img_verificado}):Object(n.jsx)("img",{alt:"img_verificado",src:"Verified"===Fe?K.icon_verificado:"Revoked"===Fe?Gt:Qt,className:V.img_verificado})]})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:8,lg:6,xl:6,children:[Object(n.jsx)("a",{id:"linkedinShare",href:"https://www.linkedin.com/sharing/share-offsite",className:"gs-foreign-tracking gs-provider-linkedin","data-url":"".concat(je.a.certificateURL).concat(e.match.params.badgeId),"data-title":"".concat(et("certificateBadgeTemplate:sharing.badge-sharing")," ").concat(null===Pe||void 0===Pe?void 0:Pe.nombre).concat("Certika"===K.organizationName?" v\xeda @certikaco":"."),onClick:function(){return rt(3)},style:{display:"none"},children:"Linkedin"}),Object(n.jsx)(S.a,{className:V.LinkedInIcon,"aria-controls":Xe,"aria-haspopup":"true",onClick:function(e){He(e.currentTarget)},children:Object(n.jsx)(qt.a,{icon:Kt.e,size:"xs"})}),Object(n.jsx)("a",{href:"https://twitter.com/intent/tweet",className:"gs-foreign-tracking gs-provider-twitter","data-url":"".concat(je.a.certificateURL).concat(e.match.params.badgeId),"data-title":"".concat(et("certificateBadgeTemplate:sharing.badge-sharing")," ").concat((null===Pe||void 0===Pe||null===(g=Pe.redesSociales)||void 0===g||null===(x=g.find((function(e){return 5===e.id_redes_sociales})))||void 0===x?void 0:x.username)||(null===Pe||void 0===Pe?void 0:Pe.nombre)).concat("Certika"===K.organizationName?" v\xeda @certikaco":"."),onClick:function(){return rt(5)},children:Object(n.jsx)(S.a,{className:V.xtwitterIcon,children:Object(n.jsx)("img",{src:oa,alt:"XTwitter",height:23})})}),Object(n.jsx)("a",{href:"https://www.facebook.com/sharer/sharer.php",className:"gs-foreign-tracking gs-provider-facebook","data-url":"".concat(je.a.certificateURL).concat(e.match.params.badgeId),onClick:function(){return rt(4)},children:Object(n.jsx)(S.a,{className:V.FacebookIcon,children:Object(n.jsx)(qt.a,{icon:Kt.a,size:"sm"})})}),Object(n.jsx)("a",{href:"https://www.messenger.com/sharer/sharer.php",className:"gs-foreign-tracking gs-provider-fbm","data-url":"".concat(je.a.certificateURL).concat(e.match.params.badgeId),onClick:function(){return rt(7)},children:Object(n.jsx)(S.a,{className:V.TwitterIcon,children:Object(n.jsx)(qt.a,{icon:Kt.b,size:"sm"})})}),Object(n.jsx)("a",{href:"https://api.whatsapp.com/send",className:"gs-foreign-tracking gs-provider-whatsapp","data-url":"".concat(je.a.certificateURL,"whatsapp/").concat(e.match.params.badgeId),"data-title":"".concat(et("certificateBadgeTemplate:sharing.badge-sharing")," ").concat(null===Pe||void 0===Pe?void 0:Pe.nombre).concat("Certika"===K.organizationName?" v\xeda certika":"."),onClick:function(){return rt(2)},children:Object(n.jsx)(S.a,{className:V.WhatsAppIcon,children:Object(n.jsx)(Ft.a,{})})}),Object(n.jsx)("a",{href:"https://telegram.me/share",className:"gs-foreign-tracking gs-provider-telegram","data-url":"".concat(je.a.certificateURL).concat(e.match.params.badgeId),"data-title":"".concat(et("certificateBadgeTemplate:sharing.badge-sharing")," ").concat(null===Pe||void 0===Pe?void 0:Pe.nombre).concat("Certika"===K.organizationName?" v\xeda certika":"."),onClick:function(){return rt(6)},children:Object(n.jsx)(S.a,{className:V.TelegramIcon,children:Object(n.jsx)(Ut.a,{viewBox:"0 0 26 24"})})})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:4,lg:6,xl:6,children:Object(n.jsx)(Mt.a,{href:"/certificates/verify/".concat(e.match.params.badgeId),target:"_blank",underline:"none",variant:"inherit",className:V.button,children:et("buttons:buttons.verify")})})]})}),Object(n.jsx)(we.a,{className:V.textParagraph,gutterBottom:!0,children:null===(O=q.insigniasEmitidas)||void 0===O||null===(v=O.plantillasInsignias)||void 0===v?void 0:v.descripcion}),Object(n.jsxs)(we.a,{className:V.text,gutterBottom:!0,children:[et("certificateBadgeTemplate:details.coffered"),":"]}),Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Dd),{},{children:Object(n.jsx)(we.a,{children:"".concat(null===(_=q.insigniasEmitidas)||void 0===_?void 0:_.primer_nombre_receptor.toUpperCase()," ").concat((null===(y=q.insigniasEmitidas)||void 0===y?void 0:y.segundo_nombre_receptor.toUpperCase())||""," ").concat(null===(w=q.insigniasEmitidas)||void 0===w?void 0:w.primer_apellido_receptor.toUpperCase()," ").concat((null===(C=q.insigniasEmitidas)||void 0===C?void 0:C.segundo_apellido_receptor.toUpperCase())||"")})}))}),Object(n.jsxs)(we.a,{className:V.textBolder,gutterBottom:!0,children:[et("certificateBadgeTemplate:details.met-requirements"),":"]}),Ae.map((function(e,t){return null===e.link||""===e.link?Object(n.jsx)(we.a,{className:V.text,children:e.descripcion_criterio},"criteria".concat(t)):Object(n.jsx)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:V.link,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))})),(null===q||void 0===q||null===(k=q.insigniasEmitidas)||void 0===k?void 0:k.merito)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{className:V.textBolder,gutterBottom:!0,children:[et("certificateBadgeTemplate:details.merit"),":"]}),Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Dd),{},{children:Object(n.jsx)(we.a,{children:null===q||void 0===q||null===(N=q.insigniasEmitidas)||void 0===N?void 0:N.merito})}))}),(null===q||void 0===q||null===(B=q.insigniasEmitidas)||void 0===B?void 0:B.link_merito)&&Object(n.jsxs)(Mt.a,{href:null===(T=q.insigniasEmitidas)||void 0===T?void 0:T.link_merito,target:"_blank",rel:"noreferrer",className:V.link,children:[et("certificateBadgeTemplate:details.merit-link"),":",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,align:"center",className:V.root,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:V.textTitle,children:Ze?de.valor_parametro_en:de.valor_parametro}),Object(n.jsx)(we.a,{className:V.text,children:et("certificateBadgeTemplate:details.level")})]}),null!==(null===q||void 0===q||null===(A=q.insigniasEmitidas)||void 0===A||null===(E=A.plantillasInsignias)||void 0===E?void 0:E.cantidad_tiempo)&&void 0!==(null===pe||void 0===pe?void 0:pe.valor_parametro)?Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:V.textTitle,children:"".concat(null===(I=q.insigniasEmitidas)||void 0===I||null===(z=I.plantillasInsignias)||void 0===z?void 0:z.cantidad_tiempo," ").concat(Ze?pe.valor_parametro_en:pe.valor_parametro)}),Object(n.jsxs)(we.a,{className:V.text,children:[" ",et("certificateBadgeTemplate:details.time")]})]}):"",Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:V.textTitle,children:Ze?xe.valor_parametro_en:xe.valor_parametro}),Object(n.jsxs)(we.a,{className:V.text,children:[" ",et("certificateBadgeTemplate:details.cost")]})]})]}),Object(n.jsxs)(ye.a,{container:!0,className:V.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:2,children:Object(n.jsxs)(we.a,{className:V.textBolder,children:[et("certificateBadgeTemplate:details.skills"),":"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:10,children:Object(n.jsx)(ye.a,{container:!0,children:ke.map((function(e,t){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Dd),{},{children:Object(n.jsx)(we.a,{children:e.habilidades.descripcion})}))},"skill".concat(t))}))})})]}),(null===(P=q.insigniasEmitidas)||void 0===P||null===(R=P.plantillasInsignias)||void 0===R?void 0:R.url)&&Object(n.jsxs)(Mt.a,{href:null===(M=q.insigniasEmitidas)||void 0===M||null===(L=M.plantillasInsignias)||void 0===L?void 0:L.url,target:"_blank",rel:"noreferrer",className:V.link,children:[et("certificateBadgeTemplate:details.additional"),":",Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]})]}),Object(n.jsx)(_t,{loading:ce})]}),Object(n.jsxs)(U.a,{anchorEl:qe,anchorOrigin:{vertical:"top",horizontal:"right"},id:Xe,keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Je,onClose:function(){He(null)},children:[Object(n.jsxs)(Y.a,{onClick:function(){return function(){var t,a,n,i,r,c,o,s,l,d=document.createElement("a");d.href="https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name=".concat(null===(t=q.insigniasEmitidas)||void 0===t||null===(a=t.plantillasInsignias)||void 0===a?void 0:a.nombre,"&organizationName=").concat((null===Pe||void 0===Pe||null===(n=Pe.redesSociales)||void 0===n||null===(i=n.find((function(e){return 3===e.id_redes_sociales})))||void 0===i?void 0:i.username)||(null===Pe||void 0===Pe?void 0:Pe.nombre),"&issueYear=").concat(Ne()(null===(r=q.insigniasEmitidas)||void 0===r?void 0:r.fecha_emision).format("YYYY"),"&issueMonth=").concat(Ne()(null===(c=q.insigniasEmitidas)||void 0===c?void 0:c.fecha_emision).format("M"),"&expirationYear=").concat(Ne()(null===(o=q.insigniasEmitidas)||void 0===o?void 0:o.fecha_expiracion).format("YYYY"),"&expirationMonth=").concat(Ne()(null===(s=q.insigniasEmitidas)||void 0===s?void 0:s.fecha_expiracion).format("M"),"&certUrl=").concat(window.location.origin,"/badges/").concat(e.match.params.badgeId,"&certId=").concat(null===q||void 0===q||null===(l=q.insigniasEmitidas)||void 0===l?void 0:l.codigo_insignia),d.target="_blank",rt(3),He(null),d.click()}()},children:[Object(n.jsx)(S.a,{className:V.LinkedInIconMenu,children:Object(n.jsx)(qt.a,{icon:Kt.e,size:"xs"})})," ",Object(n.jsx)("spam",{className:V.textLinkedMenu,children:"Agregar en el perfil"})]}),Object(n.jsxs)(Y.a,{onClick:function(){return document.getElementById("linkedinShare").click()},children:[Object(n.jsx)(S.a,{className:V.LinkedInIconMenu,children:Object(n.jsx)(qt.a,{icon:Kt.e,size:"xs"})}),Object(n.jsx)("spam",{className:V.textLinkedMenu,children:" Agregar como publicaci\xf3n"})]})]})]})}));var Rd=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"2em"},img:{width:e.spacing(30),height:e.spacing(30)},img_verificado:Object(b.a)({display:"none"},e.breakpoints.up("sm"),{display:"inline",height:e.spacing(5)}),textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},textParagraph:{textAlign:"justify",color:"#5c5c5c",margin:"1em 0 1em 0"},textCode:{color:"#808080",textAlign:"left"},button:{backgroundColor:E.a.primary,borderRadius:"10px",color:"#ffffff",padding:".5em 3em","&:hover":{backgroundColor:E.a.secondary}},header:Object(b.a)({marginTop:"3em",display:"flex",justifyContent:"center",textAlign:"center"},e.breakpoints.up("sm"),{marginTop:"0"}),divider:{marginRight:"2em"},closeButton:{margin:".5em .5em 0 0",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}},link:{color:E.a.primary,textDecoration:"underline"},badges:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}}}})),Md={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},Ld=Object(s.b)((function(e){return{user:e.user,styles:e.styles}}),null)((function(e){var t,a,r,c,o,s,b,p,j,g=Rd(),x=Object(u.g)(),O=Object(i.useState)(!1),v=Object(d.a)(O,2),_=v[0],y=v[1],w=Object(i.useState)({}),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)({}),T=Object(d.a)(B,2),A=T[0],E=T[1],I=Object(i.useState)({}),z=Object(d.a)(I,2),P=z[0],R=z[1],M=Object(i.useState)({}),L=Object(d.a)(M,2),F=L[0],U=L[1],Y=Object(i.useState)([]),q=Object(d.a)(Y,2),H=q[0],K=q[1],V=Object(i.useState)([]),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)([]),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)([]),ne=Object(d.a)(te,2),ie=ne[0],re=ne[1],ce=Object(D.a)(["certificateBadgeTemplate","buttons"]),oe=Object(d.a)(ce,1)[0];Object(i.useEffect)((function(){se().catch((function(){x.push("/500"),window.location.reload()}))}),[]);var se=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.next=3,le();case 3:return e.next=5,de();case 5:y(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u,m,b;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return y(!0),u=Object(Ie.a)(e.match.params.badgeId),t.next=4,Ce.a.get("/templateHability/getTemplateHability/".concat(u));case 4:m=t.sent,b=m.data,N(b.templateHability),me(null===(a=b.templateHability)||void 0===a||null===(n=a.templateBadge)||void 0===n?void 0:n.tiempo_vp),ue(null===(i=b.templateHability)||void 0===i||null===(r=i.templateBadge)||void 0===r?void 0:r.nivel_vp),be(null===(c=b.templateHability)||void 0===c||null===(o=c.templateBadge)||void 0===o?void 0:o.costo_vp),K(null===(s=b.templateHability)||void 0===s?void 0:s.templateHability),J(null===(l=b.templateHability)||void 0===l?void 0:l.criterion),ee(null===(d=b.templateHability)||void 0===d?void 0:d.recommendation),y(!1);case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),de=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/templateBadge/getTemplatesBadgesPublishedPublic");case 2:t=e.sent,a=t.data,re(a.templatesBadges);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ue=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:a=e.sent,n=a.data,i=n.levels.filter((function(e){return e.id===t})),E(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),me=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:a=e.sent,n=a.data,i=n.time.filter((function(e){return e.id===t})),R(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),be=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:a=e.sent,n=a.data,i=n.costs.filter((function(e){return e.id===t})),U(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pe=function(e){var t=null;return ie.map((function(a){a.id===e&&(t=a.linkPhoto)})),t},je=function(e,t){x.push("/organization/".concat(t))};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsx)(S.a,{className:g.closeButton,onClick:function(e){var t,a;return je(0,null===(t=k.templateBadge)||void 0===t||null===(a=t.organizaciones)||void 0===a?void 0:a.url_perfil)},children:Object(n.jsx)(ae.a,{})}),Object(n.jsxs)(Rt.a,{className:g.container,maxWidth:"xl",children:[Object(n.jsxs)(ye.a,{container:!0,spacing:0,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,md:4,className:"text-center",children:[Object(n.jsx)("img",{alt:"img-badge",src:k.linkPhoto,className:g.img}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:g.textTitle,children:[oe("certificateBadgeTemplate:details.issued-by"),":"]}),Object(n.jsx)(l.b,{className:g.link,onClick:function(e){var t,a;return je(0,Object(Ie.b)(null===(t=k.templateBadge)||void 0===t||null===(a=t.organizaciones)||void 0===a?void 0:a.url_perfil))},children:null===(t=k.templateBadge)||void 0===t||null===(a=t.organizaciones)||void 0===a?void 0:a.nombre})]}),Object(n.jsxs)("div",{children:[Object(n.jsxs)(we.a,{className:g.textBolder,children:[oe("certificateBadgeTemplate:details.created"),":"]}),Object(n.jsx)(we.a,{className:g.text,children:Ne()(null===(r=k.templateBadge)||void 0===r?void 0:r.fecha_creacion).format("DD-MM-YYYY")})]})]}),Object(n.jsx)(W.a,{orientation:"vertical",flexItem:!0,className:g.divider}),Object(n.jsxs)(ye.a,{item:!0,xs:12,md:7,children:[!_&&Object(n.jsx)("div",{className:g.header,children:Object(n.jsxs)(ye.a,{container:!0,spacing:0,children:[Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:g.textTitle,children:null===(c=k.templateBadge)||void 0===c?void 0:c.nombre}),Object(n.jsx)("img",{alt:"img_verificado",src:e.styles.icon_verificado,className:g.img_verificado})]})}),Object(n.jsx)(we.a,{className:g.textParagraph,gutterBottom:!0,children:null===(o=k.templateBadge)||void 0===o?void 0:o.descripcion}),Object(n.jsx)(we.a,{className:g.textBolder,gutterBottom:!0,children:oe("certificateBadgeTemplate:details.criteria")}),Q.map((function(e,t){return null===e.link||""===e.link?Object(n.jsx)(we.a,{className:g.text,children:e.descripcion_criterio},"criteria".concat(t)):Object(n.jsx)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:g.link,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))})),Object(n.jsxs)(ye.a,{container:!0,spacing:2,align:"center",className:g.root,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:g.textTitle,children:null===A||void 0===A?void 0:A.valor_parametro}),Object(n.jsx)(we.a,{className:g.text,children:oe("certificateBadgeTemplate:details.level")})]}),null!==(null===k||void 0===k||null===(s=k.templateBadge)||void 0===s?void 0:s.cantidad_tiempo)&&void 0!==(null===P||void 0===P?void 0:P.valor_parametro)?Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:g.textTitle,children:"".concat(null===(b=k.templateBadge)||void 0===b?void 0:b.cantidad_tiempo," ").concat(P.valor_parametro)}),Object(n.jsx)(we.a,{className:g.text,children:oe("certificateBadgeTemplate:details.time")})]}):"",Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,children:[Object(n.jsx)(we.a,{variant:"h5",className:g.textTitle,children:F.valor_parametro}),Object(n.jsx)(we.a,{className:g.text,children:oe("certificateBadgeTemplate:details.cost")})]})]}),Object(n.jsxs)(ye.a,{container:!0,className:g.root,children:[Object(n.jsxs)(ye.a,{item:!0,lg:12,sm:12,xs:12,children:[Object(n.jsx)(we.a,{className:g.textBolder,children:oe("certificateBadgeTemplate:details.skills")}),Object(n.jsx)(ye.a,{container:!0,children:H.map((function(e,t){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},Md),{},{children:Object(n.jsx)(we.a,{children:e.habilidades.descripcion})}))},"skill".concat(t))}))})]}),Object(n.jsx)(ye.a,{item:!0,lg:12,sm:12,xs:12,children:$.length>0?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(we.a,{className:g.textBolder,children:oe("certificateBadgeTemplate:details.recommendations")}),Object(n.jsx)("div",{className:g.badges,children:$.map((function(e,t){var a,i,r,c,o;return Object(n.jsx)(It,{badgeImage:pe(null===e||void 0===e||null===(a=e.plantillasInsigniasRecomendadas)||void 0===a?void 0:a.id),badgeName:null===e||void 0===e||null===(i=e.plantillasInsigniasRecomendadas)||void 0===i?void 0:i.nombre,organizationName:null===e||void 0===e||null===(r=e.plantillasInsigniasRecomendadas)||void 0===r||null===(c=r.organizaciones)||void 0===c?void 0:c.nombre,issuedId:Object(Ie.b)(null===e||void 0===e||null===(o=e.plantillasInsigniasRecomendadas)||void 0===o?void 0:o.id),publicBadge:!0,templateBadge:!0},"badge".concat(t))}))})]}):""}),(null===(p=k.templateBadge)||void 0===p?void 0:p.url)&&Object(n.jsxs)("a",{href:null===(j=k.templateBadge)||void 0===j?void 0:j.url,target:"_blank",rel:"noreferrer",className:g.link,children:[oe("certificateBadgeTemplate:details.additional"),Object(n.jsx)(qt.a,{icon:Ht.c,size:"xs"})]})]})]})]}),Object(n.jsx)(_t,{loading:_})]})]})})),Fd=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"}}}));var Ud={changeBreadcrump:I.a},Wd=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"redes sociales"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Ud)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=Fd(),s=Object(u.g)(),l=Object(i.useState)([]),m=Object(d.a)(l,2),b=m[0],p=m[1],j=Object(i.useState)([]),O=Object(d.a)(j,2),v=O[0],_=O[1],y=Object(i.useState)(""),w=Object(d.a)(y,2),C=w[0],k=w[1],N=Object(i.useState)(""),B=Object(d.a)(N,2),T=B[0],A=B[1],z=Object(i.useState)(!0),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(D.a)(["alerts","tables","buttons","breadCrumps"]),U=Object(d.a)(L,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?(W().then((function(){M(!1)})).catch((function(){s.push("/500"),window.location.reload()})),c(U("breadCrumps:breadCrumps.socialMedia",{returnObjects:!0}))):(s.push("/dashboard"),window.location.reload())}),[]);var W=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/socialNetworks/getsocialNetworks");case 2:t=e.sent,a=t.data,p(a.socialNetworks),_(a.socialNetworks);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(e,t,a){switch(a){case"delete":q(t);break;case"edit":s.push("/socialNetworks/edit/".concat(t));break;case"create":s.push("/socialNetworks/create")}},q=function(e){F.a.fire({text:U("alerts:alerts.delete-register"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:U("buttons:buttons.accept"),cancelButtonText:U("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&H(e).catch((function(){s.push("/500"),window.location.reload()}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},H=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/socialNetworks/".concat(t));case 2:a=e.sent,n=a.data,p(b.filter((function(e){return e.id!==t}))),_(b.filter((function(e){return e.id!==t}))),n&&F.a.fire({text:U("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),V=function(e){if(r.includes("Editar"))return Object(n.jsx)(K.a,{title:U("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return Y(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})},G=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(K.a,{title:U("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return Y(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})},Q=function(){return U("tables:table.columns-socialMedia",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:o.button,onClick:function(e){return Y(0,0,"create")},children:Object(n.jsx)("span",{children:U("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{items:b,setItems:_,loadData:W,setLoading:M}),Object(n.jsx)(zn,{columns:Q(),rows:v,setDirection:k,setOrderBy:A,children:Object(n.jsx)(vn.a,{children:R?Object(n.jsx)(qn,{columns:Q(),photo:1}):v.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(v,Object(I.f)(C,T)).slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{align:"center",children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{alt:"Remy Sharp",src:null===e||void 0===e?void 0:e.linkIcons,className:o.large})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:V(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:G(e.id)})]},e.id)}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:U("tables:table.empty-table")})})})]})})),Yd=a(1208),qd=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.5em"},card:{backgroundColor:E.a.background},input:{display:"none"},avatar:{width:"auto",height:"auto"},text:Object(b.a)({display:"flex"},e.breakpoints.up("lg"),{display:"block"}),contentInput:Object(b.a)({display:"flex",flexDirection:"column",alignItems:"left",justifyContent:"left"},e.breakpoints.up("lg"),{display:"block",alignItems:"left"}),icon:{margin:20,fontSize:"1em"}}}));var Hd={changeBreadcrump:I.a},Kd=Object(s.b)(null,Hd)((function(e){var t=e.changeBreadcrump,a=qd(),r=Object(u.g)(),c=Object(i.useState)({nombre:"",icono:null,iconoPrev:""}),o=Object(d.a)(c,2),s=o[0],l=o[1],p=Object(i.useState)(!1),j=Object(d.a)(p,2),O=j[0],v=j[1],_=Object(D.a)(["alerts","tables","buttons","breadCrumps","forms"]),y=Object(d.a)(_,1)[0];Object(i.useEffect)((function(){e.match.params.id?(w().catch((function(){r.push("/500"),window.location.reload()})),t(y("breadCrumps:breadCrumps.socialMedia-edit",{returnObjects:!0}))):t(y("breadCrumps:breadCrumps.socialMedia-create",{returnObjects:!0}))}),[]);var w=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.match.params.id,t.next=3,Ce.a.get("/socialNetworks/".concat(a));case 3:n=t.sent,i=n.data,l(Object(m.a)(Object(m.a)({},i.socialNetworks),{},{icono:i.socialNetworks.linkIcons,iconoPrev:i.socialNetworks.linkIcons}));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),C=function(){v(!1)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:a.root,onSubmit:function(t){if(t.preventDefault(),v(!O),e.match.params.id){var a,n=e.match.params.id,i=new FormData;i.append("file",s.icono),Ce.a.put("/socialNetworks/".concat(n),Object(m.a)(Object(m.a)({},s),{},{icono:null===(a=s.icono)||void 0===a?void 0:a.name})).then((function(){var e;if(null===(e=s.icono)||void 0===e?void 0:e.name){var t=Pe()("certika-social-networks-icons-".concat(n)).toString();ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-social-network-logo/").concat(t),headers:{"Content-Type":"multipart/form-data"},data:i}).then((function(){C(),r.push("/socialNetworks"),F.a.fire({icon:"success",iconColor:E.a.primary,text:y("alerts:alerts.created"),showConfirmButton:!1,timer:1500})}))}else C(),r.push("/socialNetworks"),F.a.fire({icon:"success",iconColor:E.a.primary,text:y("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})})).catch((function(e){C(),F.a.fire({icon:"error",iconColor:E.a.primary,text:y("alerts:alerts.edited-error"),showConfirmButton:!1,timer:1500}),r.push("/500"),window.location.reload()}))}else{var c,o=new FormData;o.append("file",s.icono),Ce.a.post("/socialNetworks/",Object(m.a)(Object(m.a)({},s),{},{icono:null===(c=s.icono)||void 0===c?void 0:c.name})).then((function(e){var t;if(null===(t=s.icono)||void 0===t?void 0:t.name){var a=Pe()("certika-social-networks-icons-".concat(e.data.socialNetworksId)).toString();ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-social-network-logo/").concat(a),headers:{"Content-Type":"multipart/form-data"},data:o}).then((function(){C(),r.push("/socialNetworks"),F.a.fire({icon:"success",iconColor:E.a.primary,text:y("alerts:alerts.created"),showConfirmButton:!1,timer:1500})}))}else C(),r.push("/socialNetworks"),F.a.fire({icon:"success",iconColor:E.a.primary,text:y("alerts:alerts.created"),showConfirmButton:!1,timer:1500})})).catch((function(e){C(),F.a.fire({icon:"error",iconColor:E.a.primary,text:y("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500}),r.push("/500"),window.location.reload()}))}},children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:y("forms:socialMedia-details")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:a.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:1,children:Object(n.jsx)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:Object(n.jsx)(g.a,{alt:"img-prev",src:null===s||void 0===s?void 0:s.iconoPrev,variant:"rounded",className:a.avatar,children:Object(n.jsx)(Kr.a,{sx:{margin:3,fontSize:"1em"}})})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:8,children:[Object(n.jsx)(we.a,{variant:"body2",className:a.text,children:y("forms:icon-square")}),Object(n.jsxs)("div",{className:a.contentInput,children:[Object(n.jsx)("input",{accept:"image/*",className:a.input,id:"contained-button-file",name:"imagen",type:"file",onChange:function(e){return function(e){var t=e.target.files[0];l(Object(m.a)(Object(m.a)({},s),{},{icono:t,iconoPrev:URL.createObjectURL(t)}))}(e)}}),Object(n.jsx)("label",{htmlFor:"contained-button-file",children:Object(n.jsx)(x.a,{variant:"outlined",component:"span",children:Object(n.jsx)(Yd.a,{})})})]})]})]}),Object(n.jsx)(ye.a,{container:!0,spacing:2,className:a.root,children:Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:y("forms:socialMedia-name"),name:"nombre",value:s.nombre,variant:"outlined",onChange:function(e){l(Object(m.a)(Object(m.a)({},s),{},Object(b.a)({},e.target.name,e.target.value)))}})})})}),Object(n.jsxs)("div",{className:"text-center ".concat(a.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(a.button),type:"submit",children:y("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(a.button),onClick:function(){r.push("/socialNetworks")},children:y("buttons:buttons.cancel")})]})]})})})]})}));var Vd=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",height:"80vh",width:"100vw"},container__share:{"& p":{marginBottom:5,fontWeight:"bold"}},container__share_input:{border:"1px solid",borderRadius:30,borderColor:E.a.primary,padding:10,width:"80vw",marginBottom:20},container__button:{borderRadius:20,padding:"10px 30px",backgroundColor:E.a.primary,color:"white",fontWeight:"bold"}}})),Gd=Object(s.b)((function(e){var t,a;return{user:e.user,badge:null===(t=e.badge)||void 0===t?void 0:t.insigniasEmitidas,typeBrand:null===(a=e.styles)||void 0===a?void 0:a.organizationName}}),null)((function(e){var t,a=e.user,r=e.badge,c=e.location,o=e.history,s=e.typeBrand,l=Vd(),u=Object(i.useState)(null),b=Object(d.a)(u,2),p=b[0],j=b[1],g=Object(i.useState)("He obtenido la siguiente insignia emitida por ".concat(null===(t=r.plantillasInsignias)||void 0===t?void 0:t.organizaciones.nombre).concat("Certika"===s?" v\xeda #certikaco":".")),x=Object(d.a)(g,2),O=x[0],v=x[1];Object(i.useEffect)((function(){var t=c.search.substr(e.location.search.indexOf("?code=")+6);(function(){var e=Object(h.a)(f.a.mark((function e(){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.get("/share/login/linkedin/".concat(t));case 3:a=e.sent,n=a.data,i=n.token,r=n.userId,j({token:i,userId:r}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),F.a.fire({icon:"error",title:"Error",text:"Ha ocurrido un error"});case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}})()()}),[]);var _=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.post("/share/linkedin",Object(m.a)(Object(m.a)({},p),{},{content:{title:"".concat(null===(t=r.plantillasInsignias)||void 0===t?void 0:t.nombre," fue emitida por ").concat(null===(n=r.plantillasInsignias)||void 0===n?void 0:n.organizaciones.nombre," a ").concat(r.primer_nombre_receptor," ").concat(r.segundo_nombre_receptor||""," ").concat(r.primer_apellido_receptor," ").concat(r.segundo_apellido_receptor||""),description:O,link:"".concat(je.a.certificateURL).concat(Object(Ie.b)(r.id))}}));case 3:return e.next=5,Ce.a.post("/share/statisticSocialNetwork",{id_redes_sociales:3,id_insignias_emitidas:r.id,id_usuarios:a.id});case 5:F.a.fire({icon:"success",title:"Publicado",text:"Se ha publicado el art\xedculo"}).then((function(){window.close()})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),F.a.fire({icon:"error",title:"Error",text:"Ha ocurrido un error"});case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}();return null===a&&o.push("/"),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsxs)("div",{className:l.container,children:[Object(n.jsxs)("div",{className:l.container__share,children:[Object(n.jsx)("p",{children:"Descripci\xf3n:"}),Object(n.jsx)("textarea",{name:"description",value:O,className:l.container__share_input,onChange:function(e){v(e.target.value)}})]}),Object(n.jsx)("button",{className:l.container__button,onClick:_,children:"Compartir"})]})]})}));var Qd=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",height:"80vh",width:"100vw"},container__share:{"& p":{marginBottom:5,fontWeight:"bold"}},container__share_input:{border:"1px solid",borderRadius:30,borderColor:E.a.primary,padding:10,width:"80vw",marginBottom:20},container__button:{borderRadius:20,padding:"10px 30px",backgroundColor:E.a.primary,color:"white",fontWeight:"bold"}}})),Jd=Object(s.b)((function(e){var t,a;return{user:e.user,certificate:null===(t=e.certificate)||void 0===t?void 0:t.certificadosEmitidos,typeBrand:null===(a=e.styles)||void 0===a?void 0:a.organizationName}}),null)((function(e){var t,a=e.user,r=e.certificate,c=e.location,o=e.history,s=e.typeBrand,l=Qd(),u=Object(i.useState)(null),b=Object(d.a)(u,2),p=b[0],j=b[1],g=Object(i.useState)("He obtenido el siguiente certificado emitido por ".concat(null===(t=r.plantillasCertificados)||void 0===t?void 0:t.organizaciones.nombre).concat("Certika"===s?" v\xeda #certikaco":".")),x=Object(d.a)(g,2),O=x[0],v=x[1];Object(i.useEffect)((function(){var t=c.search.substr(e.location.search.indexOf("?code=")+6);(function(){var e=Object(h.a)(f.a.mark((function e(){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.get("/share/login/linkedin/certificate/".concat(t));case 3:a=e.sent,n=a.data,i=n.token,r=n.userId,j({token:i,userId:r}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),F.a.fire({icon:"error",title:"Error",text:"Ha ocurrido un error"});case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}})()()}),[]);var _=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.post("/share/linkedin",Object(m.a)(Object(m.a)({},p),{},{content:{title:"".concat(null===(t=r.plantillasCertificados)||void 0===t?void 0:t.nombre," fue emitido por ").concat(null===(n=r.plantillasCertificados)||void 0===n?void 0:n.organizaciones.nombre," a ").concat(null===(i=r.certificadosCamposValores[0])||void 0===i?void 0:i.valor," "," "," ").concat(""),description:O,link:"".concat(je.a.certificatesURL).concat(Object(Ie.b)(r.id))}}));case 3:return e.next=5,Ce.a.post("/share/statisticSocialNetwork",{id_redes_sociales:3,id_certificados_emitidos:r.id,id_usuarios:a.id});case 5:F.a.fire({icon:"success",title:"Publicado",text:"Se ha publicado el art\xedculo"}).then((function(){window.close()})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),F.a.fire({icon:"error",title:"Error",text:"Ha ocurrido un error"});case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}();return null===a&&o.push("/"),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsxs)("div",{className:l.container,children:[Object(n.jsxs)("div",{className:l.container__share,children:[Object(n.jsx)("p",{children:"Descripci\xf3n:"}),Object(n.jsx)("textarea",{name:"description",value:O,className:l.container__share_input,onChange:function(e){v(e.target.value)}})]}),Object(n.jsx)("button",{className:l.container__button,onClick:_,children:"Compartir"})]})]})}));var Xd=Object(C.a)((function(e){return{container:function(t){return Object(b.a)({display:"flex",minHeight:"100vh",justifyContent:"center",alignItems:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"},e.breakpoints.up("md"),{marginLeft:window.location.origin===t.env.mincienciasURL?"20px":0,height:"100vh",justifyContent:"space-around"})},container_card:Object(b.a)({padding:"20px",borderRadius:"15px",margin:"5px 10px",width:"95%"},e.breakpoints.up("md"),{padding:"40px",margin:"0 10px",width:"600px"}),container__text:function(t){return Object(b.a)({width:"100%",margin:"10px 0px","& p":{fontWeight:500,marginBottom:0}},e.breakpoints.up("sm"),{width:window.location.origin===t.env.mincienciasURL?"24em":"30em"})},button:{margin:"0.5em",padding:"9px 40px",width:"50%"},container__image:function(t){return Object(b.a)({display:"none"},e.breakpoints.up("md"),{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:window.location.origin===t.env.mincienciasURL?"83.5vw":"50vw"})},img:{width:"100%",height:"100%"},container__login:{"& h2":{fontWeight:700},"& img":{width:"90%"}},container__logo:{display:"flex",justifyContent:"center",alignItems:"center"},classes__login_buttons:{justifyContent:"center",alignItems:"center",display:"flex",marginTop:"1em"}}})),Zd=function(e){var t=Xd({env:je.a}),a=Object(i.useState)({}),r=Object(d.a)(a,2),c=r[0],o=r[1],s=Object(i.useState)(!1),l=Object(d.a)(s,2),u=l[0],p=l[1],j=Object(i.useState)(""),f=Object(d.a)(j,2),h=f[0],g=f[1],O=Object(D.a)(["loginRegister","buttons"]),v=Object(d.a)(O,1)[0];return Object(i.useEffect)((function(){var e,t=null===(e=JSON.parse(window.localStorage.state))||void 0===e?void 0:e.styles;g({Logo:t.logo435x149,LoginLogo:t.icono_login,LoginBackground:t.login_background,ForgetPassword:t.forget_password}),window.location.origin===je.a.certikaURL?o(Object(m.a)(Object(m.a)({},c),{},{backoficceId:1})):window.location.origin===je.a.mincienciasURL&&o(Object(m.a)(Object(m.a)({},c),{},{backoficceId:2}))}),[]),Object(n.jsxs)("div",{className:t.container,style:{backgroundImage:window.location.origin===je.a.mincienciasURL?"none":"url(".concat(null===h||void 0===h?void 0:h.LoginBackground,")")},children:[Object(n.jsx)(kn.a,{elevation:0,className:t.container_card,children:Object(n.jsxs)("div",{className:t.container__login,children:[Object(n.jsx)("div",{className:t.container__logo,children:Object(n.jsx)("img",{src:null===h||void 0===h?void 0:h.Logo,alt:"logo"})}),Object(n.jsxs)("form",{onSubmit:function(t){t.preventDefault(),p(!0),Ce.a.post("/user/forgetPassword",c).then((function(t){p(!1),t.data?F.a.fire({icon:"success",title:"Mensaje enviado",text:"Revise su bandeja de entrada.",showConfirmButton:!1,timer:2e3}).then((function(){e.history.push("/sign-in")})):F.a.fire({icon:"error",text:"El correo electr\xf3nico no se encuentra registrado.",showConfirmButton:!1,timer:1500})})).catch((function(e){p(!1),F.a.fire({icon:"error",text:"Ha ocurrido un error. Intenta nuevamente.",showConfirmButton:!1,timer:1500})}))},children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,className:t.container__text,children:[Object(n.jsx)("p",{children:v("loginRegister:message-recovery1")}),Object(n.jsxs)("p",{children:[" ",v("loginRegister:message-recovery2")]})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:v("loginRegister:email"),name:"correo",variant:"outlined",type:"email",onChange:function(e){o(Object(m.a)(Object(m.a)({},c),{},Object(b.a)({},e.target.name,e.target.value)))}})})})]}),Object(n.jsxs)("div",{className:t.classes__login_buttons,children:[Object(n.jsx)(x.a,{color:"primary",variant:"contained",className:"my-2 ".concat(t.button),type:"submit",disableElevation:!0,children:v("buttons:buttons.send")}),Object(n.jsx)(x.a,{color:"primary",variant:"contained",className:"my-2 ".concat(t.button),onClick:function(){return e.history.push("/sign-in")},disableElevation:!0,children:v("buttons:buttons.cancel")})]})]})]})}),Object(n.jsx)("div",{className:t.container__image,children:Object(n.jsx)("img",{src:window.location.origin===je.a.certikaURL?null===h||void 0===h?void 0:h.ForgetPassword:null===h||void 0===h?void 0:h.LoginLogo,className:t.img,alt:"login-logo"})}),Object(n.jsx)(_t,{loading:u})]})};var $d=Object(C.a)((function(e){return{AppHeader:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},root:Object(b.a)({marginTop:"1em"},e.breakpoints.up("sm"),{margin:"1em 6em 0 6em"}),card:{minWidth:275,marginTop:"1em"},img:Object(b.a)({width:e.spacing(40)},e.breakpoints.up("sm"),{width:"auto"}),container__input_root:{borderRadius:"20px"},container__input_notchedOutline:{borderWidth:2,borderColor:E.a.primary},container__input_focused:{},button:{margin:"0.5em",padding:"8px 40px"},text_password_error:{marginBottom:"5px",color:"#f4443b",fontSize:"0.9em",maxWidth:"fit-content",textAlign:"justify"}}})),eu=Object(s.b)((function(e){return{user:e.user}}),null)((function(e){var t=$d(),a=Object(i.useState)([]),r=Object(d.a)(a,2),c=r[0],o=r[1],s=Object(i.useState)(!1),l=Object(d.a)(s,2),u=l[0],p=l[1],j=Object(i.useState)({password:{error:!1}}),f=Object(d.a)(j,2),h=f[0],g=f[1],O=Object(i.useRef)(),v=Object(i.useState)(""),_=Object(d.a)(v,2),y=_[0],w=_[1];Object(i.useEffect)((function(){var t,a;(null===e||void 0===e?void 0:e.user)||(null===(t=e.match.params)||void 0===t?void 0:t.accountId)||e.history.push("/");var n=null===(a=JSON.parse(window.localStorage.state))||void 0===a?void 0:a.styles;n&&w(n.logo435x149)}),[]);var C=function(e){"password"===e.target.name&&(Ji(e.target.value)?(O.current.disabled=!1,g(Object(m.a)(Object(m.a)({},h),{},{password:{error:!1}}))):(O.current.disabled=!0,g(Object(m.a)(Object(m.a)({},h),{},{password:{error:!0,message:"La contrase\xf1a debe tener m\xednimo entre 8 y 15 caracteres, una letra min\xfascula, una may\xfascula, un n\xfamero y un car\xe1cter especial."}})))),o(Object(m.a)(Object(m.a)({},c),{},Object(b.a)({},e.target.name,e.target.value)))};return Object(n.jsxs)("div",{className:"App",children:[e.user&&Object(n.jsx)(At,{}),Object(n.jsxs)("div",{className:t.AppHeader,children:[Object(n.jsx)(ve.a,{className:t.card,elevation:0,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)("img",{src:y,alt:"logo",className:t.img}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:"Cambiar contrase\xf1a"}),Object(n.jsxs)("form",{className:t.root,onSubmit:function(t){t.preventDefault();var a=e.user?e.user.data_user.cuentas[0].id:Object(Ie.a)(e.match.params.accountId);p(!0),c.password===c.password2?Ce.a.put("/user/changePassword/".concat(a),c).then((function(t){p(!1),t.data?F.a.fire({icon:"success",text:"Contrase\xf1a actualizada exitosamente.",showConfirmButton:!1,timer:2e3}).then((function(){e.user?e.history.push("/dashboard"):e.history.push("/sign-in")})):(F.a.fire({icon:"error",text:"Ha ocurrido un error. Intenta nuevamente.",showConfirmButton:!1,timer:2e3}),e.history.push("/500"),window.location.reload())})).catch((function(t){p(!1),F.a.fire({icon:"error",text:e.user?"Contrase\xf1a actual incorrecta":"Se ha vencido el tiempo de espera.",showConfirmButton:!1,timer:2e3})})):(p(!1),F.a.fire({icon:"error",text:"Las\xa0contrase\xf1as ingresadas\xa0no\xa0coinciden.",showConfirmButton:!1,timer:2e3}))},children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[e.user&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Contrase\xf1a actual",name:"currentPassword",variant:"outlined",type:"password",onChange:C,InputProps:{classes:{root:t.container__input_root,notchedOutline:t.container__input_notchedOutline,focused:t.container__input_focused}},className:t.signup_input})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsxs)(mt.a,{className:"w-100",children:[Object(n.jsx)(Te.a,{required:!0,label:"Nueva contrase\xf1a",name:"password",variant:"outlined",type:"password",onChange:C,InputProps:{classes:{root:t.container__input_root,notchedOutline:t.container__input_notchedOutline,focused:t.container__input_focused}},className:t.signup_input,error:h.password.error}),h.password.error&&Object(n.jsx)("span",{className:t.text_password_error,children:h.password.message})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Confirmar contrase\xf1a",name:"password2",variant:"outlined",type:"password",onChange:C,InputProps:{classes:{root:t.container__input_root,notchedOutline:t.container__input_notchedOutline,focused:t.container__input_focused}}})})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(t.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",ref:O,variant:"contained",className:"my-2 ".concat(t.button),type:"submit",children:"Aceptar"}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(t.button),onClick:function(){e.user?e.history.push("/dashboard"):e.history.push("/sign-in")},children:"Cancelar"})]})]})]})}),Object(n.jsx)(_t,{loading:u})]})]})})),tu=a(1209),au=a(1210),nu=a(1211),iu=new RegExp(/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/);var ru=Object(C.a)((function(e){var t;return{root:Object(b.a)({marginTop:"1em"},e.breakpoints.up("sm"),{margin:"1em 6em 0 6em"}),button:{margin:"0.5em",padding:"8px 40px"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},avatar:(t={width:"140px",height:"140px",borderRadius:"100%",marginBottom:10},Object(b.a)(t,e.breakpoints.up("sm"),{marginBottom:0}),Object(b.a)(t,"&:hover",{cursor:"pointer"}),t),input:{display:"none"},icon:{fontSize:"4em"},card:Object(b.a)({display:"flex",flexDirection:"column",alignItems:"center",margin:"4em 0",marginTop:"0",marginBottom:"0",backgroundColor:"primary"},e.breakpoints.up("sm"),{flexDirection:"row",justifyContent:"initial",alignItems:"initial",margin:"4em",marginBottom:"0",marginTop:"0"})}})),cu=Object(s.b)((function(e){var t,a;return{user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"profilesettings"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||(null===(t=e.user)||void 0===t||null===(a=t.data_user)||void 0===a?void 0:a.gruposUsuariosOrganizaciones[0].id_organizaciones)}}))((function(e){var t,a,r=e.user,c=e.dispatch,o=ru(),s=Object(u.g)(),l=Object(i.useState)({}),p=Object(d.a)(l,2),j=p[0],O=p[1],v=Object(i.useState)([]),_=Object(d.a)(v,2),y=_[0],w=_[1],C=Object(i.useState)([]),k=Object(d.a)(C,2),N=k[0],B=k[1],S=Object(i.useState)(!1),A=Object(d.a)(S,2),E=A[0],D=A[1],z=Object(i.useState)(!1),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)({primer_nombre:"",segundo_nombre:"",primer_apellido:"",segundo_apellido:"",documento:"",telefono:"",celular:"",correo:"",fecha_nacimiento:null,biografia:"",pagina_web:"",url_perfil:"",id_paises:null,id_ciudades:null,imagen:null,imagen_prev:""}),U=Object(d.a)(L,2),W=U[0],q=U[1];Object(i.useEffect)((function(){r?(V().catch((function(){s.push("/500"),window.location.reload()})),H().catch((function(){s.push("/500"),window.location.reload()}))):(s.push("/"),window.location.reload())}),[]),Object(i.useEffect)((function(){""!==W.id_paises?G(W.id_paises):B([""])}),[W.id_paises]);var H=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/user/profile");case 2:a=e.sent,n=a.data,q(Object(m.a)(Object(m.a)({},n.user),{},{imagen:n.user.linkPhoto,imagen_prev:n.user.linkPhoto,url_static:n.user.url_perfil})),(null===(t=n.user)||void 0===t?void 0:t.id_paises)&&O(Object(m.a)(Object(m.a)({},j),{},{country:null===(i=n.user)||void 0===i||null===(r=i.paises)||void 0===r?void 0:r.prefijo_telefono,city:null===(c=n.user)||void 0===c||null===(o=c.ciudades)||void 0===o?void 0:o.prefijo_telefono}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCountries");case 2:t=e.sent,a=t.data,w(a.countries);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCities",{idPais:t});case 2:a=e.sent,n=a.data,B(n.cities);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Q=function(e){q(Object(m.a)(Object(m.a)({},W),{},Object(b.a)({},e.target.name,e.target.value)))},J=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:""===t.target.value?(q(Object(m.a)(Object(m.a)({},W),{},(a={},Object(b.a)(a,t.target.name,""),Object(b.a)(a,"id_ciudades",""),a))),O("")):(q(Object(m.a)(Object(m.a)({},W),{},(n={},Object(b.a)(n,t.target.name,t.target.value),Object(b.a)(n,"id_ciudades",""),n))),(i=y.find((function(e){return e.id===t.target.value}))).prefijo_telefono&&O(Object(m.a)(Object(m.a)({},j),{},{country:i.prefijo_telefono})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),X=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:""===t.target.value?(q(Object(m.a)(Object(m.a)({},W),{},Object(b.a)({},t.target.name,""))),O("")):(q(Object(m.a)(Object(m.a)({},W),{},Object(b.a)({},t.target.name,t.target.value))),(a=N.find((function(e){return e.id===t.target.value}))).prefijo_telefono&&O(Object(m.a)(Object(m.a)({},j),{},{city:a.prefijo_telefono})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Z=function(){c(Object(I.h)(Object(m.a)(Object(m.a)({},r),{},{data_user:Object(m.a)(Object(m.a)({},r.data_user),W)})))},$=function(){D(!1)},ee=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),D(!E),e.next=4,Ce.a.post("/user/getUserUrl",{url_perfil:W.url_perfil});case 4:a=e.sent,n=a.data,(i=new FormData).append("file",W.imagen),!iu.test(W.pagina_web)&&W.pagina_web?(D(!1),F.a.fire({icon:"error",text:"Url De Sitio Web Incorrecto.",showConfirmButton:!1,timer:1500})):(W.pagina_web&&!W.pagina_web.includes("https://")&&(W.pagina_web="https://".concat(W.pagina_web)),R?($(),F.a.fire({icon:"error",text:"Fecha de nacimiento inv\xe1lida.",showConfirmButton:!1,timer:1500})):W.url_static!==W.url_perfil&&n?($(),F.a.fire({icon:"error",text:"Url de perfil se encuentra asignada.",showConfirmButton:!1,timer:1500})):Ce.a.put("/user",Object(m.a)(Object(m.a)({},W),{},{imagen:null===(r=W.imagen)||void 0===r?void 0:r.name,whatsapp:"+".concat(j.country).concat(W.celular)})).then((function(e){var t;if(null===(t=W.imagen)||void 0===t?void 0:t.name){var a=Pe()("certika-user-".concat(e.data.userId)).toString();ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-photo/").concat(a),headers:{"Content-Type":"multipart/form-data"},data:i}).then((function(){$(),Z(),s.push("/dashboard"),F.a.fire({icon:"success",text:"Edici\xf3n exitosa.",showConfirmButton:!1,timer:1500})}))}else $(),Z(),s.push("/dashboard"),F.a.fire({icon:"success",text:"Edici\xf3n exitosa.",showConfirmButton:!1,timer:1500})})).catch((function(e){$(),F.a.fire({icon:"error",text:"No se ha podido editar.",showConfirmButton:!1,timer:1500}),s.push("/500"),window.location.reload()})));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),te=function(e){var t=String(e.target.value);/^([1-9][0-9]*(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t)||(e.target.value=t.substr(t.length))};return Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)("div",{className:"App",children:[Object(n.jsx)(At,{}),Object(n.jsx)("div",{className:"App-header",children:Object(n.jsx)(ve.a,{className:o.card,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:"Edici\xf3n de usuario"}),Object(n.jsx)("input",{accept:"image/*",className:o.input,id:"contained-button-file",name:"logo",type:"file",onChange:function(e){return function(e){var t=e.target.files[0];q(Object(m.a)(Object(m.a)({},W),{},{imagen:t,imagen_prev:URL.createObjectURL(t)}))}(e)}}),Object(n.jsx)("label",{htmlFor:"contained-button-file",children:Object(n.jsx)(K.a,{title:"Cambia Tu Imagen",children:Object(n.jsx)(g.a,{src:W.imagen_prev,variant:"rounded",className:o.avatar})})}),Object(n.jsxs)(we.a,{component:"h6",variant:"h6",children:[null===r||void 0===r||null===(t=r.data_user)||void 0===t?void 0:t.primer_nombre," ",null===r||void 0===r||null===(a=r.data_user)||void 0===a?void 0:a.primer_apellido]}),Object(n.jsxs)("form",{className:o.root,onSubmit:ee,children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Agrega una biograf\xeda",name:"biografia",variant:"outlined",size:"small",multiline:!0,rows:4,onChange:Q,value:W.biografia})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Primer nombre",variant:"outlined",name:"primer_nombre",value:W.primer_nombre,onChange:Q})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Segundo nombre",variant:"outlined",name:"segundo_nombre",value:W.segundo_nombre,onChange:Q})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Primer apellido",variant:"outlined",name:"primer_apellido",value:W.primer_apellido,onChange:Q})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Segundo apellido",variant:"outlined",name:"segundo_apellido",value:W.segundo_apellido,onChange:Q})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{type:"number",label:"N\xba de documento",variant:"outlined",name:"documento",value:W.documento,onChange:Q,disabled:null===W||void 0===W?void 0:W.disable})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Fecha de nacimiento",error:R,type:"date",variant:"outlined",name:"fecha_nacimiento",value:W.fecha_nacimiento,onChange:function(e){var t=new Date,a=e.target.value.split("-"),n=new Date;t.setFullYear(a[0],a[1]-1,a[2]),t>=n||a[0]>n.getFullYear()-18?M(!0):parseInt(a[0])===n.getFullYear()-18?a[1]-1>n.getMonth()?M(!0):a[1]-1===n.getMonth()?M(a[2]>n.getDate()):M(!1):M(!1),q(Object(m.a)(Object(m.a)({},W),{},Object(b.a)({},e.target.name,e.target.value)))},InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start"})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Correo electr\xf3nico",variant:"outlined",name:"correo",type:"email",value:W.correo,onChange:Q,disabled:null===W||void 0===W?void 0:W.disable,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:Object(n.jsx)(ml.a,{})})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"P\xe1gina web",variant:"outlined",name:"pagina_web",placeholder:"https://",onChange:Q,value:W.pagina_web,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:Object(n.jsx)(tu.a,{})})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"URL perfil",variant:"outlined",name:"url_perfil",disabled:null===W||void 0===W?void 0:W.disable,onChange:Q,value:W.url_perfil,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:Object(n.jsx)(tu.a,{})})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{children:"Pa\xeds *"}),Object(n.jsxs)(T.a,{required:!0,id:"pais",name:"id_paises",label:"Pa\xeds",onChange:J,value:W.id_paises?W.id_paises:"",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:"Seleccione una opci\xf3n"})}),y.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},"countrie-".concat(e.id))}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{id:"ciudadesLabel",children:"Ciudad *"}),Object(n.jsxs)(T.a,{required:!0,id:"ciudades",name:"id_ciudades",labelId:"ciudadesLabel",value:W.id_ciudades?W.id_ciudades:"",onChange:X,label:"Ciudad",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:"Seleccione una opci\xf3n"})}),N.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},"city-".concat(e.id))}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:"Tel\xe9fono",variant:"outlined",name:"telefono",type:"number",defaultValue:null,value:W.telefono,onKeyUp:te,onChange:Q,InputProps:{startAdornment:Object(n.jsxs)(Rn.a,{position:"start",children:[Object(n.jsx)(au.a,{}),"(".concat(j.city?j.city:"",")")]})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Celular",variant:"outlined",name:"celular",type:"number",defaultValue:null,value:W.celular,onKeyUp:te,onChange:Q,InputProps:{startAdornment:Object(n.jsxs)(Rn.a,{position:"start",children:[Object(n.jsx)(nu.a,{}),"(".concat(j.country?j.country:"",")")]})}})})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(o.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(o.button),type:"submit",children:"Guardar"}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(o.button),onClick:function(){s.push("/dashboard")},children:"Cancelar"})]})]})]})})})]})})})),ou=a(1212);var su=Object(C.a)((function(e){return{AppHeader:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},root:Object(b.a)({marginTop:"1em"},e.breakpoints.up("sm"),{margin:"1em 6em 0 6em"}),card:{minWidth:275,marginTop:"1em"},img:Object(b.a)({width:e.spacing(40)},e.breakpoints.up("sm"),{width:"auto"}),container__input_root:{borderRadius:"20px"},container__input_notchedOutline:{borderWidth:2,borderColor:E.a.primary},container__input_focused:{},button:{margin:"0.5em",padding:"8px 40px"},text_password_error:{marginBottom:"5px",color:"#f4443b",fontSize:"0.9em",maxWidth:"fit-content",textAlign:"justify"},classes__login_buttons_paragraph:{"& p":{marginBottom:0,color:E.a.primary,textAlign:"initial",cursor:"pointer"}},icon:{color:E.a.primary},large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"}}})),lu=[{id:"accountId",label:"Mis cuentas",align:"center"},{id:"email",label:"Correo",minWidth:10,align:"center"},{id:"uncombine",label:"",minWidth:10,align:"center"}],du={loginRequest:I.h},uu=Object(s.b)((function(e){return{user:e.user,page:e.page,rowsPerPage:e.rowsPerPage}}),du)((function(e){var t=e.user,a=e.page,r=e.rowsPerPage,c=e.loginRequest,o=su(),s=Object(u.g)(),l=Object(i.useState)(!1),p=Object(d.a)(l,2),j=p[0],O=p[1],v=Object(i.useState)(!1),_=Object(d.a)(v,2),y=_[0],w=_[1],C=Object(i.useState)([]),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)(!1),A=Object(d.a)(T,2),I=A[0],D=A[1],z=Object(i.useState)({accountCurrent:null===t||void 0===t?void 0:t.data_user.cuentas[0].correo,accountToCombine:"",passwordAccountToCombine:""}),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)(""),U=Object(d.a)(L,2),W=U[0],Y=U[1];Object(i.useEffect)((function(){if(t){var e,a=null===(e=JSON.parse(window.localStorage.state))||void 0===e?void 0:e.styles;a&&Y(a.logo435x149),w(!0),q()}else s.push("/"),window.location.reload()}),[]);var q=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/user/getAccounts");case 2:t=e.sent,(a=t.data).accounts.map(function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/user/photo");case 2:return a=e.sent,n=a.data,t.linkPhoto=n.photo,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),B(a.accounts),w(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(e){M(Object(m.a)(Object(m.a)({},R),{},Object(b.a)({},e.target.name,e.target.value)))},V=function(){O(!1)},G=function(e){F.a.fire({customClass:{container:o.mySwal},text:"\xbfEst\xe1 seguro que desea descombinar este usuario?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:"Aceptar",cancelButtonText:"Cancelar"}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Q(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Q=function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.post("/user/uncombine",{correo:a}).then((function(){B(N.filter((function(e){return e.correo!==a}))),t.data_user.cuentas=t.data_user.cuentas.filter((function(e){return e.correo!==a})),c(t),F.a.fire({text:"Cuentas descombinadas exitosamente.",icon:"success",showConfirmButton:!1,timer:1500})}));case 3:e.next=10;break;case 5:e.prev=5,e.t0=e.catch(0),F.a.fire({customClass:{container:o.mySwal},text:"No se pudo descombinar.",icon:"error",showConfirmButton:!1,timer:1500}),s.push("/500"),window.location.reload();case 10:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)("div",{className:"App",children:[t&&Object(n.jsx)(At,{}),Object(n.jsxs)("div",{className:o.AppHeader,children:[Object(n.jsx)(ve.a,{className:o.card,elevation:0,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)("img",{src:W,alt:"logo",className:o.img}),I?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:"Combinar cuentas"}),Object(n.jsxs)("form",{className:o.root,onSubmit:function(e){e.preventDefault(),O(!j);var a=N.map((function(e){if(e.correo)return e.correo}));R.accountCurrent===R.accountToCombine?(F.a.fire({icon:"error",text:"Las cuentas no pueden ser iguales.",showConfirmButton:!1,timer:1500}),V()):a.includes(R.accountToCombine)?(F.a.fire({icon:"error",text:"Esta cuenta ya fue combinada.",showConfirmButton:!1,timer:1500}),V()):Object(Ce.a)({url:"/user/sign-in",method:"post",auth:{username:R.accountToCombine,password:R.passwordAccountToCombine}}).then((function(e){var a,n,i=e.data;Ce.a.post("/user/combine",{accountCurrent:null===t||void 0===t||null===(a=t.data_user)||void 0===a||null===(n=a.cuentas[0])||void 0===n?void 0:n.id,accountCombinate:null===i||void 0===i?void 0:i.id}).then((function(e){e&&(V(),F.a.fire({icon:"success",text:"Se ha enviado una solicitud al correo '".concat(i.correo,"', ac\xe9ptala para continuar la combinaci\xf3n de cuenta."),showConfirmButton:!0}).then((function(){s.push("/dashboard")})))})).catch((function(e){F.a.fire({icon:"error",text:"Ha ocurrido un error.",showConfirmButton:!1,timer:1500}),V(),s.push("/500"),window.location.reload()}))})).catch((function(e){V(),F.a.fire({icon:"error",text:"Usuario o contase\xf1a incorrecta.",showConfirmButton:!1,timer:1500})}))},children:[Object(n.jsxs)(ye.a,{container:!0,spacing:1,justify:"center",children:[t&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-50",children:Object(n.jsx)(Te.a,{required:!0,disabled:!0,name:"accountCurrent",variant:"outlined",value:R.accountCurrent,InputProps:{classes:{root:o.container__input_root,notchedOutline:o.container__input_notchedOutline,focused:o.container__input_focused}}})})}),Object(n.jsx)(ye.a,{item:!0,className:"text-center",children:Object(n.jsx)(ou.a,{sx:{color:E.a.primary}})}),t&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-50",children:Object(n.jsx)(Te.a,{required:!0,label:"Correo electr\xf3nico",name:"accountToCombine",variant:"outlined",onChange:H,value:R.accountToCombine,InputProps:{classes:{root:o.container__input_root,notchedOutline:o.container__input_notchedOutline,focused:o.container__input_focused}}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-50",children:Object(n.jsx)(Te.a,{required:!0,label:"Contrase\xf1a",name:"passwordAccountToCombine",variant:"outlined",type:"password",onChange:H,InputProps:{classes:{root:o.container__input_root,notchedOutline:o.container__input_notchedOutline,focused:o.container__input_focused}}})})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(o.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(o.button),type:"submit",children:"Combinar"}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(o.button),onClick:function(){M(Object(m.a)(Object(m.a)({},R),{},{accountToCombine:"",passwordAccountToCombine:""})),D(!1)},children:"Cancelar"})]})]})]}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{container:!0,children:Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,lg:12,children:Object(n.jsx)(zn,{tableSmall:!0,columns:lu,rows:N,loading:y,children:Object(n.jsx)(vn.a,{children:y?Object(n.jsx)(qn,{columns:lu,photo:1}):Object(n.jsx)(n.Fragment,{children:N.slice(a*r,a*r+r).map((function(e,t){return Object(n.jsxs)(_n.a,{align:"center",children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{alt:e.correo,src:null===e||void 0===e?void 0:e.linkPhoto,className:o.large})}),Object(n.jsx)(yn.a,{align:"center",children:e.correo}),Object(n.jsx)(yn.a,{align:"center",children:0!==t&&Object(n.jsx)(K.a,{title:"Descombinar",children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return function(e,t,a){switch(a){case"uncombine":G(t)}}(0,e.correo,"uncombine")},children:Object(n.jsx)(Cn.a,{})})})})]},e.id)}))})})})})}),Object(n.jsx)("div",{className:"text-right ".concat(o.a\u00f1adir),children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(o.button),onClick:function(){return D(!0)},children:"Combinar una cuenta"})})]})]})}),Object(n.jsx)(_t,{loading:j})]})]})})),mu=Object(C.a)((function(e){return{root:{marginTop:"2em"},card:{minWidth:275},img:Object(b.a)({width:e.spacing(40)},e.breakpoints.up("sm"),{width:"auto"}),button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}}}}));var bu={loginRequest:I.h},pu=Object(s.b)((function(e){return{user:e.user}}),bu)((function(e){var t=mu(),a=Object(u.g)(),r=Object(i.useState)(""),c=Object(d.a)(r,2),o=c[0],s=c[1],l=Object(i.useState)(!1),m=Object(d.a)(l,2),b=m[0],p=m[1],j=Object(i.useState)(""),g=Object(d.a)(j,2),O=g[0],v=g[1],_=e.user,y=e.loginRequest,w=new bt.a("logout");Object(i.useEffect)((function(){var t,n=null===(t=JSON.parse(window.localStorage.state))||void 0===t?void 0:t.styles;if(v(n.logo435x149),p(!0),e.match.params.accountCurrentId){var i=e.match.params.accountCurrentId.split("+"),r=Object(Ie.a)("".concat(i[0])),c=Object(Ie.a)("".concat(i[1]));k(r,c).catch((function(){a.push("/500"),window.location.reload()}))}else s("Se rechaz\xf3 la combinaci\xf3n de las cuentas");p(!1)}),[]);var C=function(){var e=Object(h.a)(f.a.mark((function e(t,n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0===t?(w.postMessage("reload"),a.push("/dashboard")):a.push("/sign-in");case 1:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),k=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o,l,d,u,m,b,p,j,h,g,x,O;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/user/getAccounts",{id:t});case 2:return i=e.sent,r=i.data,e.next=6,Ce.a.post("/user/getAccounts",{id:a});case 6:if(c=e.sent,o=c.data,!((null===r||void 0===r||null===(n=r.accounts)||void 0===n?void 0:n.length)>0)){e.next=18;break}if((null===r||void 0===r||null===(l=r.accounts[0])||void 0===l?void 0:l.id_usuarios)!==(null===o||void 0===o||null===(d=o.accounts[0])||void 0===d?void 0:d.id_usuarios)){e.next=13;break}s("Las cuentas '".concat(null===r||void 0===r||null===(u=r.accounts[0])||void 0===u?void 0:u.correo,"' y '").concat(null===o||void 0===o||null===(m=o.accounts[0])||void 0===m?void 0:m.correo,"' ya han sido combinadas")),e.next=18;break;case 13:return e.next=15,Ce.a.put("user/updateAccount/".concat(null===o||void 0===o||null===(b=o.accounts[0])||void 0===b?void 0:b.id),{defecto:null===o||void 0===o||null===(p=o.accounts[0])||void 0===p?void 0:p.id,id_usuarios:null===r||void 0===r||null===(j=r.accounts[0])||void 0===j?void 0:j.id_usuarios});case 15:s("Las cuentas se han combinado exitosamente"),null===_||void 0===_||null===(h=_.data_user)||void 0===h||h.cuentas.push({id:null===o||void 0===o||null===(g=o.accounts[0])||void 0===g?void 0:g.id,correo:null===o||void 0===o||null===(x=o.accounts[0])||void 0===x?void 0:x.correo,defecto:null===o||void 0===o||null===(O=o.accounts[0])||void 0===O?void 0:O.defecto}),y(_);case 18:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}();return Object(n.jsx)("div",{className:"App",children:Object(n.jsxs)("div",{className:"App-header",children:[Object(n.jsx)(ve.a,{className:t.card,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)("img",{src:O,alt:"logo",className:t.img}),Object(n.jsx)(we.a,{children:o}),Object(n.jsx)("form",{className:t.root,children:Object(n.jsx)("div",{className:"text-center ".concat(t.root),children:_?Object(n.jsx)(x.a,{variant:"contained",size:"small",className:"my-2 ".concat(t.button),onClick:function(e){return C(0)},children:"Ir al dashboard"}):Object(n.jsx)(x.a,{variant:"contained",size:"small",className:"my-2 ".concat(t.button),onClick:function(e){return C(1)},children:"Iniciar sesi\xf3n"})})})]})}),Object(n.jsx)(_t,{loading:b})]})})})),ju=Object(C.a)((function(){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},valueParameters:{margin:"0.25em"}}}));var fu={changeBreadcrump:I.a},hu=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"valores par\xe1metros"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),fu)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=Object(u.g)(),s=Object(i.useState)([]),l=Object(d.a)(s,2),m=l[0],b=l[1],p=Object(i.useState)([]),j=Object(d.a)(p,2),g=j[0],v=j[1],C=Object(i.useState)([]),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)(!1),A=Object(d.a)(T,2),z=A[0],P=A[1],R=Object(i.useState)([]),M=Object(d.a)(R,2),L=M[0],U=M[1],Y=ju(),q=Object(i.useState)(""),H=Object(d.a)(q,2),V=H[0],G=H[1],Q=Object(i.useState)(""),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(!0),ee=Object(d.a)($,2),te=ee[0],ae=ee[1],ne={},ce=Object(D.a)(["alerts","tables","buttons","breadCrumps","menu"]),oe=Object(d.a)(ce,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?(se().then((function(){ae(!1)})).catch((function(){o.push("/500"),window.location.reload()})),c(oe("breadCrumps:breadCrumps.parameter-values",{returnObjects:!0}))):(o.push("/dashboard"),window.location.reload())}),[]);var se=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/parameterValueParameter/getParameterValueParameter");case 2:t=e.sent,a=t.data,v(a.parametersValueParameters),a.parametersValueParameters=a.parametersValueParameters.filter((function(e){return!ne[e.parametros.id]&&(ne[e.parametros.id]=!0)})),b(a.parametersValueParameters.sort((function(e,t){var a,n;return(null===(a=e.parametros)||void 0===a?void 0:a.nombre.toLowerCase())<(null===(n=t.parametros)||void 0===n?void 0:n.nombre.toLowerCase())?-1:1}))),U(a.parametersValueParameters.sort((function(e,t){var a,n;return(null===(a=e.parametros)||void 0===a?void 0:a.nombre.toLowerCase())<(null===(n=t.parametros)||void 0===n?void 0:n.nombre.toLowerCase())?-1:1})));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(e,t,a){switch(a){case"delete":de(t);break;case"edit":o.push("/valueParameters/edit/".concat(Object(Ie.b)(t)));break;case"create":o.push("/valueParameters/create");break;case"view":P(!0),B(g.filter((function(e){var a;return(null===(a=e.parametros)||void 0===a?void 0:a.id)===t&&e.valor_parametro})))}},de=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:F.a.fire({text:oe("alerts:alerts.delete-button-parameter"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:oe("buttons:buttons.accept"),cancelButtonText:oe("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.value&&ue(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ue=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/parameterValueParameter/".concat(t));case 3:a=e.sent,n=a.data,v(g.filter((function(e){var a;return(null===(a=e.parametros)||void 0===a?void 0:a.id)!==t}))),b(m.filter((function(e){var a;return(null===(a=e.parametros)||void 0===a?void 0:a.id)!==t}))),U(m.filter((function(e){var a;return(null===(a=e.parametros)||void 0===a?void 0:a.id)!==t}))),n&&F.a.fire({text:oe("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(0),F.a.fire({text:oe("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),o.push("/500"),window.location.reload();case 16:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}(),me=function(e){if(r.includes("Editar"))return Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return le(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})},be=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return le(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})},pe=function(e){var t=0;if(g.map((function(a){var n;return(null===(n=a.parametros)||void 0===n?void 0:n.id)===e&&(t+=1)})),0!==t)return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsxs)("span",{children:[t,Object(n.jsx)(K.a,{title:oe("tables:table.tooltip.view-all"),children:Object(n.jsx)(S.a,{"aria-label":"view",onClick:function(t){return le(0,e,"view")},children:Object(n.jsx)(Ge.a,{children:t})})})]})})},je=function(){return oe("tables:table.columns-parameter-value",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:Y.button,onClick:function(e){return le(0,0,"create")},children:Object(n.jsx)("span",{children:oe("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"valueParameters",items:m,setItems:U,loadData:se,setLoading:ae}),Object(n.jsx)(zn,{columns:je(),rows:L,setDirection:G,setOrderBy:Z,children:Object(n.jsx)(vn.a,{children:te?Object(n.jsx)(qn,{columns:je(),photo:0}):L.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(L,Object(I.f)(V,X)).slice(t*a,t*a+a).map((function(e,t){var a,i,r,c;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:null===(a=e.parametros)||void 0===a?void 0:a.nombre}),pe(null===(i=e.parametros)||void 0===i?void 0:i.id),Object(n.jsx)(yn.a,{align:"center",children:me(null===(r=e.parametros)||void 0===r?void 0:r.id)}),Object(n.jsx)(yn.a,{align:"center",children:be(null===(c=e.parametros)||void 0===c?void 0:c.id)})]},"row".concat(t))}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:oe("tables:table.empty-table")})})}),Object(n.jsx)(O.a,{open:z,onClose:function(){P(!1)},fullWidth:!1,maxWidth:"xs",children:Object(n.jsx)(_.a,{children:N?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(ie.a,{children:[Object(n.jsxs)(y.a,{children:[Object(n.jsx)(re.a,{children:"Id"}),Object(n.jsx)(re.a,{children:"N\xb0"}),Object(n.jsx)(w.a,{children:oe("menu:parameter-values")})]}),Object(n.jsx)(W.a,{}),N.sort((function(e,t){return e.orden<t.orden?-1:1})).map((function(e){return Object(n.jsxs)(y.a,{children:[Object(n.jsx)(wn.a,{children:e.id}),Object(n.jsx)(wn.a,{children:e.orden}),Object(n.jsx)(w.a,{children:e.valor_parametro})]})}))]})}):""})})]})})),gu=a(1213),xu=a(1214),Ou=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.5em"},iconMargin:{margin:e.spacing(2)},"a\xf1adir":{marginTop:"1em"},"a\xf1adirButton":{textTransform:"none",transitionProperty:"none","&:hover":{backgroundColor:"white",textDecoration:"underline"}}}}));var vu={changeBreadcrump:I.a},_u=Object(s.b)(null,vu)((function(e){var t=Ou(),a=Object(u.g)(),r=Object(i.useState)({parametro:""}),c=Object(d.a)(r,2),o=c[0],s=c[1],l=Object(i.useState)([{index:1,valor_parametro:"",orden:"1"}]),j=Object(d.a)(l,2),g=j[0],O=j[1],v=Object(i.useState)([]),_=Object(d.a)(v,2),y=_[0],w=_[1],C=Object(i.useState)(!1),k=Object(d.a)(C,2),N=k[0],B=k[1],T=e.changeBreadcrump,A=Object(i.useState)(""),I=Object(d.a)(A,2),z=I[0],P=I[1],R=Object(D.a)(["alerts","tables","buttons","breadCrumps","menu","parameterValues"]),M=Object(d.a)(R,1)[0];Object(i.useEffect)((function(){L().catch((function(){a.push("/500"),window.location.reload()})),e.match.params.id?(U().catch((function(){a.push("/500"),window.location.reload()})),T(M("breadCrumps:breadCrumps.parameter-values-edit",{returnObjects:!0}))):T(M("breadCrumps:breadCrumps.parameter-values-create",{returnObjects:!0}))}),[]);var L=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/parameterValueParameter/getParameterValueParameter");case 2:t=e.sent,a=t.data,P(a.parametersValueParameters[0].id);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),U=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.get("/parameterValueParameter/".concat(i));case 3:r=t.sent,c=r.data,s({parametro:null===(a=c.parameterValueParameter[0])||void 0===a||null===(n=a.parametros)||void 0===n?void 0:n.nombre}),O(Object(p.a)(c.parameterValueParameter.sort((function(e,t){return e.valor_parametro.toLowerCase()<t.valor_parametro.toLowerCase()?-1:1})).map((function(e,t){return{index:e.id,valor_parametro:e.valor_parametro,orden:0===e.orden?t+1:e.orden}})))),w(Object(p.a)(c.parameterValueParameter.map((function(e){return e.id}))));case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),W=function(){B(!1)},Y=function(){var t=Object(h.a)(f.a.mark((function t(n){var i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.preventDefault(),B(!N),e.match.params.id?(i=Object(Ie.a)(e.match.params.id),Ce.a.put("/parameterValueParameter/".concat(i),Object(m.a)(Object(m.a)({},o),{},{valor_parametro:g})).then((function(e){W(),a.push("/valueParameters"),F.a.fire({icon:"success",iconColor:E.a.primary,text:M("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})})).catch((function(e){W(),F.a.fire({icon:"error",iconColor:E.a.primary,text:M("alerts:alerts.edited-error"),showConfirmButton:!1,timer:1500}),a.push("/500"),window.location.reload()}))):Ce.a.post("/parameterValueParameter/",Object(m.a)(Object(m.a)({},o),{},{valor_parametro:g})).then((function(e){W(),a.push("/valueParameters"),F.a.fire({icon:"success",iconColor:E.a.primary,text:M("alerts:alerts.created"),showConfirmButton:!1,timer:1500})})).catch((function(e){W(),F.a.fire({icon:"error",iconColor:E.a.primary,text:M("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500}),a.push("/500"),window.location.reload()}));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),q=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:O([].concat(Object(p.a)(g),[{index:z+1,valor_parametro:"",orden:g.length+1}])),P(z+1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(){var t=Object(h.a)(f.a.mark((function t(a){var n,i,r,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.match.params.id?(i=g.filter((function(e){return e.index===a})),y.includes(null===(n=i[0])||void 0===n?void 0:n.index)?F.a.fire({text:M("alerts:alerts.delete-parameter-value"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:M("buttons:buttons.accept"),cancelButtonText:M("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){var n,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value&&(1!==g.length?(r=g.sort((function(e,t){return e.orden<t.orden?-1:1})).filter((function(e){return e.index!==a})).map((function(e,t){return""===e.valor_parametro&&(e.valor_parametro=null),e.orden=t+1,e})),O(r.sort((function(e,t){return e.valor_parametro?e.valor_parametro.toLowerCase()<t.valor_parametro.toLowerCase()?-1:1:e.valor_parametro<t.valor_parametro?-1:1})))):(O([{index:z+1,valor_parametro:"",orden:"1"}]),P(z+1)),F.a.fire({icon:"info",iconColor:E.a.primary,text:"".concat(M("alerts:alerts.alert-delete-parameter-value"),' "').concat(null===(n=i[0])||void 0===n?void 0:n.valor_parametro,'"'),showConfirmButton:!0,confirmButtonText:M("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()):1!==g.length?(r=g.sort((function(e,t){return e.orden<t.orden?-1:1})).filter((function(e){return e.index!==a})).map((function(e,t){return""===e.valor_parametro&&(e.valor_parametro=null),e.orden=t+1,e})),O(r.sort((function(e,t){return e.valor_parametro?e.valor_parametro.toLowerCase()<t.valor_parametro.toLowerCase()?-1:1:e.valor_parametro<t.valor_parametro?-1:1})))):(O([{index:z+1,valor_parametro:"",orden:"1"}]),P(z+1))):1!==g.length?(c=g.filter((function(e){return e.index!==a})).map((function(e,t){return e.orden=t+1,e})),O(c)):(O([{index:z+1,valor_parametro:"",orden:"1"}]),P(z+1));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:t.root,onSubmit:Y,children:[Object(n.jsx)(we.a,{align:"center",component:"h6",variant:"h6",children:M("parameterValues:title")}),Object(n.jsx)(ye.a,{container:!0,spacing:2,children:Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:M("parameterValues:parameter"),name:"parametro",value:o.parametro,variant:"outlined",onChange:function(e){s(Object(m.a)(Object(m.a)({},o),{},Object(b.a)({},e.target.name,e.target.value)))}})})})}),g.map((function(e){return Object(n.jsxs)(ye.a,{container:!0,spacing:1,className:t.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:2,lg:1,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{type:"number",label:"Orden",variant:"outlined",name:"orden",value:e.orden})})},e.id),Object(n.jsx)(ye.a,{item:!0,xs:8,lg:10,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:M("parameterValues:parameter-value"),variant:"outlined",name:"valor_parametro",value:e.valor_parametro?e.valor_parametro:"",onChange:function(t){return a=t,n=e.index,g.map((function(e){return e.index===n&&(e[a.target.name]=a.target.value),e})),void O(Object(p.a)(g));var a,n},InputProps:{startAdornment:Object(n.jsxs)(Rn.a,{position:"start",children:[Object(n.jsx)(S.a,{onClick:function(t){var a;(a=e.orden)+1<=g.length&&(g.map((function(e){return e.orden===a?e.orden=e.orden+1:e.orden===a+1&&(e.orden=e.orden-1),e})),O(Object(p.a)(g)))},children:Object(n.jsx)(gu.a,{})}),Object(n.jsx)(S.a,{onClick:function(){var t;(t=e.orden)-1>=1&&(g.map((function(e){return e.orden===t?e.orden=e.orden-1:e.orden===t-1&&(e.orden=e.orden+1),e})),O(Object(p.a)(g)))},children:Object(n.jsx)(xu.a,{})})]})}})})},e.id),Object(n.jsx)(ye.a,{item:!0,xs:2,lg:1,children:Object(n.jsx)(K.a,{title:M("parameterValues:delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",className:t.iconMargin,size:"small",onClick:function(t){return H(e.index)},children:Object(n.jsx)(ae.a,{fontSize:"small"})})})},e.id)]},e.id)})),Object(n.jsx)("div",{className:"text-right ".concat(t.a\u00f1adir),children:Object(n.jsx)(x.a,{color:"primary",onClick:q,className:t.a\u00f1adirButton,children:M("parameterValues:add")})}),Object(n.jsxs)("div",{className:"text-center ".concat(t.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(t.button),type:"submit",children:M("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(t.button),onClick:function(){a.push("/valueParameters")},children:M("buttons:buttons.cancel")})]})]})})})]})})),yu=Object(C.a)((function(){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},container__avatar:{"& img":{height:"min-content"}}}}));var wu={changeBreadcrump:I.a,changePage:I.b},Cu=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"contratos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),wu)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changePage,o=e.changeBreadcrump,s=Object(u.g)(),l=Object(i.useState)([]),m=Object(d.a)(l,2),b=m[0],j=m[1],O=Object(i.useState)([]),v=Object(d.a)(O,2),_=v[0],y=v[1],w=yu(),C=Object(i.useState)(""),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)(""),A=Object(d.a)(T,2),E=A[0],z=A[1],P=Object(i.useState)(!0),R=Object(d.a)(P,2),M=R[0],L=R[1],F=Object(i.useState)(),U=Object(d.a)(F,2),W=U[0],Y=U[1],q=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),H=Object(d.a)(q,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?V().catch((function(){s.push("/500"),window.location.reload()})):(s.push("/dashboard"),window.location.reload())}),[]);var V=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Q();case 2:o(H("breadCrumps:breadCrumps.contracts",{returnObjects:!0})),L(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(e,t){return{limit:t||10,offset:e?e*t:0}},Q=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=G(0,a),e.next=3,Ce.a.post("/contract/getContractsCountForOrganizations",n);case 3:i=e.sent,r=i.data,j(r.contracts.rows),y(r.contracts.rows),Y(null===(t=r.contracts)||void 0===t?void 0:t.count);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),i=G(t,a),e.next=4,Ce.a.post("/contract/getContractsCountForOrganizations",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(b),Object(p.a)(null===(n=c.contracts)||void 0===n?void 0:n.rows.filter((function(e){return!b.find((function(t){return t.id===e.id}))})))),j(o),y(o),L(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),X=function(e,t,a){switch(a){case"view":c(0),s.push("/contracts/".concat(Object(Ie.b)(t)));break;case"create":s.push("/contract/create")}},Z=function(){return H("tables:table.columns-contracts-organizations",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:w.button,onClick:function(e){return X(0,0,"create")},children:Object(n.jsx)("span",{children:H("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"contracts",items:b,setItems:y,loadData:V,setLoading:L}),Object(n.jsx)(zn,{columns:Z(),rows:W,changePage:c,setDirection:B,setOrderBy:z,changePagination:J,children:Object(n.jsx)(vn.a,{children:M?Object(n.jsx)(qn,{columns:Z(),photo:0}):_.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(_,Object(I.f)(N,E)).slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhoto,className:w.container__avatar})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.activos}),Object(n.jsx)(yn.a,{align:"center",children:e.vencidos}),Object(n.jsx)(yn.a,{align:"center",children:e.pendientes}),Object(n.jsx)(yn.a,{align:"center",children:e.eliminados}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:H("tables:table.tooltip.view-all"),children:Object(n.jsx)(S.a,{"aria-label":"view",onClick:function(t){return X(0,e.id,"view")},children:Object(n.jsx)(Ge.a,{})})})})]},"row".concat(t))}))}):M?Object(n.jsx)(qn,{columns:Z(),photo:0}):Object(n.jsx)(yn.a,{align:"center",colSpan:"8",children:H("tables:table.empty-table")})})})]})})),ku=Object(C.a)((function(){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},container__avatar:{"& img":{height:"min-content"}}}}));var Nu={changeBreadcrump:I.a},Bu=Object(s.b)((function(e){return{page:e.page,user:e.user,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"contratos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Nu)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=e.user,s=Object(u.g)(),l=Object(i.useState)([]),b=Object(d.a)(l,2),j=b[0],g=b[1],O=Object(i.useState)([]),v=Object(d.a)(O,2),_=v[0],y=v[1],w=ku(),C=Object(i.useState)(""),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)(""),A=Object(d.a)(T,2),z=A[0],P=A[1],R=Object(i.useState)(!0),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)(),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],V=Object(D.a)(["alerts","tables","buttons","breadCrumps","menu"]),G=Object(d.a)(V,1)[0];Object(i.useEffect)((function(){Q().catch((function(){s.push("/500"),window.location.reload()}))}),[]);var Q=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X();case 2:U(!1);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(e,t){return{limit:t||10,offset:e?e*t:0}},X=function(){var t=Object(h.a)(f.a.mark((function t(){var n,i,r,s,l,d,u,b,p,j;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d=J(0,a),u=Object(Ie.a)(e.match.params.organizations),t.next=4,Ce.a.post("/contract/getContracts",Object(m.a)({id_organizaciones:u},d));case 4:b=t.sent,p=b.data,g(null===(n=p.contracts)||void 0===n?void 0:n.rows),y(null===(i=p.contracts)||void 0===i?void 0:i.rows),H(null===(r=p.contracts)||void 0===r?void 0:r.count),(j=G("breadCrumps:breadCrumps.contracts-organization",{returnObjects:!0}))[1].route=1===(null===o||void 0===o?void 0:o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios)||14===(null===o||void 0===o?void 0:o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios)?"/contracts":window.reload,j.push({name:p.contracts.count>0?"".concat(null===(s=p.contracts.rows[0])||void 0===s||null===(l=s.organizaciones)||void 0===l?void 0:l.nombre):""}),c(j);case 13:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Z=function(){var t=Object(h.a)(f.a.mark((function t(a,n){var i,r,c,o,s,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return U(!0),r=J(a,n),c=Object(Ie.a)(e.match.params.organizations),t.next=5,Ce.a.post("/contract/getContracts",Object(m.a)({id_organizaciones:c},r));case 5:o=t.sent,s=o.data,l=[].concat(Object(p.a)(j),Object(p.a)(null===(i=s.contracts)||void 0===i?void 0:i.rows.filter((function(e){return!j.find((function(t){return t.id===e.id}))})))),g(l),y(l),U(!1);case 11:case"end":return t.stop()}}),t)})));return function(e,a){return t.apply(this,arguments)}}(),$=function(e,t,a){switch(a){case"delete":ee(t);break;case"edit":s.push("/contracts/edit/".concat(Object(Ie.b)(t)));break;case"create":s.push("/contract/create")}},ee=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:F.a.fire({text:G("alerts:alerts.delete-button-contract"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:G("buttons:buttons.accept"),cancelButtonText:G("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.value&&te(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),te=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/contract/".concat(t));case 3:return a=e.sent,n=a.data,U(!0),e.next=8,Q();case 8:n&&F.a.fire({text:G("alerts:alerts.deleted"),icon:"success",showConfirmButton:!1,timer:1500}),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(0),F.a.fire({text:G("alerts:alerts.deleted-error"),icon:"error",showConfirmButton:!1,timer:1500}),s.push("/500"),window.location.reload();case 16:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}(),ae=function(e){if(r.includes("Editar"))return Object(n.jsx)(K.a,{title:G("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return $(0,e,"edit")},children:Object(n.jsx)(Wn,{})})})},ne=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(K.a,{title:G("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return $(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})},ie=function(){return G("tables:table.columns-contracts",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:w.button,onClick:function(e){return $(0,0,"create")},children:Object(n.jsx)("span",{children:G("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{items:j,setItems:y,loadData:Q,setLoading:U}),Object(n.jsx)(zn,{columns:ie(),rows:q,setDirection:B,setOrderBy:P,changePagination:Z,children:Object(n.jsx)(vn.a,{children:L?Object(n.jsx)(qn,{columns:ie(),photo:0}):_.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(_,Object(I.f)(N,z)).slice(t*a,t*a+a).map((function(e,t){var a;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:null===(a=e.planes)||void 0===a?void 0:a.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.valor_estado}),Object(n.jsx)(yn.a,{align:"center",children:e.fecha_inicio&&Ne()(e.fecha_inicio).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:e.vencimiento&&Ne()(e.vencimiento).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:new Intl.NumberFormat("de-DE").format(e.cantidad_emisiones)}),Object(n.jsx)(yn.a,{align:"center",children:new Intl.NumberFormat("de-DE").format(e.cantidad_insignias_emitidas)}),Object(n.jsx)(yn.a,{align:"center",children:new Intl.NumberFormat("de-DE").format(e.cantidad_certificados_emitidos)}),Object(n.jsx)(yn.a,{align:"center",children:new Intl.NumberFormat("de-DE").format(e.cantidad_carnets_emitidos)}),Object(n.jsx)(yn.a,{align:"center",children:new Intl.NumberFormat("de-DE").format(e.cantidad_documentos_emitidos)}),Object(n.jsx)(yn.a,{align:"center",children:new Intl.NumberFormat("de-DE").format(e.total_emisiones)}),Object(n.jsx)(yn.a,{align:"center",children:new Intl.NumberFormat("de-DE").format(parseInt(e.cantidad_emisiones)-parseInt(e.total_emisiones))}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado||0===e.estado?ae(e.id):""}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado||0===e.estado?ne(e.id):""})]},"row".concat(t))}))}):L?Object(n.jsx)(qn,{columns:ie(),photo:0}):Object(n.jsx)(yn.a,{align:"center",colSpan:"8",children:G("tables:table.empty-table")})})})]})}));function Su(e){return e.replace(e.split("-")[0],parseInt(e.split("-")[0])+1)}function Tu(e){var t=parseInt(e.slice(8,10))+1,a=e.split("-");return a[2]=t<10?"0".concat(t):t,a="".concat(a[0],"-").concat(a[1],"-").concat(a[2])}var Au=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.5em"},check:{padding:"5px",color:E.a.primary}}}));var Eu={changeBreadcrump:I.a},Iu=Object(s.b)(null,Eu)((function(e){var t=e.changeBreadcrump,a=Au(),r=Object(u.g)(),c=Object(i.useState)([]),o=Object(d.a)(c,2),s=o[0],l=o[1],p=Object(i.useState)([]),j=Object(d.a)(p,2),g=j[0],O=j[1],v=Object(i.useState)([]),_=Object(d.a)(v,2),y=_[0],w=_[1],C=Object(i.useState)({id:"",nombre:""}),k=Object(d.a)(C,2),N=k[0],B=k[1],S=Object(i.useState)(!1),A=Object(d.a)(S,2),I=A[0],z=A[1],P=Object(i.useState)({fecha_inicio:!1,vencimiento:!1}),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!1),W=Object(d.a)(U,2),q=W[0],H=W[1],K=Object(i.useState)(!1),V=Object(d.a)(K,2),G=V[0],Q=V[1],J=Object(i.useState)({id_organizaciones:"",tipo_contrato_vp:"",vencimiento:null,cantidad_emisiones:0,fecha_inicio:"",id_planes:""}),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=(4===Z.id_planes||5===Z.id_planes)&&!e.match.params.id||!q&&!G,te=Object(D.a)(["alerts","buttons","breadCrumps","forms"]),ae=Object(d.a)(te,1)[0];Object(i.useEffect)((function(){ne().catch((function(){r.push("/500"),window.location.reload()}))}),[]),Object(i.useEffect)((function(){var t;if(e.match.params.id)$(Object(m.a)(Object(m.a)({},Z),{},{cantidad_emisiones:4===Z.id_planes?Z.cantidad_emisiones:""===Z.id_planes?0:null===(t=s.find((function(e){return e.id===Z.id_planes})))||void 0===t?void 0:t.cantidad_emisiones}));else if(""===Z.id_planes)$(Object(m.a)(Object(m.a)({},Z),{},{cantidad_emisiones:0,fecha_inicio:"",vencimiento:""}));else if(G){var a,n=Tu(g.find((function(e){return e.id_organizaciones===Z.id_organizaciones&&0===e.estado})).vencimiento),i=Su(n);$(Object(m.a)(Object(m.a)({},Z),{},{cantidad_emisiones:4===Z.id_planes?10:null===(a=s.find((function(e){return e.id===Z.id_planes})))||void 0===a?void 0:a.cantidad_emisiones,vencimiento:i,fecha_inicio:n})),L({fecha_inicio:!1,vencimiento:!1})}else if(q){var r,c=Tu(g.find((function(e){return e.id_organizaciones===Z.id_organizaciones&&1===e.estado})).vencimiento),o=Su(c);$(Object(m.a)(Object(m.a)({},Z),{},{cantidad_emisiones:4===Z.id_planes?10:null===(r=s.find((function(e){return e.id===Z.id_planes})))||void 0===r?void 0:r.cantidad_emisiones,vencimiento:o,fecha_inicio:c})),L({fecha_inicio:!1,vencimiento:!1})}else{var l,d=Ne()().format("YYYY-MM-DD"),u=Su(d);$(Object(m.a)(Object(m.a)({},Z),{},{cantidad_emisiones:4===Z.id_planes?10:null===(l=s.find((function(e){return e.id===Z.id_planes})))||void 0===l?void 0:l.cantidad_emisiones,vencimiento:u,fecha_inicio:d})),L({fecha_inicio:!1,vencimiento:!1})}}),[Z.id_planes]),Object(i.useEffect)((function(){var t=g.find((function(e){return e.id_organizaciones===Z.id_organizaciones&&1===e.estado})),a=g.find((function(e){return e.id_organizaciones===Z.id_organizaciones&&0===e.estado}));H(!!t),Q(!!a),e.match.params.id||$(Object(m.a)(Object(m.a)({},Z),{},{vencimiento:"",cantidad_emisiones:"",fecha_inicio:"",id_planes:""}))}),[Z.id_organizaciones]);var ne=function(){var a=Object(h.a)(f.a.mark((function a(){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return z(!0),a.next=3,ie();case 3:return a.next=5,re();case 5:return a.next=7,ce();case 7:if(!e.match.params.id){a.next=13;break}return a.next=10,oe();case 10:t(ae("breadCrumps:breadCrumps.contracts-organization-edit",{returnObjects:!0})),a.next=14;break;case 13:t(ae("breadCrumps:breadCrumps.contracts-organization-create",{returnObjects:!0}));case 14:z(!1);case 15:case"end":return a.stop()}}),a)})));return function(){return a.apply(this,arguments)}}(),ie=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.get("/others/getPlans");case 2:t=e.sent,a=t.data,l(a.plans);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),re=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations");case 2:t=e.sent,a=t.data,w(a.organizations.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/contract/getContracts");case 2:t=e.sent,a=t.data,O(a.contracts.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),oe=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.get("/contract/".concat(n));case 3:i=t.sent,r=i.data,B(null===(a=r.contract)||void 0===a?void 0:a.organizaciones),$(r.contract);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),se=function(e){$(Object(m.a)(Object(m.a)({},Z),{},Object(b.a)({},e.target.name,e.target.value)))},le=function(){z(!1)},de=function(e){var t=Ne()().format("YYYY-MM-DD"),a=e.target.value;if(L(t>a?Object(m.a)(Object(m.a)({},M),{},Object(b.a)({},e.target.name,!0)):Object(m.a)(Object(m.a)({},M),{},Object(b.a)({},e.target.name,!1))),"vencimiento"!==e.target.name){var n=Su(a);$(Object(m.a)(Object(m.a)({},Z),{},Object(b.a)({vencimiento:4!==Z.id_planes?n:Z.vencimiento},e.target.name,e.target.value)))}else{var i=function(e){return e.replace(e.split("-")[0],parseInt(e.split("-")[0])-1)}(a);$(Object(m.a)(Object(m.a)({},Z),{},Object(b.a)({fecha_inicio:4!==Z.id_planes?i:Z.fecha_inicio},e.target.name,e.target.value)))}};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsxs)(_e.a,{className:"p-3",children:[Object(n.jsx)(we.a,{align:"center",component:"h6",variant:"h6",children:ae("forms:contracts")}),Object(n.jsxs)("form",{className:a.root,onSubmit:function(t){var a,n;t.preventDefault(),z(!I);var i=null===(a=g.find((function(e){return e.id_organizaciones===Z.id_organizaciones&&1===e.estado})))||void 0===a?void 0:a.vencimiento,c=null===(n=g.find((function(e){return e.id_organizaciones===Z.id_organizaciones&&0===e.estado})))||void 0===n?void 0:n.vencimiento,o=Ne()().format("YYYY-MM-DD")!==Z.fecha_inicio;if(M.fecha_inicio||M.vencimiento)le(),F.a.fire({icon:"error",iconColor:E.a.primary,text:ae("forms:invalid-dates"),showConfirmButton:!1,timer:3e3});else if(/^([0-9])*$/.test(Z.cantidad_emisiones))if(0===Z.cantidad_emisiones)le(),F.a.fire({icon:"error",iconColor:E.a.primary,text:ae("forms:enter-number-emissions"),showConfirmButton:!1,timer:3e3});else if(4===Z.id_planes&&Z.cantidad_emisiones<10)le(),F.a.fire({icon:"error",iconColor:E.a.primary,text:ae("forms:minimun-emissions"),showConfirmButton:!1,timer:2e3});else if(!e.match.params.id&&G&&Z.fecha_inicio<=c)le(),F.a.fire({icon:"error",iconColor:E.a.primary,text:"".concat(ae("forms:contract-on-hold")," ").concat(Ne()(c).format("DD/MM/YYYY"),", ").concat(ae("forms:date-new-contract"),"."),showConfirmButton:!1,timer:5e3});else if(!e.match.params.id&&q&&Z.fecha_inicio<=i)le(),F.a.fire({icon:"error",iconColor:E.a.primary,text:"".concat(ae("forms:contract-active")," ").concat(Ne()(i).format("DD/MM/YYYY"),", ").concat(ae("forms:date-new-contract"),"."),showConfirmButton:!1,timer:5e3});else if(Z.fecha_inicio>Z.vencimiento)le(),F.a.fire({icon:"error",iconColor:E.a.primary,text:ae("forms:expiration-date"),showConfirmButton:!1,timer:3e3});else if(e.match.params.id){var s=Object(Ie.a)(e.match.params.id);Ce.a.put("/contract/".concat(s),Z).then((function(e){le(),F.a.fire({icon:"success",iconColor:E.a.primary,text:ae("alerts:alerts.edited"),showConfirmButton:!1,timer:1500}),r.push("/contracts/".concat(Object(Ie.b)(Z.id_organizaciones)))})).catch((function(e){le(),F.a.fire({icon:"error",iconColor:E.a.primary,text:ae("alerts:alerts.edited-error"),showConfirmButton:!1,timer:1500})}))}else(q||G||o)&&(Z.estado=0),Ce.a.post("/contract/",Z).then((function(e){le(),F.a.fire({icon:"success",iconColor:E.a.primary,text:ae("alerts:alerts.created"),showConfirmButton:!1,timer:1500}),r.push("/contracts/".concat(Object(Ie.b)(Z.id_organizaciones)))})).catch((function(e){le(),F.a.fire({icon:"error",iconColor:E.a.primary,text:ae("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500})}));else le(),F.a.fire({icon:"error",iconColor:E.a.primary,text:ae("forms:invalid-number-emissions"),showConfirmButton:!1,timer:3e3})},children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:Object(n.jsx)(oo.a,{value:N,onChange:function(e,t){B(t),$(Object(m.a)(Object(m.a)({},Z),{},{id_organizaciones:t.id}))},options:y,getOptionLabel:function(e){return e.nombre},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{margin:"normal",label:ae("forms:organization"),variant:"outlined"}))}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{id:"modulosLabel",children:ae("forms:plan-type")}),Object(n.jsxs)(T.a,{labelId:"id_planes",label:ae("forms:plan-type"),value:Z.id_planes,onChange:se,name:"id_planes",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:ae("forms:option")})}),s.map((function(e){return Object(n.jsxs)(Y.a,{value:e.id,children:[e.nombre," ",4!==e.id&&5!==e.id&&"(".concat(e.cantidad_emisiones," emisiones)")]},e.id)}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:2,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(Te.a,{label:ae("forms:number-emissions"),required:!0,type:"number",name:"cantidad_emisiones",defaultValue:null,value:Z.cantidad_emisiones,variant:"outlined",onKeyUp:function(e){var t=String(e.target.value);/^([1-9][0-9]*(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t)||(e.target.value=t.substr(t.length))},onChange:(4===Z.id_planes||5===Z.id_planes)&&se})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:5,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,disabled:!ee,error:M.fecha_inicio,label:ae("forms:start-date"),type:"date",variant:"outlined",name:"fecha_inicio",value:Z.fecha_inicio,onChange:de,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start"})}})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:5,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:!ee,required:!0,error:M.vencimiento,label:ae("forms:expired-date"),type:"date",variant:"outlined",name:"vencimiento",value:Z.vencimiento,onChange:de,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start"})}})})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(a.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(a.button),type:"submit",children:ae("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(a.button),onClick:function(){r.push("/contracts/".concat(Object(Ie.b)(Z.id_organizaciones)))},children:ae("buttons:buttons.cancel")})]})]})]})})]})})),Du=a(1245),zu=a(1037),Pu=a(1246),Ru=a(1236),Mu=a(1265),Lu=a(1266),Fu=a(1215),Uu=a(1216),Wu=a(1217),Yu=a(1218),qu=a(1219),Hu=a.p+"static/media/fondo_verificar.8194be81.png";var Ku={root:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",backgroundImage:"url(".concat(window.location.origin===je.a.certikaURL?Hu:"",")"),backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"},container__subbar:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"10px 2.5%",padding:"0 2% 8px 2%","& p":{marginBottom:0},"& span":{fontWeight:"bold"}},container__buttons:{display:{xs:"none",sm:"flex"},justifyContent:"space-between",width:{xs:500,sm:700},"& button":{border:"none",borderRadius:8,padding:{xs:"0px 0px",sm:"2px 20px"}},"& button:focus":{outlineStyle:"none"}},container__buttons_active:{textTransform:"none",fontSize:"18px",color:E.a.primary},container__buttons_active_mobile:{textTransform:"none",fontSize:"14px",color:E.a.primary,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"},container__buttons_inactive:{backgroundColor:"transparent",textTransform:"none",fontSize:"18px",color:"#7E7E7E"},container__buttons_inactive_mobile:{backgroundColor:"transparent",textTransform:"none",fontSize:"14px",color:"#7E7E7E",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"},text_title:{color:"#7E7E7E",fontSize:"18px"},text:{color:"#7E7E7E",fontSize:"18px"},text_footer:{color:"#7E7E7E",fontSize:"16px"},container__code:{width:{xs:"80%",sm:"46%"},marginBottom:"2em"},container__footer:{width:{xs:"90%",sm:"50%"}},textField:{marginBottom:"1em",backgroundColor:"#fff","& fieldset":{borderRadius:"16px",border:"2px solid ".concat(E.a.primary)}},button:{backgroundColor:E.a.primary,textTransform:"none",borderRadius:"64px",fontSize:"16px","&:hover":{backgroundColor:E.a.secondary}},container_button_centered:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}},Vu=Object(C.a)((function(e){return{dropzone:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",borderColor:E.a.primary,borderRadius:15,"& .MuiGrid-container":{justifyContent:"center"},"& .MuiTypography-body1":{display:"flex",flexDirection:"column",alignItems:"center",paddingBottom:"1em"}}}})),Gu=function(e){var t=Vu(),a=Object(i.useState)(0),r=Object(d.a)(a,2),c=r[0],o=r[1],s=Object(i.useState)("codigo"),l=Object(d.a)(s,2),m=l[0],b=l[1],p=Object(i.useState)({}),j=Object(d.a)(p,2),f=j[0],h=j[1],g=Object(i.useState)(!1),x=Object(d.a)(g,2),O=x[0],v=x[1],_=Object(i.useState)(""),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(i.useState)({}),N=Object(d.a)(k,2),B=N[0],S=N[1],T=Object(u.g)(),A=Object(D.a)(["verify"]),I=Object(d.a)(A,1)[0];Object(i.useEffect)((function(){var e,t=null===(e=JSON.parse(window.localStorage.state))||void 0===e?void 0:e.styles;S({Logo:t.logo435x149,LoginLogo:t.icono_login,LoginBackground:t.login_background});var a,n=new URLSearchParams(document.location.search.substring(1)).get("code");if(n){P(a,n)}}),[]),Object(i.useEffect)((function(){var t=e.match.params.verificationType;o("code"===t||"document-code"===t||"carnet-code"===t||"certificate-code"===t||"diploma-code"===t?0:"metadata"===t?1:"proof"===t||"proof-document"===t||"proof-carnet"===t||"proof-certificate"===t||"proof-diploma"===t?2:"chainpoint"===t||"chainpoint-document"===t||"chainpoint-carnet"===t||"chainpoint-certificate"===t||"chainpoint-diploma"===t?3:4)}),[e.match.params.verificationType]),Object(i.useEffect)((function(){b(0===c?"codigo":1===c?"metadata":2===c?"proof":3===c?"chainpoint":"pdf")}),[c]);var z=function(e){b(e.target.name),"codigo"===e.target.name?(T.push("/verify/code"),o(0)):"metadata"===e.target.name?(T.push("/verify/metadata"),o(1),h({acceptedFiles:[".json"]})):"proof"===e.target.name?(T.push("/verify/proof"),o(2),h({acceptedFiles:[".pdf"]})):"chainpoint"===e.target.name?(T.push("/verify/chainpoint"),o(3),h({acceptedFiles:[".json"]})):"pdf"===e.target.name&&(T.push("/verify/pdf"),o(4),h({acceptedFiles:[".pdf"]}))},P=function(e,t){null===e||void 0===e||e.preventDefault();var a=w||""!==w?w:t;""!==a&&(v(!0),ct()({method:"post",url:"".concat(je.a.apiURL,"/blockchain/verify/v2/code"),data:{code:a}}).then((function(e){var t=e.data;v(!1);var a=t.isVerified,n=t.issuedId,i=t.state,r=t.type;a&&"documento"===r?T.push("/verified-documents/code/".concat(Object(Ie.b)(n))):a&&"carnet"===r?T.push("/verified-carnet/code/".concat(Object(Ie.b)(n))):!a||2!==i&&0!==i?1===i?(v(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:I("verify:verify-file.credential-no-accepted"),showConfirmButton:!1}).then((function(){C("")}))):3===i?(v(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:I("verify:verify-file.credential-rejected"),showConfirmButton:!1}).then((function(){C("")}))):(v(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:I("verify:verify-file.credential-no-valid"),showConfirmButton:!1}).then((function(){C("")}))):"insignia"===r?T.push("/certificates/verify/code/".concat(Object(Ie.b)(n))):"certificado"===r&&T.push("/verified-certificate/code/".concat(Object(Ie.b)(n)))})))};return Object(n.jsxs)(Du.a,{component:"div",sx:Ku.root,children:[Object(n.jsx)(Du.a,{component:"div",sx:Ku.container_img,children:Object(n.jsx)("img",{alt:"logo",src:null===B||void 0===B?void 0:B.Logo,style:{width:"90%"}})}),Object(n.jsx)(zu.a,{sx:Ku.text_title,children:I("verify:verify-file.message")}),Object(n.jsx)(Du.a,{component:"div",sx:Ku.container__subbar,children:Object(n.jsxs)(Du.a,{component:"div",sx:Ku.container__buttons,children:[Object(n.jsx)(Pu.a,{name:"codigo",sx:"codigo"===m?Ku.container__buttons_active:Ku.container__buttons_inactive,startIcon:Object(n.jsx)(Fu.a,{}),onClick:z,children:I("verify:verify-file.code")}),Object(n.jsx)(Pu.a,{name:"metadata",sx:"metadata"===m?Ku.container__buttons_active:Ku.container__buttons_inactive,startIcon:Object(n.jsx)(Uu.a,{}),onClick:z,children:"Metadata"}),Object(n.jsx)(Pu.a,{name:"proof",sx:"proof"===m?Ku.container__buttons_active:Ku.container__buttons_inactive,startIcon:Object(n.jsx)(Wu.a,{}),onClick:z,children:"Proof"}),Object(n.jsx)(Pu.a,{name:"chainpoint",sx:"chainpoint"===m?Ku.container__buttons_active:Ku.container__buttons_inactive,startIcon:Object(n.jsx)(Yu.a,{}),onClick:z,children:"Chainpoint"}),Object(n.jsx)(Pu.a,{name:"pdf",sx:"pdf"===m?Ku.container__buttons_active:Ku.container__buttons_inactive,startIcon:Object(n.jsx)(qu.a,{}),onClick:z,children:"PDF"})]})}),0===c?Object(n.jsx)(Du.a,{component:"div",sx:Ku.container__code,children:Object(n.jsxs)("form",{className:t.root,onSubmit:function(e){return P(e)},children:[Object(n.jsx)(Ru.a,{required:!0,fullWidth:!0,color:"primary",variant:"outlined",placeholder:I("verify:verify-file.placeholder"),onChange:function(e){C(e.target.value)},sx:Ku.textField}),Object(n.jsx)(Pu.a,{type:"submit",color:"primary",variant:"contained",sx:Ku.button,disableElevation:!0,children:I("verify:blockchain.verify")})]})}):Object(n.jsx)(Du.a,{component:"div",sx:Ku.container__code,children:Object(n.jsx)(Yc.a,{filesLimit:1,maxFileSize:1e7,acceptedFiles:f.acceptedFiles,dropzoneText:Object(n.jsx)(zu.a,{sx:Ku.text,children:I("verify:verify-file.dropzoneText")}),dropzoneClass:t.dropzone,dropzoneParagraphClass:Ku.dropzoneParagraph,showFileNames:!0,showAlerts:!1,onChange:function(e){return function(e){if(e.length>0){var t=new FormData;t.append("file",e[0]),v(!0),ct()({method:"post",url:"".concat(je.a.apiURL,"/blockchain/verify/v2/").concat(m),headers:{"Content-Type":"multipart/form-data"},data:t}).then((function(e){var t=e.data;v(!1);var a=t.isVerified,n=t.badgeIssuedId,i=t.carnetIssuedId,r=t.certificateIssuedId,c=t.documentIssuedId;a?(n&&T.push("/certificates/verify/".concat(m,"/").concat(Object(Ie.b)(n))),r&&("pdf"===m?T.push("/verified-certificate/certificate/".concat(Object(Ie.b)(r))):T.push("/verified-certificate/".concat(m,"/").concat(Object(Ie.b)(r)))),c&&T.push("/verified-documents/".concat(m,"/").concat(Object(Ie.b)(c))),i&&("pdf"===m?T.push("/verified-carnet/carnet/".concat(Object(Ie.b)(r))):T.push("/verified-carnet/".concat(m,"/").concat(Object(Ie.b)(i))))):(v(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:I("verify:verify-file.credential-no-valid"),showConfirmButton:!1}))})).catch((function(e){v(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:I("verify:verify-file.message-error"),showConfirmButton:!1})}))}}(e)}})}),Object(n.jsx)(Du.a,{component:"div",sx:Ku.container__footer,children:Object(n.jsxs)(zu.a,{sx:Ku.text_footer,children:[I("verify:verify-file.footer")," ",Object(n.jsx)("a",{href:"".concat(window.location.origin===je.a.certikaURL?"https://certika.co/wp-content/uploads/2023/08/Terminos-y-Condiciones-Acuerdos-de-niveles.pdf":""),target:"_blank",rel:"noreferrer",style:{color:E.a.primary},children:I("verify:verify-file.terms")})," ",I("verify:verify-file.learn-about")," ",Object(n.jsx)("a",{href:"".concat(window.location.origin===je.a.certikaURL?"https://certika.co/que-es-la-tecnologia-blockchain":""),target:"_blank",rel:"noreferrer",style:{color:E.a.primary},children:"blockchain."})]})}),Object(n.jsx)(Mu.a,{position:"fixed",color:"primary",sx:{top:"auto",bottom:0,backgroundColor:"#fff",display:{xs:"flex",sm:"none"}},children:Object(n.jsxs)(Lu.a,{sx:{justifyContent:"space-between"},children:[Object(n.jsx)(Du.a,{component:"div",sx:Ku.container_button_centered,children:Object(n.jsxs)(Pu.a,{name:"codigo",sx:"codigo"===m?Ku.container__buttons_active_mobile:Ku.container__buttons_inactive_mobile,onClick:z,children:[Object(n.jsx)(Fu.a,{}),I("verify:verify-file.code")]})}),Object(n.jsxs)(Pu.a,{name:"metadata",sx:"metadata"===m?Ku.container__buttons_active_mobile:Ku.container__buttons_inactive_mobile,onClick:z,children:[Object(n.jsx)(Uu.a,{}),"Metadata"]}),Object(n.jsxs)(Pu.a,{name:"proof",sx:"proof"===m?Ku.container__buttons_active_mobile:Ku.container__buttons_inactive_mobile,onClick:z,children:[Object(n.jsx)(Wu.a,{}),"Proof"]}),Object(n.jsxs)(Pu.a,{name:"chainpoint",sx:"chainpoint"===m?Ku.container__buttons_active_mobile:Ku.container__buttons_inactive_mobile,onClick:z,children:[Object(n.jsx)(Yu.a,{}),"Chainpoint"]}),Object(n.jsxs)(Pu.a,{name:"pdf",sx:"pdf"===m?Ku.container__buttons_active_mobile:Ku.container__buttons_inactive_mobile,onClick:z,children:[Object(n.jsx)(qu.a,{}),"PDF"]})]})}),Object(n.jsx)(_t,{loading:O})]})},Qu=Object(C.a)((function(e){var t,a;return{root:{backgroundImage:"url(".concat(null===(t=JSON.parse(window.localStorage.state))||void 0===t||null===(a=t.styles)||void 0===a?void 0:a.bg_Error,")")},texto:{marginTop:"3em",width:"-webkit-fill-available"},toolbar:Object(b.a)({backgroundColor:E.a.primary,padding:"10%"},e.breakpoints.up("sm"),{backgroundColor:E.a.primary,padding:"3%"}),footer:Object(b.a)({backgroundColor:E.a.primary,padding:"7%"},e.breakpoints.up("sm"),{backgroundColor:E.a.primary,padding:"5%"})}}));var Ju=function(){var e=Qu(),t=Object(u.g)(),a=Object(i.useState)(!1),r=Object(d.a)(a,2),c=r[0],o=r[1],s=Object(i.useState)({}),l=Object(d.a)(s,2),m=l[0],b=l[1];Object(i.useEffect)((function(){var e,t=null===(e=JSON.parse(window.localStorage.state))||void 0===e?void 0:e.styles;b({texto:t.error500_texto,page500:t.error500_pj}),setTimeout((function(){o(!0)}),2e3),setTimeout((function(){p()}),5e3)}),[]);var p=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(!1),t.push("/"),window.location.reload();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(_t,{loading:c}),Object(n.jsx)("div",{className:e.toolbar}),Object(n.jsxs)(ye.a,{container:!0,className:e.root,justify:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)("img",{src:null===m||void 0===m?void 0:m.texto,alt:"500 ERROR",className:e.texto})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:6,children:Object(n.jsx)("img",{src:null===m||void 0===m?void 0:m.page500,style:{width:"-webkit-fill-available"},alt:"500 NOT FOUND"})})]}),Object(n.jsx)("div",{className:e.footer})]})},Xu=Object(C.a)((function(e){var t,a;return{root:Object(b.a)({backgroundColor:"white"},e.breakpoints.up("lg"),{backgroundColor:"aliceblue",backgroundImage:"url(".concat(null===(t=JSON.parse(window.localStorage.state))||void 0===t||null===(a=t.styles)||void 0===a?void 0:a.bg_Error,")")}),text:Object(b.a)({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",fontSize:"2em",marginTop:"50%",color:E.a.primary,textAlign:"center","& img":{maxWidth:300}},e.breakpoints.up("lg"),{flexDirection:"column",alignItems:"center",marginTop:"0",marginBottom:"40%","& img":{maxWidth:500}}),button:{margin:"1em 5em 1em 5em",color:"white",backgroundColor:E.a.primary,borderRadius:10,textTransform:"none",fontWeight:"bold","&:hover":{backgroundColor:E.a.secondary}},person:Object(b.a)({display:"none",width:"-webkit-fill-available"},e.breakpoints.up("lg"),{display:"inline-block"})}}));var Zu=function(e){var t=Xu(),a=Object(D.a)(["buttons","error404"]),r=Object(d.a)(a,1)[0],c=Object(i.useState)({}),o=Object(d.a)(c,2),s=o[0],l=o[1];return Object(i.useEffect)((function(){var e,t=null===(e=JSON.parse(window.localStorage.state))||void 0===e?void 0:e.styles;l({logo:t.logo435x149,person:t.error404_pj})}),[]),Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(ye.a,{container:!0,direction:"row",justify:"space-between",alignItems:"flex-end",className:t.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:0,lg:5,children:Object(n.jsx)("img",{className:t.person,src:null===s||void 0===s?void 0:s.person,alt:"404 NOT FOUND"})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:7,children:Object(n.jsxs)("div",{className:t.text,children:[Object(n.jsx)("p",{children:r("error404:error404.textMesage")}),Object(n.jsx)("img",{src:null===s||void 0===s?void 0:s.logo,alt:"404 NOT FOUND"}),Object(n.jsx)(x.a,{variant:"outlined",component:"span",className:t.button,onClick:function(t){e.history.push("/")},children:r("buttons:buttons.go-login")})]})})]})})};var $u=function(){var e=Object(u.g)();return Object(i.useEffect)((function(){e.push("/404"),window.location.reload()}),[]),Object(n.jsx)(n.Fragment,{})};var em=function(){var e=Object(u.g)();return Object(i.useEffect)((function(){Ce.a.post("user/createUrlPerfil").then((function(){e.push("/")})).catch((function(t){e.push("/500")}))})),Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(_t,{loading:!0})})},tm=a(1267),am=a(235),nm=a.n(am),im=a(236),rm=a.n(im),cm=a(237),om=a.n(cm),sm=a(238),lm=a.n(sm),dm=a(232),um=a.n(dm),mm=a(233),bm=a.n(mm),pm=a(234),jm=a.n(pm),fm=a(258),hm=a.n(fm),gm=a(259),xm=a.n(gm),Om=a(231),vm=a.n(Om),_m=a(569),ym=a.n(_m),wm=a(570),Cm=a.n(wm),km="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAhJJREFUaEPtWNtNA0EMdCoBKgEqASoBKiFUAlQCVAIadJZGq314d6JDkbw/iZLz2uMZP5KDnfk5nHn8lgD+m8FkIBkQM5ASEhMomycDcgrFC5IBMYGyucrAJUXwJUezcIEC4N7MXsjn0cweFmKQTBQAb2Z2UzBwJUWzYKwA+Kn4uzWz94U4lk1WAbB8ELAzgfcAsdtZBfBpZl7ACBhywkEh7yqjFQDItgfshcv1gELG55GDJIBNnGtKwkf0jhUA6Dzu1INlUBEZeeCPHZShrrYCgOUDuUA2CAif+xkVc9mCXX545dkyBDELgB2XlzMzz2b2NNAQvr8zMzzLkmMfSA5Ybna2WQA1+XicLKNIMSPTrenNNdVlcxYA9/6abdjxgB1ORpfNGQA9+Xg8kIUX5lC/2/xAsNyBvjdmfE3p3jMDgLPbor5c7nozoVxFWqScDEBtdRj1+pZ+a3vU63bZxcaMJ+MkALh4R0Hz97WZUHaZGku1YVn1G5UQ9/7RpOWZUOtGDKBVoJF6+wMUAVAOnYgNS6QMMlLonDBZQiyfSGdBYnoyKecFDyqwB3/8O0MGwMU7WhFcp73VohakryNuj6B935IArMjHg2AZlUH0ljlfLXy3kgDAkbczZGnmh3vEFs9ALu7D96fwnwWRgpxpm7s/mwB2T3nhMBlIBsQMpITEBMrmyYCcQvGCZEBMoGx+9gz8AiEcfTFrULSYAAAAAElFTkSuQmCC",Nm=a(328),Bm=a.n(Nm),Sm=a(329),Tm=a.n(Sm),Am="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAtFJREFUaEPtWdttG0EMpCux04ldie1KYldiuxKnk8SVJJjD8UBRw4cO2ZUF6AD96PYxQ3LI5d6NXPhzc+H45TsQuF+N+EdE8DvpORcBgP4pIgpeQf8SkQ8Ree+yOAeBlxV8hvF1JVF6ZDaBNxF5aloXJEA2fWYSQLh8VoDc+x+VLmYRuBOR3wS8xjxCRXVhh5VemEWAxT3APzhSIAmyVtR+zMGUWQT+OqCwOMLDP14j0bht3gwCzPqwKjzgHwgcJOyT6mAGAQjX5vvMqkzoKcbRBJh4M2F6b509hFj4ZCHhNcCEPlXEp1j0VG8tREaHkLcozjjPQTFj3sLY9Fw0moAXcBT/zPpl/M/wgC9MEQFPFNhK688g4AsYA8VCp2X90QRYWPgCFh3wokJ3JJ/RGvAesMAi8OUBzrIYTcBrQEMoAp9lKZq8IgIQFTbzHRE2xq9sNNbdPAEA/Ao6srJoMQaMgM0Itmpaq3XdzLILw8FEi/2gIxALW0tPgLV8IIGFfDfVIdHpfyPLq/e06aFELAEFaRuKoGguf3dcXrWR0RqMOA13/2eXRAc8SGZNfCTYiLRixfvtDomxqkh0wLPGxHoT4BGCLEmwxl81YjW1rBFloQxAdhyOLqxYKFoSMBr2xGVXJHJt/A+6NUagilsswEhUVs/0tOfdkkQ8gQ543YyRYDEPy6GmsGuTCLiGVpRQtjDuZCEMxkJssSoJ+FTbSasq7mjsQc3wADDp0YBVpkzY0YELa9wGIoXFEWq6h78DAmF7W+EL4VECYRpQEmBqL5UsifZpsQhuva1gVyw6Na3IWRZirZyGUrbhHkHunjP6NLobWHfilUDXUqPGRR5gKdOXfT+meg8O1Zjq/dEa3Ursi1Z1g9bph6s1ADZrSRenXgmsse0LzNUDq2F2hRA79/jC5b/vso/U7BuwTUb/Y43hl7ujsue27rWQDTdxscHFe+Af7uzYcavD8kwAAAAASUVORK5CYII=",Em=a(330),Im=a.n(Em),Dm=a(200),zm=a.n(Dm),Pm=a(568),Rm=a.n(Pm);var Mm=Object(C.a)((function(e){return{container:function(e){return{marginTop:32,backgroundImage:"url(".concat(e.imageRoute,")"),backgroundRepeat:"no-repeat",width:"fit-content",maxWidth:"68vw"}},mySwal:{zIndex:3e3},pagination:{marginTop:"3px",position:"absolute"}}})),Lm={setDocumentsFields:I.u,setFormDocuments:I.y},Fm=Object(s.b)((function(e){return{documentsFields:e.documentsFields||[],imageRoute:e.formDocuments.img_prev&&e.formDocuments.img_prev[e.formDocuments.page-1],width:e.formDocuments.naturalWidthAndHeight&&e.formDocuments.naturalWidthAndHeight[e.formDocuments.page-1].width,height:e.formDocuments.naturalWidthAndHeight&&e.formDocuments.naturalWidthAndHeight[e.formDocuments.page-1].height,formDocuments:e.formDocuments}}),Lm)((function(e){var t=e.imageRoute,a=e.width,r=e.height,c=e.modifyField,o=e.documentsFields,s=e.setDocumentsFields,l=e.setFormDocuments,u=e.formDocuments,b=e.stageRef,p=e.selectedId,j=e.selectShape,f=e.handleChangePage,h=e.isSelected,g=e.setIsSelected,x=e.refField,O=e.setRefField,v=e.modifiedFieldIndex,_=e.setModifiedFieldIndex,y=e.documentSigned,w=e.changeViewFields,C=Mm({imageRoute:t}),k=Object(i.useRef)(),N=Object(i.useRef)([]);N.current=[];var B=Object(D.a)(["alerts"]),S=Object(d.a)(B,1)[0],T=Object(i.useState)(!0),A=Object(d.a)(T,2),I=A[0],z=A[1],P=Object(i.useState)([]),R=Object(d.a)(P,2),M=R[0],L=R[1],U=function(e){u.change_template&&0!==u.change_template&&(F.a.fire({icon:"info",iconColor:E.a.primary,text:S("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:S("buttons:buttons.accept"),cancelButtonText:S("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:C.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.isConfirmed?(l(Object(m.a)(Object(m.a)({},u),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})),z(!0)):z(!0)})),z(!1))};Object(i.useEffect)((function(){var e;h&&((null===M||void 0===M?void 0:M.index)||(null===x||void 0===x||null===(e=x.ref)||void 0===e?void 0:e.index))?(k.current.setNode(M||(null===x||void 0===x?void 0:x.ref)),k.current.getLayer().batchDraw(),(null===x||void 0===x?void 0:x.ref)&&("auto"===o[x.index].width&&(o[x.index]=Object(m.a)(Object(m.a)({},o[x.index]),{},{width:parseInt(x.ref.getWidth())+5})),L(null===x||void 0===x?void 0:x.ref),s(o),O(null))):h&&N&&(k.current.setNode(N.current[N.current.length-1].el),k.current.getLayer().batchDraw())}),[h]),Object(i.useEffect)((function(){if(null===x||void 0===x?void 0:x.index)o[x.index]&&"auto"===o[x.index].width&&(o[x.index]=Object(m.a)(Object(m.a)({},o[x.index]),{},{width:parseInt(x.ref.getWidth())+5})),O(null),s(o);else if(null!==v){var e=N.current.findIndex((function(e){return e.index===v}));if(o[v]&&"auto"===o[v].width){var t=parseInt(N.current[e].el.getWidth()+5);o[v]=Object(m.a)(Object(m.a)({},o[v]),{},{width:t})}52===o[v].fieldTypeConfig&&(k.current.setNode(N.current[e].el),k.current.getLayer().batchDraw()),_(null),s(o)}}),[o]);var W=function(){var e=No()(t,"Anonymous"),a=Object(d.a)(e,1)[0];return Object(n.jsx)(Co.b,{image:a})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("div",{className:C.pagination,children:Object(n.jsx)(Lt.a,{component:"span",display:"flex",justifyContent:"center",children:Object(n.jsx)(ta.a,{color:"secondary",count:(null===u||void 0===u?void 0:u.pages)||0,onChange:f,defaultPage:1,size:"small"})})}),Object(n.jsx)("div",{className:C.container,children:Object(n.jsx)(Co.f,{width:a,height:r,ref:b,onMouseDown:function(e){e.target.attrs.image&&(j(null),g(!1),L(null))},onMouseLeave:function(){o[o.length-1]&&"auto"===o[o.length-1].width&&(o[o.length-1]=Object(m.a)(Object(m.a)({},o[o.length-1]),{},{width:parseInt(N.current[N.current.length-1].el.getWidth())+5,align:"left"}),s(o)),j(null),g(!1),L(null)},children:Object(n.jsxs)(Co.c,{children:[Object(n.jsx)(W,{}),null===o||void 0===o?void 0:o.map((function(e,t){var i,l,d,b,f;return 48!==e.fieldType?(e.page===(null===u||void 0===u?void 0:u.page)||0===e.page)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Co.g,{ref:function(e){return function(e,t){e&&!N.current.includes({el:e,index:t})&&N.current.push({el:e,index:t})}(e,t)},index:t,text:"certificateCode"===e.fieldName?"".concat(e.exampleText).concat(""===e.exampleText?"":":","CK09aABbAz"):e.exampleText,x:e.x,y:e.y,width:e.width,height:parseInt(e.fontSize),align:e.align,ellipsis:!0,onClick:function(t){w(0,!0),y||(52===e.fieldTypeConfig?(g(!1),L(t.target),j(e.exampleText),g("X"!==e.exampleText&&"+"!==e.exampleText&&!0)):g(!1))},draggable:!y&&(!("X"===e.exampleText||"+"===e.exampleText)&&I),dragBoundFunc:function(t,n){var i=t.x,c=t.y;return i<0&&(i=0),c<0&&(c=0),i>a-e.width&&(i=a-e.width),c>r-e.height&&(c=r-e.height),{x:i,y:c}},fill:null===(i=e.fontColor)||void 0===i?void 0:i.hex,fontStyle:"".concat((null===(l=e.fontStyle)||void 0===l?void 0:l.bold)?"bold":""," ").concat((null===(d=e.fontStyle)||void 0===d?void 0:d.italic)?"italic":""),textDecoration:"".concat((null===(b=e.fontStyle)||void 0===b?void 0:b.underline)?"underline":""," ").concat((null===(f=e.fontStyle)||void 0===f?void 0:f.strikethrough)?"line-through":""),fontSize:parseInt(e.fontSize),fontFamily:e.fontFamily.family,onDragStart:function(e){return U()},onDragEnd:function(e){return function(e,t){o[t]=Object(m.a)(Object(m.a)({},o[t]),{},{x:e.target.x(),y:e.target.y()}),52===o[t].fieldTypeConfig?(g(!1),L(e.target),g(!0),s(o)):(g(!1),s(o))}(e,t)},onDblClick:function(a){y||"+"!==!e.exampleText||(c(t),O({ref:a.target,index:t}))},onTransformEnd:function(a){var n=M,i=n.scaleX();n.scaleX(1),n.scaleY(1),n.width(Math.max(5,n.width()*i)),function(e,t){var a=o.slice();a[t]=e,s(a)}(Object(m.a)(Object(m.a)({},e),{},{width:Math.round(n.width())}),t)}},"field".concat(t+1)),h&&Object(n.jsx)(Co.h,{ref:k,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){if(t.width<=10)return e;var n=a;return t.width>=n?e:t}})]}):"buttonVerify"===e.fieldName?(e.page===(null===u||void 0===u?void 0:u.page)||0===e.page)&&Object(n.jsx)(zo,{index:t,shapeProps:e,isSelected:e.exampleText===p,isDraggable:!y&&I,handleOnDragStart:U,onSelect:function(){w(2,!0),y||(g(!1),L(null),j(e.exampleText))},onChange:function(e){var a=o.slice();a[t]=e,s(a)},layoutWidth:a,layoutHeight:r,modifyField:y?function(){}:c},t):e.fieldName.includes("signature")?(e.page===(null===u||void 0===u?void 0:u.page)||0===e.page)&&Object(n.jsx)(Do,{shapeProps:e,isSelected:e.fieldName===p,onSelect:function(){w(3,!0),!y&&j(e.fieldName)},isDraggable:!y&&I,handleOnDragStart:U,onChange:function(e){var a=o.slice();a[t]=e,a[t].transform&&a.push(Object(m.a)(Object(m.a)({},a[t]),{},{fieldType:41,fieldTypeConfig:52,fontSize:"18",fieldName:"deleteSign",exampleText:"X",x:a[t].x+20,y:a[t].y-20,width:23,height:32,fontStyle:{bold:1}})),a[t].transform&&a.push(Object(m.a)(Object(m.a)({},a[t]),{},{fieldType:41,fieldTypeConfig:52,fontSize:"18",fieldName:"addSign",exampleText:"+",x:a[t].x+5,y:a[t].y-20,width:23,height:32,fontStyle:{bold:1}})),s(a)},layoutWidth:a,layoutHeight:r,documentsFields:o,setDocumentsFields:s},t):(e.page===(null===u||void 0===u?void 0:u.page)||0===e.page)&&Object(n.jsx)(Do,{shapeProps:e,isSelected:e.exampleText===p,onSelect:function(){w(1,!0),!y&&j(e.exampleText)},isDraggable:!y&&I,handleOnDragStart:U,onChange:function(e){var a=o.slice();a[t]=e,s(a)},layoutWidth:a,layoutHeight:r},t)}))]})})})]})})),Um=a(1220),Wm=a(327),Ym=a.n(Wm),qm=a(230),Hm=a.n(qm);var Km=Object(C.a)((function(){return{container:{minHeight:"70vh"},container__header:{display:"flex",justifyContent:"flex-start",alignItems:"center",paddingTop:8,paddingBottom:8,"& h6":{marginLeft:10,fontWeight:"bold",color:"#888"}},my_signature:{display:"flex",alignItems:"center",cursor:"pointer","&:hover":{backgroundColor:"gainsboro"}},mySwal:{zIndex:3e3}}})),Vm={setDocumentsFields:I.u,setFormDocuments:I.y},Gm=Object(s.b)((function(e){return{documentsFields:e.documentsFields||[],formDocuments:e.formDocuments}}),Vm)((function(e){var t=e.documentsFields,a=e.setDocumentsFields,i=e.modifyField,r=e.openModal,c=e.openModalSign,o=e.setFormDocuments,s=e.formDocuments,l=e.signatures,u=e.setSignatures,b=e.typeViewFields,j=Km(),g=[{fieldType:48,fieldName:"qr"},{fieldType:48,fieldName:"logo"},{fieldType:41,fieldName:"certificateCode"},{fieldType:48,fieldName:"buttonVerify"},{fieldType:48,fieldName:"signature"}],x=Object(D.a)(["alerts","certificateBadgeTemplate","buttons"]),O=Object(d.a)(x,1)[0],v=function(e){s.change_template&&0!==s.change_template?F.a.fire({icon:"info",iconColor:E.a.primary,text:O("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:O("buttons:buttons.accept"),cancelButtonText:O("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:j.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(n){n.isConfirmed&&(t.splice(e,1),a(Object(p.a)(t)),o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):(t.splice(e,1),a(Object(p.a)(t)))},_=function(e,n){if(s.change_template&&0!==s.change_template)F.a.fire({icon:"info",iconColor:E.a.primary,text:O("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:O("buttons:buttons.accept"),cancelButtonText:O("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:j.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(i){if(i.isConfirmed){if(n)a(Object(p.a)(t.filter((function(t){return t.fieldName!==e}))));else{var r=t.findIndex((function(t){return t.fieldName===e&&(t.page===(null===s||void 0===s?void 0:s.page)||0===t.page)}));a(Object(p.a)(t.filter((function(e,t){return t!==r}))))}o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""}))}}));else if(n)a(Object(p.a)(t.filter((function(t){return t.fieldName!==e}))));else{var i=t.findIndex((function(t){return t.fieldName===e&&(t.page===(null===s||void 0===s?void 0:s.page)||0===t.page)}));a(Object(p.a)(t.filter((function(e,t){return t!==i}))))}},w=function(e){var n=so(),i=n.dataQr,r=n.dataImg,c=n.dataCode,l=n.dataButtonVerify;0===e?t.push(Object(m.a)(Object(m.a)({},i),{},{page:null===s||void 0===s?void 0:s.page})):1===e?t.push(Object(m.a)(Object(m.a)({},r),{},{page:null===s||void 0===s?void 0:s.page})):-1===e?(e=2,t.push(Object(m.a)(Object(m.a)({},c),{},{page:null===s||void 0===s?void 0:s.page,fieldTypeConfig:51}))):-3===e&&t.push(Object(m.a)(Object(m.a)({},l),{},{page:null===s||void 0===s?void 0:s.page})),s.change_template&&0!==s.change_template?F.a.fire({icon:"info",iconColor:E.a.primary,text:O("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:O("buttons:buttons.accept"),cancelButtonText:O("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:j.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.isConfirmed&&(a(Object(p.a)(t)),o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):a(Object(p.a)(t))},C=function(e){t.push(Object(m.a)(Object(m.a)({},t[e]),{},{page:null===s||void 0===s?void 0:s.page})),a(Object(p.a)(t))},k=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.post("user/validCanSign");case 3:if(!e.sent.data.message){e.next=8;break}return e.abrupt("return",!1);case 8:return e.abrupt("return",!0);case 9:e.next=14;break;case 11:return e.prev=11,e.t0=e.catch(0),e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:O("alerts:alerts.try-again"),confirmButtonText:O("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:j.mySwal,confirmButton:"custom-button-confirm"}}));case 14:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=Object(h.a)(f.a.mark((function e(n){var i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=so(),r=i.dataSignature,c=t.filter((function(e){return e.fieldName.includes("signature")})),e.next=4,k();case 4:if(!e.sent){e.next=6;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:"Detectamos que tu informaci\xf3n se encuentra desactualizada, por favor, actualiza tus datos",confirmButtonText:"Actualizar datos",cancelButtonText:"Cancelar",buttonsStyling:!1,showCancelButton:!0,customClass:{container:j.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.isConfirmed&&window.open("/profileSettings","_blank")})));case 6:s.change_template&&0!==s.change_template?F.a.fire({icon:"info",iconColor:E.a.primary,text:O("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:O("buttons:buttons.accept"),cancelButtonText:O("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:j.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.isConfirmed&&(t.push(Object(m.a)(Object(m.a)(Object(m.a)({},r),n),{},{fieldName:c?"".concat(r.fieldName.split("_")[0],"_").concat(c.length+1):r.fieldName,page:null===s||void 0===s?void 0:s.page,exampleText:n.url,idSignature:n.id})),a(Object(p.a)(t)),o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):(t.push(Object(m.a)(Object(m.a)(Object(m.a)({},r),n),{},{correo:n.id&&n.correo?"":n.correo,fieldName:c?"".concat(r.fieldName.split("_")[0],"_").concat(c.length+1):r.fieldName,page:null===s||void 0===s?void 0:s.page,exampleText:n.url,idSignature:n.id})),a(Object(p.a)(t)));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),B=function(){var e,a=null===(e=t.find((function(e){return"certificateCode"===e.fieldName&&e.page===(null===s||void 0===s?void 0:s.page)})))||void 0===e?void 0:e.exampleText;return void 0===a?"C\xf3digo:CK09aABbAz":"".concat(a).concat(""===a?"":":","CK09aABbAz")},T=function(e){return(null===t||void 0===t?void 0:t.find((function(t){return t.fieldName===e&&(t.page===(null===s||void 0===s?void 0:s.page)||0===t.page)})))?"delete":"add"},A=function(e){return t.filter((function(t){return t.fieldName===e}))},I=function(e){if(s.change_template&&0!==s.change_template)F.a.fire({icon:"info",iconColor:E.a.primary,text:O("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:O("buttons:buttons.accept"),cancelButtonText:O("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:j.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(n){if(n.isConfirmed){var i=t.findIndex((function(t){return t.fieldName===e&&(t.page===(null===s||void 0===s?void 0:s.page)||0===t.page)}));0===t[i].page?t[i].page=null===s||void 0===s?void 0:s.page:t[i].page=0,a(Object(p.a)(t)),o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""}))}}));else{var n=t.findIndex((function(t){return t.fieldName===e&&(t.page===(null===s||void 0===s?void 0:s.page)||0===t.page)}));0===t[n].page?t[n].page=null===s||void 0===s?void 0:s.page:t[n].page=0,a(Object(p.a)(t))}},z=function(e){s.change_template&&0!==s.change_template?F.a.fire({icon:"info",iconColor:E.a.primary,text:O("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:O("buttons:buttons.accept"),cancelButtonText:O("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:j.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(n){n.isConfirmed&&(0===t[e].page?t[e].page=null===s||void 0===s?void 0:s.page:t[e].page=0,a(Object(p.a)(t)),o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):(0===t[e].page?t[e].page=null===s||void 0===s?void 0:s.page:t[e].page=0,a(Object(p.a)(t)))};return Object(n.jsx)(n.Fragment,{children:Object(n.jsx)("div",{className:j.container,children:Object(n.jsx)("div",{className:j.container__fields,children:function(e){switch(e){case 0:return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("div",{className:j.container__header,children:[Object(n.jsx)("h6",{children:O("certificateBadgeTemplate:certificate-design.texts")}),Object(n.jsx)(K.a,{title:O("tables:table.tooltip.add"),children:Object(n.jsx)(S.a,{onClick:r,children:Object(n.jsx)(Hm.a,{})})})]}),Object(n.jsx)(Yo,{index:-1,exampleText:B(),fieldName:g[2].fieldName,addOrDelete:T(g[2].fieldName),addDefaultField:w,modifyField:i,deleteField:function(){return _(g[2].fieldName)},deleteForAllPages:function(){return _(g[2].fieldName,"all")},page:A(g[2].fieldName),multyField:function(){return I(g[2].fieldName)},multyPages:(null===s||void 0===s?void 0:s.pages)>1},"field".concat(2)),null===t||void 0===t?void 0:t.map((function(e,t){if(48!==e.fieldType&&"certificateCode"!==e.fieldName&&"deleteSign"!==e.fieldName&&"addSign"!==e.fieldName)return Object(n.jsx)(Yo,{index:t,exampleText:e.exampleText,fieldName:e.fieldName,addField:C,modifyField:i,deleteField:v,type:0,addOrDelete:e.page===(null===s||void 0===s?void 0:s.page)||0===e.page?"delete":"add",page:null===e||void 0===e?void 0:e.page,multyField:z,multyPages:(null===s||void 0===s?void 0:s.pages)>1},"field".concat(t))}))]});case 1:return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("div",{className:j.container__header,children:Object(n.jsx)("h6",{children:O("certificateBadgeTemplate:certificate-design.images")})}),null===g||void 0===g?void 0:g.map((function(e,t){if(48===e.fieldType&&3!==t&&4!==t)return Object(n.jsx)(Yo,{index:t,exampleText:"",fieldName:e.fieldName,addOrDelete:T(e.fieldName),addDefaultField:w,deleteField:function(){return _(e.fieldName)},deleteForAllPages:function(){return _(e.fieldName,"all")},page:A(e.fieldName),multyField:function(){return I(e.fieldName)},multyPages:(null===s||void 0===s?void 0:s.pages)>1},"field".concat(t))}))]});case 2:return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("div",{className:j.container__header,children:Object(n.jsx)("h6",{children:O("certificateBadgeTemplate:certificate-design.buttons")})}),Object(n.jsx)(Yo,{index:-3,exampleText:O("certificateBadgeTemplate:certificate-design.button-verify"),fieldName:g[3].fieldName,modifyField:i,addOrDelete:T(g[3].fieldName),addDefaultField:w,deleteField:function(){return _(g[3].fieldName)},deleteForAllPages:function(){return _(g[3].fieldName,"all")},page:A(g[3].fieldName),multyField:function(){return I(g[3].fieldName)},multyPages:(null===s||void 0===s?void 0:s.pages)>1},"field".concat(3))]});case 3:return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("div",{className:j.container__header,children:[Object(n.jsx)("h6",{children:O("certificateBadgeTemplate:certificate-design.signatures")}),Object(n.jsx)(K.a,{title:O("buttons:buttons.add-signature"),children:Object(n.jsx)(S.a,{onClick:c,children:Object(n.jsx)(Hm.a,{})})})]}),Object(n.jsx)(ie.a,{children:l.length>0&&Object(n.jsx)(n.Fragment,{children:l.map((function(e){return Object(n.jsx)(ie.a,{children:Object(n.jsxs)(y.a,{button:!0,onClick:function(){return N(e)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)("img",{src:e.url,alt:"sign",width:200})}),Object(n.jsx)(Um.a,{children:Object(n.jsx)(K.a,{title:O("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(){return n=e.id,i=e.url,void F.a.fire({icon:"info",iconColor:E.a.primary,text:O("alerts:alerts.delete-signature"),showCancelButton:!0,showLoaderOnConfirm:!0,confirmButtonText:O("buttons:buttons.accept"),cancelButtonText:O("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:j.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"},preConfirm:function(){return n?Ce.a.delete("/signature/".concat(n)).then((function(){a(Object(p.a)(t.filter((function(e){return e.exampleText!==i})))),u(Object(p.a)(l.filter((function(e){return e.url!==i}))))})).catch((function(){F.a.showValidationMessage(O("alerts:alerts.try-again"))})):(a(Object(p.a)(t.filter((function(e){return e.exampleText!==i})))),u(Object(p.a)(l.filter((function(e){return e.url!==i})))))},allowOutsideClick:function(){return!F.a.isLoading()}});var n,i},children:Object(n.jsx)(Ym.a,{})})})})]})})}))})})]})}}(b)})})})})),Qm=function(e){for(var t=atob(e.split(",")[1]),a=[],n=0;n<t.length;n++)a.push(t.charCodeAt(n));return new Blob([new Uint8Array(a)],{type:"image/png"})},Jm=a(1221),Xm=a(1222),Zm=a(1223),$m=Object(xe.a)((function(e){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:e.palette.grey["light"===e.palette.type?200:700]},bar:{borderRadius:5,backgroundColor:e.palette.primary}}}))(Oe.a),eb=Object(C.a)((function(){return{container__button_fields:{display:"flex",justifyContent:"space-evenly",marginTop:20},button:{margin:"0.5em",padding:"9px 40px"}}})),tb=function(e){var t=e.closeModalSign,a=e.saveSign,i=e.progressBar,c=e.emailUser,o=r.a.useState([]),s=Object(d.a)(o,2),l=s[0],u=s[1],m=r.a.useState([]),b=Object(d.a)(m,2),j=b[0],g=b[1],O=r.a.useState("#000"),v=Object(d.a)(O,2),_=v[0],y=v[1],w=r.a.useState(!0),C=Object(d.a)(w,2),k=C[0],N=C[1],B=r.a.useRef(!1),T=r.a.useRef(null),A=eb(),E=Object(D.a)(["buttons","certifyDocuments"]),I=Object(d.a)(E,1)[0],z=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N(!1);case 2:a(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(ye.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"flex-end",children:[Object(n.jsx)(ye.a,{item:!0,xs:6,style:{textAlign:"left"},children:Object(n.jsx)(wo,{color:_,changeColor:function(e){y(e.hex)}})}),Object(n.jsxs)(ye.a,{item:!0,xs:6,style:{textAlign:"right"},children:[Object(n.jsx)(S.a,{onClick:function(){0!==l.length&&(g([].concat(Object(p.a)(j),[l[l.length-1]])),u(l.slice(0,l.length-1)))},disabled:0===l.length,children:Object(n.jsx)(Jm.a,{size:"small"})}),Object(n.jsx)(S.a,{onClick:function(){j.length>0&&(u([].concat(Object(p.a)(l),[j[j.length-1]])),g(j.slice(0,j.length-1)))},disabled:j.length<1,children:Object(n.jsx)(Xm.a,{size:"small"})}),Object(n.jsx)(S.a,{onClick:function(){return u([]),void g([])},disabled:0===l.length,children:Object(n.jsx)(Zm.a,{size:"small"})})]})]}),!i.value&&Object(n.jsx)("div",{style:{backgroundColor:"#f0f0f0",margin:"1em",borderRadius:"1em",cursor:"crosshair"},children:Object(n.jsx)(Co.f,{width:520,height:150,onMouseDown:function(e){B.current=!0;var t=e.target.getStage().getPointerPosition();u([].concat(Object(p.a)(l),[{points:[t.x,t.y],strokeWidth:3,stroke:_}]))},onMousemove:function(e){if(B.current){var t=e.target.getStage().getPointerPosition(),a=l[l.length-1];a.points=a.points.concat([parseInt(t.x),parseInt(t.y)]),l.splice(l.length-1,1,a),u(l.concat())}},onMouseup:function(){B.current=!1},ref:T,children:Object(n.jsxs)(Co.c,{children:[Object(n.jsx)(Co.g,{text:I("certifyDocuments:document.stamp"),fontSize:14,fontStyle:"italic",width:510,x:1,y:2,align:"right"}),Object(n.jsx)(Co.g,{text:I("certifyDocuments:add-signatories.signatory"),x:1,y:10,width:520,fontSize:20,align:"center"}),Object(n.jsx)(Co.g,{text:c,x:1,y:30,width:520,fontSize:20,align:"center"}),k&&Object(n.jsx)(Co.g,{text:I("certifyDocuments:document.draw-here"),width:520,x:1,y:85,align:"center"}),l.map((function(e,t){return Object(n.jsx)(Co.d,{points:e.points,stroke:e.stroke,strokeWidth:e.strokeWidth,tension:.5,lineCap:"round",lineJoin:"round",globalCompositeOperation:"eraser"===e.tool?"destination-out":"source-over"},t)}))]})})}),i.value&&Object(n.jsx)("div",{style:{margin:"1em",width:520},children:Object(n.jsxs)(Lt.a,{display:"flex",alignItems:"center",children:[Object(n.jsx)(Lt.a,{width:"100%",mr:1,children:Object(n.jsx)($m,{variant:"determinate",value:i.value})}),Object(n.jsx)(Lt.a,{minWidth:35,children:Object(n.jsx)(we.a,{variant:"body2",color:"textSecondary",children:"".concat(Math.round(i.value),"%")})})]})}),Object(n.jsx)(ye.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"flex-end",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:A.container__button_fields,children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:A.button,onClick:function(){return z(T)},disabled:l.length<1,children:I("buttons:buttons.save")})," ",Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:A.button,onClick:function(){return t()},children:I("buttons:buttons.cancel")})]})})]})},ab=a(632),nb=Object(xe.a)((function(e){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:e.palette.grey["light"===e.palette.type?200:700]},bar:{borderRadius:5,backgroundColor:e.palette.primary}}}))(Oe.a),ib=Object(C.a)((function(){return{container__button_fields:{display:"flex",justifyContent:"space-evenly",marginTop:20},button:{margin:"0.5em",padding:"9px 40px"},textArea:{backgroundColor:"#f0f0f0",border:"none",height:"80px",marginTop:"1em",marginLeft:"0.2em",resize:"none",textAlign:"center",fontSize:"50px",overflow:"hidden","&:focus":{outline:"0px"}}}})),rb=function(e){var t=e.closeModalSign,a=e.saveSign,i=e.progressBar,c=e.nameUser,o=e.emailUser,s=e.fontsFamilys,l=e.responsiveWidth,u=void 0!==l&&l,b=r.a.useState(!1),p=Object(d.a)(b,2),j=p[0],g=p[1],O=r.a.useState(!1),v=Object(d.a)(O,2),_=v[0],y=v[1],w=r.a.useState({text:c,color:"#000",font:"Caveat",fontSize:"50"}),C=Object(d.a)(w,2),k=C[0],N=C[1],B=r.a.useRef(null),S=ib(),A=Object(D.a)(["buttons","certificateBadgeTemplate","certifyDocuments"]),E=Object(d.a)(A,1)[0],I=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y(!_);case 2:if(e.t0=u,!e.t0){e.next=6;break}return e.next=6,g(!0);case 6:a(t);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(ye.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"flex-end",children:[Object(n.jsx)(ye.a,{item:!0,xs:6,style:{textAlign:"left"},children:Object(n.jsx)(wo,{color:null===k||void 0===k?void 0:k.color,changeColor:function(e){N(Object(m.a)(Object(m.a)({},k),{},{color:e.hex}))}})}),Object(n.jsx)(ye.a,{item:!0,xs:6,style:{textAlign:"right",marginTop:"1em"},children:Object(n.jsxs)(T.a,{id:"style",name:"signatureTextStyle",onChange:function(e){N(Object(m.a)(Object(m.a)({},k),{},{font:e.target.value}))},value:"0",children:[Object(n.jsx)(Y.a,{value:0,style:{display:"none"},children:E("certificateBadgeTemplate:certificate-design.font")},0),s.map((function(e){return Object(n.jsx)(Y.a,{value:e,children:Object(n.jsx)(we.a,{style:{fontSize:"18px",color:null===k||void 0===k?void 0:k.color,fontFamily:e,textAlign:"center"},children:null===k||void 0===k?void 0:k.text})})}))]})})]}),!i.value&&Object(n.jsx)("div",{style:{backgroundColor:"#f0f0f0",margin:u&&!j?"1em 0 ":"1em",borderRadius:"1em"},children:Object(n.jsx)(Co.f,{width:u&&!j?u:520,height:150,ref:B,children:Object(n.jsxs)(Co.c,{children:[Object(n.jsx)(Co.g,{text:E("certifyDocuments:document.stamp"),fontSize:14,fontStyle:"italic",width:u&&!j?u-10:510,x:1,y:2,align:"right"}),Object(n.jsx)(Co.g,{text:E("certifyDocuments:add-signatories.signatory"),x:1,y:10,width:u&&!j?u:520,fontSize:20,align:"center"}),Object(n.jsx)(Co.g,{text:o,x:1,y:30,width:u&&!j?u:520,fontSize:20,align:"center"}),_&&Object(n.jsx)(Co.g,{width:u&&!j?u:518,height:81,x:1,y:68,fontSize:null===k||void 0===k?void 0:k.fontSize,fontFamily:null===k||void 0===k?void 0:k.font,fill:null===k||void 0===k?void 0:k.color,align:"center",text:null===k||void 0===k?void 0:k.text}),!_&&Object(n.jsx)(ab.a,{children:Object(n.jsx)("textarea",{value:null===k||void 0===k?void 0:k.text,onChange:function(e){N(Object(m.a)(Object(m.a)({},k),{},{text:e.target.value}))},className:S.textArea,style:{fontFamily:null===k||void 0===k?void 0:k.font,color:null===k||void 0===k?void 0:k.color,width:u&&!j?"".concat(u-10,"px"):"500px"},onKeyDown:function(e){13===e.keyCode&&e.preventDefault()}})})]})})}),i.value&&Object(n.jsx)("div",{style:{margin:"1em",width:u&&!j?u:520},children:Object(n.jsxs)(Lt.a,{display:"flex",alignItems:"center",children:[Object(n.jsx)(Lt.a,{width:"100%",mr:1,children:Object(n.jsx)(nb,{variant:"determinate",value:i.value})}),Object(n.jsx)(Lt.a,{minWidth:35,children:Object(n.jsx)(we.a,{variant:"body2",color:"textSecondary",children:"".concat(Math.round(i.value),"%")})})]})}),Object(n.jsx)(ye.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"flex-end",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:S.container__button_fields,children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:S.button,onClick:function(){return I(B)},disabled:0===(null===k||void 0===k?void 0:k.text.length),children:E("buttons:buttons.save")})," ",Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:S.button,onClick:function(){return t()},children:E("buttons:buttons.cancel")})]})})]})},cb=a(398),ob=Object(xe.a)((function(e){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:e.palette.grey["light"===e.palette.type?200:700]},bar:{borderRadius:5,backgroundColor:e.palette.primary}}}))(Oe.a),sb=Object(C.a)((function(){return{container__button_fields:{display:"flex",justifyContent:"space-evenly",marginTop:20},button:{margin:"0.5em",padding:"9px 40px"},dropzone:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",borderColor:E.a.primary,borderRadius:15,"& .MuiGrid-container":{justifyContent:"center"}},dropzoneParagraph:{color:"gray",fontSize:"1.1em"}}})),lb=function(e){var t=e.closeModalSign,a=e.saveSign,i=e.progressBar,c=e.emailUser,o=r.a.useState(null),s=Object(d.a)(o,2),l=s[0],u=s[1],m=r.a.useRef(null),b=sb(),p=Object(D.a)(["buttons","certificateBadgeTemplate"]),j=Object(d.a)(p,1)[0],f=function(){var e=No()(null===l||void 0===l?void 0:l.image,"Anonymous"),t=Object(d.a)(e,1)[0],a=r.a.useRef();return r.a.useEffect((function(){t&&a.current.cache()}),[t]),Object(n.jsx)(Co.b,{ref:a,className:b.img,image:t,width:520,height:100,y:50,filters:[cb.a.Filters.Threshold],threshold:.6})};return Object(n.jsxs)(ye.a,{container:!0,justifyContent:"center",children:[(null===l||void 0===l?void 0:l.image)&&!(null===i||void 0===i?void 0:i.value)&&Object(n.jsx)(ye.a,{item:!0,xs:12,style:{marginTop:"1em"},children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",component:"span",onClick:function(){u(null)},children:j("buttons:buttons.change-image")})}),!l&&Object(n.jsx)(ye.a,{item:!0,xs:12,style:{textAlign:"center",margin:"1em"},children:Object(n.jsx)(Yc.a,{filesLimit:1,acceptedFiles:[".png",".jpg",".jpeg"],dropzoneText:j("certificateBadgeTemplate:badges-certificate-form.signature-dropzoneArea"),dropzoneClass:b.dropzone,dropzoneParagraphClass:b.dropzoneParagraph,showFileNames:!1,showAlerts:!0,onChange:function(e){var t=e[0];t&&u({image:URL.createObjectURL(t)})}})}),(null===l||void 0===l?void 0:l.image)&&!(null===i||void 0===i?void 0:i.value)&&Object(n.jsx)("div",{style:{backgroundColor:"#f0f0f0",margin:"1em",borderRadius:"1em"},children:Object(n.jsx)(Co.f,{width:520,height:150,ref:m,style:{mixBlendMode:"multiply"},children:Object(n.jsxs)(Co.c,{children:[Object(n.jsx)(Co.g,{text:j("certifyDocuments:document.stamp"),fontSize:14,fontStyle:"italic",width:510,x:1,y:2,align:"right"}),Object(n.jsx)(Co.g,{text:j("certifyDocuments:add-signatories.signatory"),x:1,y:10,width:520,fontSize:20,align:"center"}),Object(n.jsx)(Co.g,{text:c,x:1,y:30,width:520,fontSize:20,align:"center"}),Object(n.jsx)(f,{})]})})}),i.value&&Object(n.jsx)("div",{style:{margin:"1em",width:520},children:Object(n.jsxs)(Lt.a,{display:"flex",alignItems:"center",children:[Object(n.jsx)(Lt.a,{width:"100%",mr:1,children:Object(n.jsx)(ob,{variant:"determinate",value:i.value})}),Object(n.jsx)(Lt.a,{minWidth:35,children:Object(n.jsx)(we.a,{variant:"body2",color:"textSecondary",children:"".concat(Math.round(i.value),"%")})})]})}),Object(n.jsx)(ye.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"flex-end",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:b.container__button_fields,children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:b.button,onClick:function(){return function(e){a(e)}(m)},disabled:!(null===l||void 0===l?void 0:l.image),children:j("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:b.button,onClick:function(){return t()},children:j("buttons:buttons.cancel")})]})})]})},db=Object(C.a)((function(){return{container__button_fields:{display:"flex",justifyContent:"space-evenly",marginTop:20},button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:"50px","&:hover":{backgroundColor:E.a.secondary}},containerTable:{marginLeft:"10%",width:"80%",height:350}}})),ub=function(e){var t=e.closeModalSignatories,a=e.emailCurrent,i=e.signatories,c=e.setSignatories,o=e.documentsFields,s=e.setDocumentsFields,l=e.formDocuments,u=r.a.useState({primer_nombre:"",segundo_nombre:"",primer_apellido:"",segundo_apellido:"",correo:"",ind_whatsapp:"",num_whatsapp:"",id_paises:""}),j=Object(d.a)(u,2),O=j[0],v=j[1],_=r.a.useState(!0),y=Object(d.a)(_,2),w=y[0],C=y[1],k=r.a.useState(!1),N=Object(d.a)(k,2),B=N[0],I=N[1],z=r.a.useState([]),P=Object(d.a)(z,2),R=P[0],M=P[1],L=r.a.useState([]),F=Object(d.a)(L,2),U=F[0],q=F[1],H=r.a.useState(!1),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=r.a.useState(!0),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=r.a.useRef(null),te=db(),ne=Object(D.a)(["buttons","certificateBadgeTemplate","certifyDocuments","alerts","loginRegister","tables","selects"]),ie=Object(d.a)(ne,1)[0],re=[{id:"name",label:ie("certifyDocuments:add-signatories.column.names"),minWidth:100},{id:"email",label:ie("certifyDocuments:add-signatories.column.email"),minWidth:100},{id:"whatsapp",label:ie("certifyDocuments:form-certify.num-phone"),minWidth:100},{id:"options",label:" ",maxWidth:50}],ce=""!==O.primer_nombre||""!==O.segundo_nombre||""!==O.primer_apellido||""!==O.segundo_apellido||""!==O.id_paises||""!==O.ind_whatsapp||""!==O.num_whatsapp||""!==O.correo;r.a.useEffect((function(){M(i),oe()}),[]),r.a.useEffect((function(){de(O.id_paises)}),[O.id_paises]);var oe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCountries");case 2:t=e.sent,a=t.data,q(a.countries);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),se=function(){var e=Object(h.a)(f.a.mark((function e(t,a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(a)){e.next=7;break}return Q(!0),e.next=5,Ce.a.post("/user/getAccountSearch",{correo:a}).then((function(e){var n,i,r,c,o,s,l,d,u,m,p,j,f,h,g,x=e.data;(Q(!1),x.account)?(C(!0),$(!1),v(Object(b.a)({primer_nombre:null===(n=x.account)||void 0===n||null===(i=n.usuarios)||void 0===i?void 0:i.primer_nombre,segundo_nombre:null===(r=x.account)||void 0===r||null===(c=r.usuarios)||void 0===c?void 0:c.segundo_nombre,primer_apellido:null===(o=x.account)||void 0===o||null===(s=o.usuarios)||void 0===s?void 0:s.primer_apellido,segundo_apellido:null===(l=x.account)||void 0===l||null===(d=l.usuarios)||void 0===d?void 0:d.segundo_apellido,num_whatsapp:(null===(u=x.account)||void 0===u||null===(m=u.usuarios)||void 0===m?void 0:m.celular)||"",id_paises:(null===(p=x.account)||void 0===p||null===(j=p.usuarios)||void 0===j?void 0:j.id_paises)||"",ind_whatsapp:(null===(f=x.account)||void 0===f||null===(h=f.usuarios)||void 0===h||null===(g=h.paises)||void 0===g?void 0:g.prefijo_telefono)||""},t,a))):(C(!1),$(!1),v(Object(b.a)({primer_nombre:"",segundo_nombre:"",primer_apellido:"",segundo_apellido:"",num_whatsapp:"",id_paises:"",ind_whatsapp:""},t,a)));return I({boolean:!1,message:""})}));case 5:e.next=8;break;case 7:I({boolean:!0,message:ie("alerts:alerts.email-not-valid")});case 8:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),le=function(e){var t=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if("correo"===e.target.name&&(t.test(e.target.value)||""===e.target.value))if(R.find((function(t){return t.correo.toLowerCase()===e.target.value.toLowerCase()}))){var n;if(!(null===O||void 0===O?void 0:O.index)&&0!==(null===O||void 0===O?void 0:O.index)||(null===(n=R[null===O||void 0===O?void 0:O.index])||void 0===n?void 0:n.correo.toLowerCase())!==e.target.value.toLowerCase())return v(Object(m.a)(Object(m.a)({},O),{},Object(b.a)({},e.target.name,e.target.value))),I({boolean:!0,message:ie("alerts:alerts.signer-already")});v(Object(m.a)(Object(m.a)({},O),{},Object(b.a)({},e.target.name,e.target.value)))}else{if(e.target.value.toLowerCase()===a.toLowerCase())return v(Object(m.a)(Object(m.a)({},O),{},Object(b.a)({},e.target.name,e.target.value))),I({boolean:!0,message:ie("alerts:alerts.message-use-your-sign")});if(!t.test(e.target.value))return v(Object(m.a)(Object(m.a)({},O),{},Object(b.a)({},e.target.name,e.target.value))),C(!0),I({boolean:!1,message:""})}v(Object(m.a)(Object(m.a)({},O),{},Object(b.a)({},e.target.name,e.target.value)))},de=function(e){var t=U.find((function(t){return t.id===e}));v(Object(m.a)(Object(m.a)({},O),{},{ind_whatsapp:""===e?"":null===t||void 0===t?void 0:t.prefijo_telefono}))},ue=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(!0),e.next=3,Ce.a.post("/user/getAccountSearch",{correo:t.correo});case 3:a=e.sent,n=a.data,Q(!1),C(n.account),v(Object(m.a)({},t));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),me=function(){v({primer_nombre:"",segundo_nombre:"",primer_apellido:"",segundo_apellido:"",correo:"",id_paises:"",ind_whatsapp:"",num_whatsapp:"",line:null===O||void 0===O?void 0:O.line}),C(!0),I({boolean:!1,message:""})};function be(){for(var e="",t=0;t<6;t++)e+=["a","b","c","d","e","f","0","1","2","3","4","5","6","7","8","9"][(15*Math.random()).toFixed(0)];return"#"+e}return Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(we.a,{variant:"h6",children:ie("certifyDocuments:add-signatories.title")}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(W.a,{orientation:"horizontal",style:{backgroundColor:"#5c5c5c"}})}),Object(n.jsx)("form",{onSubmit:function(e){return function(e,t){e.preventDefault();var a=t.current.toDataURL();if(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(O.correo))if((null===O||void 0===O?void 0:O.item)||0===(null===O||void 0===O?void 0:O.item)){var n=R;n[null===O||void 0===O?void 0:O.item]=Object(m.a)(Object(m.a)({},O),{},{url:a}),c(i),M(n),me()}else M([].concat(Object(p.a)(R),[Object(m.a)(Object(m.a)({},O),{},{color:be(),url:a})])),me();else C(!0),I({boolean:!0,message:ie("alerts:alerts.email-not-valid")})}(e,ee)},style:{width:"inherit"},children:Object(n.jsxs)(ye.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:2,children:[Object(n.jsx)(mt.a,{className:"w-100",style:{marginTop:B.boolean?"1.4em":0},children:Object(n.jsx)(Te.a,{error:B.boolean,helperText:B.boolean?B.message:"",required:!0,label:ie("loginRegister:email"),name:"correo",type:"email",variant:"outlined",onChange:le,value:null===O||void 0===O?void 0:O.correo,InputProps:{endAdornment:Object(n.jsx)(Rn.a,{position:"end",children:Object(n.jsx)(K.a,{title:"Buscar",children:Object(n.jsx)(S.a,{color:"primary",onClick:function(){if(R.find((function(e){return e.correo.toLowerCase()===O.correo.toLowerCase()}))){var e;if(!(null===O||void 0===O?void 0:O.index)&&0!==(null===O||void 0===O?void 0:O.index)||(null===(e=R[null===O||void 0===O?void 0:O.index])||void 0===e?void 0:e.correo.toLowerCase())!==O.correo.toLowerCase())return v(Object(m.a)(Object(m.a)({},O),{},{correo:O.correo})),I({boolean:!0,message:ie("alerts:alerts.signer-already")});v(Object(m.a)(Object(m.a)({},O),{},{correo:O.correo}))}else{if(O.correo.toLowerCase()===a.toLowerCase())return v(Object(m.a)(Object(m.a)({},O),{},{correo:O.correo})),I({boolean:!0,message:ie("alerts:alerts.message-use-your-sign")});if(!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(O.correo))return v(Object(m.a)(Object(m.a)({},O),{},{correo:O.correo})),I({boolean:!0,message:ie("alerts:alerts.email-not-valid")});se("correo",O.correo)}},children:Object(n.jsx)(A.a,{})})})})}})}),G&&Object(n.jsx)(Oe.a,{})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:2,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,disabled:w,label:ie("loginRegister:first-name"),name:"primer_nombre",value:O.primer_nombre,onChange:le,variant:"outlined"})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:2,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:w,required:!0,label:ie("loginRegister:last-name"),name:"primer_apellido",value:O.primer_apellido,onChange:le,variant:"outlined"})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:2,children:Object(n.jsxs)(mt.a,{className:"w-100",children:[Object(n.jsxs)(di.a,{id:"label_id_paises",style:{marginLeft:".8em",marginTop:"-.5em"},children:[ie("certifyDocuments:form-certify.phone-code")," *"]}),Object(n.jsxs)(T.a,{required:!0,labelId:"label_id_paises",label:"".concat(ie("certifyDocuments:form-certify.phone-code")," *"),id:"id_paises",name:"id_paises",onChange:le,value:O.id_paises,disabled:Z,variant:"outlined",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:ie("selects:selects-autocompletes.select-option")})}),U.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:"+".concat(e.prefijo_telefono," (").concat(e.nombre,")")},e.id)}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:2,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:ie("certifyDocuments:form-certify.num-phone"),name:"num_whatsapp",value:O.num_whatsapp,onChange:le,disabled:Z,variant:"outlined"})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:2,children:[Object(n.jsx)(K.a,{title:ie("tables:table.tooltip.add"),children:Object(n.jsx)(S.a,{color:"primary",className:te.button,type:"submit",disabled:""===O.primer_nombre&&""===O.primer_apellido||B.boolean,children:Object(n.jsx)(Qa.a,{size:"small"})})}),Object(n.jsx)(K.a,{title:ie("tables:table.tooltip.clean"),children:Object(n.jsx)(S.a,{color:"primary",className:te.button,onClick:me,children:Object(n.jsx)(ae.a,{size:"small"})})})]})]})}),Object(n.jsx)(Nn.a,{className:te.containerTable,children:(null===R||void 0===R?void 0:R.length)>0&&Object(n.jsxs)(Bn.a,{stickyHeader:!0,"aria-label":"sticky table",children:[Object(n.jsx)(Sn.a,{children:Object(n.jsx)(_n.a,{children:re.map((function(e){return Object(n.jsx)(yn.a,{align:"center",minWidth:null===e||void 0===e?void 0:e.minWidth,style:{fontWeight:"bold"},children:e.label},e.id)}))})}),Object(n.jsx)(vn.a,{children:R.map((function(e,t){return Object(n.jsxs)(_n.a,{hover:!0,children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:2,children:Object(n.jsx)(g.a,{style:{backgroundColor:null===e||void 0===e?void 0:e.color},children:null===e||void 0===e?void 0:e.primer_nombre.slice(0,1)})}),Object(n.jsx)(ye.a,{item:!0,xs:10,children:Object(n.jsx)("p",{style:{margin:"0.8em 0 0 0.3em",textAlign:"left"},children:"".concat(null===e||void 0===e?void 0:e.primer_nombre," ").concat((null===e||void 0===e?void 0:e.segundo_nombre)?null===e||void 0===e?void 0:e.segundo_nombre:""," ").concat(null===e||void 0===e?void 0:e.primer_apellido," ").concat((null===e||void 0===e?void 0:e.segundo_apellido)?null===e||void 0===e?void 0:e.segundo_apellido:"")})})]})}),Object(n.jsx)(yn.a,{align:"center",children:null===e||void 0===e?void 0:e.correo}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(""!==(null===e||void 0===e?void 0:e.num_whatsapp)?"+":"").concat(null===e||void 0===e?void 0:e.ind_whatsapp," ").concat(null===e||void 0===e?void 0:e.num_whatsapp)}),Object(n.jsxs)(yn.a,{children:[Object(n.jsx)(K.a,{title:ie("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{color:"primary",variant:!0,onClick:function(){return ue(Object(m.a)(Object(m.a)({},e),{},{item:t}))},children:Object(n.jsx)(Wn,{size:"small"})})}),Object(n.jsx)(K.a,{title:ie("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{color:"primary",onClick:function(){return e=t,void M(R.filter((function(t,a){return a!==e})));var e},children:Object(n.jsx)(Cn.a,{size:"small"})})})]})]})}))})]})}),Object(n.jsx)(ye.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"flex-end",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:te.container__button_fields,children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:te.button,onClick:function(){return function(){var e=o,a=so().dataSignature,n=o.filter((function(e){return e.fieldName.includes("signature")}));e=e.filter((function(e){return!e.correo})),R.map((function(t,i){e.push(Object(m.a)(Object(m.a)({},a),{},{y:a.y+105*i>=(null===l||void 0===l?void 0:l.naturalWidthAndHeight[0].height)-155?(null===l||void 0===l?void 0:l.naturalWidthAndHeight[0].height)-155:a.y+105*i,exampleText:t.url,primer_nombre:t.primer_nombre,segundo_nombre:t.segundo_nombre,primer_apellido:t.primer_apellido,segundo_apellido:t.segundo_apellido,correo:t.correo,num_whatsapp:t.num_whatsapp,id_paises:t.id_paises,ind_whatsapp:t.ind_whatsapp,fieldName:n?"".concat(a.fieldName.split("_")[0],"_").concat(n.length+(i+1)):a.fieldName,url:t.url,page:null===l||void 0===l?void 0:l.page}))})),c(R),s(e),t()}()},disabled:ce,children:ie("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:te.button,onClick:function(){return t()},children:ie("buttons:buttons.cancel")})]})}),Object(n.jsx)("div",{style:{display:"none"},children:Object(n.jsx)(Co.f,{width:520,height:155,ref:ee,children:Object(n.jsxs)(Co.c,{children:[Object(n.jsx)(Co.e,{width:520,height:155,fill:E.a.secondary,cornerRadius:8,stroke:"black",strokeWidth:2,opacity:.5}),Object(n.jsx)(Co.g,{text:ie("certifyDocuments:add-signatories.signatory"),x:1,y:58,width:520,fontSize:20,align:"center"}),Object(n.jsx)(Co.g,{text:O.correo,x:1,y:78,width:520,fontSize:20,align:"center"})]})})})]})};var mb=Object(C.a)((function(e){return{container:{display:"grid",gridTemplateColumns:"70% 30%",backgroundColor:"#E5E5E5"},container__certificate:{display:"flex",justifyContent:"center",overflow:"auto"},container__fields:{backgroundColor:"white"},container__button_fields:{display:"flex",justifyContent:"space-evenly",marginTop:20},content_modal:{display:"grid",gridTemplateColumns:"35% 65%",gridTemplateRows:""},dialog__title:{backgroundColor:e.palette.primary.main},sweetModal:{zIndex:1300},mySwal:{zIndex:3e3},fieldButtonDisabled:{display:"none"},root_info:{height:180},container_info:{display:"flex",justifyContent:"center",margin:e.spacing(1),backgroundColor:"#fff",borderRadius:"1em"},buttonMinimize:{display:"flex",justifyContent:"right",margin:e.spacing(1),backgroundColor:"#fff",borderRadius:"1em"},buttonClose:{margin:"0 .1em 0 .1em",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}},container__button_signed:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},button_signed:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"10px 40px",fontSize:"11px","&:hover":{backgroundColor:E.a.secondary}}}})),bb={sizeZoom:{width:"50px",height:"24px",marginLeft:"5px",fontWeight:"bold",input:{textAlign:"center",cursor:"pointer"}},iconsButtons:{width:"45px",height:"45px",padding:"10px",margin:"0 3px 0 3px",borderRadius:"4px",cursor:"pointer","&:hover":{backgroundColor:"#E6E6E6"}},iconsButtonsActive:{width:"45px",height:"45px",padding:"10px",margin:"0 3px 0 3px",borderRadius:"4px",cursor:"pointer",backgroundColor:"#E6E6E6"}},pb={setDocumentsFields:I.u,setFormDocuments:I.y,setSaveDesign:I.D},jb=Object(s.b)((function(e){return{documentsFields:e.documentsFields||[],formDocuments:e.formDocuments||[]}}),pb)((function(e){var t,a,r,c,o,s,l,u,j,g,y,w,C,k,N,B,A,I=e.documentsFields,z=e.setDocumentsFields,P=e.formDocuments,R=e.setFormDocuments,M=e.setSaveDesign,L=e.setOpenDesignDocuments,U=e.fromCertify,W=e.user,q=e.md5OrganizationRoute,V=e.md5UserRoute,G=e.handleCancelGeneral,Q=e.handleSubmit,J=e.fromSign,X=e.documentSigned,Z=e.downloadDocument,$=e.isEditDocuments,ee=e.documentFinish,te=mb(),ae=Object(i.useRef)(),ne=Object(i.useState)(!0),ie=Object(d.a)(ne,2),re=ie[0],oe=ie[1],se=Object(i.useState)(!1),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(i.useState)(!1),be=Object(d.a)(me,2),pe=be[0],fe=be[1],he=Object(i.useState)(!1),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ke=Object(i.useState)(null),Ne=Object(d.a)(ke,2),Be=Ne[0],Se=Ne[1],Ee=Object(i.useState)(!1),De=Object(d.a)(Ee,2),ze=De[0],Pe=De[1],Re=Object(i.useState)(!1),Me=Object(d.a)(Re,2),Le=Me[0],Fe=Me[1],Ue=Object(i.useState)({correo:"",whatsapp:""}),We=Object(d.a)(Ue,2),Ye=We[0],qe=We[1],He=Object(i.useState)(J?3:0),Ke=Object(d.a)(He,2),Ve=Ke[0],Ge=Ke[1],Qe=Object(i.useState)([]),Je=Object(d.a)(Qe,2),Xe=Je[0],Ze=Je[1],$e=Object(i.useState)({}),et=Object(d.a)($e,2),tt=et[0],at=et[1],nt=Object(i.useState)({fieldType:41,fieldTypeConfig:51,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0}),it=Object(d.a)(nt,2),rt=it[0],ot=it[1],st=I.findIndex((function(e){return"certificateCode"===e.fieldName&&e.page===(null===P||void 0===P?void 0:P.page)})),lt=I.findIndex((function(e){return"buttonVerify"===e.fieldName})),dt="certificateCode"===rt.fieldName,ut="buttonVerify"===rt.fieldName,bt=["Caveat","Caveat Brush","Cookie","Architects Daughter","Cedarville Cursive","Dawning of a New Day","Crafty Girls","League Script"],pt=Object(i.useState)([].concat(Object(p.a)(I.map((function(e){var t;return null===(t=e.fontFamily)||void 0===t?void 0:t.family}))),["ABeeZee"],bt)||["ABeeZee"]),jt=Object(d.a)(pt,2),ft=jt[0],ht=jt[1],gt=Object(i.useState)([]),xt=Object(d.a)(gt,2),Ot=xt[0],vt=xt[1],yt=Object(i.useState)([]),wt=Object(d.a)(yt,2),Ct=wt[0],kt=wt[1],Nt=Object(i.useState)([]),Bt=Object(d.a)(Nt,2),St=Bt[0],Tt=Bt[1],Et=Object(i.useState)(!1),It=Object(d.a)(Et,2),Dt=It[0],zt=It[1],Pt=Object(i.useState)(null),Rt=Object(d.a)(Pt,2),Mt=Rt[0],Lt=Rt[1],Ft=Object(i.useState)(null),Ut=Object(d.a)(Ft,2),Wt=Ut[0],Yt=Ut[1],qt=Object(i.useState)([]),Ht=Object(d.a)(qt,2),Kt=Ht[0],Vt=Ht[1],Gt=Object(i.useState)([]),Qt=Object(d.a)(Gt,2),Jt=Qt[0],Xt=Qt[1],Zt=Object(i.useState)(0),$t=Object(d.a)(Zt,2),ea=$t[0],ta=$t[1],aa=Object(i.useState)({}),na=Object(d.a)(aa,2),ia=na[0],ra=na[1],ca=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","tables","menu"]),oa=Object(d.a)(ca,1)[0],sa="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2)),la=I.filter((function(e){return e.correo})).length>0;Object(i.useEffect)((function(){var e;(oe(!0),function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCountries");case 2:t=e.sent,a=t.data,Ze(a.countries);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()(),$)&&Xt(null===I||void 0===I||null===(e=I.filter((function(e){var t,a;return(null===(t=e.dataSign)||void 0===t?void 0:t.correo)&&(null===(a=e.dataSign)||void 0===a?void 0:a.correo)!==W.correo&&e.correo!==W.correo})))||void 0===e?void 0:e.map((function(e){return e.primer_nombre=e.dataSign?e.dataSign.primer_nombre:e.primer_nombre,e.segundo_nombre=e.dataSign?e.dataSign.segundo_nombre:e.segundo_nombre,e.primer_apellido=e.dataSign?e.dataSign.primer_apellido:e.primer_apellido,e.segundo_apellido=e.dataSign?e.dataSign.segundo_apellido:e.segundo_apellido,e.correo=e.dataSign?e.dataSign.correo:e.correo,e.num_whatsapp=e.dataSign?e.dataSign.num_whatsapp:e.num_whatsapp,e.id_paises=e.dataSign?e.dataSign.id_paises:e.id_paises,e.ind_whatsapp=e.dataSign?e.dataSign.ind_whatsapp:e.ind_whatsapp,e.url=e.exampleText,e})));Ce.a.get("/others/getFieldTypes").then((function(e){var t=e.data;Tt(t.fieldTypes.filter((function(e){return 51===e.id||52===e.id})).map((function(e){return{id:e.id,value:sa?e.valor_parametro_en:e.valor_parametro}}))),kt(t.fieldTypes.filter((function(e){return 51!==e.id&&52!==e.id})).map((function(e){return{id:e.id,value:sa?e.valor_parametro_en:e.valor_parametro}})))})),ft.length>0?vo.a.load({google:{families:ft},active:function(){oe(!1)}}):oe(!1),ct.a.get("https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyAiqPGRASVurt5YfOdCCDOljv0nqATgCSc&fields=items.family,items.files&sort=alpha").then((function(e){var t=e.data;vt(t.items)})),W&&Ce.a.post("/signature/getSignatures").then((function(e){var t=e.data;Vt(Object(p.a)(null===t||void 0===t?void 0:t.signatures))}))}),[]);var da=function(e){P.change_template&&0!==P.change_template?F.a.fire({icon:"info",iconColor:E.a.primary,text:oa("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:oa("buttons:buttons.accept"),cancelButtonText:oa("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:te.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.isConfirmed&&(Oe(!0),R(Object(m.a)(Object(m.a)({},P),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):0===P.id_plantillas_documentos&&P.checkSaveTemplate?F.a.fire({icon:"info",iconColor:E.a.primary,text:oa("alerts:alerts.signatories-no-template"),showCancelButton:!0,confirmButtonText:oa("buttons:buttons.accept"),cancelButtonText:oa("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:te.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.isConfirmed&&(Oe(!0),R(Object(m.a)(Object(m.a)({},P),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:"",checkSaveTemplate:!1})))})):Oe(!0)},ua=function(){ue(!1),ot({fieldType:41,fieldTypeConfig:51,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0})},ma=function(){fe(!1)},ba=function(e){ot(Object(m.a)(Object(m.a)({},rt),{},{fontStyle:e}))},pa=function(e){ot(Object(m.a)(Object(m.a)({},rt),{},{fontColor:U?{hex:e.hex}:e}))},ja=function(e){if(!("fontSize"===e.target.name&&e.target.value>100)){var t;if("fieldTypeConfig"===e.target.name)return ot(Object(m.a)(Object(m.a)({},rt),{},(t={},Object(b.a)(t,e.target.name,e.target.value),Object(b.a)(t,"fieldName",""),Object(b.a)(t,"align","center"),Object(b.a)(t,"width","auto"),t)));ot(Object(m.a)(Object(m.a)({},rt),{},Object(b.a)({},e.target.name,e.target.value)))}},fa=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c,o,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.current.toDataURL(),i=Qm(n),r=new FormData,c="".concat(q,"/documentsTemplate/signatures/").concat(V),r.append("file",i),r.append("route",c),r.append("userId",null===W||void 0===W||null===(a=W.data_user)||void 0===a?void 0:a.id),e.prev=7,e.next=10,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:r,onUploadProgress:function(e){var t=e.loaded,a=e.total,n=Math.floor(100*t/a);ra({value:n})}});case 10:o=e.sent,s=o.data,Vt([].concat(Object(p.a)(Kt),[{url:null===s||void 0===s?void 0:s.url,id:null===s||void 0===s?void 0:s.id}])),fe(!1),ra({}),e.next=22;break;case 17:e.prev=17,e.t0=e.catch(7),F.a.fire({icon:"error",iconColor:E.a.primary,text:oa("alerts:alerts.try-again"),confirmButtonText:oa("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:te.mySwal,confirmButton:"custom-button-confirm"}}),fe(!1),ra({});case 22:case"end":return e.stop()}}),e,null,[[7,17]])})));return function(t){return e.apply(this,arguments)}}(),ha=function(e){P.change_template&&0!==P.change_template?F.a.fire({icon:"info",iconColor:E.a.primary,text:oa("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:oa("buttons:buttons.accept"),cancelButtonText:oa("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:te.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(t){t.isConfirmed&&(ot(-1===e?Object(m.a)(Object(m.a)({},I[st]),{},{width:51===I[st].fieldTypeConfig?"auto":I[st].width,index:st}):-3===e?Object(m.a)(Object(m.a)({},I[lt]),{},{index:lt}):Object(m.a)(Object(m.a)({},I[e]),{},{width:51===I[e].fieldTypeConfig?"auto":I[e].width,index:e})),R(Object(m.a)(Object(m.a)({},P),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})),ue(!0))})):(ot(-1===e?Object(m.a)(Object(m.a)({},I[st]),{},{width:51===I[st].fieldTypeConfig?"auto":I[st].width,index:st}):-3===e?Object(m.a)(Object(m.a)({},I[lt]),{},{index:lt}):Object(m.a)(Object(m.a)({},I[e]),{},{width:51===I[e].fieldTypeConfig?"auto":I[e].width,index:e})),ue(!0))},ga=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!J||I.find((function(e){return e.fieldName.includes("signature")}))){e.next=2;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:oa("alerts:alerts.no-fields"),showConfirmButton:!1,timer:1500,customClass:{container:te.sweetModal}}));case 2:a=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]'),void 0!==st&&-1!==st&&(I[st].exampleText="".concat(I[st].exampleText).concat(""===I[st].exampleText?"":":","CK09aABbAz")),U?Q(t,a):(i=null===ae||void 0===ae||null===(n=ae.current)||void 0===n?void 0:n.toDataURL(),R(Object(m.a)(Object(m.a)({},P),{},{img_template:i})),M(!0),L(!1));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),xa=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return X?(t=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]'),Array.prototype.forEach.call(t,(function(e){return e.remove()})),void 0!==st&&-1!==st&&(I[st].exampleText="".concat(I[st].exampleText).concat(""===I[st].exampleText?"":":","CK09aABbAz")),G(),L(!1)):U?F.a.fire({icon:"info",iconColor:E.a.primary,text:oa("alerts:alerts.cancel-progress"),showCancelButton:!0,confirmButtonText:oa("buttons:buttons.accept"),cancelButtonText:oa("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:te.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){if(e.isConfirmed){var t=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]');Array.prototype.forEach.call(t,(function(e){return e.remove()})),void 0!==st&&-1!==st&&(I[st].exampleText="".concat(I[st].exampleText).concat(""===I[st].exampleText?"":":","CK09aABbAz")),G(),L(!1)}})):(a=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]'),Array.prototype.forEach.call(a,(function(e){return e.remove()})),void 0!==st&&-1!==st&&(I[st].exampleText="".concat(I[st].exampleText).concat(""===I[st].exampleText?"":":","CK09aABbAz")),L(!1)),e.next=3,ct.a.get("".concat(je.a.apiURL,"/file/getPdfForWhatsapp/delete"));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Oa=function(e){qe(Object(m.a)(Object(m.a)({},Ye),{},Object(b.a)({},e.target.name,e.target.value)))},va=function(){var e=Object(h.a)(f.a.mark((function e(t,a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a||(null===P||void 0===P?void 0:P.ip_adress)){e.next=3;break}return e.next=3,_a();case 3:Ge(t);case 4:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),_a=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ct()({method:"get",url:"https://api.ipdata.co?api-key=".concat(je.a.keyIpData)});case 3:t=e.sent,a=t.data,R(Object(m.a)(Object(m.a)({},P),{},{ip_adress:a.ip})),e.next=11;break;case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",F.a.fire({icon:"warning",iconColor:E.a.primary,text:oa("alerts:alerts.warning-block"),showConfirmButton:!0,confirmButtonText:oa("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:te.mySwal,confirmButton:"custom-button-confirm"}}));case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),ya=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:""===t.target.value?(qe(Object(m.a)(Object(m.a)({},Ye),{},Object(b.a)({},t.target.name,t.target.value))),at("")):(qe(Object(m.a)(Object(m.a)({},Ye),{},Object(b.a)({},t.target.name,t.target.value))),(a=Xe.find((function(e){return e.id===t.target.value}))).prefijo_telefono&&at(Object(m.a)(Object(m.a)({},tt),{},{country:t.target.value,prefijo_telefono:a.prefijo_telefono})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsx)("div",{style:{backgroundColor:"#E5E5E5"},children:Object(n.jsxs)(H.a,{className:te.container_info,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,style:{display:"inline-flex",alignItems:"center",height:"50px"},children:[Object(n.jsx)(we.a,{align:"left",children:"".concat((null===P||void 0===P?void 0:P.nombre_documento)||(null===P||void 0===P?void 0:P.nombre))}),((null===P||void 0===P?void 0:P.nameTemplate)||(null===P||void 0===P?void 0:P.checkSaveTemplate))&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(we.a,{style:{fontWeight:"bold",margin:"0 3px 0 3px"},children:"/"}),Object(n.jsx)(we.a,{align:"left",style:{fontWeight:"bold"},children:"".concat((null===P||void 0===P?void 0:P.nameTemplate)||(null===P||void 0===P?void 0:P.nombre_plantilla))})]}),Object(n.jsx)(we.a,{style:{fontWeight:"bold",margin:"0 3px 0 3px"},children:U&&"/"}),Object(n.jsx)(we.a,{align:"left",style:{fontWeight:"bold"},children:"".concat((null===P||void 0===P?void 0:P.nameArchive)||(null===P||void 0===P?void 0:P.nombre_archivo)||"")}),Object(n.jsx)(tm.a,{orientation:"vertical",sx:{height:"25px",margin:"0 1rem 0 1rem",backgroundColor:"#000"}}),Object(n.jsx)(K.a,{title:oa("buttons:tooltips.text"),children:Object(n.jsx)("img",{src:km,style:0===Ve?bb.iconsButtonsActive:bb.iconsButtons,alt:"textField",onClick:function(){return va(0,!0)}})}),Object(n.jsx)(K.a,{title:oa("buttons:tooltips.image"),children:Object(n.jsx)(Bm.a,{sx:1===Ve?bb.iconsButtonsActive:bb.iconsButtons,onClick:function(){return va(1,!0)}})}),Object(n.jsx)(K.a,{title:oa("buttons:tooltips.buttons"),children:Object(n.jsx)(Tm.a,{sx:2===Ve?bb.iconsButtonsActive:bb.iconsButtons,onClick:function(){return va(2,!0)}})}),J&&Object(n.jsx)(K.a,{title:oa("buttons:tooltips.sign"),children:Object(n.jsx)("img",{src:Am,style:3===Ve?bb.iconsButtonsActive:bb.iconsButtons,alt:"Signatue",onClick:function(){return va(3,!0)}})})]}),J&&Object(n.jsx)(K.a,{title:oa("buttons:buttons.add-signatorie"),children:Object(n.jsxs)(x.a,{color:"primary",variant:"outlined",disabled:X,onClick:da,disableElevation:!0,children:[Object(n.jsx)(Rm.a,{fontSize:"small",sx:{marginRight:".5em"}})," Firmantes"]})}),Object(n.jsx)(K.a,{title:oa(J?$?"buttons:buttons.edit":"menu:sign":U?"buttons:buttons.finish":"buttons:buttons.accept"),children:Object(n.jsx)(S.a,{className:te.buttonClose,disabled:X,onClick:ga,children:Object(n.jsx)(Im.a,{})})}),Object(n.jsx)(K.a,{title:oa("buttons:buttons.cancel"),children:Object(n.jsx)(S.a,{className:te.buttonClose,disabled:X,onClick:function(){void 0!==st&&-1!==st&&(I[st].exampleText="".concat(I[st].exampleText).concat(""===I[st].exampleText?"":":","CK09aABbAz")),L(!1)},children:Object(n.jsx)(zm.a,{})})})]})}),Object(n.jsxs)("div",{className:te.container,children:[Object(n.jsx)("div",{className:te.container__certificate,children:Object(n.jsx)(Fm,{isSelected:Dt,setIsSelected:zt,selectedId:Be,selectShape:function(e){if("X"===e)return z(Object(p.a)(I.filter((function(e){return e.fieldName!==Be&&"deleteSign"!==e.fieldName&&"addSign"!==e.fieldName}))));if("+"===e){var t=I.findIndex((function(e){return"deleteSign"===e.fieldName})),a=I.findIndex((function(e){return"addSign"===e.fieldName})),n=I.filter((function(e){return e.fieldName.includes("signature")})),i=I.findIndex((function(e){return e.fieldName===Be&&"deleteSign"!==e.fieldName&&"addSign"!==e.fieldName}));return I[i].y+I[i].height+20>(null===P||void 0===P?void 0:P.naturalWidthAndHeight[0].height)?(I.push(Object(m.a)(Object(m.a)({},I[i]),{},{y:I[i].y-I[i].height-20,fieldName:"".concat(I[i].fieldName.split("_")[0],"_").concat(n.length+1)})),I[t].y=I[t].y-I[i].height-20,I[a].y=I[a].y-I[i].height-20):(I.push(Object(m.a)(Object(m.a)({},I[i]),{},{y:I[i].y+I[i].height+20,fieldName:"".concat(I[i].fieldName.split("_")[0],"_").concat(n.length+1)})),I[t].y=I[t].y+I[i].height+20,I[a].y=I[a].y+I[i].height+20),Se("".concat(I[i].fieldName.split("_")[0],"_").concat(n.length+1)),z(Object(p.a)(I))}var r=I.find((function(t){return t.fieldName===e&&t.fieldName.includes("signature")})),c=I.find((function(e){return"deleteSign"===e.fieldName}));r&&!c&&(I.push(Object(m.a)(Object(m.a)({},r),{},{fieldType:41,fieldTypeConfig:52,fontSize:"18",fieldName:"deleteSign",exampleText:"X",x:r.x+20,y:r.y-20,width:23,height:32,fontStyle:{bold:1}})),I.push(Object(m.a)(Object(m.a)({},r),{},{fieldType:41,fieldTypeConfig:52,fontSize:"18",fieldName:"addSign",exampleText:"+",x:r.x+5,y:r.y-20,width:23,height:32,fontStyle:{bold:1}})),z(Object(p.a)(I))),c&&z(Object(p.a)(I.filter((function(e){return"deleteSign"!==e.fieldName&&"addSign"!==e.fieldName})))),e&&P.change_template&&0!==P.change_template?F.a.fire({icon:"info",iconColor:E.a.primary,text:oa("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:oa("buttons:buttons.accept"),cancelButtonText:oa("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:te.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(t){t.isConfirmed&&(Se(e),R(Object(m.a)(Object(m.a)({},P),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):Se(e)},stageRef:ae,modifyField:ha,handleChangePage:function(e,t){R(Object(m.a)(Object(m.a)({},P),{},{page:t}))},refField:Mt,setRefField:Lt,modifiedFieldIndex:Wt,setModifiedFieldIndex:Yt,documentSigned:X,changeViewFields:va})}),Object(n.jsx)("div",{className:te.container__fields,children:X?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)("div",{className:te.container__button_signed,children:Object(n.jsxs)(ye.a,{container:!0,style:{justifyContent:"center",marginTop:"2rem"},children:[!la&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,onClick:function(){return Fe(!1),void Pe(!ze)},children:Object(n.jsx)(ve.a,{color:"",style:{margin:"10px"},children:Object(n.jsx)(K.a,{title:oa("buttons:buttons.send-document-email"),children:Object(n.jsx)(_c.a,{children:Object(n.jsx)(_e.a,{style:{textAlign:"center"},children:Object(n.jsx)(hm.a,{disabled:!0,color:"primary"})})})})})}),Object(n.jsx)("form",{onSubmit:function(e){return function(e){if(e.preventDefault(),oe(!0),null===Ye||void 0===Ye?void 0:Ye.correo){var t,a,n=new FormData;n.append("id",(null===ee||void 0===ee||null===(t=ee.data)||void 0===t?void 0:t.reportes)?null===ee||void 0===ee||null===(a=ee.data)||void 0===a?void 0:a.reportes[0].id:Object(Ie.a)(window.location.href.split("/")[window.location.href.split("/").length-1])),n.append("email_receptor",null===Ye||void 0===Ye?void 0:Ye.correo),n.append("nombre",null===P||void 0===P?void 0:P.nombre_documento),n.append("share",!1),n.append("sub",W.data_user.id),ct()({method:"post",url:"".concat(je.a.apiURL,"/share/sendDocumentsCertify"),headers:{"Content-Type":"multipart/form-data"},data:n}).then((function(e){return 201===e.status&&F.a.fire({customClass:{container:te.mySwal},title:"El correo electr\xf3nico ha rebotado",icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}),qe(Object(m.a)(Object(m.a)({},Ye),{},{correo:""})),oe(!1),Pe(!1),F.a.fire({customClass:{container:te.mySwal},title:oa("alerts:alerts.send-successfully"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3})})).catch((function(){F.a.fire({customClass:{container:te.mySwal},title:oa("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3})}))}}(e)},children:Object(n.jsx)(ce.a,{in:ze,children:Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(Te.a,{required:!0,variant:"outlined",name:"correo",type:"email",placeholder:"example@email.com",value:Ye.correo,onChange:Oa,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:Object(n.jsx)(hm.a,{})}),endAdornment:Object(n.jsxs)(Rn.a,{position:"end",children:[Object(n.jsx)(K.a,{title:oa("buttons:buttons.send"),type:"submit",children:Object(n.jsx)(S.a,{size:"small",children:Object(n.jsx)(vm.a,{color:"primary"})})}),Object(n.jsx)(K.a,{title:oa("buttons:buttons.close"),children:Object(n.jsx)(S.a,{size:"small",onClick:function(){return Pe(!1)},children:Object(n.jsx)(zm.a,{color:"primary"})})})]})}})})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,onClick:function(){return Pe(!1),void Fe(!Le)},children:Object(n.jsx)(ve.a,{style:{margin:"10px"},children:Object(n.jsx)(K.a,{title:oa("buttons:buttons.send-document-whatsapp"),children:Object(n.jsx)(_c.a,{children:Object(n.jsx)(_e.a,{style:{textAlign:"center"},children:Object(n.jsx)(xm.a,{color:"primary"})})})})})}),Object(n.jsx)("form",{onSubmit:function(e){return function(e){if(e.preventDefault(),oe(!0),null===Ye||void 0===Ye?void 0:Ye.whatsapp){var t,a;if((null===Ye||void 0===Ye?void 0:Ye.whatsapp.length)<10)return oe(!1),F.a.fire({customClass:{container:te.mySwal},title:oa("alerts:alerts.whatsapp-send-invalid"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3});var n=new FormData;n.append("id",(null===ee||void 0===ee||null===(t=ee.data)||void 0===t?void 0:t.reportes)?null===ee||void 0===ee||null===(a=ee.data)||void 0===a?void 0:a.reportes[0].id:Object(Ie.a)(window.location.href.split("/")[window.location.href.split("/").length-1])),n.append("whatsapp_receptor","".concat(tt.prefijo_telefono).concat(null===Ye||void 0===Ye?void 0:Ye.whatsapp)),n.append("nombre",null===P||void 0===P?void 0:P.nombre_documento),n.append("share",!1),n.append("sub",W.data_user.id),ct()({method:"post",url:"".concat(je.a.apiURL,"/share/sendDocumentsCertifyWhatsapp"),headers:{"Content-Type":"multipart/form-data"},data:n}).then((function(e){return qe(Object(m.a)(Object(m.a)({},Ye),{},{whatsapp:""})),oe(!1),Fe(!1),F.a.fire({customClass:{container:te.mySwal},title:oa("alerts:alerts.send-successfully"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3})})).catch((function(){F.a.fire({customClass:{container:te.mySwal},title:oa("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3})}))}}(e)},children:Object(n.jsx)(ce.a,{in:Le,children:Object(n.jsxs)(ye.a,{container:!0,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:3,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{children:"Pa\xeds "}),Object(n.jsxs)(T.a,{required:!0,id:"pais",name:"id_paises",label:"Pa\xeds",onChange:ya,value:(null===tt||void 0===tt?void 0:tt.country)||"",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:"Seleccione una opci\xf3n"})}),Xe.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:"".concat(e.nombre).slice(0,e.nombre.length>9?4:3).toLocaleUpperCase()},"countrie-".concat(e.id))}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:9,children:Object(n.jsx)(Te.a,{required:!0,variant:"outlined",name:"whatsapp",type:"number",placeholder:"3044579029",value:Ye.whatsapp,onChange:Oa,InputProps:{startAdornment:Object(n.jsxs)(Rn.a,{position:"start",children:[Object(n.jsx)(xm.a,{}),"(+".concat(tt.prefijo_telefono?tt.prefijo_telefono:"",")")]}),endAdornment:Object(n.jsxs)(Rn.a,{position:"end",children:[Object(n.jsx)(K.a,{title:oa("buttons:buttons.send"),children:Object(n.jsx)(S.a,{size:"small",type:"submit",children:Object(n.jsx)(vm.a,{color:"primary"})})}),Object(n.jsx)(K.a,{title:oa("buttons:buttons.close"),children:Object(n.jsx)(S.a,{size:"small",onClick:function(){return Fe(!1)},children:Object(n.jsx)(zm.a,{color:"primary"})})})]})}})})]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,onClick:function(){return Z()},children:Object(n.jsx)(ve.a,{style:{margin:"10px"},children:Object(n.jsx)(K.a,{title:oa("buttons:buttons.download-documents"),children:Object(n.jsx)(_c.a,{children:Object(n.jsx)(_e.a,{style:{textAlign:"center"},children:Object(n.jsx)(ym.a,{color:"primary"})})})})})})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,onClick:function(){F.a.fire({text:oa("alerts:alerts.exit"),icon:"question",iconColor:E.a.primary,showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:oa("buttons:buttons.exit"),cancelButtonText:oa("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:te.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value&&xa();case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},children:Object(n.jsx)(ve.a,{style:{margin:"10px"},children:Object(n.jsx)(K.a,{title:oa("buttons:buttons.exit"),children:Object(n.jsx)(_c.a,{children:Object(n.jsx)(_e.a,{style:{textAlign:"center"},children:Object(n.jsxs)(we.a,{color:"primary",children:[Object(n.jsx)(Cm.a,{color:"primary"}),oa("buttons:buttons.exit")]})})})})})})]})})}):Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Gm,{openModal:function(e){P.change_template&&0!==P.change_template?F.a.fire({icon:"info",iconColor:E.a.primary,text:oa("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:oa("buttons:buttons.accept"),cancelButtonText:oa("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:te.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.isConfirmed&&(ue(!0),R(Object(m.a)(Object(m.a)({},P),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):ue(!0)},openModalSign:function(e){P.change_template&&0!==P.change_template?F.a.fire({icon:"info",iconColor:E.a.primary,text:oa("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonText:oa("buttons:buttons.accept"),cancelButtonText:oa("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:te.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.isConfirmed&&(fe(!0),ta(0),R(Object(m.a)(Object(m.a)({},P),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):(ta(0),fe(!0))},openModalSignatories:da,modifyField:ha,signatures:Kt,setSignatures:Vt,fromCertify:U,fromSign:J,typeViewFields:Ve})})})]}),Object(n.jsxs)(O.a,{open:de,onClose:ua,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",className:!ut&&function(e){var t=as(e);return t.r>230&&t.g>230&&t.b>230?te.dialog__title:""}(null===(r=rt.fontColor)||void 0===r?void 0:r.hex),style:ut?{backgroundColor:null===rt||void 0===rt||null===(c=rt.rectColor)||void 0===c?void 0:c.hex}:{},children:Object(n.jsx)(we.a,{style:{fontSize:"".concat(rt.fontSize||18,"px"),color:null===(o=rt.fontColor)||void 0===o?void 0:o.hex,fontFamily:null===(s=rt.fontFamily)||void 0===s?void 0:s.family,fontWeight:(null===(l=rt.fontStyle)||void 0===l?void 0:l.bold)?"bold":"",fontStyle:(null===(u=rt.fontStyle)||void 0===u?void 0:u.italic)?"italic":"",textDecoration:"".concat((null===(j=rt.fontStyle)||void 0===j?void 0:j.underline)?"underline":""," ").concat((null===(g=rt.fontStyle)||void 0===g?void 0:g.strikethrough)?"line-through":""),textAlign:null===rt||void 0===rt?void 0:rt.align},children:dt?"".concat(rt.exampleText).concat(""===rt.exampleText?"":":","CK09aABbAz"):ut?"Verificar":rt.exampleText||oa("certificateBadgeTemplate:certificate-design.example")})}),Object(n.jsx)(_.a,{dividers:!0,className:ut&&te.fieldButtonDisabled,children:Object(n.jsxs)("div",{className:te.content_modal,children:[Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:certificate-design.type-config-field"),"*"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(T.a,{name:"fieldTypeConfig",value:rt.fieldTypeConfig,onChange:ja,disabled:!("certificateCode"!==rt.fieldName&&!U),children:St.map((function(e,t){return Object(n.jsx)(Y.a,{value:e.id,children:Object(n.jsx)("em",{children:e.value})},"field-type-option".concat(t))}))})}),52===rt.fieldTypeConfig&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:certificate-design.name-field"),"*"]}),Object(n.jsx)("input",{type:"text",name:"fieldName",value:rt.fieldName||"",onChange:ja,disabled:"certificateCode"===rt.fieldName}),Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:certificate-design.type-field"),"*"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(T.a,{name:"fieldType",value:rt.fieldType,onChange:ja,disabled:"certificateCode"===rt.fieldName,children:Ct.map((function(e,t){return Object(n.jsx)(Y.a,{value:e.id,children:Object(n.jsx)("em",{children:e.value})},"field-type-option".concat(t))}))})})]}),Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:documents-design.field"),"*"]}),Object(n.jsx)(uo.a,{type:"text",name:"exampleText",value:rt.exampleText||"",style:{borderRadius:"16px"},onChange:dt?function(e){ts(e)&&ot(Object(m.a)(Object(m.a)({},rt),{},Object(b.a)({},e.target.name,e.target.value)))}:ja,endAdornment:Object(n.jsx)(Rn.a,{position:"end",children:dt?"".concat(""===rt.exampleText?"":":","CK09aABbAz"):""})}),52===rt.fieldTypeConfig&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:certificate-design.align-letter"),"*"]}),Object(n.jsxs)("div",{children:[Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(um.a,{}),checkedIcon:Object(n.jsx)(um.a,{}),name:"align",value:"center",checked:"center"===rt.align,onChange:ja}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(bm.a,{}),checkedIcon:Object(n.jsx)(bm.a,{}),name:"align",value:"left",checked:"left"===(null===rt||void 0===rt?void 0:rt.align),onChange:ja}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(jm.a,{}),checkedIcon:Object(n.jsx)(jm.a,{}),name:"align",value:"right",checked:"right"===(null===rt||void 0===rt?void 0:rt.align),onChange:ja})]})]}),Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:certificate-design.font"),"*"]}),Object(n.jsx)(Xo,{name:"fontFamily",value:rt.fontFamily||null,placeholder:"Selecciona un tipo de letra",options:Ot,getOptionLabel:function(e){return e.family},getOptionSelected:function(e){return e.family},onChange:function(e,t){return function(e){if((null===e||void 0===e?void 0:e.family)&&!ft.includes(e.family)){var t=[].concat(Object(p.a)(ft),[e.family]);ht(t),vo.a.load({google:{families:[e.family]},active:function(){ot(Object(m.a)(Object(m.a)({},rt),{},{fontFamily:e}))}})}else ot(Object(m.a)(Object(m.a)({},rt),{},{fontFamily:e}))}(t)}}),Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:certificate-design.size-letter"),"*"]}),Object(n.jsx)("input",{type:"number",name:"fontSize",value:rt.fontSize||"",onChange:ja,onKeyUp:lo,style:{borderRadius:"16px",border:"1px solid #C4C4C4",paddingLeft:"1em"}}),Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:certificate-design.style-letter"),"*"]}),Object(n.jsxs)("div",{children:[Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(nm.a,{}),checkedIcon:Object(n.jsx)(nm.a,{}),name:"bold",checked:null===rt||void 0===rt||null===(y=rt.fontStyle)||void 0===y?void 0:y.bold,onChange:function(e){return ba(Object(m.a)(Object(m.a)({},rt.fontStyle),{},{bold:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(rm.a,{}),checkedIcon:Object(n.jsx)(rm.a,{}),name:"italic",checked:null===rt||void 0===rt||null===(w=rt.fontStyle)||void 0===w?void 0:w.italic,onChange:function(e){return ba(Object(m.a)(Object(m.a)({},rt.fontStyle),{},{italic:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(om.a,{}),checkedIcon:Object(n.jsx)(om.a,{}),name:"underline",checked:null===rt||void 0===rt||null===(C=rt.fontStyle)||void 0===C?void 0:C.underline,onChange:function(e){return ba(Object(m.a)(Object(m.a)({},rt.fontStyle),{},{underline:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(lm.a,{}),checkedIcon:Object(n.jsx)(lm.a,{}),name:"strikethrough",checked:null===rt||void 0===rt||null===(k=rt.fontStyle)||void 0===k?void 0:k.strikethrough,onChange:function(e){return ba(Object(m.a)(Object(m.a)({},rt.fontStyle),{},{strikethrough:e.target.checked}))}})]}),Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:certificate-design.colour"),"*"]}),Object(n.jsx)(wo,{color:(null===(N=rt.fontColor)||void 0===N?void 0:N.hex)||"#000000",changeColor:pa})]})}),Object(n.jsx)(_.a,{dividers:!0,className:!ut&&te.fieldButtonDisabled,children:Object(n.jsxs)("div",{className:te.content_modal,children:[Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:certificate-design.colour-text"),"*"]}),Object(n.jsx)(wo,{color:(null===(B=rt.fontColor)||void 0===B?void 0:B.hex)||"#000000",changeColor:pa}),Object(n.jsxs)("p",{children:[oa("certificateBadgeTemplate:certificate-design.colour-background"),"*"]}),Object(n.jsx)(wo,{color:(null===(A=rt.rectColor)||void 0===A?void 0:A.hex)||"#000000",changeColor:function(e){ot(Object(m.a)(Object(m.a)({},rt),{},{rectColor:U?{hex:e.hex}:e}))}})]})}),Object(n.jsxs)(Ae.a,{children:[Object(n.jsx)(es,{color:"primary",variant:"contained",onClick:function(){if(function(){var e,t,a;return!dt&&!ut&&(!(null===(e=rt.exampleText)||void 0===e?void 0:e.length)>0||!rt.fontSize>0||!rt.fontFamily||52===rt.fieldTypeConfig&&(!(null===(t=rt.fieldName)||void 0===t?void 0:t.length)>0||!(null===(a=rt.exampleText)||void 0===a?void 0:a.length)>0||!rt.fontSize>0||!rt.fontFamily||!rt.fieldType))}())return F.a.fire({icon:"info",iconColor:E.a.primary,text:oa("alerts:alerts.certificate-all-fields"),showConfirmButton:!1,timer:1500,customClass:{container:te.sweetModal}});if(dt&&(rt.exampleText=rt.exampleText.trim()),!(rt.index>=0))I.push(Object(m.a)(Object(m.a)({},rt),{},{page:null===P||void 0===P?void 0:P.page,width:"auto",height:null===rt||void 0===rt?void 0:rt.fontSize})),Lt(null);else{var e=rt.index;delete rt.index,I[e]=rt,!ut&&Yt(e)}Se(rt.exampleText),!ut&&zt(51!==rt.fieldTypeConfig),z(Object(p.a)(I)),ot({fieldType:41,fieldTypeConfig:51,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0}),ue(!1)},children:oa("buttons:buttons.save")}),Object(n.jsx)(es,{color:"primary",variant:"contained",onClick:ua,children:oa("buttons:buttons.close")})]})]}),Object(n.jsx)(O.a,{open:pe,fullWidth:!0,maxWidth:"sm",children:Object(n.jsxs)(_.a,{children:[Object(n.jsxs)(Dr.a,{value:ea,onChange:function(e,t){ta(t)},indicatorColor:"secondary",textColor:"secondary",variant:"fullWidth",children:[Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:oa("buttons:buttons.draw")}),Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:oa("buttons:buttons.write")}),Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:oa("buttons:buttons.upload")})]}),Object(n.jsxs)(ye.a,{container:!0,children:[0===ea&&Object(n.jsx)(tb,{closeModalSign:ma,saveSign:fa,progressBar:ia,emailUser:W.correo}),1===ea&&Object(n.jsx)(rb,{closeModalSign:ma,saveSign:fa,progressBar:ia,nameUser:"".concat(W.data_user.primer_nombre," ").concat(W.data_user.primer_apellido),emailUser:W.correo,fontsFamilys:bt}),2===ea&&Object(n.jsx)(lb,{closeModalSign:ma,saveSign:fa,progressBar:ia,emailUser:W.correo})]})]})}),Object(n.jsx)(O.a,{open:xe,fullWidth:!0,maxWidth:"xl",children:Object(n.jsx)(_.a,{children:Object(n.jsx)(ub,{closeModalSignatories:function(){Oe(!1)},emailCurrent:null===W||void 0===W?void 0:W.correo,documentsFields:I,setDocumentsFields:z,signatories:Jt,setSignatories:Xt,formDocuments:P})})}),Object(n.jsx)(_t,{loading:re})]})}));var fb=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),hb=Object(C.a)((function(e){return{root:{marginTop:"1em"},avatar:{width:"auto",height:"auto","&:hover":{cursor:"pointer"}},icon:{margin:20,fontSize:"4em"},img:function(e){var t,a;return{maxWidth:"70vw",height:null===(t=e.imageRef)||void 0===t||null===(a=t.current)||void 0===a?void 0:a.naturalHeight}},buttonDialog:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"},buttonForm:{margin:"0.5em",padding:"9px 40px"},dropzone:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",borderColor:E.a.primary,borderRadius:15,"& .MuiGrid-container":{justifyContent:"center"}},dropzoneParagraph:{color:"gray",fontSize:"1.1em"}}})),gb={setDocumentsFields:I.u,changeBreadcrump:I.a,setFormDocuments:I.y,setSaveDesign:I.D},xb=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,formDocuments:e.formDocuments||[],documentsFields:e.documentsFields,returnRoute:e.returnRoute,saveDesign:e.saveDesign}}),gb)((function(e){var t,a=e.user,r=e.organizationId,c=e.formDocuments,o=e.returnRoute,s=e.setFormDocuments,l=e.documentsFields,p=e.setDocumentsFields,j=e.changeBreadcrump,v=e.saveDesign,y=e.setSaveDesign,w=Object(u.g)(),C=hb({formDocuments:c}),k=Object(i.useRef)(),N=Object(i.useRef)([]),B=Object(i.useState)(!1),S=Object(d.a)(B,2),A=S[0],I=S[1],P=Object(i.useState)([]),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!1),W=Object(d.a)(U,2),q=W[0],H=W[1],K=Object(i.useState)(!1),V=Object(d.a)(K,2),G=V[0],Q=V[1],J=Object(i.useState)(!!c.img_prev),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=1===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,te=Pe()("certika-organization-".concat(ee?1:r)).toString(),ne=Pe()("certika-user-".concat(ee?1:null===a||void 0===a||null===(t=a.data_user)||void 0===t?void 0:t.id)).toString(),ie=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","breadCrumps","tables"]),re=Object(d.a)(ie,1)[0];Object(i.useEffect)((function(){ce()}),[]);var ce=function(){var t=Object(h.a)(f.a.mark((function t(){var n;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,I(!0),t.next=4,oe();case 4:if(!!!e.match.params.id){t.next=13;break}return t.next=8,se();case 8:j(re("breadCrumps:breadCrumps.documents-template-edit",{returnObjects:!0})),y(!0),$(!0),t.next=15;break;case 13:s(Object(m.a)(Object(m.a)({},c),{},{id_organizaciones:1!==a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?r:"",id_usuarios:null===(n=a.data_user)||void 0===n?void 0:n.id,change_template:0,page:1})),j(re("breadCrumps:breadCrumps.documents-template-create",{returnObjects:!0}));case 15:I(!1),t.next=20;break;case 18:t.prev=18,t.t0=t.catch(0);case 20:case"end":return t.stop()}}),t,null,[[0,18]])})));return function(){return t.apply(this,arguments)}}(),oe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations/names");case 2:t=e.sent,a=t.data,L(a.organizations);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),se=function(){var t=Object(h.a)(f.a.mark((function t(){var n,i,r,c,o,l,d,u,b,j,h,g;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,l=Object(Ie.a)(e.match.params.id),t.next=4,Ce.a.get("/documentTemplate/".concat(l));case 4:d=t.sent,u=d.data,b=u.documentTemplate,j=b.documentTemplate,h=b.linkPhoto,g=b.linkPhotoTemplate,p(null===(n=u.documentTemplate)||void 0===n||null===(i=n.documentTemplate)||void 0===i?void 0:i.documentoCampos.map((function(e){return{id:e.id,fieldTypeConfig:""===e.nombre||"certificateCode"===e.nombre?51:52,idSignature:e.nombre.includes("signature")?e.idSignature:null,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fieldName:e.nombre,align:e.formato_letra?e.formato_letra:"center",fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontSize:e.tamano_letra,fontFamily:{family:e.tipo_letra},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseFloat(e.x),y:parseFloat(e.y),width:0===e.width?"auto":e.width,height:0===e.height?e.tamano_letra:e.height,page:e.page}}))),null===(r=u.documentTemplate)||void 0===r||(null===(c=r.documentTemplate)||void 0===c||delete c.documentoCampos),s(Object(m.a)(Object(m.a)({},j),{},{img_prev:h,img_template:g,id_usuarios:null===(o=a.data_user)||void 0===o?void 0:o.id,estado:j.estado,change_template:0,pages:h.length,page:1,fileName:"documento",naturalWidthAndHeight:N.current})),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),w.push("/500");case 15:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(){return t.apply(this,arguments)}}(),de=function(e){s(Object(m.a)(Object(m.a)({},c),{},Object(b.a)({},e.target.name,e.target.value)))},ue=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(!0),(t=new FormData).append("fileName",null===c||void 0===c?void 0:c.fileName),t.append("numPages",null===c||void 0===c?void 0:c.pages),t.append("route","".concat(te,"/documentsTemplate/documents-temp/temp")),e.next=7,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/delete-files-local"),headers:{"Content-Type":"multipart/form-data"},data:t});case 7:I(!1),s(null),p(null),w.push(o);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s(Object(m.a)({},t)),$(!0),I(!1),y(!1);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),be=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(a=t[0])){e.next=16;break}if(n="application/pdf"===a.type,I(!0),(i=new FormData).append("file",a),i.append("fileName",a.name),i.append("route","".concat(te,"/documentsTemplate/documents-temp/temp")),n){e.next=13;break}return e.next=11,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:i}).then(Object(h.a)(f.a.mark((function e(){var t,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/file/getFile",{keyFile:"".concat(te,"/documentsTemplate/documents-temp/temp"),headers:{"Content-Type":"multipart/form-data"}});case 2:t=e.sent,n=t.data,i=Object(m.a)(Object(m.a)({},c),{},{img_prev:[null===n||void 0===n?void 0:n.url],nombre:a.name.split(".")[0],imagen:"newImage",pages:1,page:1,fileName:a.name}),setTimeout((function(){me(i)}),3e3);case 6:case"end":return e.stop()}}),e)})))).catch((function(){return I(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:re("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500})}));case 11:e.next=16;break;case 13:if(!n){e.next=16;break}return e.next=16,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-documents"),headers:{"Content-Type":"multipart/form-data"},data:i}).then((function(e){var t=e.data,n=Object(m.a)(Object(m.a)({},c),{},{img_prev:t.urls,nombre:a.name.split(".")[0],imagen:"",pages:t.numPages,page:1,fileName:a.name});setTimeout((function(){me(n)}),3e3)})).catch((function(){return I(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:re("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500})}));case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,o,d,u,b,j,h,g,x,O,v,_,w;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(h=(null===(t=k.current)||void 0===t?void 0:t.naturalWidth)>(null===(a=k.current)||void 0===a?void 0:a.naturalHeight))||!((null===(n=k.current)||void 0===n?void 0:n.naturalWidth)>950||(null===(i=k.current)||void 0===i?void 0:i.naturalHeight)>700||(null===(r=k.current)||void 0===r?void 0:r.naturalWidth)<768||(null===(o=k.current)||void 0===o?void 0:o.naturalHeight)<512)){e.next=3;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:re("alerts:alerts.horizontal-documents"),showConfirmButton:!0}));case 3:if(h||!((null===(d=k.current)||void 0===d?void 0:d.naturalWidth)>668||(null===(u=k.current)||void 0===u?void 0:u.naturalHeight)>1e3||(null===(b=k.current)||void 0===b?void 0:b.naturalWidth)<400||(null===(j=k.current)||void 0===j?void 0:j.naturalHeight)<600)){e.next=5;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:re("alerts:alerts.vertical-documents"),showConfirmButton:!0}));case 5:s(Object(m.a)(Object(m.a)({},c),{},{naturalWidthAndHeight:N.current})),!(null===l||void 0===l?void 0:l.length)>0&&(g=so(),x=g.dataQr,O=g.dataImg,v=g.dataCode,_=g.dataButtonVerify,p([Object(m.a)({},x),Object(m.a)({},O),Object(m.a)(Object(m.a)({},v),{},{fieldTypeConfig:51}),Object(m.a)({},_)])),void 0!==(w=null===l||void 0===l?void 0:l.findIndex((function(e){return"certificateCode"===e.fieldName})))&&-1!==w&&(l[w].exampleText=l[w].exampleText.includes(":")?l[w].exampleText.split(":")[0]:""),y(!1),Q(!0),I(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),fe=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),"0"!==(null===c||void 0===c?void 0:c.id_organizaciones)){e.next=3;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:re("alerts:alerts.error-organization"),showConfirmButton:!1,timer:1500}));case 3:if(!!(null===c||void 0===c?void 0:c.img_prev)){e.next=6;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:re("alerts:alerts.template-certificate-alert"),showConfirmButton:!1,timer:1500}));case 6:if((null===l||void 0===l?void 0:l.length)>0){e.next=9;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:re("alerts:alerts.no-design-documents"),showConfirmButton:!1,timer:1500}));case 9:if(v){e.next=11;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:re("alerts:alerts.no-accepted-design-documents"),showConfirmButton:!1,timer:1500}));case 11:if(a=c.naturalWidthAndHeight[0].width,n=c.naturalWidthAndHeight[0].height,i=[],c.naturalWidthAndHeight.map((function(e){a<e.width&&(a=e.width),n<e.height&&(n=e.height),i.push({width:e.width,height:e.height})})),r=!c.id,delete c.naturalWidthAndHeight,I(!0),e.prev=18,!r){e.next=25;break}return delete c.img_template,e.next=23,Ce.a.post("/documentTemplate",Object(m.a)(Object(m.a)({},c),{},{width:a,height:n,documentsFields:l,sizes:i}));case 23:e.next=27;break;case 25:return e.next=27,Ce.a.put("/documentTemplate/".concat(c.id),Object(m.a)(Object(m.a)({},c),{},{width:a,height:n,documentsFields:l,sizes:i}));case 27:e.next=35;break;case 29:return e.prev=29,e.t0=e.catch(18),c.naturalWidthAndHeight=N.current,s(c),I(!1),e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:re("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}));case 35:I(!1),F.a.fire({icon:"success",iconColor:E.a.primary,text:re("alerts:alerts.saved"),showConfirmButton:!1,timer:1500}).then((function(){r?w.push("/templates/documents/edited"):w.push(o),s(null),p(null)}));case 37:case"end":return e.stop()}}),e,null,[[18,29]])})));return function(t){return e.apply(this,arguments)}}(),he=function(){H(!1)},ge=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(!0),(n=new FormData).append("fileName",null===c||void 0===c?void 0:c.fileName),n.append("numPages",null===c||void 0===c?void 0:c.pages),n.append("route","".concat(te,"/documentsTemplate/documents-temp/temp")),e.next=7,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/delete-files-local"),headers:{"Content-Type":"multipart/form-data"},data:n});case 7:I(!1),s(Object(m.a)(Object(m.a)({},c),{},{img_prev:null,img_template:null,id_organizaciones:1!==a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?r:"",id_usuarios:null===(t=a.data_user)||void 0===t?void 0:t.id,pages:0})),l&&p(l.map((function(e){return Object(m.a)(Object(m.a)({},e),{},{x:50,y:50})}))),$(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),xe=function(e){e&&!N.current.includes(e)&&N.current.push(e)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:C.root,onSubmit:fe,children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:C.root,children:[!Z&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(Yc.a,{filesLimit:1,acceptedFiles:[".pdf",".png",".jpg"],dropzoneText:re("certificateBadgeTemplate:badges-certificate-form.documents-dropzoneArea"),dropzoneClass:C.dropzone,dropzoneParagraphClass:C.dropzoneParagraph,showFileNames:!1,showAlerts:!0,onChange:be})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:[c.img_prev&&c.img_prev.map((function(e){return Object(n.jsx)(g.a,{imgProps:{ref:xe},src:e,style:{display:"none"}})})),Object(n.jsx)(g.a,{imgProps:{ref:k},alt:"img-prev",src:(null===c||void 0===c?void 0:c.img_template)?1===(null===c||void 0===c?void 0:c.pages)?null===c||void 0===c?void 0:c.img_template:null===c||void 0===c?void 0:c.img_prev[(null===c||void 0===c?void 0:c.page)-1]:(null===c||void 0===c?void 0:c.img_prev)&&(null===c||void 0===c?void 0:c.img_prev[(null===c||void 0===c?void 0:c.page)-1]),variant:"rounded",className:C.avatar,onClick:function(){return H(!(!(null===c||void 0===c?void 0:c.img_prev)||!(null===c||void 0===c?void 0:c.img_prev[(null===c||void 0===c?void 0:c.page)-1])))},children:Object(n.jsx)(le.a,{sx:{margin:2,fontSize:"4em"}})}),Object(n.jsx)(Lt.a,{component:"span",display:"flex",justifyContent:"center",children:Object(n.jsx)(ta.a,{color:"secondary",count:(null===c||void 0===c?void 0:c.pages)||0,onChange:function(e,t){s(Object(m.a)(Object(m.a)({},c),{},{page:t}))},defaultPage:1,size:"small"})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Z&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:6,children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"outlined",component:"span",onClick:ge,children:re("buttons:buttons.change-documents")})}),Object(n.jsx)(ye.a,{item:!0,xs:6,children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"outlined",component:"span",onClick:pe,children:re("buttons:buttons:design-documents")})})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:re("certificateBadgeTemplate:badges-certificate-form.documents-public-name"),name:"nombre",variant:"outlined",size:"small",onChange:de,value:(null===c||void 0===c?void 0:c.nombre)?null===c||void 0===c?void 0:c.nombre:"",placeholder:re("certificateBadgeTemplate:badges-certificate-form.documents-public-name")})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:re("certificateBadgeTemplate:badges-certificate-form.documents-private-name"),name:"nombre_privado",variant:"outlined",size:"small",onChange:de,value:(null===c||void 0===c?void 0:c.nombre_privado)?null===c||void 0===c?void 0:c.nombre_privado:"",placeholder:re("certificateBadgeTemplate:badges-certificate-form.documents-private-name")})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:1===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{children:[re("certificateBadgeTemplate:badges-certificate-form.organization"),"*"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"organizacion",name:"id_organizaciones",onChange:de,value:c.id_organizaciones,placeholder:re("certificateBadgeTemplate:badges-certificate-form.organization"),children:[Object(n.jsx)(Y.a,{value:"0",children:Object(n.jsx)("em",{children:re("selects:selects-autocompletes.select-option-documents")})}),M.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},"organization-".concat(e.id))}))]})})]})})]})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(C.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),type:"submit",children:re("buttons:buttons.save")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonForm),onClick:ue,children:re("buttons:buttons.cancel")})]})]})})}),Object(n.jsxs)(O.a,{open:q,onClose:he,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(C.buttonDialog),onClick:he,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:(null===c||void 0===c?void 0:c.img_template)?1===(null===c||void 0===c?void 0:c.pages)?null===c||void 0===c?void 0:c.img_template:null===c||void 0===c?void 0:c.img_prev[(null===c||void 0===c?void 0:c.page)-1]:(null===c||void 0===c?void 0:c.img_prev)&&(null===c||void 0===c?void 0:c.img_prev[(null===c||void 0===c?void 0:c.page)-1]),className:C.img})})]}),Object(n.jsx)(_t,{loading:A}),Object(n.jsx)(O.a,{open:G,fullScreen:!0,TransitionComponent:fb,children:Object(n.jsx)(jb,{setOpenDesignDocuments:Q,user:a,md5OrganizationRoute:te,md5UserRoute:ne,handleCancelGeneral:ue,handleSubmit:fe})})]})})),Ob=Object(C.a)((function(){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var vb={setFormDocuments:I.y,setDocumentsFields:I.u,setReturnRoute:I.C},_b=Object(s.b)((function(e){return{permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas documentos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),formDocuments:e.formDocuments}}),vb)((function(e){var t=e.children,a=e.Index,i=e.permission,r=e.setFormDocuments,c=e.setDocumentsFields,o=e.setReturnRoute,s=e.formDocuments,l=Ob(),m=Object(u.g)(),b=Object(u.h)(),p=Object(D.a)(["tabs","buttons"]),j=Object(d.a)(p,1)[0],g=j("tabs:tabs.tabs-documents",{returnObjects:!0}),O=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null===s||void 0===s?void 0:s.fileName)){e.next=6;break}return(t=new FormData).append("fileName",null===s||void 0===s?void 0:s.fileName),t.append("numPages",null===s||void 0===s?void 0:s.pages),e.next=6,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/delete-files-local"),headers:{"Content-Type":"multipart/form-data"},data:t});case 6:o(b.pathname),r(null),c(null),m.push("/templates/documents/create");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[i.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:l.button,onClick:function(){O()},children:Object(n.jsx)("span",{children:j("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),function(){if(i.includes("Leer"))return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Rr,{Index:a,TabsHeader:g}),t]});m.push("/dashboard"),window.location.reload()}()]})}));var yb=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"},img_vertical:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"},img_horizontal:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"},iconButton:{margin:"0em -.4em"}}})),wb={changeBreadcrump:I.a,changePage:I.b,setReturnRoute:I.C,setDetails:I.r},Cb=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas documentos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),wb)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.permission,b=e.changePage,p=e.setReturnRoute,j=e.setDetails,v=e.searchValue,y=Object(u.g)(),w=Object(i.useState)(!1),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)(!1),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)([]),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(M),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(!1),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(""),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(""),te=Object(d.a)(ee,2),ne=te[0],ie=te[1],re=Object(i.useState)(""),ce=Object(d.a)(re,2),oe=ce[0],se=ce[1],le=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),de=Object(d.a)(le,1)[0],ue=yb();Object(i.useEffect)((function(){b(0),me().catch((function(){y.push("/500"),window.location.reload()})),c(be())}),[]);var me=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(N(!0),v&&""!==v){e.next=4;break}return e.next=4,he();case 4:N(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),be=function(){return de("breadCrumps:breadCrumps.documents-published",{returnObjects:!0})},pe=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,je=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,fe=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),he=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!pe){e.next=9;break}return e.next=3,Ce.a.post("/documentTemplate/getDocumentTemplatesPublished");case 3:t=e.sent,a=t.data,L(a.documentTemplates),q(a.documentTemplates),e.next=14;break;case 9:return e.next=11,Ce.a.post("/documentTemplate/getDocumentTemplatesPublished",{id_organizaciones:s});case 11:n=e.sent,i=n.data,je||fe?(c=null===(r=i.documentTemplates)||void 0===r?void 0:r.filter((function(e){return e.plantillasDocumentosHistorial[0].id_usuarios===o.data_user.id})),L(c),q(c)):(L(i.documentTemplates),q(i.documentTemplates));case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ge=function(e,t,a){switch(a){case"copy":xe(e,t);break;case"edit":p("/templates/documents/published"),y.push("/templates/documents/edit/".concat(Object(Ie.b)(t)));break;case"archive":Oe(t);break;case"delete":ve(t)}},xe=function(e,t){F.a.fire({text:de("alerts:alerts.copy-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:de("buttons:buttons.accept"),cancelButtonText:de("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&_e(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},Oe=function(e){F.a.fire({text:de("alerts:alerts.archive-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:de("buttons:buttons.accept"),cancelButtonText:de("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ye(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ve=function(e){F.a.fire({text:de("alerts:alerts.delete-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:de("buttons:buttons.accept"),cancelButtonText:de("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&we(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},_e=function(e,t){var a,n,i,r,c,l;t.preventDefault(),z(!0);var d=null===M||void 0===M?void 0:M.filter((function(t){return t.id===e})),u=Object(m.a)(Object(m.a)({},d[0]),{},{copy:!0,nombre:"".concat(null===(a=d[0])||void 0===a?void 0:a.nombre," copia"),nombre_privado:"".concat(null===(null===(n=d[0])||void 0===n?void 0:n.nombre_privado)?"":"".concat(null===(i=d[0])||void 0===i?void 0:i.nombre_privado," copia")),id_usuarios:null===(r=o.data_user)||void 0===r?void 0:r.id,id_organizaciones:s,typeImagen:(null===(c=d[0])||void 0===c?void 0:c.imagen.includes("Pdf"))?"":"newImage",documentsFields:null===(l=d[0])||void 0===l?void 0:l.documentoCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:e.x,y:e.y,width:e.width,height:e.height,page:e.page,align:e.formato_letra||"center"}}))});Ce.a.post("/documentTemplate",u).then((function(e){z(!1),y.push("/templates/documents/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:de("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){z(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:de("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500})}))},ye=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.put("/documentTemplate/updateState/".concat(t),{estado:2,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()});case 3:n=e.sent,n.data&&F.a.fire({text:de("alerts:alerts.archived"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){y.push("/templates/documents/archived")})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),y.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),we=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/documentTemplate/".concat(t),{data:{id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id}}).catch((function(){y.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:de("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){me()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ke=function(e,t){if(l.includes("Editar")){var a=!1;return(je||fe)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:de("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"edit",onClick:function(t){return ge(t,e,"edit")},className:ue.iconButton,children:Object(n.jsx)(Wn,{})})})}},Be=function(e,t){if(l.includes("Copiar")){var a=!1;return(je||fe)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:de("tables:table.tooltip.copy"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"copy",onClick:function(t){return ge(t,e,"copy")},className:ue.iconButton,children:Object(n.jsx)(Ar.a,{})})})}},Se=function(e,t){if(l.includes("Archivar")){var a=!1;return(je||fe)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:de("tables:table.tooltip.archive"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"archive",onClick:function(t){return ge(t,e,"archive")},className:ue.iconButton,children:Object(n.jsx)(Er.a,{})})})}},Te=function(e,t){if(l.includes("Eliminar")){var a=!1;return(je||fe)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:de("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"delete",onClick:function(t){return ge(t,e,"delete")},className:ue.iconButton,children:Object(n.jsx)(Cn.a,{})})})}},Ee=function(){Q(!1)},De=function(){return de(pe?"tables:table.columns-documents-published-archived-super":"tables:table.columns-documents-published-archived",{returnObjects:!0})},ze=function(e){if(pe)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})};return Object(n.jsxs)(_b,{Index:0,children:[Object(n.jsx)(Fn,{tableName:"templateDocument",type:"published",items:M,setItems:q,changePage:b,loadData:me,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:je,isDeparmentCreaterRoll:fe,userId:o.data_user.id},setLoading:N}),Object(n.jsx)(zn,{columns:De(),rows:Y,setDirection:$,setOrderBy:ie,loading:k,children:Object(n.jsx)(vn.a,{children:Y.length>0?k?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:De(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(Y,Object(I.f)(Z,ne)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:de("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:ue.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,se({photo:t,width:a,height:n}),void Q(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),ze(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.documentosEmitidos}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado?de("tables:table.state.published"):" "}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:de("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return function(e){j(e),y.push("/templates/documents/published/details/".concat(Object(Ie.b)(e.id)))}(e)},className:ue.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:ke(e.id,e.plantillasDocumentosHistorial[0].id_usuarios)}),Object(n.jsx)(yn.a,{align:"center",children:Se(e.id,e.plantillasDocumentosHistorial[0].id_usuarios)}),Object(n.jsx)(yn.a,{align:"center",children:Be(e.id,e.plantillasDocumentosHistorial[0].id_usuarios)}),Object(n.jsx)(yn.a,{align:"center",children:Te(e.id,e.plantillasDocumentosHistorial[0].id_usuarios)})]},e.id)}))}):k?Object(n.jsx)(qn,{columns:De(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:de("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:G,onClose:Ee,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(ue.btnClose),onClick:Ee,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:oe.photo,className:oe.width>oe.height?ue.img_horizontal:ue.img_vertical})})]}),Object(n.jsx)(_t,{loading:A})]})})),kb=a(571),Nb=a.n(kb);var Bb=function(e){var t=e.children,a=e.Index,i=e.Buttons,r=e.documentsId,c=Object(D.a)("tabs"),o=(0,Object(d.a)(c,1)[0])("tabs.tabs-details",{returnObjects:!0}),s=[{label:"Detalle",route:"/templates/documents/published/details/".concat(Object(Ie.b)(r))},{label:"Historial",route:"/templates/documents/published/history/".concat(Object(Ie.b)(r))}];return s.map((function(e,t){return o.filter((function(a,n){return t===n?e.label=a.label:""}))})),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:i}),Object(n.jsx)(Rr,{Index:a,TabsHeader:s}),t]})},Sb=a(325),Tb=a.n(Sb);var Ab=Object(C.a)((function(e){return{root:{marginTop:"2em",marginBottom:"2em"},icon:{margin:20,fontSize:"4em"},avatar:{width:"auto",height:"auto","&:hover":{cursor:"pointer"}},img:function(e){var t;return{maxWidth:"70vw",height:null===(t=e.documentsTemplate)||void 0===t?void 0:t.height}},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 30px","&:hover":{backgroundColor:E.a.footer}},buttonForm:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"}}})),Eb={changeBreadcrump:I.a,setReturnRoute:I.C},Ib=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas documentos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),details:e.details}}),Eb)((function(e){var t=e.user,a=e.changeBreadcrump,r=e.permission,c=e.setReturnRoute,o=e.details,s=Object(u.g)(),l=Object(i.useState)(!1),b=Object(d.a)(l,2),p=b[0],j=b[1],v=Object(i.useState)(!1),y=Object(d.a)(v,2),w=y[0],C=y[1],k=Object(i.useState)({}),N=Object(d.a)(k,2),B=N[0],S=N[1],T=Object(i.useState)([]),A=Object(d.a)(T,2),I=A[0],z=A[1],P=Object(i.useState)(!1),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Ab({documentsTemplate:B}),Y=Object(i.useState)({}),q=Object(d.a)(Y,2),H=q[0],V=q[1],G=Object(i.useState)(!1),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(D.a)(["certificateBadgeTemplate","tables","alerts","buttons","breadCrumps"]),$=Object(d.a)(Z,1)[0];Object(i.useEffect)((function(){ee().catch((function(){s.push("/500"),window.location.reload()}))}),[]);var ee=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j(!0),e.next=3,te();case 3:j(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),te=function(){var e=Object(h.a)(f.a.mark((function e(){var a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{i=6===t.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,r=6===(null===(a=t.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===a?void 0:a.rol),S(o),z(null===o||void 0===o?void 0:o.documentosEmitidos),ae(null===o||void 0===o?void 0:o.estado),V(Object(m.a)(Object(m.a)({},o),{},{copy:!0,nombre:"".concat(null===o||void 0===o?void 0:o.nombre," copia"),nombre_privado:"".concat(null===(null===o||void 0===o?void 0:o.nombre_privado)?"":"".concat(null===o||void 0===o?void 0:o.nombre_privado," copia")),id_usuarios:null===(n=t.data_user)||void 0===n?void 0:n.id,typeImagen:(null===o||void 0===o?void 0:o.imagen.includes("Pdf"))?"":"newImage",documentsFields:null===o||void 0===o?void 0:o.documentoCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:e.x,y:e.y,width:e.width,height:e.height,page:e.page,align:e.formato_letra||"center"}}))})),(i||r)&&((null===o||void 0===o?void 0:o.plantillasDocumentosHistorial[0].id_usuarios)===(null===(c=t.data_user)||void 0===c?void 0:c.id)?X(!1):X(!0))}catch(l){s.push("/500")}case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=function(e){var t,n;1===e?(a($("breadCrumps:breadCrumps.documents-details-published",{returnObjects:!0})),c(null===(t=$("breadCrumps:breadCrumps.documents-details-published",{returnObjects:!0})[2])||void 0===t?void 0:t.route)):0===e?(a($("breadCrumps:breadCrumps.documents-details-edited",{returnObjects:!0})),c(null===(n=$("breadCrumps:breadCrumps.documents-details-edited",{returnObjects:!0})[2])||void 0===n?void 0:n.route)):a($("breadCrumps:breadCrumps.documents-details-archived",{returnObjects:!0}))},ne=function(e,t,a){switch(a){case"archive":ie(t);break;case"publish":re(t);break;case"delete":ce(t)}},ie=function(e){F.a.fire({text:$("alerts:alerts.archive-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:$("buttons:buttons.accept"),cancelButtonText:$("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&se(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},re=function(e){F.a.fire({text:$("alerts:alerts.publish-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:$("buttons:buttons.accept"),cancelButtonText:$("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&oe(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ce=function(e){F.a.fire({text:$("alerts:alerts.delete-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:$("buttons:buttons.accept"),cancelButtonText:$("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&le(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},oe=function(){var e=Object(h.a)(f.a.mark((function e(a){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.put("/documentTemplate/updateState/".concat(a),{estado:1,id_usuarios:null===(n=t.data_user)||void 0===n?void 0:n.id,fecha_ultima_modificacion:Date.now()});case 3:i=e.sent,i.data&&F.a.fire({text:$("alerts:alerts.published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){s.push("/templates/documents/published")})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),s.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),se=function(){var e=Object(h.a)(f.a.mark((function e(a){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.put("/documentTemplate/updateState/".concat(a),{estado:2,id_usuarios:null===(n=t.data_user)||void 0===n?void 0:n.id,fecha_ultima_modificacion:Date.now()});case 3:i=e.sent,i.data&&F.a.fire({text:$("alerts:alerts.archived"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){s.push("/templates/documents/archived")})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),s.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),le=function(){var e=Object(h.a)(f.a.mark((function e(a){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/documentTemplate/".concat(a),{data:{id_usuarios:null===(n=t.data_user)||void 0===n?void 0:n.id}});case 3:i=e.sent,i.data&&(0===(null===B||void 0===B?void 0:B.estado)?F.a.fire({text:$("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){s.push("/templates/documents/edited")})):F.a.fire({text:$("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){s.push("/templates/documents/published")}))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),s.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),de=function(){s.push("/templates/documents/edit/".concat(Object(Ie.b)(null===B||void 0===B?void 0:B.id)))},ue=function(e,t){F.a.fire({text:$("alerts:alerts.copy-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:$("buttons:buttons.accept"),cancelButtonText:$("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&me(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},me=function(e,t){t.preventDefault(),C(!0),Ce.a.post("/documentTemplate",e).then((function(e){j(!1),s.push("/templates/documents/edited"),F.a.fire({icon:"success",iconColor:E.a.primary,text:$("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){C(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:$("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500})}))},be=function(){L(!1)};return Object(n.jsxs)(Bb,{Index:0,Buttons:0===(null===B||void 0===B?void 0:B.estado)?Object(n.jsxs)(n.Fragment,{children:[r.includes("Publicar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$("tables:table.tooltip.publish"),children:Object(n.jsx)(x.a,{className:U.button,onClick:function(e){return ne(e,null===B||void 0===B?void 0:B.id,"publish")},children:Object(n.jsx)(ci.a,{})})})}),r.includes("Editar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$("tables:table.tooltip.edit"),children:Object(n.jsx)(x.a,{className:U.button,onClick:de,children:Object(n.jsx)(Wn,{})})})}),r.includes("Copiar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$("tables:table.tooltip.copy"),children:Object(n.jsx)(x.a,{disabled:J,className:U.button,onClick:function(e){return ue(e,H)},children:Object(n.jsx)(Ar.a,{})})})}),r.includes("Eliminar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$("tables:table.tooltip.delete"),children:Object(n.jsx)(x.a,{className:U.button,onClick:function(e){return ne(e,null===B||void 0===B?void 0:B.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]}):1===(null===B||void 0===B?void 0:B.estado)?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(n.Fragment,{children:[r.includes("Editar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$("tables:table.tooltip.edit"),children:Object(n.jsx)(x.a,{disabled:J,className:U.button,onClick:de,children:Object(n.jsx)(Wn,{})})})}),r.includes("Copiar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$("tables:table.tooltip.copy"),children:Object(n.jsx)(x.a,{disabled:J,className:U.button,onClick:function(e){return ue(e,H)},children:Object(n.jsx)(Ar.a,{})})})}),0!==I?r.includes("Archivar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$("tables:table.tooltip.archive"),children:Object(n.jsx)(x.a,{disabled:J,className:U.button,onClick:function(e){return ne(e,null===B||void 0===B?void 0:B.id,"archive")},children:Object(n.jsx)(Er.a,{})})})}):r.includes("Eliminar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$("tables:table.tooltip.delete"),children:Object(n.jsx)(x.a,{disabled:J,className:U.button,onClick:function(e){return ne(e,null===B||void 0===B?void 0:B.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]})}):2===(null===B||void 0===B?void 0:B.estado)?Object(n.jsx)(n.Fragment,{children:r.includes("Publicar")&&Object(n.jsx)(ye.a,{item:!0,lg:2,md:2,xs:5,children:Object(n.jsx)(K.a,{title:$("tables:table.tooltip.publish"),children:Object(n.jsx)(x.a,{className:U.button,onClick:function(e){return ne(e,null===B||void 0===B?void 0:B.id,"publish")},children:Object(n.jsx)(ci.a,{})})})})}):void 0,documentsId:Object(Ie.a)(e.match.params.id),children:[Object(n.jsx)(ve.a,{children:Object(n.jsxs)(_e.a,{className:U.root,maxWidth:"lg",children:[Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:5,md:5,xs:12,children:Object(n.jsx)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:p?Object(n.jsx)(Be.a,{variant:"circle",children:Object(n.jsx)(g.a,{className:U.avatar})}):Object(n.jsx)(K.a,{title:$("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"img-prev",src:B.linkPhotoTemplate?B.linkPhotoTemplate:B.linkPhoto,variant:"square",className:U.avatar,onClick:function(){return L(!0)},children:Object(n.jsx)(Nb.a,{className:U.icon})})})})}),Object(n.jsx)(ye.a,{item:!0,lg:7,md:7,xs:12,children:Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:U.textTitle,children:p?Object(n.jsx)(Be.a,{}):"".concat(null===B||void 0===B?void 0:B.nombre)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{variant:"h6",gutterBottom:!0,className:U.textTitle,children:p?Object(n.jsx)(Be.a,{}):"".concat(null===(null===B||void 0===B?void 0:B.nombre_privado)?"":null===B||void 0===B?void 0:B.nombre_privado)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:p?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:U.textBolder,children:[$("certificateBadgeTemplate:details.created"),": "]}),Object(n.jsx)("span",{className:U.text,children:Ne()(null===B||void 0===B?void 0:B.fecha_creacion).format("DD-MM-YYYY")})]})})]})})]}),Object(n.jsx)(W.a,{className:U.root})]})}),Object(n.jsxs)(O.a,{open:M,onClose:be,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(U.buttonForm),onClick:be,children:Object(n.jsx)(Tb.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:B.linkPhotoTemplate?B.linkPhotoTemplate:B.linkPhoto,className:U.img})})]}),Object(n.jsx)(_t,{loading:w})]})}));var Db=Object(C.a)((function(){return{root:{display:"flex",alignItems:"center",border:"2.8px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",marginTop:"1rem"}}})),zb={changeBreadcrump:I.a},Pb=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage}}),zb)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=Db(),o=Object(i.useState)(!1),s=Object(d.a)(o,2),l=s[0],u=s[1],m=Object(i.useState)(!1),b=Object(d.a)(m,2),p=b[0],j=b[1],g=Object(i.useState)(!1),x=Object(d.a)(g,2),y=x[0],w=x[1],C=Object(i.useState)([]),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)([]),A=Object(d.a)(T,2),E=A[0],z=A[1],P=Object(i.useState)([{descripcion:"",valor:"",nuevoValor:"",tipo:"",recomendacion:""}]),R=Object(d.a)(P,2),M=R[0],L=R[1],F=Object(i.useState)(""),U=Object(d.a)(F,2),W=U[0],Y=U[1],q=Object(i.useState)(""),H=Object(d.a)(q,2),V=H[0],G=H[1],Q=Object(i.useState)({}),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(D.a)(["tables","breadCrumps","dialogs"]),ee=Object(d.a)($,1)[0];Object(i.useEffect)((function(){te()}),[]);var te=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,u(!0),e.next=4,ne();case 4:return e.next=6,ae();case 6:return u(!1),e.next=9,Ce.a.post("/documentTemplate/getDocumentTemplates",{estado:1});case 9:t=e.sent,a=t.data,B(a.documentTemplates),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(0);case 16:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(){return e.apply(this,arguments)}}(),ae=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/parameterValueParameter/getParameterValueParameter");case 2:t=e.sent,a=t.data,z(a.parametersValueParameters);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/documentTemplateHistory/getDocumentTemplatesHistory",{id_plantillas_documentos:i});case 3:r=t.sent,c=r.data,Z(c.documentTemplatesHistory),ie(null===(a=c.documentTemplatesHistory[0])||void 0===a||null===(n=a.plantillasDocumentos)||void 0===n?void 0:n.estado);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ie=function(e){r(ee(1===e?"breadCrumps:breadCrumps.documents-history-published":0===e?"breadCrumps:breadCrumps.documents-history-edited":"breadCrumps:breadCrumps.documents-history-archived",{returnObjects:!0}))},re=function(e){X.map(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.id===e&&(""!==a.nuevoValor?L([{descripcion:"Creaci\xf3n",valor:N.filter((function(e){return e.id===parseInt(a.nuevoValor)}))}]):L([{descripcion:"Creaci\xf3n",valor:""}]));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),w(!0)},ce=function(e){var t=0,a="";return E.map((function(n){n.id===parseInt(e)&&(t=1,a=n.valor_parametro)})),0===t?e:a},oe=ee("tables:table.columns-history",{returnObjects:!0});return Object(n.jsxs)(Bb,{Index:1,documentsId:Object(Ie.a)(e.match.params.id),children:[Object(n.jsx)(ve.a,{children:Object(n.jsx)(zn,{columns:oe,rows:X,setDirection:Y,setOrderBy:G,loading:l,children:l?Object(n.jsx)(qn,{columns:oe,photo:0}):Object(n.jsx)(vn.a,{children:X.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(X,Object(I.f)(W,V)).slice(t*a,t*a+a).map((function(e){var t,a;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(t=e.usuarios)||void 0===t?void 0:t.primer_nombre," ").concat(null===(a=e.usuarios)||void 0===a?void 0:a.primer_apellido)}),Object(n.jsx)(yn.a,{align:"center",children:ce(e.accion)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:ee("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t="",a=[];X.map(function(){var n=Object(h.a)(f.a.mark((function n(i){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i.id===e&&(34===i.accion?re(e):36===i.accion||37===i.accion?(L([{descripcion:36===i.accion?"Publicado":"Archivado",valor:i.valor,nuevoValor:i.nuevoValor,tipo:"info"}]),j(!0)):(t=i.valor.split("\xbf?")).length>0&&(t.map(function(){var e=Object(h.a)(f.a.mark((function e(t,n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0!==n&&((t=t.split("$%&"))[0].includes("esta")?a.push({descripcion:t[0],valor:t[1],nuevoValor:t[2],tipo:"info",recomendacion:N.filter((function(e){return e.id===parseInt(t[1])}))}):a.push({descripcion:t[0],valor:t[1],nuevoValor:t[2],tipo:"info"}));case 1:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}()),L(a),j(!0)));case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())}(e.id)},children:Object(n.jsx)(Ge.a,{})})})})]},e.id)}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:ee("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:p,onClose:function(){j(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:ee("dialogs:dialog.details")}),Object(n.jsx)(_.a,{children:M.length>0?Object(n.jsx)(n.Fragment,{children:M.map((function(e){return Object(n.jsx)(ye.a,{container:!0,xs:12,className:c.root,children:Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(Qi.a,{severity:e.tipo,children:e.descripcion})})})}))}):""})]}),Object(n.jsxs)(O.a,{open:y,onClose:function(){w(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:ee("dialogs:dialog.details")}),M.length>0?Object(n.jsx)(n.Fragment,{children:M.map((function(e){return Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)(Qi.a,{severity:"info",children:e.descripcion})})}))}):Object(n.jsx)(yn.a,{align:"center",children:ee("tables:table.empty-table")})]})]})}));var Rb=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"},img_vertical:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"},img_horizontal:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"},iconButton:{margin:"0em -.4em"}}})),Mb={changeBreadcrump:I.a,changePage:I.b,setReturnRoute:I.C,setDetails:I.r},Lb=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas documentos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),searchValue:e.searchValue}}),Mb)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.permission,b=e.changePage,p=e.setReturnRoute,j=e.setDetails,v=e.searchValue,y=Object(u.g)(),w=Object(i.useState)(!1),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)(!1),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)([]),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(M),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(!1),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(""),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(""),te=Object(d.a)(ee,2),ne=te[0],ie=te[1],re=Object(i.useState)(""),ce=Object(d.a)(re,2),oe=ce[0],se=ce[1],le=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),de=Object(d.a)(le,1)[0],ue=Rb();Object(i.useEffect)((function(){b(0),me().catch((function(){y.push("/500"),window.location.reload()})),c(be())}),[]);var me=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(N(!0),v&&""!==v){e.next=4;break}return e.next=4,he();case 4:N(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),be=function(){return de("breadCrumps:breadCrumps.documents-edition",{returnObjects:!0})},pe=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,je=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,fe=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),he=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!pe){e.next=9;break}return e.next=3,Ce.a.post("/documentTemplate/getDocumentTemplatesEdited");case 3:t=e.sent,a=t.data,L(a.documentTemplates),q(a.documentTemplates),e.next=14;break;case 9:return e.next=11,Ce.a.post("/documentTemplate/getDocumentTemplatesEdited",{id_organizaciones:s});case 11:n=e.sent,i=n.data,je||fe?(c=null===(r=i.documentTemplates)||void 0===r?void 0:r.filter((function(e){return e.plantillasDocumentosHistorial[0].id_usuarios===o.data_user.id})),L(c),q(c)):(L(i.documentTemplates),q(i.documentTemplates));case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ge=function(e,t,a){switch(a){case"copy":xe(e,t);break;case"edit":p("/templates/documents/edited"),y.push("/templates/documents/edit/".concat(Object(Ie.b)(t)));break;case"publish":Oe(t);break;case"delete":ve(t)}},xe=function(e,t){F.a.fire({text:de("alerts:alerts.copy-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:de("buttons:buttons.accept"),cancelButtonText:de("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&_e(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},Oe=function(e){F.a.fire({text:de("alerts:alerts.publish-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:de("buttons:buttons.accept"),cancelButtonText:de("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ye(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ve=function(e){F.a.fire({text:de("alerts:alerts.delete-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:de("buttons:buttons.accept"),cancelButtonText:de("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&we(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},_e=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,l,d,u,b;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.preventDefault(),z(!0),u=null===M||void 0===M?void 0:M.filter((function(e){return e.id===t})),b=Object(m.a)(Object(m.a)({},u[0]),{},{copy:!0,nombre:"".concat(null===(n=u[0])||void 0===n?void 0:n.nombre," copia"),nombre_privado:"".concat(null===(null===(i=u[0])||void 0===i?void 0:i.nombre_privado)?"":"".concat(null===(r=u[0])||void 0===r?void 0:r.nombre_privado," copia")),id_usuarios:null===(c=o.data_user)||void 0===c?void 0:c.id,id_organizaciones:s,typeImagen:(null===(l=u[0])||void 0===l?void 0:l.imagen.includes("Pdf"))?"":"newImage",documentsFields:null===(d=u[0])||void 0===d?void 0:d.documentoCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:e.x,y:e.y,width:e.width,height:e.height,page:e.page,align:e.formato_letra||"center"}}))}),Ce.a.post("/documentTemplate",b).then((function(e){z(!1),me(),F.a.fire({icon:"success",iconColor:E.a.primary,text:de("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){z(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:de("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500})}));case 5:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),ye=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("documentTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){y.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:de("alerts:alerts.published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){y.push("/templates/documents/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),we=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/documentTemplate/".concat(t),{data:{id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id}}).catch((function(){y.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:de("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){me()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ke=function(e){if(l.includes("Editar"))return Object(n.jsx)(K.a,{title:de("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return ge(t,e,"edit")},className:ue.iconButton,children:Object(n.jsx)(Wn,{})})})},Be=function(e){if(l.includes("Copiar"))return Object(n.jsx)(K.a,{title:de("tables:table.tooltip.copy"),children:Object(n.jsx)(S.a,{"aria-label":"copy",onClick:function(t){return ge(t,e,"copy")},className:ue.iconButton,children:Object(n.jsx)(Ar.a,{})})})},Se=function(e){if(l.includes("Publicar"))return Object(n.jsx)(K.a,{title:de("tables:table.tooltip.publish"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return ge(t,e,"publish")},className:ue.iconButton,children:Object(n.jsx)(ci.a,{})})})},Te=function(e){if(l.includes("Eliminar"))return Object(n.jsx)(K.a,{title:de("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return ge(t,e,"delete")},className:ue.iconButton,children:Object(n.jsx)(Cn.a,{})})})},Ee=function(){Q(!1)},De=function(){return de(pe?"tables:table.columns-documents-edited-super":"tables:table.columns-documents-edited",{returnObjects:!0})},ze=function(e){if(pe)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})};return Object(n.jsxs)(_b,{Index:1,children:[Object(n.jsx)(Fn,{tableName:"templateDocument",type:"edited",items:M,setItems:q,changePage:b,loadData:me,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:je,isDeparmentCreaterRoll:fe,userId:o.data_user.id},setLoading:N}),Object(n.jsx)(zn,{columns:De(),rows:Y,setDirection:$,setOrderBy:ie,loading:k,children:Object(n.jsx)(vn.a,{children:Y.length>0?k?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:De(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(Y,Object(I.f)(Z,ne)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:de("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:ue.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,se({photo:t,width:a,height:n}),void Q(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),ze(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:0===e.estado?de("tables:table.state.edited"):""}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:de("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return function(e){j(e),y.push("/templates/documents/edited/details/".concat(Object(Ie.b)(e.id)))}(e)},className:ue.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:ke(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:Se(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:Be(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:Te(e.id)})]},e.id)}))}):k?Object(n.jsx)(qn,{columns:De(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:de("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:G,onClose:Ee,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(ue.btnClose),onClick:Ee,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:oe.photo,className:oe.width>oe.height?ue.img_horizontal:ue.img_vertical})})]}),Object(n.jsx)(_t,{loading:A})]})}));var Fb=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"},img_vertical:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"},img_horizontal:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"},iconButton:{margin:"0em -.4em"}}})),Ub={changeBreadcrump:I.a,changePage:I.b,setDetails:I.r},Wb=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas documentos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),searchValue:e.searchValue}}),Ub)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.changePage,m=e.permission,b=e.setDetails,p=e.searchValue,j=Object(u.g)(),v=Fb(),y=Object(i.useState)(!1),w=Object(d.a)(y,2),C=w[0],k=w[1],N=Object(i.useState)([]),B=Object(d.a)(N,2),T=B[0],A=B[1],z=Object(i.useState)(T),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)(""),U=Object(d.a)(L,2),W=U[0],Y=U[1],q=Object(i.useState)(""),H=Object(d.a)(q,2),V=H[0],G=H[1],Q=Object(i.useState)(!1),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(""),ee=Object(d.a)($,2),te=ee[0],ne=ee[1],ie=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),re=Object(d.a)(ie,1)[0];Object(i.useEffect)((function(){l(0),ce().catch((function(){j.push("/500"),window.location.reload()})),c(re("breadCrumps:breadCrumps.documents-archived",{returnObjects:!0}))}),[]);var ce=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k(!0),p&&""!==p){e.next=4;break}return e.next=4,de();case 4:k(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),oe=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,se=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,le=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),de=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!oe){e.next=10;break}return e.next=4,Ce.a.post("/documentTemplate/getDocumentTemplatesArchived");case 4:t=e.sent,a=t.data,A(a.documentTemplates),M(a.documentTemplates),e.next=15;break;case 10:return e.next=12,Ce.a.post("/documentTemplate/getDocumentTemplatesArchived",{id_organizaciones:s});case 12:n=e.sent,i=n.data,se||le?(c=null===(r=i.documentTemplates)||void 0===r?void 0:r.filter((function(e){return e.plantillasDocumentosHistorial[0].id_usuarios===o.data_user.id})),A(c),M(c)):(A(i.documentTemplates),M(i.documentTemplates));case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(0),j.push("/500"),window.location.reload();case 21:case"end":return e.stop()}}),e,null,[[0,17]])})));return function(){return e.apply(this,arguments)}}(),ue=function(e){if(m.includes("Publicar"))return Object(n.jsx)(K.a,{title:re("tables:table.tooltip.publish"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return function(e,t,a){switch(a){case"publish":me(t)}}(0,e,"publish")},className:v.iconButton,children:Object(n.jsx)(ci.a,{})})})},me=function(e){F.a.fire({text:re("alerts:alerts.publish-button-documents"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:re("buttons:buttons.accept"),cancelButtonText:re("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&be(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},be=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/documentTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){j.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:re("alerts:alerts.published"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){j.push("/templates/documents/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pe=function(){return re(oe?"tables:table.columns-documents-published-archived-super":"tables:table.columns-documents-published-archived",{returnObjects:!0})},je=function(e){if(oe)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})},fe=function(){Z(!1),ne("")};return Object(n.jsxs)(_b,{Index:2,children:[Object(n.jsx)(Fn,{tableName:"templateDocument",type:"archived",items:T,setItems:M,changePage:l,loadData:ce,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:se,isDeparmentCreaterRoll:le,userId:o.data_user.id},setLoading:k}),Object(n.jsx)(zn,{columns:pe(),rows:R,setDirection:Y,setOrderBy:G,loading:C,children:Object(n.jsx)(vn.a,{children:R.length>0?C?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:pe(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(R,Object(I.f)(W,V)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:re("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:v.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,ne({photo:t,width:a,height:n}),void Z(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),je(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.documentosEmitidos}),Object(n.jsx)(yn.a,{align:"center",children:2===e.estado?re("tables:table.state.archived"):""}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:re("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return function(e){b(e),j.push("/templates/documents/archived/details/".concat(Object(Ie.b)(e.id)))}(e)},className:v.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:ue(e.id)})]},e.id)}))}):C?Object(n.jsx)(qn,{columns:pe(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:re("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:X,onClose:fe,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(v.btnClose),onClick:fe,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:te.photo,className:te.width>te.height?v.img_horizontal:v.img_vertical})})]})]})})),Yb=a(1224);var qb=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),Hb=Object(xe.a)((function(e){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:e.palette.grey["light"===e.palette.type?200:700]},bar:{borderRadius:5,backgroundColor:e.palette.primary}}}))(Oe.a),Kb=Object(C.a)((function(e){return{root:{marginTop:"1em"},avatar:{width:"auto",height:"auto","&:hover":{cursor:"pointer"}},icon:{margin:20,fontSize:"4em"},img:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"},buttonDialog:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"},buttonForm:{margin:"0.5em",padding:"9px 40px"},dropzone:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",borderColor:E.a.primary,borderRadius:15,"& .MuiGrid-container":{justifyContent:"center"}},dropzoneParagraph:{color:"gray",fontSize:"1.1em"},checkbox:{display:"flex",justifyContent:"flex-end"},containerButton:{display:"grid",justifyContent:"center"},button:{margin:"0.5em",padding:"10px 40px"},mySwal:{zIndex:3e3}}})),Vb={setDocumentsFields:I.u,changeBreadcrump:I.a,setFormDocuments:I.y},Gb=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,formDocuments:e.formDocuments||[],documentsFields:e.documentsFields,returnRoute:e.returnRoute}}),Vb)((function(e){var t,a=e.user,r=e.organizationId,c=e.formDocuments,o=e.setFormDocuments,s=e.documentsFields,l=e.setDocumentsFields,p=e.changeBreadcrump,j=Object(u.g)(),y=Kb({formDocuments:c}),w=Object(i.useRef)([]),C=Object(i.useRef)([]),k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],A=N[1],I=Object(i.useState)([]),P=Object(d.a)(I,2),R=P[0],M=P[1],L=Object(i.useState)([]),U=Object(d.a)(L,2),W=U[0],q=U[1],H=Object(i.useState)([]),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!1),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(!(!(null===c||void 0===c?void 0:c.img_prev)||!c.img_prev[(null===c||void 0===c?void 0:c.page)-1])),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ie=1===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,re=Pe()("certika-organization-".concat(ie?1:r)).toString(),oe=Pe()("certika-user-".concat(ie?1:null===a||void 0===a||null===(t=a.data_user)||void 0===t?void 0:t.id)).toString(),se=Object(i.useState)(!1),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(i.useState)([]),be=Object(d.a)(me,2),pe=be[0],fe=be[1],he=Object(i.useState)({correo:"",whatsapp:""}),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ke=Object(i.useState)(!1),Be=Object(d.a)(ke,2),Se=Be[0],Ae=Be[1],Ee=Object(i.useState)(!1),Ie=Object(d.a)(Ee,2),De=Ie[0],ze=Ie[1],Re=Object(i.useState)({}),Me=Object(d.a)(Re,2),Le=Me[0],Fe=Me[1],Ue=Object(i.useState)([]),We=Object(d.a)(Ue,2),Ye=We[0],qe=We[1],He=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","breadCrumps","tables","certifyDocuments"]),Ke=Object(d.a)(He,1)[0],Ve=Object(i.useState)(ae?{title:"".concat(Ke("certifyDocuments:form-certify.uploaded-successfully")),nameFile:null===c||void 0===c?void 0:c.fileName,load:!0,value:100,inProgress:!1}:{title:"",load:!1,value:0,inProgress:!1}),Ge=Object(d.a)(Ve,2),Qe=Ge[0],Je=Ge[1];Object(i.useEffect)((function(){Xe()}),[]);var Xe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,A(!0),e.next=4,Ze();case 4:return e.next=6,$e();case 6:return e.next=8,et();case 8:return e.next=10,tt();case 10:p(Ke("breadCrumps:breadCrumps.documents-certify",{returnObjects:!0})),o(Object(m.a)(Object(m.a)({},c),{},{id_organizaciones:ie?"":r,change_template:c.id_plantillas_documentos&&0!==c.id_plantillas_documentos?c.id_plantillas_documentos:0})),A(!1),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),j.push("/500");case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(){return e.apply(this,arguments)}}(),Ze=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCountries");case 2:t=e.sent,a=t.data,qe(a.countries);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$e=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations/names");case 2:t=e.sent,a=t.data,M(a.organizations);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),et=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ie){e.next=8;break}return e.next=3,Ce.a.post("/documentTemplate/getDocumentTemplatesPublished/names");case 3:t=e.sent,a=t.data,q(a.documentTemplates),e.next=13;break;case 8:return e.next=10,Ce.a.post("/documentTemplate/getDocumentTemplatesPublished/names",{id_organizaciones:r});case 10:n=e.sent,i=n.data,q(i.documentTemplates);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),tt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/documentsCollections/getDocumentsCollections",{id_organizaciones:r});case 2:t=e.sent,a=t.data,Q(a.documentsCollections);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),at=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.get("/documentTemplate/getDocumentTemplateFields/".concat(t));case 3:n=e.sent,i=n.data,l(null===(a=i.documentTemplate)||void 0===a?void 0:a.documentoCampos.map((function(e){return{id:e.id,fieldType:e.tipo_campo_vp,exampleText:e.nombre.includes("certificateCode")?e.texto_ejemplo.split(":")[0]:e.texto_ejemplo,idSignature:e.nombre.includes("signature")?e.idSignature:null,fieldName:e.nombre,fieldTypeConfig:51,align:e.formato_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontSize:e.tamano_letra,fontFamily:{family:e.tipo_letra},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseFloat(e.x),y:parseFloat(e.y),width:e.width,height:e.height,page:e.page}}))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),j.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),nt=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(Object(m.a)(Object(m.a)({},c),{},Object(b.a)({},t.target.name,t.target.value)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),it=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(Object(m.a)(Object(m.a)({},c),{},{id_plantillas_documentos:t.target.value,change_template:t.target.value,nameTemplate:0!==t.target.value?W.find((function(e){return e.id===t.target.value})).nombre:""}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),rt=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(Object(m.a)(Object(m.a)({},c),{},{id_colecciones_documentos:t.target.value,nameArchive:0!==t.target.value?G.find((function(e){return e.id===t.target.value})).nombre:null===c||void 0===c?void 0:c.nombre_archivo}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ot=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),(t=new FormData).append("fileName",null===c||void 0===c?void 0:c.fileName),t.append("numPages",null===c||void 0===c?void 0:c.pages),t.append("route","".concat(re,"/documentsTemplate/documents-temp/temp")),t.append("certify",!0),e.next=8,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/delete-files-local"),headers:{"Content-Type":"multipart/form-data"},data:t});case 8:return e.next=10,ct.a.get("".concat(je.a.apiURL,"/file/getPdfForWhatsapp/delete"));case 10:A(!1),ne(!1),Je({title:"",load:!1,value:0,inProgress:!1}),o({id_organizaciones:c.id_organizaciones}),l(null),w.current=[],C.current=[];case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),st=function(){var e=Object(h.a)(f.a.mark((function e(t,a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(Object(m.a)({},t)),Je({title:"".concat(Ke("certifyDocuments:form-certify.uploaded-successfully")),load:!0,value:100,inProgress:!1,nameFile:a.name}),w.current=[],C.current=[],ne(!0),A(!1);case 6:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),lt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(a=t[0])){e.next=9;break}return(n=new FormData).append("file",a),n.append("fileName",a.name),n.append("certify",!0),n.append("route","".concat(re,"/documentsTemplate/documents-temp/temp")),e.next=9,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-documents"),headers:{"Content-Type":"multipart/form-data"},data:n,onUploadProgress:function(e){var t=e.loaded,a=e.total,n=Math.floor(100*t/a);Je({title:"".concat(Ke("certifyDocuments:form-certify.loading")),load:!1,value:n,inProgress:!0})}}).then((function(e){var t=e.data,n=Object(m.a)(Object(m.a)({},c),{},{img_prev:t.urls,imgHD:t.urlsHD,pages:t.numPages,page:1,fileName:a.name,nombre_documento:a.name.split(".")[0]});setTimeout((function(){st(n,a)}),3e3)}));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),dt=function(e){var t=new Date,a=e.split("-"),n=new Date;return t.setFullYear(a[0],a[1]-1,a[2]),!(t>=n)},ut=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===c||void 0===c?void 0:c.nombre_documento){e.next=2;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Ke("alerts:alerts.required-documents-name"),showConfirmButton:!1,timer:1500}));case 2:if(c.id_plantillas_documentos||0===c.id_plantillas_documentos){e.next=4;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Ke("alerts:alerts.no-select-template-documents"),showConfirmButton:!1,timer:1500}));case 4:if(c.id_colecciones_documentos||0===c.id_colecciones_documentos){e.next=6;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Ke("alerts:alerts.no-select-folder-documents"),showConfirmButton:!1,timer:1500}));case 6:if(0===c.id_plantillas_documentos){e.next=12;break}return c.checkSaveTemplate=!1,e.next=10,at(c.id_plantillas_documentos);case 10:e.next=16;break;case 12:if(!(null===c||void 0===c?void 0:c.checkSaveTemplate)||(null===c||void 0===c?void 0:c.nombre_plantilla)){e.next=14;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Ke("alerts:alerts.required-template-name"),showConfirmButton:!1,timer:1500}));case 14:t=so(),a=t.dataQr,n=t.dataCode,i=t.dataButtonVerify,!s&&l([Object(m.a)(Object(m.a)({},a),{},{page:1}),Object(m.a)(Object(m.a)({},n),{},{page:1,fieldTypeConfig:51}),Object(m.a)(Object(m.a)({},i),{},{page:1})]);case 16:if(0!==(null===c||void 0===c?void 0:c.id_colecciones_documentos)||(null===c||void 0===c?void 0:c.nombre_archivo)){e.next=18;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:Ke("alerts:alerts.required-folder-name"),showConfirmButton:!1,timer:1500}));case 18:o(Object(m.a)(Object(m.a)({},c),{},{naturalWidthAndHeight:w.current,naturalWidthAndHeightHD:C.current})),void 0!==(r=null===s||void 0===s?void 0:s.findIndex((function(e){return"certificateCode"===e.fieldName})))&&-1!==r&&(s[r].exampleText=s[r].exampleText.includes(":")?s[r].exampleText.split(":")[0]:""),c.img_prev&&c.img_prev[(null===c||void 0===c?void 0:c.page)-1]&&$(!0),A(!1);case 23:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),bt=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,o,d,u,b,p,g,x,O,v,_,w,C,k,N;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),u=[],0!==c.id_organizaciones){e.next=4;break}return e.abrupt("return",F.a.fire({customClass:{container:y.mySwal},icon:"error",iconColor:E.a.primary,text:Ke("alerts:alerts.error-organization"),showConfirmButton:!1,timer:1500}));case 4:if(!!c.img_prev[(null===c||void 0===c?void 0:c.page)-1]){e.next=7;break}return e.abrupt("return",F.a.fire({customClass:{container:y.mySwal},icon:"info",iconColor:E.a.primary,text:Ke("alerts:alerts.template-certificate-alert"),showConfirmButton:!1,timer:1500}));case 7:return e.next=9,Ce.a.get("/contract/card/".concat(ie?r:c.id_organizaciones));case 9:if(b=e.sent,(p=b.data).contract){e.next=14;break}return F.a.fire({customClass:{container:y.mySwal},icon:"error",iconColor:E.a.primary,text:Ke("alerts:alerts.no-contract-error"),showConfirmButton:!0}),e.abrupt("return",!1);case 14:if(!((null===p||void 0===p||null===(n=p.contract)||void 0===n?void 0:n.total_emisiones)+1>(null===p||void 0===p||null===(i=p.contract)||void 0===i?void 0:i.cantidad_emisiones))){e.next=17;break}return F.a.fire({customClass:{container:y.mySwal},icon:"error",iconColor:E.a.primary,text:Ke("alerts:alerts.exceeds-contract"),showConfirmButton:!0}),e.abrupt("return",!1);case 17:if(!(null===p||void 0===p||null===(o=p.contract)||void 0===o?void 0:o.vencimiento)||!dt(null===p||void 0===p||null===(d=p.contract)||void 0===d?void 0:d.vencimiento)){e.next=20;break}return F.a.fire({customClass:{container:y.mySwal},icon:"error",iconColor:E.a.primary,text:Ke("alerts:alerts.expired-contract"),showConfirmButton:!0}),e.abrupt("return",!1);case 20:return e.next=22,s.map(function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.fontColor&&(t.fontColor=t.fontColor.hex),t.rectColor&&(t.rectColor=t.rectColor.hex),!t.correo){e.next=12;break}return n=new FormData,i=Qm(t.exampleText),r="".concat(re,"/documentsTemplate/signatories/").concat(t.correo,".png"),u.push({index:a,uri:t.exampleText}),t.exampleText=r,n.append("file",i),n.append("route",r),e.next=12,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:n});case 12:return e.abrupt("return",t);case 13:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}());case 22:return g=c.naturalWidthAndHeight[0].width,x=c.naturalWidthAndHeight[0].height,c.naturalWidthAndHeight.map((function(e){g<e.width&&(g=e.width),x<e.height&&(x=e.height)})),O=c.naturalWidthAndHeightHD[0].width,v=c.naturalWidthAndHeightHD[0].height,_=[],c.naturalWidthAndHeightHD.map((function(e){O<e.width&&(O=e.width),v<e.height&&(v=e.height),_.push({width:e.width,height:e.height})})),w=parseInt(100*(O-g)/g),C=parseInt(100*(v-x)/x),k=Ne()(new Date).format("LLLL"),delete(N=Object(m.a)(Object(m.a)({},c),{},{width:O,height:v,templateWidth:g,templateHeight:x,saltosWidth:w,saltosHeight:C,sizes:_,trailDate:k})).img_template,delete N.naturalWidthAndHeight,delete N.naturalWidthAndHeightHD,A(!0),e.prev=37,e.next=40,Ce.a.post("/documentsCertify",{dataToSend:N,documentsFields:s}).then((function(e){Array.prototype.forEach.call(a,(function(e){return e.remove()})),fe(e),$(!1),A(!1)}));case 40:e.next=48;break;case 42:return e.prev=42,e.t0=e.catch(37),s.map((function(e,t){return e.fontColor&&(e.fontColor={hex:e.fontColor}),e.rectColor&&(e.rectColor={hex:e.rectColor}),"certificateCode"===e.fieldName&&e.exampleText.includes(":")&&(e.exampleText=e.exampleText.split(":")[0]),e.correo&&(e.exampleText=u.filter((function(e){return e.index===t}))[0].uri),e})),l(s),A(!1),e.abrupt("return",F.a.fire({customClass:{container:y.mySwal},icon:"error",iconColor:E.a.primary,text:Ke("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}));case 48:F.a.fire({customClass:{container:y.mySwal},icon:"success",iconColor:E.a.primary,text:Ke("alerts:alerts.saved"),showConfirmButton:!1,timer:1500}).then((function(){s.filter((function(e){return e.correo})).length>0?F.a.fire({icon:"success",iconColor:E.a.primary,text:Ke("alerts:alerts.document-send-signatorie"),showConfirmButton:!0,confirmButtonText:Ke("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:y.mySwal,confirmButton:"custom-button-confirm"}}).then((function(){ot(),j.push("/documents/files")})):ue(!0)}));case 49:case"end":return e.stop()}}),e,null,[[37,42]])})));return function(t,a){return e.apply(this,arguments)}}(),pt=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),(t=new FormData).append("fileName",null===c||void 0===c?void 0:c.fileName),t.append("numPages",null===c||void 0===c?void 0:c.pages),t.append("route","".concat(re,"/documentsTemplate/documents-temp/temp")),t.append("certify",!0),e.next=8,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/delete-files-local"),headers:{"Content-Type":"multipart/form-data"},data:t});case 8:A(!1),o(Object(m.a)(Object(m.a)({},c),{},{img_prev:null,img_template:null,pages:0,nombre_documento:""})),Je({title:"",load:!1,value:0,inProgress:!1}),ne(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),jt=function(e){e&&!w.current.includes(e)&&w.current.push(e)},ft=function(e){e&&!C.current.includes(e)&&C.current.push(e)},ht=function(){var e=Object(h.a)(f.a.mark((function e(t){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),A(!0),(i=new FormData).append("id",null===pe||void 0===pe||null===(n=pe.data)||void 0===n?void 0:n.reportes[0].id),i.append("email_receptor",xe.correo),i.append("nombre",null===c||void 0===c?void 0:c.nombre_documento),i.append("share",!1),i.append("sub",a.data_user.id),e.prev=8,e.next=11,ct()({method:"post",url:"".concat(je.a.apiURL,"/share/sendDocumentsCertify"),headers:{"Content-Type":"multipart/form-data"},data:i}).then((function(e){if(201===e.status)return A(!1),F.a.fire({customClass:{container:y.mySwal},text:Ke("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3})}));case 11:e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(8),A(!1),e.abrupt("return",F.a.fire({customClass:{container:y.mySwal},text:Ke("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}));case 17:A(!1),F.a.fire({customClass:{container:y.mySwal},text:Ke("alerts:alerts.send-successfully"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}),Ae(!1),Oe(Object(m.a)(Object(m.a)({},xe),{},{correo:""}));case 21:case"end":return e.stop()}}),e,null,[[8,13]])})));return function(t){return e.apply(this,arguments)}}(),gt=function(){var e=Object(h.a)(f.a.mark((function e(t){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),A(!0),!(null===xe||void 0===xe?void 0:xe.whatsapp)){e.next=26;break}if(!((null===xe||void 0===xe?void 0:xe.whatsapp.length)<10)){e.next=6;break}return A(!1),e.abrupt("return",F.a.fire({customClass:{container:y.mySwal},text:Ke("alerts:alerts.whatsapp-send-invalid"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}));case 6:return(i=new FormData).append("id",null===pe||void 0===pe||null===(n=pe.data)||void 0===n?void 0:n.reportes[0].id),i.append("whatsapp_receptor","".concat(Le.prefijo_telefono).concat(null===xe||void 0===xe?void 0:xe.whatsapp)),i.append("nombre",null===c||void 0===c?void 0:c.nombre_documento),i.append("share",!1),i.append("sub",a.data_user.id),e.prev=12,e.next=15,ct()({method:"post",url:"".concat(je.a.apiURL,"/share/sendDocumentsCertifyWhatsapp"),headers:{"Content-Type":"multipart/form-data"},data:i});case 15:e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(12),A(!1),e.abrupt("return",F.a.fire({customClass:{container:y.mySwal},text:Ke("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}));case 21:return Oe(Object(m.a)(Object(m.a)({},xe),{},{whatsapp:""})),Fe({}),A(!1),ze(!1),e.abrupt("return",F.a.fire({customClass:{container:y.mySwal},text:Ke("alerts:alerts.send-successfully"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}));case 26:case"end":return e.stop()}}),e,null,[[12,17]])})));return function(t){return e.apply(this,arguments)}}(),xt=function(e){Oe(Object(m.a)(Object(m.a)({},xe),{},Object(b.a)({},e.target.name,e.target.value)))},Ot=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:""===t.target.value?(Oe(Object(m.a)(Object(m.a)({},xe),{},Object(b.a)({},t.target.name,t.target.value))),Fe("")):(Oe(Object(m.a)(Object(m.a)({},xe),{},Object(b.a)({},t.target.name,t.target.value))),(a=Ye.find((function(e){return e.id===t.target.value}))).prefijo_telefono&&Fe(Object(m.a)(Object(m.a)({},Le),{},{country:t.target.value,prefijo_telefono:a.prefijo_telefono})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:y.root,children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:y.root,children:[!Qe.inProgress&&!Qe.load&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(Yc.a,{filesLimit:1,acceptedFiles:[".pdf"],dropzoneText:Ke("certificateBadgeTemplate:badges-certificate-form.documents-dropzoneArea"),dropzoneClass:y.dropzone,dropzoneParagraphClass:y.dropzoneParagraph,showFileNames:!1,showAlerts:!0,onChange:lt})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:[c.img_prev&&c.img_prev.map((function(e){return Object(n.jsx)(g.a,{imgProps:{ref:jt},src:e,style:{display:"none"}})})),c.imgHD&&c.imgHD.map((function(e){return Object(n.jsx)(g.a,{imgProps:{ref:ft},src:e,style:{display:"none"}})}))]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[(Qe.inProgress||Qe.load)&&Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsx)(we.a,{variant:"body1",children:Qe.title}),Object(n.jsxs)(Lt.a,{display:"flex",alignItems:"center",children:[Object(n.jsx)(Lt.a,{width:"100%",mr:1,children:Object(n.jsx)(Hb,{variant:"determinate",value:Qe.value})}),Object(n.jsx)(Lt.a,{minWidth:35,children:Object(n.jsx)(we.a,{variant:"body2",color:"textSecondary",children:"".concat(Math.round(Qe.value),"%")})})]}),Object(n.jsx)(we.a,{variant:"body2",color:"textSecondary",children:null===Qe||void 0===Qe?void 0:Qe.nameFile})]}),ae&&Object(n.jsx)(ye.a,{item:!0,xs:6,children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"outlined",component:"span",onClick:pt,children:Ke("buttons:buttons.change-documents")})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsxs)(we.a,{children:[Ke("certifyDocuments:form-certify.name-document"),"*"]}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:null===Qe||void 0===Qe?void 0:Qe.inProgress,required:!0,name:"nombre_documento",variant:"outlined",size:"small",onChange:nt,value:(null===c||void 0===c?void 0:c.nombre_documento)?null===c||void 0===c?void 0:c.nombre_documento:""})})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsx)(we.a,{children:Ke("certifyDocuments:form-certify.template-document")}),Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:null===Qe||void 0===Qe?void 0:Qe.inProgress,required:!0,id:"plantilla",name:"id_plantillas_documentos",onChange:it,value:void 0!==c.id_plantillas_documentos?c.id_plantillas_documentos:"",children:[Object(n.jsx)(Y.a,{value:0,children:Object(n.jsx)("em",{children:Ke("certifyDocuments:form-certify.new-template-document")})},"template-".concat(0)),W.filter((function(e){return!e.thereDynamicField})).map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},"template-".concat(e.id))}))]})})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:0===c.id_plantillas_documentos&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(we.a,{variant:"body2",color:"textSecondary",children:Ke("certifyDocuments:form-certify.message-new-template")}),Object(n.jsx)(ce.a,{in:c.checkSaveTemplate,children:Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{children:[Ke("certifyDocuments:form-certify.assign-name-template"),"*"]}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:null===Qe||void 0===Qe?void 0:Qe.inProgress,required:c.checkSaveTemplate,id:"nombre_plantilla",name:"nombre_plantilla",variant:"outlined",size:"small",onChange:nt,value:c.nombre_plantilla})})}),Object(n.jsx)(we.a,{children:Ke("certifyDocuments:form-certify.assign-name-private-template")}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:null===Qe||void 0===Qe?void 0:Qe.inProgress,id:"nombre_privado_plantilla",name:"nombre_privado_plantilla",variant:"outlined",size:"small",onChange:nt,value:c.nombre_privado_plantilla})})})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,className:y.checkbox,children:Object(n.jsx)(wi.a,{control:Object(n.jsx)(Yb.a,{color:"primary",checked:c.checkSaveTemplate,onChange:function(){o(Object(m.a)(Object(m.a)({},c),{},{checkSaveTemplate:!c.checkSaveTemplate}))}}),label:Ke("certifyDocuments:form-certify.switch-save-template"),labelPlacement:"start"})})]})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsxs)(we.a,{children:[Ke("certifyDocuments:form-certify.archive-document"),"*"]}),Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:null===Qe||void 0===Qe?void 0:Qe.inProgress,required:!0,id:"archivo",name:"id_colecciones_documentos",onChange:rt,value:void 0!==c.id_colecciones_documentos?c.id_colecciones_documentos:"",children:[Object(n.jsx)(Y.a,{value:0,children:Object(n.jsx)("em",{children:Ke("certifyDocuments:form-certify.new-archive-document")})}),G.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},"collections-".concat(e.id))}))]})})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(ce.a,{in:0===c.id_colecciones_documentos,children:Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{children:[Ke("certifyDocuments:form-certify.assign-name-archive"),"*"]}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:null===Qe||void 0===Qe?void 0:Qe.inProgress,required:0===c.id_colecciones_documentos,id:"nombre_archivo",name:"nombre_archivo",variant:"outlined",size:"small",onChange:nt,value:c.nombre_archivo})})]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:(1===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===a.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{children:[Ke("certificateBadgeTemplate:badges-certificate-form.organization"),"*"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:null===Qe||void 0===Qe?void 0:Qe.inProgress,id:"organizacion",name:"id_organizaciones",onChange:nt,value:c.id_organizaciones,placeholder:Ke("certificateBadgeTemplate:badges-certificate-form.organization"),children:[Object(n.jsx)(Y.a,{value:0,children:Object(n.jsx)("em",{children:Ke("selects:selects-autocompletes.select-option-documents")})}),R.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},"organization-".concat(e.id))}))]})})]})})]})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(y.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(y.buttonForm),disabled:!Qe.load,onClick:ut,children:Ke("buttons:buttons.next")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(y.buttonForm),onClick:ot,children:Ke("buttons:buttons.cancel")})]})]})})}),Object(n.jsx)(O.a,{open:Z,fullScreen:!0,TransitionComponent:qb,children:Object(n.jsx)(jb,{setOpenDesignDocuments:$,fromCertify:!0,user:a,md5OrganizationRoute:re,md5UserRoute:oe,handleCancelGeneral:ot,handleSubmit:bt})}),Object(n.jsxs)(O.a,{open:de,fullWidth:!0,maxWidth:"sm",style:{zIndex:1e3},children:[Object(n.jsx)(v.a,{className:"text-center",children:Ke("dialogs:dialog.choose-option")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsxs)("div",{className:"text-center ".concat(y.containerButton),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(y.button),onClick:function(){return Ae(!Se)},children:Ke("buttons:buttons.send-document-email")}),Object(n.jsx)("form",{onSubmit:function(e){return ht(e)},children:Object(n.jsx)(ce.a,{in:Se,children:Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(Te.a,{required:!0,variant:"outlined",name:"correo",type:"email",placeholder:"example@email.com",value:xe.correo,onChange:xt,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:Object(n.jsx)(hm.a,{})}),endAdornment:Object(n.jsxs)(Rn.a,{position:"end",children:[Object(n.jsx)(K.a,{title:Ke("buttons:buttons.send"),type:"submit",children:Object(n.jsx)(S.a,{size:"small",children:Object(n.jsx)(vm.a,{color:"primary"})})}),Object(n.jsx)(K.a,{title:Ke("buttons:buttons.close"),children:Object(n.jsx)(S.a,{size:"small",onClick:function(){return Ae(!1)},children:Object(n.jsx)(zm.a,{color:"primary"})})})]})}})})})}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(y.button),onClick:function(){return ze(!De)},children:Ke("buttons:buttons.send-document-whatsapp")}),Object(n.jsx)("form",{onSubmit:function(e){return gt(e)},children:Object(n.jsx)(ce.a,{in:De,children:Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:3,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{children:"Pa\xeds "}),Object(n.jsxs)(T.a,{required:!0,id:"pais",name:"id_paises",label:"Pa\xeds",onChange:Ot,value:(null===Le||void 0===Le?void 0:Le.country)||"",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:"Seleccione una opci\xf3n"})}),Ye.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:"".concat(e.nombre).slice(0,e.nombre.length>9?4:3).toLocaleUpperCase()},"countrie-".concat(e.id))}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:9,children:Object(n.jsx)(Te.a,{required:!0,variant:"outlined",name:"whatsapp",type:"number",placeholder:"3044579029",value:xe.whatsapp,onChange:xt,InputProps:{startAdornment:Object(n.jsxs)(Rn.a,{position:"start",children:[Object(n.jsx)(xm.a,{}),"(+".concat(Le.prefijo_telefono?Le.prefijo_telefono:"",")")]}),endAdornment:Object(n.jsxs)(Rn.a,{position:"end",children:[Object(n.jsx)(K.a,{title:Ke("buttons:buttons.send"),children:Object(n.jsx)(S.a,{size:"small",type:"submit",children:Object(n.jsx)(vm.a,{color:"primary"})})}),Object(n.jsx)(K.a,{title:Ke("buttons:buttons.close"),children:Object(n.jsx)(S.a,{size:"small",onClick:function(){return ze(!1)},children:Object(n.jsx)(zm.a,{color:"primary"})})})]})}})})]})})}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(y.button),onClick:function(e){var t;return function(e){var t=document.createElement("a");t.download=e,t.href=e,t.click()}(null===pe||void 0===pe||null===(t=pe.data)||void 0===t?void 0:t.routePdf)},children:Ke("buttons:buttons.download-documents")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(y.button),onClick:function(){ue(!1),ot(),j.push("/documents/files")},children:Ke("buttons:buttons.exit")})]})})]}),Object(n.jsx)(_t,{loading:B})]})})),Qb=a(1225),Jb=Object(C.a)((function(e){return{icon:{fontSize:"3rem"},table:{"&:hover":{cursor:"pointer"}}}}));var Xb={color:"#888888",fontSize:"3rem"},Zb={changePage:I.b,changeBreadcrump:I.a,setSearchValue:I.E},$b=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"insignias emitidas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),Zb)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changePage,o=e.changeBreadcrump,s=e.user,l=e.organizationId,m=e.setSearchValue,b=Object(u.g)(),p=Jb(),j=Object(i.useState)([]),g=Object(d.a)(j,2),x=g[0],O=g[1],v=Object(i.useState)([]),_=Object(d.a)(v,2),y=_[0],w=_[1],C=Object(i.useState)(!1),k=Object(d.a)(C,2),N=k[0],B=k[1],S=Object(i.useState)(""),T=Object(d.a)(S,2),A=T[0],E=T[1],z=Object(i.useState)(""),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(D.a)(["alerts","tables","buttons","breadCrumps","dialogs"]),F=Object(d.a)(L,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?U():b.push("/dashboard")}),[]),Object(i.useEffect)((function(){U()}),[window.location.href]);var U=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,B(!0),e.next=4,W();case 4:t=window.location.href.includes("sign"),o(F("breadCrumps:breadCrumps.documents-files-folders-files".concat(t?"-sign":""),{returnObjects:!0})),B(!1),m(""),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),b.push("/500");case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),W=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window.location.href.includes("sign")?"sign":"normal",e.next=3,Ce.a.post("/documentsCollections/getDocumentsCollections_v2",{estado:1});case 3:a=e.sent,n=a.data,i=[],i="sign"===t?n.documentsCollections.filter((function(e){return!e.normalDoc||e.mixDoc})):n.documentsCollections.filter((function(e){return e.normalDoc||e.mixDoc})),1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?(O(i),w(i)):(O(i.filter((function(e){return e.id_organizaciones===l}))),w(i.filter((function(e){return e.id_organizaciones===l}))));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){return F("tables:table.columns-documents-folders",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"groupDocuments",items:x,setItems:w,changePage:c,loadData:U,organizationId:1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:l,setLoading:B}),Object(n.jsx)(zn,{columns:Y(),rows:y,setDirection:E,setOrderBy:M,loading:N,children:Object(n.jsx)(vn.a,{children:N?Object(n.jsx)(qn,{columns:Y(),photo:0}):y.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(y,Object(I.f)(A,R)).slice(t*a,t*a+a).map((function(e,t){var a;return Object(n.jsxs)(_n.a,{hover:!0,className:p.table,onClick:function(t){return function(e,t,a){var n=window.location.href.includes("sign");c(0);var i=F("breadCrumps:breadCrumps.documents-files-folders-files".concat(n?"-sign":""),{returnObjects:!0});i.push({name:a}),o(i),b.push("/documents".concat(n?"/sign":"","/files/").concat(t))}(0,Object(Ie.b)(e.id),e.nombre)},children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(Qb.a,{sx:Xb})}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.nombre)}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(a=e.organizaciones)||void 0===a?void 0:a.nombre)}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_creacion).format("DD/MM/YYYY HH:mm:ss")})]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"4",children:F("tables:table.empty-table")})})})})]})}));var ep=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),tp=Object(xe.a)((function(e){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:e.palette.grey["light"===e.palette.type?200:700]},bar:{borderRadius:5,backgroundColor:e.palette.primary}}}))(Oe.a),ap=Object(C.a)((function(e){return{root:{marginTop:"1em"},avatar:{width:"auto",height:"auto","&:hover":{cursor:"pointer"}},icon:{margin:20,fontSize:"4em"},img:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"},buttonDialog:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"},buttonForm:{margin:"0.5em",padding:"9px 40px"},dropzone:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",borderColor:E.a.primary,borderRadius:15,"& .MuiGrid-container":{justifyContent:"center"}},dropzoneParagraph:{color:"gray",fontSize:"1.1em"},checkbox:{display:"flex",justifyContent:"flex-end"},containerButton:{display:"grid",justifyContent:"center"},button:{margin:"0.5em",padding:"10px 40px"},mySwal:{zIndex:3e3}}})),np={setDocumentsFields:I.u,changeBreadcrump:I.a,setFormDocuments:I.y},ip=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,formDocuments:e.formDocuments||[],documentsFields:e.documentsFields,returnRoute:e.returnRoute}}),np)((function(e){var t,a,r=e.user,c=e.organizationId,o=e.formDocuments,s=e.setFormDocuments,l=e.documentsFields,p=e.setDocumentsFields,j=e.changeBreadcrump,v=e.returnRoute,_=Object(u.g)(),y=ap({formDocuments:o}),w=Object(i.useRef)([]),C=Object(i.useRef)([]),k=Object(i.useRef)([]),N=Object(i.useState)(!1),B=Object(d.a)(N,2),S=B[0],A=B[1],I=Object(i.useState)([]),P=Object(d.a)(I,2),R=P[0],M=P[1],L=Object(i.useState)([]),U=Object(d.a)(L,2),W=U[0],q=U[1],H=Object(i.useState)(!1),K=Object(d.a)(H,2),V=K[0],G=K[1],Q=Object(i.useState)(!(!(null===o||void 0===o?void 0:o.img_prev)||!o.img_prev[(null===o||void 0===o?void 0:o.page)-1])),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=1===r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,ee=Pe()("certika-organization-".concat($?1:c)).toString(),te=Pe()("certika-user-".concat($?1:null===r||void 0===r||null===(t=r.data_user)||void 0===t?void 0:t.id)).toString(),ae=!!e.match.params.id,ne=!!e.match.params.id_template,ie=Object(i.useState)([]),re=Object(d.a)(ie,2),oe=re[0],se=re[1],le=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","breadCrumps","tables","certifyDocuments"]),de=Object(d.a)(le,1)[0],ue=Object(i.useState)(X?{title:"".concat(de("certifyDocuments:form-certify.uploaded-successfully")),nameFile:null===o||void 0===o?void 0:o.fileName,load:!0,value:100,inProgress:!1}:{title:"",load:!1,value:0,inProgress:!1}),me=Object(d.a)(ue,2),be=me[0],pe=me[1];Object(i.useEffect)((function(){fe(),he()}),[]);var fe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ct()({method:"get",url:"https://api.ipdata.co?api-key=".concat(je.a.keyIpData)});case 3:t=e.sent,a=t.data,s(Object(m.a)(Object(m.a)({},o),{},{ip_adress:a.ip})),e.next=11;break;case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",F.a.fire({icon:"warning",iconColor:E.a.primary,text:de("alerts:alerts.warning-block"),showConfirmButton:!0}));case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),he=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,A(!0),e.next=4,ge();case 4:return e.next=6,xe();case 6:j(de("breadCrumps:breadCrumps.documents-sign",{returnObjects:!0})),s(Object(m.a)(Object(m.a)({},o),{},{id_organizaciones:$?"":c,change_template:o.id_plantillas_documentos&&0!==o.id_plantillas_documentos?o.id_plantillas_documentos:0,id_plantillas_documentos:0})),A(!1),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),_.push("/500");case 14:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),ge=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations/names");case 2:t=e.sent,a=t.data,M(a.organizations);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),xe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/documentsCollections/getDocumentsCollections",{id_organizaciones:c});case 2:t=e.sent,a=t.data,q(a.documentsCollections);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Oe=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s(Object(m.a)(Object(m.a)({},o),{},Object(b.a)({},t.target.name,t.target.value)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ke=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s(Object(m.a)(Object(m.a)({},o),{},{id_colecciones_documentos:t.target.value,nameArchive:0!==t.target.value?W.find((function(e){return e.id===t.target.value})).nombre:null===o||void 0===o?void 0:o.nombre_archivo}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Be=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),(t=new FormData).append("fileName",null===o||void 0===o?void 0:o.fileName),t.append("numPages",null===o||void 0===o?void 0:o.pages),t.append("route","".concat(ee,"/documentsTemplate/documents-temp/temp")),t.append("certify",!0),e.next=8,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/delete-files-local"),headers:{"Content-Type":"multipart/form-data"},data:t});case 8:A(!1),Z(!1),pe({title:"",load:!1,value:0,inProgress:!1}),s({id_organizaciones:o.id_organizaciones,method_sign:""}),p(null),w.current=[],C.current=[],ne?_.push(v):_.push("/documents/sign");case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=Object(h.a)(f.a.mark((function e(t,a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s(Object(m.a)({},t)),pe({title:"".concat(de("certifyDocuments:form-certify.uploaded-successfully")),load:!0,value:100,inProgress:!1,nameFile:a.name}),w.current=[],C.current=[],Z(!0),Z(!0),A(!1);case 7:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Ae=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(a=t[0])){e.next=9;break}return(n=new FormData).append("file",a),n.append("fileName",a.name),n.append("certify",!0),n.append("route","".concat(ee,"/documentsTemplate/documents-temp/temp")),e.next=9,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-documents"),headers:{"Content-Type":"multipart/form-data"},data:n,onUploadProgress:function(e){var t=e.loaded,a=e.total,n=Math.floor(100*t/a);pe({title:"".concat(de("certifyDocuments:form-certify.loading")),load:!1,value:n,inProgress:!0})}}).then((function(e){var t=e.data,n=Object(m.a)(Object(m.a)({},o),{},{img_prev:t.urls,imgHD:t.urlsHD,pages:t.numPages,page:1,fileName:a.name,nombre_documento:a.name.split(".")[0]});setTimeout((function(){Se(n,a)}),3e3)}));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ee=function(e){var t=new Date,a=e.split("-"),n=new Date;return t.setFullYear(a[0],a[1]-1,a[2]),!(t>=n)},De=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne&&(null===l||void 0===l||null===(t=l.filter((function(e){var t,a;return(null===(t=e.dataSign)||void 0===t?void 0:t.correo)&&(null===(a=e.dataSign)||void 0===a?void 0:a.correo)!==r.correo&&e.correo!==r.correo})))||void 0===t||t.map((function(e,t){var a=k.current[t].toDataURL();return e.exampleText=a,e}))),null===o||void 0===o?void 0:o.ip_adress){e.next=13;break}return e.prev=2,e.next=5,ct()({method:"get",url:"https://api.ipdata.co?api-key=".concat(je.a.keyIpData)});case 5:a=e.sent,n=a.data,s(Object(m.a)(Object(m.a)({},o),{},{ip_adress:n.ip})),e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("return",F.a.fire({icon:"warning",iconColor:E.a.primary,text:de("alerts:alerts.warning-block"),showConfirmButton:!0}));case 13:if(o.id_colecciones_documentos||0===o.id_colecciones_documentos){e.next=15;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:de("alerts:alerts.no-select-folder-documents"),showConfirmButton:!1,timer:1500}));case 15:if(0!==(null===o||void 0===o?void 0:o.id_colecciones_documentos)||(null===o||void 0===o?void 0:o.nombre_archivo)){e.next=17;break}return e.abrupt("return",F.a.fire({icon:"info",iconColor:E.a.primary,text:de("alerts:alerts.required-folder-name"),showConfirmButton:!1,timer:1500}));case 17:s(Object(m.a)(Object(m.a)({},o),{},{naturalWidthAndHeight:w.current,naturalWidthAndHeightHD:C.current})),void 0!==(i=null===l||void 0===l?void 0:l.findIndex((function(e){return"certificateCode"===e.fieldName})))&&-1!==i&&(l[i].exampleText=l[i].exampleText.includes(":")?l[i].exampleText.split(":")[0]:""),o.img_prev&&o.img_prev[(null===o||void 0===o?void 0:o.page)-1]&&G(!0),A(!1);case 22:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(){return e.apply(this,arguments)}}(),ze=function(){var t=Object(h.a)(f.a.mark((function t(a,n){var i,r,s,d,u,b,j,g,x,O,w,C,k,N,B,S;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a.preventDefault(),u=[],0!==o.id_organizaciones){t.next=4;break}return t.abrupt("return",F.a.fire({customClass:{container:y.mySwal},icon:"error",iconColor:E.a.primary,text:de("alerts:alerts.error-organization"),showConfirmButton:!1,timer:1500}));case 4:if(!!o.img_prev[(null===o||void 0===o?void 0:o.page)-1]){t.next=7;break}return t.abrupt("return",F.a.fire({customClass:{container:y.mySwal},icon:"info",iconColor:E.a.primary,text:de("alerts:alerts.template-certificate-alert"),showConfirmButton:!1,timer:1500}));case 7:return t.next=9,Ce.a.get("/contract/card/".concat($?o.id_organizaciones:c));case 9:if(b=t.sent,(j=b.data).contract){t.next=14;break}return F.a.fire({customClass:{container:y.mySwal},icon:"error",iconColor:E.a.primary,text:de("alerts:alerts.no-contract-error"),showConfirmButton:!0}),t.abrupt("return",!1);case 14:if(!((null===j||void 0===j||null===(i=j.contract)||void 0===i?void 0:i.total_emisiones)+1>(null===j||void 0===j||null===(r=j.contract)||void 0===r?void 0:r.cantidad_emisiones))){t.next=17;break}return F.a.fire({customClass:{container:y.mySwal},icon:"error",iconColor:E.a.primary,text:de("alerts:alerts.exceeds-contract"),showConfirmButton:!0}),t.abrupt("return",!1);case 17:if(!(null===j||void 0===j||null===(s=j.contract)||void 0===s?void 0:s.vencimiento)||!Ee(null===j||void 0===j||null===(d=j.contract)||void 0===d?void 0:d.vencimiento)){t.next=20;break}return F.a.fire({customClass:{container:y.mySwal},icon:"error",iconColor:E.a.primary,text:de("alerts:alerts.expired-contract"),showConfirmButton:!0}),t.abrupt("return",!1);case 20:return t.next=22,l.map(function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.push({index:a,uri:t.exampleText}),t.fontColor&&(t.fontColor=t.fontColor.hex),t.rectColor&&(t.rectColor=t.rectColor.hex),!t.correo||!t.exampleText.includes("data")){e.next=13;break}return n=new FormData,i=Qm(t.exampleText),r="".concat(ee,"/documentsTemplate/signatories/").concat(t.correo,".png"),t.exampleText=r,t.url="",n.append("file",i),n.append("route",r),e.next=13,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:n});case 13:return e.abrupt("return",t);case 14:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}());case 22:if(g=o.naturalWidthAndHeight[0].width,x=o.naturalWidthAndHeight[0].height,o.naturalWidthAndHeight.map((function(e){g<e.width&&(g=e.width),x<e.height&&(x=e.height)})),O=o.naturalWidthAndHeightHD[0].width,w=o.naturalWidthAndHeightHD[0].height,C=[],o.naturalWidthAndHeightHD.map((function(e){O<e.width&&(O=e.width),w<e.height&&(w=e.height),C.push({width:e.width,height:e.height})})),k=parseInt(100*(O-g)/g),N=parseInt(100*(w-x)/x),B=Ne()(new Date).format("LLLL"),delete(S=Object(m.a)(Object(m.a)({},o),{},{width:O,height:w,templateWidth:g,templateHeight:x,saltosWidth:k,saltosHeight:N,sizes:C,trailDate:B,id_plantillas_documentos:e.match.params.id_template?Object(Ie.a)(e.match.params.id_template):o.id_plantillas_documentos?o.id_plantillas_documentos:0})).img_template,delete S.naturalWidthAndHeight,delete S.naturalWidthAndHeightHD,A(!0),t.prev=37,!ne){t.next=43;break}return t.next=41,Ce.a.put("/documentsCertify",{dataToSend:S,documentsFields:l}).then((function(){Array.prototype.forEach.call(n,(function(e){return e.remove()})),_.push(v)}));case 41:t.next=45;break;case 43:return t.next=45,Ce.a.post("/documentsCertify",{dataToSend:S,documentsFields:l}).then((function(e){var t,a;Array.prototype.forEach.call(n,(function(e){return e.remove()})),!ne&&_.push("/documents/signed/".concat(Object(Ie.b)(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(a=t.reportes[0])||void 0===a?void 0:a.id))),se(e),A(!1)}));case 45:t.next=53;break;case 47:return t.prev=47,t.t0=t.catch(37),l.map((function(e,t){return e.fontColor&&(e.fontColor={hex:e.fontColor}),e.rectColor&&(e.rectColor={hex:e.rectColor}),"certificateCode"===e.fieldName&&e.exampleText.includes(":")&&(e.exampleText=e.exampleText.split(":")[0]),e.correo&&(e.exampleText=u.filter((function(e){return e.index===t}))[0].uri),e})),p(l),A(!1),t.abrupt("return",F.a.fire({customClass:{container:y.mySwal},icon:"error",iconColor:E.a.primary,text:de("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}));case 53:F.a.fire({customClass:{container:y.mySwal},icon:"success",iconColor:E.a.primary,text:de("alerts:alerts.saved"),showConfirmButton:!1,timer:1500}).then((function(){l.map((function(e,t){return e.fontColor&&(e.fontColor={hex:e.fontColor}),e.rectColor&&(e.rectColor={hex:e.rectColor}),"certificateCode"===e.fieldName&&e.exampleText.includes(":")&&(e.exampleText=e.exampleText.split(":")[0]),e.correo&&(e.exampleText=u.filter((function(e){return e.index===t}))[0].uri),e})),p(l),l.filter((function(e){return e.correo})).length>0&&F.a.fire({icon:"success",iconColor:E.a.primary,text:de("alerts:alerts.document-send-signatorie"),showConfirmButton:!0,confirmButtonText:de("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:y.mySwal,confirmButton:"custom-button-confirm"}})}));case 54:case"end":return t.stop()}}),t,null,[[37,47]])})));return function(e,a){return t.apply(this,arguments)}}(),Re=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=document.createElement("a"),!(null===oe||void 0===oe||null===(a=oe.data)||void 0===a?void 0:a.routePdf)){t.next=7;break}n.download=null===oe||void 0===oe||null===(i=oe.data)||void 0===i?void 0:i.routePdf,n.href=null===oe||void 0===oe||null===(r=oe.data)||void 0===r?void 0:r.routePdf,n.click(),t.next=14;break;case 7:return t.next=9,Ce.a.get("documentsCertify/".concat(Object(Ie.a)(e.match.params.id)));case 9:s=t.sent,l=s.data,n.download=null===l||void 0===l||null===(c=l.documentCertify)||void 0===c?void 0:c.pdf,n.href=null===l||void 0===l||null===(o=l.documentCertify)||void 0===o?void 0:o.pdf,n.click();case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Me=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),(t=new FormData).append("fileName",null===o||void 0===o?void 0:o.fileName),t.append("numPages",null===o||void 0===o?void 0:o.pages),t.append("route","".concat(ee,"/documentsTemplate/documents-temp/temp")),t.append("certify",!0),e.next=8,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/delete-files-local"),headers:{"Content-Type":"multipart/form-data"},data:t});case 8:A(!1),s(Object(m.a)(Object(m.a)({},o),{},{img_prev:null,img_template:null,pages:0,changeDocument:!0})),pe({title:"",load:!1,value:0,inProgress:!1}),Z(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(e){e&&!w.current.includes(e)&&w.current.push(e)},Fe=function(e){e&&!C.current.includes(e)&&C.current.push(e)},Ue=function(e){e&&!k.current.includes(e)&&k.current.push(e)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsxs)(_e.a,{className:"p-3",children:[!X&&Object(n.jsx)(we.a,{children:de("certifyDocuments:form-certify.upload-document")}),Object(n.jsxs)("form",{className:y.root,children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:y.root,children:[!be.inProgress&&!be.load&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(Yc.a,{filesLimit:1,acceptedFiles:[".pdf"],dropzoneText:de("certificateBadgeTemplate:badges-certificate-form.documents-dropzoneArea"),dropzoneClass:y.dropzone,dropzoneParagraphClass:y.dropzoneParagraph,showFileNames:!1,showAlerts:!0,onChange:Ae})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:[o.img_prev&&o.img_prev.map((function(e){return Object(n.jsx)(g.a,{imgProps:{ref:Le},src:e,style:{display:"none"}})})),o.imgHD&&o.imgHD.map((function(e){return Object(n.jsx)(g.a,{imgProps:{ref:Fe},src:e,style:{display:"none"}})}))]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[(be.inProgress||be.load)&&Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsx)(we.a,{variant:"body1",children:be.title}),Object(n.jsxs)(Lt.a,{display:"flex",alignItems:"center",children:[Object(n.jsx)(Lt.a,{width:"100%",mr:1,children:Object(n.jsx)(tp,{variant:"determinate",value:be.value})}),Object(n.jsx)(Lt.a,{minWidth:35,children:Object(n.jsx)(we.a,{variant:"body2",color:"textSecondary",children:"".concat(Math.round(be.value),"%")})})]}),Object(n.jsx)(we.a,{variant:"body2",color:"textSecondary",children:null===be||void 0===be?void 0:be.nameFile})]}),X&&Object(n.jsx)(ye.a,{item:!0,xs:6,children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"outlined",component:"span",onClick:Me,children:de("buttons:buttons.change-documents")})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsxs)(we.a,{children:[de("certifyDocuments:form-certify.archive-document"),"*"]}),Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:null===be||void 0===be?void 0:be.inProgress,required:!0,id:"archivo",name:"id_colecciones_documentos",onChange:ke,value:void 0!==o.id_colecciones_documentos?o.id_colecciones_documentos:"",children:[Object(n.jsx)(Y.a,{value:0,children:Object(n.jsx)("em",{children:de("certifyDocuments:form-certify.new-archive-document")})}),W.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:e.nombre},"collections-".concat(e.id))}))]})})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(ce.a,{in:0===o.id_colecciones_documentos,children:Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{children:[de("certifyDocuments:form-certify.assign-name-archive"),"*"]}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:0===o.id_colecciones_documentos,id:"nombre_archivo",name:"nombre_archivo",variant:"outlined",size:"small",onChange:Oe,value:o.nombre_archivo})})]})})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsx)(we.a,{children:de("certifyDocuments:form-certify.method-to-sign")}),Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:null===be||void 0===be?void 0:be.inProgress,required:!0,id:"method",name:"method_sign",onChange:Oe,value:o.method_sign,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:de("certifyDocuments:form-certify.select-option")})}),Object(n.jsx)(Y.a,{value:1,children:de("certifyDocuments:form-certify.sign-via-email")}),Object(n.jsx)(Y.a,{value:2,children:de("certifyDocuments:form-certify.sign-via-whatsapp")})]})})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:(1===r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===r.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{children:[de("certificateBadgeTemplate:badges-certificate-form.organization"),"*"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:null===be||void 0===be?void 0:be.inProgress,id:"organizacion",name:"id_organizaciones",onChange:Oe,value:o.id_organizaciones,placeholder:de("certificateBadgeTemplate:badges-certificate-form.organization"),children:[Object(n.jsx)(Y.a,{value:0,children:Object(n.jsx)("em",{children:de("selects:selects-autocompletes.select-option-documents")})}),R.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},"organization-".concat(e.id))}))]})})]})})]})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(y.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(y.buttonForm),disabled:!be.load,onClick:De,children:de("buttons:buttons.next")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(y.buttonForm),onClick:Be,children:de("buttons:buttons.cancel")})]})]})]})}),Object(n.jsx)(O.a,{open:V,fullScreen:!0,TransitionComponent:ep,children:Object(n.jsx)(jb,{setOpenDesignDocuments:G,fromCertify:!0,fromSign:!0,isEditDocuments:!!ne,user:r,md5OrganizationRoute:ee,md5UserRoute:te,handleCancelGeneral:Be,handleSubmit:ze,documentSigned:ae,downloadDocument:Re,documentFinish:oe})}),Object(n.jsx)("div",{style:{display:"none"},children:ne&&(null===l||void 0===l||null===(a=l.filter((function(e){var t,a;return(null===(t=e.dataSign)||void 0===t?void 0:t.correo)&&(null===(a=e.dataSign)||void 0===a?void 0:a.correo)!==r.correo&&e.correo!==r.correo})))||void 0===a?void 0:a.map((function(e){return Object(n.jsx)(Co.f,{width:520,height:100,ref:Ue,children:Object(n.jsxs)(Co.c,{children:[Object(n.jsx)(Co.e,{width:520,height:100,fill:E.a.secondary,cornerRadius:8,stroke:"black",strokeWidth:2,opacity:.5}),Object(n.jsx)(Co.g,{text:de("certifyDocuments:add-signatories.signatory"),x:1,y:58,width:520,fontSize:20,align:"center"}),Object(n.jsx)(Co.g,{text:e.dataSign.correo,x:1,y:78,width:520,fontSize:20,align:"center"})]})})})))}),Object(n.jsx)(_t,{loading:S})]})})),rp=a(1226),cp=a(1227),op=a(1228),sp=a(1229);function lp(e){var t=e.children,a=e.value,i=e.index,r=Object(Se.a)(e,["children","value","index"]);return Object(n.jsx)("div",Object(m.a)(Object(m.a)({role:"tabpanel",hidden:a!==i,id:"full-width-tabpanel-".concat(i),"aria-labelledby":"full-width-tab-".concat(i)},r),{},{children:a===i&&Object(n.jsx)(Lt.a,{p:2,children:t})}))}function dp(e){return{id:"full-width-tab-".concat(e),"aria-controls":"full-width-tabpanel-".concat(e)}}var up=Object(xe.a)((function(e){return{root:{margin:0,padding:e.spacing(2)},closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]}}}))((function(e){var t=e.children,a=e.classes,i=e.onClose,r=Object(Se.a)(e,["children","classes","onClose"]);return Object(n.jsxs)(v.a,Object(m.a)(Object(m.a)({disableTypography:!0,className:a.root},r),{},{children:[Object(n.jsx)(we.a,{variant:"h6",children:t}),i?Object(n.jsx)(S.a,{"aria-label":"close",className:a.closeButton,onClick:i,children:Object(n.jsx)(ae.a,{})}):null]}))})),mp=Object(C.a)((function(e){return{root:{display:"flex",border:"2.8px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",marginBottom:"1rem"},text:{marginTop:"1em"},container:{marginTop:".5em",marginBottom:".5em"},alert:{backgroundColor:e.palette.primary.light},divider:{marginTop:"-.5rem"},grid:Object(b.a)({paddingRight:".8em"},e.breakpoints.up("sm"),{paddingRight:"5em"}),button:{margin:"0.5em",padding:".5em 1em",borderRadius:"10px"},container__input_root:{borderRadius:"10px"},dropzone:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",borderColor:e.palette.primary.main,borderRadius:15,"& .MuiGrid-container":{justifyContent:"center"}},dropzoneParagraph:{color:"gray",fontSize:"1.1em"},paper:{flexGrow:1,width:"100%",backgroundColor:"#F5F5F5"}}})),bp=function(e){var t=e.open,a=void 0!==t&&t,c=e.setOpen,o=e.organizationId,s=e.idDocumentCertify,l=e.loadData,u=mp(),j=Object(Wc.a)(),g=Object(i.useState)([]),v=Object(d.a)(g,2),y=v[0],w=v[1],C=Object(i.useState)(!1),k=Object(d.a)(C,2),N=k[0],B=k[1],S=r.a.useState(0),T=Object(d.a)(S,2),A=T[0],I=T[1],z=Object(i.useState)([{index:1}]),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)({}),U=Object(d.a)(L,2),W=U[0],Y=U[1],q=Object(D.a)(["alerts","certificateBadgeTemplate","buttons"]),H=Object(d.a)(q,1)[0],K=function(){w([]),M([{index:1}]),c(!1)},V=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(a=t)&&w(a);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),G=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(y.length>0)){e.next=8;break}return B(!0),t=new FormData,y.map(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.append("file",a);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t.append("id_documentos_emitidos",s),t.append("id_organizaciones",o),e.next=8,ct()({method:"post",url:"".concat(je.a.apiURL,"/documentsFieldAdditionals/upload"),headers:{"Content-Type":"multipart/form-data"},data:t}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.data&&(B(!1),c(!1),F.a.fire({icon:"success",iconColor:E.a.primary,text:H("alerts:alerts.saved"),showConfirmButton:!1,timer:1500}).then((function(){l()})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){B(!1),c(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:H("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500})}));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(e,t){var a,n;"link"===e.target.name&&(/^https?:\/\/[\w\-]+(\.[\w\-]+)+[/#?]?.*$/.test(e.target.value)||""===e.target.value?Y(Object(m.a)(Object(m.a)({},W),{},(a={},Object(b.a)(a,e.target.name,!1),Object(b.a)(a,"index",t),a))):Y(Object(m.a)(Object(m.a)({},W),{},(n={},Object(b.a)(n,e.target.name,!0),Object(b.a)(n,"index",t),n))));null===R||void 0===R||R.map((function(a){return a.index===t&&(a[e.target.name]=e.target.value),a})),M(R)},J=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=!0,R.map(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.link||(t=!1,Y(Object(m.a)(Object(m.a)({},W),{},{link:!0,index:a.index})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t&&(B(!0),Ce.a.post("/documentsFieldAdditionals/",{id_documentos_emitidos:s,fields:R}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.data&&(B(!1),c(!1),K(),F.a.fire({icon:"success",iconColor:E.a.primary,text:H("alerts:alerts.saved"),showConfirmButton:!1,timer:1500}).then((function(){l()})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){B(!1),c(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:H("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500})})));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(O.a,{open:a,onClose:K,fullWidth:!0,maxWidth:"md",children:[Object(n.jsx)(up,{align:"center",onClose:K}),Object(n.jsx)(_.a,{children:Object(n.jsxs)(ye.a,{container:!0,className:u.container,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,className:u.grid,align:"center",children:Object(n.jsx)(kn.a,{children:Object(n.jsxs)(Dr.a,{className:u.paper,value:A,onChange:function(e,t){I(t)},indicatorColor:"primary",textColor:"primary",centered:!0,children:[Object(n.jsx)(zr.a,Object(m.a)({label:"Documentos"},dp(0))),Object(n.jsx)(zr.a,Object(m.a)({label:"Links"},dp(1)))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,className:u.grid,align:"center",children:Object(n.jsxs)(Hc.a,{axis:"rtl"===j.direction?"x-reverse":"x",index:A,onChangeIndex:function(e){I(e)},children:[Object(n.jsx)(lp,{value:A,index:0,dir:j.direction,children:Object(n.jsx)(Yc.a,{filesLimit:10,acceptedFiles:[".pdf"],dropzoneText:H("certificateBadgeTemplate:badges-certificate-form.documents-dropzoneArea"),dropzoneClass:u.dropzone,dropzoneParagraphClass:u.dropzoneParagraph,showAlerts:!1,showPreviews:!0,showPreviewsInDropzone:!1,useChipsForPreview:!0,previewGridProps:{container:{spacing:1,direction:"row"}},previewChipProps:{classes:{root:u.previewChip}},previewText:H("certificateBadgeTemplate:badges-certificate-form.documents-selected-files"),onChange:V})}),Object(n.jsxs)(lp,{value:A,index:1,dir:j.direction,children:[R.map((function(e,t){return Object(n.jsx)(ye.a,{container:!0,spacing:2,children:Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:u.card,children:[Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{variant:"body1",align:"left",className:u.text,children:"".concat(H("certificateBadgeTemplate:badges-certificate-form.field-description"))}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{multiline:!0,name:"descripcion",variant:"outlined",size:"small",value:e.descripcion,onChange:function(t){return Q(t,e.index)},className:u.fieldCard})}),Object(n.jsx)(we.a,{variant:"body1",align:"left",className:u.text,children:"".concat(H("certificateBadgeTemplate:badges-certificate-form.field-url"),"*")}),Object(n.jsx)(mt.a,{className:"w-100",required:!0,children:Object(n.jsx)(Te.a,{label:"",name:"link",variant:"outlined",size:"small",placeholder:"http://",onChange:function(t){return Q(t,e.index)},value:e.link,className:u.fieldCard,type:"url",required:!0,error:W.link&&W.index===e.index,helperText:W.link&&W.index===e.index&&"Url no v\xe1lido."})})]}),Object(n.jsx)(wc.a,{children:(null===R||void 0===R?void 0:R.length)>0&&Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",size:"small",onClick:function(t){return function(e,t){var a;a=0===R.length?[{index:1}]:null===R||void 0===R?void 0:R.filter((function(e){return e.index!==t})),M(a)}(0,e.index)},children:Object(n.jsxs)(we.a,{color:"textSecondary",variant:"body2",children:[Object(n.jsx)(ae.a,{}),H("buttons:buttons.delete")]})})})]})})},"grid-activity-".concat(t))})),Object(n.jsx)(ye.a,{container:!0,spacing:2,children:Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(x.a,{disableElevation:!0,variant:"outlined",color:"primary",onClick:function(){var e=R[(null===R||void 0===R?void 0:R.length)-1];M([].concat(Object(p.a)(R),[{index:e.index+1}]))},children:H("buttons:buttons.add-field")})})})]})]})})]})}),Object(n.jsxs)(Ae.a,{children:[y.length>0&&Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",onClick:G,color:"primary",children:H("buttons:buttons.save")}),R.length>0&&Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",onClick:J,color:"primary",disabled:W.link,children:H("buttons:buttons.save")})]}),Object(n.jsx)(_t,{loading:N})]})};function pp(e){var t=e.children,a=e.value,i=e.index,r=Object(Se.a)(e,["children","value","index"]);return Object(n.jsx)("div",Object(m.a)(Object(m.a)({role:"tabpanel",hidden:a!==i,id:"full-width-tabpanel-".concat(i),"aria-labelledby":"full-width-tab-".concat(i)},r),{},{children:a===i&&Object(n.jsx)(Lt.a,{p:2,children:t})}))}function jp(e){return{id:"full-width-tab-".concat(e),"aria-controls":"full-width-tabpanel-".concat(e)}}var fp=Object(xe.a)((function(e){return{root:{margin:0,padding:e.spacing(2)},closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]}}}))((function(e){var t=e.children,a=e.classes,i=e.onClose,r=Object(Se.a)(e,["children","classes","onClose"]);return Object(n.jsxs)(v.a,Object(m.a)(Object(m.a)({disableTypography:!0,className:a.root},r),{},{children:[Object(n.jsx)(we.a,{variant:"h6",children:t}),i?Object(n.jsx)(S.a,{"aria-label":"close",className:a.closeButton,onClick:i,children:Object(n.jsx)(ae.a,{})}):null]}))})),hp=Object(C.a)((function(e){return{root:{display:"flex",border:"2.8px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",marginBottom:"1rem"},container:{marginTop:".5em",marginBottom:".5em"},alert:{backgroundColor:e.palette.primary.light},divider:{marginTop:"-.5rem"},button:{margin:"0.5em",padding:".5em 1em",borderRadius:"10px"},container__input_root:{borderRadius:"10px"},text:{marginTop:"1em"}}})),gp=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),xp=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage}}),null)((function(e){var t=e.page,a=e.rowsPerPage,c=e.open,o=void 0!==c&&c,s=e.setOpen,l=e.rows,u=e.loadData,p=e.fieldsAdditionals,j=hp(),g=Object(Wc.a)(),v=Object(i.useState)(!1),y=Object(d.a)(v,2),w=y[0],C=y[1],k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],T=N[1],A=r.a.useState(0),z=Object(d.a)(A,2),P=z[0],R=z[1],M=Object(i.useState)(""),L=Object(d.a)(M,2),U=L[0],W=L[1],Y=Object(i.useState)(""),q=Object(d.a)(Y,2),H=q[0],V=q[1],G=Object(i.useState)({descripcion:"",link:""}),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(i.useState)({}),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ae=Object(i.useState)(null),ne=Object(d.a)(ae,2),ie=ne[0],re=ne[1],ce=Object(i.useState)(!1),oe=Object(d.a)(ce,2),se=oe[0],le=oe[1],de=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","tables"]),ue=Object(d.a)(de,1)[0],me=function(){s(!1)},be=function(){X({descripcion:"",link:""}),te({}),T(!1)},pe=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C(!0),e.next=3,Ce.a.delete("/documentsFieldAdditionals/".concat(t));case 3:a=e.sent,a.data&&(C(!1),s(!1),F.a.fire({text:ue("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){u()})));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),je=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C(!0),e.next=3,Ce.a.delete("/documentsFieldAdditionals/".concat(t));case 3:a=e.sent,a.data&&(C(!1),s(!1),F.a.fire({text:ue("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){u()})));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),fe=function(e){"link"===e.target.name&&(/^https?:\/\/[\w\-]+(\.[\w\-]+)+[/#?]?.*$/.test(e.target.value)||""===e.target.value?te(Object(m.a)(Object(m.a)({},ee),{},Object(b.a)({},e.target.name,!1))):te(Object(m.a)(Object(m.a)({},ee),{},Object(b.a)({},e.target.name,!0)))),X(Object(m.a)(Object(m.a)({},J),{},Object(b.a)({},e.target.name,e.target.value)))},he=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C(!0),e.next=3,Ce.a.put("/documentsFieldAdditionals/".concat(J.id),J).then((function(e){e.data&&(C(!1),T(!1),s(!1),F.a.fire({text:ue("alerts:alerts.edited"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}).then((function(){u()})))})).catch((function(e){C(!1),T(!1),s(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:ue("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500})}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(O.a,{open:o,onClose:me,fullWidth:!1,maxWidth:"md",children:[Object(n.jsx)(fp,{align:"center",onClose:me}),Object(n.jsx)(_.a,{children:Object(n.jsxs)(ye.a,{container:!0,className:j.container,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,className:j.grid,align:"center",children:Object(n.jsx)(kn.a,{children:Object(n.jsxs)(Dr.a,{className:j.paper,value:P,onChange:function(e,t){R(t)},indicatorColor:"primary",textColor:"primary",centered:!0,children:[Object(n.jsx)(zr.a,Object(m.a)({label:"Documentos"},jp(0))),Object(n.jsx)(zr.a,Object(m.a)({label:"Links"},jp(1)))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,className:j.grid,align:"center",children:Object(n.jsxs)(Hc.a,{axis:"rtl"===g.direction?"x-reverse":"x",index:P,onChangeIndex:function(e){R(e)},children:[Object(n.jsx)(pp,{value:P,index:0,dir:g.direction,children:Object(n.jsx)(zn,{columns:ue("tables:table.columns-files-additionals",{returnObjects:!0}),rows:l,setDirection:W,setOrderBy:V,children:Object(n.jsx)(vn.a,{children:l.length>0?Object(I.J)(l,Object(I.f)(U,H)).slice(t*a,t*a+a).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:e.descripcion}),Object(n.jsxs)(yn.a,{align:"center",children:[Object(n.jsx)(K.a,{title:ue("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"preview",onClick:function(){return t=e.linkPdf,re(t),void le(!0);var t},children:Object(n.jsx)(cn.a,{})})}),Object(n.jsx)(K.a,{title:"Descargar",children:Object(n.jsx)(S.a,{"aria-label":"download",onClick:function(){return function(e){var t=document.createElement("a");t.download=e,t.href=e,t.click()}(e.linkPdf)},children:Object(n.jsx)(va.a,{})})}),3!==e.tipo&&Object(n.jsx)(K.a,{title:"Eliminar",children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(){return t=e.id,s(!1),void F.a.fire({text:ue("alerts:alerts.delete-additinal-document"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ue("buttons:buttons.accept"),cancelButtonText:ue("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.value?pe(t).catch((function(e){C(!1),s(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:ue("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500})})):s(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var t},children:Object(n.jsx)(Cn.a,{})})})]})]},e.id)})):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:ue("tables:table.empty-table")})})})})}),Object(n.jsx)(pp,{value:P,index:1,dir:g.direction,children:Object(n.jsx)(zn,{columns:ue("tables:table.columns-fields-additionals",{returnObjects:!0}),rows:p,setDirection:W,setOrderBy:V,children:Object(n.jsx)(vn.a,{children:p.length>0?Object(I.J)(p,Object(I.f)(U,H)).slice(t*a,t*a+a).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"left",children:e.descripcion}),Object(n.jsx)(yn.a,{align:"left",children:e.link}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:"Editar",children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return t=e.id,a=e.descripcion,n=e.link,X({descripcion:a,link:n,id:t}),void T(!0);var t,a,n},children:Object(n.jsx)(Wn,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:"Eliminar",children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(){return t=e.id,s(!1),void F.a.fire({text:ue("alerts:alerts.delete-additinal-link"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:ue("buttons:buttons.accept"),cancelButtonText:ue("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.value?je(t).catch((function(e){C(!1),s(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:ue("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500})})):s(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var t},children:Object(n.jsx)(Cn.a,{})})})})]},e.id)})):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"4",children:ue("tables:table.empty-table")})})})})})]})})]})}),Object(n.jsx)(_t,{loading:w})]}),Object(n.jsxs)(O.a,{open:B,onClose:be,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(fp,{align:"center",onClose:be}),Object(n.jsx)(_.a,{children:Object(n.jsx)(ye.a,{container:!0,className:j.container,spacing:2,children:Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,children:Object(n.jsx)(ve.a,{variant:"outlined",className:j.card,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{variant:"body1",align:"left",className:j.text,children:"".concat(ue("certificateBadgeTemplate:badges-certificate-form.field-description"))}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{multiline:!0,name:"descripcion",variant:"outlined",size:"small",value:J.descripcion,onChange:fe,className:j.fieldCard})}),Object(n.jsx)(we.a,{variant:"body1",align:"left",className:j.text,children:"".concat(ue("certificateBadgeTemplate:badges-certificate-form.field-url"),"*")}),Object(n.jsx)(mt.a,{className:"w-100",required:!0,children:Object(n.jsx)(Te.a,{label:"",name:"link",variant:"outlined",size:"small",placeholder:"http://",onChange:fe,value:J.link,className:j.fieldCard,type:"url",required:!0,error:ee.link,helperText:ee.link&&"Url no v\xe1lido."})})]})})})})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",color:"primary",onClick:function(){return he()},disabled:ee.link,children:ue("buttons:buttons.save")})})]}),Object(n.jsx)(O.a,{fullScreen:!0,open:se,TransitionComponent:gp,children:Object(n.jsx)(ya,{pdf:ie,download:!1,handleClose:function(){le(!1)},fullView:!0})})]})}));var Op=Object(C.a)((function(e){return{img:{maxWidth:"-webkit-fill-available",height:"-webkit-fill-available"},buttonDialog:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},namePrivate:{color:"rgba(0, 0, 0, 0.54)",fontSize:"0.875rem"},buttonCancel:{padding:"7px 40px"},mySwal:{zIndex:3e3}}})),vp=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),_p={changePage:I.b,setFormDocuments:I.y,setDocumentsFields:I.u,setReturnRoute:I.C,setSearchValue:I.E,changeBreadcrump:I.a},yp=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"insignias emitidas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,crump:e.crump||[]}}),_p)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.user,o=e.organizationId,s=e.changePage,l=e.setSearchValue,j=e.crump,g=e.changeBreadcrump,v=Object(i.useState)([]),y=Object(d.a)(v,2),w=y[0],C=y[1],k=Object(i.useState)([]),N=Object(d.a)(k,2),B=N[0],A=N[1],z=Object(i.useState)([]),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(u.g)(),W=Op(),q=Object(i.useState)(""),H=Object(d.a)(q,2),V=H[0],G=H[1],Q=Object(i.useState)(""),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(!0),ee=Object(d.a)($,2),te=ee[0],ae=ee[1],ne=Object(i.useState)(!1),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)(!1),se=Object(d.a)(oe,2),de=se[0],ue=se[1],me=Object(i.useState)(null),be=Object(d.a)(me,2),pe=be[0],fe=be[1],he=Object(i.useState)(!1),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ve=Object(i.useState)(!1),_e=Object(d.a)(ve,2),ke=_e[0],Be=_e[1],Se=Object(i.useState)(null),Ee=Object(d.a)(Se,2),De=Ee[0],ze=Ee[1],Pe=Object(i.useState)([]),Re=Object(d.a)(Pe,2),Me=Re[0],Le=Re[1],Fe=Object(i.useState)([]),Ue=Object(d.a)(Fe,2),We=Ue[0],Ye=Ue[1],qe=Object(i.useState)({email:"",whatsapp:"",message:""}),He=Object(d.a)(qe,2),Ke=He[0],Ve=He[1],Qe=Object(i.useState)(!1),Je=Object(d.a)(Qe,2),Xe=Je[0],Ze=Je[1],$e=Object(i.useState)(null),et=Object(d.a)($e,2),tt=et[0],at=et[1],nt=Object(i.useState)(0),it=Object(d.a)(nt,2),rt=it[0],ot=it[1],st=Object(i.useState)(!1),lt=Object(d.a)(st,2),dt=lt[0],ut=lt[1],bt=Object(i.useState)([]),pt=Object(d.a)(bt,2),jt=pt[0],ft=pt[1],ht=Object(i.useState)({}),gt=Object(d.a)(ht,2),xt=gt[0],Ot=gt[1],vt=Object(i.useState)(null),yt=Object(d.a)(vt,2),wt=yt[0],Ct=yt[1],kt=Boolean(wt),Nt=Object(D.a)(["alerts","tables","buttons","breadCrumps","dialogs","certifyDocuments","tabs"]),Bt=Object(d.a)(Nt,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?St().catch((function(){L.push("/500"),window.location.reload()})):(L.push("/dashboard"),window.location.reload())}),[]);var St=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j.length>3&&g(j.slice(0,3)),function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCountries");case 2:t=e.sent,a=t.data,ft(a.countries);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()(),e.next=5,Tt();case 5:ae(!1),l("");case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Tt=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/documentsCertify/getDocumentsCertifyByFiles",{id_colecciones_documentos:a});case 3:n=t.sent,i=n.data,r=window.location.href.includes("sign")?"sign":"normal",c=i.documentsCertify,c="sign"===r?i.documentsCertify.filter((function(e){return e.documentosFirmas.length>0||e.thereSignField||e.thereTrail})):i.documentsCertify.filter((function(e){return 0===e.documentosFirmas.length&&!e.thereSignField&&!e.thereTrail})),C(c),A(c);case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),At=function(e,t,a){F.a.fire({text:"".concat(Bt("alerts:alerts.revoke-undo-1")," ").concat(a," ").concat(Bt("alerts:alerts.revoke-undo-2-documents")),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:Bt("buttons:buttons.accept"),cancelButtonText:Bt("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.value&&Et(t,a);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},Et=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("eliminar"!==a&&"delete"!==a){e.next=16;break}return e.prev=1,ae(!0),e.next=5,Ce.a.delete("/documentsCertify/undo/document/".concat(t));case 5:n=e.sent,n.data&&(w.map((function(e){return e.id===t&&Tt()})),ae(!1),F.a.fire({text:Bt("alerts:alerts.deleted"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(1),ae(!1),F.a.fire({text:Bt("alerts:alerts.deleted-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 14:e.next=29;break;case 16:return e.prev=16,ae(!0),e.next=20,Ce.a.delete("/certificatesIssued/undo/certificate/".concat(t));case 20:i=e.sent,i.data&&(w.map((function(e){return e.id===t&&Tt()})),ae(!1),F.a.fire({text:Bt("alerts:alerts.undo-revoke"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})),e.next=29;break;case 25:e.prev=25,e.t1=e.catch(16),ae(!1),F.a.fire({text:Bt("alerts:alerts.undo-revoke-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 29:case"end":return e.stop()}}),e,null,[[1,10],[16,25]])})));return function(t,a){return e.apply(this,arguments)}}(),It=function(e){var t=w.find((function(t){return 0===t.estado&&t.id===e}));if(r.includes("Eliminar"))return t?Object(n.jsx)(K.a,{title:Bt("tables:table.tooltip.archive"),children:Object(n.jsx)(S.a,{"aria-label":"delete",children:Object(n.jsx)(Ul.a,{onClick:function(t){return At(0,e,Bt("tables:table.tooltip.archive").toLowerCase())}})})}):Object(n.jsx)(K.a,{title:Bt("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return At(0,e,Bt("tables:table.tooltip.delete").toLowerCase())},children:Object(n.jsx)(Cn.a,{})})})},Dt=function(){return Bt("tables:table.columns-documents-files",{returnObjects:!0})},zt=function(e){Ct(void 0),ut(!0),ot(e)},Pt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c,o,s,l,d,u,m;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ae(!0),e.next=3,Ce.a.post("/documentsFieldAdditionals/getDocumentFieldAdditionals",{tipo:1,id_documentos_emitidos:t});case 3:return o=e.sent,s=o.data,e.next=7,Ce.a.post("/documentsFieldAdditionals/getDocumentFieldAdditionals",{tipo:2,id_documentos_emitidos:t});case 7:return l=e.sent,e.next=10,Ce.a.post("/documentsFieldAdditionals/getDocumentFieldAdditionals",{tipo:3,id_documentos_emitidos:t});case 10:d=e.sent,(null===(a=s.documentFieldAdditionals)||void 0===a?void 0:a.length)>0||(null===l||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.documentFieldAdditionals)||void 0===i?void 0:i.length)>0||(null===d||void 0===d||null===(r=d.data)||void 0===r||null===(c=r.documentFieldAdditionals)||void 0===c?void 0:c.length)>0?(Le([].concat(Object(p.a)(null===s||void 0===s?void 0:s.documentFieldAdditionals),Object(p.a)(null===(u=d.data)||void 0===u?void 0:u.documentFieldAdditionals))),Ye(null===l||void 0===l||null===(m=l.data)||void 0===m?void 0:m.documentFieldAdditionals),Be(!0)):F.a.fire({text:"".concat(Bt("alerts:alerts.no-additional-document")),icon:"warning",iconColor:E.a.primary,confirmButtonText:Bt("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}),ae(!1);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Rt=function(e){Ve(Object(m.a)(Object(m.a)({},Ke),{},Object(b.a)({},e.target.name,e.target.value)))},Mt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:""===t.target.value?Ot(""):(a=jt.find((function(e){return e.id===t.target.value}))).prefijo_telefono&&Ot(Object(m.a)(Object(m.a)({},xt),{},{country:t.target.value,prefijo_telefono:a.prefijo_telefono}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Lt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),Ze(!0),1!==rt){e.next=18;break}return(a=new FormData).append("id",tt.id),a.append("email_receptor",Ke.email),a.append("nombre",tt.nombre),a.append("share",!1),a.append("sub",c.data_user.id),e.prev=9,e.next=12,ct()({method:"post",url:"".concat(je.a.apiURL,"/share/sendDocumentsCertify"),headers:{"Content-Type":"multipart/form-data"},data:a}).then((function(e){if(201===e.status)return Ze(!1),F.a.fire({customClass:{container:W.mySwal},text:"El correo electr\xf3nico ha rebotado",icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3});F.a.fire({customClass:{container:W.mySwal},text:Bt("alerts:alerts.send-successfully"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}).then((function(){Ut(),Ze(!1)}))}));case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(9),Ze(!1),e.abrupt("return",F.a.fire({customClass:{container:W.mySwal},text:Bt("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}));case 18:if(2!==rt){e.next=38;break}if(!(null===Ke||void 0===Ke?void 0:Ke.whatsapp)){e.next=38;break}if(!((null===Ke||void 0===Ke?void 0:Ke.whatsapp.length)<10)){e.next=23;break}return Ze(!1),e.abrupt("return",F.a.fire({customClass:{container:W.mySwal},text:Bt("alerts:alerts.whatsapp-send-invalid"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}));case 23:return(n=new FormData).append("id",tt.id),n.append("whatsapp_receptor","".concat(xt.prefijo_telefono).concat(null===Ke||void 0===Ke?void 0:Ke.whatsapp)),n.append("nombre",tt.nombre),n.append("share",!1),n.append("sub",c.data_user.id),e.prev=29,e.next=32,ct()({method:"post",url:"".concat(je.a.apiURL,"/share/sendDocumentsCertifyWhatsapp"),headers:{"Content-Type":"multipart/form-data"},data:n}).then((function(){F.a.fire({customClass:{container:W.mySwal},text:Bt("alerts:alerts.send-successfully"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}).then((function(){Ut(),Ze(!1)}))}));case 32:e.next=38;break;case 34:return e.prev=34,e.t1=e.catch(29),Ze(!1),e.abrupt("return",F.a.fire({customClass:{container:W.mySwal},text:Bt("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}));case 38:case"end":return e.stop()}}),e,null,[[9,14],[29,34]])})));return function(t){return e.apply(this,arguments)}}(),Ut=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ut(!1),Ve({email:"",whatsapp:"",message:""}),Ot({}),e.next=5,ct.a.get("".concat(je.a.apiURL,"/file/getPdfForWhatsapp/delete"));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Wt=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:F.a.fire({icon:"warning",iconColor:E.a.primary,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel",container:W.mySwal},buttonsStyling:!1,text:Bt("alerts:alerts.send-reminder"),showCancelButton:!0,confirmButtonText:Bt("alerts:alerts.yes-option"),cancelButtonText:"No"}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.isConfirmed){e.next=24;break}return e.prev=1,Ze(!0),e.next=5,Ce.a.post("/documentsCertify/reminderSignatories/".concat(tt.id));case 5:a=e.sent,n=a.data,e.t0=n,e.next=0===e.t0?10:1===e.t0?12:2===e.t0?14:16;break;case 10:return F.a.fire({customClass:{container:W.mySwal,confirmButton:"custom-button-confirm"},buttonsStyling:!1,text:Bt("alerts:alerts.send-successfull"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:2e3}),e.abrupt("break",17);case 12:return F.a.fire({customClass:{container:W.mySwal,confirmButton:"custom-button-confirm"},buttonsStyling:!1,text:Bt("alerts:alerts.no-send-by-many-in-day"),icon:"warning",iconColor:E.a.primary,showConfirmButton:!0}),e.abrupt("break",17);case 14:return F.a.fire({customClass:{container:W.mySwal,confirmButton:"custom-button-confirm"},buttonsStyling:!1,text:Bt("alerts:alerts.no-send-by-many"),icon:"warning",iconColor:E.a.primary,showConfirmButton:!0}),e.abrupt("break",17);case 16:return e.abrupt("break",17);case 17:Ze(!1),e.next=24;break;case 20:return e.prev=20,e.t1=e.catch(1),Ze(!1),e.abrupt("return",F.a.fire({customClass:{container:W.mySwal,confirmButton:"custom-button-confirm"},buttonsStyling:!1,text:Bt("alerts:alerts.error-ocurred"),iconColor:E.a.primary,icon:"error",showConfirmButton:!1,timer:2e3}));case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t){return e.apply(this,arguments)}}());case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"filesDocuments",items:w,setItems:A,groupId:Object(Ie.a)(e.match.params.id),changePage:s,loadData:St,setLoading:ae,organizationId:1===c.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===c.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:o}),Object(n.jsx)(zn,{columns:Dt(),rows:B,setDirection:G,setOrderBy:Z,children:Object(n.jsx)(vn.a,{children:te?Object(n.jsx)(qn,{columns:Dt(),photo:0}):B.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(B,Object(I.f)(V,X)).slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:Bt("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"preview",onClick:function(){return t=e.linkPdf,fe(t),void ce(!0);var t},children:Object(n.jsx)(cn.a,{})})})}),Object(n.jsxs)(yn.a,{align:"center",children:[e.nombre,2===e.estado?Object(n.jsx)("p",{className:W.namePrivate,children:Bt("certifyDocuments:document.waiting-for-signatories")}):""]}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_certificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:Bt("tables:table.tooltip.view-additional-field"),children:Object(n.jsx)(S.a,{"aria-label":"view",onClick:function(){return Pt(e.id)},children:Object(n.jsx)(le.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:Bt("tables:table.tooltip.view-document"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return a=Object(Ie.b)(e.id),M(a),void ue(!0);var a},children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:Bt("tables:table.tooltip.download"),children:Object(n.jsx)(S.a,{"aria-label":"export",onClick:function(){return function(e){var t=document.createElement("a");t.download=e,t.href=e,t.click()}(e.linkPdf)},children:Object(n.jsx)(rp.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:Bt("tables:table.tooltip.upload-additional-field"),children:Object(n.jsx)(S.a,{"aria-label":"upload",onClick:function(){return t=e.id,ze(t),void Oe(!0);var t},children:Object(n.jsx)(Uc.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:Bt("tables:table.tooltip.send-copy"),children:Object(n.jsx)(S.a,{"aria-label":"preview",onClick:function(t){return function(e,t){Ct(e.currentTarget),at(t)}(t,e)},children:Object(n.jsx)(cp.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:It(e.id)})]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"30",children:Bt("tables:table.empty-table")})})})}),Object(n.jsx)(O.a,{fullScreen:!0,open:re,TransitionComponent:vp,children:Object(n.jsx)(ya,{pdf:pe,download:!1,handleClose:function(){ce(!1)},fullView:!0})}),Object(n.jsx)(O.a,{fullScreen:!0,open:de,TransitionComponent:vp,children:Object(n.jsx)(Sa,{documentId:R,setOpenDialog:ue})}),Object(n.jsx)(bp,{open:xe,setOpen:Oe,organizationId:1===c.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===c.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?1:o,idDocumentCertify:De,loadData:St}),Object(n.jsx)(xp,{open:ke,setOpen:Be,rows:Me,loadData:St,fieldsAdditionals:We}),Object(n.jsx)(_t,{loading:Xe}),Object(n.jsxs)(U.a,{anchorEl:wt,anchorOrigin:{vertical:"top",horizontal:"right"},id:"primary-search-account-menu",keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:kt,onClose:function(){Ct(null)},children:[Object(n.jsxs)(Y.a,{disabled:1!==(null===tt||void 0===tt?void 0:tt.estado),onClick:function(){return zt(1)},children:[Object(n.jsx)(S.a,{children:Object(n.jsx)(op.a,{})}),Object(n.jsxs)("spam",{children:[Object(n.jsx)("p",{style:{margin:0},children:Bt("buttons:buttons.send-by-email")}),1!==(null===tt||void 0===tt?void 0:tt.estado)&&Object(n.jsx)("p",{style:{fontSize:"9px",margin:0},children:Bt("certifyDocuments:document.waiting-for-signatories")})]})]}),Object(n.jsxs)(Y.a,{disabled:1!==(null===tt||void 0===tt?void 0:tt.estado),onClick:function(){return zt(2)},children:[Object(n.jsx)(S.a,{children:Object(n.jsx)(Ft.a,{})}),Object(n.jsxs)("spam",{children:[Object(n.jsx)("p",{style:{margin:0},children:Bt("buttons:buttons.send-by-wp")}),1!==(null===tt||void 0===tt?void 0:tt.estado)&&Object(n.jsx)("p",{style:{fontSize:"9px",margin:0},children:Bt("certifyDocuments:document.waiting-for-signatories")})]})]}),1!==(null===tt||void 0===tt?void 0:tt.estado)&&Object(n.jsxs)(Y.a,{onClick:function(){return Wt()},children:[Object(n.jsx)(S.a,{children:Object(n.jsx)(sp.a,{})}),Object(n.jsx)("spam",{children:Bt("buttons:buttons.remember")})]}),Object(n.jsxs)(Y.a,{onClick:function(){return function(){var t=window.location.href.includes("sign"),a=Bt("tabs:tabs.tabs-details",{returnObjects:!0});j[2].route="/documents".concat(t?"/sign":"","/files/").concat(e.match.params.id),j.push({name:"".concat(a[1].label)}),g(j),L.push("history/".concat(Object(Ie.b)(tt.id)))}()},children:[Object(n.jsx)(S.a,{children:Object(n.jsx)(dr.a,{})}),Object(n.jsx)("spam",{children:Bt("buttons:buttons.view-history-send")})]})]}),Object(n.jsxs)(O.a,{open:dt,onClose:function(){return Ut()},fullWidth:!0,children:[Object(n.jsx)(we.a,{align:"center",variant:"h6",style:{margin:"1rem"},children:Bt("tables:table.tooltip.send-copy")}),Object(n.jsxs)("form",{type:"submit",onSubmit:function(e){return Lt(e)},children:[Object(n.jsx)(_.a,{children:Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:"w-100",children:[1===rt&&Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,variant:"outlined",name:"email",type:"email",placeholder:"example@email.co",value:Ke.email,onChange:Rt,InputProps:{startAdornment:Object(n.jsx)(Rn.a,{position:"start",children:Object(n.jsx)(ha.a,{})})}})})})}),2===rt&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:3,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsxs)(di.a,{children:[Bt("buttons:buttons.country-select")," "]}),Object(n.jsxs)(T.a,{required:!0,id:"pais",name:"id_paises",label:"Pa\xeds",onChange:Mt,value:(null===xt||void 0===xt?void 0:xt.country)||"",children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:Bt("buttons:buttons.country-select-option-default")})}),jt.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:"".concat(e.nombre).slice(0,e.nombre.length>9?4:3).toLocaleUpperCase()},"countrie-".concat(e.id))}))]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:9,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,variant:"outlined",name:"whatsapp",type:"number",placeholder:"3044579029",value:Ke.whatsapp,onChange:Rt,InputProps:{startAdornment:Object(n.jsxs)(Rn.a,{position:"start",children:[Object(n.jsx)(Ft.a,{}),"(+".concat(xt.prefijo_telefono?xt.prefijo_telefono:"",")")]})}})})})]})]})}),Object(n.jsx)(Ae.a,{style:{display:"flex",justifyContent:"center"},children:Object(n.jsx)(x.a,{color:"primary",variant:"contained",className:W.buttonCancel,disableElevation:!0,type:"submit",children:Bt("buttons:buttons.send")})})]})]})]})}));var wp={color:"#888888",fontSize:"3rem"},Cp={changePage:I.b,setSearchValue:I.E},kp=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"insignias emitidas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),Cp)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changePage,o=e.user,s=e.organizationId,l=e.setSearchValue,m=Object(u.g)(),b=Object(i.useState)([]),p=Object(d.a)(b,2),j=p[0],g=p[1],x=Object(i.useState)([]),O=Object(d.a)(x,2),v=O[0],_=O[1],y=Object(i.useState)(!1),w=Object(d.a)(y,2),C=w[0],k=w[1],N=Object(i.useState)("desc"),B=Object(d.a)(N,2),S=B[0],T=B[1],A=Object(i.useState)("fecha"),E=Object(d.a)(A,2),z=E[0],P=E[1],R=Object(D.a)(["tables","buttons"]),M=Object(d.a)(R,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?L():m.push("/dashboard")}),[]);var L=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,k(!0),e.next=4,F();case 4:k(!1),l(""),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),m.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),F=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/documentHistory/getDocumentHistorys",{id_documentos_emitidos:a});case 3:n=t.sent,i=n.data,g(i.documentHistorys.filter((function(e){return 4!==e.tipo}))),_(i.documentHistorys.filter((function(e){return 4!==e.tipo})));case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),U=function(){return M("tables:table.columns-documents-files-history",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"historyDocuments",items:j,setItems:_,changePage:c,loadData:L,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,setLoading:k}),Object(n.jsx)(zn,{columns:U(),rows:v,setDirection:T,setOrderBy:P,loading:C,children:Object(n.jsx)(vn.a,{children:C?Object(n.jsx)(qn,{columns:U(),photo:1}):v.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(v,Object(I.f)(S,z)).slice(t*a,t*a+a).map((function(e,t){var a,i;return Object(n.jsxs)(_n.a,{children:[Object(n.jsxs)(yn.a,{align:"center",children:[1===(null===e||void 0===e?void 0:e.tipo)&&Object(n.jsx)(K.a,{title:M("buttons:tooltips.share-by-email"),children:Object(n.jsx)(ha.a,{sx:wp})}),2===(null===e||void 0===e?void 0:e.tipo)&&Object(n.jsx)(K.a,{title:M("buttons:tooltips.share-by-whatsapp"),children:Object(n.jsx)(Ft.a,{sx:wp})}),3===(null===e||void 0===e?void 0:e.tipo)&&Object(n.jsx)(K.a,{title:M("buttons:tooltips.reminder"),children:Object(n.jsx)(sp.a,{sx:wp})})]}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===e||void 0===e||null===(a=e.usuarios)||void 0===a?void 0:a.primer_nombre," ").concat(null===e||void 0===e||null===(i=e.usuarios)||void 0===i?void 0:i.primer_apellido)}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===e||void 0===e?void 0:e.receptor)}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(null===e||void 0===e?void 0:e.fecha).format("DD/MM/YYYY hh:mm:ss")})]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"4",children:M("tables:table.empty-table")})})})})]})})),Np=a(1230);var Bp=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),Sp=Object(C.a)((function(e){return{container:{backgroundColor:"#E5E5E5"},container_stage:function(e){return{marginTop:32,backgroundImage:"url(".concat(e.imageRoute,")"),backgroundRepeat:"no-repeat",width:"fit-content",maxWidth:"68vw"}},container__certificate:{display:"flex",justifyContent:"center",overflow:"auto"},container__fields:{backgroundColor:"white",display:"flex",flexDirection:"column"},container__button_fields:{display:"flex",flexDirection:"column",borderRadius:10,margin:10,padding:10,cursor:"pointer",backgroundColor:E.a.primary,"& p":{marginBottom:0,color:"white",fontWeight:"bold",textAlign:"center"}},content_modal:{display:"grid",gridTemplateColumns:"35% 65%",gridTemplateRows:""},dialog__title:{backgroundColor:e.palette.primary.main},sweetModal:{zIndex:1300},mySwal:{zIndex:3e3},fieldButtonDisabled:{display:"none"},root_info:{height:180},container_info:{display:"flex",justifyContent:"center",margin:e.spacing(1),backgroundColor:"#fff",borderRadius:"1em"},buttonMinimize:{display:"flex",justifyContent:"right",margin:e.spacing(1),backgroundColor:"#fff",borderRadius:"1em"},pagination:{marginTop:"3px",position:"absolute"},style_a:{fontSize:"12px",color:"#0056b3",cursor:"pointer","&:hover":{textDecoration:"underline"}},style_a_disabled:{fontSize:"12px",color:"#6c757d",cursor:"default"}}})),Tp={login:I.g},Ap=Object(s.b)((function(e){return{user:e.user}}),Tp)((function(e){var t,a,r,c=Sp(),o=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","tables","dialogOtp"]),s=Object(d.a)(o,1)[0],l=Object(i.useState)(!1),u=Object(d.a)(l,2),b=u[0],j=u[1],v=Object(i.useState)(!0),C=Object(d.a)(v,2),k=C[0],N=C[1],B=Object(i.useState)(!1),T=Object(d.a)(B,2),A=T[0],I=T[1],z=Object(i.useState)(!0),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)([]),U=Object(d.a)(L,2),Y=U[0],q=U[1],H=Object(i.useState)([]),K=Object(d.a)(H,2),V=K[0],G=K[1],Q=Object(i.useState)(!0),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(0),ee=Object(d.a)($,2),ae=ee[0],ne=ee[1],oe=Object(i.useState)(!1),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)([]),me=Object(d.a)(ue,2),be=me[0],pe=me[1],fe=Object(i.useState)(!0),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],Oe=Object(i.useState)(window.innerWidth<660&&window.innerWidth-.3*window.innerWidth),ve=Object(d.a)(Oe,2),_e=ve[0],ke=ve[1],Be=Object(i.useState)(30),Se=Object(d.a)(Be,2),Ee=Se[0],De=Se[1],ze=Object(i.useState)({title:"",view:!1,message:"",thisNoNumberMessage:"",reSendCodeMessage:"",invalidCode:!1,codeOtp:"",signatorieEmail:"",correctNumber:!1,type:0,labelButtom:"",label_no_number:""}),Re=Object(d.a)(ze,2),Me=Re[0],Le=Re[1],Fe=["Caveat","Caveat Brush","Cookie","Architects Daughter","Cedarville Cursive","Dawning of a New Day","Crafty Girls","League Script"],Ue=e.match.params.idSignature,We=Y.findIndex((function(e){return"".concat(e.idSignature)===Object(Ie.a)(Ue)})),Ye=Pe()("certika-organization-".concat(null===V||void 0===V?void 0:V.id_organizaciones)).toString(),qe=Pe()("cer\n    tika-user-".concat(null===e||void 0===e||null===(t=e.user)||void 0===t||null===(a=t.data_user)||void 0===a?void 0:a.id)).toString(),He=Object(i.useRef)([]),Ke=Object(i.useRef)([]);Object(i.useEffect)((function(){N(!0),(null===e||void 0===e?void 0:e.user)&&!window.location.href.includes("/document")?window.location.href="/sign-in/signatorie/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature):window.location.href.includes("/document")?(Le(Object(m.a)(Object(m.a)({},Me),{},{view:!1})),Je(),Xe(),Qe(),Ce.a.post("/signature/getSignatures").then((function(e){var t=e.data;pe(null===t||void 0===t?void 0:t.signatures)})),vo.a.load({google:{families:Fe}})):Ve()}),[]),Object(i.useEffect)((function(){window.addEventListener("resize",(function(){ke(window.innerWidth<660&&window.innerWidth-.3*window.innerWidth)}),!0)}),[]),Object(i.useEffect)((function(){if(0!==Ee&&30!==Ee){var e=setTimeout((function(){De(Ee-1)}),1e3);return function(){return clearTimeout(e)}}}),[Ee]);var Ve=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.match.params.documentTemplateId||!e.match.params.idSignature){t.next=14;break}return t.prev=1,t.next=4,Ce.a.get("/signature/receiver/".concat(Ue));case 4:if(a=t.sent,null!==(n=a.data).signature){t.next=8;break}return t.abrupt("return",F.a.fire({customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"},icon:"warning",iconColor:E.a.primary,text:s("alerts:alerts.document-have-signature")}).then((function(){window.location.href="/"})));case 8:n.signature.usuarios.whatsapp?(Le(Object(m.a)(Object(m.a)({},Me),{},{title:s("dialogOtp:otp-dialog.title"),type:0,view:!0,correctNumber:!1,message:"".concat(s("dialogOtp:otp-dialog.message-informated")," +").concat(n.signature.usuarios.whatsapp," ").concat(s("dialogOtp:otp-dialog.message-informated2")," ").concat(n.signature.cuentas.correo),thisNoNumberMessage:s("dialogOtp:otp-dialog.info-number"),signatorieEmail:n.signature.cuentas.correo,codeOtp:"",invalidCode:!1,labelButtom:s("buttons:buttons.send"),label_no_number:s("dialogOtp:otp-dialog.is-not-my-number")})),De(30),M(!1)):!0===(null===(i=n.signature.cuentas)||void 0===i?void 0:i.estado)||1===(null===(r=n.signature.cuentas)||void 0===r?void 0:r.estado)?window.location.href="/sign-in/signatorie/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature):window.location.href="/sign-up/signatorie/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature),t.next=14;break;case 11:return t.prev=11,t.t0=t.catch(1),t.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:s("alerts:alerts.error-ocurred"),showConfirmButton:!0,buttonsStyling:!1,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}).then((function(){window.location.href="/"})));case 14:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(){return t.apply(this,arguments)}}(),Ge=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,0!==Me.type){t.next=8;break}return I(!0),t.next=5,Ce.a.post("/signature/otp_code/".concat(Ue));case 5:Le(Object(m.a)(Object(m.a)({},Me),{},{type:1,message:s("dialogOtp:otp-dialog.input-code"),thisNoNumberMessage:"",reSendCodeMessage:s("dialogOtp:otp-dialog.no-received-sms"),correctNumber:!0})),I(!1),0!==Ee&&De(Ee-1);case 8:if(1!==Me.type){t.next=27;break}if(a=Me.signatorieEmail,n=Me.codeOtp,I(!0),""!==n&&6===n.length){t.next=16;break}return I(!1),Le(Object(m.a)(Object(m.a)({},Me),{},{invalidCode:!0})),t.abrupt("return");case 16:return Le(Object(m.a)(Object(m.a)({},Me),{},{invalidCode:!1})),t.next=19,Ce.a.post("/signature/valid/otp_code",{code:n,email:a});case 19:if(!t.sent.data.message){t.next=25;break}return t.next=23,e.login({correo:a,password:n},"/sign-in/signatorie/".concat(e.match.params.documentTemplateId,"/").concat(e.match.params.idSignature));case 23:t.next=27;break;case 25:Le(Object(m.a)(Object(m.a)({},Me),{},{invalidCode:!0})),I(!1);case 27:t.next=32;break;case 29:return t.prev=29,t.t0=t.catch(0),t.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:s("alerts:alerts.error-ocurred"),buttonsStyling:!1,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}).then((function(){window.location.href="/"})));case 32:case"end":return t.stop()}}),t,null,[[0,29]])})));return function(){return t.apply(this,arguments)}}(),Qe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ct()({method:"get",url:"https://api.ipdata.co?api-key=".concat(je.a.keyIpData)});case 3:t=e.sent,a=t.data,G(Object(m.a)(Object(m.a)({},V),{},{ip_adress:a.ip})),e.next=11;break;case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",F.a.fire({icon:"warning",iconColor:E.a.primary,text:s("alerts:alerts.warning-block"),showConfirmButton:!0,confirmButtonText:s("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}));case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),Je=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.get("/signature/receiver/".concat(Ue));case 2:if(t=e.sent,null!==(null===(a=t.data)||void 0===a?void 0:a.signature)){e.next=6;break}return e.abrupt("return",F.a.fire({icon:"warning",iconColor:E.a.primary,text:s("alerts:alerts.document-already"),confirmButtonText:s("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}).then((function(){window.location.href="/"})));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Xe=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,o,l,d,u,b,p,j,h;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(Ie.a)(e.match.params.documentTemplateId),t.next=3,Ce.a.get("/documentTemplate/".concat(a));case 3:if(n=t.sent,!(i=n.data).documentTemplate||-1!==i.documentTemplate.documentTemplate.documentoEmitido[0].estado){t.next=7;break}return t.abrupt("return",F.a.fire({customClass:{container:c.mySwal},icon:"error",iconColor:E.a.primary,text:s("alerts:alerts.document-no-available"),showConfirmButton:!0}).then((function(){window.location.href="/"})));case 7:i.documentTemplate&&(u=i.documentTemplate,b=u.documentTemplate,p=u.linkPhoto,j=u.linkPhotoHD,h=u.linkPhotoTemplate,q(null===(r=i.documentTemplate)||void 0===r||null===(o=r.documentTemplate)||void 0===o?void 0:o.documentoCampos.map((function(e){return{id:e.id,fieldTypeConfig:""===e.nombre||"certificateCode"===e.nombre?51:52,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,idSignature:e.nombre.includes("signature")?e.idSignature:null,fieldName:e.nombre,align:e.formato_letra?e.formato_letra:"center",fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontSize:e.tamano_letra,fontFamily:{family:e.tipo_letra},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseFloat(e.x),y:parseFloat(e.y),width:0===e.width?"auto":e.width,height:0===e.height?e.tamano_letra:e.height,page:e.page}}))),null===(l=i.documentTemplate)||void 0===l||(null===(d=l.documentTemplate)||void 0===d||delete d.documentoCampos),G(Object(m.a)(Object(m.a)({},b),{},{img_prev:p,img_prevHD:j,img_template:h,id_usuarios:b.documentoEmitido[0].documentos[0].id_cuentas,estado:b.estado,pages:p.length,page:1,fileName:"documento"})),N(!1),He.current=[],Ke.current=[]);case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ze=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:F.a.fire({icon:"warning",iconColor:E.a.primary,text:s("alerts:alerts.sure-selected-signature"),showConfirmButton:!0,showCancelButton:!0,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}).then((function(e){if(e.isConfirmed){var a=Y.findIndex((function(e){return"".concat(e.idSignature)===Object(Ie.a)(Ue)}));Y[a]=Object(m.a)(Object(m.a)({},Y[a]),{},{exampleText:t.url,originalIdSign:t.id}),q(Object(p.a)(Y)),N(!0),setTimeout((function(){tt(),N(!1)}),2e3)}})),a=Y.findIndex((function(e){return"".concat(e.idSignature)===Object(Ie.a)(Ue)})),Y[a]=Object(m.a)(Object(m.a)({},Y[a]),{},{exampleText:t.url,originalIdSign:t.id}),q(Object(p.a)(Y));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$e=function(){de(!1)},et=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:F.a.fire({icon:"warning",iconColor:E.a.primary,text:s("alerts:alerts.sure-sign"),showConfirmButton:!0,confirmButtonText:s("alerts:alerts.yes-option"),cancelButtonText:"No",showCancelButton:!0,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"},buttonsStyling:!1}).then((function(e){if(e.isConfirmed){var a=t.current.toDataURL();Y[We]=Object(m.a)(Object(m.a)({},Y[We]),{},{exampleText:a}),q(Object(p.a)(Y)),de(!1),N(!0),setTimeout((function(){tt(),N(!1)}),2e3)}}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),tt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,o,l,d,u,b,p,g,x,O,v,_,y;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.preventDefault(),i=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]'),o=null===V||void 0===V?void 0:V.ip_adress,null===V||void 0===V?void 0:V.ip_adress){e.next=15;break}return e.prev=4,e.next=7,ct()({method:"get",url:"https://api.ipdata.co?api-key=".concat(je.a.keyIpData)});case 7:l=e.sent,d=l.data,o=d.ip,e.next=15;break;case 12:return e.prev=12,e.t0=e.catch(4),e.abrupt("return",F.a.fire({icon:"warning",iconColor:E.a.primary,text:s("alerts:alerts.warning-block"),showConfirmButton:!0,confirmButtonText:s("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}));case 15:if(!(null===(a=Y[We])||void 0===a||null===(n=a.exampleText)||void 0===n?void 0:n.includes("signatorie"))){e.next=17;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:s("alerts:alerts.error-sign-the-document"),showConfirmButton:!0,confirmButtonText:s("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}));case 17:return j(!0),e.next=20,Promise.all(Y.map(function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.fontColor&&(t.fontColor=t.fontColor.hex),t.rectColor&&(t.rectColor=t.rectColor.hex),"".concat(t.idSignature)!==Object(Ie.a)(Ue)){e.next=21;break}if(t.signCurrent=!0,!t.exampleText.includes("data")){e.next=20;break}return a=new FormData,n=Qm(t.exampleText),i="".concat(Ye,"/documentsTemplate/signatures/").concat(qe,"/").concat(Ue,".png"),a.append("file",n),a.append("route",i),a.append("signatorie",!0),e.next=13,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:a});case 13:c=e.sent,o=c.data,r=t.exampleText,t.exampleText=o.url,V.routeSignature=i,e.next=21;break;case 20:t.idSignature=t.originalIdSign;case 21:return e.abrupt("return",t);case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 20:return u=He.current[0].width,b=He.current[0].height,He.current.map((function(e){u<e.width&&(u=e.width),b<e.height&&(b=e.height)})),p=Ke.current[0].width,g=Ke.current[0].height,x=[],Ke.current.map((function(e){p<e.width&&(p=e.width),g<e.height&&(g=e.height),x.push({width:e.width,height:e.height})})),O=parseInt(100*(p-u)/u),v=parseInt(100*(g-b)/b),_=Ne()(new Date).format("LLLL"),y=Object(m.a)(Object(m.a)({},V),{},{ip_adress:o,idSignature:Ue,sizes:x,saltosWidth:O,saltosHeight:v,trailDate:_}),e.prev=31,e.next=34,Ce.a.post("/documentsCertify/signatureDocument",{dataToSend:y,documentsFields:Y}).then((function(e){Array.prototype.forEach.call(i,(function(e){return e.remove()})),e.data?F.a.fire({icon:"success",iconColor:E.a.primary,text:s("alerts:alerts.successfully-signed"),showConfirmButton:!0,confirmButtonText:s("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}).then((function(){G(Object(m.a)(Object(m.a)({},V),{},{pdf_documentoEmitido:e.data}));var t=document.createElement("a");t.download="".concat(V.nombre),t.href=e.data,t.click()})).then((function(){setTimeout((function(){window.location.href="/"}),3e3)})):F.a.fire({icon:"success",iconColor:E.a.primary,title:s("alerts:alerts.successfully-signed"),text:s("alerts:alerts.successfully-signed-text-still-parts"),showConfirmButton:!0,confirmButtonText:s("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}).then((function(){window.location.href="/"})),j(!1)}));case 34:e.next=41;break;case 36:return e.prev=36,e.t1=e.catch(31),Y.map(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.fontColor&&(t.fontColor={hex:t.fontColor}),t.rectColor&&(t.rectColor={hex:t.rectColor}),"".concat(t.idSignature)===Object(Ie.a)(Ue)&&(t.exampleText=r),e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),j(!1),e.abrupt("return",F.a.fire({customClass:{container:c.mySwal},icon:"error",iconColor:E.a.primary,text:s("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}));case 41:case"end":return e.stop()}}),e,null,[[4,12],[31,36]])})));return function(t){return e.apply(this,arguments)}}(),at=function(e){e&&!He.current.includes(e)&&He.current.push(e)},nt=function(e){e&&!Ke.current.includes(e)&&Ke.current.push(e)},it=function(){var t=Object(h.a)(f.a.mark((function t(){var a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,a=e.match.params.documentTemplateId,I(!0),t.next=5,Ce.a.post("/signature/otp_code/not_number/".concat(Ue,"_").concat(a));case 5:Le(Object(m.a)(Object(m.a)({},Me),{},{title:s("dialogOtp:otp-dialog.title_no_number"),labelButtom:"OK",thisNoNumberMessage:"",message:s("dialogOtp:otp-dialog.message_error_number"),label_no_number:""})),I(!1),t.next=12;break;case 9:return t.prev=9,t.t0=t.catch(0),t.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:s("alerts:alerts.error-ocurred"),buttonsStyling:!1,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}).then((function(){window.location.href="/"})));case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(){return t.apply(this,arguments)}}(),rt=function(){var t=Object(h.a)(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.history.push("/");case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ot=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,I(!0),De(30),e.next=5,Ce.a.post("/signature/otp_code/resend/".concat(Ue));case 5:De(29),I(!1),e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:s("alerts:alerts.error-ocurred"),buttonsStyling:!1,customClass:{container:c.mySwal,confirmButton:"custom-button-confirm"}}).then((function(){window.location.href="/"})));case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[k?Object(n.jsx)(_t,{loading:R}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(O.a,{open:!k,fullScreen:!0,TransitionComponent:Bp,children:[Object(n.jsx)(_t,{loading:b}),Object(n.jsx)(At,{signature:!0}),Object(n.jsxs)(ye.a,{container:!0,className:c.container,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:8,lg:8,className:c.container__certificate,children:Object(n.jsx)(ya,{pdf:V.pdf_documentoEmitido,download:!1,handleClose:function(){},fullView:!1})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,sm:4,lg:4,className:c.container__fields,children:[Object(n.jsx)(Ho,{title:s("certificateBadgeTemplate:certificate-design.signatures"),logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAztJREFUWEfFlm2IVVUUhp9XzexH4AeOOJFkJhroj2ScMKhQQ0GoTEMRJMIPUlARHZXyRxAViCWDOmGNIZUifiCm/lLUSYnKoiCiKI1CCfwATfCHiPTKuuyRM5c75957uNqGCxfOOft99lrrXWuL/3npXujb7i/pVi17NxzAdjPwPbBU0qFqEA0FsP0g0AX0BZ6TdPN+A3QCLwEtki5UE4/nDYuA7deBHQEg6XAt4o0GeBb4CjgDTJd0vRaIhkTA9ovAp8BvwHDgaq0QhQFsDwCmAcuBycAWYB0wFDhZK0QugO1hwMvAA0AIDkonHAs8lao9rPa+pJ+6Q277kTwI2/H9Q/FNNYCFwEfAeSAsdQ24BJxNXj8p6d9Kua4EYTvsuRZ4G+iQtLoawHagSVJYq+5VBrEKaAfGAG2SwrL5NrT9B9ApaWPd6kC0ZOBoNKWkFf8XS4qIllavEbA9AvgbaJX0Q0GATcB8YDbwuKTPyvfJA4j8b0gp+C/7oe0m4B3gCeCgpK3lG9uOIo2ZMCtvJuQB7CmFSJpbYfPTwGDgOLAIWCnpkzLIvfGOpBfyolcRwHY/4DKwWlK017vL9sNAdLkpkrpsRwMKoVcyNhyY3DJH0pdFAJ4HTgDNksJ2WYCA/geIKOwGNgM7Jb2VAQiYXQksdyL2FoGo+hinT1cI/xIgch4Q0XCiEb0m6UYG4L3ojpKeqVa8vQH8Dnwh6d2y03eLL5O0zXYfST0KNN63Hfm/IWlB3QC2nwR+BcZL+iVzqh7ieRvbPhUpkrS+CMCbwAJJo4uIpwj8DHwu6YMiAOHdLklr0mY1nzwDHLOiXVJHXQC2RwJ/ApMkfWe7JvGoBWBCGstxMZkOrJD0cb0AbWm+Pwa8kaq9VHAV3BCjekYSmwoMAc4Bkf9vgSOSLtYLEB9+A4QLwmo9xG2PA2YCcQNqSQ3pGBC/o9khU024+/ldG2aGTzSQeSEORAhbgVeTcPT+mJDh/SPA15Ju1ypW6b0sQMzrD8PGqYtdSVPsUeBH4EAaPGHRhq0sQNxmJ6adAyLcsD9+kv5qmGLZRiUA26PSNSvmfkzBfUXyWQSyGyBya0lhwfu6Cl/LG0V5B25rVzBsRNSiAAAAAElFTkSuQmCC",expand:X,onClick:function(){Z(!X),xe(!0)}}),Object(n.jsx)(ce.a,{in:X,children:Object(n.jsxs)(ie.a,{children:[Object(n.jsxs)(y.a,{button:!0,onClick:function(e){ne(0),de(!0)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwACG+8AAhvvAUkXG4MAAAAHdElNRQfkCwINJAvyOqHTAAACIElEQVRIx+3UW2jOcRzH8dfz7NnmsKPD2B6bISFN01hOixJFc+F44wLlwoWtLHEjd5Iop4stJO52tWVtSpSURWQsFBaZzKmWFDPb7O9ij7bpWWZc+tz+vp/39/T7/fivv1bCMOMyJOgeeZo1bjknbaT2dV4LfLTwT0yjrHBUuXSlXgsE7suJFxiKa486YLonCjDTFLTbrXq42Ys0OCkbG3UIBD7bM0SqOBWtd1uZJBRqEggEmuUOzx5R5p7NwihwJ5b9gmuu2CD99zNY5bR96jDLWSXodtghqbbbqt0lbyyWLuS9Vxq0/Yo7ogLkuBwr/rLU2Fm+g6o1+qJelRpfbfvVnu2iKFKcEQh0anVsUERYlitKke2Z431d96tEmzYJKuwAtd5pHATo9UGzPLR7aWwfs3+Aa3VimXIR3HDTGA8VSBwEaRVClxajhQYC5hgnKs8O4wW6TLTfIuetF8TdWIeI0MAWlqjXaYnVrmtyVZdAWI8HegYZgxgwxRe9/YBU8z230lSnVCr11Msh7kqmx7GWg4FDHGupncI+uuuTDLkxQESmHp/0xraQp8hVREzwZCBggSwhIRFHvJDvhAI5Zis0V5dWL7yXYZpitCJTvlp+/khjbFEpW6JdzunRYZIZ5gppVOe2DpNFfXPNd/keKbZJsVPe/qxguTTJPqhSQ6zH+GoRtkqyZGe09L+Fvea54aZnQ6zst0qRNDLjf/0T/QC23pqQEU1vAgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMC0xMS0wMlQxMzozNjoxMSswMDowMOddaFsAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjAtMTEtMDJUMTM6MzY6MTErMDA6MDCWANDnAAAAIHRFWHRzb2Z0d2FyZQBodHRwczovL2ltYWdlbWFnaWNrLm9yZ7zPHZ0AAAAYdEVYdFRodW1iOjpEb2N1bWVudDo6UGFnZXMAMaf/uy8AAAAYdEVYdFRodW1iOjpJbWFnZTo6SGVpZ2h0ADUxMo+NU4EAAAAXdEVYdFRodW1iOjpJbWFnZTo6V2lkdGgANTEyHHwD3AAAABl0RVh0VGh1bWI6Ok1pbWV0eXBlAGltYWdlL3BuZz+yVk4AAAAXdEVYdFRodW1iOjpNVGltZQAxNjA0MzI0MTcxvPIhjwAAABN0RVh0VGh1bWI6OlNpemUAMTUxNzFCQuShjmYAAABJdEVYdFRodW1iOjpVUkkAZmlsZTovLy4vdXBsb2Fkcy81Ni9WNjdhS3NWLzI2MjIvZ3VpX3NpZ25hdHVyZV9pY29uXzE1NzU4Ni5wbmfyEUKiAAAAAElFTkSuQmCC",alt:"sign"})}),Object(n.jsx)(w.a,{style:{textAlign:"center"},primary:s("buttons:buttons.add-signature")})]}),be.length>0&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(n.jsx)(W.a,{style:{width:"85%"}}),Object(n.jsx)(S.a,{onClick:function(){return xe(!ge)},children:ge?Object(n.jsx)(Np.a,{size:"small"}):Object(n.jsx)(te.a,{size:"small"})})]}),be.map((function(e){return Object(n.jsx)(ce.a,{in:ge,children:Object(n.jsx)(ie.a,{children:Object(n.jsx)(y.a,{button:!0,onClick:function(){return Ze(e)},children:Object(n.jsx)(re.a,{children:Object(n.jsx)("img",{src:e.url,alt:"sign",width:200})})})})})}))]})]})})]})]})]}),Object(n.jsx)(O.a,{open:le,fullWidth:!0,maxWidth:"sm",children:Object(n.jsxs)(_.a,{children:[Object(n.jsxs)(Dr.a,{value:ae,onChange:function(e,t){ne(t)},indicatorColor:"secondary",textColor:"secondary",variant:"fullWidth",children:[!_e&&Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:s("buttons:buttons.draw")}),Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:s("buttons:buttons.write")}),Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:s("buttons:buttons.upload")})]}),Object(n.jsxs)(ye.a,{container:!0,children:[0===ae&&!_e&&Object(n.jsx)(tb,{closeModalSign:$e,saveSign:et,progressBar:{},emailUser:null===(r=e.user)||void 0===r?void 0:r.correo,responsiveWidth:_e}),(1===ae&&!_e||_e&&0===ae)&&Object(n.jsx)(rb,{closeModalSign:$e,saveSign:et,nameUser:"".concat(e.user.data_user.primer_nombre," ").concat(e.user.data_user.primer_apellido),fontsFamilys:Fe,progressBar:{},emailUser:e.user.correo,responsiveWidth:_e}),(2===ae&&!_e||_e&&1===ae)&&Object(n.jsx)(lb,{closeModalSign:$e,saveSign:et,progressBar:{},emailUser:e.user.correo})]})]})})]}),Object(n.jsxs)(O.a,{open:Me.view,fullWidth:!0,children:[Object(n.jsx)(we.a,{align:"center",variant:"h6",style:{margin:"1rem"},children:Me.title}),Object(n.jsx)(_.a,{children:Object(n.jsx)(ye.a,{container:!0,spacing:2,className:"w-100",children:Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(we.a,{align:Me.correctNumber?"center":"start",variant:"h6",style:{textAlign:"justify"},children:Me.message})}),Me.correctNumber?Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",children:Object(n.jsx)(Te.a,{error:Me.invalidCode,required:!0,variant:"outlined",name:"codeOtp",type:"number",value:Me.codeOtp,onChange:function(e){e.target.value.length>6||Le(Object(m.a)(Object(m.a)({},Me),{},{codeOtp:e.target.value,invalidCode:!1}))},onKeyDown:function(e){return!/^([1-9][0-9]*(?:[\.][0-9]*)?|\.[0-9]+)$/.test(e)},helperText:Me.invalidCode?s("dialogOtp:otp-dialog.invalid_code"):""})})}):Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsx)(we.a,{align:"start",style:{fontSize:"14px"},children:Me.thisNoNumberMessage}),Object(n.jsx)("p",{className:c.style_a,onClick:function(){return it()},children:Me.label_no_number})]}),Me.correctNumber&&""!==Me.reSendCodeMessage&&Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)("p",{className:0===Ee?c.style_a:c.style_a_disabled,onClick:function(){return 0===Ee&&ot()},children:"".concat(Me.reSendCodeMessage," ").concat(0===Ee?"":"(".concat(Ee,"s)"))})})]})})}),Object(n.jsxs)(Ae.a,{style:{display:"flex",justifyContent:"center"},children:[Object(n.jsx)(x.a,{color:"primary",variant:"contained",className:c.buttonCancel,disableElevation:!0,onClick:function(){return!A&&("OK"===Me.labelButtom?rt():Ge())},children:A?Object(n.jsx)(Ot.a,{size:24,color:"inherit"}):Me.labelButtom}),Me.correctNumber&&Object(n.jsx)(x.a,{color:"primary",variant:"contained",className:c.buttonCancel,disableElevation:!0,onClick:function(){return Ve()},children:s("buttons:buttons.back")}),!Me.correctNumber&&Object(n.jsx)(x.a,{color:"primary",variant:"contained",className:c.buttonCancel,disableElevation:!0,onClick:function(){return window.location.href="/sign-in"},children:s("buttons:buttons.cancel")})]})]}),V.img_prev&&V.img_prev.map((function(e){return Object(n.jsx)(g.a,{imgProps:{ref:at},src:e,style:{display:"none"}})})),V.img_prevHD&&V.img_prevHD.map((function(e){return Object(n.jsx)(g.a,{imgProps:{ref:nt},src:e,style:{display:"none"}})}))]})})),Ep=a(1231);var Ip=Object(xe.a)((function(e){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:e.palette.grey["light"===e.palette.type?200:700]},bar:{borderRadius:5,backgroundColor:e.palette.primary}}}))(Oe.a),Dp=function(e){var t=e.title,a=e.value,i=void 0===a?0:a,r=e.open;return Object(n.jsxs)(O.a,{open:r,fullWidth:"xs",children:[Object(n.jsx)(v.a,{align:"center",children:t}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsxs)(Lt.a,{display:"flex",alignItems:"center",children:[Object(n.jsx)(Lt.a,{width:"100%",mr:1,children:Object(n.jsx)(Ip,{variant:"determinate",value:i})}),Object(n.jsx)(Lt.a,{minWidth:35,children:Object(n.jsx)(we.a,{variant:"body2",color:"textSecondary",children:"".concat(Math.round(i),"%")})})]})})]})},zp=r.a.createRef();var Pp=Object(C.a)((function(e){return{text:{marginTop:"1em",marginBottom:"1em"},button:{padding:"9px 40px"},input:{display:"none"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},alert:{width:"100%","& > * + *":{marginTop:e.spacing(1)}},link:{color:E.a.primary,border:"none",marginTop:"-1em",backgroundColor:"#fff","&:hover":{color:E.a.secondary}},linkDisabled:{display:"none",border:"none",marginTop:"-1em"},closeButton:{margin:".5em .5em 0 0",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}},"a\xf1adirButton":{color:"#0056b3",textTransform:"none",transitionProperty:"none","&:hover":{backgroundColor:"none",textDecoration:"underline"}},dropzone:{},previewGridContainer:{"&.MuiGrid-spacing-xs-8":{width:"100%",margin:0}},dropzoneRemoveAll:{textAlign:"rigth"}}})),Rp={changePage:I.b,changeBreadcrump:I.a},Mp=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"emitir carnets"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,styles:e.styles}}),Rp)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changePage,o=e.user,s=e.organizationId,j=e.changeBreadcrump,g=e.styles,y=Pp(),w=Object(u.g)(),C=Object(i.useState)([]),k=Object(d.a)(C,2),N=k[0],B=k[1],A=Object(i.useState)([]),P=Object(d.a)(A,2),R=P[0],M=P[1],L=Object(i.useState)([]),U=Object(d.a)(L,2),W=U[0],q=U[1],H=Object(i.useState)([]),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)([]),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(!1),te=Object(d.a)(ee,2),ne=te[0],ie=te[1],re=Object(i.useState)(!1),ce=Object(d.a)(re,2),oe=ce[0],se=ce[1],le=Object(i.useState)(!1),de=Object(d.a)(le,2),ue=de[0],me=de[1],be=Object(i.useState)([]),pe=Object(d.a)(be,2),fe=pe[0],he=pe[1],ge=Object(i.useState)([]),xe=Object(d.a)(ge,2),ke=xe[0],Ne=xe[1],Be=Object(i.useState)(!1),Se=Object(d.a)(Be,2),Ae=Se[0],Ee=Se[1],De=Object(i.useState)(!0),ze=Object(d.a)(De,2),Re=ze[0],Me=ze[1],Le=Object(i.useState)([]),Fe=Object(d.a)(Le,2),Ue=Fe[0],We=Fe[1],Ye=Object(i.useState)({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"0",file:null}),qe=Object(d.a)(Ye,2),He=qe[0],Ke=qe[1],Ve=Object(i.useState)({title:"Cargando fotos...",open:!1,value:0}),Ge=Object(d.a)(Ve,2),Qe=Ge[0],Je=Ge[1],Xe=Object(i.useState)(""),Ze=Object(d.a)(Xe,2),$e=Ze[0],et=Ze[1],tt=Object(i.useState)(""),at=Object(d.a)(tt,2),nt=at[0],it=at[1],rt=Object(i.useState)([]),ot=Object(d.a)(rt,2),st=ot[0],lt=ot[1],dt=Object(i.useState)([]),ut=Object(d.a)(dt,2),bt=ut[0],pt=ut[1],jt=Object(i.useState)([]),ft=Object(d.a)(jt,2),ht=ft[0],gt=ft[1],vt=Object(i.useState)(null),_t=Object(d.a)(vt,2),yt=_t[0],wt=_t[1],Ct=["email_receptor","indicativo_pais","whatsapp_receptor"],kt=["","",""],Nt=Object(i.useState)(),Bt=Object(d.a)(Nt,2),St=Bt[0],Tt=Bt[1],At=Object(i.useState)([{id:"index",label:"#",minWidth:50,align:"center"}]),Et=Object(d.a)(At,2),It=Et[0],Dt=Et[1],zt=Object(i.useState)(""),Pt=Object(d.a)(zt,2),Rt=Pt[0],Mt=Pt[1],Ft=Object(i.useState)([]),Ut=Object(d.a)(Ft,2),Wt=Ut[0],Yt=Ut[1],qt=Object(D.a)(["alerts","tables","buttons","certificateBadgeIssued","breadCrumps","dialogs","selects"]),Ht=Object(d.a)(qt,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?Kt().catch((function(){w.push("/500"),window.location.reload()})):(w.push("/dashboard"),window.location.reload())}),[]);var Kt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xt();case 2:return e.next=4,Zt();case 4:return e.next=6,Qt();case 6:j(Ht("breadCrumps:breadCrumps.carnet-issue",{returnObjects:!0})),c=null===(t=window.navigator)||void 0===t||null===(a=t.userAgentData)||void 0===a||null===(n=a.platform)||void 0===n?void 0:n.toLowerCase(),o=null===(i=window.navigator)||void 0===i||null===(r=i.platform)||void 0===r?void 0:r.toLowerCase(),c?c.includes("windows")?Mt("ISO-8859-3"):Mt("UTF-8"):o.includes("win")?Mt("ISO-8859-3"):Mt("UTF-8");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(i.useEffect)((function(){var e,t,a,n=null===st||void 0===st?void 0:st.filter((function(e){return(null===e||void 0===e?void 0:e.id)===(null===yt||void 0===yt?void 0:yt.id)}));pt(null===(e=n[0])||void 0===e?void 0:e.carnetCampos),Tt(null===(t=n[0])||void 0===t?void 0:t.codigo),Yt(null===(a=n[0])||void 0===a?void 0:a.carnetCamposAdicionales),(null===yt||void 0===yt?void 0:yt.id)&&F.a.fire({icon:"info",iconColor:E.a.primary,text:Ht("alerts:alerts.download-template"),confirmButtonText:Ht("buttons:buttons.download"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){var a,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value&&ea(null===(a=n[0])||void 0===a?void 0:a.carnetCampos,null===(i=n[0])||void 0===i?void 0:i.codigo,null===(r=n[0])||void 0===r?void 0:r.carnetCamposAdicionales);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(null===yt||void 0===yt?void 0:yt.id)&&Jt()}),[yt]),Object(i.useEffect)((function(){He.id_organizaciones&&Zt().catch((function(){w.push("/500"),window.location.reload()}))}),[He.id_organizaciones]);var Vt=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Gt=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Qt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Vt){e.next=9;break}return e.next=3,Ce.a.post("/carnetTemplate/getCarnetTemplatesPublished/names");case 3:t=e.sent,a=t.data,lt(a.carnetTemplates),a&&Me(!1),e.next=15;break;case 9:return e.next=11,Ce.a.post("/carnetTemplate/getCarnetTemplatesPublished/names",{id_organizaciones:s});case 11:n=e.sent,i=n.data,lt(Gt?i.carnetTemplates.filter((function(e){return e.plantillasCarnetsHistorial[0].id_usuarios===o.data_user.id})):i.carnetTemplates),i&&Me(!1);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Jt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/carnetsIssued/getCarnetsIssuedNames",{id_plantillas_carnets:null===yt||void 0===yt?void 0:yt.id});case 2:t=e.sent,a=t.data,gt(a.issued.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Xt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations");case 2:t=e.sent,a=t.data,he(a.organizations.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Zt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.get("/contract/card/".concat(He.id_organizaciones));case 2:t=e.sent,a=t.data,Ne(a.contract);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$t=function(e){Ke(Object(m.a)(Object(m.a)({},He),{},Object(b.a)({},e.target.name,e.target.value)))},ea=function(e,t,a){var n=[],i=[];e.sort((function(e,t){return e.id<t.id?-1:1})).map((function(e){"qr"!==e.nombre&&"logo"!==e.nombre&&"certificateCode"!==e.nombre&&"buttonVerify"!==e.nombre&&(n.push(e.nombre),i.push(""))})),a.sort((function(e,t){return e.id<t.id?-1:1})).map((function(e){n.push(e.nombre_campo),i.push("")}));var r=Ct.concat(n),c=kt.concat(i);r.push("fecha_expiracion"),c.push("20/09/2050"),r.unshift("codigo_carnet"),c.unshift(t);var o=Object(ed.convertArrayToCSV)([c],{header:r,separator:";"});td(o,yt)},ta=function(e){zp.current&&zp.current.open(e)},aa=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,l,d,u,b,p,j,h,g,x,O,v,_,y,w,C,k,N,S,T,A;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],i=[],r=[],l=[],d=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,u=/^([0-9]{10})+$/,b=/^([0-9])*$/,p=/^([0-9]{1,5})+$/,j=["codigo_carnet","email_receptor","indicativo_pais","whatsapp_receptor","fecha_expiracion"],h=[],t[0].meta.fields.map((function(e){It.push({id:"".concat(e),label:"".concat(e),align:"center",orden:"data.".concat(e)})})),Dt(It),bt.map((function(e){j.push(e.nombre),h.push({nombre:e.nombre,tipo:e.tipo_campo_vp})})),Wt.map((function(e){j.push(e.nombre_campo)})),t.map((function(e){j.includes("qr")&&!e.meta.fields.includes("qr")&&e.meta.fields.push("qr"),j.includes("logo")&&!e.meta.fields.includes("logo")&&e.meta.fields.push("logo"),j.includes("certificateCode")&&!e.meta.fields.includes("certificateCode")&&e.meta.fields.push("certificateCode"),j.includes("buttonVerify")&&!e.meta.fields.includes("buttonVerify")&&e.meta.fields.push("buttonVerify"),0===e.errors.length&&e.meta.fields.length===j.length&&JSON.stringify(e.meta.fields.sort())===JSON.stringify(j.sort())&&(j.includes("qr")&&(e.data=Object(m.a)({qr:"qr-certika-600x600.png"},e.data)),j.includes("logo")&&(e.data=Object(m.a)({logo:"Certika-435x149.png"},e.data)),j.includes("certificateCode")&&(e.data=Object(m.a)({certificateCode:"certificateCode"},e.data)),j.includes("buttonVerify")&&(e.data=Object(m.a)({buttonVerify:"buttonVerify"},e.data)),i.push(e.data))})),g=i.map((function(e){return e.fecha_expiracion})),x=g.filter((function(e,t){return g.indexOf(e)===t})),$(x),i.map((function(e,t){var a=[],c=[];if(i.map((function(t){t.codigo_carnet===e.codigo_carnet&&t.email_receptor===e.email_receptor&&a.push(!0),""!=="".concat(e.indicativo_pais).concat(e.whatsapp_receptor)&&"".concat(t.indicativo_pais).concat(t.whatsapp_receptor)==="".concat(e.indicativo_pais).concat(e.whatsapp_receptor)&&c.push(!0)})),""!==e.codigo_carnet.trim()&&""!==e.email_receptor.trim()){if(r.push({index:t,data:e}),1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?st.find((function(t){return t.codigo===e.codigo_carnet.trim()}))||n.push({index:t,msg:"".concat(Ht("alerts:alerts.does-exit-template")," ").concat(e.codigo_carnet)}):st.find((function(t){return t.codigo===e.codigo_carnet.trim()&&t.id_organizaciones===s}))||n.push({index:t,msg:"".concat(Ht("alerts:alerts.does-exit-template")," ").concat(e.codigo_carnet)}),a.length>1&&n.push({index:t,msg:"".concat(Ht("alerts:alerts.template-assigned")," ").concat(e.id_plantilla," ").concat(Ht("alerts:alerts.for-user")," ").concat(e.email_receptor)}),c.length>1&&n.push({index:t,msg:"".concat(Ht("alerts:alerts.template-assigned")," ").concat(e.id_plantilla," ").concat(Ht("alerts:alerts.for-user")," ").concat(e.indicativo_pais).concat(e.whatsapp_receptor)}),ht.find((function(t){return t.plantillasCarnets.codigo===e.codigo_carnet.trim()&&t.email_receptor===e.email_receptor.trim()}))&&n.push({index:t,msg:"".concat(Ht("alerts:alerts.template-issued")," ").concat(e.codigo_carnet," ").concat(Ht("alerts:alerts.for-user")," ").concat(e.email_receptor)}),""!==e.indicativo_pais.trim()&&(p.test(e.indicativo_pais.trim())||n.push({index:t,msg:"".concat(Ht("alerts:alerts.indicative-invalid"))})),d.test(e.email_receptor.trim())||n.push({index:t,msg:Ht("alerts:alerts.email-invalid")}),""!==e.whatsapp_receptor.trim()&&(u.test(e.whatsapp_receptor.trim())||n.push({index:t,msg:"".concat(Ht("alerts:alerts.whatsapp-invalid"))}),""===e.indicativo_pais.trim()&&n.push({index:t,msg:"".concat(Ht("alerts:alerts.indicative-invalid"))})),e.codigo_carnet.trim()!==St&&n.push({index:t,msg:Ht("alerts:alerts.carnet-code-error")}),h.map((function(a){""!==e[a.nombre]?42===a.tipo?b.test(e[a.nombre].trim())||n.push({index:t,msg:"".concat(Ht("alerts:alerts.field-invalid")," ").concat(a.nombre)}):44===a.tipo?u.test(e[a.nombre].trim())||n.push({index:t,msg:"".concat(Ht("alerts:alerts.field-invalid")," ").concat(a.nombre)}):43===a.tipo&&(d.test(e[a.nombre].trim())||n.push({index:t,msg:"".concat(Ht("alerts:alerts.field-invalid")," ").concat(a.nombre)})):l.push(t+2)})),""!==e.fecha_expiracion.trim()){var m=e.fecha_expiracion.trim().split("/"),j=new Date(m[2],m[1]-1,m[0]);Object(Kl.a)(parseInt(m[2]),parseInt(m[1])-1,parseInt(m[0]))&&Object(Vl.a)(j,new Date)||n.push({index:t,msg:Ht("alerts:alerts.expiration-date-invalid")})}}else l.push(t+2)})),e.next=21,Ce.a.post("/contract/validations/",{id_organizaciones:null===He||void 0===He?void 0:He.id_organizaciones,issued:r});case 21:if(O=e.sent,v=O.data,!(_=v.contracts).thereContrat){e.next=41;break}if(y=o.data_user.gruposUsuariosOrganizaciones.find((function(e){return e.id_organizaciones===s})),w=y.id,C=y.id_grupos_usuarios,!(4===C)){e.next=35;break}return e.next=30,Ce.a.get("/userGroup/organizations/".concat(w));case 30:if(k=e.sent,N=k.data,S=N.group,T=S.limit_issued,A=S.user_total_issueds,!(T&&r.length>T-A)){e.next=35;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:Ht("alerts:alerts.exceeds-contract"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){na()})));case 35:if(!_.exceeds){e.next=37;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:Ht("alerts:alerts.exceeds-contract"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){na()})));case 37:if(!_.vencido){e.next=39;break}return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:Ht("alerts:alerts.expired-contract"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){na()})));case 39:e.next=42;break;case 41:return e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:Ht("alerts:alerts.no-contract-error"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){na()})));case 42:c(0),ie(!0),B(r),M(i),q(n),Q(l),Ke(Object(m.a)(Object(m.a)({},He),{},{file:a}));case 49:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),na=function(e){zp.current&&zp.current.removeFile(e),ie(!1),se(!1),me(!1),B([]),q([]),Ke({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"",file:null}),Dt([{id:"index",label:"#",minWidth:50,align:"center"}])},ia=function(e){var t=new Date,a=e.split("-"),n=new Date;return t.setFullYear(a[0],a[1]-1,a[2]),!(t>=n)},ra=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new FormData,Ue.map((function(e){return t.append("photos",e.file)})),e.next=4,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-carnet-photos"),headers:{"Content-Type":"multipart/form-data"},data:t,onUploadProgress:function(e){var t=e.loaded,a=e.total,n=Math.floor(100*t/a);Je(Object(m.a)(Object(m.a)({},Qe),{},{open:!0,value:n}))}});case 4:Je(Object(m.a)(Object(m.a)({},Qe),{},{open:!1}));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(ve.a,{elevation:0,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{variant:"body1",className:y.text,children:Ht("certificateBadgeIssued:issue.complete-carnet")}),Object(n.jsx)(we.a,{variant:"body1",className:y.text,children:Ht("certificateBadgeIssued:issue.text-issued-carnet-1")}),Object(n.jsxs)(we.a,{variant:"body1",className:y.text,children:[Ht("certificateBadgeTemplate:details.recommendations"),":"]}),Object(n.jsxs)("ul",{children:[Object(n.jsx)("li",{children:Object(n.jsx)(we.a,{variant:"body1",className:y.text,children:Ht("certificateBadgeIssued:issue.text-issued-carnet-recommendation-1")})}),Object(n.jsx)("li",{children:Object(n.jsx)(we.a,{variant:"body1",className:y.text,children:Ht("certificateBadgeIssued:issue.text-issued-carnet-recommendation-2")})})]}),Object(n.jsxs)(we.a,{variant:"body1",className:y.text,children:[Ht("certificateBadgeIssued:issue.example"),": 123456789.jpg"]}),Ue.length>0&&Object(n.jsx)(Lt.a,{display:"flex",flexDirection:"row-reverse",children:Object(n.jsx)(K.a,{title:"Eliminar todas las fotos",children:Object(n.jsx)(S.a,{onClick:function(){return We([])},children:Object(n.jsx)(Ep.a,{fontSize:"large"})})})}),Object(n.jsx)(Yc.b,{previewGridClasses:{container:y.previewGridContainer},dropzoneText:Ht("certificateBadgeIssued:issue.text-issued-carnet-2"),acceptedFiles:["image/png","image/jpg","image/jpeg"],maxFileSize:1e7,filesLimit:1e3,onAdd:function(e){e=e.filter((function(e){return!Ue.find((function(t){return t.data===e.data}))})),We([].concat(Object(p.a)(Ue),Object(p.a)(e)))},onDelete:function(e){We(Ue.filter((function(t){return t!==e})))},fileObjects:Ue}),Object(n.jsxs)(we.a,{variant:"body1",className:y.text,children:[Ht("certificateBadgeIssued:issue.text-issued-1")," ",Object(n.jsxs)("b",{children:[Ht("certificateBadgeIssued:issue.rows-carnet")," "]}),"Certika"===g.organizationName?Ht("certificateBadgeIssued:issue.text-issued-carnet-3"):Ht("certificateBadgeIssued:issue.text-issued-carnet-3-min")]}),Object(n.jsx)(Dp,{title:Qe.title,value:Qe.value,open:Qe.open}),Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(oo.a,{options:st.sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})),getOptionLabel:function(e){return"".concat(e.nombre," (").concat(e.nombre_privado,")")},onChange:function(e,t){wt({id:null===t||void 0===t?void 0:t.id,nombre:null===t||void 0===t?void 0:t.nombre})},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{label:Re?"Cargando...":Ht("selects:selects-autocompletes.carnet-select"),variant:"outlined",InputProps:Object(m.a)(Object(m.a)({},e.InputProps),{},{endAdornment:Object(n.jsx)(n.Fragment,{children:e.InputProps.endAdornment})})}))}}),Re&&Object(n.jsx)(Oe.a,{})]}),Object(n.jsx)(Ui.a,{ref:zp,onFileLoad:aa,noClick:!0,noDrag:!0,progressBarColor:E.a.primary,config:{header:!0,encoding:Rt,skipEmptyLines:!0},children:function(e){var t=e.file;return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",marginBottom:10},children:[Object(n.jsx)(x.a,{disabled:!yt,variant:"contained",color:"primary",component:"span",className:y.button,onClick:ta,disableElevation:!0,children:Ht("buttons:buttons.choose-csv")}),Object(n.jsx)("div",{style:{borderWidth:1,height:45,lineHeight:2.5,marginTop:5,marginBottom:5,paddingLeft:13,paddingTop:3,width:"60%"},children:t&&t.name})]})}}),Object(n.jsx)(we.a,{variant:"body1",className:y.text,children:Ht("certificateBadgeIssued:issue.uses-csv")}),Object(n.jsx)(l.b,{disabled:!yt,component:"button",to:"#",onClick:function(){return ea(bt,St,Wt)},className:yt?y.link:y.linkDisabled,children:Object(n.jsxs)(we.a,{variant:"body1",className:y.text,children:[Object(n.jsx)(va.a,{}),Ht("certificateBadgeIssued:issue.dowload-template")]})})]})}),Object(n.jsxs)(O.a,{open:ne,fullWidth:!0,maxWidth:"xl",scroll:"body",children:[Object(n.jsx)(ye.a,{container:!0,justify:"flex-end",children:Object(n.jsx)(S.a,{className:y.closeButton,onClick:na,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsxs)(v.a,{children:[Object(n.jsxs)("div",{className:y.alert,children:[Object(n.jsxs)(Qi.a,{severity:"info",children:[Ht("alerts:alerts.preloaded")," ",N.length," ",Ht("alerts:alerts.of")," ",R.length," ",Ht("alerts:alerts.rows")]}),0===N.length&&Object(n.jsx)(Qi.a,{severity:"error",children:Ht("alerts:alerts.no-carnet-to-issue")}),N.length>1e3&&Object(n.jsx)(Qi.a,{severity:"error",children:Ht("alerts:alerts.exceeded-limit")}),Z.length>1&&Object(n.jsx)(Qi.a,{severity:"error",children:Ht("alerts:alerts.expiration-date-equal")}),G.length>0&&Object(n.jsxs)(Qi.a,{severity:"error",children:[Ht("alerts:alerts.rows-2")," ",Object(n.jsx)("b",{children:G.toString()})," ",Ht("alerts:alerts.no-requirements")]}),W.length>5&&!ue?Object(n.jsxs)(n.Fragment,{children:[W.map((function(e,t){return t<5&&Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:[Ht("alerts:alerts.row")," ",e.index+2,":"]})," ",e.msg,"."]})},"row".concat(t))})),Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:["5 ",Ht("alerts:alerts.of")," ",W.length," ",Ht("alerts:alerts.errors"),"."]}),Object(n.jsx)(x.a,{onClick:function(){me(!0)},className:y.a\u00f1adirButton,children:Ht("buttons:buttons.see-all")})]})})]}):Object(n.jsx)(n.Fragment,{children:W.map((function(e,t){return Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:[Ht("alerts:alerts.row")," ",e.index+2,":"]}),e.msg,"."]})},"row".concat(t))}))})]}),Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",color:"primary",component:"span",className:y.button,onClick:function(e){e.preventDefault(),ie(!1),se(!0)},disabled:(N.length!==R.length||W.length>0||0===N.length||N.length>1e3||Z.length>1||G.length>0)&&!0,children:Ht("buttons:buttons.issue")}),Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",color:"primary",component:"span",className:y.button,onClick:na,children:Ht("buttons:buttons.cancel")})]}),Object(n.jsx)(_.a,{dividers:!0,children:N.length>0&&Object(n.jsx)(zn,{columns:It,rows:N,setDirection:et,setOrderBy:it,children:Object(n.jsx)(vn.a,{children:Object(I.J)(N,Object(I.f)($e,nt)).slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("b",{children:e.index+2})}),It.filter((function(e){return"#"!==e.label})).map((function(t){return Object(n.jsx)(yn.a,{align:"center",children:e.data[t.label]})}))]},"row".concat(t))}))})})})]}),Object(n.jsx)(O.a,{open:oe,fullWidth:!0,maxWidth:"sm",style:{zIndex:100},children:Object(n.jsx)(_.a,{children:Object(n.jsxs)("form",{onSubmit:function(e){if(e.preventDefault(),(null===He||void 0===He?void 0:He.mensaje)&&(He.mensaje.length<60||He.mensaje.length>300))return F.a.fire({title:"Error",text:Ht("alerts:alerts.message-size"),icon:"error",iconColor:E.a.primary,timer:4e3,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}),!1;se(!1),F.a.fire({text:"".concat(Ht("alerts:alerts.button-emit-1")," ").concat(R.length," ").concat(Ht("alerts:alerts.button-emit-carnet-2")),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,showDenyButton:!0,confirmButtonText:Ht("buttons:buttons.issue"),cancelButtonText:Ht("buttons:buttons.cancel"),denyButtonText:Ht("buttons:buttons.back"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel",denyButton:"custom-button-back"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c,l;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.isDenied&&se(!0),t.isDismissed&&(Ke({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"",file:null}),na()),!t.value){e.next=39;break}if(ke){e.next=6;break}return F.a.fire({icon:"error",iconColor:E.a.primary,text:Ht("alerts:alerts.no-contract-error"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}),e.abrupt("return",!1);case 6:if(!((null===ke||void 0===ke?void 0:ke.total_emisiones)+R.length>(null===ke||void 0===ke?void 0:ke.cantidad_emisiones))){e.next=9;break}return F.a.fire({icon:"error",iconColor:E.a.primary,text:Ht("alerts:alerts.exceeds-contract"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}),e.abrupt("return",!1);case 9:if(!(null===ke||void 0===ke?void 0:ke.vencimiento)||!ia(null===ke||void 0===ke?void 0:ke.vencimiento)){e.next=12;break}return F.a.fire({icon:"error",iconColor:E.a.primary,text:Ht("alerts:alerts.expired-contract"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}),e.abrupt("return",!1);case 12:if(a={carnets:N,nombre:He.nombre,mensaje:He.mensaje||"".concat(Ht("alerts:alerts.message-issue-carnet"),' "').concat(null===yt||void 0===yt?void 0:yt.nombre,'".'),id_organizaciones:He.id_organizaciones,id_usuarios_emisores:o.data_user.id,archivo:He.file.name},e.prev=13,!(Ue.length>0)){e.next=17;break}return e.next=17,ra();case 17:return Ee(!0),e.next=20,Ce.a.post("/carnetsIssued/",a);case 20:return n=e.sent,i=n.data,r=Pe()("certika-organization-".concat(He.id_organizaciones)).toString(),c=Pe()("certika-issued-group-".concat(i.groupId)).toString(),(l=new FormData).append("file",He.file),l.append("route","".concat(r,"/issue-files/").concat(c,"/").concat(c)),e.next=29,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-file"),headers:{"Content-Type":"multipart/form-data"},data:l});case 29:Ee(!1),na(),F.a.fire({icon:"success",iconColor:E.a.primary,text:Ht("alerts:alerts.carnets-issued"),showConfirmButton:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then(Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:na(),w.push("/carnets/issued/".concat(Object(Ie.b)(i.groupId)));case 2:case"end":return e.stop()}}),e)})))),e.next=39;break;case 34:e.prev=34,e.t0=e.catch(13),Ee(!1),na(),F.a.fire({icon:"error",iconColor:E.a.primary,text:Ht("alerts:alerts.carnet-issued-error"),showConfirmButton:!1,timer:1500});case 39:case"end":return e.stop()}}),e,null,[[13,34]])})));return function(t){return e.apply(this,arguments)}}()),oe||(Ke({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"",file:null}),na())},children:[Object(n.jsx)(we.a,{gutterBottom:!0,children:Ht("dialogs:dialog.carnet-group-issue-name")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{autoFocus:!0,required:!0,id:"nombre",name:"nombre",variant:"outlined",onChange:$t,value:He.nombre})}),Object(n.jsx)(we.a,{gutterBottom:!0,children:Ht("dialogs:dialog.notification-message")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{id:"message",name:"mensaje",variant:"outlined",onChange:$t,value:He.mensaje||"".concat(Ht("alerts:alerts.message-issue-carnet"),' "').concat(null===yt||void 0===yt?void 0:yt.nombre,'".'),required:!0,multiline:!0})}),(1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{gutterBottom:!0,style:{marginTop:"1.5em"},children:[Ht("dialogs:dialog.select-organization")," *"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:Object(n.jsxs)(T.a,{id:"id_organizaciones",name:"id_organizaciones",onChange:$t,value:He.id_organizaciones,children:[Object(n.jsx)(Y.a,{children:Object(n.jsx)("em",{children:Ht("selects:selects-autocompletes.select-option")})}),fe.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},e.id)}))]})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(y.root),style:{marginTop:"1.5em"},children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(y.button),type:"submit",children:Ht("buttons:buttons.issue")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(y.button),onClick:na,children:Ht("buttons:buttons.cancel")})]})]})})}),Object(n.jsx)(xt.a,{className:y.backdrop,open:Ae,children:Object(n.jsx)(Ot.a,{color:"inherit"})})]})}));var Lp=Object(C.a)((function(){return{containerButton:{display:"flex",justifyContent:"space-between"},button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:"50px",padding:"10px 40px","&:hover":{backgroundColor:E.a.secondary}}}})),Fp={changePage:I.b,changeBreadcrump:I.a},Up=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"carnets emitidos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),Fp)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changePage,o=e.changeBreadcrump,s=e.user,l=e.organizationId,j=e.searchValue,g=Object(u.g)(),y=Lp(),w=Object(i.useState)([]),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)(!1),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!1),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(!1),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)({}),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(""),te=Object(d.a)(ee,2),ae=te[0],ne=te[1],ie=Object(i.useState)(""),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)(),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(D.a)(["alerts","tables","buttons","breadCrumps","dialogs"]),be=Object(d.a)(me,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?pe():g.push("/dashboard")}),[]);var pe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,L(!0),j&&""!==j){e.next=5;break}return e.next=5,ge();case 5:o(be("breadCrumps:breadCrumps.groups-carnet-issued",{returnObjects:!0})),L(!1),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),g.push("/500");case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),fe=1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,he=function(e,t){var a={limit:t||10,offset:e?e*t:0};return fe||(a.id_organizaciones=l),a},ge=function(){var e=Object(h.a)(f.a.mark((function e(){var t,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=he(0,a),e.next=4,Ce.a.post("/groupsBadgesIssued/getGroups/carnets",n);case 4:i=e.sent,r=i.data,N(r.groups.rows),z(r.groups.rows),ue(null===(t=r.groups)||void 0===t?void 0:t.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),g.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),xe=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),i=he(t,a),e.next=4,Ce.a.post("/groupsBadgesIssued/getGroups/carnets",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(k),Object(p.a)(null===(n=c.groups)||void 0===n?void 0:n.rows.filter((function(e){return!k.find((function(t){return t.id===e.id}))})))),N(o),z(o),L(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Oe=function(e){F.a.fire({text:be("alerts:alerts.revoke-carnet-group"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:be("buttons:buttons.send"),cancelButtonText:be("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ve(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ve=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,F.a.fire({text:be("alerts:alerts.revoke-message"),input:"textarea",inputPlaceholder:be("alerts:alerts.message-here"),inputAttributes:{"aria-label":be("alerts:alerts.message-here")},showCancelButton:!0,confirmButtonText:be("buttons:buttons.send"),cancelButtonText:be("buttons:buttons.cancel"),showLoaderOnConfirm:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"},inputValidator:function(e){if(!e)return be("alerts:alerts.write-message")}});case 3:if(a=e.sent,!(n=a.value)){e.next=14;break}return q(!0),e.next=9,Ce.a.delete("/carnetsIssued/revoke/".concat(t),{data:{mensaje:n}});case 9:i=e.sent,r=i.data,N(k.filter((function(e){return e.id!==t}))),z(k.filter((function(e){return e.id!==t}))),r&&(q(!1),F.a.fire({text:be("alerts:alerts.revoke"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}));case 14:e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),q(!1),F.a.fire({text:be("alerts:alerts.revoke-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 20:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(t){return e.apply(this,arguments)}}(),_e=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,q(!0),e.next=4,Ce.a.get("/carnetsIssued/forwardEmail/".concat(t));case 4:a=e.sent,a.data.issued.length>0?(q(!1),F.a.fire({text:be("alerts:alerts.email-sent"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})):(q(!1),F.a.fire({text:be("alerts:alerts.carnets-to-see"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),q(!1),F.a.fire({text:be("alerts:alerts.email-sent-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}(),ye=function(e){if(r.includes("Eliminar"))return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:be("tables:table.tooltip.revoke"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return function(e,t,a){switch(a){case"delete":Oe(t)}}(0,e,"delete")},children:Object(n.jsx)(Cn.a,{})})})})},ke=function(e){if(r.includes("Enviar correos"))return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:be("tables:table.tooltip.sent-email"),children:Object(n.jsx)(S.a,{"aria-label":"emails",onClick:function(){return t=e,void F.a.fire({title:be("alerts:alerts.see-carnet"),text:be("alerts:alerts.resend-carnet"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:be("buttons:buttons.accept"),cancelButtonText:be("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.value&&_e(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var t},children:Object(n.jsx)(Rl.a,{})})})})},Be=function(e){if(r.includes("Editar"))return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:be("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(){return Se(e)},children:Object(n.jsx)(Wn,{})})})})},Se=function(e){var t=null===k||void 0===k?void 0:k.filter((function(t){return t.id===e}));$(Object(m.a)({},t[0])),Q(!0)},Ae=function(){Q(!1)},Ee=function(){var e=Object(h.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),Ae(),e.prev=2,e.next=5,Ce.a.put("/groupsBadgesIssued/".concat(Z.id),{nombre:Z.nombre});case 5:a=e.sent,a.data&&F.a.fire({text:be("alerts:alerts.edited"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),ge(),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),F.a.fire({text:be("alerts:alerts.edited-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),g.push("/500"),window.location.reload();case 16:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(t){return e.apply(this,arguments)}}(),De=function(){return be("tables:table.columns-group-carnet-issued",{returnObjects:!0})},ze=function(){var e=Object(h.a)(f.a.mark((function e(t,a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,L(!0),e.next=4,ct()({method:"post",url:"".concat(je.a.apiURL,"/carnetsIssued/generateCarnetsByGroupId"),data:{groupId:t}});case 4:return L(!1),e.abrupt("return",F.a.fire({icon:"success",iconColor:E.a.primary,text:"Carnets Generados Exitosamente",showConfirmButton:!0,buttonsStyling:!1,confirmButtonText:be("buttons:buttons.accept"),customClass:{confirmButton:"custom-button-confirm"}}).then(Object(h.a)(f.a.mark((function e(){var n,i,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),e.next=3,ct()({method:"post",url:"".concat(je.a.apiURL,"/carnetsIssued/downloadCarnetsByGroupId"),data:{groupId:t}});case 3:n=e.sent,i=n.data,L(!1),(r=document.createElement("a")).download=a,r.href=i,r.click();case 10:case"end":return e.stop()}}),e)})))));case 8:return e.prev=8,e.t0=e.catch(0),L(!1),e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:be("alerts:alerts.error-ocurred"),showConfirmButton:!0,buttonsStyling:!1,confirmButtonText:be("buttons:buttons.accept"),customClass:{confirmButton:"custom-button-confirm"}}));case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t,a){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"groupIssued",type:"carnets",items:k,setItems:z,setCountItems:ue,changePage:c,loadData:pe,setLoading:L,organizationId:1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:l}),Object(n.jsx)(zn,{columns:De(),rows:de,setDirection:ne,setOrderBy:oe,loading:M,changePagination:xe,children:Object(n.jsx)(vn.a,{children:M?Object(n.jsx)(qn,{columns:De(),photo:0}):A.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(A,Object(I.f)(ae,ce)).slice(t*a,t*a+a).map((function(e,t){var a,i,o;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.nombre)}),Object(n.jsx)(yn.a,{align:"center",children:"".concat((null===(a=e.organizaciones)||void 0===a?void 0:a.nombre)||e.nombre_organizacion)}),Object(n.jsx)(yn.a,{align:"center",children:"".concat((null===(i=e.usuarios)||void 0===i?void 0:i.primer_nombre)||e.primer_nombre," ").concat((null===(o=e.usuarios)||void 0===o?void 0:o.primer_apellido)||e.primer_apellido)}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado?Object(n.jsxs)(n.Fragment,{children:[e.carnetIssued,Object(n.jsx)(K.a,{title:"Ver carnets",children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return a=Object(Ie.b)(e.id),c(0),void g.push("/carnets/issued/".concat(a));var a},children:Object(n.jsx)(Ge.a,{})})})]}):"En emision"}),Be(e.id),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:"Descargar carnets",children:Object(n.jsx)(S.a,{"aria-label":"download",onClick:function(){return ze(e.id,e.nombre)},children:Object(n.jsx)(kc.a,{})})})}),ke(e.id),r.includes("Descargar")&&Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:"Descargar",children:Object(n.jsx)(S.a,{"aria-label":"download",onClick:function(){return cd(e.archivo)},children:Object(n.jsx)(va.a,{})})})}),ye(e.id)]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"8",children:be("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:G,onClose:Ae,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{children:be("dialogs:dialog.edit-group-carnet-issue")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsxs)("form",{onSubmit:Ee,children:[Object(n.jsx)(we.a,{gutterBottom:!0,children:be("dialogs:dialog.carnet-group-issue-name")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{autoFocus:!0,required:!0,id:"nombre",name:"nombre",variant:"outlined",onChange:function(e){$(Object(m.a)(Object(m.a)({},Z),{},Object(b.a)({},e.target.name,e.target.value)))},value:Z.nombre})}),Object(n.jsxs)("div",{className:"text-center ".concat(y.root),style:{marginTop:"1.5em"},children:[Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(y.button),type:"submit",children:be("buttons:buttons.edit")}),Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(y.button),onClick:Ae,children:be("buttons:buttons.cancel")})]})]})})]}),Object(n.jsx)(_t,{loading:Y})]})}));var Wp=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",margin:"5px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},large:{width:e.spacing(8),height:e.spacing(8),margin:"auto"},row:{color:"#dc2626",fontWeight:"bold",padding:"1rem"},buttonDialog:{position:"absolute",top:".5em",margin:"1em",padding:"9px 20px"}}})),Yp={changeBreadcrump:I.a,changePage:I.b},qp=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"carnets emitidos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,searchValue:e.searchValue}}),Yp)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=e.permission,o=e.user,s=e.organizationId,l=e.changePage,j=e.searchValue,g=Object(i.useState)([]),v=Object(d.a)(g,2),y=v[0],w=v[1],C=Object(i.useState)([]),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Wp(),A=Object(u.g)(),z=Object(i.useState)(""),P=Object(d.a)(z,2),R=P[0],M=P[1],L=Object(i.useState)(""),U=Object(d.a)(L,2),W=U[0],Y=U[1],q=Object(i.useState)(!0),H=Object(d.a)(q,2),V=H[0],G=H[1],Q=Object(i.useState)([]),J=Object(d.a)(Q,2),X=J[0],Z=J[1],$=Object(i.useState)(!1),ee=Object(d.a)($,2),te=ee[0],ne=ee[1],ie=Object(i.useState)(null),re=Object(d.a)(ie,2),ce=re[0],oe=re[1],se=Object(i.useState)(),le=Object(d.a)(se,2),de=le[0],ue=le[1],me=Object(D.a)(["alerts","tables","buttons","breadCrumps"]),be=Object(d.a)(me,1)[0],pe=be("tables:table.columns-carnet-issued.columns-start",{returnObjects:!0}),fe=be("tables:table.columns-carnet-issued.columns-end",{returnObjects:!0});Object(i.useEffect)((function(){c.includes("Leer")?he().catch((function(){A.push("/500"),window.location.reload()})):(A.push("/dashboard"),window.location.reload())}),[]);var he=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(j&&""!==j){e.next=3;break}return e.next=3,Oe();case 3:r(be("breadCrumps:breadCrumps.groups-carnet-issued-carnets-issued",{returnObjects:!0})),G(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ge=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,xe=function(e,t){var a={limit:t||10,offset:e?e*t:0};return ge||(a.id_organizaciones=s),a},Oe=function(){var t=Object(h.a)(f.a.mark((function t(){var n,i,r,c,o,s,l,d,u;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=xe(0,a),i=Object(Ie.a)(e.match.params.id),n.id_grupos_carnets_emitidos=i,t.next=5,Ce.a.post("/carnetsIssued/getCarnetsIssued",n);case 5:r=t.sent,(c=r.data).issued.rows.length>0&&(d=[],c.issued.rows[0].carnetsCamposValores.sort((function(e,t){var a,n;return(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)<(null===(n=t.carnetCampos)||void 0===n?void 0:n.nombre)?-1:1})).map((function(e){var t,a,n,i,r,c,o,s;48!==(null===(t=e.carnetCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)&&null!==e.carnetCampos&&d.push({id:"".concat(null===(n=e.carnetCampos)||void 0===n?void 0:n.nombre),label:"".concat(null===(i=e.carnetCampos)||void 0===i?void 0:i.nombre),align:"center",orden:"".concat(null===(r=e.carnetCampos)||void 0===r?void 0:r.nombre)});null===e.carnetCampos&&d.push({id:"".concat(null===(c=e.carnetCamposAdicionales)||void 0===c?void 0:c.nombre_campo),label:"".concat(null===(o=e.carnetCamposAdicionales)||void 0===o?void 0:o.nombre_campo),align:"center",orden:"".concat(null===(s=e.carnetCamposAdicionales)||void 0===s?void 0:s.nombre_campo)})})),u=pe.concat(d).concat(fe),Z(u),w(null===(o=c.issued)||void 0===o?void 0:o.rows),B(null===(s=c.issued)||void 0===s?void 0:s.rows),ue(null===c||void 0===c||null===(l=c.issued)||void 0===l?void 0:l.count)),0!==c.issued.rows.length&&0!==c.issued.rows[0].gruposInsigniasEmitidas.estado||setTimeout(ke,15e3);case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ve=function(){var t=Object(h.a)(f.a.mark((function t(a,n){var i,r,c,o,s,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return G(!0),r=xe(a,n),c=Object(Ie.a)(e.match.params.id),r.id_grupos_carnets_emitidos=c,t.next=6,Ce.a.post("/carnetsIssued/getCarnetsIssued",r);case 6:o=t.sent,s=o.data,l=[].concat(Object(p.a)(y),Object(p.a)(null===s||void 0===s||null===(i=s.issued)||void 0===i?void 0:i.rows.filter((function(e){return!y.find((function(t){return t.id===e.id}))})))),w(l),B(l),G(!0);case 12:case"end":return t.stop()}}),t)})));return function(e,a){return t.apply(this,arguments)}}(),_e=function(e,t,a){F.a.fire({text:"".concat(be("alerts:alerts.revoke-undo-1")," ").concat(a," ").concat(be("alerts:alerts.revoke-undo-2-carnet")),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:be("buttons:buttons.send"),cancelButtonText:be("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.value&&ye(t,a);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},ye=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("revocar"!==a){e.next=21;break}return e.prev=1,e.next=4,F.a.fire({text:be("alerts:alerts.revoke-message"),input:"textarea",inputPlaceholder:be("alerts:alerts.message-here"),inputAttributes:{"aria-label":be("alerts:alerts.message-here")},showCancelButton:!0,confirmButtonText:be("buttons:buttons.send"),cancelButtonText:be("buttons:buttons.cancel"),showLoaderOnConfirm:!0,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"},inputValidator:function(e){if(!e)return be("alerts:alerts.write-message")}});case 4:if(n=e.sent,!(i=n.value)){e.next=13;break}return G(!0),e.next=10,Ce.a.delete("/carnetsIssued/revoke/carnet/".concat(t),{data:{mensaje:i}});case 10:r=e.sent,r.data&&(y.map((function(e){return e.id===t&&Oe()})),G(!1),F.a.fire({text:be("alerts:alerts.revoke"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}));case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(1),G(!1),F.a.fire({text:be("alerts:alerts.revoke-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 19:e.next=34;break;case 21:return e.prev=21,G(!0),e.next=25,Ce.a.delete("/carnetsIssued/undo/carnet/".concat(t));case 25:c=e.sent,c.data&&(y.map((function(e){return e.id===t&&Oe()})),G(!1),F.a.fire({text:be("alerts:alerts.undo-revoke"),icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})),e.next=34;break;case 30:e.prev=30,e.t1=e.catch(21),G(!1),F.a.fire({text:be("alerts:alerts.undo-revoke-error"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 34:case"end":return e.stop()}}),e,null,[[1,15],[21,30]])})));return function(t,a){return e.apply(this,arguments)}}(),we=function(e){var t=y.find((function(t){return 0===t.estado&&t.id===e}));if(c.includes("Eliminar"))return t?Object(n.jsx)(K.a,{title:be("tables:table.tooltip.undo-revoke"),children:Object(n.jsx)(S.a,{"aria-label":"delete",children:Object(n.jsx)(Ul.a,{onClick:function(t){return _e(0,e,"desrevocar")}})})}):Object(n.jsx)(K.a,{title:be("tables:table.tooltip.revoke"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return _e(0,e,"revocar")},children:Object(n.jsx)(Cn.a,{})})})},ke=function(){G(!0),he()},Be=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,G(!0),e.next=4,ct()({method:"post",url:"".concat(je.a.apiURL,"/carnetsIssued/generateCarnetsByGroupId"),data:{groupId:y[0].id_grupos_carnets_emitidos}});case 4:return G(!1),e.abrupt("return",F.a.fire({icon:"success",iconColor:E.a.primary,text:"Carnets Generados Exitosamente",showConfirmButton:!0,confirmButtonText:be("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then(Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return G(!0),e.next=3,ct()({method:"post",url:"".concat(je.a.apiURL,"/carnetsIssued/downloadCarnetsByGroupId"),data:{groupId:y[0].id_grupos_carnets_emitidos}});case 3:t=e.sent,a=t.data,G(!1),(n=document.createElement("a")).download="".concat(y[0].gruposInsigniasEmitidas.nombre),n.href=a,n.click();case 10:case"end":return e.stop()}}),e)})))));case 8:return e.prev=8,e.t0=e.catch(0),G(!1),e.abrupt("return",F.a.fire({icon:"error",iconColor:E.a.primary,text:be("alerts:alerts.error-ocurred"),showConfirmButton:!0,confirmButtonText:be("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),Se=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return G(!0),t.prev=1,t.next=4,Ce.a.post("/carnetsIssued/getCarnetsIssued",{id_grupos_carnets_emitidos:Object(Ie.a)(e.match.params.id)});case 4:o=t.sent,s=o.data,l=null===s||void 0===s||null===(a=s.issued)||void 0===a||null===(n=a.rows)||void 0===n?void 0:n.map((function(e){var t,a,n,i=null===e||void 0===e?void 0:e.carnetsCamposValores.sort((function(e,t){var a,n;return(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)<(null===(n=t.carnetCampos)||void 0===n?void 0:n.nombre)?-1:1})).filter((function(e){var t,a;return 48!==(null===(t=e.carnetCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)})).map((function(e){var t,a,n;return(null===e||void 0===e||null===(t=e.carnetCampos)||void 0===t?void 0:t.nombre)?Object(b.a)({},null===e||void 0===e||null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre,null===e||void 0===e?void 0:e.valor):Object(b.a)({},null===e||void 0===e||null===(n=e.carnetCamposAdicionales)||void 0===n?void 0:n.nombre_campo,null===e||void 0===e?void 0:e.valor)})),r={};return i.map((function(e){return r=Object(m.a)(Object(m.a)({},r),e)})),Object(m.a)(Object(m.a)({Grupo:null===(t=e.gruposInsigniasEmitidas)||void 0===t?void 0:t.nombre,Estado:1===e.estado?be("tables:table.state-reports-carnets.issued"):2===e.estado?be("tables:table.state-reports-carnets.viewed"):3===e.estado?be("tables:table.state-reports-carnets.report"):4===e.estado?be("tables:table.state-reports-carnets.bounced-mail"):be("tables:table.state-reports-carnets.revoked"),"Fecha emisi\xf3n":Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss"),Email:e.email_receptor},r),{},{"C\xf3digo carnet":e.codigo_carnet,"Nombre p\xfablico carnet":null===(a=e.plantillasCarnets)||void 0===a?void 0:a.nombre,"Nombre privado carnet":null===(n=e.plantillasCarnets)||void 0===n?void 0:n.nombre_privado,"Fecha expiraci\xf3n":null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))?Ne()(e.fecha_expiracion).format("DD/MM/YYYY"):"",Cuenta:Te(e.account),"No. correos emisi\xf3n":e.correos_emision||1,"No. correos aceptar carnet":e.correos_aceptar_carnet||0,"No. correos crear cuenta":e.correos_crear_cuenta||0,"No. correos compartir carnet":e.correos_compartir_carnet||0,"No. correos revocar":e.correos_revocar||0,"No. veces compartidas en Facebook":Ee(e.estadisticasRedesSociales,4),"No. veces compartidas en LinkedIn":Ee(e.estadisticasRedesSociales,3),"No. veces compartidas en Twitter":Ee(e.estadisticasRedesSociales,5),"No. veces compartidas en WhatsApp":Ee(e.estadisticasRedesSociales,2),"No. veces compartidas en Telegram":Ee(e.estadisticasRedesSociales,6)})})),Tc(l,null===s||void 0===s||null===(i=s.issued)||void 0===i||null===(r=i.rows[0])||void 0===r||null===(c=r.gruposInsigniasEmitidas)||void 0===c?void 0:c.nombre),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(1),F.a.fire({icon:"error",iconColor:E.a.primary,text:be("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}),G(!1);case 14:G(!1);case 15:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(){return t.apply(this,arguments)}}(),Te=function(e){return e?"Si":"No"},Ee=function(e,t){var a=e.filter((function(e){return e.id_redes_sociales===t}));return a.length>0?a.length:0},De=function(){ne(!1)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:y.length>0&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(K.a,{title:"Descargar carnets",children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:T.button,onClick:Be,children:Object(n.jsx)(kc.a,{})})}),Object(n.jsx)(K.a,{title:be("tables:table.tooltip.export"),children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:T.button,onClick:Se,children:Object(n.jsx)(va.a,{})})}),Object(n.jsx)(K.a,{title:be("tables:table.tooltip.upgrade"),children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:T.button,onClick:ke,children:Object(n.jsx)(Wl.a,{})})})]})}),Object(n.jsx)(Fn,{tableName:"CarnetIssued",items:y,setItems:B,groupId:Object(Ie.a)(e.match.params.id),setCountItems:ue,changePage:l,loadData:he,setLoading:G,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,columns:{startColumns:pe,finalColumns:fe,setColumns:Z}}),Object(n.jsx)(zn,{columns:X,rows:de,setDirection:M,setOrderBy:Y,loading:V,changePagination:ve,children:Object(n.jsx)(vn.a,{children:V?Object(n.jsx)(qn,{columns:X,photo:0}):N.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(N,Object(I.f)(R,W)).slice(t*a,t*a+a).map((function(e,t){var a,i,r;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:be("tables:table.tooltip.view-carnet"),children:Object(n.jsx)(S.a,{onClick:function(){return t=e.linkPhoto,oe(t),void ne(!0);var t},children:Object(n.jsx)(cn.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:e.gruposInsigniasEmitidas.nombre}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("span",{className:4===e.estado&&T.row,children:1===e.estado?be("tables:table.state-reports-carnets.issued"):2===e.estado?be("tables:table.state-reports-carnets.viewed"):3===e.estado?be("tables:table.state-reports-carnets.report"):4===e.estado?be("tables:table.state-reports-carnets.bounced-mail"):be("tables:table.state-reports-carnets.revoked")})}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.email_receptor}),null===(a=e.carnetsCamposValores)||void 0===a?void 0:a.sort((function(e,t){var a,n;return(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)<(null===(n=t.carnetCampos)||void 0===n?void 0:n.nombre)?-1:1})).map((function(e){var t,a;return 48!==(null===(t=e.carnetCampos)||void 0===t?void 0:t.tipo_campo_vp)&&"certificateCode"!==(null===(a=e.carnetCampos)||void 0===a?void 0:a.nombre)&&Object(n.jsx)(yn.a,{align:"center",children:e.valor})})),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:be("tables:table.tooltip.view-carnet"),children:2!==e.estado&&0!==e.estado||"Si"!==Te(e.account)?Object(n.jsx)("a",{href:"".concat(window.location.origin,"/carnet/verify/").concat(Object(Ie.b)(e.id)),target:"blank",children:e.codigo_carnet}):Object(n.jsx)("a",{href:"".concat(window.location.origin,"/carnet/").concat(Object(Ie.b)(e.id)),target:"blank",children:e.codigo_carnet})})}),Object(n.jsx)(yn.a,{align:"center",children:null===(i=e.plantillasCarnets)||void 0===i?void 0:i.nombre}),Object(n.jsx)(yn.a,{align:"center",children:null===(r=e.plantillasCarnets)||void 0===r?void 0:r.nombre_privado}),Object(n.jsx)(yn.a,{align:"center",children:null!==e.fecha_expiracion&&Object($s.a)(new Date(e.fecha_expiracion))&&Ne()(e.fecha_expiracion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:Te(e.account)}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_emision||1}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_aceptar_carnet||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_crear_cuenta||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_compartir_carnet||0}),Object(n.jsx)(yn.a,{align:"center",children:e.correos_revocar||0}),Object(n.jsx)(yn.a,{align:"center",children:Ee(e.estadisticasRedesSociales,4)}),Object(n.jsx)(yn.a,{align:"center",children:Ee(e.estadisticasRedesSociales,3)}),Object(n.jsx)(yn.a,{align:"center",children:Ee(e.estadisticasRedesSociales,5)}),Object(n.jsx)(yn.a,{align:"center",children:Ee(e.estadisticasRedesSociales,2)}),Object(n.jsx)(yn.a,{align:"center",children:Ee(e.estadisticasRedesSociales,6)}),Object(n.jsx)(yn.a,{align:"center",children:we(e.id)})]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"30",children:be("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:te,onClose:De,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(T.buttonDialog),onClick:De,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:ce,className:T.img})})]})]})}));var Hp=Object(C.a)((function(e){return{app:{minHeight:"85vh"},root:Object(b.a)({marginTop:"1em"},e.breakpoints.up("sm"),{margin:"1em 6em 0 6em"}),button:{margin:"0.5em",padding:"9px 40px"},input:{display:"none"},card:Object(b.a)({display:"flex",flexDirection:"column",alignItems:"center",margin:"4em 0",marginTop:"0",marginBottom:"0",backgroundColor:"primary"},e.breakpoints.up("sm"),{flexDirection:"row",justifyContent:"initial",alignItems:"initial",margin:"4em",marginBottom:"0",marginTop:"0"})}})),Kp=function(e){var t=Hp(),a=Object(u.g)(),r=Object(i.useState)(!1),c=Object(d.a)(r,2),o=c[0],s=c[1],l=Object(i.useState)({mensaje_reporte:""}),p=Object(d.a)(l,2),j=p[0],g=p[1],O=Object(i.useState)([]),v=Object(d.a)(O,2),_=v[0],y=v[1],w=Object(D.a)(["alerts","dialogs","buttons"]),C=Object(d.a)(w,1)[0];Object(i.useEffect)((function(){try{var t=e.match.params.type,n=Object(Ie.a)(e.match.params.id);k(t,n),g(Object(m.a)(Object(m.a)({},j),{},{type:t,id:n}))}catch(i){F.a.fire({title:"Error",text:C("alerts:alerts.error-ocurred"),icon:"error",confirmButtonText:"Ok",iconColor:E.a.primary,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}),a.push("/")}}),[]);var k=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/helpCenter/getHelpCenters",{estado:1,type:t,id:a});case 2:n=e.sent,i=n.data,y(i.helpCenters);case 5:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),N=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),0!==j.mensaje_reporte.length){e.next=3;break}return e.abrupt("return",F.a.fire({title:"Error",text:C("alerts:alerts.no-message"),icon:"error",iconColor:E.a.primary,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}));case 3:s(!0),Ce.a.post("/helpCenter",j).then((function(e){s(!1),F.a.fire({title:C("alerts:alerts.send-message-success-title"),text:C("alerts:alerts.report-send-success"),icon:"success",confirmButtonText:"Ok",iconColor:E.a.primary,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){a.push("/"),window.location.reload()}))})).catch((function(){s(!1),F.a.fire({title:"Error",text:C("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}})}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("div",{className:"App",children:[Object(n.jsx)(At,{}),Object(n.jsx)("div",{className:"App-header ".concat(t.app),children:Object(n.jsx)(ve.a,{className:t.card,children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{component:"h4",variant:"h4",children:(null===_||void 0===_?void 0:_.length)>0?C("dialogs:dialog.answer-report"):C("dialogs:dialog.new-report")}),Object(n.jsxs)("form",{className:t.root,onSubmit:N,children:[Object(n.jsx)(ye.a,{container:!0,spacing:2,children:Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{label:C("dialogs:dialog.message-report"),name:"mensaje_reporte",variant:"outlined",size:"small",multiline:!0,rows:8,onChange:function(e){g(Object(m.a)(Object(m.a)({},j),{},Object(b.a)({},e.target.name,e.target.value)))},value:j.mensaje_reporte})})})}),Object(n.jsx)("div",{className:"text-center ".concat(t.root),children:Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(t.button),type:"submit",children:C("buttons:buttons.send")})})]})]})})})]}),Object(n.jsx)(_t,{loading:o})]})};var Vp=Object(C.a)((function(){return{containerButton:{display:"flex",justifyContent:"space-between"},button:{margin:"0.5em",padding:"10px 40px"},spam:{display:"flex",justifyContent:"space-between"},btnClose:{color:"white",backgroundColor:E.a.primary,borderRadius:"50px",padding:"1px","&:hover":{backgroundColor:E.a.secondary}},mySwal:{zIndex:3e3}}})),Gp={changePage:I.b,changeBreadcrump:I.a},Qp=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"carnets reportes"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),Gp)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.permission,o=e.changeBreadcrump,s=Object(u.g)(),l=Vp(),p=Object(i.useState)([]),j=Object(d.a)(p,2),g=j[0],y=j[1],w=Object(i.useState)([]),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)(!1),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)(!1),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!1),Y=Object(d.a)(U,2),q=Y[0],H=Y[1],V=Object(i.useState)([]),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)(!1),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)({mensaje_reporte:"",estado:3}),ne=Object(d.a)(te,2),ie=ne[0],re=ne[1],ce=Object(i.useState)(""),oe=Object(d.a)(ce,2),se=oe[0],le=oe[1],de=Object(i.useState)(""),ue=Object(d.a)(de,2),me=ue[0],be=ue[1],pe=Object(D.a)(["alerts","tables","buttons","breadCrumps","dialogs"]),je=Object(d.a)(pe,1)[0],fe=Object(i.useState)(e.match.params.type),he=Object(d.a)(fe,2),ge=he[0],xe=he[1];Object(i.useEffect)((function(){c.includes("Leer")?Oe():s.push("/dashboard")}),[]),Object(i.useEffect)((function(){xe(e.match.params.type)}),[e.match.params.type]),Object(i.useEffect)((function(){Oe()}),[ge]);var Oe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,z(!0),e.next=4,ve();case 4:e.t0=ge,e.next="carnet"===e.t0?7:"badge"===e.t0?9:"certificate"===e.t0?11:13;break;case 7:return o(je("breadCrumps:breadCrumps.reports-carnet",{returnObjects:!0})),e.abrupt("break",14);case 9:return o(je("breadCrumps:breadCrumps.reports-badge",{returnObjects:!0})),e.abrupt("break",14);case 11:return o(je("breadCrumps:breadCrumps.reports-certificate",{returnObjects:!0})),e.abrupt("break",14);case 13:return e.abrupt("break",14);case 14:z(!1),e.next=20;break;case 17:e.prev=17,e.t1=e.catch(0),s.push("/500");case 20:case"end":return e.stop()}}),e,null,[[0,17]])})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/helpCenter/getHelpCenters",{type:ge});case 2:t=e.sent,a=t.data,y(a.helpCenters),N(a.helpCenters);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_e=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,L(!0),e.next=4,Ce.a.put("/helpCenter/".concat(t),{estado:-1,type:ge});case 4:L(!1),F.a.fire({title:je("alerts:alerts.delete-report-success-title"),text:je("alerts:alerts.delete-report-success-text"),icon:"success",iconColor:E.a.primary,confirmButtonText:je("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}),ve(),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),F.a.fire({customClass:{container:l.mySwal},text:je("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3});case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}(),ye=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),e.next=3,Ce.a.post("/helpCenter/getHelpCentersByIssued/",{type:ge,id:a});case 3:n=e.sent,i=n.data,L(!1),J(i.helpCenters),ee(!1),re(Object(m.a)(Object(m.a)({},ie),{},{type:ge,id:a})),H(!0);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),we=function(e){if(c.includes("Eliminar"))return Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:je("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return function(e){F.a.fire({text:je("alerts:alerts.delete-report"),icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:je("buttons:buttons.accept"),cancelButtonText:je("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&_e(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}(e)},children:Object(n.jsx)(Ka.a,{})})})})},ke=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),""!==ie.mensaje_reporte){e.next=3;break}return e.abrupt("return",F.a.fire({customClass:{container:l.mySwal},text:je("alerts:alerts.no-answer"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}));case 3:try{L(!0),H(!1),Ce.a.post("/helpCenter",ie).then((function(e){L(!1),F.a.fire({title:je("alerts:alerts.send-message-success-title"),text:je("alerts:alerts.send-message-success-text"),icon:"success",iconColor:E.a.primary,confirmButtonText:je("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}).then((function(){ve(),Q.push({mensaje_reporte:ie.mensaje_reporte,estado:ie.estado,fecha_envio:Ne()().format("DD/MM/YYYY HH:mm:ss")}),re(Object(m.a)(Object(m.a)({},ie),{},{mensaje_reporte:""})),H(!0),ee(!1)}))}))}catch(a){F.a.fire({text:je("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500})}case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Be=function(){return je("tables:table.columns-reports-carnets",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"helpCenterCarnets",items:g,setItems:N,changePage:I.b,loadData:Oe,setLoading:z}),Object(n.jsx)(zn,{columns:Be(),rows:k,setDirection:le,setOrderBy:be,loading:A,children:Object(n.jsx)(vn.a,{children:A?Object(n.jsx)(qn,{columns:Be(),photo:0}):k.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(k,Object(I.f)(se,me)).slice(a*r,a*r+r).map((function(e,t){var a,i,r,c,o,s,l,d,u,m,b,p,j,f,h;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_envio).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:(null===(a=e.carnetsEmitidos)||void 0===a?void 0:a.email_receptor)||(null===(i=e.insigniasEmitidas)||void 0===i?void 0:i.email_receptor)||(null===(r=e.certificadosEmitidos)||void 0===r?void 0:r.email_receptor)}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:je("tables:table.tooltip.view-carnet"),children:Object(n.jsx)("a",{href:"".concat(window.location.origin,"/").concat("badge"===ge?"certificates":ge,"/verify/").concat(Object(Ie.b)(e.id_carnets_emitidos||e.id_insignias_emitidas||e.id_certificados_emitidos)),target:"blank",children:(null===(c=e.carnetsEmitidos)||void 0===c?void 0:c.codigo_carnet)||(null===(o=e.insigniasEmitidas)||void 0===o?void 0:o.codigo_insignia)||(null===(s=e.certificadosEmitidos)||void 0===s?void 0:s.codigo_certificado)})})}),Object(n.jsx)(yn.a,{align:"center",children:(null===(l=e.carnetsEmitidos)||void 0===l||null===(d=l.plantillasCarnets)||void 0===d||null===(u=d.organizaciones)||void 0===u?void 0:u.nombre)||(null===(m=e.insigniasEmitidas)||void 0===m||null===(b=m.plantillasInsignias)||void 0===b||null===(p=b.organizaciones)||void 0===p?void 0:p.nombre)||(null===(j=e.certificadosEmitidos)||void 0===j||null===(f=j.plantillasCertificados)||void 0===f||null===(h=f.organizaciones)||void 0===h?void 0:h.nombre)}),Object(n.jsx)(yn.a,{align:"center",children:0===e.estado?je("tables:table.state-reports-carnets.waiting"):1===e.estado?je("tables:table.state-reports-carnets.process"):2===e.estado?je("tables:table.state-reports-carnets.finished"):""}),Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:je("tables:table.tooltip.view-message"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return ye(t,e.id_carnets_emitidos||e.id_insignias_emitidas||e.id_certificados_emitidos)},children:Object(n.jsx)(Ge.a,{})})})}),we(e.id_carnets_emitidos||e.id_insignias_emitidas||e.id_certificados_emitidos)]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:je("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:q,fullWidth:!0,maxWidth:"md",children:[Object(n.jsxs)(v.a,{align:"center",children:[" ",je("dialogs:dialog.reports")]}),Object(n.jsxs)(_.a,{dividers:!0,children:[Q.map((function(e){var t,a,i;return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("div",{className:l.spam,children:[Object(n.jsx)("spam",{children:3===e.estado?"SuperAdmin":(null===(t=e.carnetsEmitidos)||void 0===t?void 0:t.email_receptor)||(null===(a=e.insigniasEmitidas)||void 0===a?void 0:a.email_receptor)||(null===(i=e.certificadosEmitidos)||void 0===i?void 0:i.email_receptor)}),Object(n.jsx)("spam",{children:Ne()(e.fecha_envio).format("DD/MM/YYYY HH:mm:ss")})]}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{name:"mensaje_reporte",variant:"outlined",multiline:!0,value:e.mensaje_reporte})}),Object(n.jsx)(W.a,{})]})})),$&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("div",{className:l.spam,children:[Object(n.jsx)("spam",{children:"SuperAdmin"}),Object(n.jsx)(x.a,{disableElevation:!0,variant:"contained",className:"my-2 ".concat(l.btnClose),onClick:function(){""!==ie.mensaje_reporte?F.a.fire({text:je("alerts:alerts.close-report-message"),icon:"warning",iconColor:E.a.primary,showConfirmButton:!0,showCancelButton:!0,confirmButtonText:je("buttons:buttons.accept"),cancelButtonText:je("buttons:buttons.cancel"),buttonsStyling:!1,customClass:{container:l.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.value&&(ee(!1),re(Object(m.a)(Object(m.a)({},ie),{},{mensaje_reporte:""})))})):ee(!1)},children:Object(n.jsx)(ae.a,{})})]}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{name:"mensaje_reporte",variant:"outlined",multiline:!0,value:ie.mensaje_reporte,onChange:function(e){re(Object(m.a)(Object(m.a)({},ie),{},Object(b.a)({},e.target.name,e.target.value)))}})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(l.root),style:{marginTop:"1.5em"},children:[2!==(null===(t=Q[0])||void 0===t?void 0:t.estado)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(l.button),onClick:$?ke:function(){return ee(!0)},children:je($?"buttons:buttons.send":"buttons:buttons.answer")}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(l.button),onClick:function(){F.a.fire({text:je("alerts:alerts.close-case"),icon:"warning",iconColor:E.a.primary,showConfirmButton:!0,showCancelButton:!0,cancelButtonText:je("buttons:buttons.cancel"),confirmButtonText:je("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:l.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.value){e.next=19;break}return L(!0),H(!1),e.prev=3,e.next=6,Ce.a.put("/helpCenter/".concat(ie.id),{estado:2,type:ge});case 6:L(!1),F.a.fire({title:je("alerts:alerts.close-case-success-title"),text:je("alerts:alerts.close-case-success-text"),icon:"success",iconColor:E.a.primary,confirmButtonText:je("buttons:buttons.accept"),buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm"}}),H(!1),ee(!1),re(Object(m.a)(Object(m.a)({},ie),{},{mensaje_reporte:""})),ve(),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(3),F.a.fire({customClass:{container:l.mySwal},text:je("alerts:alerts.error-ocurred"),icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:3e3}),H(!0),L(!1);case 19:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(t){return e.apply(this,arguments)}}())},children:je("buttons:buttons.finished")})]}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(l.button),onClick:function(){""!==ie.mensaje_reporte?F.a.fire({text:je("alerts:alerts.close-report"),icon:"warning",iconColor:E.a.primary,showConfirmButton:!0,showCancelButton:!0,cancelButtonText:je("buttons:buttons.cancel"),confirmButtonText:je("buttons:buttons.accept"),buttonsStyling:!1,customClass:{container:l.mySwal,confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then((function(e){e.value&&(H(!1),ee(!1),re(Object(m.a)(Object(m.a)({},ie),{},{mensaje_reporte:""})))})):(H(!1),ee(!1))},children:je("buttons:buttons.close")})]})]})]}),Object(n.jsx)(_t,{loading:M})]})}));var Jp=[{id:"type",label:"Tipo de recordatorio",align:"center"},{id:"primer",label:"Primer recordatorio",align:"center"},{id:"segundo",label:"Primer recordatorio",align:"center"},{id:"actions",label:"",align:"center"}],Xp=Object(C.a)((function(e){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:"50px",padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}},mySwal:{zIndex:3e3}}})),Zp={changeBreadcrump:I.a},$p=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"recordatorios"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Zp)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=Object(u.g)(),s=Xp(),l=Object(i.useState)([]),m=Object(d.a)(l,2),b=m[0],p=m[1],j=Object(i.useState)([]),g=Object(d.a)(j,2),O=g[0],v=g[1];Object(i.useEffect)((function(){r.includes("Leer")?(_(),c([{name:"Ajustes"},{name:"Recordatorios"}])):(o.push("/dashboard"),window.location.reload())}),[]);var _=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/reminderParameter/getReminders");case 2:t=e.sent,a=t.data,p(a.reminders),v(a.reminders);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=function(e,t,a){switch(a){case"delete":w(t);break;case"create":o.push("/reminders/create")}},w=function(e){F.a.fire({text:"\xbfEst\xe1 seguro que desea eliminar este par\xe1metro?",icon:"warning",iconColor:E.a.primary,showCancelButton:!0,confirmButtonText:"Aceptar",cancelButtonText:"Cancelar",buttonsStyling:!1,customClass:{confirmButton:"custom-button-confirm",cancelButton:"custom-button-cancel"}}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&C(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},C=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/reminderParameter/".concat(t));case 3:a=e.sent,n=a.data,p(b.filter((function(e){return e.id!==t}))),v(b.filter((function(e){return e.id!==t}))),n&&F.a.fire({text:"Eliminado exitosamente.",icon:"success",iconColor:E.a.primary,showConfirmButton:!1,timer:1500}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),F.a.fire({text:"No se pudo eliminar.",icon:"error",iconColor:E.a.primary,showConfirmButton:!1,timer:1500});case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[r.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:s.button,onClick:function(e){return y(0,0,"create")},children:Object(n.jsx)("span",{children:"Gestionar"})})}):Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{items:b,setItems:v}),Object(n.jsx)(zn,{columns:Jp,rows:O,children:Object(n.jsx)(vn.a,{children:O.length>0?Object(n.jsx)(n.Fragment,{children:O.slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:0===e.tipo_recordatorio?"Insignias":1===e.tipo_recordatorio?"Certificados":2===e.tipo_recordatorio&&"Carnets"}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.primer_recordatorio," d\xedas")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.segundo_recordatorio," d\xedas")}),Object(n.jsx)(yn.a,{align:"center",children:r.includes("Eliminar")&&Object(n.jsx)(K.a,{title:"Eliminar",children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return y(0,e.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]},"row".concat(t))}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:"No hay datos registrados"})})})]})})),ej=a(1029),tj=a(1256);var aj=Object(C.a)((function(e){return{root:{marginTop:"1em"},button:{margin:"0.5em",padding:"8px 40px"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"}}})),nj={changeBreadcrump:I.a},ij=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),nj)((function(e){var t=e.changeBreadcrump,a=Object(u.g)(),r=aj(),c=Object(D.a)(["analytics","alerts","buttons"]),o=Object(d.a)(c,1)[0],s=Object(i.useState)(!1),l=Object(d.a)(s,2),p=l[0],j=l[1],g=Object(i.useState)({}),O=Object(d.a)(g,2),v=O[0],_=O[1],y=Object(i.useState)({tipo_recordatorio:"",primer_recordatorio:"",segundo_recordatorio:""}),w=Object(d.a)(y,2),C=w[0],k=w[1];Object(i.useEffect)((function(){N().catch((function(){a.push("/500"),window.location.reload()}))}),[]);var N=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t([{name:"Ajustes"},{name:"Recordatorios",route:"/reminders"},{name:"Gestionar"}]);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(i.useEffect)((function(){B(C.tipo_recordatorio).catch((function(){a.push("/500"),window.location.reload()}))}),[C.tipo_recordatorio]);var B=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/reminderParameter/getReminders",{tipo_recordatorio:t});case 2:a=e.sent,(n=a.data).reminders.length>0?k(Object(m.a)(Object(m.a)({},C),n.reminders[0])):k({tipo_recordatorio:t,primer_recordatorio:"",segundo_recordatorio:""});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),S=function(e){e.target.name,/^([1-9])$/.test(e.target.value)?_(Object(m.a)(Object(m.a)({},v),{},Object(b.a)({},e.target.name,!1))):_(Object(m.a)(Object(m.a)({},v),{},Object(b.a)({},e.target.name,!0))),k(Object(m.a)(Object(m.a)({},C),{},Object(b.a)({},e.target.name,parseInt(e.target.value))))},T=function(){var t=Object(h.a)(f.a.mark((function t(n){var i;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.preventDefault(),j(!0),(null===C||void 0===C?void 0:C.primer_recordatorio)>=(null===C||void 0===C?void 0:C.segundo_recordatorio)?(j(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:"Los d\xedas del primer recordatorio debe ser menor que el segundo."})):e.match.params.id||C.id?(i=C.id||Object(Ie.a)(e.match.params.id),Ce.a.put("/reminderParameter/".concat(i),C).then((function(e){j(!1),a.push("/reminders"),F.a.fire({icon:"success",iconColor:E.a.primary,text:"Editado exitosamente.",showConfirmButton:!1,timer:1500})})).catch((function(e){j(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:"No se ha podido editar.",showConfirmButton:!1,timer:1500})}))):Ce.a.post("/reminderParameter/",C).then((function(e){j(!1),a.push("/reminders"),F.a.fire({icon:"success",iconColor:E.a.primary,text:"Creado exitosamente.",showConfirmButton:!1,timer:1500})})).catch((function(e){j(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:"No se ha podido crear.",showConfirmButton:!1,timer:1500})}));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:r.root,onSubmit:T,children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsx)(ej.a,{component:"legend",children:"Tipo de recordatorio"}),Object(n.jsxs)(tj.a,{row:!0,"aria-label":"tipo_recordatorio",name:"tipo_recordatorio",value:C.tipo_recordatorio,onChange:S,children:[Object(n.jsx)(wi.a,{required:!0,value:0,control:Object(n.jsx)(Ci.a,{required:!0}),label:o("analytics:analytics-index.radio-buttons-badges")}),Object(n.jsx)(wi.a,{value:1,control:Object(n.jsx)(Ci.a,{required:!0}),label:o("analytics:analytics-index.radio-buttons-certificates")}),Object(n.jsx)(wi.a,{value:2,control:Object(n.jsx)(Ci.a,{required:!0}),label:o("analytics:analytics-index.radio-buttons-carnets")})]})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Primer recordatorio (# d\xedas)",variant:"outlined",name:"primer_recordatorio",value:C.primer_recordatorio,onChange:S,error:v.primer_recordatorio,helperText:v.primer_recordatorio&&"Solo se permite un car\xe1cter num\xe9rico."})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Segundo recordatorio (# d\xedas)",variant:"outlined",name:"segundo_recordatorio",value:C.segundo_recordatorio,onChange:S,error:v.segundo_recordatorio,helperText:v.segundo_recordatorio&&"Solo se permite un car\xe1cter num\xe9rico."})})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(r.root),children:[Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",disabled:v.primer_recordatorio||v.segundo_recordatorio,variant:"contained",className:"my-2 ".concat(r.button),type:"submit",children:"Guardar"}),Object(n.jsx)(x.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(r.button),onClick:function(){return a.push("/reminders")},children:"Cancelar"})]})]})})}),Object(n.jsx)(_t,{loading:p})]})})),rj=function(e){var t="";switch(e){case 7:t="Pendiente";break;case 4:t="Aprobada";break;case 6:t="Rechazada";break;case 5:t="Expirada";break;default:t="Error interno"}return t},cj=function(e){var t="";switch(e){case null:t="Transacci\xf3n pendiente";break;case 1:t="Transacci\xf3n aprobada";break;case 4:t="Transacci\xf3n rechazada por entidad financiera";break;case 5:t="Transacci\xf3n rechazada por el banco";break;case 6:t="Fondos insuficientes";break;case 7:t="Tarjeta inv\xe1lida";break;case 8:t="D\xe9bito autom\xe1tico no permitido";break;case 9:t="Tarjeta vencida";break;case 10:t="Tarjeta restringida";break;case 12:t="La fecha de expiraci\xf3n o el c\xf3digo de seguridad son inv\xe1lidos";break;case 13:t="Reintentar pago";break;case 14:t="Transacci\xf3n inv\xe1lida";break;case 17:t="El valor excede el m\xe1ximo permitido por la entidad";break;case 19:t="Transacci\xf3n abandonada por el pagador";break;case 22:t="Tarjeta no autorizada para comprar por internet";break;case 23:t="Transacci\xf3n rechazada por sospecha de fraude";break;case 9995:t="Certificado digital no encontrado";break;case 9996:t="Error tratando de comunicarse con el banco";break;case 9997:t="Error comunic\xe1ndose con la entidad financiera";break;case 9998:t="Transacci\xf3n no permitida";break;case 9999:t="Error interno";break;case 20:t="Transacci\xf3n expirada";break;default:t="Error interno"}return t},oj=function(e){var t="";switch(e){case 2:t="Tarjeta de Cr\xe9dito";break;case 4:t="Transferencias bancarias PSE";break;case 5:t="D\xe9bitos ACH";break;case 6:t="Tarjetas d\xe9bito";break;case 7:t="Efectivo";break;case 8:t="Referencia de pago";break;case 10:t="Pago en bancos";break;case 14:t="Transferencias bancarias SPEI";break;default:t=""}return t};var sj={changeBreadcrump:I.a},lj=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"pagos"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),sj)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=Object(u.g)(),m=Object(i.useState)([]),b=Object(d.a)(m,2),p=b[0],j=b[1],g=Object(i.useState)([]),x=Object(d.a)(g,2),O=x[0],v=x[1],_=Object(i.useState)(!0),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),N=Object(d.a)(k,1)[0],B=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios;Object(i.useEffect)((function(){r.includes("Leer")?(T(),c(S())):(l.push("/dashboard"),window.location.reload())}),[]);var S=function(){return N("breadCrumps:breadCrumps.payments",{returnObjects:!0})},T=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},B||(t.id_organizaciones=s),e.next=4,Ce.a.post("/payment/getPayments",t);case 4:a=e.sent,n=a.data,j(n.payments),v(n.payments),C(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),A=function(){return N("tables:table.payments",{returnObjects:!0})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"Payments",items:p,setItems:v,setLoading:C,loadData:T,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s}),Object(n.jsx)(zn,{columns:A(),rows:O,children:Object(n.jsx)(vn.a,{children:w?Object(n.jsx)(qn,{columns:A(),photo:0}):O.length>0?Object(n.jsx)(n.Fragment,{children:O.slice(t*a,t*a+a).map((function(e,t){var a,i,r,c;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_hora).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:rj(e.estado_transaccion)}),Object(n.jsx)(yn.a,{align:"center",children:cj(e.codigo_respuesta_estado_transaccion)}),Object(n.jsx)(yn.a,{align:"center",children:e.firma}),Object(n.jsx)(yn.a,{align:"center",children:e.codigo_referencia}),Object(n.jsx)(yn.a,{align:"center",children:e.id_referencia}),Object(n.jsx)(yn.a,{align:"center",children:null===(a=e.planes)||void 0===a?void 0:a.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.cantidad_emisiones.toLocaleString("es-MX")}),Object(n.jsx)(yn.a,{align:"center",children:e.valor.toLocaleString("es-MX")}),Object(n.jsx)(yn.a,{align:"center",children:e.moneda}),Object(n.jsx)(yn.a,{align:"center",children:oj(e.metodo_pago)}),Object(n.jsx)(yn.a,{align:"center",children:e.descripcion}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(i=e.usuarios)||void 0===i?void 0:i.primer_nombre," ").concat(null===(r=e.usuarios)||void 0===r?void 0:r.primer_apellido)}),Object(n.jsx)(yn.a,{align:"center",children:null===(c=e.organizaciones)||void 0===c?void 0:c.nombre})]},"row".concat(t))}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"14",children:"No hay datos registrados"})})})]})})),dj=a(1232),uj=a.p+"static/media/insignia_verificado.5225189b.svg",mj=a.p+"static/media/verificado_revocado.6dc5dd56.svg",bj=a.p+"static/media/verificado_vencido.972e1edc.svg";var pj=Object(C.a)((function(e){return{container:{display:"flex",justifyContent:"initial"},root:{marginTop:"2em"},grid:{backgroundColor:e.palette.footer.main,borderRadius:"10px",padding:"1em",marginBottom:"1em"},img_verified:{width:e.spacing(5),height:e.spacing(5)},img_status_small:{width:e.spacing(4),height:e.spacing(4)},textVerify:{fontWeight:"bold"},card:{borderRadius:"10px",borderColor:"#5c5c5c",padding:".5em",backgroundColor:"white",paddingBottom:0},cardHeader:{padding:".5em"},text:{color:"#5c5c5c"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},divider:{backgroundColor:"#5c5c5c"},button:{margin:"0.5em",borderRadius:5,padding:"9px 40px"}}})),jj=function(e){var t=e.history,a=e.location,r=pj(),c=Object(i.useState)(!1),o=Object(d.a)(c,2),s=o[0],l=o[1],u=Object(i.useState)({}),m=Object(d.a)(u,2),b=m[0],p=m[1],j=Object(D.a)(["payments"]),g=Object(d.a)(j,1)[0];Object(i.useEffect)((function(){O().catch((function(){t.push("/500"),window.location.reload()}))}),[]);var O=function(){var e=Object(h.a)(f.a.mark((function e(){var t;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l(!0),t=new URLSearchParams(null===a||void 0===a?void 0:a.search),p({transactionState:t.get("transactionState"),description:t.get("description"),processingDate:t.get("processingDate"),amount:t.get("TX_VALUE"),currency:t.get("currency"),transactionId:t.get("transactionId"),referenceCode:t.get("referenceCode"),payMethodType:t.get("polPaymentMethodType")}),l(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsx)(Rt.a,{maxWidth:"lg",className:r.container,children:Object(n.jsx)(ye.a,{container:!0,spacing:0,className:r.root,children:Object(n.jsxs)(ye.a,{item:!0,xs:12,md:12,className:"text-center ".concat(r.grid),children:[!1===s?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("img",{alt:"img_verificado",src:"4"===(null===b||void 0===b?void 0:b.transactionState)?uj:"7"===(null===b||void 0===b?void 0:b.transactionState)?bj:mj,className:r.img_verified}),Object(n.jsx)(we.a,{variant:"h6",className:r.textVerify,children:"4"===(null===b||void 0===b?void 0:b.transactionState)?g("payments:approved"):"7"===(null===b||void 0===b?void 0:b.transactionState)?g("payments:pending"):"6"===(null===b||void 0===b?void 0:b.transactionState)?g("payments:declined"):"5"===(null===b||void 0===b?void 0:b.transactionState)?g("payments:expired"):g("payments:error")}),Object(n.jsx)(we.a,{className:r.text,children:"4"===(null===b||void 0===b?void 0:b.transactionState)||"7"===(null===b||void 0===b?void 0:b.transactionState)?g("payments:message-approved"):g("payments:message-error")}),Object(n.jsx)("br",{})]}):Object(n.jsx)(Wa.a,{in:s,style:{transitionDelay:s?"800ms":"0ms"},unmountOnExit:!0,children:Object(n.jsx)(Ot.a,{size:50})}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,alignItems:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"right",children:Object(n.jsx)(we.a,{className:r.textTitle,children:g("payments:description")})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"left",children:Object(n.jsx)(we.a,{className:r.text,children:b.description})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"right",children:Object(n.jsx)(we.a,{className:r.textTitle,children:g("payments:value-paid")})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"left",children:Object(n.jsx)(we.a,{className:r.text,children:"$".concat(parseInt(b.amount).toLocaleString("es-MX")," ").concat(b.currency)})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"right",children:Object(n.jsx)(we.a,{className:r.textTitle,children:g("payments:payment-method")})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"left",children:Object(n.jsx)(we.a,{className:r.text,children:oj(parseInt(b.payMethodType))})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"right",children:Object(n.jsx)(we.a,{className:r.textTitle,children:g("payments:payment-date")})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"left",children:Object(n.jsx)(we.a,{className:r.text,children:Ne()(b.processingDate).format("DD/MM/YYYY")})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"right",children:Object(n.jsx)(we.a,{className:r.textTitle,children:g("payments:transaction-id")})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"left",children:Object(n.jsx)(we.a,{className:r.text,children:b.transactionId})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"right",children:Object(n.jsx)(we.a,{className:r.textTitle,children:g("payments:reference-code")})}),Object(n.jsx)(ye.a,{item:!0,xs:6,md:6,align:"left",children:Object(n.jsx)(we.a,{className:r.text,children:b.referenceCode})})]}),Object(n.jsx)(ye.a,{item:!0,xs:12,md:12,className:"text-center ".concat(r.grid),children:Object(n.jsxs)(x.a,{onClick:function(){return t.push("/payments")},color:"primary",variant:"contained",size:"small",className:r.button,children:[Object(n.jsx)(dj.a,{})," ",g("payments:view-pay")]})})]})})})]})},fj=a(572),hj=a.n(fj),gj=Object(xe.a)((function(e){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:e.palette.grey["light"===e.palette.type?200:700]},bar:{borderRadius:5,backgroundColor:e.palette.primary}}}))(Oe.a),xj=Object(C.a)((function(){return{container__button_fields:{display:"flex",justifyContent:"space-evenly",marginTop:20},button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}},mySwal:{zIndex:3e3}}})),Oj=function(e){var t=e.closeModalSign,a=e.saveSign,i=e.progressBar,c=r.a.useState([]),o=Object(d.a)(c,2),s=o[0],l=o[1],u=r.a.useState(!1),m=Object(d.a)(u,2),b=m[0],j=m[1],g=r.a.useState(null),O=Object(d.a)(g,2),v=O[0],_=O[1],w=xj(),C=Object(D.a)(["buttons","certifyDocuments"]),k=Object(d.a)(C,1)[0];r.a.useEffect((function(){j(!0),function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.post("/signature/getSignatures").then((function(e){var t=e.data;l(Object(p.a)(null===t||void 0===t?void 0:t.signatures)),j(!1)}));case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),j(!1),F.a.fire({icon:"error",iconColor:E.a.primary,text:k("alerts:alerts.try-again"),buttonsStyling:!1,customClass:{container:w.mySwal,confirmButton:"custom-button-confirm"}}).then((function(){return t()}));case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}()()}),[]);return Object(n.jsxs)(n.Fragment,{children:[!i.value&&Object(n.jsx)(ie.a,{children:b?Object(n.jsx)(y.a,{children:"Cargando..."}):s.length>0?Object(n.jsx)(n.Fragment,{children:s.map((function(e){return Object(n.jsxs)(y.a,{button:!0,onClick:function(){return function(e){_(e.id)}(e)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)(Ci.a,{edge:"start",checked:v===e.id})}),Object(n.jsx)(re.a,{children:Object(n.jsx)("img",{src:e.url,alt:"sign",width:200})})]})}))}):Object(n.jsx)(y.a,{children:"No tienes firmas registradas"})}),i.value&&Object(n.jsx)("div",{style:{margin:"1em",width:520},children:Object(n.jsxs)(Lt.a,{display:"flex",alignItems:"center",children:[Object(n.jsx)(Lt.a,{width:"100%",mr:1,children:Object(n.jsx)(gj,{variant:"determinate",value:i.value})}),Object(n.jsx)(Lt.a,{minWidth:35,children:Object(n.jsx)(we.a,{variant:"body2",color:"textSecondary",children:"".concat(Math.round(i.value),"%")})})]})}),Object(n.jsx)(ye.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"flex-end",children:Object(n.jsxs)(ye.a,{item:!0,xs:12,className:w.container__button_fields,children:[Object(n.jsx)(x.a,{className:w.button,onClick:function(){a({idSign:v})},disabled:null===v,children:k("buttons:buttons.save")})," ",Object(n.jsx)(x.a,{className:w.button,onClick:function(){return t()},children:k("buttons:buttons.cancel")})]})})]})};var vj=Object(C.a)((function(){return{buttonDialogClose:{color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},buttonDialogSign:{color:"white",backgroundColor:E.a.primary,borderRadius:5,width:"64px",height:"42px","&:hover":{backgroundColor:E.a.secondary}},mySwal:{zIndex:3e3}}})),_j={changePage:I.b,changeBreadcrump:I.a},yj=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"firmar diplomas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),_j)((function(e){var t,a,r,c=e.page,o=e.rowsPerPage,s=e.permission,l=e.changePage,b=e.changeBreadcrump,j=e.user,g=e.organizationId,y=Object(u.g)(),w=vj(),C=Object(i.useState)([]),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)([]),A=Object(d.a)(T,2),E=A[0],z=A[1],P=Object(i.useState)(!1),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(!1),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(!1),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!1),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(0),te=Object(d.a)(ee,2),ne=te[0],ie=te[1],re=Object(i.useState)({}),ce=Object(d.a)(re,2),oe=ce[0],se=ce[1],le=Object(i.useState)(1),de=Object(d.a)(le,2),ue=de[0],me=de[1],be=Object(i.useState)(""),pe=Object(d.a)(be,2),fe=pe[0],he=pe[1],ge=Object(i.useState)(""),xe=Object(d.a)(ge,2),Oe=xe[0],ve=xe[1],_e=Object(i.useState)(),we=Object(d.a)(_e,2),ke=we[0],Be=we[1],Se=Object(i.useState)({}),Te=Object(d.a)(Se,2),Ee=Te[0],Ie=Te[1],De=Object(i.useState)(!1),ze=Object(d.a)(De,2),Re=ze[0],Me=ze[1],Le=Object(D.a)(["alerts","tables","buttons","breadCrumps","dialogs"]),Fe=Object(d.a)(Le,1)[0],Ue=["Caveat","Caveat Brush","Cookie","Architects Daughter","Cedarville Cursive","Dawning of a New Day","Crafty Girls","League Script"],We=1===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Ye=Pe()("certika-organization-".concat(We?1:g)).toString(),qe=Pe()("certika-user-".concat(We?1:null===j||void 0===j||null===(t=j.data_user)||void 0===t?void 0:t.id)).toString();Object(i.useEffect)((function(){return s.includes("Leer")?He():y.push("/dashboard"),function(){l(0)}}),[]);var He=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,vo.a.load({google:{families:Ue},active:function(){L(!1)}}),L(!0),e.next=5,Ge();case 5:b(Fe("breadCrumps:breadCrumps.groups-diplomas-issued",{returnObjects:!0})),L(!1),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),y.push("/500");case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}(),Ke=1===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Ve=function(e,t){var a={limit:t||10,offset:e?e*t:0};return Ke||(a.id_organizaciones=g),a},Ge=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=Ve(0,o),e.next=4,Ce.a.post("/groupsBadgesIssued/getGroups/diplomasForSign",i);case 4:r=e.sent,c=r.data,B(null===(t=c.groups)||void 0===t?void 0:t.rows),z(null===(a=c.groups)||void 0===a?void 0:a.rows),Be(null===(n=c.groups)||void 0===n?void 0:n.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),y.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Qe=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),i=Ve(t,a),e.next=4,Ce.a.post("/groupsBadgesIssued/getGroups/diplomasForSign",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(N),Object(p.a)(null===(n=c.groups)||void 0===n?void 0:n.rows.filter((function(e){return!N.find((function(t){return t.id===e.id}))})))),B(o),z(o),L(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Je=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,q(!0),e.next=4,Ce.a.post("/diplomasIssued/getDiplomasForSign",{id_grupos_diplomas_emitidos:t});case 4:a=e.sent,n=a.data,se(Object(m.a)({},n.issued)),q(!1),me(1),Q(!0),e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(0),q(!1),e.abrupt("return",F.a.fire({icon:"error",text:Fe("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}));case 16:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}(),Xe=function(){return Fe("tables:table.columns-group-diplomas-issued",{returnObjects:!0})},Ze=function(){$(!1)},$e=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c,o,s,l,d,u,m,b;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return q(!0),e.next=3,ct()({method:"get",url:"https://api.ipdata.co?api-key=".concat(je.a.keyIpData)});case 3:if(a=e.sent,n=a.data,i=Ne()(new Date),!t.idSign){e.next=23;break}return e.prev=7,e.next=10,Ce.a.post("/diplomasIssued/sign",{id_firmas:t.idSign,id_diplomas_emitidos:null===oe||void 0===oe||null===(r=oe.rows[ue-1])||void 0===r?void 0:r.id,ip_adress:n.ip,trailDate:i});case 10:q(!1),$(!1),Me(!0),e.next=21;break;case 15:e.prev=15,e.t0=e.catch(7),Me(!1),q(!1),$(!1),F.a.fire({customClass:{container:w.mySwal},icon:"error",text:Fe("alerts:alerts.try-again")});case 21:e.next=50;break;case 23:return o=t.current.toDataURL(),s=Qm(o),l=new FormData,d="".concat(Ye,"/diplomasTemplate/signatures/").concat(qe),l.append("file",s),l.append("route",d),l.append("userId",null===j||void 0===j||null===(c=j.data_user)||void 0===c?void 0:c.id),e.prev=30,e.next=33,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:l,onUploadProgress:function(e){var t=e.loaded,a=e.total,n=Math.floor(100*t/a);Ie({value:n})}});case 33:return m=e.sent,b=m.data,e.next=37,Ce.a.post("/diplomasIssued/sign",{id_firmas:b.id,id_diplomas_emitidos:null===oe||void 0===oe||null===(u=oe.rows[ue-1])||void 0===u?void 0:u.id,ip_adress:n.ip});case 37:q(!1),$(!1),Ie({}),Me(!0),e.next=50;break;case 43:e.prev=43,e.t1=e.catch(30),F.a.fire({customClass:{container:w.mySwal},icon:"error",text:Fe("alerts:alerts.try-again")}),Me(!1),q(!1),$(!1),Ie({});case 50:case"end":return e.stop()}}),e,null,[[7,15],[30,43]])})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(Fn,{tableName:"groupIssued",type:"certificates",items:N,setItems:z,setCountItems:Be,changePage:l,loadData:He,setLoading:L,organizationId:1===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===j.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:g}),Object(n.jsx)(zn,{columns:Xe(),rows:ke,setDirection:he,setOrderBy:ve,loading:M,changePagination:Qe,children:Object(n.jsx)(vn.a,{children:M?Object(n.jsx)(qn,{columns:Xe(),photo:0}):E.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(E,Object(I.f)(fe,Oe)).slice(c*o,c*o+o).map((function(e,t){var a,i,r;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_emision).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(e.nombre)}),Object(n.jsx)(yn.a,{align:"center",children:"".concat((null===(a=e.organizaciones)||void 0===a?void 0:a.nombre)||e.nombre_organizacion)}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(i=e.usuarios)||void 0===i?void 0:i.primer_nombre," ").concat(null===(r=e.usuarios)||void 0===r?void 0:r.primer_apellido)}),Object(n.jsxs)(yn.a,{align:"center",children:[e.diplomasIssued,Object(n.jsx)(K.a,{title:"Firmar Diplomas",children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return Je(e.id)},children:Object(n.jsx)("img",{src:Am,alt:"Signatue",style:{width:"48px",height:"48px",padding:"12px",cursor:"pointer","&:hover":{backgroundColor:"blue"}}})})})]})]},"row".concat(t))}))}):Object(n.jsx)(_n.a,{children:Object(n.jsx)(yn.a,{align:"center",colSpan:"6",children:Fe("tables:table.empty-table-diploma")})})})}),Object(n.jsx)(O.a,{open:Z,fullWidth:!0,maxWidth:"sm",children:Object(n.jsxs)(_.a,{children:[Object(n.jsxs)(Dr.a,{value:ne,onChange:function(e,t){ie(t)},indicatorColor:"secondary",textColor:"secondary",variant:"scrollable",scrollButtons:"auto",children:[Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:Fe("buttons:buttons.my-sign")}),Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:Fe("buttons:buttons.draw")}),Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:Fe("buttons:buttons.write")}),Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:Fe("buttons:buttons.upload")})]}),Object(n.jsxs)(ye.a,{container:!0,justifyContent:"center",children:[0===ne&&Object(n.jsx)(Oj,{closeModalSign:Ze,saveSign:$e,progressBar:Ee}),1===ne&&Object(n.jsx)(tb,{closeModalSign:Ze,saveSign:$e,progressBar:Ee,emailUser:j.correo}),2===ne&&Object(n.jsx)(rb,{closeModalSign:Ze,saveSign:$e,progressBar:Ee,nameUser:"".concat(j.data_user.primer_nombre," ").concat(j.data_user.primer_apellido),emailUser:j.correo,fontsFamilys:Ue}),3===ne&&Object(n.jsx)(lb,{closeModalSign:Ze,saveSign:$e,progressBar:Ee,emailUser:j.correo})]})]})}),Object(n.jsxs)(O.a,{open:G,onClose:function(){return Q(!1)},maxWidth:"sm",children:[Object(n.jsxs)(v.a,{children:["Email receptor: ",(null===oe||void 0===oe?void 0:oe.rows)&&(null===oe||void 0===oe||null===(a=oe.rows[ue-1])||void 0===a?void 0:a.email_receptor)]}),Object(n.jsx)("img",{alt:"img-prev",src:(null===oe||void 0===oe?void 0:oe.rows)&&(null===oe||void 0===oe||null===(r=oe.rows[ue-1])||void 0===r?void 0:r.linkPhoto),style:{border:"groove",margin:"3px"}}),Object(n.jsx)(hj.a,{style:(null===oe||void 0===oe?void 0:oe.count)<=4?{display:"grid",placeItems:"center",margin:"3px 0 3px 0"}:{margin:"3px 0 3px 0"},color:"secondary",size:"large",count:null===oe||void 0===oe?void 0:oe.count,page:ue,onChange:function(e,t){me(t)}}),Object(n.jsxs)(Ae.a,{style:{justifyContent:"center"},children:[Object(n.jsx)(K.a,{title:"Firmar",children:Object(n.jsx)(x.a,{variant:"contained",className:"".concat(w.buttonDialogSign),onClick:function(e){Re||$(!0)},children:Object(n.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAv1JREFUaEPtWdFxXDEIhEpsd2JXkriSxJXYrsTuJE4lZPZF0kgIJO480s3N3Pu99yQWWGA5pit/+Mrtp4sDEJHH5MQvZv461aEXAZCM/kVE2fhs9ycRvTPzWxTIdgAi8puIYPzoeSGit0hEtgIQkVci+hn07gszA+zw2QYgpc3HzCD1+8MsClsAiMg9Ef0xjD9ynohAXvBBp9Y0CrsAWHn/ycxPNSgRAUiALaTW72gn7AIg6mKUzAdtjMER8736u+UAnKrzxMxIn+YRERAcRK+fIQ92AABx63rvetUiOjMPbVwKwCGvS0wjWpdNISd93JQwONARfSuJT/HoqdHKQFankO68GA+erWbmROt5NhetBqAJbOa/4/1p/sMRqwHoxuQB0EBh29T7OwDoBtYZ5aROyPtLAThp0TSwwYBnNjqLO6tTSEegGDYwfjrAbRsljOHsSKGB8W6V8sZwMwIiAlLhskajposfI0IDFxoAIBX/Oops2rRCKZSMz7NL6ZrKa6Ewq7NGWqYjbboPozWAuWK/iYAj+TD24iCtpqYggvrX9HwVvSx6TCAFQKoaMLIWFCOvTUMekJGe8Z0A8qZSHYHs6RmIqfGJAyMRbxLWA50BpN/LDqkjcSASU+MdYVJHE2RGClpFwhL+B0cUp/6f4QxWljLKr47G4SzM9cLKuqaASE7Dnd6+CECz8G/VmiHrcPls/dGBCHh9xKdzfjuKiOZAxHg3Ek4Vg+cwQltrE8/wnFoeF0saR6oQyhgO6g7TlcHgT1Nqg2X1IPfg3aZn6AigfP2ojD2QOsT2Ngs4484iaapMyPV8R7MDSt+UbYXRCLsCYlWhDAJIy+JJgQhPi6Pkzqt1a8WSv5t1ZLcKWVIugbgfXXgOG7/zzdJx+juGRb+9AYh6atV7HgeskqnbfvOOMRZsOcOqQlYzazrvbIMW1MN60LPW7a4kzRG9AUieaLx3i0DyioiclULd3KMbV/XndE7F7k9q/c6KM5YutlaVTX3urZHt8rR3z9VH4B+ePRmJS/cRBQAAAABJRU5ErkJggg==",style:{width:"48px",height:"48px",padding:"12px"},alt:"Sign"})})}),Object(n.jsx)(K.a,{title:"Cancelar",children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(w.buttonDialogClose),onClick:function(){return Q(!1)},children:Object(n.jsx)(ae.a,{})})})]})]}),Object(n.jsx)(_t,{loading:Y})]})})),wj=r.a.createRef();var Cj=Object(C.a)((function(e){return{text:{marginTop:"1em",marginBottom:"1em"},button:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}},input:{display:"none"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},alert:{width:"100%","& > * + *":{marginTop:e.spacing(1)}},link:{color:E.a.primary,border:"none",marginTop:"-1em",backgroundColor:"#fff","&:hover":{color:E.a.secondary}},linkDisabled:{display:"none",border:"none",marginTop:"-1em"},closeButton:{margin:".5em .5em 0 0",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}},"a\xf1adirButton":{color:"#0056b3",textTransform:"none",transitionProperty:"none","&:hover":{backgroundColor:"none",textDecoration:"underline"}}}})),kj={changePage:I.b,changeBreadcrump:I.a},Nj=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,permission:(e.permission||[]).filter((function(e){var t,a;return"emitir diplomas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,styles:e.styles}}),kj)((function(e){var t=e.page,a=e.rowsPerPage,r=e.permission,c=e.changePage,o=e.user,s=e.organizationId,p=e.changeBreadcrump,j=e.styles,g=Cj(),y=Object(u.g)(),w=Object(i.useState)([]),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),A=Object(d.a)(B,2),P=A[0],R=A[1],M=Object(i.useState)([]),L=Object(d.a)(M,2),U=L[0],W=L[1],q=Object(i.useState)([]),H=Object(d.a)(q,2),K=H[0],V=H[1],G=Object(i.useState)([]),Q=Object(d.a)(G,2),J=Q[0],X=Q[1],Z=Object(i.useState)(!1),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ne=Object(i.useState)(!1),ie=Object(d.a)(ne,2),re=ie[0],ce=ie[1],oe=Object(i.useState)(!1),se=Object(d.a)(oe,2),le=se[0],de=se[1],ue=Object(i.useState)([]),me=Object(d.a)(ue,2),be=me[0],pe=me[1],fe=Object(i.useState)(!1),he=Object(d.a)(fe,2),ge=he[0],xe=he[1],ke=Object(i.useState)(!0),Ne=Object(d.a)(ke,2),Be=Ne[0],Se=Ne[1],Ae=Object(i.useState)({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"0",file:null}),Ee=Object(d.a)(Ae,2),Ie=Ee[0],De=Ee[1],ze=Object(i.useState)(""),Re=Object(d.a)(ze,2),Me=Re[0],Le=Re[1],Fe=Object(i.useState)(""),Ue=Object(d.a)(Fe,2),We=Ue[0],Ye=Ue[1],qe=Object(i.useState)([]),He=Object(d.a)(qe,2),Ke=He[0],Ve=He[1],Ge=Object(i.useState)([]),Qe=Object(d.a)(Ge,2),Je=Qe[0],Xe=Qe[1],Ze=Object(i.useState)(null),$e=Object(d.a)(Ze,2),et=$e[0],tt=$e[1],at=["email_receptor","indicativo_pais","whatsapp_receptor"],nt=["","",""],it=Object(i.useState)(),rt=Object(d.a)(it,2),ot=rt[0],st=rt[1],lt=Object(i.useState)([{id:"index",label:"#",minWidth:50,align:"center"}]),dt=Object(d.a)(lt,2),ut=dt[0],bt=dt[1],pt=Object(i.useState)(""),jt=Object(d.a)(pt,2),ft=jt[0],ht=jt[1],gt=Object(D.a)(["alerts","tables","buttons","certificateBadgeIssued","breadCrumps","dialogs","selects"]),vt=Object(d.a)(gt,1)[0];Object(i.useEffect)((function(){r.includes("Leer")?_t():(y.push("/dashboard"),window.location.reload())}),[]);var _t=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,kt();case 2:return e.next=4,Ct();case 4:p(vt("breadCrumps:breadCrumps.diploma-issue",{returnObjects:!0})),c=null===(t=window.navigator)||void 0===t||null===(a=t.userAgentData)||void 0===a||null===(n=a.platform)||void 0===n?void 0:n.toLowerCase(),o=null===(i=window.navigator)||void 0===i||null===(r=i.platform)||void 0===r?void 0:r.toLowerCase(),c?c.includes("windows")?ht("ISO-8859-3"):ht("UTF-8"):o.includes("win")?ht("ISO-8859-3"):ht("UTF-8");case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(i.useEffect)((function(){if(null===et||void 0===et?void 0:et.id){var e,t,a=null===Ke||void 0===Ke?void 0:Ke.filter((function(e){return e.id===et.id}));Xe(null===(e=a[0])||void 0===e?void 0:e.diplomaCampos),st(null===(t=a[0])||void 0===t?void 0:t.codigo),et&&F.a.fire({icon:"info",text:vt("alerts:alerts.download-template"),confirmButtonColor:E.a.primary,confirmButtonText:vt("buttons:buttons.download")}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){var n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.value&&Bt(null===(n=a[0])||void 0===n?void 0:n.diplomaCampos,null===(i=a[0])||void 0===i?void 0:i.codigo);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}}),[et]);var yt=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,wt=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Ct=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!yt){e.next=9;break}return e.next=3,Ce.a.post("/diplomaTemplate/getDiplomaTemplatesPublished/names");case 3:t=e.sent,a=t.data,Ve(null===a||void 0===a?void 0:a.diplomaTemplates),a&&Se(!1),e.next=15;break;case 9:return e.next=11,Ce.a.post("/diplomaTemplate/getDiplomaTemplatesPublished/names",{id_organizaciones:s});case 11:n=e.sent,i=n.data,Ve(wt?null===i||void 0===i?void 0:i.diplomaTemplates.filter((function(e){return e.plantillasDiplomasHistorial[0].id_usuarios===o.data_user.id})):null===i||void 0===i?void 0:i.diplomaTemplates),i&&Se(!1);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),kt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/organization/getOrganizations");case 2:t=e.sent,a=t.data,pe(a.organizations.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Nt=function(e){De(Object(m.a)(Object(m.a)({},Ie),{},Object(b.a)({},e.target.name,e.target.value)))},Bt=function(e,t){var a=[],n=[];e.sort((function(e,t){return e.id<t.id?-1:1})).map((function(e){"qr"!==e.nombre&&"logo"!==e.nombre&&"certificateCode"!==e.nombre&&"buttonVerify"!==e.nombre&&(a.includes(e.nombre)?n.push("P\xe1gina ".concat(e.page)):n.push(""),a.push(e.nombre))}));var i=at.concat(a),r=nt.concat(n);i.push("fecha_expiracion"),r.push("20/09/2050"),i.unshift("codigo_diploma"),r.unshift(t);var c=Object(ed.convertArrayToCSV)([r],{header:i,separator:";"});td(c,et)},St=function(e){wj.current&&wj.current.open(e)},Tt=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,l,d,u,b,p,j,h,g,x,O,v,_;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],i=[],r=[],l=[],d=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,u=/^([0-9]{5,13})+$/,b=/^([0-9])*$/,p=/^([0-9]{1,5})+$/,j=["codigo_diploma","email_receptor","indicativo_pais","whatsapp_receptor","fecha_expiracion"],h=[],t[0].meta.fields.map((function(e){ut.push({id:"".concat(e),label:"".concat(e),align:"center",orden:"data.".concat(e)})})),bt(ut),Je.map((function(e){"qr"!==e.nombre&&"logo"!==e.nombre&&"certificateCode"!==e.nombre&&"buttonVerify"!==e.nombre?(j.push(e.nombre),h.push({nombre:e.nombre,tipo:e.tipo_campo_vp})):j.includes(e.nombre)||(j.push(e.nombre),h.push({nombre:e.nombre,tipo:e.tipo_campo_vp}))})),t.map((function(e){j.includes("qr")&&!e.meta.fields.includes("qr")&&e.meta.fields.push("qr"),j.includes("logo")&&!e.meta.fields.includes("logo")&&e.meta.fields.push("logo"),j.includes("certificateCode")&&!e.meta.fields.includes("certificateCode")&&e.meta.fields.push("certificateCode"),j.includes("buttonVerify")&&!e.meta.fields.includes("buttonVerify")&&e.meta.fields.push("buttonVerify"),0===e.errors.length&&e.meta.fields.length===j.length&&JSON.stringify(e.meta.fields.sort())===JSON.stringify(j.sort())&&(j.includes("qr")&&(e.data=Object(m.a)({qr:"qr-certika-600x600.png"},e.data)),j.includes("logo")&&(e.data=Object(m.a)({logo:"Certika-435x149.png"},e.data)),j.includes("certificateCode")&&(e.data=Object(m.a)({certificateCode:"certificateCode"},e.data)),j.includes("buttonVerify")&&(e.data=Object(m.a)({buttonVerify:"buttonVerify"},e.data)),i.push(e.data))})),g=i.map((function(e){return e.fecha_expiracion})),x=g.filter((function(e,t){return g.indexOf(e)===t})),X(x),i.map((function(e,t){if(""!==e.codigo_diploma.trim()&&""!==e.email_receptor.trim()){if(r.push(Object(m.a)({index:t},e)),1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?Ke.find((function(t){return t.codigo===e.codigo_diploma.trim()}))||n.push({index:t,msg:"".concat(vt("alerts:alerts.does-exit-template")," ").concat(e.codigo_diploma)}):Ke.find((function(t){return t.codigo===e.codigo_diploma.trim()&&t.id_organizaciones===s}))||n.push({index:t,msg:"".concat(vt("alerts:alerts.does-exit-template")," ").concat(e.codigo_diploma)}),d.test(e.email_receptor.trim())||n.push({index:t,msg:vt("alerts:alerts.email-invalid")}),""!==e.indicativo_pais.trim()&&(p.test(e.indicativo_pais.trim())||n.push({index:t,msg:"".concat(vt("alerts:alerts.indicative-invalid"))})),""!==e.whatsapp_receptor.trim()&&(u.test(e.whatsapp_receptor.trim())||n.push({index:t,msg:"".concat(vt("alerts:alerts.whatsapp-invalid"))}),""===e.indicativo_pais.trim()&&n.push({index:t,msg:"".concat(vt("alerts:alerts.indicative-invalid"))})),e.codigo_diploma.trim()!==ot&&n.push({index:t,msg:vt("alerts:alerts.diploma-code-error")}),h.map((function(a){""!==e[a.nombre]?41===a.tipo?0!==e[a.nombre].replace(/[^&\\#+()$~%'"*?<>{}\xef\u017c\xbd]/g,"").length&&n.push({index:t,msg:"".concat(vt("alerts:alerts.field-invalid")," ").concat(a.nombre)}):42===a.tipo?b.test(e[a.nombre].trim())||n.push({index:t,msg:"".concat(vt("alerts:alerts.field-invalid")," ").concat(a.nombre)}):44===a.tipo?u.test(e[a.nombre].trim())||n.push({index:t,msg:"".concat(vt("alerts:alerts.field-invalid")," ").concat(a.nombre)}):43===a.tipo&&(d.test(e[a.nombre].trim())||n.push({index:t,msg:"".concat(vt("alerts:alerts.field-invalid")," ").concat(a.nombre)})):l.push(t+2)})),""!==e.fecha_expiracion.trim()){var a=e.fecha_expiracion.trim().split("/"),i=new Date(a[2],a[1]-1,a[0]);Object(Kl.a)(parseInt(a[2]),parseInt(a[1])-1,parseInt(a[0]))&&Object(Vl.a)(i,new Date)||n.push({index:t,msg:vt("alerts:alerts.expiration-date-invalid")})}}else l.push(t+2)})),e.next=20,Ce.a.post("/contract/validations/",{id_organizaciones:null===Ie||void 0===Ie?void 0:Ie.id_organizaciones,issued:r});case 20:if(O=e.sent,v=O.data,!(_=v.contracts).thereContrat){e.next=30;break}if(!_.exceeds){e.next=26;break}return e.abrupt("return",F.a.fire({icon:"error",text:vt("alerts:alerts.exceeds-contract"),showConfirmButton:!0}).then((function(){At()})));case 26:if(!_.vencido){e.next=28;break}return e.abrupt("return",F.a.fire({icon:"error",text:vt("alerts:alerts.expired-contract"),showConfirmButton:!0}).then((function(){At()})));case 28:e.next=31;break;case 30:return e.abrupt("return",F.a.fire({icon:"error",text:vt("alerts:alerts.no-contract-error"),showConfirmButton:!0}).then((function(){At()})));case 31:c(0),te(!0),N(r),R(i),W(n),V(l),De(Object(m.a)(Object(m.a)({},Ie),{},{file:a}));case 38:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),At=function(){var e=Object(h.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:wj.current&&wj.current.removeFile(t),te(!1),ce(!1),de(!1),N([]),W([]),De({nombre:"",id_organizaciones:1!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14!==o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?s:"",file:null}),bt([{id:"index",label:"#",minWidth:50,align:"center"}]);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{}),Object(n.jsx)(ve.a,{children:Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{variant:"body1",className:g.text,children:vt("certificateBadgeIssued:issue.complete-diploma")}),Object(n.jsxs)(we.a,{variant:"body1",className:g.text,children:[vt("certificateBadgeIssued:issue.text-issued-1")," ",Object(n.jsxs)("b",{children:[vt("certificateBadgeIssued:issue.rows-certificate")," "]}),"Certika"===j.organizationName?vt("certificateBadgeIssued:issue.text-issued-diploma-2"):vt("certificateBadgeIssued:issue.text-issued-certificate-2-min")]}),Object(n.jsxs)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:[Object(n.jsx)(oo.a,{options:Ke?Ke.sort((function(e,t){return(null===e||void 0===e?void 0:e.nombre.toLowerCase())<(null===t||void 0===t?void 0:t.nombre.toLowerCase())?-1:1})):[],getOptionLabel:function(e){return"".concat(e.nombre," (").concat(e.nombre_privado,")")},onChange:function(e,t){tt({id:null===t||void 0===t?void 0:t.id,nombre:null===t||void 0===t?void 0:t.nombre})},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{label:Be?"Cargando...":vt("selects:selects-autocompletes.diploma-select"),variant:"outlined",InputProps:Object(m.a)(Object(m.a)({},e.InputProps),{},{endAdornment:Object(n.jsx)(n.Fragment,{children:e.InputProps.endAdornment})})}))}}),Be&&Object(n.jsx)(Oe.a,{})]}),Object(n.jsx)(Ui.a,{ref:wj,onFileLoad:Tt,noClick:!0,noDrag:!0,progressBarColor:E.a.primary,config:{header:!0,encoding:ft,skipEmptyLines:!0},children:function(e){var t=e.file;return Object(n.jsxs)("div",{style:{display:"flex",flexDirection:"row",marginBottom:10},children:[Object(n.jsx)(x.a,{disabled:!et,variant:"contained",color:"primary",component:"span",className:g.button,onClick:St,children:vt("buttons:buttons.choose-csv")}),Object(n.jsx)("div",{style:{borderWidth:1,height:45,lineHeight:2.5,marginTop:5,marginBottom:5,paddingLeft:13,paddingTop:3,width:"60%"},children:t&&t.name})]})}}),Object(n.jsx)(we.a,{variant:"body1",className:g.text,children:vt("certificateBadgeIssued:issue.uses-csv")}),Object(n.jsx)(l.b,{disabled:!et,component:"button",to:"#",onClick:function(){return Bt(Je,ot)},className:et?g.link:g.linkDisabled,children:Object(n.jsxs)(we.a,{variant:"body1",className:g.text,children:[Object(n.jsx)(va.a,{}),vt("certificateBadgeIssued:issue.dowload-template")]})})]})}),Object(n.jsxs)(O.a,{open:ee,fullWidth:!0,maxWidth:"xl",scroll:"body",children:[Object(n.jsx)(ye.a,{container:!0,justify:"flex-end",children:Object(n.jsx)(S.a,{className:g.closeButton,onClick:At,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsxs)(v.a,{children:[Object(n.jsxs)("div",{className:g.alert,children:[Object(n.jsxs)(Qi.a,{severity:"info",children:[vt("alerts:alerts.preloaded")," ",k.length," ",vt("alerts:alerts.of")," ",P.length," ",vt("alerts:alerts.rows")]}),0===k.length&&Object(n.jsx)(Qi.a,{severity:"error",children:vt("alerts:alerts.no-certificate-to-issue")}),k.length>1e3&&Object(n.jsx)(Qi.a,{severity:"error",children:vt("alerts:alerts.exceeded-limit")}),J.length>1&&Object(n.jsx)(Qi.a,{severity:"error",children:vt("alerts:alerts.expiration-date-equal")}),K.length>0&&Object(n.jsxs)(Qi.a,{severity:"error",children:[vt("alerts:alerts.rows-2")," ",Object(n.jsx)("b",{children:K.toString()})," ",vt("alerts:alerts.no-requirements")]}),U.length>5&&!le?Object(n.jsxs)(n.Fragment,{children:[U.map((function(e,t){return t<5&&Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:[vt("alerts:alerts.row")," ",e.index+2,":"]})," ",e.msg,"."]})},"row".concat(t))})),Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:["5 ",vt("alerts:alerts.of")," ",U.length," ",vt("alerts:alerts.errors"),"."]}),Object(n.jsx)(x.a,{onClick:function(){de(!0)},className:g.a\u00f1adirButton,children:vt("buttons:buttons.see-all")})]})})]}):Object(n.jsx)(n.Fragment,{children:U.map((function(e,t){return Object(n.jsx)("div",{children:Object(n.jsxs)(Qi.a,{severity:"error",children:[Object(n.jsxs)("b",{children:[vt("alerts:alerts.row")," ",e.index+2,":"]}),e.msg,"."]})},"row".concat(t))}))})]}),Object(n.jsx)(x.a,{variant:"contained",color:"primary",component:"span",className:g.button,onClick:function(e){e.preventDefault(),te(!1),ce(!0)},disabled:(k.length!==P.length||U.length>0||0===k.length||k.length>1e3||J.length>1||K.length>0)&&!0,children:vt("buttons:buttons.issue")}),Object(n.jsx)(x.a,{variant:"contained",color:"primary",component:"span",className:g.button,onClick:At,children:vt("buttons:buttons.cancel")})]}),Object(n.jsx)(_.a,{dividers:!0,children:k.length>0&&Object(n.jsx)(zn,{columns:ut,rows:k,setDirection:Le,setOrderBy:Ye,children:Object(n.jsx)(vn.a,{children:Object(I.J)(k,Object(I.f)(Me,We)).slice(t*a,t*a+a).map((function(e,t){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)("b",{children:e.index+2})}),ut.filter((function(e){return"#"!==e.label})).map((function(t){return Object(n.jsx)(yn.a,{align:"center",children:e[t.label]})}))]},"row".concat(t))}))})})})]}),Object(n.jsx)(O.a,{open:re,fullWidth:!0,maxWidth:"sm",style:{zIndex:100},children:Object(n.jsx)(_.a,{children:Object(n.jsxs)("form",{onSubmit:function(e){if(e.preventDefault(),(null===Ie||void 0===Ie?void 0:Ie.mensaje)&&(Ie.mensaje.length<60||Ie.mensaje.length>300))return F.a.fire({title:"Error",text:vt("alerts:alerts.message-size"),icon:"error",timer:4e3,confirmButtonColor:E.a.primary}),!1;ce(!1),F.a.fire({text:"".concat(vt("alerts:alerts.button-emit-1")," ").concat(P.length," ").concat(vt("alerts:alerts.button-emit-diplomas-2")),icon:"warning",showCancelButton:!0,showDenyButton:!0,confirmButtonColor:E.a.primary,cancelButtonColor:"#d33",denyButtonColor:E.a.secondary,confirmButtonText:vt("buttons:buttons.issue"),cancelButtonText:vt("buttons:buttons.cancel"),denyButtonText:"Atr\xe1s"}).then(function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.isDenied&&ce(!0),t.isDismissed&&At(),!t.value){e.next=26;break}return a={nombre:Ie.nombre,mensaje:Ie.mensaje||"".concat(vt("alerts:alerts.message-issue"),' "').concat(null===et||void 0===et?void 0:et.nombre,'".'),codigoDiploma:ot,diplomas:k,id_organizaciones:Ie.id_organizaciones,id_usuarios_emisores:o.data_user.id,archivo:Ie.file.name},e.prev=4,xe(!0),e.next=8,Ce.a.post("/diplomasIssued/",a);case 8:return n=e.sent,i=n.data,r=Pe()("certika-organization-".concat(Ie.id_organizaciones)).toString(),c=Pe()("certika-issued-group-".concat(i.groupId)).toString(),(s=new FormData).append("file",Ie.file),s.append("route","".concat(r,"/issue-files/").concat(c,"/").concat(c)),e.next=17,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-file"),headers:{"Content-Type":"multipart/form-data"},data:s});case 17:xe(!1),F.a.fire({icon:"info",text:vt("alerts:alerts.diplomas-issued"),showConfirmButton:!0}).then(Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:At(),y.push("/diplomas/sign");case 2:case"end":return e.stop()}}),e)})))),e.next=26;break;case 21:e.prev=21,e.t0=e.catch(4),xe(!1),At(),F.a.fire({icon:"error",text:vt("alerts:alerts.diploma-issued-error"),showConfirmButton:!1,timer:1500});case 26:case"end":return e.stop()}}),e,null,[[4,21]])})));return function(t){return e.apply(this,arguments)}}())},children:[Object(n.jsx)(we.a,{gutterBottom:!0,children:vt("dialogs:dialog.certificate-group-issue-name")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{autoFocus:!0,required:!0,id:"nombre",name:"nombre",variant:"outlined",onChange:Nt,value:Ie.nombre})}),Object(n.jsx)(we.a,{gutterBottom:!0,children:vt("dialogs:dialog.notification-message")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{id:"message",name:"mensaje",variant:"outlined",onChange:Nt,value:Ie.mensaje||"".concat(vt("alerts:alerts.message-issue"),' "').concat(null===et||void 0===et?void 0:et.nombre,'".'),required:!0,multiline:!0})}),(1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(we.a,{gutterBottom:!0,style:{marginTop:"1.5em"},children:[vt("dialogs:dialog.select-organization")," *"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",children:Object(n.jsxs)(T.a,{id:"id_organizaciones",name:"id_organizaciones",onChange:Nt,value:Ie.id_organizaciones,children:[Object(n.jsx)(Y.a,{children:Object(n.jsx)("em",{children:vt("selects:selects-autocompletes.select-option")})}),be.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},e.id)}))]})})]}),Object(n.jsxs)("div",{className:"text-center ".concat(g.root),style:{marginTop:"1.5em"},children:[Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(g.button),type:"submit",children:vt("buttons:buttons.issue")}),Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(g.button),onClick:At,children:vt("buttons:buttons.cancel")})]})]})})}),Object(n.jsx)(xt.a,{className:g.backdrop,open:ge,children:Object(n.jsx)(Ot.a,{color:"inherit"})})]})})),Bj=Object(C.a)((function(){return{button:{color:E.a.primary,backgroundColor:"white",borderRadius:5,padding:"8px 40px","&:hover":{backgroundColor:E.a.footer}}}}));var Sj={setReturnRoute:I.C},Tj=Object(s.b)((function(e){return{permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas diplomas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),Sj)((function(e){var t=e.children,a=e.Index,i=e.permission,r=e.setReturnRoute,c=Bj(),o=Object(u.g)(),s=Object(u.h)(),l=Object(D.a)(["tabs","buttons"]),m=Object(d.a)(l,1)[0],b=m("tabs:tabs.tabs-diploma",{returnObjects:!0});return Object(n.jsxs)(n.Fragment,{children:[i.includes("Crear")?Object(n.jsx)(Pn.a,{children:Object(n.jsx)(x.a,{className:c.button,onClick:function(){r(s.pathname),o.push("/diplomas/templates/create")},children:Object(n.jsx)("span",{children:m("buttons:buttons.create")})})}):Object(n.jsx)(Pn.a,{}),function(){if(i.includes("Leer"))return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Rr,{Index:a,TabsHeader:b}),t]});o.push("/dashboard"),window.location.reload()}()]})}));var Aj=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},buttonForm:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}},img_vertical:{maxWidth:"30vw",height:"auto"},img_horizontal:{maxWidth:"70vw",height:"auto"},iconButton:{margin:"0em -.4em"}}})),Ej={changeBreadcrump:I.a,changePage:I.b,setReturnRoute:I.C},Ij=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas diplomas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),Ej)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.permission,b=e.changePage,j=e.setReturnRoute,y=Object(u.g)(),w=Aj(),C=Object(i.useState)(!1),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)([]),A=Object(d.a)(T,2),z=A[0],P=A[1],R=Object(i.useState)(z),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)(""),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],V=Object(i.useState)(""),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)(!1),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)(!1),ne=Object(d.a)(te,2),ie=ne[0],re=ne[1],ce=Object(i.useState)(""),oe=Object(d.a)(ce,2),se=oe[0],le=oe[1],de=Object(i.useState)({}),ue=Object(d.a)(de,2),me=ue[0],be=ue[1],pe=Object(i.useState)({}),je=Object(d.a)(pe,2),fe=je[0],he=je[1],ge=Object(i.useState)({}),xe=Object(d.a)(ge,2),Oe=xe[0],ve=xe[1],_e=Object(i.useState)({}),ye=Object(d.a)(_e,2),we=ye[0],ke=ye[1],Be=Object(i.useState)(),Se=Object(d.a)(Be,2),Te=Se[0],Ee=Se[1],De=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),ze=Object(d.a)(De,1)[0];Object(i.useEffect)((function(){return Pe().catch((function(){y.push("/500"),window.location.reload()})),c(ze("breadCrumps:breadCrumps.diplomas-published",{returnObjects:!0})),function(){b(0)}}),[]);var Pe=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,qe();case 3:return e.next=5,Re();case 5:return e.next=7,Me();case 7:return e.next=9,Le();case 9:B(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Re=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,he(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,ke(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,ve(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Fe=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Ue=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,We=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),Ye=function(e,t){var a={limit:t||10,offset:e?e*t:0};return Fe||(a.id_organizaciones=s),(Ue||We)&&(a.id_usuarios=o.data_user.id),a},qe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=Ye(0,r),e.next=4,Ce.a.post("/diplomaTemplate/getDiplomaTemplatesPublished",i);case 4:c=e.sent,o=c.data,P(null===(t=o.diplomaTemplates)||void 0===t?void 0:t.rows),U(null===(a=o.diplomaTemplates)||void 0===a?void 0:a.rows),Ee(null===o||void 0===o||null===(n=o.diplomaTemplates)||void 0===n?void 0:n.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),y.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),He=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),i=Ye(t,a),e.next=4,Ce.a.post("/diplomaTemplate/getDiplomaTemplatesPublished",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(z),Object(p.a)(null===(n=c.diplomaTemplates)||void 0===n?void 0:n.rows.filter((function(e){return!z.find((function(t){return t.id===e.id}))})))),P(o),U(o),B(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Ke=function(e,t,a,n){switch(a){case"copy":Ve(e,t,n);break;case"edit":j("/diplomas/templates/published"),y.push("/diplomas/templates/edit/".concat(Object(Ie.b)(t)));break;case"archive":Qe(t);break;case"delete":Je(t)}},Ve=function(e,t,a){F.a.fire({text:ze("alerts:alerts.copy-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel")}).then(function(){var n=Object(h.a)(f.a.mark((function n(i){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i.value&&Xe(t,e,a);case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())},Qe=function(e){F.a.fire({text:ze("alerts:alerts.archive-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Ze(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Je=function(e){F.a.fire({text:ze("alerts:alerts.delete-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&$e(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Xe=function(e,t,a){var n,i,r,c,l;t.preventDefault(),B(!0);var d=null===z||void 0===z?void 0:z.filter((function(t){return t.id===e})),u=Object(m.a)(Object(m.a)({},d[0]),{},{copy:!0,nombre:"".concat(null===(n=d[0])||void 0===n?void 0:n.nombre," copia"),nombre_privado:"".concat(null===(i=d[0])||void 0===i?void 0:i.nombre_privado," copia"),id_habilidades:null===(r=d[0])||void 0===r?void 0:r.plantillasHabilidades.map((function(e){return{id_habilidades:e.id_habilidades}})),id_usuarios:null===(c=o.data_user)||void 0===c?void 0:c.id,id_organizaciones:s,diplomaFields:null===(l=d[0])||void 0===l?void 0:l.diplomaCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseInt(e.x),y:parseInt(e.y),width:e.width,height:e.height,page:e.page,align:e.formato_letra||"center"}}))});Ce.a.post("/diplomaTemplate",u).then((function(e){B(!1),y.push("/diplomas/templates/edited"),F.a.fire({icon:"success",text:ze("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){B(!1),F.a.fire({icon:"error",text:ze("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500})}))},Ze=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/diplomaTemplate/updateState/".concat(t),{estado:2,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){y.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:ze("alerts:alerts.archived"),icon:"success",showConfirmButton:!1,timer:1500}).then((function(){y.push("/diplomas/archived")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$e=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/diplomaTemplate/".concat(t),{data:{id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id}}).catch((function(){y.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:ze("alerts:alerts.deleted"),icon:"success",showConfirmButton:!1,timer:1500}).then((function(){Pe()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),et=function(e,t){if(l.includes("Editar")){var a=!1;return(Ue||We)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"edit",onClick:function(t){return Ke(t,e,"edit")},className:w.iconButton,children:Object(n.jsx)(Wn,{})})})}},tt=function(e,t){if(l.includes("Archivar")){var a=!1;return(Ue||We)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.archive"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"archive",onClick:function(t){return Ke(t,e,"archive")},className:w.iconButton,children:Object(n.jsx)(Er.a,{})})})}},at=function(e,t){if(l.includes("Eliminar")){var a=!1;return(Ue||We)&&(a=t!==o.data_user.id),Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{disabled:a,"aria-label":"delete",onClick:function(t){return Ke(t,e,"delete")},className:w.iconButton,children:Object(n.jsx)(Cn.a,{})})})}},nt=function(){return ze(Fe?"tables:table.columns-diploma-published-archived-super":"tables:table.columns-diploma-published-archived",{returnObjects:!0})},it=function(e){if(Fe)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})},rt=function(e,t,a){if(l.includes("Copiar")){var i=!1;return(Ue||We)&&(i=t!==o.data_user.id),Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.copy"),children:Object(n.jsx)(S.a,{disabled:i,"aria-label":"copy",onClick:function(t){return Ke(t,e,"copy",a)},className:w.iconButton,children:Object(n.jsx)(Ar.a,{})})})}},ct=function(){ee(!1),le("")},ot=function(){re(!1)};return Object(n.jsxs)(Tj,{Index:0,children:[Object(n.jsx)(Fn,{tableName:"templateDiploma",type:"published",items:z,setItems:U,setCountItems:Ee,changePage:b,loadData:Pe,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:Ue,isDeparmentCreaterRoll:We,userId:o.data_user.id},setLoading:B}),Object(n.jsx)(zn,{columns:nt(),rows:Te,setDirection:H,setOrderBy:J,loading:N,changePagination:He,children:Object(n.jsx)(vn.a,{children:L.length>0?N?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:nt(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(L,Object(I.f)(q,Q)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:w.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,le({photo:t,width:a,height:n}),void ee(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),it(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.diplomasEmitidos}),Object(n.jsx)(yn.a,{align:"center",children:1===e.estado?ze("tables:table.state.published"):" "}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return y.push("/diplomas/templates/published/details/".concat(Object(Ie.b)(e.id)))},className:w.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:et(e.id,e.plantillasDiplomasHistorial[0].id_usuarios)}),Object(n.jsx)(yn.a,{align:"center",children:e.diplomasEmitidos>0?rt(e.id,e.plantillasDiplomasHistorial[0].id_usuarios,!0):rt(e.id,e.plantillasDiplomasHistorial[0].id_usuarios)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t=null===z||void 0===z?void 0:z.find((function(t){return t.id===e})),a=fe.find((function(e){return e.id===t.nivel_vp})),n=Oe.find((function(e){return e.id===t.tiempo_vp})),i=we.find((function(e){return e.id===t.costo_vp}));be(Object(m.a)(Object(m.a)({},t),{},{niveles:null===a||void 0===a?void 0:a.valor_parametro,tiempos:null===n||void 0===n?void 0:n.valor_parametro,costos:null===i||void 0===i?void 0:i.valor_parametro})),re(!0)}(e.id)},className:w.iconButton,children:Object(n.jsx)(Ir.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:e.diplomasEmitidos>0?tt(e.id,e.plantillasDiplomasHistorial[0].id_usuarios):at(e.id,e.plantillasDiplomasHistorial[0].id_usuarios)})]},e.id)}))}):N?Object(n.jsx)(qn,{columns:nt(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:ze("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:$,onClose:ct,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(w.btnClose),onClick:ct,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:se.photo,className:se.width>se.height?w.img_horizontal:w.img_vertical})})]}),Object(n.jsxs)(O.a,{open:ie,onClose:ot,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:ot,children:ze("dialogs:dialog.preview-title-template-diploma")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:me})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(w.buttonForm),onClick:ot,children:ze("buttons:buttons.close")})})]})]})}));var Dj=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},buttonForm:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}},img_vertical:{maxWidth:"30vw",height:"auto"},img_horizontal:{maxWidth:"70vw",height:"auto"},iconButton:{margin:"0em -.4em"}}})),zj={changeBreadcrump:I.a,changePage:I.b,setReturnRoute:I.C},Pj=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas diplomas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),zj)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.permission,b=e.changePage,j=e.setReturnRoute,y=Object(u.g)(),w=Dj(),C=Object(i.useState)(!1),k=Object(d.a)(C,2),N=k[0],B=k[1],T=Object(i.useState)([]),A=Object(d.a)(T,2),z=A[0],P=A[1],R=Object(i.useState)(z),M=Object(d.a)(R,2),L=M[0],U=M[1],W=Object(i.useState)(""),Y=Object(d.a)(W,2),q=Y[0],H=Y[1],V=Object(i.useState)(""),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)(!1),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)(!1),ne=Object(d.a)(te,2),ie=ne[0],re=ne[1],ce=Object(i.useState)(""),oe=Object(d.a)(ce,2),se=oe[0],le=oe[1],de=Object(i.useState)({}),ue=Object(d.a)(de,2),me=ue[0],be=ue[1],pe=Object(i.useState)({}),je=Object(d.a)(pe,2),fe=je[0],he=je[1],ge=Object(i.useState)({}),xe=Object(d.a)(ge,2),Oe=xe[0],ve=xe[1],_e=Object(i.useState)({}),ye=Object(d.a)(_e,2),we=ye[0],ke=ye[1],Be=Object(i.useState)(),Se=Object(d.a)(Be,2),Te=Se[0],Ee=Se[1],De=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),ze=Object(d.a)(De,1)[0];Object(i.useEffect)((function(){return Re().catch((function(){y.push("/500"),window.location.reload()})),c(Pe()),function(){b(0)}}),[]);var Pe=function(){return ze("breadCrumps:breadCrumps.diplomas-edition",{returnObjects:!0})},Re=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,We();case 3:return e.next=5,qe();case 5:return e.next=7,He();case 7:return e.next=9,Ke();case 9:B(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Le=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Fe=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),Ue=function(e,t){var a={limit:t||10,offset:e?e*t:0};return Me||(a.id_organizaciones=s),(Le||Fe)&&(a.id_usuarios=o.data_user.id),a},We=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=Ue(0,r),e.next=4,Ce.a.post("/diplomaTemplate/getDiplomaTemplatesEdited",i);case 4:c=e.sent,o=c.data,P(null===(t=o.diplomaTemplates)||void 0===t?void 0:t.rows),U(null===(a=o.diplomaTemplates)||void 0===a?void 0:a.rows),Ee(null===o||void 0===o||null===(n=o.diplomaTemplates)||void 0===n?void 0:n.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),y.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Ye=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),i=Ue(t,a),e.next=4,Ce.a.post("/diplomaTemplate/getDiplomaTemplatesEdited",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(z),Object(p.a)(null===(n=c.diplomaTemplates)||void 0===n?void 0:n.rows.filter((function(e){return!z.find((function(t){return t.id===e.id}))})))),P(o),U(o),B(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),qe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,he(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),He=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,ke(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ke=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,ve(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ve=function(e,t,a){switch(a){case"copy":Qe(e,t);break;case"edit":j("/diplomas/templates/edited"),y.push("/diplomas/templates/edit/".concat(Object(Ie.b)(t)));break;case"publish":Je(t);break;case"delete":Xe(t)}},Qe=function(e,t){F.a.fire({text:ze("alerts:alerts.copy-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel")}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&Ze(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},Je=function(e){F.a.fire({text:ze("alerts:alerts.publish-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&$e(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Xe=function(e){F.a.fire({text:ze("alerts:alerts.delete-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:ze("buttons:buttons.accept"),cancelButtonText:ze("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&et(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Ze=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,l,d,u,b;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.preventDefault(),B(!0),d=null===z||void 0===z?void 0:z.filter((function(e){return e.id===t})),u=Object(m.a)(Object(m.a)({},d[0]),{},{copy:!0,nombre:"".concat(null===(n=d[0])||void 0===n?void 0:n.nombre," copia"),nombre_privado:"".concat(null===(i=d[0])||void 0===i?void 0:i.nombre_privado," copia"),id_habilidades:null===(r=d[0])||void 0===r?void 0:r.plantillasHabilidades.map((function(e){return{id_habilidades:e.id_habilidades}})),id_usuarios:null===(c=o.data_user)||void 0===c?void 0:c.id,id_organizaciones:s,diplomaFields:null===(l=d[0])||void 0===l?void 0:l.certificadoCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseInt(e.x),y:parseInt(e.y),width:e.width,height:e.height,page:e.page,align:e.formato_letra||"center"}}))}),e.prev=4,e.next=7,Ce.a.post("/diplomaTemplate",u);case 7:b=e.sent,b.data&&(B(!1),Re(),F.a.fire({icon:"success",text:ze("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(4),B(!1),F.a.fire({icon:"error",text:ze("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500});case 16:case"end":return e.stop()}}),e,null,[[4,12]])})));return function(t,a){return e.apply(this,arguments)}}(),$e=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/diplomaTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){y.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:ze("alerts:alerts.published"),icon:"success",showConfirmButton:!1,timer:1500}).then((function(){y.push("/diplomas/templates/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),et=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.delete("/diplomaTemplate/".concat(t),{data:{id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id}}).catch((function(){y.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:ze("alerts:alerts.deleted"),icon:"success",showConfirmButton:!1,timer:1500}).then((function(){Re()}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),tt=function(e){if(l.includes("Editar"))return Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.edit"),children:Object(n.jsx)(S.a,{"aria-label":"edit",onClick:function(t){return Ve(t,e,"edit")},className:w.iconButton,children:Object(n.jsx)(Wn,{})})})},at=function(e){if(l.includes("Publicar"))return Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.publish"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return Ve(t,e,"publish")},className:w.iconButton,children:Object(n.jsx)(ci.a,{})})})},nt=function(e){if(l.includes("Eliminar"))return Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(t){return Ve(t,e,"delete")},className:w.iconButton,children:Object(n.jsx)(Cn.a,{})})})},it=function(){return ze(Me?"tables:table.columns-diploma-edited-super":"tables:table.columns-diploma-edited",{returnObjects:!0})},rt=function(e){if(Me)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})},ct=function(e){if(l.includes("Copiar"))return Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.copy"),children:Object(n.jsx)(S.a,{"aria-label":"copy",onClick:function(t){return Ve(t,e,"copy")},className:w.iconButton,children:Object(n.jsx)(Ar.a,{})})})},ot=function(){ee(!1),le("")},st=function(){re(!1)};return Object(n.jsxs)(Tj,{Index:1,children:[Object(n.jsx)(Fn,{tableName:"templateDiploma",type:"edited",items:z,setItems:U,setCountItems:Ee,changePage:b,loadData:Re,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:Le,isDeparmentCreaterRoll:Fe,userId:o.data_user.id},setLoading:B}),Object(n.jsx)(zn,{columns:it(),rows:Te,setDirection:H,setOrderBy:J,loading:N,changePagination:Ye,children:Object(n.jsx)(vn.a,{children:L.length>0?N?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:it(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(L,Object(I.f)(q,Q)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:w.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,le({photo:t,width:a,height:n}),void ee(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),rt(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:0===e.estado?ze("tables:table.state.edited"):""}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return y.push("/diplomas/templates/published/details/".concat(Object(Ie.b)(e.id)))},className:w.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:tt(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:at(e.id)}),Object(n.jsx)(yn.a,{align:"center",children:ct(e.id)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:ze("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t=null===z||void 0===z?void 0:z.find((function(t){return t.id===e})),a=fe.find((function(e){return e.id===t.nivel_vp})),n=Oe.find((function(e){return e.id===t.tiempo_vp})),i=we.find((function(e){return e.id===t.costo_vp}));be(Object(m.a)(Object(m.a)({},t),{},{niveles:null===a||void 0===a?void 0:a.valor_parametro,tiempos:null===n||void 0===n?void 0:n.valor_parametro,costos:null===i||void 0===i?void 0:i.valor_parametro})),re(!0)}(e.id)},className:w.iconButton,children:Object(n.jsx)(Ir.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:nt(e.id)})]},e.id)}))}):N?Object(n.jsx)(qn,{columns:it(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:ze("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:$,onClose:ot,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(w.btnClose),onClick:ot,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:se.photo,className:se.width>se.height?w.img_horizontal:w.img_vertical})})]}),Object(n.jsxs)(O.a,{open:ie,onClose:st,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:st,children:ze("dialogs:dialog.preview-title-template-diploma")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:me})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(w.buttonForm),onClick:st,children:ze("buttons:buttons.close")})})]})]})}));var Rj=Object(C.a)((function(e){return{large:{width:"auto",height:e.spacing(10),margin:"auto","&:hover":{cursor:"pointer"}},btnClose:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},buttonForm:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}},img_vertical:{maxWidth:"30vw",height:"auto"},img_horizontal:{maxWidth:"70vw",height:"auto"},iconButton:{margin:"0em -.4em"}}})),Mj={changeBreadcrump:I.a,changePage:I.b},Lj=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage,user:e.user,permission:(e.permission||[]).filter((function(e){var t,a;return"plantillas diplomas"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre})),organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}}),Mj)((function(e){var t,a=e.page,r=e.rowsPerPage,c=e.changeBreadcrump,o=e.user,s=e.organizationId,l=e.changePage,b=e.permission,j=Object(u.g)(),y=Rj(),w=Object(i.useState)(!1),C=Object(d.a)(w,2),k=C[0],N=C[1],B=Object(i.useState)([]),T=Object(d.a)(B,2),A=T[0],z=T[1],P=Object(i.useState)(A),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)(""),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(""),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)(!1),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(i.useState)(!1),te=Object(d.a)(ee,2),ne=te[0],ie=te[1],re=Object(i.useState)(""),ce=Object(d.a)(re,2),oe=ce[0],se=ce[1],le=Object(i.useState)({}),de=Object(d.a)(le,2),ue=de[0],me=de[1],be=Object(i.useState)({}),pe=Object(d.a)(be,2),je=pe[0],fe=pe[1],he=Object(i.useState)({}),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ve=Object(i.useState)({}),_e=Object(d.a)(ve,2),ye=_e[0],we=_e[1],ke=Object(i.useState)(),Be=Object(d.a)(ke,2),Se=Be[0],Te=Be[1],Ee=Object(D.a)(["alerts","tables","buttons","dialogs","breadCrumps"]),De=Object(d.a)(Ee,1)[0];Object(i.useEffect)((function(){return ze().catch((function(){j.push("/500"),window.location.reload()})),c(De("breadCrumps:breadCrumps.diplomas-archived",{returnObjects:!0})),function(){l(0)}}),[]);var ze=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),e.next=3,Fe();case 3:return e.next=5,We();case 5:return e.next=7,Ye();case 7:return e.next=9,qe();case 9:N(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pe=1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Re=6===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,Me=6===(null===(t=o.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol),Le=function(e,t){var a={limit:t||10,offset:e?e*t:0};return Pe||(a.id_organizaciones=s),(Re||Me)&&(a.id_usuarios=o.data_user.id),a},Fe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=Le(0,r),e.next=4,Ce.a.post("/diplomaTemplate/getDiplomaTemplatesArchived",i);case 4:c=e.sent,o=c.data,z(null===(t=o.diplomaTemplates)||void 0===t?void 0:t.rows),L(null===(a=o.diplomaTemplates)||void 0===a?void 0:a.rows),Te(null===o||void 0===o||null===(n=o.diplomaTemplates)||void 0===n?void 0:n.count),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),j.push("/500"),window.location.reload();case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=Object(h.a)(f.a.mark((function e(t,a){var n,i,r,c,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),i=Le(t,a),e.next=4,Ce.a.post("/diplomaTemplate/getDiplomaTemplatesArchived",i);case 4:r=e.sent,c=r.data,o=[].concat(Object(p.a)(A),Object(p.a)(null===(n=c.diplomaTemplates)||void 0===n?void 0:n.rows.filter((function(e){return!A.find((function(t){return t.id===e.id}))})))),z(o),L(o),N(!1);case 10:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),We=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,fe(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ye=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,we(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,Oe(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),He=function(e){if(b.includes("Publicar"))return Object(n.jsx)(K.a,{title:De("tables:table.tooltip.publish"),children:Object(n.jsx)(S.a,{"aria-label":"publish",onClick:function(t){return function(e,t,a){switch(a){case"publish":Ke(t)}}(0,e,"publish")},className:y.iconButton,children:Object(n.jsx)(ci.a,{})})})},Ke=function(e){F.a.fire({text:De("alerts:alerts.publish-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:De("buttons:buttons.accept"),cancelButtonText:De("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&Ve(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},Ve=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.put("/diplomaTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=o.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()}).catch((function(){j.push("/500"),window.location.reload()}));case 2:n=e.sent,n.data&&F.a.fire({text:De("alerts:alerts.published"),icon:"success",showConfirmButton:!1,timer:1500}).then((function(){j.push("/diplomas/templates/published")}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Qe=function(){return De(Pe?"tables:table.columns-diploma-published-archived-super":"tables:table.columns-diploma-published-archived",{returnObjects:!0})},Je=function(e){if(Pe)return Object(n.jsx)(yn.a,{align:"center",children:e.organizaciones.nombre})},Xe=function(){ie(!1)},Ze=function(){$(!1),se("")};return Object(n.jsxs)(Tj,{Index:2,children:[Object(n.jsx)(Fn,{tableName:"templateCertificate",type:"archived",items:A,setItems:L,setCountItems:Te,changePage:l,loadData:ze,organizationId:1===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||14===o.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?null:s,deparmentCreater:{isDeparmentCreater:Re,isDeparmentCreaterRoll:Me,userId:o.data_user.id},setLoading:N}),Object(n.jsx)(zn,{columns:Qe(),rows:Se,setDirection:q,setOrderBy:Q,loading:k,changePagination:Ue,children:Object(n.jsx)(vn.a,{children:M.length>0?k?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(qn,{columns:Qe(),photo:1})}):Object(n.jsx)(n.Fragment,{children:Object(I.J)(M,Object(I.f)(Y,G)).slice(a*r,a*r+r).map((function(e){return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Object(n.jsx)(K.a,{title:De("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhotoTemplate,className:y.large,onClick:function(){return t=e.linkPhotoTemplate,a=e.width,n=e.height,se({photo:t,width:a,height:n}),void $(!0);var t,a,n}})})}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre}),Object(n.jsx)(yn.a,{align:"center",children:e.nombre_privado}),Je(e),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_ultima_modificacion).format("DD/MM/YYYY HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:e.certificadosEmitidos}),Object(n.jsx)(yn.a,{align:"center",children:2===e.estado?De("tables:table.state.archived"):""}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:De("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(){return j.push("/diplomas/templates/published/details/".concat(Object(Ie.b)(e.id)))},className:y.iconButton,children:Object(n.jsx)(Ge.a,{})})})}),Object(n.jsx)(yn.a,{align:"center",children:He(e.id)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:De("tables:table.tooltip.preview"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t=null===A||void 0===A?void 0:A.find((function(t){return t.id===e})),a=je.find((function(e){return e.id===t.nivel_vp})),n=xe.find((function(e){return e.id===t.tiempo_vp})),i=ye.find((function(e){return e.id===t.costo_vp}));me(Object(m.a)(Object(m.a)({},t),{},{niveles:null===a||void 0===a?void 0:a.valor_parametro,tiempos:null===n||void 0===n?void 0:n.valor_parametro,costos:null===i||void 0===i?void 0:i.valor_parametro})),ie(!0)}(e.id)},className:y.iconButton,children:Object(n.jsx)(Ir.a,{})})})})]},e.id)}))}):k?Object(n.jsx)(qn,{columns:Qe(),photo:1}):Object(n.jsx)(yn.a,{align:"center",colSpan:"9",children:De("tables:table.empty-table")})})}),Object(n.jsxs)(O.a,{open:Z,onClose:Ze,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(y.btnClose),onClick:Ze,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:oe.photo,className:oe.width>oe.height?y.img_horizontal:y.img_vertical})})]}),Object(n.jsxs)(O.a,{open:ne,onClose:Xe,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:Xe,children:De("dialogs:dialog.preview-title-template-diploma")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:ue})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(y.buttonForm),onClick:Xe,children:De("buttons:buttons.close")})})]})]})})),Fj=a(573),Uj=a.n(Fj);var Wj=Object(C.a)((function(e){return{container:function(e){return{marginTop:32,backgroundImage:"url(".concat(e.imageRoute,")"),backgroundRepeat:"no-repeat",width:"fit-content",maxWidth:"68vw"}},mySwal:{zIndex:3e3},pagination:{marginTop:"3px",position:"absolute"}}})),Yj={setDiplomaFields:I.s,setFormDiplomas:I.x},qj=Object(s.b)((function(e){return{diplomaFields:e.diplomaFields||[],imageRoute:e.formDiplomas.img_prev&&e.formDiplomas.img_prev[e.formDiplomas.page-1],width:e.formDiplomas.width,height:e.formDiplomas.height,formDiplomas:e.formDiplomas}}),Yj)((function(e){var t=e.imageRoute,a=e.width,r=e.height,c=e.modifyField,o=e.diplomaFields,s=e.setDiplomaFields,l=e.setFormDiplomas,u=e.formDiplomas,b=e.stageRef,p=e.selectedId,j=e.selectShape,f=e.handleChangePage,h=e.isSelected,g=e.setIsSelected,x=e.refField,O=e.setRefField,v=e.modifiedFieldIndex,_=e.setModifiedFieldIndex,y=e.documentSigned,w=Wj({imageRoute:t}),C=Object(i.useRef)(),k=Object(i.useRef)([]);k.current=[];var N=Object(D.a)(["alerts"]),B=Object(d.a)(N,1)[0],S=Object(i.useState)(!0),T=Object(d.a)(S,2),A=T[0],E=T[1],I=Object(i.useState)([]),z=Object(d.a)(I,2),P=z[0],R=z[1],M=function(e){u.change_template&&0!==u.change_template&&(F.a.fire({customClass:{container:w.mySwal},icon:"info",text:B("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:B("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(e){e.isConfirmed?(l(Object(m.a)(Object(m.a)({},u),{},{change_template:0,id_plantillas_diplomas:0,nameTemplate:""})),E(!0)):E(!0)})),E(!1))};Object(i.useEffect)((function(){var e;h&&((null===P||void 0===P?void 0:P.index)||(null===x||void 0===x||null===(e=x.ref)||void 0===e?void 0:e.index))?(C.current.setNode(P||(null===x||void 0===x?void 0:x.ref)),C.current.getLayer().batchDraw(),(null===x||void 0===x?void 0:x.ref)&&("auto"===o[x.index].width&&(o[x.index]=Object(m.a)(Object(m.a)({},o[x.index]),{},{width:parseInt(x.ref.getWidth())+5})),R(null===x||void 0===x?void 0:x.ref),s(o),O(null))):h&&k&&(C.current.setNode(k.current[k.current.length-1].el),C.current.getLayer().batchDraw())}),[h]),Object(i.useEffect)((function(){if(null===x||void 0===x?void 0:x.index)o[x.index]&&"auto"===o[x.index].width&&(o[x.index]=Object(m.a)(Object(m.a)({},o[x.index]),{},{width:parseInt(x.ref.getWidth())+5})),O(null),s(o);else if(null!==v){var e=k.current.findIndex((function(e){return e.index===v}));if(o[v]&&"auto"===o[v].width){var t=parseInt(k.current[e].el.getWidth()+5);o[v]=Object(m.a)(Object(m.a)({},o[v]),{},{width:t})}52===o[v].fieldTypeConfig&&(C.current.setNode(k.current[e].el),C.current.getLayer().batchDraw()),_(null),s(o)}}),[o]);var L=function(){var e=No()(t,"Anonymous"),a=Object(d.a)(e,1)[0];return Object(n.jsx)(Co.b,{image:a})};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("div",{className:w.pagination,children:Object(n.jsx)(Lt.a,{component:"span",display:"flex",justifyContent:"center",children:Object(n.jsx)(ta.a,{color:"secondary",count:(null===u||void 0===u?void 0:u.pages)||0,onChange:f,defaultPage:1,size:"small"})})}),Object(n.jsx)("div",{className:w.container,children:Object(n.jsx)(Co.f,{width:a,height:r,ref:b,onMouseDown:function(e){e.target.attrs.image&&(j(null),g(!1),R(null))},onMouseLeave:function(){o[o.length-1]&&"auto"===o[o.length-1].width&&(o[o.length-1]=Object(m.a)(Object(m.a)({},o[o.length-1]),{},{width:parseInt(k.current[k.current.length-1].el.getWidth())+5,align:"left"}),s(o)),j(null),g(!1),R(null)},children:Object(n.jsxs)(Co.c,{children:[Object(n.jsx)(L,{}),null===o||void 0===o?void 0:o.map((function(e,t){var i,l,d,b,f;return 48!==e.fieldType?(e.page===(null===u||void 0===u?void 0:u.page)||0===e.page)&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Co.g,{ref:function(e){return function(e,t){e&&!k.current.includes({el:e,index:t})&&k.current.push({el:e,index:t})}(e,t)},index:t,text:"certificateCode"===e.fieldName?"".concat(e.exampleText).concat(""===e.exampleText?"":":","CK09aABbAz"):e.exampleText,x:e.x,y:e.y,width:e.width,height:parseInt(e.fontSize),align:e.align,ellipsis:!0,onClick:function(t){y||(52===e.fieldTypeConfig?(g(!1),R(t.target),j(e.exampleText),g("X"!==e.exampleText&&"+"!==e.exampleText&&!0)):g(!1))},draggable:!y&&(!("X"===e.exampleText||"+"===e.exampleText)&&A),dragBoundFunc:function(t,n){var i=t.x,c=t.y;return i<0&&(i=0),c<0&&(c=0),i>a-e.width&&(i=a-e.width),c>r-e.height&&(c=r-e.height),{x:i,y:c}},fill:null===(i=e.fontColor)||void 0===i?void 0:i.hex,fontStyle:"".concat((null===(l=e.fontStyle)||void 0===l?void 0:l.bold)?"bold":""," ").concat((null===(d=e.fontStyle)||void 0===d?void 0:d.italic)?"italic":""),textDecoration:"".concat((null===(b=e.fontStyle)||void 0===b?void 0:b.underline)?"underline":""," ").concat((null===(f=e.fontStyle)||void 0===f?void 0:f.strikethrough)?"line-through":""),fontSize:parseInt(e.fontSize),fontFamily:e.fontFamily.family,onDragStart:function(e){return M()},onDragEnd:function(e){return function(e,t){o[t]=Object(m.a)(Object(m.a)({},o[t]),{},{x:e.target.x(),y:e.target.y()}),52===o[t].fieldTypeConfig?(g(!1),R(e.target),g(!0),s(o)):(g(!1),s(o))}(e,t)},onDblClick:function(a){y||"+"!==!e.exampleText||(c(t),O({ref:a.target,index:t}))},onTransformEnd:function(a){var n=P,i=n.scaleX();n.scaleX(1),n.scaleY(1),n.width(Math.max(5,n.width()*i)),function(e,t){var a=o.slice();a[t]=e,s(a)}(Object(m.a)(Object(m.a)({},e),{},{width:Math.round(n.width())}),t)}},"field".concat(t+1)),h&&Object(n.jsx)(Co.h,{ref:C,rotateEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:function(e,t){if(t.width<=10)return e;var n=a;return t.width>=n?e:t}})]}):"buttonVerify"===e.fieldName?(e.page===(null===u||void 0===u?void 0:u.page)||0===e.page)&&Object(n.jsx)(zo,{index:t,shapeProps:e,isSelected:e.exampleText===p,isDraggable:!y&&A,handleOnDragStart:M,onSelect:function(){y||(g(!1),R(null),j(e.exampleText))},onChange:function(e){var a=o.slice();a[t]=e,s(a)},layoutWidth:a,layoutHeight:r,modifyField:y?function(){}:c},t):e.fieldName.includes("signature")?(e.page===(null===u||void 0===u?void 0:u.page)||0===e.page)&&Object(n.jsx)(Do,{shapeProps:e,isSelected:e.fieldName===p,onSelect:function(){!y&&j(e.fieldName)},isDraggable:!y&&A,handleOnDragStart:M,onChange:function(e){var a=o.slice();a[t]=e,a[t].transform&&a.push(Object(m.a)(Object(m.a)({},a[t]),{},{fieldType:41,fieldTypeConfig:52,fontSize:"18",fieldName:"deleteSign",exampleText:"X",x:a[t].x+20,y:a[t].y-20,width:23,height:32,fontStyle:{bold:1}})),a[t].transform&&a.push(Object(m.a)(Object(m.a)({},a[t]),{},{fieldType:41,fieldTypeConfig:52,fontSize:"18",fieldName:"addSign",exampleText:"+",x:a[t].x+5,y:a[t].y-20,width:23,height:32,fontStyle:{bold:1}})),s(a)},layoutWidth:a,layoutHeight:r,diplomaFields:o,setDiplomaFields:s},t):(e.page===(null===u||void 0===u?void 0:u.page)||0===e.page)&&Object(n.jsx)(Do,{shapeProps:e,isSelected:e.exampleText===p,onSelect:function(){!y&&j(e.exampleText)},isDraggable:!y&&A,handleOnDragStart:M,onChange:function(e){var a=o.slice();a[t]=e,s(a)},layoutWidth:a,layoutHeight:r},t)}))]})})})]})}));var Hj=Object(C.a)((function(){return{container:{minHeight:"70vh"},container__header:{display:"flex",justifyContent:"flex-start",alignItems:"center",paddingTop:8,paddingBottom:8,"& h6":{marginLeft:10,fontWeight:"bold",color:"#888"}},my_signature:{display:"flex",alignItems:"center",cursor:"pointer","&:hover":{backgroundColor:"gainsboro"}},mySwal:{zIndex:3e3}}})),Kj={setDiplomaFields:I.s,setFormDiplomas:I.x},Vj=Object(s.b)((function(e){return{diplomaFields:e.diplomaFields||[],formDiplomas:e.formDiplomas}}),Kj)((function(e){var t=e.diplomaFields,a=e.setDiplomaFields,i=e.modifyField,r=e.openModal,c=e.openModalSign,o=e.setFormDiplomas,s=e.formDiplomas,l=e.signatures,u=e.setSignatures,b=e.openModalSignatories,j=e.typeViewFields,g=Hj(),x=[{fieldType:48,fieldName:"qr"},{fieldType:48,fieldName:"logo"},{fieldType:41,fieldName:"certificateCode"},{fieldType:48,fieldName:"buttonVerify"},{fieldType:48,fieldName:"signature"}],O=Object(D.a)(["alerts","certificateBadgeTemplate","buttons"]),v=Object(d.a)(O,1)[0],_=function(e){s.change_template&&0!==s.change_template?F.a.fire({customClass:{container:g.mySwal},icon:"info",text:v("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:v("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(n){n.isConfirmed&&(t.splice(e,1),a(Object(p.a)(t)),o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_diplomas:0,nameTemplate:""})))})):(t.splice(e,1),a(Object(p.a)(t)))},C=function(e,n){if(s.change_template&&0!==s.change_template)F.a.fire({customClass:{container:g.mySwal},icon:"info",text:v("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:v("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(i){if(i.isConfirmed){if(n)a(Object(p.a)(t.filter((function(t){return t.fieldName!==e}))));else{var r=t.findIndex((function(t){return t.fieldName===e&&(t.page===(null===s||void 0===s?void 0:s.page)||0===t.page)}));a(Object(p.a)(t.filter((function(e,t){return t!==r}))))}o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_diplomas:0,nameTemplate:""}))}}));else if(n)a(Object(p.a)(t.filter((function(t){return t.fieldName!==e}))));else{var i=t.findIndex((function(t){return t.fieldName===e&&(t.page===(null===s||void 0===s?void 0:s.page)||0===t.page)}));a(Object(p.a)(t.filter((function(e,t){return t!==i}))))}},k=function(e){var n=so(),i=n.dataQr,r=n.dataImg,c=n.dataCode,l=n.dataButtonVerify;0===e?t.push(Object(m.a)(Object(m.a)({},i),{},{page:null===s||void 0===s?void 0:s.page})):1===e?t.push(Object(m.a)(Object(m.a)({},r),{},{page:null===s||void 0===s?void 0:s.page})):-1===e?(e=2,t.push(Object(m.a)(Object(m.a)({},c),{},{page:null===s||void 0===s?void 0:s.page,fieldTypeConfig:51}))):-3===e&&t.push(Object(m.a)(Object(m.a)({},l),{},{page:null===s||void 0===s?void 0:s.page})),s.change_template&&0!==s.change_template?F.a.fire({customClass:{container:g.mySwal},icon:"info",text:v("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:v("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(e){e.isConfirmed&&(a(Object(p.a)(t)),o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_diplomas:0,nameTemplate:""})))})):a(Object(p.a)(t))},N=function(e){t.push(Object(m.a)(Object(m.a)({},t[e]),{},{page:null===s||void 0===s?void 0:s.page})),a(Object(p.a)(t))},B=function(){var e=Object(h.a)(f.a.mark((function e(n){var i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=so(),r=i.dataSignature,c=t.filter((function(e){return e.fieldName.includes("signature")})),s.change_template&&0!==s.change_template?F.a.fire({customClass:{container:g.mySwal},icon:"info",text:v("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:v("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(e){e.isConfirmed&&(t.push(Object(m.a)(Object(m.a)(Object(m.a)({},r),n),{},{fieldName:c?"".concat(r.fieldName.split("_")[0],"_").concat(c.length+1):r.fieldName,page:null===s||void 0===s?void 0:s.page,exampleText:n.url,idSignature:n.id})),a(Object(p.a)(t)),o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_diplomas:0,nameTemplate:""})))})):(t.push(Object(m.a)(Object(m.a)(Object(m.a)({},r),n),{},{correo:n.id&&n.correo?"":n.correo,fieldName:c?"".concat(r.fieldName.split("_")[0],"_").concat(c.length+1):r.fieldName,page:null===s||void 0===s?void 0:s.page,exampleText:n.url,idSignature:n.id})),a(Object(p.a)(t)));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e,a=null===(e=t.find((function(e){return"certificateCode"===e.fieldName&&e.page===(null===s||void 0===s?void 0:s.page)})))||void 0===e?void 0:e.exampleText;return void 0===a?"C\xf3digo:CK09aABbAz":"".concat(a).concat(""===a?"":":","CK09aABbAz")},A=function(e){return(null===t||void 0===t?void 0:t.find((function(t){return t.fieldName===e&&(t.page===(null===s||void 0===s?void 0:s.page)||0===t.page)})))?"delete":"add"},E=function(e){return t.filter((function(t){return t.fieldName===e}))},I=function(e){if(s.change_template&&0!==s.change_template)F.a.fire({customClass:{container:g.mySwal},icon:"info",text:v("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:v("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(n){if(n.isConfirmed){var i=t.findIndex((function(t){return t.fieldName===e&&(t.page===(null===s||void 0===s?void 0:s.page)||0===t.page)}));0===t[i].page?t[i].page=null===s||void 0===s?void 0:s.page:t[i].page=0,a(Object(p.a)(t)),o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_diplomas:0,nameTemplate:""}))}}));else{var n=t.findIndex((function(t){return t.fieldName===e&&(t.page===(null===s||void 0===s?void 0:s.page)||0===t.page)}));0===t[n].page?t[n].page=null===s||void 0===s?void 0:s.page:t[n].page=0,a(Object(p.a)(t))}},z=function(e){s.change_template&&0!==s.change_template?F.a.fire({customClass:{container:g.mySwal},icon:"info",text:v("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:v("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(n){n.isConfirmed&&(0===t[e].page?t[e].page=null===s||void 0===s?void 0:s.page:t[e].page=0,a(Object(p.a)(t)),o(Object(m.a)(Object(m.a)({},s),{},{change_template:0,id_plantillas_diplomas:0,nameTemplate:""})))})):(0===t[e].page?t[e].page=null===s||void 0===s?void 0:s.page:t[e].page=0,a(Object(p.a)(t)))};return Object(n.jsx)(n.Fragment,{children:Object(n.jsx)("div",{className:g.container,children:Object(n.jsx)("div",{className:g.container__fields,children:function(e){switch(e){case 0:return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("div",{className:g.container__header,children:[Object(n.jsx)("h6",{children:v("certificateBadgeTemplate:certificate-design.texts")}),Object(n.jsx)(K.a,{title:v("tables:table.tooltip.add"),children:Object(n.jsx)(S.a,{onClick:r,children:Object(n.jsx)(Hm.a,{})})})]}),Object(n.jsx)(Yo,{index:-1,exampleText:T(),fieldName:x[2].fieldName,addOrDelete:A(x[2].fieldName),addDefaultField:k,modifyField:i,deleteField:function(){return C(x[2].fieldName)},deleteForAllPages:function(){return C(x[2].fieldName,"all")},page:E(x[2].fieldName),multyField:function(){return I(x[2].fieldName)},multyPages:(null===s||void 0===s?void 0:s.pages)>1},"field".concat(2)),null===t||void 0===t?void 0:t.map((function(e,t){if(48!==e.fieldType&&"certificateCode"!==e.fieldName&&"deleteSign"!==e.fieldName&&"addSign"!==e.fieldName)return Object(n.jsx)(Yo,{index:t,exampleText:e.exampleText,fieldName:e.fieldName,addField:N,modifyField:i,deleteField:_,type:0,addOrDelete:e.page===(null===s||void 0===s?void 0:s.page)||0===e.page?"delete":"add",page:null===e||void 0===e?void 0:e.page,multyField:z,multyPages:(null===s||void 0===s?void 0:s.pages)>1},"field".concat(t))}))]});case 1:return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("div",{className:g.container__header,children:Object(n.jsx)("h6",{children:v("certificateBadgeTemplate:certificate-design.images")})}),null===x||void 0===x?void 0:x.map((function(e,t){if(48===e.fieldType&&3!==t&&4!==t)return Object(n.jsx)(Yo,{index:t,exampleText:"",fieldName:e.fieldName,addOrDelete:A(e.fieldName),addDefaultField:k,deleteField:function(){return C(e.fieldName)},deleteForAllPages:function(){return C(e.fieldName,"all")},page:E(e.fieldName),multyField:function(){return I(e.fieldName)},multyPages:(null===s||void 0===s?void 0:s.pages)>1},"field".concat(t))}))]});case 2:return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)("div",{className:g.container__header,children:Object(n.jsx)("h6",{children:v("certificateBadgeTemplate:certificate-design.buttons")})}),Object(n.jsx)(Yo,{index:-3,exampleText:v("certificateBadgeTemplate:certificate-design.button-verify"),fieldName:x[3].fieldName,modifyField:i,addOrDelete:A(x[3].fieldName),addDefaultField:k,deleteField:function(){return C(x[3].fieldName)},deleteForAllPages:function(){return C(x[3].fieldName,"all")},page:E(x[3].fieldName),multyField:function(){return I(x[3].fieldName)},multyPages:(null===s||void 0===s?void 0:s.pages)>1},"field".concat(3))]});case 3:return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("div",{className:g.container__header,children:[Object(n.jsx)("h6",{children:v("certificateBadgeTemplate:certificate-design.signatures")}),Object(n.jsx)(K.a,{title:v("buttons:buttons.add-signature"),children:Object(n.jsx)(S.a,{onClick:c,children:Object(n.jsx)(Hm.a,{})})})]}),Object(n.jsxs)(ie.a,{children:[l.length>0&&Object(n.jsx)(n.Fragment,{children:l.map((function(e){return Object(n.jsx)(ie.a,{children:Object(n.jsxs)(y.a,{button:!0,onClick:function(){return B(e)},children:[Object(n.jsx)(re.a,{children:Object(n.jsx)("img",{src:e.url,alt:"sign",width:200})}),Object(n.jsx)(Um.a,{children:Object(n.jsx)(K.a,{title:v("tables:table.tooltip.delete"),children:Object(n.jsx)(S.a,{"aria-label":"delete",onClick:function(){return n=e.id,i=e.url,void F.a.fire({customClass:{container:g.mySwal},icon:"info",text:v("alerts:alerts.delete-signature"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:v("alerts:alerts.yes-option"),cancelButtonText:"No",showLoaderOnConfirm:!0,preConfirm:function(){return n?Ce.a.delete("/signature/".concat(n)).then((function(){a(Object(p.a)(t.filter((function(e){return e.exampleText!==i})))),u(Object(p.a)(l.filter((function(e){return e.url!==i}))))})).catch((function(){F.a.showValidationMessage(v("alerts:alerts.try-again"))})):(a(Object(p.a)(t.filter((function(e){return e.exampleText!==i})))),u(Object(p.a)(l.filter((function(e){return e.url!==i})))))},allowOutsideClick:function(){return!F.a.isLoading()}});var n,i},children:Object(n.jsx)(Ym.a,{})})})})]})})}))}),Object(n.jsxs)(y.a,{button:!0,onClick:b,children:[Object(n.jsx)(re.a,{children:Object(n.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAVCAYAAAAnzezqAAAAAXNSR0IArs4c6QAAA7lJREFUSEvFVU2LHUUUPbe7q/p14xvGgIHoZtBB/AjIEIkrR/GLLESS4KBxoS4cg2aCIFHxHxgYBHWixMxCXfhBojHiIpgoUVeKSRBJFJ2QbFSIEIcZ7Xpd1a+P1HPG9Hvpl/nYeHfd995zz711bpVgFaZ1MkbBThAbOumC40K8aq05sFI4WWmCihtvgLK9U7bbCOFel7eeWgnmiggolT4B4b7LFqCMO5dNL5dEPwINYCAF5i5UgZROZgBctwT4GWfNcHfMwBpgLgPQ6s3tIZCui6L2axIEDwCIAMwI8IK15iCQrlOav9aMvheTzso1QPa71skWArsBeEIFy/KTogh3et9iUpVAqnRyHMANPYilQLYGQflDu5QzyxltIOUwGa4n+BGAoCfnJ2eNF6+fyEUhqTjdAXKqvoD86Gx2i9KJP5IrliDxt7PmSqXT7wHeWBsrMuHybE83AZ2+DfDRPuB01gwq1ZiEyPjlRch9zrV2KZ3M9j8uecfZ7LFuAiqZgmBHH3DrrGkCzQGli28AXNsn7qyz0UZgfk7pZB6Aro0j9jhnJroIRFHjTgnkizrWBA4U1oz5hDRNry6KcpqQTZVYCng4DGXcGOOFikgn+wV4sIYAWfKuomgd6yLgP7ROdhN4rofEjLMyWlWuj43jeJgMbgVAkfJEnue/dBfrbM1XCxuw6KIAk9aa5+u2oPMviuN7BeFDIJsUfFvk5k0AfpzeGlGcTEgp885le6sFlUq3M2CzyI0X8uK+N6M4eVKIjRCZJ9ofFHl+pJpXXcNQqcbjDHGuaLU+rxR8usjNy1rr9UT4IYDrAVgQo84ZrwcoldwGge/Wn/nPgnCrtX+diuLk2SI3ry8SihqNu6WNIedabwFoV45gcFDF+ccg7gBxXikZybLsN6WSKZL7g6D8gwi/BrCmwv6cs/FIh4DOTwIYqvguCNq3l2VwlYiMecF57TjHkxCsheBLl8ebgdlZPwFRKv0Mwnv+AyCOiXCalA3OmReVTk8AvKlXUAQOLnSx5VKxde6OEaWSl0T4Hf36+gYvquGoc9l9onXyMIH3atSaORsOqbi9DcQrteu01E/BM06F7yvbPusXqDdcgG2++yNd3S9EEThUWLNZ6fRUXfdL1f7XL6edzW6OdHJIAP++dBvlqCid/Alg8FIfdhWhvKuKZT1A/fh0HqYo5iNCTNYEzXoCZd3l4y+RsuR5CcSre9XGkqNBIGv9ZVYDQk+AdeilyP0CKYTl4VVX79xSwSaCUUB+WofzvxP4Bz4Bip285n+VAAAAAElFTkSuQmCC",alt:"sign"})}),Object(n.jsx)(w.a,{style:{textAlign:"center"},primary:v("buttons:buttons.add-signatorie")})]})]})]})}}(j)})})})}));var Gj=Object(C.a)((function(e){return{container:{display:"grid",gridTemplateColumns:"70% 30%",backgroundColor:"#E5E5E5"},container__certificate:{display:"flex",justifyContent:"center",overflow:"auto"},container__fields:{backgroundColor:"white"},container__button_fields:{display:"flex",justifyContent:"space-evenly",marginTop:20},content_modal:{display:"grid",gridTemplateColumns:"35% 65%",gridTemplateRows:""},dialog__title:{backgroundColor:e.palette.primary.main},sweetModal:{zIndex:1300},mySwal:{zIndex:3e3},fieldButtonDisabled:{display:"none"},root_info:{height:180},container_info:{display:"flex",justifyContent:"center",margin:e.spacing(1),backgroundColor:"#fff",borderRadius:"1em"},buttonMinimize:{display:"flex",justifyContent:"right",margin:e.spacing(1),backgroundColor:"#fff",borderRadius:"1em"},buttonClose:{margin:"0 .1em 0 .1em",float:"right",color:"#ffffff",backgroundColor:E.a.primary,"&:hover":{backgroundColor:E.a.secondary}},container__button_signed:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},button_signed:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"10px 40px",fontSize:"11px","&:hover":{backgroundColor:E.a.secondary}}}})),Qj={sizeZoom:{width:"50px",height:"24px",marginLeft:"5px",fontWeight:"bold",input:{textAlign:"center",cursor:"pointer"}},iconsButtons:{width:"45px",height:"45px",padding:"10px",margin:"0 3px 0 3px",borderRadius:"4px",cursor:"pointer","&:hover":{backgroundColor:"#E6E6E6"}},iconsButtonsActive:{width:"45px",height:"45px",padding:"10px",margin:"0 3px 0 3px",borderRadius:"4px",cursor:"pointer",backgroundColor:"#E6E6E6"}},Jj={setDiplomaFields:I.s,setFormDiplomas:I.x,setSaveDesign:I.D},Xj=Object(s.b)((function(e){return{diplomaFields:e.diplomaFields||[],formDiplomas:e.formDiplomas||[]}}),Jj)((function(e){var t,a,r,c,o,s,l,u,j,g,x,y,w,C,k,N,B,A=e.diplomaFields,E=e.setDiplomaFields,I=e.formDiplomas,z=e.setFormDiplomas,P=e.setSaveDesign,R=e.setOpenDesignDiploma,M=e.fromCertify,L=e.user,U=e.md5OrganizationRoute,W=e.md5UserRoute,q=e.handleCancelGeneral,V=e.fromSign,G=e.documentSigned,Q=e.isEditDocuments,J=Gj(),X=Object(i.useRef)(),Z=Object(i.useState)(!0),$=Object(d.a)(Z,2),ee=$[0],te=$[1],ae=Object(i.useState)(!1),ne=Object(d.a)(ae,2),ie=ne[0],re=ne[1],ce=Object(i.useState)(!1),oe=Object(d.a)(ce,2),se=oe[0],le=oe[1],de=Object(i.useState)(!1),ue=Object(d.a)(de,2),me=ue[0],be=ue[1],pe=Object(i.useState)(null),fe=Object(d.a)(pe,2),he=fe[0],ge=fe[1],xe=Object(i.useState)(0),Oe=Object(d.a)(xe,2),ve=Oe[0],_e=Oe[1],ke=Object(i.useState)({fieldType:41,fieldTypeConfig:51,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0}),Ne=Object(d.a)(ke,2),Be=Ne[0],Se=Ne[1],Te=A.findIndex((function(e){return"certificateCode"===e.fieldName&&e.page===(null===I||void 0===I?void 0:I.page)})),Ee=A.findIndex((function(e){return"buttonVerify"===e.fieldName})),Ie="certificateCode"===Be.fieldName,De="buttonVerify"===Be.fieldName,ze=["Caveat","Caveat Brush","Cookie","Architects Daughter","Cedarville Cursive","Dawning of a New Day","Crafty Girls","League Script"],Pe=Object(i.useState)([].concat(Object(p.a)(A.map((function(e){var t;return null===(t=e.fontFamily)||void 0===t?void 0:t.family}))),["ABeeZee"],ze)||["ABeeZee"]),Re=Object(d.a)(Pe,2),Me=Re[0],Le=Re[1],Fe=Object(i.useState)([]),Ue=Object(d.a)(Fe,2),We=Ue[0],Ye=Ue[1],qe=Object(i.useState)([]),He=Object(d.a)(qe,2),Ke=He[0],Ve=He[1],Ge=Object(i.useState)([]),Qe=Object(d.a)(Ge,2),Je=Qe[0],Xe=Qe[1],Ze=Object(i.useState)(!1),$e=Object(d.a)(Ze,2),et=$e[0],tt=$e[1],at=Object(i.useState)(null),nt=Object(d.a)(at,2),it=nt[0],rt=nt[1],ot=Object(i.useState)(null),st=Object(d.a)(ot,2),lt=st[0],dt=st[1],ut=Object(i.useState)([]),bt=Object(d.a)(ut,2),pt=bt[0],jt=bt[1],ft=Object(i.useState)([]),ht=Object(d.a)(ft,2),gt=ht[0],xt=ht[1],Ot=Object(i.useState)(0),vt=Object(d.a)(Ot,2),yt=vt[0],wt=vt[1],Ct=Object(i.useState)({}),kt=Object(d.a)(Ct,2),Nt=kt[0],Bt=kt[1],St=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","tables","menu"]),Tt=Object(d.a)(St,1)[0],Et="en"===(null===(t=window.localStorage.state)||void 0===t||null===(a=t.split('"lenguage":"')[1])||void 0===a?void 0:a.slice(0,2));Object(i.useEffect)((function(){var e;(te(!0),Q)&&xt(null===A||void 0===A||null===(e=A.filter((function(e){var t,a;return(null===(t=e.dataSign)||void 0===t?void 0:t.correo)&&(null===(a=e.dataSign)||void 0===a?void 0:a.correo)!==L.correo&&e.correo!==L.correo})))||void 0===e?void 0:e.map((function(e){return e.primer_nombre=e.dataSign?e.dataSign.primer_nombre:e.primer_nombre,e.segundo_nombre=e.dataSign?e.dataSign.segundo_nombre:e.segundo_nombre,e.primer_apellido=e.dataSign?e.dataSign.primer_apellido:e.primer_apellido,e.segundo_apellido=e.dataSign?e.dataSign.segundo_apellido:e.segundo_apellido,e.correo=e.dataSign?e.dataSign.correo:e.correo,e.url=e.exampleText,e})));Ce.a.get("/others/getFieldTypes").then((function(e){var t=e.data;Xe(t.fieldTypes.filter((function(e){return 51===e.id||52===e.id})).map((function(e){return{id:e.id,value:Et?e.valor_parametro_en:e.valor_parametro}}))),Ve(t.fieldTypes.filter((function(e){return 51!==e.id&&52!==e.id})).map((function(e){return{id:e.id,value:Et?e.valor_parametro_en:e.valor_parametro}})))})),Me.length>0?vo.a.load({google:{families:Me},active:function(){te(!1)}}):te(!1),ct.a.get("https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyAiqPGRASVurt5YfOdCCDOljv0nqATgCSc&fields=items.family,items.files&sort=alpha").then((function(e){var t=e.data;Ye(t.items)})),L&&Ce.a.post("/signature/getSignatures").then((function(e){var t=e.data;jt(Object(p.a)(null===t||void 0===t?void 0:t.signatures))}))}),[]);var It=function(){re(!1),Se({fieldType:41,fieldTypeConfig:51,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0})},Dt=function(){le(!1)},zt=function(e){Se(Object(m.a)(Object(m.a)({},Be),{},{fontStyle:e}))},Pt=function(e){Se(Object(m.a)(Object(m.a)({},Be),{},{fontColor:M?{hex:e.hex}:e}))},Rt=function(e){if(!("fontSize"===e.target.name&&e.target.value>100)){var t;if("fieldTypeConfig"===e.target.name)return Se(Object(m.a)(Object(m.a)({},Be),{},(t={},Object(b.a)(t,e.target.name,e.target.value),Object(b.a)(t,"fieldName",""),Object(b.a)(t,"align","center"),Object(b.a)(t,"width","auto"),t)));Se(Object(m.a)(Object(m.a)({},Be),{},Object(b.a)({},e.target.name,e.target.value)))}},Mt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c,o,s;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.current.toDataURL(),i=Qm(n),r=new FormData,c="".concat(U,"/documentsTemplate/signatures/").concat(W),r.append("file",i),r.append("route",c),r.append("userId",null===L||void 0===L||null===(a=L.data_user)||void 0===a?void 0:a.id),e.prev=7,e.next=10,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-certificate"),headers:{"Content-Type":"multipart/form-data"},data:r,onUploadProgress:function(e){var t=e.loaded,a=e.total,n=Math.floor(100*t/a);Bt({value:n})}});case 10:o=e.sent,s=o.data,jt([].concat(Object(p.a)(pt),[{url:null===s||void 0===s?void 0:s.url,id:null===s||void 0===s?void 0:s.id}])),le(!1),Bt({}),e.next=22;break;case 17:e.prev=17,e.t0=e.catch(7),F.a.fire({customClass:{container:J.mySwal},icon:"error",text:Tt("alerts:alerts.try-again")}),le(!1),Bt({});case 22:case"end":return e.stop()}}),e,null,[[7,17]])})));return function(t){return e.apply(this,arguments)}}(),Lt=function(e){I.change_template&&0!==I.change_template?F.a.fire({customClass:{container:J.mySwal},icon:"info",text:Tt("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Tt("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(t){t.isConfirmed&&(Se(-1===e?Object(m.a)(Object(m.a)({},A[Te]),{},{width:51===A[Te].fieldTypeConfig?"auto":A[Te].width,index:Te}):-3===e?Object(m.a)(Object(m.a)({},A[Ee]),{},{index:Ee}):Object(m.a)(Object(m.a)({},A[e]),{},{width:51===A[e].fieldTypeConfig?"auto":A[e].width,index:e})),z(Object(m.a)(Object(m.a)({},I),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})),re(!0))})):(Se(-1===e?Object(m.a)(Object(m.a)({},A[Te]),{},{width:51===A[Te].fieldTypeConfig?"auto":A[Te].width,index:Te}):-3===e?Object(m.a)(Object(m.a)({},A[Ee]),{},{index:Ee}):Object(m.a)(Object(m.a)({},A[e]),{},{width:51===A[e].fieldTypeConfig?"auto":A[e].width,index:e})),re(!0))},Ft=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!V||A.find((function(e){return e.fieldName.includes("signature")}))){e.next=2;break}return e.abrupt("return",F.a.fire({icon:"info",text:Tt("alerts:alerts.no-fields"),showConfirmButton:!1,timer:1500,customClass:{container:J.sweetModal}}));case 2:if(n=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]'),Array.prototype.forEach.call(n,(function(e){return e.remove()})),!(A.filter((function(e){return 41===e.fieldType&&"certificateCode"!==e.fieldName||42===e.fieldType})).length<=0)){e.next=7;break}return e.abrupt("return",F.a.fire({icon:"info",text:Tt("alerts:alerts.certificate-field"),showConfirmButton:!1,timer:1500,customClass:{container:J.sweetModal}}));case 7:if(void 0!==Te&&-1!==Te&&(A[Te].exampleText="".concat(A[Te].exampleText).concat(""===A[Te].exampleText?"":":","CK09aABbAz")),i=null===X||void 0===X||null===(a=X.current)||void 0===a?void 0:a.toDataURL(),(r=(null===I||void 0===I?void 0:I.img_template)||[]).length===(null===I||void 0===I?void 0:I.pages)?r[(null===I||void 0===I?void 0:I.page)-1]=i:r.push(i),!((null===I||void 0===I?void 0:I.pages)>1)){e.next=20;break}c=0;case 13:if(!(c<(null===I||void 0===I?void 0:I.pages))){e.next=20;break}if(r[c]){e.next=17;break}return r=null,e.abrupt("return",F.a.fire({icon:"info",text:Tt("alerts:alerts.certificate-no-design-page"),showConfirmButton:!1,timer:2e3,customClass:{container:J.sweetModal}}));case 17:c++,e.next=13;break;case 20:z(Object(m.a)(Object(m.a)({},I),{},{img_template:r})),P(!0),R(!1);case 23:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ut=function(){if(G){var e=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]');Array.prototype.forEach.call(e,(function(e){return e.remove()})),void 0!==Te&&-1!==Te&&(A[Te].exampleText="".concat(A[Te].exampleText).concat(""===A[Te].exampleText?"":":","CK09aABbAz")),q(),R(!1)}else if(M)F.a.fire({customClass:{container:J.mySwal},icon:"info",text:Tt("alerts:alerts.cancel-progress"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Tt("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(e){if(e.isConfirmed){var t=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]');Array.prototype.forEach.call(t,(function(e){return e.remove()})),void 0!==Te&&-1!==Te&&(A[Te].exampleText="".concat(A[Te].exampleText).concat(""===A[Te].exampleText?"":":","CK09aABbAz")),q(),R(!1)}}));else{var t=document.querySelectorAll('link[media="all"][href^="https://fonts.googleapis.com/css"]');Array.prototype.forEach.call(t,(function(e){return e.remove()})),void 0!==Te&&-1!==Te&&(A[Te].exampleText="".concat(A[Te].exampleText).concat(""===A[Te].exampleText?"":":","CK09aABbAz")),R(!1)}},Wt=function(){var e=Object(h.a)(f.a.mark((function e(t,a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a||(null===I||void 0===I?void 0:I.ip_adress)){e.next=3;break}return e.next=3,Yt();case 3:_e(t);case 4:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),Yt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ct()({method:"get",url:"https://api.ipdata.co?api-key=".concat(je.a.keyIpData)});case 3:t=e.sent,a=t.data,z(Object(m.a)(Object(m.a)({},I),{},{ip_adress:a.ip})),e.next=11;break;case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",F.a.fire({customClass:{container:J.mySwal},icon:"warning",text:Tt("alerts:alerts.warning-block"),showConfirmButton:!0}));case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}();return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(At,{}),Object(n.jsx)("div",{style:{backgroundColor:"#E5E5E5"},children:Object(n.jsxs)(H.a,{className:J.container_info,children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,style:{display:"inline-flex",alignItems:"center",height:"50px"},children:[Object(n.jsx)(we.a,{align:"left",children:Tt("certificateBadgeTemplate:diplomas-design.title-design")}),((null===I||void 0===I?void 0:I.nameTemplate)||(null===I||void 0===I?void 0:I.checkSaveTemplate))&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(we.a,{style:{fontWeight:"bold",margin:"0 3px 0 3px"},children:"/"}),Object(n.jsx)(we.a,{align:"left",style:{fontWeight:"bold"},children:"".concat((null===I||void 0===I?void 0:I.nameTemplate)||(null===I||void 0===I?void 0:I.nombre_plantilla))})]}),Object(n.jsx)(we.a,{style:{fontWeight:"bold",margin:"0 3px 0 3px"},children:M&&"/"}),Object(n.jsx)(we.a,{align:"left",style:{fontWeight:"bold"},children:"".concat((null===I||void 0===I?void 0:I.nameArchive)||(null===I||void 0===I?void 0:I.nombre_archivo)||"")}),Object(n.jsx)(tm.a,{orientation:"vertical",sx:{height:"25px",margin:"0 1rem 0 1rem",backgroundColor:"#000"}}),Object(n.jsx)("img",{src:km,style:0===ve?Qj.iconsButtonsActive:Qj.iconsButtons,alt:"textField",onClick:function(){return Wt(0,!0)}}),Object(n.jsx)(Bm.a,{sx:1===ve?Qj.iconsButtonsActive:Qj.iconsButtons,onClick:function(){return Wt(1,!0)}}),Object(n.jsx)(Tm.a,{sx:2===ve?Qj.iconsButtonsActive:Qj.iconsButtons,onClick:function(){return Wt(2,!0)}}),V&&Object(n.jsx)("img",{src:Am,style:3===ve?Qj.iconsButtonsActive:Qj.iconsButtons,alt:"Signatue",onClick:function(){return Wt(3,!0)}})]}),Object(n.jsx)(K.a,{title:Tt(V?Q?"buttons:buttons.edit":"menu:sign":M?"buttons:buttons.finish":"buttons:buttons.accept"),children:Object(n.jsx)(S.a,{className:J.buttonClose,disabled:G,onClick:Ft,children:Object(n.jsx)(Im.a,{})})}),M&&Object(n.jsx)(K.a,{title:Tt("tables:table.tooltip.edit-config"),children:Object(n.jsx)(S.a,{className:J.buttonClose,disabled:G,onClick:function(){void 0!==Te&&-1!==Te&&(A[Te].exampleText="".concat(A[Te].exampleText).concat(""===A[Te].exampleText?"":":","CK09aABbAz")),R(!1)},children:Object(n.jsx)(Uj.a,{})})}),Object(n.jsx)(K.a,{title:Tt("buttons:buttons.cancel"),children:Object(n.jsx)(S.a,{className:J.buttonClose,disabled:G,onClick:Ut,children:Object(n.jsx)(Xa.a,{})})})]})}),Object(n.jsxs)("div",{className:J.container,children:[Object(n.jsx)("div",{className:J.container__certificate,children:Object(n.jsx)(qj,{isSelected:et,setIsSelected:tt,selectedId:he,selectShape:function(e){if("X"===e)return E(Object(p.a)(A.filter((function(e){return e.fieldName!==he&&"deleteSign"!==e.fieldName&&"addSign"!==e.fieldName}))));if("+"===e){var t=A.findIndex((function(e){return"deleteSign"===e.fieldName})),a=A.findIndex((function(e){return"addSign"===e.fieldName})),n=A.filter((function(e){return e.fieldName.includes("signature")})),i=A.findIndex((function(e){return e.fieldName===he&&"deleteSign"!==e.fieldName&&"addSign"!==e.fieldName}));return A[i].y+A[i].height+20>(null===I||void 0===I?void 0:I.naturalWidthAndHeight[0].height)?(A.push(Object(m.a)(Object(m.a)({},A[i]),{},{y:A[i].y-A[i].height-20,fieldName:"".concat(A[i].fieldName.split("_")[0],"_").concat(n.length+1)})),A[t].y=A[t].y-A[i].height-20,A[a].y=A[a].y-A[i].height-20):(A.push(Object(m.a)(Object(m.a)({},A[i]),{},{y:A[i].y+A[i].height+20,fieldName:"".concat(A[i].fieldName.split("_")[0],"_").concat(n.length+1)})),A[t].y=A[t].y+A[i].height+20,A[a].y=A[a].y+A[i].height+20),ge("".concat(A[i].fieldName.split("_")[0],"_").concat(n.length+1)),E(Object(p.a)(A))}var r=A.find((function(t){return t.fieldName===e&&t.fieldName.includes("signature")})),c=A.find((function(e){return"deleteSign"===e.fieldName}));r&&!c&&(A.push(Object(m.a)(Object(m.a)({},r),{},{fieldType:41,fieldTypeConfig:52,fontSize:"18",fieldName:"deleteSign",exampleText:"X",x:r.x+20,y:r.y-20,width:23,height:32,fontStyle:{bold:1}})),A.push(Object(m.a)(Object(m.a)({},r),{},{fieldType:41,fieldTypeConfig:52,fontSize:"18",fieldName:"addSign",exampleText:"+",x:r.x+5,y:r.y-20,width:23,height:32,fontStyle:{bold:1}})),E(Object(p.a)(A))),c&&E(Object(p.a)(A.filter((function(e){return"deleteSign"!==e.fieldName&&"addSign"!==e.fieldName})))),e&&I.change_template&&0!==I.change_template?F.a.fire({customClass:{container:J.mySwal},icon:"info",text:Tt("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Tt("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(t){t.isConfirmed&&(ge(e),z(Object(m.a)(Object(m.a)({},I),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):ge(e)},stageRef:X,modifyField:Lt,handleChangePage:function(e,t){z(Object(m.a)(Object(m.a)({},I),{},{page:t}))},refField:it,setRefField:rt,modifiedFieldIndex:lt,setModifiedFieldIndex:dt,documentSigned:G})}),Object(n.jsx)("div",{className:J.container__fields,children:G?Object(n.jsx)(n.Fragment,{}):Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Vj,{openModal:function(e){I.change_template&&0!==I.change_template?F.a.fire({customClass:{container:J.mySwal},icon:"info",text:Tt("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Tt("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(e){e.isConfirmed&&(re(!0),z(Object(m.a)(Object(m.a)({},I),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):re(!0)},openModalSign:function(e){I.change_template&&0!==I.change_template?F.a.fire({customClass:{container:J.mySwal},icon:"info",text:Tt("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Tt("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(e){e.isConfirmed&&(le(!0),wt(0),z(Object(m.a)(Object(m.a)({},I),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):(wt(0),le(!0))},openModalSignatories:function(e){I.change_template&&0!==I.change_template?F.a.fire({customClass:{container:J.mySwal},icon:"info",text:Tt("alerts:alerts.new-templates-of-edited"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Tt("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(e){e.isConfirmed&&(be(!0),z(Object(m.a)(Object(m.a)({},I),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:""})))})):0===I.id_plantillas_documentos&&I.checkSaveTemplate?F.a.fire({customClass:{container:J.mySwal},icon:"info",text:Tt("alerts:alerts.signatories-no-template"),showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:Tt("alerts:alerts.yes-option"),cancelButtonText:"No"}).then((function(e){e.isConfirmed&&(be(!0),z(Object(m.a)(Object(m.a)({},I),{},{change_template:0,id_plantillas_documentos:0,nameTemplate:"",checkSaveTemplate:!1})))})):be(!0)},modifyField:Lt,signatures:pt,setSignatures:jt,fromCertify:M,fromSign:V,typeViewFields:ve})})})]}),Object(n.jsxs)(O.a,{open:ie,onClose:It,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",className:!De&&function(e){var t=as(e);return t.r>230&&t.g>230&&t.b>230?J.dialog__title:""}(null===(r=Be.fontColor)||void 0===r?void 0:r.hex),style:De?{backgroundColor:null===Be||void 0===Be||null===(c=Be.rectColor)||void 0===c?void 0:c.hex}:{},children:Object(n.jsx)(we.a,{style:{fontSize:"".concat(Be.fontSize||18,"px"),color:null===(o=Be.fontColor)||void 0===o?void 0:o.hex,fontFamily:null===(s=Be.fontFamily)||void 0===s?void 0:s.family,fontWeight:(null===(l=Be.fontStyle)||void 0===l?void 0:l.bold)?"bold":"",fontStyle:(null===(u=Be.fontStyle)||void 0===u?void 0:u.italic)?"italic":"",textDecoration:"".concat((null===(j=Be.fontStyle)||void 0===j?void 0:j.underline)?"underline":""," ").concat((null===(g=Be.fontStyle)||void 0===g?void 0:g.strikethrough)?"line-through":""),textAlign:null===Be||void 0===Be?void 0:Be.align},children:Ie?"".concat(Be.exampleText).concat(""===Be.exampleText?"":":","CK09aABbAz"):De?"Verificar":Be.exampleText||Tt("certificateBadgeTemplate:certificate-design.example")})}),Object(n.jsx)(_.a,{dividers:!0,className:De&&J.fieldButtonDisabled,children:Object(n.jsxs)("div",{className:J.content_modal,children:[Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:certificate-design.type-config-field"),"*"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(T.a,{name:"fieldTypeConfig",value:Be.fieldTypeConfig,onChange:Rt,disabled:!("certificateCode"!==Be.fieldName&&!M),children:Je.map((function(e,t){return Object(n.jsx)(Y.a,{value:e.id,children:Object(n.jsx)("em",{children:e.value})},"field-type-option".concat(t))}))})}),52===Be.fieldTypeConfig&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:certificate-design.name-field"),"*"]}),Object(n.jsx)("input",{type:"text",name:"fieldName",value:Be.fieldName||"",onChange:Rt,disabled:"certificateCode"===Be.fieldName}),Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:certificate-design.type-field"),"*"]}),Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(T.a,{name:"fieldType",value:Be.fieldType,onChange:Rt,disabled:"certificateCode"===Be.fieldName,children:Ke.map((function(e,t){return Object(n.jsx)(Y.a,{value:e.id,children:Object(n.jsx)("em",{children:e.value})},"field-type-option".concat(t))}))})})]}),Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:documents-design.field"),"*"]}),Object(n.jsx)(uo.a,{type:"text",name:"exampleText",value:Be.exampleText||"",onChange:Ie?function(e){ts(e)&&Se(Object(m.a)(Object(m.a)({},Be),{},Object(b.a)({},e.target.name,e.target.value)))}:Rt,endAdornment:Object(n.jsx)(Rn.a,{position:"end",children:Ie?"".concat(""===Be.exampleText?"":":","CK09aABbAz"):""})}),52===Be.fieldTypeConfig&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:certificate-design.align-letter"),"*"]}),Object(n.jsxs)("div",{children:[Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(um.a,{}),checkedIcon:Object(n.jsx)(um.a,{}),name:"align",value:"center",checked:"center"===Be.align,onChange:Rt}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(bm.a,{}),checkedIcon:Object(n.jsx)(bm.a,{}),name:"align",value:"left",checked:"left"===(null===Be||void 0===Be?void 0:Be.align),onChange:Rt}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(jm.a,{}),checkedIcon:Object(n.jsx)(jm.a,{}),name:"align",value:"right",checked:"right"===(null===Be||void 0===Be?void 0:Be.align),onChange:Rt})]})]}),Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:certificate-design.font"),"*"]}),Object(n.jsx)(Xo,{name:"fontFamily",value:Be.fontFamily||null,placeholder:"Selecciona un tipo de letra",options:We,getOptionLabel:function(e){return e.family},getOptionSelected:function(e){return e.family},onChange:function(e,t){return function(e){if((null===e||void 0===e?void 0:e.family)&&!Me.includes(e.family)){var t=[].concat(Object(p.a)(Me),[e.family]);Le(t),vo.a.load({google:{families:[e.family]},active:function(){Se(Object(m.a)(Object(m.a)({},Be),{},{fontFamily:e}))}})}else Se(Object(m.a)(Object(m.a)({},Be),{},{fontFamily:e}))}(t)}}),Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:certificate-design.size-letter"),"*"]}),Object(n.jsx)("input",{type:"number",name:"fontSize",value:Be.fontSize||"",onChange:Rt,onKeyUp:lo}),Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:certificate-design.style-letter"),"*"]}),Object(n.jsxs)("div",{children:[Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(nm.a,{}),checkedIcon:Object(n.jsx)(nm.a,{}),name:"bold",checked:null===Be||void 0===Be||null===(x=Be.fontStyle)||void 0===x?void 0:x.bold,onChange:function(e){return zt(Object(m.a)(Object(m.a)({},Be.fontStyle),{},{bold:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(rm.a,{}),checkedIcon:Object(n.jsx)(rm.a,{}),name:"italic",checked:null===Be||void 0===Be||null===(y=Be.fontStyle)||void 0===y?void 0:y.italic,onChange:function(e){return zt(Object(m.a)(Object(m.a)({},Be.fontStyle),{},{italic:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(om.a,{}),checkedIcon:Object(n.jsx)(om.a,{}),name:"underline",checked:null===Be||void 0===Be||null===(w=Be.fontStyle)||void 0===w?void 0:w.underline,onChange:function(e){return zt(Object(m.a)(Object(m.a)({},Be.fontStyle),{},{underline:e.target.checked}))}}),Object(n.jsx)(Hi.a,{icon:Object(n.jsx)(lm.a,{}),checkedIcon:Object(n.jsx)(lm.a,{}),name:"strikethrough",checked:null===Be||void 0===Be||null===(C=Be.fontStyle)||void 0===C?void 0:C.strikethrough,onChange:function(e){return zt(Object(m.a)(Object(m.a)({},Be.fontStyle),{},{strikethrough:e.target.checked}))}})]}),Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:certificate-design.colour"),"*"]}),Object(n.jsx)(wo,{color:(null===(k=Be.fontColor)||void 0===k?void 0:k.hex)||"#000000",changeColor:Pt})]})}),Object(n.jsx)(_.a,{dividers:!0,className:!De&&J.fieldButtonDisabled,children:Object(n.jsxs)("div",{className:J.content_modal,children:[Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:certificate-design.colour-text"),"*"]}),Object(n.jsx)(wo,{color:(null===(N=Be.fontColor)||void 0===N?void 0:N.hex)||"#000000",changeColor:Pt}),Object(n.jsxs)("p",{children:[Tt("certificateBadgeTemplate:certificate-design.colour-background"),"*"]}),Object(n.jsx)(wo,{color:(null===(B=Be.rectColor)||void 0===B?void 0:B.hex)||"#000000",changeColor:function(e){Se(Object(m.a)(Object(m.a)({},Be),{},{rectColor:M?{hex:e.hex}:e}))}})]})}),Object(n.jsxs)(Ae.a,{children:[Object(n.jsx)(es,{color:"primary",variant:"contained",onClick:function(){if(function(){var e,t,a;return!Ie&&!De&&(!(null===(e=Be.exampleText)||void 0===e?void 0:e.length)>0||!Be.fontSize>0||!Be.fontFamily||52===Be.fieldTypeConfig&&(!(null===(t=Be.fieldName)||void 0===t?void 0:t.length)>0||!(null===(a=Be.exampleText)||void 0===a?void 0:a.length)>0||!Be.fontSize>0||!Be.fontFamily||!Be.fieldType))}())return F.a.fire({icon:"info",text:Tt("alerts:alerts.certificate-all-fields"),showConfirmButton:!1,timer:1500,customClass:{container:J.sweetModal}});if(Ie&&(Be.exampleText=Be.exampleText.trim()),!(Be.index>=0))A.push(Object(m.a)(Object(m.a)({},Be),{},{page:null===I||void 0===I?void 0:I.page,width:"auto",height:null===Be||void 0===Be?void 0:Be.fontSize})),rt(null);else{var e=Be.index;delete Be.index,A[e]=Be,!De&&dt(e)}ge(Be.exampleText),!De&&tt(51!==Be.fieldTypeConfig),E(Object(p.a)(A)),Se({fieldType:41,fieldTypeConfig:51,exampleText:"",fieldName:"",align:"center",fontColor:{hex:"#000000"},fontSize:"18",fontFamily:{family:"ABeeZee",files:{italic:"http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf",regular:"http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf"}},fontStyle:{bold:0,italic:0,underline:0,strikethrough:0},x:50,y:50,width:0,height:0}),re(!1)},children:Tt("buttons:buttons.save")}),Object(n.jsx)(es,{color:"primary",variant:"contained",onClick:It,children:Tt("buttons:buttons.close")})]})]}),Object(n.jsx)(O.a,{open:se,fullWidth:!0,maxWidth:"sm",children:Object(n.jsxs)(_.a,{children:[Object(n.jsxs)(Dr.a,{value:yt,onChange:function(e,t){wt(t)},indicatorColor:"secondary",textColor:"secondary",variant:"fullWidth",children:[Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:Tt("buttons:buttons.draw")}),Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:Tt("buttons:buttons.write")}),Object(n.jsx)(zr.a,{style:{fontWeight:"bold"},label:Tt("buttons:buttons.upload")})]}),Object(n.jsxs)(ye.a,{container:!0,children:[0===yt&&Object(n.jsx)(tb,{closeModalSign:Dt,saveSign:Mt,progressBar:Nt,emailUser:L.correo}),1===yt&&Object(n.jsx)(rb,{closeModalSign:Dt,saveSign:Mt,progressBar:Nt,nameUser:"".concat(L.data_user.primer_nombre," ").concat(L.data_user.primer_apellido),emailUser:L.correo,fontsFamilys:ze}),2===yt&&Object(n.jsx)(lb,{closeModalSign:Dt,saveSign:Mt,progressBar:Nt,emailUser:L.correo})]})]})}),Object(n.jsx)(O.a,{open:me,fullWidth:!0,maxWidth:"lg",children:Object(n.jsx)(_.a,{children:Object(n.jsx)(ub,{closeModalSignatories:function(){be(!1)},emailCurrent:null===L||void 0===L?void 0:L.correo,diplomaFields:A,setDiplomaFields:E,signatories:gt,setSignatories:xt,formDiplomas:I})})}),Object(n.jsx)(_t,{loading:ee})]})}));var Zj=r.a.forwardRef((function(e,t){return Object(n.jsx)(k.a,Object(m.a)({direction:"up",ref:t},e))})),$j=Object(C.a)((function(e){return{root:{marginTop:"1em"},input:{display:"none"},avatar:{width:"auto",height:"auto","&:hover":{cursor:"pointer"}},icon:{margin:20,fontSize:"4em"},card:{backgroundColor:E.a.background},fieldCard:{backgroundColor:"#ffffff"},contentInput:Object(b.a)({marginTop:"1em",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},e.breakpoints.up("lg"),{display:"block",alignItems:"left"}),text:Object(b.a)({display:"flex"},e.breakpoints.up("lg"),{display:"block"}),autocomplete:{width:590,"& > * + *":{marginTop:e.spacing(3)},marginBottom:10},skills:{whiteSpace:"normal"},chip:{height:"100%",marginBottom:"0.5em"},img:function(e){var t,a,n,i,r,c;return{maxWidth:"70vw",height:(null===(t=e.formDiplomas)||void 0===t?void 0:t.img_prev)&&"blob"===(null===(a=e.formDiplomas)||void 0===a||null===(n=a.img_prev[0])||void 0===n?void 0:n.split(":",1)[0])?null===(i=e.imageRef)||void 0===i||null===(r=i.current)||void 0===r?void 0:r.naturalHeight:null===(c=e.formDiplomas)||void 0===c?void 0:c.height}},buttonForm:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}},buttonDialog:{margin:"0.5em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 40px","&:hover":{backgroundColor:E.a.secondary}},mySwal:{zIndex:3e3},button:{borderRadius:5}}})),ef={setDiplomaFields:I.s,changeBreadcrump:I.a,setFormDiplomas:I.x,setSaveDesign:I.D},tf=Object(s.b)((function(e){var t;return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,formDiplomas:e.formDiplomas?Object(m.a)(Object(m.a)({},e.formDiplomas),{},{activities:(null===(t=e.formDiplomas.activities)||void 0===t?void 0:t.length)>0?e.formDiplomas.activities:[{index:1}]}):{activities:[{index:1}],skills:[]},diplomaFields:e.diplomaFields,returnRoute:e.returnRoute,saveDesign:e.saveDesign}}),ef)((function(e){var t,a,r,c,o,s=e.user,l=e.organizationId,j=e.formDiplomas,v=e.returnRoute,y=e.setFormDiplomas,w=e.diplomaFields,C=e.setDiplomaFields,k=e.changeBreadcrump,N=e.saveDesign,B=e.setSaveDesign,S=Object(u.g)(),A=$j({formDiplomas:j}),E=Object(i.useRef)(),I=Object(i.useState)(!1),P=Object(d.a)(I,2),R=P[0],M=P[1],L=Object(i.useState)(),U=Object(d.a)(L,2),q=U[0],H=U[1],V=Object(i.useState)([]),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)([]),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)([]),ne=Object(d.a)(te,2),ie=ne[0],re=ne[1],ce=Object(i.useState)([]),oe=Object(d.a)(ce,2),le=oe[0],de=oe[1],ue=Object(i.useState)([]),me=Object(d.a)(ue,2),be=me[0],pe=me[1],he=Object(i.useState)([]),ge=Object(d.a)(he,2),xe=ge[0],Oe=ge[1],ke=Object(i.useState)([]),Ne=Object(d.a)(ke,2),Be=Ne[0],Se=Ne[1],Ee=Object(i.useState)([]),De=Object(d.a)(Ee,2),ze=De[0],Re=De[1],Me=Object(i.useState)(!1),Le=Object(d.a)(Me,2),Fe=Le[0],Ue=Le[1],We=Object(i.useState)(!1),Ye=Object(d.a)(We,2),qe=Ye[0],He=Ye[1],Ke=Object(i.useState)(!1),Ve=Object(d.a)(Ke,2),Ge=Ve[0],Qe=Ve[1],Je=Object(i.useState)({}),Xe=Object(d.a)(Je,2),Ze=Xe[0],$e=Xe[1],et=!!e.match.params.id,tt=1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,at=Pe()("certika-organization-".concat(tt?1:l)).toString(),nt=Pe()("certika-user-".concat(tt?1:null===s||void 0===s||null===(t=s.data_user)||void 0===t?void 0:t.id)).toString(),it=Object(D.a)(["alerts","certificateBadgeTemplate","buttons","dialogs","selects","breadCrumps","tables"]),rt=Object(d.a)(it,1)[0],ot="en"===(null===(a=window.localStorage.state)||void 0===a||null===(r=a.split('"lenguage":"')[1])||void 0===r?void 0:r.slice(0,2));Object(i.useEffect)((function(){lt()}),[]);var st,lt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,M(!0),e.next=4,ut();case 4:return e.next=6,bt();case 6:return e.next=8,pt();case 8:return e.next=10,jt();case 10:return e.next=12,ft();case 12:return e.next=14,ht();case 14:return e.next=16,gt();case 16:if(!et){e.next=23;break}return e.next=19,xt();case 19:k(rt("breadCrumps:breadCrumps.diploma-template-edit",{returnObjects:!0})),B(!0),e.next=25;break;case 23:y(Object(m.a)(Object(m.a)({},j),{},{img_prev:(null===j||void 0===j?void 0:j.img_prev)&&"blob"===(null===j||void 0===j||null===(t=j.img_prev[0])||void 0===t?void 0:t.split(":",1)[0])?null:j.img_prev,id_organizaciones:1!==s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?l:"",id_usuarios:null===(a=s.data_user)||void 0===a?void 0:a.id,page:1})),k(rt("breadCrumps:breadCrumps.diploma-template-create",{returnObjects:!0}));case 25:M(!1),e.next=31;break;case 28:e.prev=28,e.t0=e.catch(0),S.push("/500");case 31:case"end":return e.stop()}}),e,null,[[0,28]])})));return function(){return e.apply(this,arguments)}}(),dt=1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,ut=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/hability/getHabilities");case 2:t=e.sent,a=t.data,Oe(a.habilities.rows);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),bt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTypes");case 2:t=e.sent,a=t.data,J(a.types);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:t=e.sent,a=t.data,ee(a.levels);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),jt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:t=e.sent,a=t.data,re(a.costs);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ft=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:t=e.sent,a=t.data,de(a.time);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ht=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTypeCriteria");case 2:t=e.sent,a=t.data,pe(a.typeCriteria);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),gt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!dt){e.next=8;break}return e.next=3,Ce.a.post("/organization/getOrganizations");case 3:t=e.sent,a=t.data,Se(a.organizations.rows),e.next=13;break;case 8:return e.next=10,Ce.a.get("/organization/".concat(l));case 10:n=e.sent,i=n.data,Se(i.organization.organizations);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),xt=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,l,d,u,b,p,j,h,g,x,O;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,d=Object(Ie.a)(e.match.params.id),t.next=4,Ce.a.get("/diplomaTemplate/".concat(d));case 4:u=t.sent,b=u.data,p=b.diplomaTemplate,j=p.diplomaTemplate,h=p.criterion,g=p.skillsTemplate,x=p.linkPhoto,O=p.linkPhotoTemplate,Re(null===(a=b.diplomaTemplate)||void 0===a||null===(n=a.diplomaTemplate)||void 0===n?void 0:n.diplomasEmitidos),C(null===(i=b.diplomaTemplate)||void 0===i||null===(r=i.diplomaTemplate)||void 0===r?void 0:r.diplomaCampos.map((function(e){return{id:e.id,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fieldName:e.nombre,align:e.formato_letra?e.formato_letra:"center",fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontSize:e.tamano_letra,fontFamily:{family:e.tipo_letra},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseFloat(e.x),y:parseFloat(e.y),width:0===e.width?430:e.width,height:0===e.height?e.tamano_letra:e.height,page:e.page}}))),null===(c=b.diplomaTemplate)||void 0===c||(null===(o=c.diplomaTemplate)||void 0===o||delete o.diplomaCampos),y(Object(m.a)(Object(m.a)({},j),{},{img_prev:x,img_template:O,id_usuarios:null===(l=s.data_user)||void 0===l?void 0:l.id,skills:g.map((function(e,t){return{index:t,id:e.id,id_habilidades:e.id_habilidades,id_plantillas_diplomas:e.id_plantillas,descripcion:e.habilidades.descripcion}})),activities:h.map((function(e,t){return{index:t,id:e.id,tipo_criterio_vp:e.tipo_criterio_vp,descripcion_criterio:e.descripcion_criterio,link:e.link}})),estado:j.estado,page:1})),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(0),S.push("/500");case 16:case"end":return t.stop()}}),t,null,[[0,13]])})));return function(){return t.apply(this,arguments)}}(),Ot=function(){return!(0===ze||!e.match.params.id)},vt=function(e){y(Object(m.a)(Object(m.a)({},j),{},Object(b.a)({},e.target.name,e.target.value)))},yt=function(e,t){var a;null===(a=j.activities)||void 0===a||a.map((function(a){return a.index===t&&(a[e.target.name]=e.target.value),a})),y(Object(m.a)(Object(m.a)({},j),{},{activities:j.activities}))},wt=function(){y(null),C(null),S.push(v)},Ct=function(e){return!(e>1)&&(j.cantidad_tiempo=null,!0)},kt=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a,n,i,r,c,o,s,d,u,b,p,h,g,x,O,v,_,k,N,B,S,T,A,I,D,z,P,R,L,U,W,Y,H,K,V;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!!j.img_prev){e.next=3;break}return e.abrupt("return",F.a.fire({icon:"info",text:rt("alerts:alerts.template-certificate-alert"),showConfirmButton:!1,timer:1500}));case 3:if(r=Pe()("certika-organization-".concat(l)).toString(),c=!(!q||!(null===q||void 0===q||null===(t=q.imagen[0])||void 0===t?void 0:t.name)),o="blob"===(null===j||void 0===j||null===(a=j.img_prev[0])||void 0===a?void 0:a.split(":",1)[0]),s=(null===(n=E.current)||void 0===n?void 0:n.naturalWidth)>(null===(i=E.current)||void 0===i?void 0:i.naturalHeight),d=j.width>j.height,!c){e.next=48;break}if(!(o&&s&&((null===(u=E.current)||void 0===u?void 0:u.naturalWidth)>950||(null===(b=E.current)||void 0===b?void 0:b.naturalHeight)>700||(null===(p=E.current)||void 0===p?void 0:p.naturalWidth)<750||(null===(h=E.current)||void 0===h?void 0:h.naturalHeight)<550))){e.next=11;break}return e.abrupt("return",F.a.fire({icon:"info",text:rt("alerts:alerts.horizontal-certificates"),showConfirmButton:!0}));case 11:if(!o||s||!((null===(g=E.current)||void 0===g?void 0:g.naturalWidth)>668||(null===(x=E.current)||void 0===x?void 0:x.naturalHeight)>900||(null===(O=E.current)||void 0===O?void 0:O.naturalWidth)<420||(null===(v=E.current)||void 0===v?void 0:v.naturalHeight)<690)){e.next=13;break}return e.abrupt("return",F.a.fire({icon:"info",text:rt("alerts:alerts.vertical-certificates"),showConfirmButton:!0}));case 13:if(o||!d||!(j.width>950||j.height>700||j.width<750||j.height<550)){e.next=15;break}return e.abrupt("return",F.a.fire({icon:"info",text:rt("alerts:alerts.horizontal-certificates"),showConfirmButton:!0}));case 15:if(o||d||!(j.width>668||j.height>900||j.width<420||j.height<690)){e.next=17;break}return e.abrupt("return",F.a.fire({icon:"info",text:rt("alerts:alerts.vertical-certificates"),showConfirmButton:!0}));case 17:N=1;case 18:if(!(N<j.img_prev.length)){e.next=24;break}if((null===q||void 0===q||null===(B=q.elements[0])||void 0===B?void 0:B.naturalWidth)===(null===q||void 0===q||null===(S=q.elements[N])||void 0===S?void 0:S.naturalWidth)&&(null===q||void 0===q||null===(T=q.elements[0])||void 0===T?void 0:T.naturalHeight)===(null===q||void 0===q||null===(A=q.elements[N])||void 0===A?void 0:A.naturalHeight)){e.next=21;break}return e.abrupt("return",F.a.fire({icon:"error",text:rt("alerts:alerts.no-equals-format"),showConfirmButton:!0}));case 21:N++,e.next=18;break;case 24:M(!0),I=0;case 26:if(!(I<j.img_prev.length)){e.next=35;break}return(D=new FormData).append("file",null===q||void 0===q?void 0:q.imagen[I]),D.append("route","".concat(r,"/diplomasTemplate/diplomas-temp/temp").concat((null===j||void 0===j?void 0:j.pages)>1?I:"")),e.next=32,ct()({method:"post",url:"".concat(je.a.apiURL,"/file/upload-diploma"),headers:{"Content-Type":"multipart/form-data"},data:D});case 32:I++,e.next=26;break;case 35:!(null===w||void 0===w?void 0:w.length)>0&&(z=so(),P=z.dataQr,R=z.dataImg,L=z.dataCode,U=z.dataButtonVerify,C([P,R,L,U])),W=[],Y=0;case 38:if(!(Y<j.img_prev.length)){e.next=47;break}return e.next=41,Ce.a.post("/file/getFile",{keyFile:"".concat(r,"/diplomasTemplate/diplomas-temp/temp").concat((null===j||void 0===j?void 0:j.pages)>1?Y:""),headers:{"Content-Type":"multipart/form-data"}});case 41:H=e.sent,K=H.data,W.push(null===K||void 0===K?void 0:K.url);case 44:Y++,e.next=38;break;case 47:y(Object(m.a)(Object(m.a)({},j),{},{img_prev:W,width:null===(_=E.current)||void 0===_?void 0:_.naturalWidth,height:null===(k=E.current)||void 0===k?void 0:k.naturalHeight}));case 48:void 0!==(V=null===w||void 0===w?void 0:w.findIndex((function(e){return"certificateCode"===e.fieldName})))&&-1!==V&&(w[V].exampleText=w[V].exampleText.includes(":")?w[V].exampleText.split(":")[0]:""),He(!0),M(!1);case 52:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Nt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i,r,c;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),!!j.img_prev){e.next=4;break}return e.abrupt("return",F.a.fire({icon:"info",text:rt("alerts:alerts.template-certificate-alert"),showConfirmButton:!1,timer:1500}));case 4:if((null===w||void 0===w?void 0:w.length)>0){e.next=7;break}return e.abrupt("return",F.a.fire({icon:"info",text:rt("alerts:alerts.no-design-certificate"),showConfirmButton:!1,timer:1500}));case 7:if(N){e.next=9;break}return e.abrupt("return",F.a.fire({icon:"info",text:rt("alerts:alerts.no-accepted-design-certificate"),showConfirmButton:!1,timer:1500}));case 9:if(a=!j.id,M(!0),delete j.img_template,e.prev=12,!a){e.next=18;break}return e.next=16,Ce.a.post("/diplomaTemplate",Object(m.a)(Object(m.a)({},j),{},{criterios:j.activities,id_habilidades:j.skills,width:null===(n=E.current)||void 0===n?void 0:n.naturalWidth,height:null===(i=E.current)||void 0===i?void 0:i.naturalHeight,diplomaFields:w}));case 16:e.next=20;break;case 18:return e.next=20,Ce.a.put("/diplomaTemplate/".concat(j.id),Object(m.a)(Object(m.a)({},j),{},{criterios:j.activities,id_habilidades:j.skills,width:null===(r=E.current)||void 0===r?void 0:r.naturalWidth,height:null===(c=E.current)||void 0===c?void 0:c.naturalHeight,diplomaFields:w}));case 20:e.next=26;break;case 22:return e.prev=22,e.t0=e.catch(12),M(!1),e.abrupt("return",F.a.fire({icon:"error",text:rt("alerts:alerts.error-ocurred"),showConfirmButton:!1,timer:1500}));case 26:M(!1),F.a.fire({icon:"success",text:rt("alerts:alerts.saved"),showConfirmButton:!1,timer:1500}).then((function(){a?S.push("/diplomas/templates/edited"):S.push(v),y(null),C(null)}));case 28:case"end":return e.stop()}}),e,null,[[12,22]])})));return function(t){return e.apply(this,arguments)}}(),Bt=function(){Ue(!1)},St=function(){Qe(!1)};return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{create:"false"}),Object(n.jsx)(ve.a,{className:"m-0 w-100 p-0 border-0",children:Object(n.jsx)(_e.a,{className:"p-3",children:Object(n.jsxs)("form",{className:A.root,onSubmit:Nt,children:[Object(n.jsx)(we.a,{component:"h6",variant:"h6",children:rt("certificateBadgeTemplate:badges-certificate-form.details-diploma")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:A.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:[Object(n.jsx)(K.a,{title:rt("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{imgProps:{ref:E},alt:"img-prev",src:(null===j||void 0===j?void 0:j.img_template)?null===j||void 0===j?void 0:j.img_template[(null===j||void 0===j?void 0:j.page)-1]:(null===j||void 0===j?void 0:j.img_prev)?null===j||void 0===j?void 0:j.img_prev[(null===j||void 0===j?void 0:j.page)-1]:null,variant:"rounded",className:A.avatar,onClick:function(){return Ue(!!(null===j||void 0===j?void 0:j.img_prev))},children:Object(n.jsx)(se.a,{sx:{margin:4,fontSize:"4em"}})})}),Object(n.jsx)(Lt.a,{component:"span",display:"flex",justifyContent:"center",children:Object(n.jsx)(ta.a,{color:"secondary",count:(null===j||void 0===j?void 0:j.pages)||0,page:(null===j||void 0===j?void 0:j.page)||1,onChange:function(e,t){y(Object(m.a)(Object(m.a)({},j),{},{page:t}))},size:"small"})})]})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:8,children:[Object(n.jsxs)(we.a,{variant:"body2",children:[rt("certificateBadgeTemplate:badges-certificate-form.diploma-img"),Object(n.jsx)("br",{}),rt("certificateBadgeTemplate:badges-certificate-form.diploma-img-max-file"),Object(n.jsx)("br",{}),rt("certificateBadgeTemplate:badges-certificate-form.diploma-recommended-size"),Object(n.jsx)("b",{children:rt("certificateBadgeTemplate:badges-certificate-form.horizontal")}),rt("certificateBadgeTemplate:badges-certificate-form.least"),Object(n.jsx)("b",{children:"950 x 660 "}),rt("certificateBadgeTemplate:badges-certificate-form.pixels"),Object(n.jsx)("br",{}),rt("certificateBadgeTemplate:badges-certificate-form.diplomas"),Object(n.jsxs)("b",{children:[rt("certificateBadgeTemplate:badges-certificate-form.vertical")," 668 x 890 "]}),rt("certificateBadgeTemplate:badges-certificate-form.pixels")]}),Object(n.jsxs)("div",{className:A.contentInput,children:[Object(n.jsx)("input",{multiple:!0,accept:"image/*",className:A.input,id:"contained-button-file",name:"imagen",type:"file",onChange:function(e){return function(e){var t=e.target.files;if(t.length>3)return F.a.fire({icon:"error",text:rt("alerts:alerts.max-template-certificate-alert"),showConfirmButton:!0});if(t.length>0){for(var a=[],n=[],i=0;i<t.length;i++){var r=URL.createObjectURL(t[i]);a.push(r);var c=document.createElement("img");c.src=r,n.push(c)}H({imagen:t,elements:n}),y(Object(m.a)(Object(m.a)({},j),{},{img_prev:a,img_template:null,imagen:"newImage",pages:a.length,page:1})),w&&C(w.map((function(e){return Object(m.a)(Object(m.a)({},e),{},{x:50,y:50})}))),B(!1)}}(e)},disabled:Ot()}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,children:Object(n.jsx)("label",{htmlFor:"contained-button-file",children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",component:"span",disabled:Ot(),children:rt("buttons:buttons.upload-image")})})}),Object(n.jsx)(ye.a,{item:!0,children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",component:"span",disabled:Ot(),onClick:kt,children:rt("buttons:buttons.design-diploma")})})]})]})]})]}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:A.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:A.text,align:"right",children:[rt("certificateBadgeTemplate:badges-certificate-form.diploma-public-name"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:Ot(),required:!0,label:"",name:"nombre",variant:"outlined",size:"small",onChange:vt,value:null===j||void 0===j?void 0:j.nombre})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:A.text,align:"right",children:[rt("certificateBadgeTemplate:badges-certificate-form.diploma-private-name"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"",name:"nombre_privado",variant:"outlined",size:"small",onChange:vt,value:null===j||void 0===j?void 0:j.nombre_privado})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsxs)(we.a,{variant:"body1",className:A.text,align:"right",children:[rt("certificateBadgeTemplate:badges-certificate-form.description"),"*"]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:Ot(),required:!0,label:"",name:"descripcion",variant:"outlined",size:"small",multiline:!0,rows:4,value:null===j||void 0===j?void 0:j.descripcion,onChange:vt})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:A.text,align:"right",children:rt("certificateBadgeTemplate:badges-certificate-form.additional")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:Ot(),label:"",name:"url",variant:"outlined",size:"small",placeholder:"http://",onChange:vt,value:null===j||void 0===j?void 0:j.url,type:"url"})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:A.text,align:"right",children:rt("certificateBadgeTemplate:badges-certificate-form.skills")})}),Object(n.jsxs)(ye.a,{item:!0,xs:12,lg:8,children:[Object(n.jsx)(mt.a,{children:Object(n.jsx)(oo.a,{disabled:Ot(),multiple:!0,disableClearable:!0,freeSolo:!0,className:A.autocomplete,onChange:function(e,t){return function(e,t){y(Object(m.a)(Object(m.a)({},j),{},{skills:[].concat(Object(p.a)(j.skills),[t.pop()])})),Oe(xe.filter((function(t){return t.descripcion.trim()!==e.target.innerText})))}(e,t)},options:xe.sort((function(e,t){return e.descripcion.trim()<t.descripcion.trim()?-1:1})).map((function(e){return{id_habilidades:e.id,descripcion:e.descripcion}})),getOptionLabel:function(e){return e.descripcion},renderTags:function(){return null},renderInput:function(e){return Object(n.jsx)(Te.a,Object(m.a)(Object(m.a)({},e),{},{multiline:!0,variant:"outlined",label:rt("selects:selects-autocompletes.skill-select")}))}})}),(null===j||void 0===j||null===(c=j.skills)||void 0===c?void 0:c.length)>0?Object(n.jsx)(ve.a,{variant:"outlined",className:A.card,children:Object(n.jsx)(_e.a,{children:j.skills.map((function(e,t){return Object(n.jsx)(ye.a,{children:Object(n.jsx)(fe.a,{disabled:Ot(),onDelete:function(){return function(e){y(Object(m.a)(Object(m.a)({},j),{},{skills:null===j||void 0===j?void 0:j.skills.filter((function(t){return t!==e}))})),e.id_habilidades&&Oe([].concat(Object(p.a)(xe),[e]))}(e)},onClick:function(){return function(e,t){"string"===typeof e&&(Qe(!0),$e({value:e,index:t}))}(e,t)},variant:"outlined",label:Object(n.jsx)(we.a,{className:A.skills,children:"string"===typeof e?e:e.descripcion}),className:A.chip})},"skill-chip-".concat(t))}))})}):""]}),1===s.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:A.text,align:"right",children:rt("certificateBadgeTemplate:badges-certificate-form.organization")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"organizacion",name:"id_organizaciones",value:j.id_organizaciones||"",disabled:Ot(),onChange:vt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:rt("selects:selects-autocompletes.select-option")})}),Be.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},"organization-".concat(e.id))}))]})})})]}),(null===Be||void 0===Be||null===(o=Be.organizacionesRelaciones)||void 0===o?void 0:o.length)>0&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:A.text,align:"right",children:rt("certificateBadgeTemplate:badges-certificate-form.organization")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{required:!0,variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{disabled:Ot(),id:"organizacion",name:"id_organizacion_hija",onChange:vt,value:j.id_organizacion_hija,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:rt("selects:selects-autocompletes.select-option")})}),(null===Be||void 0===Be?void 0:Be.organizacionesRelaciones.map((function(e){return e.organizacionesRelacionadas}))).map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:z(e.nombre)},e.id)}))]})})})]})]}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:A.root,children:rt("certificateBadgeTemplate:badges-certificate-form.criteria-diploma-title")}),j.activities.map((function(e,t){var a;return Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:A.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",className:A.text,align:"right",children:"".concat(rt("certificateBadgeTemplate:badges-certificate-form.criterion")," ").concat(t+1)})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsxs)(ve.a,{variant:"outlined",className:A.card,children:[Object(n.jsxs)(_e.a,{children:[Object(n.jsx)(we.a,{variant:"body1",align:"left",children:"".concat(rt("certificateBadgeTemplate:badges-certificate-form.type")).concat(e.descripcion_criterio?"*":"")}),Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100 ".concat(A.fieldCard),size:"small",children:Object(n.jsxs)(T.a,{name:"tipo_criterio_vp",value:e.tipo_criterio_vp||"",required:!!e.descripcion_criterio,disabled:Ot(),onChange:function(t){return yt(t,e.index)},children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:rt("selects:selects-autocompletes.select-option")})}),be.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:ot?e.valor_parametro_en:e.valor_parametro},"type-criteria-".concat(e.id))}))]})}),Object(n.jsx)(we.a,{variant:"body1",align:"left",className:A.root,children:"".concat(rt("certificateBadgeTemplate:badges-certificate-form.description")).concat(e.tipo_criterio_vp?"*":"")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!!e.tipo_criterio_vp,disabled:Ot(),name:"descripcion_criterio",variant:"outlined",size:"small",multiline:!0,value:e.descripcion_criterio||"",rows:4,onChange:function(t){return yt(t,e.index)},className:A.fieldCard})}),Object(n.jsx)(we.a,{variant:"body1",align:"left",className:A.root,children:rt("certificateBadgeTemplate:badges-certificate-form.criterion-url")}),Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{disabled:Ot(),type:"url",name:"link",variant:"outlined",size:"small",placeholder:"http://",value:e.link||"",onChange:function(t){return yt(t,e.index)},className:A.fieldCard})})]}),Object(n.jsx)(wc.a,{children:(null===(a=j.activities)||void 0===a?void 0:a.length)>0&&Object(n.jsx)(x.a,{disabled:Ot(),size:"small",onClick:function(t){return function(e,t){var a,n;a=0===j.activities.length?[{index:1}]:null===(n=j.activities)||void 0===n?void 0:n.filter((function(e){return e.index!==t})),y(Object(m.a)(Object(m.a)({},j),{},{activities:a}))}(0,e.index)},children:Object(n.jsxs)(we.a,{color:"textSecondary",variant:"body2",children:[Object(n.jsx)(ae.a,{}),rt("buttons:buttons.delete")]})})})]})})]},"grid-activity-".concat(t))})),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(x.a,{variant:"outlined",color:"primary",onClick:function(){var e,t=j.activities[(null===(e=j.activities)||void 0===e?void 0:e.length)-1];y(Object(m.a)(Object(m.a)({},j),{},{activities:[].concat(Object(p.a)(j.activities),[{index:t.index+1}])}))},disabled:Ot(),children:rt("buttons:buttons.add-criterion")})})]}),Object(n.jsx)(W.a,{}),Object(n.jsx)(we.a,{component:"h6",variant:"h6",className:A.root,children:rt("certificateBadgeTemplate:badges-certificate-form.attributes")}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,className:A.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:A.text,children:rt("certificateBadgeTemplate:badges-certificate-form.type")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"tipo",name:"tipo_vp",defaultValue:"",value:j.tipo_vp||"",disabled:Ot(),onChange:vt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:rt("selects:selects-autocompletes.select-option")})}),Q.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:ot?e.valor_parametro_en:e.valor_parametro},"type-".concat(e.id))}))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:A.text,children:rt("certificateBadgeTemplate:badges-certificate-form.level")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"nivel",name:"nivel_vp",value:j.nivel_vp||"",disabled:Ot(),onChange:vt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:rt("selects:selects-autocompletes.select-option")})}),$.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:ot?e.valor_parametro_en:e.valor_parametro},"level-".concat(e.id))}))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:A.text,children:rt("certificateBadgeTemplate:badges-certificate-form.time")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"tiempo",name:"tiempo_vp",value:(null===j||void 0===j?void 0:j.tiempo_vp)||"",disabled:Ot(),onChange:vt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:rt("selects:selects-autocompletes.select-option")})}),le.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:ot?e.valor_parametro_en:e.valor_parametro},"time-".concat(e.id))}))]})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:A.text,children:rt("certificateBadgeTemplate:badges-certificate-form.amount-time")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsx)(Te.a,{disabled:Ct(j.tiempo_vp)||Ot(),required:!Ct(j.tiempo_vp),type:"number",name:"cantidad_tiempo",value:(st=j.cantidad_tiempo,""===st||st<1?(j.cantidad_tiempo=null,j.cantidad_tiempo):st),variant:"outlined",size:"small",onKeyUp:lo,onChange:vt})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:4,children:Object(n.jsx)(we.a,{variant:"body1",align:"right",className:A.text,children:rt("certificateBadgeTemplate:badges-certificate-form.cost")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,lg:8,children:Object(n.jsx)(mt.a,{variant:"outlined",className:"w-100",size:"small",children:Object(n.jsxs)(T.a,{id:"costo",name:"costo_vp",value:(null===j||void 0===j?void 0:j.costo_vp)||"",disabled:Ot(),onChange:vt,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:rt("selects:selects-autocompletes.select-option")})}),ie.map((function(e){return Object(n.jsx)(Y.a,{value:e.id,children:ot?e.valor_parametro_en:e.valor_parametro},"cost-".concat(e.id))}))]})})})]}),Object(n.jsx)(W.a,{}),Object(n.jsxs)(ye.a,{container:!0,spacing:1,justify:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:"auto",children:Object(n.jsx)(x.a,{type:"submit",color:"primary",variant:"contained",className:"my-2 ".concat(A.button),fullWidth:!0,children:rt("buttons:buttons.save")})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:"auto",children:Object(n.jsx)(x.a,{color:"primary",variant:"contained",onClick:wt,className:"my-2 ".concat(A.button),fullWidth:!0,children:rt("buttons:buttons.cancel")})})]})]})})}),Object(n.jsxs)(O.a,{open:Fe,onClose:Bt,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(A.buttonForm),onClick:Bt,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:(null===j||void 0===j?void 0:j.img_template)?null===j||void 0===j?void 0:j.img_template[(null===j||void 0===j?void 0:j.page)-1]:(null===j||void 0===j?void 0:j.img_prev)?null===j||void 0===j?void 0:j.img_prev[(null===j||void 0===j?void 0:j.page)-1]:null,className:A.img})})]}),Object(n.jsx)(_t,{loading:R}),Object(n.jsx)(O.a,{open:qe,fullScreen:!0,TransitionComponent:Zj,children:Object(n.jsx)(Xj,{setOpenDesignDiploma:He,user:s,md5OrganizationRoute:at,md5UserRoute:nt,handleCancelGeneral:wt,handleSubmit:Nt})}),Object(n.jsxs)(O.a,{open:Ge,onClose:St,fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{autoFocus:!0,required:!0,multiline:!0,id:"nombre",label:rt("dialogs:dialog.skill"),variant:"outlined",onChange:function(e){return $e(Object(m.a)(Object(m.a)({},Ze),{},{value:e.target.value}))},defaultValue:Ze.value})})}),Object(n.jsxs)(Ae.a,{center:!0,children:[Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(A.buttonDialog),onClick:function(){var e;null===j||void 0===j||null===(e=j.skills)||void 0===e||e.splice(Ze.index,1,Ze.value),Qe(!1)},children:rt("buttons:buttons.save")}),Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(A.buttonDialog),onClick:St,children:rt("buttons:buttons.cancel")})]})]})]})}));var af=function(e){var t=e.children,a=e.Index,i=e.Buttons,r=e.diplomaId,c=Object(D.a)("tabs"),o=(0,Object(d.a)(c,1)[0])("tabs.tabs-details",{returnObjects:!0}),s=[{label:"Detalle",route:"/diplomas/templates/published/details/".concat(Object(Ie.b)(r))},{label:"Historial",route:"/diplomas/templates/published/history/".concat(Object(Ie.b)(r))}];return s.map((function(e,t){return o.filter((function(a,n){return t===n?e.label=a.label:""}))})),Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(Pn.a,{children:i}),Object(n.jsx)(Rr,{Index:a,TabsHeader:s}),t]})};var nf=Object(C.a)((function(e){var t;return{root:{marginTop:"2em",marginBottom:"2em"},icon:{margin:20,fontSize:"4em"},avatar:{width:"auto",height:"auto","&:hover":{cursor:"pointer"}},img:function(e){var t,a;return{maxWidth:"70vw",height:null===(t=e.diplomaTemplate)||void 0===t||null===(a=t.diplomaTemplate)||void 0===a?void 0:a.height}},textBolder:{marginTop:"1em",color:"#5d5d5d",fontWeight:"bold"},textParagraph:{textAlign:"justify",color:"#5c5c5c",margin:"1em 0 1em 0"},textTitle:{color:"#5d5d5d",fontWeight:"bold"},text:{color:"#5c5c5c"},button:{color:E.a.primary,backgroundColor:"white",borderRadius:5,padding:"8px","&:hover":{backgroundColor:E.a.footer}},certificate:(t={display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(195px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}},Object(b.a)(t,e.breakpoints.up("sm"),{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(323px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}}),Object(b.a)(t,e.breakpoints.up("lg"),{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(423px, 1fr))",margin:"30px 30px 0px 30px","& div":{marginBottom:20,justifySelf:"center"}}),t),buttonForm:{position:"absolute",top:".5em",margin:"1em",color:"white",backgroundColor:E.a.primary,borderRadius:5,padding:"9px 20px","&:hover":{backgroundColor:E.a.secondary}}}})),rf={bgcolor:E.a.secondary,borderColor:E.a.secondary,color:"#ffffff",m:1,border:1,padding:1},cf={changeBreadcrump:I.a,setReturnRoute:I.C},of=Object(s.b)((function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones,permission:(e.permission||[]).filter((function(e){var t,a;return"certificados"===(null===(t=e.acciones)||void 0===t||null===(a=t.modulos)||void 0===a?void 0:a.nombre.toLowerCase())})).map((function(e){return e.acciones.nombre}))}}),cf)((function(e){var t,a,r,c,o,s,l,b,p=e.user,j=e.changeBreadcrump,y=e.permission,w=e.setReturnRoute,C=Object(u.g)(),k=Object(i.useState)(!1),N=Object(d.a)(k,2),B=N[0],S=N[1],T=Object(i.useState)(!1),A=Object(d.a)(T,2),I=A[0],z=A[1],P=Object(i.useState)({}),R=Object(d.a)(P,2),M=R[0],L=R[1],U=Object(i.useState)([]),Y=Object(d.a)(U,2),q=Y[0],H=Y[1],V=Object(i.useState)([]),G=Object(d.a)(V,2),Q=G[0],J=G[1],X=Object(i.useState)({}),Z=Object(d.a)(X,2),$=Z[0],ee=Z[1],te=Object(i.useState)({}),ne=Object(d.a)(te,2),ie=ne[0],re=ne[1],ce=Object(i.useState)({}),oe=Object(d.a)(ce,2),se=oe[0],le=oe[1],de=Object(i.useState)({}),ue=Object(d.a)(de,2),me=ue[0],be=ue[1],pe=Object(i.useState)([]),je=Object(d.a)(pe,2),fe=je[0],he=je[1],ge=Object(i.useState)(!1),xe=Object(d.a)(ge,2),Oe=xe[0],ke=xe[1],Se=Object(i.useState)(!1),Te=Object(d.a)(Se,2),Ee=Te[0],De=Te[1],ze=Object(i.useState)(!1),Pe=Object(d.a)(ze,2),Re=Pe[0],Me=Pe[1],Le=nf({diplomaTemplate:M}),Fe=Object(i.useState)({}),Ue=Object(d.a)(Fe,2),We=Ue[0],Ye=Ue[1],qe=Object(i.useState)({}),He=Object(d.a)(qe,2),Ke=He[0],Ve=He[1],Ge=Object(i.useState)(!1),Qe=Object(d.a)(Ge,2),Je=Qe[0],Xe=Qe[1],Ze=Object(D.a)(["certificateBadgeTemplate","tables","alerts","buttons","breadCrumps"]),$e=Object(d.a)(Ze,1)[0];Object(i.useEffect)((function(){et()}),[]);var et=function(){var e=Object(h.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(!0),e.next=3,tt();case 3:S(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),tt=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c,o,s,l,d,u,b,j,h,g,x,O,v,_,y,w,k,N,B,S,T,A,E,I,D,z,P,R,M;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,A=Object(Ie.a)(e.match.params.id),E=6===p.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios,I=6===(null===(a=p.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===a?void 0:a.rol),t.next=6,Ce.a.get("/diplomaTemplate/".concat(A));case 6:D=t.sent,z=D.data,L(z.diplomaTemplate),H(null===(n=z.diplomaTemplate)||void 0===n||null===(i=n.diplomaTemplate)||void 0===i?void 0:i.diplomasEmitidos),at(null===(r=z.diplomaTemplate)||void 0===r||null===(c=r.diplomaTemplate)||void 0===c?void 0:c.tiempo_vp),nt(null===(o=z.diplomaTemplate)||void 0===o||null===(s=o.diplomaTemplate)||void 0===s?void 0:s.nivel_vp),it(null===(l=z.diplomaTemplate)||void 0===l||null===(d=l.diplomaTemplate)||void 0===d?void 0:d.costo_vp),rt(null===(u=z.diplomaTemplate)||void 0===u||null===(b=u.diplomaTemplate)||void 0===b?void 0:b.tipo_vp),J(null===(j=z.diplomaTemplate)||void 0===j?void 0:j.skillsTemplate),he(null===(h=z.diplomaTemplate)||void 0===h?void 0:h.criterion),ct(null===(g=z.diplomaTemplate)||void 0===g||null===(x=g.diplomaTemplate)||void 0===x?void 0:x.estado),Ve(Object(m.a)(Object(m.a)({},null===(O=z.diplomaTemplate)||void 0===O?void 0:O.diplomaTemplate),{},{copy:!0,nombre:"".concat(null===(v=z.diplomaTemplate)||void 0===v||null===(_=v.diplomaTemplate)||void 0===_?void 0:_.nombre," copia"),nombre_privado:"".concat(null===(y=z.diplomaTemplate)||void 0===y||null===(w=y.diplomaTemplate)||void 0===w?void 0:w.nombre_privado," copia"),criterios:null===(k=z.diplomaTemplate)||void 0===k?void 0:k.criterion,id_habilidades:null===(N=z.diplomaTemplate)||void 0===N?void 0:N.skillsTemplate.map((function(e){return{id_habilidades:e.id_habilidades}})),id_usuarios:null===(B=p.data_user)||void 0===B?void 0:B.id,diplomaFields:null===(S=z.diplomaTemplate)||void 0===S||null===(T=S.diplomaTemplate)||void 0===T?void 0:T.diplomaCampos.map((function(e){return{fieldName:e.nombre,fieldType:e.tipo_campo_vp,exampleText:e.texto_ejemplo,fontFamily:{family:e.tipo_letra},fontSize:e.tamano_letra,fontColor:{hex:e.color},rectColor:{hex:e.background_color},fontStyle:{bold:e.bold,italic:e.italic,underline:e.underline,strikethrough:e.strikethrough},x:parseInt(e.x),y:parseInt(e.y),width:e.width,height:e.height,page:e.page,align:e.formato_letra||"center"}}))})),(E||I)&&((null===(P=z.diplomaTemplate)||void 0===P||null===(R=P.templatesCertificatesHistory)||void 0===R?void 0:R.filter((function(e){return 34===parseInt(e.accion)}))[0].id_usuarios)===(null===(M=p.data_user)||void 0===M?void 0:M.id)?Xe(!1):Xe(!0)),t.next=24;break;case 21:t.prev=21,t.t0=t.catch(0),C.push("/500");case 24:case"end":return t.stop()}}),t,null,[[0,21]])})));return function(){return t.apply(this,arguments)}}(),at=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTime");case 2:a=e.sent,n=a.data,i=n.time.filter((function(e){return e.id===t})),re(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),nt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getLevels");case 2:a=e.sent,n=a.data,i=n.levels.filter((function(e){return e.id===t})),ee(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),it=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getCosts");case 2:a=e.sent,n=a.data,i=n.costs.filter((function(e){return e.id===t})),le(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),rt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n,i;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/others/getTypes");case 2:a=e.sent,n=a.data,i=n.types.filter((function(e){return e.id===t})),be(i[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ct=function(e){j($e(1===e?"breadCrumps:breadCrumps.diploma-details-published":0===e?"breadCrumps:breadCrumps.diploma-details-edited":"breadCrumps:breadCrumps.diploma-details-archived",{returnObjects:!0}))},ot=function(e,t,a){switch(a){case"archive":st(t);break;case"publish":lt(t);break;case"delete":dt(t)}},st=function(e){F.a.fire({text:$e("alerts:alerts.archive-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:$e("buttons:buttons.accept"),cancelButtonText:$e("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&mt(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},lt=function(e){F.a.fire({text:$e("alerts:alerts.publish-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:$e("buttons:buttons.accept"),cancelButtonText:$e("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&ut(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},dt=function(e){F.a.fire({text:$e("alerts:alerts.delete-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:$e("buttons:buttons.accept"),cancelButtonText:$e("buttons:buttons.cancel")}).then(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.value&&bt(e);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},ut=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.put("/diplomaTemplate/updateState/".concat(t),{estado:1,id_usuarios:null===(a=p.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()});case 3:n=e.sent,n.data&&F.a.fire({text:$e("alerts:alerts.published"),icon:"success",showConfirmButton:!1,timer:1500}).then((function(){C.push("/diplomas/templates/published")})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),C.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),mt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.put("/diplomaTemplate/updateState/".concat(t),{estado:2,id_usuarios:null===(a=p.data_user)||void 0===a?void 0:a.id,fecha_ultima_modificacion:Date.now()});case 3:n=e.sent,n.data&&F.a.fire({text:$e("alerts:alerts.archived"),icon:"success",showConfirmButton:!1,timer:1500}).then((function(){C.push("/diplomas/templates/archived")})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),C.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),bt=function(){var e=Object(h.a)(f.a.mark((function e(t){var a,n;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce.a.delete("/diplomaTemplate/".concat(t),{data:{id_usuarios:null===(a=p.data_user)||void 0===a?void 0:a.id}});case 3:n=e.sent,n.data&&(0===M.diplomaTemplate.estado?F.a.fire({text:$e("alerts:alerts.deleted"),icon:"success",showConfirmButton:!1,timer:1500}).then((function(){C.push("/diplomas/templates/edited")})):F.a.fire({text:$e("alerts:alerts.deleted"),icon:"success",showConfirmButton:!1,timer:1500}).then((function(){C.push("/diplomas/templates/published")}))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),C.push("/500");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),pt=function(){w("/diplomas/templates/published/details/".concat(e.match.params.id)),C.push("/diplomas/templates/edit/".concat(Object(Ie.b)(M.diplomaTemplate.id)))},jt=function(e,t){F.a.fire({text:$e("alerts:alerts.copy-button-diploma"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:E.a.primary,confirmButtonText:$e("buttons:buttons.accept"),cancelButtonText:$e("buttons:buttons.cancel")}).then(function(){var a=Object(h.a)(f.a.mark((function a(n){return f.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n.value&&ft(t,e);case 1:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())},ft=function(e,t){t.preventDefault(),z(!0),Ce.a.post("/diplomaTemplate",e).then((function(e){S(!1),C.push("/diplomas/templates/edited"),F.a.fire({icon:"success",text:$e("alerts:alerts.copied"),showConfirmButton:!1,timer:1500})})).catch((function(e){z(!1),F.a.fire({icon:"error",text:$e("alerts:alerts.copied-error"),showConfirmButton:!1,timer:1500})}))},ht=function(){Ye(Object(m.a)(Object(m.a)({},null===M||void 0===M?void 0:M.diplomaTemplate),{},{criterios:null===M||void 0===M?void 0:M.criterion,plantillasHabilidades:null===M||void 0===M?void 0:M.skillsTemplate,linkPhotoTemplate:null===M||void 0===M?void 0:M.linkPhotoTemplate[0],photoOrganization:null===M||void 0===M?void 0:M.linkPhotoOrganization,niveles:null===$||void 0===$?void 0:$.valor_parametro,costos:null===se||void 0===se?void 0:se.valor_parametro,tiempos:null===ie||void 0===ie?void 0:ie.valor_parametro,tipos:null===me||void 0===me?void 0:me.valor_parametro})),De(!0)},gt=function(){De(!1)},xt=function(){ke(!1)};return Object(n.jsxs)(af,{Index:0,Buttons:function(){var e,t,a;return 0===(null===(e=M.diplomaTemplate)||void 0===e?void 0:e.estado)?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{className:Le.button,onClick:function(e){return ht()},children:Object(n.jsx)(Ir.a,{})})})}),y.includes("Publicar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.publish"),children:Object(n.jsx)(x.a,{className:Le.button,onClick:function(e){var t;return ot(e,null===(t=M.diplomaTemplate)||void 0===t?void 0:t.id,"publish")},children:Object(n.jsx)(ci.a,{})})})}),y.includes("Editar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.edit"),children:Object(n.jsx)(x.a,{className:Le.button,onClick:pt,children:Object(n.jsx)(Wn,{})})})}),y.includes("Copiar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.copy"),children:Object(n.jsx)(x.a,{disabled:Je,className:Le.button,onClick:function(e){return jt(e,Ke)},children:Object(n.jsx)(Ar.a,{})})})}),y.includes("Eliminar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.delete"),children:Object(n.jsx)(x.a,{className:Le.button,onClick:function(e){var t;return ot(e,null===(t=M.diplomaTemplate)||void 0===t?void 0:t.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]}):1===(null===(t=M.diplomaTemplate)||void 0===t?void 0:t.estado)?Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{className:Le.button,onClick:function(e){return ht()},children:Object(n.jsx)(Ir.a,{})})})}),y.includes("Editar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.edit"),children:Object(n.jsx)(x.a,{disabled:Je,className:Le.button,onClick:pt,children:Object(n.jsx)(Wn,{})})})}),y.includes("Copiar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.copy"),children:Object(n.jsx)(x.a,{disabled:Je,className:Le.button,onClick:function(e){return jt(e,Ke)},children:Object(n.jsx)(Ar.a,{})})})}),0!==q?y.includes("Archivar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.archive"),children:Object(n.jsx)(x.a,{disabled:Je,className:Le.button,onClick:function(e){var t;return ot(e,null===(t=M.diplomaTemplate)||void 0===t?void 0:t.id,"archive")},children:Object(n.jsx)(Er.a,{})})})}):y.includes("Eliminar")&&Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.delete"),children:Object(n.jsx)(x.a,{disabled:Je,className:Le.button,onClick:function(e){var t;return ot(e,null===(t=M.diplomaTemplate)||void 0===t?void 0:t.id,"delete")},children:Object(n.jsx)(Cn.a,{})})})})]})}):2===(null===(a=M.diplomaTemplate)||void 0===a?void 0:a.estado)?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:3,md:3,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.preview"),children:Object(n.jsx)(x.a,{className:Le.button,onClick:function(e){return ht()},children:Object(n.jsx)(Ir.a,{})})})}),y.includes("Publicar")&&Object(n.jsx)(ye.a,{item:!0,lg:2,md:2,xs:5,children:Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.publish"),children:Object(n.jsx)(x.a,{className:Le.button,onClick:function(e){var t;return ot(e,null===(t=M.diplomaTemplate)||void 0===t?void 0:t.id,"publish")},children:Object(n.jsx)(ci.a,{})})})})]}):void 0}(),diplomaId:Object(Ie.a)(e.match.params.id),children:[Object(n.jsx)(ve.a,{children:Object(n.jsxs)(_e.a,{className:Le.root,maxWidth:"lg",children:[Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:5,md:5,xs:12,children:Object(n.jsx)("div",{className:"avatar-icon-wrapper avatar-icon-xl",style:{alignSelf:"center"},children:B?Object(n.jsx)(Be.a,{variant:"circle",children:Object(n.jsx)(g.a,{className:Le.avatar})}):Object(n.jsx)(K.a,{title:$e("tables:table.tooltip.view-template"),children:Object(n.jsx)(g.a,{alt:"img-prev",src:M.linkPhotoTemplate?M.linkPhotoTemplate[0]:M.linkPhoto&&M.linkPhoto[0],variant:"square",className:Le.avatar,onClick:function(){return ke(!0)},children:Object(n.jsx)(Cc.a,{sx:{margin:4,fontSize:"4em"}})})})})}),Object(n.jsx)(ye.a,{item:!0,lg:7,md:7,xs:12,children:Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{variant:"h4",gutterBottom:!0,className:Le.textTitle,children:B?Object(n.jsx)(Be.a,{}):"".concat(null===(t=M.diplomaTemplate)||void 0===t?void 0:t.nombre)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{variant:"h6",gutterBottom:!0,className:Le.textTitle,children:B?Object(n.jsx)(Be.a,{}):"".concat(null===(a=M.diplomaTemplate)||void 0===a?void 0:a.nombre_privado)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{className:Le.textParagraph,children:B?Object(n.jsx)(Be.a,{}):"".concat(null===(r=M.diplomaTemplate)||void 0===r?void 0:r.descripcion)})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Le.textBolder,children:[$e("certificateBadgeTemplate:details.issued-by"),": "]}),Object(n.jsx)("span",{className:Le.text,children:null===(c=M.diplomaTemplate)||void 0===c||null===(o=c.organizaciones)||void 0===o?void 0:o.nombre})]})}),Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Le.textBolder,children:[$e("certificateBadgeTemplate:details.created"),": "]}),Object(n.jsx)("span",{className:Le.text,children:Ne()(null===(s=M.diplomaTemplate)||void 0===s?void 0:s.fecha_creacion).format("DD-MM-YYYY")})]})})]})})]}),Object(n.jsx)(W.a,{className:Le.root}),Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsxs)(ye.a,{item:!0,lg:6,md:6,xs:12,justify:"center",children:[Object(n.jsx)(ye.a,{item:!0,xs:12,children:B?Object(n.jsx)(Be.a,{}):Object(n.jsx)("span",{className:Le.textBolder,children:Q.length>0?"".concat($e("certificateBadgeTemplate:details.skills"),":"):""})}),Object(n.jsx)(ye.a,{item:!0,xs:12,children:Object(n.jsx)(ye.a,{container:!0,children:B?Object(n.jsx)(Be.a,{variant:"rect",width:"100%",height:"5em"}):Object(n.jsx)(n.Fragment,{children:Q.map((function(e){return Object(n.jsx)(Lt.a,{display:"flex",children:Object(n.jsx)(Lt.a,Object(m.a)(Object(m.a)({borderRadius:10},rf),{},{children:Object(n.jsx)(we.a,{children:e.habilidades.descripcion})}))})}))})})})]}),Object(n.jsx)(W.a,{orientation:"vertical",flexItem:!0,className:Le.divider}),Object(n.jsx)(ye.a,{item:!0,lg:5,md:5,xs:12,children:Object(n.jsxs)(ye.a,{container:!0,spacing:1,children:[(null===me||void 0===me?void 0:me.valor_parametro)&&Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Le.textBolder,children:[$e("certificateBadgeTemplate:details.type"),": "]}),Object(n.jsx)("span",{className:Le.text,children:me.valor_parametro})]})}),(null===$||void 0===$?void 0:$.valor_parametro)&&Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Le.textBolder,children:[$e("certificateBadgeTemplate:details.level"),": "]}),Object(n.jsx)("span",{className:Le.text,children:$.valor_parametro})]})}),B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:Object(n.jsx)(Be.a,{variant:"text"})})}):Object(n.jsx)(n.Fragment,{children:null!==(null===M||void 0===M||null===(l=M.diplomaTemplate)||void 0===l?void 0:l.cantidad_tiempo)&&void 0!==(null===ie||void 0===ie?void 0:ie.valor_parametro)?Object(n.jsxs)(ye.a,{item:!0,lg:12,md:6,xs:6,children:[Object(n.jsxs)("span",{className:Le.textBolder,children:[$e("certificateBadgeTemplate:details.time"),": "]}),Object(n.jsx)("span",{className:Le.text,children:"".concat(null===M||void 0===M||null===(b=M.diplomaTemplate)||void 0===b?void 0:b.cantidad_tiempo," ").concat(null===ie||void 0===ie?void 0:ie.valor_parametro)})]}):""}),(null===se||void 0===se?void 0:se.valor_parametro)&&Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:6,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{})}):Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)("span",{className:Le.textBolder,children:[$e("certificateBadgeTemplate:details.cost"),": "]}),Object(n.jsx)("span",{className:Le.text,children:se.valor_parametro})]})}),(null===fe||void 0===fe?void 0:fe.length)>0&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,lg:12,md:6,xs:12,children:Object(n.jsx)(we.a,{className:Le.textBolder,children:B?Object(n.jsx)(Be.a,{}):"".concat($e("certificateBadgeTemplate:details.requirements-certificate"),": ")})}),Object(n.jsx)(ye.a,{item:!0,children:B?Object(n.jsx)(n.Fragment,{children:Object(n.jsx)(Be.a,{variant:"text",width:200})}):Object(n.jsx)(n.Fragment,{children:fe.map((function(e,t){return Object(n.jsx)(we.a,{className:Le.text,gutterBottom:!0,children:e.descripcion_criterio},"criteria".concat(t))}))})})]})]})})]})]})}),Object(n.jsxs)(O.a,{open:Oe,onClose:xt,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(Le.buttonForm),onClick:xt,children:Object(n.jsx)(ae.a,{})})}),Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)("img",{alt:"img-prev",src:M.linkPhotoTemplate?M.linkPhotoTemplate[0]:M.linkPhoto&&M.linkPhoto[0],className:Le.img})})]}),Object(n.jsxs)(O.a,{open:Ee,onClose:gt,fullWidth:!0,maxWidth:"lg",children:[Object(n.jsx)(v.a,{align:"center",onClose:gt,children:$e("dialogs:dialog.preview-title-template-certificate")}),Object(n.jsx)(_.a,{dividers:!0,children:Object(n.jsx)(gc,{vista:We})}),Object(n.jsx)(Ae.a,{children:Object(n.jsx)(x.a,{variant:"contained",className:"my-2 ".concat(Le.buttonForm),onClick:gt,children:$e("buttons:buttons.close")})})]}),Object(n.jsx)(O.a,{open:Re,onClose:function(){Me(!1)},fullWidth:!0,maxWidth:"lg",children:Object(n.jsx)(_.a,{children:Object(n.jsx)(ye.a,{container:!0,spacing:2,children:Object(n.jsx)(ye.a,{item:!0,xs:12,style:{display:"flex"},children:Object(n.jsx)(we.a,{className:Le.textBolder,style:{marginTop:"12px"},children:"Sesiones"})})})})}),Object(n.jsx)(_t,{loading:I})]})}));var sf=Object(C.a)((function(){return{root:{display:"flex",alignItems:"center",border:"2.8px solid #cacaca",borderRadius:"10px",boxShadow:"4px 5px 4px 2px rgba(0, 0, 0, 0.2)",marginTop:"1rem"}}})),lf={changePage:I.b,changeBreadcrump:I.a},df=Object(s.b)((function(e){return{page:e.page,rowsPerPage:e.rowsPerPage}}),lf)((function(e){var t=e.page,a=e.rowsPerPage,r=e.changeBreadcrump,c=e.changePage,o=sf(),s=Object(i.useState)(!1),l=Object(d.a)(s,2),u=l[0],m=l[1],b=Object(i.useState)(!1),p=Object(d.a)(b,2),j=p[0],g=p[1],x=Object(i.useState)(!1),y=Object(d.a)(x,2),w=y[0],C=y[1],k=Object(i.useState)([]),N=Object(d.a)(k,2),B=N[0],T=N[1],A=Object(i.useState)([]),E=Object(d.a)(A,2),z=E[0],P=E[1],R=Object(i.useState)([{descripcion:"",valor:"",nuevoValor:"",tipo:"",recomendacion:""}]),M=Object(d.a)(R,2),L=M[0],F=M[1],U=Object(i.useState)(""),W=Object(d.a)(U,2),Y=W[0],q=W[1],H=Object(i.useState)(""),V=Object(d.a)(H,2),G=V[0],Q=V[1],J=Object(i.useState)({}),X=Object(d.a)(J,2),Z=X[0],$=X[1],ee=Object(D.a)(["tables","breadCrumps","dialogs"]),te=Object(d.a)(ee,1)[0];Object(i.useEffect)((function(){ae()}),[]);var ae=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,m(!0),c(0),t.next=5,ie();case 5:return t.next=7,ne();case 7:return m(!1),t.next=10,Ce.a.post("/diplomaTemplate/getDiplomaTemplates",{estado:1});case 10:a=t.sent,n=a.data,T(n.diplomaTemplates),t.next=18;break;case 15:t.prev=15,t.t0=t.catch(0),e.history.push("/500");case 18:case"end":return t.stop()}}),t,null,[[0,15]])})));return function(){return t.apply(this,arguments)}}(),ne=function(){var e=Object(h.a)(f.a.mark((function e(){var t,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce.a.post("/parameterValueParameter/getParameterValueParameter");case 2:t=e.sent,a=t.data,P(a.parametersValueParameters);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){var t=Object(h.a)(f.a.mark((function t(){var a,n,i,r,c;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=Object(Ie.a)(e.match.params.id),t.next=3,Ce.a.post("/diplomaTemplateHistory/getDiplomaTemplatesHistory",{id_plantillas_diplomas:i});case 3:r=t.sent,c=r.data,$(c.diplomaTemplatesHistory),re(null===(a=c.diplomaTemplatesHistory[0])||void 0===a||null===(n=a.plantillasDiplomas)||void 0===n?void 0:n.estado);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),re=function(e){r(te(1===e?"breadCrumps:breadCrumps.diploma-history-published":0===e?"breadCrumps:breadCrumps.diploma-history-edited":"breadCrumps:breadCrumps.diploma-history-archived",{returnObjects:!0}))},ce=function(e){Z.map(function(){var t=Object(h.a)(f.a.mark((function t(a){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a.id===e&&(""!==a.nuevoValor?F([{descripcion:"Creaci\xf3n",valor:B.filter((function(e){return e.id===parseInt(a.nuevoValor)}))}]):F([{descripcion:"Creaci\xf3n",valor:""}]));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),C(!0)},oe=function(e){var t=0,a="";return z.map((function(n){n.id===parseInt(e)&&(t=1,a=n.valor_parametro)})),0===t?e:a},se=te("tables:table.columns-history",{returnObjects:!0});return Object(n.jsxs)(af,{Index:2,diplomaId:Object(Ie.a)(e.match.params.id),children:[Object(n.jsx)(ve.a,{children:Object(n.jsx)(zn,{columns:se,rows:Z,setDirection:q,setOrderBy:Q,loading:u,children:u?Object(n.jsx)(qn,{columns:se,photo:0}):Object(n.jsx)(vn.a,{children:Z.length>0?Object(n.jsx)(n.Fragment,{children:Object(I.J)(Z,Object(I.f)(Y,G)).slice(t*a,t*a+a).map((function(e){var t,a;return Object(n.jsxs)(_n.a,{children:[Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("DD/MM/YYYY")}),Object(n.jsx)(yn.a,{align:"center",children:Ne()(e.fecha_accion).format("HH:mm:ss")}),Object(n.jsx)(yn.a,{align:"center",children:"".concat(null===(t=e.usuarios)||void 0===t?void 0:t.primer_nombre," ").concat(null===(a=e.usuarios)||void 0===a?void 0:a.primer_apellido)}),Object(n.jsx)(yn.a,{align:"center",children:oe(e.accion)}),Object(n.jsx)(yn.a,{children:Object(n.jsx)(K.a,{title:te("tables:table.tooltip.details"),children:Object(n.jsx)(S.a,{"aria-label":"detalles",onClick:function(t){return function(e){var t="",a=[];Z.map(function(){var n=Object(h.a)(f.a.mark((function n(i){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i.id===e&&(34===i.accion?ce(e):36===i.accion||37===i.accion?(F([{descripcion:36===i.accion?"Publicado":"Archivado",valor:i.valor,nuevoValor:i.nuevoValor,tipo:"info"}]),g(!0)):(t=i.valor.split("\xbf?")).length>0&&(t.map(function(){var e=Object(h.a)(f.a.mark((function e(t,n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0!==n&&((t=t.split("$%&"))[0].includes("esta")?a.push({descripcion:t[0],valor:t[1],nuevoValor:t[2],tipo:"info",recomendacion:B.filter((function(e){return e.id===parseInt(t[1])}))}):a.push({descripcion:t[0],valor:t[1],nuevoValor:t[2],tipo:"info"}));case 1:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}()),F(a),g(!0)));case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())}(e.id)},children:Object(n.jsx)(Ge.a,{})})})})]},e.id)}))}):Object(n.jsx)(yn.a,{align:"center",colSpan:"3",children:te("tables:table.empty-table")})})})}),Object(n.jsxs)(O.a,{open:j,onClose:function(){g(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.details")}),Object(n.jsx)(_.a,{children:L.length>0?Object(n.jsx)(n.Fragment,{children:L.map((function(e){var t,a,i,r,c,s,l;return Object(n.jsxs)(ye.a,{container:!0,xs:12,className:o.root,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,lg:12,children:Object(n.jsx)(Qi.a,{severity:e.tipo,children:e.descripcion})}),"Se a\xf1adi\xf3 esta plantilla como recomendaci\xf3n."===e.descripcion||"Se elimin\xf3 esta plantilla recomendada."===e.descripcion?e.recomendacion.length>0?Object(n.jsx)(_.a,{align:"center",children:Object(n.jsx)(zt,{format:(null===(t=e.recomendacion[0])||void 0===t?void 0:t.width)<(null===(a=e.recomendacion[0])||void 0===a?void 0:a.height)?0:1,certificateImage:e.recomendacion[0].linkPhoto,certificateName:null===(i=e.recomendacion[0])||void 0===i?void 0:i.nombre,organizationName:null===(r=e.recomendacion[0])||void 0===r||null===(c=r.organizaciones)||void 0===c?void 0:c.nombre})}):"":Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(ye.a,{item:!0,xs:6,lg:6,children:null!==e.valor&&(null===(s=e.valor)||void 0===s?void 0:s.length)>0?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.previous")}),Object(n.jsx)(_.a,{align:"center",children:e.descripcion.includes("atributo 'cantidad de tiempo'")||e.descripcion.includes("tama\xf1o de fuente")?e.valor:oe(e.valor)})]}):""}),Object(n.jsx)(ye.a,{item:!0,xs:6,lg:6,children:null!==e.valor&&(null===(l=e.valor)||void 0===l?void 0:l.length)>0?Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.current")}),Object(n.jsx)(_.a,{align:"center",children:e.descripcion.includes("atributo 'cantidad de tiempo'")||e.descripcion.includes("tama\xf1o de fuente")?e.nuevoValor:oe(e.nuevoValor)})]}):""})]})]})}))}):""})]}),Object(n.jsxs)(O.a,{open:w,onClose:function(){C(!1)},fullWidth:!0,maxWidth:"sm",children:[Object(n.jsx)(v.a,{align:"center",children:te("dialogs:dialog.details")}),L.length>0?Object(n.jsx)(n.Fragment,{children:L.map((function(e){var t,a,i,r,c,o,s;return Object(n.jsxs)(_.a,{align:"center",children:[Object(n.jsx)(Qi.a,{severity:"info",children:e.descripcion}),""!==e.valor&&(null===(t=e.valor[0])||void 0===t?void 0:t.linkPhoto)?Object(n.jsx)(zt,{format:(null===(a=e.valor[0])||void 0===a?void 0:a.width)<(null===(i=e.valor[0])||void 0===i?void 0:i.height)?0:1,certificateImage:null===(r=e.valor[0])||void 0===r?void 0:r.linkPhoto,certificateName:null===(c=e.valor[0])||void 0===c?void 0:c.nombre,organizationName:null===(o=e.valor[0])||void 0===o||null===(s=o.organizaciones)||void 0===s?void 0:s.nombre}):""]})}))}):Object(n.jsx)(yn.a,{align:"center",children:te("tables:table.empty-table")})]})]})}));var uf=Object(C.a)((function(e){var t;return{container:function(t){return Object(b.a)({display:"flex",minHeight:"100vh",justifyContent:"center",alignItems:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",overflow:"auto"},e.breakpoints.up("md"),{marginLeft:window.location.origin===t.env.mincienciasURL?"20px":0,height:"100vh",justifyContent:"space-around"})},container_card:(t={padding:"20px",borderRadius:"15px",margin:"5px 10px"},Object(b.a)(t,e.breakpoints.up("lg"),{padding:"5px 40px",margin:"0 10px",width:"600px"}),Object(b.a)(t,e.breakpoints.down("lg"),{margin:"100px 0 10px"}),t),container__login:{"& h2":{fontWeight:700},"& img":{width:"85%"}},container__logo:{display:"flex",justifyContent:"center",alignItems:"center"},button:function(e){return{marginTop:window.location.origin===e.env.mincienciasURL?"1em":0,margin:"0.5em",width:"100%",padding:"9px 40px"}},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},signin_span:{cursor:"pointer",color:e.palette.primary.main},text_password_error:{marginBottom:"5px",color:"#f4443b",fontSize:"0.9em",maxWidth:"fit-content",textAlign:"justify"},container__image:function(t){return Object(b.a)({display:"none"},e.breakpoints.up("md"),{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:window.location.origin===t.env.mincienciasURL?"80vw":"50vw"})},img:{height:"100%"},checked:{margin:0},checkedSpam:{cursor:"pointer",fontSize:13,"&:hover":{textDecoration:"underline"}},classes__login_buttons_paragraph:{justifyContent:"center",alignItems:"center","& p":{marginTop:".5em",marginBottom:".5em",textAlign:"center",cursor:"pointer",fontWeight:500,"&:hover":{textDecoration:"underline"}}}}})),mf={login:I.g},bf=Object(s.b)((function(e){return{user:e.user}}),mf)((function(e){var t=uf({env:je.a}),a=Object(i.useState)({firstName:"",secondName:"",lastName:"",secondSurname:"",email:"",password:"",organizationName:"",organizationPhone:"",countIssues:"",userRole:"",productName:""}),r=Object(d.a)(a,2),c=r[0],o=r[1],s=Object(i.useState)(!1),l=Object(d.a)(s,2),u=l[0],j=l[1],f=Object(i.useRef)(),h=Object(i.useState)({password:{error:!1}}),g=Object(d.a)(h,2),O=g[0],v=g[1],_=Object(i.useState)([]),y=Object(d.a)(_,2),w=y[0],C=y[1],k=Object(i.useState)({open:!1,title:"",url:"",viewTerms:!1,viewPPT:!1}),N=Object(d.a)(k,2),B=N[0],S=N[1],A=Object(i.useState)({}),E=Object(d.a)(A,2),I=E[0],z=E[1],P=e.user,R=Object(D.a)(["loginRegister","buttons","alerts"]),M=Object(d.a)(R,1)[0];Object(i.useEffect)((function(){var e,t=null===(e=JSON.parse(window.localStorage.state))||void 0===e?void 0:e.styles;z({Logo:t.logo435x149,LoginLogo:t.icono_login,LoginBackground:t.login_background,RegisterOrganization:t.organizationRegister}),window.location.origin===je.a.certikaURL?o(Object(m.a)(Object(m.a)({},c),{},{backoficceId:1})):window.location.origin===je.a.mincienciasURL&&o(Object(m.a)(Object(m.a)({},c),{},{backoficceId:2})),P&&j(!0)}),[]);var L=function(e){"password"===e.target.name&&(""===e.target.value||Ji(e.target.value)?(f.current.disabled=!1,v(Object(m.a)(Object(m.a)({},O),{},{password:{error:!1}})),F.a.close()):(f.current.disabled=!0,v(Object(m.a)(Object(m.a)({},O),{},{password:{error:!0}})),!O.password.error&&F.a.mixin({toast:!0,position:"bottom-start"}).fire({icon:"error",title:M("alerts:alerts.password-lenght")}))),o(Object(m.a)(Object(m.a)({},c),{},Object(b.a)({},e.target.name,e.target.value)))},U=function(e,t,a){S(Object(m.a)(Object(m.a)({},B),{},{open:!0,title:t,url:a,index:e}))},W=function(e){var t=w.includes(e),a=Object(p.a)(w);t?C(a.filter((function(t){return t!==e}))):(a.push(e),C(a)),S({open:!1,title:"",url:"",viewTerms:1===e||B.viewTerms,viewPPT:2===e||B.viewPPT})};return Object(n.jsxs)("div",{className:t.container,style:{backgroundImage:window.location.origin===je.a.mincienciasURL?"none":"url(".concat(null===I||void 0===I?void 0:I.LoginBackground,")")},children:[Object(n.jsx)(kn.a,{elevation:0,className:t.container_card,children:Object(n.jsxs)("div",{className:t.container__login,children:[Object(n.jsx)("div",{className:t.container__logo,children:Object(n.jsx)("img",{src:null===I||void 0===I?void 0:I.Logo,alt:"logo",style:{width:"70%"}})}),Object(n.jsx)("h3",{style:{marginBottom:".5em"},children:M("buttons:buttons.register")}),Object(n.jsxs)("form",{onSubmit:function(t){if(t.preventDefault(),c.password!==c.passwordConfirmation)return F.a.fire({icon:"info",text:M("alerts:alerts.password-match"),showConfirmButton:!1,timer:3e3});j(!0),Object(Ce.a)({url:"/user/sign-up",method:"post",data:{primer_nombre:c.firstName,primer_apellido:c.lastName,correo:c.email,password:c.password,backoficceId:c.backoficceId,organizationData:{nombre:c.organizationName,telefono:c.organizationPhone,correo:c.email,newOrganization:!0,nameClient:"".concat(c.firstName," ").concat(c.lastName),countIssues:c.countIssues,userRole:c.userRole,isNewOrganizaton:!0,productName:c.productName}}}).then((function(t){j(!1),t.data&&F.a.fire({icon:"success",text:M("alerts:alerts.email-confirm-account"),showConfirmButton:!1,timer:7e3}).then((function(){e.history.push("/sign-in")}))})).catch((function(){j(!1),F.a.fire({icon:"error",text:M("alerts:alerts.account-exist"),showConfirmButton:!1,timer:3e3})}))},children:[Object(n.jsxs)(ye.a,{container:!0,spacing:2,children:[Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:M("loginRegister:first-name"),name:"firstName",variant:"outlined",onChange:L,value:c.firstName})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:M("loginRegister:last-name"),name:"lastName",variant:"outlined",onChange:L,value:c.lastName})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:12,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:M("loginRegister:email"),name:"email",type:"email",variant:"outlined",onChange:L,value:c.email})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:M("loginRegister:password"),name:"password",variant:"outlined",onChange:L,error:O.password.error,type:"password"})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsxs)(mt.a,{className:"w-100",children:[O.password.error&&Object(n.jsx)("span",{className:t.text_password_error,children:O.password.message}),Object(n.jsx)(Te.a,{required:!0,label:M("loginRegister:confirm-password"),name:"passwordConfirmation",variant:"outlined",onChange:L,type:"password"})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Organizaci\xf3n",name:"organizationName",variant:"outlined",onChange:L,value:c.organizationName})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,type:"number",label:"Tel\xe9fono",name:"organizationPhone",variant:"outlined",onChange:L,value:c.organizationPhone})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsx)(mt.a,{className:"w-100",children:Object(n.jsx)(Te.a,{required:!0,label:"Cargo",name:"userRole",variant:"outlined",onChange:L,value:c.userRole})})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{id:"count-issues",children:"Producto de inter\xe9s*"}),Object(n.jsxs)(T.a,{required:!0,labelId:"count-issues",label:"Producto de interes",name:"productName",onChange:L,value:c.productName,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:"Seleccione una opci\xf3n"})}),Object(n.jsx)(Y.a,{value:"Insignias Digitales",children:"Insignias Digitales"}),Object(n.jsx)(Y.a,{value:"Certificados Digitales",children:"Certificados Digitales"}),Object(n.jsx)(Y.a,{value:"Documentos Digitales",children:"Documentos Digitales"}),Object(n.jsx)(Y.a,{value:"Carnets Digitales",children:"Carnets Digitales"})]})]})}),Object(n.jsx)(ye.a,{item:!0,xs:12,sm:6,children:Object(n.jsxs)(mt.a,{variant:"outlined",className:"w-100",children:[Object(n.jsx)(di.a,{id:"count-issues",children:"Cantidad emisiones*"}),Object(n.jsxs)(T.a,{required:!0,labelId:"count-issues",label:"Cantidad emisiones",name:"countIssues",onChange:L,value:c.countIssues,children:[Object(n.jsx)(Y.a,{value:"",children:Object(n.jsx)("em",{children:"Seleccione una opci\xf3n"})}),Object(n.jsx)(Y.a,{value:"10 - 499",children:"10 - 499"}),Object(n.jsx)(Y.a,{value:"500 - 999",children:"500 - 999"}),Object(n.jsx)(Y.a,{value:"1000 - 1999",children:"1000 - 1999"}),Object(n.jsx)(Y.a,{value:"+2000",children:"+2000"})]})]})})]}),window.location.origin!==je.a.mincienciasURL&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsx)(wi.a,{className:t.checked,control:Object(n.jsx)(Hi.a,{checked:w.includes(1),name:"checkedE",onClick:function(){return W(1)}})}),Object(n.jsx)("span",{className:t.checkedSpam,onClick:function(){return U(1,"T\xc9RMINOS Y CONDICIONES DE USO DE SOFTWARE CERTIKA S.A.S.","https://certika.co/wp-content/uploads/2022/08/Terminos-y-Condiciones-de-Uso-de-Softwre-y-ANS-1.pdf")},children:M("loginRegister:accept-terms")})]}),Object(n.jsxs)(ye.a,{item:!0,xs:12,children:[Object(n.jsx)(wi.a,{className:t.checked,control:Object(n.jsx)(Hi.a,{checked:w.includes(2),name:"checkedE",onClick:function(){return W(2)}})}),Object(n.jsx)("span",{className:t.checkedSpam,onClick:function(){return U(2,"POL\xcdTICA DE PRIVACIDAD Y TRATAMIENTO DE DATOS PERSONALES CERTIKA S.A.S","https://certika.co/wp-content/uploads/2022/07/Politica-de-Tratamiento-de-Datos-Personales-Responsable_Certika-1.pdf")},children:M("loginRegister:accept-privacy")})]})]}),Object(n.jsxs)("div",{className:"text-center",children:[Object(n.jsx)(x.a,{disabled:window.location.origin!==je.a.mincienciasURL&&!(w.includes(1)&&w.includes(2)),ref:f,variant:"contained",size:"small",className:t.button,type:"submit",color:"primary",disableElevation:!0,children:M("buttons:buttons.register")}),Object(n.jsx)("br",{})]}),Object(n.jsx)("div",{className:t.classes__login_buttons_paragraph,children:Object(n.jsxs)("p",{onClick:function(){e.history.push("/sign-in")},children:["".concat(M("loginRegister:have-account"),", "),Object(n.jsx)("span",{className:t.signin_span,children:M("loginRegister:sign-in")})]})})]})]})}),Object(n.jsx)("div",{className:t.container__image,children:Object(n.jsx)("img",{src:window.location.origin===je.a.certikaURL?null===I||void 0===I?void 0:I.RegisterOrganization:null===I||void 0===I?void 0:I.LoginLogo,className:t.img,alt:"login-logo"})}),Object(n.jsx)(xt.a,{className:t.backdrop,open:u,children:Object(n.jsx)(Ot.a,{color:"inherit"})}),Object(n.jsx)(Xi,{data:B,onClose:function(){S(Object(m.a)(Object(m.a)({},B),{},{open:!1,title:"",url:""}))},handleAccept:W,checked:w})]})})),pf=function(){var e=Object(u.h)(),t=Object(i.useState)(!1),a=Object(d.a)(t,2),r=a[0],c=a[1];return Object(i.useEffect)((function(){window.localStorage.getItem("state")?c(!0):setTimeout((function(){window.location.reload()}),3e3)}),[]),r?Object(n.jsx)(l.a,{children:Object(n.jsxs)(u.d,{children:[Object(n.jsx)(u.b,{exact:!0,path:"/",children:Object(n.jsx)(u.a,{to:"sign-in"})}),Object(n.jsx)(u.a,{from:"/verificar-certificado/proof",to:"/verify/proof-certificate"}),Object(n.jsx)(u.a,{from:"/verificar/:verificationType?",to:"/verify/:verificationType?"}),Object(n.jsxs)(u.d,{location:e,children:[Object(n.jsx)(u.b,{path:"/sign-up/certificate/:certificateId?/:reject?",component:er}),Object(n.jsx)(u.b,{path:"/sign-up/signatorie/:documentTemplateId/:idSignature",component:er}),Object(n.jsx)(u.b,{path:"/sign-up/carnet/:carnetId?/:reject?",component:er}),Object(n.jsx)(u.b,{exact:!0,path:"/sign-up/:badgeId?/:reject?",component:er}),Object(n.jsx)(u.b,{path:"/account/verify/:accountId",exact:!0,component:ar}),Object(n.jsx)(u.b,{path:"/account/forget",exact:!0,component:Zd}),Object(n.jsx)(u.b,{path:"/account/forget/:accountId",exact:!0,component:eu}),Object(n.jsx)(u.b,{path:"/account/changePassword",exact:!0,component:eu}),Object(n.jsx)(u.b,{path:"/account/combine",exact:!0,component:uu}),Object(n.jsx)(u.b,{path:"/account/combine/accept/:accountCurrentId",exact:!0,component:pu}),Object(n.jsx)(u.b,{path:"/account/combine/accept/",exact:!0,component:pu}),Object(n.jsx)(u.b,{exact:!0,path:"/sign-in/:badgeId?",component:lr}),Object(n.jsx)(u.b,{path:"/sign-in/certificate/:certificateId?",component:lr}),Object(n.jsx)(u.b,{path:"/sign-in/carnet/:carnetId?",component:lr}),Object(n.jsx)(u.b,{path:"/sign-in/signatorie/:documentTemplateId?/:idSignature?",component:lr}),Object(n.jsx)(u.b,{path:"/dashboard/:userUrl?",exact:!0,component:Ia}),Object(n.jsx)(u.b,{path:"/dashboard/badge/:badgeId?",component:Ia}),Object(n.jsx)(u.b,{path:"/dashboard/certificate/:certificateId?",component:Ia}),Object(n.jsx)(u.b,{path:"/dashboard/carnet/:carnetId?",component:Ia}),Object(n.jsx)(u.b,{path:"/dashboard/document/:documentTemplateId?/:idSignature?",component:Ia}),Object(n.jsx)(u.b,{path:"/organization/:id",component:Ra}),Object(n.jsx)(u.b,{path:"/badge/reject/:badgeId",exact:!0,component:Bd}),Object(n.jsx)(u.b,{path:"/badge/accept/:badgeId",exact:!0,component:Ad}),Object(n.jsx)(u.b,{path:"/certificate/reject/:certificateId",exact:!0,component:xs}),Object(n.jsx)(u.b,{path:"/badges/:issuedBadgeId",exact:!0,component:Ua}),Object(n.jsx)(u.b,{path:"/certificados/:issuedBadgeId",exact:!0,component:Ua}),Object(n.jsx)(u.b,{path:"/certificates/verify/:issuedBadgeId",exact:!0,component:an}),Object(n.jsx)(u.b,{path:"/certificates/verify/:verificationType/:issuedBadgeId",exact:!0,component:an}),Object(n.jsx)(u.b,{path:"/document/:documentId",exact:!0,component:bn}),Object(n.jsx)(u.b,{path:"/documents/verify/:documentId",exact:!0,component:ln}),Object(n.jsx)(u.b,{path:"/badge/:badgeId",component:Pd}),Object(n.jsx)(u.b,{exact:!0,path:"/template/:badgeId",component:Ld}),Object(n.jsx)(u.b,{exact:!0,path:"/share",component:Gd}),Object(n.jsx)(u.b,{path:"/share/certificate",component:Jd}),Object(n.jsx)(u.b,{path:"/profileSettings",exact:!0,component:cu}),Object(n.jsx)(u.b,{path:"/verify/:verificationType?",component:Gu}),Object(n.jsx)(u.b,{path:"/new-organization",component:bf}),Object(n.jsx)(u.b,{path:"/signatorie/:documentTemplateId?/:idSignature?",component:Ap}),Object(n.jsx)(u.b,{exact:!0,path:"/500",component:Ju}),Object(n.jsx)(u.b,{exact:!0,path:"/404",component:Zu}),Object(n.jsx)(u.b,{exact:!0,path:"/analytics/exportStatistics/:series",component:Cl}),Object(n.jsx)(u.b,{path:"/template/certificate/:certificateId",component:bs}),Object(n.jsx)(u.b,{path:"/certificate/:certificateId",exact:!0,component:hs}),Object(n.jsx)(u.b,{path:"/verified-certificate/:certificateId",exact:!0,component:rn}),Object(n.jsx)(u.b,{path:"/certificate/verify/:certificateId",exact:!0,component:rn}),Object(n.jsx)(u.b,{path:"/verified-certificate/:verificationType/:certificateId",exact:!0,component:rn}),Object(n.jsx)(u.b,{path:"/carnet/:carnetId",exact:!0,component:hn}),Object(n.jsx)(u.b,{path:"/carnet/verify/:carnetId",exact:!0,component:xn}),Object(n.jsx)(u.b,{path:"/verified-documents/:documentId",exact:!0,component:ln}),Object(n.jsx)(u.b,{path:"/verified-documents/:verificationType/:documentId",exact:!0,component:ln}),Object(n.jsx)(u.b,{path:"/verified-carnet/:carnetId",exact:!0,component:xn}),Object(n.jsx)(u.b,{path:"/verified-carnet/:verificationType/:carnetId",exact:!0,component:xn}),Object(n.jsx)(u.b,{path:"/helpCenter/:type/:id",exact:!0,component:Kp}),Object(n.jsx)(u.b,{exact:!0,path:"/create-url-perfil",component:em}),Object(n.jsx)(u.b,{exact:!0,path:"/responsePage",component:jj}),Object(n.jsx)(u.b,{path:"/document/signature/:documentTemplateId/:idSignature",exact:!0,component:Ap}),Object(n.jsxs)(On,{children:[Object(n.jsx)(u.b,{path:"/modules",exact:!0,component:Vn}),Object(n.jsx)(u.b,{path:"/modules/create",component:Jn}),Object(n.jsx)(u.b,{path:"/modules/edit/:id",component:Jn}),Object(n.jsx)(u.b,{path:"/actions",exact:!0,component:$n}),Object(n.jsx)(u.b,{path:"/permissions",exact:!0,component:ai}),Object(n.jsx)(u.b,{path:"/permissions/create",component:Gi}),Object(n.jsx)(u.b,{path:"/permissions/edit/:id",component:Gi}),Object(n.jsx)(u.b,{path:"/users",exact:!0,component:ri}),Object(n.jsx)(u.b,{path:"/users/create",component:qi}),Object(n.jsx)(u.b,{path:"/users/edit/:id",component:qi}),Object(n.jsx)(u.b,{path:"/organizations",exact:!0,component:li}),Object(n.jsx)(u.b,{path:"/organizations/create",component:pi}),Object(n.jsx)(u.b,{path:"/organizations/edit/:id",component:pi}),Object(n.jsx)(u.b,{path:"/userGroupsOrganization",exact:!0,component:hi}),Object(n.jsx)(u.b,{path:"/userGroupsOrganization/create",component:Oi}),Object(n.jsx)(u.b,{path:"/userGroupsOrganization/edit/:id",component:Oi}),Object(n.jsx)(u.b,{path:"/userGroups",exact:!0,component:yi}),Object(n.jsx)(u.b,{path:"/userGroups/create",component:Bi}),Object(n.jsx)(u.b,{path:"/userGroups/edit/:id",component:Bi}),Object(n.jsx)(u.b,{path:"/recommendations",exact:!0,component:br}),Object(n.jsx)(u.b,{path:"/recommendations/create",component:pr.a}),Object(n.jsx)(u.b,{path:"/recommendations/edit/:id",component:pr.a}),Object(n.jsx)(u.b,{path:"/recommendations/TemplatesRecommendations/:id",component:hr}),Object(n.jsx)(u.b,{path:"/recommendations/history/:id",component:Or}),Object(n.jsx)(u.b,{path:"/recommendations/certificate",exact:!0,component:yr}),Object(n.jsx)(u.b,{path:"/recommendations/certificate/create",component:wr.a}),Object(n.jsx)(u.b,{path:"/recommendations/certificate/edit/:id",component:wr.a}),Object(n.jsx)(u.b,{path:"/recommendations/certificate/TemplatesRecommendations/:id",component:Nr}),Object(n.jsx)(u.b,{path:"/recommendations/certificate/history/:id",component:Tr}),Object(n.jsx)(u.b,{path:"/badgesIssued",exact:!0,component:Fl}),Object(n.jsx)(u.b,{path:"/badgesIssued/badges/:id",component:Hl}),Object(n.jsx)(u.b,{path:"/issue",component:$l}),Object(n.jsx)(u.b,{path:"/certificates/issue",component:rd}),Object(n.jsx)(u.b,{path:"/carnets/issue",component:Mp}),Object(n.jsx)(u.b,{path:"/diplomas/issue",component:Nj}),Object(n.jsx)(u.b,{path:"/templates/published",exact:!0,component:Hr}),Object(n.jsx)(u.b,{path:"/templates/create",exact:!0,component:jd}),Object(n.jsx)(u.b,{path:"/templates/edit/:id",component:jd}),Object(n.jsx)(u.b,{path:"/templates/published/details/:id",component:Xr}),Object(n.jsx)(u.b,{path:"/templates/published/insights/:id",component:ac}),Object(n.jsx)(u.b,{path:"/templates/published/history/:id",component:rc}),Object(n.jsx)(u.b,{path:"/templates/edited",exact:!0,component:sc}),Object(n.jsx)(u.b,{path:"/templates/edited/details/:id",component:Xr}),Object(n.jsx)(u.b,{path:"/templates/archived",exact:!0,component:uc}),Object(n.jsx)(u.b,{path:"/templates/archived/details/:id",component:Xr}),Object(n.jsx)(u.b,{path:"/certificates/published",exact:!0,component:vc}),Object(n.jsx)(u.b,{path:"/certificates/create",exact:!0,component:ls}),Object(n.jsx)(u.b,{path:"/certificates/edit/:id",component:ls}),Object(n.jsx)(u.b,{path:"/certificates/details/:id",component:Dc}),Object(n.jsx)(u.b,{path:"/certificates/history/:id",component:Fc}),Object(n.jsx)(u.b,{path:"/certificates/certificate/insights/:id",component:Rc}),Object(n.jsx)(u.b,{path:"/certificates/edited",exact:!0,component:no}),Object(n.jsx)(u.b,{path:"/certificates/archived",exact:!0,component:co}),Object(n.jsx)(u.b,{path:"/certificates/issued",exact:!0,component:ld}),Object(n.jsx)(u.b,{path:"/certificates/issued/:id",component:md}),Object(n.jsx)(u.b,{path:"/carnets/issued",exact:!0,component:Up}),Object(n.jsx)(u.b,{path:"/carnets/issued/:id",component:qp}),Object(n.jsx)(u.b,{path:"/templates/documents/create",exact:!0,component:xb}),Object(n.jsx)(u.b,{path:"/templates/documents/edit/:id",component:xb}),Object(n.jsx)(u.b,{path:"/templates/documents/published",exact:!0,component:Cb}),Object(n.jsx)(u.b,{path:"/templates/documents/published/details/:id",component:Ib}),Object(n.jsx)(u.b,{path:"/templates/documents/published/history/:id",component:Pb}),Object(n.jsx)(u.b,{path:"/templates/documents/edited",exact:!0,component:Lb}),Object(n.jsx)(u.b,{path:"/templates/documents/edited/details/:id",component:Ib}),Object(n.jsx)(u.b,{path:"/templates/documents/archived",exact:!0,component:Wb}),Object(n.jsx)(u.b,{path:"/templates/documents/archived/details/:id",component:Ib}),Object(n.jsx)(u.b,{path:"/certify",component:Gb}),Object(n.jsx)(u.b,{path:"/documents/files/",exact:!0,component:$b}),Object(n.jsx)(u.b,{path:"/documents/sign/files/",exact:!0,component:$b}),Object(n.jsx)(u.b,{path:"/documents/files/:id",exact:!0,component:yp}),Object(n.jsx)(u.b,{path:"/documents/sign/files/:id",exact:!0,component:yp}),Object(n.jsx)(u.b,{path:"/documents/files/history/:id",exact:!0,component:kp}),Object(n.jsx)(u.b,{path:"/documents/sign/files/history/:id",exact:!0,component:kp}),Object(n.jsx)(u.b,{path:"/documents/sign",exact:!0,component:ip}),Object(n.jsx)(u.b,{path:"/documents/sign/edit/:id_template",exact:!0,component:ip}),Object(n.jsx)(u.b,{path:"/documents/signed/:id",exact:!0,component:ip}),Object(n.jsx)(u.b,{path:"/carnets/published",exact:!0,component:Cs}),Object(n.jsx)(u.b,{path:"/carnets/create",exact:!0,component:Zs}),Object(n.jsx)(u.b,{path:"/carnets/edit/:id",component:Zs}),Object(n.jsx)(u.b,{path:"/carnets/details/:id",component:Ts}),Object(n.jsx)(u.b,{path:"/carnets/history/:id",component:Is}),Object(n.jsx)(u.b,{path:"/carnets/edited",exact:!0,component:Ps}),Object(n.jsx)(u.b,{path:"/carnets/archived",exact:!0,component:Ls}),Object(n.jsx)(u.b,{path:"/reports/:type",exact:!0,component:Qp}),Object(n.jsx)(u.b,{path:"/skills",exact:!0,component:xd}),Object(n.jsx)(u.b,{path:"/skills/create",component:_d}),Object(n.jsx)(u.b,{path:"/skills/edit/:id",component:_d}),Object(n.jsx)(u.b,{path:"/skills/templates/:id",component:kd}),Object(n.jsx)(u.b,{path:"/analytics",component:vl}),Object(n.jsx)(u.b,{path:"/developers/template-ids/badges",component:Bl}),Object(n.jsx)(u.b,{path:"/developers/template-ids/documents",component:Il}),Object(n.jsx)(u.b,{path:"/developers/template-ids/certificates",component:Pl}),Object(n.jsx)(u.b,{path:"/socialNetworks",exact:!0,component:Wd}),Object(n.jsx)(u.b,{path:"/socialNetworks/create",component:Kd}),Object(n.jsx)(u.b,{path:"/socialNetworks/edit/:id",component:Kd}),Object(n.jsx)(u.b,{path:"/valueParameters",exact:!0,component:hu}),Object(n.jsx)(u.b,{path:"/valueParameters/create",component:_u}),Object(n.jsx)(u.b,{path:"/valueParameters/edit/:id",component:_u}),Object(n.jsx)(u.b,{path:"/contracts/",exact:!0,component:Cu}),Object(n.jsx)(u.b,{path:"/contracts/:organizations",exact:!0,component:Bu}),Object(n.jsx)(u.b,{path:"/contract/create/",component:Iu}),Object(n.jsx)(u.b,{path:"/contracts/edit/:id",component:Iu}),Object(n.jsx)(u.b,{path:"/reminders",exact:!0,component:$p}),Object(n.jsx)(u.b,{path:"/reminders/create",exact:!0,component:ij}),Object(n.jsx)(u.b,{path:"/payments",exact:!0,component:lj}),Object(n.jsx)(u.b,{path:"/diplomas/templates/published",exact:!0,component:Ij}),Object(n.jsx)(u.b,{path:"/diplomas/templates/edited",exact:!0,component:Pj}),Object(n.jsx)(u.b,{path:"/diplomas/templates/archived",exact:!0,component:Lj}),Object(n.jsx)(u.b,{path:"/diplomas/templates/create",exact:!0,component:tf}),Object(n.jsx)(u.b,{path:"/diplomas/templates/edit/:id",component:tf}),Object(n.jsx)(u.b,{path:"/diplomas/templates/published/details/:id",component:of}),Object(n.jsx)(u.b,{path:"/diplomas/templates/published/history/:id",component:df}),Object(n.jsx)(u.b,{path:"/diplomas/sign",exact:!0,component:yj}),Object(n.jsxs)(u.b,{exact:!0,path:"*",children:[Object(n.jsx)(u.a,{to:"/not-found"}),Object(n.jsx)(u.b,{exact:!0,path:"/not-found",component:$u})]})]})]},e.pathname)]})}):Object(n.jsx)(_t,{loading:!r})},jf=a(1233),ff=a(188),hf=a(265),gf=window.location.origin===je.a.certikaURL?{primary:"#00b9bc",secondary:"#008A91",tertiary:"#E9FFFF",background:"#FFF",footer:"#E3E4E6"}:window.location.origin===je.a.mincienciasURL&&{primary:"#3366cc",secondary:"#9ac32a",tertiary:"#d1d7e3",background:"#FFF"},xf=Object(ff.b)({palette:{primary:{main:gf.primary},secondary:{main:gf.secondary},tertiary:{main:gf.tertiary},background:{main:gf.background},footer:{main:gf.footer}},overrides:{MuiButton:{containedPrimary:{color:"white",margin:"0.5em",borderRadius:"50px",textTransform:"none",fontSize:"16px",padding:"7px 40px"},outlinedPrimary:{margin:"0.5em",borderRadius:"50px",textTransform:"none",fontSize:"16px",padding:"7px 40px"}},MuiDivider:{root:{margin:"10px 0px"}},MuiTextField:{root:{"& .MuiInputBase-root":{borderRadius:"16px"}}},MuiFormControl:{root:{"& .MuiOutlinedInput-root":{borderRadius:"16px"}}}}});var Of,vf,_f={logoutRequest:I.i,changePermissions:I.c,setLenguage:I.z,getBackOfficeOrganization:I.e},yf=Object(s.b)(null,_f)((function(e){var t=e.changePermissions,a=e.logoutRequest,i=e.setLenguage,r=e.getBackOfficeOrganization,c=new bt.a("logout"),o=new bt.a("lenguage"),s=Object(D.a)().i18n,d=(document.getElementById("title"),document.getElementById("favicon"));return Object(n.jsxs)(n.Fragment,{children:[(document.documentElement.style.setProperty("--color-primary",gf.primary),document.documentElement.style.setProperty("--color-secondary",gf.secondary),document.documentElement.style.setProperty("--color-tertiary",gf.tertiary),window.location.origin===je.a.certikaURL?(r(1),document.title="Certika",d.href=je.a.faviconCertika,Object(n.jsx)(hf.b,{children:Object(n.jsx)("div",{children:Object(n.jsxs)(hf.a,{prioritizeSeoTags:!0,children:[Object(n.jsx)("title",{children:"Certika"}),Object(n.jsx)("link",{rel:"icon",href:je.a.faviconCertika}),Object(n.jsx)("link",{rel:"apple-touch-icon",href:je.a.faviconCertika}),Object(n.jsx)("meta",{property:"og:title",content:"Certika"}),Object(n.jsx)("meta",{property:"og:description",content:"Certika es la plataforma web que permite certificar cualquier documento digital de valor, bajo tecnolog\xeda blockchain, garantizando la imposibilidad de ser falsificado o alterado en el futuro."}),Object(n.jsx)("script",{type:"text/javascript",async:"true",src:"https://api.at.getsocial.io/get/v1/628a64af/gs_async.js"})]})})})):window.location.origin===je.a.mincienciasURL?(r(je.a.idMinciencias),document.title="Minciencias | Ministerio de Ciencia Tecnolog\xeda e Innovaci\xf3n",d.href=je.a.faviconMinciencias,Object(n.jsx)(hf.b,{children:Object(n.jsx)("div",{children:Object(n.jsxs)(hf.a,{prioritizeSeoTags:!0,children:[Object(n.jsx)("title",{children:"Minciencias | Ministerio de Ciencia Tecnolog\xeda e Innovaci\xf3n"}),Object(n.jsx)("link",{rel:"icon",href:je.a.faviconMinciencias}),Object(n.jsx)("link",{rel:"apple-touch-icon",href:je.a.faviconMinciencias}),Object(n.jsx)("meta",{property:"og:title",content:"Minciencias | Ministerio de Ciencia Tecnolog\xeda e Innovaci\xf3n"}),Object(n.jsx)("meta",{property:"og:description",content:"Ministerio de Ciencia Tecnolog\xeda e Innovaci\xf3n"}),Object(n.jsx)("script",{type:"text/javascript",async:"true",src:"https://api.at.getsocial.io/get/v1/8b045409/gs_async.js"})]})})})):void 0),Object(n.jsx)(jf.a,{theme:xf,children:Object(n.jsxs)(l.a,{children:[(c.onmessage=function(e){"CerrarSesion"===e?(a(),t(),window.location.reload(),c.close()):setTimeout((function(){window.location.reload()}),150)},void(o.onmessage=function(e){s.changeLanguage(e),i(e),o.close()})),Object(n.jsx)(pf,{})]})})]})})),wf=a(228),Cf=a(576),kf=function(e,t){switch(t.type){case"LOGIN_REQUEST":case"LOGOUT_REQUEST":return Object(m.a)(Object(m.a)({},e),{},{user:t.payload});case"LOGIN_SESION":case"LOGOUT_SESION":return Object(m.a)(Object(m.a)({},e),{},{sesion:t.payload});case"PAGE":return Object(m.a)(Object(m.a)({},e),{},{page:t.payload});case"ROWS_PER_PAGE":return Object(m.a)(Object(m.a)({},e),{},{rowsPerPage:t.payload});case"BREADCRUMP":return Object(m.a)(Object(m.a)({},e),{},{crump:t.payload});case"PERMISSION":return Object(m.a)(Object(m.a)({},e),{},{permission:t.payload});case"BADGES":return Object(m.a)(Object(m.a)({},e),{},{badges:t.payload});case"CERTIFICATES":return Object(m.a)(Object(m.a)({},e),{},{certificates:t.payload});case"CARNETS":return Object(m.a)(Object(m.a)({},e),{},{carnets:t.payload});case"BADGE":return Object(m.a)(Object(m.a)({},e),{},{badge:t.payload});case"CERTIFICATE":return Object(m.a)(Object(m.a)({},e),{},{certificate:t.payload});case"CARNET":return Object(m.a)(Object(m.a)({},e),{},{carnet:t.payload});case"LOADING":return Object(m.a)(Object(m.a)({},e),{},{loading:t.payload});case"ERROR":return Object(m.a)(Object(m.a)({},e),{},{error:t.payload});case"ORGANIZATION_ID":return Object(m.a)(Object(m.a)({},e),{},{organizationId:t.payload});case"CERTIFICATE_FIELDS":return Object(m.a)(Object(m.a)({},e),{},{certificateFields:t.payload});case"DOCUMENTS_FIELDS":return Object(m.a)(Object(m.a)({},e),{},{documentsFields:t.payload});case"FORM_DOCUMENTS":return Object(m.a)(Object(m.a)({},e),{},{formDocuments:t.payload});case"SAVE_DESIGN_DOCUMENTS":return Object(m.a)(Object(m.a)({},e),{},{saveDesignDocuments:t.payload});case"DOCUMENT":return Object(m.a)(Object(m.a)({},e),{},{document:t.payload});case"FORM":return Object(m.a)(Object(m.a)({},e),{},{form:t.payload});case"RETURN_ROUTE":return Object(m.a)(Object(m.a)({},e),{},{returnRoute:t.payload});case"SAVE_DESIGN":return Object(m.a)(Object(m.a)({},e),{},{saveDesign:t.payload});case"LENGUAGE":return Object(m.a)(Object(m.a)({},e),{},{lenguage:t.payload});case"DETAILS":return Object(m.a)(Object(m.a)({},e),{},{details:t.payload});case"STYLES":return Object(m.a)(Object(m.a)({},e),{},{styles:t.payload});case"SIGNATORIESINGUP":return Object(m.a)(Object(m.a)({},e),{},{signatorieSignUp:t.payload});case"SIGNED_DOCUMENTS":return Object(m.a)(Object(m.a)({},e),{},{signedDocuments:t.payload});case"FORM_DIPLOMAS":return Object(m.a)(Object(m.a)({},e),{},{formDiplomas:t.payload});case"DIPLOMA_FIELDS":return Object(m.a)(Object(m.a)({},e),{},{diplomaFields:t.payload});case"SEARCH_VALUE":return Object(m.a)(Object(m.a)({},e),{},{searchValue:t.payload});case"VIEW":return Object(m.a)(Object(m.a)({},e),{},{view:t.payload});case"ACTIVE":return Object(m.a)(Object(m.a)({},e),{},{active:t.payload});default:return e}},Nf=a(121),Bf=a(1234),Sf=a(411),Tf=a(577),Af=a(578),Ef=a(579),If=a(580),Df=a(581),zf=a(582),Pf=a(583),Rf=a(584),Mf=a(585),Lf=a(586),Ff=a(587),Uf=a(588),Wf=a(589),Yf=a(590),qf=a(591),Hf=a(592),Kf=a(593),Vf=a(594),Gf=a(595),Qf=a(596),Jf=a(597),Xf=a(598),Zf=a(599),$f=a(600),eh=a(601),th=a(602),ah=a(603),nh=a(604),ih=a(605),rh=a(606),ch=a(607),oh=a(608),sh=a(609),lh=a(610),dh=a(611),uh=a(612),mh=a(613),bh=a(614),ph=a(615),jh=a(616),fh=a(617),hh=a(618),gh=a(619),xh=a(620),Oh=a(621),vh=a(622),_h=a(623),yh=a(624),wh=a(625),Ch={es:{alerts:Tf,tables:Ef,buttons:Df,appBar:Pf,certificateBadgeTemplate:Mf,dialogs:Ff,selects:Wf,tabs:qf,breadCrumps:Vf,certificateBadgeCollection:Gf,certificateBadgeRecommendation:Jf,menu:Zf,certificateBadgeIssued:eh,search:ah,contracts:ih,analytics:ch,dashboard:sh,error404:dh,certifyDocuments:mh,verify:jh,loginRegister:hh,payments:xh,users:vh,parameterValues:yh,forms:a(626),dialogOtp:a(627)},en:{alerts:Af,tables:If,buttons:zf,appBar:Rf,certificateBadgeTemplate:Lf,dialogs:Uf,selects:Yf,tabs:Hf,breadCrumps:Kf,certificateBadgeCollection:Qf,certificateBadgeRecommendation:Xf,menu:$f,certificateBadgeIssued:th,search:nh,contracts:rh,analytics:oh,dashboard:lh,error404:uh,certifyDocuments:bh,verify:ph,loginRegister:fh,payments:gh,users:Oh,parameterValues:_h,forms:wh,dialogOtp:a(628)}};Sf.a.init({interpolation:{escapeValue:!1},lng:(null===(Of=window.localStorage.state)||void 0===Of||null===(vf=Of.split('"lenguage":"')[1])||void 0===vf?void 0:vf.slice(0,2))||"es",resources:Ch});var kh=Sf.a;if("undefined"!==typeof window){var Nh,Bh=function(){try{var e=localStorage.getItem("state");return null===e||0===Object.keys(JSON.parse(e)).length?{page:0,rowsPerPage:10,styles:{},searchValue:"",lenguage:"es"===window.navigator.language.slice(0,2)?"es":"en",view:0}:JSON.parse(e)}catch(t){return}}();Nh=wf.c;var Sh=Object(wf.d)(kf,Bh,Nh(Object(wf.a)(Cf.a))),Th=Object(Nf.a)();Sh.subscribe((function(){!function(e){try{var t=JSON.stringify(e);localStorage.setItem("state",t)}catch(a){console.error("Error:",a)}}(Sh.getState())})),o.a.render(Object(n.jsx)(s.a,{store:Sh,children:Object(n.jsx)(Bf.a,{i18n:kh,children:Object(n.jsx)(u.c,{history:Th,children:Object(n.jsx)(yf,{})})})}),document.getElementById("root"))}},13:function(e,t,a){"use strict";a.d(t,"b",(function(){return r})),a.d(t,"a",(function(){return c})),a.d(t,"c",(function(){return o}));var n=a(735),i=a(1015).customAlphabet,r=function(e){return n.enc.Base64.stringify(n.enc.Utf8.parse(e))},c=function(e){return n.enc.Base64.parse(e).toString(n.enc.Utf8)},o=function(e){return i("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",e)()}},178:function(e,t){},20:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));var n={certificateURL:"https://certificados.certika.co/share/certificate/",certificatesURL:"https://certificados.certika.co/share/certificates/",certificatesURLMin:"https://certificados.minciencias.gov.co/share/certificates/",apiURL:"https://api.certika.co/api",linkedinShare:"https://app.certika.co/share",linkedinShareCertificate:"https://app.certika.co/share/certificate",documentURL:"https://certificados.certika.co/share/document/",linkedinShareDocument:"https://app.certika.co/share/document",carnetURL:"https://certificados.certika.co/share/carnet/",linkedinShareCarnet:"https://app.certika.co/share/carnet",certikaURL:"https://app.certika.co",mincienciasURL:"https://app.minciencias.gov.co",faviconCertika:"https://certika-s3-bucket.s3.amazonaws.com/281d313f46d0ee0b5c796424aeca7fed/images/favicon.png",faviconMinciencias:"https://certika-s3-bucket.s3.amazonaws.com/5acedcf635f23c1a392b2df745e77103/images/favicon.png",idMinciencias:30,idEan:27,idCmlogica:32,idOrquidea:44,TEST_PAYU:!1,API_KEY_PAYU:"8hbc269ueeqB5N2XcKK13gL3cB",merchantId:"929375",accountId:"936682",keyIpData:"fc1128a1de77baa17b6a99bb67a08061c386a72b49b2ffc3a11c81b3"}},25:function(e,t,a){"use strict";var n=a(0),i=(a(1),a(15)),r=a(315),c=a(642),o=a(86),s=a(87),l=a(1247),d=a(100),u=a(1147),m=Object(r.a)((function(e){return{root:{"& > * + *":{marginTop:e.spacing(2)}},text:{color:"white"},link:{color:"white",cursor:"pointer"}}}));var b=function(e){var t=e.crumps,a=m(),i=Object(s.g)();if(t)return Object(n.jsx)("div",{className:a.root,children:Object(n.jsx)(l.a,{className:a.text,separator:"\u203a","aria-label":"breadcrumb",children:null===t||void 0===t?void 0:t.map((function(e,r){return r===t.length-1||0===r?Object(n.jsx)(d.a,{color:"inherit",children:e.name},e.name):Object(n.jsx)(u.a,{className:a.link,onClick:function(){return i.push(e.route)},children:e.name},e.name)}))})})},p=a(5),j=Object(r.a)((function(e){return{header:{display:"flex",height:"3.5em",justifyContent:"space-between",backgroundColor:p.a.primary,alignItems:"center",padding:5}}}));t.a=Object(i.b)((function(e){return{crump:e.crump||[]}}),null)((function(e){var t=e.children,a=e.crump,i=j();return Object(n.jsxs)(c.a,{className:i.header,variant:"outlined",children:[Object(n.jsx)(o.a,{container:!0,spacing:0,children:Object(n.jsx)(b,{crumps:a})}),t]})}))},404:function(module,__webpack_exports__,__webpack_require__){"use strict";var _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(14),_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4),_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(2),_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__),_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(6),_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(3),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(0),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__),react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(1),react__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__),react_redux__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(15),react_router_dom__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(87),_material_ui_core_styles__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(315),_material_ui_core__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(337),_material_ui_core__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(415),_material_ui_core__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(645),_material_ui_core__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(654),_material_ui_core__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(644),_material_ui_core__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(86),_material_ui_core__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(646),_material_ui_core__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(649),_material_ui_core__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(336),_material_ui_core__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(648),_material_ui_core__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(653),_material_ui_core__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(100),_material_ui_core__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(641),_material_ui_core__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(334),_material_ui_core__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(180),_material_ui_core__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(642),_material_ui_core__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(643),_material_ui_lab_Autocomplete__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(650),sweetalert2__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(8),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(sweetalert2__WEBPACK_IMPORTED_MODULE_28__),_components_ModuleHeader__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(25),_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(5),_api__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(9),_actions__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(10),_material_ui_core_Collapse__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(338),_utils_crypt__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(13),react_i18next__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(651),useStyles=Object(_material_ui_core_styles__WEBPACK_IMPORTED_MODULE_9__.a)((function(e){return{root:{marginTop:"1em"},button:{padding:"7px 40px"},input:{display:"none"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},avatar:{padding:5,width:"auto",height:"auto"},icon:{fontSize:"4em"},checkTextOrden:{marginLeft:"0",marginRight:"0",color:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary},buttonOrden:{color:"#0056b3",textTransform:"none",transitionProperty:"none","&:hover":{backgroundColor:"white",textDecoration:"underline"}},selectOrden:{margin:e.spacing(1.5)}}}));function CreateRecommendations(props){var _user$data_user,changeBreadcrump=props.changeBreadcrump,user=props.user,organizationId=props.organizationId,history=Object(react_router_dom__WEBPACK_IMPORTED_MODULE_8__.g)(),classes=useStyles(),_useState=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)({id_plantillas:"",id_plantillas_recomendadas:[],id_usuarios:null===(_user$data_user=user.data_user)||void 0===_user$data_user?void 0:_user$data_user.id}),_useState2=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState,2),form=_useState2[0],setForm=_useState2[1],_useState3=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)(!1),_useState4=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState3,2),loading=_useState4[0],setLoading=_useState4[1],_useState5=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)([]),_useState6=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState5,2),templates=_useState6[0],setTemplate=_useState6[1],_useState7=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)([]),_useState8=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState7,2),recommendations=_useState8[0],setRecommendations=_useState8[1],_useState9=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)([]),_useState10=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState9,2),checked=_useState10[0],setChecked=_useState10[1],_useState11=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)(!1),_useState12=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState11,2),open=_useState12[0],setOpen=_useState12[1],_useState13=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)(!1),_useState14=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState13,2),openSpacing=_useState14[0],setOpenSpacing=_useState14[1],_useState15=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)([]),_useState16=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState15,2),orden=_useState16[0],setOrden=_useState16[1],_useTranslation=Object(react_i18next__WEBPACK_IMPORTED_MODULE_35__.a)(["certificateBadgeRecommendation","buttons","alerts","breadCrumps","selects"]),_useTranslation2=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useTranslation,1),t=_useTranslation2[0];Object(react__WEBPACK_IMPORTED_MODULE_6__.useEffect)((function(){loadData().catch((function(){history.push("/500"),window.location.reload()}))}),[]);var loadData=function(){var e=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__.a)(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark((function e(){return _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:props.match.params.id?(getTempateRecommendations(),getRecommendation(),setOpen(!0),changeBreadcrump(t("breadCrumps:breadCrumps.badge-recommendation-edit",{returnObjects:!0}))):(getTemplate(),getRecommendations(),changeBreadcrump(t("breadCrumps:breadCrumps.badge-recommendation-create",{returnObjects:!0})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getRecommendation=function(){var e=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__.a)(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark((function e(){var t,a,n,i,r,c;return _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=Object(_utils_crypt__WEBPACK_IMPORTED_MODULE_34__.a)(props.match.params.id),e.next=3,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/recommendation/getRecommendations",{id_plantillas:a});case 3:n=e.sent,i=n.data,r=[],c=[],i.recommendations.recommendations.map((function(e,t){r.push(e.id_plantillas_recomendadas),c.push({no:t+1,id_recomendada:e.id_plantillas_recomendadas})})),setOrden(c),setChecked(r),setForm({id_plantillas:a,id_plantillas_recomendadas:r,id_usuarios:null===(t=user.data_user)||void 0===t?void 0:t.id});case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getRecommendations=function(){var e=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__.a)(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark((function e(){var t,a,n;return _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/recommendation/getRecommendations");case 2:a=e.sent,n=a.data,setRecommendations(null===(t=n.recommendations)||void 0===t?void 0:t.recommendations);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getTemplate=function(){var e=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__.a)(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark((function e(){var t,a,n,i,r,c,o;return _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1!==user.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios){e.next=8;break}return e.next=3,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/templateBadge/getTemplatesBadgesPublished");case 3:a=e.sent,n=a.data,setTemplate(n.templatesBadges.rows),e.next=21;break;case 8:if(6!==user.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios&&6!==(null===(t=user.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol)){e.next=16;break}return e.next=11,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/templateBadge/getTemplatesBadgesPublished");case 11:i=e.sent,r=i.data,setTemplate(r.templatesBadges.rows.filter((function(e){var t,a;return(null===e||void 0===e||null===(t=e.plantillasInsigniasHistorial[0])||void 0===t?void 0:t.id_usuarios)===(null===(a=user.data_user)||void 0===a?void 0:a.id)}))),e.next=21;break;case 16:return e.next=18,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/templateBadge/getTemplatesBadgesPublished",{id_organizaciones:organizationId});case 18:c=e.sent,o=c.data,setTemplate(o.templatesBadges.rows);case 21:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getTempateRecommendations=function(){var e=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__.a)(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark((function e(){var t,a,n,i;return _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=Object(_utils_crypt__WEBPACK_IMPORTED_MODULE_34__.a)(props.match.params.id),e.next=3,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/templateBadge/getTemplatesBadgesRecommendations",{id_plantillas:a});case 3:n=e.sent,i=n.data,6===user.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios||6===(null===(t=user.data_user.gruposUsuariosOrganizaciones[0].gruposUsuarios)||void 0===t?void 0:t.rol)?setTemplate(i.templatesBadges.filter((function(e){var t,a;return(null===e||void 0===e||null===(t=e.plantillasInsigniasHistorial[0])||void 0===t?void 0:t.id_usuarios)===(null===(a=user.data_user)||void 0===a?void 0:a.id)}))):setTemplate(i.templatesBadges);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),handleInputRecomendation=function(e,t){setOpen(!0),setOrden([{no:"",id_recomendada:""}]),setChecked(""),""===e.target.value&&setOpen(!1),setForm(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},form),{},{id_plantillas:t.id}))},handleOrden=function(e,t){orden.map((function(a){return a.id_recomendada===t&&(a[e.target.name]=e.target.value),a}))},handleClose=function(){setLoading(!1)},handleCancel=function(){history.push("/recommendations")},handleSubmit=function(e){if(e.preventDefault(),setLoading(!loading),openSpacing)setLoading(!1),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"error",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.save-order"),showConfirmButton:!1,timer:1500});else if(props.match.params.id)if(checked.length>0){var a=Object(_utils_crypt__WEBPACK_IMPORTED_MODULE_34__.a)(props.match.params.id);_api__WEBPACK_IMPORTED_MODULE_31__.a.put("/recommendation/".concat(a),Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},form)).then((function(e){handleClose(),history.push("/recommendations"),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"success",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})})).catch((function(e){handleClose(),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"error",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.edited-error"),showConfirmButton:!1,timer:1500}),history.push("/500"),window.location.reload()}))}else sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"warning",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.recommended-template"),showConfirmButton:!1,timer:1500});else checked.length>0?_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/recommendation/",Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},form)).then((function(e){setLoading(!1),history.push("/recommendations"),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"success",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.created"),showConfirmButton:!1,timer:1500})})).catch((function(e){setLoading(!1),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"error",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500}),history.push("/500"),window.location.reload()})):sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"warning",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.recommended-template"),showConfirmButton:!1,timer:1500})},privateName=function(e){var t=parseInt(e,10),a=templates.filter((function(e){return e.id===t}));return""===e?"":void 0===a[0]?""!==e.nombre_privado&&null!==e.nombre_privado?"".concat(e.nombre," (").concat(e.nombre_privado,")"):e.nombre:""!==a[0].nombre_privado&&null!==a[0].nombre_privado?"".concat(a[0].nombre," (").concat(a[0].nombre_privado,")"):a[0].nombre},loadFillDataTemplates=function(e){var t=0;return recommendations.map((function(a){return a.id_plantillas===e&&(t=1),t})),!!props.match.params.id||0!==t},loadOrdenValue=function(){return orden.map((function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_10__.a,{value:e.no,children:e.no},e.no)}))},handleToggle=function handleToggle(value){return function(){var currentIndex=checked.indexOf(value),newChecked=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(checked);if(-1===currentIndex){newChecked.push(value);var maximoNo=orden.sort((function(e,t){return e.no>t.no?1:-1})),last=maximoNo[orden.length-1];""===last.no?setOrden([{no:eval(last.no+1),id_recomendada:value}]):setOrden([].concat(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(orden),[{no:last.no+1,id_recomendada:value}]))}else{newChecked.splice(currentIndex,1);var ordenDeleted=orden.filter((function(e){return e.id_recomendada!==value})),newOrden=ordenDeleted.map((function(e,t){return{no:t+1,id_recomendada:e.id_recomendada}}));newOrden.length>0?setOrden(newOrden):setOrden([{no:"",id_recomendada:""}])}setChecked(newChecked),setForm(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},form),{},{id_plantillas_recomendadas:newChecked}))}},openOrden=function(){setOpenSpacing(!0)},saveOrden=function(){var e=[],a={};orden.filter((function(e){return!a[e.no]&&(a[e.no]=!0)})).length<orden.length?sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"error",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.order-error"),showConfirmButton:!1,timer:1500}):(orden.map((function(t){e[t.no-1]=t.id_recomendada})),setChecked(e),setForm(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},form),{},{id_plantillas_recomendadas:e})),setOrden(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(orden)),setOpenSpacing(!1))},ordenView=function(e){var t="";return orden.map((function(a){return a.id_recomendada===e?t=a.no:""})),t},loadFillDataTemplates_recommended=function(e){var t=parseInt(e);return templates.map((function(e){if(e.id!==t)return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core__WEBPACK_IMPORTED_MODULE_11__.a,{role:void 0,dense:!0,button:!0,onClick:openSpacing?"":handleToggle(e.id),children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_12__.a,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_13__.a,{alt:"Remy Sharp",src:e.linkPhoto})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_14__.a,{id:"nombre",primary:e.nombre,secondary:e.nombre_privado}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:1,lg:1,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_16__.a,{control:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_17__.a,{color:"default",edge:"end",checked:-1!==checked.indexOf(e.id),tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":e.nombre},className:classes.checkTextOrden}),label:ordenView(e.id),labelPlacement:"end"})})]},e.id)}))},loadFillDataOrden=function(e){var t=parseInt(e);return templates.map((function(e){if(e.id!==t)return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_18__.a,{className:classes.selectOrden,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_19__.a,{displayEmpty:!0,name:"no",defaultValue:ordenView(e.id),onChange:function(t){return handleOrden(t,e.id)},children:-1!==checked.indexOf(e.id)?loadOrdenValue():Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_10__.a,{disabled:!0})})})}))};function Row(){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{container:!0,spacing:4,className:classes.root,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:12,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_18__.a,{required:!0,variant:"outlined",className:"w-100",children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_lab_Autocomplete__WEBPACK_IMPORTED_MODULE_27__.a,{id:"id_plantillas",name:"id_plantillas",options:templates.sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})),getOptionLabel:function(e){return privateName(e)},onChange:handleInputRecomendation,value:form.id_plantillas,getOptionDisabled:function(e){return loadFillDataTemplates(e.id)},renderInput:function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_20__.a,Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{label:t("selects:selects-autocompletes.recommendation-select"),variant:"outlined"}))}})})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:12,lg:12,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core_Collapse__WEBPACK_IMPORTED_MODULE_33__.a,{in:open,timeout:"auto",unmountOnExit:!0,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{container:!0,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:10,lg:11,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_21__.a,{variant:"h6",children:t("certificateBadgeRecommendation:badge-certificate-recommendation-form.select-template-recommendate")})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:2,lg:1,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_21__.a,{variant:"h6",children:t("certificateBadgeRecommendation:badge-certificate-recommendation-form.order")})})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_22__.a,{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{container:!0,spacing:1,lg:12,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:openSpacing?10:12,lg:openSpacing?11:12,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_23__.a,{children:loadFillDataTemplates_recommended(form.id_plantillas)})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:2,lg:1,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core_Collapse__WEBPACK_IMPORTED_MODULE_33__.a,{in:openSpacing,timeout:"auto",unmountOnExit:!0,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_23__.a,{children:loadFillDataOrden(form.id_plantillas)})})})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{container:!0,spacing:1,lg:12,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:9,lg:10}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:3,lg:2,children:openSpacing?Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_24__.a,{onClick:saveOrden,className:classes.buttonOrden,children:t("buttons:buttons.save-order")}):Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_24__.a,{onClick:openOrden,className:classes.buttonOrden,children:t("buttons:buttons.change-order")})})]})]})})]})})}return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment,{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_components_ModuleHeader__WEBPACK_IMPORTED_MODULE_29__.a,{create:"false"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_25__.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_26__.a,{className:"p-3",children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("form",{className:classes.root,onSubmit:handleSubmit,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_21__.a,{component:"h6",variant:"h6",children:t("certificateBadgeRecommendation:badge-certificate-recommendation-form.template-recommendation")}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(Row,{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"text-center ".concat(classes.root),children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_24__.a,{color:"primary",variant:"contained",className:"my-2 ".concat(classes.button),type:"submit",disableElevation:!0,children:t("buttons:buttons.save")}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_24__.a,{color:"primary",variant:"contained",className:"my-2 ".concat(classes.button),onClick:handleCancel,disableElevation:!0,children:t("buttons:buttons.cancel")})]})]})})})]})}var mapStateToProps=function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}},mapDispatchToProps={changeBreadcrump:_actions__WEBPACK_IMPORTED_MODULE_32__.a};__webpack_exports__.a=Object(react_redux__WEBPACK_IMPORTED_MODULE_7__.b)(mapStateToProps,mapDispatchToProps)(CreateRecommendations)},405:function(module,__webpack_exports__,__webpack_require__){"use strict";var _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(14),_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4),_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(2),_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__),_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(6),_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(3),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(0),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__),react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(1),react__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__),react_redux__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(15),react_router_dom__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(87),_material_ui_core_styles__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(315),_material_ui_core__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(337),_material_ui_core__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(415),_material_ui_core__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(645),_material_ui_core__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(654),_material_ui_core__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(644),_material_ui_core__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(86),_material_ui_core__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(646),_material_ui_core__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(649),_material_ui_core__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(336),_material_ui_core__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(648),_material_ui_core__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(653),_material_ui_core__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(100),_material_ui_core__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(641),_material_ui_core__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(334),_material_ui_core__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(180),_material_ui_core__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(642),_material_ui_core__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(643),_material_ui_lab_Autocomplete__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(650),sweetalert2__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(8),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(sweetalert2__WEBPACK_IMPORTED_MODULE_28__),_components_ModuleHeader__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(25),_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(5),_api__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(9),_actions__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(10),_material_ui_core_Collapse__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(338),_utils_crypt__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(13),react_i18next__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(651),useStyles=Object(_material_ui_core_styles__WEBPACK_IMPORTED_MODULE_9__.a)((function(e){return{root:{marginTop:"1em"},button:{padding:"7px 40px"},input:{display:"none"},backdrop:{zIndex:e.zIndex.drawer+1,color:"#fff"},avatar:{padding:5,width:"auto",height:"auto"},icon:{fontSize:"4em"},checkTextOrden:{marginLeft:"0",marginRight:"0",color:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary},buttonOrden:{color:"#0056b3",textTransform:"none",transitionProperty:"none","&:hover":{backgroundColor:"white",textDecoration:"underline"}},selectOrden:{margin:e.spacing(1.5)}}}));function CreateRecommendations(props){var _user$data_user,changeBreadcrump=props.changeBreadcrump,user=props.user,organizationId=props.organizationId,history=Object(react_router_dom__WEBPACK_IMPORTED_MODULE_8__.g)(),classes=useStyles(),_useState=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)({id_plantillas_certificados:"",id_plantillas_certificados_recomendadas:[],id_usuarios:null===(_user$data_user=user.data_user)||void 0===_user$data_user?void 0:_user$data_user.id}),_useState2=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState,2),form=_useState2[0],setForm=_useState2[1],_useState3=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)(!1),_useState4=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState3,2),loading=_useState4[0],setLoading=_useState4[1],_useState5=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)([]),_useState6=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState5,2),templates=_useState6[0],setTemplate=_useState6[1],_useState7=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)([]),_useState8=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState7,2),recommendations=_useState8[0],setRecommendations=_useState8[1],_useState9=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)([]),_useState10=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState9,2),checked=_useState10[0],setChecked=_useState10[1],_useState11=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)(!1),_useState12=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState11,2),open=_useState12[0],setOpen=_useState12[1],_useState13=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)(!1),_useState14=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState13,2),openSpacing=_useState14[0],setOpenSpacing=_useState14[1],_useState15=Object(react__WEBPACK_IMPORTED_MODULE_6__.useState)([]),_useState16=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useState15,2),orden=_useState16[0],setOrden=_useState16[1],_useTranslation=Object(react_i18next__WEBPACK_IMPORTED_MODULE_35__.a)(["certificateBadgeRecommendation","buttons","alerts","breadCrumps","selects"]),_useTranslation2=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.a)(_useTranslation,1),t=_useTranslation2[0];Object(react__WEBPACK_IMPORTED_MODULE_6__.useEffect)((function(){loadData().catch((function(){history.push("/500"),window.location.reload()}))}),[]);var loadData=function(){var e=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__.a)(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark((function e(){return _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:props.match.params.id?(getTempateRecommendations(),getRecommendation(),setOpen(!0),changeBreadcrump(t("breadCrumps:breadCrumps.certificate-recommendation-edit",{returnObjects:!0}))):(getTemplate(),getRecommendations(),changeBreadcrump(t("breadCrumps:breadCrumps.certificate-recommendation-create",{returnObjects:!0})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getRecommendation=function(){var e=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__.a)(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark((function e(){var t,a,n,i,r,c;return _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=Object(_utils_crypt__WEBPACK_IMPORTED_MODULE_34__.a)(props.match.params.id),e.next=3,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/recommendation/getRecommendations",{id_plantillas_certificados:a});case 3:n=e.sent,i=n.data,r=[],c=[],i.recommendations.recommendationsCertificate.map((function(e,t){r.push(e.id_plantillas_certificados_recomendadas),c.push({no:t+1,id_recomendada:e.id_plantillas_certificados_recomendadas})})),setOrden(c),setChecked(r),setForm({id_plantillas_certificados:a,id_plantillas_certificados_recomendadas:r,id_usuarios:null===(t=user.data_user)||void 0===t?void 0:t.id});case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getRecommendations=function(){var e=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__.a)(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark((function e(){var t,a,n;return _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/recommendation/getRecommendations");case 2:a=e.sent,n=a.data,setRecommendations(null===(t=n.recommendations)||void 0===t?void 0:t.recommendationsCertificate);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getTemplate=function(){var e=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__.a)(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark((function e(){var t,a,n,i,r,c;return _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1!==user.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios){e.next=8;break}return e.next=3,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/certificateTemplate/getCertificateTemplatesPublished");case 3:t=e.sent,a=t.data,setTemplate(a.certificateTemplates.rows),e.next=21;break;case 8:if(6!==user.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios){e.next=16;break}return e.next=11,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/certificateTemplate/getCertificateTemplatesPublished");case 11:n=e.sent,i=n.data,setTemplate(i.certificateTemplates.rows.filter((function(e){var t,a;return(null===e||void 0===e||null===(t=e.plantillasCertificadosHistorial[0])||void 0===t?void 0:t.id_usuarios)===(null===(a=user.data_user)||void 0===a?void 0:a.id)}))),e.next=21;break;case 16:return e.next=18,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/certificateTemplate/getCertificateTemplatesPublished",{id_organizaciones:organizationId});case 18:r=e.sent,c=r.data,setTemplate(c.certificateTemplates.rows);case 21:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),getTempateRecommendations=function(){var e=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__.a)(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark((function e(){var t,a,n;return _home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Object(_utils_crypt__WEBPACK_IMPORTED_MODULE_34__.a)(props.match.params.id),e.next=3,_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/certificateTemplate/getCertificateTemplatesRecommendations",{id_plantillas_certificados:t});case 3:a=e.sent,n=a.data,6===user.data_user.gruposUsuariosOrganizaciones[0].id_grupos_usuarios?setTemplate(n.certificateTemplates.filter((function(e){var t,a;return(null===e||void 0===e||null===(t=e.plantillasCertificadosHistorial[0])||void 0===t?void 0:t.id_usuarios)===(null===(a=user.data_user)||void 0===a?void 0:a.id)}))):setTemplate(n.certificateTemplates);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),handleInputRecomendation=function(e,t){setOpen(!0),setOrden([{no:"",id_recomendada:""}]),setChecked(""),""===e.target.value&&setOpen(!1),setForm(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},form),{},{id_plantillas_certificados:t.id}))},handleOrden=function(e,t){orden.map((function(a){return a.id_recomendada===t&&(a[e.target.name]=e.target.value),a}))},handleClose=function(){setLoading(!1)},handleCancel=function(){history.push("/recommendations/certificate")},handleSubmit=function(e){if(e.preventDefault(),setLoading(!loading),openSpacing)setLoading(!1),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"error",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.save-order"),showConfirmButton:!1,timer:1500});else if(props.match.params.id)if(checked.length>0){var a=Object(_utils_crypt__WEBPACK_IMPORTED_MODULE_34__.a)(props.match.params.id);_api__WEBPACK_IMPORTED_MODULE_31__.a.put("/recommendation/".concat(a),Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},form)).then((function(e){handleClose(),history.push("/recommendations/certificate"),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"success",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.edited"),showConfirmButton:!1,timer:1500})})).catch((function(e){handleClose(),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"error",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.recommended-template"),showConfirmButton:!1,timer:1500}),history.push("/500"),window.location.reload()}))}else sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"warning",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.recommended-template"),showConfirmButton:!1,timer:1500});else checked.length>0?_api__WEBPACK_IMPORTED_MODULE_31__.a.post("/recommendation/",Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},form)).then((function(e){setLoading(!1),history.push("/recommendations/certificate"),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"success",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.created"),showConfirmButton:!1,timer:1500})})).catch((function(e){setLoading(!1),sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"error",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.created-error"),showConfirmButton:!1,timer:1500}),history.push("/500"),window.location.reload()})):sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"warning",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.recommended-template"),showConfirmButton:!1,timer:1500})},privateName=function(e){var t=parseInt(e,10),a=templates.filter((function(e){return e.id===t}));return""===e?"":void 0===a[0]?""!==e.nombre_privado?"".concat(e.nombre," (").concat(e.nombre_privado,")"):e.nombre:""!==a[0].nombre_privado?"".concat(a[0].nombre," (").concat(a[0].nombre_privado,")"):a[0].nombre},loadFillDataTemplates=function(e){var t=0;return recommendations.map((function(a){return a.id_plantillas_certificados===e&&(t=1),t})),!!props.match.params.id||0!==t},loadOrdenValue=function(){return orden.map((function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_10__.a,{value:e.no,children:e.no},e.no)}))},handleToggle=function handleToggle(value){return function(){var currentIndex=checked.indexOf(value),newChecked=Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(checked);if(-1===currentIndex){newChecked.push(value);var maximoNo=orden.sort((function(e,t){return e.no>t.no?1:-1})),last=maximoNo[orden.length-1];""===last.no?setOrden([{no:eval(last.no+1),id_recomendada:value}]):setOrden([].concat(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(orden),[{no:last.no+1,id_recomendada:value}]))}else{newChecked.splice(currentIndex,1);var ordenDeleted=orden.filter((function(e){return e.id_recomendada!==value})),newOrden=ordenDeleted.map((function(e,t){return{no:t+1,id_recomendada:e.id_recomendada}}));newOrden.length>0?setOrden(newOrden):setOrden([{no:"",id_recomendada:""}])}setChecked(newChecked),setForm(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},form),{},{id_plantillas_certificados_recomendadas:newChecked}))}},openOrden=function(){setOpenSpacing(!0)},saveOrden=function(){var e=[],a={};orden.filter((function(e){return!a[e.no]&&(a[e.no]=!0)})).length<orden.length?sweetalert2__WEBPACK_IMPORTED_MODULE_28___default.a.fire({icon:"error",iconColor:_assets_styles_colors__WEBPACK_IMPORTED_MODULE_30__.a.primary,text:t("alerts:alerts.order-error"),showConfirmButton:!1,timer:1500}):(orden.map((function(t){e[t.no-1]=t.id_recomendada})),setChecked(e),setForm(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},form),{},{id_plantillas_certificados_recomendadas:e})),setOrden(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(orden)),setOpenSpacing(!1))},ordenView=function(e){var t="";return orden.map((function(a){return a.id_recomendada===e?t=a.no:""})),t},loadFillDataTemplates_recommended=function(e){var t=parseInt(e);return templates.map((function(e){if(e.id!==t)return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core__WEBPACK_IMPORTED_MODULE_11__.a,{role:void 0,dense:!0,button:!0,onClick:openSpacing?"":handleToggle(e.id),children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_12__.a,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_13__.a,{alt:"Remy Sharp",variant:"square",src:e.linkPhoto})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_14__.a,{id:"nombre",primary:e.nombre,secondary:e.nombre_privado}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:1,lg:1,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_16__.a,{control:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_17__.a,{color:"default",edge:"end",checked:-1!==checked.indexOf(e.id),tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":e.nombre},className:classes.checkTextOrden}),label:ordenView(e.id),labelPlacement:"end"})})]},e.id)}))},loadFillDataOrden=function(e){var t=parseInt(e);return templates.map((function(e){if(e.id!==t)return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_18__.a,{className:classes.selectOrden,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_19__.a,{displayEmpty:!0,name:"no",defaultValue:ordenView(e.id),onChange:function(t){return handleOrden(t,e.id)},children:-1!==checked.indexOf(e.id)?loadOrdenValue():Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_10__.a,{disabled:!0})})})}))};function Row(){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{container:!0,spacing:4,className:classes.root,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:12,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_18__.a,{required:!0,variant:"outlined",className:"w-100",children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_lab_Autocomplete__WEBPACK_IMPORTED_MODULE_27__.a,{id:"id_plantillas_certificados",name:"id_plantillas_certificados",options:templates.sort((function(e,t){return e.nombre.toLowerCase()<t.nombre.toLowerCase()?-1:1})),getOptionLabel:function(e){return privateName(e)},onChange:handleInputRecomendation,value:form.id_plantillas_certificados,getOptionDisabled:function(e){return loadFillDataTemplates(e.id)},renderInput:function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_20__.a,Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_home_circleci_project_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{label:t("selects:selects-autocompletes.recommendation-select"),variant:"outlined"}))}})})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:12,lg:12,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core_Collapse__WEBPACK_IMPORTED_MODULE_33__.a,{in:open,timeout:"auto",unmountOnExit:!0,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{container:!0,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:10,lg:11,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_21__.a,{variant:"h6",children:t("certificateBadgeRecommendation:badge-certificate-recommendation-form.select-template-recommendate")})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:2,lg:1,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_21__.a,{variant:"h6",children:t("certificateBadgeRecommendation:badge-certificate-recommendation-form.order")})})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_22__.a,{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{container:!0,spacing:1,lg:12,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:openSpacing?10:12,lg:openSpacing?11:12,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_23__.a,{children:loadFillDataTemplates_recommended(form.id_plantillas_certificados)})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:2,lg:1,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core_Collapse__WEBPACK_IMPORTED_MODULE_33__.a,{in:openSpacing,timeout:"auto",unmountOnExit:!0,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_23__.a,{children:loadFillDataOrden(form.id_plantillas_certificados)})})})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{container:!0,spacing:1,lg:12,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:9,lg:10}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_15__.a,{item:!0,xs:3,lg:2,children:openSpacing?Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_24__.a,{onClick:saveOrden,className:classes.buttonOrden,children:t("buttons:buttons.save-order")}):Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_24__.a,{onClick:openOrden,className:classes.buttonOrden,children:t("buttons:buttons.change-order")})})]})]})})]})})}return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment,{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_components_ModuleHeader__WEBPACK_IMPORTED_MODULE_29__.a,{create:"false"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_25__.a,{className:"m-0 w-100 p-0 border-0",elevation:0,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_26__.a,{className:"p-3",children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("form",{className:classes.root,onSubmit:handleSubmit,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_21__.a,{component:"h6",variant:"h6",children:t("certificateBadgeRecommendation:badge-certificate-recommendation-form.template-recommendation")}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(Row,{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"text-center ".concat(classes.root),children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_24__.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(classes.button),type:"submit",children:t("buttons:buttons.save")}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_24__.a,{disableElevation:!0,color:"primary",variant:"contained",className:"my-2 ".concat(classes.button),onClick:handleCancel,children:t("buttons:buttons.cancel")})]})]})})})]})}var mapStateToProps=function(e){return{user:e.user,organizationId:e.organizationId||e.user.data_user.gruposUsuariosOrganizaciones[0].id_organizaciones}},mapDispatchToProps={changeBreadcrump:_actions__WEBPACK_IMPORTED_MODULE_32__.a};__webpack_exports__.a=Object(react_redux__WEBPACK_IMPORTED_MODULE_7__.b)(mapStateToProps,mapDispatchToProps)(CreateRecommendations)},497:function(e,t){},5:function(e,t,a){"use strict";var n,i,r,c,o,s,l,d,u,m,b,p,j,f,h,g,x,O,v=a(32),_=a.n(v),y=a(20),w=function(e){var t="",a="";switch(window.location.origin===y.a.certikaURL?_()({url:"".concat(y.a.apiURL,"/organization/backoffice/",1),method:"get"}).then((function(e){t=e.data.organization.styles.colors})):window.location.origin===y.a.mincienciasURL&&_()({url:"".concat(y.a.apiURL,"/organization/backoffice/").concat(y.a.idMinciencias),method:"get"}).then((function(e){t=e.data.organization.styles})),e){case"primary":a=t.primary;break;case"secondary":a=t.secondary;break;case"tertiary":a=t.tertiary;break;case"background":a=t.background;break;case"footer":a=t.footer;break;case"error":a=t.error}return a},C={primary:"".concat(window.localStorage.state?null===(n=JSON.parse(window.localStorage.state))||void 0===n||null===(i=n.styles)||void 0===i||null===(r=i.colors)||void 0===r?void 0:r.primary:w("primary")),secondary:"".concat(window.localStorage.state?null===(c=JSON.parse(window.localStorage.state))||void 0===c||null===(o=c.styles)||void 0===o||null===(s=o.colors)||void 0===s?void 0:s.secondary:w("secondary")),tertiary:"".concat(window.localStorage.state?null===(l=JSON.parse(window.localStorage.state))||void 0===l||null===(d=l.styles)||void 0===d||null===(u=d.colors)||void 0===u?void 0:u.tertiary:w("tertiary")),background:"".concat(window.localStorage.state?null===(m=JSON.parse(window.localStorage.state))||void 0===m||null===(b=m.styles)||void 0===b||null===(p=b.colors)||void 0===p?void 0:p.background:w("background")),footer:"".concat(window.localStorage.state?null===(j=JSON.parse(window.localStorage.state))||void 0===j||null===(f=j.styles)||void 0===f||null===(h=f.colors)||void 0===h?void 0:h.footer:w("footer")),error:"".concat(window.localStorage.state?null===(g=JSON.parse(window.localStorage.state))||void 0===g||null===(x=g.styles)||void 0===x||null===(O=x.colors)||void 0===O?void 0:O.error:w("error"))};t.a=C},577:function(e){e.exports=JSON.parse('{"alerts":{"skill-alert":"Debe seleccionar por lo menos una habilidad.","img-alert":"Debe subir una imagen.","url-alert":"URL informaci\xf3n adicional no v\xe1lida.","url-criteria-alert":"URL criterio no v\xe1lida.","created":"Creado exitosamente.","created-error":"No se ha podido crear.","edited":"Editado exitosamente.","edited-error":"No se ha podido editar.","copied":"Copiado exitosamente.","copied-error":"No se ha podido copiar","deleted":"Eliminado exitosamente","deleted-error":"No se ha podido eliminar","archived":"Archivado exitosamente.","archived-error":"No se ha podido archivar","published":"Publicado exitosamente","published-error":"No se ha podido publicar","aproved":"Aprobado exitosamente","copy-button":"\xbfEst\xe1 seguro que desea copiar la plantilla insignia?","archive-button":"\xbfEst\xe1 seguro que desea archivar la plantilla insignia?","delete-button":"\xbfEst\xe1 seguro que desea eliminar la plantilla insignia?","publish-button":"\xbfEst\xe1 seguro que desea publicar la plantilla insignia?","aprove-button":"\xbfEst\xe1 seguro que desea aprobar esta organizaci\xf3n?","delete-register":"\xbfEst\xe1 seguro que desea eliminar este registro?","save-order":"Guarde el orden","recommended-template":"Recomienda una plantilla","order-error":"Orden incoherente","does-exit-template":"No existe la plantilla.","first-name-invalid":"Es inv\xe1lido\xa0el campo primer_nombre_receptor.","midle-name-invalid":"Es inv\xe1lido\xa0el campo segundo_nombre_receptor.","last-name-invalid":"Es inv\xe1lido\xa0el campo primer_apellido_receptor.","second-last-name-invalid":"Es inv\xe1lido\xa0el campo segundo_apellido_receptor.","template-assigned":"Ya tienes asignada la plantilla","for-user":"para el usuario","template-issued":"Ya fue emitida la plantilla","email-invalid":"Es inv\xe1lido\xa0el campo email_receptor.","identification-type-invalid":"Es inv\xe1lido\xa0el campo tipo_identificacion.","identification-invalid":"Es inv\xe1lido\xa0el campo identificacion","phone-number-invalid":"Es inv\xe1lido\xa0el campo numero_celular","indicative-invalid":"Es inv\xe1lido\xa0el campo indicativo_pa\xeds","whatsapp-invalid":"Es inv\xe1lido\xa0el campo whatsapp_receptor","telegram-invalid":"Es inv\xe1lido\xa0el campo numero_telegram","link-merit":"Es inv\xe1lido\xa0el campo link_merito","empty-merit":"El m\xe9rito no puede ser vac\xedo.","expiration-date-invalid":"Es inv\xe1lido\xa0el campo fecha_expiracion","button-emit-1":"\xbfEst\xe1 seguro que desea emitir","button-emit-2":"insignias?","button-emit-certificate-2":"certificados?","button-emit-diplomas-2":"diplomas?","exceeds-contract":"Esta emisi\xf3n supera la cantidad de emisiones establecida en su contrato.","expired-contract":"Su contrato est\xe1 vencido.","badges-issued":"Insignias emitidas exitosamente.","all-badges-correctly":"Todas las insignias se entregaron correctamente, no se presentaron rebotes.","all-certificates-correctly":"Todos los certificados se entregaron correctamente, no se presentaron rebotes.","all-carnets-correctly":"Todos los carnets se entregaron correctamente, no se presentaron rebotes.","template":"insignia","templates":"insignias","no-delivered":"no entregada","no-delivered-plural":"no entregadas","certificate":"certificado","certificates":"certificados","no-delivered-certificate":"no entregado","no-delivered-plural-certificate":"no entregados","bounds-presented":"se presentaron rebotes.","analyzing-deliveries":"Analizando entregas.","template-issued-error":"No se ha podido emitir las insignias.","certificate-issued-error":"No se ha podido emitir los certificados.","diploma-issued-error":"No se ha podido emitir los diplomas.","no-contract-error":"No puede emitir porque no tiene un contrato establecido.","preloaded":"Se han precargado","of":"de","rows":"filas.","no-badge-issue":"No\xa0hay\xa0insignias\xa0a\xa0emitir, compruebe que\xa0sus\xa0registros\xa0tengan\xa0el\xa0formato\xa0correcto.","rows-2":"Las filas","no-requirements":"no cumplen los requisitos","exceeded-limit":"Ha superado el l\xedmite de registros permitidos.","row":"Fila","errors":"errores","revoke-undo-1":"\xbfEst\xe1 seguro que desea","revoke-undo-2":"esta insignia?","revoke-undo-2-certificate":"este certificado?","revoke-undo-2-documents":"este documento?","revoke-message":"Ingrese una breve descripci\xf3n con el motivo de la revocaci\xf3n.","message-here":"Escribe tu mensaje aqu\xed...","write-message":"Escribe un mensaje","revoke":"Revocado exitosamente.","revoke-error":"No se pudo revocar.","undo-revoke":"Desrevocado exitosamente.","undo-revoke-error":"No se pudo desrevocar.","revoke-group":"\xbfEst\xe1 seguro que desea revocar este grupo de insignias?","badge-no-accepted":"Insignia no aceptada","resend":"\xbfEst\xe1\xa0seguro\xa0que\xa0desea\xa0volver a enviar un correo a los usuarios que no han aceptado su insignia?","email-sent":"Correos enviados exitosamente.","badges-to-accept":"No hay insignias por aceptar.","email-sent-error":"No se pudo enviar.","create-account":"Crear cuenta","email-account":"\xbfEst\xe1\xa0seguro\xa0que\xa0desea enviar un correo a los usuarios que no han creado una cuenta?","no-accouts":"No hay cuentas por crear.","share-badge":"Compartir insignia","email-share":"\xbfEst\xe1\xa0seguro\xa0que\xa0desea enviar un correo a los usuarios que no han compartido su insignia?","no-share-badge":"Se han enviado el m\xe1ximo de recordatorios o no hay insignias por compartir.","copy-button-certificate":"\xbfEst\xe1 seguro que desea copiar la plantilla certificado?","archive-button-certificate":"\xbfEst\xe1 seguro que desea archivar la plantilla certificado?","delete-button-certificate":"\xbfEst\xe1 seguro que desea eliminar la plantilla certificado?","publish-button-certificate":"\xbfEst\xe1 seguro que desea publicar la plantilla certificado?","copy-button-carnet":"\xbfEst\xe1 seguro que desea copiar la plantilla carnet?","archive-button-carnet":"\xbfEst\xe1 seguro que desea archivar la plantilla carnet?","delete-button-carnet":"\xbfEst\xe1 seguro que desea eliminar la plantilla carnet?","publish-button-carnet":"\xbfEst\xe1 seguro que desea publicar la plantilla carnet?","template-certificate-alert":"Debe subir una plantilla.","horizontal-certificates":"El tama\xf1o recomendado para certificados horizontales es de 950x660 p\xedxeles.","vertical-certificates":"El tama\xf1o recomendado para certificados verticales es de 668x890 p\xedxeles.","no-design-certificate":"No ha dise\xf1ado el certificado.","no-accepted-design-certificate":"No ha aceptado el dise\xf1o del certificado.","error-ocurred":"Ha ocurrido un error, por favor intenta m\xe1s tarde.","saved":"Guardado exitosamente.","analytics-index-alert-range-dates-invalid":"Rango de fechas inv\xe1lido.","analytics-index-alert-no-datas":"No hay datos para los filtros aplicados.","analytics-index-alert-delete-filter":"\xbfEst\xe1 seguro que desea borrar el filtro?","analytics-index-alert-select-groups-issued":"Debe seleccionar un grupo de emisi\xf3n","download-template":"Descargue nuestra plantilla para asegurarse de que sus registros tengan el formato correcto.","certificate-code-error":"El c\xf3digo del certificado no corresponde con el certificado seleccionado","field-invalid":"Es inv\xe1lido el campo","message-size":"El mensaje debe contener entre 60 a 300 caracteres","message-issue":"Hola, te invitamos a que aceptes, ingreses y compartas tu certificado","message-issue-badge":"Hola (nombre usuario), te invitamos a que aceptes, ingreses y compartas tu insignia","message-issue-carnet":"Hola, te invitamos a que aceptes, ingreses y compartas tu carnet","certificates-issued":"Los certificados est\xe1n siendo emitidos.","diplomas-issued":"Los diplomas est\xe1n siendo emitidos.","expiration-date-equal":"Las fechas de expiraci\xf3n deben ser iguales","no-certificate-to-issue":"No hay certificados a emitir, compruebe que sus registros tengan el formato correcto.","revoke-certificate-group":"\xbfEst\xe1 seguro que desea revocar este grupo de certificados?","certificate-no-accepted":"Certificado no aceptado","resend-certificate":"\xbfEst\xe1 seguro que desea volver a enviar un correo a los usuarios que no han aceptado su certificado?","certificate-issue":"Emision de certificados","send-certificates":"\xbfEst\xe1 seguro que desea enviar el correo de emision a los usuarios de este grupo?","resend-issue-certificate":"\xbfEst\xe1\xa0seguro\xa0que\xa0desea\xa0volver a enviar un correo de emisi\xf3n a este usuario?","certificates-to-accept":"No hay certificados por aceptar.","share-certificate":"Compartir certificado","email-share-certificate":"\xbfEst\xe1\xa0seguro\xa0que\xa0desea enviar un correo a los usuarios que no han compartido su certificado?","no-share-certificate":"Se han enviado el m\xe1ximo de recordatorios o no hay certificados por compartir.","user-no-found":"Usuario no encontrado","badge-accepted":"Insignia Aceptada","close-session":"\xbfDesea cerrar la sesi\xf3n actual?","certificate-accepted":"Certificado aceptado","carnet-accepted":"Carnet aceptado","access-denied":"Acceso denegado","certificate-field":"Debe a\xf1adir al menos un campo","certificate-no-design-page":"No ha dise\xf1ado todas las p\xe1ginas del certificado","certificate-all-fields":"Debe llenar todos los campos","copy-button-documents":"\xbfEst\xe1 seguro que desea copiar la plantilla documento?","archive-button-documents":"\xbfEst\xe1 seguro que desea archivar la plantilla documento?","delete-button-documents":"\xbfEst\xe1 seguro que desea eliminar la plantilla documento?","publish-button-documents":"\xbfEst\xe1 seguro que desea publicar la plantilla documento?","horizontal-documents":"El tama\xf1o recomendado para los documentos horizontales es de 768x700 p\xedxeles.","vertical-documents":"El tama\xf1o recomendado para los documentos verticales es de 400x990 p\xedxeles.","no-design-documents":"No ha dise\xf1ado el documento.","no-accepted-design-documents":"No ha aceptado el dise\xf1o del documento.","error-organization":"Debe seleccionar una organizaci\xf3n.","no-select-template-documents":"No ha seleccionado una plantilla.","no-select-folder-documents":"No ha seleccionado una carpeta.","new-templates-of-edited":"Si contin\xfaas, tu dise\xf1o ser\xe1 una nueva plantilla. \xbfDeseas continuar?","yes-option":"Si","download-document-certify":"\xbfDesea descargar el documento certificado?","template-carnet-alert-field-image":"Debe subir una imagen.","template-carnet-alert-field-image-size":"Solo se permiten im\xe1genes 200x200.","carnet-code-error":"El c\xf3digo del carnet no corresponde con el carnet seleccionado","button-emit-carnet-2":"carnet?","carnets-issued":"Los carnets est\xe1n siendo emitidos.","carnet":"carnet","carnets":"carnets","no-delivered-carnet":"no entregado","no-delivered-plural-carnet":"no entregados","carnet-issued-error":"No se ha podido emitir los carnets.","no-carnet-to-issue":"No hay carnet a emitir, compruebe que sus registros tengan el formato correcto.","revoke-undo-2-carnet":"este carnet?","revoke-carnet-group":"\xbfEst\xe1 seguro que desea revocar este grupo de carnets?","see-carnet":"Recordatorio ver carnet","resend-carnet":"\xbfEst\xe1 seguro que desea volver a enviar un correo a los usuarios que no han visto su carnet?","carnets-to-see":"No hay carnets por ver.","share-carnet":"Compartir carnet","email-share-carnet":"\xbfEst\xe1 seguro que desea enviar un correo a los usuarios que no han compartido su carnet?","no-share-carnet":"No hay carnets por compartir.","delete-report":"\xbfEst\xe1 seguro que desea eliminar este reporte?","delete-report-success-title":"Reporte eliminado.","delete-report-success-text":"El reporte se ha eliminado con \xe9xito.","close-report":"\xbfEst\xe1 seguro que desea cerrar el reporte? Perder\xe1 la informaci\xf3n.","close-report-message":"\xbfEst\xe1 seguro de cerrar el mensaje? Perder\xe1 la informaci\xf3n.","close-case":"\xbfEst\xe1 seguro de finalizar el caso?","close-case-success-title":"Solicitud terminada.","close-case-success-text":"La solicitud se ha finalizado con \xe9xito.","no-answer":"No ha ingresado una respuesta.","send-message-success-title":"Mensaje enviado","send-message-success-text":"Tu respuesta ha sido enviada con \xe9xito.","no-message":"No ha ingresado un mensaje.","report-send-success":"Tu reporte ha sido enviado con \xe9xito. Pronto nos comunicaremos contigo","max-template-certificate-alert":"Solo se permite m\xe1ximo 3 im\xe1genes por certificado.","no-equals-format":"Las im\xe1genes no tienen el mismo formato.","delete-additinal-document":"\xbfEst\xe1 seguro que desea eliminar este documento adicional?","delete-additinal-link":"\xbfEst\xe1 seguro que desea eliminar este link adicional?","certificate-field-name-exists":"El nombre del campo ya existe.","send":"Enviar","cancel":"Cancelar","email-send-invalid":"Correo Inv\xe1lido","send-document":"\xbfDesea enviar el documento por correo electr\xf3nico?","email-send-document":"Introduzca el correo electr\xf3nico al cual va a enviar el documento.","whatsapp-send-invalid":"N\xfamero Inv\xe1lido","whatsapp-send-document":"Introduzca el n\xfamero de WhatsApp, incluyendo el indicativo al cual va a enviar el documento.","send-successfully":"Documento enviado exitosamente.","exit":"\xbfEst\xe1 seguro que desea salir?","info-template":"Hemos actualizado nuestra plantilla, si anteriormente ya la has descargado, actual\xedzala descarg\xe1ndola nuevamente.","try-again":"Ha ocurrido un error, intenta nuevamente.","user-incorrect":"Usuario o contrase\xf1a incorrecta","password-lenght":"La contrase\xf1a debe tener m\xednimo entre 8 y 15 caracteres,\\n una letra min\xfascula, una may\xfascula, un n\xfamero y un car\xe1cter especial.","password-match":"Las contrase\xf1as ingresadas no coinciden","email-confirm-account":"Se ha enviado un correo para confirmar tu cuenta","account-exist":"Ya existe una cuenta con este correo","thanks-register":"Gracias por registrarte","required-documents-name":"Debe darle un nombre a su documento.","required-template-name":"Debe darle un nombre a su nueva plantilla.","required-folder-name":"Debe darle un nombre a su nueva carpeta.","cancel-progress":"Perder\xe1 todo su dise\xf1o y configuraci\xf3n inicial. \xbfEst\xe1 seguro que desea cancelar el proceso?","delete-signature":"Si la firma est\xe1 aplicada al dise\xf1o, se eliminar\xe1 y tambi\xe9n se eliminar\xe1 de tus registros. \xbfEst\xe1s seguro de que desea eliminar la firma?","buy-issues":"Est\xe1 seguro que desea comprar","issues-for":"emisiones por","sign-in-signatorie":"Inicia sesi\xf3n para revisar y firmar el documento que se te ha enviado.","document-have-signature":"Ya has firmado este documento.","sing-up-signatorie":"Completa el registro asignando una contrase\xf1a para revisar y firmar el documento que se te ha enviado.","successful-sign-up":"Registro exitoso","user-no-is-signatorie":"El usuario en sesi\xf3n no corresponde con el usuario que debe firmar el documento.","document-already":"Este documento ya ha sido firmado.","error-sign-the-document":"Debe firmar el documento","successfully-signed":"Firmado exitosamente","successfully-signed-text-still-parts":"A\xfan faltan partes por firmar, cuando todas las partes completen el proceso, recibir\xe1s una notificaci\xf3n.","signer-already":"Ya fue agregado este firmante","message-use-your-sign":"Para a\xf1adir tu firma usa,\\n<Agregar Firma> o escoge una ya creada","document-send-signatorie":"El Documento ha sido enviado a los firmantes, recibir\xe1s una notificaci\xf3n cuando est\xe9 firmado por todas las partes.","signatories-no-template":"Si agregas firmantes ya no se guardar\xe1 tu plantilla. \xbfDeseas continuar?","no-fields":"El documento no ha sido firmado.","warning-block":"Si est\xe1s utilizando alguna extensi\xf3n para filtrar tipos de contenido (cookies, anuncios, publicidad), por favor deshabil\xedtala para continuar.","no-additional-document":"Este documento no tiene campos adicionales.","diploma-code-error":"El c\xf3digo del diploma no corresponde con el diploma seleccionado","publish-button-diploma":"\xbfEst\xe1 seguro que desea publicar esta plantilla de diploma?","copy-button-diploma":"\xbfEst\xe1 seguro que desea copiar esta plantilla de diploma?","delete-button-diploma":"\xbfEst\xe1 seguro que desea eliminar esta plantilla de diploma?","archive-button-diploma":"\xbfEst\xe1 seguro que desea archivar esta plantilla de diploma?","delete-button-user":"\xbfEst\xe1 seguro que desea archivar este usuario?","birthdate-invalid":"Fecha de nacimiento invalida.","url-profile-error":"Url de perfil se encuentra asignada.","url-website-error":"Url de p\xe1gina web incorrecto.","issued-limit-error-1":"El usuario ya tiene","issued-limit-error-2":"emisiones, no puede establecer un l\xedmite menor a este.","issued-limit-error-3":"El l\xedmite de emisiones asignado, es mayor que las emisiones disponibles en su plan.","issued-limit-error-4":"emisiones, debe establecer un l\xedmite de emisiones mayor a este.","email-error":"Ya existe un usuario asignado a este correo electr\xf3nico.","template-copy":"C\xf3digo de plantilla copiado.","delete-button-parameter":"\xbfEst\xe1 seguro que desea eliminar este par\xe1metro?\\n Revise que no tenga asignaciones.","delete-parameter-value":"\xbfEst\xe1 seguro que desea eliminar este valor par\xe1metro?\\n Revise que no tenga asignaciones.","alert-delete-parameter-value":"Al guardar, se eliminar\xe1 por completo el valor par\xe1metro: ","delete-button-contract":"\xbfEst\xe1 seguro que desea eliminar este contrato?","delete-button-module":"\xbfEst\xe1 seguro que desea eliminar este m\xf3dulo?","delete-button-userGroup":"\xbfEst\xe1 seguro que desea eliminar este grupo de usuario?","error-delete-userGroup":"No se puede eliminar este registro, ya tiene asociaciones.","user-register":"Ya est\xe1 registrado en nuestra base de datos","user-create-batch":"\xbfEst\xe1 seguro que desea crear","user-create-batch-2":"usuarios?","user-assigned":"Ya se encuentr\xe1 asignado el email","delete-button-permission":"\xbfEst\xe1 seguro que desea eliminar este permiso?","no-actions":"No hay acciones","successful-definition":"Definici\xf3n exitosa","no-defined":"No se ha podido definir","organization-issue-error":"Acci\xf3n imposible, la organizaci\xf3n ya emiti\xf3 insignias.","delete-button-organization":"\xbfEst\xe1 seguro que desea eliminar esta organizaci\xf3n?.","url-social-invalid":"Url De Red Social no v\xe1lida.","select-social-network":"Seleccione Un Tipo de Red Social","link-social-network":"Ingresa El Link De Tu Red Social","nit-error":"El NIT digitado ya se encuentra asociado a una organizaci\xf3n.","logo-error":"Ingresa un logo","document-no-available":"Lo sentimos, este documento ya no est\xe1 disponible.","sure-sign":"\xbfEst\xe1 seguro que desea firmar el documento con esta firma?","email-not-valid":"Correo no es v\xe1lido","send-reminder":"\xbfEst\xe1 seguro de enviar un correo electr\xf3nico a los firmantes recordando hacer el proceso de firma?","send-successfull":"Recordatorios enviados exitosamente","no-send-by-many-in-day":"Ya ha enviado recordatorios el d\xeda de hoy, intente ma\xf1ana nuevamente","no-send-by-many":"Ha superado el n\xfamero de recordatorios permitidos para este documento","sure-selected-signature":"\xbfEst\xe1 seguro que desea firmar el documento con esta firma?"},"notifications":{"organization":"La organizaci\xf3n","issued":"ha emitido","badges":"insignias","certificates":"certificados","carnets":"carnets","clear":"Limpiar","received":"Has recibido","new-badge":"una nueva insignia","new-certificate":"un nuevo certificado","new-carnet":"un nuevo carnet","from":"de parte de","msg-invite":"Hola, te invitamos a que aceptes, y compartas tu","badge":"insignia","certificate":"certificado","carnet":"carnet","issued-by":"Emitido por:","see-card":"Ver carnet","report-error":"Reportar error","accept":"Aceptar","reject":"Rechazar"}}')},578:function(e){e.exports=JSON.parse('{"alerts":{"skill-alert":"You must select at least one skill.","img-alert":"You must upload an image.","url-alert":"Invalid additional url information.","url-criteria-alert":"Invalid url criteria.","created":"Successfully created.","created-error":"Could not create.","edited":"Successfully edited.","edited-error":"Could not edit.","copied":"Successfully copied.","copied-error":"Could not copy","deleted":"Successfully deleted","deleted-error":"Could not delete","archived":"Successfully Archived.","archived-error":"Could not archive","published":"Successfully published","aproved":"Successfully aproved","published-error":"Could not publish","copy-button":"Are you sure you want to copy the badge template?","archive-button":"Are you sure you want to archive the badge template?","delete-button":"Are you sure you want to delete the badge template?","publish-button":"Are you sure you want to publish the badge template?","aprove-button":"Are you sure you want to aprove the organization?","delete-register":"Are you sure you want to delete this record?","save-order":"Save the order","recommended-template":"Recommend a Template","order-error":"Inconsistent order","does-exit-template":"Template does not exist.","first-name-invalid":"The receiver_first_name field is invalid","midle-name-invalid":"The receiver_middle_name field is invalid","last-name-invalid":"The receiver_last_name field is invalid","second-last-name-invalid":"The receiver_second_last_name field is invalid","template-assigned":"You already have the template assigned","for-user":"for the user","template-issued":"The template has already been issued","email-invalid":"The receiver_email field is invalid","identification-type-invalid":"The identification_type field is invalid","identification-invalid":"The identification field is invalid.","phone-number-invalid":"The phone_number field is invalid","indicative-invalid":"The indicative_country field is invalid","whatsapp-invalid":"The whatsapp_receiver field is invalid","telegram-invalid":"The telegram_number field is invalid","link-merit":"The link_merit field is invalid","empty-merit":"Merit cannot be empty.","expiration-date-invalid":"The expiration_date field is invalid","button-emit-1":"Are you sure you want to issue","button-emit-2":"badges?","button-emit-certificate-2":"certificates?","button-emit-diplomas-2":"diplomas?","exceeds-contract":"This emission exceeds the amount of emissions established in your contract.","expired-contract":"Your contract is expired.","badges-issued":"Badges issued successfully.","all-badges-correctly":"All badges were delivered correctly, no bounces were presented.","all-certificates-correctly":"All certificates were delivered correctly, there were no bounces.","all-carnets-correctly":"All carnets were delivered correctly, there were no bounces.","template":"badge","templates":"badges","no-delivered":"Undelivered","no-delivered-plural":"Undelivered","certificate":"certificate","certificates":"certificates","no-delivered-certificate":"Undelivered","no-delivered-plural-certificate":"Undelivered","bounds-presented":"rebounds were presented.","analyzing-deliveries":"Analyzing deliveries.","template-issued-error":"Badges could not be issued.","certificate-issued-error":"The certificates could not be issued.","diploma-issued-error":"The diplomas could not be issued.","no-contract-error":"You cannot issue because you do not have an established contract.","preloaded":"Have been preloaded","of":"of","rows":"rows.","no-badge-issue":"There are no badges to issue, check that your records are in the correct format.","rows-2":"The rows","no-requirements":"do not meet the requirements","exceeded-limit":"You have exceeded the limit of allowed registrations.","row":"Row","errors":"errors","revoke-undo-1":"Are you sure you want","revoke-undo-2":"this badge?","revoke-undo-2-certificate":"this certificate?","revoke-undo-2-documents":"this document?","revoke-message":"Enter a short description with the reason for the revocation.","message-here":"Write your message here...","write-message":"Write a message","revoke":"Successfully revoked.","revoke-error":"Cannot be revoked.","undo-revoke":"Successfully unrevoked.","undo-revoke-error":"Could not be unrevocated.","revoke-group":"Are you sure you want to revoke this badge group?","badge-no-accepted":"Badge not accepted","resend":"Are you sure you want to resend email to users who have not accepted your badge?","email-sent":"Emails sent successfully.","badges-to-accept":"There are no badges to accept.","email-sent-error":"It could not send.","create-account":"Create Account","email-account":"Are you sure you want to send an email to users who have not created an account?","no-accouts":"There are no accounts to create.","share-badge":"Share badge","email-share":"Are you sure you want to send an email to users who have not shared their badge?","no-share-badge":"The maximum number of reminders have been sent or there are no badges to share.","copy-button-certificate":"Are you sure you want to copy the certificate template?","archive-button-certificate":"Are you sure you want to archive the certificate template?","delete-button-certificate":"Are you sure you want to delete the certificate template?","publish-button-certificate":"Are you sure you want to publish the certificate template?","copy-button-carnet":"Are you sure you want to copy the carnet template?","archive-button-carnet":"Are you sure you want to archive the carnet template?","delete-button-carnet":"Are you sure you want to delete the carnet template?","publish-button-carnet":"Are you sure you want to publish the carnet template?","template-certificate-alert":"You must upload a template.","horizontal-certificates":"The recommended size for horizontal certificates is 950x660 pixels.","vertical-certificates":"The recommended size for vertical certificates is 668x890 pixels.","no-design-certificate":"You have not designed the certificate.","no-accepted-design-certificate":"You have not accepted the certificate design.","error-ocurred":"An error has occurred, please try again later.","saved":"Successfully saved.","analytics-index-alert-range-dates-invalid":"Invalid date range.","analytics-index-alert-no-datas":"There is no data for the applied filters.","analytics-index-alert-delete-filter":"Are you sure you want to clear the filter?","analytics-index-alert-select-groups-issued":"You must select a group issue","download-template":"Download our template to make sure your records are formatted correctly.","certificate-code-error":"The certificate code does not correspond to the selected certificate","field-invalid":"The field is invalid","message-size":"The message must contain between 60 to 300 characters","message-issue":"Hello, we invite you to accept, login and share your certificate","message-issue-badge":"Hello (username), we invite you to accept, login and share your badge","message-issue-carnet":"Hello, we invite you to accept, login and share your carnet","certificates-issued":"Certificates are being issued.","expiration-date-equal":"Expiration dates must be the same","no-certificate-to-issue":"There are no certificates to issue, check that your records are in the correct format.","revoke-certificate-group":"Are you sure you want to revoke this group of certificates?","certificate-no-accepted":"Certificate not accepted","resend-certificate":"Are you sure you want to resend an email to users who have not accepted your certificate?","resend-issue-certificate":"Are you sure you want to resend issue mail to this user?","certificate-issue":"Certificate issue","send-certificates":"Are you sure you want to send the certificate issue email to the users in this group?","certificates-to-accept":"There are no certificates to accept.","share-certificate":"Share certificate","email-share-certificate":"Are you sure you want to send an email to users who have not shared their certificate?","no-share-certificate":"The maximum number of reminders have been sent or there are no certificates to share.","user-no-found":"User not found","badge-accepted":"Badge Accepted","close-session":"Do you want to close the current session?","certificate-accepted":"Certificate Accepted","carnet-accepted":"Carnet Accepted","access-denied":"Access denied","certificate-field":"You must add at least one field","certificate-no-design-page":"You have not designed all the pages of the certificate","certificate-all-fields":"You must fill all the fields","copy-button-documents":"Are you sure you want to copy the documents template?","archive-button-documents":"Are you sure you want to archive the documents template?","delete-button-documents":"Are you sure you want to delete the documents template?","publish-button-documents":"Are you sure you want to publish the documents template?","horizontal-documents":"The recommended size for horizontal documents is at least 768x700 pixels.","vertical-documents":"The recommended size for vertical documents is at least 400x990 pixels.","no-design-documents":"You have not designed the document.","no-accepted-design-documents":"You have not accepted the document design.","error-organization":"You must select an organization.","no-select-template-documents":"You must select a template.","no-select-folder-documents":"You must select a folder.","new-templates-of-edited":"If you continue, your design it will be a new template. Do you want to continue?","yes-option":"Yes","download-document-certify":"Do you want to download the certified document?","template-carnet-alert-field-image":"You must upload a image.","template-carnet-alert-field-image-size":"Only 200x200 images are allowed.","carnet-code-error":"The certificate code does not correspond to the selected carnet","button-emit-carnet-2":"carnet?","carnets-issued":"Carnets are being issued.","carnet":"carnet","carnets":"carnets","no-delivered-carnet":"Undelivered","no-delivered-plural-carnet":"Undelivered","carnet-issued-error":"The certificates could not be issued.","no-carnet-to-issue":"There are no carnets to issue, check that your records are in the correct format.","revoke-undo-2-carnet":"this carnet?","revoke-carnet-group":"Are you sure you want to revoke this group of carnet?","see-carnet":"Reminder see carnet","resend-carnet":"Are you sure you want to resend an email to users who have not viewed your carnet?","carnets-to-see":"There are no carnets to see.","share-carnet":"Share carnet","email-share-carnet":"Are you sure you want to send an email to users who have not shared their carnet?","no-share-carnet":"There are no carnets to share.","delete-report":"Are you sure you want to delete this report?","delete-report-success-title":"Report removed.","delete-report-success-text":"The report has been removed successfully.","close-report":"Are you sure you want to close the report? You will lose the information.","close-report-message":"Are you sure to close the message? You will lose the information.","close-case":"Are you sure you finish the case?","close-case-success-title":"Application completed.","close-case-success-text":"The request has been completed successfully.","no-answer":"You have not entered an answer.","send-message-success-title":"Message sent","send-message-success-text":"Your reply has been sent successfully.","no-message":"You have not entered a message.","report-send-success":"Your report has been sent successfully. We will contact you soon","max-template-certificate-alert":"Only a maximum of 3 images are allowed per certificate.","no-equals-format":"The images do not have the same format.","delete-additinal-document":"Are you sure you want to delete this additional document?","delete-additinal-link":"Are you sure you want to delete this additional link?","certificate-field-name-exists":"The field name already exists.","send":"Send","cancel":"Cancel","email-send-invalid":"Invalid Email","send-document":"Do you want to send the document by email?","email-send-document":"Enter the email to which you are going to send the document.","whatsapp-send-invalid":"Invalid Number","whatsapp-send-document":"Enter the WhatsApp number, including the code to which you are going to send the document.","send-successfully":"Document sent successfully.","exit":"Are you sure you want to exit?","info-template":"We have updated our template, if you have previously downloaded it, update it by downloading it again.","try-again":"An error has occurred, please try again.","user-incorrect":"Incorrect username or password","password-lenght":"The password must have a minimum of 8 to 15 characters, a lowercase letter, an uppercase letter, a number and a special character.","password-match":"Passwords entered do not match.","email-confirm-account":"An email has been sent to confirm your account","account-exist":"An account already exists with this email","thanks-register":"Thank you for signing up","required-documents-name":"You must give your document a name.","required-template-name":"You must give your new template a name.","required-folder-name":"You must give your new folder a name.","cancel-progress":"You will lose all your initial layout and settings. Are you sure you want to cancel the process?","delete-signature":"If the signature is applied to the design, it will be removed and it will also be removed from your records. Are you sure you want to remove the signature?","buy-issues":"Are you sure you want to buy","issues-for":"issues for","sign-in-signatorie":"Login to review and sign the document that has been sent to you.","document-have-signature":"You have already signed this document.","sing-up-signatorie":"Complete the registration by assigning a password to review and sign the document that has been sent to you.","successful-sign-up":"Successful registration","user-no-is-signatorie":"The user in session does not correspond to the user who must sign the document.","document-already":"This document has already been signed.","error-sign-the-document":"You must sign the document","successfully-signed":"Successfully signed","successfully-signed-text-still-parts":"There are still parts to sign, when all parts complete the process, you will receive a notification.","signer-already":"This signer has already been added","message-use-your-sign":"To add your signature use,\\n<Add Signature> or choose an already created one,","document-send-signatorie":"The Document has been sent to the signatories, you will receive a notification when it is signed by all parties.","signatories-no-template":"Adding signers will no longer save your template. Do you want to continue?","no-fields":"The document has not been signed.","warning-block":"If you are using an extension to filter types of content (cookies, ads, advertising), please disable it to continue.","no-additional-document":"This document has no additional fields.","diploma-code-error":"The diploma code does not correspond to the selected diploma","publish-button-diploma":"Are you sure you want to publish the diploma template?","copy-button-diploma":"Are you sure you want to copy the diploma template?","delete-button-diploma":"Are you sure you want to delete the diploma template?","archive-button-diploma":"Are you sure you want to archive the diploma template?","delete-button-user":"Are you sure you want to delete the user?","birthdate-invalid":"Invalid birthdate.","url-profile-error":"Profile URL is already assigned.","url-website-error":"Incorrect website URL.","issued-limit-error-1":"The user already has ","issued-limit-error-2":"issues, so you cannot set a limit lower than this.","issued-limit-error-3":"The assigned issue limit exceeds the available issues in your plan.","issued-limit-error-4":"issues, you must set an issue limit higher than this.","email-error":"A user is already assigned to this email address.","template-copy":"Template code copied.","delete-button-parameter":"Are you sure you want to delete this parameter?\\n Please review to ensure it has no assignments.","delete-parameter-value":"Are you sure you want to delete this parameter value?\\n Please review to ensure it has no assignments.","alert-delete-parameter-value":"Saving will completely remove the parameter value: ","delete-button-contract":"Are you sure you want to delete this contract?","delete-button-module":"Are you sure you want to delete this module?","delete-button-userGroup":"Are you sure you want to delete this user group?","error-delete-userGroup":"This record cannot be deleted, it already has associations.","user-register":"You are already registered in our database","user-create-batch":"Are you sure you want to create","user-create-batch-2":"users?","user-assigned":"The email is already assigned","delete-button-permission":"Are you sure you want to delete this permission?","no-actions":"No actions available","successful-definition":"Successful definition","no-defined":"Could not be defined","organization-issue-error":"Impossible action, the organization has already issued badges.","delete-button-organization":"Are you sure you want to delete this organization?","url-social-invalid":"Invalid Social Media URL.","select-social-network":"Select a Social Media Type","link-social-network":"Enter Your Social Media Link","nit-error":"The entered NIT is already associated with an organization.","logo-error":"Please, provide a logo","document-no-available":"Sorry, this document is no longer available.","sure-sign":"Are you sure you want to sign the document with this signature?","email-not-valid":"Email is not valid","send-reminder":"Are you sure you send an email to the signers, remembering to do the signing process?","send-successfull":"Reminders sends successfully","no-send-by-many-in-day":"You\'ve already sent reminders today, try tomorrow","no-send-by-many":"You have already exceeded the number of reminders allowed for this document","sure-selected-signature":"Are you sure you want to sign the document with this signature?"},"notifications":{"organization":"The organization","issued":"has issued","badges":"badges","certificates":"certificates","carnets":"ID Cards","clear":"Clear","received":"You have received","new-badge":"a new badge","new-certificate":"a new certificate","new-carnet":"a new ID Card","from":"from","msg-invite":"Hello, we invite you to accept and share your","badge":"badge","certificate":"certificate","carnet":"ID Card","issued-by":"Issued by:","see-card":"See card","report-error":"Report error","accept":"Accept","reject":"Reject"}}')},579:function(e){e.exports=JSON.parse('{"table":{"empty-table":"No hay datos registrados","empty-table-diploma":"No hay diplomas por firmar","rows-per-page":"Filas por p\xe1gina","no-assignend":"No asignada","without-organization":"Sin organizaci\xf3n","state":{"published":"Publicado","edited":"En edici\xf3n","archived":"Archivado","pending":"Pendiente","approved":"Aprobado"},"state-issue":{"pending":"Pendiente","accepted":"Aceptada","rejected":"Rechazada","bounced-mail":"Correo Rebotado","revoked":"Revocada","issued":"Emitida"},"state-issue-certificate":{"pending":"Pendiente","accepted":"Aceptado","rejected":"Rechazado","bounced-mail":"Correo Rebotado","revoked":"Revocado","issued":"Emitido"},"state-reports-carnets":{"waiting":"En espera","process":"En proceso","finished":"Finalizado","issued":"Emitido","viewed":"Visto","revoked":"Revocado","report":"Reporte","bounced-mail":"Correo Rebotado"},"tooltip":{"details":"Ver Detalles","edit":"Editar","add":"Agregar","publish":"Publicar","copy":"Copiar","preview":"Vista Previa","archive":"Archivar","delete":"Eliminar","history":"Historial","assigned-templates":"Ver Plantillas Asignadas","view-template":"Ver Plantilla","recommended-templates":"Ver Plantillas Recomendadas","revoke":"Revocar","undo-revoke":"Desrevocar","export":"Exportar","upgrade":"Actualizar","view-badge":"Ver Insignia","view-certificate":"Ver Certificado","view-certificates":"Ver Certificados","sent-email":"Enviar correos","download":"Descargar pdf","view-document":"Ver Documento","view-carnet":"Ver Carnet","view-message":"Ver mensajes","upload-additional-field":"Subir campo adicional","view-additional-field":"Ver campos adicionales","multy":"Incluir en todas las p\xe1ginas","share":"Compartir","edit-config":"Editar informaci\xf3n general","clean":"Limpiar","send-copy":"Enviar una copia","download-code":"Descargar c\xf3digos","view-accounts":"Ver cuentas","view-all":"Ver todos","download-certificate":"Descargar certificados","to-download":"Descargar","aprove":"Aprobar"},"columns-published-archived":[{"id":"insignia","label":"Insignia","align":"center"},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Emitidos","align":"center","orden":"insigniasEmitidas"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":" ","align":"center","colSpan":5}],"columns-published-archived-super":[{"id":"insignia","label":"Insignia","align":"center"},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Emitidos","align":"center","orden":"insigniasEmitidas"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":" ","align":"center","colSpan":5}],"columns-edited":[{"id":"insignia","label":"Insignia","align":"center"},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":" ","align":"center","colSpan":6}],"columns-edited-super":[{"id":"insignia","label":"Insignia","align":"center"},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":" ","align":"center","colSpan":6}],"columns-history":[{"id":"date","label":"Fecha","align":"center","orden":"fecha_accion"},{"id":"hour","label":"Hora","align":"center"},{"id":"update","label":"Usuario","align":"center","orden":"usuarios.primer_nombre"},{"id":"type","label":"Tipo de acci\xf3n","align":"center"},{"id":"","label":" ","align":"center"}],"columns-collections":[{"id":"badge","label":"","align":"center"},{"id":"collection","label":"Colecci\xf3n","align":"center","orden":"nombre"},{"id":"organization","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"templates","label":"Plantillas","align":"center","orden":"templates"},{"id":"history","label":"Historial"},{"id":"edit","label":"","minWidth":10,"align":"center"},{"id":"delete","label":"","minWidth":10,"align":"center"}],"template-assigned":[{"id":"insignia","label":"Insignia","align":"center"},{"id":"name","label":"Nombre P\xfablico","align":"center","orden":"plantillasInsignias.nombre"},{"id":"private_name","label":"Nombre Privado","align":"center","orden":"plantillasInsignias.nombre_privado"},{"id":"tipo","label":"Organizaci\xf3n","align":"center"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"plantillasInsignias.fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center"}],"columns-recommendations":[{"id":"","label":"Plantilla","minWidth":10,"align":"center"},{"id":"name","label":"Nombre P\xfablico","minWidth":10,"align":"center","orden":"plantillasInsignias.nombre"},{"id":"private_name","label":"Nombre Privado","minWidth":10,"align":"center","orden":"plantillasInsignias.nombre_privado"},{"id":"id_plantilla_recomendada","label":"Plantillas recomendadas","minWidth":10,"align":"center"},{"id":"history","label":"Historial"},{"id":"edit","label":""},{"id":"delete","label":""}],"columns-recommended-assigned":[{"id":"insignia","label":"Insignia","align":"center"},{"id":"name","label":"Nombre P\xfablico","align":"center","orden":"plantillasInsigniasRecomendadas.nombre"},{"id":"private_name","label":"Nombre Privado","align":"center","orden":"plantillasInsigniasRecomendadas.nombre_privado"},{"id":"tipo","label":"Organizaci\xf3n","align":"center"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"plantillasInsigniasRecomendadas.fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center"}],"columns-template-user-batch":[{"id":"index","label":"#","minWidth":50,"align":"center"},{"id":"documento","label":"documento","minWidth":50,"align":"center","orden":"data.documento"},{"id":"email","label":"email","minWidth":50,"align":"center","orden":"data.email"},{"id":"indicativo_pais","label":"indicativo_pais","minWidth":50,"align":"center","orden":"data.indicativo_pais"},{"id":"celular","label":"celular","minWidth":50,"align":"center","orden":"data.celular"},{"id":"primer_nombre","label":"primer_nombre","minWidth":50,"align":"center","orden":"data.primer_nombre"},{"id":"segundo_nombre","label":"segundo_nombre","minWidth":50,"align":"center","orden":"data.segundo_nombre"},{"id":"primer_apellido","label":"primer_apellido","minWidth":50,"align":"center","orden":"data.primer_apellido"},{"id":"segundo_apellido","label":"segundo_apellido","minWidth":50,"align":"center","orden":"data.segundo_apellido"}],"columns-template-badge-issue":[{"id":"index","label":"#","minWidth":50,"align":"center"},{"id":"id_plantilla","label":"id_plantilla","minWidth":200,"align":"center","orden":"data.id_plantilla"},{"id":"email_receptor","label":"email_receptor","minWidth":50,"align":"center","orden":"data.email_receptor"},{"id":"indicativo_pais","label":"indicativo_pais","minWidth":50,"align":"center","orden":"data.indicativo_pais"},{"id":"whatsapp_receptor","label":"whatsapp_receptor","minWidth":50,"align":"center","orden":"data.whatsapp_receptor"},{"id":"tipo_identificacion","label":"tipo_identificacion","minWidth":50,"align":"center","orden":"data.tipo_identificacion"},{"id":"identificacion","label":"identificacion","minWidth":50,"align":"center","orden":"data.identificacion"},{"id":"primer_nombre_receptor","label":"primer_nombre_receptor","minWidth":50,"align":"center","orden":"data.primer_nombre_receptor"},{"id":"segundo_nombre_receptor","label":"segundo_nombre_receptor","minWidth":50,"align":"center","orden":"data.segundo_nombre_receptor"},{"id":"primer_apellido_receptor","label":"primer_apellido_receptor","minWidth":50,"align":"center","orden":"data.primer_apellido_receptor"},{"id":"segundo_apellido_receptor","label":"segundo_apellido_receptor","minWidth":50,"align":"center","orden":"data.segundo_apellido_receptor"},{"id":"numero_celular","label":"numero_celular","minWidth":50,"align":"center","orden":"data.numero_celular"},{"id":"numero_telegram","label":"numero_telegram","minWidth":50,"align":"center","orden":"data.numero_telegram"},{"id":"merito","label":"merito","minWidth":50,"align":"center","orden":"data.merito"},{"id":"link_merito","label":"link_merito","minWidth":50,"align":"center","orden":"data.link_merito"},{"id":"fecha_expiracion","label":"fecha_expiracion","minWidth":50,"align":"center","orden":"data.fecha_expiracion"}],"columns-badges-issued":[{"id":"group","label":"Grupo","minWidth":150,"align":"center","orden":"gruposInsigniasEmitidas.nombre"},{"id":"state","label":"Estado","minWidth":50,"align":"center"},{"id":"badge","label":"Insignia","minWidth":50,"align":"center"},{"id":"date","label":"Fecha emisi\xf3n","minWidth":50,"align":"center","orden":"fecha_emision"},{"id":"name","label":"Nombres","minWidth":100,"align":"center","orden":"primer_nombre_receptor"},{"id":"lastname","label":"Apellidos","minWidth":100,"align":"center","orden":"primer_apellido_receptor"},{"id":"email","label":"Email","minWidth":100,"align":"center","orden":"email_receptor"},{"id":"tipo_id","label":"Tipo de identificaci\xf3n","minWidth":100,"align":"center","orden":"tipo_identificacion"},{"id":"id","label":"Identificaci\xf3n","minWidth":100,"align":"center","orden":"identificacion"},{"id":"code","label":"C\xf3digo insignia","minWidth":200,"align":"center","orden":"codigo_insignia"},{"id":"badgename","label":"Nombre P\xfablico insignia","minWidth":200,"align":"center","orden":"plantillasInsignias.nombre"},{"id":"badgenamePrivate","label":"Nombre Privado insignia","minWidth":200,"align":"center","orden":"plantillasInsignias.nombre_privado"},{"id":"expiratedate","label":"Fecha expiraci\xf3n","minWidth":10,"align":"center","orden":"fecha_expiracion"},{"id":"celular","label":"Celular","minWidth":100,"align":"center","orden":"numero_celular"},{"id":"whatsapp","label":"WhatsApp","minWidth":100,"align":"center","orden":"whatsapp_receptor"},{"id":"telegram","label":"Telegram","minWidth":100,"align":"center","orden":"numero_telegram"},{"id":"merito","label":"Merito","minWidth":400,"align":"center","orden":"merito"},{"id":"link_merito","label":"Link Merito","minWidth":200,"align":"center","orden":"link_merito"},{"id":"account","label":"Cuenta","minWidth":50,"align":"center","orden":"email_receptor"},{"id":"correos_emision","label":"No. correos Emisi\xf3n","minWidth":150,"align":"center","orden":"correos_emision"},{"id":"correos_aceptar_insignia","label":"No. correos Aceptar insignia","minWidth":170,"align":"center","orden":"correos_aceptar_insignia"},{"id":"correos_crear_cuenta","label":"No. correos Crear cuenta","minWidth":150,"align":"center","orden":"correos_crear_cuenta"},{"id":"correos_compartir _insignia","label":"No. correos Compatir insignia","minWidth":170,"align":"center","orden":"correos_compartir_insignia"},{"id":"correos_revocar","label":"No. correos Revocar","minWidth":170,"align":"center","orden":"correos_revocar"},{"id":"facebook","label":"No. veces compartidas en Facebook","minWidth":170,"align":"center"},{"id":"linkedin","label":"No. veces compartidas en Linkedin","minWidth":170,"align":"center"},{"id":"twitter","label":"No. veces compartidas en Twitter","minWidth":170,"align":"center"},{"id":"whatsapp","label":"No. veces compartidas en Whatsapp","minWidth":170,"align":"center"},{"id":"telegram","label":"No. veces compartidas en Telegram","minWidth":170,"align":"center"},{"id":"delete","label":"","minWidth":10,"align":"center"}],"columns-badges-issued-excel":["Grupo","Estado","Fecha emisi\xf3n","Primer nombre","Segundo nombre","Primer apellido","Segundo apellido","Email","WhatsApp","Tipo de identificaci\xf3n","Identificaci\xf3n","C\xf3digo insignia","Nombre p\xfablico insignia","Nombre privado insignia","Fecha expiraci\xf3n","Celular","Telegram","M\xe9rito","Link m\xe9rito","Cuenta","No. correos Emisi\xf3n","No. correos Aceptar insignia","No. correos Crear cuenta","No. correos Compatir insignia","No. correos Revocar insignia","Facebook","LinkedIn","Twitter","WhatsApp","Telegram"],"columns-certificate-issued":{"columns-start":[{"id":"","label":"","minWidth":"10","align":"center"},{"id":"group","label":"Grupo","minWidth":"150","align":"center","orden":"gruposInsigniasEmitidas.nombre"},{"id":"state","label":"Estado","minWidth":"50","align":"center"},{"id":"date","label":"Fecha emisi\xf3n","minWidth":"50","align":"center","orden":"fecha_emision"},{"id":"email","label":"Email","minWidth":"100","align":"center","orden":"email_receptor"}],"columns-end":[{"id":"code","label":"C\xf3digo Certificado","minWidth":"200","align":"center","orden":"codigo_certificado"},{"id":"certificateMame","label":"Nombre P\xfablico Certificado","minWidth":"200","align":"center","orden":"plantillasCertificados.nombre"},{"id":"certificateMamePrivate","label":"Nombre Privado Certificado","minWidth":"200","align":"center","orden":"plantillasCertificados.nombre_privado"},{"id":"expiratedate","label":"Fecha expiraci\xf3n","minWidth":"10","align":"center","orden":"fecha_expiracion"},{"id":"account","label":"Cuenta","minWidth":"50","align":"center","orden":"email_receptor"},{"id":"correos_emision","label":"No. correos Emisi\xf3n","minWidth":"150","align":"center","orden":"correos_emision"},{"id":"correos_aceptar_certificado","label":"No. correos Aceptar certificado","minWidth":"170","align":"center","orden":"correos_aceptar_certificado"},{"id":"correos_crear_cuenta","label":"No. correos Crear cuenta","minWidth":"150","align":"center","orden":"correos_crear_cuenta"},{"id":"correos_compartir_certificado","label":"No. correos Compatir certificado","minWidth":"170","align":"center","orden":"correos_compartir_certificado"},{"id":"correos_revocar","label":"No. correos Revocar","minWidth":"170","align":"center","orden":"correos_revocar"},{"id":"facebook","label":"No. veces compartidos en Facebook","minWidth":"170","align":"center"},{"id":"linkedin","label":"No. veces compartidos en Linkedin","minWidth":"170","align":"center"},{"id":"twitter","label":"No. veces compartidos en Twitter","minWidth":"170","align":"center"},{"id":"whatsapp","label":"No. veces compartidos en Whatsapp","minWidth":"170","align":"center"},{"id":"telegram","label":"No. veces compartidos en Telegram","minWidth":"170","align":"center"},{"id":"email","label":"","minWidth":"10","align":"center"},{"id":"delete","label":"","minWidth":"10","align":"center"}]},"columns-certificate-published-archived":[{"id":"certificado","label":"Certificado","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Emitidos","align":"center","orden":"certificadosEmitidos"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-certificate-edited":[{"id":"certificado","label":"Certificado","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-certificate-published-archived-super":[{"id":"certificado","label":"Certificado","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Emitidos","align":"center","orden":"certificadosEmitidos"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-certificate-edited-super":[{"id":"certificado","label":"Certificado","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-certificate-recommendations":[{"id":"","label":"Plantilla","width":150,"align":"center"},{"id":"name","label":"Nombre P\xfablico","minWidth":10,"align":"center","orden":"plantillasCertificados.nombre"},{"id":"private_name","label":"Nombre Privado","minWidth":10,"align":"center","orden":"plantillasCertificados.nombre_privado"},{"id":"id_plantilla_recomendada","label":"Plantillas recomendadas","minWidth":10,"align":"center"},{"id":"history","label":"Historial"},{"id":"edit","label":""},{"id":"delete","label":""}],"columns-certificate-recommended-assigned":[{"id":"certificado","label":"Certificado","align":"center","width":150},{"id":"name","label":"Nombre P\xfablico","align":"center","orden":"plantillasCertificadosRecomendadas.nombre"},{"id":"private_name","label":"Nombre Privado","align":"center","orden":"plantillasCertificadosRecomendadas.nombre_privado"},{"id":"tipo","label":"Organizaci\xf3n","align":"center"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"plantillasCertificadosRecomendadas.fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center"}],"template-certificate-assigned":[{"id":"insignia","label":"Certificado","align":"center","width":150},{"id":"name","label":"Nombre P\xfablico","align":"center","orden":"plantillasCertificados.nombre"},{"id":"private_name","label":"Nombre Privado","align":"center","orden":"plantillasCertificados.nombre_privado"},{"id":"tipo","label":"Organizaci\xf3n","align":"center"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"plantillasCertificados.fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center"}],"columns-group-badges-issued":[{"id":"date","label":"Fecha emisi\xf3n","minWidth":50,"align":"center","orden":"fecha_emision"},{"id":"name","label":"Nombre","minWidth":100,"align":"center","orden":"nombre"},{"id":"organization","label":"Organizaci\xf3n","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"user","label":"Usuario emisor","minWidth":100,"align":"center","orden":"usuarios.primer_nombre"},{"id":"issued","label":"Insignias emitidas","align":"center","orden":"BadgesIssued"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":4}],"columns-group-certificates-issued":[{"id":"date","label":"Fecha emisi\xf3n","minWidth":50,"align":"center","orden":"fecha_emision"},{"id":"name","label":"Nombre","minWidth":100,"align":"center","orden":"nombre"},{"id":"organization","label":"Organizaci\xf3n","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"user","label":"Usuario emisor","minWidth":100,"align":"center","orden":"usuarios.primer_nombre"},{"id":"issued","label":"Certificados emitidos","align":"center","orden":"certificateIssued"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":4}],"columns-documents-published-archived":[{"id":"documento","label":"Documento","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Certificados","align":"center","orden":"documentosEmitidos"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-documents-edited":[{"id":"documento","label":"Documento","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-documents-published-archived-super":[{"id":"documento","label":"Documento","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Certificados","align":"center","orden":"documentosEmitidos"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-documents-edited-super":[{"id":"documento","label":"Documento","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-documents-folders":[{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":1},{"id":"name","label":"Nombre","minWidth":100,"align":"center","orden":"nombre"},{"id":"organization","label":"Organizaci\xf3n","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"Fecha de creaci\xf3n","minWidth":50,"align":"center","orden":"fecha_certificacion"}],"columns-documents-files":[{"id":"icon","label":"","minWidth":10,"align":"center","colSpan":1},{"id":"name","label":"Nombre","minWidth":200,"align":"center","orden":"nombre"},{"id":"date","label":"Fecha de creaci\xf3n","minWidth":50,"align":"center","orden":"fecha_certificacion"},{"id":"additional","label":"Campos adicionales","minWidth":50,"align":"center"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":7}],"columns-documents-files-history":[{"id":"type","label":"Tipo","minWidth":100,"align":"center","colSpan":1,"orden":"tipo"},{"id":"sender","label":"Enviado por","minWidth":100,"align":"center","orden":"usuarios.primer_nombre"},{"id":"received","label":"Recibido por","minWidth":100,"align":"center","orden":"receptor"},{"id":"date","label":"Fecha de env\xedo","minWidth":50,"align":"center","orden":"fecha"}],"columns-carnet-published-archived":[{"id":"carnet","label":"Carnet","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Emitidos","align":"center","orden":"carnetsEmitidos"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-carnet-edited":[{"id":"carnet","label":"Carnet","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-carnet-published-archived-super":[{"id":"carnet","label":"Carnet","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Emitidos","align":"center","orden":"carnetsEmitidos"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-carnet-edited-super":[{"id":"carnet","label":"Carnet","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-group-carnet-issued":[{"id":"date","label":"Fecha emisi\xf3n","minWidth":50,"align":"center","orden":"fecha_emision"},{"id":"name","label":"Nombre","minWidth":100,"align":"center","orden":"nombre"},{"id":"organization","label":"Organizaci\xf3n","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"user","label":"Usuario emisor","minWidth":100,"align":"center","orden":"usuarios.primer_nombre"},{"id":"issued","label":"Carnets emitidos","align":"center","orden":"carnetIssued"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":4}],"columns-carnet-issued":{"columns-start":[{"id":"","label":"","minWidth":"10","align":"center"},{"id":"group","label":"Grupo","minWidth":"150","align":"center","orden":"gruposCarnetsEmitidos.nombre"},{"id":"state","label":"Estado","minWidth":"50","align":"center"},{"id":"date","label":"Fecha emisi\xf3n","minWidth":"50","align":"center","orden":"fecha_emision"},{"id":"email","label":"Email","minWidth":"100","align":"center","orden":"email_receptor"}],"columns-end":[{"id":"code","label":"C\xf3digo Carnet","minWidth":"200","align":"center","orden":"codigo_carnet"},{"id":"carnetMame","label":"Nombre P\xfablico Carnet","minWidth":"200","align":"center","orden":"plantillasCarnets.nombre"},{"id":"carnetMamePrivate","label":"Nombre Privado Carnet","minWidth":"200","align":"center","orden":"plantillasCarnets.nombre_privado"},{"id":"expiratedate","label":"Fecha expiraci\xf3n","minWidth":"10","align":"center","orden":"fecha_expiracion"},{"id":"account","label":"Cuenta","minWidth":"50","align":"center","orden":"email_receptor"},{"id":"correos_emision","label":"No. correos Emisi\xf3n","minWidth":"150","align":"center","orden":"correos_emision"},{"id":"correos_aceptar_carnet","label":"No. correos Aceptar carnet","minWidth":"170","align":"center","orden":"correos_aceptar_carnet"},{"id":"correos_crear_cuenta","label":"No. correos Crear cuenta","minWidth":"150","align":"center","orden":"correos_crear_cuenta"},{"id":"correos_compartir_carnet","label":"No. correos Compatir carnet","minWidth":"170","align":"center","orden":"correos_compartir_carnet"},{"id":"correos_revocar","label":"No. correos Revocar","minWidth":"170","align":"center","orden":"correos_revocar"},{"id":"facebook","label":"No. veces compartidos en Facebook","minWidth":"170","align":"center"},{"id":"linkedin","label":"No. veces compartidos en Linkedin","minWidth":"170","align":"center"},{"id":"twitter","label":"No. veces compartidos en Twitter","minWidth":"170","align":"center"},{"id":"whatsapp","label":"No. veces compartidos en Whatsapp","minWidth":"170","align":"center"},{"id":"telegram","label":"No. veces compartidos en Telegram","minWidth":"170","align":"center"},{"id":"delete","label":"","minWidth":"10","align":"center"}]},"columns-reports-carnets":[{"id":"date","label":"Fecha reporte","minWidth":50,"align":"center","orden":"fecha_envio"},{"id":"email","label":"Email","minWidth":100,"align":"center","orden":"carnetsEmitidos.email_receptor"},{"id":"code","label":"C\xf3digo","minWidth":100,"align":"center","orden":"carnetsEmitidos.codigo_carnet"},{"id":"organization","label":"Organizaci\xf3n","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"state","label":"Estado","minWidth":100,"align":"center","orden":"estado"},{"id":"message","label":"Mensajes","align":"center"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":4}],"columns-files-additionals":[{"id":"document","label":"Documento","align":"center"},{"id":"actions","label":"","align":"center","colSpan":2}],"columns-fields-additionals":[{"id":"description","label":"Descripci\xf3n","align":"center"},{"id":"link","label":"Link","align":"center"},{"id":"actions","label":"","align":"center","colSpan":2}],"columns-plan":[{"id":"id","label":"Id del pedido","minWidth":50,"align":"center","orden":"id"},{"id":"date","label":"Fecha","minWidth":100,"align":"center","orden":"fecha"},{"id":"total","label":"Total","minWidth":100,"align":"center","orden":"total"},{"id":"state","label":"Estado","minWidth":100,"align":"center","orden":"estado"},{"id":"actions","label":"","minWidth":100,"align":"center"}],"payments":[{"id":"date","label":"Fecha y hora","align":"center","minWidth":150},{"id":"state","label":"Estado","align":"center"},{"id":"code_state","label":"Respuesta estado","align":"center","minWidth":250},{"id":"signature","label":"Firma transacci\xf3n","align":"center"},{"id":"referenceCode","label":"C\xf3digo referencia","align":"center"},{"id":"referenceId","label":"Id referencia","align":"center"},{"id":"plan","label":"Plan","align":"center","minWidth":150},{"id":"cantIssues","label":"Cantidad emisiones","align":"center"},{"id":"amount","label":"Valor pagado","align":"center"},{"id":"currency","label":"Moneda","align":"center"},{"id":"paymentMethod","label":"Metodo de pago","align":"center","minWidth":170},{"id":"description","label":"Descripci\xf3n","align":"center"},{"id":"users","label":"Usuario","align":"center","minWidth":150},{"id":"organization","label":"Organizaci\xf3n","align":"center","minWidth":250}],"columns-contracts":[{"id":"plan","label":"Tipo de plan","align":"center","orden":"tipo_contrato"},{"id":"estado","label":"Estado","align":"center","orden":"estado"},{"id":"inicio","label":"Inicio","align":"center","orden":"fecha_inicio"},{"id":"vencimiento","label":"Vencimiento","align":"center","orden":"vencimiento"},{"id":"cant-emisiones","label":"Cantidad de emisiones","align":"center","orden":"cantidad_insignias"},{"id":"cant-insig-emitidas","label":"Insignias emitidas","align":"center","orden":"cantidad_insignias_emitidas"},{"id":"cant-cert-emitidos","label":"Certificados emitidos","align":"center","orden":"cantidad_certificados_emitidos"},{"id":"cant-carn-emitidos","label":"Carnets emitidos","align":"center","orden":"cantidad_carnets_emitidos"},{"id":"cant-doc-emitidos","label":"Documentos Certificados","align":"center","orden":"cantidad_documentos_emitidos"},{"id":"total-emitidos","label":"Total de emisiones","align":"center","orden":"total_emisiones"},{"id":"remaining-emissions","label":"Emisiones restantes","align":"center","orden":"emisiones_restantes"},{"id":"edit","label":"","align":"center"},{"id":"delete","label":"","align":"center"}],"columns-diploma-published-archived-super":[{"id":"diploma","label":"Diploma","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Emitidos","align":"center","orden":"diplomasEmitidos"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-diploma-published-archived":[{"id":"diploma","label":"Diploma","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Emitidos","align":"center","orden":"diplomasEmitidos"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-diploma-edited":[{"id":"diploma","label":"Diploma","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-diploma-edited-super":[{"id":"diploma","label":"Diploma","align":"center","width":150},{"id":"nombre_publico","label":"Nombre P\xfablico","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Nombre Privado","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"Estado","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-group-diplomas-issued":[{"id":"date","label":"Fecha emisi\xf3n","minWidth":50,"align":"center","orden":"fecha_emision"},{"id":"name","label":"Nombre","minWidth":100,"align":"center","orden":"nombre"},{"id":"organization","label":"Organizaci\xf3n","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"user","label":"Usuario emisor","minWidth":100,"align":"center","orden":"usuarios.primer_nombre"},{"id":"issued","label":"Diplomas para firmar","align":"center","orden":"diplomaIssued"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":4}],"columns-users":[{"id":"nombres","label":"Nombres","align":"center","orden":"primer_nombre"},{"id":"apellidos","label":"Apellidos","align":"center","orden":"primer_apellido"},{"id":"email","label":"Email","align":"center","orden":"email"},{"id":"userGroup","label":"Grupo de usuario","align":"center","orden":"grupo_usuario","minWidth":200},{"id":"cuenta","label":"Cuentas","align":"center","orden":"cuentas"},{"id":"","label":"","align":"center","colSpan":3}],"columns-users-super":[{"id":"nombres","label":"Nombres","align":"center","orden":"primer_nombre"},{"id":"apellidos","label":"Apellidos","align":"center","orden":"primer_apellido"},{"id":"email","label":"Email","align":"center","orden":"email"},{"id":"userGroup","label":"Grupo de usuario","align":"center","orden":"grupo_usuario","minWidth":200},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"organizaciones"},{"id":"cuenta","label":"Cuentas","align":"center","orden":"cuentas"},{"id":"","label":"","align":"center","colSpan":3}],"columns-organizations":[{"id":"nit","label":"NIT","align":"center","orden":"nit"},{"id":"logo","label":"logo","align":"center"},{"id":"nombre","label":"Nombre","align":"center","orden":"nombre"},{"id":"telefono","label":"Tel\xe9fono","align":"center","orden":"telefono"},{"id":"email","label":"Direccion","align":"center","orden":"direccion"},{"id":"sitio_web","label":"Sitio web","align":"center","orden":"sitio_web"},{"id":"estado","label":"Estado","align":"center","orden":"estado"},{"id":"actions","label":"","align":"center","colSpan":4}],"columns-ids-templates-badges":[{"id":"id","label":"Id Plantilla","align":"center","orden":"codigo"},{"id":"name","label":"Plantilla","align":"center","orden":"nombre"},{"id":"estado","label":"Estado","align":"center"},{"id":"dataCreate","label":"Fecha De Creaci\xf3n","align":"center","orden":"fecha_creacion"},{"id":"dataUpdate","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"","label":"","align":"center"}],"columns-ids-templates-certificates":[{"id":"id","label":"Id Plantilla","align":"center","orden":"codigo"},{"id":"image","label":"Certificado","align":"center","orden":"nombre"},{"id":"name","label":"Plantilla","align":"center","orden":"nombre"},{"id":"estado","label":"Estado","align":"center"},{"id":"dataCreate","label":"Fecha De Creaci\xf3n","align":"center","orden":"fecha_creacion"},{"id":"dataUpdate","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"","label":"","align":"center"}],"columns-ids-templates-documents":[{"id":"id","label":"Id Plantilla","align":"center","orden":"codigo"},{"id":"image","label":"Documento","align":"center","orden":"nombre"},{"id":"name","label":"Plantilla","align":"center","orden":"nombre"},{"id":"estado","label":"Estado","align":"center"},{"id":"dataCreate","label":"Fecha De Creaci\xf3n","align":"center","orden":"fecha_creacion"},{"id":"dataUpdate","label":"\xdaltima Actualizaci\xf3n","align":"center","orden":"fecha_ultima_modificacion"},{"id":"","label":"","align":"center"}],"columns-parameter-value":[{"id":"parametre","label":"Par\xe1metro","align":"center","orden":"parametros.nombre"},{"id":"valueParameter","label":"Valores Par\xe1metros","align":"center"},{"id":"edit","label":"","align":"center"},{"id":"delete","label":"","align":"center"}],"columns-contracts-organizations":[{"id":"logo","label":"","minWidth":50,"align":"center"},{"id":"organizacion","label":"Organizaci\xf3n","align":"center","orden":"nombre"},{"id":"activos","label":"Activos","align":"center","orden":"activos"},{"id":"vencidos","label":"Vencidos","align":"center","orden":"vencidos"},{"id":"pendientes","label":"En espera","align":"center","orden":"pendientes"},{"id":"eliminados","label":"Eliminados","align":"center","orden":"eliminados"},{"id":"view","label":"","align":"center"}],"columns-modules":[{"id":"name","label":"Nombre","align":"center","orden":"nombre"},{"id":"view","label":"Acciones","align":"center"},{"id":"edit","label":"","align":"center"},{"id":"delete","label":"","align":"center"}],"columns-userGroup":[{"id":"nombre","label":"Nombre","align":"center","orden":"nombre"},{"id":"eliminar","label":"","align":"center","width":"10%"},{"id":"acciones","label":"","align":"center","width":"10%"}],"columns-permissions":[{"id":"grupo","label":"Grupo de Usuarios","align":"center","orden":"gruposUsuarios.nombre"},{"id":"modulos","label":"M\xf3dulo","align":"center","orden":"acciones.modulos.nombre"},{"id":"actiones","label":"Acciones","align":"center"},{"id":"eliminar","label":"","align":"center","width":"10%"},{"id":"eliminar","label":"","align":"center","width":"10%"}],"columns-user-groups-organizations":[{"id":"user","label":"Usuario","minWidth":10,"align":"center","orden":"usuarios.primer_nombre"},{"id":"organization","label":"Organizaci\xf3n","minWidth":10,"align":"center","orden":"organizaciones.nombre"},{"id":"userGroup","label":"Grupo usuario","minWidth":110,"align":"center","orden":"gruposUsuarios.nombre"},{"id":"edit","label":""},{"id":"delete","label":""}],"columns-socialMedia":[{"id":"icono","label":"Icono","align":"center"},{"id":"nombre","label":"Nombre","align":"center","orden":"nombre"},{"id":"","label":"","align":"center"},{"id":"","label":"","align":"center"}]},"pagination":{"all-pages":"P\xe1ginas: Todas","one-page":"P\xe1gina"}}')},580:function(e){e.exports=JSON.parse('{"table":{"empty-table":"No data recorded","empty-table-diploma":"No hay diplomas por firmar","rows-per-page":"Rows per page","no-assignend":"No assigned","without-organization":"Without organization","state":{"published":"Published","edited":"In Edit","archived":"Archived","pending":"Pending","approved":"Approved"},"state-issue":{"pending":"Pending","accepted":"Accepted","rejected":"Rejected","bounced-mail":"Bounced mail","revoked":"Revoked","issued":"Issued"},"state-issue-certificate":{"pending":"Pending","accepted":"Accepted","rejected":"Rejected","bounced-mail":"Bounced mail","revoked":"Revoked","issued":"Issued"},"state-reports-carnets":{"waiting":"in waiting","process":"in process","finished":"Finished","issued":"Issued","viewed":"Viewed","revoked":"Revoked","report":"Reported","bounced-mail":"Bounced mail"},"tooltip":{"details":"Details","edit":"Edit","add":"Add","publish":"Publish","copy":"Copy","preview":"Preview","archive":"Archive","delete":"Delete","history":"History","assigned-templates":"See Assigned Templates","view-template":"View Template","recommended-templates":"See Recommended Templates","revoke":"Revoke","undo-revoke":"Undo","export":"To Export","upgrade":"To Update","view-badge":"See Badge","view-certificate":"See certificate","view-certificates":"View certificates","sent-email":"Send emails","download":"Download Pdf","view-document":"View Document","view-carnet":"View ID Card","view-message":"View messages","upload-additional-field":"Upload additional field","view-additional-field":"View additional field","multy":"Include on all pages","share":"Share","edit-config":"Edit general information","clean":"Clean up","send-copy":"Send a copy","download-code":"Download codes","view-accounts":"View accounts","view-all":"To see all","download-certificate":"Download certificates","to-download":"Download","aprove":"Aprove"},"columns-published-archived":[{"id":"insignia","label":"Badge","align":"center"},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Issued","align":"center","orden":"insigniasEmitidas"},{"id":"state","label":"State","align":"center"},{"id":"","label":" ","align":"center","colSpan":5}],"columns-published-archived-super":[{"id":"insignia","label":"Badge","align":"center"},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Issued","align":"center","orden":"insigniasEmitidas"},{"id":"state","label":"State","align":"center"},{"id":"","label":" ","align":"center","colSpan":5}],"columns-edited":[{"id":"insignia","label":"Badge","align":"center"},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":" ","align":"center","colSpan":6}],"columns-edited-super":[{"id":"insignia","label":"Badge","align":"center"},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":" ","align":"center","colSpan":6}],"columns-history":[{"id":"date","label":"Date","align":"center","orden":"fecha_accion"},{"id":"hour","label":"Hour","align":"center"},{"id":"update","label":"User","align":"center","orden":"usuarios.primer_nombre"},{"id":"type","label":"Type of Action","align":"center"},{"id":"","label":" ","align":"center"}],"columns-collections":[{"id":"badge","label":"","align":"center"},{"id":"collection","label":"Colection","align":"center","orden":"nombre"},{"id":"organization","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"templates","label":"Templates","align":"center","orden":"templates"},{"id":"history","label":"History"},{"id":"edit","label":"","minWidth":10,"align":"center"},{"id":"delete","label":"","minWidth":10,"align":"center"}],"template-assigned":[{"id":"insignia","label":"Badge","align":"center"},{"id":"name","label":"Public Name","align":"center","orden":"plantillasInsignias.nombre"},{"id":"private_name","label":"Private Name","align":"center","orden":"plantillasInsignias.nombre_privado"},{"id":"tipo","label":"Organization","align":"center"},{"id":"date","label":"Last Update","align":"center","orden":"plantillasInsignias.fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center"}],"columns-recommendations":[{"id":"","label":"Template","minWidth":10,"align":"center"},{"id":"name","label":"Public Name","minWidth":10,"align":"center","orden":"plantillasInsignias.nombre"},{"id":"private_name","label":"Private Name","minWidth":10,"align":"center","orden":"plantillasInsignias.nombre_privado"},{"id":"id_plantilla_recomendada","label":"Recommended Templates","minWidth":10,"align":"center"},{"id":"history","label":"Record"},{"id":"edit","label":""},{"id":"delete","label":""}],"columns-recommended-assigned":[{"id":"insignia","label":"Badge","align":"center"},{"id":"name","label":"Public Name","align":"center","orden":"plantillasInsigniasRecomendadas.nombre"},{"id":"private_name","label":"Private Name","align":"center","orden":"plantillasInsigniasRecomendadas.nombre_privado"},{"id":"tipo","label":"Organization","align":"center"},{"id":"date","label":"Last Update","align":"center","orden":"plantillasInsigniasRecomendadas.fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center"}],"columns-template-user-batch":[{"id":"index","label":"#","minWidth":50,"align":"center"},{"id":"documento","label":"ID","minWidth":50,"align":"center","orden":"data.documento"},{"id":"email","label":"email","minWidth":50,"align":"center","orden":"data.email"},{"id":"indicativo_pais","label":"indicative_country","minWidth":50,"align":"center","orden":"data.indicativo_pais"},{"id":"celular","label":"phone_number","minWidth":50,"align":"center","orden":"data.celular"},{"id":"primer_nombre","label":"first_name","minWidth":50,"align":"center","orden":"data.primer_nombre"},{"id":"segundo_nombre","label":"middle_name","minWidth":50,"align":"center","orden":"data.segundo_nombre"},{"id":"primer_apellido","label":"last_name","minWidth":50,"align":"center","orden":"data.primer_apellido"},{"id":"segundo_apellido","label":"second_last_name","minWidth":50,"align":"center","orden":"data.segundo_apellido"}],"columns-template-badge-issue":[{"id":"index","label":"#","minWidth":50,"align":"center"},{"id":"id_plantilla","label":"template_id","minWidth":200,"align":"center","orden":"data.id_plantilla"},{"id":"email_receptor","label":"receiver_email","minWidth":50,"align":"center","orden":"data.email_receptor"},{"id":"indicativo_pais","label":"indicative_country","minWidth":50,"align":"center","orden":"data.indicativo_pais"},{"id":"whatsapp_receptor","label":"whatsapp_receiver","minWidth":50,"align":"center","orden":"data.whatsapp_receptor"},{"id":"tipo_identificacion","label":"identification_type","minWidth":50,"align":"center","orden":"data.tipo_identificacion"},{"id":"identificacion","label":"identification","minWidth":50,"align":"center","orden":"data.identificacion"},{"id":"primer_nombre_receptor","label":"receiver_first_name","minWidth":50,"align":"center","orden":"data.primer_nombre_receptor"},{"id":"segundo_nombre_receptor","label":"receiver_middle_name","minWidth":50,"align":"center","orden":"data.segundo_nombre_receptor"},{"id":"primer_apellido_receptor","label":"receiver_last_name","minWidth":50,"align":"center","orden":"data.primer_apellido_receptor"},{"id":"segundo_apellido_receptor","label":"receiver_second_last_name","minWidth":50,"align":"center","orden":"data.segundo_apellido_receptor"},{"id":"numero_celular","label":"phone_number","minWidth":50,"align":"center","orden":"data.numero_celular"},{"id":"numero_telegram","label":"telegram_number","minWidth":50,"align":"center","orden":"data.numero_telegram"},{"id":"merito","label":"merit","minWidth":50,"align":"center","orden":"data.merito"},{"id":"link_merito","label":"link_merit","minWidth":50,"align":"center","orden":"data.link_merito"},{"id":"fecha_expiracion","label":"expiration_date","minWidth":50,"align":"center","orden":"data.fecha_expiracion"}],"columns-badges-issued":[{"id":"group","label":"Group","minWidth":150,"align":"center","orden":"gruposInsigniasEmitidas.nombre"},{"id":"state","label":"State","minWidth":50,"align":"center"},{"id":"badge","label":"Badge","minWidth":50,"align":"center"},{"id":"date","label":"Issued date","minWidth":50,"align":"center","orden":"fecha_emision"},{"id":"name","label":"Names","minWidth":100,"align":"center","orden":"primer_nombre_receptor"},{"id":"lastname","label":"Last Names","minWidth":100,"align":"center","orden":"primer_apellido_receptor"},{"id":"email","label":"Email","minWidth":100,"align":"center","orden":"email_receptor"},{"id":"tipo_id","label":"Identification Type","minWidth":100,"align":"center","orden":"tipo_identificacion"},{"id":"id","label":"Identification","minWidth":100,"align":"center","orden":"identificacion"},{"id":"code","label":"Badge code","minWidth":200,"align":"center","orden":"codigo_insignia"},{"id":"badgename","label":"Public name badge","minWidth":200,"align":"center","orden":"plantillasInsignias.nombre"},{"id":"badgenamePrivate","label":"Private name badge","minWidth":200,"align":"center","orden":"plantillasInsignias.nombre_privado"},{"id":"expiratedate","label":"Expiration date","minWidth":10,"align":"center","orden":"fecha_expiracion"},{"id":"celular","label":"Mobile","minWidth":100,"align":"center","orden":"numero_celular"},{"id":"whatsapp","label":"WhatsApp","minWidth":100,"align":"center","orden":"whatsapp_receptor"},{"id":"telegram","label":"Telegram","minWidth":100,"align":"center","orden":"numero_telegram"},{"id":"merit","label":"Merit","minWidth":400,"align":"center","orden":"merit"},{"id":"link_merit","label":"Link Merit","minWidth":100,"align":"center","orden":"link_merit"},{"id":"account","label":"Account","minWidth":50,"align":"center","orden":"email_receptor"},{"id":"correos_emision","label":"No. emails Issue","minWidth":150,"align":"center","orden":"correos_emision"},{"id":"correos_aceptar_insignia","label":"No. emails Accept Badge","minWidth":170,"align":"center","orden":"correos_aceptar_insignia"},{"id":"correos_crear_cuenta","label":"No. emails Create Account","minWidth":150,"align":"center","orden":"correos_crear_cuenta"},{"id":"correos_compartir _insignia","label":"No. emails Share badge","minWidth":170,"align":"center","orden":"correos_compartir_insignia"},{"id":"correos_revocar","label":"No. emails Revoke","minWidth":170,"align":"center","orden":"correos_revocar"},{"id":"facebook","label":"times shared in Facebook","minWidth":170,"align":"center"},{"id":"linkedin","label":"times shared in Linkedin","minWidth":170,"align":"center"},{"id":"twitter","label":"times shared in Twitter","minWidth":170,"align":"center"},{"id":"whatsapp","label":"times shared in Whatsapp","minWidth":170,"align":"center"},{"id":"telegram","label":"times shared in Telegram","minWidth":170,"align":"center"},{"id":"delete","label":"","minWidth":10,"align":"center"}],"columns-badges-issued-excel":["Group","State","Issued date","First Name","Middle Name","Last Name","Second Last Name","Email","WhatsApp","Identification Type","Identification","Badge code","Public name badge","Private name badge","Expiration date","Mobile","Telegram","Merit","Merit link","Account","No. emails Issue","No. emails Accept Badge","No. emails Create Account","No. emails Share Badge","No. emails Revoke Badge","Facebook","LinkedIn","Twitter","WhatsApp","Telegram"],"columns-certificate-issued":{"columns-start":[{"id":"","label":"","minWidth":"10","align":"center"},{"id":"group","label":"Group","minWidth":"150","align":"center","orden":"gruposInsigniasEmitidas.nombre"},{"id":"state","label":"State","minWidth":"50","align":"center"},{"id":"date","label":"Issued date","minWidth":"50","align":"center","orden":"fecha_emision"},{"id":"email","label":"Email","minWidth":"100","align":"center","orden":"email_receptor"}],"columns-end":[{"id":"code","label":"Certificate code","minWidth":"200","align":"center","orden":"codigo_certificado"},{"id":"certificateMame","label":"Certificate Public Name","minWidth":"200","align":"center","orden":"plantillasCertificados.nombre"},{"id":"certificateMamePrivate","label":"Certificate Private Name","minWidth":"200","align":"center","orden":"plantillasCertificados.nombre_privado"},{"id":"expiratedate","label":"Expiration date","minWidth":"10","align":"center","orden":"fecha_expiracion"},{"id":"account","label":"Account","minWidth":"50","align":"center","orden":"email_receptor"},{"id":"correos_emision","label":"No. emails Issue","minWidth":"150","align":"center","orden":"correos_emision"},{"id":"correos_aceptar_certificado","label":"No. emails Accept Certificate","minWidth":"170","align":"center","orden":"correos_aceptar_certificado"},{"id":"correos_crear_cuenta","label":"No. emails Create Account","minWidth":"150","align":"center","orden":"correos_crear_cuenta"},{"id":"correos_compartir_certificado","label":"No. emails Share Certificate","minWidth":"170","align":"center","orden":"correos_compartir_certificado"},{"id":"correos_revocar","label":"No. emails Revoke Certificate","minWidth":"170","align":"center","orden":"correos_revocar"},{"id":"facebook","label":"times shared in Facebook","minWidth":"170","align":"center"},{"id":"linkedin","label":"times shared in Linkedin","minWidth":"170","align":"center"},{"id":"twitter","label":"times shared in Twitter","minWidth":"170","align":"center"},{"id":"whatsapp","label":"times shared in Whatsapp","minWidth":"170","align":"center"},{"id":"telegram","label":"times shared in Telegram","minWidth":"170","align":"center"},{"id":"email","label":"","minWidth":"10","align":"center"},{"id":"delete","label":"","minWidth":"10","align":"center"}]},"columns-certificate-published-archived":[{"id":"certificado","label":"Certificate","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Issued","align":"center","orden":"certificadosEmitidos"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-certificate-edited":[{"id":"certificado","label":"Certificate","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-certificate-published-archived-super":[{"id":"certificado","label":"Certificate","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Issued","align":"center","orden":"certificadosEmitidos"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-certificate-edited-super":[{"id":"certificado","label":"Certificate","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-certificate-recommendations":[{"id":"","label":"Template","width":150,"align":"center"},{"id":"name","label":"Public Name","minWidth":10,"align":"center","orden":"plantillasCertificados.nombre"},{"id":"private_name","label":"Private Name","minWidth":10,"align":"center","orden":"plantillasCertificados.nombre_privado"},{"id":"id_plantilla_recomendada","label":"Recommended Templates","minWidth":10,"align":"center"},{"id":"history","label":"Record"},{"id":"edit","label":""},{"id":"delete","label":""}],"columns-certificate-recommended-assigned":[{"id":"insignia","label":"Certificate","align":"center","width":150},{"id":"name","label":"Public Name","align":"center","orden":"plantillasCertificadosRecomendadas.nombre"},{"id":"private_name","label":"Private Name","align":"center","orden":"plantillasCertificadosRecomendadas.nombre_privado"},{"id":"tipo","label":"Organization","align":"center"},{"id":"date","label":"Last Update","align":"center","orden":"plantillasCertificadosRecomendadas.fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center"}],"template-certificate-assigned":[{"id":"insignia","label":"Certificate","align":"center","width":150},{"id":"name","label":"Public Name","align":"center","orden":"plantillasCertificados.nombre"},{"id":"private_name","label":"Private Name","align":"center","orden":"plantillasCertificados.nombre_privado"},{"id":"tipo","label":"Organization","align":"center"},{"id":"date","label":"Last Update","align":"center","orden":"plantillasCertificados.fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center"}],"columns-group-badges-issued":[{"id":"date","label":"Date issued","minWidth":50,"align":"center","orden":"fecha_emision"},{"id":"name","label":"Name","minWidth":100,"align":"center","orden":"nombre"},{"id":"organization","label":"Organization","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"user","label":"Issuing user","minWidth":100,"align":"center","orden":"usuarios.primer_nombre"},{"id":"issued","label":"Badges issued","align":"center","orden":"BadgesIssued"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":4}],"columns-group-certificates-issued":[{"id":"date","label":"Date issued","minWidth":50,"align":"center","orden":"fecha_emision"},{"id":"name","label":"Name","minWidth":100,"align":"center","orden":"nombre"},{"id":"organization","label":"Organization","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"user","label":"Issuing user","minWidth":100,"align":"center","orden":"usuarios.primer_nombre"},{"id":"issued","label":"Certificates Issued","align":"center","orden":"certificateIssued"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":4}],"columns-documents-published-archived":[{"id":"documento","label":"Document","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Certify","align":"center","orden":"documentosEmitidos"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-documents-edited":[{"id":"documento","label":"Document","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-documents-published-archived-super":[{"id":"documento","label":"Document","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Certify","align":"center","orden":"documentosEmitidos"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-documents-edited-super":[{"id":"documento","label":"Document","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-documents-folders":[{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":1},{"id":"name","label":"Name","minWidth":100,"align":"center","orden":"nombre"},{"id":"organization","label":"Organization","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"Date created","minWidth":50,"align":"center","orden":"fecha_certificacion"}],"columns-documents-files":[{"id":"icon","label":"","minWidth":10,"align":"center","colSpan":1},{"id":"name","label":"Name","minWidth":200,"align":"center","orden":"nombre"},{"id":"date","label":"Date created","minWidth":50,"align":"center","orden":"fecha_certificacion"},{"id":"additional","label":"Additional fields","minWidth":50,"align":"center","orden":"documentos_adicionales"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":7}],"columns-documents-files-history":[{"id":"type","label":"Type","minWidth":100,"align":"center","colSpan":1,"orden":"tipo"},{"id":"sender","label":"Sender by","minWidth":100,"align":"center","orden":"usuarios.primer_nombre"},{"id":"received","label":"Received by","minWidth":100,"align":"center","orden":"receptor"},{"id":"date","label":"Send date","minWidth":50,"align":"center","orden":"fecha"}],"columns-carnet-published-archived":[{"id":"carnet","label":"ID Card","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Issued","align":"center","orden":"carnetsEmitidos"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-carnet-edited":[{"id":"carnet","label":"ID Card","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-carnet-published-archived-super":[{"id":"carnet","label":"ID Card","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Issued","align":"center","orden":"carnetsEmitidos"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-carnet-edited-super":[{"id":"carnet","label":"ID Card","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-group-carnet-issued":[{"id":"date","label":"Date issued","minWidth":50,"align":"center","orden":"fecha_emision"},{"id":"name","label":"Name","minWidth":100,"align":"center","orden":"nombre"},{"id":"organization","label":"Organization","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"user","label":"Issuing user","minWidth":100,"align":"center","orden":"usuarios.primer_nombre"},{"id":"issued","label":"ID Card Issued","align":"center","orden":"carnetIssued"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":4}],"columns-carnet-issued":{"columns-start":[{"id":"","label":"","minWidth":"10","align":"center"},{"id":"group","label":"Group","minWidth":"150","align":"center","orden":"gruposCarnetsEmitidos.nombre"},{"id":"state","label":"State","minWidth":"50","align":"center"},{"id":"date","label":"Issued date","minWidth":"50","align":"center","orden":"fecha_emision"},{"id":"email","label":"Email","minWidth":"100","align":"center","orden":"email_receptor"}],"columns-end":[{"id":"code","label":"Carnet code","minWidth":"200","align":"center","orden":"codigo_carnet"},{"id":"carnetMame","label":"Carnet Public Name","minWidth":"200","align":"center","orden":"plantillasCarnet.nombre"},{"id":"carnetMamePrivate","label":"Carnet Private Name","minWidth":"200","align":"center","orden":"plantillasCarnets.nombre_privado"},{"id":"expiratedate","label":"Expiration date","minWidth":"10","align":"center","orden":"fecha_expiracion"},{"id":"account","label":"Account","minWidth":"50","align":"center","orden":"email_receptor"},{"id":"correos_emision","label":"No. emails Issue","minWidth":"150","align":"center","orden":"correos_emision"},{"id":"correos_aceptar_carnet","label":"No. emails Accept Carnet","minWidth":"170","align":"center","orden":"correos_aceptar_carnet"},{"id":"correos_crear_cuenta","label":"No. emails Create Account","minWidth":"150","align":"center","orden":"correos_crear_cuenta"},{"id":"correos_compartir_carnet","label":"No. emails Share Carnet","minWidth":"170","align":"center","orden":"correos_compartir_carnet"},{"id":"correos_revocar","label":"No. emails Revoke Carnet","minWidth":"170","align":"center","orden":"correos_revocar"},{"id":"facebook","label":"times shared in Facebook","minWidth":"170","align":"center"},{"id":"linkedin","label":"times shared in Linkedin","minWidth":"170","align":"center"},{"id":"twitter","label":"times shared in Twitter","minWidth":"170","align":"center"},{"id":"whatsapp","label":"times shared in Whatsapp","minWidth":"170","align":"center"},{"id":"telegram","label":"times shared in Telegram","minWidth":"170","align":"center"},{"id":"delete","label":"","minWidth":"10","align":"center"}]},"columns-reports-carnets":[{"id":"date","label":"Date Report","minWidth":50,"align":"center","orden":"fecha_envio"},{"id":"email","label":"Email","minWidth":100,"align":"center","orden":"carnetsEmitidos.email_receptor"},{"id":"code","label":"Code","minWidth":100,"align":"center","orden":"carnetsEmitidos.codigo_carnet"},{"id":"organization","label":"Organization","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"state","label":"State","minWidth":100,"align":"center","orden":"estado"},{"id":"message","label":"Report Message","align":"center"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":4}],"columns-plan":[{"id":"id","label":"Order ID","minWidth":50,"align":"center","orden":"id"},{"id":"date","label":"Date","minWidth":100,"align":"center","orden":"fecha"},{"id":"total","label":"Total","minWidth":100,"align":"center","orden":"total"},{"id":"state","label":"State","minWidth":100,"align":"center","orden":"estadp"},{"id":"actions","label":"","minWidth":100,"align":"center"}],"payments":[{"id":"date","label":"Date and hour","align":"center","minWidth":150},{"id":"state","label":"State","align":"center"},{"id":"code_state","label":"State response","align":"center","minWidth":250},{"id":"signature","label":"Transaction signature","align":"center"},{"id":"referenceCode","label":"Reference code","align":"center"},{"id":"referenceId","label":"Reference Id","align":"center"},{"id":"plan","label":"Plan","align":"center","minWidth":150},{"id":"cantIssues","label":"Number emissions","align":"center"},{"id":"amount","label":"Amount paid","align":"center"},{"id":"currency","label":"Currency","align":"center"},{"id":"paymentMethod","label":"Payment method","align":"center","minWidth":170},{"id":"description","label":"Description","align":"center"},{"id":"users","label":"User","align":"center","minWidth":150},{"id":"organization","label":"Organization","align":"center","minWidth":250}],"columns-contracts":[{"id":"plan","label":"Plan Type","align":"center","orden":"tipo_contrato"},{"id":"estado","label":"Status","align":"center","orden":"estado"},{"id":"inicio","label":"Start","align":"center","orden":"fecha_inicio"},{"id":"vencimiento","label":"Expiration","align":"center","orden":"vencimiento"},{"id":"cant-emisiones","label":"Number of Emissions","align":"center","orden":"cantidad_insignias"},{"id":"cant-insig-emitidas","label":"Issued Badges","align":"center","orden":"cantidad_insignias_emitidas"},{"id":"cant-cert-emitidos","label":"Issued Certificates","align":"center","orden":"cantidad_certificados_emitidos"},{"id":"cant-carn-emitidos","label":"Issued Cards","align":"center","orden":"cantidad_carnets_emitidos"},{"id":"cant-doc-emitidos","label":"Certified Documents","align":"center","orden":"cantidad_documentos_emitidos"},{"id":"total-emitidos","label":"Total Emissions","align":"center","orden":"total_emisiones"},{"id":"remaining-emissions","label":"Remaining emissions","align":"center","orden":"emisiones_restantes"},{"id":"edit","label":"","align":"center"},{"id":"delete","label":"","align":"center"}],"columns-diploma-published-archived":[{"id":"diploma","label":"Diploma","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Issued","align":"center","orden":"diplomasEmitidos"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-diploma-edited":[{"id":"diploma","label":"Diploma","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-diploma-published-archived-super":[{"id":"diploma","label":"Diploma","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"number","label":"N\xb0 Issued","align":"center","orden":"diplomasEmitidos"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":5}],"columns-diploma-edited-super":[{"id":"diploma","label":"Diploma","align":"center","width":150},{"id":"nombre_publico","label":"Public Name","align":"center","orden":"nombre"},{"id":"nombre_privado","label":"Private Name","align":"center","orden":"nombre_privado"},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones.nombre"},{"id":"date","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"state","label":"State","align":"center"},{"id":"","label":"","align":"center","colSpan":6}],"columns-group-diplomas-issued":[{"id":"date","label":"Date issued","minWidth":50,"align":"center","orden":"fecha_emision"},{"id":"name","label":"Name","minWidth":100,"align":"center","orden":"nombre"},{"id":"organization","label":"Organization","minWidth":100,"align":"center","orden":"organizaciones.nombre"},{"id":"user","label":"Issuing user","minWidth":100,"align":"center","orden":"usuarios.primer_nombre"},{"id":"issued","label":"Diplomas For Sign","align":"center","orden":"diplomaIssued"},{"id":"actions","label":"","minWidth":100,"align":"center","colSpan":4}],"columns-users":[{"id":"nombres","label":"Names","align":"center","orden":"primer_nombre"},{"id":"apellidos","label":"Last Names","align":"center","orden":"primer_apellido"},{"id":"email","label":"Email","align":"center","orden":"email"},{"id":"userGroup","label":"User group","align":"center","orden":"grupo_usuario","minWidth":200},{"id":"cuenta","label":"Accounts","align":"center","orden":"cuentas"},{"id":"","label":"","align":"center","colSpan":3}],"columns-users-super":[{"id":"nombres","label":"Names","align":"center","orden":"primer_nombre"},{"id":"apellidos","label":"Last Names","align":"center","orden":"primer_apellido"},{"id":"email","label":"Email","align":"center","orden":"email"},{"id":"userGroup","label":"User group","align":"center","orden":"grupo_usuario","minWidth":200},{"id":"organizacion","label":"Organization","align":"center","orden":"organizaciones"},{"id":"cuenta","label":"Accounts","align":"center","orden":"cuentas"},{"id":"","label":"","align":"center","colSpan":3}],"columns-organizations":[{"id":"nit","label":"NIT","align":"center","orden":"nit"},{"id":"logo","label":"logo","align":"center"},{"id":"nombre","label":"Name","align":"center","orden":"nombre"},{"id":"telefono","label":"Phone","align":"center","orden":"telefono"},{"id":"email","label":"Address","align":"center","orden":"direccion"},{"id":"sitio_web","label":"Website","align":"center","orden":"sitio_web"},{"id":"estado","label":"State","align":"center","orden":"estado"},{"id":"actions","label":"","align":"center","colSpan":4}],"columns-ids-templates-badges":[{"id":"id","label":"Id template","align":"center","orden":"codigo"},{"id":"name","label":"Template","align":"center","orden":"nombre"},{"id":"estado","label":"State","align":"center"},{"id":"dataCreate","label":"Creation date","align":"center","orden":"fecha_creacion"},{"id":"dataUpdate","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"","label":"","align":"center"}],"columns-ids-templates-certificates":[{"id":"id","label":"Id template","align":"center","orden":"codigo"},{"id":"image","label":"Certificate","align":"center","orden":"nombre"},{"id":"name","label":"Template","align":"center","orden":"nombre"},{"id":"estado","label":"State","align":"center"},{"id":"dataCreate","label":"Creation date","align":"center","orden":"fecha_creacion"},{"id":"dataUpdate","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"","label":"","align":"center"}],"columns-ids-templates-documents":[{"id":"id","label":"Id template","align":"center","orden":"codigo"},{"id":"image","label":"Document","align":"center","orden":"nombre"},{"id":"name","label":"Template","align":"center","orden":"nombre"},{"id":"estado","label":"State","align":"center"},{"id":"dataCreate","label":"Creation date","align":"center","orden":"fecha_creacion"},{"id":"dataUpdate","label":"Last Update","align":"center","orden":"fecha_ultima_modificacion"},{"id":"","label":"","align":"center"}],"columns-parameter-value":[{"id":"parametre","label":"Parameter","align":"center","orden":"parametros.nombre"},{"id":"valueParameter","label":"Parameter value","align":"center"},{"id":"edit","label":"","align":"center"},{"id":"delete","label":"","align":"center"}],"columns-contracts-organizations":[{"id":"logo","label":"","minWidth":50,"align":"center"},{"id":"organizacion","label":"Organization","align":"center","orden":"nombre"},{"id":"activos","label":"Active","align":"center","orden":"activos"},{"id":"vencidos","label":"Expired ","align":"center","orden":"vencidos"},{"id":"pendientes","label":"Pending","align":"center","orden":"pendientes"},{"id":"eliminados","label":"Deleted","align":"center","orden":"eliminados"},{"id":"view","label":"","align":"center"}],"columns-modules":[{"id":"name","label":"Name","align":"center","orden":"nombre"},{"id":"view","label":"Actions","align":"center"},{"id":"edit","label":"","align":"center"},{"id":"delete","label":"","align":"center"}],"columns-userGroup":[{"id":"nombre","label":"Name","align":"center","orden":"nombre"},{"id":"eliminar","label":"","align":"center","width":"10%"},{"id":"acciones","label":"","align":"center","width":"10%"}],"columns-permissions":[{"id":"grupo","label":"User groups","align":"center","orden":"gruposUsuarios.nombre"},{"id":"modulos","label":"Modules","align":"center","orden":"acciones.modulos.nombre"},{"id":"actiones","label":"Actions","align":"center"},{"id":"eliminar","label":"","align":"center","width":"10%"},{"id":"eliminar","label":"","align":"center","width":"10%"}],"columns-user-groups-organizations":[{"id":"user","label":"User","minWidth":10,"align":"center","orden":"usuarios.primer_nombre"},{"id":"organization","label":"Organization","minWidth":10,"align":"center","orden":"organizaciones.nombre"},{"id":"userGroup","label":"User group","minWidth":110,"align":"center","orden":"gruposUsuarios.nombre"},{"id":"edit","label":""},{"id":"delete","label":""}],"columns-socialMedia":[{"id":"icono","label":"Icon","align":"center"},{"id":"nombre","label":"Name","align":"center","orden":"nombre"},{"id":"","label":"","align":"center"},{"id":"","label":"","align":"center"}]},"pagination":{"all-pages":"Pages: All","one-page":"Page"}}')},581:function(e){e.exports=JSON.parse('{"buttons":{"accept":"Aceptar","cancel":"Cancelar","back":"Atr\xe1s","delete":"Eliminar","add-criterion":"Agregar criterio","save":"Guardar","preview":"Vista Previa","close":"Cerrar","upload-image":"Subir imagen","upload-documents":"Subir documento","create":"Crear","change-order":"Cambiar Orden","save-order":"Guardar Orden","choose-csv":"Elegir archivo CSV","send":"Enviar","issue":"Emitir","see-all":"Ver todos","edit":"Editar","reminder":"Recordatorio","badge-no-accepted":"insignia no aceptada","create-account":"crear cuenta","share-badge":"compartir insignia","design-certificate":"Dise\xf1ar certificado","filter":"Filtrar","export":"Exportar","download":"Descargar","certificate-issue":"Correo emisi\xf3n certificados","certificate-no-accepted":"certificado no aceptado","share-certificate":"compartir certificado","verify":"Verificar","click-here":"Haciendo click aqu\xed","logout":"Cerrar Sesi\xf3n","go-login":"Ir a la p\xe1gina principal","design-documents":"Dise\xf1ar documento","change-documents":"Cambiar documento","view-design-documents":"Abrir dise\xf1o","design-carnet":"Dise\xf1ar carnet","carnet-no-accepted":"carnet no aceptado","see-carnet":"ver carnet","answer":"Responder","finished":"Finalizar","add-field":"Agregar campo","reminders":"Recordatorios","exit":"Salir","sign-in":"Iniciar Sesi\xf3n","register":"Registrarme","send-document-email":"Enviar documento por correo electr\xf3nico","send-document-whatsapp":"Enviar documento por Whatsapp","download-documents":"Descargar documento","finish":"Terminar","next":"Siguiente","draw":"Dibujar","write":"Escribir","upload":"Cargar","add-signature":"Agregar mi firma","add-signatorie":"Gestionar firmantes","change-image":"Cambiar imagen","my-sign":"Mis firmas","design-diploma":"Dise\xf1ar diploma","send-by-email":"Enviar por correo electr\xf3nico","send-by-wp":"Enviar por Whatsapp","view-history-send":"Ver historial de env\xedos","remember":"Recordar a los firmantes","country-select":"Pa\xeds","country-select-option-default":"Seleccione una opci\xf3n","to-manage":"Gestionar","upload-logo":"Subir logo."},"tooltips":{"text":"Texto","image":"Im\xe1genes","buttons":"Botones","sign":"Firmas","view-actions":"Ver acciones","share-by-email":"Compartido por correo","share-by-whatsapp":"Compartido por whatsapp","reminder":"Recordatorio por correo"}}')},582:function(e){e.exports=JSON.parse('{"buttons":{"accept":"Accept","cancel":"Cancel","back":"Back","delete":"Delete","add-criterion":"Add criterion","save":"Save","preview":"Preview","close":"Close","upload-image":"Upload image","upload-documents":"Upload documents","create":"Create","change-order":"Change Order","save-order":"Save Order","choose-csv":"Choose csv file","send":"Send","issue":"Issue","see-all":"See all","edit":"Edit","reminder":"Reminder","badge-no-accepted":"badge not accepted","create-account":"create account","share-badge":"share badge","design-certificate":"Design certificate","filter":"Filter","export":"Export","download":"Download","certificate-issue":"Email certificate issue","certificate-no-accepted":"certificate not accepted","share-certificate":"share certificate","verify":"Verify","click-here":"Click here","logout":"Logout","go-login":"Go To Login","design-documents":"Design document","change-documents":"Change document","view-design-documents":"Open design","design-carnet":"Design carnet","carnet-no-accepted":"carnet not accepted","share-carnet":"share carnet","see-carnet":"see carnet","answer":"Reply","finished":"Finalize","add-field":"Add field","reminders":"Reminders","exit":"Exit","sign-in":"Sign In","register":"Register","send-document-email":"Send document by email","send-document-whatsapp":"Send document via Whatsapp","download-documents":"Download document","finish":"Finish","next":"Next","draw":"Draw","write":"Write","upload":"Upload","add-signature":"Add my signature","add-signatorie":"Manage signers","change-image":"Change image","my-sign":"My Signatures","design-diploma":"Design diploma","send-by-email":"Send by e-mail","send-by-wp":"Send by Whatsapp","view-history-send":"View shipping history","remember":"Remind the signatories","country-select":"Country","country-select-option-default":"Select an option","to-manage":"Manage","upload-logo":"Upload Logo"},"tooltips":{"text":"Text","image":"Images","buttons":"Buttons","sign":"Signatures","view-actions":"View actions","share-by-email":"Share by email","share-by-whatsapp":"Share by whatsapp","reminder":"Reminders"}}')},583:function(e){e.exports=JSON.parse('{"appBar":{"welcome":"Bienvenido de nuevo,","dashboard":"Dashboard","change-password":"Cambiar Contrase\xf1a","edit-profile":"Editar Perfil","combination":"Combinar Cuenta","organization":"Organizaci\xf3n","logout":"Cerrar Sesi\xf3n","admin":"Administrador"}}')},584:function(e){e.exports=JSON.parse('{"appBar":{"welcome":"Welcome back,","dashboard":"Dashboard","change-password":"Change Password","edit-profile":"Edit Profile","combination":"Combine Account","organization":"Organization","logout":"Logout","admin":"Administrator"}}')},585:function(e){e.exports=JSON.parse('{"badges-certificate-form":{"badge-img":"Las plantillas de insignias deben usar im\xe1genes cuadradas en formato PNG, con dimensiones de al menos 600x600 p\xedxeles.","details-badge":"Detalles de la plantilla de insignia","badge-public-name":"Nombre p\xfablico de la insignia","badge-private-name":"Nombre privado de la insignia","description":"Descripci\xf3n","additional":"Url para la informaci\xf3n adicional","skills":"Habilidades","skill-select":"Selecciona habilidad","criteria-title":"Criterios de insignia","criteria-certificate-title":"Criterios del certificado","criterion":"Criterio","type":"Tipo","criterion-url":"Url del criterio","attributes":"Atributos","level":"Nivel","cost":"Costo","time":"Tiempo","amount-time":"Cantidad de tiempo","recommendation-title":"Recomendaciones (Opcional)","organization":"Organizaci\xf3n","details-certificate":"Detalles de la plantilla del certificado","certificate-img":"Las plantillas de certificados deben usar im\xe1genes en formato PNG.","certificate-img-max-file":"Max. 3 im\xe1genes del mismo formato por certificado.","recommended-size":"Tama\xf1o recomendado para certificados ","horizontal":"horizontales ","least":"de al menos ","certificates":"y para los certificados ","vertical":"verticales","pixels":"p\xedxeles","certificate-public-name":"Nombre p\xfablico del certificado","certificate-private-name":"Nombre privado del certificado","documents-dropzoneArea":"Arrastra el documento o haz click para seleccionarlo","signature-dropzoneArea":"Arrastra la imagen de tu firma o haz click para seleccionarla","documents-public-name":"Nombre","documents-private-name":"Nombre privado","documents-selected-files":"Documentos seleccionados","details-carnet":"Detalles de la plantilla del carnet","carnet-public-name":"Nombre p\xfablico del carnet","carnet-private-name":"Nombre privado del carnet","additional-fields":"Campos adicionales","field":"Campo","field-name":"Nombre del campo","field-type":"Tipo del campo","field-title":"T\xedtulo del campo","field-description":"Descripci\xf3n del campo","field-url":"Url del campo","details-diploma":"Detalles de la plantilla del diploma","diploma-img":"Las plantillas de los diplomas deben usar im\xe1genes en formato PNG.","diploma-img-max-file":"Max. 3 im\xe1genes del mismo formato por diploma.","diploma-recommended-size":"Tama\xf1o recomendado para diplomas ","diplomas":"y para los diplomas ","diploma-public-name":"Nombre p\xfablico del diploma","diploma-private-name":"Nombre privado del diploma","criteria-diploma-title":"Criterios del diploma"},"details":{"issued-by":"Emitido por","created":"Creado","created-by":"Creado por","skills":"Habilidades","type":"Tipo","level":"Nivel","cost":"Costo","time":"Tiempo","criteria":"Requisitos para insignia","recommendations":"Recomendaciones","additional":"Informaci\xf3n adicional","more-information":"M\xe1s informaci\xf3n","date-create":"Fecha de creaci\xf3n","requirements":"Requisitos","attributes":"Atributos","right-reserved":"Todos los derechos reservados","requirements-certificate":"Requisitos para el certificado","issued":"Emitido","expiration":"Vencimiento","badge-link":"Link de insignia","copied":"\xa1Copiado!","badge-code":"C\xf3digo de la insignia","coffered":"Es conferido a","merit":"M\xe9rito","merit-link":"Link m\xe9rito","met-requirements":"Por lo tanto ha cumplido con los requisitos","credencials":"Mostrar credenciales","copied-certificate":"del certificado copiado","certificate-link":"Link del certificado","copy":"Copiar","certificate-code":"C\xf3digo del certificado","document-code":"C\xf3digo del documento","document-link":"Link del documento","copied-document":"del documento copiado","date-certification":"Fecha de certificaci\xf3n","fields-privates":"Campos Privados","fields-publics":"Campos P\xfablicos","information-public":"Informaci\xf3n P\xfablica","information-private":"Informaci\xf3n Privada","fields-additionals":"Campos Adicionales"},"certificate-design":{"name-field":"Nombre del campo","type-config-field":"Configuraci\xf3n del campo","type-field":"Tipo del campo","example":"Texto de ejemplo","font":"Tipo de letra","size-letter":"Tama\xf1o de letra","style-letter":"Estilos de letra","align-letter":"Formato de letra","colour":"Color","title-design":"Dise\xf1o de certificados","colour-text":"Color Texto","colour-background":"Color Bot\xf3n","texts":"Texto","images":"Im\xe1genes","buttons":"Botones","signatures":"Firmas","button-verify":"Bot\xf3n para verificar"},"documents-design":{"title-design":"Dise\xf1o de documentos","field":"Texto del campo"},"diplomas-design":{"title-design":"Dise\xf1o de diplomas","field":"Texto del campo"},"sharing":{"badge-sharing":"He obtenido la siguiente insignia emitida por","via-certika":"via","certificate-sharing":"He obtenido el siguiente certificado emitido por","document-sharing":"El siguiente documento ha sido certificado por","carnet-sharing":"He obtenido el siguiente carnet emitido por"}}')},586:function(e){e.exports=JSON.parse('{"badges-certificate-form":{"badge-img":"Badge templates must use square images in PNG format, with dimensions of at least 600x600 pixels.","details-badge":"Badge template details","badge-public-name":"Badge Public Name","badge-private-name":"Badge Private Name","description":"Description","additional":"Url for additional information","skills":"Skills","criteria-title":"Badge criteria","criteria-certificate-title":"Certificate criteria","criterion":"Criterion","type":"Type","criterion-url":"Criterion url","attributes":"Attributes","level":"Level","cost":"Cost","time":"Time","amount-time":"Amount of time","recommendation-title":"Recommendations (Optional)","organization":"Organization","details-certificate":"Certificate template details","certificate-img":"Certificate templates must use images in PNG format.","certificate-img-max-file":"Max. 3 images of the same format per certificate.","recommended-size":"Recommended size for certificates ","horizontal":"horizontal ","least":"of at least ","certificates":"and for certificates ","vertical":"vertical","pixels":"pixels","certificate-public-name":"Certificate Public Name","certificate-private-name":"Certificate Private Name","documents-dropzoneArea":"Drag the document or click to select it","signature-dropzoneArea":"Drag your signature image or click to select it","documents-public-name":"Name","documents-private-name":"Name private","documents-selected-files":"Selected files","details-carnet":"Carnet template details","carnet-public-name":"Carnet Public Name","carnet-private-name":"Carnet Private Name","additional-fields":"Additional Fields","field":"Field","field-name":"Field name","field-type":"Field type","field-title":"Field title","field-description":"Field description","field-url":"Field url","details-diploma":"Diploma template details","diploma-img":"Diploma templates must use images in PNG format.","diploma-img-max-file":"Max. 3 images of the same format per diploma.","diploma-recommended-size":"Recommended size for diplomas ","diplomas":"and for diplomas ","diploma-public-name":"Diploma public name","diploma-private-name":"Diploma private name","criteria-diploma-title":"Diploma criteria"},"details":{"issued-by":"Issued by","created":"Created","created-by":"Created by","skills":"Skills","type":"Type","level":"Level","cost":"Cost","time":"Time","criteria":"Badge Requirements","recommendations":"Recommendations","additional":"Additional information","more-information":"More information","date-create":"Creation date","requirements":"Requirements","attributes":"Attributes","right-reserved":"All rights reserved","requirements-certificate":"Requirements for the certificate","issued":"Issued","expiration":"Expiration","badge-link":"Badge link","copied":"Copied!","badge-code":"Badge code","coffered":"It is conferred to","merit":"Merit","merit-link":"Merit link","met-requirements":"Therefore, it has met the requirements","credencials":"Show credentials","copied-certificate":"of the copied certificate","certificate-link":"Certificate link","copy":"Copy","certificate-code":"Certificate code","document-code":"Document code","document-link":"Document link","copied-document":"of the copied document","date-certification":"Certification date","fields-privates":"Private Fields","fields-publics":"Public Fields","information-public":"Public Information","information-private":"Private Information","fields-additionals":"Additional Fields"},"certificate-design":{"name-field":"Field Name","type-config-field":"Field Configuration","type-field":"Field type","example":"Sample text","font":"Font","size-letter":"Letter size","style-letter":"Letter styles","align-letter":"Letter format","colour":"Colour","title-design":"Certificate Design","colour-text":"Colour Text","colour-background":"Colour Button","texts":"Text","images":"Images","buttons":"Buttons","signatures":"Signatures","button-verify":"Button to verify"},"documents-design":{"title-design":"Documents Design","field":"Field text"},"diplomas-design":{"title-design":"Diplomas design","field":"Field text"},"sharing":{"badge-sharing":"I have obtained the following badge issued by","via-certika":"via","certificate-sharing":"I have obtained the following certificate issued by","document-sharing":"The following document has been certified by","carnet-sharing":"I have obtained the following carnet issued by"}}')},587:function(e){e.exports=JSON.parse('{"dialog":{"version":"Versi\xf3n 1.5","details":"Detalles de la acci\xf3n","preview-title":"Vista previa de la plantilla insignia","previous":"Dato anterior","current":"Dato actual","skill":"Habilidad","groups-issue-badges-name":"Ingrese el nombre del grupo de insignias:","select-organization":"Seleccione una organizaci\xf3n:","choose-option":"Escoja una opci\xf3n","edit-group-badge-issue":"Editar nombre grupo insignias emitidas","badge-group-issue-name":"Ingrese el nombre del grupo de insignias: *","certificate-group-issue-name":"Ingrese el nombre del grupo de certificados: *","preview-title-template-certificate":"Vista previa de plantilla certificado","state-published":"Publicado","state-archived":"Archivado","state-created":"Creado","state-deleted":"Se\xa0elimin\xf3 una\xa0plantilla.","state-added":"Se\xa0agreg\xf3\xa0una\xa0plantilla.","collection-created":"Se cre\xf3 una colecci\xf3n.","notification-message":"Mensaje de notificaci\xf3n: *","edit-group-certificate-issue":"Editar nombre grupo certificados emitidos","carnet-group-issue-name":"Ingrese el nombre del grupo de carnets: *","preview-title-template-carnet":"Vista previa de plantilla carnet","edit-group-carnet-issue":"Editar nombre grupo carnets emitidos","reports":"Reportes","new-report":"\xbfEn qu\xe9 podemos ayudarte?","answer-report":"Env\xedanos tu respuesta.","message-report":"Escribe una breve descripci\xf3n.","preview-title-template-diploma":"Vista previa de plantilla diploma","accounts":"Cuentas"}}')},588:function(e){e.exports=JSON.parse('{"dialog":{"version":"Version 1.5","details":"Action details","preview-title":"Template badge preview","previous":"Previous data","current":"Current data","skill":"Skill","groups-issue-badges-name":"Enter the name of the badge group:","select-organization":"Select an organization:","choose-option":"Choose an option","edit-group-badge-issue":"Edit group name badges issued","badge-group-issue-name":"Enter the name of the badge group: *","certificate-group-issue-name":"Enter the name of the certificate group: *","preview-title-template-certificate":"Certificate template preview","state-publish":"Published","state-archive":"Archived","state-create":"Created","state-deleted":"A template was removed.","state-added":"A template was added.","collection-created":"A collection was created.","notification-message":"Notification message: *","edit-group-certificate-issue":"Edit group name certificates issued","carnet-group-issue-name":"Enter the name of the carnet group: *","preview-title-template-carnet":"Carnet template preview","edit-group-carnet-issue":"Edit group name carnets issued","reports":"Reports","new-report":"How can we help you?","answer-report":"Send us your answer.","message-report":"Write a short description.","preview-title-template-diploma":"Diploma template preview","accounts":"Accounts"}}')},589:function(e){e.exports=JSON.parse('{"selects-autocompletes":{"skill-select":"Selecciona una habilidad","select-option":"Selecciona una opci\xf3n","select-option-documents":"Selecciona una organizaci\xf3n","recommendation-select":"Selecciona una plantilla","certificate-select":"Selecciona un certificado","carnet-select":"Selecciona un carnet","diploma-select":"Selecciona un diploma","social-network-select":"Redes sociales"}}')},590:function(e){e.exports=JSON.parse('{"selects-autocompletes":{"skill-select":"Select a skill","select-option":"Select an option","select-option-documents":"Select an organization","recommendation-select":"Select a template","certificate-select":"Select a certificate","carnet-select":"Select a ID Card","diploma-select":"Select a diploma","social-network-select":"Social network"}}')},591:function(e){e.exports=JSON.parse('{"tabs":{"tabs-badge":[{"label":"Publicados","route":"/templates/published"},{"label":"En Edici\xf3n","route":"/templates/edited"},{"label":"Archivados","route":"/templates/archived"}],"tabs-details":[{"label":"Detalle"},{"label":"Historial"}],"tabs-certificate":[{"label":"Publicados","route":"/certificates/published"},{"label":"En Edici\xf3n","route":"/certificates/edited"},{"label":"Archivados","route":"/certificates/archived"}],"tabs-documents":[{"label":"Publicados","route":"/templates/documents/published"},{"label":"En Edici\xf3n","route":"/templates/documents/edited"},{"label":"Archivados","route":"/templates/documents/archived"}],"tabs-carnets":[{"label":"Publicados","route":"/carnets/published"},{"label":"En Edici\xf3n","route":"/carnets/edited"},{"label":"Archivados","route":"/carnets/archived"}],"tabs-plan":[{"label":"Mi plan","route":"/plan/myplan"},{"label":"Historial de pagos","route":"/plan/history"}],"tabs-diploma":[{"label":"Publicados","route":"/diplomas/templates/published"},{"label":"En Edici\xf3n","route":"/diplomas/templates/edited"},{"label":"Archivados","route":"/diplomas/templates/archived"}]}}')},592:function(e){e.exports=JSON.parse('{"tabs":{"tabs-badge":[{"label":"Published","route":"/templates/published"},{"label":"In edit","route":"/templates/edited"},{"label":"Archived","route":"/templates/archived"}],"tabs-details":[{"label":"Detail"},{"label":"Record"}],"tabs-certificate":[{"label":"Published","route":"/certificates/published"},{"label":"In edit","route":"/certificates/edited"},{"label":"Archived","route":"/certificates/archived"}],"tabs-documents":[{"label":"Published","route":"/templates/documents/published"},{"label":"In edit","route":"/templates/documents/edited"},{"label":"Archived","route":"/templates/documents/archived"}],"tabs-carnets":[{"label":"Published","route":"/carnets/published"},{"label":"In edit","route":"/carnets/edited"},{"label":"Archived","route":"/carnets/archived"}],"tabs-plan":[{"label":"My plan","route":"/plan/myplan"},{"label":"Payment history","route":"/plan/history"}],"tabs-diploma":[{"label":"Published","route":"/diplomas/templates/published"},{"label":"In edit","route":"/diplomas/templates/edited"},{"label":"Archived","route":"/diplomas/templates/archived"}]}}')},593:function(e){e.exports=JSON.parse('{"breadCrumps":{"badge-published":[{"name":"Badges"},{"name":"Templates"},{"name":"Published"}],"badge-archived":[{"name":"Badges"},{"name":"Templates"},{"name":"Archived"}],"badge-edition":[{"name":"Badges"},{"name":"Templates"},{"name":"In Edition"}],"badge-details-published":[{"name":"Badges"},{"name":"Templates","route":"/templates/published"},{"name":"Published","route":"/templates/published"},{"name":"Detail"}],"badge-details-edited":[{"name":"Badges"},{"name":"Templates","route":"/templates/published"},{"name":"In Edition","route":"/templates/edited"},{"name":"Detail"}],"badge-details-archived":[{"name":"Badges"},{"name":"Templates","route":"/templates/published"},{"name":"Archived","route":"/templates/archived"},{"name":"Detail"}],"badge-history-published":[{"name":"Badges"},{"name":"Templates","route":"/templates/published"},{"name":"Published","route":"/templates/published"},{"name":"Record"}],"badge-history-edited":[{"name":"Badges"},{"name":"Templates","route":"/templates/published"},{"name":"In Edition","route":"/templates/edited"},{"name":"Record"}],"badge-history-archived":[{"name":"Badges"},{"name":"Templates","route":"/templates/published"},{"name":"Archived","route":"/templates/archived"},{"name":"Record"}],"badge-template-create":[{"name":"Badges"},{"name":"Templates","route":"/templates/published"},{"name":"Create"}],"badge-template-edit":[{"name":"Badges"},{"name":"Templates","route":"/templates/published"},{"name":"Edit"}],"badge-collection":[{"name":"Badges"},{"name":"Collections"}],"badge-collection-assigned":[{"name":"Badges"},{"name":"Collections","route":"/collections"},{"name":"Assigned Templates"}],"badge-collection-history":[{"name":"Badges"},{"name":"Collections","route":"/collections"},{"name":"Record"}],"badge-collection-create":[{"name":"Badges"},{"name":"Collections","route":"/collections"},{"name":"Create"}],"badge-collection-edit":[{"name":"Badges"},{"name":"Collections","route":"/collections"},{"name":"Edit"}],"badge-recommendation":[{"name":"Badges"},{"name":"Recommendations"}],"badge-recommendation-assigned":[{"name":"Badges"},{"name":"Recommendations","route":"/recommendations"},{"name":"Assigned Templates"}],"badge-recommendation-history":[{"name":"Badges"},{"name":"Recommendations","route":"/recommendations"},{"name":"Record"}],"badge-recommendation-create":[{"name":"Badges"},{"name":"Recommendations","route":"/recommendations"},{"name":"Create"}],"badge-recommendation-edit":[{"name":"Badges"},{"name":"Recommendations","route":"/recommendations"},{"name":"Edit"}],"badge-issue":[{"name":"Badges"},{"name":"Issue"}],"groups-badge-issued":[{"name":"Badges"},{"name":"Badge groups issued"}],"groups-badge-issued-badges-issued":[{"name":"Badges"},{"name":"Badge groups issued","route":"/badgesIssued"},{"name":"Badges Issued"}],"certificates-published":[{"name":"Certificates"},{"name":"Templates"},{"name":"Published"}],"certificates-edition":[{"name":"Certificates"},{"name":"Templates"},{"name":"In Edition"}],"certificates-archived":[{"name":"Certificates"},{"name":"Templates"},{"name":"Archived"}],"certificate-details-published":[{"name":"Certificates"},{"name":"Templates","route":"/certificates/published"},{"name":"Published","route":"/certificates/published"},{"name":"Detail"}],"certificate-details-edited":[{"name":"Certificates"},{"name":"Templates","route":"/certificates/published"},{"name":"In Edition","route":"/certificates/edited"},{"name":"Detail"}],"certificate-details-archived":[{"name":"Certificates"},{"name":"Templates","route":"/certificates/published"},{"name":"Archived","route":"/certificates/archived"},{"name":"Detail"}],"certificate-history-published":[{"name":"Certificates"},{"name":"Templates","route":"/certificates/published"},{"name":"Published","route":"/certificates/published"},{"name":"Record"}],"certificate-history-edited":[{"name":"Certificates"},{"name":"Templates","route":"/certificates/published"},{"name":"In Edition","route":"/certificates/edited"},{"name":"Record"}],"certificate-history-archived":[{"name":"Certificates"},{"name":"Templates","route":"/certificates/published"},{"name":"Archived","route":"/certificates/archived"},{"name":"Record"}],"certificate-template-create":[{"name":"Certificates"},{"name":"Templates","route":"/certificates/published"},{"name":"Create"}],"certificate-template-edit":[{"name":"Certificates"},{"name":"Templates","route":"/certificates/published"},{"name":"Edit"}],"certificate-recommendation":[{"name":"Certificates"},{"name":"Recommendations"}],"certificate-recommendation-assigned":[{"name":"Certificates"},{"name":"Recommendations","route":"/recommendations/certificate"},{"name":"Assigned Templates"}],"certificate-recommendation-history":[{"name":"Certificates"},{"name":"Recommendations","route":"/recommendations/certificate"},{"name":"Record"}],"certificate-recommendation-create":[{"name":"Certificates"},{"name":"Recommendations","route":"/recommendations/certificate"},{"name":"Create"}],"certificate-recommendation-edit":[{"name":"Certificates"},{"name":"Recommendations","route":"/recommendations/certificate"},{"name":"Edit"}],"certificate-collection":[{"name":"Certificates"},{"name":"Collections"}],"certificate-collection-assigned":[{"name":"Certificates"},{"name":"Collections","route":"/collections/certificate"},{"name":"Assigned Templates"}],"certificate-collection-history":[{"name":"Certificates"},{"name":"Collections","route":"/collections/certificate"},{"name":"Record"}],"certificate-collection-create":[{"name":"Certificates"},{"name":"Collections","route":"/collections/certificate"},{"name":"Create"}],"certificate-collection-edit":[{"name":"Certificates"},{"name":"Collections","route":"/collections/certificate"},{"name":"Edit"}],"analytics-list":[{"name":"Analytics"},{"name":"List"}],"analytics-statistics":[{"name":"Analytics"},{"name":"Statistics"}],"certificate-issue":[{"name":"Certificates"},{"name":"Issue"}],"groups-certificate-issued":[{"name":"Certificates"},{"name":"Certificate groups issued"}],"groups-certificate-issued-certificates-issued":[{"name":"Certificates"},{"name":"Certificate groups issued","route":"/certificates/issued"},{"name":"Certificates Issued"}],"documents-published":[{"name":"Documents"},{"name":"Templates"},{"name":"Published"}],"documents-archived":[{"name":"Documents"},{"name":"Templates"},{"name":"Archived"}],"documents-edition":[{"name":"Documents"},{"name":"Templates"},{"name":"In Edition"}],"documents-details-published":[{"name":"Documents"},{"name":"Templates","route":"/templates/documents/published"},{"name":"Published","route":"/templates/documents/published"},{"name":"Detail"}],"documents-details-edited":[{"name":"Documents"},{"name":"Templates","route":"/templates/documents/published"},{"name":"In Edition","route":"/templates/documents/edited"},{"name":"Detail"}],"documents-details-archived":[{"name":"Documents"},{"name":"Templates","route":"/templates/documents/published"},{"name":"Archived","route":"/templates/documents/archived"},{"name":"Detail"}],"documents-history-published":[{"name":"Documents"},{"name":"Templates","route":"/templates/documents/published"},{"name":"Published","route":"/templates/documents/published"},{"name":"Record"}],"documents-history-edited":[{"name":"Documents"},{"name":"Templates","route":"/templates/documents/published"},{"name":"In Edition","route":"/templates/documents/edited"},{"name":"Record"}],"documents-history-archived":[{"name":"Documents"},{"name":"Templates","route":"/templates/documents/published"},{"name":"Archived","route":"/templates/documents/archived"},{"name":"Record"}],"documents-template-create":[{"name":"Documents"},{"name":"Templates","route":"/templates/documents/published"},{"name":"Create"}],"documents-template-edit":[{"name":"Documents"},{"name":"Templates","route":"/templates/documents/published"},{"name":"Edit"}],"documents-certify":[{"name":"Documents"},{"name":"Certify"}],"documents-sign":[{"name":"Digital Signature"},{"name":"Sign"}],"documents-files-folders":[{"name":"Documents"},{"name":"Folders"}],"documents-files-folders-files":[{"name":"Documents"},{"name":"Files","route":"/documents/files"}],"documents-files-folders-files-sign":[{"name":"Digital Signature"},{"name":"Files","route":"/documents/sign/files"}],"carnets-published":[{"name":"ID Cards"},{"name":"Templates"},{"name":"Published"}],"carnets-edition":[{"name":"ID Cards"},{"name":"Templates"},{"name":"In Edition"}],"carnets-archived":[{"name":"ID Cards"},{"name":"Templates"},{"name":"Archived"}],"carnet-details-published":[{"name":"ID Cards"},{"name":"Templates","route":"/carnets/published"},{"name":"Published","route":"/carnets/published"},{"name":"Detail"}],"carnet-details-edited":[{"name":"ID Cards"},{"name":"Templates","route":"/carnets/published"},{"name":"In Edition","route":"/carnets/edited"},{"name":"Detail"}],"carnet-details-archived":[{"name":"ID Cards"},{"name":"Templates","route":"/carnets/published"},{"name":"Archived","route":"/carnets/archived"},{"name":"Detail"}],"carnet-history-published":[{"name":"ID Cards"},{"name":"Templates","route":"/carnets/published"},{"name":"Published","route":"/carnets/published"},{"name":"Record"}],"carnet-history-edited":[{"name":"ID Cards"},{"name":"Templates","route":"/carnets/published"},{"name":"In Edition","route":"/carnets/edited"},{"name":"Record"}],"carnet-history-archived":[{"name":"ID Cards"},{"name":"Templates","route":"/carnets/published"},{"name":"Archived","route":"/carnets/archived"},{"name":"Record"}],"carnet-template-create":[{"name":"ID Cards"},{"name":"Templates","route":"/carnets/published"},{"name":"Create"}],"carnet-template-edit":[{"name":"ID Cards"},{"name":"Templates","route":"/carnets/published"},{"name":"Edit"}],"groups-carnet-issued-carnets-issued":[{"name":"ID Cards"},{"name":"ID Card groups issued","route":"/carnets/issued"},{"name":"ID Card Issued"}],"groups-carnet-issued":[{"name":"ID Cards"},{"name":"ID Card groups issued"}],"carnet-issue":[{"name":"ID Cards"},{"name":"Issue"}],"reports-carnet":[{"name":"ID Cards"},{"name":"Reports"}],"payments":[{"name":"Settings"},{"name":"Payments"}],"diplomas-published":[{"name":"Diplomas"},{"name":"Templates"},{"name":"Published"}],"diplomas-edition":[{"name":"Diplomas"},{"name":"Templates"},{"name":"In Edition"}],"diplomas-archived":[{"name":"Diplomas"},{"name":"Templates"},{"name":"Archived"}],"reports-certificate":[{"name":"Certificates"},{"name":"Reports"}],"reports-badge":[{"name":"Badges"},{"name":"Reports"}],"groups-diplomas-issued":[{"name":"Diplomas"},{"name":"Groups diplomas issued"}],"diploma-issue":[{"name":"Diplomas"},{"name":"Issue"}],"diploma-template-create":[{"name":"Diplomas"},{"name":"Templates","route":"/diplomas/templates/published"},{"name":"Create"}],"diploma-template-edit":[{"name":"Diplomas"},{"name":"Templates","route":"/diplomas/templates/published"},{"name":"Edit"}],"diploma-details-published":[{"name":"Diplomas"},{"name":"Templates","route":"/diplomas/templates/published"},{"name":"Published","route":"/diplomas/templates/published"},{"name":"Detail"}],"diploma-details-edited":[{"name":"Diplomas"},{"name":"Templates","route":"/diplomas/templates/published"},{"name":"In Edition","route":"/diplomas/templates/edited"},{"name":"Detail"}],"diploma-details-archived":[{"name":"Diplomas"},{"name":"Templates","route":"/diplomas/templates/published"},{"name":"Archived","route":"/diplomas/templates/archived"},{"name":"Detail"}],"diploma-history-published":[{"name":"Diplomas"},{"name":"Templates","route":"/diplomas/templates/published"},{"name":"Published","route":"/diplomas/templates/published"},{"name":"Record"}],"diploma-history-edited":[{"name":"Diplomas"},{"name":"Templates","route":"/diplomas/templates/published"},{"name":"In Edition","route":"/diplomas/templates/edited"},{"name":"Record"}],"diploma-history-archived":[{"name":"Diplomas"},{"name":"Templates","route":"/diplomas/templates/published"},{"name":"Archived","route":"/diplomas/templates/archived"},{"name":"Record"}],"settings-users":[{"name":"Settings"},{"name":"Users"}],"settings-users-create":[{"name":"Settings"},{"name":"Users","route":"/users"},{"name":"Create"}],"settings-users-edit":[{"name":"Settings"},{"name":"Users","route":"/users"},{"name":"Edit"}],"settings-organizations":[{"name":"Settings"},{"name":"Organizations"}],"settings-organizations-edit":[{"name":"Settings"},{"name":"Organizations","route":"/organizations"},{"name":"Edit"}],"settings-organizations-create":[{"name":"Settings"},{"name":"Organizations","route":"/organizations"},{"name":"Create"}],"ids-templates-badges":[{"name":"Badges"},{"name":"Ids templates badges"}],"ids-templates-certificates":[{"name":"Certificates"},{"name":"Ids templates certificates"}],"ids-templates-documents":[{"name":"Documents"},{"name":"Ids templates documents"}],"parameter-values":[{"name":"Settings"},{"name":"Parameter values"}],"parameter-values-create":[{"name":"Settings"},{"name":"Parameter values","route":"/valueParameters"},{"name":"Create"}],"parameter-values-edit":[{"name":"Settings"},{"name":"Parameter values","route":"/valueParameters"},{"name":"Edit"}],"contracts":[{"name":"Settings"},{"name":"Contracts"}],"contracts-organization":[{"name":"Settings"},{"name":"Contracts","route":"/contracts"}],"contracts-organization-create":[{"name":"Settings"},{"name":"Contracts","route":"/contracts"},{"name":"Create"}],"contracts-organization-edit":[{"name":"Settings"},{"name":"Contracts","route":"/contracts"},{"name":"Edit"}],"modules":[{"name":"Settings"},{"name":"Modules"}],"modules-create":[{"name":"Settings"},{"name":"Modules","route":"/modules"},{"name":"Create"}],"modules-edit":[{"name":"Settings"},{"name":"Modules","route":"/modules"},{"name":"Edit"}],"userGroup":[{"name":"Settings"},{"name":"User groups"}],"userGroup-edit":[{"name":"Settings"},{"name":"User groups","route":"/userGroups"},{"name":"Edit"}],"userGroup-create":[{"name":"Settings"},{"name":"User groups","route":"/userGroups"},{"name":"Create"}],"permissions":[{"name":"Settings"},{"name":"Permissions"}],"permissions-manage":[{"name":"Settings"},{"name":"Permissions","route":"/permissions"},{"name":"To manage"}],"user-groups-organizations":[{"name":"Settings"},{"name":"User groups organizations"}],"user-groups-organizations-create":[{"name":"Settings"},{"name":"User groups organizations","route":"/userGroupsOrganization"},{"name":"Create"}],"user-groups-organizations-edit":[{"name":"Settings"},{"name":"User groups organizations","route":"/userGroupsOrganization"},{"name":"Edit"}],"socialMedia":[{"name":"Settings"},{"name":"Social media"}],"socialMedia-create":[{"name":"Settings"},{"name":"Social media","route":"/socialNetworks"},{"name":"Create"}],"socialMedia-edit":[{"name":"Settings"},{"name":"Social media","route":"/socialNetworks"},{"name":"Edit"}]}}')},594:function(e){e.exports=JSON.parse('{"breadCrumps":{"badge-published":[{"name":"Insignias"},{"name":"Plantillas"},{"name":"Publicados"}],"badge-archived":[{"name":"Insignias"},{"name":"Plantillas"},{"name":"Archivados"}],"badge-edition":[{"name":"Insignias"},{"name":"Plantillas"},{"name":"En Edici\xf3n"}],"badge-details-published":[{"name":"Insignias"},{"name":"Plantillas","route":"/templates/published"},{"name":"Publicados","route":"/templates/published"},{"name":"Detalle"}],"badge-details-edited":[{"name":"Insignias"},{"name":"Plantillas","route":"/templates/published"},{"name":"En Edici\xf3n","route":"/templates/edited"},{"name":"Detalle"}],"badge-details-archived":[{"name":"Insignias"},{"name":"Plantillas","route":"/templates/published"},{"name":"Archivados","route":"/templates/archived"},{"name":"Detalle"}],"badge-history-published":[{"name":"Insignias"},{"name":"Plantillas","route":"/templates/published"},{"name":"Publicados","route":"/templates/published"},{"name":"Historial"}],"badge-history-edited":[{"name":"Insignias"},{"name":"Plantillas","route":"/templates/published"},{"name":"En Edici\xf3n","route":"/templates/edited"},{"name":"Historial"}],"badge-history-archived":[{"name":"Insignias"},{"name":"Plantillas","route":"/templates/published"},{"name":"Archivados","route":"/templates/archived"},{"name":"Historial"}],"badge-template-create":[{"name":"Insignias"},{"name":"Plantillas","route":"/templates/published"},{"name":"Crear"}],"badge-template-edit":[{"name":"Insignias"},{"name":"Plantillas","route":"/templates/published"},{"name":"Editar"}],"badge-collection":[{"name":"Insignias"},{"name":"Colecciones"}],"badge-collection-assigned":[{"name":"Insignias"},{"name":"Colecciones","route":"/collections"},{"name":"Plantillas Asignadas"}],"badge-collection-history":[{"name":"Insignias"},{"name":"Colecciones","route":"/collections"},{"name":"Historial"}],"badge-collection-create":[{"name":"Insignias"},{"name":"Colecciones","route":"/collections"},{"name":"Crear"}],"badge-collection-edit":[{"name":"Insignias"},{"name":"Colecciones","route":"/collections"},{"name":"Editar"}],"badge-recommendation":[{"name":"Insignias"},{"name":"Recomendaciones"}],"badge-recommendation-assigned":[{"name":"Insignias"},{"name":"Recomendaciones","route":"/recommendations"},{"name":"Plantillas Asignadas"}],"badge-recommendation-history":[{"name":"Insignias"},{"name":"Recomendaciones","route":"/recommendations"},{"name":"Historial"}],"badge-recommendation-create":[{"name":"Insignias"},{"name":"Recomendaciones","route":"/recommendations"},{"name":"Crear"}],"badge-recommendation-edit":[{"name":"Insignias"},{"name":"Recomendaciones","route":"/recommendations"},{"name":"Editar"}],"badge-issue":[{"name":"Insignias"},{"name":"Emitir"}],"groups-badge-issued":[{"name":"Insignias"},{"name":"Grupos de Insignias emitidas"}],"groups-badge-issued-badges-issued":[{"name":"Insignias"},{"name":"Grupos de Insignias emitidas","route":"/badgesIssued"},{"name":"Insignias emitidas"}],"certificates-published":[{"name":"Certificados"},{"name":"Plantillas"},{"name":"Publicados"}],"certificates-edition":[{"name":"Certificados"},{"name":"Plantillas"},{"name":"En Edici\xf3n"}],"certificates-archived":[{"name":"Certificados"},{"name":"Plantillas"},{"name":"Archivados"}],"certificate-details-published":[{"name":"Certificados"},{"name":"Plantillas","route":"/certificates/published"},{"name":"Publicados","route":"/certificates/published"},{"name":"Detalle"}],"certificate-details-edited":[{"name":"Certificados"},{"name":"Plantillas","route":"/certificates/published"},{"name":"En Edici\xf3n","route":"/certificates/edited"},{"name":"Detalle"}],"certificate-details-archived":[{"name":"Certificados"},{"name":"Plantillas","route":"/certificates/published"},{"name":"Archivados","route":"/certificates/archived"},{"name":"Detalle"}],"certificate-history-published":[{"name":"Certificados"},{"name":"Plantillas","route":"/certificates/published"},{"name":"Publicados","route":"/certificates/published"},{"name":"Historial"}],"certificate-history-edited":[{"name":"Certificados"},{"name":"Plantillas","route":"/certificates/published"},{"name":"En Edici\xf3n","route":"/certificates/edited"},{"name":"Historial"}],"certificate-history-archived":[{"name":"Certificados"},{"name":"Plantillas","route":"/certificates/published"},{"name":"Archivados","route":"/certificates/archived"},{"name":"Historial"}],"certificate-template-create":[{"name":"Certificados"},{"name":"Plantillas","route":"/certificates/published"},{"name":"Crear"}],"certificate-template-edit":[{"name":"Certificados"},{"name":"Plantillas","route":"/certificates/published"},{"name":"Editar"}],"certificate-recommendation":[{"name":"Certificados"},{"name":"Recomendaciones"}],"certificate-recommendation-assigned":[{"name":"Certificados"},{"name":"Recomendaciones","route":"/recommendations/certificate"},{"name":"Plantillas Asignadas"}],"certificate-recommendation-history":[{"name":"Certificados"},{"name":"Recomendaciones","route":"/recommendations/certificate"},{"name":"Historial"}],"certificate-recommendation-create":[{"name":"Certificados"},{"name":"Recomendaciones","route":"/recommendations/certificate"},{"name":"Crear"}],"certificate-recommendation-edit":[{"name":"Certificados"},{"name":"Recomendaciones","route":"/recommendations/certificate"},{"name":"Editar"}],"certificate-collection":[{"name":"Certificados"},{"name":"Colecciones"}],"certificate-collection-assigned":[{"name":"Certificados"},{"name":"Colecciones","route":"/collections/certificate"},{"name":"Plantillas asignadas"}],"certificate-collection-history":[{"name":"Certificados"},{"name":"Colecciones","route":"/collections/certificate"},{"name":"Historial"}],"certificate-collection-create":[{"name":"Certificados"},{"name":"Colecciones","route":"/collections/certificate"},{"name":"Crear"}],"certificate-collection-edit":[{"name":"Certificados"},{"name":"Colecciones","route":"/collections/certificate"},{"name":"Editar"}],"analytics-list":[{"name":"Anal\xedtica"},{"name":"Listado"}],"analytics-statistics":[{"name":"Anal\xedtica"},{"name":"Estad\xedsticas"}],"certificate-issue":[{"name":"Certificados"},{"name":"Emitir"}],"groups-certificate-issued":[{"name":"Certificados"},{"name":"Grupos de Certificados emitidos"}],"groups-certificate-issued-certificates-issued":[{"name":"Certificados"},{"name":"Grupos de Certificados emitidos","route":"/certificates/issued"},{"name":"Certificados emitidos"}],"documents-published":[{"name":"Documentos"},{"name":"Plantillas"},{"name":"Publicados"}],"documents-archived":[{"name":"Documentos"},{"name":"Plantillas"},{"name":"Archivados"}],"documents-edition":[{"name":"Documentos"},{"name":"Plantillas"},{"name":"En Edici\xf3n"}],"documents-details-published":[{"name":"Documentos"},{"name":"Plantillas","route":"/templates/documents/published"},{"name":"Publicados","route":"/templates/documents/published"},{"name":"Detalle"}],"documents-details-edited":[{"name":"Documentos"},{"name":"Plantillas","route":"/templates/documents/published"},{"name":"En Edici\xf3n","route":"/templates/documents/edited"},{"name":"Detalle"}],"documents-details-archived":[{"name":"Documentos"},{"name":"Plantillas","route":"/templates/documents/published"},{"name":"Archivados","route":"/templates/documents/archived"},{"name":"Detalle"}],"documents-history-published":[{"name":"Documentos"},{"name":"Plantillas","route":"/templates/documents/published"},{"name":"Publicados","route":"/templates/documents/published"},{"name":"Historial"}],"documents-history-edited":[{"name":"Documentos"},{"name":"Plantillas","route":"/templates/documents/published"},{"name":"En Edici\xf3n","route":"/templates/documents/edited"},{"name":"Historial"}],"documents-history-archived":[{"name":"Documentos"},{"name":"Plantillas","route":"/templates/documents/published"},{"name":"Archivados","route":"/templates/documents/archived"},{"name":"Historial"}],"documents-template-create":[{"name":"Documentos"},{"name":"Plantillas","route":"/templates/documents/published"},{"name":"Crear"}],"documents-template-edit":[{"name":"Documentos"},{"name":"Plantillas","route":"/templates/documents/published"},{"name":"Editar"}],"documents-certify":[{"name":"Documentos"},{"name":"Certificar"}],"documents-sign":[{"name":"Firma Digital"},{"name":"Firmar"}],"documents-files-folders":[{"name":"Documentos"},{"name":"Carpetas"}],"documents-files-folders-files":[{"name":"Documentos"},{"name":"Archivos","route":"/documents/files"}],"documents-files-folders-files-sign":[{"name":"Firma Digital"},{"name":"Archivos","route":"/documents/sign/files"}],"carnets-published":[{"name":"Carnets"},{"name":"Plantillas"},{"name":"Publicados"}],"carnets-edition":[{"name":"Carnets"},{"name":"Plantillas"},{"name":"En Edici\xf3n"}],"carnets-archived":[{"name":"Carnets"},{"name":"Plantillas"},{"name":"Archivados"}],"carnet-details-published":[{"name":"Carnets"},{"name":"Plantillas","route":"/carnets/published"},{"name":"Publicados","route":"/carnets/published"},{"name":"Detalle"}],"carnet-details-edited":[{"name":"Carnets"},{"name":"Plantillas","route":"/carnets/published"},{"name":"En Edici\xf3n","route":"/carnets/edited"},{"name":"Detalle"}],"carnet-details-archived":[{"name":"Carnets"},{"name":"Plantillas","route":"/carnets/published"},{"name":"Archivados","route":"/carnets/archived"},{"name":"Detalle"}],"carnet-history-published":[{"name":"Carnets"},{"name":"Plantillas","route":"/carnets/published"},{"name":"Publicados","route":"/carnets/published"},{"name":"Historial"}],"carnet-history-edited":[{"name":"Carnets"},{"name":"Plantillas","route":"/carnets/published"},{"name":"En Edici\xf3n","route":"/carnets/edited"},{"name":"Historial"}],"carnet-history-archived":[{"name":"Carnets"},{"name":"Plantillas","route":"/carnets/published"},{"name":"Archivados","route":"/carnets/archived"},{"name":"Historial"}],"carnet-template-create":[{"name":"Carnets"},{"name":"Plantillas","route":"/carnets/published"},{"name":"Crear"}],"carnet-template-edit":[{"name":"Carnets"},{"name":"Plantillas","route":"/carnets/published"},{"name":"Editar"}],"groups-carnet-issued-carnets-issued":[{"name":"Carnets"},{"name":"Grupos de Carnets emitidos","route":"/carnets/issued"},{"name":"Carnets emitidos"}],"groups-carnet-issued":[{"name":"Carnets"},{"name":"Grupos de Carnets emitidos"}],"carnet-issue":[{"name":"Carnets"},{"name":"Emitir"}],"reports-carnet":[{"name":"Carnets"},{"name":"Reportes"}],"payments":[{"name":"Ajustes"},{"name":"Pagos"}],"diplomas-published":[{"name":"Diplomas"},{"name":"Plantillas"},{"name":"Publicados"}],"diplomas-edition":[{"name":"Diplomas"},{"name":"Plantillas"},{"name":"En Edici\xf3n"}],"diplomas-archived":[{"name":"Diplomas"},{"name":"Plantillas"},{"name":"Archivados"}],"reports-certificate":[{"name":"Certificados"},{"name":"Reportes"}],"reports-badge":[{"name":"Insignias"},{"name":"Reportes"}],"groups-diplomas-issued":[{"name":"Diplomas"},{"name":"Grupos de diplomas emitidos"}],"diploma-issue":[{"name":"Diplomas"},{"name":"Emitir"}],"diploma-template-create":[{"name":"Diplomas"},{"name":"Plantillas","route":"/diplomas/templates/create"},{"name":"Crear"}],"diploma-template-edit":[{"name":"Diplomas"},{"name":"Plantillas","route":"/diplomas/templates/published"},{"name":"Editar"}],"diploma-details-published":[{"name":"Diplomas"},{"name":"Plantillas","route":"/diplomas/templates/published"},{"name":"Publicados","route":"/diplomas/templates/published"},{"name":"Detalle"}],"diploma-details-edited":[{"name":"Diplomas"},{"name":"Plantillas","route":"/diplomas/templates/published"},{"name":"En Edici\xf3n","route":"/diplomas/templates/edited"},{"name":"Detalle"}],"diploma-details-archived":[{"name":"Diplomas"},{"name":"Plantillas","route":"/diplomas/templates/published"},{"name":"Archivados","route":"/diplomas/templates/archived"},{"name":"Detalle"}],"diploma-history-published":[{"name":"Diplomas"},{"name":"Plantillas","route":"/diplomas/templates/published"},{"name":"Publicados","route":"/diplomas/templates/published"},{"name":"Historial"}],"diploma-history-edited":[{"name":"Diplomas"},{"name":"Plantillas","route":"/diplomas/templates/published"},{"name":"En Edici\xf3n","route":"/diplomas/templates/edited"},{"name":"Historial"}],"diploma-history-archived":[{"name":"Diplomas"},{"name":"Plantillas","route":"/diplomas/templates/published"},{"name":"Archivados","route":"/diplomas/templates/archived"},{"name":"Historial"}],"settings-users":[{"name":"Ajustes"},{"name":"Usuarios"}],"settings-users-create":[{"name":"Ajustes"},{"name":"Usuarios","route":"/users"},{"name":"Crear"}],"settings-users-edit":[{"name":"Ajustes"},{"name":"Usuarios","route":"/users"},{"name":"Editar"}],"settings-organizations":[{"name":"Ajustes"},{"name":"Organizaciones"}],"settings-organizations-edit":[{"name":"Ajustes"},{"name":"Organizaciones","route":"/organizations"},{"name":"Editar"}],"settings-organizations-create":[{"name":"Ajustes"},{"name":"Organizaciones","route":"/organizations"},{"name":"Crear"}],"ids-templates-badges":[{"name":"Insignias"},{"name":"Ids plantillas insignias"}],"ids-templates-certificates":[{"name":"Certificados"},{"name":"Ids plantillas certificados"}],"ids-templates-documents":[{"name":"Documentos"},{"name":"Ids plantillas documentos"}],"parameter-values":[{"name":"Ajustes"},{"name":"Valores Par\xe1metros"}],"parameter-values-create":[{"name":"Ajustes"},{"name":"Valores Par\xe1metros","route":"/valueParameters"},{"name":"Editar"}],"parameter-values-edit":[{"name":"Ajustes"},{"name":"Valores Par\xe1metros","route":"/valueParameters"},{"name":"Crear"}],"contracts":[{"name":"Ajustes"},{"name":"Contratos"}],"contracts-organization":[{"name":"Ajustes"},{"name":"Contratos","route":"/contracts"}],"contracts-organization-create":[{"name":"Ajustes"},{"name":"Contratos","route":"/contracts"},{"name":"Crear"}],"contracts-organization-edit":[{"name":"Ajustes"},{"name":"Contratos","route":"/contracts"},{"name":"Editar"}],"modules":[{"name":"Ajustes"},{"name":"M\xf3dulos"}],"modules-create":[{"name":"Ajustes"},{"name":"M\xf3dulos","route":"/modules"},{"name":"Crear"}],"modules-edit":[{"name":"Ajustes"},{"name":"M\xf3dulos","route":"/modules"},{"name":"Editar"}],"userGroup":[{"name":"Ajustes"},{"name":"Grupos de usuarios"}],"userGroup-edit":[{"name":"Ajustes"},{"name":"Grupos de usuarios","route":"/userGroups"},{"name":"Editar"}],"userGroup-create":[{"name":"Ajustes"},{"name":"Grupos de usuarios","route":"/userGroups"},{"name":"Crear"}],"permissions":[{"name":"Ajustes"},{"name":"Permisos"}],"permissions-manage":[{"name":"Ajustes"},{"name":"Permisos","route":"/permissions"},{"name":"Gestionar"}],"user-groups-organizations":[{"name":"Ajustes"},{"name":"Grupos usuarios organizaciones"}],"user-groups-organizations-create":[{"name":"Ajustes"},{"name":"Grupos usuarios organizaciones","route":"/userGroupsOrganization"},{"name":"Crear"}],"user-groups-organizations-edit":[{"name":"Ajustes"},{"name":"Grupos usuarios organizaciones","route":"/userGroupsOrganization"},{"name":"Editar"}],"socialMedia":[{"name":"Ajustes"},{"name":"Redes Sociales"}],"socialMedia-create":[{"name":"Ajustes"},{"name":"Redes Sociales","route":"/socialNetworks"},{"name":"Crear"}],"socialMedia-edit":[{"name":"Ajustes"},{"name":"Redes Sociales","route":"/socialNetworks"},{"name":"Editar"}]}}')},595:function(e){e.exports=JSON.parse('{"badge-certificate-collection-form":{"collection-img":"Las Colecciones deben usar im\xe1genes cuadradas en formato PNG, con dimensiones de al menos 600x600 p\xedxeles.","details-collection":"Detalles de la colecci\xf3n.","templates":"Plantillas","name-collection":"Nombre de la colecci\xf3n","organization":"Organizaci\xf3n"}}')},596:function(e){e.exports=JSON.parse('{"badge-certificate-collection-form":{"collection-img":"Collections must use square images in PNG format, with dimensions of at least 600x600 pixels.","details-collection":"Collection details.","templates":"Templates","name-collection":"Collection name","organization":"Organization"}}')},597:function(e){e.exports=JSON.parse('{"badge-certificate-recommendation-form":{"organization":"Organizaci\xf3n","template-recommendation":"Recomendaci\xf3n de plantillas.","select-template-recommendate":"Seleccione Plantillas a Recomendar","order":"Orden"}}')},598:function(e){e.exports=JSON.parse('{"badge-certificate-recommendation-form":{"organization":"Organization","template-recommendation":"Template recommendation.","select-template-recommendate":"Select Templates to Recommend","order":"Order"}}')},599:function(e){e.exports=JSON.parse('{"badges":"Insignias","templates":"Plantillas","collections":"Colecciones","recommendations":"Recomendaciones","issue":"Emitir","badge-issued":"Insignias emitidas","certificate-issued":"Certificados emitidos","document-issued":"Documentos emitidos","carnet-issued":"Carnets emitidos","reports":"Reportes","certificates":"Certificados","archives":"Archivos","certify":"Certificar","documents":"Documentos","analytics":"Anal\xedtica","developers":"Desarrolladores","id-templates-badges":"IDs plantillas insignias","id-templates-documents":"IDs plantillas documentos","id-templates-certificates":"IDs plantillas certificados","settings":"Ajustes","parameter-values":"Valores par\xe1metros","modules":"M\xf3dulos","user-groups":"Grupos de usuarios","actions":"Acciones","permits":"Permisos","users":"Usuarios","organizations":"Organizaciones","user-groups-organizations":"Grupos usuarios organizaciones","social-media":"Redes sociales","contracts":"Contratos","skills":"Habilidades","reminders":"Recordatorios","carnets":"Carnets","payments":"Pagos","sign":"Firmar","diplomas":"Diplomas","diplomas-issued":"Diplomas emitidos","digital_signature":"Firma Digital"}')},600:function(e){e.exports=JSON.parse('{"badges":"Badges","templates":"Templates","collections":"Collections","recommendations":"Recommendations","issue":"Issue","badge-issued":"Issued badges","certificate-issued":"Issued certificates","document-issued":"Issued documents","carnet-issued":"Issued ID Cards","reports":"Reports","certificates":"Certificates","documents":"Documents","archives":"Files","certify":"Certify","analytics":"Analytics","developers":"Developers","id-templates-badges":"IDs templates badges","id-templates-documents":"IDs templates documents","id-templates-certificates":"IDs templates certificates","settings":"Settings","parameter-values":"Parameter values","modules":"Modules","user-groups":"User groups","actions":"Actions","permits":"Permits","users":"Users","organizations":"Organizations","user-groups-organizations":"User groups organizations","social-media":"Social media","contracts":"Contracts","skills":"Skills","reminders":"Reminders","carnets":"ID Cards","payments":"Payments","sign":"Sign","diplomas":"Diplomas","diplomas-issued":"Diplomas issued","digital_signature":"Digital Signature"}')},601:function(e){e.exports=JSON.parse('{"issue":{"complete-badge":"Complete la siguiente informaci\xf3n para emitir insignias.","text-issued-1":"Sube un archivo de texto delimitado por comas (.csv) de hasta","rows":"500 filas","rows-certificate":"1.000 filas","text-issued-2":"para importar una lista de ganadores de insignias por Certika. Aseg\xfarese de que su archivo CSV tenga el formato requerido y de que todos los campos obligatorios est\xe9n completos.","text-issued-2-min":"para importar una lista de ganadores de insignias por MinCiencias. Aseg\xfarese de que su archivo CSV tenga el formato requerido y de que todos los campos obligatorios est\xe9n completos.","access":"Acceda a los Ids de las plantillas de su organizaci\xf3n para configurar su archivo CSV.","view-id":"Ver ID de plantilla.","uses-csv":"Utilice nuestra plantilla CSV para asegurarse de que sus registros tengan el formato correcto.","dowload-template":"Descarga plantilla","complete-certificate":"Complete la siguiente informaci\xf3n para emitir certificados.","text-issued-certificate-2":"para importar una lista de ganadores de certificados por Certika. Aseg\xfarese de que su archivo CSV tenga el formato requerido y de que todos los campos obligatorios est\xe9n completos.","text-issued-certificate-2-min":"para importar una lista de ganadores de certificados por MinCiencias. Aseg\xfarese de que su archivo CSV tenga el formato requerido y de que todos los campos obligatorios est\xe9n completos.","complete-carnet":"Complete la siguiente informaci\xf3n para emitir carnets.","rows-carnet":"1.000 filas","example":"Ejemplo","text-issued-carnet-1":"Sube las fotos que van a ser usadas para los carnets.","text-issued-carnet-2":"Arrastra las fotos o haz click para seleccionarlas.","text-issued-carnet-3":"para importar una lista de ganadores de carnets por Certika. Aseg\xfarese de que su archivo CSV tenga el formato requerido y de que todos los campos obligatorios est\xe9n completos.","text-issued-carnet-3-min":"para importar una lista de ganadores de carnets por MinCiencias. Aseg\xfarese de que su archivo CSV tenga el formato requerido y de que todos los campos obligatorios est\xe9n completos.","text-issued-carnet-recommendation-1":"Los nombres de las im\xe1genes deben tener el n\xfamero de identificaci\xf3n de la persona.","text-issued-carnet-recommendation-2":"El formato de imagen debe ser igual para todos (png, jpg, jpeg).","complete-diploma":"Complete la siguiente informaci\xf3n para emitir diplomas.","text-issued-diploma-2":"para importar una lista de ganadores de diplomas por Certika. Aseg\xfarese de que su archivo CSV tenga el formato requerido y de que todos los campos obligatorios est\xe9n completos."}}')},602:function(e){e.exports=JSON.parse('{"issue":{"complete-badge":"Complete the following information to issue badges.","text-issued-1":"Upload a comma-delimited text file (.csv) up to","rows":"500 rows","rows-certificate":"1.000 rows","text-issued-2":"to import a list of badge winners by Certika. Make sure your CSV file is in the required format and that all required fields are complete.","text-issued-2-min":"to import a list of badge winners by Minsciences. Make sure your CSV file is in the required format and that all required fields are complete.","access":"Access your organization\'s template IDs to configure your CSV file.","view-id":"View Template ID.","uses-csv":"Use our CSV template to make sure your records are in the correct format.","dowload-template":"Download template","complete-certificate":"Complete the following information to issue certificates.","text-issued-certificate-2":"to import a list of certificate winners by Certika. Make sure your CSV file is in the required format and that all required fields are complete.","text-issued-certificate-2-min":"to import a list of certificate winners by Minsciences. Make sure your CSV file is in the required format and that all required fields are complete.","complete-carnet":"Complete the following information to issue carnets.","rows-carnet":"1.000 rows","example":"Example","text-issued-carnet-1":"Upload the photos to be used for the carnets.","text-issued-carnet-2":"Drag the photos or click to select them.","text-issued-carnet-3":"to import a list of carnet winners by Certika. Make sure your CSV file is in the required format and that all required fields are complete.","text-issued-carnet-3-min":"to import a list of carnet winners by Minsciences. Make sure your CSV file is in the required format and that all required fields are complete.","text-issued-carnet-recommendation-1":"The names of the images should have the identification number of the person.","text-issued-carnet-recommendation-2":"The image format should be the same for all (png, jpg, jpeg).","complete-diploma":"Complete the following information to issue diplomas.","text-issued-diploma-2":"to import a list of diplomas winners by Certika. Make sure your CSV file is in the required format and that all required fields are complete."}}')},603:function(e){e.exports=JSON.parse('{"search":{"search":"Buscar"}}')},604:function(e){e.exports=JSON.parse('{"search":{"search":"Search"}}')},605:function(e){e.exports=JSON.parse('{"total-issue":"Emisiones totales","of":"de","expiration":"Vencimiento de contrato:","without-expiration":"Sin vencimiento","without-contract":"Sin contrato","total-users":"Usuarios totales","select-issue":"Seleccione su cantidad de emisiones","total-pay":"Total a pagar","pay":"Pagar","lite":"Plan Lite","plus":"Plan Plus","premium":"Plan Premium","on-demand":"Plan On Demand","unit":"Unitario","organitation":"Organizaci\xf3n:","user":"Usuario","year":"a\xf1o"}')},606:function(e){e.exports=JSON.parse('{"total-issue":"Total issues","of":"of","expiration":"Contract expiration","without-expiration":"Without expiration","without-contract":"Without contract","total-users":"Total users","select-issue":"Select your amount of emissions","total-pay":"Total to pay","pay":"To pay","lite":"Lite plan","plus":"Plus plan","premium":"Premium plan","on-demand":"On Demand plan","unit":"Unit","organitation":"Organitation:","user":"User","year":"year"}')},607:function(e){e.exports=JSON.parse('{"times-share":"Total veces compartidas:","analytics-index":{"title":"Filtros","type":"Tipo de emisi\xf3n","type-analytics":"Tipo de anal\xedtica","list":"Listado","statistics":"Estad\xedstica","radio-buttons-badges":"Insignias","radio-buttons-certificates":"Certificados","radio-buttons-carnets":"Carnets","select-groups-issued":"Grupos de emisiones","select-organizations":"Organizaci\xf3n","select-templates":"Plantillas","date-start":"Fecha inicio de emisi\xf3n","date-end":"Fecha final de emisi\xf3n","states-title":"Estados","state-checkbox":[{"id":0,"estado":"Revocada","orden":4},{"id":1,"estado":"Pendiente","orden":2},{"id":2,"estado":"Aceptada","orden":1},{"id":3,"estado":"Rechazada","orden":3},{"id":4,"estado":"Correo rebotado","orden":5}],"count-checkbox":[{"id":0,"estado":"Documentos","orden":4},{"id":1,"estado":"Certificados","orden":2},{"id":2,"estado":"Insignias","orden":1},{"id":3,"estado":"Carnets","orden":3},{"id":4,"estado":"Usuarios","orden":5}],"account-title":"Creaci\xf3n de cuenta:","account-checkbox-yes":"Si","account-checkbox-no":"No","tabs-list":"Listado","tabs-statistics":"Estad\xedsticas"},"analytics-statistics":{"percent-issued":"Porcentaje de emisiones","pending":"Pendientes","badges-issued":"Insignias emitidas","badge-issued":"Insignia emitida","badges-accepted":"Aceptadas","badges-rejected":"Rechazadas","badges-revoked":"Revocadas","badge-certificate-accepted-porcen":"Aceptaci\xf3n","badge-certificate-jected-porcen":"Negaci\xf3n","badge-revoked-porcen":"Revocadas","certificates-issued":"Certificados emitidos","certificate-issued":"Certificado emitido","carnets-issued":"Carnets emitidos","carnet-issued":"Carnet emitido","certificates-accepted":"Aceptados","certificates-rejected":"Rechazados","certificates-revoked":"Revocados","account":"Cuentas creadas","account-porcen":"Ceaci\xf3n de cuentas","name-document-export-png":"Estad\xedsticas.png","title-document-export":"Estad\xedsticas","bounced-mail-text-export":"Correos rebotados","issues-available":" Disponibles"}}')},608:function(e){e.exports=JSON.parse('{"times-share":"Total times shared:","analytics-index":{"title":"Filters","type":"Type of emission","type-analytics":"Type of analytics","list":"Listing","statistics":"Statistics","radio-buttons-badges":"Badges","radio-buttons-certificates":"Certificates","radio-buttons-carnets":"ID Cards","select-groups-issued":"Emission groups","select-organizations":"Organization","select-templates":"Templates","date-start":"Start date of issue","date-end":"Final date of issue","states-title":"State","state-checkbox":[{"id":0,"estado":"Revoked","orden":4},{"id":1,"estado":"Pending","orden":2},{"id":2,"estado":"Accepted","orden":1},{"id":3,"estado":"Rejected","orden":3},{"id":4,"estado":"Bounced mail","orden":5}],"count-checkbox":[{"id":0,"estado":"Documents","orden":4},{"id":1,"estado":"Certificates","orden":2},{"id":2,"estado":"Badges","orden":1},{"id":3,"estado":"ID Cards","orden":3},{"id":4,"estado":"Users","orden":5}],"account-title":"Account creation:","account-checkbox-yes":"Yes","account-checkbox-no":"No","tabs-list":"List","tabs-statistics":"Statistics"},"analytics-statistics":{"percent-issued":"Issued percent","pending":"Pending","badges-issued":"Badges issued","badge-issued":"Badge issued","badges-accepted":"Accepted","badges-rejected":"Rejected","badges-revoked":"Revoked","badge-certificate-accepted-porcen":"Acceptance","badge-certificate-jected-porcen":"Denial","badge-revoked-porcen":"Revoked","certificates-issued":"Certificates issued","certificate-issued":"Certificate issued","carnets-issued":"ID Cards issued","carnet-issued":"ID Card issued","certificates-accepted":"Accepted","certificates-rejected":"Rejected","certificates-revoked":"Revoked","account":"Accounts created","account-porcen":"Account creation","name-document-export-png":"Statistics.png","title-document-export":"Statistics","bounced-mail-text-export":"Bounced mail","issues-available":" Availables"}}')},609:function(e){e.exports=JSON.parse('{"welcome":"Bienvenido de nuevo,","have-badges-certificates":"\xa1A\xfan no tienes ","certificates":"certificados","badges":"insignias","carnets":"carnets","signedDocuments":"Documentos firmados","can-know":"Puedes conocer","badges-2":"las insignias","certificates-2":"los certificados","carnets-2":"los carnets ","organization-offered":" que ofrece la organizaci\xf3n a la que perteneces","this-user":"\xa1Este usuario a\xfan no tiene","wait":"Mientras esperas, por qu\xe9 no comienzas","edit-profile":"editando tu perfil","this-organization":"\xa1Esta organizaci\xf3n a\xfan no tiene ","order-by":"Ordenar por","most-recent":"M\xe1s recientes","most-popular":"M\xe1s popular","badge":"insignia","certificate":"certificado","carnet":"carnet"}')},610:function(e){e.exports=JSON.parse('{"welcome":"Welcome back,","have-badges-certificates":"You still don\'t have","certificates":"certificates","badges":"badges","carnets":"ID Cards","signedDocuments":"Signed documents","can-know":"You can know","badges-2":"the badges","certificates-2":"the certificates","carnets-2":"the ID Cards ","organization-offered":"offered by the organization to which you belong","this-user":"This user does not yet haves","wait":"While you wait, why don\'t you start","edit-profile":"editing your profile ","this-organization":"This organization does not yet haves","order-by":"Order by","most-recent":"Most recent","most-popular":"Most popular","badge":"badge","certificate":"certificate","carnet":"ID Card"}')},611:function(e){e.exports=JSON.parse('{"error404":{"textMesage":"Puede que te hayas perdido"}}')},612:function(e){e.exports=JSON.parse('{"error404":{"textMesage":"You may have missed"}}')},613:function(e){e.exports=JSON.parse('{"form-certify":{"name-document":"Nombre del documento","template-document":"Si tienes una plantilla, selecci\xf3nala.","new-template-document":"Nueva plantilla","message-new-template":"Se crear\xe1 una nueva plantilla con el dise\xf1o que generes a continuaci\xf3n, si deseas guardarla, activa el check: (Guardar plantilla)","archive-document":"Selecciona una carpeta donde guardar tu documento.","new-archive-document":"Nueva Carpeta","assign-name-template":"Nombre para la nueva plantilla.","assign-name-private-template":"Nombre privado para la nueva plantilla.","assign-name-archive":"Nombre para la nueva carpeta.","switch-save-template":"Guardar plantilla","loading":"Cargando...","uploaded-successfully":"Documento cargado exitosamente.","name-template":"Plantilla","name-folder":"Carpeta","method-to-sign":"Seleccione el m\xe9todo que utilizar\xe1n los participantes para firmar","sign-via-email":"\u200bFirmar v\xeda correo electr\xf3nico","sign-via-whatsapp":"Firmar v\xeda WhatsApp","select-option":"Seleccione una opci\xf3n","num-phone":"N\xfamero de celular","whatsap-code":"Indicativo WhatsApp","phone-code":"Indicativo Celular","upload-document":"Sube el documento que deseas firmar."},"document":{"additional-documents":"Documentos adicionales","additional-links":"Links adicionales","draw-here":"Dibuja aqu\xed","write-here":"Escriba aqu\xed","stamp":"firmado en Certika","waiting-for-signatories":"En espera por firmantes"},"add-signatories":{"column":{"names":"Nombre","email":"Correo"},"title":"Agregar firmantes","signatory":"Firmante"}}')},614:function(e){e.exports=JSON.parse('{"form-certify":{"name-document":"Name documents","template-document":"If you have a template, select it.","new-template-document":"New template","message-new-template":"A new template will be created with the design you generate next, if you want to save it, activate the check (Save template)","archive-document":"Select a folder to save your document to.","new-archive-document":"New folder","assign-name-template":"Name for the new template.","assign-name-private-template":"Private name for the new template.","assign-name-archive":"Name for the new folder.","switch-save-template":"Save template","loading":"Loading...","uploaded-successfully":"Document uploaded successfully.","name-template":"Template","name-folder":"Folder","method-to-sign":"Select the method that participants will use to sign","sign-via-email":"Sign via email","sign-via-whatsapp":"Sign via WhatsApp","select-option":"Select an option","num-phone":"Cell phone number","whatsap-code":"WhatsApp Code","phone-code":"Cell phone code","upload-document":"Upload the document you want to sign."},"document":{"additional-documents":"Additional documents","additional-links":"Additional links","draw-here":"Draw here","write-here":"Write here","stamp":"signed in Certika","waiting-for-signatories":"Waiting for signatories"},"add-signatories":{"column":{"names":"Name","email":"Email"},"title":"Add Signers","signatory":"Signatory"}}')},615:function(e){e.exports=JSON.parse('{"verify-success":"\xa1Successful verification!","message-badge":{"badge-issued":"This digital badge was issued by","badge-information-revoked":"but it is revoked.","badge-information-expired":"but it is expired.","badge-revoked":"\xa1Revoked badge!","badge-expired":"\xa1Expired badge!","badge-name":"The badge name is found in our database.","badge-headline":"The holder of this badge has been verified."},"message-certificate":{"certificate-issued":"This digital certificate was issued by","certificate-information-revoked":"but it is revoked.","certificate-information-expired":"but it is expired.","certificate-revoked":"\xa1Revoked certificate!","certificate-expired":"\xa1Expired Certificate!","certificate-name":"The certificate name is found in our database","certificate-headline":"The holder of this certificate has been verified."},"message-carnet":{"carnet-issued":"This digital id card was certified by","carnet-information-revoked":"but it is revoked.","carnet-information-expired":"but it is expired.","carnet-revoked":"\xa1Revoked id card!","carnet-expired":"\xa1Expired id card!","carnet-name":"The id card name is found in our database.","carnet-headline":"The holder of this id card has been verified."},"message-document":{"document-issued":"This digital document was certified by","document-information-revoked":"but it is revoked.","document-information-expired":"but it is expired.","document-revoked":"\xa1Revoked document!","document-expired":"\xa1Expired document!","document-name":"The document name is found in our database.","document-headline":"The holder of this document has been verified.","document-signature":"The signature of this document is in our database."},"information-expired":"but it is expired.","information":"and your information is totally valid.","credentials":"Show credentials","issued-verified":"This issuer is verified by","more-information":"More information","expired":"Expires on","issued":"Issued on","certificate":"Certified on","blockchain":{"information-blockchain":"Information recorded on the blockchain.","state-register":"Registration Status","state-wait":"On hold","hash":"Metadata hash","type-register":"Type of register","date-signature":"Type of register","link":"Blockchain link","files":"Blockchain files.","download":"Download","verify":"Verify","certificate":"Certificate","block":"Block"},"additional-documents":"Additional documents.","verify-file":{"message":"Quickly verify any badge, certificate, diploma, id card or document.","footer":"Our services are supported by the use of blockchain technology, which is currently the most secure encryption technology in the world. By verifying you are accepting our","terms":"Terms and Conditions.","learn-about":"Learn more about","code":"Code","placeholder":"Enter your credential code...","dropzoneText":"Drop file here or click to upload","message-error":"An error has occurred.","credential-no-valid":"The credential is not valid.","credential-no-accepted":"The credential has not yet been accepted by the user.","credential-rejected":"The credential was rejected by the user."}}')},616:function(e){e.exports=JSON.parse('{"verify-success":"\xa1Verificaci\xf3n exitosa!","message-badge":{"badge-issued":"Esta insignia digital fue emitida a trav\xe9s de","badge-information-revoked":"pero se encuentra revocada.","badge-information-expired":"pero se encuentra vencida.","badge-revoked":"\xa1Insignia revocada!","badge-expired":"\xa1Insignia expirada!","badge-name":"El nombre de la insignia se encuentra en nuestra base de datos.","badge-headline":"El titular de \xe9sta insignia ha sido verificado."},"message-certificate":{"certificate-issued":"Este certificado digital fue emitido a trav\xe9s de ","certificate-information-revoked":"pero se encuentra revocado.","certificate-information-expired":"pero se encuentra vencido.","certificate-revoked":"\xa1Certificado revocado!","certificate-expired":"\xa1Certificado expirado!","certificate-name":"El nombre del certificado se encuentra en nuestra base de datos.","certificate-headline":"El titular de este certificado ha sido verificado."},"message-carnet":{"carnet-issued":"Este carnet digital fue certificado a trav\xe9s de ","carnet-information-revoked":"pero se encuentra revocado.","carnet-information-expired":"pero se encuentra vencido.","carnet-revoked":"\xa1Carnet revocado!","carnet-expired":"\xa1Carnet expirado!","carnet-name":"El nombre del carnet se encuentra en nuestra base de datos.","carnet-headline":"El titular de este carnet ha sido verificado."},"message-document":{"document-issued":"Este documento digital fue certificado a trav\xe9s de ","document-information-revoked":"pero se encuentra revocado.","document-information-expired":"pero se encuentra vencido.","document-revoked":"Documento revocado!","document-expired":"Documento expirado!","document-name":"El nombre del documento se encuentra en nuestra base de datos.","document-headline":"El titular de este documento ha sido verificado.","document-signature":"La firma de este documento se encuentra en nuestra base de datos."},"information":"y su informaci\xf3n es totalmente v\xe1lida.","credentials":"Mostrar credenciales","issued-verified":"Este emisor est\xe1 verificado por","more-information":"M\xe1s informaci\xf3n","expired":"Vence el","issued":"Expedido el","certificate":"Certificado el","blockchain":{"information-blockchain":"Informaci\xf3n registrada en blockchain.","state-register":"Estado del registro","state-wait":"En espera","hash":"Hash del metadata","type-register":"Tipo de registro","date-signature":"Fecha de firma en blockchain","link":"Link de blockchain","files":"Archivos de blockchain.","download":"Descargar","verify":"Verificar","certificate":"Certificado","block":"Bloque"},"additional-documents":"Documentos adicionales.","verify-file":{"message":"Verifica r\xe1pidamente cualquier insignia, certificado, diploma, carnet o documento.","footer":"Nuestros servicios est\xe1n soportados bajo el uso de la tecnolog\xeda blockchain o cadena de bloques, que es actualmente la tecnolog\xeda de cifrado m\xe1s segura del mundo. Al verificar est\xe1s aceptando nuestros","terms":"T\xe9rminos y Condiciones.","learn-about":"Conoce m\xe1s sobre","code":"C\xf3digo","placeholder":"Escribe el c\xf3digo de tu credencial...","dropzoneText":"Suelte aqu\xed el archivo o haga clic para cargarlo","message-error":"Ha ocurrido un error.","credential-no-valid":"La credencial no es v\xe1lida.","credential-no-accepted":"La credencial a\xfan no ha sido aceptada por el usuario.","credential-rejected":"La credencial a\xfan no ha sido aceptada por el usuario."}}')},617:function(e){e.exports=JSON.parse('{"sign-in":"Sign in","email":"Email","password":"Password","forget-password":"\xbfDid you forget your password?","register-yet":"\xbfDon\'t have an account yet?","register":"Sign up","first-name":"First name","second-name":"Second name","last-name":"Last name","second-last-name":"Second last name","confirm-password":"Confirm Password","accept-terms":"Accept our Terms and Conditions of Use","accept-privacy":"Accept our Privacy Policy and personal data treatment","have-account":"If you already have an account","message-recovery1":"To recover your account, enter your email address and a message will be sent to you.","message-recovery2":"If you do not find the message, it may be in your spam folder.","message-verify":"Thanks for signing up.","have-organization":"Are you an organization?","register-organization":"Register it"}')},618:function(e){e.exports=JSON.parse('{"sign-in":"Inicia sesi\xf3n","email":"Correo electr\xf3nico","password":"Contrase\xf1a","forget-password":"\xbfHas olvidado tu contrase\xf1a?","register-yet":"\xbfA\xfan no tienes cuenta?","register":"Reg\xedstrate","first-name":"Primer nombre","second-name":"Segundo nombre","last-name":"Primer apellido","second-last-name":"Segundo apellido","confirm-password":"Confirmar Contrase\xf1a","accept-terms":"Acepte nuestros T\xe9rminos y condiciones de uso","accept-privacy":"Acepte nuestra Pol\xedtica de privacidad y tratamiento de datos personales","have-account":"Si ya tienes una cuenta","message-recovery1":"Para recuperar tu cuenta ingresa tu correo electr\xf3nico y posteriormente se le enviar\xe1 un mensaje.","message-recovery2":"Si no encuentra el mensaje, tal vez est\xe9 en la bandeja de correos no deseados.","message-verify":"Gracias por registrarte.","have-organization":"\xbfEres una organizaci\xf3n?","register-organization":"Reg\xedstrala"}')},619:function(e){e.exports=JSON.parse('{"approved":"\xa1Approved transaction!","pending":"\xa1Pending transaction!","declined":"\xa1Declined transaction!","expired":"\xa1Expired transaction!","error":"\xa1Failed transaction!","message-approved":"Your payment has been registered, you will receive a confirmation by email.","message-error":"Your payment could not be registered, please try again later.","view-pay":"See my payments","date-pay":"Purchase date","description":"Description","value-paid":"Paid value","payment-method":"Payment method","payment-date":"Payment date","transaction-id":"Transaction id","reference-code":"Reference code"}')},620:function(e){e.exports=JSON.parse('{"approved":"\xa1Transacci\xf3n Aprobada!","pending":"\xa1Transacci\xf3n Pendiente!","declined":"\xa1Transacci\xf3n Rechazada!","expired":"\xa1Transacci\xf3n Expirada!","error":"\xa1Error en Transacci\xf3n!","message-approved":"Se ha registrado tu pago, recibir\xe1 una confirmaci\xf3n por correo electr\xf3nico.","message-error":"No se ha podido registrar tu pago, intente m\xe1s tarde.","view-pay":"Ver mis pagos","date-pay":"Fecha de compra","description":"Descripci\xf3n","value-paid":"Valor total pagado","payment-method":"M\xe9todo de pago","payment-date":"Fecha de pago","transaction-id":"Id transacci\xf3n","reference-code":"C\xf3digo de referencia"}')},621:function(e){e.exports=JSON.parse('{"users":{"photo-profile":"Profile photo","message-photo":"For the logo, square images in PNG format with dimensions of at least 600x600 pixels should be used.","first-name":"First name","second-name":"Second name","last-name":"Last name","second-last-name":"Second last name","document":"Document","birthdate":"Birthdate","url-profile":"Profile URL","country":"Country","city":"City","email":"Email","phone":"Phone","cellphone":"Cellphone","web-site":"Website","biography":"Biography","password":"Password","confirm-password":"Confirm password","organization":"Organzation","user-group":"User group","issue-limit":"Issue limit","choose-csv":"Use our CSV template to ensure your records have the correct format."},"organization":{"name":"Organization Name","description":"Organization Description","logo":"Organization Logo","nit":"NIT","address":"Address","social-media":"Social Media (optional)","add-social-media":"Add New Social Media","number-wpp":"WhatsApp Number*","name-user":"Alias or Username @*","url-social":"Social Media URL*"}}')},622:function(e){e.exports=JSON.parse('{"users":{"photo-profile":"Foto de perfil","message-photo":"Para el logotipo se deben usar im\xe1genes cuadradas en formato PNG, con dimensiones de al menos 600x600 p\xedxeles.","first-name":"Primer nombre","second-name":"Segundo nombre","last-name":"Primer apellido","second-last-name":"Segundo apellido","document":"Documento","birthdate":"Fecha de nacimiento","url-profile":"Url perfil","country":"Pa\xeds","city":"Ciudad","email":"Correo electr\xf3nico","phone":"Tel\xe9fono","cellphone":"Celular","web-site":"Sitio web","biography":"Biograf\xeda","password":"Contrase\xf1a","confirm-password":"Confirmar contrase\xf1a","organization":"Organizacion","user-group":"Grupo usuario","issue-limit":"L\xedmite de emisiones","choose-csv":" Utilice nuestra plantilla CSV para asegurarse de que sus registros tengan el formato correcto."},"organization":{"name":"Nombre de la organizaci\xf3n","description":"Descripci\xf3n de la organizaci\xf3n","logo":"Logotipo de la organizaci\xf3n","nit":"nit","address":"Direcci\xf3n","social-media":"Redes sociales (opcional)","add-social-media":"A\xf1adir nueva red social","number-wpp":"N\xfamero de whatsapp*","name-user":"Alias o nombre de usuario @*","url-social":"URL red social*"}}')},623:function(e){e.exports=JSON.parse('{"title":"Parameter detail","parameter":"Parameter","parameter-value":"Parameter value","add":"Add parameter value","delete":"Delete parameter value"}')},624:function(e){e.exports=JSON.parse('{"title":"Detalle del par\xe1metro","parameter":"Par\xe1metro","parameter-value":"Valor par\xe1metro","add":"A\xf1adir valor par\xe1metro","delete":"Eliminar valor par\xe1metro"}')},625:function(e){e.exports=JSON.parse('{"contracts":"Contracts","organization":"Organizations","plan-type":"Plan Type","number-emissions":"Number of Emissions","start-date":"Start Date","expired-date":"Expiration Date","option":"Select an option","invalid-dates":"Invalid dates","invalid-number-emissions":"Invalid number of emissions","enter-number-emissions":"Enter the number of emissions","minimun-emissions":"For the OnDemand plan, a minimum of 10 emissions is required","contract-on-hold":"This organization has a contract on hold that expires on","date-new-contract":"set a date later than this for a new contract.","contract-active":"This organization has an active contract that expires on","expiration-date":"The expiration date cannot be earlier than the start date","actions":"Actions","module-error-delete":"You cannot delete this action, it is assigned to a permission.","modules":"Modules","module-name":"Module name","action":"Action","action-delete":"Delete action","action-add":"Add action","userGroup-define":"Define user group","advanced":"Advanced","name":"Name","organizations":"Organizations","selected-option":"Choose an option","permissions-definition":"Permission definition","userGroup":"User group","user":"User","socialMedia-details":"Social media details","icon-square":"The icons must use square images in PNG format.","socialMedia-name":"Social media name"}')},626:function(e){e.exports=JSON.parse('{"contracts":"Contratos","organization":"Organizaciones","plan-type":"Tipo de plan","number-emissions":"Cantidad de emisiones","start-date":"Fecha de inicio","expired-date":"Fecha de vencimiento","option":"Seleccione una opci\xf3n","invalid-dates":"Fechas inv\xe1lidas","invalid-number-emissions":"Cantidad de emisiones inv\xe1lidas","enter-number-emissions":"Ingrese la cantidad de emisiones","minimun-emissions":"Para el plan OnDemand m\xednimo 10 emisiones","contract-on-hold":"Esta organizaci\xf3n tiene un contrato en espera que vence el","date-new-contract":"establezca una fecha mayor a esta para un nuevo contrato.","contract-active":"Esta organizaci\xf3n tiene un contrato activo que vence el","expiration-date":"La fecha de vencimiento no puede ser menor a la fecha de inicio","actions":"Acciones","module-error-delete":"No se puede eliminar esta acci\xf3n, est\xe1 asignada a un permiso.","modules":"M\xf3dulos","module-name":"Nombre del m\xf3dulo","action":"Acci\xf3n","action-delete":"Eliminar acci\xf3n","action-add":"A\xf1adir acci\xf3n","userGroup-define":"Definici\xf3n de grupo de usuarios","advanced":"Avanzado","name":"Nombre","organizations":"Organizaciones","selected-option":"Seleccione una opci\xf3n","permissions-definition":"Definici\xf3n de permisos","userGroup":"Grupo de usuarios","user":"Usuario","socialMedia-details":"Detalles de la red social","icon-square":"Los Iconos deben usar im\xe1genes cuadradas en formato PNG.","socialMedia-name":"Nombre de la red social"}')},627:function(e){e.exports=JSON.parse('{"otp-dialog":{"title":"Necesitamos identificarte.","message-informated":"Enviaremos un c\xf3digo de verificaci\xf3n al n\xfamero de tel\xe9fono","message-informated2":"y al correo electr\xf3nico","info-number":"Este n\xfamero y correo electr\xf3nico han sido proporcionados por el emisor del documento.","input-code":"Ingresa el c\xf3digo.","is-not-my-number":"No reconozco el n\xfamero de tel\xe9fono o correo electr\xf3nico.","title_no_number":"Lo sentimos.","invalid_code":"el c\xf3digo es inv\xe1lido.","message_error_number":"Comunicaremos al emisor del documento para corregir el error.","no-received-sms":"No he recibido el c\xf3digo, enviar nuevamente"}}')},628:function(e){e.exports=JSON.parse('{"otp-dialog":{"title":"We need to identify you.","message-informated":"We will send a verification code to the phone number","message-informated2":"and the email","info-number":"This number and email have been provided by the issuer of the document.","input-code":"Enter the code.","is-not-my-number":"I don\'t recognize the phone number or email.","title_no_number":"We\'re sorry.","invalid_code":"The code is invalid.","message_error_number":"We will contact the issuer of the document to correct the error.","no-received-sms":"I have not received the code, send again"}}')},700:function(e,t,a){},701:function(e,t,a){},722:function(e,t){},740:function(e,t){},742:function(e,t){},752:function(e,t){},754:function(e,t){},780:function(e,t){},782:function(e,t){},783:function(e,t){},788:function(e,t){},790:function(e,t){},809:function(e,t){},821:function(e,t){},824:function(e,t){},856:function(e,t){},857:function(e,t){},858:function(e,t){},859:function(e,t){},860:function(e,t){},9:function(e,t,a){"use strict";var n=a(32),i=a.n(n).a.create({withCredentials:!0,baseURL:"https://gtw.certika.co",timeout:2e5});t.a=i}},[[1013,1,2]]]);
//# sourceMappingURL=main.dd7759e2.chunk.js.map