phanpy-cz/assets/main-e75P80UH.js.map
2024-10-16 19:47:13 +02:00

1 line
1.2 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"main-e75P80UH.js","sources":["../../node_modules/just-debounce-it/index.mjs","../../node_modules/swiped-events/src/swiped-events.js","../../src/utils/usePageVisibility.js","../../src/components/background-service.jsx","../../src/components/compose-button.jsx","../../src/components/keyboard-shortcuts-help.jsx","../../node_modules/@formkit/auto-animate/index.mjs","../../node_modules/@formkit/auto-animate/preact/index.mjs","../../src/pages/accounts.jsx","../../src/assets/logo.svg","../../src/components/lang-selector.jsx","../../src/utils/push-notifications.js","../../src/pages/settings.jsx","../../src/utils/focus-deck.js","../../src/utils/useLocationChange.js","../../src/utils/lists.js","../../src/components/list-add-edit.jsx","../../src/components/account-info.jsx","../../src/components/account-sheet.jsx","../../src/components/drafts.jsx","../../src/components/embed-modal.jsx","../../src/components/generic-accounts.jsx","../../src/components/media-alt-modal.jsx","../../src/utils/color-utils.js","../../src/components/media-modal.jsx","../../src/components/report-modal.jsx","../../node_modules/lz-string/libs/lz-string.js","../../src/assets/floating-button.svg","../../src/assets/multi-column.svg","../../src/assets/tab-menu-bar.svg","../../src/utils/followed-tags.js","../../src/components/AsyncText.jsx","../../src/components/shortcuts-settings.jsx","../../src/components/modals.jsx","../../src/components/follow-request-buttons.jsx","../../src/components/notification.jsx","../../src/components/notification-service.jsx","../../src/components/search-form.jsx","../../src/components/search-command.jsx","../../src/components/shortcuts.jsx","../../src/utils/timeline-utils.js","../../src/utils/useScroll.js","../../src/utils/useScrollFn.js","../../src/components/media-post.jsx","../../src/components/nav-menu.jsx","../../src/components/timeline.jsx","../../src/pages/account-statuses.jsx","../../src/pages/bookmarks.jsx","../../src/assets/features/catch-up.png","../../src/pages/catchup.jsx","../../src/pages/favourites.jsx","../../src/pages/filters.jsx","../../src/pages/followed-hashtags.jsx","../../src/pages/following.jsx","../../src/pages/hashtag.jsx","../../src/pages/list.jsx","../../src/utils/group-notifications.js","../../src/pages/mentions.jsx","../../src/pages/notifications.jsx","../../src/pages/public.jsx","../../src/pages/search.jsx","../../src/pages/trending.jsx","../../src/components/columns.jsx","../../src/pages/home.jsx","../../src/utils/get-instance-status-url.js","../../src/pages/http-route.jsx","../../src/pages/lists.jsx","../../src/data/instances.json?url","../../src/utils/oauth-pkce.js","../../src/utils/auth.js","../../src/pages/login.jsx","../../src/pages/status.jsx","../../src/pages/status-route.jsx","../../src/assets/features/boosts-carousel.jpg","../../src/assets/features/grouped-notifications.jpg","../../src/assets/features/multi-column.jpg","../../src/assets/features/multi-hashtag-timeline.jpg","../../src/assets/features/nested-comments-thread.jpg","../../src/assets/logo-text.svg","../../src/pages/welcome.jsx","../../src/utils/toast-alert.js","../../src/app.jsx","../../src/main.jsx"],"sourcesContent":["var functionDebounce = debounce;\n\nfunction debounce(fn, wait, callFirst) {\n var timeout = null;\n var debouncedFn = null;\n\n var clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n\n debouncedFn = null;\n timeout = null;\n }\n };\n\n var flush = function() {\n var call = debouncedFn;\n clear();\n\n if (call) {\n call();\n }\n };\n\n var debounceWrapper = function() {\n if (!wait) {\n return fn.apply(this, arguments);\n }\n\n var context = this;\n var args = arguments;\n var callNow = callFirst && !timeout;\n clear();\n\n debouncedFn = function() {\n fn.apply(context, args);\n };\n\n timeout = setTimeout(function() {\n timeout = null;\n\n if (!callNow) {\n var call = debouncedFn;\n debouncedFn = null;\n\n return call();\n }\n }, wait);\n\n if (callNow) {\n return debouncedFn();\n }\n };\n\n debounceWrapper.cancel = clear;\n debounceWrapper.flush = flush;\n\n return debounceWrapper;\n}\n\nexport {functionDebounce as default};\n","/*!\n * swiped-events.js - v@version@\n * Pure JavaScript swipe events\n * https://github.com/john-doherty/swiped-events\n * @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element\n * @author John Doherty <www.johndoherty.info>\n * @license MIT\n */\n(function (window, document) {\n\n 'use strict';\n\n // patch CustomEvent to allow constructor creation (IE/Chrome)\n if (typeof window.CustomEvent !== 'function') {\n\n window.CustomEvent = function (event, params) {\n\n params = params || { bubbles: false, cancelable: false, detail: undefined };\n\n var evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n\n window.CustomEvent.prototype = window.Event.prototype;\n }\n\n document.addEventListener('touchstart', handleTouchStart, false);\n document.addEventListener('touchmove', handleTouchMove, false);\n document.addEventListener('touchend', handleTouchEnd, false);\n\n var xDown = null;\n var yDown = null;\n var xDiff = null;\n var yDiff = null;\n var timeDown = null;\n var startEl = null;\n var touchCount = 0;\n\n /**\n * Fires swiped event if swipe detected on touchend\n * @param {object} e - browser event object\n * @returns {void}\n */\n function handleTouchEnd(e) {\n\n // if the user released on a different target, cancel!\n if (startEl !== e.target) return;\n\n var swipeThreshold = parseInt(getNearestAttribute(startEl, 'data-swipe-threshold', '20'), 10); // default 20 units\n var swipeUnit = getNearestAttribute(startEl, 'data-swipe-unit', 'px'); // default px\n var swipeTimeout = parseInt(getNearestAttribute(startEl, 'data-swipe-timeout', '500'), 10); // default 500ms\n var timeDiff = Date.now() - timeDown;\n var eventType = '';\n var changedTouches = e.changedTouches || e.touches || [];\n\n if (swipeUnit === 'vh') {\n swipeThreshold = Math.round((swipeThreshold / 100) * document.documentElement.clientHeight); // get percentage of viewport height in pixels\n }\n if (swipeUnit === 'vw') {\n swipeThreshold = Math.round((swipeThreshold / 100) * document.documentElement.clientWidth); // get percentage of viewport height in pixels\n }\n\n if (Math.abs(xDiff) > Math.abs(yDiff)) { // most significant\n if (Math.abs(xDiff) > swipeThreshold && timeDiff < swipeTimeout) {\n if (xDiff > 0) {\n eventType = 'swiped-left';\n }\n else {\n eventType = 'swiped-right';\n }\n }\n }\n else if (Math.abs(yDiff) > swipeThreshold && timeDiff < swipeTimeout) {\n if (yDiff > 0) {\n eventType = 'swiped-up';\n }\n else {\n eventType = 'swiped-down';\n }\n }\n\n if (eventType !== '') {\n\n var eventData = {\n dir: eventType.replace(/swiped-/, ''),\n touchType: (changedTouches[0] || {}).touchType || 'direct',\n fingers: touchCount, // Number of fingers used\n xStart: parseInt(xDown, 10),\n xEnd: parseInt((changedTouches[0] || {}).clientX || -1, 10),\n yStart: parseInt(yDown, 10),\n yEnd: parseInt((changedTouches[0] || {}).clientY || -1, 10)\n };\n\n // fire `swiped` event event on the element that started the swipe\n startEl.dispatchEvent(new CustomEvent('swiped', { bubbles: true, cancelable: true, detail: eventData }));\n\n // fire `swiped-dir` event on the element that started the swipe\n startEl.dispatchEvent(new CustomEvent(eventType, { bubbles: true, cancelable: true, detail: eventData }));\n }\n\n // reset values\n xDown = null;\n yDown = null;\n timeDown = null;\n }\n /**\n * Records current location on touchstart event\n * @param {object} e - browser event object\n * @returns {void}\n */\n function handleTouchStart(e) {\n\n // if the element has data-swipe-ignore=\"true\" we stop listening for swipe events\n if (e.target.getAttribute('data-swipe-ignore') === 'true') return;\n\n startEl = e.target;\n\n timeDown = Date.now();\n xDown = e.touches[0].clientX;\n yDown = e.touches[0].clientY;\n xDiff = 0;\n yDiff = 0;\n touchCount = e.touches.length;\n }\n\n /**\n * Records location diff in px on touchmove event\n * @param {object} e - browser event object\n * @returns {void}\n */\n function handleTouchMove(e) {\n\n if (!xDown || !yDown) return;\n\n var xUp = e.touches[0].clientX;\n var yUp = e.touches[0].clientY;\n\n xDiff = xDown - xUp;\n yDiff = yDown - yUp;\n }\n\n /**\n * Gets attribute off HTML element or nearest parent\n * @param {object} el - HTML element to retrieve attribute from\n * @param {string} attributeName - name of the attribute\n * @param {any} defaultValue - default value to return if no match found\n * @returns {any} attribute value or defaultValue\n */\n function getNearestAttribute(el, attributeName, defaultValue) {\n\n // walk up the dom tree looking for attributeName\n while (el && el !== document.documentElement) {\n\n var attributeValue = el.getAttribute(attributeName);\n\n if (attributeValue) {\n return attributeValue;\n }\n\n el = el.parentNode;\n }\n\n return defaultValue;\n }\n\n}(window, document));\n","import { useEffect, useRef } from 'preact/hooks';\n\nexport default function usePageVisibility(fn = () => {}, deps = []) {\n const savedCallback = useRef(fn);\n useEffect(() => {\n savedCallback.current = fn;\n }, [deps]);\n\n useEffect(() => {\n const handleVisibilityChange = () => {\n const hidden = document.hidden || document.visibilityState === 'hidden';\n console.log('👀 Page visibility changed', hidden ? 'hidden' : 'visible');\n savedCallback.current(!hidden);\n };\n\n document.addEventListener('visibilitychange', handleVisibilityChange);\n return () =>\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n }, []);\n}\n","import { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport { api } from '../utils/api';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport useInterval from '../utils/useInterval';\nimport usePageVisibility from '../utils/usePageVisibility';\n\nconst STREAMING_TIMEOUT = 1000 * 3; // 3 seconds\nconst POLL_INTERVAL = 20_000; // 20 seconds\n\nexport default memo(function BackgroundService({ isLoggedIn }) {\n // Notifications service\n // - WebSocket to receive notifications when page is visible\n const [visible, setVisible] = useState(true);\n const visibleTimeout = useRef();\n usePageVisibility((visible) => {\n clearTimeout(visibleTimeout.current);\n if (visible) {\n setVisible(true);\n } else {\n visibleTimeout.current = setTimeout(() => {\n setVisible(false);\n }, POLL_INTERVAL);\n }\n });\n\n const checkLatestNotification = async (masto, instance, skipCheckMarkers) => {\n if (states.notificationsLast) {\n const notificationsIterator = masto.v1.notifications.list({\n limit: 1,\n sinceId: states.notificationsLast.id,\n });\n const { value: notifications } = await notificationsIterator.next();\n if (notifications?.length) {\n if (skipCheckMarkers) {\n states.notificationsShowNew = true;\n } else {\n let lastReadId;\n try {\n const markers = await masto.v1.markers.fetch({\n timeline: 'notifications',\n });\n lastReadId = markers?.notifications?.lastReadId;\n } catch (e) {}\n if (lastReadId) {\n states.notificationsShowNew = notifications[0].id !== lastReadId;\n } else {\n states.notificationsShowNew = true;\n }\n }\n }\n }\n };\n\n useEffect(() => {\n let sub;\n let streamTimeout;\n let pollNotifications;\n if (isLoggedIn && visible) {\n const { masto, streaming, instance } = api();\n (async () => {\n // 1. Get the latest notification\n await checkLatestNotification(masto, instance);\n\n let hasStreaming = false;\n // 2. Start streaming\n if (streaming) {\n streamTimeout = setTimeout(() => {\n (async () => {\n try {\n hasStreaming = true;\n sub = streaming.user.notification.subscribe();\n console.log('🎏 Streaming notification', sub);\n for await (const entry of sub) {\n if (!sub) break;\n if (!visible) break;\n console.log('🔔🔔 Notification entry', entry);\n if (entry.event === 'notification') {\n console.log('🔔🔔 Notification', entry);\n saveStatus(entry.payload, instance, {\n skipThreading: true,\n });\n }\n states.notificationsShowNew = true;\n }\n console.log('💥 Streaming notification loop STOPPED');\n } catch (e) {\n hasStreaming = false;\n console.error(e);\n }\n\n if (!hasStreaming) {\n console.log('🎏 Streaming failed, fallback to polling');\n pollNotifications = setInterval(() => {\n checkLatestNotification(masto, instance, true);\n }, POLL_INTERVAL);\n }\n })();\n }, STREAMING_TIMEOUT);\n }\n })();\n }\n return () => {\n sub?.unsubscribe?.();\n sub = null;\n clearTimeout(streamTimeout);\n clearInterval(pollNotifications);\n };\n }, [visible, isLoggedIn]);\n\n // Check for updates service\n const lastCheckDate = useRef();\n const checkForUpdates = () => {\n lastCheckDate.current = Date.now();\n console.log('✨ Check app update');\n fetch('./version.json')\n .then((r) => r.json())\n .then((info) => {\n if (info) states.appVersion = info;\n })\n .catch((e) => {\n console.error(e);\n });\n };\n useInterval(checkForUpdates, visible && 1000 * 60 * 30); // 30 minutes\n usePageVisibility((visible) => {\n if (visible) {\n if (!lastCheckDate.current) {\n checkForUpdates();\n } else {\n const diff = Date.now() - lastCheckDate.current;\n if (diff > 1000 * 60 * 60) {\n // 1 hour\n checkForUpdates();\n }\n }\n }\n });\n\n // Global keyboard shortcuts \"service\"\n useHotkeys('shift+alt+k', () => {\n const currentCloakMode = states.settings.cloakMode;\n states.settings.cloakMode = !currentCloakMode;\n showToast({\n text: currentCloakMode ? t`Cloak mode disabled` : t`Cloak mode enabled`,\n });\n });\n\n return null;\n});\n","import { t, Trans } from '@lingui/macro';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSnapshot } from 'valtio';\n\nimport openCompose from '../utils/open-compose';\nimport openOSK from '../utils/open-osk';\nimport states from '../utils/states';\n\nimport Icon from './icon';\n\nexport default function ComposeButton() {\n const snapStates = useSnapshot(states);\n\n function handleButton(e) {\n if (snapStates.composerState.minimized) {\n states.composerState.minimized = false;\n openOSK();\n return;\n }\n\n if (e.shiftKey) {\n const newWin = openCompose();\n\n if (!newWin) {\n states.showCompose = true;\n }\n } else {\n openOSK();\n states.showCompose = true;\n }\n }\n\n useHotkeys('c, shift+c', handleButton, {\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n });\n\n return (\n <button\n type=\"button\"\n id=\"compose-button\"\n onClick={handleButton}\n class={`${snapStates.composerState.minimized ? 'min' : ''} ${\n snapStates.composerState.publishing ? 'loading' : ''\n } ${snapStates.composerState.publishingError ? 'error' : ''}`}\n >\n <Icon icon=\"quill\" size=\"xl\" alt={t`Compose`} />\n </button>\n );\n}\n","import './keyboard-shortcuts-help.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSnapshot } from 'valtio';\n\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Modal from './modal';\n\nexport default memo(function KeyboardShortcutsHelp() {\n const snapStates = useSnapshot(states);\n\n function onClose() {\n states.showKeyboardShortcutsHelp = false;\n }\n\n useHotkeys(\n '?, shift+?, shift+slash',\n (e) => {\n console.log('help');\n states.showKeyboardShortcutsHelp = true;\n },\n {\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n },\n );\n\n return (\n !!snapStates.showKeyboardShortcutsHelp && (\n <Modal onClose={onClose}>\n <div id=\"keyboard-shortcuts-help-container\" class=\"sheet\" tabindex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>\n <Trans>Keyboard shortcuts</Trans>\n </h2>\n </header>\n <main>\n <table>\n <tbody>\n {[\n {\n action: t`Keyboard shortcuts help`,\n keys: <kbd>?</kbd>,\n },\n {\n action: t`Next post`,\n keys: <kbd>j</kbd>,\n },\n {\n action: t`Previous post`,\n keys: <kbd>k</kbd>,\n },\n {\n action: t`Skip carousel to next post`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>j</kbd>\n </Trans>\n ),\n },\n {\n action: t`Skip carousel to previous post`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>k</kbd>\n </Trans>\n ),\n },\n {\n action: t`Load new posts`,\n keys: <kbd>.</kbd>,\n },\n {\n action: t`Open post details`,\n keys: (\n <Trans>\n <kbd>Enter</kbd> or <kbd>o</kbd>\n </Trans>\n ),\n },\n {\n action: (\n <Trans>\n Expand content warning or\n <br />\n toggle expanded/collapsed thread\n </Trans>\n ),\n keys: <kbd>x</kbd>,\n },\n {\n action: t`Close post or dialogs`,\n keys: (\n <Trans>\n <kbd>Esc</kbd> or <kbd>Backspace</kbd>\n </Trans>\n ),\n },\n {\n action: t`Focus column in multi-column mode`,\n keys: (\n <Trans>\n <kbd>1</kbd> to <kbd>9</kbd>\n </Trans>\n ),\n },\n {\n action: t`Compose new post`,\n keys: <kbd>c</kbd>,\n },\n {\n action: t`Compose new post (new window)`,\n className: 'insignificant',\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>c</kbd>\n </Trans>\n ),\n },\n {\n action: t`Send post`,\n keys: (\n <Trans>\n <kbd>Ctrl</kbd> + <kbd>Enter</kbd> or <kbd>⌘</kbd> +{' '}\n <kbd>Enter</kbd>\n </Trans>\n ),\n },\n {\n action: t`Search`,\n keys: <kbd>/</kbd>,\n },\n {\n action: t`Reply`,\n keys: <kbd>r</kbd>,\n },\n {\n action: t`Reply (new window)`,\n className: 'insignificant',\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>r</kbd>\n </Trans>\n ),\n },\n {\n action: t`Like (favourite)`,\n keys: (\n <Trans>\n <kbd>l</kbd> or <kbd>f</kbd>\n </Trans>\n ),\n },\n {\n action: t`Boost`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>b</kbd>\n </Trans>\n ),\n },\n {\n action: t`Bookmark`,\n keys: <kbd>d</kbd>,\n },\n {\n action: t`Toggle Cloak mode`,\n keys: (\n <Trans>\n <kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>k</kbd>\n </Trans>\n ),\n },\n ].map(({ action, className, keys }) => (\n <tr key={action}>\n <th class={className}>{action}</th>\n <td>{keys}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </main>\n </div>\n </Modal>\n )\n );\n});\n","/**\n * A set of all the parents currently being observe. This is the only non weak\n * registry.\n */\nconst parents = new Set();\n/**\n * Element coordinates that is constantly kept up to date.\n */\nconst coords = new WeakMap();\n/**\n * Siblings of elements that have been removed from the dom.\n */\nconst siblings = new WeakMap();\n/**\n * Animations that are currently running.\n */\nconst animations = new WeakMap();\n/**\n * A map of existing intersection observers used to track element movements.\n */\nconst intersections = new WeakMap();\n/**\n * Intervals for automatically checking the position of elements occasionally.\n */\nconst intervals = new WeakMap();\n/**\n * The configuration options for each group of elements.\n */\nconst options = new WeakMap();\n/**\n * Debounce counters by id, used to debounce calls to update positions.\n */\nconst debounces = new WeakMap();\n/**\n * All parents that are currently enabled are tracked here.\n */\nconst enabled = new WeakSet();\n/**\n * The document used to calculate transitions.\n */\nlet root;\n/**\n * The roots XY scroll positions.\n */\nlet scrollX = 0;\nlet scrollY = 0;\n/**\n * Used to sign an element as the target.\n */\nconst TGT = \"__aa_tgt\";\n/**\n * Used to sign an element as being part of a removal.\n */\nconst DEL = \"__aa_del\";\n/**\n * Used to sign an element as being \"new\". When an element is removed from the\n * dom, but may cycle back in we can sign it with new to ensure the next time\n * it is recognized we consider it new.\n */\nconst NEW = \"__aa_new\";\n/**\n * Callback for handling all mutations.\n * @param mutations - A mutation list\n */\nconst handleMutations = (mutations) => {\n const elements = getElements(mutations);\n // If elements is \"false\" that means this mutation that should be ignored.\n if (elements) {\n elements.forEach((el) => animate(el));\n }\n};\n/**\n *\n * @param entries - Elements that have been resized.\n */\nconst handleResizes = (entries) => {\n entries.forEach((entry) => {\n if (entry.target === root)\n updateAllPos();\n if (coords.has(entry.target))\n updatePos(entry.target);\n });\n};\n/**\n * Observe this elements position.\n * @param el - The element to observe the position of.\n */\nfunction observePosition(el) {\n const oldObserver = intersections.get(el);\n oldObserver === null || oldObserver === void 0 ? void 0 : oldObserver.disconnect();\n let rect = coords.get(el);\n let invocations = 0;\n const buffer = 5;\n if (!rect) {\n rect = getCoords(el);\n coords.set(el, rect);\n }\n const { offsetWidth, offsetHeight } = root;\n const rootMargins = [\n rect.top - buffer,\n offsetWidth - (rect.left + buffer + rect.width),\n offsetHeight - (rect.top + buffer + rect.height),\n rect.left - buffer,\n ];\n const rootMargin = rootMargins\n .map((px) => `${-1 * Math.floor(px)}px`)\n .join(\" \");\n const observer = new IntersectionObserver(() => {\n ++invocations > 1 && updatePos(el);\n }, {\n root,\n threshold: 1,\n rootMargin,\n });\n observer.observe(el);\n intersections.set(el, observer);\n}\n/**\n * Update the exact position of a given element.\n * @param el - An element to update the position of.\n */\nfunction updatePos(el) {\n clearTimeout(debounces.get(el));\n const optionsOrPlugin = getOptions(el);\n const delay = isPlugin(optionsOrPlugin) ? 500 : optionsOrPlugin.duration;\n debounces.set(el, setTimeout(async () => {\n const currentAnimation = animations.get(el);\n try {\n await (currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.finished);\n coords.set(el, getCoords(el));\n observePosition(el);\n }\n catch {\n // ignore errors as the `.finished` promise is rejected when animations were cancelled\n }\n }, delay));\n}\n/**\n * Updates all positions that are currently being tracked.\n */\nfunction updateAllPos() {\n clearTimeout(debounces.get(root));\n debounces.set(root, setTimeout(() => {\n parents.forEach((parent) => forEach(parent, (el) => lowPriority(() => updatePos(el))));\n }, 100));\n}\n/**\n * Its possible for a quick scroll or other fast events to get past the\n * intersection observer, so occasionally we need want \"cold-poll\" for the\n * latests and greatest position. We try to do this in the most non-disruptive\n * fashion possible. First we only do this ever couple seconds, staggard by a\n * random offset.\n * @param el - Element\n */\nfunction poll(el) {\n setTimeout(() => {\n intervals.set(el, setInterval(() => lowPriority(updatePos.bind(null, el)), 2000));\n }, Math.round(2000 * Math.random()));\n}\n/**\n * Perform some operation that is non critical at some point.\n * @param callback\n */\nfunction lowPriority(callback) {\n if (typeof requestIdleCallback === \"function\") {\n requestIdleCallback(() => callback());\n }\n else {\n requestAnimationFrame(() => callback());\n }\n}\n/**\n * The mutation observer responsible for watching each root element.\n */\nlet mutations;\n/**\n * A resize observer, responsible for recalculating elements on resize.\n */\nlet resize;\n/**\n * Ensure the browser is supported.\n */\nconst supportedBrowser = typeof window !== \"undefined\" && \"ResizeObserver\" in window;\n/**\n * If this is in a browser, initialize our Web APIs\n */\nif (supportedBrowser) {\n root = document.documentElement;\n mutations = new MutationObserver(handleMutations);\n resize = new ResizeObserver(handleResizes);\n window.addEventListener(\"scroll\", () => {\n scrollY = window.scrollY;\n scrollX = window.scrollX;\n });\n resize.observe(root);\n}\n/**\n * Retrieves all the elements that may have been affected by the last mutation\n * including ones that have been removed and are no longer in the DOM.\n * @param mutations - A mutation list.\n * @returns\n */\nfunction getElements(mutations) {\n const observedNodes = mutations.reduce((nodes, mutation) => {\n return [\n ...nodes,\n ...Array.from(mutation.addedNodes),\n ...Array.from(mutation.removedNodes),\n ];\n }, []);\n // Short circuit if _only_ comment nodes are observed\n const onlyCommentNodesObserved = observedNodes.every((node) => node.nodeName === \"#comment\");\n if (onlyCommentNodesObserved)\n return false;\n return mutations.reduce((elements, mutation) => {\n // Short circuit if we find a purposefully deleted node.\n if (elements === false)\n return false;\n if (mutation.target instanceof Element) {\n target(mutation.target);\n if (!elements.has(mutation.target)) {\n elements.add(mutation.target);\n for (let i = 0; i < mutation.target.children.length; i++) {\n const child = mutation.target.children.item(i);\n if (!child)\n continue;\n if (DEL in child) {\n return false;\n }\n target(mutation.target, child);\n elements.add(child);\n }\n }\n if (mutation.removedNodes.length) {\n for (let i = 0; i < mutation.removedNodes.length; i++) {\n const child = mutation.removedNodes[i];\n if (DEL in child) {\n return false;\n }\n if (child instanceof Element) {\n elements.add(child);\n target(mutation.target, child);\n siblings.set(child, [\n mutation.previousSibling,\n mutation.nextSibling,\n ]);\n }\n }\n }\n }\n return elements;\n }, new Set());\n}\n/**\n * Assign the target to an element.\n * @param el - The root element\n * @param child\n */\nfunction target(el, child) {\n if (!child && !(TGT in el))\n Object.defineProperty(el, TGT, { value: el });\n else if (child && !(TGT in child))\n Object.defineProperty(child, TGT, { value: el });\n}\n/**\n * Determines what kind of change took place on the given element and then\n * performs the proper animation based on that.\n * @param el - The specific element to animate.\n */\nfunction animate(el) {\n var _a;\n const isMounted = el.isConnected;\n const preExisting = coords.has(el);\n if (isMounted && siblings.has(el))\n siblings.delete(el);\n if (animations.has(el)) {\n (_a = animations.get(el)) === null || _a === void 0 ? void 0 : _a.cancel();\n }\n if (NEW in el) {\n add(el);\n }\n else if (preExisting && isMounted) {\n remain(el);\n }\n else if (preExisting && !isMounted) {\n remove(el);\n }\n else {\n add(el);\n }\n}\n/**\n * Removes all non-digits from a string and casts to a number.\n * @param str - A string containing a pixel value.\n * @returns\n */\nfunction raw(str) {\n return Number(str.replace(/[^0-9.\\-]/g, \"\"));\n}\n/**\n * Get the scroll offset of elements\n * @param el - Element\n * @returns\n */\nfunction getScrollOffset(el) {\n let p = el.parentElement;\n while (p) {\n if (p.scrollLeft || p.scrollTop) {\n return { x: p.scrollLeft, y: p.scrollTop };\n }\n p = p.parentElement;\n }\n return { x: 0, y: 0 };\n}\n/**\n * Get the coordinates of elements adjusted for scroll position.\n * @param el - Element\n * @returns\n */\nfunction getCoords(el) {\n const rect = el.getBoundingClientRect();\n const { x, y } = getScrollOffset(el);\n return {\n top: rect.top + y,\n left: rect.left + x,\n width: rect.width,\n height: rect.height,\n };\n}\n/**\n * Returns the width/height that the element should be transitioned between.\n * This takes into account box-sizing.\n * @param el - Element being animated\n * @param oldCoords - Old set of Coordinates coordinates\n * @param newCoords - New set of Coordinates coordinates\n * @returns\n */\nfunction getTransitionSizes(el, oldCoords, newCoords) {\n let widthFrom = oldCoords.width;\n let heightFrom = oldCoords.height;\n let widthTo = newCoords.width;\n let heightTo = newCoords.height;\n const styles = getComputedStyle(el);\n const sizing = styles.getPropertyValue(\"box-sizing\");\n if (sizing === \"content-box\") {\n const paddingY = raw(styles.paddingTop) +\n raw(styles.paddingBottom) +\n raw(styles.borderTopWidth) +\n raw(styles.borderBottomWidth);\n const paddingX = raw(styles.paddingLeft) +\n raw(styles.paddingRight) +\n raw(styles.borderRightWidth) +\n raw(styles.borderLeftWidth);\n widthFrom -= paddingX;\n widthTo -= paddingX;\n heightFrom -= paddingY;\n heightTo -= paddingY;\n }\n return [widthFrom, widthTo, heightFrom, heightTo].map(Math.round);\n}\n/**\n * Retrieves animation options for the current element.\n * @param el - Element to retrieve options for.\n * @returns\n */\nfunction getOptions(el) {\n return TGT in el && options.has(el[TGT])\n ? options.get(el[TGT])\n : { duration: 250, easing: \"ease-in-out\" };\n}\n/**\n * Returns the target of a given animation (generally the parent).\n * @param el - An element to check for a target\n * @returns\n */\nfunction getTarget(el) {\n if (TGT in el)\n return el[TGT];\n return undefined;\n}\n/**\n * Checks if animations are enabled or disabled for a given element.\n * @param el - Any element\n * @returns\n */\nfunction isEnabled(el) {\n const target = getTarget(el);\n return target ? enabled.has(target) : false;\n}\n/**\n * Iterate over the children of a given parent.\n * @param parent - A parent element\n * @param callback - A callback\n */\nfunction forEach(parent, ...callbacks) {\n callbacks.forEach((callback) => callback(parent, options.has(parent)));\n for (let i = 0; i < parent.children.length; i++) {\n const child = parent.children.item(i);\n if (child) {\n callbacks.forEach((callback) => callback(child, options.has(child)));\n }\n }\n}\n/**\n * Always return tuple to provide consistent interface\n */\nfunction getPluginTuple(pluginReturn) {\n if (Array.isArray(pluginReturn))\n return pluginReturn;\n return [pluginReturn];\n}\n/**\n * Determine if config is plugin\n */\nfunction isPlugin(config) {\n return typeof config === \"function\";\n}\n/**\n * The element in question is remaining in the DOM.\n * @param el - Element to flip\n * @returns\n */\nfunction remain(el) {\n const oldCoords = coords.get(el);\n const newCoords = getCoords(el);\n if (!isEnabled(el))\n return coords.set(el, newCoords);\n let animation;\n if (!oldCoords)\n return;\n const pluginOrOptions = getOptions(el);\n if (typeof pluginOrOptions !== \"function\") {\n const deltaX = oldCoords.left - newCoords.left;\n const deltaY = oldCoords.top - newCoords.top;\n const [widthFrom, widthTo, heightFrom, heightTo] = getTransitionSizes(el, oldCoords, newCoords);\n const start = {\n transform: `translate(${deltaX}px, ${deltaY}px)`,\n };\n const end = {\n transform: `translate(0, 0)`,\n };\n if (widthFrom !== widthTo) {\n start.width = `${widthFrom}px`;\n end.width = `${widthTo}px`;\n }\n if (heightFrom !== heightTo) {\n start.height = `${heightFrom}px`;\n end.height = `${heightTo}px`;\n }\n animation = el.animate([start, end], {\n duration: pluginOrOptions.duration,\n easing: pluginOrOptions.easing,\n });\n }\n else {\n const [keyframes] = getPluginTuple(pluginOrOptions(el, \"remain\", oldCoords, newCoords));\n animation = new Animation(keyframes);\n animation.play();\n }\n animations.set(el, animation);\n coords.set(el, newCoords);\n animation.addEventListener(\"finish\", updatePos.bind(null, el));\n}\n/**\n * Adds the element with a transition.\n * @param el - Animates the element being added.\n */\nfunction add(el) {\n if (NEW in el)\n delete el[NEW];\n const newCoords = getCoords(el);\n coords.set(el, newCoords);\n const pluginOrOptions = getOptions(el);\n if (!isEnabled(el))\n return;\n let animation;\n if (typeof pluginOrOptions !== \"function\") {\n animation = el.animate([\n { transform: \"scale(.98)\", opacity: 0 },\n { transform: \"scale(0.98)\", opacity: 0, offset: 0.5 },\n { transform: \"scale(1)\", opacity: 1 },\n ], {\n duration: pluginOrOptions.duration * 1.5,\n easing: \"ease-in\",\n });\n }\n else {\n const [keyframes] = getPluginTuple(pluginOrOptions(el, \"add\", newCoords));\n animation = new Animation(keyframes);\n animation.play();\n }\n animations.set(el, animation);\n animation.addEventListener(\"finish\", updatePos.bind(null, el));\n}\n/**\n * Clean up after removing an element from the dom.\n * @param el - Element being removed\n * @param styles - Optional styles that should be removed from the element.\n */\nfunction cleanUp(el, styles) {\n var _a;\n el.remove();\n coords.delete(el);\n siblings.delete(el);\n animations.delete(el);\n (_a = intersections.get(el)) === null || _a === void 0 ? void 0 : _a.disconnect();\n setTimeout(() => {\n if (DEL in el)\n delete el[DEL];\n Object.defineProperty(el, NEW, { value: true, configurable: true });\n if (styles && el instanceof HTMLElement) {\n for (const style in styles) {\n el.style[style] = \"\";\n }\n }\n }, 0);\n}\n/**\n * Animates the removal of an element.\n * @param el - Element to remove\n */\nfunction remove(el) {\n var _a;\n if (!siblings.has(el) || !coords.has(el))\n return;\n const [prev, next] = siblings.get(el);\n Object.defineProperty(el, DEL, { value: true, configurable: true });\n const finalX = window.scrollX;\n const finalY = window.scrollY;\n if (next && next.parentNode && next.parentNode instanceof Element) {\n next.parentNode.insertBefore(el, next);\n }\n else if (prev && prev.parentNode) {\n prev.parentNode.appendChild(el);\n }\n else {\n (_a = getTarget(el)) === null || _a === void 0 ? void 0 : _a.appendChild(el);\n }\n if (!isEnabled(el))\n return cleanUp(el);\n const [top, left, width, height] = deletePosition(el);\n const optionsOrPlugin = getOptions(el);\n const oldCoords = coords.get(el);\n if (finalX !== scrollX || finalY !== scrollY) {\n adjustScroll(el, finalX, finalY, optionsOrPlugin);\n }\n let animation;\n let styleReset = {\n position: \"absolute\",\n top: `${top}px`,\n left: `${left}px`,\n width: `${width}px`,\n height: `${height}px`,\n margin: \"0\",\n pointerEvents: \"none\",\n transformOrigin: \"center\",\n zIndex: \"100\",\n };\n if (!isPlugin(optionsOrPlugin)) {\n Object.assign(el.style, styleReset);\n animation = el.animate([\n {\n transform: \"scale(1)\",\n opacity: 1,\n },\n {\n transform: \"scale(.98)\",\n opacity: 0,\n },\n ], { duration: optionsOrPlugin.duration, easing: \"ease-out\" });\n }\n else {\n const [keyframes, options] = getPluginTuple(optionsOrPlugin(el, \"remove\", oldCoords));\n if ((options === null || options === void 0 ? void 0 : options.styleReset) !== false) {\n styleReset = (options === null || options === void 0 ? void 0 : options.styleReset) || styleReset;\n Object.assign(el.style, styleReset);\n }\n animation = new Animation(keyframes);\n animation.play();\n }\n animations.set(el, animation);\n animation.addEventListener(\"finish\", cleanUp.bind(null, el, styleReset));\n}\n/**\n * If the element being removed is at the very bottom of the page, and the\n * the page was scrolled into a space being \"made available\" by the element\n * that was removed, the page scroll will have jumped up some amount. We need\n * to offset the jump by the amount that the page was \"automatically\" scrolled\n * up. We can do this by comparing the scroll position before and after the\n * element was removed, and then offsetting by that amount.\n *\n * @param el - The element being deleted\n * @param finalX - The final X scroll position\n * @param finalY - The final Y scroll position\n * @param optionsOrPlugin - The options or plugin\n * @returns\n */\nfunction adjustScroll(el, finalX, finalY, optionsOrPlugin) {\n const scrollDeltaX = scrollX - finalX;\n const scrollDeltaY = scrollY - finalY;\n const scrollBefore = document.documentElement.style.scrollBehavior;\n const scrollBehavior = getComputedStyle(root).scrollBehavior;\n if (scrollBehavior === \"smooth\") {\n document.documentElement.style.scrollBehavior = \"auto\";\n }\n window.scrollTo(window.scrollX + scrollDeltaX, window.scrollY + scrollDeltaY);\n if (!el.parentElement)\n return;\n const parent = el.parentElement;\n let lastHeight = parent.clientHeight;\n let lastWidth = parent.clientWidth;\n const startScroll = performance.now();\n // Here we use a manual scroll animation to keep the element using the same\n // easing and timing as the parents scroll animation.\n function smoothScroll() {\n requestAnimationFrame(() => {\n if (!isPlugin(optionsOrPlugin)) {\n const deltaY = lastHeight - parent.clientHeight;\n const deltaX = lastWidth - parent.clientWidth;\n if (startScroll + optionsOrPlugin.duration > performance.now()) {\n window.scrollTo({\n left: window.scrollX - deltaX,\n top: window.scrollY - deltaY,\n });\n lastHeight = parent.clientHeight;\n lastWidth = parent.clientWidth;\n smoothScroll();\n }\n else {\n document.documentElement.style.scrollBehavior = scrollBefore;\n }\n }\n });\n }\n smoothScroll();\n}\n/**\n * Determines the position of the element being removed.\n * @param el - The element being deleted\n * @returns\n */\nfunction deletePosition(el) {\n const oldCoords = coords.get(el);\n const [width, , height] = getTransitionSizes(el, oldCoords, getCoords(el));\n let offsetParent = el.parentElement;\n while (offsetParent &&\n (getComputedStyle(offsetParent).position === \"static\" ||\n offsetParent instanceof HTMLBodyElement)) {\n offsetParent = offsetParent.parentElement;\n }\n if (!offsetParent)\n offsetParent = document.body;\n const parentStyles = getComputedStyle(offsetParent);\n const parentCoords = coords.get(offsetParent) || getCoords(offsetParent);\n const top = Math.round(oldCoords.top - parentCoords.top) -\n raw(parentStyles.borderTopWidth);\n const left = Math.round(oldCoords.left - parentCoords.left) -\n raw(parentStyles.borderLeftWidth);\n return [top, left, width, height];\n}\n/**\n * A function that automatically adds animation effects to itself and its\n * immediate children. Specifically it adds effects for adding, moving, and\n * removing DOM elements.\n * @param el - A parent element to add animations to.\n * @param options - An optional object of options.\n */\nfunction autoAnimate(el, config = {}) {\n if (mutations && resize) {\n const mediaQuery = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const isDisabledDueToReduceMotion = mediaQuery.matches &&\n !isPlugin(config) &&\n !config.disrespectUserMotionPreference;\n if (!isDisabledDueToReduceMotion) {\n enabled.add(el);\n if (getComputedStyle(el).position === \"static\") {\n Object.assign(el.style, { position: \"relative\" });\n }\n forEach(el, updatePos, poll, (element) => resize === null || resize === void 0 ? void 0 : resize.observe(element));\n if (isPlugin(config)) {\n options.set(el, config);\n }\n else {\n options.set(el, { duration: 250, easing: \"ease-in-out\", ...config });\n }\n mutations.observe(el, { childList: true });\n parents.add(el);\n }\n }\n return Object.freeze({\n parent: el,\n enable: () => {\n enabled.add(el);\n },\n disable: () => {\n enabled.delete(el);\n },\n isEnabled: () => enabled.has(el),\n });\n}\n/**\n * The vue directive.\n */\nconst vAutoAnimate = {\n mounted: (el, binding) => {\n autoAnimate(el, binding.value || {});\n },\n // ignore ssr see #96:\n getSSRProps: () => ({}),\n};\n\nexport { autoAnimate as default, getTransitionSizes, vAutoAnimate };\n","import { useRef, useState, useEffect } from 'preact/hooks';\nimport autoAnimate from '../index.mjs';\n\n/**\n * AutoAnimate hook for adding dead-simple transitions and animations to preact.\n * @param options - Auto animate options or a plugin\n * @returns\n */\nfunction useAutoAnimate(options) {\n const element = useRef(null);\n const [controller, setController] = useState();\n const setEnabled = (enabled) => {\n if (controller) {\n enabled ? controller.enable() : controller.disable();\n }\n };\n useEffect(() => {\n if (element.current instanceof HTMLElement)\n setController(autoAnimate(element.current, options || {}));\n }, []);\n return [element, setEnabled];\n}\n\nexport { useAutoAnimate };\n","import './accounts.css';\n\nimport { useAutoAnimate } from '@formkit/auto-animate/preact';\nimport { t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { useReducer } from 'preact/hooks';\n\nimport Avatar from '../components/avatar';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport MenuConfirm from '../components/menu-confirm';\nimport MenuLink from '../components/menu-link';\nimport Menu2 from '../components/menu2';\nimport NameText from '../components/name-text';\nimport { api } from '../utils/api';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID, setCurrentAccountID } from '../utils/store-utils';\n\nconst isStandalone = window.matchMedia('(display-mode: standalone)').matches;\n\nfunction Accounts({ onClose }) {\n const { masto } = api();\n // Accounts\n const accounts = store.local.getJSON('accounts');\n const currentAccount = getCurrentAccountID();\n const moreThanOneAccount = accounts.length > 1;\n\n const [_, reload] = useReducer((x) => x + 1, 0);\n const [accountsListParent] = useAutoAnimate();\n\n return (\n <div id=\"accounts-container\" class=\"sheet\" tabIndex=\"-1\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header class=\"header-grid\">\n <h2>\n <Trans>Accounts</Trans>\n </h2>\n </header>\n <main>\n <section>\n <ul class=\"accounts-list\" ref={accountsListParent}>\n {accounts.map((account, i) => {\n const isCurrent = account.info.id === currentAccount;\n const isDefault = i === 0; // first account is always default\n return (\n <li key={account.info.id}>\n <div>\n {moreThanOneAccount && (\n <span class={`current ${isCurrent ? 'is-current' : ''}`}>\n <Icon icon=\"check-circle\" alt={t`Current`} />\n </span>\n )}\n <Avatar\n url={account.info.avatarStatic}\n size=\"xxl\"\n onDblClick={async () => {\n if (isCurrent) {\n try {\n const info = await masto.v1.accounts\n .$select(account.info.id)\n .fetch();\n console.log('fetched account info', info);\n account.info = info;\n store.local.setJSON('accounts', accounts);\n reload();\n } catch (e) {}\n }\n }}\n />\n <NameText\n account={\n moreThanOneAccount\n ? {\n ...account.info,\n acct: /@/.test(account.info.acct)\n ? account.info.acct\n : `${account.info.acct}@${account.instanceURL}`,\n }\n : account.info\n }\n showAcct\n onClick={() => {\n if (isCurrent) {\n states.showAccount = `${account.info.username}@${account.instanceURL}`;\n } else {\n setCurrentAccountID(account.info.id);\n location.reload();\n }\n }}\n />\n </div>\n <div class=\"actions\">\n {isDefault && moreThanOneAccount && (\n <>\n <span class=\"tag\">\n <Trans>Default</Trans>\n </span>{' '}\n </>\n )}\n <Menu2\n align=\"end\"\n menuButton={\n <button type=\"button\" class=\"plain more-button\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n {moreThanOneAccount && (\n <>\n <MenuItem\n disabled={isCurrent}\n onClick={() => {\n setCurrentAccountID(account.info.id);\n location.reload();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <Trans>Switch to this account</Trans>\n </MenuItem>\n {!isStandalone && !isCurrent && (\n <MenuLink\n href={`./?account=${account.info.id}`}\n target=\"_blank\"\n >\n <Icon icon=\"external\" />\n <span>\n <Trans>Switch in new tab/window</Trans>\n </span>\n </MenuLink>\n )}\n <MenuDivider />\n </>\n )}\n <MenuItem\n onClick={() => {\n states.showAccount = `${account.info.username}@${account.instanceURL}`;\n }}\n >\n <Icon icon=\"user\" />\n <span>\n <Trans>View profile…</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n {moreThanOneAccount && (\n <MenuItem\n disabled={isDefault}\n onClick={() => {\n // Move account to the top of the list\n accounts.splice(i, 1);\n accounts.unshift(account);\n store.local.setJSON('accounts', accounts);\n reload();\n }}\n >\n <Icon icon=\"check-circle\" />\n <span>\n <Trans>Set as default</Trans>\n </span>\n </MenuItem>\n )}\n <MenuConfirm\n subMenu\n confirmLabel={\n <>\n <Icon icon=\"exit\" />\n <span>\n <Trans>\n Log out{' '}\n <span class=\"bidi-isolate\">\n @{account.info.acct}\n </span>\n ?\n </Trans>\n </span>\n </>\n }\n disabled={!isCurrent}\n menuItemClassName=\"danger\"\n onClick={() => {\n // const yes = confirm('Log out?');\n // if (!yes) return;\n accounts.splice(i, 1);\n store.local.setJSON('accounts', accounts);\n // location.reload();\n location.href = location.pathname || '/';\n }}\n >\n <Icon icon=\"exit\" />\n <span>\n <Trans>Log out…</Trans>\n </span>\n </MenuConfirm>\n </Menu2>\n </div>\n </li>\n );\n })}\n </ul>\n <p>\n <Link to=\"/login\" class=\"button plain2\" onClick={onClose}>\n <Icon icon=\"plus\" />{' '}\n <span>\n <Trans>Add an existing account</Trans>\n </span>\n </Link>\n </p>\n {moreThanOneAccount && (\n <p>\n <small>\n <Trans>\n Note: <i>Default</i> account will always be used for first\n load. Switched accounts will persist during the session.\n </Trans>\n </small>\n </p>\n )}\n </section>\n </main>\n </div>\n );\n}\n\nexport default Accounts;\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2064%2064'%3e%3cpath%20fill='none'%20d='M0%200h63.994v63.994H0z'/%3e%3cpath%20fill='%23a4bff7'%20d='M37.774%2011.471c14.639%203.752%2019.034%2016.557%2015.889%2031.304-.696%203.261-2.563%206.661-6.356%208.693-3.204%201.717-8.07%202.537-15.338.55l-9.634-2.404C11.651%2046.992%208.378%2038.733%2010.027%2031.823c3.627-15.201%2015.543-23.48%2027.747-20.352Z'/%3e%3cpath%20fill='%23d8e7fe'%20d='M36.76%2015.429c12.289%203.15%2015.547%2014.114%2012.907%2026.493-.947%204.44-4.937%209.365-16.664%206.143l-9.684-2.417c-7.854-1.923-10.53-7.8-9.318-12.877%203.016-12.639%2012.611-19.943%2022.759-17.342Z'/%3e%3cpath%20fill='%236081e6'%20d='M27.471%2024.991c-1.457-.698-7.229%203.213-7.663%208.926-.182%202.39%204.55%203.237%205.071-.169.725-4.743%203.715-8.218%202.592-8.757Zm10.746%202.005c-2.083.327-.382%205.901-.595%2010.727-.123%202.8%204.388%203.464%204.703%202.011%201.098-5.073-2.066-13.058-4.108-12.738Z'/%3e%3c/svg%3e\"","import { useLingui } from '@lingui/react';\nimport { useMemo } from 'preact/hooks';\n\nimport { CATALOGS, DEFAULT_LANG, DEV_LOCALES, LOCALES } from '../locales';\nimport { activateLang } from '../utils/lang';\nimport localeCode2Text from '../utils/localeCode2Text';\nimport store from '../utils/store';\n\nconst regionMaps = {\n 'zh-CN': 'zh-Hans',\n 'zh-TW': 'zh-Hant',\n 'pt-BR': 'pt-BR',\n};\n\nexport default function LangSelector() {\n const { i18n } = useLingui();\n\n // Sorted on render, so the order won't suddenly change based on current locale\n const populatedLocales = useMemo(() => {\n return LOCALES.map((lang) => {\n // Don't need regions for now, it makes text too noisy\n // Wait till there's too many languages and there are regional clashes\n const regionlessCode = regionMaps[lang] || lang.replace(/-[a-z]+$/i, '');\n\n const native = localeCode2Text({\n code: regionlessCode,\n locale: lang,\n fallback: CATALOGS.find((c) => c.code === lang)?.nativeName,\n });\n\n // Not used when rendering because it'll change based on current locale\n // Only used for sorting on render\n const _common = localeCode2Text({\n code: regionlessCode,\n locale: i18n.locale,\n fallback: CATALOGS.find((c) => c.code === lang)?.name,\n });\n\n return {\n code: lang,\n regionlessCode,\n _common,\n native,\n };\n }).sort((a, b) => {\n // Sort by common name\n const order = a._common.localeCompare(b._common, i18n.locale);\n if (order !== 0) return order;\n // Sort by code (fallback)\n if (a.code < b.code) return -1;\n if (a.code > b.code) return 1;\n return 0;\n });\n }, []);\n\n return (\n <label class=\"lang-selector\">\n 🌐{' '}\n <select\n class=\"small\"\n value={i18n.locale || DEFAULT_LANG}\n onChange={(e) => {\n store.local.set('lang', e.target.value);\n activateLang(e.target.value);\n }}\n >\n {populatedLocales.map(({ code, regionlessCode, native }) => {\n // Common name changes based on current locale\n const common = localeCode2Text({\n code: regionlessCode,\n locale: i18n.locale,\n fallback: CATALOGS.find((c) => c.code === code)?.name,\n });\n const showCommon = !!common && common !== native;\n return (\n <option\n value={code}\n data-regionless-code={regionlessCode}\n key={code}\n >\n {showCommon ? `${native} - ${common}` : native}\n </option>\n );\n })}\n {(import.meta.env.DEV || import.meta.env.PHANPY_SHOW_DEV_LOCALES) && (\n <optgroup label=\"🚧 Development (<50% translated)\">\n {DEV_LOCALES.map((code) => {\n if (code === 'pseudo-LOCALE') {\n return (\n <>\n <hr />\n <option value={code} key={code}>\n Pseudolocalization (test)\n </option>\n </>\n );\n }\n const nativeName = CATALOGS.find(\n (c) => c.code === code,\n )?.nativeName;\n const completion = CATALOGS.find(\n (c) => c.code === code,\n )?.completion;\n return (\n <option value={code} key={code}>\n {nativeName || code} &lrm;[{completion}%]\n </option>\n );\n })}\n </optgroup>\n )}\n </select>\n </label>\n );\n}\n","// Utils for push notifications\nimport { api } from './api';\nimport { getVapidKey } from './store-utils';\n\n// Subscription is an object with the following structure:\n// {\n// data: {\n// alerts: {\n// admin: {\n// report: boolean,\n// signUp: boolean,\n// },\n// favourite: boolean,\n// follow: boolean,\n// mention: boolean,\n// poll: boolean,\n// reblog: boolean,\n// status: boolean,\n// update: boolean,\n// }\n// },\n// policy: \"all\" | \"followed\" | \"follower\" | \"none\",\n// subscription: {\n// endpoint: string,\n// keys: {\n// auth: string,\n// p256dh: string,\n// },\n// },\n// }\n\n// Back-end CRUD\n// =============\n\nfunction createBackendPushSubscription(subscription) {\n const { masto } = api();\n return masto.v1.push.subscription.create(subscription);\n}\n\nfunction fetchBackendPushSubscription() {\n const { masto } = api();\n return masto.v1.push.subscription.fetch();\n}\n\nfunction updateBackendPushSubscription(subscription) {\n const { masto } = api();\n return masto.v1.push.subscription.update(subscription);\n}\n\nfunction removeBackendPushSubscription() {\n const { masto } = api();\n return masto.v1.push.subscription.remove();\n}\n\n// Front-end\n// =========\n\nexport function isPushSupported() {\n return 'serviceWorker' in navigator && 'PushManager' in window;\n}\n\nexport function getRegistration() {\n // return navigator.serviceWorker.ready;\n return navigator.serviceWorker.getRegistration();\n}\n\nasync function getSubscription() {\n const registration = await getRegistration();\n const subscription = registration\n ? await registration.pushManager.getSubscription()\n : undefined;\n return { registration, subscription };\n}\n\nfunction urlBase64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = `${base64String}${padding}`\n .replace(/-/g, '+')\n .replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n\n return outputArray;\n}\n\n// Front-end <-> back-end\n// ======================\n\nexport async function initSubscription() {\n if (!isPushSupported()) return;\n const { subscription } = await getSubscription();\n let backendSubscription = null;\n try {\n backendSubscription = await fetchBackendPushSubscription();\n } catch (err) {\n if (/(not found|unknown)/i.test(err.message)) {\n // No subscription found\n } else {\n // Other error\n throw err;\n }\n }\n console.log('INIT subscription', {\n subscription,\n backendSubscription,\n });\n\n // Check if the subscription changed\n if (backendSubscription && subscription) {\n const sameEndpoint = backendSubscription.endpoint === subscription.endpoint;\n const vapidKey = getVapidKey();\n const sameKey = backendSubscription.serverKey === vapidKey;\n if (!sameEndpoint) {\n throw new Error('Backend subscription endpoint changed');\n }\n if (sameKey) {\n // Subscription didn't change\n } else {\n // Subscription changed\n console.error('🔔 Subscription changed', {\n sameEndpoint,\n serverKey: backendSubscription.serverKey,\n vapIdKey: vapidKey,\n endpoint1: backendSubscription.endpoint,\n endpoint2: subscription.endpoint,\n sameKey,\n key1: backendSubscription.serverKey,\n key2: vapidKey,\n });\n throw new Error('Backend subscription key and vapid key changed');\n // Only unsubscribe from backend, not from browser\n // await removeBackendPushSubscription();\n // // Now let's resubscribe\n // // NOTE: I have no idea if this works\n // return await updateSubscription({\n // data: backendSubscription.data,\n // policy: backendSubscription.policy,\n // });\n }\n }\n\n if (subscription && !backendSubscription) {\n // check if account's vapidKey is same as subscription's applicationServerKey\n const vapidKey = getVapidKey();\n if (vapidKey) {\n const { applicationServerKey } = subscription.options;\n const vapidKeyStr = urlBase64ToUint8Array(vapidKey).toString();\n const applicationServerKeyStr = new Uint8Array(\n applicationServerKey,\n ).toString();\n const sameKey = vapidKeyStr === applicationServerKeyStr;\n if (sameKey) {\n // Subscription didn't change\n } else {\n // Subscription changed\n console.error('🔔 Subscription changed', {\n vapidKeyStr,\n applicationServerKeyStr,\n sameKey,\n });\n // Unsubscribe since backend doesn't have a subscription\n await subscription.unsubscribe();\n throw new Error('Subscription key and vapid key changed');\n }\n } else {\n console.warn('No vapidKey found');\n }\n }\n\n // Check if backend subscription returns 404\n // if (subscription && !backendSubscription) {\n // // Re-subscribe to backend\n // backendSubscription = await createBackendPushSubscription({\n // subscription,\n // data: {},\n // policy: 'all',\n // });\n // }\n\n return { subscription, backendSubscription };\n}\n\nexport async function updateSubscription({ data, policy }) {\n console.log('🔔 Updating subscription', { data, policy });\n if (!isPushSupported()) return;\n let { registration, subscription } = await getSubscription();\n let backendSubscription = null;\n\n if (subscription) {\n try {\n backendSubscription = await updateBackendPushSubscription({\n data,\n policy,\n });\n // TODO: save subscription in user settings\n } catch (error) {\n // Backend doesn't have a subscription for this user\n // Create a new one\n backendSubscription = await createBackendPushSubscription({\n subscription,\n data,\n policy,\n });\n // TODO: save subscription in user settings\n }\n } else {\n // User is not subscribed\n const vapidKey = getVapidKey();\n if (!vapidKey) throw new Error('No server key found');\n subscription = await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(vapidKey),\n });\n backendSubscription = await createBackendPushSubscription({\n subscription,\n data,\n policy,\n });\n // TODO: save subscription in user settings\n }\n\n return { subscription, backendSubscription };\n}\n\nexport async function removeSubscription() {\n if (!isPushSupported()) return;\n const { subscription } = await getSubscription();\n if (subscription) {\n await removeBackendPushSubscription();\n await subscription.unsubscribe();\n }\n}\n","import './settings.css';\n\nimport { Plural, t, Trans } from '@lingui/macro';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport logo from '../assets/logo.svg';\n\nimport Icon from '../components/icon';\nimport LangSelector from '../components/lang-selector';\nimport Link from '../components/link';\nimport RelativeTime from '../components/relative-time';\nimport targetLanguages from '../data/lingva-target-languages';\nimport { api } from '../utils/api';\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport localeCode2Text from '../utils/localeCode2Text';\nimport {\n initSubscription,\n isPushSupported,\n removeSubscription,\n updateSubscription,\n} from '../utils/push-notifications';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport supports from '../utils/supports';\n\nconst DEFAULT_TEXT_SIZE = 16;\nconst TEXT_SIZES = [14, 15, 16, 17, 18, 19, 20];\nconst {\n PHANPY_WEBSITE: WEBSITE,\n PHANPY_PRIVACY_POLICY_URL: PRIVACY_POLICY_URL,\n PHANPY_IMG_ALT_API_URL: IMG_ALT_API_URL,\n PHANPY_GIPHY_API_KEY: GIPHY_API_KEY,\n} = import.meta.env;\n\nfunction Settings({ onClose }) {\n const snapStates = useSnapshot(states);\n const currentTheme = store.local.get('theme') || 'auto';\n const themeFormRef = useRef();\n const targetLanguage =\n snapStates.settings.contentTranslationTargetLanguage || null;\n const systemTargetLanguage = getTranslateTargetLanguage();\n const systemTargetLanguageText = localeCode2Text(systemTargetLanguage);\n const currentTextSize = store.local.get('textSize') || DEFAULT_TEXT_SIZE;\n\n const [prefs, setPrefs] = useState(store.account.get('preferences') || {});\n const { masto, authenticated, instance } = api();\n // Get preferences every time Settings is opened\n // NOTE: Disabled for now because I don't expect this to change often. Also for some reason, the /api/v1/preferences endpoint is cached for a while and return old prefs if refresh immediately after changing them.\n // useEffect(() => {\n // const { masto } = api();\n // (async () => {\n // try {\n // const preferences = await masto.v1.preferences.fetch();\n // setPrefs(preferences);\n // store.account.set('preferences', preferences);\n // } catch (e) {\n // // Silently fail\n // console.error(e);\n // }\n // })();\n // }, []);\n\n return (\n <div\n id=\"settings-container\"\n class=\"sheet\"\n tabIndex=\"-1\"\n style={{\n '--current-text-size': `${currentTextSize}px`,\n }}\n >\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Settings</Trans>\n </h2>\n </header>\n <main>\n <section>\n <ul>\n <li>\n <div>\n <label>\n <Trans>Appearance</Trans>\n </label>\n </div>\n <div>\n <form\n ref={themeFormRef}\n onInput={(e) => {\n console.log(e);\n e.preventDefault();\n const formData = new FormData(themeFormRef.current);\n const theme = formData.get('theme');\n const html = document.documentElement;\n\n if (theme === 'auto') {\n html.classList.remove('is-light', 'is-dark');\n\n // Disable manual theme <meta>\n const $manualMeta = document.querySelector(\n 'meta[data-theme-setting=\"manual\"]',\n );\n if ($manualMeta) {\n $manualMeta.name = '';\n }\n // Enable auto theme <meta>s\n const $autoMetas = document.querySelectorAll(\n 'meta[data-theme-setting=\"auto\"]',\n );\n $autoMetas.forEach((m) => {\n m.name = 'theme-color';\n });\n } else {\n html.classList.toggle('is-light', theme === 'light');\n html.classList.toggle('is-dark', theme === 'dark');\n\n // Enable manual theme <meta>\n const $manualMeta = document.querySelector(\n 'meta[data-theme-setting=\"manual\"]',\n );\n if ($manualMeta) {\n $manualMeta.name = 'theme-color';\n $manualMeta.content =\n theme === 'light'\n ? $manualMeta.dataset.themeLightColor\n : $manualMeta.dataset.themeDarkColor;\n }\n // Disable auto theme <meta>s\n const $autoMetas = document.querySelectorAll(\n 'meta[data-theme-setting=\"auto\"]',\n );\n $autoMetas.forEach((m) => {\n m.name = '';\n });\n }\n document\n .querySelector('meta[name=\"color-scheme\"]')\n .setAttribute(\n 'content',\n theme === 'auto' ? 'dark light' : theme,\n );\n\n if (theme === 'auto') {\n store.local.del('theme');\n } else {\n store.local.set('theme', theme);\n }\n }}\n >\n <div class=\"radio-group\">\n <label>\n <input\n type=\"radio\"\n name=\"theme\"\n value=\"light\"\n defaultChecked={currentTheme === 'light'}\n />\n <span>\n <Trans>Light</Trans>\n </span>\n </label>\n <label>\n <input\n type=\"radio\"\n name=\"theme\"\n value=\"dark\"\n defaultChecked={currentTheme === 'dark'}\n />\n <span>\n <Trans>Dark</Trans>\n </span>\n </label>\n <label>\n <input\n type=\"radio\"\n name=\"theme\"\n value=\"auto\"\n defaultChecked={\n currentTheme !== 'light' && currentTheme !== 'dark'\n }\n />\n <span>\n <Trans>Auto</Trans>\n </span>\n </label>\n </div>\n </form>\n </div>\n </li>\n <li>\n <div>\n <label>\n <Trans>Text size</Trans>\n </label>\n </div>\n <div class=\"range-group\">\n <span style={{ fontSize: TEXT_SIZES[0] }}>\n <Trans comment=\"Preview of one character, in smallest size\">\n A\n </Trans>\n </span>{' '}\n <input\n type=\"range\"\n min={TEXT_SIZES[0]}\n max={TEXT_SIZES[TEXT_SIZES.length - 1]}\n step=\"1\"\n value={currentTextSize}\n list=\"sizes\"\n onChange={(e) => {\n const value = parseInt(e.target.value, 10);\n const html = document.documentElement;\n // set CSS variable\n html.style.setProperty('--text-size', `${value}px`);\n // save to local storage\n if (value === DEFAULT_TEXT_SIZE) {\n store.local.del('textSize');\n } else {\n store.local.set('textSize', e.target.value);\n }\n }}\n />{' '}\n <span style={{ fontSize: TEXT_SIZES[TEXT_SIZES.length - 1] }}>\n <Trans comment=\"Preview of one character, in largest size\">\n A\n </Trans>\n </span>\n <datalist id=\"sizes\">\n {TEXT_SIZES.map((size) => (\n <option value={size} />\n ))}\n </datalist>\n </div>\n </li>\n <li>\n <span>\n <label>\n <Trans>Display language</Trans>\n </label>\n <br />\n <small>\n <a\n href=\"https://crowdin.com/project/phanpy\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Volunteer translations</Trans>\n </a>\n </small>\n </span>\n <LangSelector />\n </li>\n </ul>\n </section>\n {authenticated && (\n <>\n <h3>\n <Trans>Posting</Trans>\n </h3>\n <section>\n <ul>\n <li>\n <div>\n <label for=\"posting-privacy-field\">\n <Trans>Default visibility</Trans>{' '}\n <Icon icon=\"cloud\" alt={t`Synced`} class=\"synced-icon\" />\n </label>\n </div>\n <div>\n <select\n id=\"posting-privacy-field\"\n value={prefs['posting:default:visibility'] || 'public'}\n onChange={(e) => {\n const { value } = e.target;\n (async () => {\n try {\n await masto.v1.accounts.updateCredentials({\n source: {\n privacy: value,\n },\n });\n setPrefs({\n ...prefs,\n 'posting:default:visibility': value,\n });\n store.account.set('preferences', {\n ...prefs,\n 'posting:default:visibility': value,\n });\n } catch (e) {\n alert(t`Failed to update posting privacy`);\n console.error(e);\n }\n })();\n }}\n >\n <option value=\"public\">\n <Trans>Public</Trans>\n </option>\n <option value=\"unlisted\">\n <Trans>Unlisted</Trans>\n </option>\n <option value=\"private\">\n <Trans>Followers only</Trans>\n </option>\n </select>\n </div>\n </li>\n </ul>\n </section>\n <p class=\"section-postnote\">\n <Icon icon=\"cloud\" alt={t`Synced`} class=\"synced-icon\" />{' '}\n <small>\n <Trans>\n Synced to your instance server's settings.{' '}\n <a\n href={`https://${instance}/`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to your instance ({instance}) for more settings.\n </a>\n </Trans>\n </small>\n </p>\n </>\n )}\n <h3>\n <Trans>Experiments</Trans>\n </h3>\n <section>\n <ul>\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.autoRefresh}\n onChange={(e) => {\n states.settings.autoRefresh = e.target.checked;\n }}\n />{' '}\n <Trans>Auto refresh timeline posts</Trans>\n </label>\n </li>\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.boostsCarousel}\n onChange={(e) => {\n states.settings.boostsCarousel = e.target.checked;\n }}\n />{' '}\n <Trans>Boosts carousel</Trans>\n </label>\n </li>\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.contentTranslation}\n onChange={(e) => {\n const { checked } = e.target;\n states.settings.contentTranslation = checked;\n if (!checked) {\n states.settings.contentTranslationTargetLanguage = null;\n }\n }}\n />{' '}\n <Trans>Post translation</Trans>\n </label>\n <div\n class={`sub-section ${\n !snapStates.settings.contentTranslation\n ? 'more-insignificant'\n : ''\n }`}\n >\n <div>\n <label>\n <Trans>Translate to </Trans>{' '}\n <select\n value={targetLanguage || ''}\n disabled={!snapStates.settings.contentTranslation}\n style={{ width: '10em' }}\n onChange={(e) => {\n states.settings.contentTranslationTargetLanguage =\n e.target.value || null;\n }}\n >\n <option value=\"\">\n <Trans>\n System language ({systemTargetLanguageText})\n </Trans>\n </option>\n <option disabled>──────────</option>\n {targetLanguages.map((lang) => {\n const common = localeCode2Text({\n code: lang.code,\n fallback: lang.name,\n });\n const native = localeCode2Text({\n code: lang.code,\n locale: lang.code,\n });\n const showCommon = common !== native;\n return (\n <option value={lang.code}>\n {showCommon ? `${native} - ${common}` : common}\n </option>\n );\n })}\n </select>\n </label>\n </div>\n <hr />\n <div class=\"checkbox-fieldset\">\n <Plural\n value={\n snapStates.settings.contentTranslationHideLanguages.length\n }\n _0={`Hide \"Translate\" button for:`}\n other={`Hide \"Translate\" button for (#):`}\n />\n <div class=\"checkbox-fields\">\n {targetLanguages.map((lang) => {\n const common = localeCode2Text({\n code: lang.code,\n fallback: lang.name,\n });\n const native = localeCode2Text({\n code: lang.code,\n locale: lang.code,\n });\n const showCommon = common !== native;\n return (\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.contentTranslationHideLanguages.includes(\n lang.code,\n )}\n onChange={(e) => {\n const { checked } = e.target;\n if (checked) {\n states.settings.contentTranslationHideLanguages.push(\n lang.code,\n );\n } else {\n states.settings.contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages.filter(\n (code) => code !== lang.code,\n );\n }\n }}\n />{' '}\n {showCommon ? (\n <span>\n {native}{' '}\n <span class=\"insignificant\">- {common}</span>\n </span>\n ) : (\n common\n )}\n </label>\n );\n })}\n </div>\n </div>\n <p class=\"insignificant\">\n <small>\n <Trans>\n Note: This feature uses external translation services,\n powered by{' '}\n <a\n href=\"https://github.com/cheeaun/lingva-api\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Lingva API\n </a>{' '}\n &amp;{' '}\n <a\n href=\"https://github.com/thedaviddelta/lingva-translate\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Lingva Translate\n </a>\n .\n </Trans>\n </small>\n </p>\n <hr />\n <div>\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.contentTranslationAutoInline}\n disabled={!snapStates.settings.contentTranslation}\n onChange={(e) => {\n states.settings.contentTranslationAutoInline =\n e.target.checked;\n }}\n />{' '}\n <Trans>Auto inline translation</Trans>\n </label>\n <p class=\"insignificant\">\n <small>\n <Trans>\n Automatically show translation for posts in timeline.\n Only works for <b>short</b> posts without content\n warning, media and poll.\n </Trans>\n </small>\n </p>\n </div>\n </div>\n </li>\n {!!GIPHY_API_KEY && authenticated && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.composerGIFPicker}\n onChange={(e) => {\n states.settings.composerGIFPicker = e.target.checked;\n }}\n />{' '}\n <Trans>GIF Picker for composer</Trans>\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Note: This feature uses external GIF search service,\n powered by{' '}\n <a\n href=\"https://developers.giphy.com/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n GIPHY\n </a>\n . G-rated (suitable for viewing by all ages), tracking\n parameters are stripped, referrer information is omitted\n from requests, but search queries and IP address\n information will still reach their servers.\n </Trans>\n </small>\n </div>\n </li>\n )}\n {!!IMG_ALT_API_URL && authenticated && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.mediaAltGenerator}\n onChange={(e) => {\n states.settings.mediaAltGenerator = e.target.checked;\n }}\n />{' '}\n <Trans>Image description generator</Trans>{' '}\n <Icon icon=\"sparkles2\" class=\"more-insignificant\" />\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Only for new images while composing new posts.\n </Trans>\n </small>\n </div>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Note: This feature uses external AI service, powered by{' '}\n <a\n href=\"https://github.com/cheeaun/img-alt-api\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n img-alt-api\n </a>\n . May not work well. Only for images and in English.\n </Trans>\n </small>\n </div>\n </li>\n )}\n {authenticated && supports('@mastodon/grouped-notifications') && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.groupedNotificationsAlpha}\n onChange={(e) => {\n states.settings.groupedNotificationsAlpha =\n e.target.checked;\n }}\n />{' '}\n <Trans>Server-side grouped notifications</Trans>\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Alpha-stage feature. Potentially improved grouping window\n but basic grouping logic.\n </Trans>\n </small>\n </div>\n </li>\n )}\n {authenticated && (\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={\n snapStates.settings.shortcutSettingsCloudImportExport\n }\n onChange={(e) => {\n states.settings.shortcutSettingsCloudImportExport =\n e.target.checked;\n }}\n />{' '}\n <Trans>\"Cloud\" import/export for shortcuts settings</Trans>{' '}\n <Icon icon=\"cloud\" class=\"more-insignificant\" />\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n ⚠️⚠️⚠️ Very experimental.\n <br />\n Stored in your own profiles notes. Profile (private)\n notes are mainly used for other profiles, and hidden for\n own profile.\n </Trans>\n </small>\n </div>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Note: This feature uses currently-logged-in instance\n server API.\n </Trans>\n </small>\n </div>\n </li>\n )}\n <li class=\"block\">\n <label>\n <input\n type=\"checkbox\"\n checked={snapStates.settings.cloakMode}\n onChange={(e) => {\n states.settings.cloakMode = e.target.checked;\n }}\n />{' '}\n <Trans>\n Cloak mode{' '}\n <span class=\"insignificant\">\n (<samp>Text</samp> → <samp>████</samp>)\n </span>\n </Trans>\n </label>\n <div class=\"sub-section insignificant\">\n <small>\n <Trans>\n Replace text as blocks, useful when taking screenshots, for\n privacy reasons.\n </Trans>\n </small>\n </div>\n </li>\n {authenticated && (\n <li>\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => {\n states.showDrafts = true;\n states.showSettings = false;\n }}\n >\n <Trans>Unsent drafts</Trans>\n </button>\n </li>\n )}\n </ul>\n </section>\n {authenticated && <PushNotificationsSection onClose={onClose} />}\n <h3>\n <Trans>About</Trans>\n </h3>\n <section>\n <div\n style={{\n display: 'flex',\n flexWrap: 'wrap',\n gap: 8,\n lineHeight: 1.25,\n alignItems: 'center',\n marginTop: 8,\n }}\n >\n <img\n src={logo}\n alt=\"\"\n width=\"64\"\n height=\"64\"\n style={{\n aspectRatio: '1/1',\n verticalAlign: 'middle',\n background: '#b7cdf9',\n borderRadius: 12,\n }}\n />\n <div>\n <b>Phanpy</b>{' '}\n <a\n href=\"https://hachyderm.io/@phanpy\"\n // target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = 'phanpy@hachyderm.io';\n }}\n >\n @phanpy\n </a>\n <br />\n <Trans>\n <a\n href=\"https://github.com/cheeaun/phanpy\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Built\n </a>{' '}\n by{' '}\n <a\n href=\"https://mastodon.social/@cheeaun\"\n // target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = 'cheeaun@mastodon.social';\n }}\n >\n @cheeaun\n </a>\n </Trans>\n </div>\n </div>\n <p>\n <a\n href=\"https://github.com/sponsors/cheeaun\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Sponsor</Trans>\n </a>{' '}\n &middot;{' '}\n <a\n href=\"https://www.buymeacoffee.com/cheeaun\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Donate</Trans>\n </a>{' '}\n &middot;{' '}\n <a\n href={PRIVACY_POLICY_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Privacy Policy</Trans>\n </a>\n </p>\n {__BUILD_TIME__ && (\n <p>\n {WEBSITE && (\n <>\n <Trans>\n <span class=\"insignificant\">Site:</span>{' '}\n {WEBSITE.replace(/https?:\\/\\//g, '').replace(/\\/$/, '')}\n </Trans>\n <br />\n </>\n )}\n <Trans>\n <span class=\"insignificant\">Version:</span>{' '}\n <input\n type=\"text\"\n class=\"version-string\"\n readOnly\n size=\"18\" // Manually calculated here\n value={`${__BUILD_TIME__.slice(0, 10).replace(/-/g, '.')}${\n __COMMIT_HASH__ ? `.${__COMMIT_HASH__}` : ''\n }`}\n onClick={(e) => {\n e.target.select();\n // Copy to clipboard\n try {\n navigator.clipboard.writeText(e.target.value);\n showToast(t`Version string copied`);\n } catch (e) {\n console.warn(e);\n showToast(t`Unable to copy version string`);\n }\n }}\n />{' '}\n {!__FAKE_COMMIT_HASH__ && (\n <span class=\"ib insignificant\">\n (\n <a\n href={`https://github.com/cheeaun/phanpy/commit/${__COMMIT_HASH__}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <RelativeTime datetime={new Date(__BUILD_TIME__)} />\n </a>\n )\n </span>\n )}\n </Trans>\n </p>\n )}\n </section>\n {(import.meta.env.DEV || import.meta.env.PHANPY_DEV) && (\n <details class=\"debug-info\">\n <summary></summary>\n <p>Debugging</p>\n {__BENCH_RESULTS?.size > 0 && (\n <ul>\n {Array.from(__BENCH_RESULTS.entries()).map(\n ([name, duration]) => (\n <li>\n <b>{name}</b>: {duration}ms\n </li>\n ),\n )}\n </ul>\n )}\n <p>Service Worker Cache</p>\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={async () => alert(await getCachesKeys())}\n >\n Show keys count\n </button>{' '}\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={() => {\n const key = prompt('Enter cache key');\n if (!key) return;\n try {\n clearCacheKey(key);\n } catch (e) {\n alert(e);\n }\n }}\n >\n Clear cache key\n </button>{' '}\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={() => {\n try {\n clearCaches();\n } catch (e) {\n alert(e);\n }\n }}\n >\n Clear all caches\n </button>\n </details>\n )}\n </main>\n </div>\n );\n}\n\nasync function getCachesKeys() {\n const keys = await caches.keys();\n const total = {};\n for (const key of keys) {\n const cache = await caches.open(key);\n const k = await cache.keys();\n total[key] = k.length;\n }\n return total;\n}\n\nfunction clearCacheKey(key) {\n return caches.delete(key);\n}\n\nasync function clearCaches() {\n const keys = await caches.keys();\n for (const key of keys) {\n await caches.delete(key);\n }\n}\n\nfunction PushNotificationsSection({ onClose }) {\n if (!isPushSupported()) return null;\n\n const { instance } = api();\n const [uiState, setUIState] = useState('default');\n const pushFormRef = useRef();\n const [allowNotifications, setAllowNotifications] = useState(false);\n const [needRelogin, setNeedRelogin] = useState(false);\n const previousPolicyRef = useRef();\n useEffect(() => {\n (async () => {\n setUIState('loading');\n try {\n const { subscription, backendSubscription } = await initSubscription();\n if (\n backendSubscription?.policy &&\n backendSubscription.policy !== 'none'\n ) {\n setAllowNotifications(true);\n const { alerts, policy } = backendSubscription;\n console.log('backendSubscription', backendSubscription);\n previousPolicyRef.current = policy;\n const { elements } = pushFormRef.current;\n const policyEl = elements.namedItem('policy');\n if (policyEl) policyEl.value = policy;\n // alerts is {}, iterate it\n Object.keys(alerts).forEach((alert) => {\n const el = elements.namedItem(alert);\n if (el?.type === 'checkbox') {\n el.checked = true;\n }\n });\n }\n setUIState('default');\n } catch (err) {\n console.warn(err);\n if (/outside.*authorized/i.test(err.message)) {\n setNeedRelogin(true);\n } else {\n alert(err?.message || err);\n }\n setUIState('error');\n }\n })();\n }, []);\n\n const isLoading = uiState === 'loading';\n\n return (\n <form\n ref={pushFormRef}\n onChange={() => {\n setTimeout(() => {\n const values = Object.fromEntries(new FormData(pushFormRef.current));\n const allowNotifications = !!values['policy-allow'];\n const params = {\n data: {\n policy: values.policy,\n alerts: {\n mention: !!values.mention,\n favourite: !!values.favourite,\n reblog: !!values.reblog,\n follow: !!values.follow,\n follow_request: !!values.followRequest,\n poll: !!values.poll,\n update: !!values.update,\n status: !!values.status,\n },\n },\n };\n\n let alertsCount = 0;\n // Remove false values from data.alerts\n // API defaults to false anyway\n Object.keys(params.data.alerts).forEach((key) => {\n if (!params.data.alerts[key]) {\n delete params.data.alerts[key];\n } else {\n alertsCount++;\n }\n });\n const policyChanged =\n previousPolicyRef.current !== params.data.policy;\n\n console.log('PN Form', {\n values,\n allowNotifications: allowNotifications,\n params,\n });\n\n if (allowNotifications && alertsCount > 0) {\n if (policyChanged) {\n console.debug('Policy changed.');\n removeSubscription()\n .then(() => {\n updateSubscription(params);\n })\n .catch((err) => {\n console.warn(err);\n alert(t`Failed to update subscription. Please try again.`);\n });\n } else {\n updateSubscription(params).catch((err) => {\n console.warn(err);\n alert(t`Failed to update subscription. Please try again.`);\n });\n }\n } else {\n removeSubscription().catch((err) => {\n console.warn(err);\n alert(t`Failed to remove subscription. Please try again.`);\n });\n }\n }, 100);\n }}\n >\n <h3>\n <Trans>Push Notifications (beta)</Trans>\n </h3>\n <section>\n <ul>\n <li>\n <label>\n <input\n type=\"checkbox\"\n disabled={isLoading || needRelogin}\n name=\"policy-allow\"\n checked={allowNotifications}\n onChange={async (e) => {\n const { checked } = e.target;\n if (checked) {\n // Request permission\n const permission = await Notification.requestPermission();\n if (permission === 'granted') {\n setAllowNotifications(true);\n } else {\n setAllowNotifications(false);\n if (permission === 'denied') {\n alert(\n t`Push notifications are blocked. Please enable them in your browser settings.`,\n );\n }\n }\n } else {\n setAllowNotifications(false);\n }\n }}\n />{' '}\n <Trans>\n Allow from{' '}\n <select\n name=\"policy\"\n disabled={isLoading || needRelogin || !allowNotifications}\n >\n {[\n {\n value: 'all',\n label: t`anyone`,\n },\n {\n value: 'followed',\n label: t`people I follow`,\n },\n {\n value: 'follower',\n label: t`followers`,\n },\n ].map((type) => (\n <option value={type.value}>{type.label}</option>\n ))}\n </select>\n </Trans>\n </label>\n <div\n class=\"shazam-container no-animation\"\n style={{\n width: '100%',\n }}\n hidden={!allowNotifications}\n >\n <div class=\"shazam-container-inner\">\n <div class=\"sub-section\">\n <ul>\n {[\n {\n value: 'mention',\n label: t`Mentions`,\n },\n {\n value: 'favourite',\n label: t`Likes`,\n },\n {\n value: 'reblog',\n label: t`Boosts`,\n },\n {\n value: 'follow',\n label: t`Follows`,\n },\n {\n value: 'followRequest',\n label: t`Follow requests`,\n },\n {\n value: 'poll',\n label: t`Polls`,\n },\n {\n value: 'update',\n label: t`Post edits`,\n },\n {\n value: 'status',\n label: t`New posts`,\n },\n ].map((alert) => (\n <li>\n <label>\n <input type=\"checkbox\" name={alert.value} />{' '}\n {alert.label}\n </label>\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n {needRelogin && (\n <div class=\"sub-section\">\n <p>\n <Trans>\n Push permission was not granted since your last login.\n You'll need to{' '}\n <Link to={`/login?instance=${instance}`} onClick={onClose}>\n <b>log in</b> again to grant push permission\n </Link>\n .\n </Trans>\n </p>\n </div>\n )}\n </li>\n </ul>\n </section>\n <p class=\"section-postnote\">\n <small>\n <Trans>\n NOTE: Push notifications only work for <b>one account</b>.\n </Trans>\n </small>\n </p>\n </form>\n );\n}\n\nexport default Settings;\n","const focusDeck = () => {\n let timer = setTimeout(() => {\n const columns = document.getElementById('columns');\n if (columns) {\n // Focus first column\n // columns.querySelector('.deck-container')?.focus?.();\n } else {\n const modals = document.querySelectorAll('#modal-container > *');\n if (modals?.length) {\n // Focus last modal\n const modal = modals[modals.length - 1]; // last one\n const modalFocusElement =\n modal.querySelector('[tabindex=\"-1\"]') || modal;\n if (modalFocusElement) {\n modalFocusElement.focus();\n return;\n }\n }\n const backDrop = document.querySelector('.deck-backdrop');\n if (backDrop) return;\n // Focus last deck\n const pages = document.querySelectorAll('.deck-container');\n const page = pages[pages.length - 1]; // last one\n if (page && page.tabIndex === -1) {\n console.log('FOCUS', page);\n page.focus();\n }\n }\n }, 100);\n return () => clearTimeout(timer);\n};\n\nexport default focusDeck;\n","import { useEffect, useRef } from 'preact/hooks';\nimport { useLocation } from 'react-router-dom';\n\n// Hook that runs a callback when the location changes\n// Won't run on the first render\n\nexport default function useLocationChange(fn) {\n if (!fn) return;\n const location = useLocation();\n const currentLocationRef = useRef(location.pathname);\n useEffect(() => {\n // console.log('location', {\n // current: currentLocationRef.current,\n // next: location.pathname,\n // });\n if (\n currentLocationRef.current &&\n location.pathname !== currentLocationRef.current\n ) {\n fn?.();\n }\n }, [location.pathname, fn]);\n}\n","import { api } from './api';\nimport pmem from './pmem';\nimport store from './store';\n\nconst FETCH_MAX_AGE = 1000 * 60; // 1 minute\nconst MAX_AGE = 24 * 60 * 60 * 1000; // 1 day\n\nexport const fetchLists = pmem(\n async () => {\n const { masto } = api();\n const lists = await masto.v1.lists.list();\n lists.sort((a, b) => a.title.localeCompare(b.title));\n\n if (lists.length) {\n setTimeout(() => {\n // Save to local storage, with saved timestamp\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }, 1);\n }\n\n return lists;\n },\n {\n maxAge: FETCH_MAX_AGE,\n },\n);\n\nexport async function getLists() {\n try {\n const { lists, updatedAt } = store.account.get('lists') || {};\n if (!lists?.length) return await fetchLists();\n if (Date.now() - updatedAt > MAX_AGE) {\n // Stale-while-revalidate\n fetchLists();\n return lists;\n }\n return lists;\n } catch (e) {\n return [];\n }\n}\n\nexport const fetchList = pmem(\n (id) => {\n const { masto } = api();\n return masto.v1.lists.$select(id).fetch();\n },\n {\n maxAge: FETCH_MAX_AGE,\n },\n);\n\nexport async function getList(id) {\n const { lists } = store.account.get('lists') || {};\n console.log({ lists });\n if (lists?.length) {\n const theList = lists.find((l) => l.id === id);\n if (theList) return theList;\n }\n try {\n return fetchList(id);\n } catch (e) {\n return null;\n }\n}\n\nexport async function getListTitle(id) {\n const list = await getList(id);\n return list?.title || '';\n}\n\nexport function addListStore(list) {\n const { lists } = store.account.get('lists') || {};\n if (lists?.length) {\n lists.push(list);\n lists.sort((a, b) => a.title.localeCompare(b.title));\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }\n}\n\nexport function updateListStore(list) {\n const { lists } = store.account.get('lists') || {};\n if (lists?.length) {\n const index = lists.findIndex((l) => l.id === list.id);\n if (index !== -1) {\n lists[index] = list;\n lists.sort((a, b) => a.title.localeCompare(b.title));\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }\n }\n}\n\nexport function deleteListStore(listID) {\n const { lists } = store.account.get('lists') || {};\n if (lists?.length) {\n const index = lists.findIndex((l) => l.id === listID);\n if (index !== -1) {\n lists.splice(index, 1);\n store.account.set('lists', {\n lists,\n updatedAt: Date.now(),\n });\n }\n }\n}\n","import { t, Trans } from '@lingui/macro';\nimport { useEffect, useRef, useState } from 'preact/hooks';\n\nimport { api } from '../utils/api';\nimport { addListStore, deleteListStore, updateListStore } from '../utils/lists';\nimport supports from '../utils/supports';\n\nimport Icon from './icon';\nimport MenuConfirm from './menu-confirm';\n\nfunction ListAddEdit({ list, onClose }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const editMode = !!list;\n const nameFieldRef = useRef();\n const repliesPolicyFieldRef = useRef();\n const exclusiveFieldRef = useRef();\n useEffect(() => {\n if (editMode) {\n nameFieldRef.current.value = list.title;\n repliesPolicyFieldRef.current.value = list.repliesPolicy;\n if (exclusiveFieldRef.current) {\n exclusiveFieldRef.current.checked = list.exclusive;\n }\n }\n }, [editMode]);\n const supportsExclusive = supports('@mastodon/list-exclusive');\n\n return (\n <div class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}{' '}\n <header>\n <h2>{editMode ? t`Edit list` : t`New list`}</h2>\n </header>\n <main>\n <form\n class=\"list-form\"\n onSubmit={(e) => {\n e.preventDefault(); // Get form values\n\n const formData = new FormData(e.target);\n const title = formData.get('title');\n const repliesPolicy = formData.get('replies_policy');\n const exclusive = formData.get('exclusive') === 'on';\n console.log({\n title,\n repliesPolicy,\n exclusive,\n });\n setUIState('loading');\n\n (async () => {\n try {\n let listResult;\n\n if (editMode) {\n listResult = await masto.v1.lists.$select(list.id).update({\n title,\n replies_policy: repliesPolicy,\n exclusive,\n });\n } else {\n listResult = await masto.v1.lists.create({\n title,\n replies_policy: repliesPolicy,\n exclusive,\n });\n }\n\n console.log(listResult);\n setUIState('default');\n onClose?.({\n state: 'success',\n list: listResult,\n });\n\n setTimeout(() => {\n if (editMode) {\n updateListStore(listResult);\n } else {\n addListStore(listResult);\n }\n }, 1);\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(\n editMode\n ? t`Unable to edit list.`\n : t`Unable to create list.`,\n );\n }\n })();\n }}\n >\n <div class=\"list-form-row\">\n <label for=\"list-title\">\n <Trans>Name</Trans>{' '}\n <input\n ref={nameFieldRef}\n type=\"text\"\n id=\"list-title\"\n name=\"title\"\n required\n disabled={uiState === 'loading'}\n dir=\"auto\"\n />\n </label>\n </div>\n <div class=\"list-form-row\">\n <select\n ref={repliesPolicyFieldRef}\n name=\"replies_policy\"\n required\n disabled={uiState === 'loading'}\n >\n <option value=\"list\">\n <Trans>Show replies to list members</Trans>\n </option>\n <option value=\"followed\">\n <Trans>Show replies to people I follow</Trans>\n </option>\n <option value=\"none\">\n <Trans>Don't show replies</Trans>\n </option>\n </select>\n </div>\n {supportsExclusive && (\n <div class=\"list-form-row\">\n <label class=\"label-block\">\n <input\n ref={exclusiveFieldRef}\n type=\"checkbox\"\n name=\"exclusive\"\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>Hide posts on this list from Home/Following</Trans>\n </label>\n </div>\n )}\n <div class=\"list-form-footer\">\n <button type=\"submit\" disabled={uiState === 'loading'}>\n {editMode ? t`Save` : t`Create`}\n </button>\n {editMode && (\n <MenuConfirm\n disabled={uiState === 'loading'}\n align=\"end\"\n menuItemClassName=\"danger\"\n confirmLabel={t`Delete this list?`}\n onClick={() => {\n // const yes = confirm('Delete this list?');\n // if (!yes) return;\n setUIState('loading');\n\n (async () => {\n try {\n await masto.v1.lists.$select(list.id).remove();\n setUIState('default');\n onClose?.({\n state: 'deleted',\n });\n setTimeout(() => {\n deleteListStore(list.id);\n }, 1);\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(t`Unable to delete list.`);\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"light danger\"\n disabled={uiState === 'loading'}\n >\n <Trans>Delete…</Trans>\n </button>\n </MenuConfirm>\n )}\n </div>\n </form>\n </main>\n </div>\n );\n}\n\nexport default ListAddEdit;\n","import './account-info.css';\n\nimport { msg, plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\n\nimport { api } from '../utils/api';\nimport enhanceContent from '../utils/enhance-content';\nimport getHTMLText from '../utils/getHTMLText';\nimport handleContentLinks from '../utils/handle-content-links';\nimport i18nDuration from '../utils/i18n-duration';\nimport { getLists } from '../utils/lists';\nimport niceDateTime from '../utils/nice-date-time';\nimport pmem from '../utils/pmem';\nimport shortenNumber from '../utils/shorten-number';\nimport showCompose from '../utils/show-compose';\nimport showToast from '../utils/show-toast';\nimport states, { hideAllModals } from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID, updateAccount } from '../utils/store-utils';\nimport supports from '../utils/supports';\n\nimport AccountBlock from './account-block';\nimport Avatar from './avatar';\nimport EmojiText from './emoji-text';\nimport Icon from './icon';\nimport Link from './link';\nimport ListAddEdit from './list-add-edit';\nimport Loader from './loader';\nimport MenuConfirm from './menu-confirm';\nimport MenuLink from './menu-link';\nimport Menu2 from './menu2';\nimport Modal from './modal';\nimport SubMenu2 from './submenu2';\nimport TranslationBlock from './translation-block';\n\nconst MUTE_DURATIONS = [\n 60 * 5, // 5 minutes\n 60 * 30, // 30 minutes\n 60 * 60, // 1 hour\n 60 * 60 * 6, // 6 hours\n 60 * 60 * 24, // 1 day\n 60 * 60 * 24 * 3, // 3 days\n 60 * 60 * 24 * 7, // 1 week\n 0, // forever\n];\nconst MUTE_DURATIONS_LABELS = {\n 0: msg`Forever`,\n 300: i18nDuration(5, 'minute'),\n 1_800: i18nDuration(30, 'minute'),\n 3_600: i18nDuration(1, 'hour'),\n 21_600: i18nDuration(6, 'hour'),\n 86_400: i18nDuration(1, 'day'),\n 259_200: i18nDuration(3, 'day'),\n 604_800: i18nDuration(1, 'week'),\n};\n\nconst LIMIT = 80;\n\nconst ACCOUNT_INFO_MAX_AGE = 1000 * 60 * 10; // 10 mins\n\nfunction fetchFamiliarFollowers(currentID, masto) {\n return masto.v1.accounts.familiarFollowers.fetch({\n id: [currentID],\n });\n}\nconst memFetchFamiliarFollowers = pmem(fetchFamiliarFollowers, {\n maxAge: ACCOUNT_INFO_MAX_AGE,\n});\n\nasync function fetchPostingStats(accountID, masto) {\n const fetchStatuses = masto.v1.accounts\n .$select(accountID)\n .statuses.list({\n limit: 20,\n })\n .next();\n\n const { value: statuses } = await fetchStatuses;\n console.log('fetched statuses', statuses);\n const stats = {\n total: statuses.length,\n originals: 0,\n replies: 0,\n boosts: 0,\n };\n // Categories statuses by type\n // - Original posts (not replies to others)\n // - Threads (self-replies + 1st original post)\n // - Boosts (reblogs)\n // - Replies (not-self replies)\n statuses.forEach((status) => {\n if (status.reblog) {\n stats.boosts++;\n } else if (\n !!status.inReplyToId &&\n status.inReplyToAccountId !== status.account.id // Not self-reply\n ) {\n stats.replies++;\n } else {\n stats.originals++;\n }\n });\n\n // Count days since last post\n if (statuses.length) {\n stats.daysSinceLastPost = Math.ceil(\n (Date.now() - new Date(statuses[statuses.length - 1].createdAt)) /\n 86400000,\n );\n }\n\n console.log('posting stats', stats);\n return stats;\n}\nconst memFetchPostingStats = pmem(fetchPostingStats, {\n maxAge: ACCOUNT_INFO_MAX_AGE,\n});\n\nfunction AccountInfo({\n account,\n fetchAccount = () => {},\n standalone,\n instance,\n authenticated,\n}) {\n const { i18n } = useLingui();\n const { masto } = api({\n instance,\n });\n const { masto: currentMasto, instance: currentInstance } = api();\n const [uiState, setUIState] = useState('default');\n const isString = typeof account === 'string';\n const [info, setInfo] = useState(isString ? null : account);\n\n const sameCurrentInstance = useMemo(\n () => instance === currentInstance,\n [instance, currentInstance],\n );\n\n useEffect(() => {\n if (!isString) {\n setInfo(account);\n return;\n }\n setUIState('loading');\n (async () => {\n try {\n const info = await fetchAccount();\n states.accounts[`${info.id}@${instance}`] = info;\n setInfo(info);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setInfo(null);\n setUIState('error');\n }\n })();\n }, [isString, account, fetchAccount]);\n\n const {\n acct,\n avatar,\n avatarStatic,\n bot,\n createdAt,\n displayName,\n emojis,\n fields,\n followersCount,\n followingCount,\n group,\n // header,\n // headerStatic,\n id,\n lastStatusAt,\n locked,\n note,\n statusesCount,\n url,\n username,\n memorial,\n moved,\n roles,\n hideCollections,\n } = info || {};\n let headerIsAvatar = false;\n let { header, headerStatic } = info || {};\n if (!header || /missing\\.png$/.test(header)) {\n if (avatar && !/missing\\.png$/.test(avatar)) {\n header = avatar;\n headerIsAvatar = true;\n if (avatarStatic && !/missing\\.png$/.test(avatarStatic)) {\n headerStatic = avatarStatic;\n }\n }\n }\n\n const isSelf = useMemo(() => id === getCurrentAccountID(), [id]);\n\n useEffect(() => {\n const infoHasEssentials = !!(\n info?.id &&\n info?.username &&\n info?.acct &&\n info?.avatar &&\n info?.avatarStatic &&\n info?.displayName &&\n info?.url\n );\n if (isSelf && instance && infoHasEssentials) {\n const accounts = store.local.getJSON('accounts');\n let updated = false;\n accounts.forEach((account) => {\n if (account.info.id === info.id && account.instanceURL === instance) {\n account.info = info;\n updated = true;\n }\n });\n if (updated) {\n console.log('Updated account info', info);\n store.local.setJSON('accounts', accounts);\n }\n }\n }, [isSelf, info, instance]);\n\n const accountInstance = useMemo(() => {\n if (!url) return null;\n const domain = punycode.toUnicode(URL.parse(url).hostname);\n return domain;\n }, [url]);\n\n const [headerCornerColors, setHeaderCornerColors] = useState([]);\n\n const followersIterator = useRef();\n const familiarFollowersCache = useRef([]);\n async function fetchFollowers(firstLoad) {\n if (firstLoad || !followersIterator.current) {\n followersIterator.current = masto.v1.accounts.$select(id).followers.list({\n limit: LIMIT,\n });\n }\n const results = await followersIterator.current.next();\n if (isSelf) return results;\n if (!sameCurrentInstance) return results;\n\n const { value } = results;\n let newValue = [];\n // On first load, fetch familiar followers, merge to top of results' `value`\n // Remove dups on every fetch\n if (firstLoad) {\n let familiarFollowers = [];\n try {\n familiarFollowers = await masto.v1.accounts.familiarFollowers.fetch({\n id: [id],\n });\n } catch (e) {}\n familiarFollowersCache.current = familiarFollowers?.[0]?.accounts || [];\n newValue = [\n ...familiarFollowersCache.current,\n ...value.filter(\n (account) =>\n !familiarFollowersCache.current.some(\n (familiar) => familiar.id === account.id,\n ),\n ),\n ];\n } else if (value?.length) {\n newValue = value.filter(\n (account) =>\n !familiarFollowersCache.current.some(\n (familiar) => familiar.id === account.id,\n ),\n );\n }\n\n return {\n ...results,\n value: newValue,\n };\n }\n\n const followingIterator = useRef();\n async function fetchFollowing(firstLoad) {\n if (firstLoad || !followingIterator.current) {\n followingIterator.current = masto.v1.accounts.$select(id).following.list({\n limit: LIMIT,\n });\n }\n const results = await followingIterator.current.next();\n return results;\n }\n\n const LinkOrDiv = standalone ? 'div' : Link;\n const accountLink = instance ? `/${instance}/a/${id}` : `/a/${id}`;\n\n const [familiarFollowers, setFamiliarFollowers] = useState([]);\n const [postingStats, setPostingStats] = useState();\n const [postingStatsUIState, setPostingStatsUIState] = useState('default');\n const hasPostingStats = !!postingStats?.total;\n\n const renderFamiliarFollowers = async (currentID) => {\n try {\n const followers = await memFetchFamiliarFollowers(\n currentID,\n currentMasto,\n );\n console.log('fetched familiar followers', followers);\n setFamiliarFollowers(\n followers[0].accounts.slice(0, FAMILIAR_FOLLOWERS_LIMIT),\n );\n } catch (e) {\n console.error(e);\n }\n };\n\n const renderPostingStats = async () => {\n if (!id) return;\n setPostingStatsUIState('loading');\n try {\n const stats = await memFetchPostingStats(id, masto);\n setPostingStats(stats);\n setPostingStatsUIState('default');\n } catch (e) {\n console.error(e);\n setPostingStatsUIState('error');\n }\n };\n\n const onRelationshipChange = useCallback(\n ({ relationship, currentID }) => {\n if (!relationship.following) {\n renderFamiliarFollowers(currentID);\n if (!standalone && statusesCount > 0) {\n // Only render posting stats if not standalone and has posts\n renderPostingStats();\n }\n }\n },\n [standalone, id, statusesCount],\n );\n\n const onProfileUpdate = useCallback(\n (newAccount) => {\n if (newAccount.id === id) {\n console.log('Updated account info', newAccount);\n setInfo(newAccount);\n states.accounts[`${newAccount.id}@${instance}`] = newAccount;\n }\n },\n [id, instance],\n );\n\n return (\n <div\n tabIndex=\"-1\"\n class={`account-container ${uiState === 'loading' ? 'skeleton' : ''}`}\n style={{\n '--header-color-1': headerCornerColors[0],\n '--header-color-2': headerCornerColors[1],\n '--header-color-3': headerCornerColors[2],\n '--header-color-4': headerCornerColors[3],\n }}\n >\n {uiState === 'error' && (\n <div class=\"ui-state\">\n <p>\n <Trans>Unable to load account.</Trans>\n </p>\n <p>\n <a\n href={isString ? account : url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Go to account page</Trans> <Icon icon=\"external\" />\n </a>\n </p>\n </div>\n )}\n {uiState === 'loading' ? (\n <>\n <header>\n <AccountBlock avatarSize=\"xxxl\" skeleton />\n </header>\n <main>\n <div class=\"note\">\n <p>███████ ████ ████</p>\n <p>████ ████████ ██████ █████████ ████ ██</p>\n </div>\n <div class=\"account-metadata-box\">\n <div class=\"profile-metadata\">\n <div class=\"profile-field\">\n <b class=\"more-insignificant\">███</b>\n <p>██████</p>\n </div>\n <div class=\"profile-field\">\n <b class=\"more-insignificant\">████</b>\n <p>███████████</p>\n </div>\n </div>\n <div class=\"stats\">\n <div>\n <span>██</span> <Trans>Followers</Trans>\n </div>\n <div>\n <span>██</span> <Trans id=\"following.stats\">Following</Trans>\n </div>\n <div>\n <span>██</span> <Trans>Posts</Trans>\n </div>\n </div>\n </div>\n <div class=\"actions\">\n <span />\n <span class=\"buttons\">\n <button type=\"button\" class=\"plain\" disabled>\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n </span>\n </div>\n </main>\n </>\n ) : (\n info && (\n <>\n {!!moved && (\n <div class=\"account-moved\">\n <p>\n <Trans>\n <b>{displayName}</b> has indicated that their new account is\n now:\n </Trans>\n </p>\n <AccountBlock\n account={moved}\n instance={instance}\n onClick={(e) => {\n e.stopPropagation();\n states.showAccount = moved;\n }}\n />\n </div>\n )}\n {!!header && !/missing\\.png$/.test(header) && (\n <img\n src={header}\n alt=\"\"\n class={`header-banner ${\n headerIsAvatar ? 'header-is-avatar' : ''\n }`}\n onError={(e) => {\n if (e.target.crossOrigin) {\n if (e.target.src !== headerStatic) {\n e.target.src = headerStatic;\n } else {\n e.target.removeAttribute('crossorigin');\n e.target.src = header;\n }\n } else if (e.target.src !== headerStatic) {\n e.target.src = headerStatic;\n } else {\n e.target.remove();\n }\n }}\n crossOrigin=\"anonymous\"\n onLoad={(e) => {\n e.target.classList.add('loaded');\n try {\n // Get color from four corners of image\n const canvas = window.OffscreenCanvas\n ? new OffscreenCanvas(1, 1)\n : document.createElement('canvas');\n const ctx = canvas.getContext('2d', {\n willReadFrequently: true,\n });\n canvas.width = e.target.width;\n canvas.height = e.target.height;\n ctx.imageSmoothingEnabled = false;\n ctx.drawImage(e.target, 0, 0);\n // const colors = [\n // ctx.getImageData(0, 0, 1, 1).data,\n // ctx.getImageData(e.target.width - 1, 0, 1, 1).data,\n // ctx.getImageData(0, e.target.height - 1, 1, 1).data,\n // ctx.getImageData(\n // e.target.width - 1,\n // e.target.height - 1,\n // 1,\n // 1,\n // ).data,\n // ];\n // Get 10x10 pixels from corners, get average color from each\n const pixelDimension = 10;\n const colors = [\n ctx.getImageData(0, 0, pixelDimension, pixelDimension)\n .data,\n ctx.getImageData(\n e.target.width - pixelDimension,\n 0,\n pixelDimension,\n pixelDimension,\n ).data,\n ctx.getImageData(\n 0,\n e.target.height - pixelDimension,\n pixelDimension,\n pixelDimension,\n ).data,\n ctx.getImageData(\n e.target.width - pixelDimension,\n e.target.height - pixelDimension,\n pixelDimension,\n pixelDimension,\n ).data,\n ].map((data) => {\n let r = 0;\n let g = 0;\n let b = 0;\n let a = 0;\n for (let i = 0; i < data.length; i += 4) {\n r += data[i];\n g += data[i + 1];\n b += data[i + 2];\n a += data[i + 3];\n }\n const dataLength = data.length / 4;\n return [\n r / dataLength,\n g / dataLength,\n b / dataLength,\n a / dataLength,\n ];\n });\n const rgbColors = colors.map((color) => {\n const [r, g, b, a] = lightenRGB(color);\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n });\n setHeaderCornerColors(rgbColors);\n console.log({ colors, rgbColors });\n } catch (e) {\n // Silently fail\n }\n }}\n />\n )}\n <header>\n {standalone ? (\n <Menu2\n shift={\n window.matchMedia('(min-width: calc(40em))').matches\n ? 114\n : 64\n }\n menuButton={\n <div>\n <AccountBlock\n account={info}\n instance={instance}\n avatarSize=\"xxxl\"\n onClick={() => {}}\n />\n </div>\n }\n >\n <div class=\"szh-menu__header\">\n <AccountHandleInfo acct={acct} instance={instance} />\n </div>\n <MenuItem\n onClick={() => {\n const handleWithInstance = acct.includes('@')\n ? `@${acct}`\n : `@${acct}@${instance}`;\n try {\n navigator.clipboard.writeText(handleWithInstance);\n showToast(t`Handle copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy handle`);\n }\n }}\n >\n <Icon icon=\"link\" />\n <span>\n <Trans>Copy handle</Trans>\n </span>\n </MenuItem>\n <MenuItem href={url} target=\"_blank\">\n <Icon icon=\"external\" />\n <span>\n <Trans>Go to original profile page</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n <MenuLink href={info.avatar} target=\"_blank\">\n <Icon icon=\"user\" />\n <span>\n <Trans>View profile image</Trans>\n </span>\n </MenuLink>\n <MenuLink href={info.header} target=\"_blank\">\n <Icon icon=\"media\" />\n <span>\n <Trans>View profile header</Trans>\n </span>\n </MenuLink>\n </Menu2>\n ) : (\n <AccountBlock\n account={info}\n instance={instance}\n avatarSize=\"xxxl\"\n internal\n />\n )}\n </header>\n <div class=\"faux-header-bg\" aria-hidden=\"true\" />\n <main>\n {!!memorial && (\n <span class=\"tag\">\n <Trans>In Memoriam</Trans>\n </span>\n )}\n {!!bot && (\n <span class=\"tag\">\n <Icon icon=\"bot\" /> <Trans>Automated</Trans>\n </span>\n )}\n {!!group && (\n <span class=\"tag\">\n <Icon icon=\"group\" /> <Trans>Group</Trans>\n </span>\n )}\n {roles?.map((role) => (\n <span class=\"tag\">\n {role.name}\n {!!accountInstance && (\n <>\n {' '}\n <span class=\"more-insignificant\">{accountInstance}</span>\n </>\n )}\n </span>\n ))}\n <div\n class=\"note\"\n dir=\"auto\"\n onClick={handleContentLinks({\n instance: currentInstance,\n })}\n dangerouslySetInnerHTML={{\n __html: enhanceContent(note, { emojis }),\n }}\n />\n <div class=\"account-metadata-box\">\n {fields?.length > 0 && (\n <div class=\"profile-metadata\">\n {fields.map(({ name, value, verifiedAt }, i) => (\n <div\n class={`profile-field ${\n verifiedAt ? 'profile-verified' : ''\n }`}\n key={name + i}\n dir=\"auto\"\n >\n <b>\n <EmojiText text={name} emojis={emojis} />{' '}\n {!!verifiedAt && (\n <Icon\n icon=\"check-circle\"\n size=\"s\"\n alt={t`Verified`}\n />\n )}\n </b>\n <p\n dangerouslySetInnerHTML={{\n __html: enhanceContent(value, { emojis }),\n }}\n />\n </div>\n ))}\n </div>\n )}\n <div class=\"stats\">\n <LinkOrDiv\n tabIndex={0}\n to={accountLink}\n onClick={() => {\n // states.showAccount = false;\n setTimeout(() => {\n states.showGenericAccounts = {\n id: 'followers',\n heading: t`Followers`,\n fetchAccounts: fetchFollowers,\n instance,\n excludeRelationshipAttrs: isSelf\n ? ['followedBy']\n : [],\n blankCopy: hideCollections\n ? t`This user has chosen to not make this information available.`\n : undefined,\n };\n }, 0);\n }}\n >\n {!!familiarFollowers.length && (\n <span class=\"shazam-container-horizontal\">\n <span class=\"shazam-container-inner stats-avatars-bunch\">\n {familiarFollowers.map((follower) => (\n <Avatar\n url={follower.avatarStatic}\n size=\"s\"\n alt={`${follower.displayName} @${follower.acct}`}\n squircle={follower?.bot}\n />\n ))}\n </span>\n </span>\n )}\n <span title={followersCount}>\n {shortenNumber(followersCount)}\n </span>{' '}\n <Trans>Followers</Trans>\n </LinkOrDiv>\n <LinkOrDiv\n class=\"insignificant\"\n tabIndex={0}\n to={accountLink}\n onClick={() => {\n // states.showAccount = false;\n setTimeout(() => {\n states.showGenericAccounts = {\n heading: t({\n id: 'following.stats',\n message: 'Following',\n }),\n fetchAccounts: fetchFollowing,\n instance,\n excludeRelationshipAttrs: isSelf ? ['following'] : [],\n blankCopy: hideCollections\n ? t`This user has chosen to not make this information available.`\n : undefined,\n };\n }, 0);\n }}\n >\n <span title={followingCount}>\n {shortenNumber(followingCount)}\n </span>{' '}\n <Trans id=\"following.stats\">Following</Trans>\n <br />\n </LinkOrDiv>\n <LinkOrDiv\n class=\"insignificant\"\n to={accountLink}\n // onClick={\n // standalone\n // ? undefined\n // : () => {\n // hideAllModals();\n // }\n // }\n >\n <span title={statusesCount}>\n {shortenNumber(statusesCount)}\n </span>{' '}\n <Trans>Posts</Trans>\n </LinkOrDiv>\n {!!createdAt && (\n <div class=\"insignificant\">\n <Trans>\n Joined{' '}\n <time datetime={createdAt}>\n {niceDateTime(createdAt, {\n hideTime: true,\n })}\n </time>\n </Trans>\n </div>\n )}\n </div>\n </div>\n {!!postingStats && (\n <LinkOrDiv\n to={accountLink}\n class=\"account-metadata-box\"\n // onClick={() => {\n // states.showAccount = false;\n // }}\n >\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n {hasPostingStats ? (\n <div\n class=\"posting-stats\"\n title={t`${(\n postingStats.originals / postingStats.total\n ).toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n })} original posts, ${(\n postingStats.replies / postingStats.total\n ).toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n })} replies, ${(\n postingStats.boosts / postingStats.total\n ).toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n })} boosts`}\n >\n <div>\n {postingStats.daysSinceLastPost < 365\n ? plural(postingStats.total, {\n one: plural(postingStats.daysSinceLastPost, {\n one: `Last 1 post in the past 1 day`,\n other: `Last 1 post in the past ${postingStats.daysSinceLastPost} days`,\n }),\n other: plural(\n postingStats.daysSinceLastPost,\n {\n one: `Last ${postingStats.total} posts in the past 1 day`,\n other: `Last ${postingStats.total} posts in the past ${postingStats.daysSinceLastPost} days`,\n },\n ),\n })\n : plural(postingStats.total, {\n one: 'Last 1 post in the past year(s)',\n other: `Last ${postingStats.total} posts in the past year(s)`,\n })}\n </div>\n <div\n class=\"posting-stats-bar\"\n style={{\n // [originals | replies | boosts]\n '--originals-percentage': `${\n (postingStats.originals / postingStats.total) *\n 100\n }%`,\n '--replies-percentage': `${\n ((postingStats.originals +\n postingStats.replies) /\n postingStats.total) *\n 100\n }%`,\n }}\n />\n <div class=\"posting-stats-legends\">\n <span class=\"ib\">\n <span class=\"posting-stats-legend-item posting-stats-legend-item-originals\" />{' '}\n <Trans>Original</Trans>\n </span>{' '}\n <span class=\"ib\">\n <span class=\"posting-stats-legend-item posting-stats-legend-item-replies\" />{' '}\n <Trans>Replies</Trans>\n </span>{' '}\n <span class=\"ib\">\n <span class=\"posting-stats-legend-item posting-stats-legend-item-boosts\" />{' '}\n <Trans>Boosts</Trans>\n </span>\n </div>\n </div>\n ) : (\n <div class=\"posting-stats\">\n <Trans>Post stats unavailable.</Trans>\n </div>\n )}\n </div>\n </div>\n </LinkOrDiv>\n )}\n {!moved && (\n <div class=\"account-metadata-box\">\n <div\n class=\"shazam-container no-animation\"\n hidden={!!postingStats}\n >\n <div class=\"shazam-container-inner\">\n <button\n type=\"button\"\n class=\"posting-stats-button\"\n disabled={postingStatsUIState === 'loading'}\n onClick={() => {\n renderPostingStats();\n }}\n >\n <div\n class={`posting-stats-bar posting-stats-icon ${\n postingStatsUIState === 'loading' ? 'loading' : ''\n }`}\n style={{\n '--originals-percentage': '33%',\n '--replies-percentage': '66%',\n }}\n />\n <Trans>View post stats</Trans>{' '}\n {/* <Loader\n abrupt\n hidden={postingStatsUIState !== 'loading'}\n /> */}\n </button>\n </div>\n </div>\n </div>\n )}\n </main>\n <footer>\n <RelatedActions\n info={info}\n instance={instance}\n standalone={standalone}\n authenticated={authenticated}\n onRelationshipChange={onRelationshipChange}\n onProfileUpdate={onProfileUpdate}\n />\n </footer>\n </>\n )\n )}\n </div>\n );\n}\n\nconst FAMILIAR_FOLLOWERS_LIMIT = 3;\n\nfunction RelatedActions({\n info,\n instance,\n standalone,\n authenticated,\n onRelationshipChange = () => {},\n onProfileUpdate = () => {},\n}) {\n if (!info) return null;\n const { _ } = useLingui();\n const {\n masto: currentMasto,\n instance: currentInstance,\n authenticated: currentAuthenticated,\n } = api();\n const sameInstance = instance === currentInstance;\n\n const [relationshipUIState, setRelationshipUIState] = useState('default');\n const [relationship, setRelationship] = useState(null);\n\n const { id, acct, url, username, locked, lastStatusAt, note, fields, moved } =\n info;\n const accountID = useRef(id);\n\n const {\n following,\n showingReblogs,\n notifying,\n followedBy,\n blocking,\n blockedBy,\n muting,\n mutingNotifications,\n requested,\n domainBlocking,\n endorsed,\n note: privateNote,\n } = relationship || {};\n\n const [currentInfo, setCurrentInfo] = useState(null);\n const [isSelf, setIsSelf] = useState(false);\n\n const acctWithInstance = acct.includes('@') ? acct : `${acct}@${instance}`;\n\n useEffect(() => {\n if (info) {\n const currentAccount = getCurrentAccountID();\n let currentID;\n (async () => {\n if (sameInstance && authenticated) {\n currentID = id;\n } else if (!sameInstance && currentAuthenticated) {\n // Grab this account from my logged-in instance\n const acctHasInstance = info.acct.includes('@');\n try {\n const results = await currentMasto.v2.search.fetch({\n q: acctHasInstance ? info.acct : `${info.username}@${instance}`,\n type: 'accounts',\n limit: 1,\n resolve: true,\n });\n console.log('🥏 Fetched account from logged-in instance', results);\n if (results.accounts.length) {\n currentID = results.accounts[0].id;\n setCurrentInfo(results.accounts[0]);\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n if (!currentID) return;\n\n if (currentAccount === currentID) {\n // It's myself!\n setIsSelf(true);\n return;\n }\n\n accountID.current = currentID;\n\n // if (moved) return;\n\n setRelationshipUIState('loading');\n\n const fetchRelationships = currentMasto.v1.accounts.relationships.fetch(\n {\n id: [currentID],\n },\n );\n\n try {\n const relationships = await fetchRelationships;\n console.log('fetched relationship', relationships);\n setRelationshipUIState('default');\n\n if (relationships.length) {\n const relationship = relationships[0];\n setRelationship(relationship);\n onRelationshipChange({ relationship, currentID });\n }\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n }\n })();\n }\n }, [info, authenticated]);\n\n useEffect(() => {\n if (info && isSelf) {\n updateAccount(info);\n }\n }, [info, isSelf]);\n\n const loading = relationshipUIState === 'loading';\n\n const [showTranslatedBio, setShowTranslatedBio] = useState(false);\n const [showAddRemoveLists, setShowAddRemoveLists] = useState(false);\n const [showPrivateNoteModal, setShowPrivateNoteModal] = useState(false);\n const [showEditProfile, setShowEditProfile] = useState(false);\n const [lists, setLists] = useState([]);\n\n return (\n <>\n <div class=\"actions\">\n <span>\n {followedBy ? (\n <span class=\"tag\">\n <Trans>Follows you</Trans>\n </span>\n ) : !!lastStatusAt ? (\n <small class=\"insignificant\">\n <Trans>\n Last post:{' '}\n <span class=\"ib\">\n {niceDateTime(lastStatusAt, {\n hideTime: true,\n })}\n </span>\n </Trans>\n </small>\n ) : (\n <span />\n )}\n {muting && (\n <span class=\"tag danger\">\n <Trans>Muted</Trans>\n </span>\n )}\n {blocking && (\n <span class=\"tag danger\">\n <Trans>Blocked</Trans>\n </span>\n )}\n </span>{' '}\n <span class=\"buttons\">\n {!!privateNote && (\n <button\n type=\"button\"\n class=\"private-note-tag\"\n title={t`Private note`}\n onClick={() => {\n setShowPrivateNoteModal(true);\n }}\n dir=\"auto\"\n >\n <span>{privateNote}</span>\n </button>\n )}\n <Menu2\n portal={{\n target: document.body,\n }}\n containerProps={{\n style: {\n // Higher than the backdrop\n zIndex: 1001,\n },\n }}\n align=\"center\"\n position=\"anchor\"\n overflow=\"auto\"\n menuButton={\n <button type=\"button\" class=\"plain\" disabled={loading}>\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n onMenuChange={(e) => {\n if (following && e.open) {\n // Fetch lists that have this account\n (async () => {\n try {\n const lists = await currentMasto.v1.accounts\n .$select(accountID.current)\n .lists.list();\n console.log('fetched account lists', lists);\n setLists(lists);\n } catch (e) {\n console.error(e);\n }\n })();\n }\n }}\n >\n {currentAuthenticated && !isSelf && (\n <>\n <MenuItem\n onClick={() => {\n showCompose({\n draftStatus: {\n status: `@${currentInfo?.acct || acct} `,\n },\n });\n }}\n >\n <Icon icon=\"at\" />\n <span>\n <Trans>\n Mention <span class=\"bidi-isolate\">@{username}</span>\n </Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n setShowTranslatedBio(true);\n }}\n >\n <Icon icon=\"translate\" />\n <span>\n <Trans>Translate bio</Trans>\n </span>\n </MenuItem>\n {supports('@mastodon/profile-private-note') && (\n <MenuItem\n onClick={() => {\n setShowPrivateNoteModal(true);\n }}\n >\n <Icon icon=\"pencil\" />\n <span>\n {privateNote ? t`Edit private note` : t`Add private note`}\n </span>\n </MenuItem>\n )}\n {following && !!relationship && (\n <>\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const rel = await currentMasto.v1.accounts\n .$select(accountID.current)\n .follow({\n notify: !notifying,\n });\n if (rel) setRelationship(rel);\n setRelationshipUIState('default');\n showToast(\n rel.notifying\n ? t`Notifications enabled for @${username}'s posts.`\n : t` Notifications disabled for @${username}'s posts.`,\n );\n } catch (e) {\n alert(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"notification\" />\n <span>\n {notifying\n ? t`Disable notifications`\n : t`Enable notifications`}\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const rel = await currentMasto.v1.accounts\n .$select(accountID.current)\n .follow({\n reblogs: !showingReblogs,\n });\n if (rel) setRelationship(rel);\n setRelationshipUIState('default');\n showToast(\n rel.showingReblogs\n ? t`Boosts from @${username} enabled.`\n : t`Boosts from @${username} disabled.`,\n );\n } catch (e) {\n alert(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"rocket\" />\n <span>\n {showingReblogs ? t`Disable boosts` : t`Enable boosts`}\n </span>\n </MenuItem>\n </>\n )}\n {/* Add/remove from lists is only possible if following the account */}\n {following && (\n <MenuItem\n onClick={() => {\n setShowAddRemoveLists(true);\n }}\n >\n <Icon icon=\"list\" />\n {lists.length ? (\n <>\n <small class=\"menu-grow\">\n <Trans>Add/Remove from Lists</Trans>\n <br />\n <span class=\"more-insignificant\">\n {lists.map((list) => list.title).join(', ')}\n </span>\n </small>\n <small class=\"more-insignificant\">{lists.length}</small>\n </>\n ) : (\n <span>\n <Trans>Add/Remove from Lists</Trans>\n </span>\n )}\n </MenuItem>\n )}\n <MenuDivider />\n </>\n )}\n <MenuItem\n onClick={() => {\n const handle = `@${currentInfo?.acct || acctWithInstance}`;\n try {\n navigator.clipboard.writeText(handle);\n showToast(t`Handle copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy handle`);\n }\n }}\n >\n <Icon icon=\"copy\" />\n <small>\n <Trans>Copy handle</Trans>\n <br />\n <span class=\"more-insignificant bidi-isolate\">\n @{currentInfo?.acct || acctWithInstance}\n </span>\n </small>\n </MenuItem>\n <MenuItem href={url} target=\"_blank\">\n <Icon icon=\"external\" />\n <small class=\"menu-double-lines\">{niceAccountURL(url)}</small>\n </MenuItem>\n <div class=\"menu-horizontal\">\n <MenuItem\n onClick={() => {\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(url);\n showToast(t`Link copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy link`);\n }\n }}\n >\n <Icon icon=\"link\" />\n <span>\n <Trans>Copy</Trans>\n </span>\n </MenuItem>\n {navigator?.share &&\n navigator?.canShare?.({\n url,\n }) && (\n <MenuItem\n onClick={() => {\n try {\n navigator.share({\n url,\n });\n } catch (e) {\n console.error(e);\n alert(t`Sharing doesn't seem to work.`);\n }\n }}\n >\n <Icon icon=\"share\" />\n <span>\n <Trans>Share…</Trans>\n </span>\n </MenuItem>\n )}\n </div>\n {!!relationship && (\n <>\n <MenuDivider />\n {muting ? (\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .unmute();\n console.log('unmuting', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`Unmuted @${username}`);\n states.reloadGenericAccounts.id = 'mute';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"unmute\" />\n <span>\n <Trans>\n Unmute <span class=\"bidi-isolate\">@{username}</span>\n </Trans>\n </span>\n </MenuItem>\n ) : (\n <SubMenu2\n menuClassName=\"menu-blur\"\n openTrigger=\"clickOnly\"\n direction=\"bottom\"\n overflow=\"auto\"\n shift={16}\n label={\n <>\n <Icon icon=\"mute\" />\n <span class=\"menu-grow\">\n <Trans>\n Mute <span class=\"bidi-isolate\">@{username}</span>…\n </Trans>\n </span>\n <span\n style={{\n textOverflow: 'clip',\n }}\n >\n <Icon icon=\"time\" />\n <Icon icon=\"chevron-right\" />\n </span>\n </>\n }\n >\n <div class=\"menu-wrap\">\n {MUTE_DURATIONS.map((duration) => (\n <MenuItem\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const newRelationship =\n await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .mute({\n duration,\n });\n console.log('muting', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(\n t`Muted @${username} for ${\n typeof MUTE_DURATIONS_LABELS[duration] ===\n 'function'\n ? MUTE_DURATIONS_LABELS[duration]()\n : _(MUTE_DURATIONS_LABELS[duration])\n }`,\n );\n states.reloadGenericAccounts.id = 'mute';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n showToast(t`Unable to mute @${username}`);\n }\n })();\n }}\n >\n {typeof MUTE_DURATIONS_LABELS[duration] === 'function'\n ? MUTE_DURATIONS_LABELS[duration]()\n : _(MUTE_DURATIONS_LABELS[duration])}\n </MenuItem>\n ))}\n </div>\n </SubMenu2>\n )}\n {followedBy && (\n <MenuConfirm\n subMenu\n menuItemClassName=\"danger\"\n confirmLabel={\n <>\n <Icon icon=\"user-x\" />\n <span>\n <Trans>\n Remove <span class=\"bidi-isolate\">@{username}</span>{' '}\n from followers?\n </Trans>\n </span>\n </>\n }\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .removeFromFollowers();\n console.log(\n 'removing from followers',\n newRelationship,\n );\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`@${username} removed from followers`);\n states.reloadGenericAccounts.id = 'followers';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <Icon icon=\"user-x\" />\n <span>\n <Trans>Remove follower…</Trans>\n </span>\n </MenuConfirm>\n )}\n <MenuConfirm\n subMenu\n confirm={!blocking}\n confirmLabel={\n <>\n <Icon icon=\"block\" />\n <span>\n <Trans>\n Block <span class=\"bidi-isolate\">@{username}</span>?\n </Trans>\n </span>\n </>\n }\n itemProps={{\n className: 'danger',\n }}\n menuItemClassName=\"danger\"\n onClick={() => {\n // if (!blocking && !confirm(`Block @${username}?`)) {\n // return;\n // }\n setRelationshipUIState('loading');\n (async () => {\n try {\n if (blocking) {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .unblock();\n console.log('unblocking', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`Unblocked @${username}`);\n } else {\n const newRelationship = await currentMasto.v1.accounts\n .$select(currentInfo?.id || id)\n .block();\n console.log('blocking', newRelationship);\n setRelationship(newRelationship);\n setRelationshipUIState('default');\n showToast(t`Blocked @${username}`);\n }\n states.reloadGenericAccounts.id = 'block';\n states.reloadGenericAccounts.counter++;\n } catch (e) {\n console.error(e);\n setRelationshipUIState('error');\n if (blocking) {\n showToast(t`Unable to unblock @${username}`);\n } else {\n showToast(t`Unable to block @${username}`);\n }\n }\n })();\n }}\n >\n {blocking ? (\n <>\n <Icon icon=\"unblock\" />\n <span>\n <Trans>\n Unblock <span class=\"bidi-isolate\">@{username}</span>\n </Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"block\" />\n <span>\n <Trans>\n Block <span class=\"bidi-isolate\">@{username}</span>…\n </Trans>\n </span>\n </>\n )}\n </MenuConfirm>\n <MenuItem\n className=\"danger\"\n onClick={() => {\n states.showReportModal = {\n account: currentInfo || info,\n };\n }}\n >\n <Icon icon=\"flag\" />\n <span>\n <Trans>\n Report <span class=\"bidi-isolate\">@{username}</span>…\n </Trans>\n </span>\n </MenuItem>\n </>\n )}\n {currentAuthenticated &&\n isSelf &&\n standalone &&\n supports('@mastodon/profile-edit') && (\n <>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n setShowEditProfile(true);\n }}\n >\n <Icon icon=\"pencil\" />\n <span>\n <Trans>Edit profile</Trans>\n </span>\n </MenuItem>\n </>\n )}\n {import.meta.env.DEV && currentAuthenticated && isSelf && (\n <>\n <MenuDivider />\n <MenuItem\n onClick={async () => {\n const relationships =\n await currentMasto.v1.accounts.relationships.fetch({\n id: [accountID.current],\n });\n const { note } = relationships[0] || {};\n if (note) {\n alert(note);\n console.log(note);\n }\n }}\n >\n <Icon icon=\"pencil\" />\n <span>See note</span>\n </MenuItem>\n </>\n )}\n </Menu2>\n {!relationship && relationshipUIState === 'loading' && (\n <Loader abrupt />\n )}\n {!!relationship && !moved && (\n <MenuConfirm\n confirm={following || requested}\n confirmLabel={\n <span>\n {requested\n ? t`Withdraw follow request?`\n : t`Unfollow @${info.acct || info.username}?`}\n </span>\n }\n menuItemClassName=\"danger\"\n align=\"end\"\n disabled={loading}\n onClick={() => {\n setRelationshipUIState('loading');\n (async () => {\n try {\n let newRelationship;\n\n if (following || requested) {\n // const yes = confirm(\n // requested\n // ? 'Withdraw follow request?'\n // : `Unfollow @${info.acct || info.username}?`,\n // );\n\n // if (yes) {\n newRelationship = await currentMasto.v1.accounts\n .$select(accountID.current)\n .unfollow();\n // }\n } else {\n newRelationship = await currentMasto.v1.accounts\n .$select(accountID.current)\n .follow();\n }\n\n if (newRelationship) setRelationship(newRelationship);\n setRelationshipUIState('default');\n } catch (e) {\n alert(e);\n setRelationshipUIState('error');\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class={`${following || requested ? 'light swap' : ''}`}\n data-swap-state={following || requested ? 'danger' : ''}\n disabled={loading}\n >\n {following ? (\n <>\n <span>\n <Trans>Following</Trans>\n </span>\n <span>\n <Trans>Unfollow…</Trans>\n </span>\n </>\n ) : requested ? (\n <>\n <span>\n <Trans>Requested</Trans>\n </span>\n <span>\n <Trans>Withdraw…</Trans>\n </span>\n </>\n ) : locked ? (\n <>\n <Icon icon=\"lock\" />{' '}\n <span>\n <Trans>Follow</Trans>\n </span>\n </>\n ) : (\n t`Follow`\n )}\n </button>\n </MenuConfirm>\n )}\n </span>\n </div>\n {!!showTranslatedBio && (\n <Modal\n onClose={() => {\n setShowTranslatedBio(false);\n }}\n >\n <TranslatedBioSheet\n note={note}\n fields={fields}\n onClose={() => setShowTranslatedBio(false)}\n />\n </Modal>\n )}\n {!!showAddRemoveLists && (\n <Modal\n onClose={() => {\n setShowAddRemoveLists(false);\n }}\n >\n <AddRemoveListsSheet\n accountID={accountID.current}\n onClose={() => setShowAddRemoveLists(false)}\n />\n </Modal>\n )}\n {!!showPrivateNoteModal && (\n <Modal\n onClose={() => {\n setShowPrivateNoteModal(false);\n }}\n >\n <PrivateNoteSheet\n account={info}\n note={privateNote}\n onRelationshipChange={(relationship) => {\n setRelationship(relationship);\n // onRelationshipChange({ relationship, currentID: accountID.current });\n }}\n onClose={() => setShowPrivateNoteModal(false)}\n />\n </Modal>\n )}\n {!!showEditProfile && (\n <Modal\n onClose={() => {\n setShowEditProfile(false);\n }}\n >\n <EditProfileSheet\n onClose={({ state, account } = {}) => {\n setShowEditProfile(false);\n if (state === 'success' && account) {\n onProfileUpdate(account);\n }\n }}\n />\n </Modal>\n )}\n </>\n );\n}\n\n// Apply more alpha if high luminence\nfunction lightenRGB([r, g, b]) {\n const luminence = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n console.log('luminence', luminence);\n let alpha;\n if (luminence >= 220) {\n alpha = 1;\n } else if (luminence <= 50) {\n alpha = 0.1;\n } else {\n alpha = luminence / 255;\n }\n alpha = Math.min(1, alpha);\n return [r, g, b, alpha];\n}\n\nfunction niceAccountURL(url) {\n if (!url) return;\n const urlObj = URL.parse(url);\n const { host, pathname } = urlObj;\n const path = pathname.replace(/\\/$/, '').replace(/^\\//, '');\n return (\n <>\n <span class=\"more-insignificant\">{punycode.toUnicode(host)}/</span>\n <wbr />\n <span>{path}</span>\n </>\n );\n}\n\nfunction TranslatedBioSheet({ note, fields, onClose }) {\n const fieldsText =\n fields\n ?.map(({ name, value }) => `${name}\\n${getHTMLText(value)}`)\n .join('\\n\\n') || '';\n\n const text = getHTMLText(note) + (fieldsText ? `\\n\\n${fieldsText}` : '');\n\n return (\n <div class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Translated Bio</Trans>\n </h2>\n </header>\n <main>\n <p\n style={{\n whiteSpace: 'pre-wrap',\n }}\n >\n {text}\n </p>\n <TranslationBlock forceTranslate text={text} />\n </main>\n </div>\n );\n}\n\nfunction AddRemoveListsSheet({ accountID, onClose }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [lists, setLists] = useState([]);\n const [listsContainingAccount, setListsContainingAccount] = useState([]);\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const lists = await getLists();\n setLists(lists);\n const listsContainingAccount = await masto.v1.accounts\n .$select(accountID)\n .lists.list();\n console.log({ lists, listsContainingAccount });\n setListsContainingAccount(listsContainingAccount);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n const [showListAddEditModal, setShowListAddEditModal] = useState(false);\n\n return (\n <div class=\"sheet\" id=\"list-add-remove-container\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Add/Remove from Lists</Trans>\n </h2>\n </header>\n <main>\n {lists.length > 0 ? (\n <ul class=\"list-add-remove\">\n {lists.map((list) => {\n const inList = listsContainingAccount.some(\n (l) => l.id === list.id,\n );\n return (\n <li>\n <button\n type=\"button\"\n class={`light ${inList ? 'checked' : ''}`}\n disabled={uiState === 'loading'}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n if (inList) {\n await masto.v1.lists\n .$select(list.id)\n .accounts.remove({\n accountIds: [accountID],\n });\n } else {\n await masto.v1.lists\n .$select(list.id)\n .accounts.create({\n accountIds: [accountID],\n });\n }\n // setUIState('default');\n reload();\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(\n inList\n ? t`Unable to remove from list.`\n : t`Unable to add to list.`,\n );\n }\n })();\n }}\n >\n <Icon icon=\"check-circle\" alt=\"☑️\" />\n <span>{list.title}</span>\n </button>\n </li>\n );\n })}\n </ul>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load lists.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No lists.</Trans>\n </p>\n )}\n <button\n type=\"button\"\n class=\"plain2\"\n onClick={() => setShowListAddEditModal(true)}\n disabled={uiState !== 'default'}\n >\n <Icon icon=\"plus\" size=\"l\" />{' '}\n <span>\n <Trans>New list</Trans>\n </span>\n </button>\n </main>\n {showListAddEditModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowListAddEditModal(false);\n }\n }}\n >\n <ListAddEdit\n list={showListAddEditModal?.list}\n onClose={(result) => {\n if (result.state === 'success') {\n reload();\n }\n setShowListAddEditModal(false);\n }}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nfunction PrivateNoteSheet({\n account,\n note: initialNote,\n onRelationshipChange = () => {},\n onClose = () => {},\n}) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const textareaRef = useRef(null);\n\n useEffect(() => {\n let timer;\n if (textareaRef.current && !initialNote) {\n timer = setTimeout(() => {\n textareaRef.current.focus?.();\n }, 100);\n }\n return () => {\n clearTimeout(timer);\n };\n }, []);\n\n return (\n <div class=\"sheet\" id=\"private-note-container\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <b>\n <Trans>\n Private note about{' '}\n <span class=\"bidi-isolate\">\n @{account?.username || account?.acct}\n </span>\n </Trans>\n </b>\n </header>\n <main>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const formData = new FormData(e.target);\n const note = formData.get('note');\n if (note?.trim() !== initialNote?.trim()) {\n setUIState('loading');\n (async () => {\n try {\n const newRelationship = await masto.v1.accounts\n .$select(account?.id)\n .note.create({\n comment: note,\n });\n console.log('updated relationship', newRelationship);\n setUIState('default');\n onRelationshipChange(newRelationship);\n onClose();\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(e?.message || t`Unable to update private note.`);\n }\n })();\n }\n }}\n >\n <textarea\n ref={textareaRef}\n name=\"note\"\n disabled={uiState === 'loading'}\n dir=\"auto\"\n >\n {initialNote}\n </textarea>\n <footer>\n <button\n type=\"button\"\n class=\"light\"\n disabled={uiState === 'loading'}\n onClick={() => {\n onClose?.();\n }}\n >\n <Trans>Cancel</Trans>\n </button>\n <span>\n <Loader abrupt hidden={uiState !== 'loading'} />\n <button disabled={uiState === 'loading'} type=\"submit\">\n <Trans>Save &amp; close</Trans>\n </button>\n </span>\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nfunction EditProfileSheet({ onClose = () => {} }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('loading');\n const [account, setAccount] = useState(null);\n\n useEffect(() => {\n (async () => {\n try {\n const acc = await masto.v1.accounts.verifyCredentials();\n setAccount(acc);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, []);\n\n console.log('EditProfileSheet', account);\n const { displayName, source } = account || {};\n const { note, fields } = source || {};\n const fieldsAttributesRef = useRef(null);\n\n return (\n <div class=\"sheet\" id=\"edit-profile-container\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <b>\n <Trans>Edit profile</Trans>\n </b>\n </header>\n <main>\n {uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const formData = new FormData(e.target);\n const displayName = formData.get('display_name');\n const note = formData.get('note');\n const fieldsAttributesFields =\n fieldsAttributesRef.current.querySelectorAll(\n 'input[name^=\"fields_attributes\"]',\n );\n const fieldsAttributes = [];\n fieldsAttributesFields.forEach((field) => {\n const name = field.name;\n const [_, index, key] =\n name.match(/fields_attributes\\[(\\d+)\\]\\[(.+)\\]/) || [];\n const value = field.value ? field.value.trim() : '';\n if (index && key && value) {\n if (!fieldsAttributes[index]) fieldsAttributes[index] = {};\n fieldsAttributes[index][key] = value;\n }\n });\n // Fill in the blanks\n fieldsAttributes.forEach((field) => {\n if (field.name && !field.value) {\n field.value = '';\n }\n });\n\n (async () => {\n try {\n const newAccount = await masto.v1.accounts.updateCredentials({\n displayName,\n note,\n fieldsAttributes,\n });\n console.log('updated account', newAccount);\n onClose?.({\n state: 'success',\n account: newAccount,\n });\n } catch (e) {\n console.error(e);\n alert(e?.message || t`Unable to update profile.`);\n }\n })();\n }}\n >\n <p>\n <label>\n <Trans>Name</Trans>{' '}\n <input\n type=\"text\"\n name=\"display_name\"\n defaultValue={displayName}\n maxLength={30}\n disabled={uiState === 'loading'}\n dir=\"auto\"\n />\n </label>\n </p>\n <p>\n <label>\n <Trans>Bio</Trans>\n <textarea\n defaultValue={note}\n name=\"note\"\n maxLength={500}\n rows=\"5\"\n disabled={uiState === 'loading'}\n dir=\"auto\"\n />\n </label>\n </p>\n {/* Table for fields; name and values are in fields, min 4 rows */}\n <p>\n <Trans>Extra fields</Trans>\n </p>\n <table ref={fieldsAttributesRef}>\n <thead>\n <tr>\n <th>\n <Trans>Label</Trans>\n </th>\n <th>\n <Trans>Content</Trans>\n </th>\n </tr>\n </thead>\n <tbody>\n {Array.from({ length: Math.max(4, fields.length) }).map(\n (_, i) => {\n const { name = '', value = '' } = fields[i] || {};\n return (\n <FieldsAttributesRow\n key={i}\n name={name}\n value={value}\n index={i}\n disabled={uiState === 'loading'}\n />\n );\n },\n )}\n </tbody>\n </table>\n <footer>\n <button\n type=\"button\"\n class=\"light\"\n disabled={uiState === 'loading'}\n onClick={() => {\n onClose?.();\n }}\n >\n <Trans>Cancel</Trans>\n </button>\n <button type=\"submit\" disabled={uiState === 'loading'}>\n <Trans>Save</Trans>\n </button>\n </footer>\n </form>\n )}\n </main>\n </div>\n );\n}\n\nfunction FieldsAttributesRow({ name, value, disabled, index: i }) {\n const [hasValue, setHasValue] = useState(!!value);\n return (\n <tr>\n <td>\n <input\n type=\"text\"\n name={`fields_attributes[${i}][name]`}\n defaultValue={name}\n disabled={disabled}\n maxLength={255}\n required={hasValue}\n dir=\"auto\"\n />\n </td>\n <td>\n <input\n type=\"text\"\n name={`fields_attributes[${i}][value]`}\n defaultValue={value}\n disabled={disabled}\n maxLength={255}\n onChange={(e) => setHasValue(!!e.currentTarget.value)}\n dir=\"auto\"\n />\n </td>\n </tr>\n );\n}\n\nfunction AccountHandleInfo({ acct, instance }) {\n // acct = username or username@server\n let [username, server] = acct.split('@');\n if (!server) server = instance;\n return (\n <div class=\"handle-info\">\n <span class=\"handle-handle\">\n <b class=\"handle-username\">{username}</b>\n <span class=\"handle-at\">@</span>\n <b class=\"handle-server\">{server}</b>\n </span>\n <div class=\"handle-legend\">\n <span class=\"ib\">\n <span class=\"handle-legend-icon username\" /> <Trans>username</Trans>\n </span>{' '}\n <span class=\"ib\">\n <span class=\"handle-legend-icon server\" />{' '}\n <Trans>server domain name</Trans>\n </span>\n </div>\n </div>\n );\n}\n\nexport default AccountInfo;\n","import { t } from '@lingui/macro';\nimport { useEffect } from 'preact/hooks';\n\nimport { api } from '../utils/api';\nimport states from '../utils/states';\nimport useLocationChange from '../utils/useLocationChange';\n\nimport AccountInfo from './account-info';\nimport Icon from './icon';\n\nfunction AccountSheet({ account, instance: propInstance, onClose }) {\n const { masto, instance, authenticated } = api({ instance: propInstance });\n const isString = typeof account === 'string';\n\n useEffect(() => {\n if (!isString) {\n states.accounts[`${account.id}@${instance}`] = account;\n }\n }, [account]);\n\n useLocationChange(onClose);\n\n return (\n <div\n class=\"sheet\"\n // onClick={(e) => {\n // const accountBlock = e.target.closest('.account-block');\n // if (accountBlock) {\n // onClose({\n // destination: 'account-statuses',\n // });\n // }\n // }}\n >\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close outer\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <AccountInfo\n instance={instance}\n authenticated={authenticated}\n account={account}\n fetchAccount={async () => {\n if (isString) {\n try {\n const info = await masto.v1.accounts.lookup({\n acct: account,\n skip_webfinger: false,\n });\n return info;\n } catch (e) {\n const result = await masto.v2.search.fetch({\n q: account,\n type: 'accounts',\n limit: 1,\n resolve: authenticated,\n });\n if (result.accounts.length) {\n return result.accounts[0];\n } else if (/https?:\\/\\/[^/]+\\/@/.test(account)) {\n const accountURL = URL.parse(account);\n const { hostname, pathname } = accountURL;\n const acct =\n pathname.replace(/^\\//, '').replace(/\\/$/, '') +\n '@' +\n hostname;\n const result = await masto.v2.search.fetch({\n q: acct,\n type: 'accounts',\n limit: 1,\n resolve: authenticated,\n });\n if (result.accounts.length) {\n return result.accounts[0];\n }\n }\n }\n } else {\n return account;\n }\n }}\n />\n </div>\n );\n}\n\nexport default AccountSheet;\n","import './drafts.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { useEffect, useMemo, useReducer, useState } from 'react';\n\nimport { api } from '../utils/api';\nimport db from '../utils/db';\nimport niceDateTime from '../utils/nice-date-time';\nimport states from '../utils/states';\nimport { getCurrentAccountNS } from '../utils/store-utils';\n\nimport Icon from './icon';\nimport Loader from './loader';\nimport MenuConfirm from './menu-confirm';\n\nfunction Drafts({ onClose }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [drafts, setDrafts] = useState([]);\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const keys = await db.drafts.keys();\n if (keys.length) {\n const ns = getCurrentAccountNS();\n const ownKeys = keys.filter((key) => key.startsWith(ns));\n if (ownKeys.length) {\n const drafts = await db.drafts.getMany(ownKeys);\n drafts.sort(\n (a, b) =>\n new Date(b.updatedAt).getTime() -\n new Date(a.updatedAt).getTime(),\n );\n setDrafts(drafts);\n } else {\n setDrafts([]);\n }\n } else {\n setDrafts([]);\n }\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n const hasDrafts = drafts?.length > 0;\n\n return (\n <div class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Unsent drafts</Trans>{' '}\n <Loader abrupt hidden={uiState !== 'loading'} />\n </h2>\n {hasDrafts && (\n <div class=\"insignificant\">\n <Trans>\n Looks like you have unsent drafts. Let's continue where you left\n off.\n </Trans>\n </div>\n )}\n </header>\n <main>\n {hasDrafts ? (\n <>\n <ul class=\"drafts-list\">\n {drafts.map((draft) => {\n const { updatedAt, key, draftStatus, replyTo } = draft;\n const updatedAtDate = new Date(updatedAt);\n return (\n <li key={updatedAt}>\n <div class=\"mini-draft-meta\">\n <b>\n <Icon icon={replyTo ? 'reply' : 'quill'} size=\"s\" />{' '}\n <time>\n {!!replyTo && (\n <>\n <span class=\"bidi-isolate\">\n @{replyTo.account.acct}\n </span>\n <br />\n </>\n )}\n {niceDateTime(updatedAtDate)}\n </time>\n </b>\n <MenuConfirm\n confirmLabel={\n <span>\n <Trans>Delete this draft?</Trans>\n </span>\n }\n menuItemClassName=\"danger\"\n align=\"end\"\n disabled={uiState === 'loading'}\n onClick={() => {\n (async () => {\n try {\n // const yes = confirm('Delete this draft?');\n // if (yes) {\n await db.drafts.del(key);\n reload();\n // }\n } catch (e) {\n alert(t`Error deleting draft! Please try again.`);\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"small light\"\n disabled={uiState === 'loading'}\n >\n <Trans>Delete…</Trans>\n </button>\n </MenuConfirm>\n </div>\n <button\n type=\"button\"\n disabled={uiState === 'loading'}\n class=\"draft-item\"\n onClick={async () => {\n // console.log({ draftStatus });\n let replyToStatus;\n if (replyTo) {\n setUIState('loading');\n try {\n replyToStatus = await masto.v1.statuses\n .$select(replyTo.id)\n .fetch();\n } catch (e) {\n console.error(e);\n alert(t`Error fetching reply-to status!`);\n setUIState('default');\n return;\n }\n setUIState('default');\n }\n window.__COMPOSE__ = {\n draftStatus,\n replyToStatus,\n };\n states.showCompose = true;\n states.showDrafts = false;\n }}\n >\n <MiniDraft draft={draft} />\n </button>\n </li>\n );\n })}\n </ul>\n {drafts.length > 1 && (\n <p>\n <MenuConfirm\n confirmLabel={\n <span>\n <Trans>Delete all drafts?</Trans>\n </span>\n }\n menuItemClassName=\"danger\"\n disabled={uiState === 'loading'}\n onClick={() => {\n (async () => {\n // const yes = confirm('Delete all drafts?');\n // if (yes) {\n setUIState('loading');\n try {\n await db.drafts.delMany(\n drafts.map((draft) => draft.key),\n );\n setUIState('default');\n reload();\n } catch (e) {\n console.error(e);\n alert(t`Error deleting drafts! Please try again.`);\n setUIState('error');\n }\n // }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"light danger\"\n disabled={uiState === 'loading'}\n >\n <Trans>Delete all…</Trans>\n </button>\n </MenuConfirm>\n </p>\n )}\n </>\n ) : (\n <p>\n <Trans>No drafts found.</Trans>\n </p>\n )}\n </main>\n </div>\n );\n}\n\nfunction MiniDraft({ draft }) {\n const { draftStatus, replyTo } = draft;\n const { status, spoilerText, poll, mediaAttachments } = draftStatus;\n const hasPoll = poll?.options?.length > 0;\n const hasMedia = mediaAttachments?.length > 0;\n const hasPollOrMedia = hasPoll || hasMedia;\n const firstImageMedia = useMemo(() => {\n if (!hasMedia) return;\n const image = mediaAttachments.find((media) => /image/.test(media.type));\n if (!image) return;\n const { file } = image;\n const objectURL = URL.createObjectURL(file);\n return objectURL;\n }, [hasMedia, mediaAttachments]);\n return (\n <>\n <div class=\"mini-draft\">\n {hasPollOrMedia && (\n <div\n class={`mini-draft-aside ${firstImageMedia ? 'has-image' : ''}`}\n style={\n firstImageMedia\n ? {\n '--bg-image': `url(${firstImageMedia})`,\n }\n : {}\n }\n >\n {hasPoll && <Icon icon=\"poll\" alt={t`Poll`} />}\n {hasMedia && (\n <span>\n <Icon icon=\"attachment\" alt={t`Media`} />{' '}\n <small>{mediaAttachments?.length}</small>\n </span>\n )}\n </div>\n )}\n <div class=\"mini-draft-main\">\n {!!spoilerText && <div class=\"mini-draft-spoiler\">{spoilerText}</div>}\n {!!status && <div class=\"mini-draft-status\">{status}</div>}\n </div>\n </div>\n </>\n );\n}\n\nexport default Drafts;\n","import './embed-modal.css';\n\nimport { t, Trans } from '@lingui/macro';\n\nimport Icon from './icon';\n\nfunction EmbedModal({ html, url, width, height, onClose = () => {} }) {\n return (\n <div class=\"embed-modal-container\">\n <div class=\"top-controls\">\n <button type=\"button\" class=\"light\" onClick={() => onClose()}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n {url && (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"button plain\"\n >\n <span>\n <Trans>Open in new window</Trans>\n </span>{' '}\n <Icon icon=\"external\" />\n </a>\n )}\n </div>\n <div\n class=\"embed-content\"\n dangerouslySetInnerHTML={{ __html: html }}\n style={{\n '--width': width + 'px',\n '--height': height + 'px',\n '--aspect-ratio': `${width}/${height}`,\n }}\n />\n </div>\n );\n}\n\nexport default EmbedModal;\n","import './generic-accounts.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { InView } from 'react-intersection-observer';\nimport { useSnapshot } from 'valtio';\n\nimport { api } from '../utils/api';\nimport { fetchRelationships } from '../utils/relationships';\nimport states from '../utils/states';\nimport useLocationChange from '../utils/useLocationChange';\n\nimport AccountBlock from './account-block';\nimport Icon from './icon';\nimport Link from './link';\nimport Loader from './loader';\nimport Status from './status';\n\nexport default function GenericAccounts({\n instance,\n excludeRelationshipAttrs = [],\n postID,\n onClose = () => {},\n blankCopy = t`Nothing to show`,\n}) {\n const { masto, instance: currentInstance } = api();\n const isCurrentInstance = instance ? instance === currentInstance : true;\n const snapStates = useSnapshot(states);\n ``;\n const [uiState, setUIState] = useState('default');\n const [accounts, setAccounts] = useState([]);\n const [showMore, setShowMore] = useState(false);\n\n useLocationChange(onClose);\n\n if (!snapStates.showGenericAccounts) {\n return null;\n }\n\n const {\n id,\n heading,\n fetchAccounts,\n accounts: staticAccounts,\n showReactions,\n } = snapStates.showGenericAccounts;\n\n const [relationshipsMap, setRelationshipsMap] = useState({});\n\n const loadRelationships = async (accounts) => {\n if (!accounts?.length) return;\n if (!isCurrentInstance) return;\n const relationships = await fetchRelationships(accounts, relationshipsMap);\n if (relationships) {\n setRelationshipsMap({\n ...relationshipsMap,\n ...relationships,\n });\n }\n };\n\n const loadAccounts = (firstLoad) => {\n if (!fetchAccounts) return;\n if (firstLoad) setAccounts([]);\n setUIState('loading');\n (async () => {\n try {\n const { done, value } = await fetchAccounts(firstLoad);\n if (Array.isArray(value)) {\n if (firstLoad) {\n const accounts = [];\n for (let i = 0; i < value.length; i++) {\n const account = value[i];\n const theAccount = accounts.find(\n (a, j) => a.id === account.id && i !== j,\n );\n if (!theAccount) {\n accounts.push({\n _types: [],\n ...account,\n });\n } else {\n theAccount._types.push(...account._types);\n }\n }\n setAccounts(accounts);\n } else {\n // setAccounts((prev) => [...prev, ...value]);\n // Merge accounts by id and _types\n setAccounts((prev) => {\n const newAccounts = prev;\n for (const account of value) {\n const theAccount = newAccounts.find((a) => a.id === account.id);\n if (!theAccount) {\n newAccounts.push(account);\n } else {\n theAccount._types.push(...account._types);\n }\n }\n return newAccounts;\n });\n }\n setShowMore(!done);\n\n loadRelationships(value);\n } else {\n setShowMore(false);\n }\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n };\n\n const firstLoad = useRef(true);\n useEffect(() => {\n if (staticAccounts?.length > 0) {\n setAccounts(staticAccounts);\n loadRelationships(staticAccounts);\n } else {\n loadAccounts(true);\n firstLoad.current = false;\n }\n }, [staticAccounts, fetchAccounts]);\n\n useEffect(() => {\n if (firstLoad.current) return;\n // reloadGenericAccounts contains value like {id: 'mute', counter: 1}\n // We only need to reload if the id matches\n if (snapStates.reloadGenericAccounts?.id === id) {\n loadAccounts(true);\n }\n }, [snapStates.reloadGenericAccounts.counter]);\n\n const post = states.statuses[postID];\n\n return (\n <div id=\"generic-accounts-container\" class=\"sheet\" tabindex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>{heading || t`Accounts`}</h2>\n </header>\n <main>\n {post && (\n <Link\n to={`/${instance || currentInstance}/s/${post.id}`}\n class=\"post-preview\"\n >\n <Status status={post} size=\"s\" readOnly />\n </Link>\n )}\n {accounts.length > 0 ? (\n <>\n <ul class=\"accounts-list\">\n {accounts.map((account) => {\n const relationship = relationshipsMap[account.id];\n const key = `${account.id}-${account._types?.length || ''}`;\n return (\n <li key={key}>\n {showReactions && account._types?.length > 0 && (\n <div class=\"reactions-block\">\n {account._types.map((type) => (\n <Icon\n icon={\n {\n reblog: 'rocket',\n favourite: 'heart',\n }[type]\n }\n class={`${type}-icon`}\n />\n ))}\n </div>\n )}\n <div class=\"account-relationships\">\n <AccountBlock\n account={account}\n showStats\n relationship={relationship}\n excludeRelationshipAttrs={excludeRelationshipAttrs}\n />\n </div>\n </li>\n );\n })}\n </ul>\n {uiState === 'default' ? (\n showMore ? (\n <InView\n onChange={(inView) => {\n if (inView) {\n loadAccounts();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n onClick={() => loadAccounts()}\n >\n <Trans>Show more…</Trans>\n </button>\n </InView>\n ) : (\n <p class=\"ui-state insignificant\">\n <Trans>The end.</Trans>\n </p>\n )\n ) : (\n uiState === 'loading' && (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n )\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Error loading accounts</Trans>\n </p>\n ) : (\n <p class=\"ui-state insignificant\">{blankCopy}</p>\n )}\n </main>\n </div>\n );\n}\n","import { t, Trans } from '@lingui/macro';\nimport { Menu, MenuItem } from '@szhsin/react-menu';\nimport { useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport localeMatch from '../utils/locale-match';\nimport { speak, supportsTTS } from '../utils/speech';\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Menu2 from './menu2';\nimport TranslationBlock from './translation-block';\n\nexport default function MediaAltModal({ alt, lang, onClose }) {\n const snapStates = useSnapshot(states);\n const [forceTranslate, setForceTranslate] = useState(false);\n const targetLanguage = getTranslateTargetLanguage(true);\n const contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages || [];\n const differentLanguage =\n !!lang &&\n lang !== targetLanguage &&\n !localeMatch([lang], [targetLanguage]) &&\n !contentTranslationHideLanguages.find(\n (l) => lang === l || localeMatch([lang], [l]),\n );\n\n return (\n <div class=\"sheet\" tabindex=\"-1\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close outer\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header class=\"header-grid\">\n <h2>\n <Trans>Media description</Trans>\n </h2>\n <div class=\"header-side\">\n <Menu2\n align=\"end\"\n menuButton={\n <button type=\"button\" class=\"plain4\">\n <Icon icon=\"more\" alt={t`More`} size=\"xl\" />\n </button>\n }\n >\n <MenuItem\n disabled={forceTranslate}\n onClick={() => {\n setForceTranslate(true);\n }}\n >\n <Icon icon=\"translate\" />\n <span>\n <Trans>Translate</Trans>\n </span>\n </MenuItem>\n {supportsTTS && (\n <MenuItem\n onClick={() => {\n speak(alt, lang);\n }}\n >\n <Icon icon=\"speak\" />\n <span>\n <Trans>Speak</Trans>\n </span>\n </MenuItem>\n )}\n </Menu2>\n </div>\n </header>\n <main lang={lang} dir=\"auto\">\n <p\n style={{\n whiteSpace: 'pre-wrap',\n textWrap: 'pretty',\n }}\n >\n {alt}\n </p>\n {(differentLanguage || forceTranslate) && (\n <TranslationBlock\n forceTranslate={forceTranslate}\n sourceLanguage={lang}\n text={alt}\n />\n )}\n </main>\n </div>\n );\n}\n","// https://gist.github.com/earthbound19/e7fe15fdf8ca3ef814750a61bc75b5ce\nfunction clamp(value, min, max) {\n return Math.max(Math.min(value, max), min);\n}\n\nconst gammaToLinear = (c) =>\n c >= 0.04045 ? Math.pow((c + 0.055) / 1.055, 2.4) : c / 12.92;\nconst linearToGamma = (c) =>\n c >= 0.0031308 ? 1.055 * Math.pow(c, 1 / 2.4) - 0.055 : 12.92 * c;\n\nexport function rgb2oklab([r, g, b]) {\n r = gammaToLinear(r / 255);\n g = gammaToLinear(g / 255);\n b = gammaToLinear(b / 255);\n var l = 0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b;\n var m = 0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b;\n var s = 0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b;\n l = Math.cbrt(l);\n m = Math.cbrt(m);\n s = Math.cbrt(s);\n return [\n l * +0.2104542553 + m * +0.793617785 + s * -0.0040720468,\n l * +1.9779984951 + m * -2.428592205 + s * +0.4505937099,\n l * +0.0259040371 + m * +0.7827717662 + s * -0.808675766,\n ];\n}\n\nexport function oklab2rgb([L, a, b]) {\n var l = L + a * +0.3963377774 + b * +0.2158037573;\n var m = L + a * -0.1055613458 + b * -0.0638541728;\n var s = L + a * -0.0894841775 + b * -1.291485548;\n // The ** operator here cubes; same as l_*l_*l_ in the C++ example:\n l = l ** 3;\n m = m ** 3;\n s = s ** 3;\n var r = l * +4.0767416621 + m * -3.3077115913 + s * +0.2309699292;\n var g = l * -1.2684380046 + m * +2.6097574011 + s * -0.3413193965;\n var b = l * -0.0041960863 + m * -0.7034186147 + s * +1.707614701;\n // Convert linear RGB values returned from oklab math to sRGB for our use before returning them:\n r = 255 * linearToGamma(r);\n g = 255 * linearToGamma(g);\n b = 255 * linearToGamma(b);\n // OPTION: clamp r g and b values to the range 0-255; but if you use the values immediately to draw, JavaScript clamps them on use:\n r = clamp(r, 0, 255);\n g = clamp(g, 0, 255);\n b = clamp(b, 0, 255);\n // OPTION: round the values. May not be necessary if you use them immediately for rendering in JavaScript, as JavaScript (also) discards decimals on render:\n r = Math.round(r);\n g = Math.round(g);\n b = Math.round(b);\n return [r, g, b];\n}\n","import { t, Trans } from '@lingui/macro';\nimport { MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport {\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport { oklab2rgb, rgb2oklab } from '../utils/color-utils';\nimport isRTL from '../utils/is-rtl';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Link from './link';\nimport Media from './media';\nimport MenuLink from './menu-link';\nimport Menu2 from './menu2';\n\nconst { PHANPY_IMG_ALT_API_URL: IMG_ALT_API_URL } = import.meta.env;\n\nfunction MediaModal({\n mediaAttachments,\n statusID,\n instance,\n lang,\n index = 0,\n onClose = () => {},\n}) {\n const [uiState, setUIState] = useState('default');\n const carouselRef = useRef(null);\n\n const [currentIndex, setCurrentIndex] = useState(index);\n const carouselFocusItem = useRef(null);\n useLayoutEffect(() => {\n carouselFocusItem.current?.scrollIntoView();\n\n // history.pushState({ mediaModal: true }, '');\n // const handlePopState = (e) => {\n // if (e.state?.mediaModal) {\n // onClose();\n // }\n // };\n // window.addEventListener('popstate', handlePopState);\n // return () => {\n // window.removeEventListener('popstate', handlePopState);\n // };\n }, []);\n const prevStatusID = useRef(statusID);\n useEffect(() => {\n const scrollLeft = index * carouselRef.current.clientWidth;\n const differentStatusID = prevStatusID.current !== statusID;\n if (differentStatusID) prevStatusID.current = statusID;\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left: scrollLeft * (isRTL() ? -1 : 1),\n behavior: differentStatusID ? 'auto' : 'smooth',\n });\n }, [index, statusID]);\n\n const [showControls, setShowControls] = useState(true);\n\n useEffect(() => {\n let handleSwipe = () => {\n onClose();\n };\n if (carouselRef.current) {\n carouselRef.current.addEventListener('swiped-down', handleSwipe);\n }\n return () => {\n if (carouselRef.current) {\n carouselRef.current.removeEventListener('swiped-down', handleSwipe);\n }\n };\n }, []);\n\n useHotkeys(\n 'esc',\n onClose,\n {\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n },\n [onClose],\n );\n\n useEffect(() => {\n let handleScroll = () => {\n const { clientWidth, scrollLeft } = carouselRef.current;\n const index = Math.round(Math.abs(scrollLeft) / clientWidth);\n setCurrentIndex(index);\n };\n if (carouselRef.current) {\n carouselRef.current.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n }\n return () => {\n if (carouselRef.current) {\n carouselRef.current.removeEventListener('scroll', handleScroll);\n }\n };\n }, []);\n\n useEffect(() => {\n let timer = setTimeout(() => {\n carouselRef.current?.focus?.();\n }, 100);\n return () => clearTimeout(timer);\n }, []);\n\n const mediaAccentColors = useMemo(() => {\n return mediaAttachments?.map((media) => {\n const { blurhash } = media;\n if (blurhash) {\n const averageColor = getBlurHashAverageColor(blurhash);\n const labAverageColor = rgb2oklab(averageColor);\n return oklab2rgb([0.6, labAverageColor[1], labAverageColor[2]]);\n }\n return null;\n });\n }, [mediaAttachments]);\n const mediaAccentGradient = useMemo(() => {\n const gap = 5;\n const range = 100 / mediaAccentColors.length;\n return (\n mediaAccentColors\n ?.map((color, i) => {\n const start = i * range + gap;\n const end = (i + 1) * range - gap;\n if (color) {\n return `\n rgba(${color?.join(',')}, 0.4) ${start}%,\n rgba(${color?.join(',')}, 0.4) ${end}%\n `;\n }\n\n return `\n transparent ${start}%,\n transparent ${end}%\n `;\n })\n ?.join(', ') || 'transparent'\n );\n }, [mediaAccentColors]);\n\n let toastRef = useRef(null);\n useEffect(() => {\n return () => {\n toastRef.current?.hideToast?.();\n };\n }, []);\n\n return (\n <div\n class={`media-modal-container media-modal-count-${mediaAttachments?.length}`}\n >\n <div\n ref={carouselRef}\n tabIndex=\"0\"\n data-swipe-threshold=\"44\"\n class=\"carousel\"\n onClick={(e) => {\n if (\n e.target.classList.contains('carousel-item') ||\n e.target.classList.contains('media') ||\n e.target.classList.contains('media-zoom')\n ) {\n onClose();\n }\n }}\n style={\n mediaAttachments.length > 1\n ? {\n backgroundAttachment: 'local',\n backgroundImage: `linear-gradient(\n to ${isRTL() ? 'left' : 'right'}, ${mediaAccentGradient})`,\n }\n : {}\n }\n >\n {mediaAttachments?.map((media, i) => {\n const accentColor =\n mediaAttachments.length === 1 ? mediaAccentColors[i] : null;\n return (\n <div\n class=\"carousel-item\"\n style={\n accentColor\n ? {\n '--accent-color': `rgb(${accentColor?.join(',')})`,\n '--accent-alpha-color': `rgba(${accentColor?.join(\n ',',\n )}, 0.4)`,\n }\n : {}\n }\n tabindex=\"0\"\n key={media.id}\n ref={i === currentIndex ? carouselFocusItem : null}\n onClick={(e) => {\n // console.log(e);\n // if (e.target !== e.currentTarget) {\n // setShowControls(!showControls);\n // }\n if (!e.target.classList.contains('media')) {\n setShowControls(!showControls);\n }\n }}\n >\n {!!media.description && (\n <button\n type=\"button\"\n class=\"media-alt\"\n hidden={!showControls}\n onClick={() => {\n states.showMediaAlt = {\n alt: media.description,\n lang,\n };\n }}\n >\n <span class=\"alt-badge\">ALT</span>\n <span class=\"media-alt-desc\" lang={lang} dir=\"auto\">\n {media.description}\n </span>\n </button>\n )}\n <Media media={media} showOriginal lang={lang} />\n </div>\n );\n })}\n </div>\n <div class=\"carousel-top-controls\" hidden={!showControls}>\n <span>\n <button\n type=\"button\"\n class=\"carousel-button\"\n onClick={() => onClose()}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n </span>\n {mediaAttachments?.length > 1 ? (\n <span class=\"carousel-dots\">\n {mediaAttachments?.map((media, i) => (\n <button\n key={media.id}\n type=\"button\"\n disabled={i === currentIndex}\n class={`carousel-dot ${i === currentIndex ? 'active' : ''}`}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n const left =\n carouselRef.current.clientWidth * i * (isRTL() ? -1 : 1);\n carouselRef.current.scrollTo({ left, behavior: 'smooth' });\n carouselRef.current.focus();\n }}\n >\n <Icon icon=\"round\" size=\"s\" alt=\"⸱\" />\n </button>\n ))}\n </span>\n ) : (\n <span />\n )}\n <span>\n <Menu2\n overflow=\"auto\"\n align=\"end\"\n position=\"anchor\"\n gap={4}\n menuClassName=\"glass-menu\"\n menuButton={\n <button type=\"button\" class=\"carousel-button\">\n <Icon icon=\"more\" alt={t`More`} />\n </button>\n }\n >\n <MenuLink\n href={\n mediaAttachments[currentIndex]?.remoteUrl ||\n mediaAttachments[currentIndex]?.url\n }\n class=\"carousel-button\"\n target=\"_blank\"\n title={t`Open original media in new window`}\n >\n <Icon icon=\"popout\" />\n <span>\n <Trans>Open original media</Trans>\n </span>\n </MenuLink>\n {import.meta.env.DEV && // Only dev for now\n !!states.settings.mediaAltGenerator &&\n !!IMG_ALT_API_URL &&\n !!mediaAttachments[currentIndex]?.url &&\n !mediaAttachments[currentIndex]?.description &&\n mediaAttachments[currentIndex]?.type === 'image' && (\n <>\n <MenuDivider />\n <MenuItem\n disabled={uiState === 'loading'}\n onClick={() => {\n setUIState('loading');\n toastRef.current = showToast({\n text: t`Attempting to describe image. Please wait…`,\n duration: -1,\n });\n (async function () {\n try {\n const response = await fetch(\n `${IMG_ALT_API_URL}?image=${encodeURIComponent(\n mediaAttachments[currentIndex]?.url,\n )}`,\n ).then((r) => r.json());\n states.showMediaAlt = {\n alt: response.description,\n };\n } catch (e) {\n console.error(e);\n showToast(t`Failed to describe image`);\n } finally {\n setUIState('default');\n toastRef.current?.hideToast?.();\n }\n })();\n }}\n >\n <Icon icon=\"sparkles2\" />\n <span>\n <Trans>Describe image…</Trans>\n </span>\n </MenuItem>\n </>\n )}\n </Menu2>{' '}\n <Link\n to={`${instance ? `/${instance}` : ''}/s/${statusID}${\n window.matchMedia('(min-width: calc(40em + 350px))').matches\n ? `?media=${currentIndex + 1}`\n : ''\n }`}\n class=\"button carousel-button media-post-link\"\n // onClick={() => {\n // // if small screen (not media query min-width 40em + 350px), run onClose\n // if (\n // !window.matchMedia('(min-width: calc(40em + 350px))').matches\n // ) {\n // onClose();\n // }\n // }}\n >\n <span class=\"button-label\">\n <Trans>View post</Trans>{' '}\n </span>\n &raquo;\n </Link>\n </span>\n </div>\n {mediaAttachments?.length > 1 && (\n <div class=\"carousel-controls\" hidden={!showControls}>\n <button\n type=\"button\"\n class=\"carousel-button\"\n hidden={currentIndex === 0}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left:\n carouselRef.current.clientWidth *\n (currentIndex - 1) *\n (isRTL() ? -1 : 1),\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-left\" alt={t`Previous`} />\n </button>\n <button\n type=\"button\"\n class=\"carousel-button\"\n hidden={currentIndex === mediaAttachments.length - 1}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left:\n carouselRef.current.clientWidth *\n (currentIndex + 1) *\n (isRTL() ? -1 : 1),\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-right\" alt={t`Next`} />\n </button>\n </div>\n )}\n </div>\n );\n}\n\nexport default MediaModal;\n","import './report-modal.css';\n\nimport { msg, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { Fragment } from 'preact';\nimport { useMemo, useRef, useState } from 'preact/hooks';\n\nimport { api } from '../utils/api';\nimport showToast from '../utils/show-toast';\nimport { getCurrentInstance } from '../utils/store-utils';\n\nimport AccountBlock from './account-block';\nimport Icon from './icon';\nimport Loader from './loader';\nimport Status from './status';\n\n// NOTE: `dislike` hidden for now, it's actually not used for reporting\n// Mastodon shows another screen for unfollowing, muting or blocking instead of reporting\n\nconst CATEGORIES = [, /*'dislike'*/ 'spam', 'legal', 'violation', 'other'];\n// `violation` will be set if there are `rule_ids[]`\n\nconst CATEGORIES_INFO = {\n // dislike: {\n // label: 'Dislike',\n // description: 'Not something you want to see',\n // },\n spam: {\n label: msg`Spam`,\n description: msg`Malicious links, fake engagement, or repetitive replies`,\n },\n legal: {\n label: msg`Illegal`,\n description: msg`Violates the law of your or the server's country`,\n },\n violation: {\n label: msg`Server rule violation`,\n description: msg`Breaks specific server rules`,\n stampLabel: msg`Violation`,\n },\n other: {\n label: msg`Other`,\n description: msg`Issue doesn't fit other categories`,\n excludeStamp: true,\n },\n};\n\nfunction ReportModal({ account, post, onClose }) {\n const { _ } = useLingui();\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [username, domain] = account.acct.split('@');\n\n const [rules, currentDomain] = useMemo(() => {\n const { rules, domain } = getCurrentInstance();\n return [rules || [], domain];\n });\n\n const [selectedCategory, setSelectedCategory] = useState(null);\n const [showRules, setShowRules] = useState(false);\n\n const rulesRef = useRef(null);\n const [hasRules, setHasRules] = useState(false);\n\n return (\n <div class=\"report-modal-container\">\n <div class=\"top-controls\">\n <h1>{post ? t`Report Post` : t`Report @${username}`}</h1>\n <button\n type=\"button\"\n class=\"plain4 small\"\n disabled={uiState === 'loading'}\n onClick={() => onClose()}\n >\n <Icon icon=\"x\" size=\"xl\" alt={t`Close`} />\n </button>\n </div>\n <main>\n <div class=\"report-preview\">\n {post ? (\n <Status status={post} size=\"s\" previewMode />\n ) : (\n <AccountBlock\n account={account}\n avatarSize=\"xxl\"\n useAvatarStatic\n showStats\n showActivity\n />\n )}\n </div>\n {!!selectedCategory &&\n !CATEGORIES_INFO[selectedCategory].excludeStamp && (\n <span\n class=\"rubber-stamp\"\n key={selectedCategory}\n aria-hidden=\"true\"\n >\n {_(\n CATEGORIES_INFO[selectedCategory].stampLabel ||\n _(CATEGORIES_INFO[selectedCategory].label),\n )}\n <small>\n <Trans>Pending review</Trans>\n </small>\n </span>\n )}\n <form\n onSubmit={(e) => {\n e.preventDefault();\n\n const formData = new FormData(e.target);\n const entries = Object.fromEntries(formData.entries());\n console.log('ENTRIES', entries);\n\n let { category, comment, forward } = entries;\n if (!comment) comment = undefined;\n if (forward === 'on') forward = true;\n const ruleIds =\n category === 'violation'\n ? Object.entries(entries)\n .filter(([key]) => key.startsWith('rule_ids'))\n .map(([key, value]) => value)\n : undefined;\n\n const params = {\n category,\n comment,\n forward,\n ruleIds,\n };\n console.log('PARAMS', params);\n\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.reports.create({\n accountId: account.id,\n statusIds: post?.id ? [post.id] : undefined,\n category,\n comment,\n ruleIds,\n forward,\n });\n setUIState('success');\n showToast(post ? t`Post reported` : t`Profile reported`);\n onClose();\n } catch (error) {\n console.error(error);\n setUIState('error');\n showToast(\n error?.message ||\n (post\n ? t`Unable to report post`\n : t`Unable to report profile`),\n );\n }\n })();\n }}\n >\n <p>\n {post\n ? t`What's the issue with this post?`\n : t`What's the issue with this profile?`}\n </p>\n <section class=\"report-categories\">\n {CATEGORIES.map((category) =>\n category === 'violation' && !rules?.length ? null : (\n <Fragment key={category}>\n <label class=\"report-category\">\n <input\n type=\"radio\"\n name=\"category\"\n value={category}\n required\n disabled={uiState === 'loading'}\n onChange={(e) => {\n setSelectedCategory(e.target.value);\n setShowRules(e.target.value === 'violation');\n }}\n />\n <span>\n {_(CATEGORIES_INFO[category].label)} &nbsp;\n <small class=\"ib insignificant\">\n {_(CATEGORIES_INFO[category].description)}\n </small>\n </span>\n </label>\n {category === 'violation' && !!rules?.length && (\n <div\n class=\"shazam-container no-animation\"\n hidden={!showRules}\n >\n <div class=\"shazam-container-inner\">\n <div class=\"report-rules\" ref={rulesRef}>\n {rules.map((rule, i) => (\n <label class=\"report-rule\" key={rule.id}>\n <input\n type=\"checkbox\"\n name={`rule_ids[${i}]`}\n value={rule.id}\n required={showRules && !hasRules}\n disabled={uiState === 'loading'}\n onChange={(e) => {\n const { checked } = e.target;\n if (checked) {\n setHasRules(true);\n } else {\n const checkedInputs =\n rulesRef.current.querySelectorAll(\n 'input:checked',\n );\n if (!checkedInputs.length) {\n setHasRules(false);\n }\n }\n }}\n />\n <span>{rule.text}</span>\n </label>\n ))}\n </div>\n </div>\n </div>\n )}\n </Fragment>\n ),\n )}\n </section>\n <section class=\"report-comment\">\n <p>\n <label for=\"report-comment\">\n <Trans>Additional info</Trans>\n </label>\n </p>\n <textarea\n maxlength=\"1000\"\n rows=\"1\"\n name=\"comment\"\n id=\"report-comment\"\n disabled={uiState === 'loading'}\n required={!post} // Required if not reporting a post\n />\n </section>\n {!!domain && domain !== currentDomain && (\n <section>\n <p>\n <label>\n <input\n type=\"checkbox\"\n switch\n name=\"forward\"\n disabled={uiState === 'loading'}\n />{' '}\n <span>\n <Trans>\n Forward to <i>{domain}</i>\n </Trans>\n </span>\n </label>\n </p>\n </section>\n )}\n <footer>\n <button type=\"submit\" disabled={uiState === 'loading'}>\n <Trans>Send Report</Trans>\n </button>{' '}\n <button\n type=\"submit\"\n class=\"plain2\"\n disabled={uiState === 'loading'}\n onClick={async () => {\n try {\n await masto.v1.accounts.$select(account.id).mute(); // Infinite duration\n showToast(t`Muted ${username}`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to mute ${username}`);\n }\n // onSubmit will still run\n }}\n >\n <Trans>\n Send Report <small class=\"ib\">+ Mute profile</small>\n </Trans>\n </button>{' '}\n <button\n type=\"submit\"\n class=\"plain2\"\n disabled={uiState === 'loading'}\n onClick={async () => {\n try {\n await masto.v1.accounts.$select(account.id).block();\n showToast(t`Blocked ${username}`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to block ${username}`);\n }\n // onSubmit will still run\n }}\n >\n <Trans>\n Send Report <small class=\"ib\">+ Block profile</small>\n </Trans>\n </button>\n <Loader hidden={uiState !== 'loading'} />\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nexport default ReportModal;\n","// Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>\n// This work is free. You can redistribute it and/or modify it\n// under the terms of the WTFPL, Version 2\n// For more information see LICENSE.txt or http://www.wtfpl.net/\n//\n// For more information, the home page:\n// http://pieroxy.net/blog/pages/lz-string/testing.html\n//\n// LZ-based compression algorithm, version 1.4.5\nvar LZString = (function() {\n\n// private property\nvar f = String.fromCharCode;\nvar keyStrBase64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nvar keyStrUriSafe = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$\";\nvar baseReverseDic = {};\n\nfunction getBaseValue(alphabet, character) {\n if (!baseReverseDic[alphabet]) {\n baseReverseDic[alphabet] = {};\n for (var i=0 ; i<alphabet.length ; i++) {\n baseReverseDic[alphabet][alphabet.charAt(i)] = i;\n }\n }\n return baseReverseDic[alphabet][character];\n}\n\nvar LZString = {\n compressToBase64 : function (input) {\n if (input == null) return \"\";\n var res = LZString._compress(input, 6, function(a){return keyStrBase64.charAt(a);});\n switch (res.length % 4) { // To produce valid Base64\n default: // When could this happen ?\n case 0 : return res;\n case 1 : return res+\"===\";\n case 2 : return res+\"==\";\n case 3 : return res+\"=\";\n }\n },\n\n decompressFromBase64 : function (input) {\n if (input == null) return \"\";\n if (input == \"\") return null;\n return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); });\n },\n\n compressToUTF16 : function (input) {\n if (input == null) return \"\";\n return LZString._compress(input, 15, function(a){return f(a+32);}) + \" \";\n },\n\n decompressFromUTF16: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 16384, function(index) { return compressed.charCodeAt(index) - 32; });\n },\n\n //compress into uint8array (UCS-2 big endian format)\n compressToUint8Array: function (uncompressed) {\n var compressed = LZString.compress(uncompressed);\n var buf=new Uint8Array(compressed.length*2); // 2 bytes per character\n\n for (var i=0, TotalLen=compressed.length; i<TotalLen; i++) {\n var current_value = compressed.charCodeAt(i);\n buf[i*2] = current_value >>> 8;\n buf[i*2+1] = current_value % 256;\n }\n return buf;\n },\n\n //decompress from uint8array (UCS-2 big endian format)\n decompressFromUint8Array:function (compressed) {\n if (compressed===null || compressed===undefined){\n return LZString.decompress(compressed);\n } else {\n var buf=new Array(compressed.length/2); // 2 bytes per character\n for (var i=0, TotalLen=buf.length; i<TotalLen; i++) {\n buf[i]=compressed[i*2]*256+compressed[i*2+1];\n }\n\n var result = [];\n buf.forEach(function (c) {\n result.push(f(c));\n });\n return LZString.decompress(result.join(''));\n\n }\n\n },\n\n\n //compress into a string that is already URI encoded\n compressToEncodedURIComponent: function (input) {\n if (input == null) return \"\";\n return LZString._compress(input, 6, function(a){return keyStrUriSafe.charAt(a);});\n },\n\n //decompress from an output of compressToEncodedURIComponent\n decompressFromEncodedURIComponent:function (input) {\n if (input == null) return \"\";\n if (input == \"\") return null;\n input = input.replace(/ /g, \"+\");\n return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); });\n },\n\n compress: function (uncompressed) {\n return LZString._compress(uncompressed, 16, function(a){return f(a);});\n },\n _compress: function (uncompressed, bitsPerChar, getCharFromInt) {\n if (uncompressed == null) return \"\";\n var i, value,\n context_dictionary= {},\n context_dictionaryToCreate= {},\n context_c=\"\",\n context_wc=\"\",\n context_w=\"\",\n context_enlargeIn= 2, // Compensate for the first entry which should not count\n context_dictSize= 3,\n context_numBits= 2,\n context_data=[],\n context_data_val=0,\n context_data_position=0,\n ii;\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii);\n if (!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)) {\n context_dictionary[context_c] = context_dictSize++;\n context_dictionaryToCreate[context_c] = true;\n }\n\n context_wc = context_w + context_c;\n if (Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)) {\n context_w = context_wc;\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<8 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | value;\n if (context_data_position ==bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = 0;\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<16 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++;\n context_w = String(context_c);\n }\n }\n\n // Output the code for w.\n if (context_w !== \"\") {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<8 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | value;\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = 0;\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<16 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n }\n\n // Mark the end of the stream\n value = 2;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data.push(getCharFromInt(context_data_val));\n break;\n }\n else context_data_position++;\n }\n return context_data.join('');\n },\n\n decompress: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });\n },\n\n _decompress: function (length, resetValue, getNextValue) {\n var dictionary = [],\n next,\n enlargeIn = 4,\n dictSize = 4,\n numBits = 3,\n entry = \"\",\n result = [],\n i,\n w,\n bits, resb, maxpower, power,\n c,\n data = {val:getNextValue(0), position:resetValue, index:1};\n\n for (i = 0; i < 3; i += 1) {\n dictionary[i] = i;\n }\n\n bits = 0;\n maxpower = Math.pow(2,2);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (next = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 2:\n return \"\";\n }\n dictionary[3] = c;\n w = c;\n result.push(c);\n while (true) {\n if (data.index > length) {\n return \"\";\n }\n\n bits = 0;\n maxpower = Math.pow(2,numBits);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (c = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 2:\n return result.join('');\n }\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n if (dictionary[c]) {\n entry = dictionary[c];\n } else {\n if (c === dictSize) {\n entry = w + w.charAt(0);\n } else {\n return null;\n }\n }\n result.push(entry);\n\n // Add w+entry[0] to the dictionary.\n dictionary[dictSize++] = w + entry.charAt(0);\n enlargeIn--;\n\n w = entry;\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n }\n }\n};\n return LZString;\n})();\n\nif (typeof define === 'function' && define.amd) {\n define(function () { return LZString; });\n} else if( typeof module !== 'undefined' && module != null ) {\n module.exports = LZString\n} else if( typeof angular !== 'undefined' && angular != null ) {\n angular.module('LZString', [])\n .factory('LZString', function () {\n return LZString;\n });\n}\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%234169E1'%20d='M14%2052a4%204%200%201%201-8%200%204%204%200%200%201%208%200Zm64-42a4%204%200%201%201-8%200%204%204%200%200%201%208%200Z'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2082%2062'%3e%3crect%20width='78'%20height='58'%20x='2'%20y='2'%20fill='%23999'%20fill-opacity='.3'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='18'%20height='46'%20x='8'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='32'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='56'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M19%203h62v10H19z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M43%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M52%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M3%2049h30v10H3z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M11%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M20%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3c/svg%3e\"","import { api } from '../utils/api';\nimport store from '../utils/store';\n\nconst LIMIT = 200;\nconst MAX_FETCH = 10;\n\nexport async function fetchFollowedTags() {\n const { masto } = api();\n const iterator = masto.v1.followedTags.list({\n limit: LIMIT,\n });\n const tags = [];\n let fetchCount = 0;\n do {\n const { value, done } = await iterator.next();\n if (done || value?.length === 0) break;\n tags.push(...value);\n fetchCount++;\n } while (fetchCount < MAX_FETCH);\n tags.sort((a, b) => a.name.localeCompare(b.name));\n console.log(tags);\n\n if (tags.length) {\n setTimeout(() => {\n // Save to local storage, with saved timestamp\n store.account.set('followedTags', {\n tags,\n updatedAt: Date.now(),\n });\n }, 1);\n }\n\n return tags;\n}\n\nconst MAX_AGE = 24 * 60 * 60 * 1000; // 1 day\nexport async function getFollowedTags() {\n try {\n const { tags, updatedAt } = store.account.get('followedTags') || {};\n if (!tags?.length) return await fetchFollowedTags();\n if (Date.now() - updatedAt > MAX_AGE) {\n // Stale-while-revalidate\n fetchFollowedTags();\n return tags;\n }\n return tags;\n } catch (e) {\n return [];\n }\n}\n\nconst fauxDiv = document.createElement('div');\nexport const extractTagsFromStatus = (content) => {\n if (!content) return [];\n if (content.indexOf('#') === -1) return [];\n fauxDiv.innerHTML = content;\n const hashtagLinks = fauxDiv.querySelectorAll('a.hashtag');\n if (!hashtagLinks.length) return [];\n return Array.from(hashtagLinks).map((a) =>\n a.innerText.trim().replace(/^[^#]*#+/, ''),\n );\n};\n","import { useEffect, useState } from 'preact/hooks';\n\nfunction AsyncText({ children }) {\n if (typeof children === 'string') return children;\n const [text, setText] = useState('');\n useEffect(() => {\n Promise.resolve(children).then(setText);\n }, [children]);\n return text;\n}\n\nexport default AsyncText;\n","import './shortcuts-settings.css';\n\nimport { useAutoAnimate } from '@formkit/auto-animate/preact';\nimport { msg, Plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport {\n compressToEncodedURIComponent,\n decompressFromEncodedURIComponent,\n} from 'lz-string';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport floatingButtonUrl from '../assets/floating-button.svg';\nimport multiColumnUrl from '../assets/multi-column.svg';\nimport tabMenuBarUrl from '../assets/tab-menu-bar.svg';\n\nimport { api } from '../utils/api';\nimport { fetchFollowedTags } from '../utils/followed-tags';\nimport { getLists, getListTitle } from '../utils/lists';\nimport pmem from '../utils/pmem';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\n\nimport AsyncText from './AsyncText';\nimport Icon from './icon';\nimport MenuConfirm from './menu-confirm';\nimport Modal from './modal';\n\nexport const SHORTCUTS_LIMIT = 9;\n\nconst TYPES = [\n 'following',\n 'mentions',\n 'notifications',\n 'list',\n 'public',\n 'trending',\n 'search',\n 'hashtag',\n 'bookmarks',\n 'favourites',\n // NOTE: Hide for now\n // 'account-statuses', // Need @acct search first\n];\nconst TYPE_TEXT = {\n following: msg`Home / Following`,\n notifications: msg`Notifications`,\n list: msg`Lists`,\n public: msg`Public (Local / Federated)`,\n search: msg`Search`,\n 'account-statuses': msg`Account`,\n bookmarks: msg`Bookmarks`,\n favourites: msg`Likes`,\n hashtag: msg`Hashtag`,\n trending: msg`Trending`,\n mentions: msg`Mentions`,\n};\nconst TYPE_PARAMS = {\n list: [\n {\n text: msg`List ID`,\n name: 'id',\n notRequired: true,\n },\n ],\n public: [\n {\n text: msg`Local only`,\n name: 'local',\n type: 'checkbox',\n },\n {\n text: msg`Instance`,\n name: 'instance',\n type: 'text',\n placeholder: msg`Optional, e.g. mastodon.social`,\n notRequired: true,\n },\n ],\n trending: [\n {\n text: msg`Instance`,\n name: 'instance',\n type: 'text',\n placeholder: msg`Optional, e.g. mastodon.social`,\n notRequired: true,\n },\n ],\n search: [\n {\n text: msg`Search term`,\n name: 'query',\n type: 'text',\n placeholder: msg`Optional, unless for multi-column mode`,\n notRequired: true,\n },\n ],\n 'account-statuses': [\n {\n text: '@',\n name: 'id',\n type: 'text',\n placeholder: 'cheeaun@mastodon.social',\n },\n ],\n hashtag: [\n {\n text: '#',\n name: 'hashtag',\n type: 'text',\n placeholder: msg`e.g. PixelArt (Max 5, space-separated)`,\n pattern: '[^#]+',\n },\n {\n text: msg`Media only`,\n name: 'media',\n type: 'checkbox',\n },\n {\n text: msg`Instance`,\n name: 'instance',\n type: 'text',\n placeholder: msg`Optional, e.g. mastodon.social`,\n notRequired: true,\n },\n ],\n};\nconst fetchAccountTitle = pmem(async ({ id }) => {\n const account = await api().masto.v1.accounts.$select(id).fetch();\n return account.username || account.acct || account.displayName;\n});\nexport const SHORTCUTS_META = {\n following: {\n id: 'home',\n title: (_, index) =>\n index === 0\n ? t`Home`\n : t({ id: 'following.title', message: 'Following' }),\n path: '/',\n icon: 'home',\n },\n mentions: {\n id: 'mentions',\n title: msg`Mentions`,\n path: '/mentions',\n icon: 'at',\n },\n notifications: {\n id: 'notifications',\n title: msg`Notifications`,\n path: '/notifications',\n icon: 'notification',\n },\n list: {\n id: ({ id }) => (id ? 'list' : 'lists'),\n title: ({ id }) => (id ? getListTitle(id) : t`Lists`),\n path: ({ id }) => (id ? `/l/${id}` : '/l'),\n icon: 'list',\n excludeViewMode: ({ id }) => (!id ? ['multi-column'] : []),\n },\n public: {\n id: 'public',\n title: ({ local }) => (local ? t`Local` : t`Federated`),\n subtitle: ({ instance }) => instance || api().instance,\n path: ({ local, instance }) => `/${instance}/p${local ? '/l' : ''}`,\n icon: ({ local }) => (local ? 'building' : 'earth'),\n },\n trending: {\n id: 'trending',\n title: msg`Trending`,\n subtitle: ({ instance }) => instance || api().instance,\n path: ({ instance }) => `/${instance}/trending`,\n icon: 'chart',\n },\n search: {\n id: 'search',\n title: ({ query }) => (query ? `“${query}”` : t`Search`),\n path: ({ query }) =>\n query\n ? `/search?q=${encodeURIComponent(query)}&type=statuses`\n : '/search',\n icon: 'search',\n excludeViewMode: ({ query }) => (!query ? ['multi-column'] : []),\n },\n 'account-statuses': {\n id: 'account-statuses',\n title: fetchAccountTitle,\n path: ({ id }) => `/a/${id}`,\n icon: 'user',\n },\n bookmarks: {\n id: 'bookmarks',\n title: msg`Bookmarks`,\n path: '/b',\n icon: 'bookmark',\n },\n favourites: {\n id: 'favourites',\n title: msg`Likes`,\n path: '/f',\n icon: 'heart',\n },\n hashtag: {\n id: 'hashtag',\n title: ({ hashtag }) => hashtag,\n subtitle: ({ instance }) => instance || api().instance,\n path: ({ hashtag, instance, media }) =>\n `${instance ? `/${instance}` : ''}/t/${hashtag.split(/\\s+/).join('+')}${\n media ? '?media=1' : ''\n }`,\n icon: 'hashtag',\n },\n};\n\nfunction ShortcutsSettings({ onClose }) {\n const { _ } = useLingui();\n const snapStates = useSnapshot(states);\n const { shortcuts } = snapStates;\n const [showForm, setShowForm] = useState(false);\n const [showImportExport, setShowImportExport] = useState(false);\n\n const [shortcutsListParent] = useAutoAnimate();\n\n return (\n <div id=\"shortcuts-settings-container\" class=\"sheet\" tabindex=\"-1\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Icon icon=\"shortcut\" /> <Trans>Shortcuts</Trans>{' '}\n <sup\n style={{\n fontSize: 12,\n opacity: 0.5,\n textTransform: 'uppercase',\n }}\n >\n <Trans>beta</Trans>\n </sup>\n </h2>\n </header>\n <main>\n <p>\n <Trans>Specify a list of shortcuts that'll appear&nbsp;as:</Trans>\n </p>\n <div class=\"shortcuts-view-mode\">\n {[\n {\n value: 'float-button',\n label: t`Floating button`,\n imgURL: floatingButtonUrl,\n },\n {\n value: 'tab-menu-bar',\n label: t`Tab/Menu bar`,\n imgURL: tabMenuBarUrl,\n },\n {\n value: 'multi-column',\n label: t`Multi-column`,\n imgURL: multiColumnUrl,\n },\n ].map(({ value, label, imgURL }) => {\n const checked =\n snapStates.settings.shortcutsViewMode === value ||\n (value === 'float-button' &&\n !snapStates.settings.shortcutsViewMode);\n return (\n <label key={value} class={checked ? 'checked' : ''}>\n <input\n type=\"radio\"\n name=\"shortcuts-view-mode\"\n value={value}\n checked={checked}\n onChange={(e) => {\n states.settings.shortcutsViewMode = e.target.value;\n }}\n />{' '}\n <img src={imgURL} alt=\"\" width=\"80\" height=\"58\" />{' '}\n <span>{label}</span>\n </label>\n );\n })}\n </div>\n {shortcuts.length > 0 ? (\n <>\n <ol class=\"shortcuts-list\" ref={shortcutsListParent}>\n {shortcuts.filter(Boolean).map((shortcut, i) => {\n // const key = i + Object.values(shortcut);\n const key = Object.values(shortcut).join('-');\n const { type } = shortcut;\n if (!SHORTCUTS_META[type]) return null;\n let { icon, title, subtitle, excludeViewMode } =\n SHORTCUTS_META[type];\n if (typeof title === 'function') {\n title = title(shortcut, i);\n } else {\n title = _(title);\n }\n if (typeof subtitle === 'function') {\n subtitle = subtitle(shortcut, i);\n } else {\n subtitle = _(subtitle);\n }\n if (typeof icon === 'function') {\n icon = icon(shortcut, i);\n }\n if (typeof excludeViewMode === 'function') {\n excludeViewMode = excludeViewMode(shortcut, i);\n }\n const excludedViewMode = excludeViewMode?.includes(\n snapStates.settings.shortcutsViewMode,\n );\n return (\n <li key={key}>\n <Icon icon={icon} />\n <span class=\"shortcut-text\">\n <AsyncText>{title}</AsyncText>\n {subtitle && (\n <>\n {' '}\n <small class=\"ib insignificant\">{subtitle}</small>\n </>\n )}\n {excludedViewMode && (\n <span class=\"tag\">\n <Trans>Not available in current view mode</Trans>\n </span>\n )}\n </span>\n <span class=\"shortcut-actions\">\n <button\n type=\"button\"\n class=\"plain small\"\n disabled={i === 0}\n onClick={() => {\n const shortcutsArr = Array.from(states.shortcuts);\n if (i > 0) {\n const temp = states.shortcuts[i - 1];\n shortcutsArr[i - 1] = shortcut;\n shortcutsArr[i] = temp;\n states.shortcuts = shortcutsArr;\n }\n }}\n >\n <Icon icon=\"arrow-up\" alt={t`Move up`} />\n </button>\n <button\n type=\"button\"\n class=\"plain small\"\n disabled={i === shortcuts.length - 1}\n onClick={() => {\n const shortcutsArr = Array.from(states.shortcuts);\n if (i < states.shortcuts.length - 1) {\n const temp = states.shortcuts[i + 1];\n shortcutsArr[i + 1] = shortcut;\n shortcutsArr[i] = temp;\n states.shortcuts = shortcutsArr;\n }\n }}\n >\n <Icon icon=\"arrow-down\" alt={t`Move down`} />\n </button>\n <button\n type=\"button\"\n class=\"plain small\"\n onClick={() => {\n setShowForm({\n shortcut,\n shortcutIndex: i,\n });\n }}\n >\n <Icon icon=\"pencil\" alt={t`Edit`} />\n </button>\n {/* <button\n type=\"button\"\n class=\"plain small\"\n onClick={() => {\n states.shortcuts.splice(i, 1);\n }}\n >\n <Icon icon=\"x\" alt=\"Remove\" />\n </button> */}\n </span>\n </li>\n );\n })}\n </ol>\n {shortcuts.length === 1 &&\n snapStates.settings.shortcutsViewMode !== 'float-button' && (\n <div class=\"ui-state insignificant\">\n <Icon icon=\"info\" />{' '}\n <small>\n <Trans>\n Add more than one shortcut/column to make this work.\n </Trans>\n </small>\n </div>\n )}\n </>\n ) : (\n <div class=\"ui-state insignificant\">\n <p>\n {snapStates.settings.shortcutsViewMode === 'multi-column'\n ? t`No columns yet. Tap on the Add column button.`\n : t`No shortcuts yet. Tap on the Add shortcut button.`}\n </p>\n <p>\n <Trans>\n Not sure what to add?\n <br />\n Try adding{' '}\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n states.shortcuts = [\n {\n type: 'following',\n },\n {\n type: 'notifications',\n },\n ];\n }}\n >\n Home / Following and Notifications\n </a>{' '}\n first.\n </Trans>\n </p>\n </div>\n )}\n <p class=\"insignificant\">\n {shortcuts.length >= SHORTCUTS_LIMIT &&\n (snapStates.settings.shortcutsViewMode === 'multi-column'\n ? t`Max ${SHORTCUTS_LIMIT} columns`\n : t`Max ${SHORTCUTS_LIMIT} shortcuts`)}\n </p>\n <p\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n }}\n >\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => setShowImportExport(true)}\n >\n <Trans>Import/export</Trans>\n </button>\n <button\n type=\"button\"\n disabled={shortcuts.length >= SHORTCUTS_LIMIT}\n onClick={() => setShowForm(true)}\n >\n <Icon icon=\"plus\" />{' '}\n <span>\n {snapStates.settings.shortcutsViewMode === 'multi-column'\n ? t`Add column…`\n : t`Add shortcut…`}\n </span>\n </button>\n </p>\n </main>\n {showForm && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowForm(false);\n }\n }}\n >\n <ShortcutForm\n shortcut={showForm.shortcut}\n shortcutIndex={showForm.shortcutIndex}\n onSubmit={({ result, mode }) => {\n console.log('onSubmit', result);\n if (mode === 'edit') {\n states.shortcuts[showForm.shortcutIndex] = result;\n } else {\n states.shortcuts.push(result);\n }\n }}\n onClose={() => setShowForm(false)}\n />\n </Modal>\n )}\n {showImportExport && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowImportExport(false);\n }\n }}\n >\n <ImportExport\n shortcuts={shortcuts}\n onClose={() => setShowImportExport(false)}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nconst FORM_NOTES = {\n list: msg`Specific list is optional. For multi-column mode, list is required, else the column will not be shown.`,\n search: msg`For multi-column mode, search term is required, else the column will not be shown.`,\n hashtag: msg`Multiple hashtags are supported. Space-separated.`,\n};\n\nfunction ShortcutForm({\n onSubmit,\n disabled,\n shortcut,\n shortcutIndex,\n onClose,\n}) {\n const { _ } = useLingui();\n console.log('shortcut', shortcut);\n const editMode = !!shortcut;\n const [currentType, setCurrentType] = useState(shortcut?.type || null);\n\n const [uiState, setUIState] = useState('default');\n const [lists, setLists] = useState([]);\n const [followedHashtags, setFollowedHashtags] = useState([]);\n useEffect(() => {\n (async () => {\n if (currentType !== 'list') return;\n try {\n setUIState('loading');\n const lists = await getLists();\n setLists(lists);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n\n (async () => {\n if (currentType !== 'hashtag') return;\n try {\n const tags = await fetchFollowedTags();\n setFollowedHashtags(tags);\n } catch (e) {\n console.error(e);\n }\n })();\n }, [currentType]);\n\n const formRef = useRef();\n useEffect(() => {\n if (editMode && currentType && TYPE_PARAMS[currentType]) {\n // Populate form\n const form = formRef.current;\n TYPE_PARAMS[currentType].forEach(({ name, type }) => {\n const input = form.querySelector(`[name=\"${name}\"]`);\n if (input && shortcut[name]) {\n if (type === 'checkbox') {\n input.checked = shortcut[name] === 'on' ? true : false;\n } else {\n input.value = shortcut[name];\n }\n }\n });\n }\n }, [editMode, currentType]);\n\n return (\n <div id=\"shortcut-settings-form\" class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>{editMode ? t`Edit shortcut` : t`Add shortcut`}</h2>\n </header>\n <main tabindex=\"-1\">\n <form\n ref={formRef}\n onSubmit={(e) => {\n // Construct a nice object from form\n e.preventDefault();\n const data = new FormData(e.target);\n const result = {};\n data.forEach((value, key) => {\n result[key] = value?.trim();\n if (key === 'instance') {\n // Remove protocol and trailing slash\n result[key] = result[key]\n .replace(/^https?:\\/\\//, '')\n .replace(/\\/+$/, '');\n // Remove @acct@ or acct@ from instance URL\n result[key] = result[key].replace(/^@?[^@]+@/, '');\n }\n });\n console.log('result', result);\n if (!result.type) return;\n onSubmit({\n result,\n mode: editMode ? 'edit' : 'add',\n });\n // Reset\n e.target.reset();\n setCurrentType(null);\n onClose?.();\n }}\n >\n <p>\n <label>\n <span>\n <Trans>Timeline</Trans>\n </span>\n <select\n required\n disabled={disabled}\n onChange={(e) => {\n setCurrentType(e.target.value);\n }}\n defaultValue={editMode ? shortcut.type : undefined}\n name=\"type\"\n dir=\"auto\"\n >\n <option></option>\n {TYPES.map((type) => (\n <option value={type}>{_(TYPE_TEXT[type])}</option>\n ))}\n </select>\n </label>\n </p>\n {TYPE_PARAMS[currentType]?.map?.(\n ({ text, name, type, placeholder, pattern, notRequired }) => {\n if (currentType === 'list') {\n return (\n <p>\n <label>\n <span>\n <Trans>List</Trans>\n </span>\n <select\n name=\"id\"\n required={!notRequired}\n disabled={disabled || uiState === 'loading'}\n defaultValue={editMode ? shortcut.id : undefined}\n dir=\"auto\"\n >\n <option value=\"\"></option>\n {lists.map((list) => (\n <option value={list.id}>{list.title}</option>\n ))}\n </select>\n </label>\n </p>\n );\n }\n\n return (\n <p>\n <label>\n <span>{_(text)}</span>{' '}\n <input\n type={type}\n switch={type === 'checkbox' || undefined}\n name={name}\n placeholder={_(placeholder)}\n required={type === 'text' && !notRequired}\n disabled={disabled}\n list={\n currentType === 'hashtag'\n ? 'followed-hashtags-datalist'\n : null\n }\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck={false}\n pattern={pattern}\n dir=\"auto\"\n />\n {currentType === 'hashtag' &&\n followedHashtags.length > 0 && (\n <datalist id=\"followed-hashtags-datalist\">\n {followedHashtags.map((tag) => (\n <option value={tag.name} />\n ))}\n </datalist>\n )}\n </label>\n </p>\n );\n },\n )}\n {!!FORM_NOTES[currentType] && (\n <p class=\"form-note insignificant\">\n <Icon icon=\"info\" />\n {_(FORM_NOTES[currentType])}\n </p>\n )}\n <footer>\n <button\n type=\"submit\"\n class=\"block\"\n disabled={disabled || uiState === 'loading'}\n >\n {editMode ? t`Save` : t`Add`}\n </button>\n {editMode && (\n <button\n type=\"button\"\n class=\"light danger\"\n onClick={() => {\n states.shortcuts.splice(shortcutIndex, 1);\n onClose?.();\n }}\n >\n <Trans>Remove</Trans>\n </button>\n )}\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nfunction ImportExport({ shortcuts, onClose }) {\n const { _ } = useLingui();\n const { masto } = api();\n const shortcutsStr = useMemo(() => {\n if (!shortcuts) return '';\n if (!shortcuts.filter(Boolean).length) return '';\n return compressToEncodedURIComponent(\n JSON.stringify(shortcuts.filter(Boolean)),\n );\n }, [shortcuts]);\n const [importShortcutStr, setImportShortcutStr] = useState('');\n const [importUIState, setImportUIState] = useState('default');\n const parsedImportShortcutStr = useMemo(() => {\n if (!importShortcutStr) {\n setImportUIState('default');\n return null;\n }\n try {\n const parsed = JSON.parse(\n decompressFromEncodedURIComponent(importShortcutStr),\n );\n // Very basic validation, I know\n if (!Array.isArray(parsed)) throw new Error('Not an array');\n setImportUIState('default');\n return parsed;\n } catch (err) {\n // Fallback to JSON string parsing\n // There's a chance that someone might want to import a JSON string instead of the compressed version\n try {\n const parsed = JSON.parse(importShortcutStr);\n if (!Array.isArray(parsed)) throw new Error('Not an array');\n setImportUIState('default');\n return parsed;\n } catch (err) {\n setImportUIState('error');\n return null;\n }\n }\n }, [importShortcutStr]);\n const hasCurrentSettings = states.shortcuts.length > 0;\n\n const shortcutsImportFieldRef = useRef();\n\n return (\n <div id=\"import-export-container\" class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>\n Import/Export <small class=\"ib insignificant\">Shortcuts</small>\n </Trans>\n </h2>\n </header>\n <main tabindex=\"-1\">\n <section>\n <h3>\n <Icon icon=\"arrow-down-circle\" size=\"l\" class=\"insignificant\" />{' '}\n <span>\n <Trans>Import</Trans>\n </span>\n </h3>\n <p class=\"field-button\">\n <input\n ref={shortcutsImportFieldRef}\n type=\"text\"\n name=\"import\"\n placeholder={t`Paste shortcuts here`}\n class=\"block\"\n onInput={(e) => {\n setImportShortcutStr(e.target.value);\n }}\n dir=\"auto\"\n />\n {states.settings.shortcutSettingsCloudImportExport && (\n <button\n type=\"button\"\n class=\"plain2 small\"\n disabled={importUIState === 'cloud-downloading'}\n onClick={async () => {\n setImportUIState('cloud-downloading');\n const currentAccount = getCurrentAccountID();\n showToast(\n t`Downloading saved shortcuts from instance server…`,\n );\n try {\n const relationships =\n await masto.v1.accounts.relationships.fetch({\n id: [currentAccount],\n });\n const relationship = relationships[0];\n if (relationship) {\n const { note = '' } = relationship;\n if (\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/.test(\n note,\n )\n ) {\n const settings = note.match(\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/,\n )[1];\n const { v, dt, data } = JSON.parse(settings);\n shortcutsImportFieldRef.current.value = data;\n shortcutsImportFieldRef.current.dispatchEvent(\n new Event('input'),\n );\n }\n }\n setImportUIState('default');\n } catch (e) {\n console.error(e);\n setImportUIState('error');\n showToast(t`Unable to download shortcuts`);\n }\n }}\n title={t`Download shortcuts from instance server`}\n >\n <Icon icon=\"cloud\" />\n <Icon icon=\"arrow-down\" />\n </button>\n )}\n </p>\n {!!parsedImportShortcutStr &&\n Array.isArray(parsedImportShortcutStr) && (\n <>\n <p>\n <b>{parsedImportShortcutStr.length}</b> shortcut\n {parsedImportShortcutStr.length > 1 ? 's' : ''}{' '}\n <small class=\"insignificant\">\n ({importShortcutStr.length} characters)\n </small>\n </p>\n <ol class=\"import-settings-list\">\n {parsedImportShortcutStr.map((shortcut) => (\n <li>\n <span\n style={{\n opacity: shortcuts.some((s) =>\n // Compare all properties\n Object.keys(s).every(\n (key) => s[key] === shortcut[key],\n ),\n )\n ? 1\n : 0,\n }}\n >\n *\n </span>\n <span>\n {_(TYPE_TEXT[shortcut.type])}\n {shortcut.type === 'list' && ' ⚠️'}{' '}\n {TYPE_PARAMS[shortcut.type]?.map?.(\n ({ text, name, type }) =>\n shortcut[name] ? (\n <>\n <span class=\"tag collapsed insignificant\">\n {text}:{' '}\n {type === 'checkbox'\n ? shortcut[name] === 'on'\n ? '✅'\n : '❌'\n : shortcut[name]}\n </span>{' '}\n </>\n ) : null,\n )}\n </span>\n </li>\n ))}\n </ol>\n <p>\n <small>\n <Trans>* Exists in current shortcuts</Trans>\n </small>\n <br />\n <small>\n ⚠️{' '}\n <Trans>\n List may not work if it's from a different account.\n </Trans>\n </small>\n </p>\n </>\n )}\n {importUIState === 'error' && (\n <p class=\"error\">\n <small>\n ⚠️ <Trans>Invalid settings format</Trans>\n </small>\n </p>\n )}\n <p>\n {hasCurrentSettings && (\n <>\n <MenuConfirm\n confirmLabel={t`Append to current shortcuts?`}\n menuFooter={\n <div class=\"footer\">\n <Trans>\n Only shortcuts that dont exist in current shortcuts\n will be appended.\n </Trans>\n </div>\n }\n onClick={() => {\n // states.shortcuts = [\n // ...states.shortcuts,\n // ...parsedImportShortcutStr,\n // ];\n // Append non-unique shortcuts only\n const nonUniqueShortcuts = parsedImportShortcutStr.filter(\n (shortcut) =>\n !states.shortcuts.some((s) =>\n // Compare all properties\n Object.keys(s).every(\n (key) => s[key] === shortcut[key],\n ),\n ),\n );\n if (!nonUniqueShortcuts.length) {\n showToast(t`No new shortcuts to import`);\n return;\n }\n let newShortcuts = [\n ...states.shortcuts,\n ...nonUniqueShortcuts,\n ];\n const exceededLimit = newShortcuts.length > SHORTCUTS_LIMIT;\n if (exceededLimit) {\n // If exceeded, trim it\n newShortcuts = newShortcuts.slice(0, SHORTCUTS_LIMIT);\n }\n states.shortcuts = newShortcuts;\n showToast(\n exceededLimit\n ? t`Shortcuts imported. Exceeded max ${SHORTCUTS_LIMIT}, so the rest are not imported.`\n : t`Shortcuts imported`,\n );\n onClose?.();\n }}\n >\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!parsedImportShortcutStr}\n >\n <Trans>Import & append…</Trans>\n </button>\n </MenuConfirm>{' '}\n </>\n )}\n <MenuConfirm\n confirmLabel={\n hasCurrentSettings\n ? t`Override current shortcuts?`\n : t`Import shortcuts?`\n }\n menuItemClassName={hasCurrentSettings ? 'danger' : undefined}\n onClick={() => {\n states.shortcuts = parsedImportShortcutStr;\n showToast(t`Shortcuts imported`);\n onClose?.();\n }}\n >\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!parsedImportShortcutStr}\n >\n {hasCurrentSettings ? t`or override…` : t`Import…`}\n </button>\n </MenuConfirm>\n </p>\n </section>\n <section>\n <h3>\n <Icon icon=\"arrow-up-circle\" size=\"l\" class=\"insignificant\" />{' '}\n <span>\n <Trans>Export</Trans>\n </span>\n </h3>\n <p>\n <input\n style={{ width: '100%' }}\n type=\"text\"\n value={shortcutsStr}\n readOnly\n onClick={(e) => {\n if (!e.target.value) return;\n e.target.select();\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(e.target.value);\n showToast(t`Shortcuts copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy shortcuts`);\n }\n }}\n dir=\"auto\"\n />\n </p>\n <p>\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!shortcutsStr}\n onClick={() => {\n try {\n navigator.clipboard.writeText(shortcutsStr);\n showToast(t`Shortcut settings copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy shortcut settings`);\n }\n }}\n >\n <Icon icon=\"clipboard\" />{' '}\n <span>\n <Trans>Copy</Trans>\n </span>\n </button>{' '}\n {navigator?.share &&\n navigator?.canShare?.({\n text: shortcutsStr,\n }) && (\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={!shortcutsStr}\n onClick={() => {\n try {\n navigator.share({\n text: shortcutsStr,\n });\n } catch (e) {\n console.error(e);\n alert(t`Sharing doesn't seem to work.`);\n }\n }}\n >\n <Icon icon=\"share\" />{' '}\n <span>\n <Trans>Share</Trans>\n </span>\n </button>\n )}{' '}\n {states.settings.shortcutSettingsCloudImportExport && (\n <button\n type=\"button\"\n class=\"plain2\"\n disabled={importUIState === 'cloud-uploading'}\n onClick={async () => {\n setImportUIState('cloud-uploading');\n const currentAccount = getCurrentAccountID();\n try {\n const relationships =\n await masto.v1.accounts.relationships.fetch({\n id: [currentAccount],\n });\n const relationship = relationships[0];\n if (relationship) {\n const { note = '' } = relationship;\n // const newNote = `${note}\\n\\n\\n$<phanpy-shortcuts-settings>{shortcutsStr}</phanpy-shortcuts-settings>`;\n let newNote = '';\n const settingsJSON = JSON.stringify({\n v: '1', // version\n dt: Date.now(), // datetime stamp\n data: shortcutsStr, // shortcuts settings string\n });\n if (\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/.test(\n note,\n )\n ) {\n newNote = note.replace(\n /<phanpy-shortcuts-settings>(.*)<\\/phanpy-shortcuts-settings>/,\n `<phanpy-shortcuts-settings>${settingsJSON}</phanpy-shortcuts-settings>`,\n );\n } else {\n newNote = `${note}\\n\\n\\n<phanpy-shortcuts-settings>${settingsJSON}</phanpy-shortcuts-settings>`;\n }\n showToast(t`Saving shortcuts to instance server…`);\n await masto.v1.accounts\n .$select(currentAccount)\n .note.create({\n comment: newNote,\n });\n setImportUIState('default');\n showToast(t`Shortcuts saved`);\n }\n } catch (e) {\n console.error(e);\n setImportUIState('error');\n showToast(t`Unable to save shortcuts`);\n }\n }}\n title={t`Sync to instance server`}\n >\n <Icon icon=\"cloud\" />\n <Icon icon=\"arrow-up\" />\n </button>\n )}{' '}\n {shortcutsStr.length > 0 && (\n <small class=\"insignificant ib\">\n <Plural\n value={shortcutsStr.length}\n one=\"# character\"\n other=\"# characters\"\n />\n </small>\n )}\n </p>\n {!!shortcutsStr && (\n <details>\n <summary class=\"insignificant\">\n <small>\n <Trans>Raw Shortcuts JSON</Trans>\n </small>\n </summary>\n <textarea style={{ width: '100%' }} rows={10} readOnly>\n {JSON.stringify(shortcuts.filter(Boolean), null, 2)}\n </textarea>\n </details>\n )}\n </section>\n {states.settings.shortcutSettingsCloudImportExport && (\n <footer>\n <p>\n <Icon icon=\"cloud\" />{' '}\n <Trans>\n Import/export settings from/to instance server (Very\n experimental)\n </Trans>\n </p>\n </footer>\n )}\n </main>\n </div>\n );\n}\n\nexport default ShortcutsSettings;\n","import { t, Trans } from '@lingui/macro';\nimport { useEffect } from 'preact/hooks';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { subscribe, useSnapshot } from 'valtio';\n\nimport Accounts from '../pages/accounts';\nimport Settings from '../pages/settings';\nimport focusDeck from '../utils/focus-deck';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\n\nimport AccountSheet from './account-sheet';\nimport ComposeSuspense, { preload } from './compose-suspense';\nimport Drafts from './drafts';\nimport EmbedModal from './embed-modal';\nimport GenericAccounts from './generic-accounts';\nimport MediaAltModal from './media-alt-modal';\nimport MediaModal from './media-modal';\nimport Modal from './modal';\nimport ReportModal from './report-modal';\nimport ShortcutsSettings from './shortcuts-settings';\n\nsubscribe(states, (changes) => {\n for (const [action, path, value, prevValue] of changes) {\n // When closing modal, focus on deck\n if (/^show/i.test(path) && !value) {\n focusDeck();\n }\n }\n});\n\nexport default function Modals() {\n const snapStates = useSnapshot(states);\n const navigate = useNavigate();\n const location = useLocation();\n\n useEffect(() => {\n setTimeout(preload, 1000);\n }, []);\n\n return (\n <>\n {!!snapStates.showCompose && (\n <Modal\n class={`solid ${snapStates.composerState.minimized ? 'min' : ''}`}\n minimized={!!snapStates.composerState.minimized}\n >\n <ComposeSuspense\n replyToStatus={\n typeof snapStates.showCompose !== 'boolean'\n ? snapStates.showCompose.replyToStatus\n : window.__COMPOSE__?.replyToStatus || null\n }\n editStatus={\n states.showCompose?.editStatus ||\n window.__COMPOSE__?.editStatus ||\n null\n }\n draftStatus={\n states.showCompose?.draftStatus ||\n window.__COMPOSE__?.draftStatus ||\n null\n }\n onClose={(results) => {\n const { newStatus, instance, type } = results || {};\n states.showCompose = false;\n window.__COMPOSE__ = null;\n if (newStatus) {\n states.reloadStatusPage++;\n showToast({\n text: {\n post: t`Post published. Check it out.`,\n reply: t`Reply posted. Check it out.`,\n edit: t`Post updated. Check it out.`,\n }[type || 'post'],\n delay: 1000,\n duration: 10_000, // 10 seconds\n onClick: (toast) => {\n toast.hideToast();\n states.prevLocation = location;\n navigate(\n instance\n ? `/${instance}/s/${newStatus.id}`\n : `/s/${newStatus.id}`,\n );\n },\n });\n }\n }}\n />\n </Modal>\n )}\n {!!snapStates.showSettings && (\n <Modal\n onClose={() => {\n states.showSettings = false;\n }}\n >\n <Settings\n onClose={() => {\n states.showSettings = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showAccounts && (\n <Modal\n onClose={() => {\n states.showAccounts = false;\n }}\n >\n <Accounts\n onClose={() => {\n states.showAccounts = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showAccount && (\n <Modal\n onClose={() => {\n states.showAccount = false;\n }}\n >\n <AccountSheet\n account={snapStates.showAccount?.account || snapStates.showAccount}\n instance={snapStates.showAccount?.instance}\n onClose={({ destination } = {}) => {\n states.showAccount = false;\n // states.showGenericAccounts = false;\n // if (destination) {\n // states.showAccounts = false;\n // }\n }}\n />\n </Modal>\n )}\n {!!snapStates.showDrafts && (\n <Modal\n onClose={() => {\n states.showDrafts = false;\n }}\n >\n <Drafts onClose={() => (states.showDrafts = false)} />\n </Modal>\n )}\n {!!snapStates.showMediaModal && (\n <Modal\n onClick={(e) => {\n if (\n e.target === e.currentTarget ||\n e.target.classList.contains('media')\n ) {\n states.showMediaModal = false;\n }\n }}\n >\n <MediaModal\n mediaAttachments={snapStates.showMediaModal.mediaAttachments}\n instance={snapStates.showMediaModal.instance}\n index={snapStates.showMediaModal.index}\n statusID={snapStates.showMediaModal.statusID}\n onClose={() => {\n states.showMediaModal = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showShortcutsSettings && (\n <Modal\n onClose={() => {\n states.showShortcutsSettings = false;\n }}\n >\n <ShortcutsSettings\n onClose={() => (states.showShortcutsSettings = false)}\n />\n </Modal>\n )}\n {!!snapStates.showGenericAccounts && (\n <Modal\n onClose={() => {\n states.showGenericAccounts = false;\n }}\n >\n <GenericAccounts\n instance={snapStates.showGenericAccounts.instance}\n excludeRelationshipAttrs={\n snapStates.showGenericAccounts.excludeRelationshipAttrs\n }\n postID={snapStates.showGenericAccounts.postID}\n onClose={() => (states.showGenericAccounts = false)}\n blankCopy={snapStates.showGenericAccounts.blankCopy}\n />\n </Modal>\n )}\n {!!snapStates.showMediaAlt && (\n <Modal\n onClose={(e) => {\n states.showMediaAlt = false;\n }}\n >\n <MediaAltModal\n alt={snapStates.showMediaAlt.alt || snapStates.showMediaAlt}\n lang={snapStates.showMediaAlt?.lang}\n onClose={() => {\n states.showMediaAlt = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showEmbedModal && (\n <Modal\n class=\"solid\"\n onClose={() => {\n states.showEmbedModal = false;\n }}\n >\n <EmbedModal\n html={snapStates.showEmbedModal.html}\n url={snapStates.showEmbedModal.url}\n width={snapStates.showEmbedModal.width}\n height={snapStates.showEmbedModal.height}\n onClose={() => {\n states.showEmbedModal = false;\n }}\n />\n </Modal>\n )}\n {!!snapStates.showReportModal && (\n <Modal\n onClose={() => {\n states.showReportModal = false;\n }}\n >\n <ReportModal\n account={snapStates.showReportModal.account}\n post={snapStates.showReportModal.post}\n onClose={() => {\n states.showReportModal = false;\n }}\n />\n </Modal>\n )}\n </>\n );\n}\n","import { t, Trans } from '@lingui/macro';\nimport { useState } from 'preact/hooks';\n\nimport { api } from '../utils/api';\n\nimport Icon from './icon';\nimport Loader from './loader';\n\nfunction FollowRequestButtons({ accountID, onChange }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [requestState, setRequestState] = useState(null); // accept, reject\n const [relationship, setRelationship] = useState(null);\n\n const hasRelationship = relationship !== null;\n\n return (\n <p class=\"follow-request-buttons\">\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRelationship}\n onClick={() => {\n setUIState('loading');\n setRequestState('accept');\n (async () => {\n try {\n const rel = await masto.v1.followRequests\n .$select(accountID)\n .authorize();\n if (!rel?.followedBy) {\n throw new Error('Follow request not accepted');\n }\n setRelationship(rel);\n onChange();\n } catch (e) {\n console.error(e);\n }\n setUIState('default');\n })();\n }}\n >\n <Trans>Accept</Trans>\n </button>{' '}\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRelationship}\n class=\"light danger\"\n onClick={() => {\n setUIState('loading');\n setRequestState('reject');\n (async () => {\n try {\n const rel = await masto.v1.followRequests\n .$select(accountID)\n .reject();\n if (rel?.followedBy) {\n throw new Error('Follow request not rejected');\n }\n setRelationship(rel);\n onChange();\n } catch (e) {\n console.error(e);\n setUIState('default');\n }\n })();\n }}\n >\n <Trans>Reject</Trans>\n </button>\n <span class=\"follow-request-states\">\n {hasRelationship && requestState ? (\n requestState === 'accept' ? (\n <Icon\n icon=\"check-circle\"\n alt={t`Accepted`}\n class=\"follow-accepted\"\n />\n ) : (\n <Icon icon=\"x-circle\" alt={t`Rejected`} class=\"follow-rejected\" />\n )\n ) : (\n <Loader hidden={uiState !== 'loading'} />\n )}\n </span>\n </p>\n );\n}\n\nexport default FollowRequestButtons;\n","import { msg, Plural, Select, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\n\nimport { api } from '../utils/api';\nimport { isFiltered } from '../utils/filters';\nimport shortenNumber from '../utils/shorten-number';\nimport states, { statusKey } from '../utils/states';\nimport { getCurrentAccountID } from '../utils/store-utils';\nimport useTruncated from '../utils/useTruncated';\n\nimport Avatar from './avatar';\nimport CustomEmoji from './custom-emoji';\nimport FollowRequestButtons from './follow-request-buttons';\nimport Icon from './icon';\nimport Link from './link';\nimport NameText from './name-text';\nimport Status from './status';\n\nconst NOTIFICATION_ICONS = {\n mention: 'comment',\n status: 'notification',\n reblog: 'rocket',\n follow: 'follow',\n follow_request: 'follow-add',\n favourite: 'heart',\n poll: 'poll',\n update: 'pencil',\n 'admin.signup': 'account-edit',\n 'admin.report': 'account-warning',\n severed_relationships: 'heart-break',\n moderation_warning: 'alert',\n emoji_reaction: 'emoji2',\n 'pleroma:emoji_reaction': 'emoji2',\n};\n\n/*\nNotification types\n==================\nmention = Someone mentioned you in their status\nstatus = Someone you enabled notifications for has posted a status\nreblog = Someone boosted one of your statuses\nfollow = Someone followed you\nfollow_request = Someone requested to follow you\nfavourite = Someone favourited one of your statuses\npoll = A poll you have voted in or created has ended\nupdate = A status you interacted with has been edited\nadmin.sign_up = Someone signed up (optionally sent to admins)\nadmin.report = A new report has been filed\nsevered_relationships = Severed relationships\nmoderation_warning = Moderation warning\n*/\n\nfunction emojiText({ account, emoji, emoji_url }) {\n let url;\n let staticUrl;\n if (typeof emoji_url === 'string') {\n url = emoji_url;\n } else {\n url = emoji_url?.url;\n staticUrl = emoji_url?.staticUrl;\n }\n const emojiObject = url ? (\n <CustomEmoji url={url} staticUrl={staticUrl} alt={emoji} />\n ) : (\n emoji\n );\n return (\n <Trans>\n {account} reacted to your post with {emojiObject}\n </Trans>\n );\n}\n\nconst contentText = {\n status: ({ account }) => <Trans>{account} published a post.</Trans>,\n reblog: ({\n count,\n account,\n postsCount,\n postType,\n components: { Subject },\n }) => (\n <Plural\n value={count}\n _1={\n <Plural\n value={postsCount}\n _1={\n <Select\n value={postType}\n _reply={<Trans>{account} boosted your reply.</Trans>}\n other={<Trans>{account} boosted your post.</Trans>}\n />\n }\n other={\n <Trans>\n {account} boosted {postsCount} of your posts.\n </Trans>\n }\n />\n }\n other={\n <Select\n value={postType}\n _reply={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted your reply.\n </Trans>\n }\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted your post.\n </Trans>\n }\n />\n }\n />\n ),\n follow: ({ account, count, components: { Subject } }) => (\n <Plural\n value={count}\n _1={<Trans>{account} followed you.</Trans>}\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n followed you.\n </Trans>\n }\n />\n ),\n follow_request: ({ account }) => (\n <Trans>{account} requested to follow you.</Trans>\n ),\n favourite: ({\n account,\n count,\n postsCount,\n postType,\n components: { Subject },\n }) => (\n <Plural\n value={count}\n _1={\n <Plural\n value={postsCount}\n _1={\n <Select\n value={postType}\n _reply={<Trans>{account} liked your reply.</Trans>}\n other={<Trans>{account} liked your post.</Trans>}\n />\n }\n other={\n <Trans>\n {account} liked {postsCount} of your posts.\n </Trans>\n }\n />\n }\n other={\n <Select\n value={postType}\n _reply={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n liked your reply.\n </Trans>\n }\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n liked your post.\n </Trans>\n }\n />\n }\n />\n ),\n poll: () => t`A poll you have voted in or created has ended.`,\n 'poll-self': () => t`A poll you have created has ended.`,\n 'poll-voted': () => t`A poll you have voted in has ended.`,\n update: () => t`A post you interacted with has been edited.`,\n 'favourite+reblog': ({\n count,\n account,\n postsCount,\n postType,\n components: { Subject },\n }) => (\n <Plural\n value={count}\n _1={\n <Plural\n value={postsCount}\n _1={\n <Select\n value={postType}\n _reply={<Trans>{account} boosted & liked your reply.</Trans>}\n other={<Trans>{account} boosted & liked your post.</Trans>}\n />\n }\n other={\n <Trans>\n {account} boosted & liked {postsCount} of your posts.\n </Trans>\n }\n />\n }\n other={\n <Select\n value={postType}\n _reply={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted & liked your reply.\n </Trans>\n }\n other={\n <Trans>\n <Subject clickable={count > 1}>\n <span title={count}>{shortenNumber(count)}</span> people\n </Subject>{' '}\n boosted & liked your post.\n </Trans>\n }\n />\n }\n />\n ),\n 'admin.sign_up': ({ account }) => <Trans>{account} signed up.</Trans>,\n 'admin.report': ({ account, targetAccount }) => (\n <Trans>\n {account} reported {targetAccount}\n </Trans>\n ),\n severed_relationships: ({ name }) => (\n <Trans>\n Lost connections with <i>{name}</i>.\n </Trans>\n ),\n moderation_warning: () => (\n <b>\n <Trans>Moderation warning</Trans>\n </b>\n ),\n emoji_reaction: emojiText,\n 'pleroma:emoji_reaction': emojiText,\n};\n\n// account_suspension, domain_block, user_domain_block\nconst SEVERED_RELATIONSHIPS_TEXT = {\n account_suspension: ({ from, targetName }) => (\n <Trans>\n An admin from <i>{from}</i> has suspended <i>{targetName}</i>, which means\n you can no longer receive updates from them or interact with them.\n </Trans>\n ),\n domain_block: ({ from, targetName, followersCount, followingCount }) => (\n <Trans>\n An admin from <i>{from}</i> has blocked <i>{targetName}</i>. Affected\n followers: {followersCount}, followings: {followingCount}.\n </Trans>\n ),\n user_domain_block: ({ targetName, followersCount, followingCount }) => (\n <Trans>\n You have blocked <i>{targetName}</i>. Removed followers: {followersCount},\n followings: {followingCount}.\n </Trans>\n ),\n};\n\nconst MODERATION_WARNING_TEXT = {\n none: msg`Your account has received a moderation warning.`,\n disable: msg`Your account has been disabled.`,\n mark_statuses_as_sensitive: msg`Some of your posts have been marked as sensitive.`,\n delete_statuses: msg`Some of your posts have been deleted.`,\n sensitive: msg`Your posts will be marked as sensitive from now on.`,\n silence: msg`Your account has been limited.`,\n suspend: msg`Your account has been suspended.`,\n};\n\nconst AVATARS_LIMIT = 30;\n\nfunction Notification({\n notification,\n instance,\n isStatic,\n disableContextMenu,\n}) {\n const { _ } = useLingui();\n const { masto } = api();\n const {\n id,\n status,\n account,\n report,\n event,\n moderation_warning,\n // Client-side grouped notification\n _ids,\n _accounts,\n _statuses,\n _groupKeys,\n // Server-side grouped notification\n sampleAccounts,\n notificationsCount,\n groupKey,\n } = notification;\n let { type } = notification;\n\n if (type === 'mention' && !status) {\n // Could be deleted\n return null;\n }\n\n // status = Attached when type of the notification is favourite, reblog, status, mention, poll, or update\n const actualStatus = status?.reblog || status;\n const actualStatusID = actualStatus?.id;\n\n const currentAccount = getCurrentAccountID();\n const isSelf = currentAccount === account?.id;\n const isVoted = status?.poll?.voted;\n const isReplyToOthers =\n !!status?.inReplyToAccountId &&\n status?.inReplyToAccountId !== currentAccount &&\n status?.account?.id === currentAccount;\n\n let favsCount = 0;\n let reblogsCount = 0;\n if (type === 'favourite+reblog') {\n if (_accounts) {\n for (const account of _accounts) {\n if (account._types?.includes('favourite')) {\n favsCount++;\n }\n if (account._types?.includes('reblog')) {\n reblogsCount++;\n }\n }\n }\n if (!reblogsCount && favsCount) type = 'favourite';\n if (!favsCount && reblogsCount) type = 'reblog';\n }\n\n let text;\n if (type === 'poll') {\n text = contentText[isSelf ? 'poll-self' : isVoted ? 'poll-voted' : 'poll'];\n } else if (contentText[type]) {\n text = contentText[type];\n } else {\n // Anticipate unhandled notification types, possibly from Mastodon forks or non-Mastodon instances\n // This surfaces the error to the user, hoping that users will report it\n text = t`[Unknown notification type: ${type}]`;\n }\n\n const Subject = ({ clickable, ...props }) =>\n clickable ? (\n <b tabIndex=\"0\" onClick={handleOpenGenericAccounts} {...props} />\n ) : (\n <b {...props} />\n );\n\n if (typeof text === 'function') {\n const count =\n _accounts?.length || sampleAccounts?.length || (account ? 1 : 0);\n const postsCount = _statuses?.length || (status ? 1 : 0);\n if (type === 'admin.report') {\n const targetAccount = report?.targetAccount;\n if (targetAccount) {\n text = text({\n account: <NameText account={account} showAvatar />,\n targetAccount: <NameText account={targetAccount} showAvatar />,\n });\n }\n } else if (type === 'severed_relationships') {\n const targetName = event?.targetName;\n if (targetName) {\n text = text({ name: targetName });\n }\n } else if (\n (type === 'emoji_reaction' || type === 'pleroma:emoji_reaction') &&\n notification.emoji\n ) {\n const emojiURL =\n notification.emoji_url || // This is string\n status?.emojis?.find?.(\n (emoji) =>\n emoji?.shortcode ===\n notification.emoji.replace(/^:/, '').replace(/:$/, ''),\n ); // Emoji object instead of string\n text = text({\n account: <NameText account={account} showAvatar />,\n emoji: notification.emoji,\n emojiURL,\n });\n } else {\n text = text({\n account: account ? (\n <NameText account={account} showAvatar />\n ) : (\n sampleAccounts?.[0] && (\n <NameText account={sampleAccounts[0]} showAvatar />\n )\n ),\n count,\n postsCount,\n postType: isReplyToOthers ? 'reply' : 'post',\n components: { Subject },\n });\n }\n }\n\n const formattedCreatedAt =\n notification.createdAt && new Date(notification.createdAt).toLocaleString();\n\n const genericAccountsHeading =\n {\n 'favourite+reblog': t`Boosted/Liked by…`,\n favourite: t`Liked by…`,\n reblog: t`Boosted by…`,\n follow: t`Followed by…`,\n }[type] || t`Accounts`;\n const handleOpenGenericAccounts = () => {\n states.showGenericAccounts = {\n heading: genericAccountsHeading,\n accounts: _accounts,\n showReactions: type === 'favourite+reblog',\n excludeRelationshipAttrs: type === 'follow' ? ['followedBy'] : [],\n postID: statusKey(actualStatusID, instance),\n };\n };\n\n console.debug('RENDER Notification', notification.id);\n\n const diffCount =\n notificationsCount > 0 && notificationsCount > sampleAccounts?.length;\n const expandAccounts = diffCount ? 'remote' : 'local';\n\n // If there's a status and filter action is 'hide', then the notification is hidden\n // TODO: Handle 'warn' action one day\n if (!!status?.filtered) {\n const isOwnPost = status?.account?.id === currentAccount;\n const filterInfo = isFiltered(status.filtered, 'notifications');\n if (!isSelf && !isOwnPost && filterInfo?.action === 'hide') {\n return null;\n }\n }\n\n return (\n <div\n class={`notification notification-${type}`}\n data-notification-id={_ids || id}\n data-group-key={_groupKeys?.join(' ') || groupKey}\n tabIndex=\"0\"\n >\n <div\n class={`notification-type notification-${type}`}\n title={formattedCreatedAt}\n >\n {type === 'favourite+reblog' ? (\n <>\n <Icon icon=\"rocket\" size=\"xl\" alt={type} class=\"reblog-icon\" />\n <Icon icon=\"heart\" size=\"xl\" alt={type} class=\"favourite-icon\" />\n </>\n ) : (\n <Icon\n icon={NOTIFICATION_ICONS[type] || 'notification'}\n size=\"xl\"\n alt={type}\n />\n )}\n </div>\n <div class=\"notification-content\">\n {type !== 'mention' && (\n <>\n <p>{text}</p>\n {type === 'follow_request' && (\n <FollowRequestButtons accountID={account.id} />\n )}\n {type === 'severed_relationships' && (\n <div>\n {SEVERED_RELATIONSHIPS_TEXT[event.type]({\n from: instance,\n ...event,\n })}\n <br />\n <a\n href={`https://${instance}/severed_relationships`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>\n Learn more <Icon icon=\"external\" size=\"s\" />\n </Trans>\n </a>\n .\n </div>\n )}\n {type === 'moderation_warning' && !!moderation_warning && (\n <div>\n {_(MODERATION_WARNING_TEXT[moderation_warning.action]())}\n <br />\n <a\n href={`/disputes/strikes/${moderation_warning.id}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>\n Learn more <Icon icon=\"external\" size=\"s\" />\n </Trans>\n </a>\n </div>\n )}\n </>\n )}\n {_accounts?.length > 1 && (\n <p class=\"avatars-stack\">\n {_accounts.slice(0, AVATARS_LIMIT).map((account) => (\n <Fragment key={account.id}>\n <a\n key={account.id}\n href={account.url}\n rel=\"noopener noreferrer\"\n class=\"account-avatar-stack\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = account;\n }}\n >\n <Avatar\n url={account.avatarStatic}\n size={\n _accounts.length <= 10\n ? 'xxl'\n : _accounts.length < 20\n ? 'xl'\n : 'l'\n }\n key={account.id}\n alt={`${account.displayName} @${account.acct}`}\n squircle={account?.bot}\n />\n {type === 'favourite+reblog' && (\n <div class=\"account-sub-icons\">\n {account._types.map((type) => (\n <Icon\n icon={NOTIFICATION_ICONS[type]}\n size=\"s\"\n class={`${type}-icon`}\n />\n ))}\n </div>\n )}\n </a>{' '}\n </Fragment>\n ))}\n {type === 'favourite+reblog' && expandAccounts === 'remote' ? (\n <button\n type=\"button\"\n class=\"small plain\"\n data-group-keys={_groupKeys?.join(' ')}\n onClick={() => {\n states.showGenericAccounts = {\n heading: genericAccountsHeading,\n fetchAccounts: async () => {\n const keyAccounts = await Promise.allSettled(\n _groupKeys.map(async (gKey) => {\n const iterator = masto.v2.notifications\n .$select(gKey)\n .accounts.list();\n return [gKey, (await iterator.next()).value];\n }),\n );\n const accounts = [];\n for (const keyAccount of keyAccounts) {\n const [key, _accounts] = keyAccount.value;\n const type = /^favourite/.test(key)\n ? 'favourite'\n : /^reblog/.test(key)\n ? 'reblog'\n : null;\n if (!type) continue;\n for (const account of _accounts) {\n const theAccount = accounts.find(\n (a) => a.id === account.id,\n );\n if (theAccount) {\n theAccount._types.push(type);\n } else {\n account._types = [type];\n accounts.push(account);\n }\n }\n }\n return {\n done: true,\n value: accounts,\n };\n },\n showReactions: true,\n postID: statusKey(actualStatusID, instance),\n };\n }}\n >\n <Icon icon=\"chevron-down\" />\n </button>\n ) : (\n <button\n type=\"button\"\n class=\"small plain\"\n onClick={handleOpenGenericAccounts}\n >\n {_accounts.length > AVATARS_LIMIT &&\n `+${_accounts.length - AVATARS_LIMIT}`}\n <Icon icon=\"chevron-down\" />\n </button>\n )}\n </p>\n )}\n {!_accounts?.length && sampleAccounts?.length > 1 && (\n <p class=\"avatars-stack\">\n {sampleAccounts.map((account) => (\n <Fragment key={account.id}>\n <a\n key={account.id}\n href={account.url}\n rel=\"noopener noreferrer\"\n class=\"account-avatar-stack\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = account;\n }}\n >\n <Avatar\n url={account.avatarStatic}\n size=\"xxl\"\n key={account.id}\n alt={`${account.displayName} @${account.acct}`}\n squircle={account?.bot}\n />\n {/* {type === 'favourite+reblog' && (\n <div class=\"account-sub-icons\">\n {account._types.map((type) => (\n <Icon\n icon={NOTIFICATION_ICONS[type]}\n size=\"s\"\n class={`${type}-icon`}\n />\n ))}\n </div>\n )} */}\n </a>{' '}\n </Fragment>\n ))}\n {notificationsCount > sampleAccounts.length && (\n <Link\n to={\n instance ? `/${instance}/s/${status.id}` : `/s/${status.id}`\n }\n class=\"button small plain centered\"\n >\n +{notificationsCount - sampleAccounts.length}\n <Icon icon=\"chevron-right\" />\n </Link>\n )}\n </p>\n )}\n {_statuses?.length > 1 && (\n <ul class=\"notification-group-statuses\">\n {_statuses.map((status) => (\n <li key={status.id}>\n <TruncatedLink\n class={`status-link status-type-${type}`}\n to={\n instance ? `/${instance}/s/${status.id}` : `/s/${status.id}`\n }\n >\n <Status\n status={status}\n size=\"s\"\n previewMode\n allowContextMenu\n />\n </TruncatedLink>\n </li>\n ))}\n </ul>\n )}\n {status && (!_statuses?.length || _statuses?.length <= 1) && (\n <TruncatedLink\n class={`status-link status-type-${type}`}\n to={\n instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`\n }\n onContextMenu={\n !disableContextMenu\n ? (e) => {\n const post = e.target.querySelector('.status');\n if (post) {\n // Fire a custom event to open the context menu\n if (e.metaKey) return;\n e.preventDefault();\n post.dispatchEvent(\n new MouseEvent('contextmenu', {\n clientX: e.clientX,\n clientY: e.clientY,\n }),\n );\n }\n }\n : undefined\n }\n >\n {isStatic ? (\n <Status\n status={actualStatus}\n size=\"s\"\n readOnly\n allowContextMenu\n />\n ) : (\n <Status\n statusID={actualStatusID}\n size=\"s\"\n readOnly\n allowContextMenu\n />\n )}\n </TruncatedLink>\n )}\n </div>\n </div>\n );\n}\n\nfunction TruncatedLink(props) {\n const ref = useTruncated();\n return <Link {...props} data-read-more={t`Read more →`} ref={ref} />;\n}\n\nexport default memo(Notification, (oldProps, newProps) => {\n return oldProps.notification?.id === newProps.notification?.id;\n});\n","import { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useLayoutEffect, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport { api } from '../utils/api';\nimport states from '../utils/states';\nimport {\n getAccountByAccessToken,\n getCurrentAccount,\n} from '../utils/store-utils';\nimport usePageVisibility from '../utils/usePageVisibility';\n\nimport Icon from './icon';\nimport Link from './link';\nimport Modal from './modal';\nimport Notification from './notification';\n\n{\n if ('serviceWorker' in navigator) {\n console.log('👂👂👂 Listen to message');\n navigator.serviceWorker.addEventListener('message', (event) => {\n console.log('💥💥💥 Message event', event);\n const { type, id, accessToken } = event?.data || {};\n if (type === 'notification') {\n states.routeNotification = {\n id,\n accessToken,\n };\n }\n });\n }\n}\n\nexport default memo(function NotificationService() {\n if (!('serviceWorker' in navigator)) return null;\n\n const snapStates = useSnapshot(states);\n const { routeNotification } = snapStates;\n\n console.log('🛎️ Notification service', routeNotification);\n\n const { id, accessToken } = routeNotification || {};\n const [showNotificationSheet, setShowNotificationSheet] = useState(false);\n\n useLayoutEffect(() => {\n if (!id || !accessToken) return;\n const { instance: currentInstance } = api();\n const { masto, instance } = api({\n accessToken,\n });\n console.log('API', { accessToken, currentInstance, instance });\n const sameInstance = currentInstance === instance;\n const account = accessToken\n ? getAccountByAccessToken(accessToken)\n : getCurrentAccount();\n (async () => {\n const notification = await masto.v1.notifications.$select(id).fetch();\n if (notification && account) {\n console.log('🛎️ Notification', { id, notification, account });\n const accountInstance = account.instanceURL;\n const { type, status, account: notificationAccount } = notification;\n const hasModal = !!document.querySelector('#modal-container > *');\n const isFollow = type === 'follow' && !!notificationAccount?.id;\n const hasAccount = !!notificationAccount?.id;\n const hasStatus = !!status?.id;\n if (isFollow && sameInstance) {\n // Show account sheet, can handle different instances\n states.showAccount = {\n account: notificationAccount,\n instance: accountInstance,\n };\n } else if (hasModal || !sameInstance || (hasAccount && hasStatus)) {\n // Show sheet of notification, if\n // - there is a modal open\n // - the notification is from another instance\n // - the notification has both account and status, gives choice for users to go to account or status\n setShowNotificationSheet({\n id,\n account,\n notification,\n sameInstance,\n });\n } else {\n if (hasStatus) {\n // Go to status page\n location.hash = `/${currentInstance}/s/${status.id}`;\n } else if (isFollow) {\n // Go to profile page\n location.hash = `/${currentInstance}/a/${notificationAccount.id}`;\n } else {\n // Go to notifications page\n location.hash = '/notifications';\n }\n }\n } else {\n console.warn('🛎️ Notification not found', id);\n }\n })();\n }, [id, accessToken]);\n\n // useLayoutEffect(() => {\n // // Listen to message from service worker\n // const handleMessage = (event) => {\n // console.log('💥💥💥 Message event', event);\n // const { type, id, accessToken } = event?.data || {};\n // if (type === 'notification') {\n // states.routeNotification = {\n // id,\n // accessToken,\n // };\n // }\n // };\n // console.log('👂👂👂 Listen to message');\n // navigator.serviceWorker.addEventListener('message', handleMessage);\n // return () => {\n // console.log('👂👂👂 Remove listen to message');\n // navigator.serviceWorker.removeEventListener('message', handleMessage);\n // };\n // }, []);\n\n useLayoutEffect(() => {\n if (navigator?.clearAppBadge) {\n navigator.clearAppBadge();\n }\n }, []);\n usePageVisibility((visible) => {\n if (visible && navigator?.clearAppBadge) {\n console.log('🔰 Clear app badge');\n navigator.clearAppBadge();\n }\n });\n\n const onClose = () => {\n setShowNotificationSheet(false);\n states.routeNotification = null;\n\n // If url is #/notifications?id=123, go to #/notifications\n if (/\\/notifications\\?id=/i.test(location.hash)) {\n location.hash = '/notifications';\n }\n };\n\n if (showNotificationSheet) {\n const { id, account, notification, sameInstance } = showNotificationSheet;\n return (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n onClose();\n }\n }}\n >\n <div class=\"sheet\" tabIndex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <b>\n <Trans>Notification</Trans>\n </b>\n </header>\n <main>\n {!sameInstance && (\n <p>\n <Trans>This notification is from your other account.</Trans>\n </p>\n )}\n <div\n class=\"notification-peek\"\n // style={{\n // pointerEvents: sameInstance ? '' : 'none',\n // }}\n onClick={(e) => {\n const { target } = e;\n // If button or links\n if (e.target.tagName === 'BUTTON' || e.target.tagName === 'A') {\n onClose();\n }\n }}\n >\n <Notification\n instance={account.instanceURL}\n notification={notification}\n isStatic\n />\n </div>\n <div\n style={{\n textAlign: 'end',\n }}\n >\n <Link to=\"/notifications\" class=\"button light\" onClick={onClose}>\n <span>\n <Trans>View all notifications</Trans>\n </span>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n </main>\n </div>\n </Modal>\n );\n }\n\n return null;\n});\n","import { t, Trans } from '@lingui/macro';\nimport { forwardRef } from 'preact/compat';\nimport { useImperativeHandle, useRef, useState } from 'preact/hooks';\nimport { useSearchParams } from 'react-router-dom';\n\nimport { api } from '../utils/api';\n\nimport Icon from './icon';\nimport Link from './link';\n\nconst SearchForm = forwardRef((props, ref) => {\n const { instance } = api();\n const [searchParams, setSearchParams] = useSearchParams();\n const [searchMenuOpen, setSearchMenuOpen] = useState(false);\n const [query, setQuery] = useState(searchParams.get('q') || '');\n const type = searchParams.get('type');\n const formRef = useRef(null);\n\n const searchFieldRef = useRef(null);\n useImperativeHandle(ref, () => ({\n setValue: (value) => {\n setQuery(value);\n },\n focus: () => {\n searchFieldRef.current.focus();\n },\n select: () => {\n searchFieldRef.current.select();\n },\n blur: () => {\n searchFieldRef.current.blur();\n },\n }));\n\n return (\n <form\n ref={formRef}\n class=\"search-popover-container\"\n onSubmit={(e) => {\n e.preventDefault();\n\n const isSearchPage = /\\/search/.test(location.hash);\n if (isSearchPage) {\n if (query) {\n const params = {\n q: query,\n };\n if (type) params.type = type; // Preserve type\n setSearchParams(params);\n } else {\n setSearchParams({});\n }\n } else {\n if (query) {\n location.hash = `/search?q=${encodeURIComponent(query)}${\n type ? `&type=${type}` : ''\n }`;\n } else {\n location.hash = `/search`;\n }\n }\n\n props?.onSubmit?.(e);\n }}\n >\n <input\n ref={searchFieldRef}\n value={query}\n name=\"q\"\n type=\"search\"\n // autofocus\n placeholder={t`Search`}\n dir=\"auto\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck=\"false\"\n onSearch={(e) => {\n if (!e.target.value) {\n setSearchParams({});\n }\n }}\n onInput={(e) => {\n setQuery(e.target.value);\n setSearchMenuOpen(true);\n }}\n onFocus={() => {\n setSearchMenuOpen(true);\n formRef.current\n ?.querySelector('.search-popover-item')\n ?.classList.add('focus');\n }}\n onBlur={() => {\n setTimeout(() => {\n setSearchMenuOpen(false);\n }, 100);\n formRef.current\n ?.querySelector('.search-popover-item.focus')\n ?.classList.remove('focus');\n }}\n onKeyDown={(e) => {\n const { key } = e;\n switch (key) {\n case 'Escape':\n setSearchMenuOpen(false);\n break;\n case 'Down':\n case 'ArrowDown':\n e.preventDefault();\n if (searchMenuOpen) {\n const focusItem = formRef.current.querySelector(\n '.search-popover-item.focus',\n );\n if (focusItem) {\n let nextItem = focusItem.nextElementSibling;\n while (nextItem && nextItem.hidden) {\n nextItem = nextItem.nextElementSibling;\n }\n if (nextItem) {\n nextItem.classList.add('focus');\n const siblings = Array.from(\n nextItem.parentElement.children,\n ).filter((el) => el !== nextItem);\n siblings.forEach((el) => {\n el.classList.remove('focus');\n });\n }\n } else {\n const firstItem = formRef.current.querySelector(\n '.search-popover-item',\n );\n if (firstItem) {\n firstItem.classList.add('focus');\n }\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n e.preventDefault();\n if (searchMenuOpen) {\n const focusItem = document.querySelector(\n '.search-popover-item.focus',\n );\n if (focusItem) {\n let prevItem = focusItem.previousElementSibling;\n while (prevItem && prevItem.hidden) {\n prevItem = prevItem.previousElementSibling;\n }\n if (prevItem) {\n prevItem.classList.add('focus');\n const siblings = Array.from(\n prevItem.parentElement.children,\n ).filter((el) => el !== prevItem);\n siblings.forEach((el) => {\n el.classList.remove('focus');\n });\n }\n } else {\n const lastItem = document.querySelector(\n '.search-popover-item:last-child',\n );\n if (lastItem) {\n lastItem.classList.add('focus');\n }\n }\n }\n break;\n case 'Enter':\n if (searchMenuOpen) {\n const focusItem = document.querySelector(\n '.search-popover-item.focus',\n );\n if (focusItem) {\n e.preventDefault();\n focusItem.click();\n }\n setSearchMenuOpen(false);\n props?.onSubmit?.(e);\n }\n break;\n }\n }}\n />\n <div class=\"search-popover\" hidden={!searchMenuOpen || !query}>\n {/* {!!query && (\n <Link\n to={`/search?q=${encodeURIComponent(query)}`}\n class=\"search-popover-item focus\"\n onClick={(e) => {\n props?.onSubmit?.(e);\n }}\n >\n <Icon icon=\"search\" />\n <span>{query}</span>\n </Link>\n )} */}\n {!!query &&\n [\n {\n label: (\n <Trans>\n {query}{' '}\n <small class=\"insignificant\">\n accounts, hashtags &amp; posts\n </small>\n </Trans>\n ),\n to: `/search?q=${encodeURIComponent(query)}`,\n top: !type && !/\\s/.test(query),\n hidden: !!type,\n },\n {\n label: (\n <Trans>\n Posts with <q>{query}</q>\n </Trans>\n ),\n to: `/search?q=${encodeURIComponent(query)}&type=statuses`,\n hidden: /^https?:/.test(query),\n top: /\\s/.test(query),\n icon: 'document',\n queryType: 'statuses',\n },\n {\n label: (\n <Trans>\n Posts tagged with <mark>#{query.replace(/^#/, '')}</mark>\n </Trans>\n ),\n to: `/${instance}/t/${query.replace(/^#/, '')}`,\n hidden:\n /^@/.test(query) || /^https?:/.test(query) || /\\s/.test(query),\n top: /^#/.test(query),\n type: 'link',\n icon: 'hashtag',\n queryType: 'hashtags',\n },\n {\n label: (\n <Trans>\n Look up <mark>{query}</mark>\n </Trans>\n ),\n to: `/${query}`,\n hidden: !/^https?:/.test(query),\n top: /^https?:/.test(query),\n type: 'link',\n },\n {\n label: (\n <Trans>\n Accounts with <q>{query}</q>\n </Trans>\n ),\n to: `/search?q=${encodeURIComponent(query)}&type=accounts`,\n icon: 'group',\n queryType: 'accounts',\n },\n ]\n .sort((a, b) => {\n if (type) {\n if (a.queryType === type) return -1;\n if (b.queryType === type) return 1;\n }\n if (a.top && !b.top) return -1;\n if (!a.top && b.top) return 1;\n return 0;\n })\n .filter(({ hidden }) => !hidden)\n .map(({ label, to, icon, type }, i) => (\n <Link\n to={to}\n class={`search-popover-item ${i === 0 ? 'focus' : ''}`}\n // hidden={hidden}\n onClick={(e) => {\n console.log('onClick', e);\n props?.onSubmit?.(e);\n }}\n >\n <Icon\n icon={icon || (type === 'link' ? 'arrow-right' : 'search')}\n class=\"more-insignificant\"\n />\n <span>{label}</span>{' '}\n </Link>\n ))}\n </div>\n </form>\n );\n});\n\nexport default SearchForm;\n","import './search-command.css';\n\nimport { memo } from 'preact/compat';\nimport { useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport SearchForm from './search-form';\n\nexport default memo(function SearchCommand({ onClose = () => {} }) {\n const [showSearch, setShowSearch] = useState(false);\n const searchFormRef = useRef(null);\n\n useHotkeys(\n ['Slash', '/'],\n (e) => {\n setShowSearch(true);\n setTimeout(() => {\n searchFormRef.current?.focus?.();\n searchFormRef.current?.select?.();\n }, 0);\n },\n {\n preventDefault: true,\n ignoreEventWhen: (e) => {\n const isSearchPage = /\\/search/.test(location.hash);\n const hasModal = !!document.querySelector('#modal-container > *');\n return isSearchPage || hasModal;\n },\n },\n );\n\n const closeSearch = () => {\n setShowSearch(false);\n onClose();\n };\n\n useHotkeys(\n 'esc',\n (e) => {\n searchFormRef.current?.blur?.();\n closeSearch();\n },\n {\n enabled: showSearch,\n enableOnFormTags: true,\n preventDefault: true,\n },\n );\n\n return (\n <div\n id=\"search-command-container\"\n hidden={!showSearch}\n onClick={(e) => {\n console.log(e);\n if (e.target === e.currentTarget) {\n closeSearch();\n }\n }}\n >\n <SearchForm\n ref={searchFormRef}\n onSubmit={() => {\n closeSearch();\n }}\n />\n </div>\n );\n});\n","import './shortcuts.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { MenuDivider } from '@szhsin/react-menu';\nimport { memo } from 'preact/compat';\nimport { useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useNavigate } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport { SHORTCUTS_META } from '../components/shortcuts-settings';\nimport { api } from '../utils/api';\nimport { getLists } from '../utils/lists';\nimport states from '../utils/states';\n\nimport AsyncText from './AsyncText';\nimport Icon from './icon';\nimport Link from './link';\nimport MenuLink from './menu-link';\nimport Menu2 from './menu2';\nimport SubMenu2 from './submenu2';\n\nfunction Shortcuts() {\n const { _ } = useLingui();\n const { instance } = api();\n const snapStates = useSnapshot(states);\n const { shortcuts, settings } = snapStates;\n\n if (!shortcuts.length) {\n return null;\n }\n if (\n settings.shortcutsViewMode === 'multi-column' ||\n (!settings.shortcutsViewMode && settings.shortcutsColumnsMode)\n ) {\n return null;\n }\n\n const menuRef = useRef();\n\n const hasLists = useRef(false);\n const formattedShortcuts = shortcuts\n .map((pin, i) => {\n const { type, ...data } = pin;\n if (!SHORTCUTS_META[type]) return null;\n let { id, path, title, subtitle, icon } = SHORTCUTS_META[type];\n\n if (typeof id === 'function') {\n id = id(data, i);\n }\n if (typeof path === 'function') {\n path = path(\n {\n ...data,\n instance: data.instance || instance,\n },\n i,\n );\n }\n if (typeof title === 'function') {\n title = title(data, i);\n } else {\n title = _(title);\n }\n if (typeof subtitle === 'function') {\n subtitle = subtitle(data, i);\n } else {\n subtitle = _(subtitle);\n }\n if (typeof icon === 'function') {\n icon = icon(data, i);\n }\n\n if (id === 'lists') {\n hasLists.current = true;\n }\n\n return {\n id,\n path,\n title,\n subtitle,\n icon,\n };\n })\n .filter(Boolean);\n\n const navigate = useNavigate();\n useHotkeys(['1', '2', '3', '4', '5', '6', '7', '8', '9'], (e, handler) => {\n const index = parseInt(handler.keys[0], 10) - 1;\n if (index < formattedShortcuts.length) {\n const { path } = formattedShortcuts[index];\n if (path) {\n navigate(path);\n menuRef.current?.closeMenu?.();\n }\n }\n });\n\n const [lists, setLists] = useState([]);\n\n return (\n <div id=\"shortcuts\">\n {snapStates.settings.shortcutsViewMode === 'tab-menu-bar' ? (\n <nav\n class=\"tab-bar\"\n onContextMenu={(e) => {\n e.preventDefault();\n states.showShortcutsSettings = true;\n }}\n >\n <ul>\n {formattedShortcuts.map(\n ({ id, path, title, subtitle, icon }, i) => {\n return (\n <li key={`${i}-${id}-${title}-${subtitle}-${path}`}>\n <Link\n class={subtitle ? 'has-subtitle' : ''}\n to={path}\n onClick={(e) => {\n if (e.target.classList.contains('is-active')) {\n e.preventDefault();\n const page = document.getElementById(`${id}-page`);\n console.log(id, page);\n if (page) {\n page.scrollTop = 0;\n const updatesButton =\n page.querySelector('.updates-button');\n if (updatesButton) {\n updatesButton.click();\n }\n }\n }\n }}\n >\n <Icon icon={icon} size=\"xl\" alt={title} />\n <span>\n <AsyncText>{title}</AsyncText>\n {subtitle && (\n <>\n <br />\n <small>{subtitle}</small>\n </>\n )}\n </span>\n </Link>\n </li>\n );\n },\n )}\n </ul>\n </nav>\n ) : (\n <Menu2\n instanceRef={menuRef}\n overflow=\"auto\"\n viewScroll=\"close\"\n menuClassName=\"glass-menu shortcuts-menu\"\n gap={8}\n position=\"anchor\"\n onMenuChange={(e) => {\n if (e.open && hasLists.current) {\n getLists().then(setLists);\n }\n }}\n menuButton={\n <button\n type=\"button\"\n id=\"shortcuts-button\"\n class=\"plain\"\n onContextMenu={(e) => {\n e.preventDefault();\n states.showShortcutsSettings = true;\n }}\n onTransitionStart={(e) => {\n // Close menu if the button disappears\n try {\n const { target } = e;\n if (getComputedStyle(target).pointerEvents === 'none') {\n menuRef.current?.closeMenu?.();\n }\n } catch (e) {}\n }}\n >\n <Icon icon=\"shortcut\" size=\"xl\" alt={t`Shortcuts`} />\n </button>\n }\n >\n {formattedShortcuts.map(({ id, path, title, subtitle, icon }, i) => {\n if (id === 'lists') {\n return (\n <SubMenu2\n menuClassName=\"glass-menu\"\n overflow=\"auto\"\n gap={-8}\n label={\n <>\n <Icon icon={icon} size=\"l\" />\n <span class=\"menu-grow\">\n <AsyncText>{title}</AsyncText>\n </span>\n <Icon icon=\"chevron-right\" />\n </>\n }\n >\n <MenuLink to=\"/l\">\n <span>\n <Trans>All Lists</Trans>\n </span>\n </MenuLink>\n <MenuDivider />\n {lists?.map((list) => (\n <MenuLink key={list.id} to={`/l/${list.id}`}>\n <span>{list.title}</span>\n </MenuLink>\n ))}\n </SubMenu2>\n );\n }\n\n return (\n <MenuLink\n to={path}\n key={`${i}-${id}-${title}-${subtitle}-${path}`}\n class=\"glass-menu-item\"\n >\n <Icon icon={icon} size=\"l\" />{' '}\n <span class=\"menu-grow\">\n <span>\n <AsyncText>{title}</AsyncText>\n </span>\n {subtitle && (\n <>\n {' '}\n <small class=\"more-insignificant\">{subtitle}</small>\n </>\n )}\n </span>\n <span class=\"menu-shortcut hide-until-focus-visible\">\n {i + 1}\n </span>\n </MenuLink>\n );\n })}\n </Menu2>\n )}\n </div>\n );\n}\n\nexport default memo(Shortcuts);\n","import { api } from './api';\nimport { extractTagsFromStatus, getFollowedTags } from './followed-tags';\nimport pmem from './pmem';\nimport { fetchRelationships } from './relationships';\nimport states, { saveStatus, statusKey } from './states';\nimport store from './store';\nimport supports from './supports';\n\nexport function groupBoosts(values) {\n let newValues = [];\n let boostStash = [];\n let serialBoosts = 0;\n for (let i = 0; i < values.length; i++) {\n const item = values[i];\n if (item.reblog && !item.account?.group) {\n boostStash.push(item);\n serialBoosts++;\n } else {\n newValues.push(item);\n if (serialBoosts < 3) {\n serialBoosts = 0;\n }\n }\n }\n // if boostStash is more than quarter of values\n // or if there are 3 or more boosts in a row\n if (\n values.length > 10 &&\n (boostStash.length > values.length / 4 || serialBoosts >= 3)\n ) {\n // if boostStash is more than 3 quarter of values\n const boostStashID = boostStash.map((status) => status.id);\n if (boostStash.length > (values.length * 3) / 4) {\n // insert boost array at the end of specialHome list\n newValues = [\n ...newValues,\n { id: boostStashID, items: boostStash, type: 'boosts' },\n ];\n } else {\n // insert boosts array in the middle of specialHome list\n const half = Math.floor(newValues.length / 2);\n newValues = [\n ...newValues.slice(0, half),\n {\n id: boostStashID,\n items: boostStash,\n type: 'boosts',\n },\n ...newValues.slice(half),\n ];\n }\n return newValues;\n } else {\n return values;\n }\n}\n\nexport function dedupeBoosts(items, instance) {\n const boostedStatusIDs = store.account.get('boostedStatusIDs') || {};\n const filteredItems = items.filter((item) => {\n if (!item.reblog) return true;\n const statusKey = `${instance}-${item.reblog.id}`;\n const boosterID = boostedStatusIDs[statusKey];\n if (boosterID && boosterID !== item.id) {\n console.warn(\n `🚫 Duplicate boost by ${item.account.displayName}`,\n item,\n item.reblog,\n );\n return false;\n } else {\n boostedStatusIDs[statusKey] = item.id;\n }\n return true;\n });\n // Limit to 50\n const keys = Object.keys(boostedStatusIDs);\n if (keys.length > 50) {\n keys.slice(0, keys.length - 50).forEach((key) => {\n delete boostedStatusIDs[key];\n });\n }\n store.account.set('boostedStatusIDs', boostedStatusIDs);\n return filteredItems;\n}\n\nexport function groupContext(items, instance) {\n const contexts = [];\n let contextIndex = 0;\n items.forEach((item) => {\n for (let i = 0; i < contexts.length; i++) {\n if (contexts[i].find((t) => t.id === item.id)) return;\n if (\n contexts[i].find((t) => t.id === item.inReplyToId) ||\n contexts[i].find((t) => t.inReplyToId === item.id)\n ) {\n contexts[i].push(item);\n return;\n }\n }\n const repliedItem = items.find((i) => i.id === item.inReplyToId);\n if (repliedItem) {\n contexts[contextIndex++] = [item, repliedItem];\n }\n });\n\n // Check for cross-item contexts\n // Merge contexts into one if they have a common item (same id)\n for (let i = 0; i < contexts.length; i++) {\n for (let j = i + 1; j < contexts.length; j++) {\n const commonItem = contexts[i].find((t) => contexts[j].includes(t));\n if (commonItem) {\n contexts[i] = [...contexts[i], ...contexts[j]];\n // Remove duplicate items\n contexts[i] = contexts[i].filter(\n (item, index, self) =>\n self.findIndex((t) => t.id === item.id) === index,\n );\n contexts.splice(j, 1);\n j--;\n }\n }\n }\n\n // Sort items by checking inReplyToId\n contexts.forEach((context) => {\n context.sort((a, b) => {\n if (!a.inReplyToId && !b.inReplyToId) {\n return new Date(a.createdAt) - new Date(b.createdAt);\n }\n if (a.inReplyToId === b.id) return 1;\n if (b.inReplyToId === a.id) return -1;\n if (!a.inReplyToId) return -1;\n if (!b.inReplyToId) return 1;\n return new Date(a.createdAt) - new Date(b.createdAt);\n });\n });\n\n // Tag items that has different author than first post's author\n contexts.forEach((context) => {\n const firstItemAccountID = context[0].account.id;\n context.forEach((item) => {\n if (item.account.id !== firstItemAccountID) {\n item._differentAuthor = true;\n }\n });\n });\n\n if (contexts.length) console.log('🧵 Contexts', contexts);\n\n const newItems = [];\n const appliedContextIndices = [];\n const inReplyToIds = [];\n items.forEach((item) => {\n if (item.reblog) {\n newItems.push(item);\n return;\n }\n for (let i = 0; i < contexts.length; i++) {\n if (contexts[i].find((t) => t.id === item.id)) {\n if (appliedContextIndices.includes(i)) return;\n const contextItems = contexts[i];\n contextItems.sort((a, b) => {\n const aDate = new Date(a.createdAt);\n const bDate = new Date(b.createdAt);\n return aDate - bDate;\n });\n const firstItemAccountID = contextItems[0].account.id;\n newItems.push({\n id: contextItems.map((i) => i.id),\n items: contextItems,\n type: contextItems.every((it) => it.account.id === firstItemAccountID)\n ? 'thread'\n : 'conversation',\n });\n appliedContextIndices.push(i);\n return;\n }\n }\n\n // PREPARE FOR REPLY HINTS\n if (item.inReplyToId && item.inReplyToAccountId !== item.account.id) {\n const sKey = statusKey(item.id, instance);\n if (!states.statusReply[sKey]) {\n // If it's a reply and not a thread\n inReplyToIds.push({\n sKey,\n inReplyToId: item.inReplyToId,\n });\n // queueMicrotask(async () => {\n // try {\n // const { masto } = api({ instance });\n // // const replyToStatus = await masto.v1.statuses\n // // .$select(item.inReplyToId)\n // // .fetch();\n // const replyToStatus = await fetchStatus(item.inReplyToId, masto);\n // saveStatus(replyToStatus, instance, {\n // skipThreading: true,\n // skipUnfurling: true,\n // });\n // states.statusReply[sKey] = {\n // id: replyToStatus.id,\n // instance,\n // };\n // } catch (e) {\n // // Silently fail\n // console.error(e);\n // }\n // });\n }\n }\n\n newItems.push(item);\n });\n\n // FETCH AND SHOW REPLY HINTS\n if (inReplyToIds?.length) {\n queueMicrotask(() => {\n const { masto } = api({ instance });\n console.log('REPLYHINT', inReplyToIds);\n\n // Fallback if batch fetch fails or returns nothing or not supported\n async function fallbackFetch() {\n for (let i = 0; i < inReplyToIds.length; i++) {\n const { sKey, inReplyToId } = inReplyToIds[i];\n try {\n const replyToStatus = await fetchStatus(inReplyToId, masto);\n saveStatus(replyToStatus, instance, {\n skipThreading: true,\n });\n states.statusReply[sKey] = {\n id: replyToStatus.id,\n instance,\n };\n // Pause 1s\n await new Promise((resolve) => setTimeout(resolve, 1000));\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n }\n }\n\n if (supports('@mastodon/fetch-multiple-statuses')) {\n // This is batch fetching yooo, woot\n // Limit 20, returns 422 if exceeded https://github.com/mastodon/mastodon/pull/27871\n const ids = inReplyToIds.map(({ inReplyToId }) => inReplyToId);\n (async () => {\n try {\n const replyToStatuses = await masto.v1.statuses.list({ id: ids });\n if (replyToStatuses?.length) {\n for (const replyToStatus of replyToStatuses) {\n saveStatus(replyToStatus, instance, {\n skipThreading: true,\n });\n const sKey = inReplyToIds.find(\n ({ inReplyToId }) => inReplyToId === replyToStatus.id,\n )?.sKey;\n if (sKey) {\n states.statusReply[sKey] = {\n id: replyToStatus.id,\n instance,\n };\n }\n }\n } else {\n fallbackFetch();\n }\n } catch (e) {\n // Silently fail\n console.error(e);\n fallbackFetch();\n }\n })();\n } else {\n fallbackFetch();\n }\n });\n }\n\n return newItems;\n}\n\nconst fetchStatus = pmem((statusID, masto) => {\n return masto.v1.statuses.$select(statusID).fetch();\n});\n\nexport async function assignFollowedTags(items, instance) {\n const followedTags = await getFollowedTags(); // [{name: 'tag'}, {...}]\n if (!followedTags.length) return;\n const { statusFollowedTags } = states;\n console.log('statusFollowedTags', statusFollowedTags);\n const statusWithFollowedTags = [];\n items.forEach((item) => {\n if (item.reblog) return;\n const { id, content, tags = [] } = item;\n const sKey = statusKey(id, instance);\n if (statusFollowedTags[sKey]?.length) return;\n const extractedTags = extractTagsFromStatus(content);\n if (!extractedTags.length && !tags.length) return;\n const itemFollowedTags = followedTags.reduce((acc, tag) => {\n if (\n extractedTags.some((t) => t.toLowerCase() === tag.name.toLowerCase()) ||\n tags.some((t) => t.name.toLowerCase() === tag.name.toLowerCase())\n ) {\n acc.push(tag.name);\n }\n return acc;\n }, []);\n if (itemFollowedTags.length) {\n // statusFollowedTags[sKey] = itemFollowedTags;\n statusWithFollowedTags.push({\n item,\n sKey,\n followedTags: itemFollowedTags,\n });\n }\n });\n\n if (statusWithFollowedTags.length) {\n const accounts = statusWithFollowedTags.map((s) => s.item.account);\n const relationships = await fetchRelationships(accounts);\n if (!relationships) return;\n\n statusWithFollowedTags.forEach((s) => {\n const { item, sKey, followedTags } = s;\n const r = relationships[item.account.id];\n if (r && !r.following) {\n statusFollowedTags[sKey] = followedTags;\n }\n });\n }\n}\n\nexport function clearFollowedTagsState() {\n states.statusFollowedTags = {};\n}\n","import { useLayoutEffect, useState } from 'preact/hooks';\n\nexport default function useScroll({\n scrollableRef,\n distanceFromStart = 1, // ratio of clientHeight/clientWidth\n distanceFromEnd = 1, // ratio of clientHeight/clientWidth\n scrollThresholdStart = 10,\n scrollThresholdEnd = 10,\n direction = 'vertical',\n distanceFromStartPx: _distanceFromStartPx,\n distanceFromEndPx: _distanceFromEndPx,\n} = {}) {\n const [scrollDirection, setScrollDirection] = useState(null);\n const [reachStart, setReachStart] = useState(false);\n const [reachEnd, setReachEnd] = useState(false);\n const [nearReachStart, setNearReachStart] = useState(false);\n const [nearReachEnd, setNearReachEnd] = useState(false);\n const isVertical = direction === 'vertical';\n\n useLayoutEffect(() => {\n const scrollableElement = scrollableRef.current;\n if (!scrollableElement) return {};\n let previousScrollStart = isVertical\n ? scrollableElement.scrollTop\n : scrollableElement.scrollLeft;\n\n function onScroll() {\n const {\n scrollTop,\n scrollLeft,\n scrollHeight,\n scrollWidth,\n clientHeight,\n clientWidth,\n } = scrollableElement;\n const scrollStart = isVertical ? scrollTop : scrollLeft;\n const scrollDimension = isVertical ? scrollHeight : scrollWidth;\n const clientDimension = isVertical ? clientHeight : clientWidth;\n const scrollDistance = Math.abs(scrollStart - previousScrollStart);\n const distanceFromStartPx =\n _distanceFromStartPx ||\n Math.min(\n clientDimension * distanceFromStart,\n scrollDimension,\n scrollStart,\n );\n const distanceFromEndPx =\n _distanceFromEndPx ||\n Math.min(\n clientDimension * distanceFromEnd,\n scrollDimension,\n scrollDimension - scrollStart - clientDimension,\n );\n\n if (\n scrollDistance >=\n (previousScrollStart < scrollStart\n ? scrollThresholdEnd\n : scrollThresholdStart)\n ) {\n setScrollDirection(previousScrollStart < scrollStart ? 'end' : 'start');\n previousScrollStart = scrollStart;\n }\n\n setReachStart(scrollStart <= 0);\n setReachEnd(scrollStart + clientDimension >= scrollDimension);\n setNearReachStart(scrollStart <= distanceFromStartPx);\n setNearReachEnd(\n scrollStart + clientDimension >= scrollDimension - distanceFromEndPx,\n );\n }\n\n scrollableElement.addEventListener('scroll', onScroll, { passive: true });\n\n return () => scrollableElement.removeEventListener('scroll', onScroll);\n }, [\n distanceFromStart,\n distanceFromEnd,\n scrollThresholdStart,\n scrollThresholdEnd,\n ]);\n\n return {\n scrollDirection,\n reachStart,\n reachEnd,\n nearReachStart,\n nearReachEnd,\n init: () => {\n if (scrollableRef.current) {\n scrollableRef.current.dispatchEvent(new Event('scroll'));\n }\n },\n };\n}\n","import { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks';\nimport { useThrottledCallback } from 'use-debounce';\n\nexport default function useScrollFn(\n {\n scrollableRef,\n distanceFromStart = 1, // ratio of clientHeight/clientWidth\n distanceFromEnd = 1, // ratio of clientHeight/clientWidth\n scrollThresholdStart = 10,\n scrollThresholdEnd = 10,\n direction = 'vertical',\n distanceFromStartPx: _distanceFromStartPx,\n distanceFromEndPx: _distanceFromEndPx,\n init,\n } = {},\n callback,\n deps,\n) {\n if (!callback) return;\n // const [scrollDirection, setScrollDirection] = useState(null);\n // const [reachStart, setReachStart] = useState(false);\n // const [reachEnd, setReachEnd] = useState(false);\n // const [nearReachStart, setNearReachStart] = useState(false);\n // const [nearReachEnd, setNearReachEnd] = useState(false);\n const isVertical = direction === 'vertical';\n const previousScrollStart = useRef(null);\n const scrollDirection = useRef(null);\n\n const onScroll = useThrottledCallback(() => {\n // let scrollDirection = null;\n let reachStart = false;\n let reachEnd = false;\n let nearReachStart = false;\n let nearReachEnd = false;\n\n const scrollableElement = scrollableRef.current;\n const {\n scrollTop,\n scrollLeft,\n scrollHeight,\n scrollWidth,\n clientHeight,\n clientWidth,\n } = scrollableElement;\n const scrollStart = isVertical ? scrollTop : scrollLeft;\n const scrollDimension = isVertical ? scrollHeight : scrollWidth;\n const clientDimension = isVertical ? clientHeight : clientWidth;\n const scrollDistance = Math.abs(scrollStart - previousScrollStart.current);\n const distanceFromStartPx =\n _distanceFromStartPx ||\n Math.min(\n clientDimension * distanceFromStart,\n scrollDimension,\n scrollStart,\n );\n const distanceFromEndPx =\n _distanceFromEndPx ||\n Math.min(\n clientDimension * distanceFromEnd,\n scrollDimension,\n scrollDimension - scrollStart - clientDimension,\n );\n\n if (\n scrollDistance >=\n (previousScrollStart.current < scrollStart\n ? scrollThresholdEnd\n : scrollThresholdStart)\n ) {\n // setScrollDirection(\n // previousScrollStart.current < scrollStart ? 'end' : 'start',\n // );\n scrollDirection.current =\n previousScrollStart.current < scrollStart ? 'end' : 'start';\n previousScrollStart.current = scrollStart;\n }\n\n // setReachStart(scrollStart <= 0);\n // setReachEnd(scrollStart + clientDimension >= scrollDimension);\n // setNearReachStart(scrollStart <= distanceFromStartPx);\n // setNearReachEnd(\n // scrollStart + clientDimension >= scrollDimension - distanceFromEndPx,\n // );\n reachStart = scrollStart <= 0;\n reachEnd = scrollStart + clientDimension >= scrollDimension;\n nearReachStart = scrollStart <= distanceFromStartPx;\n nearReachEnd =\n scrollStart + clientDimension >= scrollDimension - distanceFromEndPx;\n\n callback({\n scrollDirection: scrollDirection.current,\n reachStart,\n reachEnd,\n nearReachStart,\n nearReachEnd,\n });\n }, 500);\n\n useLayoutEffect(() => {\n const scrollableElement = scrollableRef.current;\n if (!scrollableElement) return {};\n previousScrollStart.current =\n scrollableElement[isVertical ? 'scrollTop' : 'scrollLeft'];\n\n scrollableElement.addEventListener('scroll', onScroll, { passive: true });\n\n return () => scrollableElement.removeEventListener('scroll', onScroll);\n }, [\n distanceFromStart,\n distanceFromEnd,\n scrollThresholdStart,\n scrollThresholdEnd,\n ...deps,\n ]);\n\n // useEffect(() => {\n // callback({\n // scrollDirection,\n // reachStart,\n // reachEnd,\n // nearReachStart,\n // nearReachEnd,\n // });\n // }, [\n // scrollDirection,\n // reachStart,\n // reachEnd,\n // nearReachStart,\n // nearReachEnd,\n // ...deps,\n // ]);\n\n useEffect(() => {\n if (init && scrollableRef.current) {\n queueMicrotask(() => {\n scrollableRef.current.dispatchEvent(new Event('scroll'));\n });\n }\n }, [init]);\n\n // return {\n // scrollDirection,\n // reachStart,\n // reachEnd,\n // nearReachStart,\n // nearReachEnd,\n // init: () => {\n // if (scrollableRef.current) {\n // scrollableRef.current.dispatchEvent(new Event('scroll'));\n // }\n // },\n // };\n}\n","import './media-post.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport FilterContext from '../utils/filter-context';\nimport { isFiltered } from '../utils/filters';\nimport states, { statusKey } from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\n\nimport Media from './media';\n\nfunction MediaPost({\n class: className,\n statusID,\n status,\n instance,\n parent,\n // allowFilters,\n onMediaClick,\n}) {\n let sKey = statusKey(statusID, instance);\n const snapStates = useSnapshot(states);\n if (!status) {\n status = snapStates.statuses[sKey] || snapStates.statuses[statusID];\n sKey = statusKey(status?.id, instance);\n }\n if (!status) {\n return null;\n }\n\n const {\n account: {\n acct,\n avatar,\n avatarStatic,\n id: accountId,\n url: accountURL,\n displayName,\n username,\n emojis: accountEmojis,\n bot,\n group,\n },\n id,\n repliesCount,\n reblogged,\n reblogsCount,\n favourited,\n favouritesCount,\n bookmarked,\n poll,\n muted,\n sensitive,\n spoilerText,\n visibility, // public, unlisted, private, direct\n language,\n editedAt,\n filtered,\n card,\n createdAt,\n inReplyToId,\n inReplyToAccountId,\n content,\n mentions,\n mediaAttachments,\n reblog,\n uri,\n url,\n emojis,\n // Non-API props\n _deleted,\n _pinned,\n // _filtered,\n } = status;\n\n if (!mediaAttachments?.length) {\n return null;\n }\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...status,\n });\n }\n };\n\n const currentAccount = useMemo(() => {\n return getCurrentAccountID();\n }, []);\n const isSelf = useMemo(() => {\n return currentAccount && currentAccount === accountId;\n }, [accountId, currentAccount]);\n\n const filterContext = useContext(FilterContext);\n const filterInfo = !isSelf && isFiltered(filtered, filterContext);\n\n if (filterInfo?.action === 'hide') {\n return null;\n }\n\n console.debug('RENDER Media post', id, status?.account.displayName);\n\n const hasSpoiler = sensitive;\n const readingExpandMedia = useMemo(() => {\n // default | show_all | hide_all\n const prefs = store.account.get('preferences') || {};\n return prefs['reading:expand:media']?.toLowerCase() || 'default';\n }, []);\n const showSpoilerMedia = readingExpandMedia === 'show_all';\n\n const Parent = parent || 'div';\n\n return mediaAttachments.map((media, i) => {\n const mediaKey = `${sKey}-${media.id}`;\n const filterTitleStr = filterInfo?.titlesStr;\n return (\n <Parent\n data-state-post-id={sKey}\n onMouseEnter={debugHover}\n key={mediaKey}\n data-spoiler-text={\n spoilerText || (sensitive ? t`Sensitive media` : undefined)\n }\n data-filtered-text={\n filterInfo\n ? filterTitleStr\n ? t`Filtered: ${filterTitleStr}`\n : t`Filtered`\n : undefined\n }\n class={`\n media-post\n ${filterInfo ? 'filtered' : ''}\n ${hasSpoiler ? 'has-spoiler' : ''}\n ${showSpoilerMedia ? 'show-media' : ''}\n `}\n >\n <Media\n class={className}\n media={media}\n lang={language}\n to={`/${instance}/s/${id}?media-only=${i + 1}`}\n onClick={\n onMediaClick ? (e) => onMediaClick(e, i, media, status) : undefined\n }\n />\n </Parent>\n );\n });\n}\n\nexport default memo(MediaPost);\n","import './nav-menu.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { ControlledMenu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { memo } from 'preact/compat';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport { useLongPress } from 'use-long-press';\nimport { useSnapshot } from 'valtio';\n\nimport { api } from '../utils/api';\nimport { getLists } from '../utils/lists';\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\nimport states from '../utils/states';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\nimport supports from '../utils/supports';\n\nimport Avatar from './avatar';\nimport Icon from './icon';\nimport MenuLink from './menu-link';\nimport SubMenu2 from './submenu2';\n\nfunction NavMenu(props) {\n const snapStates = useSnapshot(states);\n const { masto, instance, authenticated } = api();\n\n const [currentAccount, moreThanOneAccount] = useMemo(() => {\n const accounts = store.local.getJSON('accounts') || [];\n const acc =\n accounts.find((account) => account.info.id === getCurrentAccountID()) ||\n accounts[0];\n return [acc, accounts.length > 1];\n }, []);\n\n // Home = Following\n // But when in multi-column mode, Home becomes columns of anything\n // User may choose pin or not to pin Following\n // If user doesn't pin Following, we show it in the menu\n const showFollowing =\n (snapStates.settings.shortcutsViewMode === 'multi-column' ||\n (!snapStates.settings.shortcutsViewMode &&\n snapStates.settings.shortcutsColumnsMode)) &&\n !snapStates.shortcuts.find((pin) => pin.type === 'following');\n\n const bindLongPress = useLongPress(\n () => {\n states.showAccounts = true;\n },\n {\n threshold: 600,\n detect: 'touch',\n cancelOnMovement: true,\n },\n );\n\n const buttonRef = useRef();\n const [menuState, setMenuState] = useState(undefined);\n\n const boundingBoxPadding = safeBoundingBoxPadding([\n 0,\n 0,\n snapStates.settings.shortcutsViewMode === 'tab-menu-bar' ? 50 : 0,\n 0,\n ]);\n\n const mutesIterator = useRef();\n async function fetchMutes(firstLoad) {\n if (firstLoad || !mutesIterator.current) {\n mutesIterator.current = masto.v1.mutes.list({\n limit: 80,\n });\n }\n const results = await mutesIterator.current.next();\n return results;\n }\n\n const blocksIterator = useRef();\n async function fetchBlocks(firstLoad) {\n if (firstLoad || !blocksIterator.current) {\n blocksIterator.current = masto.v1.blocks.list({\n limit: 80,\n });\n }\n const results = await blocksIterator.current.next();\n return results;\n }\n\n const supportsLists = supports('@mastodon/lists');\n const [lists, setLists] = useState([]);\n useEffect(() => {\n if (!supportsLists) return;\n if (menuState === 'open') {\n getLists().then(setLists);\n }\n }, [menuState === 'open']);\n\n const buttonClickTS = useRef();\n return (\n <>\n <button\n ref={buttonRef}\n type=\"button\"\n class={`button plain nav-menu-button ${\n moreThanOneAccount ? 'with-avatar' : ''\n } ${menuState === 'open' ? 'active' : ''}`}\n style={{ position: 'relative' }}\n onClick={() => {\n buttonClickTS.current = Date.now();\n setMenuState((state) => (!state ? 'open' : undefined));\n }}\n onContextMenu={(e) => {\n e.preventDefault();\n states.showAccounts = true;\n }}\n {...bindLongPress()}\n >\n {moreThanOneAccount && (\n <Avatar\n url={\n currentAccount?.info?.avatar || currentAccount?.info?.avatarStatic\n }\n size=\"l\"\n squircle={currentAccount?.info?.bot}\n />\n )}\n <Icon icon=\"menu\" size={moreThanOneAccount ? 's' : 'l'} alt={t`Menu`} />\n </button>\n <ControlledMenu\n menuClassName=\"nav-menu\"\n state={menuState}\n anchorRef={buttonRef}\n onClose={() => {\n setMenuState(undefined);\n }}\n containerProps={{\n style: {\n zIndex: 10,\n },\n onClick: () => {\n if (Date.now() - buttonClickTS.current < 300) {\n return;\n }\n // setMenuState(undefined);\n },\n }}\n portal={{\n target: document.body,\n }}\n {...props}\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n align=\"center\"\n boundingBoxPadding={boundingBoxPadding}\n unmountOnClose\n >\n {!!snapStates.appVersion?.commitHash &&\n __COMMIT_HASH__ !== snapStates.appVersion.commitHash && (\n <div class=\"top-menu\">\n <MenuItem\n onClick={() => {\n const yes = confirm(t`Reload page now to update?`);\n if (yes) {\n (async () => {\n try {\n location.reload();\n } catch (e) {}\n })();\n }\n }}\n >\n <Icon icon=\"sparkles\" class=\"sparkle-icon\" size=\"l\" />{' '}\n <span>\n <Trans>New update available…</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n </div>\n )}\n <section>\n <MenuLink to=\"/\">\n <Icon icon=\"home\" size=\"l\" />{' '}\n <span>\n <Trans>Home</Trans>\n </span>\n </MenuLink>\n {authenticated ? (\n <>\n {showFollowing && (\n <MenuLink to=\"/following\">\n <Icon icon=\"following\" size=\"l\" />{' '}\n <span>\n <Trans id=\"following.title\">Following</Trans>\n </span>\n </MenuLink>\n )}\n <MenuLink to=\"/catchup\">\n <Icon icon=\"history2\" size=\"l\" />\n <span>\n <Trans>Catch-up</Trans>\n </span>\n </MenuLink>\n {supports('@mastodon/mentions') && (\n <MenuLink to=\"/mentions\">\n <Icon icon=\"at\" size=\"l\" />{' '}\n <span>\n <Trans>Mentions</Trans>\n </span>\n </MenuLink>\n )}\n <MenuLink to=\"/notifications\">\n <Icon icon=\"notification\" size=\"l\" />{' '}\n <span>\n <Trans>Notifications</Trans>\n </span>\n {snapStates.notificationsShowNew && (\n <sup title={t`New`} style={{ opacity: 0.5 }}>\n {' '}\n &bull;\n </sup>\n )}\n </MenuLink>\n <MenuDivider />\n {currentAccount?.info?.id && (\n <MenuLink to={`/${instance}/a/${currentAccount.info.id}`}>\n <Icon icon=\"user\" size=\"l\" />{' '}\n <span>\n <Trans>Profile</Trans>\n </span>\n </MenuLink>\n )}\n {lists?.length > 0 ? (\n <SubMenu2\n menuClassName=\"nav-submenu\"\n overflow=\"auto\"\n gap={-8}\n label={\n <>\n <Icon icon=\"list\" size=\"l\" />\n <span class=\"menu-grow\">\n <Trans>Lists</Trans>\n </span>\n <Icon icon=\"chevron-right\" />\n </>\n }\n >\n <MenuLink to=\"/l\">\n <span>\n <Trans>All Lists</Trans>\n </span>\n </MenuLink>\n {lists?.length > 0 && (\n <>\n <MenuDivider />\n {lists.map((list) => (\n <MenuLink key={list.id} to={`/l/${list.id}`}>\n <span>{list.title}</span>\n </MenuLink>\n ))}\n </>\n )}\n </SubMenu2>\n ) : (\n supportsLists && (\n <MenuLink to=\"/l\">\n <Icon icon=\"list\" size=\"l\" />\n <span>\n <Trans>Lists</Trans>\n </span>\n </MenuLink>\n )\n )}\n <MenuLink to=\"/b\">\n <Icon icon=\"bookmark\" size=\"l\" />{' '}\n <span>\n <Trans>Bookmarks</Trans>\n </span>\n </MenuLink>\n <SubMenu2\n menuClassName=\"nav-submenu\"\n overflow=\"auto\"\n gap={-8}\n label={\n <>\n <Icon icon=\"more\" size=\"l\" />\n <span class=\"menu-grow\">\n <Trans>More…</Trans>\n </span>\n <Icon icon=\"chevron-right\" />\n </>\n }\n >\n <MenuLink to=\"/f\">\n <Icon icon=\"heart\" size=\"l\" />{' '}\n <span>\n <Trans>Likes</Trans>\n </span>\n </MenuLink>\n <MenuLink to=\"/fh\">\n <Icon icon=\"hashtag\" size=\"l\" />{' '}\n <span>\n <Trans>Followed Hashtags</Trans>\n </span>\n </MenuLink>\n <MenuDivider />\n {supports('@mastodon/filters') && (\n <MenuLink to=\"/ft\">\n <Icon icon=\"filters\" size=\"l\" />{' '}\n <span>\n <Trans>Filters</Trans>\n </span>\n </MenuLink>\n )}\n <MenuItem\n onClick={() => {\n states.showGenericAccounts = {\n id: 'mute',\n heading: t`Muted users`,\n fetchAccounts: fetchMutes,\n excludeRelationshipAttrs: ['muting'],\n };\n }}\n >\n <Icon icon=\"mute\" size=\"l\" />{' '}\n <span>\n <Trans>Muted users…</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n states.showGenericAccounts = {\n id: 'block',\n heading: t`Blocked users`,\n fetchAccounts: fetchBlocks,\n excludeRelationshipAttrs: ['blocking'],\n };\n }}\n >\n <Icon icon=\"block\" size=\"l\" />{' '}\n <span>\n <Trans>Blocked users…</Trans>\n </span>\n </MenuItem>{' '}\n </SubMenu2>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n states.showAccounts = true;\n }}\n >\n <Icon icon=\"group\" size=\"l\" />{' '}\n <span>\n <Trans>Accounts…</Trans>\n </span>\n </MenuItem>\n </>\n ) : (\n <>\n <MenuDivider />\n <MenuLink to=\"/login\">\n <Icon icon=\"user\" size=\"l\" />{' '}\n <span>\n <Trans>Log in</Trans>\n </span>\n </MenuLink>\n </>\n )}\n </section>\n <section>\n <MenuDivider />\n <MenuLink to={`/search`}>\n <Icon icon=\"search\" size=\"l\" />{' '}\n <span>\n <Trans>Search</Trans>\n </span>\n </MenuLink>\n <MenuLink to={`/${instance}/trending`}>\n <Icon icon=\"chart\" size=\"l\" />{' '}\n <span>\n <Trans>Trending</Trans>\n </span>\n </MenuLink>\n <MenuLink to={`/${instance}/p/l`}>\n <Icon icon=\"building\" size=\"l\" />{' '}\n <span>\n <Trans>Local</Trans>\n </span>\n </MenuLink>\n <MenuLink to={`/${instance}/p`}>\n <Icon icon=\"earth\" size=\"l\" />{' '}\n <span>\n <Trans>Federated</Trans>\n </span>\n </MenuLink>\n {authenticated ? (\n <>\n <MenuDivider className=\"divider-grow\" />\n <MenuItem\n onClick={() => {\n states.showKeyboardShortcutsHelp = true;\n }}\n >\n <Icon icon=\"keyboard\" size=\"l\" />{' '}\n <span>\n <Trans>Keyboard shortcuts</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n states.showShortcutsSettings = true;\n }}\n >\n <Icon icon=\"shortcut\" size=\"l\" />{' '}\n <span>\n <Trans>Shortcuts / Columns…</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n states.showSettings = true;\n }}\n >\n <Icon icon=\"gear\" size=\"l\" />{' '}\n <span>\n <Trans>Settings…</Trans>\n </span>\n </MenuItem>\n </>\n ) : (\n <>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n states.showSettings = true;\n }}\n >\n <Icon icon=\"gear\" size=\"l\" />{' '}\n <span>\n <Trans>Settings…</Trans>\n </span>\n </MenuItem>\n </>\n )}\n </section>\n </ControlledMenu>\n </>\n );\n}\n\nexport default memo(NavMenu);\n","import { plural, t, Trans } from '@lingui/macro';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { InView } from 'react-intersection-observer';\nimport { useDebouncedCallback } from 'use-debounce';\nimport { useSnapshot } from 'valtio';\n\nimport FilterContext from '../utils/filter-context';\nimport { filteredItems, isFiltered } from '../utils/filters';\nimport isRTL from '../utils/is-rtl';\nimport showToast from '../utils/show-toast';\nimport states, { statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport { isMediaFirstInstance } from '../utils/store-utils';\nimport { groupBoosts, groupContext } from '../utils/timeline-utils';\nimport useInterval from '../utils/useInterval';\nimport usePageVisibility from '../utils/usePageVisibility';\nimport useScroll from '../utils/useScroll';\nimport useScrollFn from '../utils/useScrollFn';\n\nimport Icon from './icon';\nimport Link from './link';\nimport MediaPost from './media-post';\nimport NavMenu from './nav-menu';\nimport Status from './status';\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n};\n\nfunction Timeline({\n title,\n titleComponent,\n id,\n instance,\n emptyText,\n errorText,\n useItemID, // use statusID instead of status object, assuming it's already in states\n boostsCarousel,\n fetchItems = () => {},\n checkForUpdates = () => {},\n checkForUpdatesInterval = 15_000, // 15 seconds\n headerStart,\n headerEnd,\n timelineStart,\n // allowFilters,\n refresh,\n view,\n filterContext,\n showFollowedTags,\n showReplyParent,\n clearWhenRefresh,\n}) {\n const snapStates = useSnapshot(states);\n const [items, setItems] = useState([]);\n const [uiState, setUIState] = useState('start');\n const [showMore, setShowMore] = useState(false);\n const [showNew, setShowNew] = useState(false);\n const [visible, setVisible] = useState(true);\n const scrollableRef = useRef();\n\n console.debug('RENDER Timeline', id, refresh);\n __BENCHMARK.start(`timeline-${id}-load`);\n\n const mediaFirst = useMemo(() => isMediaFirstInstance(), []);\n\n const allowGrouping = view !== 'media';\n const loadItemsTS = useRef(0); // Ensures only one loadItems at a time\n const loadItems = useDebouncedCallback(\n (firstLoad) => {\n setShowNew(false);\n // if (uiState === 'loading') return;\n setUIState('loading');\n (async () => {\n try {\n const ts = (loadItemsTS.current = Date.now());\n let { done, value } = await fetchItems(firstLoad);\n if (ts !== loadItemsTS.current) return;\n if (Array.isArray(value)) {\n // Avoid grouping for pinned posts\n const [pinnedPosts, otherPosts] = value.reduce(\n (acc, item) => {\n if (item._pinned) {\n acc[0].push(item);\n } else {\n acc[1].push(item);\n }\n return acc;\n },\n [[], []],\n );\n value = otherPosts;\n if (allowGrouping) {\n if (boostsCarousel) {\n value = groupBoosts(value);\n }\n value = groupContext(value, instance);\n }\n if (pinnedPosts.length) {\n value = pinnedPosts.concat(value);\n }\n console.log(value);\n if (firstLoad) {\n setItems(value);\n } else {\n setItems((items) => [...items, ...value]);\n }\n if (!value.length) done = true;\n setShowMore(!done);\n } else {\n setShowMore(false);\n }\n setUIState('default');\n __BENCHMARK.end(`timeline-${id}-load`);\n } catch (e) {\n console.error(e);\n setUIState('error');\n if (firstLoad && !items.length && errorText) {\n showToast(errorText);\n }\n } finally {\n loadItems.cancel();\n }\n })();\n },\n 1_000,\n {\n leading: true,\n // trailing: false,\n },\n );\n\n const itemsSelector = '.timeline-item, .timeline-item-alt';\n\n const jRef = useHotkeys('j, shift+j', (_, handler) => {\n // focus on next status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let nextItem = allItems[activeItemIndex + 1];\n if (handler.shift) {\n // get next status that's not .timeline-item-alt\n nextItem = allItems.find(\n (item, index) =>\n index > activeItemIndex &&\n !item.classList.contains('timeline-item-alt'),\n );\n }\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const kRef = useHotkeys('k, shift+k', (_, handler) => {\n // focus on previous status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (handler.shift) {\n // get prev status that's not .timeline-item-alt\n prevItem = allItems.findLast(\n (item, index) =>\n index < activeItemIndex &&\n !item.classList.contains('timeline-item-alt'),\n );\n }\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const oRef = useHotkeys(['enter', 'o'], () => {\n // open active status\n const activeItem = document.activeElement;\n if (activeItem?.matches(itemsSelector)) {\n activeItem.click();\n }\n });\n\n const showNewPostsIndicator =\n items.length > 0 && uiState !== 'loading' && showNew;\n const handleLoadNewPosts = useCallback(() => {\n if (showNewPostsIndicator) loadItems(true);\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }, [loadItems, showNewPostsIndicator]);\n const dotRef = useHotkeys('.', handleLoadNewPosts);\n\n // const {\n // scrollDirection,\n // nearReachStart,\n // nearReachEnd,\n // reachStart,\n // reachEnd,\n // } = useScroll({\n // scrollableRef,\n // distanceFromEnd: 2,\n // scrollThresholdStart: 44,\n // });\n const headerRef = useRef();\n // const [hiddenUI, setHiddenUI] = useState(false);\n const [nearReachStart, setNearReachStart] = useState(false);\n useScrollFn(\n {\n scrollableRef,\n distanceFromEnd: 2,\n scrollThresholdStart: 44,\n },\n ({\n scrollDirection,\n nearReachStart,\n // nearReachEnd,\n reachStart,\n // reachEnd,\n }) => {\n // setHiddenUI(scrollDirection === 'end' && !nearReachEnd);\n if (headerRef.current) {\n const hiddenUI = scrollDirection === 'end' && !nearReachStart;\n headerRef.current.hidden = hiddenUI;\n }\n setNearReachStart(nearReachStart);\n if (reachStart) {\n loadItems(true);\n }\n // else if (nearReachEnd || (reachEnd && showMore)) {\n // loadItems();\n // }\n },\n [],\n );\n\n useEffect(() => {\n scrollableRef.current?.scrollTo({ top: 0 });\n loadItems(true);\n }, []);\n const firstLoad = useRef(true);\n useEffect(() => {\n if (firstLoad.current) {\n firstLoad.current = false;\n return;\n }\n if (clearWhenRefresh && items?.length) {\n loadItems.cancel?.();\n setItems([]);\n }\n loadItems(true);\n }, [clearWhenRefresh, refresh]);\n\n // useEffect(() => {\n // if (reachStart) {\n // loadItems(true);\n // }\n // }, [reachStart]);\n\n // useEffect(() => {\n // if (nearReachEnd || (reachEnd && showMore)) {\n // loadItems();\n // }\n // }, [nearReachEnd, showMore]);\n\n const prevView = useRef(view);\n useEffect(() => {\n if (prevView.current !== view) {\n prevView.current = view;\n setItems([]);\n }\n }, [view]);\n\n const loadOrCheckUpdates = useCallback(\n async ({ disableIdleCheck = false } = {}) => {\n const noPointers = scrollableRef.current\n ? getComputedStyle(scrollableRef.current).pointerEvents === 'none'\n : false;\n console.log('✨ Load or check updates', id, {\n autoRefresh: snapStates.settings.autoRefresh,\n scrollTop: scrollableRef.current.scrollTop,\n disableIdleCheck,\n idle: window.__IDLE__,\n inBackground: inBackground(),\n noPointers,\n });\n if (\n snapStates.settings.autoRefresh &&\n scrollableRef.current.scrollTop < 16 &&\n (disableIdleCheck || window.__IDLE__) &&\n !inBackground() &&\n !noPointers\n ) {\n console.log('✨ Load updates', id, snapStates.settings.autoRefresh);\n loadItems(true);\n } else {\n console.log('✨ Check updates', id, snapStates.settings.autoRefresh);\n const hasUpdate = await checkForUpdates();\n if (hasUpdate) {\n console.log('✨ Has new updates', id);\n setShowNew(true);\n }\n }\n },\n [id, loadItems, checkForUpdates, snapStates.settings.autoRefresh],\n );\n\n const lastHiddenTime = useRef();\n usePageVisibility(\n (visible) => {\n if (visible) {\n const timeDiff = Date.now() - lastHiddenTime.current;\n if (!lastHiddenTime.current || timeDiff > 1000 * 3) {\n // 3 seconds\n loadOrCheckUpdates({\n disableIdleCheck: true,\n });\n }\n } else {\n lastHiddenTime.current = Date.now();\n }\n setVisible(visible);\n },\n [checkForUpdates, loadOrCheckUpdates, snapStates.settings.autoRefresh],\n );\n\n // checkForUpdates interval\n useInterval(\n loadOrCheckUpdates,\n visible && !showNew\n ? checkForUpdatesInterval * (nearReachStart ? 1 : 2)\n : null,\n );\n\n // const hiddenUI = scrollDirection === 'end' && !nearReachStart;\n\n return (\n <FilterContext.Provider value={filterContext}>\n <div\n id={`${id}-page`}\n class={`deck-container ${\n mediaFirst ? 'deck-container-media-first' : ''\n }`}\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n oRef(node);\n dotRef(node);\n }}\n tabIndex=\"-1\"\n onClick={(e) => {\n // If click on timeline item, unhide header\n if (\n headerRef.current &&\n e.target.closest('.timeline-item, .timeline-item-alt')\n ) {\n setTimeout(() => {\n headerRef.current.hidden = false;\n }, 250);\n }\n }}\n >\n <div class=\"timeline-deck deck\">\n <header\n ref={headerRef}\n // hidden={hiddenUI}\n onClick={(e) => {\n if (!e.target.closest('a, button')) {\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }\n }}\n onDblClick={(e) => {\n if (!e.target.closest('a, button')) {\n loadItems(true);\n }\n }}\n class={uiState === 'loading' ? 'loading' : ''}\n >\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n {headerStart !== null && headerStart !== undefined ? (\n headerStart\n ) : (\n <Link to=\"/\" class=\"button plain home-button\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n )}\n </div>\n {title && (titleComponent ? titleComponent : <h1>{title}</h1>)}\n <div class=\"header-side\">\n {/* <Loader hidden={uiState !== 'loading'} /> */}\n {!!headerEnd && headerEnd}\n </div>\n </div>\n {showNewPostsIndicator && (\n <button\n class=\"updates-button shiny-pill\"\n type=\"button\"\n onClick={handleLoadNewPosts}\n >\n <Icon icon=\"arrow-up\" /> <Trans>New posts</Trans>\n </button>\n )}\n </header>\n {!!timelineStart && (\n <div\n class={`timeline-start ${uiState === 'loading' ? 'loading' : ''}`}\n >\n {timelineStart}\n </div>\n )}\n {!!items.length ? (\n <>\n <ul class={`timeline ${view ? `timeline-${view}` : ''}`}>\n {items.map((status) => (\n <TimelineItem\n status={status}\n instance={instance}\n useItemID={useItemID}\n // allowFilters={allowFilters}\n filterContext={filterContext}\n key={status.id + status?._pinned + view}\n view={view}\n showFollowedTags={showFollowedTags}\n showReplyParent={showReplyParent}\n mediaFirst={mediaFirst}\n />\n ))}\n {showMore &&\n uiState === 'loading' &&\n (view === 'media' ? null : (\n <>\n <li\n style={{\n height: '20vh',\n }}\n >\n <Status skeleton mediaFirst={mediaFirst} />\n </li>\n <li\n style={{\n height: '25vh',\n }}\n >\n <Status skeleton mediaFirst={mediaFirst} />\n </li>\n </>\n ))}\n </ul>\n {uiState === 'default' &&\n (showMore ? (\n <InView\n root={scrollableRef.current}\n rootMargin={`0px 0px ${screen.height * 1.5}px 0px`}\n onChange={(inView) => {\n if (inView) {\n loadItems();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n onClick={() => loadItems()}\n style={{ marginBlockEnd: '6em' }}\n >\n <Trans>Show more…</Trans>\n </button>\n </InView>\n ) : (\n <p class=\"ui-state insignificant\">\n <Trans>The end.</Trans>\n </p>\n ))}\n </>\n ) : uiState === 'loading' ? (\n <ul class=\"timeline\">\n {Array.from({ length: 5 }).map((_, i) =>\n view === 'media' ? (\n <div\n style={{\n height: '50vh',\n }}\n />\n ) : (\n <li key={i}>\n <Status skeleton mediaFirst={mediaFirst} />\n </li>\n ),\n )}\n </ul>\n ) : (\n uiState !== 'error' &&\n uiState !== 'start' && <p class=\"ui-state\">{emptyText}</p>\n )}\n {uiState === 'error' && (\n <p class=\"ui-state\">\n {errorText}\n <br />\n <br />\n <button type=\"button\" onClick={() => loadItems(!items.length)}>\n <Trans>Try again</Trans>\n </button>\n </p>\n )}\n </div>\n </div>\n </FilterContext.Provider>\n );\n}\n\nconst TimelineItem = memo(\n ({\n status,\n instance,\n useItemID,\n // allowFilters,\n filterContext,\n view,\n showFollowedTags,\n showReplyParent,\n mediaFirst,\n }) => {\n console.debug('RENDER TimelineItem', status.id);\n const { id: statusID, reblog, items, type, _pinned } = status;\n if (_pinned) useItemID = false;\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n\n if (items) {\n let fItems = filteredItems(items, filterContext);\n let title = '';\n if (type === 'boosts') {\n title = plural(fItems.length, {\n one: '# Boost',\n other: '# Boosts',\n });\n } else if (type === 'pinned') {\n title = t`Pinned posts`;\n }\n const isCarousel = type === 'boosts' || type === 'pinned';\n if (isCarousel) {\n const filteredItemsIDs = new Set();\n // Here, we don't hide filtered posts, but we sort them last\n fItems.sort((a, b) => {\n // if (a._filtered && !b._filtered) {\n // return 1;\n // }\n // if (!a._filtered && b._filtered) {\n // return -1;\n // }\n const aFiltered = isFiltered(a.filtered, filterContext);\n const bFiltered = isFiltered(b.filtered, filterContext);\n if (aFiltered) filteredItemsIDs.add(a.id);\n if (bFiltered) filteredItemsIDs.add(b.id);\n if (aFiltered && !bFiltered) {\n return 1;\n }\n if (!aFiltered && bFiltered) {\n return -1;\n }\n return 0;\n });\n\n if (filteredItemsIDs.size >= 2) {\n const GROUP_SIZE = 5;\n // If 2 or more, group filtered items into one, limit to GROUP_SIZE in a group\n const unfiltered = [];\n const filtered = [];\n fItems.forEach((item) => {\n if (filteredItemsIDs.has(item.id)) {\n filtered.push(item);\n } else {\n unfiltered.push(item);\n }\n });\n const filteredItems = [];\n for (let i = 0; i < filtered.length; i += GROUP_SIZE) {\n filteredItems.push({\n _grouped: true,\n posts: filtered.slice(i, i + GROUP_SIZE),\n });\n }\n fItems = unfiltered.concat(filteredItems);\n }\n\n return (\n <li key={`timeline-${statusID}`} class=\"timeline-item-carousel\">\n <StatusCarousel title={title} class={`${type}-carousel`}>\n {fItems.map((item) => {\n const { id: statusID, reblog, _pinned, _grouped } = item;\n if (_grouped) {\n return (\n <li key={statusID} class=\"timeline-item-carousel-group\">\n {item.posts.map((item) => {\n const { id: statusID, reblog, _pinned } = item;\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n if (_pinned) useItemID = false;\n return (\n <Link\n class=\"status-carousel-link timeline-item-alt\"\n to={url}\n >\n {useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n size=\"s\"\n />\n ) : (\n <Status\n status={item}\n instance={instance}\n size=\"s\"\n />\n )}\n </Link>\n );\n })}\n </li>\n );\n }\n\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n if (_pinned) useItemID = false;\n return (\n <li key={statusID}>\n <Link\n class=\"status-carousel-link timeline-item-alt\"\n to={url}\n >\n {useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n size=\"s\"\n contentTextWeight\n enableCommentHint\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n ) : (\n <Status\n status={item}\n instance={instance}\n size=\"s\"\n contentTextWeight\n enableCommentHint\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n )}\n </Link>\n </li>\n );\n })}\n </StatusCarousel>\n </li>\n );\n }\n const manyItems = fItems.length > 3;\n return fItems.map((item, i) => {\n const { id: statusID, _differentAuthor } = item;\n const url = instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`;\n const isMiddle = i > 0 && i < fItems.length - 1;\n const isSpoiler = item.sensitive && !!item.spoilerText;\n const showCompact =\n (!_differentAuthor && isSpoiler && i > 0) ||\n (manyItems &&\n isMiddle &&\n (type === 'thread' ||\n (type === 'conversation' &&\n !_differentAuthor &&\n !fItems[i - 1]._differentAuthor &&\n !fItems[i + 1]._differentAuthor)));\n const isStart = i === 0;\n const isEnd = i === fItems.length - 1;\n return (\n <li\n key={`timeline-${statusID}`}\n class={`timeline-item-container timeline-item-container-type-${type} timeline-item-container-${\n isStart ? 'start' : isEnd ? 'end' : 'middle'\n } ${_differentAuthor ? 'timeline-item-diff-author' : ''}`}\n >\n <Link class=\"status-link timeline-item\" to={url}>\n {showCompact ? (\n <TimelineStatusCompact\n status={item}\n instance={instance}\n filterContext={filterContext}\n />\n ) : useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n enableCommentHint={isEnd}\n showFollowedTags={showFollowedTags}\n // allowFilters={allowFilters}\n />\n ) : (\n <Status\n status={item}\n instance={instance}\n enableCommentHint={isEnd}\n showFollowedTags={showFollowedTags}\n // allowFilters={allowFilters}\n />\n )}\n </Link>\n </li>\n );\n });\n }\n\n const itemKey = `timeline-${statusID + _pinned}`;\n\n if (view === 'media') {\n return useItemID ? (\n <MediaPost\n class=\"timeline-item\"\n parent=\"li\"\n key={itemKey}\n statusID={statusID}\n instance={instance}\n // allowFilters={allowFilters}\n />\n ) : (\n <MediaPost\n class=\"timeline-item\"\n parent=\"li\"\n key={itemKey}\n status={status}\n instance={instance}\n // allowFilters={allowFilters}\n />\n );\n }\n\n return (\n <li key={itemKey}>\n <Link class=\"status-link timeline-item\" to={url}>\n {useItemID ? (\n <Status\n statusID={statusID}\n instance={instance}\n enableCommentHint\n showFollowedTags={showFollowedTags}\n showReplyParent={showReplyParent}\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n ) : (\n <Status\n status={status}\n instance={instance}\n enableCommentHint\n showFollowedTags={showFollowedTags}\n showReplyParent={showReplyParent}\n // allowFilters={allowFilters}\n mediaFirst={mediaFirst}\n />\n )}\n </Link>\n </li>\n );\n },\n (oldProps, newProps) => {\n const oldID = (oldProps.status?.id || '').toString();\n const newID = (newProps.status?.id || '').toString();\n return (\n oldID === newID &&\n oldProps.instance === newProps.instance &&\n oldProps.view === newProps.view\n );\n },\n);\n\nfunction StatusCarousel({ title, class: className, children }) {\n const carouselRef = useRef();\n // const { reachStart, reachEnd, init } = useScroll({\n // scrollableRef: carouselRef,\n // direction: 'horizontal',\n // });\n const startButtonRef = useRef();\n const endButtonRef = useRef();\n // useScrollFn(\n // {\n // scrollableRef: carouselRef,\n // direction: 'horizontal',\n // init: true,\n // },\n // ({ reachStart, reachEnd }) => {\n // if (startButtonRef.current) startButtonRef.current.disabled = reachStart;\n // if (endButtonRef.current) endButtonRef.current.disabled = reachEnd;\n // },\n // [],\n // );\n // useEffect(() => {\n // init?.();\n // }, []);\n\n const [render, setRender] = useState(false);\n useEffect(() => {\n setTimeout(() => {\n setRender(true);\n }, 1);\n }, []);\n\n return (\n <div class={`status-carousel ${className}`}>\n <header>\n <h3>{title}</h3>\n <span>\n <button\n ref={startButtonRef}\n type=\"button\"\n class=\"small plain2\"\n // disabled={reachStart}\n onClick={() => {\n const left =\n Math.min(320, carouselRef.current?.offsetWidth) *\n (isRTL() ? 1 : -1);\n carouselRef.current?.scrollBy({\n left,\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"chevron-left\" alt={t`Previous`} />\n </button>{' '}\n <button\n ref={endButtonRef}\n type=\"button\"\n class=\"small plain2\"\n // disabled={reachEnd}\n onClick={() => {\n const left =\n Math.min(320, carouselRef.current?.offsetWidth) *\n (isRTL() ? -1 : 1);\n carouselRef.current?.scrollBy({\n left,\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"chevron-right\" alt={t`Next`} />\n </button>\n </span>\n </header>\n <ul ref={carouselRef}>\n <InView\n class=\"status-carousel-beacon\"\n onChange={(inView) => {\n if (startButtonRef.current)\n startButtonRef.current.disabled = inView;\n }}\n />\n {children[0]}\n {render && children.slice(1)}\n <InView\n class=\"status-carousel-beacon\"\n onChange={(inView) => {\n if (endButtonRef.current) endButtonRef.current.disabled = inView;\n }}\n />\n </ul>\n </div>\n );\n}\n\nfunction TimelineStatusCompact({ status, instance, filterContext }) {\n const snapStates = useSnapshot(states);\n const { id, visibility, language } = status;\n const statusPeekText = statusPeek(status);\n const sKey = statusKey(id, instance);\n const filterInfo = isFiltered(status.filtered, filterContext);\n return (\n <article\n class={`status compact-thread ${\n visibility === 'direct' ? 'visibility-direct' : ''\n }`}\n tabindex=\"-1\"\n >\n {!!snapStates.statusThreadNumber[sKey] ? (\n <div class=\"status-thread-badge\">\n <Icon icon=\"thread\" size=\"s\" alt={t`Thread`} />\n {snapStates.statusThreadNumber[sKey]\n ? ` ${snapStates.statusThreadNumber[sKey]}/X`\n : ''}\n </div>\n ) : (\n <div class=\"status-thread-badge\">\n <Icon icon=\"thread\" size=\"s\" alt={t`Thread`} />\n </div>\n )}\n <div\n class=\"content-compact\"\n title={statusPeekText}\n lang={language}\n dir=\"auto\"\n >\n {!!filterInfo ? (\n <b\n class=\"status-filtered-badge badge-meta horizontal\"\n title={filterInfo?.titlesStr || ''}\n >\n {filterInfo?.titlesStr ? (\n <Trans>\n <span>Filtered</span>: <span>{filterInfo.titlesStr}</span>\n </Trans>\n ) : (\n <span>\n <Trans>Filtered</Trans>\n </span>\n )}\n </b>\n ) : (\n <>\n {statusPeekText}\n {status.sensitive && status.spoilerText && (\n <>\n {' '}\n <span class=\"spoiler-badge\">\n <Icon icon=\"eye-close\" size=\"s\" alt={t`Content warning`} />\n </span>\n </>\n )}\n </>\n )}\n </div>\n </article>\n );\n}\n\nfunction inBackground() {\n return !!document.querySelector('.deck-backdrop, #modal-container > *');\n}\n\nexport default Timeline;\n","import { t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { MenuItem } from '@szhsin/react-menu';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport AccountInfo from '../components/account-info';\nimport EmojiText from '../components/emoji-text';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Menu2 from '../components/menu2';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport pmem from '../utils/pmem';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport { isMediaFirstInstance } from '../utils/store-utils';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\nconst MIN_YEAR = 1983;\nconst MIN_YEAR_MONTH = `${MIN_YEAR}-01`; // Birth of the Internet\n\nconst supportsInputMonth = (() => {\n try {\n const input = document.createElement('input');\n input.setAttribute('type', 'month');\n return input.type === 'month';\n } catch (e) {\n return false;\n }\n})();\n\nasync function _isSearchEnabled(instance) {\n const { masto } = api({ instance });\n const results = await masto.v2.search.fetch({\n q: 'from:me',\n type: 'statuses',\n limit: 1,\n });\n return !!results?.statuses?.length;\n}\nconst isSearchEnabled = pmem(_isSearchEnabled);\n\nfunction AccountStatuses() {\n const snapStates = useSnapshot(states);\n const { id, ...params } = useParams();\n const [searchParams, setSearchParams] = useSearchParams();\n const month = searchParams.get('month');\n const excludeReplies = !searchParams.get('replies');\n const excludeBoosts = !!searchParams.get('boosts');\n const tagged = searchParams.get('tagged');\n const media = !!searchParams.get('media');\n const { masto, instance, authenticated } = api({ instance: params.instance });\n const { masto: currentMasto, instance: currentInstance } = api();\n const accountStatusesIterator = useRef();\n\n const allSearchParams = [month, excludeReplies, excludeBoosts, tagged, media];\n const [account, setAccount] = useState();\n const searchOffsetRef = useRef(0);\n useEffect(() => {\n searchOffsetRef.current = 0;\n }, allSearchParams);\n\n const mediaFirst = useMemo(() => isMediaFirstInstance(), []);\n\n const sameCurrentInstance = useMemo(\n () => instance === currentInstance,\n [instance, currentInstance],\n );\n const [searchEnabled, setSearchEnabled] = useState(false);\n useEffect(() => {\n // Only enable for current logged-in instance\n // Most remote instances don't allow unauthenticated searches\n if (!sameCurrentInstance) return;\n if (!account?.acct) return;\n (async () => {\n const enabled = await isSearchEnabled(instance);\n console.log({ enabled });\n setSearchEnabled(enabled);\n })();\n }, [instance, sameCurrentInstance, account?.acct]);\n\n async function fetchAccountStatuses(firstLoad) {\n const isValidMonth = /^\\d{4}-[01]\\d$/.test(month);\n const isValidYear = month?.split?.('-')?.[0] >= MIN_YEAR;\n if (isValidMonth && isValidYear) {\n if (!account) {\n return {\n value: [],\n done: true,\n };\n }\n const [_year, _month] = month.split('-');\n const monthIndex = parseInt(_month, 10) - 1;\n // YYYY-MM (no day)\n // Search options:\n // - from:account\n // - after:YYYY-MM-DD (non-inclusive)\n // - before:YYYY-MM-DD (non-inclusive)\n\n // Last day of previous month\n const after = new Date(_year, monthIndex, 0);\n const afterStr = `${after.getFullYear()}-${(after.getMonth() + 1)\n .toString()\n .padStart(2, '0')}-${after.getDate().toString().padStart(2, '0')}`;\n // First day of next month\n const before = new Date(_year, monthIndex + 1, 1);\n const beforeStr = `${before.getFullYear()}-${(before.getMonth() + 1)\n .toString()\n .padStart(2, '0')}-${before.getDate().toString().padStart(2, '0')}`;\n console.log({\n month,\n _year,\n _month,\n monthIndex,\n after,\n before,\n afterStr,\n beforeStr,\n });\n\n let limit;\n if (firstLoad) {\n limit = LIMIT + 1;\n searchOffsetRef.current = 0;\n } else {\n limit = LIMIT + searchOffsetRef.current + 1;\n searchOffsetRef.current += LIMIT;\n }\n\n const searchResults = await masto.v2.search.fetch({\n q: `from:${account.acct} after:${afterStr} before:${beforeStr}`,\n type: 'statuses',\n limit,\n offset: searchOffsetRef.current,\n });\n if (searchResults?.statuses?.length) {\n const value = searchResults.statuses.slice(0, LIMIT);\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n const done = searchResults.statuses.length <= LIMIT;\n return { value, done };\n } else {\n return { value: [], done: true };\n }\n }\n\n let results = [];\n if (firstLoad) {\n const { value } = await masto.v1.accounts\n .$select(id)\n .statuses.list({\n pinned: true,\n })\n .next();\n if (value?.length && !tagged && !media) {\n const pinnedStatuses = value.map((status) => {\n saveStatus(status, instance);\n return {\n ...status,\n _pinned: true,\n };\n });\n if (pinnedStatuses.length >= 3) {\n const pinnedStatusesIds = pinnedStatuses.map((status) => status.id);\n results.push({\n id: pinnedStatusesIds,\n items: pinnedStatuses,\n type: 'pinned',\n });\n } else {\n results.push(...pinnedStatuses);\n }\n }\n }\n if (firstLoad || !accountStatusesIterator.current) {\n accountStatusesIterator.current = masto.v1.accounts\n .$select(id)\n .statuses.list({\n limit: LIMIT,\n exclude_replies: excludeReplies,\n exclude_reblogs: excludeBoosts,\n only_media: media || undefined,\n tagged,\n });\n }\n const { value, done } = await accountStatusesIterator.current.next();\n if (value?.length) {\n // Check if value is same as pinned post (results)\n // If the index for every post is the same, means API might not support pinned posts\n if (results.length) {\n let pinnedStatusesIds = [];\n if (results[0]?.type === 'pinned') {\n pinnedStatusesIds = results[0].id;\n } else {\n pinnedStatusesIds = results\n .filter((status) => status._pinned)\n .map((status) => status.id);\n }\n const containsAllPinned = pinnedStatusesIds.every((postId) =>\n value.some((status) => status.id === postId),\n );\n if (containsAllPinned) {\n // Remove pinned posts\n results = [];\n }\n }\n\n results.push(...value);\n\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n value: results,\n done,\n };\n }\n\n const [featuredTags, setFeaturedTags] = useState([]);\n const { i18n } = useLingui();\n let title = t`Account posts`;\n if (account?.acct) {\n const acctDisplay = /@/.test(account.acct) ? '' : '@' + account.acct;\n const accountDisplay = account?.displayName\n ? `${account.displayName} (${acctDisplay})`\n : `${acctDisplay}`;\n if (!excludeReplies) {\n title = t`${accountDisplay} (+ Replies)`;\n } else if (excludeBoosts) {\n title = t`${accountDisplay} (- Boosts)`;\n } else if (tagged) {\n title = t`${accountDisplay} (#${tagged})`;\n } else if (media) {\n title = t`${accountDisplay} (Media)`;\n } else if (month) {\n const monthYear = new Date(month).toLocaleString(i18n.locale, {\n month: 'long',\n year: 'numeric',\n });\n title = t`${accountDisplay} (${monthYear})`;\n } else {\n title = accountDisplay;\n }\n }\n useTitle(title, '/:instance?/a/:id');\n\n const fetchAccountPromiseRef = useRef();\n const fetchAccount = useCallback(() => {\n const fetchPromise =\n fetchAccountPromiseRef.current || masto.v1.accounts.$select(id).fetch();\n fetchAccountPromiseRef.current = fetchPromise;\n return fetchPromise;\n }, [id, masto]);\n\n useEffect(() => {\n (async () => {\n try {\n const acc = await fetchAccount();\n console.log(acc);\n setAccount(acc);\n } catch (e) {\n console.error(e);\n }\n // No need, because the whole filter bar is hidden\n // TODO: Revisit this\n if (!mediaFirst) {\n try {\n const featuredTags = await masto.v1.accounts\n .$select(id)\n .featuredTags.list();\n console.log({ featuredTags });\n setFeaturedTags(featuredTags);\n } catch (e) {\n console.error(e);\n }\n }\n })();\n }, [id, mediaFirst]);\n\n const { displayName, acct, emojis } = account || {};\n\n const filterBarRef = useRef();\n const TimelineStart = useMemo(() => {\n const filtered =\n !excludeReplies || excludeBoosts || tagged || media || !!month;\n const cachedAccount = snapStates.accounts[`${id}@${instance}`];\n\n return (\n <>\n <AccountInfo\n instance={instance}\n account={cachedAccount || id}\n fetchAccount={fetchAccount}\n authenticated={authenticated}\n standalone\n />\n {!mediaFirst && (\n <div\n class=\"filter-bar\"\n ref={filterBarRef}\n style={{\n position: 'relative',\n }}\n >\n {filtered ? (\n <Link\n to={`/${instance}/a/${id}`}\n class=\"insignificant filter-clear\"\n title={t`Clear filters`}\n key=\"clear-filters\"\n >\n <Icon icon=\"x\" size=\"l\" alt={t`Clear`} />\n </Link>\n ) : (\n <Icon\n icon=\"filter\"\n class=\"insignificant\"\n size=\"l\"\n alt={t`Filters`}\n />\n )}\n <Link\n to={`/${instance}/a/${id}${excludeReplies ? '?replies=1' : ''}`}\n onClick={() => {\n if (excludeReplies) {\n showToast(t`Showing post with replies`);\n }\n }}\n class={excludeReplies ? '' : 'is-active'}\n >\n <Trans>+ Replies</Trans>\n </Link>\n <Link\n to={`/${instance}/a/${id}${excludeBoosts ? '' : '?boosts=0'}`}\n onClick={() => {\n if (!excludeBoosts) {\n showToast(t`Showing posts without boosts`);\n }\n }}\n class={!excludeBoosts ? '' : 'is-active'}\n >\n <Trans>- Boosts</Trans>\n </Link>\n <Link\n to={`/${instance}/a/${id}${media ? '' : '?media=1'}`}\n onClick={() => {\n if (!media) {\n showToast(t`Showing posts with media`);\n }\n }}\n class={media ? 'is-active' : ''}\n >\n <Trans>Media</Trans>\n </Link>\n {featuredTags.map((tag) => (\n <Link\n key={tag.id}\n to={`/${instance}/a/${id}${\n tagged === tag.name\n ? ''\n : `?tagged=${encodeURIComponent(tag.name)}`\n }`}\n onClick={() => {\n if (tagged !== tag.name) {\n showToast(t`Showing posts tagged with #${tag.name}`);\n }\n }}\n class={tagged === tag.name ? 'is-active' : ''}\n >\n <span>\n <span class=\"more-insignificant\">#</span>\n {tag.name}\n </span>\n {\n // The count differs based on instance 😅\n }\n {/* <span class=\"filter-count\">{tag.statusesCount}</span> */}\n </Link>\n ))}\n {searchEnabled &&\n (supportsInputMonth ? (\n <label class={`filter-field ${month ? 'is-active' : ''}`}>\n <Icon icon=\"month\" size=\"l\" />\n <input\n type=\"month\"\n disabled={!account?.acct}\n value={month || ''}\n min={MIN_YEAR_MONTH}\n max={new Date().toISOString().slice(0, 7)}\n onInput={(e) => {\n const { value, validity } = e.currentTarget;\n if (!validity.valid) return;\n setSearchParams(\n value\n ? {\n month: value,\n }\n : {},\n );\n const [year, month] = value.split('-');\n const monthIndex = parseInt(month, 10) - 1;\n const date = new Date(year, monthIndex);\n showToast(\n t`Showing posts in ${date.toLocaleString(i18n.locale, {\n month: 'long',\n year: 'numeric',\n })}`,\n );\n }}\n />\n </label>\n ) : (\n // Fallback to <select> for month and <input type=\"number\"> for year\n <MonthPicker\n class={`filter-field ${month ? 'is-active' : ''}`}\n disabled={!account?.acct}\n value={month || ''}\n min={MIN_YEAR_MONTH}\n max={new Date().toISOString().slice(0, 7)}\n onInput={(e) => {\n const { value, validity } = e;\n if (!validity.valid) return;\n setSearchParams(\n value\n ? {\n month: value,\n }\n : {},\n );\n }}\n />\n ))}\n </div>\n )}\n </>\n );\n }, [\n id,\n instance,\n authenticated,\n featuredTags,\n fetchAccount,\n searchEnabled,\n ...allSearchParams,\n ]);\n\n useEffect(() => {\n // Focus on .is-active\n const active = filterBarRef.current?.querySelector('.is-active');\n if (active) {\n console.log('active', active, active.offsetLeft);\n filterBarRef.current.scrollTo({\n behavior: 'smooth',\n left:\n active.offsetLeft -\n (filterBarRef.current.offsetWidth - active.offsetWidth) / 2,\n });\n }\n }, [featuredTags, searchEnabled, ...allSearchParams]);\n\n const accountInstance = useMemo(() => {\n if (!account?.url) return null;\n const domain = URL.parse(account.url).hostname;\n return domain;\n }, [account]);\n const sameInstance = instance === accountInstance;\n const allowSwitch = !!account && !sameInstance;\n\n return (\n <Timeline\n key={id}\n title={`${account?.acct ? '@' + account.acct : t`Posts`}`}\n titleComponent={\n <h1\n class=\"header-double-lines header-account\"\n // onClick={() => {\n // states.showAccount = {\n // account,\n // instance,\n // };\n // }}\n >\n <b>\n <EmojiText text={displayName} emojis={emojis} />\n </b>\n <div>\n <span class=\"bidi-isolate\">@{acct}</span>\n </div>\n </h1>\n }\n id=\"account-statuses\"\n instance={instance}\n emptyText={t`Nothing to see here yet.`}\n errorText={t`Unable to load posts`}\n fetchItems={fetchAccountStatuses}\n useItemID\n view={media || mediaFirst ? 'media' : undefined}\n boostsCarousel={snapStates.settings.boostsCarousel}\n timelineStart={TimelineStart}\n refresh={[\n excludeReplies,\n excludeBoosts,\n tagged,\n media,\n month + account?.acct,\n ].toString()}\n headerEnd={\n <Menu2\n portal\n // setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem\n disabled={!allowSwitch}\n onClick={() => {\n (async () => {\n try {\n const { masto } = api({\n instance: accountInstance,\n });\n const acc = await masto.v1.accounts.lookup({\n acct: account.acct,\n });\n const { id } = acc;\n location.hash = `/${accountInstance}/a/${id}`;\n } catch (e) {\n console.error(e);\n alert(t`Unable to fetch account info`);\n }\n })();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Switch to account's instance{' '}\n {accountInstance ? (\n <>\n {' '}\n (<b>{punycode.toUnicode(accountInstance)}</b>)\n </>\n ) : null}\n </Trans>\n </small>\n </MenuItem>\n {!sameCurrentInstance && (\n <MenuItem\n onClick={() => {\n (async () => {\n try {\n const acc = await currentMasto.v1.accounts.lookup({\n acct: account.acct + '@' + instance,\n });\n const { id } = acc;\n location.hash = `/${currentInstance}/a/${id}`;\n } catch (e) {\n console.error(e);\n alert(t`Unable to fetch account info`);\n }\n })();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Switch to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nfunction MonthPicker(props) {\n const { i18n } = useLingui();\n const {\n class: className,\n disabled,\n value,\n min,\n max,\n onInput = () => {},\n } = props;\n const [_year, _month] = value?.split('-') || [];\n const monthFieldRef = useRef();\n const yearFieldRef = useRef();\n\n const checkValidity = (month, year) => {\n const [minYear, minMonth] = min?.split('-') || [];\n const [maxYear, maxMonth] = max?.split('-') || [];\n if (year < minYear) return false;\n if (year > maxYear) return false;\n if (year === minYear && month < minMonth) return false;\n if (year === maxYear && month > maxMonth) return false;\n return true;\n };\n\n return (\n <div class={className}>\n <Icon icon=\"month\" size=\"l\" />\n <select\n ref={monthFieldRef}\n disabled={disabled}\n value={_month || ''}\n onInput={(e) => {\n const { value: month } = e.currentTarget;\n const year = yearFieldRef.current.value;\n if (!checkValidity(month, year))\n return {\n value: '',\n validity: {\n valid: false,\n },\n };\n onInput({\n value: month ? `${year}-${month}` : '',\n validity: {\n valid: true,\n },\n });\n }}\n >\n <option value=\"\">\n <Trans>Month</Trans>\n </option>\n <option disabled>-----</option>\n {Array.from({ length: 12 }, (_, i) => (\n <option\n value={\n // Month is 1-indexed\n (i + 1).toString().padStart(2, '0')\n }\n key={i}\n >\n {new Date(0, i).toLocaleString(i18n.locale, {\n month: 'long',\n })}\n </option>\n ))}\n </select>{' '}\n <input\n ref={yearFieldRef}\n type=\"number\"\n disabled={disabled}\n value={_year || new Date().getFullYear()}\n min={min?.slice(0, 4) || MIN_YEAR}\n max={max?.slice(0, 4) || new Date().getFullYear()}\n onInput={(e) => {\n const { value: year, validity } = e.currentTarget;\n const month = monthFieldRef.current.value;\n if (!validity.valid || !checkValidity(month, year))\n return {\n value: '',\n validity: {\n valid: false,\n },\n };\n onInput({\n value: year ? `${year}-${month}` : '',\n validity: {\n valid: true,\n },\n });\n }}\n style={{\n width: '4.5em',\n }}\n />\n </div>\n );\n}\n\nexport default AccountStatuses;\n","import { t, Trans } from '@lingui/macro';\nimport { useRef } from 'preact/hooks';\n\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Bookmarks() {\n useTitle(t`Bookmarks`, '/bookmarks');\n const { masto, instance } = api();\n const bookmarksIterator = useRef();\n async function fetchBookmarks(firstLoad) {\n if (firstLoad || !bookmarksIterator.current) {\n bookmarksIterator.current = masto.v1.bookmarks.list({ limit: LIMIT });\n }\n return await bookmarksIterator.current.next();\n }\n\n return (\n <Timeline\n title={t`Bookmarks`}\n id=\"bookmarks\"\n emptyText={t`No bookmarks yet. Go bookmark something!`}\n errorText={t`Unable to load bookmarks.`}\n instance={instance}\n fetchItems={fetchBookmarks}\n />\n );\n}\n\nexport default Bookmarks;\n","export default \"__VITE_ASSET__S_9SYp01__\"","import '../components/links-bar.css';\nimport './catchup.css';\n\nimport autoAnimate from '@formkit/auto-animate';\nimport { msg, Plural, select, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSearchParams } from 'react-router-dom';\nimport { uid } from 'uid/single';\n\nimport catchupUrl from '../assets/features/catch-up.png';\n\nimport Avatar from '../components/avatar';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Modal from '../components/modal';\nimport NameText from '../components/name-text';\nimport NavMenu from '../components/nav-menu';\nimport RelativeTime from '../components/relative-time';\nimport { api } from '../utils/api';\nimport { oklab2rgb, rgb2oklab } from '../utils/color-utils';\nimport db from '../utils/db';\nimport emojifyText from '../utils/emojify-text';\nimport { isFiltered } from '../utils/filters';\nimport htmlContentLength from '../utils/html-content-length';\nimport mem from '../utils/mem';\nimport niceDateTime from '../utils/nice-date-time';\nimport shortenNumber from '../utils/shorten-number';\nimport showToast from '../utils/show-toast';\nimport states, { statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport store from '../utils/store';\nimport { getCurrentAccountID, getCurrentAccountNS } from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport { assignFollowedTags } from '../utils/timeline-utils';\nimport useTitle from '../utils/useTitle';\n\nconst FILTER_CONTEXT = 'home';\n\nconst RANGES = [\n { label: msg`last 1 hour`, value: 1 },\n { label: msg`last 2 hours`, value: 2 },\n { label: msg`last 3 hours`, value: 3 },\n { label: msg`last 4 hours`, value: 4 },\n { label: msg`last 5 hours`, value: 5 },\n { label: msg`last 6 hours`, value: 6 },\n { label: msg`last 7 hours`, value: 7 },\n { label: msg`last 8 hours`, value: 8 },\n { label: msg`last 9 hours`, value: 9 },\n { label: msg`last 10 hours`, value: 10 },\n { label: msg`last 11 hours`, value: 11 },\n { label: msg`last 12 hours`, value: 12 },\n { label: msg`beyond 12 hours`, value: 13 },\n];\n\nconst FILTER_KEYS = {\n original: msg`Original`,\n replies: msg`Replies`,\n boosts: msg`Boosts`,\n followedTags: msg`Followed tags`,\n groups: msg`Groups`,\n filtered: msg`Filtered`,\n};\nconst FILTER_SORTS = [\n 'createdAt',\n 'repliesCount',\n 'favouritesCount',\n 'reblogsCount',\n 'density',\n];\nconst FILTER_GROUPS = [null, 'account'];\n\nconst DTF = mem(\n (locale) =>\n new Intl.DateTimeFormat(locale || undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n }),\n);\n\nfunction Catchup() {\n const { i18n, _ } = useLingui();\n const dtf = DTF(i18n.locale);\n\n useTitle(`Catch-up`, '/catchup');\n const { masto, instance } = api();\n const [searchParams, setSearchParams] = useSearchParams();\n const id = searchParams.get('id');\n const [uiState, setUIState] = useState('start');\n const [showTopLinks, setShowTopLinks] = useState(false);\n\n const currentAccount = useMemo(() => {\n return getCurrentAccountID();\n }, []);\n const isSelf = (accountID) => accountID === currentAccount;\n\n const supportsPixelfed = supports('@pixelfed/home-include-reblogs');\n\n async function fetchHome({ maxCreatedAt }) {\n const maxCreatedAtDate = maxCreatedAt ? new Date(maxCreatedAt) : null;\n console.debug('fetchHome', maxCreatedAtDate);\n const allResults = [];\n const homeIterator = masto.v1.timelines.home.list({ limit: 40 });\n mainloop: while (true) {\n try {\n if (supportsPixelfed && homeIterator.nextParams) {\n if (typeof homeIterator.nextParams === 'string') {\n homeIterator.nextParams += '&include_reblogs=true';\n } else {\n homeIterator.nextParams.include_reblogs = true;\n }\n }\n const results = await homeIterator.next();\n const { value } = results;\n if (value?.length) {\n // This ignores maxCreatedAt filter, but it's ok for now\n await assignFollowedTags(value, instance);\n let addedResults = false;\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const createdAtDate = new Date(item.createdAt);\n if (!maxCreatedAtDate || createdAtDate >= maxCreatedAtDate) {\n // Filtered\n const selfPost = isSelf(\n item.reblog?.account?.id || item.account.id,\n );\n const filterInfo =\n !selfPost &&\n isFiltered(\n item.reblog?.filtered || item.filtered,\n FILTER_CONTEXT,\n );\n if (filterInfo?.action === 'hide') continue;\n item._filtered = filterInfo;\n\n // Followed tags\n const sKey = statusKey(item.id, instance);\n item._followedTags = states.statusFollowedTags[sKey]\n ? [...states.statusFollowedTags[sKey]]\n : [];\n\n allResults.push(item);\n addedResults = true;\n } else {\n // Don't immediately stop, still add the other items that might still be within range\n // break mainloop;\n }\n // Only stop when ALL items are outside of range\n if (!addedResults) {\n break mainloop;\n }\n }\n } else {\n break mainloop;\n }\n // Pause 1s\n await new Promise((resolve) => setTimeout(resolve, 1000));\n } catch (e) {\n console.error(e);\n break mainloop;\n }\n }\n\n // Post-process all results\n // 1. Threadify - tag 1st-post in a thread\n allResults.forEach((status) => {\n if (status?.inReplyToId) {\n const replyToStatus = allResults.find(\n (s) => s.id === status.inReplyToId,\n );\n if (replyToStatus && !replyToStatus.inReplyToId) {\n replyToStatus._thread = true;\n }\n }\n });\n\n return allResults;\n }\n\n const [posts, setPosts] = useState([]);\n const catchupRangeRef = useRef();\n const catchupLastRef = useRef();\n const NS = useMemo(() => getCurrentAccountNS(), []);\n const handleCatchupClick = useCallback(async ({ duration } = {}) => {\n const now = Date.now();\n const maxCreatedAt = duration ? now - duration : null;\n setUIState('loading');\n const results = await fetchHome({ maxCreatedAt });\n // Namespaced by account ID\n // Possible conflict if ID matches between different accounts from different instances\n const catchupID = `${NS}-${uid()}`;\n try {\n await db.catchup.set(catchupID, {\n id: catchupID,\n posts: results,\n count: results.length,\n startAt: maxCreatedAt,\n endAt: now,\n });\n setSearchParams({ id: catchupID });\n } catch (e) {\n console.error(e, results);\n }\n }, []);\n\n useEffect(() => {\n if (id) {\n (async () => {\n const catchup = await db.catchup.get(id);\n if (catchup) {\n catchup.posts.sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1));\n setPosts(catchup.posts);\n setUIState('results');\n }\n })();\n } else if (uiState === 'results') {\n setPosts([]);\n setUIState('start');\n }\n }, [id]);\n\n const [reloadCatchupsCount, reloadCatchups] = useReducer((c) => c + 1, 0);\n const [lastCatchupEndAt, setLastCatchupEndAt] = useState(null);\n const [prevCatchups, setPrevCatchups] = useState([]);\n useEffect(() => {\n (async () => {\n try {\n const catchups = await db.catchup.keys();\n if (catchups.length) {\n const ns = getCurrentAccountNS();\n const ownKeys = catchups.filter((key) => key.startsWith(`${ns}-`));\n if (ownKeys.length) {\n let ownCatchups = await db.catchup.getMany(ownKeys);\n ownCatchups.sort((a, b) => b.endAt - a.endAt);\n\n // Split to 1st 3 last catchups, and the rest\n let lastCatchups = ownCatchups.slice(0, 3);\n let restCatchups = ownCatchups.slice(3);\n\n const trimmedCatchups = lastCatchups.map((c) => {\n const { id, count, startAt, endAt } = c;\n return {\n id,\n count,\n startAt,\n endAt,\n };\n });\n setPrevCatchups(trimmedCatchups);\n setLastCatchupEndAt(lastCatchups[0].endAt);\n\n // GC time\n ownCatchups = null;\n lastCatchups = null;\n\n queueMicrotask(() => {\n if (restCatchups.length) {\n // delete them\n db.catchup\n .delMany(restCatchups.map((c) => c.id))\n .then(() => {\n // GC time\n restCatchups = null;\n })\n .catch((e) => {\n console.error(e);\n });\n }\n });\n\n return;\n }\n }\n } catch (e) {\n console.error(e);\n }\n setPrevCatchups([]);\n })();\n }, [reloadCatchupsCount]);\n useEffect(() => {\n if (uiState === 'start') {\n reloadCatchups();\n }\n }, [uiState === 'start']);\n\n const [filterCounts, links] = useMemo(() => {\n let filtered = 0,\n groups = 0,\n boosts = 0,\n replies = 0,\n followedTags = 0,\n original = 0;\n const links = {};\n for (const post of posts) {\n if (post._filtered) {\n filtered++;\n post.__FILTER = 'filtered';\n } else if (post.group) {\n groups++;\n post.__FILTER = 'groups';\n } else if (post.reblog) {\n boosts++;\n post.__FILTER = 'boosts';\n } else if (post._followedTags?.length) {\n followedTags++;\n post.__FILTER = 'followedTags';\n } else if (\n post.inReplyToId &&\n post.inReplyToAccountId !== post.account?.id\n ) {\n replies++;\n post.__FILTER = 'replies';\n } else {\n original++;\n post.__FILTER = 'original';\n }\n\n const thePost = post.reblog || post;\n if (\n post.__FILTER !== 'filtered' &&\n thePost.card?.url &&\n thePost.card?.image &&\n thePost.card?.type === 'link'\n ) {\n const { card, favouritesCount, reblogsCount } = thePost;\n let { url } = card;\n url = url.replace(/\\/$/, '');\n if (!links[url]) {\n links[url] = {\n postID: thePost.id,\n card,\n shared: 1,\n sharers: [post.account],\n likes: favouritesCount,\n boosts: reblogsCount,\n };\n } else {\n if (links[url].sharers.find((a) => a.id === post.account.id)) {\n continue;\n }\n links[url].shared++;\n links[url].sharers.push(post.account);\n if (links[url].postID !== thePost.id) {\n links[url].likes += favouritesCount;\n links[url].boosts += reblogsCount;\n }\n }\n }\n }\n\n let topLinks = [];\n for (const link in links) {\n topLinks.push({\n url: link,\n ...links[link],\n });\n }\n topLinks.sort((a, b) => {\n if (a.shared > b.shared) return -1;\n if (a.shared < b.shared) return 1;\n if (a.boosts > b.boosts) return -1;\n if (a.boosts < b.boosts) return 1;\n if (a.likes > b.likes) return -1;\n if (a.likes < b.likes) return 1;\n return 0;\n });\n\n // Slice links to shared > 1 but min 10 links\n if (topLinks.length > 10) {\n linksLoop: for (let i = 10; i < topLinks.length; i++) {\n const { shared } = topLinks[i];\n if (shared <= 1) {\n topLinks = topLinks.slice(0, i);\n break linksLoop;\n }\n }\n }\n\n return [\n {\n filtered,\n groups,\n boosts,\n replies,\n followedTags,\n original,\n },\n topLinks,\n ];\n }, [posts]);\n\n const [selectedFilterCategory, setSelectedFilterCategory] = useState('all');\n const [selectedAuthor, setSelectedAuthor] = useState(null);\n\n const [range, setRange] = useState(1);\n\n const [sortBy, setSortBy] = useState('createdAt');\n const [sortOrder, setSortOrder] = useState('asc');\n const [groupBy, setGroupBy] = useState(null);\n\n const [filteredPosts, authors, authorCounts] = useMemo(() => {\n const authorsHash = {};\n const authorCountsMap = new Map();\n\n let filteredPosts = posts.filter((post) => {\n const postFilterMatches =\n selectedFilterCategory === 'all' ||\n post.__FILTER === selectedFilterCategory;\n\n if (postFilterMatches) {\n authorsHash[post.account.id] = post.account;\n authorCountsMap.set(\n post.account.id,\n (authorCountsMap.get(post.account.id) || 0) + 1,\n );\n }\n\n return postFilterMatches;\n });\n\n // Deduplicate boosts\n const boostedPosts = {};\n filteredPosts.forEach((post) => {\n if (post.reblog) {\n if (boostedPosts[post.reblog.id]) {\n if (boostedPosts[post.reblog.id].__BOOSTERS) {\n boostedPosts[post.reblog.id].__BOOSTERS.add(post.account);\n } else {\n boostedPosts[post.reblog.id].__BOOSTERS = new Set([post.account]);\n }\n post.__HIDDEN = true;\n } else {\n boostedPosts[post.reblog.id] = post;\n }\n }\n });\n\n if (selectedAuthor && authorCountsMap.has(selectedAuthor)) {\n filteredPosts = filteredPosts.filter(\n (post) =>\n post.account.id === selectedAuthor ||\n [...(post.__BOOSTERS || [])].find((a) => a.id === selectedAuthor),\n );\n }\n\n return [filteredPosts, authorsHash, Object.fromEntries(authorCountsMap)];\n }, [selectedFilterCategory, selectedAuthor, posts]);\n\n const filteredPostsMap = useMemo(() => {\n const map = {};\n filteredPosts.forEach((post) => {\n map[post.id] = post;\n });\n return map;\n }, [filteredPosts]);\n\n const authorCountsList = useMemo(\n () =>\n Object.keys(authorCounts).sort(\n (a, b) => authorCounts[b] - authorCounts[a],\n ),\n [authorCounts],\n );\n\n const sortedFilteredPosts = useMemo(() => {\n const authorIndices = {};\n authorCountsList.forEach((authorID, index) => {\n authorIndices[authorID] = index;\n });\n return filteredPosts\n .filter((post) => !post.__HIDDEN)\n .sort((a, b) => {\n if (groupBy === 'account') {\n const aAccountID = a.account.id;\n const bAccountID = b.account.id;\n const aIndex = authorIndices[aAccountID];\n const bIndex = authorIndices[bAccountID];\n const order = aIndex - bIndex;\n if (order !== 0) {\n return order;\n }\n }\n if (sortBy !== 'createdAt') {\n a = a.reblog || a;\n b = b.reblog || b;\n if (sortBy !== 'density' && a[sortBy] === b[sortBy]) {\n return a.createdAt > b.createdAt ? 1 : -1;\n }\n }\n if (sortBy === 'density') {\n const aDensity = postDensity(a);\n const bDensity = postDensity(b);\n if (sortOrder === 'asc') {\n return aDensity > bDensity ? 1 : -1;\n } else {\n return bDensity > aDensity ? 1 : -1;\n }\n }\n if (sortOrder === 'asc') {\n return a[sortBy] > b[sortBy] ? 1 : -1;\n } else {\n return b[sortBy] > a[sortBy] ? 1 : -1;\n }\n });\n }, [filteredPosts, sortBy, sortOrder, groupBy, authorCountsList]);\n\n const prevGroup = useRef(null);\n\n const authorsListParent = useRef(null);\n const autoAnimated = useRef(false);\n useEffect(() => {\n if (posts.length > 100 || autoAnimated.current) return;\n if (authorsListParent.current) {\n autoAnimate(authorsListParent.current, {\n duration: 200,\n });\n autoAnimated.current = true;\n }\n }, [posts, authorsListParent]);\n\n const postsBarType = posts.length > 160 ? '3d' : '2d';\n\n const postsBar = useMemo(() => {\n if (postsBarType !== '2d') return null;\n return posts.map((post) => {\n // If part of filteredPosts\n const isFiltered = filteredPostsMap[post.id];\n return (\n <span\n key={post.id}\n class={`post-dot ${isFiltered ? 'post-dot-highlight' : ''}`}\n />\n );\n });\n }, [filteredPostsMap]);\n\n const postsBins = useMemo(() => {\n if (postsBarType !== '3d') return null;\n if (!posts?.length) return null;\n const bins = binByTime(posts, 'createdAt', 320);\n return bins.map((posts, i) => {\n return (\n <div class=\"posts-bin\" key={i}>\n {posts.map((post) => {\n const isFiltered = filteredPostsMap[post.id];\n return (\n <span\n key={post.id}\n class={`post-dot ${isFiltered ? 'post-dot-highlight' : ''}`}\n />\n );\n })}\n </div>\n );\n });\n }, [filteredPostsMap]);\n\n const scrollableRef = useRef(null);\n\n // if range value exceeded lastCatchupEndAt, show error\n const lastCatchupRange = useMemo(() => {\n // return hour, not ms\n if (!lastCatchupEndAt) return null;\n return (Date.now() - lastCatchupEndAt) / 1000 / 60 / 60;\n }, [lastCatchupEndAt, range]);\n\n useEffect(() => {\n if (uiState !== 'results') return;\n const authorUsername =\n selectedAuthor && authors[selectedAuthor]\n ? authors[selectedAuthor].username\n : '';\n const sortOrderIndex = sortOrder === 'asc' ? 0 : 1;\n const groupByText = {\n account: 'authors',\n };\n let toast = showToast({\n duration: 5_000, // 5 seconds\n // Note: I'm sorry, translators\n text: t`Showing ${select(selectedFilterCategory, {\n all: 'all posts',\n original: 'original posts',\n replies: 'replies',\n boosts: 'boosts',\n followedTags: 'followed tags',\n groups: 'groups',\n filtered: 'filtered posts',\n })}, ${select(sortBy, {\n createdAt: select(sortOrder, {\n asc: 'oldest',\n desc: 'latest',\n }),\n reblogsCount: select(sortOrder, {\n asc: 'fewest boosts',\n desc: 'most boosts',\n }),\n favouritesCount: select(sortOrder, {\n asc: 'fewest likes',\n desc: 'most likes',\n }),\n repliesCount: select(sortOrder, {\n asc: 'fewest replies',\n desc: 'most replies',\n }),\n density: select(sortOrder, { asc: 'least dense', desc: 'most dense' }),\n })} first${select(groupBy, {\n account: ', grouped by authors',\n other: '',\n })}`,\n });\n return () => {\n toast?.hideToast?.();\n };\n }, [\n uiState,\n selectedFilterCategory,\n selectedAuthor,\n sortBy,\n sortOrder,\n groupBy,\n authors,\n ]);\n\n useEffect(() => {\n if (selectedAuthor) {\n if (authors[selectedAuthor]) {\n // Check if author is visible and within the scrollable area viewport\n const authorElement = authorsListParent.current.querySelector(\n `[data-author=\"${selectedAuthor}\"]`,\n );\n const scrollableRect =\n authorsListParent.current?.getBoundingClientRect();\n const authorRect = authorElement?.getBoundingClientRect();\n console.log({\n sLeft: scrollableRect.left,\n sRight: scrollableRect.right,\n aLeft: authorRect.left,\n aRight: authorRect.right,\n });\n if (\n authorRect.left < scrollableRect.left ||\n authorRect.right > scrollableRect.right\n ) {\n authorElement.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n } else if (authorRect.top < 0) {\n authorElement.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n });\n }\n }\n }\n }, [selectedAuthor, authors]);\n\n const [showHelp, setShowHelp] = useState(false);\n\n const itemsSelector = '.catchup-list > li > a';\n const jRef = useHotkeys(\n 'j',\n () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n const nextItem = allItems[activeItemIndex + 1];\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView({\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n }\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n },\n );\n\n const kRef = useHotkeys(\n 'k',\n () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView({\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n }\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n },\n );\n\n const hlRef = useHotkeys(\n 'h, l',\n (_, handler) => {\n // Go next/prev selectedAuthor in authorCountsList list\n const key = handler.keys[0];\n if (selectedAuthor) {\n const index = authorCountsList.indexOf(selectedAuthor);\n if (key === 'h') {\n if (index > 0 && index < authorCountsList.length) {\n setSelectedAuthor(authorCountsList[index - 1]);\n scrollableRef.current?.focus();\n }\n } else if (key === 'l') {\n if (index < authorCountsList.length - 1 && index >= 0) {\n setSelectedAuthor(authorCountsList[index + 1]);\n scrollableRef.current?.focus();\n }\n }\n } else if (key === 'l') {\n setSelectedAuthor(authorCountsList[0]);\n scrollableRef.current?.focus();\n }\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const escRef = useHotkeys(\n 'esc',\n () => {\n setSelectedAuthor(null);\n scrollableRef.current?.focus();\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const dotRef = useHotkeys(\n '.',\n () => {\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n },\n {\n preventDefault: true,\n ignoreModifiers: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const handleArrowKeys = useCallback((e) => {\n const activeElement = document.activeElement;\n const isRadio =\n activeElement?.tagName === 'INPUT' && activeElement.type === 'radio';\n const isArrowKeys =\n e.key === 'ArrowDown' ||\n e.key === 'ArrowUp' ||\n e.key === 'ArrowLeft' ||\n e.key === 'ArrowRight';\n if (isArrowKeys && isRadio) {\n // Note: page scroll won't trigger on first arrow key press due to this. Subsequent presses will.\n activeElement.blur();\n return;\n }\n }, []);\n\n return (\n <div\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n hlRef(node);\n escRef(node);\n }}\n id=\"catchup-page\"\n class=\"deck-container\"\n tabIndex=\"-1\"\n >\n <div class=\"timeline-deck deck wide\">\n <header\n class={`${uiState === 'loading' ? 'loading' : ''}`}\n onClick={(e) => {\n if (!e.target.closest('a, button')) {\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }\n }}\n >\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n {uiState === 'results' && (\n <Link to=\"/catchup\" class=\"button plain\">\n <Icon icon=\"history2\" size=\"l\" alt={t`Catch-up`} />\n </Link>\n )}\n {uiState === 'start' && (\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n )}\n </div>\n <h1>\n {uiState !== 'start' && (\n <Trans>\n Catch-up <sup>beta</sup>\n </Trans>\n )}\n </h1>\n <div class=\"header-side\">\n {uiState !== 'start' && uiState !== 'loading' && (\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n setShowHelp(true);\n }}\n >\n <Trans>Help</Trans>\n </button>\n )}\n </div>\n </div>\n </header>\n <main onKeyDown={handleArrowKeys}>\n {uiState === 'start' && (\n <div class=\"catchup-start\">\n <h1>\n <Trans>\n Catch-up <sup>beta</sup>\n </Trans>\n </h1>\n <details>\n <summary>\n <Trans>What is this?</Trans>\n </summary>\n <p>\n <Trans>\n Catch-up is a separate timeline for your followings,\n offering a high-level view at a glance, with a simple,\n email-inspired interface to effortlessly sort and filter\n through posts.\n </Trans>\n </p>\n <img\n src={catchupUrl}\n width=\"1200\"\n height=\"900\"\n alt={t`Preview of Catch-up UI`}\n />\n <p>\n <button\n type=\"button\"\n onClick={(e) => {\n e.target.closest('details').open = false;\n }}\n >\n <Trans>Let's catch up</Trans>\n </button>\n </p>\n </details>\n <p>\n <Trans>Let's catch up on the posts from your followings.</Trans>\n </p>\n <p>\n <b>\n <Trans>Show me all posts from…</Trans>\n </b>\n </p>\n <div class=\"catchup-form\">\n <input\n ref={catchupRangeRef}\n type=\"range\"\n value={range}\n min={RANGES[0].value}\n max={RANGES[RANGES.length - 1].value}\n step=\"1\"\n list=\"catchup-ranges\"\n onChange={(e) => setRange(+e.target.value)}\n />{' '}\n <span\n style={{\n width: '8em',\n }}\n >\n {_(RANGES[range - 1].label)}\n <br />\n <small class=\"insignificant\">\n {range == RANGES[RANGES.length - 1].value\n ? t`until the max`\n : niceDateTime(\n new Date(Date.now() - range * 60 * 60 * 1000),\n )}\n </small>\n </span>\n <datalist id=\"catchup-ranges\">\n {RANGES.map(({ label, value }) => (\n <option value={value} label={_(label)} />\n ))}\n </datalist>{' '}\n <button\n type=\"button\"\n onClick={() => {\n if (range < RANGES[RANGES.length - 1].value) {\n let duration;\n if (\n range === RANGES[RANGES.length - 1].value &&\n catchupLastRef.current?.checked\n ) {\n duration = Date.now() - lastCatchupEndAt;\n } else {\n duration = range * 60 * 60 * 1000;\n }\n handleCatchupClick({ duration });\n } else {\n handleCatchupClick();\n }\n }}\n >\n <Trans>Catch up</Trans>\n </button>\n </div>\n {lastCatchupRange && range > lastCatchupRange ? (\n <p class=\"catchup-info\">\n <Icon icon=\"info\" />{' '}\n <Trans>Overlaps with your last catch-up</Trans>\n </p>\n ) : range === RANGES[RANGES.length - 1].value &&\n lastCatchupEndAt ? (\n <p class=\"catchup-info\">\n <label>\n <input\n type=\"checkbox\"\n switch\n checked\n ref={catchupLastRef}\n />{' '}\n <Trans>\n Until the last catch-up (\n {dtf.format(new Date(lastCatchupEndAt))})\n </Trans>\n </label>\n </p>\n ) : null}\n <p class=\"insignificant\">\n <small>\n <Trans>\n Note: your instance might only show a maximum of 800 posts\n in the Home timeline regardless of the time range. Could be\n less or more.\n </Trans>\n </small>\n </p>\n {!!prevCatchups?.length && (\n <div class=\"catchup-prev\">\n <p>\n <Trans>Previously…</Trans>\n </p>\n <ul>\n {prevCatchups.map((pc) => (\n <li key={pc.id}>\n <Link to={`/catchup?id=${pc.id}`}>\n <Icon icon=\"history2\" />{' '}\n <span>\n {pc.startAt\n ? dtf.formatRange(\n new Date(pc.startAt),\n new Date(pc.endAt),\n )\n : `… – ${dtf.format(new Date(pc.endAt))}`}\n </span>\n </Link>{' '}\n <span>\n <small class=\"ib insignificant\">\n <Plural\n value={pc.count}\n one=\"# post\"\n other=\"# posts\"\n />\n </small>{' '}\n <button\n type=\"button\"\n class=\"light danger small\"\n onClick={async () => {\n const yes = confirm(t`Remove this catch-up?`);\n if (yes) {\n let t = showToast(\n t`Removing Catch-up ${pc.id}`,\n );\n await db.catchup.del(pc.id);\n t?.hideToast?.();\n showToast(t`Catch-up ${pc.id} removed`);\n reloadCatchups();\n }\n }}\n >\n <Icon icon=\"x\" alt={t`Remove`} />\n </button>\n </span>\n </li>\n ))}\n </ul>\n {prevCatchups.length >= 3 && (\n <p>\n <small>\n <Trans>\n Note: Only max 3 will be stored. The rest will be\n automatically removed.\n </Trans>\n </small>\n </p>\n )}\n </div>\n )}\n </div>\n )}\n {uiState === 'loading' && (\n <div class=\"ui-state catchup-start\">\n <Loader abrupt />\n <p class=\"insignificant\">\n <Trans>Fetching posts…</Trans>\n </p>\n <p class=\"insignificant\">\n <Trans>This might take a while.</Trans>\n </p>\n </div>\n )}\n {uiState === 'results' && (\n <>\n <div class=\"catchup-header\">\n {posts.length > 0 && (\n <p>\n <b class=\"ib\">\n {dtf.formatRange(\n new Date(posts[0].createdAt),\n new Date(posts[posts.length - 1].createdAt),\n )}\n </b>\n </p>\n )}\n <aside>\n <button\n hidden={\n selectedFilterCategory === 'all' &&\n !selectedAuthor &&\n sortBy === 'createdAt' &&\n sortOrder === 'asc'\n }\n type=\"button\"\n class=\"plain4 small\"\n onClick={() => {\n setSelectedFilterCategory('all');\n setSelectedAuthor(null);\n setSortBy('createdAt');\n setGroupBy(null);\n setSortOrder('asc');\n }}\n >\n <Trans>Reset filters</Trans>\n </button>\n {links?.length > 0 && (\n <button\n type=\"button\"\n class=\"plain small\"\n onClick={() => setShowTopLinks(!showTopLinks)}\n >\n <Trans>Top links</Trans>{' '}\n <Icon\n icon=\"chevron-down\"\n style={{\n transform: showTopLinks\n ? 'rotate(180deg)'\n : 'rotate(0deg)',\n }}\n />\n </button>\n )}\n </aside>\n </div>\n <div class=\"shazam-container no-animation\" hidden={!showTopLinks}>\n <div class=\"shazam-container-inner\">\n <div class=\"catchup-top-links links-bar\">\n {links.map((link) => {\n const { card, shared, sharers, likes, boosts } = link;\n const {\n blurhash,\n title,\n description,\n url,\n image,\n imageDescription,\n language,\n width,\n height,\n publishedAt,\n } = card;\n const domain = punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n let accentColor;\n if (blurhash) {\n const averageColor = getBlurHashAverageColor(blurhash);\n const labAverageColor = rgb2oklab(averageColor);\n accentColor = oklab2rgb([\n 0.6,\n labAverageColor[1],\n labAverageColor[2],\n ]);\n }\n\n return (\n <a\n key={url}\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"link-block\"\n style={\n accentColor\n ? {\n '--accent-color': `rgb(${accentColor.join(\n ',',\n )})`,\n '--accent-alpha-color': `rgba(${accentColor.join(\n ',',\n )}, 0.4)`,\n }\n : {}\n }\n >\n <article>\n <figure>\n <img\n src={image}\n alt={imageDescription}\n width={width}\n height={height}\n loading=\"lazy\"\n />\n </figure>\n <div class=\"article-body\">\n <header>\n <div class=\"article-meta\">\n <span class=\"domain\">{domain}</span>{' '}\n {!!publishedAt && <>&middot; </>}\n {!!publishedAt && (\n <>\n <RelativeTime\n datetime={publishedAt}\n format=\"micro\"\n />\n </>\n )}\n </div>\n {!!title && (\n <h1\n class=\"title\"\n lang={language}\n dir=\"auto\"\n title={title}\n >\n {title}\n </h1>\n )}\n </header>\n {!!description && (\n <p\n class=\"description\"\n lang={language}\n dir=\"auto\"\n title={description}\n >\n {description}\n </p>\n )}\n <hr />\n <p\n style={{\n whiteSpace: 'nowrap',\n }}\n >\n <Trans>\n Shared by{' '}\n {sharers.map((s) => {\n const { avatarStatic, displayName } = s;\n return (\n <button\n type=\"button\"\n class=\"plain\"\n style={{\n padding: 0,\n }}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n // Reset and filter to author\n const { id } = s;\n setSelectedAuthor(id);\n setSelectedFilterCategory('all');\n }}\n >\n <Avatar\n url={avatarStatic}\n size=\"s\"\n alt={displayName}\n />\n </button>\n );\n })}\n </Trans>\n </p>\n </div>\n </article>\n </a>\n );\n })}\n </div>\n </div>\n </div>\n {posts.length >= 5 &&\n (postsBarType === '3d' ? (\n <div class=\"catchup-posts-viz-time-bar\">{postsBins}</div>\n ) : (\n <div class=\"catchup-posts-viz-bar\">{postsBar}</div>\n ))}\n {posts.length >= 2 && (\n <div class=\"catchup-filters\">\n <label class=\"filter-cat\">\n <input\n type=\"radio\"\n name=\"filter-cat\"\n checked={selectedFilterCategory.toLowerCase() === 'all'}\n onChange={() => {\n setSelectedFilterCategory('all');\n }}\n />\n <Trans>All</Trans> <span class=\"count\">{posts.length}</span>\n </label>\n {Object.entries(FILTER_KEYS).map(\n ([key, label]) =>\n !!filterCounts[key] && (\n <label\n class=\"filter-cat\"\n key={_(label)}\n title={\n ((filterCounts[key] / posts.length) * 100).toFixed(\n 2,\n ) + '%'\n }\n >\n <input\n type=\"radio\"\n name=\"filter-cat\"\n checked={\n selectedFilterCategory.toLowerCase() ===\n key.toLowerCase()\n }\n onChange={() => {\n setSelectedFilterCategory(key);\n if (key === 'boosts') {\n setSortBy('reblogsCount');\n setSortOrder('desc');\n setGroupBy(null);\n }\n // setSelectedAuthor(null);\n }}\n />\n {_(label)}{' '}\n <span class=\"count\">{filterCounts[key]}</span>\n </label>\n ),\n )}\n </div>\n )}\n {posts.length >= 2 && !!authorCounts && (\n <div\n class=\"catchup-filters authors-filters\"\n ref={authorsListParent}\n >\n {authorCountsList.map((author) => (\n <label\n class=\"filter-author\"\n data-author={author}\n key={`${author}-${authorCounts[author]}`}\n // Preact messed up the order sometimes, need additional key besides just `author`\n // https://github.com/preactjs/preact/issues/2849\n >\n <input\n type=\"radio\"\n name=\"filter-author\"\n checked={selectedAuthor === author}\n onChange={() => {\n setSelectedAuthor(author);\n // setGroupBy(null);\n }}\n onClick={() => {\n if (selectedAuthor === author) {\n setSelectedAuthor(null);\n }\n }}\n />\n <Avatar\n url={\n authors[author].avatarStatic || authors[author].avatar\n }\n size=\"xxl\"\n alt={`${authors[author].displayName} (@${authors[author].acct})`}\n />{' '}\n <span class=\"count\">{authorCounts[author]}</span>\n <span class=\"username\">{authors[author].username}</span>\n </label>\n ))}\n {authorCountsList.length > 5 && (\n <small\n key=\"authors-count\"\n style={{\n whiteSpace: 'nowrap',\n paddingInline: '1em',\n opacity: 0.33,\n }}\n >\n <Plural\n value={authorCountsList.length}\n one=\"# author\"\n other=\"# authors\"\n />\n </small>\n )}\n </div>\n )}\n {posts.length >= 2 && (\n <div class=\"catchup-filters\">\n <span class=\"filter-label\">\n <Trans>Sort</Trans>\n </span>{' '}\n <fieldset class=\"radio-field-group\">\n {FILTER_SORTS.map((key) => (\n <label\n class=\"filter-sort\"\n key={key}\n onClick={(e) => {\n if (sortBy === key) {\n e.preventDefault();\n e.stopPropagation();\n setSortOrder(sortOrder === 'asc' ? 'desc' : 'asc');\n }\n }}\n >\n <input\n type=\"radio\"\n name=\"filter-sort-cat\"\n checked={sortBy === key}\n onChange={() => {\n setSortBy(key);\n const order = /(replies|favourites|reblogs)/.test(\n key,\n )\n ? 'desc'\n : 'asc';\n setSortOrder(order);\n }}\n />\n {\n {\n createdAt: t`Date`,\n repliesCount: t`Replies`,\n favouritesCount: t`Likes`,\n reblogsCount: t`Boosts`,\n density: t`Density`,\n }[key]\n }\n {sortBy === key && (sortOrder === 'asc' ? ' ↑' : ' ↓')}\n </label>\n ))}\n </fieldset>\n {/* <fieldset class=\"radio-field-group\">\n {['asc', 'desc'].map((key) => (\n <label class=\"filter-sort\" key={key}>\n <input\n type=\"radio\"\n name=\"filter-sort-dir\"\n checked={sortOrder === key}\n onChange={() => {\n setSortOrder(key);\n }}\n />\n {key === 'asc' ? '↑' : '↓'}\n </label>\n ))}\n </fieldset> */}\n <span class=\"filter-label\">\n <Trans>Group</Trans>\n </span>{' '}\n <fieldset class=\"radio-field-group\">\n {FILTER_GROUPS.map((key) => (\n <label class=\"filter-group\" key={key || 'none'}>\n <input\n type=\"radio\"\n name=\"filter-group\"\n checked={groupBy === key}\n onChange={() => {\n setGroupBy(key);\n }}\n disabled={key === 'account' && selectedAuthor}\n />\n {{\n account: t`Authors`,\n }[key] || t`None`}\n </label>\n ))}\n </fieldset>\n {\n selectedAuthor && authorCountsList.length > 1 ? (\n <button\n type=\"button\"\n class=\"plain6 small\"\n onClick={() => {\n setSelectedAuthor(null);\n }}\n style={{\n whiteSpace: 'nowrap',\n }}\n >\n <Trans>Show all authors</Trans>\n </button>\n ) : null\n // <button\n // type=\"button\"\n // class=\"plain4 small\"\n // onClick={() => {}}\n // >\n // Group by authors\n // </button>\n }\n </div>\n )}\n <ul\n class={`catchup-list catchup-filter-${\n selectedFilterCategory || ''\n } ${sortBy ? `catchup-sort-${sortBy}` : ''} ${\n selectedAuthor && authors[selectedAuthor]\n ? `catchup-selected-author`\n : ''\n } ${groupBy ? `catchup-group-${groupBy}` : ''}`}\n >\n {sortedFilteredPosts.map((post, i) => {\n const id = post.reblog?.id || post.id;\n let showSeparator = false;\n if (groupBy === 'account') {\n if (\n prevGroup.current &&\n post.account.id !== prevGroup.current &&\n i > 0\n ) {\n showSeparator = true;\n }\n prevGroup.current = post.account.id;\n }\n return (\n <Fragment key={`${post.id}-${showSeparator}`}>\n {showSeparator && <li class=\"separator\" />}\n <IntersectionPostLineItem\n to={`/${instance}/s/${id}`}\n post={post}\n root={scrollableRef.current}\n />\n </Fragment>\n );\n })}\n </ul>\n <footer>\n {filteredPosts.length > 5 && (\n <p>\n {selectedFilterCategory === 'boosts'\n ? t`You don't have to read everything.`\n : t`That's all.`}{' '}\n <button\n type=\"button\"\n class=\"textual\"\n onClick={() => {\n scrollableRef.current.scrollTop = 0;\n }}\n >\n <Trans>Back to top</Trans>\n </button>\n .\n </p>\n )}\n </footer>\n </>\n )}\n </main>\n </div>\n {showHelp && (\n <Modal onClose={() => setShowHelp(false)}>\n <div class=\"sheet\" id=\"catchup-help-sheet\">\n <button\n type=\"button\"\n class=\"sheet-close\"\n onClick={() => setShowHelp(false)}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>\n <Trans>Help</Trans>\n </h2>\n </header>\n <main>\n <dl>\n <dt>\n <Trans>Top links</Trans>\n </dt>\n <dd>\n <Trans>\n Links shared by followings, sorted by shared counts, boosts\n and likes.\n </Trans>\n </dd>\n <dt>\n <Trans>Sort: Density</Trans>\n </dt>\n <dd>\n <Trans>\n Posts are sorted by information density or depth. Shorter\n posts are \"lighter\" while longer posts are \"heavier\". Posts\n with photos are \"heavier\" than posts without photos.\n </Trans>\n </dd>\n <dt>\n <Trans>Group: Authors</Trans>\n </dt>\n <dd>\n <Trans>\n Posts are grouped by authors, sorted by posts count per\n author.\n </Trans>\n </dd>\n <dt>\n <Trans>Keyboard shortcuts</Trans>\n </dt>\n {/* <dd>\n <kbd>j</kbd>: <Trans>Next post</Trans>\n </dd>\n <dd>\n <kbd>k</kbd>: <Trans>Previous post</Trans>\n </dd>\n <dd>\n <kbd>l</kbd>: <Trans>Next author</Trans>\n </dd>\n <dd>\n <kbd>h</kbd>: <Trans>Previous author</Trans>\n </dd>\n <dd>\n <kbd>Enter</kbd>: <Trans>Open post details</Trans>\n </dd>\n <dd>\n <kbd>.</kbd>: <Trans>Scroll to top</Trans>\n </dd> */}\n <dd>\n <table>\n <tbody>\n <tr>\n <td>\n <Trans>Next post</Trans>\n </td>\n <td>\n <kbd>j</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Previous post</Trans>\n </td>\n <td>\n <kbd>k</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Next author</Trans>\n </td>\n <td>\n <kbd>l</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Previous author</Trans>\n </td>\n <td>\n <kbd>h</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Open post details</Trans>\n </td>\n <td>\n <kbd>Enter</kbd>\n </td>\n </tr>\n <tr>\n <td>\n <Trans>Scroll to top</Trans>\n </td>\n <td>\n <kbd>.</kbd>\n </td>\n </tr>\n </tbody>\n </table>\n </dd>\n </dl>\n </main>\n </div>\n </Modal>\n )}\n </div>\n );\n}\n\nconst PostLine = memo(\n function ({ post }) {\n const {\n id,\n account,\n group,\n reblog,\n inReplyToId,\n inReplyToAccountId,\n _followedTags: isFollowedTags,\n _filtered: filterInfo,\n visibility,\n __BOOSTERS,\n } = post;\n const isReplyTo = inReplyToId && inReplyToAccountId !== account.id;\n const isFiltered = !!filterInfo;\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...post,\n });\n }\n };\n\n return (\n <article\n class={`post-line ${\n group\n ? 'group'\n : reblog\n ? 'reblog'\n : isFollowedTags?.length\n ? 'followed-tags'\n : ''\n } ${isReplyTo ? 'reply-to' : ''} ${\n isFiltered ? 'filtered' : ''\n } visibility-${visibility}`}\n onMouseEnter={debugHover}\n >\n <span class=\"post-author\">\n {reblog ? (\n <span class=\"post-reblog-avatar\">\n <Avatar\n url={account.avatarStatic || account.avatar}\n squircle={account.bot}\n />\n {__BOOSTERS?.size > 0\n ? [...__BOOSTERS].map((b) => (\n <Avatar url={b.avatarStatic || b.avatar} squircle={b.bot} />\n ))\n : ''}{' '}\n <Icon icon=\"rocket\" />{' '}\n {/* <Avatar\n url={reblog.account.avatarStatic || reblog.account.avatar}\n squircle={reblog.account.bot}\n /> */}\n <NameText account={reblog.account} showAvatar />\n </span>\n ) : (\n <NameText account={account} showAvatar />\n )}\n </span>\n <PostPeek post={reblog || post} filterInfo={filterInfo} />\n <span class=\"post-meta\">\n <PostStats post={reblog || post} />{' '}\n <RelativeTime\n datetime={new Date(reblog?.createdAt || post.createdAt)}\n format=\"micro\"\n />\n </span>\n </article>\n );\n },\n (oldProps, newProps) => {\n return oldProps?.post?.id === newProps?.post?.id;\n },\n);\n\nconst IntersectionPostLineItem = ({ root, to, ...props }) => {\n const ref = useRef();\n const [show, setShow] = useState(false);\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n const entry = entries[0];\n if (entry.isIntersecting) {\n queueMicrotask(() => setShow(true));\n observer.unobserve(ref.current);\n }\n },\n {\n root,\n rootMargin: `${Math.max(320, screen.height * 0.75)}px`,\n },\n );\n if (ref.current) observer.observe(ref.current);\n return () => {\n if (ref.current) observer.unobserve(ref.current);\n };\n }, []);\n\n return show ? (\n <li>\n <Link to={to}>\n <PostLine {...props} />\n </Link>\n </li>\n ) : (\n <li ref={ref} style={{ height: '4em' }} />\n );\n};\n\n// A media speak a thousand words\nconst MEDIA_DENSITY = 8;\nconst CARD_DENSITY = 8;\nfunction postDensity(post) {\n const { spoilerText, content, poll, mediaAttachments, card } = post;\n const pollContent = poll?.options?.length\n ? poll.options.reduce((acc, cur) => acc + cur.title, '')\n : '';\n const density =\n (spoilerText.length + htmlContentLength(content) + pollContent.length) /\n 140 +\n (mediaAttachments?.length\n ? MEDIA_DENSITY * mediaAttachments.length\n : card?.image\n ? CARD_DENSITY\n : 0);\n return density;\n}\n\nconst MEDIA_SIZE = 48;\n\nfunction PostPeek({ post, filterInfo }) {\n const {\n spoilerText,\n sensitive,\n content,\n emojis,\n poll,\n mediaAttachments,\n card,\n inReplyToId,\n inReplyToAccountId,\n account,\n _thread,\n } = post;\n const isThread =\n (inReplyToId && inReplyToAccountId === account.id) || !!_thread;\n\n const readingExpandSpoilers = useMemo(() => {\n const prefs = store.account.get('preferences') || {};\n return !!prefs['reading:expand:spoilers'];\n }, []);\n // const readingExpandSpoilers = true;\n const showMedia = readingExpandSpoilers || (!spoilerText && !sensitive);\n const postText = content ? statusPeek(post) : '';\n\n const showPostContent = !spoilerText || readingExpandSpoilers;\n\n return (\n <div class=\"post-peek\" title={!spoilerText ? postText : ''}>\n <span class=\"post-peek-content\">\n {isThread && !showPostContent && (\n <>\n <span class=\"post-peek-tag post-peek-thread\">Thread</span>{' '}\n </>\n )}\n {!!filterInfo ? (\n <span class=\"post-peek-filtered\">\n {/* Filtered{filterInfo?.titlesStr ? `: ${filterInfo.titlesStr}` : ''} */}\n {filterInfo?.titlesStr\n ? t`Filtered: ${filterInfo.titlesStr}`\n : t`Filtered`}\n </span>\n ) : (\n <>\n {!!spoilerText && (\n <span class=\"post-peek-spoiler\">\n <Icon\n icon={`${readingExpandSpoilers ? 'eye-open' : 'eye-close'}`}\n />{' '}\n {spoilerText}\n </span>\n )}\n {showPostContent && (\n <div class=\"post-peek-html\">\n {isThread && (\n <>\n <span class=\"post-peek-tag post-peek-thread\">\n <Trans>Thread</Trans>\n </span>{' '}\n </>\n )}\n {!!content && (\n <div\n dangerouslySetInnerHTML={{\n __html: emojifyText(content, emojis),\n }}\n />\n )}\n {!!poll?.options?.length &&\n poll.options.map((o) => (\n <div>\n {poll.multiple ? '▪️' : '•'} {o.title}\n </div>\n ))}\n {!content &&\n mediaAttachments?.length === 1 &&\n mediaAttachments[0].description && (\n <>\n <span class=\"post-peek-tag post-peek-alt\">ALT</span>{' '}\n <div>{mediaAttachments[0].description}</div>\n </>\n )}\n </div>\n )}\n </>\n )}\n </span>\n {!filterInfo && (\n <span class=\"post-peek-post-content\">\n {!!poll && (\n <span class=\"post-peek-tag post-peek-poll\">\n <Icon icon=\"poll\" size=\"s\" />\n <Trans>Poll</Trans>\n </span>\n )}\n {!!mediaAttachments?.length\n ? mediaAttachments.map((m) => {\n const mediaURL = m.previewUrl || m.url;\n const remoteMediaURL = m.previewRemoteUrl || m.remoteUrl;\n const width = m.meta?.original\n ? m.meta.original.width\n : m.meta?.small?.width || m.meta?.original?.width;\n const height = m.meta?.original\n ? m.meta.original.height\n : m.meta?.small?.height || m.meta?.original?.height;\n return (\n <span key={m.id} class=\"post-peek-media\">\n {{\n image:\n (mediaURL || remoteMediaURL) && showMedia ? (\n <img\n src={mediaURL}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={m.description}\n loading=\"lazy\"\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n style={{\n '--anim-duration': `${Math.min(\n Math.max(Math.max(width, height) / 100, 5),\n 120,\n )}s`,\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">🖼</span>\n ),\n gifv:\n (mediaURL || remoteMediaURL) && showMedia ? (\n <img\n src={mediaURL}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={m.description}\n loading=\"lazy\"\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">🎞️</span>\n ),\n video:\n (mediaURL || remoteMediaURL) && showMedia ? (\n <img\n src={mediaURL}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={m.description}\n loading=\"lazy\"\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">📹</span>\n ),\n audio: <span class=\"post-peek-faux-media\">🎵</span>,\n }[m.type] || null}\n </span>\n );\n })\n : !!card &&\n card.image &&\n showMedia && (\n <span\n class={`post-peek-media post-peek-card card-${\n card.type || ''\n }`}\n >\n {card.image ? (\n <img\n src={card.image}\n width={MEDIA_SIZE}\n height={MEDIA_SIZE}\n alt={\n card.title || card.description || card.imageDescription\n }\n loading=\"lazy\"\n style={{\n '--anim-duration':\n card.width &&\n card.height &&\n `${Math.min(\n Math.max(\n Math.max(card.width, card.height) / 100,\n 5,\n ),\n 120,\n )}s`,\n }}\n />\n ) : (\n <span class=\"post-peek-faux-media\">🔗</span>\n )}\n </span>\n )}\n </span>\n )}\n </div>\n );\n}\n\nfunction PostStats({ post }) {\n const { reblogsCount, repliesCount, favouritesCount } = post;\n return (\n <span class=\"post-stats\">\n {repliesCount > 0 && (\n <span class=\"post-stat-replies\">\n <Icon icon=\"comment2\" size=\"s\" alt={t`Replies`} />{' '}\n {shortenNumber(repliesCount)}\n </span>\n )}\n {favouritesCount > 0 && (\n <span class=\"post-stat-likes\">\n <Icon icon=\"heart\" size=\"s\" alt={t`Likes`} />{' '}\n {shortenNumber(favouritesCount)}\n </span>\n )}\n {reblogsCount > 0 && (\n <span class=\"post-stat-boosts\">\n <Icon icon=\"rocket\" size=\"s\" alt={t`Boosts`} />{' '}\n {shortenNumber(reblogsCount)}\n </span>\n )}\n </span>\n );\n}\n\nfunction binByTime(data, key, numBins) {\n // Extract dates from data objects\n const dates = data.map((item) => new Date(item[key]));\n\n // Find minimum and maximum dates directly (avoiding Math.min/max)\n const minDate = dates.reduce(\n (acc, date) => (date < acc ? date : acc),\n dates[0],\n );\n const maxDate = dates.reduce(\n (acc, date) => (date > acc ? date : acc),\n dates[0],\n );\n\n // Calculate the time span in milliseconds\n const range = maxDate.getTime() - minDate.getTime();\n\n // Create empty bins and loop through data\n const bins = Array.from({ length: numBins }, () => []);\n data.forEach((item) => {\n const date = new Date(item[key]);\n const normalized = (date.getTime() - minDate.getTime()) / range;\n const binIndex = Math.floor(normalized * (numBins - 1));\n bins[binIndex].push(item);\n });\n\n return bins;\n}\n\nexport default Catchup;\n","import { t, Trans } from '@lingui/macro';\nimport { useRef } from 'preact/hooks';\n\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Favourites() {\n useTitle(t`Likes`, '/favourites');\n const { masto, instance } = api();\n const favouritesIterator = useRef();\n async function fetchFavourites(firstLoad) {\n if (firstLoad || !favouritesIterator.current) {\n favouritesIterator.current = masto.v1.favourites.list({ limit: LIMIT });\n }\n return await favouritesIterator.current.next();\n }\n\n return (\n <Timeline\n title={t`Likes`}\n id=\"favourites\"\n emptyText={t`No likes yet. Go like something!`}\n errorText={t`Unable to load likes.`}\n instance={instance}\n fetchItems={fetchFavourites}\n />\n );\n}\n\nexport default Favourites;\n","import './filters.css';\n\nimport { i18n } from '@lingui/core';\nimport { msg, Plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { useEffect, useReducer, useRef, useState } from 'preact/hooks';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport MenuConfirm from '../components/menu-confirm';\nimport Modal from '../components/modal';\nimport NavMenu from '../components/nav-menu';\nimport RelativeTime from '../components/relative-time';\nimport { api } from '../utils/api';\nimport i18nDuration from '../utils/i18n-duration';\nimport useInterval from '../utils/useInterval';\nimport useTitle from '../utils/useTitle';\n\nconst FILTER_CONTEXT = ['home', 'public', 'notifications', 'thread', 'account'];\nconst FILTER_CONTEXT_UNIMPLEMENTED = ['notifications', 'thread', 'account'];\nconst FILTER_CONTEXT_LABELS = {\n home: msg`Home and lists`,\n notifications: msg`Notifications`,\n public: msg`Public timelines`,\n thread: msg`Conversations`,\n account: msg`Profiles`,\n};\n\nconst EXPIRY_DURATIONS = [\n 0, // forever\n 30 * 60, // 30 minutes\n 60 * 60, // 1 hour\n 6 * 60 * 60, // 6 hours\n 12 * 60 * 60, // 12 hours\n 60 * 60 * 24, // 24 hours\n 60 * 60 * 24 * 7, // 7 days\n 60 * 60 * 24 * 30, // 30 days\n];\n\nconst EXPIRY_DURATIONS_LABELS = {\n 0: msg`Never`,\n 1800: i18nDuration(30, 'minute'),\n 3600: i18nDuration(1, 'hour'),\n 21600: i18nDuration(6, 'hour'),\n 43200: i18nDuration(12, 'hour'),\n 86_400: i18nDuration(24, 'hour'),\n 604_800: i18nDuration(7, 'day'),\n 2_592_000: i18nDuration(30, 'day'),\n};\n\nfunction Filters() {\n const { masto } = api();\n useTitle(t`Filters`, `/ft`);\n const [uiState, setUIState] = useState('default');\n const [showFiltersAddEditModal, setShowFiltersAddEditModal] = useState(false);\n\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n const [filters, setFilters] = useState([]);\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const filters = await masto.v2.filters.list();\n filters.sort((a, b) => a.title.localeCompare(b.title));\n filters.forEach((filter) => {\n if (filter.keywords?.length) {\n filter.keywords.sort((a, b) => a.id - b.id);\n }\n });\n console.log(filters);\n setFilters(filters);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n return (\n <div id=\"filters-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"timeline-deck deck\">\n <header>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n </div>\n <h1>\n <Trans>Filters</Trans>\n </h1>\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n setShowFiltersAddEditModal(true);\n }}\n >\n <Icon icon=\"plus\" size=\"l\" alt={t`New filter`} />\n </button>\n </div>\n </div>\n </header>\n <main>\n {filters.length > 0 ? (\n <>\n <ul class=\"filters-list\">\n {filters.map((filter) => {\n const { id, title, expiresAt, keywords } = filter;\n return (\n <li key={id}>\n <div>\n <h2>{title}</h2>\n {keywords?.length > 0 && (\n <div>\n {keywords.map((k) => (\n <>\n <span class=\"tag collapsed insignificant\">\n {k.wholeWord ? `“${k.keyword}”` : k.keyword}\n </span>{' '}\n </>\n ))}\n </div>\n )}\n <small class=\"insignificant\">\n <ExpiryStatus expiresAt={expiresAt} />\n </small>\n </div>\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n setShowFiltersAddEditModal({\n filter,\n });\n }}\n >\n <Icon icon=\"pencil\" size=\"l\" alt=\"Edit filter\" />\n </button>\n </li>\n );\n })}\n </ul>\n {filters.length > 1 && (\n <footer class=\"ui-state\">\n <small class=\"insignificant\">\n <Plural\n value={filters.length}\n one=\"# filter\"\n other=\"# filters\"\n />\n </small>\n </footer>\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load filters.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No filters yet.</Trans>\n </p>\n )}\n </main>\n </div>\n {!!showFiltersAddEditModal && (\n <Modal\n title={t`Add filter`}\n onClose={() => {\n setShowFiltersAddEditModal(false);\n }}\n >\n <FiltersAddEdit\n filter={showFiltersAddEditModal?.filter}\n onClose={(result) => {\n if (result.state === 'success') {\n reload();\n }\n setShowFiltersAddEditModal(false);\n }}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nlet _id = 1;\nconst incID = () => _id++;\nfunction FiltersAddEdit({ filter, onClose }) {\n const { _ } = useLingui();\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const editMode = !!filter;\n const { context, expiresAt, id, keywords, title, filterAction } =\n filter || {};\n const hasExpiry = !!expiresAt;\n const expiresAtDate = hasExpiry && new Date(expiresAt);\n const [editKeywords, setEditKeywords] = useState(keywords || []);\n const keywordsRef = useRef();\n\n // Hacky way of handling removed keywords for both existing and new ones\n const [removedKeywordIDs, setRemovedKeywordIDs] = useState([]);\n const [removedKeyword_IDs, setRemovedKeyword_IDs] = useState([]);\n\n const filteredEditKeywords = editKeywords.filter(\n (k) =>\n !removedKeywordIDs.includes(k.id) && !removedKeyword_IDs.includes(k._id),\n );\n\n return (\n <div class=\"sheet\" id=\"filters-add-edit-modal\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>{editMode ? t`Edit filter` : t`New filter`}</h2>\n </header>\n <main>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const formData = new FormData(e.target);\n const title = formData.get('title');\n const keywordIDs = formData.getAll('keyword_attributes[][id]');\n const keywordKeywords = formData.getAll(\n 'keyword_attributes[][keyword]',\n );\n // const keywordWholeWords = formData.getAll(\n // 'keyword_attributes[][whole_word]',\n // );\n // Not using getAll because it skips the empty checkboxes\n const keywordWholeWords = [\n ...keywordsRef.current.querySelectorAll(\n 'input[name=\"keyword_attributes[][whole_word]\"]',\n ),\n ].map((i) => i.checked);\n const keywordsAttributes = keywordKeywords.map((k, i) => ({\n id: keywordIDs[i] || undefined,\n keyword: k,\n wholeWord: keywordWholeWords[i],\n }));\n // if (editMode && keywords?.length) {\n // // Find which one got deleted and add to keywordsAttributes\n // keywords.forEach((k) => {\n // if (!keywordsAttributes.find((ka) => ka.id === k.id)) {\n // keywordsAttributes.push({\n // ...k,\n // _destroy: true,\n // });\n // }\n // });\n // }\n if (editMode && removedKeywordIDs?.length) {\n removedKeywordIDs.forEach((id) => {\n keywordsAttributes.push({\n id,\n _destroy: true,\n });\n });\n }\n const context = formData.getAll('context');\n let expiresIn = formData.get('expires_in');\n const filterAction = formData.get('filter_action');\n console.log({\n title,\n keywordIDs,\n keywords: keywordKeywords,\n wholeWords: keywordWholeWords,\n keywordsAttributes,\n context,\n expiresIn,\n filterAction,\n });\n\n // Required fields\n if (!title || !context?.length) {\n return;\n }\n\n setUIState('loading');\n\n (async () => {\n try {\n let filterResult;\n\n if (editMode) {\n if (expiresIn === '' || expiresIn === null) {\n // No value\n // Preserve existing expiry if not specified\n // Seconds from now to expiresAtDate\n // Other clients don't do this\n if (hasExpiry) {\n expiresIn = Math.floor(\n (expiresAtDate - new Date()) / 1000,\n );\n } else {\n expiresIn = null;\n }\n } else if (expiresIn === '0' || expiresIn === 0) {\n // 0 = Never\n expiresIn = null;\n } else {\n expiresIn = +expiresIn;\n }\n filterResult = await masto.v2.filters.$select(id).update({\n title,\n context,\n expiresIn,\n keywordsAttributes,\n filterAction,\n });\n } else {\n expiresIn = +expiresIn || null;\n filterResult = await masto.v2.filters.create({\n title,\n context,\n expiresIn,\n keywordsAttributes,\n filterAction,\n });\n }\n console.log({ filterResult });\n setUIState('default');\n onClose?.({\n state: 'success',\n filter: filterResult,\n });\n } catch (error) {\n console.error(error);\n setUIState('error');\n alert(\n editMode\n ? t`Unable to edit filter`\n : t`Unable to create filter`,\n );\n }\n })();\n }}\n >\n <div class=\"filter-form-row\">\n <label>\n <b>\n <Trans>Title</Trans>\n </b>\n <input\n type=\"text\"\n name=\"title\"\n defaultValue={title}\n disabled={uiState === 'loading'}\n dir=\"auto\"\n required\n />\n </label>\n </div>\n <div class=\"filter-form-keywords\" ref={keywordsRef}>\n {filteredEditKeywords.length ? (\n <ul class=\"filter-keywords\">\n {filteredEditKeywords.map((k) => {\n const { id, keyword, wholeWord, _id } = k;\n return (\n <li key={`${id}-${_id}`}>\n <input\n type=\"hidden\"\n name=\"keyword_attributes[][id]\"\n value={id}\n />\n <input\n name=\"keyword_attributes[][keyword]\"\n type=\"text\"\n defaultValue={keyword}\n disabled={uiState === 'loading'}\n required\n dir=\"auto\"\n />\n <div class=\"filter-keyword-actions\">\n <label>\n <input\n name=\"keyword_attributes[][whole_word]\"\n type=\"checkbox\"\n value={id} // Hacky way to map checkbox boolean to the keyword id\n defaultChecked={wholeWord}\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>Whole word</Trans>\n </label>\n <button\n type=\"button\"\n class=\"light danger small\"\n disabled={uiState === 'loading'}\n onClick={() => {\n if (id) {\n removedKeywordIDs.push(id);\n setRemovedKeywordIDs([...removedKeywordIDs]);\n } else if (_id) {\n removedKeyword_IDs.push(_id);\n setRemovedKeyword_IDs([...removedKeyword_IDs]);\n }\n }}\n >\n <Icon icon=\"x\" alt={t`Remove`} />\n </button>\n </div>\n </li>\n );\n })}\n </ul>\n ) : (\n <div class=\"filter-keywords\">\n <div class=\"insignificant\">\n <Trans>No keywords. Add one.</Trans>\n </div>\n </div>\n )}\n <footer class=\"filter-keywords-footer\">\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => {\n setEditKeywords([\n ...editKeywords,\n {\n _id: incID(),\n keyword: '',\n wholeWord: true,\n },\n ]);\n setTimeout(() => {\n // Focus last input\n const fields =\n keywordsRef.current.querySelectorAll(\n 'input[type=\"text\"]',\n );\n fields[fields.length - 1]?.focus?.();\n }, 10);\n }}\n >\n <Trans>Add keyword</Trans>\n </button>{' '}\n {filteredEditKeywords?.length > 1 && (\n <small class=\"insignificant\">\n <Plural\n value={filteredEditKeywords.length}\n one=\"# keyword\"\n other=\"# keywords\"\n />\n </small>\n )}\n </footer>\n </div>\n <div class=\"filter-form-cols\">\n <div class=\"filter-form-col\">\n <div>\n <b>\n <Trans>Filter from…</Trans>\n </b>\n </div>\n {FILTER_CONTEXT.map((ctx) => (\n <div>\n <label\n class={\n FILTER_CONTEXT_UNIMPLEMENTED.includes(ctx)\n ? 'insignificant'\n : ''\n }\n >\n <input\n type=\"checkbox\"\n name=\"context\"\n value={ctx}\n defaultChecked={!!context ? context.includes(ctx) : true}\n disabled={uiState === 'loading'}\n />{' '}\n {_(FILTER_CONTEXT_LABELS[ctx])}\n {FILTER_CONTEXT_UNIMPLEMENTED.includes(ctx) ? '*' : ''}\n </label>{' '}\n </div>\n ))}\n <p>\n <small class=\"insignificant\">\n <Trans>* Not implemented yet</Trans>\n </small>\n </p>\n </div>\n <div class=\"filter-form-col\">\n {editMode && (\n <Trans>\n Status:{' '}\n <b>\n <ExpiryStatus expiresAt={expiresAt} showNeverExpires />\n </b>\n </Trans>\n )}\n <div>\n <label for=\"filters-expires_in\">\n {editMode ? t`Change expiry` : t`Expiry`}\n </label>\n <select\n id=\"filters-expires_in\"\n name=\"expires_in\"\n disabled={uiState === 'loading'}\n defaultValue={editMode ? undefined : 0}\n >\n {editMode && <option></option>}\n {EXPIRY_DURATIONS.map((v) => (\n <option value={v}>\n {typeof EXPIRY_DURATIONS_LABELS[v] === 'function'\n ? EXPIRY_DURATIONS_LABELS[v]()\n : _(EXPIRY_DURATIONS_LABELS[v])}\n </option>\n ))}\n </select>\n </div>\n <p>\n <Trans>Filtered post will be…</Trans>\n <br />\n <label class=\"ib\">\n <input\n type=\"radio\"\n name=\"filter_action\"\n value=\"warn\"\n defaultChecked={filterAction === 'warn' || !editMode}\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>minimized</Trans>\n </label>{' '}\n <label class=\"ib\">\n <input\n type=\"radio\"\n name=\"filter_action\"\n value=\"hide\"\n defaultChecked={filterAction === 'hide'}\n disabled={uiState === 'loading'}\n />{' '}\n <Trans>hidden</Trans>\n </label>\n </p>\n </div>\n </div>\n <footer class=\"filter-form-footer\">\n <span>\n <button type=\"submit\" disabled={uiState === 'loading'}>\n {editMode ? t`Save` : t`Create`}\n </button>{' '}\n <Loader abrupt hidden={uiState !== 'loading'} />\n </span>\n {editMode && (\n <MenuConfirm\n disabled={uiState === 'loading'}\n align=\"end\"\n menuItemClassName=\"danger\"\n confirmLabel={t`Delete this filter?`}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n await masto.v2.filters.$select(id).remove();\n setUIState('default');\n onClose?.({\n state: 'success',\n });\n } catch (e) {\n console.error(e);\n setUIState('error');\n alert(t`Unable to delete filter.`);\n }\n })();\n }}\n >\n <button\n type=\"button\"\n class=\"light danger\"\n onClick={() => {}}\n disabled={uiState === 'loading'}\n >\n <Trans>Delete…</Trans>\n </button>\n </MenuConfirm>\n )}\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nfunction ExpiryStatus({ expiresAt, showNeverExpires }) {\n const hasExpiry = !!expiresAt;\n const expiresAtDate = hasExpiry && new Date(expiresAt);\n const expired = hasExpiry && expiresAtDate <= new Date();\n\n // If less than a minute left, re-render interval every second, else every minute\n const [_, rerender] = useReducer((c) => c + 1, 0);\n useInterval(rerender, expired || 30_000);\n\n return expired ? (\n t`Expired`\n ) : hasExpiry ? (\n <Trans>\n Expiring <RelativeTime datetime={expiresAtDate} />\n </Trans>\n ) : (\n showNeverExpires && t`Never expires`\n );\n}\n\nexport default Filters;\n","import { Plural, t, Trans } from '@lingui/macro';\nimport { useEffect, useState } from 'preact/hooks';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport NavMenu from '../components/nav-menu';\nimport { api } from '../utils/api';\nimport { fetchFollowedTags } from '../utils/followed-tags';\nimport useTitle from '../utils/useTitle';\n\nfunction FollowedHashtags() {\n const { masto, instance } = api();\n useTitle(t`Followed Hashtags`, `/fh`);\n const [uiState, setUIState] = useState('default');\n\n const [followedHashtags, setFollowedHashtags] = useState([]);\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const tags = await fetchFollowedTags();\n setFollowedHashtags(tags);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, []);\n\n return (\n <div id=\"followed-hashtags-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"timeline-deck deck\">\n <header>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n </div>\n <h1>\n <Trans>Followed Hashtags</Trans>\n </h1>\n <div class=\"header-side\" />\n </div>\n </header>\n <main>\n {followedHashtags.length > 0 ? (\n <>\n <ul class=\"link-list\">\n {followedHashtags.map((tag) => (\n <li>\n <Link\n to={\n instance\n ? `/${instance}/t/${tag.name}`\n : `/t/${tag.name}`\n }\n >\n <Icon icon=\"hashtag\" alt=\"#\" /> <span>{tag.name}</span>\n </Link>\n </li>\n ))}\n </ul>\n {followedHashtags.length > 1 && (\n <footer class=\"ui-state\">\n <small class=\"insignificant\">\n <Plural\n value={followedHashtags.length}\n one=\"# hashtag\"\n other=\"# hashtags\"\n />\n </small>\n </footer>\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load followed hashtags.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No hashtags followed yet.</Trans>\n </p>\n )}\n </main>\n </div>\n </div>\n );\n}\n\nexport default FollowedHashtags;\n","import { t, Trans } from '@lingui/macro';\nimport { useEffect, useRef } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport states, { getStatus, saveStatus } from '../utils/states';\nimport supports from '../utils/supports';\nimport {\n assignFollowedTags,\n clearFollowedTagsState,\n dedupeBoosts,\n} from '../utils/timeline-utils';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Following({ title, path, id, ...props }) {\n useTitle(\n title ||\n t({\n id: 'following.title',\n message: 'Following',\n }),\n path || '/following',\n );\n const { masto, streaming, instance } = api();\n const snapStates = useSnapshot(states);\n const homeIterator = useRef();\n const latestItem = useRef();\n __BENCHMARK.end('time-to-following');\n\n console.debug('RENDER Following', title, id);\n const supportsPixelfed = supports('@pixelfed/home-include-reblogs');\n\n async function fetchHome(firstLoad) {\n if (firstLoad || !homeIterator.current) {\n __BENCHMARK.start('fetch-home-first');\n homeIterator.current = masto.v1.timelines.home.list({ limit: LIMIT });\n }\n if (supportsPixelfed && homeIterator.current?.nextParams) {\n if (typeof homeIterator.current.nextParams === 'string') {\n homeIterator.current.nextParams += '&include_reblogs=true';\n } else {\n homeIterator.current.nextParams.include_reblogs = true;\n }\n }\n const results = await homeIterator.current.next();\n let { value } = results;\n if (value?.length) {\n let latestItemChanged = false;\n if (firstLoad) {\n if (value[0].id !== latestItem.current) {\n latestItemChanged = true;\n }\n latestItem.current = value[0].id;\n console.log('First load', latestItem.current);\n }\n\n // value = filteredItems(value, 'home');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n value = dedupeBoosts(value, instance);\n if (firstLoad && latestItemChanged) clearFollowedTagsState();\n assignFollowedTags(value, instance);\n\n // ENFORCE sort by datetime (Latest first)\n value.sort((a, b) => {\n const aDate = new Date(a.createdAt);\n const bDate = new Date(b.createdAt);\n return bDate - aDate;\n });\n }\n __BENCHMARK.end('fetch-home-first');\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const opts = {\n limit: 5,\n since_id: latestItem.current,\n };\n if (supports('@pixelfed/home-include-reblogs')) {\n opts.include_reblogs = true;\n }\n const results = await masto.v1.timelines.home.list(opts).next();\n let { value } = results;\n console.log('checkForUpdates', latestItem.current, value);\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n latestItem.current = value[0].id;\n value = dedupeBoosts(value, instance);\n value = filteredItems(value, 'home');\n if (value.some((item) => !item.reblog)) {\n return true;\n }\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n useEffect(() => {\n let sub;\n (async () => {\n if (streaming) {\n sub = streaming.user.subscribe();\n console.log('🎏 Streaming user', sub);\n for await (const entry of sub) {\n if (!sub) break;\n if (entry.event === 'status.update') {\n const status = entry.payload;\n console.log(`🔄 Status ${status.id} updated`);\n saveStatus(status, instance);\n } else if (entry.event === 'delete') {\n const statusID = entry.payload;\n console.log(`❌ Status ${statusID} deleted`);\n // delete states.statuses[statusID];\n const s = getStatus(statusID, instance);\n if (s) s._deleted = true;\n }\n }\n console.log('💥 Streaming user loop STOPPED');\n }\n })();\n return () => {\n sub?.unsubscribe?.();\n sub = null;\n };\n }, [streaming]);\n\n return (\n <Timeline\n title={title || t({ id: 'following.title', message: 'Following' })}\n id={id || 'following'}\n emptyText={t`Nothing to see here.`}\n errorText={t`Unable to load posts.`}\n instance={instance}\n fetchItems={fetchHome}\n checkForUpdates={checkForUpdates}\n useItemID\n boostsCarousel={snapStates.settings.boostsCarousel}\n {...props}\n // allowFilters\n filterContext=\"home\"\n showFollowedTags\n showReplyParent\n />\n );\n}\n\nexport default Following;\n","import { plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport {\n FocusableItem,\n MenuDivider,\n MenuGroup,\n MenuHeader,\n MenuItem,\n} from '@szhsin/react-menu';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport { useNavigate, useParams, useSearchParams } from 'react-router-dom';\n\nimport Icon from '../components/icon';\nimport MenuConfirm from '../components/menu-confirm';\nimport Menu2 from '../components/menu2';\nimport { SHORTCUTS_LIMIT } from '../components/shortcuts-settings';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport { isMediaFirstInstance } from '../utils/store-utils';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\n// Limit is 4 per \"mode\"\n// https://github.com/mastodon/mastodon/issues/15194\n// Hard-coded https://github.com/mastodon/mastodon/blob/19614ba2477f3d12468f5ec251ce1cc5f8c6210c/app/models/tag_feed.rb#L4\nconst TAGS_LIMIT_PER_MODE = 4;\nconst TOTAL_TAGS_LIMIT = TAGS_LIMIT_PER_MODE + 1;\n\nfunction Hashtags({ media: mediaView, columnMode, ...props }) {\n // const navigate = useNavigate();\n let { hashtag, ...params } = columnMode ? {} : useParams();\n if (props.hashtag) hashtag = props.hashtag;\n let hashtags = hashtag.trim().split(/[\\s+]+/);\n hashtags.sort();\n hashtag = hashtags[0];\n const [searchParams, setSearchParams] = useSearchParams();\n const media = mediaView || !!searchParams.get('media');\n const linkParams = media ? '?media=1' : '';\n\n const { masto, instance, authenticated } = api({\n instance: props?.instance || params.instance,\n });\n const {\n masto: currentMasto,\n instance: currentInstance,\n authenticated: currentAuthenticated,\n } = api();\n const hashtagTitle = hashtags.map((t) => `#${t}`).join(' ');\n const title = instance\n ? media\n ? t`${hashtagTitle} (Media only) on ${instance}`\n : t`${hashtagTitle} on ${instance}`\n : media\n ? t`${hashtagTitle} (Media only)`\n : t`${hashtagTitle}`;\n useTitle(title, `/:instance?/t/:hashtag`);\n const latestItem = useRef();\n\n const mediaFirst = useMemo(() => isMediaFirstInstance(), []);\n\n // const hashtagsIterator = useRef();\n const maxID = useRef(undefined);\n async function fetchHashtags(firstLoad) {\n // if (firstLoad || !hashtagsIterator.current) {\n // hashtagsIterator.current = masto.v1.timelines.tag.$select(hashtag).list({\n // limit: LIMIT,\n // any: hashtags.slice(1),\n // });\n // }\n // const results = await hashtagsIterator.current.next();\n\n // NOTE: Temporary fix for listHashtag not persisting `any` in subsequent calls.\n const results = await masto.v1.timelines.tag\n .$select(hashtag)\n .list({\n limit: LIMIT,\n any: hashtags.slice(1),\n maxId: firstLoad ? undefined : maxID.current,\n onlyMedia: media ? true : undefined,\n })\n .next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'public');\n value.forEach((item) => {\n saveStatus(item, instance, {\n skipThreading: media || mediaFirst, // If media view, no need to form threads\n });\n });\n\n maxID.current = value[value.length - 1].id;\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.timelines.tag\n .$select(hashtag)\n .list({\n limit: 1,\n any: hashtags.slice(1),\n since_id: latestItem.current,\n onlyMedia: media,\n })\n .next();\n let { value } = results;\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n value = filteredItems(value, 'public');\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n const [followUIState, setFollowUIState] = useState('default');\n const [info, setInfo] = useState();\n // Get hashtag info\n useEffect(() => {\n (async () => {\n try {\n const info = await masto.v1.tags.$select(hashtag).fetch();\n console.log(info);\n setInfo(info);\n } catch (e) {\n console.error(e);\n }\n })();\n }, [hashtag]);\n\n const reachLimit = hashtags.length >= TOTAL_TAGS_LIMIT;\n\n const [featuredUIState, setFeaturedUIState] = useState('default');\n const [featuredTags, setFeaturedTags] = useState([]);\n const [isFeaturedTag, setIsFeaturedTag] = useState(false);\n useEffect(() => {\n if (!authenticated) return;\n (async () => {\n try {\n const featuredTags = await masto.v1.featuredTags.list();\n setFeaturedTags(featuredTags);\n setIsFeaturedTag(\n featuredTags.some(\n (tag) => tag.name.toLowerCase() === hashtag.toLowerCase(),\n ),\n );\n } catch (e) {\n console.error(e);\n }\n })();\n }, []);\n\n return (\n <Timeline\n key={instance + hashtagTitle}\n title={title}\n titleComponent={\n !!instance && (\n <h1 class=\"header-double-lines\">\n <b dir=\"auto\">{hashtagTitle}</b>\n <div>{instance}</div>\n </h1>\n )\n }\n id=\"hashtag\"\n instance={instance}\n emptyText={t`No one has posted anything with this tag yet.`}\n errorText={t`Unable to load posts with this tag`}\n fetchItems={fetchHashtags}\n checkForUpdates={checkForUpdates}\n useItemID\n view={media || mediaFirst ? 'media' : undefined}\n refresh={media}\n // allowFilters\n filterContext=\"public\"\n headerEnd={\n <Menu2\n portal\n setDownOverflow\n overflow=\"auto\"\n // viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n {!!info && hashtags.length === 1 && (\n <>\n <MenuConfirm\n subMenu\n confirm={info.following}\n confirmLabel={t`Unfollow #${hashtag}?`}\n disabled={followUIState === 'loading' || !authenticated}\n onClick={() => {\n setFollowUIState('loading');\n if (info.following) {\n // const yes = confirm(`Unfollow #${hashtag}?`);\n // if (!yes) {\n // setFollowUIState('default');\n // return;\n // }\n masto.v1.tags\n .$select(hashtag)\n .unfollow()\n .then(() => {\n setInfo({ ...info, following: false });\n showToast(t`Unfollowed #${hashtag}`);\n })\n .catch((e) => {\n alert(e);\n console.error(e);\n })\n .finally(() => {\n setFollowUIState('default');\n });\n } else {\n masto.v1.tags\n .$select(hashtag)\n .follow()\n .then(() => {\n setInfo({ ...info, following: true });\n showToast(t`Followed #${hashtag}`);\n })\n .catch((e) => {\n alert(e);\n console.error(e);\n })\n .finally(() => {\n setFollowUIState('default');\n });\n }\n }}\n >\n {info.following ? (\n <>\n <Icon icon=\"check-circle\" />{' '}\n <span>\n <Trans>Following…</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"plus\" />{' '}\n <span>\n <Trans>Follow</Trans>\n </span>\n </>\n )}\n </MenuConfirm>\n <MenuItem\n type=\"checkbox\"\n checked={isFeaturedTag}\n disabled={featuredUIState === 'loading' || !authenticated}\n onClick={() => {\n setFeaturedUIState('loading');\n if (isFeaturedTag) {\n const featuredTagID = featuredTags.find(\n (tag) => tag.name.toLowerCase() === hashtag.toLowerCase(),\n ).id;\n if (featuredTagID) {\n masto.v1.featuredTags\n .$select(featuredTagID)\n .remove()\n .then(() => {\n setIsFeaturedTag(false);\n showToast(t`Unfeatured on profile`);\n setFeaturedTags(\n featuredTags.filter(\n (tag) => tag.id !== featuredTagID,\n ),\n );\n })\n .catch((e) => {\n console.error(e);\n })\n .finally(() => {\n setFeaturedUIState('default');\n });\n } else {\n showToast(t`Unable to unfeature on profile`);\n }\n } else {\n masto.v1.featuredTags\n .create({\n name: hashtag,\n })\n .then((value) => {\n setIsFeaturedTag(true);\n showToast(t`Featured on profile`);\n setFeaturedTags(featuredTags.concat(value));\n })\n .catch((e) => {\n console.error(e);\n })\n .finally(() => {\n setFeaturedUIState('default');\n });\n }\n }}\n >\n {isFeaturedTag ? (\n <>\n <Icon icon=\"check-circle\" />\n <span>\n <Trans>Featured on profile</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"check-circle\" />\n <span>\n <Trans>Feature on profile</Trans>\n </span>\n </>\n )}\n </MenuItem>\n <MenuDivider />\n </>\n )}\n {!mediaFirst && (\n <>\n <MenuHeader className=\"plain\">\n <Trans>Filters</Trans>\n </MenuHeader>\n <MenuItem\n type=\"checkbox\"\n checked={!!media}\n onClick={() => {\n if (media) {\n searchParams.delete('media');\n } else {\n searchParams.set('media', '1');\n }\n setSearchParams(searchParams);\n }}\n >\n <Icon icon=\"check-circle\" alt=\"☑️\" />{' '}\n <span class=\"menu-grow\">\n <Trans>Media only</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n </>\n )}\n <FocusableItem className=\"menu-field\" disabled={reachLimit}>\n {({ ref }) => (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const newHashtag = e.target[0].value?.trim?.();\n // Use includes but need to be case insensitive\n if (\n newHashtag &&\n !hashtags.some(\n (t) => t.toLowerCase() === newHashtag.toLowerCase(),\n )\n ) {\n hashtags.push(newHashtag);\n hashtags.sort();\n // navigate(\n // instance\n // ? `/${instance}/t/${hashtags.join('+')}`\n // : `/t/${hashtags.join('+')}`,\n // );\n location.hash = instance\n ? `/${instance}/t/${hashtags.join('+')}`\n : `/t/${hashtags.join('+')}${linkParams}`;\n }\n }}\n >\n <Icon icon=\"hashtag\" />\n <input\n ref={ref}\n type=\"text\"\n placeholder={\n reachLimit\n ? plural(TOTAL_TAGS_LIMIT, {\n other: 'Max # tags',\n })\n : t`Add hashtag`\n }\n required\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck={false}\n // no spaces, no hashtags\n pattern=\"[^#][^\\s#]+[^#]\"\n disabled={reachLimit}\n dir=\"auto\"\n />\n </form>\n )}\n </FocusableItem>\n <MenuGroup takeOverflow>\n {hashtags.map((tag, i) => (\n <MenuItem\n key={tag}\n disabled={hashtags.length === 1}\n onClick={(e) => {\n hashtags.splice(i, 1);\n hashtags.sort();\n // navigate(\n // instance\n // ? `/${instance}/t/${hashtags.join('+')}`\n // : `/t/${hashtags.join('+')}`,\n // );\n location.hash = instance\n ? `/${instance}/t/${hashtags.join('+')}${linkParams}`\n : `/t/${hashtags.join('+')}${linkParams}`;\n }}\n >\n <Icon icon=\"x\" alt={t`Remove hashtag`} class=\"danger-icon\" />\n <span class=\"bidi-isolate\">\n <span class=\"more-insignificant\">#</span>\n {tag}\n </span>\n </MenuItem>\n ))}\n </MenuGroup>\n <MenuDivider />\n <MenuItem\n disabled={!currentAuthenticated}\n onClick={() => {\n if (states.shortcuts.length >= SHORTCUTS_LIMIT) {\n alert(\n plural(SHORTCUTS_LIMIT, {\n one: 'Max # shortcut reached. Unable to add shortcut.',\n other: 'Max # shortcuts reached. Unable to add shortcut.',\n }),\n );\n return;\n }\n const shortcut = {\n type: 'hashtag',\n hashtag: hashtags.join(' '),\n instance,\n media: media ? 'on' : undefined,\n };\n // Check if already exists\n const exists = states.shortcuts.some(\n (s) =>\n s.type === shortcut.type &&\n s.hashtag\n .split(/[\\s+]+/)\n .sort()\n .join(' ') ===\n shortcut.hashtag\n .split(/[\\s+]+/)\n .sort()\n .join(' ') &&\n (s.instance ? s.instance === shortcut.instance : true) &&\n (s.media ? !!s.media === !!shortcut.media : true),\n );\n if (exists) {\n alert(t`This shortcut already exists`);\n } else {\n states.shortcuts.push(shortcut);\n showToast(t`Hashtag shortcut added`);\n }\n }}\n >\n <Icon icon=\"shortcut\" />{' '}\n <span>\n <Trans>Add to Shortcuts</Trans>\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n let newInstance = prompt(\n t`Enter a new instance e.g. \"mastodon.social\"`,\n );\n if (!/\\./.test(newInstance)) {\n if (newInstance) alert(t`Invalid instance`);\n return;\n }\n if (newInstance) {\n newInstance = newInstance.toLowerCase().trim();\n // navigate(`/${newInstance}/t/${hashtags.join('+')}`);\n location.hash = `/${newInstance}/t/${hashtags.join(\n '+',\n )}${linkParams}`;\n }\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <span>\n <Trans>Go to another instance…</Trans>\n </span>\n </MenuItem>\n {currentInstance !== instance && (\n <MenuItem\n onClick={() => {\n location.hash = `/${currentInstance}/t/${hashtags.join(\n '+',\n )}${linkParams}`;\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Go to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nexport default Hashtags;\n","import './lists.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { InView } from 'react-intersection-observer';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport AccountBlock from '../components/account-block';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport ListAddEdit from '../components/list-add-edit';\nimport MenuConfirm from '../components/menu-confirm';\nimport MenuLink from '../components/menu-link';\nimport Menu2 from '../components/menu2';\nimport Modal from '../components/modal';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport { getList, getLists } from '../utils/lists';\nimport states, { saveStatus } from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction List(props) {\n const snapStates = useSnapshot(states);\n const { masto, instance } = api();\n const id = props?.id || useParams()?.id;\n // const navigate = useNavigate();\n const latestItem = useRef();\n // const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n\n const listIterator = useRef();\n async function fetchList(firstLoad) {\n if (firstLoad || !listIterator.current) {\n listIterator.current = masto.v1.timelines.list.$select(id).list({\n limit: LIMIT,\n });\n }\n const results = await listIterator.current.next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'home');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.timelines.list.$select(id).list({\n limit: 1,\n since_id: latestItem.current,\n });\n let { value } = results;\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n value = filteredItems(value, 'home');\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n const [lists, setLists] = useState([]);\n useEffect(() => {\n getLists().then(setLists);\n }, []);\n\n const [list, setList] = useState({ title: 'List' });\n // const [title, setTitle] = useState(`List`);\n useTitle(list.title, `/l/:id`);\n useEffect(() => {\n (async () => {\n try {\n const list = await getList(id);\n setList(list);\n // setTitle(list.title);\n } catch (e) {\n console.error(e);\n }\n })();\n }, [id]);\n\n const [showListAddEditModal, setShowListAddEditModal] = useState(false);\n const [showManageMembersModal, setShowManageMembersModal] = useState(false);\n\n return (\n <>\n <Timeline\n key={id}\n title={list.title}\n id=\"list\"\n emptyText={t`Nothing yet.`}\n errorText={t`Unable to load posts.`}\n instance={instance}\n fetchItems={fetchList}\n checkForUpdates={checkForUpdates}\n useItemID\n boostsCarousel={snapStates.settings.boostsCarousel}\n // allowFilters\n filterContext=\"home\"\n showReplyParent\n // refresh={reloadCount}\n headerStart={\n // <Link to=\"/l\" class=\"button plain\">\n // <Icon icon=\"list\" size=\"l\" />\n // </Link>\n <Menu2\n overflow=\"auto\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"list\" size=\"l\" alt={t`Lists`} />\n <Icon icon=\"chevron-down\" size=\"s\" />\n </button>\n }\n >\n <MenuLink to=\"/l\">\n <span>\n <Trans>All Lists</Trans>\n </span>\n </MenuLink>\n {lists?.length > 0 && (\n <>\n <MenuDivider />\n {lists.map((list) => (\n <MenuLink key={list.id} to={`/l/${list.id}`}>\n <span>{list.title}</span>\n </MenuLink>\n ))}\n </>\n )}\n </Menu2>\n }\n headerEnd={\n <Menu2\n portal\n setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem\n onClick={() =>\n setShowListAddEditModal({\n list,\n })\n }\n >\n <Icon icon=\"pencil\" size=\"l\" />\n <span>\n <Trans>Edit</Trans>\n </span>\n </MenuItem>\n <MenuItem onClick={() => setShowManageMembersModal(true)}>\n <Icon icon=\"group\" size=\"l\" />\n <span>\n <Trans>Manage members</Trans>\n </span>\n </MenuItem>\n </Menu2>\n }\n />\n {showListAddEditModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowListAddEditModal(false);\n }\n }}\n >\n <ListAddEdit\n list={showListAddEditModal?.list}\n onClose={(result) => {\n if (result.state === 'success' && result.list) {\n setList(result.list);\n // reload();\n } else if (result.state === 'deleted') {\n // navigate('/l');\n location.hash = '/l';\n }\n setShowListAddEditModal(false);\n }}\n />\n </Modal>\n )}\n {showManageMembersModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowManageMembersModal(false);\n }\n }}\n >\n <ListManageMembers\n listID={id}\n onClose={() => setShowManageMembersModal(false)}\n />\n </Modal>\n )}\n </>\n );\n}\n\nconst MEMBERS_LIMIT = 40;\nfunction ListManageMembers({ listID, onClose }) {\n // Show list of members with [Remove] button\n // API only returns 40 members at a time, so this need to be paginated with infinite scroll\n // Show [Add] button after removing a member\n const { masto, instance } = api();\n const [members, setMembers] = useState([]);\n const [uiState, setUIState] = useState('default');\n const [showMore, setShowMore] = useState(false);\n\n const membersIterator = useRef();\n\n async function fetchMembers(firstLoad) {\n setShowMore(false);\n setUIState('loading');\n (async () => {\n try {\n if (firstLoad || !membersIterator.current) {\n membersIterator.current = masto.v1.lists\n .$select(listID)\n .accounts.list({\n limit: MEMBERS_LIMIT,\n });\n }\n const results = await membersIterator.current.next();\n let { done, value } = results;\n if (value?.length) {\n if (firstLoad) {\n setMembers(value);\n } else {\n setMembers(members.concat(value));\n }\n setShowMore(!done);\n } else {\n setShowMore(false);\n }\n setUIState('default');\n } catch (e) {\n setUIState('error');\n }\n })();\n }\n\n useEffect(() => {\n fetchMembers(true);\n }, []);\n\n return (\n <div class=\"sheet\" id=\"list-manage-members-container\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Manage members</Trans>\n </h2>\n </header>\n <main>\n <ul>\n {members.map((member) => (\n <li key={member.id}>\n <AccountBlock account={member} instance={instance} />\n <RemoveAddButton account={member} listID={listID} />\n </li>\n ))}\n {showMore && uiState === 'default' && (\n <InView as=\"li\" onChange={(inView) => inView && fetchMembers()}>\n <button type=\"button\" class=\"light block\" onClick={fetchMembers}>\n <Trans>Show more…</Trans>\n </button>\n </InView>\n )}\n </ul>\n </main>\n </div>\n );\n}\n\nfunction RemoveAddButton({ account, listID }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [removed, setRemoved] = useState(false);\n\n return (\n <MenuConfirm\n confirm={!removed}\n confirmLabel={\n <span>\n <Trans>\n Remove <span class=\"bidi-isolate\">@{account.username}</span> from\n list?\n </Trans>\n </span>\n }\n align=\"end\"\n menuItemClassName=\"danger\"\n onClick={() => {\n if (removed) {\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.lists.$select(listID).accounts.create({\n accountIds: [account.id],\n });\n setUIState('default');\n setRemoved(false);\n } catch (e) {\n setUIState('error');\n }\n })();\n } else {\n // const yes = confirm(`Remove ${account.username} from this list?`);\n // if (!yes) return;\n setUIState('loading');\n\n (async () => {\n try {\n await masto.v1.lists.$select(listID).accounts.remove({\n accountIds: [account.id],\n });\n setUIState('default');\n setRemoved(true);\n } catch (e) {\n setUIState('error');\n }\n })();\n }\n }}\n >\n <button\n type=\"button\"\n class={`light ${removed ? '' : 'danger'}`}\n disabled={uiState === 'loading'}\n >\n {removed ? t`Add` : t`Remove…`}\n </button>\n </MenuConfirm>\n );\n}\n\nexport default List;\n","// This is like very lame \"type-checking\" lol\nconst notificationTypeKeys = {\n mention: ['account', 'status'],\n status: ['account', 'status'],\n reblog: ['account', 'status'],\n follow: ['account'],\n follow_request: ['account'],\n favourite: ['account', 'status'],\n poll: ['status'],\n update: ['status'],\n};\nexport function fixNotifications(notifications) {\n return notifications.filter((notification) => {\n const { type, id, createdAt } = notification;\n if (!type) {\n console.warn('Notification missing type', notification);\n return false;\n }\n if (!id || !createdAt) {\n console.warn('Notification missing id or createdAt', notification);\n // Continue processing this despite missing id or createdAt\n }\n const keys = notificationTypeKeys[type];\n if (keys?.length) {\n return keys.every((key) => !!notification[key]);\n }\n return true; // skip other types\n });\n}\n\nexport function massageNotifications2(notifications) {\n if (notifications?.notificationGroups) {\n const {\n accounts = [],\n notificationGroups = [],\n statuses = [],\n } = notifications;\n return notificationGroups.map((group) => {\n const { sampleAccountIds, statusId } = group;\n const sampleAccounts =\n sampleAccountIds?.map((id) => accounts.find((a) => a.id === id)) || [];\n const status = statuses?.find((s) => s.id === statusId) || null;\n return {\n ...group,\n sampleAccounts,\n status,\n };\n });\n }\n return notifications;\n}\n\nexport function groupNotifications2(groupNotifications) {\n // Make grouped notifications to look like faux grouped notifications\n const newGroupNotifications = groupNotifications.map((gn) => {\n const {\n latestPageNotificationAt,\n mostRecentNotificationId,\n sampleAccounts,\n notificationsCount,\n } = gn;\n\n return {\n id: '' + mostRecentNotificationId,\n createdAt: latestPageNotificationAt,\n account: sampleAccounts[0],\n ...gn,\n };\n });\n\n // Merge favourited and reblogged of same status into a single notification\n // - new type: \"favourite+reblog\"\n // - sum numbers for `notificationsCount` and `sampleAccounts`\n const notificationsMap = {};\n const newGroupNotifications1 = [];\n for (let i = 0; i < newGroupNotifications.length; i++) {\n const gn = newGroupNotifications[i];\n const {\n type,\n status,\n createdAt,\n notificationsCount,\n sampleAccounts,\n groupKey,\n } = gn;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n let virtualType = type;\n const sameCount =\n notificationsCount > 0 && notificationsCount === sampleAccounts?.length;\n // if (sameCount && (type === 'favourite' || type === 'reblog')) {\n if (type === 'favourite' || type === 'reblog') {\n virtualType = 'favourite+reblog';\n }\n // const key = `${status?.id}-${virtualType}-${date}-${sameCount ? 1 : 0}`;\n const key = `${status?.id}-${virtualType}-${date}`;\n const mappedNotification = notificationsMap[key];\n if (mappedNotification) {\n // Merge sampleAccounts + merge _types\n sampleAccounts.forEach((a) => {\n const mappedAccount = mappedNotification.sampleAccounts.find(\n (ma) => ma.id === a.id,\n );\n if (!mappedAccount) {\n mappedNotification.sampleAccounts.push({\n ...a,\n _types: [type],\n });\n } else {\n mappedAccount._types.push(type);\n mappedAccount._types.sort().reverse();\n }\n });\n // mappedNotification.notificationsCount =\n // mappedNotification.sampleAccounts.length;\n mappedNotification.notificationsCount = Math.min(\n mappedNotification.notificationsCount,\n notificationsCount,\n );\n mappedNotification._notificationsCount.push(notificationsCount);\n mappedNotification._accounts = mappedNotification.sampleAccounts;\n mappedNotification._groupKeys.push(groupKey);\n } else {\n const accounts = sampleAccounts.map((a) => ({\n ...a,\n _types: [type],\n }));\n notificationsMap[key] = {\n ...gn,\n sampleAccounts: accounts,\n type: virtualType,\n _accounts: accounts,\n _groupKeys: groupKey ? [groupKey] : [],\n _notificationsCount: [notificationsCount],\n };\n newGroupNotifications1.push(notificationsMap[key]);\n }\n }\n\n // 2nd pass.\n // - Group 1 account favourte/reblog multiple posts\n // - _statuses: [status, status, ...]\n const notificationsMap2 = {};\n const newGroupNotifications2 = [];\n for (let i = 0; i < newGroupNotifications1.length; i++) {\n const gn = newGroupNotifications1[i];\n const { type, account, _accounts, sampleAccounts, createdAt, groupKey } =\n gn;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n const hasOneAccount =\n sampleAccounts?.length === 1 || _accounts?.length === 1;\n if (\n (type === 'favourite' ||\n type === 'reblog' ||\n type === 'favourite+reblog') &&\n hasOneAccount\n ) {\n const key = `${account?.id}-${type}-${date}`;\n const mappedNotification = notificationsMap2[key];\n if (mappedNotification) {\n mappedNotification._statuses.push(gn.status);\n mappedNotification._ids += `-${gn.id}`;\n mappedNotification._groupKeys.push(groupKey);\n } else {\n let n = (notificationsMap2[key] = {\n ...gn,\n type,\n _ids: gn.id,\n _statuses: [gn.status],\n _groupKeys: groupKey ? [groupKey] : [],\n });\n newGroupNotifications2.push(n);\n }\n } else {\n newGroupNotifications2.push(gn);\n }\n }\n\n console.log('newGroupNotifications2', newGroupNotifications2);\n\n return newGroupNotifications2;\n}\n\nexport default function groupNotifications(notifications) {\n // Filter out invalid notifications\n notifications = fixNotifications(notifications);\n\n // Create new flat list of notifications\n // Combine sibling notifications based on type and status id\n // Concat all notification.account into an array of _accounts\n const notificationsMap = {};\n const cleanNotifications = [];\n for (let i = 0, j = 0; i < notifications.length; i++) {\n const notification = notifications[i];\n const { id, status, account, type, createdAt } = notification;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n let virtualType = type;\n if (type === 'favourite' || type === 'reblog') {\n virtualType = 'favourite+reblog';\n }\n const key = `${status?.id}-${virtualType}-${date}`;\n const mappedNotification = notificationsMap[key];\n if (virtualType === 'follow_request') {\n cleanNotifications[j++] = notification;\n } else if (mappedNotification?.account) {\n const mappedAccount = mappedNotification._accounts.find(\n (a) => a.id === account.id,\n );\n if (mappedAccount) {\n mappedAccount._types.push(type);\n mappedAccount._types.sort().reverse();\n mappedNotification._ids += `-${id}`;\n } else {\n account._types = [type];\n mappedNotification._accounts.push(account);\n mappedNotification._ids += `-${id}`;\n }\n } else {\n if (account) account._types = [type];\n let n = (notificationsMap[key] = {\n ...notification,\n type: virtualType,\n _ids: id,\n _accounts: account ? [account] : [],\n });\n cleanNotifications[j++] = n;\n }\n }\n\n // 2nd pass to group \"favourite+reblog\"-type notifications by account if _accounts.length <= 1\n // This means one acount has favourited and reblogged the multiple statuses\n // The grouped notification\n // - type: \"favourite+reblog+account\"\n // - _statuses: [status, status, ...]\n const notificationsMap2 = {};\n const cleanNotifications2 = [];\n for (let i = 0, j = 0; i < cleanNotifications.length; i++) {\n const notification = cleanNotifications[i];\n const { id, account, _accounts, type, createdAt } = notification;\n const date = createdAt ? new Date(createdAt).toLocaleDateString() : '';\n if (type === 'favourite+reblog' && account && _accounts.length === 1) {\n const key = `${account?.id}-${type}-${date}`;\n const mappedNotification = notificationsMap2[key];\n if (mappedNotification) {\n mappedNotification._statuses.push(notification.status);\n mappedNotification._ids += `-${id}`;\n } else {\n let n = (notificationsMap2[key] = {\n ...notification,\n type,\n _ids: id,\n _statuses: [notification.status],\n });\n cleanNotifications2[j++] = n;\n }\n } else {\n cleanNotifications2[j++] = notification;\n }\n }\n\n console.log({ notifications, cleanNotifications, cleanNotifications2 });\n\n // return cleanNotifications;\n return cleanNotifications2;\n}\n","import { t, Trans } from '@lingui/macro';\nimport { useMemo, useRef, useState } from 'preact/hooks';\nimport { useSearchParams } from 'react-router-dom';\n\nimport Link from '../components/link';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { fixNotifications } from '../utils/group-notifications';\nimport { saveStatus } from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\nconst emptySearchParams = new URLSearchParams();\n\nfunction Mentions({ columnMode, ...props }) {\n const { masto, instance } = api();\n const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();\n const [stateType, setStateType] = useState(null);\n const type = props?.type || searchParams.get('type') || stateType;\n useTitle(type === 'private' ? t`Private mentions` : t`Mentions`, '/mentions');\n\n const mentionsIterator = useRef();\n const latestItem = useRef();\n\n async function fetchMentions(firstLoad) {\n if (firstLoad || !mentionsIterator.current) {\n mentionsIterator.current = masto.v1.notifications.list({\n limit: LIMIT,\n types: ['mention'],\n });\n }\n const results = await mentionsIterator.current.next();\n let { value } = results;\n if (value?.length) {\n value = fixNotifications(value);\n\n if (firstLoad) {\n latestItem.current = value[0].id;\n console.log('First load', latestItem.current);\n }\n\n value.forEach(({ status: item }) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value: value?.map((item) => item.status),\n };\n }\n\n const conversationsIterator = useRef();\n const latestConversationItem = useRef();\n async function fetchConversations(firstLoad) {\n if (firstLoad || !conversationsIterator.current) {\n conversationsIterator.current = masto.v1.conversations.list({\n limit: LIMIT,\n });\n }\n const results = await conversationsIterator.current.next();\n let { value } = results;\n value = value?.filter((item) => item.lastStatus);\n if (value?.length) {\n if (firstLoad) {\n latestConversationItem.current = value[0].lastStatus.id;\n console.log('First load', latestConversationItem.current);\n }\n\n value.forEach(({ lastStatus: item }) => {\n saveStatus(item, instance);\n });\n }\n console.log('results', results);\n return {\n ...results,\n value: value?.map((item) => item.lastStatus),\n };\n }\n\n function fetchItems(...args) {\n if (type === 'private') {\n return fetchConversations(...args);\n }\n return fetchMentions(...args);\n }\n\n async function checkForUpdates() {\n if (type === 'private') {\n try {\n const results = await masto.v1.conversations\n .list({\n limit: 1,\n since_id: latestConversationItem.current,\n })\n .next();\n let { value } = results;\n console.log(\n 'checkForUpdates PRIVATE',\n latestConversationItem.current,\n value,\n );\n const valueContainsLatestItem =\n value[0]?.id === latestConversationItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n latestConversationItem.current = value[0].lastStatus.id;\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n } else {\n try {\n const results = await masto.v1.notifications\n .list({\n limit: 1,\n types: ['mention'],\n since_id: latestItem.current,\n })\n .next();\n let { value } = results;\n console.log('checkForUpdates ALL', latestItem.current, value);\n if (value?.length) {\n latestItem.current = value[0].id;\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n }\n\n const TimelineStart = useMemo(() => {\n return (\n <div class=\"filter-bar centered\">\n <Link\n to=\"/mentions\"\n class={!type ? 'is-active' : ''}\n onClick={(e) => {\n if (columnMode) {\n e.preventDefault();\n setStateType(null);\n }\n }}\n >\n <Trans>All</Trans>\n </Link>\n <Link\n to=\"/mentions?type=private\"\n class={type === 'private' ? 'is-active' : ''}\n onClick={(e) => {\n if (columnMode) {\n e.preventDefault();\n setStateType('private');\n }\n }}\n >\n <Trans>Private</Trans>\n </Link>\n </div>\n );\n }, [type]);\n\n return (\n <Timeline\n title={t`Mentions`}\n id=\"mentions\"\n emptyText={t`No one mentioned you :(`}\n errorText={t`Unable to load mentions.`}\n instance={instance}\n fetchItems={fetchItems}\n checkForUpdates={checkForUpdates}\n useItemID\n timelineStart={TimelineStart}\n refresh={type}\n />\n );\n}\n\nexport default Mentions;\n","import './notifications.css';\n\nimport { msg, Plural, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { InView } from 'react-intersection-observer';\nimport { useSearchParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\nimport { subscribeKey } from 'valtio/utils';\n\nimport AccountBlock from '../components/account-block';\nimport FollowRequestButtons from '../components/follow-request-buttons';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Modal from '../components/modal';\nimport NavMenu from '../components/nav-menu';\nimport Notification from '../components/notification';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport enhanceContent from '../utils/enhance-content';\nimport groupNotifications, {\n groupNotifications2,\n massageNotifications2,\n} from '../utils/group-notifications';\nimport handleContentLinks from '../utils/handle-content-links';\nimport mem from '../utils/mem';\nimport niceDateTime from '../utils/nice-date-time';\nimport { getRegistration } from '../utils/push-notifications';\nimport shortenNumber from '../utils/shorten-number';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport { getCurrentInstance } from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport usePageVisibility from '../utils/usePageVisibility';\nimport useScroll from '../utils/useScroll';\nimport useTitle from '../utils/useTitle';\n\nconst NOTIFICATIONS_LIMIT = 80;\nconst NOTIFICATIONS_GROUPED_LIMIT = 20;\nconst emptySearchParams = new URLSearchParams();\n\nconst scrollIntoViewOptions = {\n block: 'center',\n inline: 'center',\n behavior: 'smooth',\n};\n\nconst memSupportsGroupedNotifications = mem(\n () => supports('@mastodon/grouped-notifications'),\n {\n maxAge: 1000 * 60 * 5, // 5 minutes\n },\n);\n\nexport function mastoFetchNotifications(opts = {}) {\n const { masto } = api();\n if (\n states.settings.groupedNotificationsAlpha &&\n memSupportsGroupedNotifications()\n ) {\n // https://github.com/mastodon/mastodon/pull/29889\n return masto.v2.notifications.list({\n limit: NOTIFICATIONS_GROUPED_LIMIT,\n ...opts,\n });\n } else {\n return masto.v1.notifications.list({\n limit: NOTIFICATIONS_LIMIT,\n ...opts,\n });\n }\n}\n\nexport function getGroupedNotifications(notifications) {\n if (\n states.settings.groupedNotificationsAlpha &&\n memSupportsGroupedNotifications()\n ) {\n return groupNotifications2(notifications);\n } else {\n return groupNotifications(notifications);\n }\n}\n\nconst NOTIFICATIONS_POLICIES = [\n 'forNotFollowing',\n 'forNotFollowers',\n 'forNewAccounts',\n 'forPrivateMentions',\n 'forLimitedAccounts',\n];\nconst NOTIFICATIONS_POLICIES_TEXT = {\n forNotFollowing: msg`You don't follow`,\n forNotFollowers: msg`Who don't follow you`,\n forNewAccounts: msg`With a new account`,\n forPrivateMentions: msg`Who unsolicitedly private mention you`,\n forLimitedAccounts: msg`Who are limited by server moderators`,\n};\n\nfunction Notifications({ columnMode }) {\n const { _ } = useLingui();\n useTitle(t`Notifications`, '/notifications');\n const { masto, instance } = api();\n const snapStates = useSnapshot(states);\n const [uiState, setUIState] = useState('default');\n const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();\n const notificationID = searchParams.get('id');\n const notificationAccessToken = searchParams.get('access_token');\n const [showMore, setShowMore] = useState(false);\n const [onlyMentions, setOnlyMentions] = useState(false);\n const scrollableRef = useRef();\n const { nearReachEnd, scrollDirection, reachStart, nearReachStart } =\n useScroll({\n scrollableRef,\n });\n const hiddenUI = scrollDirection === 'end' && !nearReachStart;\n const [followRequests, setFollowRequests] = useState([]);\n const [announcements, setAnnouncements] = useState([]);\n\n console.debug('RENDER Notifications');\n\n const notificationsIterator = useRef();\n async function fetchNotifications(firstLoad) {\n if (firstLoad || !notificationsIterator.current) {\n // Reset iterator\n notificationsIterator.current = mastoFetchNotifications({\n excludeTypes: ['follow_request'],\n });\n }\n if (/max_id=($|&)/i.test(notificationsIterator.current?.nextParams)) {\n // Pixelfed returns next paginationed link with empty max_id\n // I assume, it's done (end of list)\n return {\n done: true,\n };\n }\n const allNotifications = await notificationsIterator.current.next();\n const notifications = massageNotifications2(allNotifications.value);\n\n if (notifications?.length) {\n notifications.forEach((notification) => {\n saveStatus(notification.status, instance, {\n skipThreading: true,\n });\n });\n\n // TEST: Slot in a fake notification to test 'severed_relationships'\n // notifications.unshift({\n // id: '123123',\n // type: 'severed_relationships',\n // createdAt: '2024-03-22T19:20:08.316Z',\n // event: {\n // type: 'account_suspension',\n // targetName: 'mastodon.dev',\n // followersCount: 0,\n // followingCount: 0,\n // },\n // });\n\n // TEST: Slot in a fake notification to test 'moderation_warning'\n // notifications.unshift({\n // id: '123123',\n // type: 'moderation_warning',\n // createdAt: new Date().toISOString(),\n // moderation_warning: {\n // id: '1231234',\n // action: 'mark_statuses_as_sensitive',\n // },\n // });\n\n // console.log({ notifications });\n\n const groupedNotifications = getGroupedNotifications(notifications);\n\n if (firstLoad) {\n states.notificationsLast = groupedNotifications[0];\n states.notifications = groupedNotifications;\n\n // Update last read marker\n masto.v1.markers\n .create({\n notifications: {\n lastReadId: groupedNotifications[0].id,\n },\n })\n .catch(() => {});\n } else {\n states.notifications.push(...groupedNotifications);\n }\n }\n\n states.notificationsShowNew = false;\n states.notificationsLastFetchTime = Date.now();\n return allNotifications;\n }\n\n async function fetchFollowRequests() {\n // Note: no pagination here yet because this better be on a separate page. Should be rare use-case???\n try {\n return await masto.v1.followRequests.list({\n limit: 80,\n });\n } catch (e) {\n // Silently fail\n return [];\n }\n }\n\n const loadFollowRequests = () => {\n setUIState('loading');\n (async () => {\n try {\n const requests = await fetchFollowRequests();\n setFollowRequests(requests);\n setUIState('default');\n } catch (e) {\n setUIState('error');\n }\n })();\n };\n\n async function fetchAnnouncements() {\n try {\n return await masto.v1.announcements.list();\n } catch (e) {\n // Silently fail\n return [];\n }\n }\n\n const supportsFilteredNotifications = supports(\n '@mastodon/filtered-notifications',\n );\n const [showNotificationsSettings, setShowNotificationsSettings] =\n useState(false);\n const [notificationsPolicy, setNotificationsPolicy] = useState({});\n function fetchNotificationsPolicy() {\n return masto.v2.notifications.policy.fetch().catch(() => {});\n }\n function loadNotificationsPolicy() {\n fetchNotificationsPolicy()\n .then((policy) => {\n console.log('✨ Notifications policy', policy);\n setNotificationsPolicy(policy);\n })\n .catch(() => {});\n }\n const [notificationsRequests, setNotificationsRequests] = useState(null);\n function fetchNotificationsRequest() {\n return masto.v1.notifications.requests.list();\n }\n\n const loadNotifications = (firstLoad) => {\n setShowNew(false);\n setUIState('loading');\n (async () => {\n try {\n const fetchNotificationsPromise = fetchNotifications(firstLoad);\n\n if (firstLoad) {\n fetchAnnouncements()\n .then((announcements) => {\n announcements.sort((a, b) => {\n // Sort by updatedAt first, then createdAt\n const aDate = new Date(a.updatedAt || a.createdAt);\n const bDate = new Date(b.updatedAt || b.createdAt);\n return bDate - aDate;\n });\n setAnnouncements(announcements);\n })\n .catch(() => {});\n\n fetchFollowRequests()\n .then((requests) => {\n setFollowRequests(requests);\n })\n .catch(() => {});\n\n if (supportsFilteredNotifications) {\n loadNotificationsPolicy();\n }\n }\n\n const { done } = await fetchNotificationsPromise;\n setShowMore(!done);\n\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n };\n\n useEffect(() => {\n loadNotifications(true);\n }, []);\n useEffect(() => {\n if (reachStart) {\n loadNotifications(true);\n }\n }, [reachStart]);\n\n // useEffect(() => {\n // if (nearReachEnd && showMore) {\n // loadNotifications();\n // }\n // }, [nearReachEnd, showMore]);\n\n const [showNew, setShowNew] = useState(false);\n\n const loadUpdates = useCallback(\n ({ disableIdleCheck = false } = {}) => {\n if (uiState === 'loading') {\n return;\n }\n console.log('✨ Load updates', {\n autoRefresh: snapStates.settings.autoRefresh,\n scrollTop: scrollableRef.current?.scrollTop,\n inBackground: inBackground(),\n disableIdleCheck,\n });\n if (\n snapStates.settings.autoRefresh &&\n scrollableRef.current?.scrollTop < 16 &&\n (disableIdleCheck || window.__IDLE__) &&\n !inBackground()\n ) {\n loadNotifications(true);\n }\n },\n [snapStates.notificationsShowNew, snapStates.settings.autoRefresh, uiState],\n );\n // useEffect(loadUpdates, [snapStates.notificationsShowNew]);\n\n const lastHiddenTime = useRef();\n usePageVisibility((visible) => {\n if (visible) {\n const timeDiff = Date.now() - lastHiddenTime.current;\n if (!lastHiddenTime.current || timeDiff > 1000 * 3) {\n // 3 seconds\n loadUpdates({\n disableIdleCheck: true,\n });\n } else {\n lastHiddenTime.current = Date.now();\n }\n }\n });\n const firstLoad = useRef(true);\n useEffect(() => {\n let unsub = subscribeKey(states, 'notificationsShowNew', (v) => {\n if (firstLoad.current) {\n firstLoad.current = false;\n return;\n }\n if (uiState === 'loading') return;\n if (v) loadUpdates();\n setShowNew(v);\n });\n return () => unsub?.();\n }, []);\n\n const todayDate = new Date();\n const yesterdayDate = new Date(todayDate - 24 * 60 * 60 * 1000);\n let currentDay = new Date();\n const showTodayEmpty = !snapStates.notifications.some(\n (notification) =>\n new Date(notification.createdAt).toDateString() ===\n todayDate.toDateString(),\n );\n\n const announcementsListRef = useRef();\n\n useEffect(() => {\n if (notificationID) {\n states.routeNotification = {\n id: notificationID,\n accessToken: atob(notificationAccessToken),\n };\n }\n }, [notificationID, notificationAccessToken]);\n\n // useEffect(() => {\n // if (uiState === 'default') {\n // (async () => {\n // try {\n // const registration = await getRegistration();\n // if (registration?.getNotifications) {\n // const notifications = await registration.getNotifications();\n // console.log('🔔 Push notifications', notifications);\n // // Close all notifications?\n // // notifications.forEach((notification) => {\n // // notification.close();\n // // });\n // }\n // } catch (e) {}\n // })();\n // }\n // }, [uiState]);\n\n const itemsSelector = '.notification';\n const jRef = useHotkeys('j', () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let nextItem = allItems[activeItemIndex + 1];\n if (nextItem) {\n nextItem.focus();\n nextItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const kRef = useHotkeys('k', () => {\n // focus on previous status after active item\n const activeItem = document.activeElement.closest(itemsSelector);\n const activeItemRect = activeItem?.getBoundingClientRect();\n const allItems = Array.from(\n scrollableRef.current.querySelectorAll(itemsSelector),\n );\n if (\n activeItem &&\n activeItemRect.top < scrollableRef.current.clientHeight &&\n activeItemRect.bottom > 0\n ) {\n const activeItemIndex = allItems.indexOf(activeItem);\n let prevItem = allItems[activeItemIndex - 1];\n if (prevItem) {\n prevItem.focus();\n prevItem.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n const topmostItem = allItems.find((item) => {\n const itemRect = item.getBoundingClientRect();\n return itemRect.top >= 44 && itemRect.left >= 0;\n });\n if (topmostItem) {\n topmostItem.focus();\n topmostItem.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n const oRef = useHotkeys(['enter', 'o'], () => {\n const activeItem = document.activeElement.closest(itemsSelector);\n const statusLink = activeItem?.querySelector('.status-link');\n if (statusLink) {\n statusLink.click();\n }\n });\n\n const today = new Date();\n const todaySubHeading = useMemo(() => {\n return niceDateTime(today, {\n forceOpts: {\n weekday: 'long',\n },\n });\n }, [today]);\n\n return (\n <div\n id=\"notifications-page\"\n class=\"deck-container\"\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n oRef(node);\n }}\n tabIndex=\"-1\"\n >\n <div class={`timeline-deck deck ${onlyMentions ? 'only-mentions' : ''}`}>\n <header\n hidden={hiddenUI}\n onClick={(e) => {\n if (!e.target.closest('a, button')) {\n scrollableRef.current?.scrollTo({ top: 0, behavior: 'smooth' });\n }\n }}\n onDblClick={(e) => {\n if (!e.target.closest('a, button')) {\n loadNotifications(true);\n }\n }}\n class={uiState === 'loading' ? 'loading' : ''}\n >\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" alt={t`Home`} />\n </Link>\n </div>\n <h1>\n <Trans>Notifications</Trans>\n </h1>\n <div class=\"header-side\">\n {supportsFilteredNotifications && (\n <button\n type=\"button\"\n class=\"button plain4\"\n onClick={() => {\n setShowNotificationsSettings(true);\n }}\n >\n <Icon\n icon=\"settings\"\n size=\"l\"\n alt={t`Notifications settings`}\n />\n </button>\n )}\n </div>\n </div>\n {showNew && uiState !== 'loading' && (\n <button\n class=\"updates-button shiny-pill\"\n type=\"button\"\n onClick={() => {\n loadNotifications(true);\n scrollableRef.current?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-up\" /> <Trans>New notifications</Trans>\n </button>\n )}\n </header>\n {announcements.length > 0 && (\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n <details class=\"announcements\">\n <summary>\n <span>\n <Icon icon=\"announce\" class=\"announcement-icon\" size=\"l\" />{' '}\n <Plural\n value={announcements.length}\n one=\"Announcement\"\n other=\"Announcements\"\n />{' '}\n <small class=\"insignificant\">{instance}</small>\n </span>\n {announcements.length > 1 && (\n <span class=\"announcements-nav-buttons\">\n {announcements.map((announcement, index) => (\n <button\n type=\"button\"\n class=\"plain2 small\"\n onClick={() => {\n announcementsListRef.current?.children[\n index\n ].scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }}\n >\n {index + 1}\n </button>\n ))}\n </span>\n )}\n </summary>\n <ul\n class={`announcements-list-${\n announcements.length > 1 ? 'multiple' : 'single'\n }`}\n ref={announcementsListRef}\n >\n {announcements.map((announcement) => (\n <li>\n <AnnouncementBlock announcement={announcement} />\n </li>\n ))}\n </ul>\n </details>\n </div>\n </div>\n )}\n {followRequests.length > 0 && (\n <div class=\"follow-requests\">\n <h2 class=\"timeline-header\">\n <Trans>Follow requests</Trans>\n </h2>\n {followRequests.length > 5 ? (\n <details>\n <summary>\n <Plural\n value={followRequests.length}\n one=\"# follow request\"\n other=\"# follow requests\"\n />\n </summary>\n <ul>\n {followRequests.map((account) => (\n <li key={account.id}>\n <AccountBlock account={account} />\n <FollowRequestButtons\n accountID={account.id}\n onChange={() => {\n // loadFollowRequests();\n // loadNotifications(true);\n }}\n />\n </li>\n ))}\n </ul>\n </details>\n ) : (\n <ul>\n {followRequests.map((account) => (\n <li key={account.id}>\n <AccountBlock account={account} />\n <FollowRequestButtons\n accountID={account.id}\n onChange={() => {\n // loadFollowRequests();\n // loadNotifications(true);\n }}\n />\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n {supportsFilteredNotifications &&\n notificationsPolicy?.summary?.pendingRequestsCount > 0 && (\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n <div class=\"filtered-notifications\">\n <details\n onToggle={async (e) => {\n const { open } = e.target;\n if (open) {\n const requests = await fetchNotificationsRequest();\n setNotificationsRequests(requests);\n console.log({ open, requests });\n }\n }}\n >\n <summary>\n <Plural\n value={notificationsPolicy.summary.pendingRequestsCount}\n one=\"Filtered notifications from # person\"\n other=\"Filtered notifications from # people\"\n />\n </summary>\n {!notificationsRequests ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n notificationsRequests?.length > 0 && (\n <ul>\n {notificationsRequests.map((request) => (\n <li key={request.id}>\n <div class=\"request-notifcations\">\n {!request.lastStatus?.id && (\n <AccountBlock\n useAvatarStatic\n showStats\n account={request.account}\n />\n )}\n {request.lastStatus?.id && (\n <div class=\"last-post\">\n <Link\n class=\"status-link\"\n to={`/${instance}/s/${request.lastStatus.id}`}\n >\n <Status\n status={request.lastStatus}\n size=\"s\"\n readOnly\n />\n </Link>\n </div>\n )}\n <NotificationRequestModalButton\n request={request}\n />\n </div>\n <NotificationRequestButtons\n request={request}\n onChange={() => {\n loadNotifications(true);\n }}\n />\n </li>\n ))}\n </ul>\n )\n )}\n </details>\n </div>\n </div>\n </div>\n )}\n <div id=\"mentions-option\">\n <label>\n <input\n type=\"checkbox\"\n checked={onlyMentions}\n onChange={(e) => {\n setOnlyMentions(e.target.checked);\n }}\n />{' '}\n <Trans>Only mentions</Trans>\n </label>\n </div>\n <h2 class=\"timeline-header\">\n <Trans>Today</Trans>{' '}\n <small class=\"insignificant bidi-isolate\">{todaySubHeading}</small>\n </h2>\n {showTodayEmpty && (\n <p class=\"ui-state insignificant\">\n {uiState === 'default' ? t`You're all caught up.` : <>&hellip;</>}\n </p>\n )}\n {snapStates.notifications.length ? (\n <>\n {snapStates.notifications\n // This is leaked from Notifications popover\n .filter((n) => n.type !== 'follow_request')\n .map((notification) => {\n if (onlyMentions && notification.type !== 'mention') {\n return null;\n }\n const notificationDay = new Date(notification.createdAt);\n const differentDay =\n notificationDay.toDateString() !== currentDay.toDateString();\n if (differentDay) {\n currentDay = notificationDay;\n }\n // if notificationDay is yesterday, show \"Yesterday\"\n // if notificationDay is before yesterday, show date\n const heading =\n notificationDay.toDateString() ===\n yesterdayDate.toDateString()\n ? t`Yesterday`\n : niceDateTime(currentDay, {\n hideTime: true,\n });\n const subHeading = niceDateTime(currentDay, {\n forceOpts: {\n weekday: 'long',\n },\n });\n return (\n <Fragment key={notification._ids || notification.id}>\n {differentDay && (\n <h2 class=\"timeline-header\">\n <span>{heading}</span>{' '}\n <small class=\"insignificant bidi-isolate\">\n {subHeading}\n </small>\n </h2>\n )}\n <Notification\n instance={instance}\n notification={notification}\n key={notification._ids || notification.id}\n />\n </Fragment>\n );\n })}\n </>\n ) : (\n <>\n {uiState === 'loading' && (\n <>\n <ul class=\"timeline flat\">\n {Array.from({ length: 5 }).map((_, i) => (\n <li class=\"notification skeleton\">\n <div class=\"notification-type\">\n <Icon icon=\"notification\" size=\"xl\" />\n </div>\n <div class=\"notification-content\">\n <p>███████████ ████</p>\n </div>\n </li>\n ))}\n </ul>\n </>\n )}\n {uiState === 'error' && (\n <p class=\"ui-state\">\n <Trans>Unable to load notifications</Trans>\n <br />\n <br />\n <button type=\"button\" onClick={() => loadNotifications(true)}>\n <Trans>Try again</Trans>\n </button>\n </p>\n )}\n </>\n )}\n {showMore && (\n <InView\n onChange={(inView) => {\n if (inView) {\n loadNotifications();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n disabled={uiState === 'loading'}\n onClick={() => loadNotifications()}\n style={{ marginBlockEnd: '6em' }}\n >\n {uiState === 'loading' ? (\n <Loader abrupt />\n ) : (\n <Trans>Show more…</Trans>\n )}\n </button>\n </InView>\n )}\n </div>\n {supportsFilteredNotifications && showNotificationsSettings && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowNotificationsSettings(false);\n }\n }}\n >\n <div class=\"sheet\" id=\"notifications-settings\" tabIndex=\"-1\">\n <button\n type=\"button\"\n class=\"sheet-close\"\n onClick={() => setShowNotificationsSettings(false)}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <h2>\n <Trans>Notifications settings</Trans>\n </h2>\n </header>\n <main>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n const {\n forNotFollowing,\n forNotFollowers,\n forNewAccounts,\n forPrivateMentions,\n forLimitedAccounts,\n } = e.target;\n const newPolicy = {\n ...notificationsPolicy,\n forNotFollowing: forNotFollowing.value,\n forNotFollowers: forNotFollowers.value,\n forNewAccounts: forNewAccounts.value,\n forPrivateMentions: forPrivateMentions.value,\n forLimitedAccounts: forLimitedAccounts.value,\n };\n setNotificationsPolicy(newPolicy);\n setShowNotificationsSettings(false);\n (async () => {\n try {\n await masto.v2.notifications.policy.update(newPolicy);\n showToast(t`Notifications settings updated`);\n } catch (e) {\n console.error(e);\n }\n })();\n }}\n >\n <p>\n <Trans>Filter out notifications from people:</Trans>\n </p>\n <div class=\"notification-policy-fields\">\n {NOTIFICATIONS_POLICIES.map((key) => {\n const value = notificationsPolicy[key];\n return (\n <div key={key}>\n <label>\n {_(NOTIFICATIONS_POLICIES_TEXT[key])}\n <select name={key} defaultValue={value} class=\"small\">\n <option value=\"accept\">\n <Trans>Accept</Trans>\n </option>\n <option value=\"filter\">\n <Trans>Filter</Trans>\n </option>\n <option value=\"drop\">\n <Trans>Ignore</Trans>\n </option>\n </select>\n </label>\n </div>\n );\n })}\n </div>\n <p>\n <button type=\"submit\">\n <Trans>Save</Trans>\n </button>\n </p>\n </form>\n </main>\n </div>\n </Modal>\n )}\n </div>\n );\n}\n\nfunction inBackground() {\n return !!document.querySelector('.deck-backdrop, #modal-container > *');\n}\n\nfunction AnnouncementBlock({ announcement }) {\n const { instance } = api();\n const { contact } = getCurrentInstance();\n const contactAccount = contact?.account;\n const {\n id,\n content,\n startsAt,\n endsAt,\n published,\n allDay,\n publishedAt,\n updatedAt,\n read,\n mentions,\n statuses,\n tags,\n emojis,\n reactions,\n } = announcement;\n\n const publishedAtDate = new Date(publishedAt);\n const publishedDateText = niceDateTime(publishedAtDate);\n const updatedAtDate = new Date(updatedAt);\n const updatedAtText = niceDateTime(updatedAtDate);\n\n return (\n <div class=\"announcement-block\">\n <AccountBlock account={contactAccount} />\n <div\n class=\"announcement-content\"\n onClick={handleContentLinks({ mentions, instance })}\n dangerouslySetInnerHTML={{\n __html: enhanceContent(content, {\n emojis,\n }),\n }}\n />\n <p class=\"insignificant\">\n <time datetime={publishedAtDate.toISOString()}>\n {niceDateTime(publishedAtDate)}\n </time>\n {updatedAt && updatedAtText !== publishedDateText && (\n <>\n {' '}\n &bull;{' '}\n <span class=\"ib\">\n <Trans>\n Updated{' '}\n <time datetime={updatedAtDate.toISOString()}>\n {niceDateTime(updatedAtDate)}\n </time>\n </Trans>\n </span>\n </>\n )}\n </p>\n <div class=\"announcement-reactions\" hidden>\n {reactions.map((reaction) => {\n const { name, count, me, staticUrl, url } = reaction;\n return (\n <button type=\"button\" class={`plain4 small ${me ? 'reacted' : ''}`}>\n {url || staticUrl ? (\n <img src={url || staticUrl} alt={name} width=\"16\" height=\"16\" />\n ) : (\n <span>{name}</span>\n )}{' '}\n <span class=\"count\">{shortenNumber(count)}</span>\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction fetchNotficationsByAccount(accountID) {\n const { masto } = api();\n return masto.v1.notifications.list({\n accountID,\n });\n}\nfunction NotificationRequestModalButton({ request }) {\n const { instance } = api();\n const [uiState, setUIState] = useState('loading');\n const { account, lastStatus } = request;\n const [showModal, setShowModal] = useState(false);\n const [notifications, setNotifications] = useState([]);\n\n function onClose() {\n setShowModal(false);\n }\n\n useEffect(() => {\n if (!request?.account?.id) return;\n if (!showModal) return;\n setUIState('loading');\n (async () => {\n const notifs = await fetchNotficationsByAccount(request.account.id);\n setNotifications(notifs || []);\n setUIState('default');\n })();\n }, [showModal, request?.account?.id]);\n\n return (\n <>\n <button\n type=\"button\"\n class=\"plain4 request-notifications-account\"\n onClick={() => {\n setShowModal(true);\n }}\n >\n <Icon icon=\"notification\" class=\"more-insignificant\" />{' '}\n <small>\n <Trans>\n View notifications from{' '}\n <span class=\"bidi-isolate\">@{account.username}</span>\n </Trans>\n </small>{' '}\n <Icon icon=\"chevron-down\" />\n </button>\n {showModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n onClose();\n }\n }}\n >\n <div class=\"sheet\" tabIndex=\"-1\">\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <b>\n <Trans>\n Notifications from{' '}\n <span class=\"bidi-isolate\">@{account.username}</span>\n </Trans>\n </b>\n </header>\n <main>\n {uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n notifications.map((notification) => (\n <div\n class=\"notification-peek\"\n onClick={(e) => {\n const { target } = e;\n // If button or links\n if (\n e.target.tagName === 'BUTTON' ||\n e.target.tagName === 'A'\n ) {\n onClose();\n }\n }}\n >\n <Notification\n instance={instance}\n notification={notification}\n isStatic\n />\n </div>\n ))\n )}\n </main>\n </div>\n </Modal>\n )}\n </>\n );\n}\n\nfunction NotificationRequestButtons({ request, onChange }) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [requestState, setRequestState] = useState(null); // accept, dismiss\n const hasRequestState = requestState !== null;\n\n return (\n <p class=\"notification-request-buttons\">\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRequestState}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.notifications.requests\n .$select(request.id)\n .accept();\n setRequestState('accept');\n setUIState('default');\n onChange({\n request,\n state: 'accept',\n });\n showToast(\n t`Notifications from @${request.account.username} will not be filtered from now on.`,\n );\n } catch (error) {\n setUIState('error');\n console.error(error);\n showToast(t`Unable to accept notification request`);\n }\n })();\n }}\n >\n <Trans>Allow</Trans>\n </button>{' '}\n <button\n type=\"button\"\n disabled={uiState === 'loading' || hasRequestState}\n class=\"light danger\"\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n await masto.v1.notifications.requests\n .$select(request.id)\n .dismiss();\n setRequestState('dismiss');\n setUIState('default');\n onChange({\n request,\n state: 'dismiss',\n });\n showToast(\n t`Notifications from @${request.account.username} will not show up in Filtered notifications from now on.`,\n );\n } catch (error) {\n setUIState('error');\n console.error(error);\n showToast(t`Unable to dismiss notification request`);\n }\n })();\n }}\n >\n <Trans>Dismiss</Trans>\n </button>\n <span class=\"notification-request-states\">\n {uiState === 'loading' ? (\n <Loader abrupt />\n ) : requestState === 'accept' ? (\n <Icon\n icon=\"check-circle\"\n alt={t`Accepted`}\n class=\"notification-accepted\"\n />\n ) : (\n requestState === 'dismiss' && (\n <Icon\n icon=\"x-circle\"\n alt={t`Dismissed`}\n class=\"notification-dismissed\"\n />\n )\n )}\n </span>\n </p>\n );\n}\n\nexport default memo(Notifications);\n","import { t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu';\nimport { useRef } from 'preact/hooks';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport Icon from '../components/icon';\nimport Menu2 from '../components/menu2';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { filteredItems } from '../utils/filters';\nimport states, { saveStatus } from '../utils/states';\nimport supports from '../utils/supports';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\n\nfunction Public({ local, columnMode, ...props }) {\n const snapStates = useSnapshot(states);\n const isLocal = !!local;\n const params = columnMode ? {} : useParams();\n const { masto, instance } = api({\n instance: props?.instance || params.instance,\n });\n const { masto: currentMasto, instance: currentInstance } = api();\n const title = isLocal\n ? t`Local timeline (${instance})`\n : t`Federated timeline (${instance})`;\n useTitle(title, isLocal ? `/:instance?/p/l` : `/:instance?/p`);\n // const navigate = useNavigate();\n const latestItem = useRef();\n\n const publicIterator = useRef();\n async function fetchPublic(firstLoad) {\n if (firstLoad || !publicIterator.current) {\n const opts = {\n limit: LIMIT,\n local: isLocal || undefined,\n };\n if (!isLocal && supports('@pixelfed/global-feed')) {\n opts.remote = true;\n }\n publicIterator.current = masto.v1.timelines.public.list(opts);\n }\n const results = await publicIterator.current.next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'public');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.timelines.public\n .list({\n limit: 1,\n local: isLocal,\n since_id: latestItem.current,\n })\n .next();\n let { value } = results;\n const valueContainsLatestItem = value[0]?.id === latestItem.current; // since_id might not be supported\n if (value?.length && !valueContainsLatestItem) {\n value = filteredItems(value, 'public');\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n return (\n <Timeline\n key={instance + isLocal}\n title={title}\n titleComponent={\n <h1 class=\"header-double-lines\">\n <b>{isLocal ? t`Local timeline` : t`Federated timeline`}</b>\n <div>{instance}</div>\n </h1>\n }\n id=\"public\"\n instance={instance}\n emptyText={t`No one has posted anything yet.`}\n errorText={t`Unable to load posts`}\n fetchItems={fetchPublic}\n checkForUpdates={checkForUpdates}\n useItemID\n headerStart={<></>}\n boostsCarousel={snapStates.settings.boostsCarousel}\n // allowFilters\n filterContext=\"public\"\n headerEnd={\n <Menu2\n portal\n // setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem href={isLocal ? `/#/${instance}/p` : `/#/${instance}/p/l`}>\n {isLocal ? (\n <>\n <Icon icon=\"transfer\" />{' '}\n <span>\n <Trans>Switch to Federated</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"transfer\" />{' '}\n <span>\n <Trans>Switch to Local</Trans>\n </span>\n </>\n )}\n </MenuItem>\n <MenuDivider />\n <MenuItem\n onClick={() => {\n let newInstance = prompt(\n t`Enter a new instance e.g. \"mastodon.social\"`,\n );\n if (!/\\./.test(newInstance)) {\n if (newInstance) alert(t`Invalid instance`);\n return;\n }\n if (newInstance) {\n newInstance = newInstance.toLowerCase().trim();\n // navigate(isLocal ? `/${newInstance}/p/l` : `/${newInstance}/p`);\n location.hash = isLocal\n ? `/${newInstance}/p/l`\n : `/${newInstance}/p`;\n }\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <span>\n <Trans>Go to another instance…</Trans>\n </span>\n </MenuItem>\n {currentInstance !== instance && (\n <MenuItem\n onClick={() => {\n location.hash = isLocal\n ? `/${currentInstance}/p/l`\n : `/${currentInstance}/p`;\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Go to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nexport default Public;\n","import './search.css';\n\nimport { useAutoAnimate } from '@formkit/auto-animate/preact';\nimport { t, Trans } from '@lingui/macro';\nimport { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { InView } from 'react-intersection-observer';\nimport { useParams, useSearchParams } from 'react-router-dom';\n\nimport AccountBlock from '../components/account-block';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport NavMenu from '../components/nav-menu';\nimport SearchForm from '../components/search-form';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport { fetchRelationships } from '../utils/relationships';\nimport shortenNumber from '../utils/shorten-number';\nimport usePageVisibility from '../utils/usePageVisibility';\nimport useTitle from '../utils/useTitle';\n\nconst SHORT_LIMIT = 5;\nconst LIMIT = 40;\nconst emptySearchParams = new URLSearchParams();\n\nfunction Search({ columnMode, ...props }) {\n const params = columnMode ? {} : useParams();\n const { masto, instance, authenticated } = api({\n instance: params.instance,\n });\n const [uiState, setUIState] = useState('default');\n const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();\n const searchFormRef = useRef();\n const q = props?.query || searchParams.get('q');\n const type = columnMode\n ? 'statuses'\n : props?.type || searchParams.get('type');\n let title = t`Search`;\n if (q) {\n switch (type) {\n case 'statuses':\n title = t`Search: ${q} (Posts)`;\n break;\n case 'accounts':\n title = t`Search: ${q} (Accounts)`;\n break;\n case 'hashtags':\n title = t`Search: ${q} (Hashtags)`;\n break;\n default:\n title = t`Search: ${q}`;\n }\n }\n useTitle(title, `/search`);\n\n const [showMore, setShowMore] = useState(false);\n const offsetRef = useRef(0);\n useEffect(() => {\n offsetRef.current = 0;\n }, [q, type]);\n\n const scrollableRef = useRef();\n useLayoutEffect(() => {\n scrollableRef.current?.scrollTo?.(0, 0);\n }, [q, type]);\n\n const [statusResults, setStatusResults] = useState([]);\n const [accountResults, setAccountResults] = useState([]);\n const [hashtagResults, setHashtagResults] = useState([]);\n useEffect(() => {\n setStatusResults([]);\n setAccountResults([]);\n setHashtagResults([]);\n }, [q]);\n const setTypeResultsFunc = {\n statuses: setStatusResults,\n accounts: setAccountResults,\n hashtags: setHashtagResults,\n };\n\n const [relationshipsMap, setRelationshipsMap] = useState({});\n const loadRelationships = async (accounts) => {\n if (!accounts?.length) return;\n const relationships = await fetchRelationships(accounts, relationshipsMap);\n if (relationships) {\n setRelationshipsMap({\n ...relationshipsMap,\n ...relationships,\n });\n }\n };\n\n function loadResults(firstLoad) {\n if (firstLoad) {\n offsetRef.current = 0;\n }\n\n if (!firstLoad && !authenticated) {\n // Search results pagination is only available to authenticated users\n return;\n }\n\n setUIState('loading');\n if (firstLoad && !type) {\n setStatusResults(statusResults.slice(0, SHORT_LIMIT));\n setAccountResults(accountResults.slice(0, SHORT_LIMIT));\n setHashtagResults(hashtagResults.slice(0, SHORT_LIMIT));\n }\n\n (async () => {\n const params = {\n q,\n resolve: authenticated,\n limit: SHORT_LIMIT,\n };\n if (type) {\n params.limit = LIMIT;\n params.type = type;\n if (authenticated) params.offset = offsetRef.current;\n }\n\n try {\n const results = await masto.v2.search.fetch(params);\n console.log(results);\n if (type) {\n if (firstLoad) {\n setTypeResultsFunc[type](results[type]);\n const length = results[type]?.length;\n offsetRef.current = LIMIT;\n setShowMore(!!length);\n } else {\n setTypeResultsFunc[type]((prev) => [...prev, ...results[type]]);\n const length = results[type]?.length;\n offsetRef.current = offsetRef.current + LIMIT;\n setShowMore(!!length);\n }\n } else {\n setStatusResults(results.statuses || []);\n setAccountResults(results.accounts || []);\n setHashtagResults(results.hashtags || []);\n offsetRef.current = 0;\n setShowMore(false);\n }\n loadRelationships(results.accounts);\n\n setUIState('default');\n } catch (err) {\n console.error(err);\n setUIState('error');\n }\n })();\n }\n\n const lastHiddenTime = useRef();\n usePageVisibility((visible) => {\n const reachStart = scrollableRef.current?.scrollTop === 0;\n if (visible && reachStart) {\n const timeDiff = Date.now() - lastHiddenTime.current;\n if (!lastHiddenTime.current || timeDiff > 1000 * 3) {\n // 3 seconds\n loadResults(true);\n } else {\n lastHiddenTime.current = Date.now();\n }\n }\n });\n\n useEffect(() => {\n searchFormRef.current?.setValue?.(q || '');\n if (q) {\n loadResults(true);\n } else {\n searchFormRef.current?.focus?.();\n }\n }, [q, type, instance]);\n\n useHotkeys(\n ['/', 'Slash'],\n (e) => {\n searchFormRef.current?.focus?.();\n searchFormRef.current?.select?.();\n },\n {\n preventDefault: true,\n },\n );\n\n const [filterBarParent] = useAutoAnimate();\n\n return (\n <div id=\"search-page\" class=\"deck-container\" ref={scrollableRef}>\n <div class=\"timeline-deck deck\">\n <header class={uiState === 'loading' ? 'loading' : ''}>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n </div>\n <SearchForm ref={searchFormRef} />\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n loadResults(true);\n }}\n disabled={uiState === 'loading'}\n >\n <Icon icon=\"search\" size=\"l\" alt={t`Search`} />\n </button>\n </div>\n </div>\n </header>\n <main>\n {!!q && !columnMode && (\n <div\n ref={filterBarParent}\n class={`filter-bar ${uiState === 'loading' ? 'loading' : ''}`}\n >\n {!!type && (\n <Link to={`/search${q ? `?q=${encodeURIComponent(q)}` : ''}`}>\n <Icon icon=\"chevron-left\" /> <Trans>All</Trans>\n </Link>\n )}\n {[\n {\n label: t`Accounts`,\n type: 'accounts',\n to: `/search?q=${encodeURIComponent(q)}&type=accounts`,\n },\n {\n label: t`Hashtags`,\n type: 'hashtags',\n to: `/search?q=${encodeURIComponent(q)}&type=hashtags`,\n },\n {\n label: t`Posts`,\n type: 'statuses',\n to: `/search?q=${encodeURIComponent(q)}&type=statuses`,\n },\n ]\n .sort((a, b) => {\n if (a.type === type) return -1;\n if (b.type === type) return 1;\n return 0;\n })\n .map((link) => (\n <Link to={link.to} key={link.type}>\n {link.label}\n </Link>\n ))}\n </div>\n )}\n {!!q ? (\n <>\n {(!type || type === 'accounts') && (\n <>\n {type !== 'accounts' && (\n <h2 class=\"timeline-header\">\n <Trans>Accounts</Trans>{' '}\n <Link\n to={`/search?q=${encodeURIComponent(q)}&type=accounts`}\n >\n <Icon icon=\"arrow-right\" size=\"l\" alt={t`See more`} />\n </Link>\n </h2>\n )}\n {accountResults.length > 0 ? (\n <>\n <ul class=\"timeline flat accounts-list\">\n {accountResults.map((account) => (\n <li key={account.id}>\n <AccountBlock\n account={account}\n instance={instance}\n showStats\n relationship={relationshipsMap[account.id]}\n />\n </li>\n ))}\n </ul>\n {type !== 'accounts' && (\n <div class=\"ui-state\">\n <Link\n class=\"plain button\"\n to={`/search?q=${encodeURIComponent(\n q,\n )}&type=accounts`}\n >\n <Trans>See more accounts</Trans>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n )}\n </>\n ) : (\n !type &&\n (uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No accounts found.</Trans>\n </p>\n ))\n )}\n </>\n )}\n {(!type || type === 'hashtags') && (\n <>\n {type !== 'hashtags' && (\n <h2 class=\"timeline-header\">\n <Trans>Hashtags</Trans>{' '}\n <Link\n to={`/search?q=${encodeURIComponent(q)}&type=hashtags`}\n >\n <Icon icon=\"arrow-right\" size=\"l\" alt={t`See more`} />\n </Link>\n </h2>\n )}\n {hashtagResults.length > 0 ? (\n <>\n <ul class=\"link-list hashtag-list\">\n {hashtagResults.map((hashtag) => {\n const { name, history } = hashtag;\n const total = history?.reduce?.(\n (acc, cur) => acc + +cur.uses,\n 0,\n );\n return (\n <li key={`${name}-${total}`}>\n <Link\n to={\n instance\n ? `/${instance}/t/${name}`\n : `/t/${name}`\n }\n >\n <Icon icon=\"hashtag\" alt=\"#\" />\n <span>{name}</span>\n {!!total && (\n <span class=\"count\">\n {shortenNumber(total)}\n </span>\n )}\n </Link>\n </li>\n );\n })}\n </ul>\n {type !== 'hashtags' && (\n <div class=\"ui-state\">\n <Link\n class=\"plain button\"\n to={`/search?q=${encodeURIComponent(\n q,\n )}&type=hashtags`}\n >\n <Trans>See more hashtags</Trans>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n )}\n </>\n ) : (\n !type &&\n (uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No hashtags found.</Trans>\n </p>\n ))\n )}\n </>\n )}\n {(!type || type === 'statuses') && (\n <>\n {type !== 'statuses' && (\n <h2 class=\"timeline-header\">\n <Trans>Posts</Trans>{' '}\n <Link\n to={`/search?q=${encodeURIComponent(q)}&type=statuses`}\n >\n <Icon icon=\"arrow-right\" size=\"l\" alt={t`See more`} />\n </Link>\n </h2>\n )}\n {statusResults.length > 0 ? (\n <>\n <ul class=\"timeline\">\n {statusResults.map((status) => (\n <li key={status.id}>\n <Link\n class=\"status-link\"\n to={\n instance\n ? `/${instance}/s/${status.id}`\n : `/s/${status.id}`\n }\n >\n <Status status={status} />\n </Link>\n </li>\n ))}\n </ul>\n {type !== 'statuses' && (\n <div class=\"ui-state\">\n <Link\n class=\"plain button\"\n to={`/search?q=${encodeURIComponent(\n q,\n )}&type=statuses`}\n >\n <Trans>See more posts</Trans>{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </div>\n )}\n </>\n ) : (\n !type &&\n (uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No posts found.</Trans>\n </p>\n ))\n )}\n </>\n )}\n {!!type &&\n (uiState === 'default' ? (\n showMore ? (\n <InView\n onChange={(inView) => {\n if (inView) {\n loadResults();\n }\n }}\n >\n <button\n type=\"button\"\n class=\"plain block\"\n onClick={() => loadResults()}\n style={{ marginBlockEnd: '6em' }}\n >\n <Trans>Show more…</Trans>\n </button>\n </InView>\n ) : (\n <p class=\"ui-state insignificant\">\n <Trans>The end.</Trans>\n </p>\n )\n ) : (\n uiState === 'loading' && (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n )\n ))}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader abrupt />\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>\n Enter your search term or paste a URL above to get started.\n </Trans>\n </p>\n )}\n </main>\n </div>\n </div>\n );\n}\n\nexport default Search;\n","import '../components/links-bar.css';\nimport './trending.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport { MenuItem } from '@szhsin/react-menu';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Menu2 from '../components/menu2';\nimport NameText from '../components/name-text';\nimport RelativeTime from '../components/relative-time';\nimport Timeline from '../components/timeline';\nimport { api } from '../utils/api';\nimport { oklab2rgb, rgb2oklab } from '../utils/color-utils';\nimport { filteredItems } from '../utils/filters';\nimport pmem from '../utils/pmem';\nimport shortenNumber from '../utils/shorten-number';\nimport states, { saveStatus } from '../utils/states';\nimport supports from '../utils/supports';\nimport useTitle from '../utils/useTitle';\n\nconst LIMIT = 20;\nconst TREND_CACHE_TIME = 10 * 60 * 1000; // 10 minutes\n\nconst fetchLinks = pmem(\n (masto) => {\n return masto.v1.trends.links.list().next();\n },\n {\n maxAge: TREND_CACHE_TIME,\n },\n);\n\nconst fetchHashtags = pmem(\n (masto) => {\n return masto.v1.trends.tags.list().next();\n },\n {\n maxAge: TREND_CACHE_TIME,\n },\n);\n\nfunction fetchTrendsStatuses(masto) {\n if (supports('@pixelfed/trending')) {\n return masto.pixelfed.v2.discover.posts.trending.list({\n range: 'daily',\n });\n }\n return masto.v1.trends.statuses.list({\n limit: LIMIT,\n });\n}\n\nfunction fetchLinkList(masto, params) {\n return masto.v1.timelines.link.list(params);\n}\n\nfunction Trending({ columnMode, ...props }) {\n const snapStates = useSnapshot(states);\n const params = columnMode ? {} : useParams();\n const { masto, instance } = api({\n instance: props?.instance || params.instance,\n });\n const { masto: currentMasto, instance: currentInstance } = api();\n const title = t`Trending (${instance})`;\n useTitle(title, `/:instance?/trending`);\n // const navigate = useNavigate();\n const latestItem = useRef();\n\n const sameCurrentInstance = instance === currentInstance;\n\n const [hashtags, setHashtags] = useState([]);\n const [links, setLinks] = useState([]);\n const trendIterator = useRef();\n\n async function fetchTrends(firstLoad) {\n console.log('fetchTrend', firstLoad);\n if (firstLoad || !trendIterator.current) {\n trendIterator.current = fetchTrendsStatuses(masto);\n\n // Get hashtags\n if (supports('@mastodon/trending-hashtags')) {\n try {\n // const iterator = masto.v1.trends.tags.list();\n const { value: tags } = await fetchHashtags(masto);\n console.log('tags', tags);\n if (tags?.length) {\n setHashtags(tags);\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n // Get links\n if (supports('@mastodon/trending-links')) {\n try {\n const { value } = await fetchLinks(masto, instance);\n // 4 types available: link, photo, video, rich\n // Only want links for now\n const links = value?.filter?.((link) => link.type === 'link');\n console.log('links', links);\n if (links?.length) {\n setLinks(links);\n }\n } catch (e) {\n console.error(e);\n }\n }\n }\n const results = await trendIterator.current.next();\n let { value } = results;\n if (value?.length) {\n if (firstLoad) {\n latestItem.current = value[0].id;\n }\n\n // value = filteredItems(value, 'public'); // Might not work here\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n return {\n ...results,\n value,\n };\n }\n\n // Link mentions\n // https://github.com/mastodon/mastodon/pull/30381\n const [currentLinkMentionsLoading, setCurrentLinkMentionsLoading] =\n useState(false);\n const currentLinkMentionsIterator = useRef();\n const [currentLink, setCurrentLink] = useState(null);\n const hasCurrentLink = !!currentLink;\n const currentLinkRef = useRef();\n const supportsTrendingLinkPosts =\n sameCurrentInstance && supports('@mastodon/trending-link-posts');\n\n useEffect(() => {\n if (currentLink && currentLinkRef.current) {\n currentLinkRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'center',\n });\n }\n }, [currentLink]);\n\n const prevCurrentLink = useRef();\n async function fetchLinkMentions(firstLoad) {\n if (firstLoad || !currentLinkMentionsIterator.current) {\n setCurrentLinkMentionsLoading(true);\n currentLinkMentionsIterator.current = fetchLinkList(masto, {\n url: currentLink,\n });\n }\n prevCurrentLink.current = currentLink;\n const results = await currentLinkMentionsIterator.current.next();\n let { value } = results;\n if (value?.length) {\n value = filteredItems(value, 'public');\n value.forEach((item) => {\n saveStatus(item, instance);\n });\n }\n if (prevCurrentLink.current === currentLink) {\n setCurrentLinkMentionsLoading(false);\n }\n return {\n ...results,\n value,\n };\n }\n\n async function checkForUpdates() {\n try {\n const results = await masto.v1.trends.statuses\n .list({\n limit: 1,\n // NOT SUPPORTED\n // since_id: latestItem.current,\n })\n .next();\n let { value } = results;\n value = filteredItems(value, 'public');\n if (value?.length && value[0].id !== latestItem.current) {\n latestItem.current = value[0].id;\n return true;\n }\n return false;\n } catch (e) {\n return false;\n }\n }\n\n const TimelineStart = useMemo(() => {\n return (\n <>\n {!!hashtags.length && (\n <div class=\"filter-bar expandable\">\n <Icon icon=\"chart\" class=\"insignificant\" size=\"l\" />\n {hashtags.map((tag, i) => {\n const { name, history } = tag;\n const total = history.reduce((acc, cur) => acc + +cur.uses, 0);\n return (\n <Link to={`/${instance}/t/${name}`} key={name}>\n <span dir=\"auto\">\n <span class=\"more-insignificant\">#</span>\n {name}\n </span>\n <span class=\"filter-count\">{shortenNumber(total)}</span>\n </Link>\n );\n })}\n </div>\n )}\n {!!links.length && (\n <div class=\"links-bar\">\n <header>\n <h3>\n <Trans>Trending News</Trans>\n </h3>\n </header>\n {links.map((link) => {\n const {\n authors,\n authorName,\n authorUrl,\n blurhash,\n description,\n height,\n image,\n imageDescription,\n language,\n providerName,\n providerUrl,\n publishedAt,\n title,\n url,\n width,\n } = link;\n const author = authors?.[0]?.account?.id\n ? authors[0].account\n : null;\n const isShortTitle = title.length < 30;\n const hasAuthor = !!(authorName || author);\n const domain = punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n let accentColor;\n if (blurhash) {\n const averageColor = getBlurHashAverageColor(blurhash);\n const labAverageColor = rgb2oklab(averageColor);\n accentColor = oklab2rgb([\n 0.6,\n labAverageColor[1],\n labAverageColor[2],\n ]);\n }\n\n return (\n <div key={url}>\n <a\n ref={currentLink === url ? currentLinkRef : null}\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class={`link-block ${\n hasCurrentLink\n ? currentLink === url\n ? 'active'\n : 'inactive'\n : ''\n }`}\n style={\n accentColor\n ? {\n '--accent-color': `rgb(${accentColor.join(',')})`,\n '--accent-alpha-color': `rgba(${accentColor.join(\n ',',\n )}, 0.4)`,\n }\n : {}\n }\n >\n <article>\n <figure>\n <img\n src={image}\n alt={imageDescription}\n width={width}\n height={height}\n loading=\"lazy\"\n />\n </figure>\n <div class=\"article-body\">\n <header>\n <div class=\"article-meta\">\n <span class=\"domain\">{domain}</span>{' '}\n {!!publishedAt && <>&middot; </>}\n {!!publishedAt && (\n <>\n <RelativeTime\n datetime={publishedAt}\n format=\"micro\"\n />\n </>\n )}\n </div>\n {!!title && (\n <h1\n class=\"title\"\n lang={language}\n dir=\"auto\"\n title={title}\n >\n {title}\n </h1>\n )}\n </header>\n {!!description && (\n <p\n class={`description ${\n hasAuthor && !isShortTitle ? '' : 'more-lines'\n }`}\n lang={language}\n dir=\"auto\"\n title={description}\n >\n {description}\n </p>\n )}\n {hasAuthor && (\n <>\n <hr />\n <p class=\"byline\">\n <small>\n <Trans comment=\"By [Author]\">\n By{' '}\n {author ? (\n <NameText account={author} showAvatar />\n ) : authorUrl ? (\n <a\n href={authorUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {authorName}\n </a>\n ) : (\n authorName\n )}\n </Trans>\n </small>\n </p>\n </>\n )}\n </div>\n </article>\n </a>\n {supportsTrendingLinkPosts && (\n <button\n type=\"button\"\n class=\"small plain4 block\"\n onClick={() => {\n setCurrentLink(url);\n }}\n disabled={url === currentLink}\n >\n <Icon icon=\"comment2\" />{' '}\n <span>\n <Trans>Mentions</Trans>\n </span>{' '}\n <Icon icon=\"chevron-down\" />\n </button>\n )}\n </div>\n );\n })}\n </div>\n )}\n {supportsTrendingLinkPosts && !!links.length && (\n <div\n class={`timeline-header-block ${hasCurrentLink ? 'blended' : ''}`}\n >\n {hasCurrentLink ? (\n <>\n <div style={{ width: 50, flexShrink: 0, textAlign: 'center' }}>\n {currentLinkMentionsLoading ? (\n <Loader abrupt />\n ) : (\n <button\n type=\"button\"\n class=\"light\"\n onClick={() => {\n setCurrentLink(null);\n }}\n >\n <Icon icon=\"x\" alt={t`Back to showing trending posts`} />\n </button>\n )}\n </div>\n <p>\n <Trans>\n Showing posts mentioning{' '}\n <span class=\"link-text\">\n {currentLink\n .replace(/^https?:\\/\\/(www\\.)?/i, '')\n .replace(/\\/$/, '')}\n </span>\n </Trans>\n </p>\n </>\n ) : (\n <p class=\"insignificant\">\n <Trans>Trending posts</Trans>\n </p>\n )}\n </div>\n )}\n </>\n );\n }, [hashtags, links, currentLink, currentLinkMentionsLoading]);\n\n return (\n <Timeline\n key={instance}\n title={title}\n titleComponent={\n <h1 class=\"header-double-lines\">\n <b>\n <Trans>Trending</Trans>\n </b>\n <div>{instance}</div>\n </h1>\n }\n id=\"trending\"\n instance={instance}\n emptyText={t`No trending posts.`}\n errorText={t`Unable to load posts`}\n fetchItems={hasCurrentLink ? fetchLinkMentions : fetchTrends}\n checkForUpdates={hasCurrentLink ? undefined : checkForUpdates}\n checkForUpdatesInterval={5 * 60 * 1000} // 5 minutes\n useItemID\n headerStart={<></>}\n boostsCarousel={snapStates.settings.boostsCarousel}\n // allowFilters\n filterContext=\"public\"\n timelineStart={TimelineStart}\n refresh={currentLink}\n clearWhenRefresh\n view={hasCurrentLink ? 'link-mentions' : undefined}\n headerEnd={\n <Menu2\n portal\n // setDownOverflow\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n menuButton={\n <button type=\"button\" class=\"plain\">\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n }\n >\n <MenuItem\n onClick={() => {\n let newInstance = prompt(\n t`Enter a new instance e.g. \"mastodon.social\"`,\n );\n if (!/\\./.test(newInstance)) {\n if (newInstance) alert(t`Invalid instance`);\n return;\n }\n if (newInstance) {\n newInstance = newInstance.toLowerCase().trim();\n // navigate(`/${newInstance}/trending`);\n location.hash = `/${newInstance}/trending`;\n }\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <span>\n <Trans>Go to another instance…</Trans>\n </span>\n </MenuItem>\n {currentInstance !== instance && (\n <MenuItem\n onClick={() => {\n location.hash = `/${currentInstance}/trending`;\n }}\n >\n <Icon icon=\"bus\" />{' '}\n <small class=\"menu-double-lines\">\n <Trans>\n Go to my instance (<b>{currentInstance}</b>)\n </Trans>\n </small>\n </MenuItem>\n )}\n </Menu2>\n }\n />\n );\n}\n\nexport default Trending;\n","import { t, Trans } from '@lingui/macro';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useSnapshot } from 'valtio';\n\nimport Bookmarks from '../pages/bookmarks';\nimport Favourites from '../pages/favourites';\nimport Following from '../pages/following';\nimport Hashtag from '../pages/hashtag';\nimport List from '../pages/list';\nimport Mentions from '../pages/mentions';\nimport Notifications from '../pages/notifications';\nimport Public from '../pages/public';\nimport Search from '../pages/search';\nimport Trending from '../pages/trending';\nimport states from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nfunction Columns() {\n useTitle(t`Home`, '/');\n const snapStates = useSnapshot(states);\n const { shortcuts } = snapStates;\n\n console.debug('RENDER Columns', shortcuts);\n\n const components = shortcuts.map((shortcut) => {\n if (!shortcut) return null;\n const { type, ...params } = shortcut;\n const Component = {\n following: Following,\n notifications: Notifications,\n list: List,\n public: Public,\n bookmarks: Bookmarks,\n favourites: Favourites,\n hashtag: Hashtag,\n mentions: Mentions,\n trending: Trending,\n search: Search,\n }[type];\n if (!Component) return null;\n // Don't show Search column with no query, for now\n if (type === 'search' && !params.query) return null;\n // Don't show List column with no list, for now\n if (type === 'list' && !params.id) return null;\n return (\n <Component key={type + JSON.stringify(params)} {...params} columnMode />\n );\n });\n\n useHotkeys(['1', '2', '3', '4', '5', '6', '7', '8', '9'], (e, handler) => {\n try {\n const index = parseInt(handler.keys[0], 10) - 1;\n document.querySelectorAll('#columns > *')[index].focus();\n } catch (e) {\n console.error(e);\n }\n });\n\n return (\n <div\n id=\"columns\"\n onContextMenu={(e) => {\n // If right-click on header, but not links or buttons\n if (\n e.target.closest('.deck > header') &&\n !e.target.closest('a') &&\n !e.target.closest('button')\n ) {\n e.preventDefault();\n states.showShortcutsSettings = true;\n }\n }}\n >\n {components}\n </div>\n );\n}\n\nexport default Columns;\n","import './notifications-menu.css';\n\nimport { msg, t, Trans } from '@lingui/macro';\nimport { useLingui } from '@lingui/react';\nimport { ControlledMenu } from '@szhsin/react-menu';\nimport { memo } from 'preact/compat';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useSnapshot } from 'valtio';\n\nimport Columns from '../components/columns';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport Notification from '../components/notification';\nimport { api } from '../utils/api';\nimport db from '../utils/db';\nimport { massageNotifications2 } from '../utils/group-notifications';\nimport states, { saveStatus } from '../utils/states';\nimport { getCurrentAccountNS } from '../utils/store-utils';\n\nimport Following from './following';\nimport {\n getGroupedNotifications,\n mastoFetchNotifications,\n} from './notifications';\n\nfunction Home() {\n const { _ } = useLingui();\n const snapStates = useSnapshot(states);\n __BENCHMARK.end('time-to-home');\n useEffect(() => {\n (async () => {\n const keys = await db.drafts.keys();\n if (keys.length) {\n const ns = getCurrentAccountNS();\n const ownKeys = keys.filter((key) => key.startsWith(ns));\n if (ownKeys.length) {\n states.showDrafts = true;\n }\n }\n })();\n }, []);\n\n return (\n <>\n {(snapStates.settings.shortcutsViewMode === 'multi-column' ||\n (!snapStates.settings.shortcutsViewMode &&\n snapStates.settings.shortcutsColumnsMode)) &&\n !!snapStates.shortcuts?.length ? (\n <Columns />\n ) : (\n <Following\n title={_(msg`Home`)}\n path=\"/\"\n id=\"home\"\n headerStart={false}\n headerEnd={<NotificationsLink />}\n />\n )}\n </>\n );\n}\n\nfunction NotificationsLink() {\n const snapStates = useSnapshot(states);\n const notificationLinkRef = useRef();\n const [menuState, setMenuState] = useState(undefined);\n return (\n <>\n <Link\n ref={notificationLinkRef}\n to=\"/notifications\"\n class={`button plain notifications-button ${\n snapStates.notificationsShowNew ? 'has-badge' : ''\n } ${menuState || ''}`}\n onClick={(e) => {\n e.stopPropagation();\n if (window.matchMedia('(min-width: calc(40em))').matches) {\n e.preventDefault();\n setMenuState((state) => (!state ? 'open' : undefined));\n }\n }}\n >\n <Icon icon=\"notification\" size=\"l\" alt={t`Notifications`} />\n </Link>\n <NotificationsMenu\n state={menuState}\n anchorRef={notificationLinkRef}\n onClose={() => setMenuState(undefined)}\n />\n </>\n );\n}\n\nconst NOTIFICATIONS_DISPLAY_LIMIT = 5;\nfunction NotificationsMenu({ anchorRef, state, onClose }) {\n const { masto, instance } = api();\n const snapStates = useSnapshot(states);\n const [uiState, setUIState] = useState('default');\n\n const notificationsIterator = mastoFetchNotifications();\n\n async function fetchNotifications() {\n const allNotifications = await notificationsIterator.next();\n const notifications = massageNotifications2(allNotifications.value);\n\n if (notifications?.length) {\n notifications.forEach((notification) => {\n saveStatus(notification.status, instance, {\n skipThreading: true,\n });\n });\n\n const groupedNotifications = getGroupedNotifications(notifications);\n\n states.notificationsLast = groupedNotifications[0];\n states.notifications = groupedNotifications;\n\n // Update last read marker\n masto.v1.markers\n .create({\n notifications: {\n lastReadId: groupedNotifications[0].id,\n },\n })\n .catch(() => {});\n }\n\n states.notificationsShowNew = false;\n states.notificationsLastFetchTime = Date.now();\n return allNotifications;\n }\n\n const [hasFollowRequests, setHasFollowRequests] = useState(false);\n function fetchFollowRequests() {\n return masto.v1.followRequests.list({\n limit: 1,\n });\n }\n\n function loadNotifications() {\n setUIState('loading');\n (async () => {\n try {\n await fetchNotifications();\n const followRequests = await fetchFollowRequests();\n setHasFollowRequests(!!followRequests?.length);\n setUIState('default');\n } catch (e) {\n setUIState('error');\n }\n })();\n }\n\n useEffect(() => {\n if (state === 'open') loadNotifications();\n }, [state]);\n\n const menuRef = useRef();\n\n return (\n <ControlledMenu\n ref={menuRef}\n menuClassName=\"notifications-menu\"\n state={state}\n anchorRef={anchorRef}\n onClose={onClose}\n portal={{\n target: document.body,\n }}\n containerProps={{\n onClick: () => {\n menuRef.current?.closeMenu?.();\n },\n }}\n overflow=\"auto\"\n viewScroll=\"close\"\n position=\"anchor\"\n align=\"center\"\n boundingBoxPadding=\"8 8 8 8\"\n >\n <header>\n <h2>\n <Trans>Notifications</Trans>\n </h2>\n </header>\n <main>\n {snapStates.notifications.length ? (\n <>\n {snapStates.notifications\n .slice(0, NOTIFICATIONS_DISPLAY_LIMIT)\n .map((notification) => (\n <Notification\n key={notification._ids || notification.id}\n instance={instance}\n notification={notification}\n disableContextMenu\n />\n ))}\n </>\n ) : uiState === 'loading' ? (\n <div class=\"ui-state\">\n <Loader abrupt />\n </div>\n ) : (\n uiState === 'error' && (\n <div class=\"ui-state\">\n <p>\n <Trans>Unable to fetch notifications.</Trans>\n </p>\n <p>\n <button type=\"button\" onClick={loadNotifications}>\n <Trans>Try again</Trans>\n </button>\n </p>\n </div>\n )\n )}\n </main>\n <footer>\n <Link to=\"/mentions\" class=\"button plain\">\n <Icon icon=\"at\" />{' '}\n <span>\n <Trans>Mentions</Trans>\n </span>\n </Link>\n <Link to=\"/notifications\" class=\"button plain2\">\n {hasFollowRequests ? (\n <Trans>\n <span class=\"tag collapsed\">New</span>{' '}\n <span>Follow Requests</span>\n </Trans>\n ) : (\n <b>\n <Trans>See all</Trans>\n </b>\n )}{' '}\n <Icon icon=\"arrow-right\" />\n </Link>\n </footer>\n </ControlledMenu>\n );\n}\n\nexport default memo(Home);\n","// export const statusRegex = /\\/@([^@\\/]+)@?([^\\/]+)?\\/([^\\/]+)\\/?$/i;\n// export const statusNoteRegex = /\\/notes\\/([^\\/]+)\\/?$/i;\n\nconst statusPostRegexes = [\n /^\\/@[^@\\/]+\\/(?:statuses|posts)\\/([^\\/]+)/i, // GoToSocial, Takahe\n /\\/notes\\/([^\\/]+)/i, // Misskey, Firefish\n /^\\/(?:notice|objects)\\/([a-z0-9-]+)/i, // Pleroma\n /\\/@[^@\\/]+\\/post\\/([^\\/]+)/i, // Threads\n /\\/@[^@\\/]+@?[^\\/]+?\\/([^\\/]+)/i, // Mastodon\n /^\\/p\\/[^\\/]+\\/([^\\/]+)/i, // Pixelfed\n];\n\nexport function getInstanceStatusObject(url) {\n // Regex /:username/:id, where username = @username or @username@domain, id = anything\n const { hostname, pathname } = URL.parse(url);\n // const [, username, domain, id] = pathname.match(statusRegex) || [];\n for (const regex of statusPostRegexes) {\n const [, id] = pathname.match(regex) || [];\n console.log(pathname, regex, id);\n if (id) {\n return {\n instance: hostname,\n id,\n };\n }\n }\n return {};\n}\n\nfunction getInstanceStatusURL(url) {\n const { instance, id } = getInstanceStatusObject(url);\n if (instance && id) {\n return `/${instance}/s/${id}`;\n }\n return null;\n}\n\nexport default getInstanceStatusURL;\n","import { t, Trans } from '@lingui/macro';\nimport { useLayoutEffect, useState } from 'preact/hooks';\nimport { useLocation } from 'react-router-dom';\n\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport { api } from '../utils/api';\nimport getInstanceStatusURL, {\n getInstanceStatusObject,\n} from '../utils/get-instance-status-url';\n\nexport default function HttpRoute() {\n const location = useLocation();\n const url = location.pathname.replace(/^\\//, '');\n const statusObject = getInstanceStatusObject(url);\n // const statusURL = getInstanceStatusURL(url);\n const statusURL = statusObject?.instance\n ? `/${statusObject.instance}/s/${statusObject.id}`\n : null;\n const [uiState, setUIState] = useState('loading');\n\n useLayoutEffect(() => {\n setUIState('loading');\n (async () => {\n // Check if status returns 200\n try {\n const { instance, id } = statusObject;\n if (id) {\n const { masto } = api({ instance });\n const status = await masto.v1.statuses.$select(id).fetch();\n if (status) {\n window.location.hash = statusURL + '?view=full';\n return;\n }\n }\n } catch (e) {}\n\n // Fallback to search\n {\n const { masto: currentMasto, instance: currentInstance } = api();\n const result = await currentMasto.v2.search.fetch({\n q: url,\n limit: 1,\n resolve: true,\n });\n if (result.statuses.length) {\n const status = result.statuses[0];\n window.location.hash = `/${currentInstance}/s/${status.id}?view=full`;\n } else if (result.accounts.length) {\n const account = result.accounts[0];\n window.location.hash = `/${currentInstance}/a/${account.id}`;\n } else if (statusURL) {\n // Fallback to original URL, which will probably show error\n window.location.hash = statusURL + '?view=full';\n } else {\n setUIState('error');\n }\n }\n })();\n }, [statusURL]);\n\n return (\n <div class=\"ui-state\" tabIndex=\"-1\">\n {uiState === 'loading' ? (\n <>\n <Loader abrupt />\n <h2>\n <Trans>Resolving…</Trans>\n </h2>\n <p>\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {url}\n </a>\n </p>\n </>\n ) : (\n <>\n <h2>\n <Trans>Unable to resolve URL</Trans>\n </h2>\n <p>\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {url}\n </a>\n </p>\n </>\n )}\n <hr />\n <p>\n <Link to=\"/\">\n <Trans>Go home</Trans>\n </Link>\n </p>\n </div>\n );\n}\n","import './lists.css';\n\nimport { Plural, t, Trans } from '@lingui/macro';\nimport { useEffect, useReducer, useState } from 'preact/hooks';\n\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport ListAddEdit from '../components/list-add-edit';\nimport Loader from '../components/loader';\nimport Modal from '../components/modal';\nimport NavMenu from '../components/nav-menu';\nimport { fetchLists } from '../utils/lists';\nimport useTitle from '../utils/useTitle';\n\nfunction Lists() {\n useTitle(t`Lists`, `/l`);\n const [uiState, setUIState] = useState('default');\n\n const [reloadCount, reload] = useReducer((c) => c + 1, 0);\n const [lists, setLists] = useState([]);\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const lists = await fetchLists();\n console.log(lists);\n setLists(lists);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, [reloadCount]);\n\n const [showListAddEditModal, setShowListAddEditModal] = useState(false);\n\n return (\n <div id=\"lists-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"timeline-deck deck\">\n <header>\n <div class=\"header-grid\">\n <div class=\"header-side\">\n <NavMenu />\n <Link to=\"/\" class=\"button plain\">\n <Icon icon=\"home\" size=\"l\" />\n </Link>\n </div>\n <h1>\n <Trans>Lists</Trans>\n </h1>\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => setShowListAddEditModal(true)}\n >\n <Icon icon=\"plus\" size=\"l\" alt={t`New list`} />\n </button>\n </div>\n </div>\n </header>\n <main>\n {lists.length > 0 ? (\n <>\n <ul class=\"link-list\">\n {lists.map((list) => (\n <li>\n <Link to={`/l/${list.id}`}>\n <span>\n <Icon icon=\"list\" /> <span>{list.title}</span>\n </span>\n {/* <button\n type=\"button\"\n class=\"plain\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n setShowListAddEditModal({\n list,\n });\n }}\n >\n <Icon icon=\"pencil\" />\n </button> */}\n </Link>\n </li>\n ))}\n </ul>\n {lists.length > 1 && (\n <footer class=\"ui-state\">\n <small class=\"insignificant\">\n <Plural value={lists.length} one=\"# list\" other=\"# lists\" />\n </small>\n </footer>\n )}\n </>\n ) : uiState === 'loading' ? (\n <p class=\"ui-state\">\n <Loader />\n </p>\n ) : uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Unable to load lists.</Trans>\n </p>\n ) : (\n <p class=\"ui-state\">\n <Trans>No lists yet.</Trans>\n </p>\n )}\n </main>\n </div>\n {showListAddEditModal && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowListAddEditModal(false);\n }\n }}\n >\n <ListAddEdit\n list={showListAddEditModal?.list}\n onClose={(result) => {\n if (result.state === 'success') {\n reload();\n }\n setShowListAddEditModal(false);\n }}\n />\n </Modal>\n )}\n </div>\n );\n}\n\nexport default Lists;\n","export default \"__VITE_ASSET__Y_wpqkTO__\"","function dec2hex(dec) {\n return ('0' + dec.toString(16)).slice(-2);\n}\nexport function verifier() {\n var array = new Uint32Array(56 / 2);\n window.crypto.getRandomValues(array);\n return Array.from(array, dec2hex).join('');\n}\nfunction sha256(plain) {\n // returns promise ArrayBuffer\n const encoder = new TextEncoder();\n const data = encoder.encode(plain);\n return window.crypto.subtle.digest('SHA-256', data);\n}\nfunction base64urlencode(a) {\n let str = '';\n const bytes = new Uint8Array(a);\n const len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n str += String.fromCharCode(bytes[i]);\n }\n return btoa(str).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\nexport async function generateCodeChallenge(v) {\n const hashed = await sha256(v);\n return base64urlencode(hashed);\n}\n\n// If /.well-known/oauth-authorization-server exists and code_challenge_methods_supported includes \"S256\", means support PKCE\nexport async function supportsPKCE({ instanceURL }) {\n if (!instanceURL) return false;\n try {\n const res = await fetch(\n `https://${instanceURL}/.well-known/oauth-authorization-server`,\n );\n if (!res.ok || res.status !== 200) return false;\n const json = await res.json();\n if (json.code_challenge_methods_supported?.includes('S256')) return true;\n return false;\n } catch (e) {\n return false;\n }\n}\n\n// For debugging\nwindow.__generateCodeChallenge = generateCodeChallenge;\n","import { generateCodeChallenge, verifier } from './oauth-pkce';\n\nconst {\n DEV,\n PHANPY_CLIENT_NAME: CLIENT_NAME,\n PHANPY_WEBSITE: WEBSITE,\n} = import.meta.env;\n\nconst SCOPES = 'read write follow push';\n\n/*\n PHANPY_WEBSITE is set to the default official site.\n It's used in pre-built releases, so there's no way to change it dynamically\n without rebuilding.\n Therefore, we can't use it as redirect_uri.\n We only use PHANPY_WEBSITE if it's \"same\" as current location URL.\n \n Very basic check based on location.hostname for now\n*/\nconst sameSite = WEBSITE\n ? WEBSITE.toLowerCase().includes(location.hostname)\n : false;\nconst currentLocation = location.origin + location.pathname;\nconst REDIRECT_URI = DEV || !sameSite ? currentLocation : WEBSITE;\n\nexport async function registerApplication({ instanceURL }) {\n const registrationParams = new URLSearchParams({\n client_name: CLIENT_NAME,\n redirect_uris: REDIRECT_URI,\n scopes: SCOPES,\n website: WEBSITE,\n });\n const registrationResponse = await fetch(\n `https://${instanceURL}/api/v1/apps`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: registrationParams.toString(),\n },\n );\n const registrationJSON = await registrationResponse.json();\n console.log({ registrationJSON });\n return registrationJSON;\n}\n\nexport async function getPKCEAuthorizationURL({ instanceURL, client_id }) {\n const codeVerifier = verifier();\n const codeChallenge = await generateCodeChallenge(codeVerifier);\n const params = new URLSearchParams({\n client_id,\n code_challenge_method: 'S256',\n code_challenge: codeChallenge,\n redirect_uri: REDIRECT_URI,\n response_type: 'code',\n scope: SCOPES,\n });\n const authorizationURL = `https://${instanceURL}/oauth/authorize?${params.toString()}`;\n return [authorizationURL, codeVerifier];\n}\n\nexport async function getAuthorizationURL({ instanceURL, client_id }) {\n const authorizationParams = new URLSearchParams({\n client_id,\n scope: SCOPES,\n redirect_uri: REDIRECT_URI,\n // redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',\n response_type: 'code',\n });\n const authorizationURL = `https://${instanceURL}/oauth/authorize?${authorizationParams.toString()}`;\n return authorizationURL;\n}\n\nexport async function getAccessToken({\n instanceURL,\n client_id,\n client_secret,\n code,\n code_verifier,\n}) {\n const params = new URLSearchParams({\n client_id,\n redirect_uri: REDIRECT_URI,\n grant_type: 'authorization_code',\n code,\n scope: SCOPES,\n // client_secret,\n // code_verifier,\n });\n if (client_secret) {\n params.append('client_secret', client_secret);\n }\n if (code_verifier) {\n params.append('code_verifier', code_verifier);\n }\n const tokenResponse = await fetch(`https://${instanceURL}/oauth/token`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: params.toString(),\n });\n const tokenJSON = await tokenResponse.json();\n console.log({ tokenJSON });\n return tokenJSON;\n}\n","import './login.css';\n\nimport { t, Trans } from '@lingui/macro';\nimport Fuse from 'fuse.js';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useSearchParams } from 'react-router-dom';\n\nimport logo from '../assets/logo.svg';\n\nimport LangSelector from '../components/lang-selector';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport instancesListURL from '../data/instances.json?url';\nimport {\n getAuthorizationURL,\n getPKCEAuthorizationURL,\n registerApplication,\n} from '../utils/auth';\nimport { supportsPKCE } from '../utils/oauth-pkce';\nimport store from '../utils/store';\nimport useTitle from '../utils/useTitle';\n\nconst { PHANPY_DEFAULT_INSTANCE: DEFAULT_INSTANCE } = import.meta.env;\n\nfunction Login() {\n useTitle('Log in');\n const instanceURLRef = useRef();\n const cachedInstanceURL = store.local.get('instanceURL');\n const [uiState, setUIState] = useState('default');\n const [searchParams] = useSearchParams();\n const instance = searchParams.get('instance');\n const submit = searchParams.get('submit');\n const [instanceText, setInstanceText] = useState(\n instance || cachedInstanceURL?.toLowerCase() || '',\n );\n\n const [instancesList, setInstancesList] = useState([]);\n const searcher = useRef();\n useEffect(() => {\n (async () => {\n try {\n const res = await fetch(instancesListURL);\n const data = await res.json();\n setInstancesList(data);\n searcher.current = new Fuse(data);\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n })();\n }, []);\n\n // useEffect(() => {\n // if (cachedInstanceURL) {\n // instanceURLRef.current.value = cachedInstanceURL.toLowerCase();\n // }\n // }, []);\n\n const submitInstance = (instanceURL) => {\n if (!instanceURL) return;\n\n (async () => {\n // WEB_DOMAIN vs LOCAL_DOMAIN negotiation time\n // https://docs.joinmastodon.org/admin/config/#web_domain\n try {\n const res = await fetch(`https://${instanceURL}/.well-known/host-meta`); // returns XML\n const text = await res.text();\n // Parse XML\n const parser = new DOMParser();\n const xmlDoc = parser.parseFromString(text, 'text/xml');\n // Get Link[template]\n const link = xmlDoc.getElementsByTagName('Link')[0];\n const template = link.getAttribute('template');\n const url = URL.parse(template);\n const { host } = url; // host includes the port\n if (instanceURL !== host) {\n console.log(`💫 ${instanceURL} -> ${host}`);\n instanceURL = host;\n }\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n\n store.local.set('instanceURL', instanceURL);\n\n setUIState('loading');\n try {\n const { client_id, client_secret, vapid_key } =\n await registerApplication({\n instanceURL,\n });\n\n const authPKCE = await supportsPKCE({ instanceURL });\n console.log({ authPKCE });\n if (authPKCE) {\n if (client_id && client_secret) {\n store.sessionCookie.set('clientID', client_id);\n store.sessionCookie.set('clientSecret', client_secret);\n store.sessionCookie.set('vapidKey', vapid_key);\n\n const [url, verifier] = await getPKCEAuthorizationURL({\n instanceURL,\n client_id,\n });\n store.sessionCookie.set('codeVerifier', verifier);\n location.href = url;\n } else {\n alert(t`Failed to register application`);\n }\n } else {\n if (client_id && client_secret) {\n store.sessionCookie.set('clientID', client_id);\n store.sessionCookie.set('clientSecret', client_secret);\n store.sessionCookie.set('vapidKey', vapid_key);\n\n location.href = await getAuthorizationURL({\n instanceURL,\n client_id,\n });\n } else {\n alert(t`Failed to register application`);\n }\n }\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n };\n\n const cleanInstanceText = instanceText\n ? instanceText\n .replace(/^https?:\\/\\//, '') // Remove protocol from instance URL\n .replace(/\\/+$/, '') // Remove trailing slash\n .replace(/^@?[^@]+@/, '') // Remove @?acct@\n .trim()\n : null;\n const instanceTextLooksLikeDomain =\n /[^\\s\\r\\n\\t\\/\\\\]+\\.[^\\s\\r\\n\\t\\/\\\\]+/.test(cleanInstanceText) &&\n !/[\\s\\/\\\\@]/.test(cleanInstanceText);\n\n const instancesSuggestions = cleanInstanceText\n ? searcher.current\n ?.search(cleanInstanceText, {\n limit: 10,\n })\n ?.map((match) => match.item)\n : [];\n\n const selectedInstanceText = instanceTextLooksLikeDomain\n ? cleanInstanceText\n : instancesSuggestions?.length\n ? instancesSuggestions[0]\n : instanceText\n ? instancesList.find((instance) => instance.includes(instanceText))\n : null;\n\n const onSubmit = (e) => {\n e.preventDefault();\n // const { elements } = e.target;\n // let instanceURL = elements.instanceURL.value.toLowerCase();\n // // Remove protocol from instance URL\n // instanceURL = instanceURL.replace(/^https?:\\/\\//, '').replace(/\\/+$/, '');\n // // Remove @acct@ or acct@ from instance URL\n // instanceURL = instanceURL.replace(/^@?[^@]+@/, '');\n // if (!/\\./.test(instanceURL)) {\n // instanceURL = instancesList.find((instance) =>\n // instance.includes(instanceURL),\n // );\n // }\n // submitInstance(instanceURL);\n submitInstance(selectedInstanceText);\n };\n\n if (submit) {\n useEffect(() => {\n submitInstance(instance || selectedInstanceText);\n }, []);\n }\n\n return (\n <main id=\"login\" style={{ textAlign: 'center' }}>\n <form onSubmit={onSubmit}>\n <h1>\n <img src={logo} alt=\"\" width=\"80\" height=\"80\" />\n <br />\n <Trans>Log in</Trans>\n </h1>\n <label>\n <p>\n <Trans>Instance</Trans>\n </p>\n <input\n value={instanceText}\n required\n type=\"text\"\n class=\"large\"\n id=\"instanceURL\"\n ref={instanceURLRef}\n disabled={uiState === 'loading'}\n // list=\"instances-list\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n spellCheck={false}\n placeholder={t`instance domain`}\n onInput={(e) => {\n setInstanceText(e.target.value);\n }}\n dir=\"auto\"\n />\n {instancesSuggestions?.length > 0 ? (\n <ul id=\"instances-suggestions\">\n {instancesSuggestions.map((instance, i) => (\n <li>\n <button\n type=\"button\"\n class=\"plain5\"\n onClick={() => {\n submitInstance(instance);\n }}\n >\n {instance}\n </button>\n </li>\n ))}\n </ul>\n ) : (\n <div id=\"instances-eg\">\n <Trans>e.g. &ldquo;mastodon.social&rdquo;</Trans>\n </div>\n )}\n {/* <datalist id=\"instances-list\">\n {instancesList.map((instance) => (\n <option value={instance} />\n ))}\n </datalist> */}\n </label>\n {uiState === 'error' && (\n <p class=\"error\">\n <Trans>\n Failed to log in. Please try again or try another instance.\n </Trans>\n </p>\n )}\n <div>\n <button\n disabled={\n uiState === 'loading' || !instanceText || !selectedInstanceText\n }\n >\n {selectedInstanceText\n ? t`Continue with ${selectedInstanceText}`\n : t`Continue`}\n </button>{' '}\n </div>\n <Loader hidden={uiState !== 'loading'} />\n <hr />\n {!DEFAULT_INSTANCE && (\n <p>\n <a href=\"https://joinmastodon.org/servers\" target=\"_blank\">\n <Trans>Don't have an account? Create one!</Trans>\n </a>\n </p>\n )}\n <p>\n <Link to=\"/\">\n <Trans>Go home</Trans>\n </Link>\n </p>\n <LangSelector />\n </form>\n </main>\n );\n}\n\nexport default Login;\n","import './status.css';\n\nimport { Plural, t, Trans } from '@lingui/macro';\nimport { Menu, MenuDivider, MenuHeader, MenuItem } from '@szhsin/react-menu';\nimport debounce from 'just-debounce-it';\nimport pRetry from 'p-retry';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { InView } from 'react-intersection-observer';\nimport { matchPath, useSearchParams } from 'react-router-dom';\nimport { useSnapshot } from 'valtio';\n\nimport Avatar from '../components/avatar';\nimport Icon from '../components/icon';\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport MediaModal from '../components/media-modal';\nimport Menu2 from '../components/menu2';\nimport NameText from '../components/name-text';\nimport RelativeTime from '../components/relative-time';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport htmlContentLength from '../utils/html-content-length';\nimport shortenNumber from '../utils/shorten-number';\nimport states, {\n getStatus,\n saveStatus,\n statusKey,\n threadifyStatus,\n} from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport { getCurrentAccount } from '../utils/store-utils';\nimport useScroll from '../utils/useScroll';\nimport useTitle from '../utils/useTitle';\n\nimport getInstanceStatusURL from './../utils/get-instance-status-url';\n\nconst { PHANPY_DEFAULT_INSTANCE: DEFAULT_INSTANCE } = import.meta.env;\n\nconst LIMIT = 40;\nconst SUBCOMMENTS_OPEN_ALL_LIMIT = 10;\nconst MAX_WEIGHT = 5;\n\nlet cachedRepliesToggle = {};\nlet cachedStatusesMap = {};\nlet scrollPositions = {};\nfunction resetScrollPosition(id) {\n delete cachedStatusesMap[id];\n delete scrollPositions[id];\n}\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n};\n\n// Select all statuses except those inside collapsed details/summary\n// Hat-tip to @AmeliaBR@front-end.social\n// https://front-end.social/@AmeliaBR/109784776146144471\nconst STATUSES_SELECTOR =\n '.status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)';\n\nconst STATUS_URL_REGEX = /\\/s\\//i;\n\nfunction StatusPage(params) {\n const { id } = params;\n const { masto, instance } = api({ instance: params.instance });\n const snapStates = useSnapshot(states);\n const [searchParams, setSearchParams] = useSearchParams();\n const mediaParam = searchParams.get('media');\n const mediaOnlyParam = searchParams.get('media-only');\n const mediaIndex = parseInt(mediaParam || mediaOnlyParam, 10);\n let showMedia = mediaIndex > 0;\n const mediaStatusID = searchParams.get('mediaStatusID');\n const mediaStatus = getStatus(mediaStatusID, instance);\n if (mediaStatusID && !mediaStatus) {\n showMedia = false;\n }\n const showMediaOnly = showMedia && !!mediaOnlyParam;\n\n const sKey = statusKey(id, instance);\n const [heroStatus, setHeroStatus] = useState(states.statuses[sKey]);\n useEffect(() => {\n if (states.statuses[sKey]) {\n setHeroStatus(states.statuses[sKey]);\n }\n }, [sKey]);\n\n const closeLink = useMemo(() => {\n const { prevLocation } = states;\n const pathname =\n (prevLocation?.pathname || '') + (prevLocation?.search || '');\n const matchStatusPath =\n matchPath('/:instance/s/:id', pathname) || matchPath('/s/:id', pathname);\n if (!pathname || matchStatusPath) {\n return '/';\n }\n return pathname;\n }, []);\n\n useEffect(() => {\n if (!heroStatus && showMedia) {\n (async () => {\n try {\n const status = await masto.v1.statuses.$select(id).fetch();\n saveStatus(status, instance);\n setHeroStatus(status);\n } catch (err) {\n console.error(err);\n alert('Unable to load post.');\n location.hash = closeLink;\n }\n })();\n }\n }, [showMedia]);\n\n const mediaAttachments = mediaStatusID\n ? snapStates.statuses[statusKey(mediaStatusID, instance)]?.mediaAttachments\n : heroStatus?.mediaAttachments;\n\n const handleMediaClose = useCallback(() => {\n if (\n !window.matchMedia('(min-width: calc(40em + 350px))').matches &&\n snapStates.prevLocation\n ) {\n history.back();\n } else {\n if (showMediaOnly) {\n location.hash = closeLink;\n } else {\n searchParams.delete('media');\n searchParams.delete('mediaStatusID');\n setSearchParams(searchParams);\n }\n }\n }, [showMediaOnly, closeLink, snapStates.prevLocation]);\n\n useEffect(() => {\n let timer = setTimeout(() => {\n // carouselRef.current?.focus?.();\n const $carousel = document.querySelector('.carousel');\n if ($carousel) {\n $carousel.focus();\n }\n }, 100);\n return () => clearTimeout(timer);\n }, [showMediaOnly]);\n\n useEffect(() => {\n const $deckContainers = document.querySelectorAll('.deck-container');\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.setAttribute('inert', '');\n });\n return () => {\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.removeAttribute('inert');\n });\n };\n }, []);\n\n return (\n <div class=\"deck-backdrop\">\n {showMedia ? (\n mediaAttachments?.length ? (\n <MediaModal\n mediaAttachments={mediaAttachments}\n statusID={mediaStatusID || id}\n instance={instance}\n lang={heroStatus?.language}\n index={mediaIndex - 1}\n onClose={handleMediaClose}\n />\n ) : (\n <div class=\"media-modal-container loading\">\n <Loader abrupt />\n </div>\n )\n ) : (\n <Link to={closeLink} />\n )}\n {!showMediaOnly && (\n <StatusThread\n id={id}\n instance={params.instance}\n closeLink={closeLink}\n />\n )}\n </div>\n );\n}\n\nfunction StatusParent(props) {\n const { linkable, to, onClick, ...restProps } = props;\n return linkable ? (\n <Link class=\"status-link\" to={to} onClick={onClick} {...restProps} />\n ) : (\n <div class=\"status-focus\" tabIndex={0} {...restProps} />\n );\n}\n\nfunction StatusThread({ id, closeLink = '/', instance: propInstance }) {\n const [searchParams, setSearchParams] = useSearchParams();\n const mediaParam = searchParams.get('media');\n const mediaStatusID = searchParams.get('mediaStatusID');\n const showMedia = parseInt(mediaParam, 10) > 0;\n const firstLoad = useRef(\n !states.prevLocation &&\n (history.length === 1 ||\n ('navigation' in window && navigation?.entries?.()?.length === 1)),\n );\n const [viewMode, setViewMode] = useState(\n searchParams.get('view') || firstLoad.current ? 'full' : null,\n );\n const translate = !!parseInt(searchParams.get('translate'));\n const { masto, instance } = api({ instance: propInstance });\n const {\n masto: currentMasto,\n instance: currentInstance,\n authenticated,\n } = api();\n const sameInstance = instance === currentInstance;\n const snapStates = useSnapshot(states);\n const [statuses, setStatuses] = useState([]);\n const [uiState, setUIState] = useState('default');\n const heroStatusRef = useRef();\n const sKey = statusKey(id, instance);\n const totalDescendants = useRef(0);\n\n const scrollableRef = useRef();\n useEffect(() => {\n scrollableRef.current?.focus();\n }, []);\n useEffect(() => {\n const onScroll = debounce(() => {\n // console.log('onScroll');\n if (!scrollableRef.current) return;\n const { scrollTop } = scrollableRef.current;\n if (uiState !== 'loading') {\n scrollPositions[id] = scrollTop;\n }\n }, 50);\n scrollableRef.current?.addEventListener('scroll', onScroll, {\n passive: true,\n });\n onScroll();\n return () => {\n onScroll.cancel();\n scrollableRef.current?.removeEventListener('scroll', onScroll);\n };\n }, [id, uiState !== 'loading']);\n\n const scrollOffsets = useRef();\n const lastInitContextTS = useRef();\n const initContext = ({ reloadHero } = {}) => {\n console.debug('initContext', id);\n setUIState('loading');\n let heroTimer;\n\n const cachedStatuses = cachedStatusesMap[id];\n if (cachedStatuses) {\n // Case 1: It's cached, let's restore them to make it snappy\n const reallyCachedStatuses = cachedStatuses.filter(\n (s) => states.statuses[sKey],\n // Some are not cached in the global state, so we need to filter them out\n );\n setStatuses(reallyCachedStatuses);\n } else {\n // const heroIndex = statuses.findIndex((s) => s.id === id);\n // if (heroIndex !== -1) {\n // // Case 2: It's in current statuses. Slice off all descendant statuses after the hero status to be safe\n // const slicedStatuses = statuses.slice(0, heroIndex + 1);\n // setStatuses(slicedStatuses);\n // } else {\n // Case 3: Not cached and not in statuses, let's start from scratch\n setStatuses([{ id }]);\n // }\n }\n\n (async () => {\n const heroFetch = () =>\n pRetry(() => masto.v1.statuses.$select(id).fetch(), {\n retries: 4,\n });\n const contextFetch = pRetry(\n () => masto.v1.statuses.$select(id).context.fetch(),\n {\n retries: 8,\n },\n );\n\n const hasStatus = !!snapStates.statuses[sKey];\n let heroStatus = snapStates.statuses[sKey];\n if (hasStatus && !reloadHero) {\n console.debug('Hero status is cached');\n } else {\n try {\n heroStatus = await heroFetch();\n saveStatus(heroStatus, instance);\n // Give time for context to appear\n await new Promise((resolve) => {\n setTimeout(resolve, 100);\n });\n } catch (e) {\n console.error(e);\n setUIState('error');\n return;\n }\n }\n\n try {\n const context = await contextFetch;\n const { ancestors, descendants } = context;\n\n totalDescendants.current = descendants?.length || 0;\n\n const missingStatuses = new Set();\n ancestors.forEach((status) => {\n saveStatus(status, instance, {\n skipThreading: true,\n });\n if (\n status.inReplyToId &&\n !ancestors.find((s) => s.id === status.inReplyToId)\n ) {\n missingStatuses.add(status.inReplyToId);\n }\n });\n const ancestorsIsThread = ancestors.every(\n (s) => s.account.id === heroStatus.account.id,\n );\n const nestedDescendants = [];\n descendants.forEach((status) => {\n saveStatus(status, instance, {\n skipThreading: true,\n });\n\n if (\n status.inReplyToId &&\n !descendants.find((s) => s.id === status.inReplyToId) &&\n status.inReplyToId !== heroStatus.id\n ) {\n missingStatuses.add(status.inReplyToId);\n }\n\n if (status.inReplyToAccountId === status.account.id) {\n // If replying to self, it's part of the thread, level 1\n nestedDescendants.push(status);\n } else if (status.inReplyToId === heroStatus.id) {\n // If replying to the hero status, it's a reply, level 1\n nestedDescendants.push(status);\n } else if (\n !status.inReplyToAccountId &&\n nestedDescendants.find((s) => s.id === status.inReplyToId) &&\n status.account.id === heroStatus.account.id\n ) {\n // If replying to hero's own statuses, it's part of the thread, level 1\n nestedDescendants.push(status);\n } else {\n // If replying to someone else, it's a reply to a reply, level 2\n const parent = descendants.find((s) => s.id === status.inReplyToId);\n if (parent) {\n if (!parent.__replies) {\n parent.__replies = [];\n }\n parent.__replies.push(status);\n } else {\n // If no parent, something is wrong\n console.warn('No parent found for', status);\n }\n }\n });\n\n console.log({ ancestors, descendants, nestedDescendants });\n if (missingStatuses.size) {\n console.error('Missing statuses', [...missingStatuses]);\n }\n\n function expandReplies(_replies) {\n return _replies?.map((_r) => ({\n id: _r.id,\n account: _r.account,\n repliesCount: _r.repliesCount,\n content: _r.content,\n weight: calcStatusWeight(_r),\n replies: expandReplies(_r.__replies),\n }));\n }\n\n const allStatuses = [\n ...ancestors.map((s) => ({\n id: s.id,\n ancestor: true,\n isThread: ancestorsIsThread,\n accountID: s.account.id,\n account: s.account,\n repliesCount: s.repliesCount,\n weight: calcStatusWeight(s),\n })),\n {\n id,\n accountID: heroStatus.account.id,\n weight: calcStatusWeight(heroStatus),\n },\n ...nestedDescendants.map((s) => ({\n id: s.id,\n account: s.account,\n accountID: s.account.id,\n descendant: true,\n thread: s.account.id === heroStatus.account.id,\n weight: calcStatusWeight(s),\n replies: expandReplies(s.__replies),\n })),\n ];\n\n setUIState('default');\n scrollOffsets.current = {\n offsetTop: heroStatusRef.current?.offsetTop,\n scrollTop: scrollableRef.current?.scrollTop,\n };\n\n // Set limit to hero's index\n const heroLimit = allStatuses.findIndex((s) => s.id === id);\n if (heroLimit >= limit) {\n setLimit(heroLimit + 1);\n }\n\n console.log({ allStatuses });\n setStatuses(allStatuses);\n cachedStatusesMap[id] = allStatuses;\n\n // Let's threadify this one\n // Note that all non-hero statuses will trigger saveStatus which will threadify them too\n // By right, at this point, all descendant statuses should be cached\n threadifyStatus(heroStatus, instance);\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n\n lastInitContextTS.current = Date.now();\n\n return () => {\n clearTimeout(heroTimer);\n };\n };\n\n useEffect(initContext, [id, masto]);\n\n const [showRefresh, setShowRefresh] = useState(false);\n useEffect(() => {\n let interval = setInterval(() => {\n const now = Date.now();\n if (\n lastInitContextTS.current &&\n now - lastInitContextTS.current >= 60_000\n ) {\n setShowRefresh(true);\n }\n }, 60_000); // 1 minute\n return () => {\n clearInterval(interval);\n };\n }, []);\n\n useLayoutEffect(() => {\n if (!statuses.length) return;\n console.debug('STATUSES', statuses);\n const scrollPosition = scrollPositions[id];\n console.debug('scrollPosition', scrollPosition);\n if (!!scrollPosition) {\n console.debug('Case 1', {\n id,\n scrollPosition,\n });\n scrollableRef.current.scrollTop = scrollPosition;\n } else if (scrollOffsets.current) {\n const newScrollOffsets = {\n offsetTop: heroStatusRef.current?.offsetTop,\n scrollTop: scrollableRef.current?.scrollTop,\n };\n const newScrollTop =\n newScrollOffsets.offsetTop -\n scrollOffsets.current.offsetTop +\n newScrollOffsets.scrollTop;\n console.debug('Case 2', {\n scrollOffsets: scrollOffsets.current,\n newScrollOffsets,\n newScrollTop,\n statuses: [...statuses],\n });\n scrollableRef.current.scrollTop = newScrollTop;\n } else if (statuses.length === 1) {\n console.debug('Case 3', {\n id,\n });\n scrollableRef.current.scrollTop = 0;\n }\n\n // RESET\n scrollOffsets.current = null;\n }, [statuses]);\n\n useEffect(() => {\n if (snapStates.reloadStatusPage <= 0) return;\n // Delete the cache for the context\n (async () => {\n try {\n const { instanceURL } = getCurrentAccount();\n const contextURL = `https://${instanceURL}/api/v1/statuses/${id}/context`;\n console.log('Clear cache', contextURL);\n const apiCache = await caches.open('api');\n await apiCache.delete(contextURL, { ignoreVary: true });\n\n return initContext({\n reloadHero: true,\n });\n } catch (e) {\n console.error(e);\n }\n })();\n }, [snapStates.reloadStatusPage]);\n\n useEffect(() => {\n return () => {\n // RESET\n scrollPositions = {};\n states.reloadStatusPage = 0;\n cachedStatusesMap = {};\n cachedRepliesToggle = {};\n statusWeightCache.clear();\n };\n }, []);\n\n const heroStatus = snapStates.statuses[sKey] || snapStates.statuses[id];\n const heroDisplayName = useMemo(() => {\n // Remove shortcodes from display name\n if (!heroStatus) return '';\n const { account } = heroStatus;\n const div = document.createElement('div');\n div.innerHTML = account.displayName;\n return div.innerText.trim();\n }, [heroStatus]);\n const heroContentText = useMemo(() => {\n if (!heroStatus) return '';\n let text = statusPeek(heroStatus);\n if (text.length > 64) {\n // \"The title should ideally be less than 64 characters in length\"\n // https://www.w3.org/Provider/Style/TITLE.html\n text = text.slice(0, 64) + '…';\n }\n return text;\n }, [heroStatus]);\n useTitle(\n heroDisplayName && heroContentText\n ? `${heroDisplayName}: \"${heroContentText}\"`\n : t({\n id: 'post.title',\n message: 'Post',\n }),\n '/:instance?/s/:id',\n );\n\n const postInstance = useMemo(() => {\n if (!heroStatus) return;\n const { url } = heroStatus;\n if (!url) return;\n return URL.parse(url).hostname;\n }, [heroStatus]);\n const postSameInstance = useMemo(() => {\n if (!postInstance) return;\n return postInstance === instance;\n }, [postInstance, instance]);\n\n const [limit, setLimit] = useState(LIMIT);\n const showMore = useMemo(() => {\n // return number of statuses to show\n return statuses.length - limit;\n }, [statuses.length, limit]);\n\n const hasDescendants = statuses.some((s) => s.descendant);\n const ancestors = statuses.filter((s) => s.ancestor);\n\n const [heroInView, setHeroInView] = useState(true);\n const heroPointer = useMemo(() => {\n // get top offset of heroStatus\n if (!heroStatusRef.current || heroInView) return null;\n const { top } = heroStatusRef.current.getBoundingClientRect();\n return top > 0 ? 'down' : 'up';\n }, [heroInView]);\n\n useHotkeys(\n 'esc',\n () => {\n location.hash = closeLink;\n },\n {\n // If media is open, esc to close media first\n // Else close the status page\n enabled: !showMedia,\n ignoreEventWhen: (e) => {\n const hasModal = !!document.querySelector('#modal-container > *');\n return hasModal;\n },\n },\n );\n // For backspace, will always close both media and status page\n useHotkeys('backspace', () => {\n location.hash = closeLink;\n });\n\n useHotkeys('j', () => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n const activeStatusRect = activeStatus?.getBoundingClientRect();\n const allStatusLinks = Array.from(\n scrollableRef.current.querySelectorAll(STATUSES_SELECTOR),\n );\n console.log({ allStatusLinks });\n if (\n activeStatus &&\n activeStatusRect.top < scrollableRef.current.clientHeight &&\n activeStatusRect.bottom > 0\n ) {\n const activeStatusIndex = allStatusLinks.indexOf(activeStatus);\n let nextStatus = allStatusLinks[activeStatusIndex + 1];\n if (nextStatus) {\n nextStatus.focus();\n nextStatus.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostStatusLink = allStatusLinks.find((statusLink) => {\n const statusLinkRect = statusLink.getBoundingClientRect();\n return statusLinkRect.top >= 44 && statusLinkRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostStatusLink) {\n topmostStatusLink.focus();\n topmostStatusLink.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n useHotkeys('k', () => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n const activeStatusRect = activeStatus?.getBoundingClientRect();\n const allStatusLinks = Array.from(\n scrollableRef.current.querySelectorAll(STATUSES_SELECTOR),\n );\n if (\n activeStatus &&\n activeStatusRect.top < scrollableRef.current.clientHeight &&\n activeStatusRect.bottom > 0\n ) {\n const activeStatusIndex = allStatusLinks.indexOf(activeStatus);\n let prevStatus = allStatusLinks[activeStatusIndex - 1];\n if (prevStatus) {\n prevStatus.focus();\n prevStatus.scrollIntoView(scrollIntoViewOptions);\n }\n } else {\n // If active status is not in viewport, get the topmost status-link in viewport\n const topmostStatusLink = allStatusLinks.find((statusLink) => {\n const statusLinkRect = statusLink.getBoundingClientRect();\n return statusLinkRect.top >= 44 && statusLinkRect.left >= 0; // 44 is the magic number for header height, not real\n });\n if (topmostStatusLink) {\n topmostStatusLink.focus();\n topmostStatusLink.scrollIntoView(scrollIntoViewOptions);\n }\n }\n });\n\n // NOTE: I'm not sure if 'x' is the best shortcut for this, might change it later\n // IDEA: x is for expand\n useHotkeys('x', () => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n if (activeStatus) {\n const details = activeStatus.nextElementSibling;\n if (details && details.tagName.toLowerCase() === 'details') {\n details.open = !details.open;\n }\n }\n });\n\n const [reachTopPost, setReachTopPost] = useState(false);\n // const { nearReachStart } = useScroll({\n // scrollableRef,\n // distanceFromStartPx: 16,\n // });\n\n const initialPageState = useRef(showMedia ? 'media+status' : 'status');\n\n const handleMediaClick = useCallback(\n (e, i, media, status) => {\n e.preventDefault();\n e.stopPropagation();\n setSearchParams({\n media: i + 1,\n mediaStatusID: status.id,\n });\n },\n [id],\n );\n\n const handleStatusLinkClick = useCallback((e, status) => {\n resetScrollPosition(status.id);\n }, []);\n\n useEffect(() => {\n let timer;\n if (mediaStatusID && showMedia) {\n timer = setTimeout(() => {\n const status = scrollableRef.current?.querySelector(\n `.status-link[href*=\"/${mediaStatusID}\"]`,\n );\n if (status) {\n status.scrollIntoView(scrollIntoViewOptions);\n }\n }, 400); // After CSS transition\n }\n return () => {\n clearTimeout(timer);\n };\n }, [mediaStatusID, showMedia]);\n\n const renderStatus = useCallback(\n (status, i) => {\n const {\n id: statusID,\n ancestor,\n isThread,\n descendant,\n thread,\n replies,\n repliesCount,\n weight,\n } = status;\n const isHero = statusID === id;\n const isLinkable = isThread || ancestor;\n\n return (\n <li\n key={statusID}\n ref={isHero ? heroStatusRef : null}\n class={`${ancestor ? 'ancestor' : ''} ${\n descendant ? 'descendant' : ''\n } ${thread ? 'thread' : ''} ${isHero ? 'hero' : ''}`}\n >\n {isHero ? (\n <>\n <InView\n threshold={0.1}\n onChange={(inView) => {\n queueMicrotask(() => {\n requestAnimationFrame(() => {\n setHeroInView(inView);\n });\n });\n }}\n class=\"status-focus\"\n tabIndex={0}\n >\n <Status\n statusID={statusID}\n instance={instance}\n withinContext\n size=\"l\"\n enableTranslate\n forceTranslate={translate}\n />\n </InView>\n {uiState !== 'loading' && !authenticated ? (\n <div class=\"post-status-banner\">\n <p>\n <Trans>\n You're not logged in. Interactions (reply, boost, etc) are\n not possible.\n </Trans>\n </p>\n <Link\n to={\n DEFAULT_INSTANCE\n ? `/login?instance=${DEFAULT_INSTANCE}&submit=1`\n : '/login'\n }\n class=\"button\"\n >\n <Trans>Log in</Trans>\n </Link>\n </div>\n ) : (\n !sameInstance && (\n <div class=\"post-status-banner\">\n <p>\n <Trans>\n This post is from another instance (<b>{instance}</b>).\n Interactions (reply, boost, etc) are not possible.\n </Trans>\n </p>\n <button\n type=\"button\"\n disabled={uiState === 'loading'}\n onClick={() => {\n setUIState('loading');\n (async () => {\n try {\n const results = await currentMasto.v2.search.fetch({\n q: heroStatus.url,\n type: 'statuses',\n resolve: true,\n limit: 1,\n });\n if (results.statuses.length) {\n const status = results.statuses[0];\n location.hash = currentInstance\n ? `/${currentInstance}/s/${status.id}`\n : `/s/${status.id}`;\n } else {\n throw new Error('No results');\n }\n } catch (e) {\n setUIState('default');\n alert(t`Error: ${e}`);\n console.error(e);\n }\n })();\n }}\n >\n <Icon icon=\"transfer\" />{' '}\n <Trans>\n Switch to my instance to enable interactions\n </Trans>\n </button>\n </div>\n )\n )}\n </>\n ) : (\n <StatusParent\n linkable={isLinkable}\n to={instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`}\n onClick={() => {\n resetScrollPosition(statusID);\n }}\n >\n {/* <Link\n class=\"status-link\"\n to={instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`}\n onClick={() => {\n resetScrollPosition(statusID);\n }}\n > */}\n {i === 0 && ancestor ? (\n <InView\n threshold={0.5}\n onChange={(inView) => {\n queueMicrotask(() => {\n requestAnimationFrame(() => {\n setReachTopPost(inView);\n });\n });\n }}\n >\n <Status\n statusID={statusID}\n instance={instance}\n withinContext\n size={thread || ancestor ? 'm' : 's'}\n enableTranslate\n onMediaClick={handleMediaClick}\n onStatusLinkClick={handleStatusLinkClick}\n />\n </InView>\n ) : (\n <Status\n statusID={statusID}\n instance={instance}\n withinContext\n size={thread || ancestor ? 'm' : 's'}\n enableTranslate\n onMediaClick={handleMediaClick}\n onStatusLinkClick={handleStatusLinkClick}\n showActionsBar={!!descendant}\n />\n )}\n {ancestor && repliesCount > 1 && (\n <div class=\"replies-link\">\n <Icon icon=\"comment2\" alt={t`Replies`} />{' '}\n <span title={repliesCount}>\n {shortenNumber(repliesCount)}\n </span>\n </div>\n )}{' '}\n {/* {replies?.length > LIMIT && (\n <div class=\"replies-link\">\n <Icon icon=\"comment\" />{' '}\n <span title={replies.length}>\n {shortenNumber(replies.length)}\n </span>\n </div>\n )} */}\n </StatusParent>\n // </Link>\n )}\n {descendant && replies?.length > 0 && (\n <SubComments\n instance={instance}\n replies={replies}\n hasParentThread={thread}\n level={1}\n accWeight={weight}\n openAll={totalDescendants.current < SUBCOMMENTS_OPEN_ALL_LIMIT}\n parentLink={{\n to: instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`,\n onClick: () => resetScrollPosition(statusID),\n }}\n />\n )}\n {uiState === 'loading' &&\n isHero &&\n !!heroStatus?.repliesCount &&\n !hasDescendants && (\n <div class=\"status-loading\">\n <Loader abrupt={heroStatus.repliesCount >= 3} />\n </div>\n )}\n {uiState === 'error' &&\n isHero &&\n !!heroStatus?.repliesCount &&\n !hasDescendants && (\n <div class=\"status-error\">\n <Trans>Unable to load replies.</Trans>\n <br />\n <button\n type=\"button\"\n class=\"plain\"\n onClick={() => {\n states.reloadStatusPage++;\n }}\n >\n <Trans>Try again</Trans>\n </button>\n </div>\n )}\n </li>\n );\n },\n [\n id,\n instance,\n uiState,\n authenticated,\n sameInstance,\n translate,\n handleMediaClick,\n handleStatusLinkClick,\n hasDescendants,\n ],\n );\n\n const prevLocationIsStatusPage = useMemo(() => {\n // Navigation API\n if ('navigation' in window && navigation?.entries) {\n const prevEntry = navigation.entries()[navigation.currentEntry.index - 1];\n if (prevEntry?.url) {\n return STATUS_URL_REGEX.test(prevEntry.url);\n }\n }\n return STATUS_URL_REGEX.test(states.prevLocation?.pathname);\n }, [sKey]);\n\n const moreStatusesKeys = useMemo(() => {\n if (!showMore) return [];\n const ids = [];\n function getIDs(status) {\n ids.push(status.id);\n if (status.replies) {\n status.replies.forEach(getIDs);\n }\n }\n statuses.slice(limit).forEach(getIDs);\n return ids.map((id) => statusKey(id, instance));\n }, [showMore, statuses, limit, instance]);\n\n const statusesList = useMemo(\n () => statuses.slice(0, limit).map(renderStatus),\n [statuses, limit, renderStatus],\n );\n\n // If there's spoiler in hero status, auto-expand it\n useEffect(() => {\n let timer = setTimeout(() => {\n if (!heroStatusRef.current) return;\n const spoilerButton = heroStatusRef.current.querySelector(\n '.spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)',\n );\n if (spoilerButton) spoilerButton.click();\n }, 1000);\n return () => clearTimeout(timer);\n }, [id]);\n\n return (\n <div\n tabIndex=\"-1\"\n ref={scrollableRef}\n class={`status-deck deck contained ${\n statuses.length > 1 ? 'padded-bottom' : ''\n } ${\n initialPageState.current === 'status' && !firstLoad.current\n ? 'slide-in'\n : ''\n } ${viewMode ? `deck-view-${viewMode}` : ''}`}\n onAnimationEnd={(e) => {\n // Fix the bounce effect when switching viewMode\n // `slide-in` animation kicks in when switching viewMode\n if (initialPageState.current === 'status') {\n // e.target.classList.remove('slide-in');\n initialPageState.current = null;\n }\n }}\n >\n <header\n class={`${uiState === 'loading' ? 'loading' : ''}`}\n onDblClick={(e) => {\n // reload statuses\n states.reloadStatusPage++;\n }}\n >\n {/* <div>\n <Link class=\"button plain deck-close\" href={closeLink}>\n <Icon icon=\"chevron-left\" size=\"xl\" />\n </Link>\n </div> */}\n <div class=\"header-grid header-grid-2\">\n <h1>\n {prevLocationIsStatusPage && (\n <button\n type=\"button\"\n class=\"plain deck-back\"\n onClick={() => {\n history.back();\n }}\n >\n <Icon icon=\"chevron-left\" size=\"xl\" alt={t`Back`} />\n </button>\n )}\n {!heroInView && heroStatus && uiState !== 'loading' ? (\n <>\n <span class=\"hero-heading\">\n <NameText\n account={heroStatus.account}\n instance={instance}\n showAvatar\n short\n />{' '}\n <span class=\"insignificant\">\n &bull;{' '}\n <RelativeTime\n datetime={heroStatus.createdAt}\n format=\"micro\"\n />\n </span>\n </span>{' '}\n <button\n type=\"button\"\n class=\"ancestors-indicator light small\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n heroStatusRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n });\n }}\n title={t`Go to main post`}\n >\n <Icon\n icon={heroPointer === 'down' ? 'arrow-down' : 'arrow-up'}\n />\n </button>\n </>\n ) : (\n <>\n <Trans id=\"post.title\">Post</Trans>{' '}\n <button\n type=\"button\"\n class=\"ancestors-indicator light small\"\n onClick={(e) => {\n // Scroll to top\n e.preventDefault();\n e.stopPropagation();\n scrollableRef.current.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }}\n hidden={!ancestors.length || reachTopPost}\n title={t`${ancestors.length} posts above Go to top`}\n >\n <Icon icon=\"arrow-up\" />\n {ancestors\n .filter(\n (a, i, arr) =>\n arr.findIndex((b) => b.accountID === a.accountID) === i,\n )\n .slice(0, 3)\n .map((ancestor) => (\n <Avatar\n key={ancestor.account.id}\n url={ancestor.account.avatar}\n alt={ancestor.account.displayName}\n />\n ))}\n {/* <Icon icon=\"comment\" />{' '} */}\n {ancestors.length > 3 && (\n <>\n {' '}\n <span class=\"insignificant\">\n {shortenNumber(ancestors.length)}\n </span>\n </>\n )}\n </button>\n </>\n )}\n </h1>\n <div class=\"header-side\">\n <button\n type=\"button\"\n class=\"plain4 button-switch-view\"\n style={{\n display: viewMode === 'full' ? '' : 'none',\n }}\n onClick={() => {\n setViewMode(null);\n searchParams.delete('media');\n searchParams.delete('media-only');\n searchParams.delete('view');\n setSearchParams(searchParams);\n }}\n title={t`Switch to Side Peek view`}\n >\n <Icon icon=\"layout4\" size=\"l\" />\n </button>\n {showRefresh && (\n <button\n type=\"button\"\n class=\"plain button-refresh\"\n onClick={() => {\n states.reloadStatusPage++;\n setShowRefresh(false);\n }}\n >\n <Icon icon=\"refresh\" size=\"l\" alt={t`Refresh`} />\n </button>\n )}\n <Menu2\n align=\"end\"\n portal={{\n // Need this, else the menu click will cause scroll jump\n target: scrollableRef.current,\n }}\n menuButton={\n <button type=\"button\" class=\"button plain4\">\n <Icon icon=\"more\" alt={t`More`} size=\"xl\" />\n </button>\n }\n >\n <MenuItem\n disabled={uiState === 'loading'}\n onClick={() => {\n states.reloadStatusPage++;\n }}\n >\n <Icon icon=\"refresh\" />\n <span>\n <Trans>Refresh</Trans>\n </span>\n </MenuItem>\n <MenuItem\n className=\"menu-switch-view\"\n onClick={() => {\n setViewMode(viewMode === 'full' ? null : 'full');\n searchParams.delete('media');\n searchParams.delete('media-only');\n if (viewMode === 'full') {\n searchParams.delete('view');\n } else {\n searchParams.set('view', 'full');\n }\n setSearchParams(searchParams);\n }}\n >\n <Icon\n icon={\n {\n '': 'layout5',\n full: 'layout4',\n }[viewMode || '']\n }\n />\n <span>\n {viewMode === 'full'\n ? t`Switch to Side Peek view`\n : t`Switch to Full view`}\n </span>\n </MenuItem>\n <MenuItem\n onClick={() => {\n // Click all buttons with class .spoiler but not .spoiling\n const buttons = Array.from(\n scrollableRef.current.querySelectorAll(\n '.spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)',\n ),\n );\n buttons.forEach((button) => {\n button.click();\n });\n }}\n >\n <Icon icon=\"eye-open\" />{' '}\n <span>\n <Trans>Show all sensitive content</Trans>\n </span>\n </MenuItem>\n <MenuDivider />\n <MenuHeader className=\"plain\">\n <Trans>Experimental</Trans>\n </MenuHeader>\n <MenuItem\n disabled={!postInstance || postSameInstance}\n onClick={() => {\n const statusURL = getInstanceStatusURL(heroStatus.url);\n if (statusURL) {\n location.hash = statusURL;\n } else {\n alert(t`Unable to switch`);\n }\n }}\n >\n <Icon icon=\"transfer\" />\n <small class=\"menu-double-lines\">\n {postInstance\n ? t`Switch to post's instance (${punycode.toUnicode(\n postInstance,\n )})`\n : t`Switch to post's instance`}\n </small>\n </MenuItem>\n </Menu2>\n <Link class=\"button plain deck-close\" to={closeLink}>\n <Icon icon=\"x\" size=\"xl\" alt={t`Close`} />\n </Link>\n </div>\n </div>\n </header>\n {!!statuses.length && heroStatus ? (\n <ul\n class={`timeline flat contextual grow ${\n uiState === 'loading' ? 'loading' : ''\n }`}\n >\n {statusesList}\n {showMore > 0 && (\n <li>\n <button\n type=\"button\"\n class=\"plain block show-more\"\n disabled={uiState === 'loading'}\n onClick={() => setLimit((l) => l + LIMIT)}\n style={{ marginBlockEnd: '6em' }}\n data-state-post-ids={moreStatusesKeys.join(' ')}\n >\n <div class=\"ib avatars-bunch\">\n {/* show avatars for first 5 statuses */}\n {statuses.slice(limit, limit + 5).map((status) => (\n <Avatar\n key={status.id}\n url={status.account.avatarStatic}\n // title={`${status.avatar.displayName} (@${status.avatar.acct})`}\n />\n ))}\n </div>{' '}\n <div class=\"ib\">\n <Trans>Show more…</Trans>{' '}\n <span class=\"tag\">\n {showMore > LIMIT ? `${LIMIT}+` : showMore}\n </span>\n </div>\n </button>\n </li>\n )}\n </ul>\n ) : (\n <>\n {uiState === 'loading' && (\n <ul class=\"timeline flat contextual grow loading\">\n <li>\n <Status skeleton size=\"l\" />\n </li>\n </ul>\n )}\n {uiState === 'error' && (\n <p class=\"ui-state\">\n <Trans>Unable to load post</Trans>\n <br />\n <br />\n <button\n type=\"button\"\n onClick={() => {\n states.reloadStatusPage++;\n }}\n >\n <Trans>Try again</Trans>\n </button>\n </p>\n )}\n </>\n )}\n </div>\n );\n}\n\nfunction SubComments({\n replies,\n instance,\n hasParentThread,\n level,\n accWeight,\n openAll,\n parentLink,\n}) {\n const [searchParams, setSearchParams] = useSearchParams();\n\n // Total comments count, including sub-replies\n const diveDeep = (replies) => {\n return replies.reduce((acc, reply) => {\n const { repliesCount, replies } = reply;\n const count = replies?.length || repliesCount;\n return acc + count + diveDeep(replies || []);\n }, 0);\n };\n const totalComments = replies.length + diveDeep(replies);\n const sameCount = replies.length === totalComments;\n\n // Get the first 3 accounts, unique by id\n const accounts = replies\n .map((r) => r.account)\n .filter((a, i, arr) => arr.findIndex((b) => b.id === a.id) === i)\n .slice(0, 3);\n\n const totalWeight = useMemo(() => {\n return replies?.reduce((acc, reply) => {\n return acc + reply?.weight;\n }, accWeight);\n }, [accWeight, replies?.length]);\n\n let open = false;\n if (openAll) {\n open = true;\n } else if (totalWeight <= MAX_WEIGHT) {\n open = true;\n } else if (!hasParentThread && totalComments === 1) {\n const shortReply = calcStatusWeight(replies[0]) < 2;\n if (shortReply) open = true;\n }\n const openBefore = cachedRepliesToggle[replies[0].id];\n\n const handleMediaClick = useCallback((e, i, media, status) => {\n e.preventDefault();\n e.stopPropagation();\n setSearchParams({\n media: i + 1,\n mediaStatusID: status.id,\n });\n }, []);\n\n const detailsRef = useRef();\n useLayoutEffect(() => {\n function handleScroll(e) {\n // NOTE: this scrollLeft works for RTL too\n // Browsers do the magic for us\n e.target.dataset.scrollLeft = e.target.scrollLeft;\n }\n detailsRef.current?.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n return () => {\n detailsRef.current?.removeEventListener('scroll', handleScroll);\n };\n }, []);\n\n return (\n <details\n ref={detailsRef}\n class=\"replies\"\n open={openBefore || open}\n onToggle={(e) => {\n const { open } = e.target;\n // use first reply as ID\n cachedRepliesToggle[replies[0].id] = open;\n }}\n style={{\n '--comments-level': level,\n }}\n data-comments-level={level}\n data-comments-level-overflow={level > 4}\n >\n <summary class=\"replies-summary\" hidden={open}>\n <span class=\"avatars\">\n {accounts.map((a) => (\n <Avatar\n key={a.id}\n url={a.avatarStatic}\n title={`${a.displayName} @${a.username}`}\n squircle={a?.bot}\n />\n ))}\n </span>\n <span class=\"replies-counts\">\n <b>\n <Plural\n value={replies.length}\n one=\"# reply\"\n other={\n <Trans>\n <span title={replies.length}>\n {shortenNumber(replies.length)}\n </span>{' '}\n replies\n </Trans>\n }\n />\n </b>\n {!sameCount && totalComments > 1 && (\n <>\n {' '}\n &middot;{' '}\n <span>\n <Plural\n value={totalComments}\n one=\"# comment\"\n other={\n <Trans>\n <span title={totalComments}>\n {shortenNumber(totalComments)}\n </span>{' '}\n comments\n </Trans>\n }\n />\n </span>\n </>\n )}\n </span>\n <Icon icon=\"chevron-down\" class=\"replies-summary-chevron\" />\n {!!parentLink && (\n <Link\n class=\"replies-parent-link\"\n to={parentLink.to}\n onClick={parentLink.onClick}\n title={t`View post with its replies`}\n >\n &raquo;\n </Link>\n )}\n </summary>\n <ul>\n {replies.map((r) => (\n <li key={r.id}>\n {/* <Link\n class=\"status-link\"\n to={instance ? `/${instance}/s/${r.id}` : `/s/${r.id}`}\n onClick={() => {\n resetScrollPosition(r.id);\n }}\n > */}\n <div class=\"status-focus\" tabIndex={0}>\n <Status\n statusID={r.id}\n instance={instance}\n withinContext\n size=\"s\"\n enableTranslate\n onMediaClick={handleMediaClick}\n showActionsBar\n />\n {!r.replies?.length && r.repliesCount > 0 && (\n <div class=\"replies-link\">\n <Icon icon=\"comment2\" alt={t`Replies`} />{' '}\n <span title={r.repliesCount}>\n {shortenNumber(r.repliesCount)}\n </span>\n </div>\n )}\n </div>\n {/* </Link> */}\n {r.replies?.length && (\n <SubComments\n instance={instance}\n replies={r.replies}\n level={level + 1}\n accWeight={!open ? r.weight : totalWeight}\n openAll={openAll}\n parentLink={{\n to: instance ? `/${instance}/s/${r.id}` : `/s/${r.id}`,\n onClick: () => {\n resetScrollPosition(r.id);\n },\n }}\n />\n )}\n </li>\n ))}\n </ul>\n </details>\n );\n}\n\nconst MEDIA_VIRTUAL_LENGTH = 140;\nconst POLL_VIRTUAL_LENGTH = 35;\nconst CARD_VIRTUAL_LENGTH = 70;\nconst WEIGHT_SEGMENT = 140;\nconst statusWeightCache = new Map();\nfunction calcStatusWeight(status) {\n const cachedWeight = statusWeightCache.get(status.id);\n if (cachedWeight) return cachedWeight;\n const { spoilerText, content, mediaAttachments, poll, card } = status;\n const length = htmlContentLength(spoilerText + content);\n const mediaLength = mediaAttachments?.length ? MEDIA_VIRTUAL_LENGTH : 0;\n const pollLength = (poll?.options?.length || 0) * POLL_VIRTUAL_LENGTH;\n const cardLength =\n card && (mediaAttachments?.length || poll?.options?.length)\n ? 0\n : CARD_VIRTUAL_LENGTH;\n const totalLength = length + mediaLength + pollLength + cardLength;\n const weight = totalLength / WEIGHT_SEGMENT;\n statusWeightCache.set(status.id, weight);\n return weight;\n}\n\nexport default memo(StatusPage);\n","import { useParams } from 'react-router-dom';\n\nimport Status from './status';\n\nexport default function StatusRoute() {\n const params = useParams();\n const { id, instance } = params;\n return <Status id={id} instance={instance} />;\n}\n","export default \"__VITE_ASSET__W5CngKHO__\"","export default \"__VITE_ASSET__vmqRZ5q5__\"","export default \"__VITE_ASSET__DFAo1Udm__\"","export default \"__VITE_ASSET__D2_o1n6___\"","export default \"__VITE_ASSET__ySLnBMku__\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%20102%2028'%3e%3cpath%20fill='none'%20d='M0%200h101.5v27.5H0z'/%3e%3cg%20fill-rule='nonzero'%3e%3cpath%20fill='url(%23a)'%20d='M2.32%2021.85c1.4%200%202.21-.85%202.21-2.3v-4.64H8.5c4.45%200%207.54-2.9%207.54-7.24%200-4.35-2.98-7.24-7.32-7.24h-6.4C.93.43.11%201.28.11%202.73v16.82c0%201.45.82%202.3%202.21%202.3Zm2.21-10.4V3.94h3c2.54%200%204%201.34%204%203.75s-1.47%203.76-4%203.76h-3Z'/%3e%3cpath%20fill='url(%23b)'%20d='M20.52%2021.88c1.25%200%202.13-.76%202.13-2.23v-7.04c0-2.07%201.2-3.49%203.21-3.49%201.95%200%202.95%201.23%202.95%203.25v7.28c0%201.47.89%202.23%202.13%202.23%201.26%200%202.14-.76%202.14-2.23v-8.18c0-3.64-1.99-5.9-5.48-5.9-2.38%200-4.1%201.12-4.93%203.1h-.09V2.3c0-1.38-.78-2.2-2.1-2.2-1.31%200-2.1.82-2.1%202.2v17.34c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23c)'%20d='M40.45%2021.82c1.96%200%203.93-.98%204.8-2.65h.1v.8c.08%201.27.89%201.91%202.05%201.91%201.21%200%202.08-.73%202.08-2.15v-8.95c0-3.17-2.63-5.25-6.65-5.25-3.26%200-5.78%201.16-6.5%203.04-.15.32-.23.63-.23.96%200%20.97.75%201.64%201.79%201.64.69%200%201.23-.26%201.7-.79.95-1.23%201.74-1.65%203.04-1.65%201.62%200%202.64.85%202.64%202.31v1.04l-3.95.24c-3.93.23-6.13%201.88-6.13%204.74%200%202.83%202.27%204.76%205.26%204.76Zm1.4-3.09c-1.43%200-2.4-.73-2.4-1.9%200-1.12.91-1.83%202.51-1.95l3.31-.2v1.14c0%201.7-1.54%202.91-3.41%202.91Z'/%3e%3cpath%20fill='url(%23d)'%20d='M54.37%2021.88c1.26%200%202.14-.76%202.14-2.23v-7.09c0-2.03%201.21-3.44%203.13-3.44s2.89%201.17%202.89%203.22v7.31c0%201.47.88%202.23%202.14%202.23%201.24%200%202.13-.76%202.13-2.23v-8.2c0-3.68-1.96-5.87-5.45-5.87-2.41%200-4%201.07-4.83%203.01h-.09v-.87c0-1.35-.85-2.17-2.14-2.17-1.28%200-2.06.82-2.06%202.15v11.95c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23e)'%20d='M71.65%2027.17c1.26%200%202.14-.76%202.14-2.23v-6h.09a5.15%205.15%200%200%200%204.88%202.88c3.92%200%206.35-3.05%206.35-8.1%200-5.07-2.44-8.1-6.43-8.1a5.12%205.12%200%200%200-4.86%202.99h-.09v-.85c0-1.45-.88-2.21-2.1-2.21-1.24%200-2.11.76-2.11%202.2v17.2c0%201.46.89%202.22%202.13%202.22Zm5.6-8.8c-2.1%200-3.47-1.8-3.47-4.65%200-2.81%201.37-4.67%203.47-4.67%202.14%200%203.49%201.83%203.49%204.67%200%202.86-1.35%204.66-3.5%204.66Z'/%3e%3cpath%20fill='url(%23f)'%20d='M89.61%2027.39c3.44%200%205.26-1.5%206.73-5.55l4.81-13.1a4%204%200%200%200%20.24-1.26c0-1.13-.85-1.93-2.08-1.93-1.1%200-1.71.51-2.07%201.7l-3.4%2010.9h-.08L90.35%207.28c-.36-1.25-.94-1.73-2.07-1.73-1.26%200-2.21.83-2.21%201.99%200%20.35.09.82.25%201.26l5%2013.21-.21.56c-.52%201.1-1.32%201.42-2.07%201.42l-.75-.01c-.96%200-1.56.54-1.56%201.4%200%201.29%201%202%202.88%202Z'/%3e%3c/g%3e%3cdefs%3e%3cradialGradient%20id='a'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='b'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='c'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='d'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='e'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='f'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3c/defs%3e%3c/svg%3e\"","import './welcome.css';\n\nimport { t, Trans } from '@lingui/macro';\n\nimport boostsCarouselUrl from '../assets/features/boosts-carousel.jpg';\nimport groupedNotificationsUrl from '../assets/features/grouped-notifications.jpg';\nimport multiColumnUrl from '../assets/features/multi-column.jpg';\nimport multiHashtagTimelineUrl from '../assets/features/multi-hashtag-timeline.jpg';\nimport nestedCommentsThreadUrl from '../assets/features/nested-comments-thread.jpg';\nimport logoText from '../assets/logo-text.svg';\nimport logo from '../assets/logo.svg';\n\nimport LangSelector from '../components/lang-selector';\nimport Link from '../components/link';\nimport states from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst {\n PHANPY_DEFAULT_INSTANCE: DEFAULT_INSTANCE,\n PHANPY_WEBSITE: WEBSITE,\n PHANPY_PRIVACY_POLICY_URL: PRIVACY_POLICY_URL,\n PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL: DEFAULT_INSTANCE_REGISTRATION_URL,\n} = import.meta.env;\nconst appSite = WEBSITE\n ? WEBSITE.replace(/https?:\\/\\//g, '').replace(/\\/$/, '')\n : null;\nconst appVersion = __BUILD_TIME__\n ? `${__BUILD_TIME__.slice(0, 10).replace(/-/g, '.')}${\n __COMMIT_HASH__ ? `.${__COMMIT_HASH__}` : ''\n }`\n : null;\n\nfunction Welcome() {\n useTitle(null, ['/', '/welcome']);\n return (\n <main id=\"welcome\">\n <div class=\"hero-container\">\n <div class=\"hero-content\">\n <h1>\n <img\n src={logo}\n alt=\"\"\n width=\"160\"\n height=\"160\"\n style={{\n aspectRatio: '1/1',\n marginBlockEnd: -16,\n }}\n />\n <img src={logoText} alt=\"Phanpy\" width=\"200\" />\n </h1>\n <p class=\"desc\">\n <Trans>A minimalistic opinionated Mastodon web client.</Trans>\n </p>\n <p>\n <Link\n to={\n DEFAULT_INSTANCE\n ? `/login?instance=${DEFAULT_INSTANCE}&submit=1`\n : '/login'\n }\n class=\"button\"\n >\n {DEFAULT_INSTANCE ? t`Log in` : t`Log in with Mastodon`}\n </Link>\n </p>\n {DEFAULT_INSTANCE && DEFAULT_INSTANCE_REGISTRATION_URL && (\n <p>\n <a href={DEFAULT_INSTANCE_REGISTRATION_URL} class=\"button plain5\">\n <Trans>Sign up</Trans>\n </a>\n </p>\n )}\n {!DEFAULT_INSTANCE && (\n <p class=\"insignificant\">\n <small>\n <Trans>\n Connect your existing Mastodon/Fediverse account.\n <br />\n Your credentials are not stored on this server.\n </Trans>\n </small>\n </p>\n )}\n </div>\n {(appSite || appVersion) && (\n <p class=\"app-site-version\">\n <small>\n {appSite} {appVersion}\n </small>\n </p>\n )}\n <p>\n <Trans>\n <a href=\"https://github.com/cheeaun/phanpy\" target=\"_blank\">\n Built\n </a>{' '}\n by{' '}\n <a\n href=\"https://mastodon.social/@cheeaun\"\n target=\"_blank\"\n onClick={(e) => {\n e.preventDefault();\n states.showAccount = 'cheeaun@mastodon.social';\n }}\n >\n @cheeaun\n </a>\n .{' '}\n <a href={PRIVACY_POLICY_URL} target=\"_blank\">\n Privacy Policy\n </a>\n .\n </Trans>\n </p>\n <div>\n <LangSelector />\n </div>\n </div>\n <div id=\"why-container\">\n <div class=\"sections\">\n <section>\n <img\n src={boostsCarouselUrl}\n alt={t`Screenshot of Boosts Carousel`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Boosts Carousel</Trans>\n </h4>\n <p>\n <Trans>\n Visually separate original posts and re-shared posts (boosted\n posts).\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={nestedCommentsThreadUrl}\n alt={t`Screenshot of nested comments thread`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Nested comments thread</Trans>\n </h4>\n <p>\n <Trans>\n Effortlessly follow conversations. Semi-collapsible replies.\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={groupedNotificationsUrl}\n alt={t`Screenshot of grouped notifications`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Grouped notifications</Trans>\n </h4>\n <p>\n <Trans>\n Similar notifications are grouped and collapsed to reduce\n clutter.\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={multiColumnUrl}\n alt={t`Screenshot of multi-column UI`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Single or multi-column</Trans>\n </h4>\n <p>\n <Trans>\n By default, single column for zen-mode seekers. Configurable\n multi-column for power users.\n </Trans>\n </p>\n </section>\n <section>\n <img\n src={multiHashtagTimelineUrl}\n alt={t`Screenshot of multi-hashtag timeline with a form to add more hashtags`}\n loading=\"lazy\"\n />\n <h4>\n <Trans>Multi-hashtag timeline</Trans>\n </h4>\n <p>\n <Trans>Up to 5 hashtags combined into a single timeline.</Trans>\n </p>\n </section>\n </div>\n </div>\n </main>\n );\n}\n\nexport default Welcome;\n","// Replace alert() with toastify-js\nimport Toastify from 'toastify-js';\n\nconst nativeAlert = window.alert;\nif (!window.__nativeAlert) window.__nativeAlert = nativeAlert;\n\nwindow.alert = function (message) {\n console.debug(\n 'ALERT: This is a custom alert() function. Native alert() is still available as window.__nativeAlert()',\n );\n // If Error object, show the message\n if (message instanceof Error && message?.message) {\n message = message.message;\n }\n // If not string, stringify it\n if (typeof message !== 'string') {\n message = JSON.stringify(message);\n }\n\n const toast = Toastify({\n text: message,\n className: 'alert',\n gravity: 'top',\n position: 'center',\n duration: 10_000,\n offset: {\n y: 48,\n },\n onClick: () => {\n toast.hideToast();\n },\n });\n toast.showToast();\n};\n","import './app.css';\n\nimport { useLingui } from '@lingui/react';\nimport debounce from 'just-debounce-it';\nimport { memo } from 'preact/compat';\nimport {\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { matchPath, Route, Routes, useLocation } from 'react-router-dom';\n\nimport 'swiped-events';\n\nimport { subscribe } from 'valtio';\n\nimport BackgroundService from './components/background-service';\nimport ComposeButton from './components/compose-button';\nimport { ICONS } from './components/ICONS';\nimport KeyboardShortcutsHelp from './components/keyboard-shortcuts-help';\nimport Loader from './components/loader';\nimport Modals from './components/modals';\nimport NotificationService from './components/notification-service';\nimport SearchCommand from './components/search-command';\nimport Shortcuts from './components/shortcuts';\nimport NotFound from './pages/404';\nimport AccountStatuses from './pages/account-statuses';\nimport Bookmarks from './pages/bookmarks';\nimport Catchup from './pages/catchup';\nimport Favourites from './pages/favourites';\nimport Filters from './pages/filters';\nimport FollowedHashtags from './pages/followed-hashtags';\nimport Following from './pages/following';\nimport Hashtag from './pages/hashtag';\nimport Home from './pages/home';\nimport HttpRoute from './pages/http-route';\nimport List from './pages/list';\nimport Lists from './pages/lists';\nimport Login from './pages/login';\nimport Mentions from './pages/mentions';\nimport Notifications from './pages/notifications';\nimport Public from './pages/public';\nimport Search from './pages/search';\nimport StatusRoute from './pages/status-route';\nimport Trending from './pages/trending';\nimport Welcome from './pages/welcome';\nimport {\n api,\n hasInstance,\n hasPreferences,\n initAccount,\n initClient,\n initInstance,\n initPreferences,\n} from './utils/api';\nimport { getAccessToken } from './utils/auth';\nimport focusDeck from './utils/focus-deck';\nimport states, { initStates, statusKey } from './utils/states';\nimport store from './utils/store';\nimport {\n getAccount,\n getCurrentAccount,\n setCurrentAccountID,\n} from './utils/store-utils';\n\nimport './utils/toast-alert';\n\nwindow.__STATES__ = states;\nwindow.__STATES_STATS__ = () => {\n const keys = [\n 'statuses',\n 'accounts',\n 'spoilers',\n 'unfurledLinks',\n 'statusQuotes',\n ];\n const counts = {};\n keys.forEach((key) => {\n counts[key] = Object.keys(states[key]).length;\n });\n console.warn('STATE stats', counts);\n\n const { statuses } = states;\n const unmountedPosts = [];\n for (const key in statuses) {\n const $post = document.querySelector(\n `[data-state-post-id~=\"${key}\"], [data-state-post-ids~=\"${key}\"]`,\n );\n if (!$post) {\n unmountedPosts.push(key);\n }\n }\n console.warn('Unmounted posts', unmountedPosts.length, unmountedPosts);\n};\n\n// Experimental \"garbage collection\" for states\n// Every 15 minutes\n// Only posts for now\nsetInterval(() => {\n if (!window.__IDLE__) return;\n const { statuses, unfurledLinks, notifications } = states;\n let keysCount = 0;\n const { instance } = api();\n for (const key in statuses) {\n if (!window.__IDLE__) break;\n try {\n const $post = document.querySelector(\n `[data-state-post-id~=\"${key}\"], [data-state-post-ids~=\"${key}\"]`,\n );\n const postInNotifications = notifications.some(\n (n) => key === statusKey(n.status?.id, instance),\n );\n if (!$post && !postInNotifications) {\n delete states.statuses[key];\n delete states.statusQuotes[key];\n for (const link in unfurledLinks) {\n const unfurled = unfurledLinks[link];\n const sKey = statusKey(unfurled.id, unfurled.instance);\n if (sKey === key) {\n delete states.unfurledLinks[link];\n break;\n }\n }\n keysCount++;\n }\n } catch (e) {}\n }\n if (keysCount) {\n console.info(`GC: Removed ${keysCount} keys`);\n }\n}, 15 * 60 * 1000);\n\n// Preload icons\n// There's probably a better way to do this\n// Related: https://github.com/vitejs/vite/issues/10600\nsetTimeout(() => {\n for (const icon in ICONS) {\n setTimeout(() => {\n if (Array.isArray(ICONS[icon])) {\n ICONS[icon][0]?.();\n } else if (typeof ICONS[icon] === 'object') {\n ICONS[icon].module?.();\n } else {\n ICONS[icon]?.();\n }\n }, 1);\n }\n}, 5000);\n\n(() => {\n window.__IDLE__ = true;\n const nonIdleEvents = [\n 'mousemove',\n 'mousedown',\n 'resize',\n 'keydown',\n 'touchstart',\n 'pointerdown',\n 'pointermove',\n 'wheel',\n ];\n const setIdle = () => {\n window.__IDLE__ = true;\n };\n const IDLE_TIME = 3_000; // 3 seconds\n const debouncedSetIdle = debounce(setIdle, IDLE_TIME);\n const onNonIdle = () => {\n window.__IDLE__ = false;\n debouncedSetIdle();\n };\n nonIdleEvents.forEach((event) => {\n window.addEventListener(event, onNonIdle, {\n passive: true,\n capture: true,\n });\n });\n window.addEventListener('blur', setIdle, {\n passive: true,\n });\n // When cursor leaves the window, set idle\n document.documentElement.addEventListener(\n 'mouseleave',\n (e) => {\n if (!e.relatedTarget && !e.toElement) {\n setIdle();\n }\n },\n {\n passive: true,\n },\n );\n // document.addEventListener(\n // 'visibilitychange',\n // () => {\n // if (document.visibilityState === 'visible') {\n // onNonIdle();\n // }\n // },\n // {\n // passive: true,\n // },\n // );\n})();\n\n// Possible fix for iOS PWA theme-color bug\n// It changes when loading web pages in \"webview\"\nconst isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);\nif (isIOS) {\n document.addEventListener('visibilitychange', () => {\n if (document.visibilityState === 'visible') {\n const theme = store.local.get('theme');\n let $meta;\n if (theme) {\n // Get current meta\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][data-theme-setting=\"manual\"]`,\n );\n if ($meta) {\n const color = $meta.content;\n const tempColor =\n theme === 'light'\n ? $meta.dataset.themeLightColorTemp\n : $meta.dataset.themeDarkColorTemp;\n $meta.content = tempColor || '';\n setTimeout(() => {\n $meta.content = color;\n }, 10);\n }\n } else {\n // Get current color scheme\n const colorScheme = window.matchMedia('(prefers-color-scheme: dark)')\n .matches\n ? 'dark'\n : 'light';\n // Get current theme-color\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][media*=\"${colorScheme}\"]`,\n );\n if ($meta) {\n const color = $meta.dataset.content;\n const tempColor = $meta.dataset.contentTemp;\n $meta.content = tempColor || '';\n setTimeout(() => {\n $meta.content = color;\n }, 10);\n }\n }\n }\n });\n}\n\n{\n const theme = store.local.get('theme');\n // If there's a theme, it's NOT auto\n if (theme) {\n // dark | light\n document.documentElement.classList.add(`is-${theme}`);\n document\n .querySelector('meta[name=\"color-scheme\"]')\n .setAttribute('content', theme || 'dark light');\n\n // Enable manual theme <meta>\n const $manualMeta = document.querySelector(\n 'meta[data-theme-setting=\"manual\"]',\n );\n if ($manualMeta) {\n $manualMeta.name = 'theme-color';\n $manualMeta.content =\n theme === 'light'\n ? $manualMeta.dataset.themeLightColor\n : $manualMeta.dataset.themeDarkColor;\n }\n // Disable auto theme <meta>s\n const $autoMetas = document.querySelectorAll(\n 'meta[data-theme-setting=\"auto\"]',\n );\n $autoMetas.forEach((m) => {\n m.name = '';\n });\n }\n const textSize = store.local.get('textSize');\n if (textSize) {\n document.documentElement.style.setProperty('--text-size', `${textSize}px`);\n }\n}\n\nsubscribe(states, (changes) => {\n for (const [action, path, value, prevValue] of changes) {\n // Change #app dataset based on settings.shortcutsViewMode\n if (path.join('.') === 'settings.shortcutsViewMode') {\n const $app = document.getElementById('app');\n if ($app) {\n $app.dataset.shortcutsViewMode = states.shortcuts?.length ? value : '';\n }\n }\n\n // Add/Remove cloak class to body\n if (path.join('.') === 'settings.cloakMode') {\n const $body = document.body;\n $body.classList.toggle('cloak', value);\n }\n }\n});\n\nconst BENCHES = new Map();\nwindow.__BENCH_RESULTS = new Map();\nwindow.__BENCHMARK = {\n start(name) {\n if (!import.meta.env.DEV && !import.meta.env.PHANPY_DEV) return;\n // If already started, ignore\n if (BENCHES.has(name)) return;\n const start = performance.now();\n BENCHES.set(name, start);\n },\n end(name) {\n if (!import.meta.env.DEV && !import.meta.env.PHANPY_DEV) return;\n const start = BENCHES.get(name);\n if (start) {\n const end = performance.now();\n const duration = end - start;\n __BENCH_RESULTS.set(name, duration);\n BENCHES.delete(name);\n }\n },\n};\n\nfunction App() {\n const [isLoggedIn, setIsLoggedIn] = useState(false);\n const [uiState, setUIState] = useState('loading');\n __BENCHMARK.start('app-init');\n __BENCHMARK.start('time-to-following');\n __BENCHMARK.start('time-to-home');\n __BENCHMARK.start('time-to-isLoggedIn');\n useLingui();\n\n useEffect(() => {\n const instanceURL = store.local.get('instanceURL');\n const code = decodeURIComponent(\n (window.location.search.match(/code=([^&]+)/) || [, ''])[1],\n );\n\n if (code) {\n console.log({ code });\n // Clear the code from the URL\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname || '/',\n );\n\n const clientID = store.sessionCookie.get('clientID');\n const clientSecret = store.sessionCookie.get('clientSecret');\n const vapidKey = store.sessionCookie.get('vapidKey');\n const verifier = store.sessionCookie.get('codeVerifier');\n\n (async () => {\n setUIState('loading');\n const { access_token: accessToken } = await getAccessToken({\n instanceURL,\n client_id: clientID,\n client_secret: clientSecret,\n code,\n code_verifier: verifier || undefined,\n });\n\n if (accessToken) {\n const client = initClient({ instance: instanceURL, accessToken });\n await Promise.allSettled([\n initPreferences(client),\n initInstance(client, instanceURL),\n initAccount(client, instanceURL, accessToken, vapidKey),\n ]);\n initStates();\n window.__IGNORE_GET_ACCOUNT_ERROR__ = true;\n\n setIsLoggedIn(true);\n setUIState('default');\n } else {\n setUIState('error');\n }\n __BENCHMARK.end('app-init');\n })();\n } else {\n window.__IGNORE_GET_ACCOUNT_ERROR__ = true;\n const searchAccount = decodeURIComponent(\n (window.location.search.match(/account=([^&]+)/) || [, ''])[1],\n );\n let account;\n if (searchAccount) {\n account = getAccount(searchAccount);\n console.log('searchAccount', searchAccount, account);\n if (account) {\n setCurrentAccountID(account.info.id);\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname || '/',\n );\n }\n }\n if (!account) {\n account = getCurrentAccount();\n }\n if (account) {\n setCurrentAccountID(account.info.id);\n const { client } = api({ account });\n const { instance } = client;\n // console.log('masto', masto);\n initStates();\n setUIState('loading');\n (async () => {\n try {\n if (hasPreferences() && hasInstance(instance)) {\n // Non-blocking\n initPreferences(client);\n initInstance(client, instance);\n } else {\n await Promise.allSettled([\n initPreferences(client),\n initInstance(client, instance),\n ]);\n }\n } catch (e) {\n } finally {\n setIsLoggedIn(true);\n setUIState('default');\n __BENCHMARK.end('app-init');\n }\n })();\n } else {\n setUIState('default');\n __BENCHMARK.end('app-init');\n }\n }\n\n // Cleanup\n store.sessionCookie.del('clientID');\n store.sessionCookie.del('clientSecret');\n store.sessionCookie.del('codeVerifier');\n }, []);\n\n let location = useLocation();\n states.currentLocation = location.pathname;\n // useLayoutEffect(() => {\n // states.currentLocation = location.pathname;\n // }, [location.pathname]);\n\n useEffect(focusDeck, [location, isLoggedIn]);\n\n if (/\\/https?:/.test(location.pathname)) {\n return <HttpRoute />;\n }\n\n if (uiState === 'loading') {\n return <Loader id=\"loader-root\" />;\n }\n\n return (\n <>\n <PrimaryRoutes isLoggedIn={isLoggedIn} />\n <SecondaryRoutes isLoggedIn={isLoggedIn} />\n <Routes>\n <Route path=\"/:instance?/s/:id\" element={<StatusRoute />} />\n </Routes>\n {isLoggedIn && <ComposeButton />}\n {isLoggedIn && <Shortcuts />}\n <Modals />\n {isLoggedIn && <NotificationService />}\n <BackgroundService isLoggedIn={isLoggedIn} />\n <SearchCommand onClose={focusDeck} />\n <KeyboardShortcutsHelp />\n </>\n );\n}\n\nfunction Root({ isLoggedIn }) {\n if (isLoggedIn) {\n __BENCHMARK.end('time-to-isLoggedIn');\n }\n return isLoggedIn ? <Home /> : <Welcome />;\n}\n\nconst PrimaryRoutes = memo(({ isLoggedIn }) => {\n const location = useLocation();\n const nonRootLocation = useMemo(() => {\n const { pathname } = location;\n return !/^\\/(login|welcome)/i.test(pathname);\n }, [location]);\n\n return (\n <Routes location={nonRootLocation || location}>\n <Route path=\"/\" element={<Root isLoggedIn={isLoggedIn} />} />\n <Route path=\"/login\" element={<Login />} />\n <Route path=\"/welcome\" element={<Welcome />} />\n </Routes>\n );\n});\n\nfunction getPrevLocation() {\n return states.prevLocation || null;\n}\nfunction SecondaryRoutes({ isLoggedIn }) {\n // const snapStates = useSnapshot(states);\n const location = useLocation();\n // const prevLocation = snapStates.prevLocation;\n const backgroundLocation = useRef(getPrevLocation());\n\n const isModalPage = useMemo(() => {\n return (\n matchPath('/:instance/s/:id', location.pathname) ||\n matchPath('/s/:id', location.pathname)\n );\n }, [location.pathname, matchPath]);\n if (isModalPage) {\n if (!backgroundLocation.current)\n backgroundLocation.current = getPrevLocation();\n } else {\n backgroundLocation.current = null;\n }\n console.debug({\n backgroundLocation: backgroundLocation.current,\n location,\n });\n\n return (\n <Routes location={backgroundLocation.current || location}>\n {isLoggedIn && (\n <>\n <Route path=\"/notifications\" element={<Notifications />} />\n <Route path=\"/mentions\" element={<Mentions />} />\n <Route path=\"/following\" element={<Following />} />\n <Route path=\"/b\" element={<Bookmarks />} />\n <Route path=\"/f\" element={<Favourites />} />\n <Route path=\"/l\">\n <Route index element={<Lists />} />\n <Route path=\":id\" element={<List />} />\n </Route>\n <Route path=\"/fh\" element={<FollowedHashtags />} />\n <Route path=\"/ft\" element={<Filters />} />\n <Route path=\"/catchup\" element={<Catchup />} />\n </>\n )}\n <Route path=\"/:instance?/t/:hashtag\" element={<Hashtag />} />\n <Route path=\"/:instance?/a/:id\" element={<AccountStatuses />} />\n <Route path=\"/:instance?/p\">\n <Route index element={<Public />} />\n <Route path=\"l\" element={<Public local />} />\n </Route>\n <Route path=\"/:instance?/trending\" element={<Trending />} />\n <Route path=\"/:instance?/search\" element={<Search />} />\n {/* <Route path=\"/:anything\" element={<NotFound />} /> */}\n </Routes>\n );\n}\n\nexport { App };\n","import './index.css';\nimport './cloak-mode.css';\nimport './polyfills';\n\nimport { i18n } from '@lingui/core';\nimport { I18nProvider } from '@lingui/react';\n// Polyfill needed for Firefox < 122\n// https://bugzilla.mozilla.org/show_bug.cgi?id=1423593\n// import '@formatjs/intl-segmenter/polyfill';\nimport { render } from 'preact';\nimport { HashRouter } from 'react-router-dom';\n\nimport { App } from './app';\nimport { initActivateLang } from './utils/lang';\n\ninitActivateLang();\n\nif (import.meta.env.DEV) {\n import('preact/debug');\n}\n\nrender(\n <I18nProvider i18n={i18n}>\n <HashRouter>\n <App />\n </HashRouter>\n </I18nProvider>,\n document.getElementById('app'),\n);\n\n// Storage cleanup\nsetTimeout(() => {\n try {\n // Clean up iconify localStorage\n Object.keys(localStorage).forEach((key) => {\n if (key.startsWith('iconify')) {\n localStorage.removeItem(key);\n }\n });\n Object.keys(sessionStorage).forEach((key) => {\n if (key.startsWith('iconify')) {\n sessionStorage.removeItem(key);\n }\n });\n\n // Clean up old settings key\n localStorage.removeItem('settings:boostsCarousel');\n } catch (e) {}\n}, 5000);\n\n// Service worker cache cleanup\nif ('serviceWorker' in navigator && typeof caches !== 'undefined') {\n const MAX_SW_CACHE_SIZE = 50;\n const IGNORE_CACHE_KEYS = ['icons'];\n let clearRanOnce = false;\n const FAST_INTERVAL = 10_000; // 10 seconds\n const SLOW_INTERVAL = 60 * 60 * 1000; // 1 hour\n async function clearCaches() {\n if (window.__IDLE__) {\n try {\n const keys = await caches.keys();\n for (const key of keys) {\n if (IGNORE_CACHE_KEYS.includes(key)) continue;\n const cache = await caches.open(key);\n const _keys = await cache.keys();\n if (_keys.length > MAX_SW_CACHE_SIZE) {\n console.warn('Cleaning cache', key, _keys.length);\n const deleteKeys = _keys.slice(MAX_SW_CACHE_SIZE);\n for (const deleteKey of deleteKeys) {\n await cache.delete(deleteKey);\n }\n }\n }\n clearRanOnce = true;\n } catch (e) {} // Silent fail\n }\n // Once cleared, clear again at slower interval\n setTimeout(clearCaches, clearRanOnce ? SLOW_INTERVAL : FAST_INTERVAL);\n }\n setTimeout(clearCaches, FAST_INTERVAL);\n}\n\nwindow.__CLOAK__ = () => {\n document.body.classList.toggle('cloak');\n};\n"],"names":["functionDebounce","debounce","fn","wait","callFirst","timeout","debouncedFn","clear","flush","call","debounceWrapper","context","args","callNow","window","document","event","params","evt","handleTouchStart","handleTouchMove","handleTouchEnd","xDown","yDown","xDiff","yDiff","timeDown","startEl","touchCount","e","swipeThreshold","getNearestAttribute","swipeUnit","swipeTimeout","timeDiff","eventType","changedTouches","eventData","xUp","yUp","el","attributeName","defaultValue","attributeValue","usePageVisibility","deps","savedCallback","useRef","useEffect","current","handleVisibilityChange","hidden","visibilityState","console","STREAMING_TIMEOUT","POLL_INTERVAL","BackgroundService","memo","isLoggedIn","visible","setVisible","useState","visibleTimeout","clearTimeout","setTimeout","checkLatestNotification","masto","instance","skipCheckMarkers","states","notificationsLast","notificationsIterator","v1","notifications","list","limit","sinceId","id","value","next","length","notificationsShowNew","lastReadId","markers","fetch","timeline","sub","streamTimeout","pollNotifications","streaming","api","hasStreaming","user","notification","subscribe","log","entry","_a","checkForUpdates","clearInterval","r","info","useInterval","lastCheckDate","useHotkeys","currentCloakMode","Date","diff","i18n","settings","text","_","ComposeButton","snapStates","useSnapshot","handleButton","composerState","minimized","openOSK","shiftKey","openCompose","showCompose","ignoreEventWhen","querySelector","_jsx","type","onClick","class","publishing","publishingError","children","Icon","icon","size","alt","KeyboardShortcutsHelp","onClose","showKeyboardShortcutsHelp","hasModal","Modal","tabindex","Trans","keys","0","action","className","1","2","map","parents","coords","siblings","animations","intersections","intervals","options","debounces","enabled","root","scrollX","scrollY","TGT","DEL","NEW","handleMutations","mutations","elements","getElements","animate","handleResizes","entries","updateAllPos","updatePos","observePosition","oldObserver","rect","invocations","buffer","getCoords","offsetWidth","offsetHeight","rootMargin","px","observer","optionsOrPlugin","getOptions","delay","isPlugin","currentAnimation","parent","forEach","lowPriority","poll","callback","resize","supportedBrowser","nodes","mutation","node","target","i","child","isMounted","preExisting","add","remain","remove","raw","str","getScrollOffset","p","x","y","getTransitionSizes","oldCoords","newCoords","widthFrom","heightFrom","widthTo","heightTo","styles","paddingY","paddingX","getTarget","isEnabled","callbacks","getPluginTuple","pluginReturn","config","animation","pluginOrOptions","deltaX","deltaY","start","end","keyframes","cleanUp","style","prev","finalX","finalY","top","left","width","height","deletePosition","adjustScroll","styleReset","scrollDeltaX","scrollDeltaY","scrollBefore","lastHeight","lastWidth","startScroll","smoothScroll","offsetParent","parentStyles","parentCoords","autoAnimate","element","useAutoAnimate","controller","setController","setEnabled","isStandalone","matchMedia","matches","Accounts","accounts","store","local","getJSON","currentAccount","getCurrentAccountID","moreThanOneAccount","reload","useReducer","accountsListParent","_jsxs","tabIndex","ref","account","isCurrent","isDefault","Avatar","url","avatarStatic","onDblClick","$select","NameText","test","showAcct","setCurrentAccountID","_Fragment","Menu2","align","menuButton","disabled","location","MenuLink","href","MenuDivider","MenuItem","splice","MenuConfirm","subMenu","confirmLabel","menuItemClassName","Link","to","logo","regionMaps","LangSelector","useLingui","populatedLocales","useMemo","LOCALES","lang","regionlessCode","replace","native","localeCode2Text","code","locale","fallback","CATALOGS","find","c","nativeName","_common","name","sort","a","b","order","localeCompare","DEFAULT_LANG","onChange","set","common","import","createBackendPushSubscription","subscription","push","create","fetchBackendPushSubscription","updateBackendPushSubscription","update","removeBackendPushSubscription","isPushSupported","navigator","getRegistration","serviceWorker","getSubscription","registration","pushManager","undefined","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","outputArray","Uint8Array","charCodeAt","initSubscription","backendSubscription","err","message","sameEndpoint","sameKey","vapidKey","key2","applicationServerKey","vapidKeyStr","applicationServerKeyStr","updateSubscription","data","policy","removeSubscription","DEFAULT_TEXT_SIZE","TEXT_SIZES","PHANPY_WEBSITE","WEBSITE","PHANPY_PRIVACY_POLICY_URL","PRIVACY_POLICY_URL","PHANPY_IMG_ALT_API_URL","IMG_ALT_API_URL","PHANPY_GIPHY_API_KEY","GIPHY_API_KEY","Settings","currentTheme","get","themeFormRef","targetLanguage","contentTranslationTargetLanguage","systemTargetLanguage","getTranslateTargetLanguage","systemTargetLanguageText","currentTextSize","prefs","setPrefs","authenticated","onInput","formData","theme","documentElement","html","classList","$manualMeta","$autoMetas","querySelectorAll","m","toggle","defaultChecked","fontSize","min","max","step","parseInt","setProperty","rel","for","checked","autoRefresh","boostsCarousel","targetLanguages","showCommon","contentTranslationHideLanguages","contentTranslation","composerGIFPicker","mediaAltGenerator","supports","groupedNotificationsAlpha","shortcutSettingsCloudImportExport","cloakMode","PushNotificationsSection","display","flexWrap","gap","lineHeight","src","aspectRatio","verticalAlign","borderRadius","RelativeTime","datetime","readOnly","__BUILD_TIME__","showToast","caches","uiState","setUIState","allowNotifications","setAllowNotifications","setNeedRelogin","pushFormRef","needRelogin","alerts","previousPolicyRef","policyEl","namedItem","isLoading","values","mention","favourite","reblog","follow","follow_request","followRequest","status","key","alertsCount","allowNotifications2","alert","permission","label","components","alert2","focusDeck","timer","columns","getElementById","modals","modal","modalFocusElement","focus","pages","page","useLocationChange","useLocation","currentLocationRef","pathname","FETCH_MAX_AGE","MAX_AGE","fetchLists","pmem","lists","title","updatedAt","now","maxAge","getLists","fetchList","getList","theList","getListTitle","addListStore","updateListStore","index","deleteListStore","listID","findIndex","ListAddEdit","editMode","nameFieldRef","repliesPolicyFieldRef","exclusiveFieldRef","repliesPolicy","exclusive","supportsExclusive","onSubmit","preventDefault","FormData","listResult","replies_policy","MUTE_DURATIONS","MUTE_DURATIONS_LABELS","i18nDuration","LIMIT","ACCOUNT_INFO_MAX_AGE","fetchFamiliarFollowers","currentID","familiarFollowers","memFetchFamiliarFollowers","fetchPostingStats","accountID","fetchStatuses","statuses","total","originals","replies","stats","boosts","memFetchPostingStats","fetchAccount","standalone","i18n2","currentMasto","currentInstance","isString","setInfo","sameCurrentInstance","info2","acct","avatar","bot","createdAt","displayName","emojis","fields","group","lastStatusAt","locked","note","statusesCount","username","memorial","moved","roles","hideCollections","header","headerStatic","headerIsAvatar","isSelf","infoHasEssentials","account2","updated","punycode","accountInstance","setHeaderCornerColors","followersIterator","toUnicode","domain","fetchFollowers","firstLoad","familiarFollowersCache","results","newValue","familiarFollowers2","familiar","followingIterator","LinkOrDiv","accountLink","postingStats","setPostingStats","renderFamiliarFollowers","setFamiliarFollowers","postingStatsUIState","setPostingStatsUIState","hasPostingStats","followers","renderPostingStats","onRelationshipChange","onProfileUpdate","useCallback","newAccount","headerCornerColors","stopPropagation","onError","ctx","canvas","onLoad","pixelDimension","rgbColors","OffscreenCanvas","createElement","g","imageSmoothingEnabled","drawImage","colors","getImageData","dataLength","lightenRGB","color","AccountBlock","avatarSize","handleWithInstance","clipboard","enhanceContent","verifiedAt","__html","EmojiText","blankCopy","follower","followersCount","shortenNumber","fetchFollowing","followingCount","excludeRelationshipAttrs","hideTime","daysSinceLastPost","FAMILIAR_FOLLOWERS_LIMIT","relationshipUIState","setRelationshipUIState","setRelationship","sameInstance","following","showingReblogs","currentInfo","setCurrentInfo","notifying","followedBy","blocking","blockedBy","muting","mutingNotifications","requested","domainBlocking","endorsed","privateNote","acctWithInstance","setIsSelf","q","fetchRelationships","relationships","relationship2","relationship","showAddRemoveLists","setShowAddRemoveLists","showPrivateNoteModal","setLists","updateAccount","showTranslatedBio","showEditProfile","setShowPrivateNoteModal","lists2","currentAuthenticated","onMenuChange","setShowTranslatedBio","handle","niceAccountURL","newRelationship","counter","duration","error","setShowEditProfile","Loader","loading","TranslatedBioSheet","EditProfileSheet","AddRemoveListsSheet","luminence","alpha","urlObj","host","state","getHTMLText","fieldsText","Math","path","listsContainingAccount2","reloadCount","showListAddEditModal","setShowListAddEditModal","setListsContainingAccount","listsContainingAccount","inList","accountIds","result","PrivateNoteSheet","initialNote","textareaRef","_b","e2","trim","setAccount","acc","source","fieldsAttributesRef","displayName2","note2","fieldsAttributesFields","field","fieldsAttributes","FieldsAttributesRow","hasValue","setHasValue","AccountHandleInfo","server","maxLength","required","AccountSheet","propInstance","AccountInfo","lookup","skip_webfinger","v2","search","resolve","accountURL","URL","parse","hostname","Drafts","drafts","setDrafts","db","ns","getCurrentAccountNS","ownKeys","filter","startsWith","getMany","getTime","hasDrafts","abrupt","draft","draftStatus","replyTo","updatedAtDate","replyToStatus","MiniDraft","spoilerText","mediaAttachments","hasPoll","hasMedia","firstImageMedia","image","file","objectURL","createObjectURL","hasPollOrMedia","EmbedModal","dangerouslySetInnerHTML","GenericAccounts","postID","isCurrentInstance","setAccounts","showMore","setShowMore","showGenericAccounts","heading","fetchAccounts","staticAccounts","showReactions","relationshipsMap","setRelationshipsMap","loadRelationships","loadAccounts","done","Array","isArray","theAccount","j","_types","newAccounts","reloadGenericAccounts","post","Status","showStats","InView","MediaAltModal","forceTranslate","setForceTranslate","differentLanguage","localeMatch","l","supportsTTS","speak","dir","whiteSpace","textWrap","TranslationBlock","sourceLanguage","clamp","gammaToLinear","pow","linearToGamma","rgb2oklab","s","cbrt","oklab2rgb","L","round","MediaModal","statusID","carouselRef","currentIndex","setCurrentIndex","carouselFocusItem","useLayoutEffect","scrollIntoView","prevStatusID","scrollLeft","clientWidth","differentStatusID","scrollTo","isRTL","behavior","showControls","setShowControls","handleSwipe","addEventListener","removeEventListener","handleScroll","abs","passive","mediaAccentColors","media","blurhash","averageColor","getBlurHashAverageColor","labAverageColor","mediaAccentGradient","range","join","toastRef","hideToast","contains","backgroundAttachment","backgroundImage","accentColor","description","showMediaAlt","Media","showOriginal","overflow","position","menuClassName","remoteUrl","CATEGORIES","CATEGORIES_INFO","spam","legal","violation","stampLabel","other","excludeStamp","ReportModal","split","rules","currentDomain","getCurrentInstance","selectedCategory","setSelectedCategory","showRules","setShowRules","rulesRef","hasRules","setHasRules","previewMode","useAvatarStatic","showActivity","Object","fromEntries","category","comment","forward","ruleIds","reports","accountId","statusIds","Fragment","rule","maxlength","rows","LZString","f","keyStrBase64","keyStrUriSafe","baseReverseDic","getBaseValue","alphabet","character","input","res","compressed","uncompressed","buf","TotalLen","current_value","bitsPerChar","getCharFromInt","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data","context_data_val","context_data_position","ii","resetValue","getNextValue","dictionary","enlargeIn","dictSize","numBits","w","bits","resb","maxpower","power","module","floatingButtonUrl","multiColumnUrl$1","tabMenuBarUrl","MAX_FETCH","fetchFollowedTags","iterator","followedTags","tags","fetchCount","getFollowedTags","fauxDiv","extractTagsFromStatus","content","hashtagLinks","AsyncText","setText","Promise","then","SHORTCUTS_LIMIT","TYPES","TYPE_TEXT","public","bookmarks","favourites","hashtag","trending","mentions","TYPE_PARAMS","notRequired","placeholder","pattern","fetchAccountTitle","SHORTCUTS_META","excludeViewMode","subtitle","query","encodeURIComponent","ShortcutsSettings","shortcuts","showForm","setShowForm","showImportExport","setShowImportExport","shortcutsListParent","opacity","textTransform","imgURL","multiColumnUrl","shortcutsViewMode","Boolean","shortcut","excludedViewMode","includes","shortcutsArr","from","temp","shortcutIndex","justifyContent","alignItems","currentTarget","ShortcutForm","mode","ImportExport","FORM_NOTES","currentType","setCurrentType","setFollowedHashtags","form","formRef","switch","followedHashtags","autocorrect","autocapitalize","tag","shortcutsStr","compressToEncodedURIComponent","importShortcutStr","setImportShortcutStr","parsedImportShortcutStr","setImportUIState","parsed","JSON","decompressFromEncodedURIComponent","hasCurrentSettings","shortcutsImportFieldRef","v","dt","importUIState","menuFooter","nonUniqueShortcuts","exceededLimit","newShortcuts","writeText","share","settingsJSON","newNote","changes","prevValue","Modals","navigate","useNavigate","preload","ComposeSuspense","__COMPOSE__","editStatus","newStatus","reloadStatusPage","reply","edit","toast","prevLocation","showSettings","showAccounts","showAccount","destination","showDrafts","showMediaModal","showShortcutsSettings","showEmbedModal","showReportModal","FollowRequestButtons","requestState","setRequestState","hasRelationship","followRequests","authorize","Error","NOTIFICATION_ICONS","severed_relationships","moderation_warning","emoji_reaction","emojiText","emoji","emoji_url","staticUrl","emojiObject","CustomEmoji","contentText","count","postsCount","postType","Subject","clickable","3","poll-self","poll-voted","favourite+reblog","admin.sign_up","admin.report","targetAccount","SEVERED_RELATIONSHIPS_TEXT","account_suspension","targetName","domain_block","user_domain_block","MODERATION_WARNING_TEXT","none","disable","mark_statuses_as_sensitive","delete_statuses","sensitive","silence","suspend","AVATARS_LIMIT","Notification","isStatic","disableContextMenu","report","_ids","_accounts","_statuses","_groupKeys","sampleAccounts","notificationsCount","groupKey","actualStatus","actualStatusID","isVoted","voted","isReplyToOthers","inReplyToAccountId","favsCount","reblogsCount","props","handleOpenGenericAccounts","showAvatar","emojiURL","shortcode","formattedCreatedAt","toLocaleString","genericAccountsHeading","statusKey","diffCount","expandAccounts","_g","isOwnPost","isFiltered","filtered","type2","gKey","keyAccounts","keyAccount","_accounts2","status2","TruncatedLink","onContextMenu","dispatchEvent","clientX","clientY","useTruncated","oldProps","newProps","accessToken","NotificationService","routeNotification","showNotificationSheet","notificationAccount","hasAccount","hash","warn","id2","setShowNotificationSheet","tagName","instanceURL","SearchForm","forwardRef","searchParams","setSearchParams","useSearchParams","searchMenuOpen","setSearchMenuOpen","setQuery","searchFieldRef","useImperativeHandle","setValue","select","blur","autocomplete","spellCheck","onSearch","onFocus","onBlur","onKeyDown","focusItem","nextItem","nextElementSibling","parentElement","firstItem","prevItem","previousElementSibling","lastItem","click","queryType","SearchCommand","showSearch","setShowSearch","searchFormRef","isSearchPage","closeSearch","enableOnFormTags","Shortcuts","shortcutsColumnsMode","menuRef","hasLists","formattedShortcuts","pin","handler","closeMenu","updatesButton","instanceRef","viewScroll","SubMenu2","groupBoosts","newValues","boostStash","serialBoosts","item","boostStashID","items","half","floor","slice","dedupeBoosts","boostedStatusIDs","filteredItems","boosterID","groupContext","contexts","contextIndex","t","repliedItem","self","inReplyToId","firstItemAccountID","newItems","appliedContextIndices","inReplyToIds","contextItems","aDate","bDate","every","it","sKey","statusReply","queueMicrotask","fallbackFetch","fetchStatus","saveStatus","skipThreading","ids","replyToStatuses","assignFollowedTags","statusFollowedTags","statusWithFollowedTags","extractedTags","itemFollowedTags","useScroll","scrollableRef","distanceFromStart","distanceFromEnd","scrollThresholdStart","scrollThresholdEnd","direction","distanceFromStartPx","_distanceFromStartPx","distanceFromEndPx","_distanceFromEndPx","scrollDirection","setScrollDirection","reachStart","setReachStart","reachEnd","setReachEnd","nearReachStart","setNearReachStart","nearReachEnd","setNearReachEnd","isVertical","scrollableElement","previousScrollStart","scrollTop","onScroll","scrollHeight","scrollWidth","clientHeight","scrollStart","scrollDimension","clientDimension","scrollDistance","init","Event","useScrollFn","useThrottledCallback","MediaPost","onMediaClick","accountEmojis","repliesCount","reblogged","favourited","favouritesCount","bookmarked","muted","visibility","language","editedAt","card","uri","_deleted","_pinned","debugHover","filterContext","useContext","FilterContext","filterInfo","hasSpoiler","readingExpandMedia","mediaKey","toLowerCase","filterTitleStr","showSpoilerMedia","NavMenu","showFollowing","bindLongPress","useLongPress","threshold","detect","cancelOnMovement","buttonRef","menuState","setMenuState","boundingBoxPadding","safeBoundingBoxPadding","mutesIterator","fetchMutes","mutes","blocksIterator","fetchBlocks","blocks","supportsLists","buttonClickTS","squircle","ControlledMenu","anchorRef","containerProps","zIndex","portal","body","unmountOnClose","appVersion","commitHash","__COMMIT_HASH__","confirm","scrollIntoViewOptions","block","inline","Timeline","titleComponent","emptyText","errorText","useItemID","fetchItems","checkForUpdatesInterval","headerStart","headerEnd","timelineStart","refresh","view","showFollowedTags","showReplyParent","clearWhenRefresh","setItems","showNew","setShowNew","debug","isMediaFirstInstance","mediaFirst","allowGrouping","loadItemsTS","firstLoad2","loadItems","useDebouncedCallback","ts","otherPosts","pinnedPosts","items2","itemsSelector","jRef","activeItem","activeItemRect","closest","getBoundingClientRect","allItems","activeItemIndex","indexOf","itemRect","topmostItem","kRef","findLast","oRef","handleLoadNewPosts","showNewPostsIndicator","dotRef","headerRef","nearReachStart2","hiddenUI","prevView","disableIdleCheck","loadOrCheckUpdates","inBackground","noPointers","__IDLE__","visible2","hasUpdate","lastHiddenTime","TimelineItem","skeleton","inView","fItems","filteredItemsIDs","aFiltered","bFiltered","isCarousel","unfiltered","filteredItems2","has","StatusCarousel","_pinned2","_grouped","item2","statusID3","_pinned3","actualStatusID3","reblog3","statusID2","actualStatusID2","reblog2","url2","showCompact","_differentAuthor","isSpoiler","manyItems","isMiddle","isStart","isEnd","TimelineStatusCompact","itemKey","enableCommentHint","endButtonRef","render","setRender","newID","oldID","startButtonRef","statusPeekText","statusPeek","statusThreadNumber","titlesStr","MIN_YEAR","MIN_YEAR_MONTH","supportsInputMonth","setAttribute","_isSearchEnabled","isSearchEnabled","AccountStatuses","useParams","month","excludeReplies","excludeBoosts","tagged","accountStatusesIterator","allSearchParams","searchOffsetRef","searchEnabled","setSearchEnabled","isValidMonth","_year","_month","monthIndex","after","afterStr","before","beforeStr","searchResults","value2","offset","pinnedStatuses","pinnedStatusesIds","postId","setFeaturedTags","acctDisplay","accountDisplay","featuredTags","monthYear","fetchAccountPromiseRef","useTitle","fetchPromise","cachedAccount","filterBarRef","TimelineStart","year","month2","date","validity","MonthPicker","active","allowSwitch","offsetLeft","fetchAccountStatuses","masto2","monthFieldRef","yearFieldRef","checkValidity","minYear","minMonth","maxYear","maxMonth","Bookmarks","bookmarksIterator","fetchBookmarks","catchupUrl","FILTER_CONTEXT","RANGES","FILTER_KEYS","original","groups","FILTER_SORTS","FILTER_GROUPS","DTF","mem","Intl","DateTimeFormat","day","hour","minute","Catchup","dtf","showTopLinks","setShowTopLinks","supportsPixelfed","fetchHome","maxCreatedAt","maxCreatedAtDate","allResults","mainloop","homeIterator","nextParams","createdAtDate","selfPost","addedResults","catchupRangeRef","catchupLastRef","handleCatchupClick","catchupID","catchup","posts","setPosts","reloadCatchups","setLastCatchupEndAt","prevCatchups","setPrevCatchups","lastCatchupEndAt","catchups","ownCatchups","trimmedCatchups","lastCatchups","restCatchups","endAt","startAt","reloadCatchupsCount","_followedTags","_e","thePost","__FILTER","links","sharers","links2","link","topLinks","shared","linksLoop","likes","filteredPosts","authors","authorCounts","selectedFilterCategory","filteredPosts2","setSelectedAuthor","sortBy","authorsHash","setSortOrder","authorCountsMap","postFilterMatches","boostedPosts","__BOOSTERS","selectedAuthor","filteredPostsMap","authorID","authorCountsList","sortedFilteredPosts","aAccountID","authorIndices","bAccountID","aIndex","bIndex","postDensity","bDensity","aDensity","sortOrder","groupBy","prevGroup","authorsListParent","autoAnimated","isFiltered2","postsBar","postsBarType","posts2","postsBins","binByTime","lastCatchupRange","sortOrderIndex","authorElement","scrollableRect","authorRect","right","showHelp","setShowHelp","hlRef","_2","escRef","handleArrowKeys","ignoreModifiers","activeElement","isRadio","isArrowKeys","setRange","niceDateTime","format","pc","yes","setSelectedFilterCategory","setSortBy","formatRange","setGroupBy","transform","imageDescription","publishedAt","filterCounts","author","paddingInline","showSeparator","IntersectionPostLineItem","isFollowedTags","PostLine","isReplyTo","show","setShow","IntersectionObserver","unobserve","MEDIA_DENSITY","CARD_DENSITY","pollContent","cur","htmlContentLength","PostPeek","density","isThread","_thread","readingExpandSpoilers","showMedia","showPostContent","emojifyText","o","multiple","remoteMediaURL","_f","_h","_j","_i","mediaURL","MEDIA_SIZE","previewUrl","gifv","video","audio","PostStats","numBins","dates","minDate","normalized","binIndex","bins","Favourites","favouritesIterator","fetchFavourites","FILTER_CONTEXT_UNIMPLEMENTED","FILTER_CONTEXT_LABELS","home","thread","EXPIRY_DURATIONS","EXPIRY_DURATIONS_LABELS","Filters","showFiltersAddEditModal","setShowFiltersAddEditModal","filters","setFilters","keywords","expiresAt","k","keyword","ExpiryStatus","_id","incID","FiltersAddEdit","filterAction","hasExpiry","expiresAtDate","editKeywords","setEditKeywords","keywordsRef","setRemovedKeyword_IDs","filteredEditKeywords","setRemovedKeywordIDs","removedKeyword_IDs","title2","keywordIDs","getAll","keywordKeywords","keywordWholeWords","wholeWord","removedKeywordIDs","keywordsAttributes","context2","expiresIn","filterResult","filterAction2","_id2","showNeverExpires","expired","rerender","FollowedHashtags","Following","latestItem","__BENCHMARK","latestItemChanged","clearFollowedTagsState","opts","payload","TAGS_LIMIT_PER_MODE","TOTAL_TAGS_LIMIT","Hashtags","mediaView","columnMode","hashtags","linkParams","hashtagTitle","maxID","fetchHashtags","timelines","any","maxId","onlyMedia","since_id","valueContainsLatestItem","followUIState","setFollowUIState","reachLimit","featuredUIState","setFeaturedUIState","isFeaturedTag","featuredTags2","setIsFeaturedTag","finally","featuredTagID","catch","MenuHeader","delete","FocusableItem","newHashtag","MenuGroup","exists","newInstance","List","listIterator","setList","showManageMembersModal","setShowManageMembersModal","list2","setDownOverflow","ListManageMembers","MEMBERS_LIMIT","members","setMembers","membersIterator","fetchMembers","member","as","RemoveAddButton","removed","setRemoved","notificationTypeKeys","fixNotifications","massageNotifications2","notificationGroups","sampleAccountIds","statusId","groupNotifications2","groupNotifications","newGroupNotifications","gn","latestPageNotificationAt","mostRecentNotificationId","newGroupNotifications1","notificationsMap","virtualType","mappedNotification","mappedAccount","ma","newGroupNotifications2","notificationsMap2","hasOneAccount","toLocaleDateString","n","cleanNotifications","cleanNotifications2","emptySearchParams","URLSearchParams","Mentions","stateType","setStateType","mentionsIterator","fetchMentions","types","conversationsIterator","latestConversationItem","lastStatus","fetchConversations","NOTIFICATIONS_LIMIT","NOTIFICATIONS_GROUPED_LIMIT","memSupportsGroupedNotifications","mastoFetchNotifications","getGroupedNotifications","NOTIFICATIONS_POLICIES","NOTIFICATIONS_POLICIES_TEXT","forNotFollowing","forNotFollowers","forNewAccounts","forPrivateMentions","forLimitedAccounts","Notifications","notificationID","notificationAccessToken","onlyMentions","setOnlyMentions","setFollowRequests","announcements","setAnnouncements","excludeTypes","allNotifications","groupedNotifications","notificationsLastFetchTime","fetchFollowRequests","loadFollowRequests","requests","fetchAnnouncements","supportsFilteredNotifications","showNotificationsSettings","setNotificationsPolicy","fetchNotificationsPolicy","loadNotificationsPolicy","notificationsRequests","setNotificationsRequests","fetchNotificationsRequest","loadNotifications","fetchNotificationsPromise","fetchNotifications","loadUpdates","unsub","subscribeKey","yesterdayDate","todayDate","currentDay","showTodayEmpty","announcementsListRef","statusLink","today","todaySubHeading","forceOpts","setShowNotificationsSettings","announcement","AnnouncementBlock","notificationsPolicy","onToggle","open","request","NotificationRequestModalButton","NotificationRequestButtons","differentDay","notificationDay","toDateString","subHeading","weekday","newPolicy","contact","contactAccount","startsAt","endsAt","published","reactions","allDay","read","publishedAtDate","publishedDateText","updatedAtText","reaction","me","fetchNotficationsByAccount","setShowModal","showModal","setNotifications","notifs","hasRequestState","Public","isLocal","publicIterator","fetchPublic","remote","prompt","SHORT_LIMIT","Search","offsetRef","statusResults","setStatusResults","accountResults","setAccountResults","hashtagResults","setHashtagResults","setTypeResultsFunc","loadResults","filterBarParent","history","reduce","TREND_CACHE_TIME","fetchLinks","trends","fetchTrendsStatuses","pixelfed","discover","fetchLinkList","Trending","setHashtags","setLinks","trendIterator","fetchTrends","currentLinkMentionsLoading","setCurrentLinkMentionsLoading","currentLinkMentionsIterator","currentLink","setCurrentLink","supportsTrendingLinkPosts","currentLinkRef","hasCurrentLink","fetchLinkMentions","prevCurrentLink","authorUrl","authorName","providerName","providerUrl","isShortTitle","hasAuthor","flexShrink","textAlign","Columns","Hashtag","Component","Home","NotificationsLink","notificationLinkRef","NotificationsMenu","NOTIFICATIONS_DISPLAY_LIMIT","hasFollowRequests","setHasFollowRequests","statusPostRegexes","getInstanceStatusObject","regex","match","getInstanceStatusURL","HttpRoute","statusObject","statusURL","Lists","instancesListURL","dec2hex","dec","toString","verifier","array","Uint32Array","crypto","getRandomValues","sha256","plain","TextEncoder","encode","subtle","digest","base64urlencode","bytes","len","byteLength","String","fromCharCode","btoa","generateCodeChallenge","hashed","supportsPKCE","ok","json","code_challenge_methods_supported","__generateCodeChallenge","DEV","PHANPY_CLIENT_NAME","CLIENT_NAME","SCOPES","sameSite","currentLocation","origin","REDIRECT_URI","registerApplication","registrationParams","client_name","redirect_uris","scopes","website","method","headers","getPKCEAuthorizationURL","registrationJSON","client_id","codeChallenge","code_challenge_method","code_challenge","authorizationParams","scope","authorizationURL","client_secret","code_verifier","redirect_uri","append","PHANPY_DEFAULT_INSTANCE","DEFAULT_INSTANCE","Login","instanceURLRef","cachedInstanceURL","submit","instanceText","setInstanceText","instancesList","setInstancesList","searcher","Fuse","submitInstance","xmlDoc","parseFromString","template","vapid_key","authPKCE","sessionCookie","getAuthorizationURL","cleanInstanceText","instanceTextLooksLikeDomain","instancesSuggestions","instance2","selectedInstanceText","SUBCOMMENTS_OPEN_ALL_LIMIT","MAX_WEIGHT","cachedRepliesToggle","cachedStatusesMap","scrollPositions","resetScrollPosition","STATUSES_SELECTOR","STATUS_URL_REGEX","StatusPage","mediaParam","mediaOnlyParam","mediaIndex","mediaStatusID","mediaStatus","getStatus","showMediaOnly","heroStatus","setHeroStatus","closeLink","matchStatusPath","matchPath","handleMediaClose","$carousel","$deckContainers","$deckContainer","StatusParent","linkable","restProps","StatusThread","navigation","translate","setStatuses","heroStatusRef","totalDescendants","scrollOffsets","lastInitContextTS","reloadHero","heroTimer","cachedStatuses","reallyCachedStatuses","heroFetch","pRetry","contextFetch","hasStatus","heroStatus2","_replies","_r","expandReplies","weight","descendants","missingStatuses","ancestors2","ancestors","ancestorsIsThread","nestedDescendants","__replies","ancestor","allStatuses","offsetTop","setLimit","showRefresh","setShowRefresh","interval","scrollPosition","setInterval","newScrollOffsets","newScrollTop","getCurrentAccount","heroDisplayName","div","heroContentText","apiCache","postInstance","statusWeightCache","innerHTML","heroInView","activeStatus","postSameInstance","activeStatusRect","activeStatusIndex","allStatusLinks","nextStatus","some","heroPointer","topmostStatusLink","prevStatus","statusLinkRect","details","reachTopPost","initialPageState","handleMediaClick","renderStatus","descendant","isHero","requestAnimationFrame","setHeroInView","setReachTopPost","handleStatusLinkClick","isLinkable","SubComments","hasDescendants","showActionsBar","prevEntry","level","moreStatusesKeys","openAll","parentLink","getIDs","statusesList","spoilerButton","viewMode","prevLocationIsStatusPage","onAnimationEnd","arr","setViewMode","button","hasParentThread","replies2","replies3","diveDeep","totalComments","sameCount","totalWeight","accWeight","calcStatusWeight","openBefore","detailsRef","open2","dataset","POLL_VIRTUAL_LENGTH","cachedWeight","mediaLength","MEDIA_VIRTUAL_LENGTH","pollLength","cardLength","CARD_VIRTUAL_LENGTH","StatusRoute","boostsCarouselUrl","groupedNotificationsUrl","multiHashtagTimelineUrl","nestedCommentsThreadUrl","logoText","PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL","DEFAULT_INSTANCE_REGISTRATION_URL","appSite","Welcome","marginBlockEnd","nativeAlert","__nativeAlert","Toastify","gravity","__STATES__","__STATES_STATS__","counts","unmountedPosts","unfurledLinks","postInNotifications","$post","unfurled","keysCount","ICONS","nonIdleEvents","setIdle","debouncedSetIdle","onNonIdle","isIOS","$meta","tempColor","colorScheme","themeDarkColor","textSize","$app","BENCHES","setIsLoggedIn","decodeURIComponent","clientSecret","clientID","initStates","searchAccount","getAccount","client","hasPreferences","hasInstance","initPreferences","initInstance","PrimaryRoutes","Routes","Route","Root","nonRootLocation","getPrevLocation","SecondaryRoutes","backgroundLocation","isModalPage","initActivateLang","I18nProvider","HashRouter","App","localStorage","removeItem","sessionStorage","IGNORE_CACHE_KEYS","clearRanOnce","FAST_INTERVAL","SLOW_INTERVAL","clearCaches","cache","_keys","MAX_SW_CACHE_SIZE","deleteKeys"],"mappings":"ilCAAA,IAAIA,GAAmBC,GAEvB,SAASA,GAASC,EAAIC,EAAMC,EAAW,CACrC,IAAIC,EAAU,KACVC,EAAc,KAEdC,EAAQ,UAAW,CACjBF,IACF,aAAaA,CAAO,EAEpBC,EAAc,KACdD,EAAU,KAEhB,EAEMG,EAAQ,UAAW,CACrB,IAAIC,EAAOH,EACXC,IAEIE,GACFA,GAEN,EAEMC,EAAkB,UAAW,CAC/B,GAAI,CAACP,EACH,OAAOD,EAAG,MAAM,KAAM,SAAS,EAGjC,IAAIS,EAAU,KACVC,EAAO,UACPC,EAAUT,GAAa,CAACC,EAkB5B,GAjBAE,IAEAD,EAAc,UAAW,CACvBJ,EAAG,MAAMS,EAASC,CAAI,CAC5B,EAEIP,EAAU,WAAW,UAAW,CAG9B,GAFAA,EAAU,KAEN,CAACQ,EAAS,CACZ,IAAIJ,EAAOH,EACX,OAAAA,EAAc,KAEPG,EAAI,CACZ,CACF,EAAEN,CAAI,EAEH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