1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5548],{3829:function(e,r,a){"use strict";var s=a(8156);r.Z=void 0;var t=s(a(3587)),l=a(1527),o=(0,t.default)((0,l.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4h-3.5z"}),"DeleteOutlineOutlined");r.Z=o},4093:function(e,r,a){"use strict";var s=a(8156);r.Z=void 0;var t=s(a(3587)),l=a(1527),o=(0,t.default)((0,l.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z"}),"EditOutlined");r.Z=o},598:function(e,r,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/panel-usuarios",function(){return a(4117)}])},6271:function(e,r,a){"use strict";a.r(r);var s=a(1527),t=a(959),l=a(7150),o=a(726),u=a(4810),i=a(1637),d=a(2459),n=a(7477);let c=e=>{let{openModalAdd:r,handleCloseModal:a,setuser:c}=e,[m,b]=(0,t.useState)(null),[x,g]=(0,t.useState)("administrador"),h=(0,t.useRef)(null),[f,p]=(0,t.useState)(!1),[y,v]=(0,t.useState)({nombre_usuarios:"",rut_usuarios:"",correo_usuarios:"",clave_usuarios:""}),w=e=>{v({...y,[e.target.name]:e.target.value})},j=async e=>{if(e.preventDefault(),null!==m){let r=await (0,i.c)(m,"usuarios"),s={nombre_usuarios:y.nombre_usuarios,rut_usuarios:y.rut_usuarios,correo_usuarios:y.correo_usuarios,clave_usuarios:y.clave_usuarios,rol_usuarios:x,foto__usuarios:r};await (0,n.r4)(s);let t=await (0,n.PR)();c(t)}else{await (0,n.r4)({...y,rol_usuarios:x,foto__usuarios:"https://firebasestorage.googleapis.com/v0/b/arzobispado-46c0f.appspot.com/o/static%2Favatardefault_92824.png?alt=media&token"});let l=await (0,n.PR)();c(l)}a()},k=e=>{e.stopPropagation()},_=e=>{h.current.scrollTop=0,p(!0)};return(0,s.jsx)("div",{children:(0,s.jsx)(l.Z,{open:r,onClose:a,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",BackdropProps:{onClick:k},children:(0,s.jsxs)("div",{className:!0===f?"overflow-y-hidden absolute top-1/2 left-1/2 -translate-x-1/2 bg-white shadow-lg -translate-y-1/2 w-2/3 md:w-2/3 h-5/6 p-11 rounded-xl":"absolute top-1/2 left-1/2 -translate-x-1/2 bg-white shadow-lg -translate-y-1/2 w-2/3 md:w-2/3 h-5/6 p-11 rounded-xl overflow-y-auto",ref:h,children:[(0,s.jsx)("div",{className:!0===f?"":"hidden",children:(0,s.jsx)(d.Z,{seccion:"usuarios"})}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-8 pb-3",children:[(0,s.jsx)("h5",{className:"text-lg font-semibold",children:"Agrega un nuevo usuario"}),(0,s.jsx)("button",{onClick:()=>a(),children:(0,s.jsx)(o.Z,{})})]}),(0,s.jsxs)("form",{onSubmit:j,children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"nombre_usuarios",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Nombre"}),(0,s.jsx)("input",{type:"text",id:"nombre_usuarios",onChange:w,value:null==y?void 0:y.nombre_usuarios,name:"nombre_usuarios",className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"rut_usuarios",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"RUT"}),(0,s.jsx)("input",{type:"text",id:"rut_usuarios",onChange:w,name:"rut_usuarios",value:null==y?void 0:y.rut_usuarios,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"correo_usuarios",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Correo"}),(0,s.jsx)("input",{type:"text",id:"correo_usuarios",name:"correo_usuarios",onChange:w,value:null==y?void 0:y.correo_usuarios,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"clave_usuarios",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Clave"}),(0,s.jsx)("input",{type:"password",id:"clave_usuarios",name:"clave_usuarios",value:null==y?void 0:y.clave_usuarios,onChange:w,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"rol_usuarios",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Rol"}),(0,s.jsxs)("select",{id:"rol_usuarios",onChange:function(e){g(e.target.value)},name:"rol_usuarios",value:x,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",children:[(0,s.jsx)("option",{value:"administrador",children:"Administrador"}),(0,s.jsx)("option",{value:"periodista",children:"Periodista"})]})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"imagen",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Imagen"}),(0,s.jsx)("input",{type:"file",onChange:e=>b(e.target.files[0]),value:null==y?void 0:y.file,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap flex-row",children:[(0,s.jsx)(u.zx,{type:"submit",onClick:_,children:"Guardar"}),(0,s.jsx)(u.zx,{color:"gray",className:"ml-3",onClick:a,children:"Cancelar"})]})]})]})})})};r.default=c},5045:function(e,r,a){"use strict";a.r(r);var s=a(1527),t=a(959),l=a(7150),o=a(6511),u=a(726),i=a(4810),d=a(1637),n=a(2459),c=a(7477);let m=e=>{let{openModal:r,handleCloseModal:a}=e,[m,b]=(0,t.useState)(null),x=(0,t.useRef)(null),[g,h]=(0,t.useState)(!1),[f,p]=(0,t.useState)({id_usuarios:"",nombre_usuarios:"",rut_usuarios:"",correo_usuarios:"",rol_usuarios:"",foto__usuarios:""}),y=e=>{p({...f,[e.target.name]:e.target.value})},v=async e=>{if(e.preventDefault(),null!==m){let r=await (0,d.c)(m,"usuarios"),s={...f,nombre_usuarios:f.nombre_usuarios,rut_usuarios:f.rut_usuarios,correo_usuarios:f.correo_usuarios,rol_usuarios:f.rol_usuarios,foto__usuarios:r};await (0,c.Nq)(s.id_usuarios,s);let t=await getUser();setuser(t)}else{await (0,c.Nq)(sendData.id_usuarios,f);let l=await getUser();setuser(l)}a()},w=(0,o.v9)(e=>{let{user:r}=e;return r.userUpdate}),j=e=>{e.stopPropagation()},k=e=>{x.current.scrollTop=0,h(!0)};return(0,t.useEffect)(()=>{p(w)},[w]),(0,s.jsx)("div",{children:(0,s.jsx)(l.Z,{open:r,onClose:a,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",BackdropProps:{onClick:j},children:(0,s.jsxs)("div",{className:!0===g?"overflow-y-hidden absolute top-1/2 left-1/2 -translate-x-1/2 bg-white shadow-lg -translate-y-1/2 w-2/3 md:w-2/3 h-5/6 p-11 rounded-xl":"absolute top-1/2 left-1/2 -translate-x-1/2 bg-white shadow-lg -translate-y-1/2 w-2/3 md:w-2/3 h-5/6 p-11 rounded-xl overflow-y-auto",ref:x,children:[(0,s.jsx)("div",{className:!0===g?"":"hidden",children:(0,s.jsx)(n.Z,{seccion:"usuarios"})}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-8 pb-3",children:[(0,s.jsxs)("h5",{className:"text-lg font-semibold",children:["Editar al usuario"," ",(0,s.jsx)("span",{className:"text-blue-800",children:null==f?void 0:f.nombre_usuarios})]}),(0,s.jsx)("button",{onClick:()=>a(),children:(0,s.jsx)(u.Z,{})})]}),(0,s.jsxs)("form",{onSubmit:v,children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"nombre",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Nombre"}),(0,s.jsx)("input",{type:"text",id:"nombre_usuarios",onChange:y,value:null==f?void 0:f.nombre_usuarios,name:"nombre_usuarios",className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"rut",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"RUT"}),(0,s.jsx)("input",{type:"text",id:"rut_usuarios",onChange:y,name:"rut_usuarios",value:null==f?void 0:f.rut_usuarios,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"correo",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Correo"}
1),(0,s.jsx)("input",{id:"correo_usuarios",type:"text",onChange:y,value:null==f?void 0:f.correo_usuarios,name:"correo_usuarios",className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"rol",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Rol"}),(0,s.jsxs)("select",{type:"text",id:"rol_usuarios",onChange:y,name:"rol_usuarios",value:null==f?void 0:f.rol_usuarios,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",children:[(0,s.jsx)("option",{value:"administrador",selected:!0,children:"Administrador"}),(0,s.jsx)("option",{value:"periodista",children:"Periodista"})]})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{htmlFor:"imagen",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Imagen"}),(0,s.jsx)("input",{type:"file",onChange:e=>b(e.target.files[0]),className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap flex-row",children:[(0,s.jsx)(i.zx,{type:"submit",onClick:k,children:"Guardar"}),(0,s.jsx)(i.zx,{color:"gray",className:"ml-3",onClick:a,children:"Cancelar"})]})]})]})})})};r.default=m},4117:function(e,r,a){"use strict";a.r(r);var s=a(1527),t=a(959),l=a(6555),o=a.n(l),u=a(6511),i=a(3829),d=a(4093),n=a(2798),c=a(6271),m=a(5045),b=a(7064),x=a(7477);let g=()=>{let e=(0,u.I0)(),[r,a]=(0,t.useState)([]),l=(0,u.v9)(e=>{let{auth:r}=e;return r.UserInfo}),[g,h]=(0,t.useState)(!1),[f,p]=(0,t.useState)(!1),y=async()=>{let e=await (0,x.PR)();a(e)},v=e=>{o().fire({title:"\xbf\xc9stas seguro?",text:"Un usuario que se elimina no se puede recuperar",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Si, eliminar!!",cancelButtonText:"Cancelar"}).then(r=>{r.isConfirmed&&w(e)})},w=async e=>{await (0,x.h8)(e);let r=await (0,x.PR)();a(r)},j=r=>{e((0,b.DD)(r)),h(!0)},k=()=>{h(!1),p(!1)};return(0,t.useEffect)(()=>{y()},[]),(0,s.jsxs)(n.Z,{children:[f&&(0,s.jsx)(c.default,{openModalAdd:f,handleCloseModal:k,setuser:a}),g&&(0,s.jsx)(m.default,{openModal:g,handleCloseModal:k,setuser:a}),(0,s.jsxs)("div",{className:"relative shadow-md sm:rounded-lg",children:[(0,s.jsxs)("section",{className:" pt-2 bg-white dark:bg-gray-900",children:[(0,s.jsx)("h1",{className:" mt-10 text-3xl font-semibold text-center text-gray-800 capitalize lg:text-4xl dark:text-white",children:"Usuarios"}),(0,s.jsx)("div",{className:"flex flex-wrap justify-center container px-6 py-10 mx-auto",children:null==r?void 0:r.map(e=>(0,s.jsx)("div",{className:" flex flex-wrap mx-3 mt-8 xl:mt-16",children:(0,s.jsxs)("div",{className:"flex flex-col items-center shadow-lg p-8 transition-colors duration-200 transform cursor-pointer group hover:bg-blue-600 rounded-xl w-52",children:[(0,s.jsx)("img",{className:"object-cover w-32 h-32 rounded-full ring-4 ring-gray-300",src:e.foto__usuarios,alt:""}),(0,s.jsx)("h1",{className:"mt-4 text-2xl font-semibold text-gray-700 capitalize dark:text-white group-hover:text-white",children:e.nombre_usuarios}),(0,s.jsx)("p",{className:"mt-2 text-gray-500 capitalize dark:text-gray-300 group-hover:text-gray-300",children:e.rut_usuarios}),(0,s.jsx)("p",{className:"mt-2 lowercase text-gray-500 dark:text-gray-300 group-hover:text-gray-300",children:e.correo_usuarios}),(0,s.jsxs)("div",{className:"flex mt-3 -mx-2",children:[(null==l?void 0:l.id_usuarios)!==(null==e?void 0:e.id_usuarios)&&(0,s.jsx)("button",{className:"mr-2 group-hover:text-gray-300",onClick:()=>v(e.id_usuarios),children:(0,s.jsx)(i.Z,{})}),(0,s.jsx)("button",{className:"group-hover:text-gray-300",onClick:()=>j(e),children:(0,s.jsx)(d.Z,{})})]})]})},e.id_usuarios))})]}),(0,s.jsx)("div",{className:"flex justify-between mt-10 items-center bg-white p-2",children:(0,s.jsx)("div",{children:(0,s.jsx)("button",{className:"block text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center",type:"button",onClick:()=>p(!0),children:"Agregar usuario"})})})]})]})};r.default=g},2459:function(e,r,a){"use strict";var s=a(1527);let t=e=>{let{seccion:r}=e;return(0,s.jsx)("div",{className:"z-50 absolute h-[68rem] left-0 top-0 bg-black bg-opacity-40 w-full",children:(0,s.jsxs)("div",{className:"flex flex-col items-center mt-32 ",children:[(0,s.jsx)("div",{children:(0,s.jsx)("img",{src:"/logot.png",alt:"",className:"w-96 animate-spin-slow"})}),(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:"py-2 px-5 rounded-lg flex items-center flex-col",children:[(0,s.jsxs)("div",{className:"loader-dots block relative w-20 h-5 mt-2",children:[(0,s.jsx)("div",{className:"absolute top-0 mt-1 w-3 h-3 rounded-full bg-red-500"}),(0,s.jsx)("div",{className:"absolute top-0 mt-1 w-3 h-3 rounded-full bg-blue-500"}),(0,s.jsx)("div",{className:"absolute top-0 mt-1 w-3 h-3 rounded-full bg-yellow-500"}),(0,s.jsx)("div",{className:"absolute top-0 mt-1 w-3 h-3 rounded-full bg-green-500"})]}),(0,s.jsxs)("div",{className:"text-white font-semibold text-xl mt-2 text-center",children:["Cargando ",r,", por favor espere..."]})]})})]})})};r.Z=t},1637:function(e,r,a){"use strict";a.d(r,{c:function(){return n}});var s=a(6973),t=a(384),l=a.n(t),o=a(7518),u=a(9168);let i=(0,s.ZF)({apiKey:"AIzaSyAftK3QHEuZ-pGWVIMGFne6wF_ZnLCD-Ow",authDomain:"arzobispado-46c0f.firebaseapp.com",projectId:"arzobispado-46c0f",storageBucket:"arzobispado-46c0f.appspot.com",messagingSenderId:"181432918837",appId:"1:181432918837:web:c95e8907d577a859c2227c"}),d=(0,o.cF)(i),n=async(e,r)=>{let a="".concat((0,u.Z)()).concat(l().extname(e.name)),s=(0,o.iH)(d,"".concat(r,"/").concat(a));await (0,o.KV)(s,e);let t=await (0,o.Jt)(s);return t}},7064:function(e,r,a){"use strict";a.d(r,{DD:function(){return l},xy:function(){return u}}),a(6555);var s=a(2874),t=a(7477);let l=e=>r=>{r(o(e))},o=e=>({type:s.QN,payload:e}),u=e=>async r=>{r(i());try{await (0,t.Nq)("".concat(e.id_usuarios),e),r(d(e))}catch(a){r(n())}},i=()=>({type:s.ly}),d=e=>({type:s.Vq,payload:e}),n=()=>({type:s.Hd,payload:!0})}},function(e){e.O(0,[6977,3440,4810,7151,5086,3259,6555,8052,2798,9774,2888,179],function(){return e(e.s=598)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.