import{N as h,a4 as m,i as f,a5 as l}from"./Dk4AzF7j.js";const D=t=>{const{kapi:a}=h(),{setCachedData:o,addTimeToProcessedData:u}=m(),s=f(),{data:c,error:i,status:d,refresh:p}=l(()=>{const{pid:e}=s.params;return`incidents-${t}-${e}`},async()=>{const{pid:e}=s.params;if(e===null)throw new Error("No project id found");return t==="current"?await a("Incident").then(r=>r.search(Number(e))):await a("Incident").then(r=>r.since(Number(e),{days:3}))},{transform:e=>u(e),getCachedData:(e,r,n)=>{if(!(n.cause==="refresh:manual"||n.cause==="refresh:hook"))return o(e)}});return{data:c,error:i,status:d,refresh:p}};export{D as u};
