@tryghost/activitypub 3.0.7 → 3.0.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 (61) hide show
  1. package/dist/activitypub.js +6 -3
  2. package/dist/{at-sign-DjgaOOtV.mjs → at-sign-Fsk3x72r.mjs} +2 -2
  3. package/dist/{at-sign-DjgaOOtV.mjs.map → at-sign-Fsk3x72r.mjs.map} +1 -1
  4. package/dist/{avatar-flipboard-8NioODS5.mjs → avatar-flipboard-C10JfFS_.mjs} +2 -2
  5. package/dist/{avatar-flipboard-8NioODS5.mjs.map → avatar-flipboard-C10JfFS_.mjs.map} +1 -1
  6. package/dist/{bluesky-sharing-B4oF-0BN.mjs → bluesky-sharing-C1xeGSL6.mjs} +4 -4
  7. package/dist/{bluesky-sharing-B4oF-0BN.mjs.map → bluesky-sharing-C1xeGSL6.mjs.map} +1 -1
  8. package/dist/{copy-BxgO1lWX.mjs → copy-C1fElSkQ.mjs} +2 -2
  9. package/dist/{copy-BxgO1lWX.mjs.map → copy-C1fElSkQ.mjs.map} +1 -1
  10. package/dist/{deleted-feed-item-Ct4Zc7u3.mjs → deleted-feed-item-Bun4tY2_.mjs} +2 -2
  11. package/dist/{deleted-feed-item-Ct4Zc7u3.mjs.map → deleted-feed-item-Bun4tY2_.mjs.map} +1 -1
  12. package/dist/{edit-profile-DVsYbpNY.mjs → edit-profile-CYh00FZ7.mjs} +1211 -1121
  13. package/dist/edit-profile-CYh00FZ7.mjs.map +1 -0
  14. package/dist/{feed-D0aeoOOJ.mjs → feed-BxUqmcN9.mjs} +4 -4
  15. package/dist/{feed-D0aeoOOJ.mjs.map → feed-BxUqmcN9.mjs.map} +1 -1
  16. package/dist/{hash-B-J30lCU.mjs → hash-CNgwAx-U.mjs} +2 -2
  17. package/dist/{hash-B-J30lCU.mjs.map → hash-CNgwAx-U.mjs.map} +1 -1
  18. package/dist/{inbox-BrLsHadF.mjs → inbox-DqNqII4a.mjs} +2 -2
  19. package/dist/{inbox-BrLsHadF.mjs.map → inbox-DqNqII4a.mjs.map} +1 -1
  20. package/dist/{index-_vEj3NfZ.mjs → index--Q6orQkb.mjs} +7960 -8593
  21. package/dist/index--Q6orQkb.mjs.map +1 -0
  22. package/dist/{index-DyFr7l3O.mjs → index-BueIufRq.mjs} +2450 -2838
  23. package/dist/index-BueIufRq.mjs.map +1 -0
  24. package/dist/{index-DnpX9U7J.mjs → index-C3KJXzZE.mjs} +32 -32
  25. package/dist/{index-DnpX9U7J.mjs.map → index-C3KJXzZE.mjs.map} +1 -1
  26. package/dist/{index-BftxScf5.mjs → index-C9pnotJK.mjs} +24 -24
  27. package/dist/{index-BftxScf5.mjs.map → index-C9pnotJK.mjs.map} +1 -1
  28. package/dist/{index-BMm_mIRT.mjs → index-CJJXnqq1.mjs} +3 -3
  29. package/dist/{index-BMm_mIRT.mjs.map → index-CJJXnqq1.mjs.map} +1 -1
  30. package/dist/{index-WlK4xdmR.mjs → index-CONoLlDU.mjs} +2 -2
  31. package/dist/{index-WlK4xdmR.mjs.map → index-CONoLlDU.mjs.map} +1 -1
  32. package/dist/{index-DL7eG3Ac.mjs → index-Dvh9q3jy.mjs} +18 -18
  33. package/dist/{index-DL7eG3Ac.mjs.map → index-Dvh9q3jy.mjs.map} +1 -1
  34. package/dist/{index-BdcW7GlH.mjs → index-jhjmoHwu.mjs} +36 -36
  35. package/dist/{index-BdcW7GlH.mjs.map → index-jhjmoHwu.mjs.map} +1 -1
  36. package/dist/{moderation-KWQp9gQj.mjs → moderation-CYhwUFi2.mjs} +3 -3
  37. package/dist/{moderation-KWQp9gQj.mjs.map → moderation-CYhwUFi2.mjs.map} +1 -1
  38. package/dist/{note-CfQDRkeT.mjs → note-COVa8CMw.mjs} +4 -4
  39. package/dist/{note-CfQDRkeT.mjs.map → note-COVa8CMw.mjs.map} +1 -1
  40. package/dist/{reply-BrWarBVQ.mjs → reply-BHpKVBxx.mjs} +2 -2
  41. package/dist/{reply-BrWarBVQ.mjs.map → reply-BHpKVBxx.mjs.map} +1 -1
  42. package/dist/separator-DP7q5sFH.mjs +116 -0
  43. package/dist/separator-DP7q5sFH.mjs.map +1 -0
  44. package/dist/{settings-CCnMmVaW.mjs → settings-3n7zo_3K.mjs} +3 -3
  45. package/dist/{settings-CCnMmVaW.mjs.map → settings-3n7zo_3K.mjs.map} +1 -1
  46. package/dist/{step-1-HGv6537o.mjs → step-1-BmUukywZ.mjs} +3 -3
  47. package/dist/{step-1-HGv6537o.mjs.map → step-1-BmUukywZ.mjs.map} +1 -1
  48. package/dist/{step-2-hqeY_dIc.mjs → step-2-C--I3xxp.mjs} +7 -7
  49. package/dist/{step-2-hqeY_dIc.mjs.map → step-2-C--I3xxp.mjs.map} +1 -1
  50. package/dist/{step-3-8yg4QPpr.mjs → step-3-0Deh5N9c.mjs} +7 -7
  51. package/dist/{step-3-8yg4QPpr.mjs.map → step-3-0Deh5N9c.mjs.map} +1 -1
  52. package/dist/{tabs-BZytpdZ9.mjs → tabs-D_vmoLBo.mjs} +35 -35
  53. package/dist/{tabs-BZytpdZ9.mjs.map → tabs-D_vmoLBo.mjs.map} +1 -1
  54. package/dist/{topic-filter-1kNAxvyr.mjs → topic-filter-DJMrhH-c.mjs} +2 -2
  55. package/dist/{topic-filter-1kNAxvyr.mjs.map → topic-filter-DJMrhH-c.mjs.map} +1 -1
  56. package/package.json +2 -2
  57. package/dist/edit-profile-DVsYbpNY.mjs.map +0 -1
  58. package/dist/index-DyFr7l3O.mjs.map +0 -1
  59. package/dist/index-_vEj3NfZ.mjs.map +0 -1
  60. package/dist/separator-nDV4oVPB.mjs +0 -39
  61. package/dist/separator-nDV4oVPB.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index-DL7eG3Ac.mjs","sources":["../../../node_modules/lucide-react/dist/esm/icons/repeat-2.js","../../../node_modules/lucide-react/dist/esm/icons/user-round-check.js","../src/views/notifications/components/notification-icon.tsx","../src/views/notifications/components/notification-item.tsx","../src/components/global/separator.tsx","../src/views/notifications/notifications.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 [\"path\", { d: \"m2 9 3-3 3 3\", key: \"1ltn5i\" }],\n [\"path\", { d: \"M13 18H7a2 2 0 0 1-2-2V6\", key: \"1r6tfw\" }],\n [\"path\", { d: \"m22 15-3 3-3-3\", key: \"4rnwn2\" }],\n [\"path\", { d: \"M11 6h6a2 2 0 0 1 2 2v10\", key: \"2f72bc\" }]\n];\nconst Repeat2 = createLucideIcon(\"repeat-2\", __iconNode);\n\nexport { __iconNode, Repeat2 as default };\n//# sourceMappingURL=repeat-2.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 13.292-6\", key: \"bjp14o\" }],\n [\"circle\", { cx: \"10\", cy: \"8\", r: \"5\", key: \"o932ke\" }],\n [\"path\", { d: \"m16 19 2 2 4-4\", key: \"1b14m6\" }]\n];\nconst UserRoundCheck = createLucideIcon(\"user-round-check\", __iconNode);\n\nexport { __iconNode, UserRoundCheck as default };\n//# sourceMappingURL=user-round-check.js.map\n","import React from 'react';\nimport {LucideIcon} from '@tryghost/shade';\n\nexport type NotificationType = 'like' | 'follow' | 'reply' | 'repost' | 'mention';\nexport type NotificationIconSize = 'sm' | 'lg';\n\ninterface NotificationIconProps {\n notificationType: NotificationType;\n size?: NotificationIconSize;\n className?: string;\n}\n\nconst NotificationIcon: React.FC<NotificationIconProps> = ({notificationType, size = 'lg', className}) => {\n let icon;\n let badgeColor = '';\n const iconColor = 'white';\n const iconSize = size === 'sm' ? 13 : 20;\n const strokeWidth = size === 'sm' ? 2 : 1.5;\n\n switch (notificationType) {\n case 'follow':\n icon = <LucideIcon.UserRoundCheck className={`-mr-0.5 -mt-0.5 ${size === 'sm' && 'size-[11px]'}`} color={iconColor} size={iconSize} strokeWidth={strokeWidth} />;\n badgeColor = 'bg-blue-600';\n break;\n case 'like':\n icon = <LucideIcon.Heart className={`${size === 'sm' ? 'size-[11px]' : 'mt-px size-5'}`} color={iconColor} strokeWidth={strokeWidth} />;\n badgeColor = 'bg-pink-600';\n break;\n case 'reply':\n icon = <LucideIcon.Reply className='mb-px mr-px' color={iconColor} size={iconSize} strokeWidth={strokeWidth} />;\n badgeColor = 'bg-purple-600';\n break;\n case 'repost':\n icon = <LucideIcon.Repeat2 color={iconColor} size={iconSize} strokeWidth={strokeWidth} />;\n badgeColor = 'bg-green-500';\n break;\n case 'mention':\n icon = <LucideIcon.AtSign className={`${size === 'sm' ? 'size-[12px]' : 'size-5'}`} color={iconColor} size={iconSize} strokeWidth={strokeWidth} />;\n badgeColor = 'bg-orange-500';\n break;\n }\n\n return (\n <div className={`flex ${size === 'sm' ? 'size-5' : 'size-9'} items-center justify-center rounded-full ${badgeColor} ${className && className}`}>\n {icon}\n </div>\n );\n};\n\nexport default NotificationIcon;\n","import NotificationIcon, {NotificationIconSize, NotificationType} from './notification-icon';\nimport React from 'react';\n\n// Context to share common props between compound components\ninterface NotificationContextType {\n onClick?: () => void;\n url?: string;\n}\n\nconst NotificationContext = React.createContext<NotificationContextType | undefined>(undefined);\n\n// Root component\ninterface NotificationItemProps {\n isGrouped?: boolean;\n centerAlign?: boolean;\n children: React.ReactNode;\n onClick?: () => void;\n url?: string;\n className?: string;\n}\n\nconst NotificationItem = ({isGrouped, centerAlign, children, onClick, url, className}: NotificationItemProps) => {\n return (\n <NotificationContext.Provider value={{onClick, url}}>\n <div className={`group relative -mx-4 -my-px ${isGrouped ? 'grid' : 'flex'} ${centerAlign ? 'items-center' : 'items-start'} cursor-pointer grid-cols-[auto_1fr] gap-x-4 gap-y-2.5 rounded-lg px-4 py-5 text-left break-anywhere hover:bg-gray-75 ${className}`}\n role='button'\n onClick={onClick}\n >\n {children}\n </div>\n </NotificationContext.Provider>\n );\n};\n\n// Sub-components\nconst Icon = ({size = 'lg', type}: {size?: NotificationIconSize; type: NotificationType}) => {\n return (\n <div className='col-start-1 row-start-1'>\n <NotificationIcon notificationType={type} size={size} />\n </div>\n );\n};\n\nconst Avatars = ({children}: {children: React.ReactNode}) => {\n return (\n <div className='col-start-2 row-start-1 flex gap-2'>\n {children}\n </div>\n );\n};\n\nconst Content = ({children}: {children: React.ReactNode}) => {\n return (\n <div className='col-start-2 row-start-2 -mt-0.5 grow overflow-hidden'>\n {children}\n </div>\n );\n};\n\n// Attach sub-components to the main component\nNotificationItem.Icon = Icon;\nNotificationItem.Avatars = Avatars;\nNotificationItem.Content = Content;\n\nexport default NotificationItem;\n","import React from 'react';\n\nconst Separator: React.FC = () => {\n return <div className='h-px w-full bg-gray-150 dark:bg-gray-950' />;\n};\n\nexport default Separator;","import React, {useEffect, useRef} from 'react';\nimport {ActorProperties} from '@tryghost/admin-x-framework/api/activitypub';\nimport {Button, LoadingIndicator, LucideIcon, Skeleton} from '@tryghost/shade';\n\nimport APAvatar from '@components/global/ap-avatar';\nimport AppError from '@components/layout/error';\nimport FeedItemStats from '@components/feed/feed-item-stats';\nimport FollowButton from '@components/global/follow-button';\nimport Layout from '@components/layout';\nimport NotificationIcon from './components/notification-icon';\nimport NotificationItem from './components/notification-item';\nimport ProfilePreviewHoverCard from '@components/global/profile-preview-hover-card';\nimport Separator from '@components/global/separator';\nimport {EmptyViewIcon, EmptyViewIndicator} from '@src/components/global/empty-view-indicator';\nimport {Notification, isApiError} from '@src/api/activitypub';\nimport {handleProfileClick} from '@utils/handle-profile-click';\nimport {renderFeedAttachment} from '@components/feed/feed-item';\nimport {renderTimestamp} from '@src/utils/render-timestamp';\nimport {stripHtml} from '@src/utils/content-formatters';\nimport {useNavigateWithBasePath} from '@src/hooks/use-navigate-with-base-path';\nimport {useNotificationsForUser} from '@hooks/use-activity-pub-queries';\n\ninterface NotificationGroup {\n id: string;\n type: Notification['type'];\n actors: Notification['actor'][];\n post: Notification['post'];\n inReplyTo: Notification['inReplyTo'];\n createdAt: string;\n}\n\ninterface NotificationGroupDescriptionProps {\n group: NotificationGroup;\n}\n\n/**\n * Calculate a time bucket for grouping notifications\n * Groups notifications into time windows\n */\nfunction getTimeBucket(timestamp: string): string {\n const TIME_WINDOW_MS = 24 * 60 * 60 * 1000; // 24 hours\n const date = new Date(timestamp);\n const timeMs = date.getTime();\n const bucketStart = Math.floor(timeMs / TIME_WINDOW_MS) * TIME_WINDOW_MS;\n return bucketStart.toString();\n}\n\nfunction groupNotifications(notifications: Notification[]): NotificationGroup[] {\n const groups: {\n [key: string]: NotificationGroup\n } = {};\n\n let lastType: string | null = null;\n let sequenceCounter = 0;\n\n notifications.forEach((notification) => {\n // Increment sequence counter when we encounter a different type\n // This preserves chronological order by preventing grouping across type boundaries\n if (notification.type !== lastType) {\n sequenceCounter += 1;\n lastType = notification.type;\n }\n\n let groupKey = '';\n const timeBucket = `_${getTimeBucket(notification.createdAt)}`;\n const sequence = `_seq${sequenceCounter}`;\n\n switch (notification.type) {\n case 'like':\n if (notification.post?.id) {\n groupKey = `like_${notification.post.id}${timeBucket}${sequence}`;\n }\n break;\n case 'reply':\n // Don't group replies\n groupKey = `reply_${notification.id}`;\n break;\n case 'repost':\n if (notification.post?.id) {\n groupKey = `repost_${notification.post.id}${timeBucket}${sequence}`;\n }\n break;\n case 'follow':\n groupKey = `follow_${timeBucket}${sequence}`;\n break;\n case 'mention':\n // Don't group mentions\n groupKey = `mention_${notification.id}`;\n break;\n }\n\n if (!groups[groupKey]) {\n groups[groupKey] = {\n id: notification.id,\n type: notification.type,\n actors: [],\n post: notification.post,\n inReplyTo: notification.inReplyTo,\n createdAt: notification.createdAt\n };\n }\n\n // Add actor if not already in the group\n if (!groups[groupKey].actors.find(a => a.id === notification.actor.id)) {\n groups[groupKey].actors.push(notification.actor);\n }\n });\n\n return Object.values(groups);\n};\n\nconst NotificationGroupDescription: React.FC<NotificationGroupDescriptionProps> = ({group}) => {\n const [firstActor, ...otherActors] = group.actors;\n const hasOthers = otherActors.length > 0;\n\n const actorClass = 'cursor-pointer font-semibold hover:underline text-black dark:text-white';\n\n const navigate = useNavigateWithBasePath();\n\n const actorText = (\n <>\n <ProfilePreviewHoverCard actor={firstActor as unknown as ActorProperties} align=\"center\" isCurrentUser={false}>\n <span\n className={actorClass}\n onClick={(e) => {\n e?.stopPropagation();\n handleProfileClick(firstActor.handle, navigate);\n }}\n >\n {firstActor.name}\n </span>\n </ProfilePreviewHoverCard>\n {hasOthers && ` and ${otherActors.length} ${otherActors.length > 1 ? 'others' : 'other'}`}\n </>\n );\n\n switch (group.type) {\n case 'follow':\n return <>{actorText} followed you</>;\n case 'like':\n return <>{actorText} liked your {group.post?.type === 'article' ? 'post' : 'note'}</>;\n case 'repost':\n return <>{actorText} reposted your {group.post?.type === 'article' ? 'post' : 'note'}</>;\n case 'reply':\n if (group.inReplyTo && typeof group.inReplyTo !== 'string') {\n return actorText;\n }\n break;\n case 'mention':\n return actorText;\n }\n\n return <></>;\n};\n\nconst ProfileLinkedContent: React.FC<{\n content: string;\n className?: string;\n stripTags?: string[];\n}> = ({content, className, stripTags = []}) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const navigate = useNavigateWithBasePath();\n\n useEffect(() => {\n const element = contentRef.current;\n if (!element) {\n return;\n }\n\n const handleProfileLinkClick = (e: Event) => {\n const target = (e as MouseEvent).target as HTMLElement;\n const link = target.closest('a[data-profile]');\n\n if (link) {\n const handle = link.getAttribute('data-profile')?.trim();\n const isValidHandle = /^@([\\w.-]+)@([\\w-]+\\.[\\w.-]+[a-zA-Z])$/.test(handle || '');\n\n if (isValidHandle && handle) {\n e.preventDefault();\n e.stopPropagation();\n handleProfileClick(handle, navigate);\n }\n }\n };\n\n element.addEventListener('click', handleProfileLinkClick);\n return () => {\n element.removeEventListener('click', handleProfileLinkClick);\n };\n }, [navigate, content]);\n\n return (\n <div\n dangerouslySetInnerHTML={{__html: stripHtml(content || '', stripTags)}}\n ref={contentRef}\n className={className}\n />\n );\n};\n\nconst Notifications: React.FC = () => {\n const [openStates, setOpenStates] = React.useState<{[key: string]: boolean}>({});\n const navigate = useNavigateWithBasePath();\n\n const toggleOpen = (groupId: string) => {\n setOpenStates(prev => ({\n ...prev,\n [groupId]: !prev[groupId]\n }));\n };\n\n const handleLikeClick = () => {\n // Do API req or smth\n // Don't need to know about setting timeouts or anything like that\n };\n\n const maxAvatars = 5;\n\n const {data, error, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading} = useNotificationsForUser('index');\n\n const notificationGroups = (\n data?.pages.flatMap((page) => {\n return groupNotifications(page.notifications);\n })\n // If no notifications, return 10 empty groups for the loading state\n ?? Array(10).fill({actors: [{}]}));\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 handleNotificationClick = (group: NotificationGroup, index: number) => {\n switch (group.type) {\n case 'like':\n if (group.post) {\n navigate(`/${group.post.type === 'article' ? 'reader' : 'notes'}/${encodeURIComponent(group.post.id)}`);\n }\n break;\n case 'reply':\n if (group.post && group.inReplyTo) {\n navigate(`/notes/${encodeURIComponent(group.post.id)}`);\n }\n break;\n case 'repost':\n if (group.post) {\n navigate(`/${group.post.type === 'article' ? 'reader' : 'notes'}/${encodeURIComponent(group.post.id)}`);\n }\n break;\n case 'follow':\n if (group.actors.length > 1) {\n toggleOpen(group.id || `${group.type}_${index}`);\n } else {\n handleProfileClick(group.actors[0].handle, navigate);\n }\n break;\n case 'mention':\n if (group.post) {\n navigate(`/notes/${encodeURIComponent(group.post.id)}`);\n }\n break;\n }\n };\n\n if (error && isApiError(error)) {\n return <AppError errorCode={error.code} statusCode={error.statusCode}/>;\n }\n\n return (\n <Layout>\n <div className='z-0 flex w-full flex-col items-center'>\n {\n isLoading === false && notificationGroups.length === 0 && (\n <EmptyViewIndicator>\n <EmptyViewIcon><LucideIcon.Bell /></EmptyViewIcon>\n Quiet for now, but not for long! When someone likes, boosts, or replies to you, you&apos;ll find it here.\n </EmptyViewIndicator>\n )\n }\n {\n (notificationGroups.length > 0) && (\n <>\n <div className='my-8 flex w-full max-w-[620px] flex-col max-md:mt-5'>\n {notificationGroups.map((group, index) => (\n <React.Fragment key={group.id || `${group.type}_${index}`}>\n <NotificationItem\n centerAlign={group.actors.length < 2 && group.type === 'follow'}\n className='hover:bg-gray-75 dark:hover:bg-gray-950'\n isGrouped={group.actors.length > 1}\n onClick={() => handleNotificationClick(group, index)}\n >\n {isLoading ?\n <Skeleton className='rounded-full' containerClassName='flex h-10 w-10' /> :\n (group.actors.length > 1 ?\n <NotificationItem.Icon type={group.type} /> :\n <div className='relative'>\n <APAvatar\n key={group.actors[0].id}\n author={{\n icon: {\n url: group.actors[0].avatarUrl || ''\n },\n name: group.actors[0].name,\n handle: group.actors[0].handle\n }}\n size='notification'\n />\n <NotificationIcon className='absolute -bottom-1 -right-1 z-10 border-2 border-white dark:border-black' notificationType={group.type} size='sm' />\n </div>\n )\n }\n {group.actors.length > 1 && <NotificationItem.Avatars>\n <div className='flex w-full flex-col'>\n <div className='relative flex items-center pl-2'>\n {!openStates[group.id || `${group.type}_${index}`] && group.actors.slice(0, maxAvatars).map((actor: ActorProperties) => (\n <APAvatar\n key={actor.id}\n author={{\n icon: {\n url: actor.avatarUrl || ''\n },\n name: actor.name,\n handle: actor.handle\n }}\n className='-ml-2 !bg-[#F3F3F3] outline outline-2 outline-white group-hover:!bg-[#EDEEF0] group-hover:outline-gray-75 dark:outline-black group-hover:dark:outline-gray-950'\n size='notification'\n />\n ))}\n {group.actors.length > maxAvatars && (!openStates[group.id || `${group.type}_${index}`]) && (\n <div className='absolute right-[28px] z-10 flex size-9 items-center justify-center rounded-full bg-black/50 text-base font-semibold tracking-tightest text-white'>\n {`+${group.actors.length - maxAvatars}`}\n </div>\n )}\n\n {group.actors.length > 1 && (\n <Button className={`group flex items-center gap-0.5 text-gray-700 hover:bg-transparent hover:text-black dark:text-gray-600 dark:hover:text-white ${openStates[group.id || `${group.type}_${index}`] ? 'ml-[-20px]' : 'ml-0 w-[28px]'}`} variant='ghost' onClick={(event?: React.MouseEvent<HTMLElement>) => {\n event?.stopPropagation();\n toggleOpen(group.id || `${group.type}_${index}`);\n }}>\n <LucideIcon.ChevronDown className={`${openStates[group.id || `${group.type}_${index}`] ? 'rotate-180' : ''}`} size={20} strokeWidth={1.5} />\n {openStates[group.id || `${group.type}_${index}`] ? 'Hide' : <span className='sr-only'>Show all</span>}\n </Button>\n )}\n </div>\n <div className={`overflow-hidden transition-all duration-300 ease-in-out ${openStates[group.id || `${group.type}_${index}`] ? 'mb-2 max-h-[1384px] opacity-100' : 'max-h-0 opacity-0'}`}>\n {openStates[group.id || `${group.type}_${index}`] && group.actors.length > 1 && (\n <div className='flex flex-col gap-2 pt-2'>\n {group.actors.map((actor: ActorProperties) => (\n <div\n key={actor.id}\n className='group/item flex items-center justify-between gap-4 break-anywhere'\n onClick={(e) => {\n e?.stopPropagation();\n handleProfileClick(actor.handle, navigate);\n }}\n >\n <div className='flex min-w-0 items-center'>\n <APAvatar author={{\n icon: {\n url: actor.avatarUrl || ''\n },\n name: actor.name,\n handle: actor.handle\n }} size='xs' />\n <span className='ml-2 line-clamp-1 text-base font-semibold group-hover/item:underline dark:text-white'>{actor.name}</span>\n <span className='ml-1 line-clamp-1 text-base text-gray-700 dark:text-gray-600'>{actor.handle}</span>\n </div>\n {group.type === 'follow' && !actor.followedByMe && (\n <FollowButton\n following={false}\n handle={actor.handle}\n variant=\"link\"\n />\n )}\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n </NotificationItem.Avatars>}\n <NotificationItem.Content>\n <div>\n {isLoading ?\n <>\n <Skeleton />\n <Skeleton className='w-full max-w-60' />\n </> :\n <div className='flex justify-between'>\n <div className='flex items-center gap-1'>\n <span className='truncate'><NotificationGroupDescription group={group} /></span>\n {group.actors.length < 2 &&\n <>\n <span className='mt-px text-[8px] text-gray-700 dark:text-gray-600'>&bull;</span>\n <span className='mt-0.5 text-sm text-gray-700 dark:text-gray-600'>{renderTimestamp(group, false)}</span>\n </>\n }\n </div>\n {/* Follow button for singular follow, reply, and mention */}\n {group.actors.length === 1 && (group.type === 'follow' || group.type === 'reply' || group.type === 'mention') && !group.actors[0].followedByMe && (\n <FollowButton\n following={false}\n handle={group.actors[0].handle}\n variant=\"link\"\n />\n )}\n </div>\n }\n </div>\n {(\n ((group.type === 'reply' && group.inReplyTo) || group.type === 'mention') ||\n (group.type === 'like' && !group.post?.name && group.post?.content) ||\n (group.type === 'repost' && !group.post?.name && group.post?.content)\n ) && (\n (group.type !== 'reply' && group.type !== 'mention' ?\n <div className='ap-note-content mt-0.5 line-clamp-1 text-pretty text-sm text-gray-700 dark:text-gray-600'>\n {group.post?.type === 'article' && group.post?.title && <>{group.post.title} &mdash; </>}\n <span dangerouslySetInnerHTML={{__html: stripHtml(group.post?.content || '')}} />\n </div> :\n <>\n <div className='mt-2.5 rounded-md bg-gray-100 px-5 py-[14px] group-hover:bg-gray-200 dark:bg-gray-925/30 group-hover:dark:bg-black/40'>\n <ProfileLinkedContent\n className='ap-note-content text-pretty'\n content={group.post?.content || ''}\n stripTags={['a']}\n />\n {group.post && group.post.attachments && group.post.attachments.length > 0 && (\n <div className='notification-attachments mb-1 [&_.attachment-gallery]:flex [&_.attachment-gallery]:flex-wrap [&_img]:aspect-square [&_img]:max-w-[calc(20%-6.4px)]'>\n {renderFeedAttachment(\n {...group.post, type: 'Note', attachment: group.post.attachments}\n )}\n </div>\n )}\n </div>\n </>\n )\n )}\n {((group.type === 'reply' && group.post) || group.type === 'mention') && (\n <div className=\"mt-1.5\">\n <FeedItemStats\n actor={{\n ...group.actors[0],\n icon: {\n url: group.actors[0].avatarUrl || ''\n },\n id: group.actors[0].url,\n preferredUsername: group.actors[0].handle?.replace(/^@([^@]+)@.*$/, '$1') || 'unknown'\n }}\n buttonClassName='hover:bg-gray-200'\n commentCount={group.post.replyCount || 0}\n layout=\"notification\"\n likeCount={group.post.likeCount || 0}\n object={{\n ...group.post,\n liked: group.post.likedByMe,\n reposted: group.post.repostedByMe\n }}\n repostCount={group.post.repostCount || 0}\n onLikeClick={handleLikeClick}\n />\n </div>\n )}\n </NotificationItem.Content>\n </NotificationItem>\n {index < notificationGroups.length - 1 &&\n <div className='pl-[52px]'><Separator /></div>\n }\n </React.Fragment>\n ))}\n </div>\n <div ref={loadMoreRef} className='h-1'></div>\n {isFetchingNextPage && (\n <div className='-mt-4 mb-8 flex flex-col items-center justify-center space-y-4 text-center'>\n <LoadingIndicator size='md' />\n </div>\n )}\n </>\n )\n }\n </div>\n </Layout>\n );\n};\n\nexport default Notifications;\n"],"names":["__iconNode","Repeat2","createLucideIcon","UserRoundCheck","NotificationIcon","notificationType","size","className","icon","badgeColor","iconColor","iconSize","strokeWidth","jsx","LucideIcon.UserRoundCheck","LucideIcon.Heart","LucideIcon.Reply","LucideIcon.Repeat2","LucideIcon.AtSign","NotificationContext","React","NotificationItem","isGrouped","centerAlign","children","onClick","url","Icon","type","Avatars","Content","Separator","getTimeBucket","timestamp","timeMs","groupNotifications","notifications","groups","lastType","sequenceCounter","notification","groupKey","timeBucket","sequence","_a","_b","a","NotificationGroupDescription","group","firstActor","otherActors","hasOthers","actorClass","navigate","useNavigateWithBasePath","actorText","jsxs","Fragment","ProfilePreviewHoverCard","e","handleProfileClick","ProfileLinkedContent","content","stripTags","contentRef","useRef","useEffect","element","handleProfileLinkClick","link","handle","stripHtml","Notifications","openStates","setOpenStates","toggleOpen","groupId","prev","handleLikeClick","maxAvatars","data","error","fetchNextPage","hasNextPage","isFetchingNextPage","isLoading","useNotificationsForUser","notificationGroups","page","observerRef","loadMoreRef","entries","handleNotificationClick","index","isApiError","AppError","Layout","EmptyViewIndicator","EmptyViewIcon","LucideIcon.Bell","Skeleton","APAvatar","actor","Button","event","LucideIcon.ChevronDown","FollowButton","renderTimestamp","_c","_d","_e","_f","_g","_h","renderFeedAttachment","FeedItemStats","_i","LoadingIndicator"],"mappings":";;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,gBAAgB,KAAK,SAAQ,CAAE;AAAA,EAC7C,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD,CAAC,QAAQ,EAAE,GAAG,kBAAkB,KAAK,SAAQ,CAAE;AAAA,EAC/C,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAC3D,GACMC,KAAUC,EAAiB,YAAYF,EAAU;ACfvD;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,kBAAkB,KAAK,SAAQ,CAAE;AACjD,GACMG,KAAiBD,EAAiB,oBAAoBF,EAAU,GCFhEI,IAAoD,CAAC,EAAC,kBAAAC,GAAkB,MAAAC,IAAO,MAAM,WAAAC,QAAe;AACtG,MAAIC,GACAC,IAAa;AACjB,QAAMC,IAAY,SACZC,IAAWL,MAAS,OAAO,KAAK,IAChCM,IAAcN,MAAS,OAAO,IAAI;AAExC,UAAQD,GAAA;AAAA,IACR,KAAK;AACD,MAAAG,IA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AA,sBAEzB,aAAaA,EAAM,KAAK,eAAe;AAAA,sBACvC,aAAa8B;AAAA,oBAAA;AAAA,kBAAA,EACjB,CACJ;AAAA,gBAAA,EAAA,CAER;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAEHe,IAAQN,EAAmB,SAAS,KACjC1E,gBAAAA,EAAAA,IAAC,SAAI,WAAU,aAAY,UAAAA,gBAAAA,EAAAA,IAACkB,IAAA,CAAA,CAAU,EAAA,CAAE;AAAA,QAAA,EAAA,GArL3BiB,EAAM,MAAM,GAAGA,EAAM,IAAI,IAAI6C,CAAK,EAuLvD;AAAA,OACH,GACL;AAAA,MACAhF,gBAAAA,EAAAA,IAAC,OAAA,EAAI,KAAK6E,GAAa,WAAU,OAAM;AAAA,MACtCN,2BACI,OAAA,EAAI,WAAU,8EACX,UAAAvE,gBAAAA,EAAAA,IAACwG,IAAA,EAAiB,MAAK,KAAA,CAAK,EAAA,CAChC;AAAA,IAAA,EAAA,CAER;AAAA,EAAA,EAAA,CAGZ,EAAA,CACJ;AAER;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"index-Dvh9q3jy.mjs","sources":["../../../node_modules/lucide-react/dist/esm/icons/repeat-2.js","../../../node_modules/lucide-react/dist/esm/icons/user-round-check.js","../src/views/notifications/components/notification-icon.tsx","../src/views/notifications/components/notification-item.tsx","../src/components/global/separator.tsx","../src/views/notifications/notifications.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 [\"path\", { d: \"m2 9 3-3 3 3\", key: \"1ltn5i\" }],\n [\"path\", { d: \"M13 18H7a2 2 0 0 1-2-2V6\", key: \"1r6tfw\" }],\n [\"path\", { d: \"m22 15-3 3-3-3\", key: \"4rnwn2\" }],\n [\"path\", { d: \"M11 6h6a2 2 0 0 1 2 2v10\", key: \"2f72bc\" }]\n];\nconst Repeat2 = createLucideIcon(\"repeat-2\", __iconNode);\n\nexport { __iconNode, Repeat2 as default };\n//# sourceMappingURL=repeat-2.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 13.292-6\", key: \"bjp14o\" }],\n [\"circle\", { cx: \"10\", cy: \"8\", r: \"5\", key: \"o932ke\" }],\n [\"path\", { d: \"m16 19 2 2 4-4\", key: \"1b14m6\" }]\n];\nconst UserRoundCheck = createLucideIcon(\"user-round-check\", __iconNode);\n\nexport { __iconNode, UserRoundCheck as default };\n//# sourceMappingURL=user-round-check.js.map\n","import React from 'react';\nimport {LucideIcon} from '@tryghost/shade';\n\nexport type NotificationType = 'like' | 'follow' | 'reply' | 'repost' | 'mention';\nexport type NotificationIconSize = 'sm' | 'lg';\n\ninterface NotificationIconProps {\n notificationType: NotificationType;\n size?: NotificationIconSize;\n className?: string;\n}\n\nconst NotificationIcon: React.FC<NotificationIconProps> = ({notificationType, size = 'lg', className}) => {\n let icon;\n let badgeColor = '';\n const iconColor = 'white';\n const iconSize = size === 'sm' ? 13 : 20;\n const strokeWidth = size === 'sm' ? 2 : 1.5;\n\n switch (notificationType) {\n case 'follow':\n icon = <LucideIcon.UserRoundCheck className={`-mr-0.5 -mt-0.5 ${size === 'sm' && 'size-[11px]'}`} color={iconColor} size={iconSize} strokeWidth={strokeWidth} />;\n badgeColor = 'bg-blue-600';\n break;\n case 'like':\n icon = <LucideIcon.Heart className={`${size === 'sm' ? 'size-[11px]' : 'mt-px size-5'}`} color={iconColor} strokeWidth={strokeWidth} />;\n badgeColor = 'bg-pink-600';\n break;\n case 'reply':\n icon = <LucideIcon.Reply className='mb-px mr-px' color={iconColor} size={iconSize} strokeWidth={strokeWidth} />;\n badgeColor = 'bg-purple-600';\n break;\n case 'repost':\n icon = <LucideIcon.Repeat2 color={iconColor} size={iconSize} strokeWidth={strokeWidth} />;\n badgeColor = 'bg-green-500';\n break;\n case 'mention':\n icon = <LucideIcon.AtSign className={`${size === 'sm' ? 'size-[12px]' : 'size-5'}`} color={iconColor} size={iconSize} strokeWidth={strokeWidth} />;\n badgeColor = 'bg-orange-500';\n break;\n }\n\n return (\n <div className={`flex ${size === 'sm' ? 'size-5' : 'size-9'} items-center justify-center rounded-full ${badgeColor} ${className && className}`}>\n {icon}\n </div>\n );\n};\n\nexport default NotificationIcon;\n","import NotificationIcon, {NotificationIconSize, NotificationType} from './notification-icon';\nimport React from 'react';\n\n// Context to share common props between compound components\ninterface NotificationContextType {\n onClick?: () => void;\n url?: string;\n}\n\nconst NotificationContext = React.createContext<NotificationContextType | undefined>(undefined);\n\n// Root component\ninterface NotificationItemProps {\n isGrouped?: boolean;\n centerAlign?: boolean;\n children: React.ReactNode;\n onClick?: () => void;\n url?: string;\n className?: string;\n}\n\nconst NotificationItem = ({isGrouped, centerAlign, children, onClick, url, className}: NotificationItemProps) => {\n return (\n <NotificationContext.Provider value={{onClick, url}}>\n <div className={`group relative -mx-4 -my-px ${isGrouped ? 'grid' : 'flex'} ${centerAlign ? 'items-center' : 'items-start'} cursor-pointer grid-cols-[auto_1fr] gap-x-4 gap-y-2.5 rounded-lg px-4 py-5 text-left break-anywhere hover:bg-gray-75 ${className}`}\n role='button'\n onClick={onClick}\n >\n {children}\n </div>\n </NotificationContext.Provider>\n );\n};\n\n// Sub-components\nconst Icon = ({size = 'lg', type}: {size?: NotificationIconSize; type: NotificationType}) => {\n return (\n <div className='col-start-1 row-start-1'>\n <NotificationIcon notificationType={type} size={size} />\n </div>\n );\n};\n\nconst Avatars = ({children}: {children: React.ReactNode}) => {\n return (\n <div className='col-start-2 row-start-1 flex gap-2'>\n {children}\n </div>\n );\n};\n\nconst Content = ({children}: {children: React.ReactNode}) => {\n return (\n <div className='col-start-2 row-start-2 -mt-0.5 grow overflow-hidden'>\n {children}\n </div>\n );\n};\n\n// Attach sub-components to the main component\nNotificationItem.Icon = Icon;\nNotificationItem.Avatars = Avatars;\nNotificationItem.Content = Content;\n\nexport default NotificationItem;\n","import React from 'react';\n\nconst Separator: React.FC = () => {\n return <div className='h-px w-full bg-gray-150 dark:bg-gray-950' />;\n};\n\nexport default Separator;","import React, {useEffect, useRef} from 'react';\nimport {ActorProperties} from '@tryghost/admin-x-framework/api/activitypub';\nimport {Button, LoadingIndicator, LucideIcon, Skeleton} from '@tryghost/shade';\n\nimport APAvatar from '@components/global/ap-avatar';\nimport AppError from '@components/layout/error';\nimport FeedItemStats from '@components/feed/feed-item-stats';\nimport FollowButton from '@components/global/follow-button';\nimport Layout from '@components/layout';\nimport NotificationIcon from './components/notification-icon';\nimport NotificationItem from './components/notification-item';\nimport ProfilePreviewHoverCard from '@components/global/profile-preview-hover-card';\nimport Separator from '@components/global/separator';\nimport {EmptyViewIcon, EmptyViewIndicator} from '@src/components/global/empty-view-indicator';\nimport {Notification, isApiError} from '@src/api/activitypub';\nimport {handleProfileClick} from '@utils/handle-profile-click';\nimport {renderFeedAttachment} from '@components/feed/feed-item';\nimport {renderTimestamp} from '@src/utils/render-timestamp';\nimport {stripHtml} from '@src/utils/content-formatters';\nimport {useNavigateWithBasePath} from '@src/hooks/use-navigate-with-base-path';\nimport {useNotificationsForUser} from '@hooks/use-activity-pub-queries';\n\ninterface NotificationGroup {\n id: string;\n type: Notification['type'];\n actors: Notification['actor'][];\n post: Notification['post'];\n inReplyTo: Notification['inReplyTo'];\n createdAt: string;\n}\n\ninterface NotificationGroupDescriptionProps {\n group: NotificationGroup;\n}\n\n/**\n * Calculate a time bucket for grouping notifications\n * Groups notifications into time windows\n */\nfunction getTimeBucket(timestamp: string): string {\n const TIME_WINDOW_MS = 24 * 60 * 60 * 1000; // 24 hours\n const date = new Date(timestamp);\n const timeMs = date.getTime();\n const bucketStart = Math.floor(timeMs / TIME_WINDOW_MS) * TIME_WINDOW_MS;\n return bucketStart.toString();\n}\n\nfunction groupNotifications(notifications: Notification[]): NotificationGroup[] {\n const groups: {\n [key: string]: NotificationGroup\n } = {};\n\n let lastType: string | null = null;\n let sequenceCounter = 0;\n\n notifications.forEach((notification) => {\n // Increment sequence counter when we encounter a different type\n // This preserves chronological order by preventing grouping across type boundaries\n if (notification.type !== lastType) {\n sequenceCounter += 1;\n lastType = notification.type;\n }\n\n let groupKey = '';\n const timeBucket = `_${getTimeBucket(notification.createdAt)}`;\n const sequence = `_seq${sequenceCounter}`;\n\n switch (notification.type) {\n case 'like':\n if (notification.post?.id) {\n groupKey = `like_${notification.post.id}${timeBucket}${sequence}`;\n }\n break;\n case 'reply':\n // Don't group replies\n groupKey = `reply_${notification.id}`;\n break;\n case 'repost':\n if (notification.post?.id) {\n groupKey = `repost_${notification.post.id}${timeBucket}${sequence}`;\n }\n break;\n case 'follow':\n groupKey = `follow_${timeBucket}${sequence}`;\n break;\n case 'mention':\n // Don't group mentions\n groupKey = `mention_${notification.id}`;\n break;\n }\n\n if (!groups[groupKey]) {\n groups[groupKey] = {\n id: notification.id,\n type: notification.type,\n actors: [],\n post: notification.post,\n inReplyTo: notification.inReplyTo,\n createdAt: notification.createdAt\n };\n }\n\n // Add actor if not already in the group\n if (!groups[groupKey].actors.find(a => a.id === notification.actor.id)) {\n groups[groupKey].actors.push(notification.actor);\n }\n });\n\n return Object.values(groups);\n};\n\nconst NotificationGroupDescription: React.FC<NotificationGroupDescriptionProps> = ({group}) => {\n const [firstActor, ...otherActors] = group.actors;\n const hasOthers = otherActors.length > 0;\n\n const actorClass = 'cursor-pointer font-semibold hover:underline text-black dark:text-white';\n\n const navigate = useNavigateWithBasePath();\n\n const actorText = (\n <>\n <ProfilePreviewHoverCard actor={firstActor as unknown as ActorProperties} align=\"center\" isCurrentUser={false}>\n <span\n className={actorClass}\n onClick={(e) => {\n e?.stopPropagation();\n handleProfileClick(firstActor.handle, navigate);\n }}\n >\n {firstActor.name}\n </span>\n </ProfilePreviewHoverCard>\n {hasOthers && ` and ${otherActors.length} ${otherActors.length > 1 ? 'others' : 'other'}`}\n </>\n );\n\n switch (group.type) {\n case 'follow':\n return <>{actorText} followed you</>;\n case 'like':\n return <>{actorText} liked your {group.post?.type === 'article' ? 'post' : 'note'}</>;\n case 'repost':\n return <>{actorText} reposted your {group.post?.type === 'article' ? 'post' : 'note'}</>;\n case 'reply':\n if (group.inReplyTo && typeof group.inReplyTo !== 'string') {\n return actorText;\n }\n break;\n case 'mention':\n return actorText;\n }\n\n return <></>;\n};\n\nconst ProfileLinkedContent: React.FC<{\n content: string;\n className?: string;\n stripTags?: string[];\n}> = ({content, className, stripTags = []}) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const navigate = useNavigateWithBasePath();\n\n useEffect(() => {\n const element = contentRef.current;\n if (!element) {\n return;\n }\n\n const handleProfileLinkClick = (e: Event) => {\n const target = (e as MouseEvent).target as HTMLElement;\n const link = target.closest('a[data-profile]');\n\n if (link) {\n const handle = link.getAttribute('data-profile')?.trim();\n const isValidHandle = /^@([\\w.-]+)@([\\w-]+\\.[\\w.-]+[a-zA-Z])$/.test(handle || '');\n\n if (isValidHandle && handle) {\n e.preventDefault();\n e.stopPropagation();\n handleProfileClick(handle, navigate);\n }\n }\n };\n\n element.addEventListener('click', handleProfileLinkClick);\n return () => {\n element.removeEventListener('click', handleProfileLinkClick);\n };\n }, [navigate, content]);\n\n return (\n <div\n dangerouslySetInnerHTML={{__html: stripHtml(content || '', stripTags)}}\n ref={contentRef}\n className={className}\n />\n );\n};\n\nconst Notifications: React.FC = () => {\n const [openStates, setOpenStates] = React.useState<{[key: string]: boolean}>({});\n const navigate = useNavigateWithBasePath();\n\n const toggleOpen = (groupId: string) => {\n setOpenStates(prev => ({\n ...prev,\n [groupId]: !prev[groupId]\n }));\n };\n\n const handleLikeClick = () => {\n // Do API req or smth\n // Don't need to know about setting timeouts or anything like that\n };\n\n const maxAvatars = 5;\n\n const {data, error, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading} = useNotificationsForUser('index');\n\n const notificationGroups = (\n data?.pages.flatMap((page) => {\n return groupNotifications(page.notifications);\n })\n // If no notifications, return 10 empty groups for the loading state\n ?? Array(10).fill({actors: [{}]}));\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 handleNotificationClick = (group: NotificationGroup, index: number) => {\n switch (group.type) {\n case 'like':\n if (group.post) {\n navigate(`/${group.post.type === 'article' ? 'reader' : 'notes'}/${encodeURIComponent(group.post.id)}`);\n }\n break;\n case 'reply':\n if (group.post && group.inReplyTo) {\n navigate(`/notes/${encodeURIComponent(group.post.id)}`);\n }\n break;\n case 'repost':\n if (group.post) {\n navigate(`/${group.post.type === 'article' ? 'reader' : 'notes'}/${encodeURIComponent(group.post.id)}`);\n }\n break;\n case 'follow':\n if (group.actors.length > 1) {\n toggleOpen(group.id || `${group.type}_${index}`);\n } else {\n handleProfileClick(group.actors[0].handle, navigate);\n }\n break;\n case 'mention':\n if (group.post) {\n navigate(`/notes/${encodeURIComponent(group.post.id)}`);\n }\n break;\n }\n };\n\n if (error && isApiError(error)) {\n return <AppError errorCode={error.code} statusCode={error.statusCode}/>;\n }\n\n return (\n <Layout>\n <div className='z-0 flex w-full flex-col items-center'>\n {\n isLoading === false && notificationGroups.length === 0 && (\n <EmptyViewIndicator>\n <EmptyViewIcon><LucideIcon.Bell /></EmptyViewIcon>\n Quiet for now, but not for long! When someone likes, boosts, or replies to you, you&apos;ll find it here.\n </EmptyViewIndicator>\n )\n }\n {\n (notificationGroups.length > 0) && (\n <>\n <div className='my-8 flex w-full max-w-[620px] flex-col max-md:mt-5'>\n {notificationGroups.map((group, index) => (\n <React.Fragment key={group.id || `${group.type}_${index}`}>\n <NotificationItem\n centerAlign={group.actors.length < 2 && group.type === 'follow'}\n className='hover:bg-gray-75 dark:hover:bg-gray-950'\n isGrouped={group.actors.length > 1}\n onClick={() => handleNotificationClick(group, index)}\n >\n {isLoading ?\n <Skeleton className='rounded-full' containerClassName='flex h-10 w-10' /> :\n (group.actors.length > 1 ?\n <NotificationItem.Icon type={group.type} /> :\n <div className='relative'>\n <APAvatar\n key={group.actors[0].id}\n author={{\n icon: {\n url: group.actors[0].avatarUrl || ''\n },\n name: group.actors[0].name,\n handle: group.actors[0].handle\n }}\n size='notification'\n />\n <NotificationIcon className='absolute -bottom-1 -right-1 z-10 border-2 border-white dark:border-black' notificationType={group.type} size='sm' />\n </div>\n )\n }\n {group.actors.length > 1 && <NotificationItem.Avatars>\n <div className='flex w-full flex-col'>\n <div className='relative flex items-center pl-2'>\n {!openStates[group.id || `${group.type}_${index}`] && group.actors.slice(0, maxAvatars).map((actor: ActorProperties) => (\n <APAvatar\n key={actor.id}\n author={{\n icon: {\n url: actor.avatarUrl || ''\n },\n name: actor.name,\n handle: actor.handle\n }}\n className='-ml-2 !bg-[#F3F3F3] outline outline-2 outline-white group-hover:!bg-[#EDEEF0] group-hover:outline-gray-75 dark:outline-black group-hover:dark:outline-gray-950'\n size='notification'\n />\n ))}\n {group.actors.length > maxAvatars && (!openStates[group.id || `${group.type}_${index}`]) && (\n <div className='absolute right-[28px] z-10 flex size-9 items-center justify-center rounded-full bg-black/50 text-base font-semibold tracking-tightest text-white'>\n {`+${group.actors.length - maxAvatars}`}\n </div>\n )}\n\n {group.actors.length > 1 && (\n <Button className={`group flex items-center gap-0.5 text-gray-700 hover:bg-transparent hover:text-black dark:text-gray-600 dark:hover:text-white ${openStates[group.id || `${group.type}_${index}`] ? 'ml-[-20px]' : 'ml-0 w-[28px]'}`} variant='ghost' onClick={(event?: React.MouseEvent<HTMLElement>) => {\n event?.stopPropagation();\n toggleOpen(group.id || `${group.type}_${index}`);\n }}>\n <LucideIcon.ChevronDown className={`${openStates[group.id || `${group.type}_${index}`] ? 'rotate-180' : ''}`} size={20} strokeWidth={1.5} />\n {openStates[group.id || `${group.type}_${index}`] ? 'Hide' : <span className='sr-only'>Show all</span>}\n </Button>\n )}\n </div>\n <div className={`overflow-hidden transition-all duration-300 ease-in-out ${openStates[group.id || `${group.type}_${index}`] ? 'mb-2 max-h-[1384px] opacity-100' : 'max-h-0 opacity-0'}`}>\n {openStates[group.id || `${group.type}_${index}`] && group.actors.length > 1 && (\n <div className='flex flex-col gap-2 pt-2'>\n {group.actors.map((actor: ActorProperties) => (\n <div\n key={actor.id}\n className='group/item flex items-center justify-between gap-4 break-anywhere'\n onClick={(e) => {\n e?.stopPropagation();\n handleProfileClick(actor.handle, navigate);\n }}\n >\n <div className='flex min-w-0 items-center'>\n <APAvatar author={{\n icon: {\n url: actor.avatarUrl || ''\n },\n name: actor.name,\n handle: actor.handle\n }} size='xs' />\n <span className='ml-2 line-clamp-1 text-base font-semibold group-hover/item:underline dark:text-white'>{actor.name}</span>\n <span className='ml-1 line-clamp-1 text-base text-gray-700 dark:text-gray-600'>{actor.handle}</span>\n </div>\n {group.type === 'follow' && !actor.followedByMe && (\n <FollowButton\n following={false}\n handle={actor.handle}\n variant=\"link\"\n />\n )}\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n </NotificationItem.Avatars>}\n <NotificationItem.Content>\n <div>\n {isLoading ?\n <>\n <Skeleton />\n <Skeleton className='w-full max-w-60' />\n </> :\n <div className='flex justify-between'>\n <div className='flex items-center gap-1'>\n <span className='truncate'><NotificationGroupDescription group={group} /></span>\n {group.actors.length < 2 &&\n <>\n <span className='mt-px text-[8px] text-gray-700 dark:text-gray-600'>&bull;</span>\n <span className='mt-0.5 text-sm text-gray-700 dark:text-gray-600'>{renderTimestamp(group, false)}</span>\n </>\n }\n </div>\n {/* Follow button for singular follow, reply, and mention */}\n {group.actors.length === 1 && (group.type === 'follow' || group.type === 'reply' || group.type === 'mention') && !group.actors[0].followedByMe && (\n <FollowButton\n following={false}\n handle={group.actors[0].handle}\n variant=\"link\"\n />\n )}\n </div>\n }\n </div>\n {(\n ((group.type === 'reply' && group.inReplyTo) || group.type === 'mention') ||\n (group.type === 'like' && !group.post?.name && group.post?.content) ||\n (group.type === 'repost' && !group.post?.name && group.post?.content)\n ) && (\n (group.type !== 'reply' && group.type !== 'mention' ?\n <div className='ap-note-content mt-0.5 line-clamp-1 text-pretty text-sm text-gray-700 dark:text-gray-600'>\n {group.post?.type === 'article' && group.post?.title && <>{group.post.title} &mdash; </>}\n <span dangerouslySetInnerHTML={{__html: stripHtml(group.post?.content || '')}} />\n </div> :\n <>\n <div className='mt-2.5 rounded-md bg-gray-100 px-5 py-[14px] group-hover:bg-gray-200 dark:bg-gray-925/30 group-hover:dark:bg-black/40'>\n <ProfileLinkedContent\n className='ap-note-content text-pretty'\n content={group.post?.content || ''}\n stripTags={['a']}\n />\n {group.post && group.post.attachments && group.post.attachments.length > 0 && (\n <div className='notification-attachments mb-1 [&_.attachment-gallery]:flex [&_.attachment-gallery]:flex-wrap [&_img]:aspect-square [&_img]:max-w-[calc(20%-6.4px)]'>\n {renderFeedAttachment(\n {...group.post, type: 'Note', attachment: group.post.attachments}\n )}\n </div>\n )}\n </div>\n </>\n )\n )}\n {((group.type === 'reply' && group.post) || group.type === 'mention') && (\n <div className=\"mt-1.5\">\n <FeedItemStats\n actor={{\n ...group.actors[0],\n icon: {\n url: group.actors[0].avatarUrl || ''\n },\n id: group.actors[0].url,\n preferredUsername: group.actors[0].handle?.replace(/^@([^@]+)@.*$/, '$1') || 'unknown'\n }}\n buttonClassName='hover:bg-gray-200'\n commentCount={group.post.replyCount || 0}\n layout=\"notification\"\n likeCount={group.post.likeCount || 0}\n object={{\n ...group.post,\n liked: group.post.likedByMe,\n reposted: group.post.repostedByMe\n }}\n repostCount={group.post.repostCount || 0}\n onLikeClick={handleLikeClick}\n />\n </div>\n )}\n </NotificationItem.Content>\n </NotificationItem>\n {index < notificationGroups.length - 1 &&\n <div className='pl-[52px]'><Separator /></div>\n }\n </React.Fragment>\n ))}\n </div>\n <div ref={loadMoreRef} className='h-1'></div>\n {isFetchingNextPage && (\n <div className='-mt-4 mb-8 flex flex-col items-center justify-center space-y-4 text-center'>\n <LoadingIndicator size='md' />\n </div>\n )}\n </>\n )\n }\n </div>\n </Layout>\n );\n};\n\nexport default Notifications;\n"],"names":["__iconNode","Repeat2","createLucideIcon","UserRoundCheck","NotificationIcon","notificationType","size","className","icon","badgeColor","iconColor","iconSize","strokeWidth","jsx","LucideIcon.UserRoundCheck","LucideIcon.Heart","LucideIcon.Reply","LucideIcon.Repeat2","LucideIcon.AtSign","NotificationContext","React","NotificationItem","isGrouped","centerAlign","children","onClick","url","Icon","type","Avatars","Content","Separator","getTimeBucket","timestamp","timeMs","groupNotifications","notifications","groups","lastType","sequenceCounter","notification","groupKey","timeBucket","sequence","_a","_b","a","NotificationGroupDescription","group","firstActor","otherActors","hasOthers","actorClass","navigate","useNavigateWithBasePath","actorText","jsxs","Fragment","ProfilePreviewHoverCard","e","handleProfileClick","ProfileLinkedContent","content","stripTags","contentRef","useRef","useEffect","element","handleProfileLinkClick","link","handle","stripHtml","Notifications","openStates","setOpenStates","toggleOpen","groupId","prev","handleLikeClick","maxAvatars","data","error","fetchNextPage","hasNextPage","isFetchingNextPage","isLoading","useNotificationsForUser","notificationGroups","page","observerRef","loadMoreRef","entries","handleNotificationClick","index","isApiError","AppError","Layout","EmptyViewIndicator","EmptyViewIcon","LucideIcon.Bell","Skeleton","APAvatar","actor","Button","event","LucideIcon.ChevronDown","FollowButton","renderTimestamp","_c","_d","_e","_f","_g","_h","renderFeedAttachment","FeedItemStats","_i","LoadingIndicator"],"mappings":";;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA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;AAAA,OACH,GACL;AAAA,MACAhF,gBAAAA,EAAAA,IAAC,OAAA,EAAI,KAAK6E,GAAa,WAAU,OAAM;AAAA,MACtCN,2BACI,OAAA,EAAI,WAAU,8EACX,UAAAvE,gBAAAA,EAAAA,IAACwG,IAAA,EAAiB,MAAK,KAAA,CAAK,EAAA,CAChC;AAAA,IAAA,EAAA,CAER;AAAA,EAAA,EAAA,CAGZ,EAAA,CACJ;AAER;","x_google_ignoreList":[0,1]}
