import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import"./types-CgHs3Dg6.mjs";import{t as n}from"./utils-V17BGZ_G.mjs";const r={path:`/events/:tagSlug?`,categories:[`finance`],example:`/polymarket/events`,parameters:{tagSlug:`Tag slug to filter events, e.g. politics, sports, crypto. Omit for all events.`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`polymarket.com`,`polymarket.com/:tagSlug`],target:`/events/:tagSlug`}],name:`Events`,url:`polymarket.com`,maintainers:[`heqi201255`],handler:i};async function i(r){let i=r.req.param(`tagSlug`),a={active:!0,closed:!1,limit:30,order:`volume`,ascending:!1};i&&(a.tag_slug=i);let o=((await e(`https://gamma-api.polymarket.com/events/pagination`,{query:a})).data||[]).map(e=>({title:e.title,description:n(e),link:`https://polymarket.com/event/${e.slug}`,pubDate:e.startDate?t(e.startDate):void 0,category:e.tags?.map(e=>e.label).filter(Boolean)}));return{title:`Polymarket Events${i?` - ${i}`:``}`,link:i?`https://polymarket.com/${i}`:`https://polymarket.com`,item:o}}export{r as route};