PageSourceSearch

https://www.buenosairesbus.com/_next/static/chunks/pages/authentication/admin-34b207eaa774eb80.js

js buenosairesbus.com collected 2026-09-25 00:02:02 UTC 8,466 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6208],{63477:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/authentication/admin",function(){return i(82978)}])},82978:function(e,n,i){"use strict";i.r(n);var t=i(85893),l=i(11163),s=i(67294),o=i(33207),a=i(9008),c=i.n(a),r=i(30381),d=i.n(r),h=i(5152),u=i.n(h),x=i(41610),m=i(48263),j=i(62623),Z=i(86867),g=i(28492),p=i(69397),f=i(99226),b=i(4592),C=i(21987),k=i(13614),v=i(37858),_=i(75921),w=i(98102),E=i(58439),y=i(64666),P=i(37645),T=i(54799),D=i(35713),Y=i(22715),N=i(20847),F=i(76642),L=i(91894),S=i(67720),A=i(50594);i(37676);var M=i(25617),W=i(56561),O=i(87066);let G=u()(()=>Promise.all([i.e(2937),i.e(1167)]).then(i.t.bind(i,71167,23)),{loadableGenerated:{webpack:()=>[71167]},ssr:!1,loading:()=>(0,t.jsx)("p",{children:"Loading ..."})}),q=O.Z.create({baseURL:"".concat("https://magicbusapi.herokuapp.com","/magicbus/")}),Admin=()=>{let{accessTokenWeb:e}=(0,M.v9)(e=>e.auth),n=(0,l.useRouter)(),[i,a]=(0,s.useState)([]),[r,h]=(0,s.useState)([]),[u,x]=(0,s.use
1State)(null),[O,z]=(0,s.useState)(""),[B,H]=(0,s.useState)(""),[R,V]=(0,s.useState)(""),[I,X]=(0,s.useState)(!1),[$,J]=(0,s.useState)(!1),Q=["header","bold","italic","underline","strike","blockquote","list","bullet","indent","link","image","align"],U={toolbar:[[{header:[1,2,!1]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{align:""},{align:"center"},{align:"right"},{align:"justify"}]]};(0,s.useEffect)(()=>{let i=(0,o.Bw)(e);i&&n.push("/authentication/login"),d().locale("es");let getListDatos=async()=>{let n=await (0,W.g)({accessToken:e,url:"/magicbus/notificaciones/es"});a(n)},getListDatosFormulario=async()=>{let n=await (0,W.g)({accessToken:e,url:"/formulario/list"});h(n)};getListDatos(),getListDatosFormulario()},[I,$]);let handleEdit=e=>{let n=d()(e.vencimiento).add(3,"hours").format("YYYY-MM-DD");x({...e,vencimiento:n}),z(e.documento||""),H(e.documento_eng||""),V(e.documento_por||""),X(!0)},handleFormClose=()=>X(!1),handleDeleteOpen=e=>{x(e),J(!0)},handleDeleteClose=()=>J(!1),handleFieldChange=e=>n=>{x({...u,[e]:n.target.value})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c(),{children:(0,t.jsx)("title",{children:"Buenos Aires Bus - Admin"})}),(0,t.jsxs)(m.ZP,{container:!0,spacing:2,children:[(0,t.jsx)(m.ZP,{item:!0,lg:12,sm:12,xs:12,children:(0,t.jsxs)(j.Z,{sx:{m:2},children:[(0,t.jsx)(Z.Z,{title:"Accesos R\xe1pidos"}),(0,t.jsxs)(g.Z,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[(0,t.jsx)(p.Z,{variant:"outlined",onClick:()=>n.push("/authentication/admin/cupones"),children:"Gestionar Cupones"}),(0,t.jsx)(p.Z,{variant:"outlined",onClick:()=>n.push("/authentication/admin/qr"),children:"Generador de QR"})]})]})}),(0,t.jsx)(m.ZP,{item:!0,lg:12,sm:6,xs:12,children:(0,t.jsxs)(j.Z,{sx:{m:2},children:[(0,t.jsx)(Z.Z,{title:"Notificaciones"}),(0,t.jsxs)(g.Z,{children:[I?(0,t.jsxs)(y.Z,{open:I,onClose:handleFormClose,maxWidth:"md",fullWidth:!0,children:[(0,t.jsxs)(P.Z,{children:[u._id?"Editar Notificaci\xf3n":"Nueva Notificaci\xf3n",(0,t.jsx)(T.Z,{"aria-label":"close",onClick:handleFormClose,sx:{position:"absolute",right:8,top:8},children:(0,t.jsx)(A.Z,{})})]}),(0,t.jsx)(D.Z,{dividers:!0,children:(0,t.jsxs)(m.ZP,{container:!0,spacing:2,children:[(0,t.jsx)(m.ZP,{item:!0,xs:12,md:4,children:(0,t.jsx)(Y.Z,{fullWidth:!0,label:"T\xedtulo (ES)",value:u.titulo,onChange:handleFieldChange("titulo")})}),(0,t.jsx)(m.ZP,{item:!0,xs:12,children:(0,t.jsx)(G,{theme:"snow",value:O,onChange:z,formats:Q,modules:U})}),(0,t.jsx)(m.ZP,{item:!0,xs:12,md:4,children:(0,t.jsx)(Y.Z,{fullWidth:!0,label:"T\xedtulo (EN)",value:u.titulo_eng,onChange:handleFieldChange("titulo_eng")})}),(0,t.jsx)(m.ZP,{item:!0,xs:12,children:(0,t.jsx)(G,{theme:"snow",value:B,onChange:H,formats:Q,modules:U})}),(0,t.jsx)(m.ZP,{item:!0,xs:12,md:4,children:(0,t.jsx)(Y.Z,{fullWidth:!0,label:"T\xedtulo (PT)",value:u.titulo_por,onChange:handleFieldChange("titulo_por")})}),(0,t.jsx)(m.ZP,{item:!0,xs:12,children:(0,t.jsx)(G,{theme:"snow",value:R,onChange:V,formats:Q,modules:U})}),(0,t.jsx)(m.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(Y.Z,{label:"Vencimiento",type:"date",fullWidth:!0,value:u.vencimiento,onChange:handleFieldChange("vencimiento"),InputLabelProps:{shrink:!0}})}),(0,t.jsx)(m.ZP,{item:!0,xs:12,md:6,sx:{display:"flex",alignItems:"center"},children:(0,t.jsx)(N.Z,{control:(0,t.jsx)(F.Z,{checked:u.habilitado,onChange:()=>{x({...u,habilitado:!u.habilitado})}}),label:u.habilitado?"Habilitado":"Deshabilitado"})})]})}),(0,t.jsxs)(L.Z,{children:[(0,t.jsx)(p.Z,{onClick:handleFormClose,children:"Cancelar"}),(0,t.jsx)(p.Z,{onClick:()=>{let e={...u,documento:O,documento_eng:B,documento_por:R},n=u._id?q.put("notificaciones",{params:e}):q.post("notificaciones",{params:e});n.then(e=>{console.log(e),X(!1)}).catch(console.error)},variant:"contained",children:"Guardar"})]})]}):(0,t.jsxs)(f.Z,{children:[(0,t.jsx)(f.Z,{sx:{display:"flex",justifyContent:"flex-end",mb:2},children:(0,t.jsx)(p.Z,{variant:"outlined",onClick:()=>{x({titulo:"",titulo_eng:"",titulo_por:"",vencimiento:d()().format("YYYY-MM-DD"),habilitado:!0}),z(""),H(""),V(""),X(!0)},children:"+ Nuevo"})}),(0,t.jsx)(b.Z,{component:C.Z,children:(0,t.jsxs)(k.Z,{children:[(0,t.jsx)(v.Z,{children:(0,t.jsxs)(_.Z,{children:[(0,t.jsx)(w.Z,{children:"T\xedtulo"}
1),(0,t.jsx)(w.Z,{children:"Vencimiento"}),(0,t.jsx)(w.Z,{children:"Habilitado"}),(0,t.jsx)(w.Z,{children:"Estado"}),(0,t.jsx)(w.Z,{align:"center",children:"Acciones"})]})}),(0,t.jsx)(E.Z,{children:i.map(e=>(0,t.jsxs)(_.Z,{children:[(0,t.jsx)(w.Z,{children:e.titulo}),(0,t.jsx)(w.Z,{children:d()(e.vencimiento).add(3,"hours").format("DD/MM/YYYY")}),(0,t.jsx)(w.Z,{children:e.habilitado?"S\xed":"No"}),(0,t.jsx)(w.Z,{children:d()(e.vencimiento).add(3,"hours").isBefore(d()())?"Vencido":"Vigente"}),(0,t.jsxs)(w.Z,{align:"center",children:[(0,t.jsx)(p.Z,{size:"small",onClick:()=>handleEdit(e),children:"Editar"}),(0,t.jsx)(p.Z,{size:"small",color:"error",onClick:()=>handleDeleteOpen(e),children:"Eliminar"})]})]},e._id))})]})})]}),(0,t.jsxs)(y.Z,{open:$,onClose:handleDeleteClose,children:[(0,t.jsx)(P.Z,{children:"Eliminar Notificaci\xf3n"}),(0,t.jsx)(D.Z,{children:"\xbfEst\xe1 seguro de que desea eliminar esta notificaci\xf3n?"}),(0,t.jsxs)(L.Z,{children:[(0,t.jsx)(p.Z,{onClick:handleDeleteClose,children:"Cancelar"}),(0,t.jsx)(p.Z,{onClick:()=>{q.delete("notificaciones/".concat(u._id)).then(()=>J(!1)).catch(console.error)},color:"error",variant:"contained",children:"Eliminar"})]})]})]})]})}),(0,t.jsx)(S.Z,{}),(0,t.jsx)(m.ZP,{item:!0,lg:12,sm:6,xs:12,children:(0,t.jsxs)(j.Z,{sx:{m:2},children:[(0,t.jsx)(Z.Z,{title:"Formularios de Contacto"}),(0,t.jsx)(g.Z,{children:(0,t.jsx)(b.Z,{component:C.Z,children:(0,t.jsxs)(k.Z,{children:[(0,t.jsx)(v.Z,{children:(0,t.jsxs)(_.Z,{children:[(0,t.jsx)(w.Z,{children:"createdAt"}),(0,t.jsx)(w.Z,{children:"nombre"}),(0,t.jsx)(w.Z,{children:"email"}),(0,t.jsx)(w.Z,{children:"telefono"}),(0,t.jsx)(w.Z,{children:"nacionalidad"}),(0,t.jsx)(w.Z,{children:"consulta"})]})}),(0,t.jsx)(E.Z,{children:r.map(e=>(0,t.jsxs)(_.Z,{children:[(0,t.jsx)(w.Z,{children:d()(e.createdAt).format("DD/MM/YYYY HH:mm")}),(0,t.jsx)(w.Z,{children:e.nombre}),(0,t.jsx)(w.Z,{children:e.email}),(0,t.jsx)(w.Z,{children:e.telefono}),(0,t.jsx)(w.Z,{children:e.nacionalidad}),(0,t.jsx)(w.Z,{children:e.consulta})]},e._id))})]})})})]})})]})]})};Admin.getLayout=x.u$,n.default=Admin},56561:function(e,n,i){"use strict";i.d(n,{$:function(){return postList},g:function(){return getList}});let t="".concat("https://magicbusapi.herokuapp.com"),postList=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{accessToken:"",url:"",body:""};try{let n=await fetch("".concat(t).concat(e.url),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"".concat(e.accessToken)},body:JSON.stringify(e.body)});if(!n.ok)throw Error(n.statusText);return await n.json()}catch(e){return{mensaje:e.message}}},getList=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{accessToken:"",url:""};try{let n=await fetch("".concat(t).concat(e.url),{method:"GET",headers:{"Content-Type":"application/json",Authorization:"".concat(e.accessToken)}});if(!n.ok)throw Error(n.statusText);return await n.json()}catch(e){return{mensaje:e.message}}}}},function(e){e.O(0,[4885,7525,1664,6896,3238,701,8263,8827,534,2715,359,7066,7863,2913,1610,9774,2888,179],function(){return e(e.s=63477)}),_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.