@@ -1,5 +1,5 @@
1
- import { ad as q, c as C, ax as E, e as Q, ay as T, aj as K, az as tt, ai as et, aA as it, aB as st, aC as X } from "./index-_vEj3NfZ.mjs";
2
- const nt = (n, t) => n == null ? t : t == null ? n : Math.max(n, t), A = /* @__PURE__ */ new WeakMap(), Et = {
1
+ import { ai as q, c as E, aD as R, e as Q, aE as T, ah as K, aF as tt, ag as et, aG as it, aH as st, aI as X } from "./index--Q6orQkb.mjs";
2
+ const nt = (n, t) => n == null ? t : t == null ? n : Math.max(n, t), A = /* @__PURE__ */ new WeakMap(), Rt = {
3
3
  onUpdate(n, t, e) {
4
4
  if (A.set(e, void 0), !e.computedTrend)
5
5
  return;
@@ -72,10 +72,10 @@ const ct = String.raw, dt = (() => {
72
72
  return !1;
73
73
  }
74
74
  return !0;
75
- })(), ut = typeof CSS < "u" && CSS.supports && CSS.supports("line-height", "mod(1,1)"), p = typeof matchMedia < "u" ? matchMedia("(prefers-reduced-motion: reduce)") : null, R = "--_number-flow-d-opacity", N = "--_number-flow-d-width", $ = "--_number-flow-dx", M = "--_number-flow-d", pt = (() => {
75
+ })(), ut = typeof CSS < "u" && CSS.supports && CSS.supports("line-height", "mod(1,1)"), p = typeof matchMedia < "u" ? matchMedia("(prefers-reduced-motion: reduce)") : null, C = "--_number-flow-d-opacity", N = "--_number-flow-d-width", $ = "--_number-flow-dx", M = "--_number-flow-d", pt = (() => {
76
76
  try {
77
77
  return CSS.registerProperty({
78
- name: R,
78
+ name: C,
79
79
  syntax: "<number>",
80
80
  inherits: !1,
81
81
  initialValue: "0"
@@ -98,9 +98,9 @@ const ct = String.raw, dt = (() => {
98
98
  } catch {
99
99
  return !1;
100
100
  }
101
- })(), ft = "var(--number-flow-char-height, 1em)", y = "var(--number-flow-mask-height, 0.25em)", P = `calc(${y} / 2)`, j = "var(--number-flow-mask-width, 0.5em)", _ = `calc(${j} / var(--scale-x))`, b = "#000 0, transparent 71%", B = ct`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${ft} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${N}) / var(--width));transform:translateX(var(${$})) scaleX(var(--scale-x));margin:0 calc(-1 * ${j});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${_},#000 calc(100% - ${_}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${y},#000 calc(100% - ${y}),transparent 100% ),radial-gradient(at bottom right,${b}),radial-gradient(at bottom left,${b}),radial-gradient(at top left,${b}),radial-gradient(at top right,${b});-webkit-mask-size:100% calc(100% - ${y} * 2),calc(100% - ${_} * 2) 100%,${_} ${y},${_} ${y},${_} ${y},${_} ${y};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${P} ${j};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${$})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${M})}.digit__num,.number .section::after{padding:${P} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${R}))}`, mt = HTMLElement, z = ut && dt && pt;
101
+ })(), ft = "var(--number-flow-char-height, 1em)", y = "var(--number-flow-mask-height, 0.25em)", P = `calc(${y} / 2)`, k = "var(--number-flow-mask-width, 0.5em)", _ = `calc(${k} / var(--scale-x))`, b = "#000 0, transparent 71%", I = ct`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${ft} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${N}) / var(--width));transform:translateX(var(${$})) scaleX(var(--scale-x));margin:0 calc(-1 * ${k});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${_},#000 calc(100% - ${_}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${y},#000 calc(100% - ${y}),transparent 100% ),radial-gradient(at bottom right,${b}),radial-gradient(at bottom left,${b}),radial-gradient(at top left,${b}),radial-gradient(at top right,${b});-webkit-mask-size:100% calc(100% - ${y} * 2),calc(100% - ${_} * 2) 100%,${_} ${y},${_} ${y},${_} ${y},${_} ${y};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${P} ${k};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${$})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${M})}.digit__num,.number .section::after{padding:${P} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${C}))}`, mt = HTMLElement, H = ut && dt && pt;
102
102
  let S;
103
- class H extends mt {
103
+ class z extends mt {
104
104
  constructor() {
105
105
  super(), this.created = !1, this.batched = !1;
106
106
  const { animated: t, ...e } = this.constructor.defaultProps;
@@ -123,7 +123,7 @@ class H extends mt {
123
123
  const { pre: i, integer: s, fraction: r, post: a, value: o } = t;
124
124
  if (this.created) {
125
125
  const l = this._data;
126
- this._data = t, this.computedTrend = typeof this.trend == "function" ? this.trend(l.value, o) : this.trend, this.computedAnimated = z && this._animated && (!this.respectMotionPreference || !(p != null && p.matches)) && // https://github.com/barvian/number-flow/issues/9
126
+ this._data = t, this.computedTrend = typeof this.trend == "function" ? this.trend(l.value, o) : this.trend, this.computedAnimated = H && this._animated && (!this.respectMotionPreference || !(p != null && p.matches)) && // https://github.com/barvian/number-flow/issues/9
127
127
  rt(this), (e = this.plugins) == null || e.forEach((d) => {
128
128
  var u;
129
129
  return (u = d.onUpdate) == null ? void 0 : u.call(d, t, l, this);
@@ -135,10 +135,10 @@ class H extends mt {
135
135
  } catch {
136
136
  }
137
137
  if (typeof CSSStyleSheet < "u" && this.shadowRoot.adoptedStyleSheets)
138
- S || (S = new CSSStyleSheet(), S.replaceSync(B)), this.shadowRoot.adoptedStyleSheets = [S];
138
+ S || (S = new CSSStyleSheet(), S.replaceSync(I)), this.shadowRoot.adoptedStyleSheets = [S];
139
139
  else {
140
140
  const l = document.createElement("style");
141
- l.textContent = B, this.shadowRoot.appendChild(l);
141
+ l.textContent = I, this.shadowRoot.appendChild(l);
142
142
  }
143
143
  this._pre = new V(this, i, {
144
144
  justify: "right",
@@ -172,7 +172,7 @@ class H extends mt {
172
172
  }), this._abortAnimationsFinish = t;
173
173
  }
174
174
  }
175
- H.defaultProps = {
175
+ z.defaultProps = {
176
176
  transformTiming: {
177
177
  duration: 900,
178
178
  // Make sure to keep this minified:
@@ -303,13 +303,13 @@ class V extends J {
303
303
  }), this.pop(e), this.addNewAndUpdateExisting(t);
304
304
  }
305
305
  }
306
- class k {
306
+ class j {
307
307
  constructor(t, e, { onRemove: i, animateIn: s = !1 } = {}) {
308
308
  this.flow = t, this.el = e, this._present = !0, this._remove = () => {
309
309
  var r;
310
310
  this.el.remove(), (r = this._onRemove) == null || r.call(this);
311
311
  }, this.el.classList.add("animate-presence"), this.flow.computedAnimated && s && this.el.animate({
312
- [R]: [-0.9999, 0]
312
+ [C]: [-0.9999, 0]
313
313
  }, {
314
314
  ...this.flow.opacityTiming,
315
315
  composite: "accumulate"
@@ -325,7 +325,7 @@ class k {
325
325
  return;
326
326
  }
327
327
  this.el.style.setProperty("--_number-flow-d-opacity", t ? "0" : "-.999"), this.el.animate({
328
- [R]: t ? [-0.9999, 0] : [0.999, 0]
328
+ [C]: t ? [-0.9999, 0] : [0.999, 0]
329
329
  }, {
330
330
  ...this.flow.opacityTiming,
331
331
  composite: "accumulate"
@@ -335,7 +335,7 @@ class k {
335
335
  }
336
336
  }
337
337
  }
338
- class G extends k {
338
+ class G extends j {
339
339
  constructor(t, e, i, s) {
340
340
  super(t.flow, i, s), this.section = t, this.value = e, this.el = i;
341
341
  }
@@ -404,7 +404,7 @@ class yt extends G {
404
404
  className: "symbol"
405
405
  }, [r]), s), this.type = e, this._children = /* @__PURE__ */ new Map(), this._onChildRemove = (a) => () => {
406
406
  this._children.delete(a);
407
- }, this._children.set(i, new k(this.flow, r, {
407
+ }, this._children.set(i, new j(this.flow, r, {
408
408
  onRemove: this._onChildRemove(i)
409
409
  }));
410
410
  }
@@ -426,7 +426,7 @@ class yt extends G {
426
426
  className: "symbol__value",
427
427
  textContent: t
428
428
  });
429
- this.el.appendChild(s), this._children.set(t, new k(this.flow, s, {
429
+ this.el.appendChild(s), this._children.set(t, new j(this.flow, s, {
430
430
  animateIn: !0,
431
431
  onRemove: this._onChildRemove(t)
432
432
  }));
@@ -444,18 +444,18 @@ class yt extends G {
444
444
  }
445
445
  }
446
446
  var W;
447
- const vt = parseInt((W = st.match(/^(\d+)\./)) == null ? void 0 : W[1]), L = vt >= 19, _t = [
447
+ const vt = parseInt((W = st.match(/^(\d+)\./)) == null ? void 0 : W[1]), F = vt >= 19, _t = [
448
448
  "data",
449
449
  "digits"
450
450
  ];
451
- class F extends H {
451
+ class L extends z {
452
452
  attributeChangedCallback(t, e, i) {
453
453
  this[t] = JSON.parse(i);
454
454
  }
455
455
  }
456
- F.observedAttributes = L ? [] : _t;
457
- ot("number-flow-react", F);
458
- const U = {}, I = L ? (n) => n : JSON.stringify;
456
+ L.observedAttributes = F ? [] : _t;
457
+ ot("number-flow-react", L);
458
+ const U = {}, B = F ? (n) => n : JSON.stringify;
459
459
  function D(n) {
460
460
  const { transformTiming: t, spinTiming: e, opacityTiming: i, animated: s, respectMotionPreference: r, trend: a, plugins: o, ...l } = n;
461
461
  return [
@@ -479,11 +479,11 @@ class wt extends it {
479
479
  this.el.batched = !this.props.isolate;
480
480
  const [e] = D(this.props);
481
481
  Object.entries(e).forEach(([i, s]) => {
482
- this.el[i] = s ?? F.defaultProps[i];
482
+ this.el[i] = s ?? L.defaultProps[i];
483
483
  }), t != null && t.onAnimationsStart && this.el.removeEventListener("animationsstart", t.onAnimationsStart), this.props.onAnimationsStart && this.el.addEventListener("animationsstart", this.props.onAnimationsStart), t != null && t.onAnimationsFinish && this.el.removeEventListener("animationsfinish", t.onAnimationsFinish), this.props.onAnimationsFinish && this.el.addEventListener("animationsfinish", this.props.onAnimationsFinish);
484
484
  }
485
485
  componentDidMount() {
486
- this.updateProperties(), L && this.el && (this.el.digits = this.props.digits, this.el.data = this.props.data);
486
+ this.updateProperties(), F && this.el && (this.el.digits = this.props.digits, this.el.data = this.props.data);
487
487
  }
488
488
  getSnapshotBeforeUpdate(t) {
489
489
  var e;
@@ -521,9 +521,9 @@ class wt extends it {
521
521
  __html: ""
522
522
  },
523
523
  suppressHydrationWarning: !0,
524
- digits: I(l),
524
+ digits: B(l),
525
525
  // Make sure data is set last, everything else is updated:
526
- data: I(s)
526
+ data: B(s)
527
527
  })
528
528
  );
529
529
  }
@@ -531,15 +531,15 @@ class wt extends it {
531
531
  super(t), this.handleRef = this.handleRef.bind(this);
532
532
  }
533
533
  }
534
- const Rt = /* @__PURE__ */ q(function({ value: t, locales: e, format: i, prefix: s, suffix: r, ...a }, o) {
534
+ const Ct = /* @__PURE__ */ q(function({ value: t, locales: e, format: i, prefix: s, suffix: r, ...a }, o) {
535
535
  tt(o, () => l.current, []);
536
- const l = C(), d = et(Z);
536
+ const l = E(), d = et(Z);
537
537
  d == null || d.useRegister(l);
538
- const u = E(() => e ? JSON.stringify(e) : "", [
538
+ const u = R(() => e ? JSON.stringify(e) : "", [
539
539
  e
540
- ]), f = E(() => i ? JSON.stringify(i) : "", [
540
+ ]), f = R(() => i ? JSON.stringify(i) : "", [
541
541
  i
542
- ]), m = E(() => {
542
+ ]), m = R(() => {
543
543
  var w;
544
544
  const g = U[w = `${u}:${f}`] ?? (U[w] = new Intl.NumberFormat(e, i));
545
545
  return ht(t, g, s, r);
@@ -558,7 +558,7 @@ const Rt = /* @__PURE__ */ q(function({ value: t, locales: e, format: i, prefix:
558
558
  });
559
559
  }), Z = /* @__PURE__ */ K(void 0);
560
560
  function $t({ children: n }) {
561
- const t = C(/* @__PURE__ */ new Set()), e = C(!1), i = C(/* @__PURE__ */ new WeakMap()), s = E(() => ({
561
+ const t = E(/* @__PURE__ */ new Set()), e = E(!1), i = E(/* @__PURE__ */ new WeakMap()), s = R(() => ({
562
562
  useRegister(r) {
563
563
  Q(() => (t.current.add(r), () => {
564
564
  t.current.delete(r);
@@ -582,18 +582,18 @@ function $t({ children: n }) {
582
582
  }, n);
583
583
  }
584
584
  const bt = () => X(() => () => {
585
- }, () => z, () => !1), St = () => X((n) => (p == null || p.addEventListener("change", n), () => p == null ? void 0 : p.removeEventListener("change", n)), () => p.matches, () => !1);
585
+ }, () => H, () => !1), St = () => X((n) => (p == null || p.addEventListener("change", n), () => p == null ? void 0 : p.removeEventListener("change", n)), () => p.matches, () => !1);
586
586
  function xt({ respectMotionPreference: n = !0 } = {}) {
587
587
  const t = bt(), e = St();
588
588
  return t && (!n || !e);
589
589
  }
590
590
  export {
591
- F as NumberFlowElement,
591
+ L as NumberFlowElement,
592
592
  $t as NumberFlowGroup,
593
- Et as continuous,
594
- Rt as default,
593
+ Rt as continuous,
594
+ Ct as default,
595
595
  xt as useCanAnimate,
596
596
  bt as useIsSupported,
597
597
  St as usePrefersReducedMotion
598
598
  };
599
- //# sourceMappingURL=index-BdcW7GlH.mjs.map
599
+ //# sourceMappingURL=index-jhjmoHwu.mjs.map