import{deleteCookie as d,getCookie as o,setCookie as p}from"hono/cookie";const q=(r,u,a)=>{const i=r.req.routePath,l=r.req.param(),m=Object.fromEntries(Object.entries(l).map(([e,t])=>{if(t&&(i.includes(`/:${e}{.*}`)||i.includes(`/:${e}{.+}`))){const c=t.split("/").filter(Boolean);return[e,c.length?c:void 0]}return[e,t]})),s={...r.res,status:e=>(r.status(e),s),json:e=>r.json(e),text:(e,t)=>(t&&r.status(t),r.text(e)),redirect:(e,t=302)=>r.redirect(e,t),setCookie:(e,t,n)=>(p(r,e,t,n),s),deleteCookie:e=>(d(r,e),s)};return{...u,...s,params:m,query:r.req.query()||{},cookies:o(r),telemetry:a}};export{q as enhanceContext};
