@tryghost/activitypub 3.1.0 → 3.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/activitypub.js +2 -2
  2. package/dist/{at-sign-l8HMU0fk.mjs → at-sign-B8iQvS42.mjs} +2 -2
  3. package/dist/{at-sign-l8HMU0fk.mjs.map → at-sign-B8iQvS42.mjs.map} +1 -1
  4. package/dist/{avatar-flipboard-D12yCmyH.mjs → avatar-flipboard-DNwig8eO.mjs} +2 -2
  5. package/dist/{avatar-flipboard-D12yCmyH.mjs.map → avatar-flipboard-DNwig8eO.mjs.map} +1 -1
  6. package/dist/{bluesky-sharing-D65sfQFX.mjs → bluesky-sharing-Cx4y2eb_.mjs} +6 -6
  7. package/dist/{bluesky-sharing-D65sfQFX.mjs.map → bluesky-sharing-Cx4y2eb_.mjs.map} +1 -1
  8. package/dist/{copy-DCHXVz-9.mjs → copy-Dg0Olymi.mjs} +2 -2
  9. package/dist/{copy-DCHXVz-9.mjs.map → copy-Dg0Olymi.mjs.map} +1 -1
  10. package/dist/{deleted-feed-item-BkXeOOSC.mjs → deleted-feed-item-C6ttBewp.mjs} +2 -2
  11. package/dist/{deleted-feed-item-BkXeOOSC.mjs.map → deleted-feed-item-C6ttBewp.mjs.map} +1 -1
  12. package/dist/{edit-profile-DdCJ6UkE.mjs → edit-profile-D17SCzby.mjs} +6 -6
  13. package/dist/edit-profile-D17SCzby.mjs.map +1 -0
  14. package/dist/{feed-D4gYSgoO.mjs → feed-OJkCDmvZ.mjs} +7 -7
  15. package/dist/{feed-D4gYSgoO.mjs.map → feed-OJkCDmvZ.mjs.map} +1 -1
  16. package/dist/{hash-D_Ql6FHR.mjs → hash-CaF6a8FN.mjs} +2 -2
  17. package/dist/{hash-D_Ql6FHR.mjs.map → hash-CaF6a8FN.mjs.map} +1 -1
  18. package/dist/{inbox-BIeU-G-G.mjs → inbox-DKED2HYQ.mjs} +2 -2
  19. package/dist/{inbox-BIeU-G-G.mjs.map → inbox-DKED2HYQ.mjs.map} +1 -1
  20. package/dist/{index-DK0316YP.mjs → index-B3WQF6P6.mjs} +2 -2
  21. package/dist/{index-DK0316YP.mjs.map → index-B3WQF6P6.mjs.map} +1 -1
  22. package/dist/{index-DiYjJ67s.mjs → index-BTDCxNUL.mjs} +11 -11
  23. package/dist/index-BTDCxNUL.mjs.map +1 -0
  24. package/dist/{index-BvOcRwis.mjs → index-CVvjItO-.mjs} +2 -2
  25. package/dist/{index-BvOcRwis.mjs.map → index-CVvjItO-.mjs.map} +1 -1
  26. package/dist/{index-l72TqahD.mjs → index-Cjktkl_Z.mjs} +9 -9
  27. package/dist/index-Cjktkl_Z.mjs.map +1 -0
  28. package/dist/{index-CPG1Xmp8.mjs → index-Cl_bAvCu.mjs} +6 -6
  29. package/dist/{index-CPG1Xmp8.mjs.map → index-Cl_bAvCu.mjs.map} +1 -1
  30. package/dist/{index-BurflorF.mjs → index-Cty-No3l.mjs} +11 -11
  31. package/dist/{index-BurflorF.mjs.map → index-Cty-No3l.mjs.map} +1 -1
  32. package/dist/{index-BlNT1f8K.mjs → index-DUNT0yV6.mjs} +3 -3
  33. package/dist/{index-BlNT1f8K.mjs.map → index-DUNT0yV6.mjs.map} +1 -1
  34. package/dist/{index-DIicyWvr.mjs → index-q4Ygdo0-.mjs} +52 -52
  35. package/dist/{index-DIicyWvr.mjs.map → index-q4Ygdo0-.mjs.map} +1 -1
  36. package/dist/{moderation-B0rtiaEH.mjs → moderation-nXSBmheF.mjs} +5 -5
  37. package/dist/{moderation-B0rtiaEH.mjs.map → moderation-nXSBmheF.mjs.map} +1 -1
  38. package/dist/{note-DjaU27En.mjs → note-uNSHIe4G.mjs} +4 -4
  39. package/dist/{note-DjaU27En.mjs.map → note-uNSHIe4G.mjs.map} +1 -1
  40. package/dist/{reply-4cqNFwLY.mjs → reply-BVkBkA2M.mjs} +2 -2
  41. package/dist/{reply-4cqNFwLY.mjs.map → reply-BVkBkA2M.mjs.map} +1 -1
  42. package/dist/{separator-Dgj8LPTF.mjs → separator-BljDgTc9.mjs} +2 -2
  43. package/dist/{separator-Dgj8LPTF.mjs.map → separator-BljDgTc9.mjs.map} +1 -1
  44. package/dist/{settings-qNWc2HyW.mjs → settings-CjuIDMTF.mjs} +3 -3
  45. package/dist/{settings-qNWc2HyW.mjs.map → settings-CjuIDMTF.mjs.map} +1 -1
  46. package/dist/{step-1-CuRWXSkm.mjs → step-1-YV90JpzH.mjs} +4 -4
  47. package/dist/{step-1-CuRWXSkm.mjs.map → step-1-YV90JpzH.mjs.map} +1 -1
  48. package/dist/{step-2-BsxjLzY8.mjs → step-2-BO7QOUb7.mjs} +6 -6
  49. package/dist/{step-2-BsxjLzY8.mjs.map → step-2-BO7QOUb7.mjs.map} +1 -1
  50. package/dist/{step-3-NBvYqr7R.mjs → step-3-qgcA50w6.mjs} +7 -7
  51. package/dist/{step-3-NBvYqr7R.mjs.map → step-3-qgcA50w6.mjs.map} +1 -1
  52. package/dist/{tabs-ROut24vi.mjs → tabs-DdupTuil.mjs} +15 -15
  53. package/dist/{tabs-ROut24vi.mjs.map → tabs-DdupTuil.mjs.map} +1 -1
  54. package/dist/{topic-filter-YL1wy3Q1.mjs → topic-filter-DqTL6EKu.mjs} +2 -2
  55. package/dist/{topic-filter-YL1wy3Q1.mjs.map → topic-filter-DqTL6EKu.mjs.map} +1 -1
  56. package/package.json +1 -1
  57. package/dist/edit-profile-DdCJ6UkE.mjs.map +0 -1
  58. package/dist/index-DiYjJ67s.mjs.map +0 -1
  59. package/dist/index-l72TqahD.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BTDCxNUL.mjs","sources":["../../../node_modules/lucide-react/dist/esm/icons/pencil.js","../../../node_modules/lucide-react/dist/esm/icons/user-round-x.js","../src/utils/get-name.ts","../src/views/profile/components/actor-list.tsx","../src/views/profile/components/likes.tsx","../src/views/profile/components/posts.tsx","../src/views/profile/components/unblock-dialog.tsx","../src/views/profile/components/profile-menu.tsx","../src/views/profile/components/unblock-button.tsx","../src/views/profile/components/profile-page.tsx","../src/views/profile/profile.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.553.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\",\n key: \"1a8usu\"\n }\n ],\n [\"path\", { d: \"m15 5 4 4\", key: \"1mk7zo\" }]\n];\nconst Pencil = createLucideIcon(\"pencil\", __iconNode);\n\nexport { __iconNode, Pencil as default };\n//# sourceMappingURL=pencil.js.map\n","/**\n * @license lucide-react v0.553.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M2 21a8 8 0 0 1 11.873-7\", key: \"74fkxq\" }],\n [\"circle\", { cx: \"10\", cy: \"8\", r: \"5\", key: \"o932ke\" }],\n [\"path\", { d: \"m17 17 5 5\", key: \"p7ous7\" }],\n [\"path\", { d: \"m22 17-5 5\", key: \"gqnmv0\" }]\n];\nconst UserRoundX = createLucideIcon(\"user-round-x\", __iconNode);\n\nexport { __iconNode, UserRoundX as default };\n//# sourceMappingURL=user-round-x.js.map\n","export default function getName(actor: {name: unknown, preferredUsername: unknown}): string {\n if (typeof actor.name === 'string') {\n return actor.name;\n }\n if (typeof actor.preferredUsername === 'string') {\n return actor.preferredUsername;\n }\n if (typeof actor.preferredUsername === 'object' && actor.preferredUsername !== null) {\n if ('@value' in actor.preferredUsername) {\n if (typeof actor.preferredUsername['@value'] === 'string') {\n return actor.preferredUsername['@value'];\n }\n }\n }\n return 'Unknown';\n}\n","import APAvatar from '@src/components/global/ap-avatar';\nimport ActivityItem from '@src/components/activities/activity-item';\nimport FollowButton from '@src/components/global/follow-button';\nimport ProfilePreviewHoverCard from '@components/global/profile-preview-hover-card';\nimport React, {useEffect, useRef} from 'react';\nimport getName from '@src/utils/get-name';\nimport getUsername from '@src/utils/get-username';\nimport {Actor} from '@src/api/activitypub';\nimport {Button, LoadingIndicator, LucideIcon, NoValueLabel, NoValueLabelIcon} from '@tryghost/shade';\nimport {handleProfileClick} from '@src/utils/handle-profile-click';\nimport {useAccountForUser} from '@src/hooks/use-activity-pub-queries';\nimport {useNavigateWithBasePath} from '@src/hooks/use-navigate-with-base-path';\n\ntype ActorListProps = {\n noResultsMessage: string,\n actors: Actor[],\n isLoading: boolean,\n fetchNextPage: () => void,\n hasNextPage: boolean,\n isFetchingNextPage: boolean\n};\n\nconst ActorList: React.FC<ActorListProps> = ({\n noResultsMessage,\n actors,\n isLoading,\n fetchNextPage,\n hasNextPage,\n isFetchingNextPage\n}) => {\n const currentAccountQuery = useAccountForUser('index', 'me');\n const {data: currentUser} = currentAccountQuery;\n\n const observerRef = useRef<IntersectionObserver | null>(null);\n const loadMoreRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n\n observerRef.current = new IntersectionObserver((entries) => {\n if (entries[0].isIntersecting && hasNextPage && !isFetchingNextPage) {\n fetchNextPage();\n }\n });\n\n if (loadMoreRef.current) {\n observerRef.current.observe(loadMoreRef.current);\n }\n\n return () => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n };\n }, [hasNextPage, isFetchingNextPage, fetchNextPage]);\n\n const navigate = useNavigateWithBasePath();\n\n return (\n <div className='pt-3' data-testid=\"actor-list\">\n {\n hasNextPage === false && actors.length === 0 ? (\n <NoValueLabel>\n <NoValueLabelIcon><LucideIcon.UserRoundPlus /></NoValueLabelIcon>\n {noResultsMessage}\n </NoValueLabel>\n ) : (\n <div className='flex flex-col'>\n {actors.map(({actor, isFollowing, blockedByMe, domainBlockedByMe}) => {\n const actorHandle = actor.handle || getUsername(actor);\n const isCurrentUser = actorHandle === currentUser?.handle;\n\n return (\n <React.Fragment key={actor.id}>\n <ProfilePreviewHoverCard actor={actor} align='center' isCurrentUser={isCurrentUser} side='left'>\n <div>\n <ActivityItem key={actor.id}\n data-testid=\"actor-item\"\n onClick={() => {\n handleProfileClick(actor, navigate);\n }}\n >\n <APAvatar author={actor} />\n <div>\n <div className='text-gray-600 break-anywhere'>\n <span className='mr-1 line-clamp-1 font-bold text-black dark:text-white'>{getName(actor)}</span>\n <div className='line-clamp-1 text-sm'>{actorHandle}</div>\n </div>\n </div>\n {blockedByMe || domainBlockedByMe ?\n <Button className='pointer-events-none ml-auto min-w-[90px]' variant='destructive'>Blocked</Button> :\n !isCurrentUser ? (\n <FollowButton\n className='ml-auto'\n data-testid=\"follow-button\"\n following={isFollowing}\n handle={actorHandle}\n type='secondary'\n />\n ) : null\n }\n </ActivityItem>\n </div>\n </ProfilePreviewHoverCard>\n </React.Fragment>\n );\n })}\n </div>\n )\n }\n <div ref={loadMoreRef} className='h-1'></div>\n {\n (isFetchingNextPage || isLoading) && (\n <div className='mt-6 flex flex-col items-center justify-center gap-4 text-center'>\n <LoadingIndicator size='md' />\n </div>\n )\n }\n </div>\n );\n};\n\nexport default ActorList;\n","import FeedItem from '@src/components/feed/feed-item';\nimport {Activity} from '@src/api/activitypub';\nimport {LoadingIndicator, LucideIcon, NoValueLabel, NoValueLabelIcon, Separator} from '@tryghost/shade';\nimport {useEffect, useRef} from 'react';\nimport {useNavigateWithBasePath} from '@src/hooks/use-navigate-with-base-path';\n\nexport type LikesProps = {\n isLoading: boolean,\n posts: Activity[],\n fetchNextPage: () => void,\n hasNextPage: boolean,\n isFetchingNextPage: boolean\n}\n\nconst Likes: React.FC<LikesProps> = ({\n posts,\n fetchNextPage,\n hasNextPage,\n isFetchingNextPage,\n isLoading\n}) => {\n const observerRef = useRef<IntersectionObserver | null>(null);\n const loadMoreRef = useRef<HTMLDivElement | null>(null);\n const endLoadMoreRef = useRef<HTMLDivElement | null>(null);\n\n // Calculate the index at which to place the loadMoreRef - This will place it ~75% through the list\n const loadMoreIndex = Math.max(0, Math.floor(posts.length * 0.75) - 1);\n\n useEffect(() => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n\n observerRef.current = new IntersectionObserver((entries) => {\n if (entries[0].isIntersecting && hasNextPage && !isFetchingNextPage) {\n fetchNextPage();\n }\n });\n\n if (loadMoreRef.current) {\n observerRef.current.observe(loadMoreRef.current);\n }\n if (endLoadMoreRef.current) {\n observerRef.current.observe(endLoadMoreRef.current);\n }\n\n return () => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n };\n }, [hasNextPage, isFetchingNextPage, fetchNextPage]);\n\n const navigate = useNavigateWithBasePath();\n\n return (\n <>\n {hasNextPage === false && posts.length === 0 && (\n <NoValueLabel>\n <NoValueLabelIcon><LucideIcon.Heart /></NoValueLabelIcon>\n You haven&apos;t liked anything yet.\n </NoValueLabel>\n )}\n <ul className='mx-auto flex max-w-[640px] flex-col' data-testid=\"profile-likes-list\">\n {posts.map((activity, index) => (\n <li\n key={`likes-${activity.id}`}\n data-testid=\"profile-like-item\"\n data-test-view-article\n >\n <FeedItem\n actor={activity.actor}\n allowDelete={activity.object.authored}\n commentCount={activity.object.replyCount}\n isLoading={isLoading}\n layout='feed'\n likeCount={activity.object.likeCount}\n object={activity.object}\n repostCount={activity.object.repostCount}\n type={activity.type}\n onClick={() => {\n if (activity.object.type === 'Note') {\n navigate(`/notes/${encodeURIComponent(activity.object.id)}`);\n } else if (activity.object.type === 'Article') {\n navigate(`/reader/${encodeURIComponent(activity.object.id)}`);\n }\n }}\n />\n {index < posts.length - 1 && <Separator />}\n {index === loadMoreIndex && (\n <div ref={loadMoreRef} className='h-1'></div>\n )}\n </li>\n ))}\n {isFetchingNextPage && (\n <li className='flex flex-col items-center justify-center gap-4 text-center'>\n <LoadingIndicator size='md' />\n </li>\n )}\n </ul>\n <div ref={endLoadMoreRef} className='h-1'></div>\n </>\n );\n};\n\nexport default Likes;\n","import FeedItem from '@src/components/feed/feed-item';\nimport {Activity} from '@src/api/activitypub';\nimport {LoadingIndicator, LucideIcon, NoValueLabel, NoValueLabelIcon, Separator} from '@tryghost/shade';\nimport {useEffect, useRef} from 'react';\nimport {useNavigateWithBasePath} from '@src/hooks/use-navigate-with-base-path';\n\nexport type PostsProps = {\n posts: Activity[],\n isLoading: boolean,\n fetchNextPage: () => void,\n hasNextPage: boolean,\n isFetchingNextPage: boolean,\n noResultsMessage: string\n}\n\nconst Posts: React.FC<PostsProps> = ({\n posts,\n fetchNextPage,\n hasNextPage,\n isFetchingNextPage,\n isLoading,\n noResultsMessage\n}) => {\n const observerRef = useRef<IntersectionObserver | null>(null);\n const loadMoreRef = useRef<HTMLDivElement | null>(null);\n const endLoadMoreRef = useRef<HTMLDivElement | null>(null);\n\n // Calculate the index at which to place the loadMoreRef - This will place it ~75% through the list\n const loadMoreIndex = Math.max(0, Math.floor(posts.length * 0.75) - 1);\n\n useEffect(() => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n\n observerRef.current = new IntersectionObserver((entries) => {\n if (entries[0].isIntersecting && hasNextPage && !isFetchingNextPage) {\n fetchNextPage();\n }\n });\n\n if (loadMoreRef.current) {\n observerRef.current.observe(loadMoreRef.current);\n }\n if (endLoadMoreRef.current) {\n observerRef.current.observe(endLoadMoreRef.current);\n }\n\n return () => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n };\n }, [hasNextPage, isFetchingNextPage, fetchNextPage]);\n\n const navigate = useNavigateWithBasePath();\n\n return (\n <>\n {hasNextPage === false && posts.length === 0 && (\n <NoValueLabel>\n <NoValueLabelIcon><LucideIcon.Pencil /></NoValueLabelIcon>\n {noResultsMessage}\n </NoValueLabel>\n )}\n <ul className='mx-auto flex max-w-[640px] flex-col' data-testid=\"profile-posts-list\">\n {posts.map((activity, index) => (\n <li\n key={`posts-${activity.id}`}\n data-testid=\"profile-post-item\"\n data-test-view-article\n >\n <FeedItem\n actor={activity.actor}\n allowDelete={activity.object.authored}\n commentCount={activity.object.replyCount}\n isLoading={isLoading}\n layout='feed'\n likeCount={activity.object.likeCount}\n object={activity.object}\n repostCount={activity.object.repostCount}\n type={activity.type}\n onClick={() => {\n if (activity.object.type === 'Note') {\n navigate(`/notes/${encodeURIComponent(activity.object.id)}`);\n } else if (activity.object.type === 'Article') {\n navigate(`/reader/${encodeURIComponent(activity.object.id)}`);\n }\n }}\n />\n {index < posts.length - 1 && <Separator />}\n {index === loadMoreIndex && (\n <div ref={loadMoreRef} className='h-1'></div>\n )}\n </li>\n ))}\n {isFetchingNextPage && (\n <li className='flex flex-col items-center justify-center gap-4 text-center'>\n <LoadingIndicator size='md' />\n </li>\n )}\n </ul>\n <div ref={endLoadMoreRef} className='h-1'></div>\n </>\n );\n};\n\nexport default Posts;\n","import React, {useCallback, useEffect, useState} from 'react';\nimport {\n AlertDialog,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n Button,\n H4,\n LucideIcon\n} from '@tryghost/shade';\nimport {toast} from 'sonner';\n\ntype DialogMode = 'idle' | 'dual' | 'userOnly' | 'domainOnly';\n\ninterface UnblockDialogProps {\n handle: string;\n isUserBlocked: boolean;\n isDomainBlocked: boolean;\n onUnblockUser: () => Promise<void> | void;\n onUnblockDomain: () => Promise<void> | void;\n trigger?: React.ReactNode;\n onUnblockComplete?: () => void;\n isOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nconst UnblockDialog: React.FC<UnblockDialogProps> = ({\n handle,\n isUserBlocked,\n isDomainBlocked,\n onUnblockUser,\n onUnblockDomain,\n trigger,\n onUnblockComplete,\n isOpen: externalIsOpen,\n onOpenChange: externalOnOpenChange\n}) => {\n const [internalDialogOpen, setInternalDialogOpen] = useState(false);\n const [dialogState, setDialogState] = useState(() => {\n const bothBlocked = isUserBlocked && isDomainBlocked;\n const userOnlyBlocked = isUserBlocked && !isDomainBlocked;\n const domainOnlyBlocked = !isUserBlocked && isDomainBlocked;\n\n let mode: DialogMode = 'idle';\n if (bothBlocked) {\n mode = 'dual';\n } else if (userOnlyBlocked) {\n mode = 'userOnly';\n } else if (domainOnlyBlocked) {\n mode = 'domainOnly';\n }\n\n return {\n mode,\n userUnblocked: false,\n domainUnblocked: false\n };\n });\n\n const isControlled = externalIsOpen !== undefined;\n const dialogOpen = isControlled ? externalIsOpen : internalDialogOpen;\n\n const [wasOpened, setWasOpened] = useState(false);\n\n const initializeDialogState = useCallback(() => {\n const bothBlocked = isUserBlocked && isDomainBlocked;\n const userOnlyBlocked = isUserBlocked && !isDomainBlocked;\n const domainOnlyBlocked = !isUserBlocked && isDomainBlocked;\n\n let mode: DialogMode = 'idle';\n if (bothBlocked) {\n mode = 'dual';\n } else if (userOnlyBlocked) {\n mode = 'userOnly';\n } else if (domainOnlyBlocked) {\n mode = 'domainOnly';\n }\n\n setDialogState(prev => ({\n ...prev,\n mode,\n userUnblocked: false,\n domainUnblocked: false\n }));\n }, [isUserBlocked, isDomainBlocked]);\n\n useEffect(() => {\n if (dialogOpen && !wasOpened) {\n initializeDialogState();\n setWasOpened(true);\n } else if (!dialogOpen) {\n setWasOpened(false);\n }\n }, [dialogOpen, wasOpened, initializeDialogState]);\n\n const handleDialogOpen = () => {\n if (isControlled) {\n externalOnOpenChange?.(true);\n } else {\n setInternalDialogOpen(true);\n }\n };\n\n const handleDialogClose = (open: boolean) => {\n if (!open) {\n if (isControlled) {\n externalOnOpenChange?.(false);\n } else {\n setInternalDialogOpen(false);\n }\n }\n };\n\n const handleUnblock = async () => {\n await onUnblockUser();\n\n setDialogState(prev => ({\n ...prev,\n userUnblocked: true\n }));\n\n if (dialogState.mode !== 'dual' || dialogState.domainUnblocked) {\n handleDialogClose(false);\n onUnblockComplete?.();\n }\n\n toast.success('User unblocked');\n };\n\n const handleDomainUnblock = async () => {\n await onUnblockDomain();\n\n setDialogState(prev => ({\n ...prev,\n domainUnblocked: true\n }));\n\n if (dialogState.mode !== 'dual' || dialogState.userUnblocked) {\n handleDialogClose(false);\n onUnblockComplete?.();\n }\n\n toast.success('Domain unblocked');\n };\n\n const domain = handle.split('@').filter(Boolean)[1];\n\n const renderDualView = () => (\n <>\n <AlertDialogHeader>\n <AlertDialogTitle className='mb-1 flex flex-col gap-1'>\n Unblock\n </AlertDialogTitle>\n <AlertDialogDescription className='mt-4!' asChild>\n <div className='flex flex-col rounded-md border'>\n <div className='flex justify-between gap-6 p-5'>\n <div className='flex flex-col gap-1'>\n <H4>Unblock user</H4>\n <p><span className='font-semibold text-black'>{handle}</span> will be able to follow you and engage with your public posts.</p>\n </div>\n <Button className={`gap-1 ${dialogState.userUnblocked ? 'pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white' : 'text-red hover:text-red-400'}`} variant='outline' onClick={handleUnblock}>\n <LucideIcon.User />\n {dialogState.userUnblocked ? 'User unblocked' : 'Unblock user'}\n </Button>\n </div>\n <div className='border-t' />\n <div className='flex justify-between gap-6 p-5'>\n <div className='flex flex-col gap-1'>\n <H4>Unblock domain</H4>\n <p>Users from <span className='font-semibold text-black'>{domain}</span> will be able to follow you and engage with your public posts.</p>\n </div>\n <Button className={`gap-1 ${dialogState.domainUnblocked ? 'pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white' : 'text-red hover:text-red-400'}`} variant='outline' onClick={handleDomainUnblock}>\n <LucideIcon.Globe />\n {dialogState.domainUnblocked ? 'Domain unblocked' : 'Unblock domain'}\n </Button>\n </div>\n </div>\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <Button onClick={() => handleDialogClose(false)}>OK</Button>\n </AlertDialogFooter>\n </>\n );\n\n const renderSingleView = () => {\n const isUserBlock = dialogState.mode === 'userOnly';\n\n return (\n <>\n <AlertDialogHeader>\n <AlertDialogTitle className='mb-1 flex flex-col gap-1'>\n {isUserBlock ? 'Unblock this user?' : 'Unblock this domain?'}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {isUserBlock\n ? <><span className='font-semibold text-black'>{handle}</span> will be able to follow you and engage with your public posts.</>\n : <>Users from <span className='font-semibold text-black'>{domain}</span> will be able to follow you and engage with your public posts.</>\n }\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <Button onClick={isUserBlock ? handleUnblock : handleDomainUnblock}>\n Unblock\n </Button>\n </AlertDialogFooter>\n </>\n );\n };\n\n return (\n <AlertDialog open={dialogOpen} onOpenChange={handleDialogClose}>\n {trigger && (\n <AlertDialogTrigger asChild onClick={handleDialogOpen}>\n {trigger}\n </AlertDialogTrigger>\n )}\n <AlertDialogContent className={`${dialogState.mode === 'dual' && 'max-w-[600px]'}`}>\n {dialogState.mode === 'dual' ? renderDualView() : renderSingleView()}\n </AlertDialogContent>\n </AlertDialog>\n );\n};\n\nexport default UnblockDialog;\n","import React, {useState} from 'react';\nimport UnblockDialog from './unblock-dialog';\nimport {Account} from '@src/api/activitypub';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n Button,\n Popover,\n PopoverClose,\n PopoverContent,\n PopoverTrigger,\n buttonVariants\n} from '@tryghost/shade';\n\ninterface ProfileMenuProps {\n account?: Account,\n children: React.ReactNode;\n onCopyHandle: () => void;\n onBlockAccount: () => void;\n onBlockDomain: () => void;\n disabled?: boolean;\n isBlocked?: boolean;\n isDomainBlocked?: boolean;\n}\n\nconst ProfileMenu: React.FC<ProfileMenuProps> = ({\n account,\n children,\n onCopyHandle,\n onBlockAccount,\n onBlockDomain,\n disabled = false,\n isBlocked = false,\n isDomainBlocked = false\n}) => {\n const [dialogType, setDialogType] = useState<'user' | 'domain' | null>(null);\n const [dialogOpen, setDialogOpen] = useState(false);\n\n const handleCopyHandleClick = (e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation();\n onCopyHandle();\n };\n\n const handleBlockAccountClick = (e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation();\n onBlockAccount();\n };\n\n const handleBlockDomainClick = (e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation();\n onBlockDomain();\n };\n\n const handle = account?.handle;\n const domain = handle?.split('@').filter(Boolean)[1];\n\n const renderBlockView = () => (\n <AlertDialog open={dialogOpen} onOpenChange={setDialogOpen}>\n <AlertDialogContent onClick={e => e.stopPropagation()}>\n <AlertDialogHeader>\n <AlertDialogTitle className='mb-1 flex flex-col gap-1'>\n {dialogType === 'user' ? 'Block this user?' : 'Block this domain?'}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {dialogType === 'user'\n ? <><span className='font-semibold text-black'>{handle}</span> will be able to see your public posts, but will no longer be able follow you or interact with your content on the social web.</>\n : <>All users from <span className='font-semibold text-black'>{domain}</span> will be able to see your public posts, but won&apos;t be able to follow you or interact with your content.</>\n }\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n {dialogType !== 'domain' &&\n <Button className='-ml-3 mr-auto hover:bg-transparent hover:opacity-80' variant='ghost' onClick={(e) => {\n e.stopPropagation();\n setDialogType('domain');\n }}>Block domain instead</Button>\n }\n <AlertDialogCancel onClick={e => e.stopPropagation()}>\n Cancel\n </AlertDialogCancel>\n <AlertDialogAction\n className={buttonVariants({variant: 'destructive'})}\n onClick={dialogType === 'user' ? handleBlockAccountClick : handleBlockDomainClick}\n >\n Block\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n\n const renderUnblockView = () => (\n account && <UnblockDialog\n handle={account.handle}\n isDomainBlocked={account.domainBlockedByMe}\n isOpen={dialogOpen}\n isUserBlocked={account.blockedByMe}\n onOpenChange={setDialogOpen}\n onUnblockDomain={onBlockDomain}\n onUnblockUser={onBlockAccount}\n />\n );\n\n return (\n <>\n <Popover>\n <PopoverTrigger disabled={disabled} asChild onClick={e => e.stopPropagation()}>\n {children}\n </PopoverTrigger>\n <PopoverContent align=\"end\" className='p-2'>\n <div className='flex w-48 flex-col'>\n <PopoverClose asChild>\n <Button className='justify-start' variant='ghost' onClick={handleCopyHandleClick}>\n Copy handle\n </Button>\n </PopoverClose>\n <PopoverClose asChild>\n <Button className='justify-start text-red hover:bg-red/5 hover:text-red' variant='ghost' onClick={(e) => {\n e.stopPropagation();\n if (!isBlocked && !isDomainBlocked) {\n setDialogType('user');\n }\n setDialogOpen(true);\n }}>\n {isBlocked ? 'Unblock user' : isDomainBlocked ? 'Unblock domain' : 'Block user'}\n </Button>\n </PopoverClose>\n </div>\n </PopoverContent>\n </Popover>\n {isBlocked || isDomainBlocked ? renderUnblockView() : renderBlockView()}\n </>\n );\n};\n\nexport default ProfileMenu;\n","import React, {useState} from 'react';\nimport UnblockDialog from './unblock-dialog';\nimport {Account} from '@src/api/activitypub';\nimport {Button} from '@tryghost/shade';\n\ninterface UnblockButtonProps {\n account: Account,\n onUnblock: () => void;\n onDomainUnblock: () => void;\n className?: string;\n}\n\nconst UnblockButton: React.FC<UnblockButtonProps> = ({\n account,\n onUnblock,\n onDomainUnblock,\n className = ''\n}) => {\n const [isHovered, setIsHovered] = useState(false);\n\n const trigger = (\n <Button\n className={`min-w-[90px] ${className}`}\n variant='destructive'\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isHovered ? 'Unblock' : 'Blocked'}\n </Button>\n );\n\n return (\n <UnblockDialog\n handle={account.handle}\n isDomainBlocked={account.domainBlockedByMe}\n isUserBlocked={account.blockedByMe}\n trigger={trigger}\n onUnblockDomain={onDomainUnblock}\n onUnblockUser={onUnblock}\n />\n );\n};\n\nexport default UnblockButton;\n","import APAvatar from '@src/components/global/ap-avatar';\nimport EditProfile from '@src/views/preferences/components/edit-profile';\nimport FollowButton from '@src/components/global/follow-button';\nimport Layout from '@src/components/layout';\nimport ProfileMenu from './profile-menu';\nimport UnblockButton from './unblock-button';\nimport {Account} from '@src/api/activitypub';\nimport {Badge, Button, Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, H2, H4, LucideIcon, NoValueLabel, NoValueLabelIcon, Skeleton, Tabs, TabsContent, TabsList, TabsTrigger, TabsTriggerCount, abbreviateNumber} from '@tryghost/shade';\nimport {EmptyViewIcon, EmptyViewIndicator} from '@src/components/global/empty-view-indicator';\nimport {SettingAction} from '@src/views/preferences/components/settings';\nimport {openLinksInNewTab, sanitizeHtml, stripHtml} from '@src/utils/content-formatters';\nimport {toast} from 'sonner';\nimport {useAccountForUser, useBlockDomainMutationForUser, useBlockMutationForUser, useUnblockDomainMutationForUser, useUnblockMutationForUser} from '@src/hooks/use-activity-pub-queries';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {useLocation, useNavigationStack, useParams} from '@tryghost/admin-x-framework';\nimport {useNavigateWithBasePath} from '@src/hooks/use-navigate-with-base-path';\nimport type {ProfileTab} from '../profile';\n\nconst noop = () => {};\n\ntype ProfilePageProps = {\n account: Account,\n customFields: Array<{\n name: string;\n value: string;\n }>,\n postsTab: React.ReactNode,\n likesTab: React.ReactNode,\n followingTab: React.ReactNode,\n followersTab: React.ReactNode,\n isLoadingAccount: boolean\n}\n\nconst ProfilePage:React.FC<ProfilePageProps> = ({\n account,\n customFields,\n isLoadingAccount,\n postsTab,\n likesTab,\n followingTab,\n followersTab\n}) => {\n const params = useParams<{handle?: string; tab?: string}>();\n const location = useLocation();\n const navigate = useNavigateWithBasePath();\n const {canGoBack} = useNavigationStack();\n\n const profilePath = params.handle ? `/profile/${params.handle}` : '/profile';\n const likesEnabled = !params.handle;\n\n const tabSlug = params.handle\n ? (params.tab || '')\n : (location.pathname.split('/').pop() || '');\n\n const allowedTabs = useMemo<ProfileTab[]>(() => (\n likesEnabled ? ['likes', 'following', 'followers'] : ['following', 'followers']\n ), [likesEnabled]);\n const activeTab: ProfileTab = allowedTabs.includes(tabSlug as ProfileTab) ? tabSlug as ProfileTab : 'posts';\n\n const blockMutation = useBlockMutationForUser('index');\n const unblockMutation = useUnblockMutationForUser('index');\n const blockDomainMutation = useBlockDomainMutationForUser('index');\n const unblockDomainMutation = useUnblockDomainMutationForUser('index');\n\n const currentAccountQuery = useAccountForUser('index', 'me');\n const {data: currentUser} = params.handle ? currentAccountQuery : {data: undefined};\n const isCurrentUser = params.handle === currentUser?.handle || !params.handle;\n\n const isBlocked = account?.blockedByMe;\n const isDomainBlocked = account?.domainBlockedByMe;\n const [viewBlockedPosts, setViewBlockedPosts] = useState(false);\n const [copied, setCopied] = useState(false);\n const copyTimeoutRef = useRef<number | null>(null);\n\n useEffect(() => () => {\n if (copyTimeoutRef.current) {\n window.clearTimeout(copyTimeoutRef.current);\n }\n }, []);\n\n const handleBlock = () => {\n if (isBlocked) {\n unblockMutation.mutate(account);\n } else {\n blockMutation.mutate(account);\n toast.success('User blocked');\n }\n setViewBlockedPosts(false);\n };\n\n const handleDomainBlock = () => {\n if (isDomainBlocked) {\n unblockDomainMutation.mutate({url: account.apId, handle: account.handle});\n } else {\n blockDomainMutation.mutate({url: account.apId, handle: account.handle});\n toast.success('Domain blocked');\n }\n setViewBlockedPosts(false);\n };\n\n const handleCopy = async () => {\n if (!account?.handle || !navigator?.clipboard?.writeText) {\n toast.error('Unable to copy handle');\n return;\n }\n try {\n await navigator.clipboard.writeText(account.handle);\n setCopied(true);\n toast.success('Handle copied');\n if (copyTimeoutRef.current) {\n window.clearTimeout(copyTimeoutRef.current);\n }\n copyTimeoutRef.current = window.setTimeout(() => setCopied(false), 2000);\n } catch {\n toast.error('Failed to copy handle');\n setCopied(false);\n }\n };\n\n const [isExpanded, setisExpanded] = useState(false);\n const [isEditingProfile, setIsEditingProfile] = useState(false);\n\n const toggleExpand = () => {\n setisExpanded(!isExpanded);\n };\n\n const contentRef = useRef<HTMLDivElement | null>(null);\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n useEffect(() => {\n if (contentRef.current) {\n setIsOverflowing(contentRef.current.scrollHeight > 160); // Compare content height to max height\n }\n }, [isExpanded, account?.bio, customFields, isLoadingAccount]);\n\n useEffect(() => {\n if (!tabSlug) {\n return;\n }\n\n if (!allowedTabs.includes(tabSlug as ProfileTab)) {\n navigate(profilePath, {replace: true});\n }\n }, [allowedTabs, profilePath, navigate, tabSlug]);\n\n const createTabPath = (tab: ProfileTab) => {\n if (tab === 'posts') {\n return profilePath;\n }\n\n return `${profilePath}/${tab}`;\n };\n\n const handleTabChange = (tab: ProfileTab) => {\n if (tab === activeTab) {\n return;\n }\n\n navigate(createTabPath(tab), {replace: true});\n };\n\n if (!isLoadingAccount && !account) {\n return (\n <Layout>\n <div className='mx-auto mt-4 flex w-full max-w-[620px] flex-col items-center [&_svg]:translate-x-px'>\n <EmptyViewIndicator>\n <EmptyViewIcon><LucideIcon.UserRoundX /></EmptyViewIcon>\n <div>Profile not found</div>\n </EmptyViewIndicator>\n </div>\n </Layout>\n );\n }\n\n return (\n <Layout>\n <div className='z-0 mx-[max(-4vw,-32px)] -mt-9 flex flex-col items-center pb-16'>\n <div className='mx-auto w-full'>\n <>\n {account?.bannerImageUrl ?\n <div className='h-[15vw] min-h-[200px] w-full overflow-hidden bg-gradient-to-tr from-gray-200 to-gray-100'>\n <img\n alt={account?.name}\n className='size-full object-cover'\n referrerPolicy='no-referrer'\n src={account?.bannerImageUrl}\n />\n </div>\n :\n <div className='h-[max(8vw,132px)] w-full overflow-hidden bg-gradient-to-tr from-white to-white dark:from-black dark:to-black'></div>\n }\n <div className={`mx-auto max-w-[620px] px-6 ${(!account?.bannerImageUrl && !canGoBack) ? '-mt-8' : '-mt-12'}`}>\n <div className='flex items-end justify-between'>\n <div className='-ml-2 rounded-full bg-white p-1 dark:bg-black'>\n {isLoadingAccount ?\n <Skeleton className='size-[92px] rounded-full' />\n :\n <APAvatar\n author={\n {\n icon: {\n url: account?.avatarUrl\n },\n name: account?.name,\n handle: account?.handle\n }\n }\n size='lg'\n />\n }\n </div>\n {!isCurrentUser && !isLoadingAccount &&\n <div className='flex gap-2'>\n {!(isBlocked || isDomainBlocked) ?\n <FollowButton\n following={account?.followedByMe}\n handle={account?.handle}\n type='primary'\n onFollow={noop}\n onUnfollow={noop}\n /> :\n <UnblockButton\n account={account}\n onDomainUnblock={handleDomainBlock}\n onUnblock={handleBlock}\n />\n }\n <ProfileMenu\n account={account}\n isBlocked={isBlocked}\n isDomainBlocked={isDomainBlocked}\n onBlockAccount={handleBlock}\n onBlockDomain={handleDomainBlock}\n onCopyHandle={handleCopy}\n >\n <Button aria-label='Open profile menu' variant='outline'><LucideIcon.Ellipsis /></Button>\n </ProfileMenu>\n </div>\n }\n {isCurrentUser && !isLoadingAccount &&\n <Dialog open={isEditingProfile} onOpenChange={setIsEditingProfile}>\n <DialogTrigger>\n <SettingAction><Button variant='secondary'>Edit profile</Button></SettingAction>\n </DialogTrigger>\n <DialogContent className='w-full max-w-[520px]' onOpenAutoFocus={e => e.preventDefault()}>\n <DialogHeader>\n <DialogTitle>Profile settings</DialogTitle>\n </DialogHeader>\n {account && <EditProfile account={account} setIsEditingProfile={setIsEditingProfile} />}\n </DialogContent>\n </Dialog>\n }\n </div>\n <H2 className='mt-4 truncate break-anywhere'>{!isLoadingAccount ? account?.name : <Skeleton className='w-32' />}</H2>\n <div className='mb-4 flex items-center gap-2'>\n <a className='inline-flex max-w-full truncate text-[1.5rem] text-gray-800 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-500' href={account?.url} rel='noopener noreferrer' target='_blank'>\n <span className='truncate'>{!isLoadingAccount ? account?.handle : <Skeleton className='w-full max-w-56' />}</span>\n </a>\n {!isLoadingAccount && (\n <Button className='-ml-1.5 size-6 p-0 text-gray-800 hover:text-gray-900 dark:text-gray-700 dark:hover:text-gray-600' title='Copy handle' variant='link' onClick={handleCopy}>\n {!copied ?\n <LucideIcon.Copy size={16} /> :\n <LucideIcon.Check size={16} />\n }\n </Button>\n )}\n {account?.followsMe && !isLoadingAccount && (\n <Badge className='mt-px whitespace-nowrap' variant='secondary'>Follows you</Badge>\n )}\n </div>\n {(account?.bio || customFields?.length > 0) && (<div ref={contentRef} className={`ap-profile-content relative text-[1.5rem] break-anywhere [&>p]:mb-3 ${isExpanded ? 'max-h-none pb-7' : 'max-h-[160px] overflow-hidden'} relative`}>\n {!isLoadingAccount ?\n <div dangerouslySetInnerHTML={{__html: sanitizeHtml(openLinksInNewTab(stripHtml(account?.bio ?? '', ['a', 'br'])))}} /> :\n <>\n <Skeleton />\n <Skeleton className='w-full max-w-48' />\n </>\n }\n {customFields?.map((attachment: {name: string, value: string}) => (\n <span className='mt-3 line-clamp-1 flex flex-col text-[1.5rem]'>\n <span className={`text-xs font-semibold`}>{attachment.name}</span>\n <span dangerouslySetInnerHTML={{__html: sanitizeHtml(attachment.value)}} className='ap-profile-content truncate'/>\n </span>\n ))}\n {!isExpanded && isOverflowing && (\n <div className='absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/100 via-60% to-transparent dark:from-black dark:via-black/100' />\n )}\n {isOverflowing && <Button\n className='absolute bottom-0 h-auto p-0 text-md'\n variant='link'\n onClick={toggleExpand}\n >{isExpanded ? 'Show less' : 'Show all'}</Button>}\n </div>)}\n <Tabs\n key={params.handle || account?.handle || 'current-user'}\n className='mt-5'\n value={activeTab}\n variant='underline'\n onValueChange={value => handleTabChange(value as ProfileTab)}\n >\n <TabsList>\n <TabsTrigger value=\"posts\">Posts</TabsTrigger>\n {likesEnabled && <TabsTrigger value=\"likes\">\n Likes\n <TabsTriggerCount>{abbreviateNumber(account?.likedCount || 0)}</TabsTriggerCount>\n </TabsTrigger>}\n <TabsTrigger value=\"following\">\n Following\n <TabsTriggerCount>{abbreviateNumber(account?.followingCount || 0)}</TabsTriggerCount>\n </TabsTrigger>\n <TabsTrigger value=\"followers\">\n Followers\n <TabsTriggerCount>{abbreviateNumber(account?.followerCount || 0)}</TabsTriggerCount>\n </TabsTrigger>\n </TabsList>\n <TabsContent value='posts'>\n {((isBlocked || isDomainBlocked) && !viewBlockedPosts) ?\n <NoValueLabel>\n <NoValueLabelIcon><LucideIcon.Ban /></NoValueLabelIcon>\n <div className='mt-2 flex flex-col items-center gap-0.5'>\n <H4>{account.name} is blocked</H4>\n <p>You can view the posts, but it won&apos;t unblock the user.</p>\n <Button className='mt-4' variant='secondary' onClick={() => setViewBlockedPosts(true)}>View posts</Button>\n </div>\n </NoValueLabel> :\n postsTab\n }\n </TabsContent>\n {likesEnabled && <TabsContent value='likes'>\n {likesTab}\n </TabsContent>}\n <TabsContent value='following'>\n {followingTab}\n </TabsContent>\n <TabsContent value='followers'>\n {followersTab}\n </TabsContent>\n </Tabs>\n </div>\n </>\n </div>\n </div>\n </Layout>\n );\n};\n\nexport default ProfilePage;\n","import ActorList from './components/actor-list';\nimport AppError from '@components/layout/error';\nimport Likes from './components/likes';\nimport Posts from './components/posts';\nimport ProfilePage from './components/profile-page';\nimport React, {useEffect} from 'react';\nimport {Activity, isApiError} from '@src/api/activitypub';\nimport {useAccountFollowsForUser, useAccountForUser, usePostsByAccount, usePostsLikedByAccount} from '@hooks/use-activity-pub-queries';\nimport {useParams} from '@tryghost/admin-x-framework';\n\nexport type ProfileTab = 'posts' | 'likes' | 'following' | 'followers';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\ninterface ProfileProps {}\n\nconst PostsTab:React.FC<{handle: string}> = ({handle}) => {\n const {postsByAccountQuery} = usePostsByAccount(handle ? handle : 'me', {enabled: true});\n\n const {\n data,\n fetchNextPage,\n hasNextPage,\n isFetchingNextPage,\n isLoading\n } = postsByAccountQuery;\n\n const posts = data?.pages.flatMap((page: {posts: Activity[]}) => page.posts) ?? Array.from({length: 5}, (_, index) => ({id: `placeholder-${index}`, object: {}}));\n\n return <Posts\n fetchNextPage={fetchNextPage}\n hasNextPage={hasNextPage!}\n isFetchingNextPage={isFetchingNextPage}\n isLoading={isLoading}\n noResultsMessage={handle ? `${handle} hasn't posted anything yet` : `You haven't posted anything yet.`}\n posts={posts}\n />;\n};\n\nconst LikesTab: React.FC = () => {\n const {postsLikedByAccountQuery} = usePostsLikedByAccount({enabled: true});\n const {data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading} = postsLikedByAccountQuery;\n\n const posts = data?.pages.flatMap(page => page.posts) ?? Array.from({length: 5}, (_, index) => ({id: `placeholder-${index}`, object: {}}));\n\n return <Likes\n fetchNextPage={fetchNextPage}\n hasNextPage={hasNextPage!}\n isFetchingNextPage={isFetchingNextPage}\n isLoading={isLoading}\n posts={posts}\n />;\n};\n\nconst FollowingTab: React.FC<{handle: string}> = ({handle}) => {\n const accountQuery = useAccountFollowsForUser(handle === '' ? 'me' : handle, 'following');\n\n const {\n data,\n fetchNextPage,\n hasNextPage,\n isFetchingNextPage,\n isLoading\n } = accountQuery;\n\n const actors = data?.pages.flatMap((page) => {\n if ('following' in page) {\n return page.following;\n } else if ('accounts' in page) {\n return page.accounts.map(account => ({\n actor: {\n id: account.id,\n name: account.name,\n handle: account.handle,\n icon: {\n url: account.avatarUrl\n }\n },\n isFollowing: account.isFollowing,\n blockedByMe: account.blockedByMe,\n domainBlockedByMe: account.domainBlockedByMe\n }));\n }\n return [];\n }) ?? [];\n\n return (\n <ActorList\n actors={actors}\n fetchNextPage={fetchNextPage}\n hasNextPage={hasNextPage!}\n isFetchingNextPage={isFetchingNextPage}\n isLoading={isLoading}\n noResultsMessage={`${handle || 'You'} have no following`}\n />\n );\n};\n\nconst FollowersTab: React.FC<{handle: string}> = ({handle}) => {\n const accountQuery = useAccountFollowsForUser(handle === '' ? 'me' : handle, 'followers');\n\n const {\n data,\n fetchNextPage,\n hasNextPage,\n isFetchingNextPage,\n isLoading\n } = accountQuery;\n\n const actors = data?.pages.flatMap((page) => {\n if ('followers' in page) {\n return page.followers;\n } else if ('accounts' in page) {\n return page.accounts.map(account => ({\n actor: {\n id: account.id,\n name: account.name,\n handle: account.handle,\n icon: {\n url: account.avatarUrl\n }\n },\n isFollowing: account.isFollowing\n }));\n }\n return [];\n }) ?? [];\n\n return (\n <ActorList\n actors={actors}\n fetchNextPage={fetchNextPage}\n hasNextPage={hasNextPage!}\n isFetchingNextPage={isFetchingNextPage}\n isLoading={isLoading}\n noResultsMessage={`${handle || 'You'} have no followers yet`}\n />\n );\n};\n\nconst Profile: React.FC<ProfileProps> = ({}) => {\n const params = useParams();\n\n const {data: account, isLoading: isLoadingAccount, error: accountError, refetch} = useAccountForUser('index', (params.handle || 'me'));\n\n useEffect(() => {\n refetch();\n }, [params.handle, refetch]);\n\n if (accountError && isApiError(accountError) && accountError.statusCode !== 404) {\n return <AppError errorCode={accountError.code} statusCode={accountError.statusCode} />;\n }\n\n const customFields = Object.keys(account?.customFields || {}).map((key) => {\n return {\n name: key,\n value: account!.customFields[key]\n };\n }) || [];\n\n const postsTab = <PostsTab handle={params.handle || ''} />;\n const likesTab = <LikesTab />;\n const followingTab = <FollowingTab handle={params.handle || ''} />;\n const followersTab = <FollowersTab handle={params.handle || ''} />;\n\n return <ProfilePage\n account={account!}\n customFields={customFields}\n followersTab={followersTab}\n followingTab={followingTab}\n isLoadingAccount={isLoadingAccount}\n likesTab={likesTab}\n postsTab={postsTab}\n />;\n};\n\nexport default Profile;\n"],"names":["__iconNode","Pencil","createLucideIcon","UserRoundX","getName","actor","ActorList","noResultsMessage","actors","isLoading","fetchNextPage","hasNextPage","isFetchingNextPage","currentAccountQuery","useAccountForUser","currentUser","observerRef","useRef","loadMoreRef","useEffect","entries","navigate","useNavigateWithBasePath","jsxs","NoValueLabel","jsx","NoValueLabelIcon","LucideIcon.UserRoundPlus","isFollowing","blockedByMe","domainBlockedByMe","actorHandle","getUsername","isCurrentUser","React","ProfilePreviewHoverCard","ActivityItem","handleProfileClick","APAvatar","Button","FollowButton","LoadingIndicator","Likes","posts","endLoadMoreRef","loadMoreIndex","Fragment","LucideIcon.Heart","activity","index","FeedItem","Separator","Posts","LucideIcon.Pencil","UnblockDialog","handle","isUserBlocked","isDomainBlocked","onUnblockUser","onUnblockDomain","trigger","onUnblockComplete","externalIsOpen","externalOnOpenChange","internalDialogOpen","setInternalDialogOpen","useState","dialogState","setDialogState","bothBlocked","userOnlyBlocked","domainOnlyBlocked","mode","isControlled","dialogOpen","wasOpened","setWasOpened","initializeDialogState","useCallback","prev","handleDialogOpen","handleDialogClose","open","handleUnblock","toast","handleDomainUnblock","domain","renderDualView","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","H4","LucideIcon.User","LucideIcon.Globe","AlertDialogFooter","renderSingleView","isUserBlock","AlertDialogCancel","AlertDialog","AlertDialogTrigger","AlertDialogContent","ProfileMenu","account","children","onCopyHandle","onBlockAccount","onBlockDomain","disabled","isBlocked","dialogType","setDialogType","setDialogOpen","handleCopyHandleClick","e","handleBlockAccountClick","handleBlockDomainClick","renderBlockView","AlertDialogAction","buttonVariants","renderUnblockView","Popover","PopoverTrigger","PopoverContent","PopoverClose","UnblockButton","onUnblock","onDomainUnblock","className","isHovered","setIsHovered","noop","ProfilePage","customFields","isLoadingAccount","postsTab","likesTab","followingTab","followersTab","params","useParams","location","useLocation","canGoBack","useNavigationStack","profilePath","likesEnabled","tabSlug","allowedTabs","useMemo","activeTab","blockMutation","useBlockMutationForUser","unblockMutation","useUnblockMutationForUser","blockDomainMutation","useBlockDomainMutationForUser","unblockDomainMutation","useUnblockDomainMutationForUser","viewBlockedPosts","setViewBlockedPosts","copied","setCopied","copyTimeoutRef","handleBlock","handleDomainBlock","handleCopy","_a","isExpanded","setisExpanded","isEditingProfile","setIsEditingProfile","toggleExpand","contentRef","isOverflowing","setIsOverflowing","createTabPath","tab","handleTabChange","Layout","EmptyViewIndicator","EmptyViewIcon","LucideIcon.UserRoundX","Skeleton","LucideIcon.Ellipsis","Dialog","DialogTrigger","SettingAction","DialogContent","DialogHeader","DialogTitle","EditProfile","H2","LucideIcon.Check","LucideIcon.Copy","Badge","sanitizeHtml","openLinksInNewTab","stripHtml","attachment","Tabs","value","TabsList","TabsTrigger","TabsTriggerCount","abbreviateNumber","TabsContent","LucideIcon.Ban","PostsTab","postsByAccountQuery","usePostsByAccount","data","page","_","LikesTab","postsLikedByAccountQuery","usePostsLikedByAccount","FollowingTab","accountQuery","useAccountFollowsForUser","FollowersTab","Profile","accountError","refetch","isApiError","AppError","key"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAC5C,GACMC,KAASC,GAAiB,UAAUF,EAAU;ACnBpD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,KAAK,GAAG,KAAK,KAAK,UAAU;AAAA,EACvD,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAAA,EAC3C,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMG,KAAaD,GAAiB,gBAAgBF,EAAU;ACf9D,SAAwBI,GAAQC,GAA4D;AACxF,SAAI,OAAOA,EAAM,QAAS,WACfA,EAAM,OAEb,OAAOA,EAAM,qBAAsB,WAC5BA,EAAM,oBAEb,OAAOA,EAAM,qBAAsB,YAAYA,EAAM,sBAAsB,QACvE,YAAYA,EAAM,qBACd,OAAOA,EAAM,kBAAkB,QAAQ,KAAM,WACtCA,EAAM,kBAAkB,QAAQ,IAI5C;AACX;ACOA,MAAMC,KAAsC,CAAC;AAAA,EACzC,kBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AACJ,MAAM;AACF,QAAMC,IA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,KAAkC,CAAC,CAAA,MAAO;AAC5C,QAAMlF,IAASC,GAAA,GAET,EAAC,MAAMrC,GAAS,WAAW+B,GAAkB,OAAOwF,GAAc,SAAAC,EAAA,IAAWhN,EAAkB,SAAU4H,EAAO,UAAU,IAAK;AAMrI,MAJAvH,EAAU,MAAM;AACZ,IAAA2M,EAAA;AAAA,EACJ,GAAG,CAACpF,EAAO,QAAQoF,CAAO,CAAC,GAEvBD,KAAgBE,GAAWF,CAAY,KAAKA,EAAa,eAAe;AACxE,iCAAQG,IAAA,EAAS,WAAWH,EAAa,MAAM,YAAYA,EAAa,YAAY;AAGxF,QAAMzF,IAAe,OAAO,MAAK9B,KAAA,gBAAAA,EAAS,iBAAgB,EAAE,EAAE,IAAI,CAAC2H,OACxD;AAAA,IACH,MAAMA;AAAA,IACN,OAAO3H,EAAS,aAAa2H,CAAG;AAAA,EAAA,EAEvC,KAAK,CAAA,GAEA3F,IAAW7G,gBAAAA,EAAAA,IAACsL,IAAA,EAAS,QAAQrE,EAAO,UAAU,IAAI,GAClDH,0BAAY8E,IAAA,EAAS,GACrB7E,IAAe/G,gBAAAA,EAAAA,IAAC+L,IAAA,EAAa,QAAQ9E,EAAO,UAAU,IAAI,GAC1DD,IAAehH,gBAAAA,EAAAA,IAACkM,IAAA,EAAa,QAAQjF,EAAO,UAAU,IAAI;AAEhE,SAAOjH,gBAAAA,EAAAA;AAAAA,IAAC0G;AAAA,IAAA;AAAA,MACJ,SAAA7B;AAAA,MACA,cAAA8B;AAAA,MACA,cAAAK;AAAA,MACA,cAAAD;AAAA,MACA,kBAAAH;AAAA,MACA,UAAAE;AAAA,MACA,UAAAD;AAAA,IAAA;AAAA,EAAA;AAER;","x_google_ignoreList":[0,1]}
@@ -1,4 +1,4 @@
1
- import { ae as U, R as g, af as D, j as d, ag as G, ah as X, ai as Z, aj as P, ak as ee, e as k, al as B, am as x, c as L, an as te, b as K, ao as oe, W as y } from "./index-DIicyWvr.mjs";
1
+ import { ae as U, R as g, af as D, j as d, ag as G, ah as X, ai as Z, aj as P, ak as ee, e as k, al as B, am as x, c as L, an as te, b as K, ao as oe, W as y } from "./index-q4Ygdo0-.mjs";
2
2
  function ne(e) {
3
3
  const o = e + "CollectionProvider", [i, r] = U(o), [w, I] = i(
4
4
  o,
@@ -216,4 +216,4 @@ export {
216
216
  Ce as c,
217
217
  ce as u
218
218
  };
219
- //# sourceMappingURL=index-BvOcRwis.mjs.map
219
+ //# sourceMappingURL=index-CVvjItO-.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-BvOcRwis.mjs","sources":["../../../node_modules/@radix-ui/react-collection/dist/index.mjs","../../../node_modules/@radix-ui/react-direction/dist/index.mjs","../../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/collection-legacy.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\n\n// src/collection.tsx\nimport React2 from \"react\";\nimport { createContextScope as createContextScope2 } from \"@radix-ui/react-context\";\nimport { useComposedRefs as useComposedRefs2 } from \"@radix-ui/react-compose-refs\";\nimport { createSlot as createSlot2 } from \"@radix-ui/react-slot\";\n\n// src/ordered-dictionary.ts\nvar __instanciated = /* @__PURE__ */ new WeakMap();\nvar OrderedDict = class _OrderedDict extends Map {\n #keys;\n constructor(entries) {\n super(entries);\n this.#keys = [...super.keys()];\n __instanciated.set(this, true);\n }\n set(key, value) {\n if (__instanciated.get(this)) {\n if (this.has(key)) {\n this.#keys[this.#keys.indexOf(key)] = key;\n } else {\n this.#keys.push(key);\n }\n }\n super.set(key, value);\n return this;\n }\n insert(index, key, value) {\n const has = this.has(key);\n const length = this.#keys.length;\n const relativeIndex = toSafeInteger(index);\n let actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n const safeIndex = actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {\n this.set(key, value);\n return this;\n }\n const size = this.size + (has ? 0 : 1);\n if (relativeIndex < 0) {\n actualIndex++;\n }\n const keys = [...this.#keys];\n let nextValue;\n let shouldSkip = false;\n for (let i = actualIndex; i < size; i++) {\n if (actualIndex === i) {\n let nextKey = keys[i];\n if (keys[i] === key) {\n nextKey = keys[i + 1];\n }\n if (has) {\n this.delete(key);\n }\n nextValue = this.get(nextKey);\n this.set(key, value);\n } else {\n if (!shouldSkip && keys[i - 1] === key) {\n shouldSkip = true;\n }\n const currentKey = keys[shouldSkip ? i : i - 1];\n const currentValue = nextValue;\n nextValue = this.get(currentKey);\n this.delete(currentKey);\n this.set(currentKey, currentValue);\n }\n }\n return this;\n }\n with(index, key, value) {\n const copy = new _OrderedDict(this);\n copy.insert(index, key, value);\n return copy;\n }\n before(key) {\n const index = this.#keys.indexOf(key) - 1;\n if (index < 0) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position before the given key.\n */\n setBefore(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index, newKey, value);\n }\n after(key) {\n let index = this.#keys.indexOf(key);\n index = index === -1 || index === this.size - 1 ? -1 : index + 1;\n if (index === -1) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position after the given key.\n */\n setAfter(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index + 1, newKey, value);\n }\n first() {\n return this.entryAt(0);\n }\n last() {\n return this.entryAt(-1);\n }\n clear() {\n this.#keys = [];\n return super.clear();\n }\n delete(key) {\n const deleted = super.delete(key);\n if (deleted) {\n this.#keys.splice(this.#keys.indexOf(key), 1);\n }\n return deleted;\n }\n deleteAt(index) {\n const key = this.keyAt(index);\n if (key !== void 0) {\n return this.delete(key);\n }\n return false;\n }\n at(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return this.get(key);\n }\n }\n entryAt(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return [key, this.get(key)];\n }\n }\n indexOf(key) {\n return this.#keys.indexOf(key);\n }\n keyAt(index) {\n return at(this.#keys, index);\n }\n from(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.at(dest);\n }\n keyFrom(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.keyAt(dest);\n }\n find(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return entry;\n }\n index++;\n }\n return void 0;\n }\n findIndex(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return index;\n }\n index++;\n }\n return -1;\n }\n filter(predicate, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n entries.push(entry);\n }\n index++;\n }\n return new _OrderedDict(entries);\n }\n map(callbackfn, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index, this])]);\n index++;\n }\n return new _OrderedDict(entries);\n }\n reduce(...args) {\n const [callbackfn, initialValue] = args;\n let index = 0;\n let accumulator = initialValue ?? this.at(0);\n for (const entry of this) {\n if (index === 0 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n index++;\n }\n return accumulator;\n }\n reduceRight(...args) {\n const [callbackfn, initialValue] = args;\n let accumulator = initialValue ?? this.at(-1);\n for (let index = this.size - 1; index >= 0; index--) {\n const entry = this.at(index);\n if (index === this.size - 1 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n }\n return accumulator;\n }\n toSorted(compareFn) {\n const entries = [...this.entries()].sort(compareFn);\n return new _OrderedDict(entries);\n }\n toReversed() {\n const reversed = new _OrderedDict();\n for (let index = this.size - 1; index >= 0; index--) {\n const key = this.keyAt(index);\n const element = this.get(key);\n reversed.set(key, element);\n }\n return reversed;\n }\n toSpliced(...args) {\n const entries = [...this.entries()];\n entries.splice(...args);\n return new _OrderedDict(entries);\n }\n slice(start, end) {\n const result = new _OrderedDict();\n let stop = this.size - 1;\n if (start === void 0) {\n return result;\n }\n if (start < 0) {\n start = start + this.size;\n }\n if (end !== void 0 && end > 0) {\n stop = end - 1;\n }\n for (let index = start; index <= stop; index++) {\n const key = this.keyAt(index);\n const element = this.get(key);\n result.set(key, element);\n }\n return result;\n }\n every(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (!Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return false;\n }\n index++;\n }\n return true;\n }\n some(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return true;\n }\n index++;\n }\n return false;\n }\n};\nfunction at(array, index) {\n if (\"at\" in Array.prototype) {\n return Array.prototype.at.call(array, index);\n }\n const actualIndex = toSafeIndex(array, index);\n return actualIndex === -1 ? void 0 : array[actualIndex];\n}\nfunction toSafeIndex(array, index) {\n const length = array.length;\n const relativeIndex = toSafeInteger(index);\n const actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n}\nfunction toSafeInteger(number) {\n return number !== number || number === 0 ? 0 : Math.trunc(number);\n}\n\n// src/collection.tsx\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nfunction createCollection2(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope2(PROVIDER_NAME);\n const [CollectionContextProvider, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n {\n collectionElement: null,\n collectionRef: { current: null },\n collectionRefObject: { current: null },\n itemMap: new OrderedDict(),\n setItemMap: () => void 0\n }\n );\n const CollectionProvider = ({ state, ...props }) => {\n return state ? /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ jsx2(CollectionInit, { ...props });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const CollectionInit = (props) => {\n const state = useInitCollection();\n return /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state });\n };\n CollectionInit.displayName = PROVIDER_NAME + \"Init\";\n const CollectionProviderImpl = (props) => {\n const { scope, children, state } = props;\n const ref = React2.useRef(null);\n const [collectionElement, setCollectionElement] = React2.useState(\n null\n );\n const composeRefs = useComposedRefs2(ref, setCollectionElement);\n const [itemMap, setItemMap] = state;\n React2.useEffect(() => {\n if (!collectionElement) return;\n const observer = getChildListObserver(() => {\n });\n observer.observe(collectionElement, {\n childList: true,\n subtree: true\n });\n return () => {\n observer.disconnect();\n };\n }, [collectionElement]);\n return /* @__PURE__ */ jsx2(\n CollectionContextProvider,\n {\n scope,\n itemMap,\n setItemMap,\n collectionRef: composeRefs,\n collectionRefObject: ref,\n collectionElement,\n children\n }\n );\n };\n CollectionProviderImpl.displayName = PROVIDER_NAME + \"Impl\";\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);\n const CollectionSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx2(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);\n const CollectionItemSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React2.useRef(null);\n const [element, setElement] = React2.useState(null);\n const composedRefs = useComposedRefs2(forwardedRef, ref, setElement);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n const { setItemMap } = context;\n const itemDataRef = React2.useRef(itemData);\n if (!shallowEqual(itemDataRef.current, itemData)) {\n itemDataRef.current = itemData;\n }\n const memoizedItemData = itemDataRef.current;\n React2.useEffect(() => {\n const itemData2 = memoizedItemData;\n setItemMap((map) => {\n if (!element) {\n return map;\n }\n if (!map.has(element)) {\n map.set(element, { ...itemData2, element });\n return map.toSorted(sortByDocumentPosition);\n }\n return map.set(element, { ...itemData2, element }).toSorted(sortByDocumentPosition);\n });\n return () => {\n setItemMap((map) => {\n if (!element || !map.has(element)) {\n return map;\n }\n map.delete(element);\n return new OrderedDict(map);\n });\n };\n }, [element, memoizedItemData, setItemMap]);\n return /* @__PURE__ */ jsx2(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useInitCollection() {\n return React2.useState(new OrderedDict());\n }\n function useCollection(scope) {\n const { itemMap } = useCollectionContext(name + \"CollectionConsumer\", scope);\n return itemMap;\n }\n const functions = {\n createCollectionScope,\n useCollection,\n useInitCollection\n };\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n functions\n ];\n}\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n if (typeof a !== \"object\" || typeof b !== \"object\") return false;\n if (a == null || b == null) return false;\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n for (const key of keysA) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) return false;\n if (a[key] !== b[key]) return false;\n }\n return true;\n}\nfunction isElementPreceding(a, b) {\n return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);\n}\nfunction sortByDocumentPosition(a, b) {\n return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;\n}\nfunction getChildListObserver(callback) {\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === \"childList\") {\n callback();\n return;\n }\n }\n });\n return observer;\n}\nexport {\n createCollection,\n createCollection2 as unstable_createCollection\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/direction/src/direction.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DirectionContext = React.createContext(void 0);\nvar DirectionProvider = (props) => {\n const { dir, children } = props;\n return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });\n};\nfunction useDirection(localDir) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || \"ltr\";\n}\nvar Provider = DirectionProvider;\nexport {\n DirectionProvider,\n Provider,\n useDirection\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlotImpl","createSlot","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlotImpl","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b","DirectionContext","React.createContext","useDirection","localDir","globalDir","React.useContext","ENTRY_FOCUS","EVENT_OPTIONS","GROUP_NAME","Collection","createRovingFocusGroupContext","createRovingFocusGroupScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React.forwardRef","RovingFocusGroupImpl","__scopeRovingFocusGroup","orientation","loop","dir","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","React.useRef","direction","currentTabStopId","setCurrentTabStopId","useControllableState","isTabbingBackOut","setIsTabbingBackOut","React.useState","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","React.useEffect","node","React.useCallback","tabStopId","prevCount","Primitive","composeEventHandlers","event","isKeyboardFocus","entryFocusEvent","items","item","activeItem","currentItem","candidateNodes","focusFirst","ITEM_NAME","RovingFocusGroupItem","focusable","active","itemProps","autoId","useId","id","isCurrentTabStop","onFocusableItemAdd","onFocusableItemRemove","focusIntent","getFocusIntent","currentIndex","wrapArray","MAP_KEY_TO_FOCUS_INTENT","getDirectionAwareKey","key","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","candidate","array","startIndex","_","index","Root","Item"],"mappings":";AAQA,SAASA,GAAiBC,GAAM;AAC9B,QAAMC,IAAgBD,IAAO,sBACvB,CAACE,GAAyBC,CAAqB,IAAIC,EAAmBH,CAAa,GACnF,CAACI,GAAwBC,CAAoB,IAAIJ;AAAA,IACrDD;AAAA,IACA,EAAE,eAAe,EAAE,SAAS,KAAI,GAAI,SAAyB,oBAAI,IAAG,EAAE;AAAA,EAC1E,GACQM,IAAqB,CAACC,MAAU;AACpC,UAAM,EAAE,OAAAC,GAAO,UAAAC,EAAQ,IAAKF,GACtBG,IAAMC,EAAM,OAAO,IAAI,GACvBC,IAAUD,EAA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AQ,cAAc,eAAeA,MAAQ,eAAe,cAAcA;AACnF;AACA,SAASL,GAAerB,GAAO9B,GAAaE,GAAK;AAC/C,QAAMsD,IAAMD,GAAqBzB,EAAM,KAAK5B,CAAG;AAC/C,MAAI,EAAAF,MAAgB,cAAc,CAAC,aAAa,YAAY,EAAE,SAASwD,CAAG,MACtE,EAAAxD,MAAgB,gBAAgB,CAAC,WAAW,WAAW,EAAE,SAASwD,CAAG;AACzE,WAAOF,GAAwBE,CAAG;AACpC;AACA,SAASlB,EAAWmB,GAAYC,IAAgB,IAAO;AACrD,QAAMC,IAA6B,SAAS;AAC5C,aAAWC,KAAaH;AAGtB,QAFIG,MAAcD,MAClBC,EAAU,MAAM,EAAE,eAAAF,GAAe,GAC7B,SAAS,kBAAkBC,GAA4B;AAE/D;AACA,SAASN,GAAUQ,GAAOC,GAAY;AACpC,SAAOD,EAAM,IAAI,CAACE,GAAGC,MAAUH,GAAOC,IAAaE,KAASH,EAAM,MAAM,CAAC;AAC3E;AACG,IAACI,KAAOrE,GACPsE,KAAO1B;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"index-CVvjItO-.mjs","sources":["../../../node_modules/@radix-ui/react-collection/dist/index.mjs","../../../node_modules/@radix-ui/react-direction/dist/index.mjs","../../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/collection-legacy.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\n\n// src/collection.tsx\nimport React2 from \"react\";\nimport { createContextScope as createContextScope2 } from \"@radix-ui/react-context\";\nimport { useComposedRefs as useComposedRefs2 } from \"@radix-ui/react-compose-refs\";\nimport { createSlot as createSlot2 } from \"@radix-ui/react-slot\";\n\n// src/ordered-dictionary.ts\nvar __instanciated = /* @__PURE__ */ new WeakMap();\nvar OrderedDict = class _OrderedDict extends Map {\n #keys;\n constructor(entries) {\n super(entries);\n this.#keys = [...super.keys()];\n __instanciated.set(this, true);\n }\n set(key, value) {\n if (__instanciated.get(this)) {\n if (this.has(key)) {\n this.#keys[this.#keys.indexOf(key)] = key;\n } else {\n this.#keys.push(key);\n }\n }\n super.set(key, value);\n return this;\n }\n insert(index, key, value) {\n const has = this.has(key);\n const length = this.#keys.length;\n const relativeIndex = toSafeInteger(index);\n let actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n const safeIndex = actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {\n this.set(key, value);\n return this;\n }\n const size = this.size + (has ? 0 : 1);\n if (relativeIndex < 0) {\n actualIndex++;\n }\n const keys = [...this.#keys];\n let nextValue;\n let shouldSkip = false;\n for (let i = actualIndex; i < size; i++) {\n if (actualIndex === i) {\n let nextKey = keys[i];\n if (keys[i] === key) {\n nextKey = keys[i + 1];\n }\n if (has) {\n this.delete(key);\n }\n nextValue = this.get(nextKey);\n this.set(key, value);\n } else {\n if (!shouldSkip && keys[i - 1] === key) {\n shouldSkip = true;\n }\n const currentKey = keys[shouldSkip ? i : i - 1];\n const currentValue = nextValue;\n nextValue = this.get(currentKey);\n this.delete(currentKey);\n this.set(currentKey, currentValue);\n }\n }\n return this;\n }\n with(index, key, value) {\n const copy = new _OrderedDict(this);\n copy.insert(index, key, value);\n return copy;\n }\n before(key) {\n const index = this.#keys.indexOf(key) - 1;\n if (index < 0) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position before the given key.\n */\n setBefore(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index, newKey, value);\n }\n after(key) {\n let index = this.#keys.indexOf(key);\n index = index === -1 || index === this.size - 1 ? -1 : index + 1;\n if (index === -1) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position after the given key.\n */\n setAfter(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index + 1, newKey, value);\n }\n first() {\n return this.entryAt(0);\n }\n last() {\n return this.entryAt(-1);\n }\n clear() {\n this.#keys = [];\n return super.clear();\n }\n delete(key) {\n const deleted = super.delete(key);\n if (deleted) {\n this.#keys.splice(this.#keys.indexOf(key), 1);\n }\n return deleted;\n }\n deleteAt(index) {\n const key = this.keyAt(index);\n if (key !== void 0) {\n return this.delete(key);\n }\n return false;\n }\n at(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return this.get(key);\n }\n }\n entryAt(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return [key, this.get(key)];\n }\n }\n indexOf(key) {\n return this.#keys.indexOf(key);\n }\n keyAt(index) {\n return at(this.#keys, index);\n }\n from(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.at(dest);\n }\n keyFrom(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.keyAt(dest);\n }\n find(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return entry;\n }\n index++;\n }\n return void 0;\n }\n findIndex(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return index;\n }\n index++;\n }\n return -1;\n }\n filter(predicate, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n entries.push(entry);\n }\n index++;\n }\n return new _OrderedDict(entries);\n }\n map(callbackfn, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index, this])]);\n index++;\n }\n return new _OrderedDict(entries);\n }\n reduce(...args) {\n const [callbackfn, initialValue] = args;\n let index = 0;\n let accumulator = initialValue ?? this.at(0);\n for (const entry of this) {\n if (index === 0 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n index++;\n }\n return accumulator;\n }\n reduceRight(...args) {\n const [callbackfn, initialValue] = args;\n let accumulator = initialValue ?? this.at(-1);\n for (let index = this.size - 1; index >= 0; index--) {\n const entry = this.at(index);\n if (index === this.size - 1 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n }\n return accumulator;\n }\n toSorted(compareFn) {\n const entries = [...this.entries()].sort(compareFn);\n return new _OrderedDict(entries);\n }\n toReversed() {\n const reversed = new _OrderedDict();\n for (let index = this.size - 1; index >= 0; index--) {\n const key = this.keyAt(index);\n const element = this.get(key);\n reversed.set(key, element);\n }\n return reversed;\n }\n toSpliced(...args) {\n const entries = [...this.entries()];\n entries.splice(...args);\n return new _OrderedDict(entries);\n }\n slice(start, end) {\n const result = new _OrderedDict();\n let stop = this.size - 1;\n if (start === void 0) {\n return result;\n }\n if (start < 0) {\n start = start + this.size;\n }\n if (end !== void 0 && end > 0) {\n stop = end - 1;\n }\n for (let index = start; index <= stop; index++) {\n const key = this.keyAt(index);\n const element = this.get(key);\n result.set(key, element);\n }\n return result;\n }\n every(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (!Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return false;\n }\n index++;\n }\n return true;\n }\n some(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return true;\n }\n index++;\n }\n return false;\n }\n};\nfunction at(array, index) {\n if (\"at\" in Array.prototype) {\n return Array.prototype.at.call(array, index);\n }\n const actualIndex = toSafeIndex(array, index);\n return actualIndex === -1 ? void 0 : array[actualIndex];\n}\nfunction toSafeIndex(array, index) {\n const length = array.length;\n const relativeIndex = toSafeInteger(index);\n const actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n}\nfunction toSafeInteger(number) {\n return number !== number || number === 0 ? 0 : Math.trunc(number);\n}\n\n// src/collection.tsx\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nfunction createCollection2(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope2(PROVIDER_NAME);\n const [CollectionContextProvider, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n {\n collectionElement: null,\n collectionRef: { current: null },\n collectionRefObject: { current: null },\n itemMap: new OrderedDict(),\n setItemMap: () => void 0\n }\n );\n const CollectionProvider = ({ state, ...props }) => {\n return state ? /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ jsx2(CollectionInit, { ...props });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const CollectionInit = (props) => {\n const state = useInitCollection();\n return /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state });\n };\n CollectionInit.displayName = PROVIDER_NAME + \"Init\";\n const CollectionProviderImpl = (props) => {\n const { scope, children, state } = props;\n const ref = React2.useRef(null);\n const [collectionElement, setCollectionElement] = React2.useState(\n null\n );\n const composeRefs = useComposedRefs2(ref, setCollectionElement);\n const [itemMap, setItemMap] = state;\n React2.useEffect(() => {\n if (!collectionElement) return;\n const observer = getChildListObserver(() => {\n });\n observer.observe(collectionElement, {\n childList: true,\n subtree: true\n });\n return () => {\n observer.disconnect();\n };\n }, [collectionElement]);\n return /* @__PURE__ */ jsx2(\n CollectionContextProvider,\n {\n scope,\n itemMap,\n setItemMap,\n collectionRef: composeRefs,\n collectionRefObject: ref,\n collectionElement,\n children\n }\n );\n };\n CollectionProviderImpl.displayName = PROVIDER_NAME + \"Impl\";\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);\n const CollectionSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx2(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);\n const CollectionItemSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React2.useRef(null);\n const [element, setElement] = React2.useState(null);\n const composedRefs = useComposedRefs2(forwardedRef, ref, setElement);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n const { setItemMap } = context;\n const itemDataRef = React2.useRef(itemData);\n if (!shallowEqual(itemDataRef.current, itemData)) {\n itemDataRef.current = itemData;\n }\n const memoizedItemData = itemDataRef.current;\n React2.useEffect(() => {\n const itemData2 = memoizedItemData;\n setItemMap((map) => {\n if (!element) {\n return map;\n }\n if (!map.has(element)) {\n map.set(element, { ...itemData2, element });\n return map.toSorted(sortByDocumentPosition);\n }\n return map.set(element, { ...itemData2, element }).toSorted(sortByDocumentPosition);\n });\n return () => {\n setItemMap((map) => {\n if (!element || !map.has(element)) {\n return map;\n }\n map.delete(element);\n return new OrderedDict(map);\n });\n };\n }, [element, memoizedItemData, setItemMap]);\n return /* @__PURE__ */ jsx2(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useInitCollection() {\n return React2.useState(new OrderedDict());\n }\n function useCollection(scope) {\n const { itemMap } = useCollectionContext(name + \"CollectionConsumer\", scope);\n return itemMap;\n }\n const functions = {\n createCollectionScope,\n useCollection,\n useInitCollection\n };\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n functions\n ];\n}\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n if (typeof a !== \"object\" || typeof b !== \"object\") return false;\n if (a == null || b == null) return false;\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n for (const key of keysA) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) return false;\n if (a[key] !== b[key]) return false;\n }\n return true;\n}\nfunction isElementPreceding(a, b) {\n return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);\n}\nfunction sortByDocumentPosition(a, b) {\n return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;\n}\nfunction getChildListObserver(callback) {\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === \"childList\") {\n callback();\n return;\n }\n }\n });\n return observer;\n}\nexport {\n createCollection,\n createCollection2 as unstable_createCollection\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/direction/src/direction.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DirectionContext = React.createContext(void 0);\nvar DirectionProvider = (props) => {\n const { dir, children } = props;\n return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });\n};\nfunction useDirection(localDir) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || \"ltr\";\n}\nvar Provider = DirectionProvider;\nexport {\n DirectionProvider,\n Provider,\n useDirection\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlotImpl","createSlot","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlotImpl","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b","DirectionContext","React.createContext","useDirection","localDir","globalDir","React.useContext","ENTRY_FOCUS","EVENT_OPTIONS","GROUP_NAME","Collection","createRovingFocusGroupContext","createRovingFocusGroupScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React.forwardRef","RovingFocusGroupImpl","__scopeRovingFocusGroup","orientation","loop","dir","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","React.useRef","direction","currentTabStopId","setCurrentTabStopId","useControllableState","isTabbingBackOut","setIsTabbingBackOut","React.useState","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","React.useEffect","node","React.useCallback","tabStopId","prevCount","Primitive","composeEventHandlers","event","isKeyboardFocus","entryFocusEvent","items","item","activeItem","currentItem","candidateNodes","focusFirst","ITEM_NAME","RovingFocusGroupItem","focusable","active","itemProps","autoId","useId","id","isCurrentTabStop","onFocusableItemAdd","onFocusableItemRemove","focusIntent","getFocusIntent","currentIndex","wrapArray","MAP_KEY_TO_FOCUS_INTENT","getDirectionAwareKey","key","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","candidate","array","startIndex","_","index","Root","Item"],"mappings":";AAQA,SAASA,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B,YAAYpC,KAAoB,KAAI,CAAE,IAAIpD;AAAA,UAC9H;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACE;AACF;AACAiF,EAAqB,cAAcD;AACnC,IAAIe,KAA0B;AAAA,EAC5B,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,UAAU;AAAA,EACV,KAAK;AACP;AACA,SAASC,GAAqBC,GAAKtD,GAAK;AACtC,SAAIA,MAAQ,QAAcsD,IACnBA,MAAQ,cAAc,eAAeA,MAAQ,eAAe,cAAcA;AACnF;AACA,SAASL,GAAerB,GAAO9B,GAAaE,GAAK;AAC/C,QAAMsD,IAAMD,GAAqBzB,EAAM,KAAK5B,CAAG;AAC/C,MAAI,EAAAF,MAAgB,cAAc,CAAC,aAAa,YAAY,EAAE,SAASwD,CAAG,MACtE,EAAAxD,MAAgB,gBAAgB,CAAC,WAAW,WAAW,EAAE,SAASwD,CAAG;AACzE,WAAOF,GAAwBE,CAAG;AACpC;AACA,SAASlB,EAAWmB,GAAYC,IAAgB,IAAO;AACrD,QAAMC,IAA6B,SAAS;AAC5C,aAAWC,KAAaH;AAGtB,QAFIG,MAAcD,MAClBC,EAAU,MAAM,EAAE,eAAAF,GAAe,GAC7B,SAAS,kBAAkBC,GAA4B;AAE/D;AACA,SAASN,GAAUQ,GAAOC,GAAY;AACpC,SAAOD,EAAM,IAAI,CAACE,GAAGC,MAAUH,GAAOC,IAAaE,KAASH,EAAM,MAAM,CAAC;AAC3E;AACG,IAACI,KAAOrE,GACPsE,KAAO1B;","x_google_ignoreList":[0,1,2]}
@@ -1,7 +1,7 @@
1
- import { aj as cA, j as t, al as y4, c as aA, e as hA, ae as g3, W as sA, aW as E3, b as mA, ak as _5, an as g1, aE as $5, bm as A6, af as F3, aX as r6, am as VA, aV as x3, b4 as e6, b0 as t6, b1 as C6, bn as n6, b2 as s6, a6 as H3, b5 as o6, s as E1, R as iA, b6 as l6, ai as a6, ah as i6, bo as B6, bp as b2, I as M3, bq as c6, B as v3, k as u6, A as f6, S as j2, Y as h6, O as l4, Q as Q6, aw as d6, ax as p6, L as U6 } from "./index-DIicyWvr.mjs";
2
- import { c as N3, I as w6, u as g6, R as E6 } from "./index-BvOcRwis.mjs";
3
- import { C as m3 } from "./copy-DCHXVz-9.mjs";
4
- import { a as F6 } from "./settings-qNWc2HyW.mjs";
1
+ import { aj as cA, j as t, al as y4, c as aA, e as hA, ae as g3, W as sA, aW as E3, b as mA, ak as _5, an as g1, aE as $5, bm as A6, af as F3, aX as r6, am as VA, aV as x3, b4 as e6, b0 as t6, b1 as C6, bn as n6, b2 as s6, a6 as H3, b5 as o6, s as E1, R as iA, b6 as l6, ai as a6, ah as i6, bo as B6, bp as b2, I as M3, bq as c6, B as v3, k as u6, A as f6, S as j2, Y as h6, O as l4, Q as Q6, aw as d6, ax as p6, L as U6 } from "./index-q4Ygdo0-.mjs";
2
+ import { c as N3, I as w6, u as g6, R as E6 } from "./index-CVvjItO-.mjs";
3
+ import { C as m3 } from "./copy-Dg0Olymi.mjs";
4
+ import { a as F6 } from "./settings-CjuIDMTF.mjs";
5
5
  var x6 = Object.freeze({
6
6
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
7
7
  position: "absolute",
@@ -517,7 +517,7 @@ var y2 = iA.forwardRef(
517
517
  }
518
518
  ), k3 = H2, J3 = W3;
519
519
  const q3 = l6(
520
- "inline-flex items-center justify-center gap-2 rounded-sm text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm dark:hover:bg-background [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]",
520
+ "focus-visible:outline-hidden inline-flex items-center justify-center gap-2 rounded-xs text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm dark:hover:bg-background [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]",
521
521
  {
522
522
  variants: {
523
523
  variant: {
@@ -5855,7 +5855,7 @@ const Or = "SiteResponseType", Sr = B6({
5855
5855
  src: I
5856
5856
  }
5857
5857
  ) : /* @__PURE__ */ t.jsx("div", { className: "relative size-full overflow-hidden rounded-[26px] rounded-b-none", style: { background: `linear-gradient(to bottom, ${q(i === "accent" ? "#ffffff" : B || "#15171a", 1)}, ${q(i === "accent" ? "#ffffff" : B || "#15171a", 0.5)})` }, children: /* @__PURE__ */ t.jsx(e2, { className: "absolute", style: { color: i === "accent" ? q(B || "#15171a", 0.2) : "rgba(255, 255, 255, 0.2)", top: A ? "-42px" : "-84px", left: A ? "-69px" : "-138px" } }) }),
5858
- R && /* @__PURE__ */ t.jsx("div", { className: "absolute bottom-0 left-1/2 -mb-8 -translate-x-1/2 rounded-full border-8 [&>div]:!size-16 [&_img]:!size-16", style: { borderColor: d }, children: /* @__PURE__ */ t.jsx(
5858
+ R && /* @__PURE__ */ t.jsx("div", { className: "[&>div]:size-16! [&_img]:size-16! absolute bottom-0 left-1/2 -mb-8 -translate-x-1/2 rounded-full border-8", style: { borderColor: d }, children: /* @__PURE__ */ t.jsx(
5859
5859
  f6,
5860
5860
  {
5861
5861
  author: {
@@ -5871,11 +5871,11 @@ const Or = "SiteResponseType", Sr = B6({
5871
5871
  ] }),
5872
5872
  /* @__PURE__ */ t.jsxs("div", { className: `flex grow flex-col items-center p-6 ${e != null && e.avatarUrl || l ? "pt-9" : "pt-3"} text-center ${r === "square" ? "flex-1 justify-center" : ""}`, children: [
5873
5873
  /* @__PURE__ */ t.jsx(M3, { className: `${A && "tracking-normal"}`, style: { color: H }, children: C ? /* @__PURE__ */ t.jsx(j2, { className: "w-32" }) : e == null ? void 0 : e.name }),
5874
- /* @__PURE__ */ t.jsx("span", { className: `mt-1.5 leading-7 ${A && "tracking-normal"}`, style: { color: H }, children: C ? /* @__PURE__ */ t.jsx(j2, { className: "w-28" }) : "Available on Ghost, Flipboard, Threads, Bluesky, Mastodon, or wherever you get your social web feeds." }),
5874
+ /* @__PURE__ */ t.jsx("span", { className: `mt-1.5 leading-tight ${A && "tracking-normal"}`, style: { color: H }, children: C ? /* @__PURE__ */ t.jsx(j2, { className: "w-28" }) : "Available on Ghost, Flipboard, Threads, Bluesky, Mastodon, or wherever you get your social web feeds." }),
5875
5875
  /* @__PURE__ */ t.jsx(
5876
5876
  "div",
5877
5877
  {
5878
- className: `mt-auto flex max-h-[60px] min-h-12 w-full items-center justify-center break-all rounded-full border px-4 py-2 font-medium leading-7 ${A && "tracking-normal"}`,
5878
+ className: `mt-auto flex max-h-[60px] min-h-12 w-full items-center justify-center break-all rounded-full border px-4 py-2 font-medium leading-tight ${A && "tracking-normal"}`,
5879
5879
  style: {
5880
5880
  color: i !== "light" ? "#fff" : B,
5881
5881
  borderColor: B ? q(i === "accent" ? "#ffffff" : B, i !== "light" ? 0.7 : 0.2) : void 0,
@@ -6117,4 +6117,4 @@ const Dr = ({ account: A, isLoading: r }) => {
6117
6117
  export {
6118
6118
  zr as default
6119
6119
  };
6120
- //# sourceMappingURL=index-l72TqahD.mjs.map
6120
+ //# sourceMappingURL=index-Cjktkl_Z.mjs.map