1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[275],{53342:function(e,a,r){"use strict";var n=r(21608),t=r(67814),o=r(62987),s=r.n(o),i=r(91889),c=r(85893),l=function(e){return e===i.fs?s().button:s().buttonSecondary};a.Z=function(e){var a=e.text,r=e.onclick,o=e.icon,u=e.width,d=e.background,_=void 0===d?i.fs:d;return(0,c.jsx)("div",{className:l(_),onClick:r,style:{width:u||120,background:_},children:(0,c.jsxs)(n.Z,{className:s().rowbutton,children:[(0,c.jsx)("div",{className:s().icondiv,children:(0,c.jsx)(t.G,{icon:o})}),(0,c.jsx)("div",{className:s().textdiv,children:a})]})})}},67066:function(e,a,r){"use strict";r.d(a,{d:function(){return s}});r(67294);var n=r(41724),t=r.n(n),o=r(85893),s=function(e){var a=e.label,r=e.type,n=void 0===r?"text":r,s=e.value,i=e.onChange;e.placeholder;return(0,o.jsxs)(o.Fragment,{children:[a?(0,o.jsx)("span",{children:a}):null,(0,o.jsx)("input",{className:t().inputtextlabel,type:n,value:s,onChange:i})]})}},59575:function(e,a,r){"use strict";var n=r(77191),t=(r(67294),r(47045)),o=r.n(t),s=r(85893);a.Z=function(e){return(0,n.Z)(e),(0,s.jsx)("div",{className:o().container,children:(0,s.jsxs)("div",{className:o()["lds-ring"],children:[(0,s.jsx)("div",{}),(0,s.jsx)("div",{}),(0,s.jsx)("div",{}),(0,s.jsx)("div",{})]})})}},26227:function(e,a,r){"use strict";r.r(a);var n=r(59499),t=r(50029),o=r(16835),s=r(87794),i=r.n(s),c=r(76307),l=r.n(c),u=r(38672),d=r(67294),_=r(53342),f=r(51436),m=r(11163),p=r(81118),v=r(67066),g=r(59575),h=r(87032),x=r(67421),b=r(67555),j=r.n(b),P=(r(72498),r(85893));function T(e,a){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?T(Object(r),!0).forEach((function(a){(0,n.Z)(e,a,r[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))}))}return e}var N=function(){var e=(0,x.$G)().t,a=(0,p.Gk)(),r=(0,o.Z)(a,2),s=r[0],c=r[1].data,b=(0,d.useState)({nombre:"",apellidos:"",email:"",telefono:"",disabled:!1,clientID:-1}),T=b[0],N=b[1],w=(0,p.U2)(),O=(0,o.Z)(w,2),I=O[0],k=O[1].data,D=(0,d.useState)(null),Z=D[0],F=D[1],E=(0,m.useRouter)();E.query.usuarioID;(0,d.useEffect)((function(){s()}),[]);var S=function(){var a=(0,t.Z)(i().mark((function a(){return i().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:(""===T.nombre||""===T.apellidos||""===T.email||""===T.telefono||-1===T.clientID?(F({type:"error",message:e("fill_all_fields")}),0):!(T.telefono.length<10||!T.telefono.includes("+")||T.telefono.includes(" "))||(F({type:"error",message:e("phone_warning_requirements")}),0))&&I({variables:{items:[{name:T.nombre,surname:T.apellidos,email:T.email,telephone:T.telefono,clientID:T.clientID,english:!1,roleID:3}]}});case 1:case"end":return a.stop()}}),a)})));return function(){return a.apply(this,arguments)}}();(0,d.useEffect)((function(){null!=k&&(k.generatePassword.length>0?(F({type:"success",message:e("user_sucessfully_created")}),setTimeout((function(){return E.push("/configuracion/usuarios")}),1e3)):F({type:"error",message:e("error_on_user_creation")}))}),[k]);var C=function(e,a){N(y(y({},T),{},(0,n.Z)({},e,a)))},H=(0,d.useMemo)((function(){return((null===c||void 0===c?void 0:c.clients)||[]).map((function(e){return{value:"".concat(e.clientID),label:e.name||""}}))}),[c]);return(0,P.jsx)(u.Z,{title:"Empatiza - ".concat(e("user_creation_title")),children:(0,P.jsxs)("div",{className:l().container,children:[(0,P.jsx)("h1",{className:l().bienvenido,children:e("user_creation_title")}),Z&&(0,P.jsx)("div",{className:"toast-".concat(Z.type),children:(0,P.jsx)("p",{children:Z.message})}),c?(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)(v.d,{label:"".concat(e("name"),":"),value:(null===T||void 0===T?void 0:T.nombre)||"",onChange:function(e){return C("nombre",e.target.value)}})}),(0,P.jsx)("div",{className:l().formFieldHalf,children:(0,P.jsx)(v.d,{label:"".concat(e("surname"),":"),value:(null===T||void 0===T?void 0:T.apellidos)||"",onChange:function(e){return C("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)(v.d,{label:"".concat(e("email"),":"),value:(null===T||void 0===T?void 0:T.email)||"",onChange:function(e){return C("email",e.target.value)}})}),(0,P.jsxs)("div",{className:l().formFieldHalf,children:[(0,P.jsx)("span",{children:e("phone")}),(0,P.jsx)(j(),{placeholder:e("phone"),onChange:function(e){void 0!=e&&C("telefono","+".concat(e))},specialLabel:"",inputStyle:{width:"100%"}})]})]}),(0,P.jsx)("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:H,placeholder:e("select_one_client"),value:H.find((function(e){return e.value==="".concat(T.clientID)})),onChange:function(e){return C("clientID",parseInt(e.value))},noOptionsMessage:function(){return e("no_options")}})]})}),(0,P.jsxs)("div",{className:l().divfilterbuttonery,children:[(0,P.jsx)(_.Z,{text:e("create").toUpperCase(),onclick:S,icon:f.r6l,width:120}),(0,P.jsx)(_.Z,{text:e("cancel"),onclick:function(){return E.push("/configuracion/usuarios")},icon:f.acZ,width:150,background:"var(--orange-warning)"})]})]}):(0,P.jsx)(g.Z,{})]})})};N.requireAuth=!0,a.default=N},44036:function(e,a,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/configuracion/usuarios/crear",function(){return r(26227)}])},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 a=44036,e(e.s=a);var a}));var a=e.O();_N_E=a}]);
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.