"use strict";exports.id=19326,exports.ids=[19326],exports.modules={19326:(a,b,c)=>{c.r(b),c.d(b,{default:()=>o});var d=c(48249),e=c(67484),f=c(19099),g=c(89531),h=c(60932),i=c(84466),j=c(61783),k=c(20524),l=c(10756),m=c(40433),n=c(91115);function o({params:a}){let b=(0,f.useRouter)(),c=(0,e.use)(a),o=c?.id,[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!0),[t,u]=(0,e.useState)(!1),v=async a=>{if(o)try{u(!0),await (0,l.qM)(o,a),(0,n.Te)("Event updated successfully"),b.push(`${m.bw.ADMIN}/events`)}catch(a){throw(0,n.Qg)(a instanceof Error?a.message:"Failed to update event"),a}finally{u(!1)}};return r?(0,d.jsx)("div",{className:"flex min-h-[40vh] items-center justify-center",children:(0,d.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-slate-300 border-t-primary-600"})}):p?(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsx)(h.u,{href:`${m.bw.ADMIN}/events`,children:(0,d.jsxs)(k.$,{variant:"outline",size:"sm",className:"w-fit",children:[(0,d.jsx)(g.AqJ,{className:"mr-2 h-4 w-4"}),"Back to events"]})}),(0,d.jsx)(i.wc,{title:"Edit event",description:p.title}),(0,d.jsx)(j.B,{initialData:p,onSubmit:v,onCancel:()=>b.push(`${m.bw.ADMIN}/events`),isLoading:t})]}):null}}};