"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[83442],{83442:(e,a,s)=>{s.r(a),s.d(a,{default:()=>o});var t=s(95155),n=s(12115),l=s(73321),r=s(74373),c=s(11301),u=s(46577),i=s(2581);function o({params:e}){let a=(0,l.useRouter)(),s=(0,n.use)(e),o=s?.id,[d,f]=(0,n.useState)(null),[g,k]=(0,n.useState)(!0);(0,n.useEffect)(()=>{o&&(async()=>{try{k(!0);let e=await (0,c.ex)(o);f(e)}catch(e){console.error("Error fetching package:",e),(0,i.Qg)(e instanceof Error?e.message:"Failed to load package"),(0,u.yK)("/admin/packages",a)}finally{k(!1)}})()},[o,a]);let p=()=>{(0,u.yK)("/admin/packages",a)};return g?(0,t.jsx)("div",{className:"min-h-[40vh] animate-pulse rounded-xl bg-slate-100"}):d?(0,t.jsx)(r.Z,{mode:"edit",initialPackage:d,onCancel:p,onSuccess:p}):null}}}]);