1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[426],{53342:function(e,t,a){"use strict";var n=a(21608),r=a(67814),s=a(62987),o=a.n(s),i=a(91889),c=a(85893),l=function(e){return e===i.fs?o().button:o().buttonSecondary};t.Z=function(e){var t=e.text,a=e.onclick,s=e.icon,u=e.width,d=e.background,f=void 0===d?i.fs:d;return(0,c.jsx)("div",{className:l(f),onClick:a,style:{width:u||120,background:f},children:(0,c.jsxs)(n.Z,{className:o().rowbutton,children:[(0,c.jsx)("div",{className:o().icondiv,children:(0,c.jsx)(r.G,{icon:s})}),(0,c.jsx)("div",{className:o().textdiv,children:t})]})})}},67066:function(e,t,a){"use strict";a.d(t,{d:function(){return o}});a(67294);var n=a(41724),r=a.n(n),s=a(85893),o=function(e){var t=e.label,a=e.type,n=void 0===a?"text":a,o=e.value,i=e.onChange;e.placeholder;return(0,s.jsxs)(s.Fragment,{children:[t?(0,s.jsx)("span",{children:t}):null,(0,s.jsx)("input",{className:r().inputtextlabel,type:n,value:o,onChange:i})]})}},59575:function(e,t,a){"use strict";var n=a(77191),r=(a(67294),a(47045)),s=a.n(r),o=a(85893);t.Z=function(e){return(0,n.Z)(e),(0,o.jsx)("div",{className:s().container,children:(0,o.jsxs)("div",{className:s()["lds-ring"],children:[(0,o.jsx)("div",{}),(0,o.jsx)("div",{}),(0,o.jsx)("div",{}),(0,o.jsx)("div",{})]})})}},56670:function(e,t,a){"use strict";a.d(t,{$d:function(){return o},FI:function(){return l},GA:function(){return n},b1:function(){return d},c2:function(){return u},fk:function(){return i},ho:function(){return r},iA:function(){return c},wd:function(){return s}});var n=function(e){return e.split("-").reverse().join("/")},r=function(e){var t=e.toTimeString();return t.split(":")[0]+":"+t.split(":")[1]},s=function(e){var t=new Date(e),a=t.getDate()+"/";t.getDate()<10&&(a="0"+a);var n=t.getMonth()+1;return n<10&&(a+="0"),a+=n.toString(),"".concat(a,"/").concat(t.getFullYear())},o=function(e){var t=new Date(e),a=t.getDate()+"/";t.getDate()<10&&(a="0"+a);var n=t.getMonth()+1;return n<10&&(a+="0"),a+=n.toString(),"".concat(a,"/").concat(t.getFullYear()," ").concat(t.getHours(),":").concat(t.getMinutes())},i=function(e){return e.setHours(0,0,0,0),e.setDate(e.getDate()+1),e.getDay()},c=function(e){return f[e]},l=function(e){return e.toISOString().split("T")[0]},u=function(e){var t=new Date(e);return"\n ".concat(t.getDate().toString().padStart(2,"0"),"/").concat((t.getMonth()+1).toString().padStart(2,"0"),"/").concat(t.getFullYear().toString().padStart(4,"0")," \n ").concat(t.getHours().toString().padStart(2,"0"),":").concat(t.getMinutes().toString().padStart(2,"0"),":").concat(t.getSeconds().toString().padStart(2,"0"))},d=function(e,t){return new Date(t,e+1,0).getDate()},f=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"]},35990:function(e,t,a){"use strict";a.r(t);var n=a(59499),r=a(50029),s=a(16835),o=a(87794),i=a.n(o),c=a(76307),l=a.n(c),u=a(38672),d=a(67294),f=a(53342),g=a(51436),p=a(11163),_=a(81118),m=a(67066),v=a(59575),h=a(87032),b=a(56670),x=a(67421),j=a(67555),y=a.n(j),P=(a(72498),a(85893));function I(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function S(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?I(Object(a),!0).forEach((function(t){(0,n.Z)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):I(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var D=function(){var e=(0,x.$G)().t,t=(0,_.FL)({fetchPolicy:"network-only"}),a=(0,s.Z)(t,2),o=a[0],c=a[1].data,j=(0,_.Gk)(),I=(0,s.Z)(j,2),D=I[0],T=I[1].data,N=(0,d.useState)({nombre:"",apellidos:"",email:"",telefono:"",disabled:!1,clientID:-1}),w=N[0],k=N[1],O=(0,_.kD)(),U=(0,s.Z)(O,2),F=U[0],Z=U[1].data,E=(0,_.Yb)(),C=(0,s.Z)(E,2),A=C[0],H=C[1].data,M=(0,d.useState)(null),G=M[0],R=M[1],Y=(0,p.useRouter)(),X=Y.query.usuarioID;(0,d.useEffect)((function(){D(),o({variables:{usuarioId:parseInt(X)}})}),[]),(0,d.useEffect)((function(){null!==c&&void 0!==c&&c.getUser&&k({nombre:c.getUser.name,apellidos:c.getUser.surname,email:c.getUser.email,telefono:c.getUser.telephone,disabled:c.getUser.disabled,clientID:c.getUser.clientID})}),[c]);var L=function(){var t=(0,r.Z)(i().mark((function t(){var a;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(""===w.nombre||""===w.apellidos||""===w.email||""===w.telefono||-1===w.clientID?(R({type:"error",message:e("fill_all_fields")}),0):!(w.telefono.length<10||!w.telefono.includes("+")||w.telefono.includes(" "))||(R({type:"error",message:e("El tel\xe9fono debe tener al menos 9 d\xedgitos y el prefijo (SIN ESPACIOS). Ejemplo: +34123456789")}),0))&&F({variables:{userId:parseInt(X),name:w.nombre,surname:w.apellidos,email:w.email,telephone:w.telefono,clientId:w.clientID,roleId:(null===c||void 0===c||null===(a=c.getUser)||void 0===a?void 0:a.role.roleID)||3}});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),q=function(){A({variables:{usuarioId:parseInt(X),disabled:!w.disabled}})};(0,d.useEffect)((function(){null!=H&&(R(H?{type:"success",message:e("updated_user_successfully")}:{type:"error",message:e("error_updating_user")}),o({variables:{usuarioId:parseInt(X)}}))}),[H]),(0,d.useEffect)((function(){null!=Z&&(R(Z?{type:"success",message:e("updated_user_successfully")}:{type:"error",message:e("error_updating_user")}),o({variables:{usuarioId:parseInt(X)}}))}),[Z]);var J=function(e,t){k(S(S({},w),{},(0,n.Z)({},e,t)))},z=(0,d.useMemo)((function(){return((null===T||void 0===T?void 0:T.clients)||[]).map((function(e){return{value:"".concat(e.clientID),label:e.name||""}}))}),[T]),V=(0,d.useState)("");V[0],V[1];return(0,P.jsx)(u.Z,{title:"Empatiza - ".concat(e("user_config_title")),children:(0,P.jsxs)("div",{className:l().container,children:[(0,P.jsx)("h1",{className:l().bienvenido,children:e("user_config")}),G&&(0,P.jsx)("div",{className:"toast-".concat(G.type),children:(0,P.jsx)("p",{children:G.message})}),null!==c&&void 0!==c&&c.getUser&&T?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)("div",{className:l().formGroup,children:[(0,P.jsx)("div",{className:l().formFieldHalf,children:(0,P.jsx)(m.d,{label:"".concat(e("name"),":"),value:(null===w||void 0===w?void 0:w.nombre)||"",onChange:function(e){return J("nombre",e.target.value)}})}),(0,P.jsx)("div",{className:l().formFieldHalf,children:(0,P.jsx)(m.d,{label:"".concat(e("surname"),":"),value:(null===w||void 0===w?void 0:w.apellidos)||"",onChange:function(e){return J("apellidos",e.target.value)}})})]}),(0,P.jsx)("div",{className:l().parentFormSeparator,children:(0,P.jsx)("div",{className:l().formSeparator})}),(0,P.jsxs)("div",{className:l().formGroup,children:[(0,P.jsx)("div",{className:l().formFieldHalf,children:(0,P.jsx)(m.d,{label:"".concat(e("email"),":"),value:(null===w||void 0===w?void 0:w.email)||"",onChange:function(e){return J("email",e.target.value)}})}),(0,P.jsxs)("div",{className:l().formFieldHalf,children:[(0,P.jsx)("span",{children:e("phone")}),(0,P.jsx)(y(),{value:w.telefono,placeholder:e("phone"),onChange:function(e){void 0!=e&&J("telefono","+".concat(e))},specialLabel:"",inputStyle:{width:"100%"}})]})]}),(0,P.jsxs)("div",{className:l().formGroup,children:[(0,P.jsxs)("div",{className:l().formFieldHalf,children:[(0,P.jsx)("span",{children:"".concat(e("client"),":")}),(0,P.jsx)(h.ZP,{options:z,placeholder:e("select_one_client"),value:z.find((function(e){return e.value==="".concat(w.clientID)})),onChange:function(e){return J("clientID",parseInt(e.value))},noOptionsMessage:function(){return e("no_options")}})]}),(0,P.jsxs)("div",{className:l().formFieldHalf,children:[(0,P.jsx)("span",{children:"".concat(e("status"),":")}),c.getUser.disabled?(0,P.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,P.jsx)("p",{className:l().inactive,children:e("disabled")}),(0,P.jsx)("div",{style:{height:40},children:(0,P.jsx)(f.Z,{text:e("enable").toUpperCase(),onclick:q,icon:g.f8k,width:128,background:"#50c64c"})})]}):(0,P.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,P.jsx)("p",{className:l().active,children:e("enabled")}),(0,P.jsx)("div",{style:{height:40},children:(0,P.jsx)(f.Z,{text:e("disable").toUpperCase(),onclick:q,icon:g.nYk,width:160,background:"#c64c4c"})})]})]})]}),(0,P.jsxs)("div",{children:[(0,P.jsxs)("p",{style:{margin:"4px 0"},children:[(0,P.jsx)("strong",{children:"".concat(e("first_access"),":")})," ",c.getUser.createdAccess?(0,b.c2)(c.getUser.createdAccess):"-"]}),(0,P.jsxs)("p",{style:{margin:"4px 0"},children:[(0,P.jsx)("strong",{children:"".concat(e("last_access"))})," ",c.getUser.lastAccess?(0,b.c2)(c.getUser.lastAccess):"-"]})]}),(0,P.jsxs)("div",{className:l().divfilterbuttonery,children:[(0,P.jsx)(f.Z,{text:e("save").toUpperCase(),onclick:L,icon:g.r6l,width:150}),(0,P.jsx)(f.Z,{text:e("cancel").toUpperCase(),onclick:function(){return Y.push("/configuracion/usuarios")},icon:g.acZ,width:150,background:"var(--orange-warning)"})]})]}):(0,P.jsx)(v.Z,{})]})})};D.requireAuth=!0,t.default=D},25762:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/configuracion/usuarios/[usuarioID]",function(){return a(35990)}])},41724:function(e){e.exports={inputtext:"InputText_inputtext__C4EDM",inputtextlabel:"InputText_inputtextlabel__Rnim_"}},47045:function(e){e.exports={container:"LoadingSpinner_container__htbli","lds-ring":"LoadingSpinner_lds-ring__0BEvr"}},76307:function(e){e.exports={subNav:"TareasProgramadas_subNav__LAYHi",titulo:"TareasProgramadas_titulo__PZblf",container:"TareasProgramadas_container__YUA7k",cardDeck:"TareasProgramadas_cardDeck__MM8sh",card:"TareasProgramadas_card__2OPQp",cardTitle:"TareasProgramadas_cardTitle__AUREf",cardInfo:"TareasProgramadas_cardInfo__KF_nn",bold:"TareasProgramadas_bold___Debc",noMarginRight:"TareasProgramadas_noMarginRight__7I64q",divfilter:"TareasProgramadas_divfilter__tcjju",divfilterbutton:"TareasProgramadas_divfilterbutton__51brl",divfilterbuttonery:"TareasProgramadas_divfilterbuttonery__aHWlg",w100:"TareasProgramadas_w100__TUXou",buscar:"TareasProgramadas_buscar__sk7zp",textinfo:"TareasProgramadas_textinfo__1NpfW",infoIcon:"TareasProgramadas_infoIcon__6EPFI",legendP:"TareasProgramadas_legendP__xmPvX",legendPoint:"TareasProgramadas_legendPoint__nF9xV",noResultados:"TareasProgramadas_noResultados__yAUVO",backgroundIcon:"TareasProgramadas_backgroundIcon__Wjnby",formGroup:"TareasProgramadas_formGroup__Uvj4_",formFieldHalf:"TareasProgramadas_formFieldHalf__Jn8sb",parentFormSeparator:"TareasProgramadas_parentFormSeparator__ZVbGX",formSeparator:"TareasProgramadas_formSeparator__0DIj_",active:"TareasProgramadas_active__i32Za",inactive:"TareasProgramadas_inactive__JXuqH"}}},function(e){e.O(0,[808,774,888,179],(function(){return t=25762,e
1(e.s=t);var t}));var t=e.O();_N_E=t}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.