import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{a as n,i as r,o as i,t as a}from"./utils-CV66l6sM.mjs";import o from"node:querystring";const s={path:`/profile/:handle/:routeParams?`,categories:[`social-media`],view:1,example:`/bsky/profile/bsky.app`,parameters:{handle:`User handle, can be found in URL`,routeParams:`Filter parameter, Use filter to customize content types`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`bsky.app/profile/:handle`]}],name:`Post`,maintainers:[`TonyRL`],handler:c,description:`
| Filter Value | Description |
|--------------|-------------|
| posts_with_replies | Includes Posts, Replies, and Reposts |
| posts_no_replies | Includes Posts and Reposts, without Replies |
| posts_with_media | Shows only Posts containing media |
| posts_and_author_threads | Shows Posts and Threads, without Replies and Reposts |

Default value for filter is \`posts_and_author_threads\` if not specified.

Example:
- \`/bsky/profile/bsky.app/filter=posts_with_replies\``};async function c(s){let c=s.req.param(`handle`),l=o.parse(s.req.param(`routeParams`)).filter||`posts_and_author_threads`,u=await n(c,e.tryGet),d=await r(u,e.tryGet),f=await a(u,l,e.tryGet),p=f.feed.map(({post:e})=>({title:e.record.text.split(`
`)[0],description:i({text:e.record.text.replaceAll(`
`,`<br>`),embed:e.embed}),author:e.author.displayName,pubDate:t(e.record.createdAt),link:`https://bsky.app/profile/${e.author.handle}/post/${e.uri.split(`app.bsky.feed.post/`)[1]}`,upvotes:e.likeCount,comments:e.replyCount}));return s.set(`json`,{DID:u,profile:d,authorFeed:f}),{title:`${d.displayName} (@${d.handle}) — Bluesky`,description:d.description?.replaceAll(`
`,` `),link:`https://bsky.app/profile/${d.handle}`,image:d.avatar,icon:d.avatar,logo:d.avatar,item:p,allowEmpty:!0}}export{s as route};