1 line
1.2 MiB
1 line
1.2 MiB
{"version":3,"file":"main-B7dDrG0m.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","../../node_modules/chroma-js/src/utils/limit.js","../../node_modules/chroma-js/src/utils/type.js","../../node_modules/chroma-js/src/utils/unpack.js","../../node_modules/chroma-js/src/utils/index.js","../../node_modules/chroma-js/src/utils/multiply-matrices.js","../../node_modules/chroma-js/src/io/lab/lab-constants.js","../../node_modules/chroma-js/src/io/lab/lab2rgb.js","../../node_modules/chroma-js/src/io/oklab/oklab2rgb.js","../../node_modules/chroma-js/src/io/lab/rgb2lab.js","../../node_modules/chroma-js/src/io/oklab/rgb2oklab.js","../../node_modules/chroma-js/src/io/lch/lch2lab.js","../../node_modules/chroma-js/src/io/oklch/oklch2rgb.js","../../node_modules/chroma-js/src/io/lch/lab2lch.js","../../node_modules/chroma-js/src/io/oklch/rgb2oklch.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/annual-report.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 { useLingui } from '@lingui/react/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 const { t } = useLingui();\n\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 { useLingui } from '@lingui/react/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 { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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`Focus next column in multi-column mode`,\n keys: <kbd>]</kbd>,\n },\n {\n action: t`Focus previous column in multi-column mode`,\n keys: <kbd>[</kbd>,\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 root’s 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 parent’s 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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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} ‎[{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, Trans, useLingui } from '@lingui/react/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 prettyBytes from '../utils/pretty-bytes';\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 { t } = useLingui();\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 &{' '}\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 profile’s 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 ·{' '}\n <a\n href=\"https://www.buymeacoffee.com/cheeaun\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Trans>Donate</Trans>\n </a>{' '}\n ·{' '}\n <a\n href=\"https://patreon.com/cheeaun\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Patreon\n </a>{' '}\n ·{' '}\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={async () => alert(await getCachesSize())}\n >\n Show cache size\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\nasync function getCachesSize() {\n const keys = await caches.keys();\n let total = {};\n let TOTAL = 0;\n for (const key of keys) {\n const cache = await caches.open(key);\n const k = await cache.keys();\n for (const item of k) {\n try {\n const response = await cache.match(item);\n const blob = await response.blob();\n total[key] = (total[key] || 0) + blob.size;\n TOTAL += blob.size;\n } catch (e) {\n alert('Failed to get cache size for ' + item);\n alert(e);\n }\n }\n }\n return {\n ...Object.fromEntries(\n Object.entries(total).map(([k, v]) => [k, prettyBytes(v)]),\n ),\n TOTAL: prettyBytes(TOTAL),\n };\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 const { t } = useLingui();\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 focused column\n const focusedColumn = columns.querySelector('.deck-container.focus');\n if (focusedColumn) {\n focusedColumn.focus();\n } else {\n // Focus first column within viewport\n const firstVisibleColumn = Array.from(\n columns.querySelectorAll('.deck-container'),\n ).find((column) => {\n const columnRect = column.getBoundingClientRect();\n return columnRect.left >= 0;\n });\n if (firstVisibleColumn) {\n firstVisibleColumn.focus();\n } else {\n // Focus first column\n columns.querySelector('.deck-container')?.focus?.();\n }\n }\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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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 =\n supports('@mastodon/list-exclusive') ||\n supports('@gotosocial/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 } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/macro';\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 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 60 * 60 * 24 * 30, // 30 days\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 2592_000: i18nDuration(30, 'day'),\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, t } = 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 { _, t } = 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 { t } = useLingui();\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 { t } = useLingui();\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 { t } = useLingui();\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 & close</Trans>\n </button>\n </span>\n </footer>\n </form>\n </main>\n </div>\n );\n}\n\nfunction EditProfileSheet({ onClose = () => {} }) {\n const { t } = useLingui();\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 const encodedAcct = punycode.toASCII(acct);\n return (\n <div class=\"handle-info\">\n <span class=\"handle-handle\" title={encodedAcct}>\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 { useLingui } from '@lingui/react/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 { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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 { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/macro';\n\nimport Icon from './icon';\n\nfunction EmbedModal({ html, url, width, height, onClose = () => {} }) {\n const { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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,\n}) {\n const { t } = useLingui();\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\">\n {blankCopy || t`Nothing to show`}\n </p>\n )}\n </main>\n </div>\n );\n}\n","import { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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","const { min, max } = Math;\n\nexport default (x, low = 0, high = 1) => {\n return min(max(low, x), high);\n};\n","// ported from jQuery's $.type\nconst classToType = {};\nfor (let name of [\n 'Boolean',\n 'Number',\n 'String',\n 'Function',\n 'Array',\n 'Date',\n 'RegExp',\n 'Undefined',\n 'Null'\n]) {\n classToType[`[object ${name}]`] = name.toLowerCase();\n}\nexport default function (obj) {\n return classToType[Object.prototype.toString.call(obj)] || 'object';\n}\n","import type from './type.js';\n\nexport default (args, keyOrder = null) => {\n // if called with more than 3 arguments, we return the arguments\n if (args.length >= 3) return Array.prototype.slice.call(args);\n // with less than 3 args we check if first arg is object\n // and use the keyOrder string to extract and sort properties\n if (type(args[0]) == 'object' && keyOrder) {\n return keyOrder\n .split('')\n .filter((k) => args[0][k] !== undefined)\n .map((k) => args[0][k]);\n }\n // otherwise we just return the first argument\n // (which we suppose is an array of args)\n return args[0].slice(0);\n};\n","const { PI, min, max } = Math;\n\nconst rnd2 = (a) => Math.round(a * 100) / 100;\nconst rnd3 = (a) => Math.round(a * 100) / 100;\n\nexport { default as clip_rgb } from './clip_rgb.js';\nexport { default as limit } from './limit.js';\nexport { default as type } from './type.js';\nexport { default as unpack } from './unpack.js';\nexport { default as last } from './last.js';\n\nconst TWOPI = PI * 2;\nconst PITHIRD = PI / 3;\nconst DEG2RAD = PI / 180;\nconst RAD2DEG = 180 / PI;\n\n/**\n * Reverse the first three elements of an array\n *\n * @param {any[]} arr\n * @returns {any[]}\n */\nfunction reverse3(arr) {\n return [...arr.slice(0, 3).reverse(), ...arr.slice(3)];\n}\n\nexport { PI, TWOPI, PITHIRD, DEG2RAD, RAD2DEG, min, max, rnd2, rnd3, reverse3 };\n","// from https://www.w3.org/TR/css-color-4/multiply-matrices.js\nexport default function multiplyMatrices(A, B) {\n let m = A.length;\n\n if (!Array.isArray(A[0])) {\n // A is vector, convert to [[a, b, c, ...]]\n A = [A];\n }\n\n if (!Array.isArray(B[0])) {\n // B is vector, convert to [[a], [b], [c], ...]]\n B = B.map((x) => [x]);\n }\n\n let p = B[0].length;\n let B_cols = B[0].map((_, i) => B.map((x) => x[i])); // transpose B\n let product = A.map((row) =>\n B_cols.map((col) => {\n if (!Array.isArray(row)) {\n return col.reduce((a, c) => a + c * row, 0);\n }\n\n return row.reduce((a, c, i) => a + c * (col[i] || 0), 0);\n })\n );\n\n if (m === 1) {\n product = product[0]; // Avoid [[a, b, c, ...]]\n }\n\n if (p === 1) {\n return product.map((x) => x[0]); // Avoid [[a], [b], [c], ...]]\n }\n\n return product;\n}\n","const labConstants = {\n // Corresponds roughly to RGB brighter/darker\n Kn: 18,\n\n // D65 standard referent\n labWhitePoint: 'd65',\n Xn: 0.95047,\n Yn: 1,\n Zn: 1.08883,\n\n t0: 0.137931034, // 4 / 29\n t1: 0.206896552, // 6 / 29\n t2: 0.12841855, // 3 * t1 * t1\n t3: 0.008856452, // t1 * t1 * t1,\n\n kE: 216.0 / 24389.0,\n kKE: 8.0,\n kK: 24389.0 / 27.0,\n\n RefWhiteRGB: {\n // sRGB\n X: 0.95047,\n Y: 1,\n Z: 1.08883\n },\n\n MtxRGB2XYZ: {\n m00: 0.4124564390896922,\n m01: 0.21267285140562253,\n m02: 0.0193338955823293,\n m10: 0.357576077643909,\n m11: 0.715152155287818,\n m12: 0.11919202588130297,\n m20: 0.18043748326639894,\n m21: 0.07217499330655958,\n m22: 0.9503040785363679\n },\n\n MtxXYZ2RGB: {\n m00: 3.2404541621141045,\n m01: -0.9692660305051868,\n m02: 0.055643430959114726,\n m10: -1.5371385127977166,\n m11: 1.8760108454466942,\n m12: -0.2040259135167538,\n m20: -0.498531409556016,\n m21: 0.041556017530349834,\n m22: 1.0572251882231791\n },\n\n // used in rgb2xyz\n As: 0.9414285350000001,\n Bs: 1.040417467,\n Cs: 1.089532651,\n\n MtxAdaptMa: {\n m00: 0.8951,\n m01: -0.7502,\n m02: 0.0389,\n m10: 0.2664,\n m11: 1.7135,\n m12: -0.0685,\n m20: -0.1614,\n m21: 0.0367,\n m22: 1.0296\n },\n\n MtxAdaptMaI: {\n m00: 0.9869929054667123,\n m01: 0.43230526972339456,\n m02: -0.008528664575177328,\n m10: -0.14705425642099013,\n m11: 0.5183602715367776,\n m12: 0.04004282165408487,\n m20: 0.15996265166373125,\n m21: 0.0492912282128556,\n m22: 0.9684866957875502\n }\n};\n\nexport default labConstants;\n\n// taken from https://de.mathworks.com/help/images/ref/whitepoint.html\nconst ILLUMINANTS = new Map([\n // ASTM E308-01\n ['a', [1.0985, 0.35585]],\n // Wyszecki & Stiles, p. 769\n ['b', [1.0985, 0.35585]],\n // C ASTM E308-01\n ['c', [0.98074, 1.18232]],\n // D50 (ASTM E308-01)\n ['d50', [0.96422, 0.82521]],\n // D55 (ASTM E308-01)\n ['d55', [0.95682, 0.92149]],\n // D65 (ASTM E308-01)\n ['d65', [0.95047, 1.08883]],\n // E (ASTM E308-01)\n ['e', [1, 1, 1]],\n // F2 (ASTM E308-01)\n ['f2', [0.99186, 0.67393]],\n // F7 (ASTM E308-01)\n ['f7', [0.95041, 1.08747]],\n // F11 (ASTM E308-01)\n ['f11', [1.00962, 0.6435]],\n ['icc', [0.96422, 0.82521]]\n]);\n\nexport function setLabWhitePoint(name) {\n const ill = ILLUMINANTS.get(String(name).toLowerCase());\n if (!ill) {\n throw new Error('unknown Lab illuminant ' + name);\n }\n labConstants.labWhitePoint = name;\n labConstants.Xn = ill[0];\n labConstants.Zn = ill[1];\n}\n\nexport function getLabWhitePoint() {\n return labConstants.labWhitePoint;\n}\n","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\n\n/*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\nconst lab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [L, a, b] = args;\n const [x, y, z] = lab2xyz(L, a, b);\n const [r, g, b_] = xyz2rgb(x, y, z);\n return [r, g, b_, args.length > 3 ? args[3] : 1];\n};\n\nconst lab2xyz = (L, a, b) => {\n const { kE, kK, kKE, Xn, Yn, Zn } = LAB_CONSTANTS;\n\n const fy = (L + 16.0) / 116.0;\n const fx = 0.002 * a + fy;\n const fz = fy - 0.005 * b;\n\n const fx3 = fx * fx * fx;\n const fz3 = fz * fz * fz;\n\n const xr = fx3 > kE ? fx3 : (116.0 * fx - 16.0) / kK;\n const yr = L > kKE ? Math.pow((L + 16.0) / 116.0, 3.0) : L / kK;\n const zr = fz3 > kE ? fz3 : (116.0 * fz - 16.0) / kK;\n\n const x = xr * Xn;\n const y = yr * Yn;\n const z = zr * Zn;\n\n return [x, y, z];\n};\n\nconst compand = (linear) => {\n /* sRGB */\n const sign = Math.sign(linear);\n linear = Math.abs(linear);\n return (\n (linear <= 0.0031308\n ? linear * 12.92\n : 1.055 * Math.pow(linear, 1.0 / 2.4) - 0.055) * sign\n );\n};\n\nconst xyz2rgb = (x, y, z) => {\n const { MtxAdaptMa, MtxAdaptMaI, MtxXYZ2RGB, RefWhiteRGB, Xn, Yn, Zn } =\n LAB_CONSTANTS;\n\n const As = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;\n const Bs = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;\n const Cs = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;\n\n const Ad =\n RefWhiteRGB.X * MtxAdaptMa.m00 +\n RefWhiteRGB.Y * MtxAdaptMa.m10 +\n RefWhiteRGB.Z * MtxAdaptMa.m20;\n const Bd =\n RefWhiteRGB.X * MtxAdaptMa.m01 +\n RefWhiteRGB.Y * MtxAdaptMa.m11 +\n RefWhiteRGB.Z * MtxAdaptMa.m21;\n const Cd =\n RefWhiteRGB.X * MtxAdaptMa.m02 +\n RefWhiteRGB.Y * MtxAdaptMa.m12 +\n RefWhiteRGB.Z * MtxAdaptMa.m22;\n\n const X1 =\n (x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z * MtxAdaptMa.m20) *\n (Ad / As);\n const Y1 =\n (x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z * MtxAdaptMa.m21) *\n (Bd / Bs);\n const Z1 =\n (x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z * MtxAdaptMa.m22) *\n (Cd / Cs);\n\n const X2 =\n X1 * MtxAdaptMaI.m00 + Y1 * MtxAdaptMaI.m10 + Z1 * MtxAdaptMaI.m20;\n const Y2 =\n X1 * MtxAdaptMaI.m01 + Y1 * MtxAdaptMaI.m11 + Z1 * MtxAdaptMaI.m21;\n const Z2 =\n X1 * MtxAdaptMaI.m02 + Y1 * MtxAdaptMaI.m12 + Z1 * MtxAdaptMaI.m22;\n\n const r = compand(\n X2 * MtxXYZ2RGB.m00 + Y2 * MtxXYZ2RGB.m10 + Z2 * MtxXYZ2RGB.m20\n );\n const g = compand(\n X2 * MtxXYZ2RGB.m01 + Y2 * MtxXYZ2RGB.m11 + Z2 * MtxXYZ2RGB.m21\n );\n const b = compand(\n X2 * MtxXYZ2RGB.m02 + Y2 * MtxXYZ2RGB.m12 + Z2 * MtxXYZ2RGB.m22\n );\n\n return [r * 255, g * 255, b * 255];\n};\n\nexport default lab2rgb;\nexport { xyz2rgb };\n","import { unpack } from '../../utils/index.js';\nimport multiplyMatrices from '../../utils/multiply-matrices.js';\nimport { xyz2rgb } from '../lab/lab2rgb.js';\n\nconst oklab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [L, a, b, ...rest] = args;\n const [X, Y, Z] = OKLab_to_XYZ([L, a, b]);\n const [r, g, b_] = xyz2rgb(X, Y, Z);\n return [r, g, b_, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\n// from https://www.w3.org/TR/css-color-4/#color-conversion-code\nfunction OKLab_to_XYZ(OKLab) {\n // Given OKLab, convert to XYZ relative to D65\n var LMStoXYZ = [\n [1.2268798758459243, -0.5578149944602171, 0.2813910456659647],\n [-0.0405757452148008, 1.112286803280317, -0.0717110580655164],\n [-0.0763729366746601, -0.4214933324022432, 1.5869240198367816]\n ];\n var OKLabtoLMS = [\n [1.0, 0.3963377773761749, 0.2158037573099136],\n [1.0, -0.1055613458156586, -0.0638541728258133],\n [1.0, -0.0894841775298119, -1.2914855480194092]\n ];\n\n var LMSnl = multiplyMatrices(OKLabtoLMS, OKLab);\n return multiplyMatrices(\n LMStoXYZ,\n LMSnl.map((c) => c ** 3)\n );\n}\n\nexport default oklab2rgb;\n","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\n\nconst rgb2lab = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const [x, y, z] = rgb2xyz(r, g, b);\n const [L, a, b_] = xyz2lab(x, y, z);\n return [L, a, b_, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\nfunction xyz2lab(x, y, z) {\n const { Xn, Yn, Zn, kE, kK } = LAB_CONSTANTS;\n const xr = x / Xn;\n const yr = y / Yn;\n const zr = z / Zn;\n\n const fx = xr > kE ? Math.pow(xr, 1.0 / 3.0) : (kK * xr + 16.0) / 116.0;\n const fy = yr > kE ? Math.pow(yr, 1.0 / 3.0) : (kK * yr + 16.0) / 116.0;\n const fz = zr > kE ? Math.pow(zr, 1.0 / 3.0) : (kK * zr + 16.0) / 116.0;\n\n return [116.0 * fy - 16.0, 500.0 * (fx - fy), 200.0 * (fy - fz)];\n}\n\nfunction gammaAdjustSRGB(companded) {\n const sign = Math.sign(companded);\n companded = Math.abs(companded);\n const linear =\n companded <= 0.04045\n ? companded / 12.92\n : Math.pow((companded + 0.055) / 1.055, 2.4);\n return linear * sign;\n}\n\nconst rgb2xyz = (r, g, b) => {\n // normalize and gamma adjust\n r = gammaAdjustSRGB(r / 255);\n g = gammaAdjustSRGB(g / 255);\n b = gammaAdjustSRGB(b / 255);\n\n const { MtxRGB2XYZ, MtxAdaptMa, MtxAdaptMaI, Xn, Yn, Zn, As, Bs, Cs } =\n LAB_CONSTANTS;\n\n let x = r * MtxRGB2XYZ.m00 + g * MtxRGB2XYZ.m10 + b * MtxRGB2XYZ.m20;\n let y = r * MtxRGB2XYZ.m01 + g * MtxRGB2XYZ.m11 + b * MtxRGB2XYZ.m21;\n let z = r * MtxRGB2XYZ.m02 + g * MtxRGB2XYZ.m12 + b * MtxRGB2XYZ.m22;\n\n const Ad = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;\n const Bd = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;\n const Cd = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;\n\n let X = x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z * MtxAdaptMa.m20;\n let Y = x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z * MtxAdaptMa.m21;\n let Z = x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z * MtxAdaptMa.m22;\n\n X *= Ad / As;\n Y *= Bd / Bs;\n Z *= Cd / Cs;\n\n x = X * MtxAdaptMaI.m00 + Y * MtxAdaptMaI.m10 + Z * MtxAdaptMaI.m20;\n y = X * MtxAdaptMaI.m01 + Y * MtxAdaptMaI.m11 + Z * MtxAdaptMaI.m21;\n z = X * MtxAdaptMaI.m02 + Y * MtxAdaptMaI.m12 + Z * MtxAdaptMaI.m22;\n\n return [x, y, z];\n};\n\nexport default rgb2lab;\nexport { rgb2xyz };\n","import { unpack } from '../../utils/index.js';\nimport multiplyMatrices from '../../utils/multiply-matrices.js';\nimport { rgb2xyz } from '../lab/rgb2lab.js';\n\nconst rgb2oklab = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const xyz = rgb2xyz(r, g, b);\n const oklab = XYZ_to_OKLab(xyz);\n return [...oklab, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\n// from https://www.w3.org/TR/css-color-4/#color-conversion-code\nfunction XYZ_to_OKLab(XYZ) {\n // Given XYZ relative to D65, convert to OKLab\n const XYZtoLMS = [\n [0.819022437996703, 0.3619062600528904, -0.1288737815209879],\n [0.0329836539323885, 0.9292868615863434, 0.0361446663506424],\n [0.0481771893596242, 0.2642395317527308, 0.6335478284694309]\n ];\n const LMStoOKLab = [\n [0.210454268309314, 0.7936177747023054, -0.0040720430116193],\n [1.9779985324311684, -2.4285922420485799, 0.450593709617411],\n [0.0259040424655478, 0.7827717124575296, -0.8086757549230774]\n ];\n\n const LMS = multiplyMatrices(XYZtoLMS, XYZ);\n // JavaScript Math.cbrt returns a sign-matched cube root\n // beware if porting to other languages\n // especially if tempted to use a general power function\n return multiplyMatrices(\n LMStoOKLab,\n LMS.map((c) => Math.cbrt(c))\n );\n // L in range [0,1]. For use in CSS, multiply by 100 and add a percent\n}\n\nexport default rgb2oklab;\n","import { unpack, DEG2RAD } from '../../utils/index.js';\nconst { sin, cos } = Math;\n\nconst lch2lab = (...args) => {\n /*\n Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.\n These formulas were invented by David Dalrymple to obtain maximum contrast without going\n out of gamut if the parameters are in the range 0-1.\n\n A saturation multiplier was added by Gregor Aisch\n */\n let [l, c, h] = unpack(args, 'lch');\n if (isNaN(h)) h = 0;\n h = h * DEG2RAD;\n return [l, cos(h) * c, sin(h) * c];\n};\n\nexport default lch2lab;\n","import { unpack } from '../../utils/index.js';\nimport lch2lab from '../lch/lch2lab.js';\nimport oklab2rgb from '../oklab/oklab2rgb.js';\n\nconst oklch2rgb = (...args) => {\n args = unpack(args, 'lch');\n const [l, c, h, ...rest] = args;\n const [L, a, b_] = lch2lab(l, c, h);\n const [r, g, b] = oklab2rgb(L, a, b_);\n return [r, g, b, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\nexport default oklch2rgb;\n","import { unpack, RAD2DEG } from '../../utils/index.js';\nconst { sqrt, atan2, round } = Math;\n\nconst lab2lch = (...args) => {\n const [l, a, b] = unpack(args, 'lab');\n const c = sqrt(a * a + b * b);\n let h = (atan2(b, a) * RAD2DEG + 360) % 360;\n if (round(c * 10000) === 0) h = Number.NaN;\n return [l, c, h];\n};\n\nexport default lab2lch;\n","import { unpack } from '../../utils/index.js';\nimport rgb2oklab from '../oklab/rgb2oklab.js';\nimport lab2lch from '../lch/lab2lch.js';\n\nconst rgb2oklch = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const [l, a, b_] = rgb2oklab(r, g, b);\n const [L, c, h] = lab2lch(l, a, b_);\n return [L, c, h, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\nexport default rgb2oklch;\n","import { Trans, useLingui } from '@lingui/react/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 { oklch2rgb, rgb2oklch } from '../utils/color-utils';\nimport isRTL from '../utils/is-rtl';\nimport showToast from '../utils/show-toast';\nimport states from '../utils/states';\nimport store from '../utils/store';\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 { t } = useLingui();\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 mediaOkColors = useMemo(() => {\n return mediaAttachments?.map((media) => {\n const { blurhash } = media;\n if (blurhash) {\n const averageColor = getBlurHashAverageColor(blurhash);\n return rgb2oklch(averageColor);\n }\n return null;\n });\n }, [mediaAttachments]);\n const mediaAccentColors = useMemo(() => {\n return mediaOkColors?.map((okColor) => {\n if (okColor) {\n return {\n light: oklch2rgb([0.95, 0.01, okColor[2]]),\n dark: oklch2rgb([0.35, 0.01, okColor[2]]),\n default: oklch2rgb([0.6, okColor[1], okColor[2]]),\n };\n }\n return null;\n });\n });\n const mediaAccentGradients = useMemo(() => {\n const gap = 5;\n const range = 100 / mediaAccentColors.length;\n const colors = mediaAccentColors.map((color, i) => {\n const start = i * range + gap;\n const end = (i + 1) * range - gap;\n if (color?.light && color?.dark) {\n return {\n light: `\n rgb(${color.light?.join(',')}) ${start}%, \n rgb(${color.light?.join(',')}) ${end}%\n `,\n dark: `\n rgb(${color.dark?.join(',')}) ${start}%, \n rgb(${color.dark?.join(',')}) ${end}%\n `,\n };\n }\n\n return {\n light: `\n transparent ${start}%, \n transparent ${end}%\n `,\n dark: `\n transparent ${start}%, \n transparent ${end}%\n `,\n };\n });\n const lightGradient = colors.map((color) => color.light).join(', ');\n const darkGradient = colors.map((color) => color.dark).join(', ');\n return {\n light: lightGradient,\n dark: darkGradient,\n };\n }, [mediaAccentColors]);\n\n let toastRef = useRef(null);\n useEffect(() => {\n return () => {\n toastRef.current?.hideToast?.();\n };\n }, []);\n\n useLayoutEffect(() => {\n const currentColor = mediaAccentColors[currentIndex];\n let $meta;\n let metaColor;\n if (currentColor) {\n const theme = store.local.get('theme');\n if (theme) {\n const mediaColor = `rgb(${currentColor[theme].join(',')})`;\n console.log({ mediaColor });\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][data-theme-setting=\"manual\"]`,\n );\n if ($meta) {\n metaColor = $meta.content;\n $meta.content = mediaColor;\n }\n } else {\n const colorScheme = window.matchMedia('(prefers-color-scheme: dark)')\n .matches\n ? 'dark'\n : 'light';\n const mediaColor = `rgb(${currentColor[colorScheme].join(',')})`;\n console.log({ mediaColor });\n $meta = document.querySelector(\n `meta[name=\"theme-color\"][media*=\"${colorScheme}\"]`,\n );\n if ($meta) {\n metaColor = $meta.content;\n $meta.content = mediaColor;\n }\n }\n }\n return () => {\n // Reset meta color\n if ($meta && metaColor) {\n $meta.content = metaColor;\n }\n };\n }, [currentIndex, mediaAccentColors]);\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 '--accent-gradient-light': mediaAccentGradients?.light,\n '--accent-gradient-dark': mediaAccentGradients?.dark,\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.default.join(',')})`,\n '--accent-light-color': `rgb(${accentColor.light?.join(\n ',',\n )})`,\n '--accent-dark-color': `rgb(${accentColor.dark?.join(\n ',',\n )})`,\n '--accent-alpha-color': `rgba(${accentColor.default.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.focus();\n carouselRef.current.scrollTo({ left, behavior: 'smooth' });\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 »\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 } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/macro';\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 { _, t } = 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)} \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, t } from '@lingui/core/macro';\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\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 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 don’t 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 { useLingui } from '@lingui/react/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 { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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, t } from '@lingui/core/macro';\nimport { Plural, Select, Trans, useLingui } from '@lingui/react/macro';\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 annual_report: 'celebrate',\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 annual_report: ({ year }) => <Trans>Your {year} #Wrapstodon is here!</Trans>,\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 annualReport,\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 if (type === 'annual_report') {\n text = text({\n ...notification.annualReport,\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 {type === 'annual_report' && (\n <div>\n <Link to={`/annual_report/${annualReport?.year}`}>\n <Trans>View #Wrapstodon</Trans>\n </Link>\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 { Trans, useLingui } from '@lingui/react/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 const { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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 & 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 { Trans, useLingui } from '@lingui/react/macro';\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 { t } = useLingui();\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 const isMultiColumnMode =\n settings.shortcutsViewMode === 'multi-column' ||\n (!settings.shortcutsViewMode && settings.shortcutsColumnsMode);\n if (isMultiColumnMode) {\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(\n ['1', '2', '3', '4', '5', '6', '7', '8', '9'],\n (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 enabled: !isMultiColumnMode,\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 { Trans, useLingui } from '@lingui/react/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 const { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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 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 •\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 <ListMenu menuState={menuState} />\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\nfunction ListMenu({ menuState }) {\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, supportsLists]);\n\n return 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}\n\nexport default memo(NavMenu);\n","import { plural } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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 const { t } = useLingui();\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 { t } = useLingui();\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 { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/macro';\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 { i18n, t } = useLingui();\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 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 './annual-report.css';\n\nimport { Trans } from '@lingui/react/macro';\nimport { useEffect, useState } from 'preact/hooks';\nimport { useParams } from 'react-router-dom';\n\nimport Link from '../components/link';\nimport Loader from '../components/loader';\nimport NameText from '../components/name-text';\nimport Status from '../components/status';\nimport { api } from '../utils/api';\nimport useTitle from '../utils/useTitle';\n\nexport default function AnnualReport() {\n const params = useParams();\n const { year } = params;\n useTitle(year ? `Annual Report: ${year}` : 'Annual Report');\n const { masto, instance } = api();\n const [results, setResults] = useState(null);\n const [uiState, setUIState] = useState('default');\n\n useEffect(() => {\n if (year) {\n (async () => {\n setUIState('loading');\n const results = await masto.v1.annualReports.$select(year).fetch();\n console.log('REPORT', results);\n setResults(results);\n setUIState('default');\n })();\n }\n }, [year]);\n\n const { accounts, annualReports, statuses } = results || {};\n const report = annualReports?.find((report) => report.year == year)?.data;\n\n const datePlaceholder = new Date();\n\n return (\n <div id=\"annual-report-page\" class=\"deck-container\" tabIndex=\"-1\">\n <div class=\"report\">\n <h1>{year} #Wrapstodon</h1>\n {uiState === 'loading' && (\n <p>\n <Loader abrupt /> <Trans>Loading…</Trans>\n </p>\n )}\n {!!report && (\n <dl>\n {Object.entries(report).map(([key, value]) => (\n <>\n <dt>{key}</dt>\n <dd class={`report-${key}`}>\n {Array.isArray(value) ? (\n <table>\n <thead>\n <tr>\n {Object.entries(value[0]).map(([key, value]) => (\n <th\n class={\n key !== 'month' && typeof value === 'number'\n ? 'number'\n : ''\n }\n >\n {key}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {value.map((item) => (\n <tr>\n {Object.entries(item).map(([k, value]) => (\n <td\n class={\n k !== 'month' && typeof value === 'number'\n ? 'number'\n : ''\n }\n >\n {value &&\n /(accountId)/i.test(k) &&\n /^(mostRebloggedAccounts|commonlyInteractedWithAccounts)$/i.test(\n key,\n ) ? (\n <NameText\n account={accounts?.find(\n (a) => a.id === value,\n )}\n showAvatar\n />\n ) : k === 'month' ? (\n datePlaceholder.setMonth(value - 1) &&\n datePlaceholder.toLocaleString(undefined, {\n month: 'long',\n })\n ) : typeof value === 'number' ? (\n value.toLocaleString()\n ) : (\n value\n )}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n ) : typeof value === 'object' ? (\n /^(topStatuses)$/i.test(key) ? (\n <dl>\n {Object.entries(value).map(([k, value]) => (\n <>\n <dt>{k}</dt>\n <dd>\n {value && (\n <Link to={`/${instance}/s/${value}`}>\n <Status\n status={statuses?.find(\n (s) => s.id === value,\n )}\n size=\"s\"\n readOnly\n />\n </Link>\n )}\n </dd>\n </>\n ))}\n </dl>\n ) : (\n <table>\n <tbody>\n {Object.entries(value).map(([k, value]) => (\n <tr>\n <th>{k}</th>\n <td\n class={\n typeof value === 'number' ? 'number' : ''\n }\n >\n {value}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )\n ) : typeof value === 'string' ? (\n value\n ) : (\n // Last resort\n JSON.stringify(value, null, 2)\n )}\n </dd>\n </>\n ))}\n </dl>\n )}\n </div>\n <hr />\n <p style={{ textAlign: 'center' }}>\n <Link to=\"/\">\n <Trans>Go home</Trans>\n </Link>\n </p>\n </div>\n );\n}\n","import { useLingui } from '@lingui/react/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 const { t } = useLingui();\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, select } from '@lingui/core/macro';\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\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, _, t } = 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 st = showToast(\n t`Removing Catch-up ${pc.id}`,\n );\n await db.catchup.del(pc.id);\n st?.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 && <>· </>}\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 id=\"group.filter\">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 { t } = useLingui();\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 { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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 const { t } = useLingui();\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 { msg } from '@lingui/core/macro';\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\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 { t } = useLingui();\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 { _, t } = 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 { t } = useLingui();\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, Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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 { useLingui } from '@lingui/react/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 const { t } = useLingui();\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 } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/macro';\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 { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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 const { t } = useLingui();\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 { t } = useLingui();\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};\n\nconst GROUP_TYPES = ['favourite', 'reblog', 'follow'];\nconst groupable = (type) => GROUP_TYPES.includes(type);\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 (!groupable(type)) {\n newGroupNotifications1.push(gn);\n } else 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 (!groupable(type)) {\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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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 } from '@lingui/core/macro';\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\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 store from '../utils/store';\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 { _, t } = 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 [annualReportNotification, setAnnualReportNotification] =\n useState(null);\n useEffect(async () => {\n // Skip this if not in December\n const date = new Date();\n if (date.getMonth() !== 11) return;\n\n // Skip if doesn't support annual report\n if (!supports('@mastodon/annual-report')) return;\n\n let annualReportNotification = store.account.get(\n 'annualReportNotification',\n );\n if (annualReportNotification) {\n setAnnualReportNotification(annualReportNotification);\n return;\n }\n const notificationIterator = mastoFetchNotifications({\n types: ['annual_report'],\n });\n try {\n const notification = await notificationIterator.next();\n annualReportNotification = notification?.value?.notificationGroups?.[0];\n const annualReportYear = annualReportNotification?.annualReport?.year;\n // If same year, show the annual report\n if (annualReportYear == date.getFullYear()) {\n console.log(\n 'ANNUAL REPORT',\n annualReportYear,\n annualReportNotification,\n );\n setAnnualReportNotification(annualReportNotification);\n store.account.set('annualReportNotification', annualReportNotification);\n }\n } catch (e) {\n console.warn(e);\n }\n }, []);\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 {annualReportNotification && (\n <div class=\"shazam-container\">\n <div class=\"shazam-container-inner\">\n <Notification notification={annualReportNotification} />\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.` : <>…</>}\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 •{' '}\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 { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n};\n\nfunction Search({ columnMode, ...props }) {\n const { t } = useLingui();\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 typeResults = {\n statuses: statusResults,\n accounts: accountResults,\n hashtags: hashtagResults,\n };\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 // If first item is the same, it means API doesn't support offset\n // I know this is a very basic check, but it works for now\n if (results[type]?.[0]?.id === typeResults[type]?.[0]?.id) {\n setShowMore(false);\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 }\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 let timer;\n searchFormRef.current?.setValue?.(q || '');\n if (q) {\n loadResults(true);\n } else {\n timer = setTimeout(() => {\n searchFormRef.current?.focus?.();\n }, 150); // Right after focusDeck runs\n }\n return () => clearTimeout(timer);\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 itemsSelector = '.timeline > li > a, .hashtag-list > li > a';\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 [filterBarParent] = useAutoAnimate();\n\n return (\n <div\n id=\"search-page\"\n class=\"deck-container\"\n tabIndex=\"-1\"\n ref={(node) => {\n scrollableRef.current = node;\n jRef(node);\n kRef(node);\n }}\n >\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 { Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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 && <>· </>}\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 { useLingui } from '@lingui/react/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 isRTL from '../utils/is-rtl';\nimport states from '../utils/states';\nimport useTitle from '../utils/useTitle';\n\nconst scrollIntoViewOptions = {\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n};\n\nfunction Columns() {\n const { t } = useLingui();\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 const $column = document.querySelectorAll('#columns > *')[index];\n if ($column) {\n $column.focus();\n $column.scrollIntoView(scrollIntoViewOptions);\n }\n } catch (e) {\n console.error(e);\n }\n });\n\n useHotkeys(['[', ']'], (e, handler) => {\n const key = handler.keys[0];\n const currentFocusedColumn = document.activeElement.closest('#columns > *');\n\n const rtl = isRTL();\n const prevColKey = rtl ? ']' : '[';\n const nextColKey = rtl ? '[' : ']';\n let $column;\n\n if (key === prevColKey) {\n // If [, focus on left of focused column, else first column\n $column = currentFocusedColumn\n ? currentFocusedColumn.previousElementSibling\n : document.querySelectorAll('#columns > *')[0];\n } else if (key === nextColKey) {\n // If ], focus on right of focused column, else 2nd column\n $column = currentFocusedColumn\n ? currentFocusedColumn.nextElementSibling\n : document.querySelectorAll('#columns > *')[1];\n }\n if ($column) {\n $column.focus();\n $column.scrollIntoView(scrollIntoViewOptions);\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 onFocus={() => {\n // Get current focused column\n const currentFocusedColumn =\n document.activeElement.closest('#columns > *');\n if (currentFocusedColumn) {\n // Remove focus classes from all columns\n // Add focus class to current focused column\n document.querySelectorAll('#columns > *').forEach((column) => {\n column.classList.toggle('focus', column === currentFocusedColumn);\n });\n }\n }}\n >\n {components}\n </div>\n );\n}\n\nexport default Columns;\n","import './notifications-menu.css';\n\nimport { msg } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/macro';\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 { t } = useLingui();\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 { Trans } from '@lingui/react/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, Trans, useLingui } from '@lingui/react/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 const { t } = useLingui();\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 { Trans, useLingui } from '@lingui/react/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 const { t } = useLingui();\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. “mastodon.social”</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, Trans, useLingui } from '@lingui/react/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 { t } = useLingui();\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\n// oldest first\nfunction createdAtSort(a, b) {\n return new Date(b.created_at) - new Date(a.created_at);\n}\n\nfunction StatusThread({ id, closeLink = '/', instance: propInstance }) {\n const { t } = useLingui();\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 ancestors.sort(createdAtSort);\n descendants.sort(createdAtSort);\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(\n (s) =>\n s.id === status.inReplyToId &&\n s.account.id === heroStatus.account.id,\n ) &&\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 // sort hero author to top\n nestedDescendants.sort((a, b) => {\n const heroAccountID = heroStatus.account.id;\n if (a.account.id === heroAccountID && b.account.id !== heroAccountID)\n return -1;\n if (b.account.id === heroAccountID && a.account.id !== heroAccountID)\n return 1;\n return 0;\n });\n\n console.log({ ancestors, descendants, nestedDescendants });\n if (missingStatuses.size) {\n console.error('Missing statuses', [...missingStatuses]);\n }\n\n let descendantLevelsCount = 1;\n function expandReplies(_replies, level) {\n const nextLevel = level + 1;\n if (nextLevel > descendantLevelsCount) {\n descendantLevelsCount = level;\n }\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 level: nextLevel,\n replies: expandReplies(_r.__replies, nextLevel),\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 level: 1,\n replies: expandReplies(s.__replies, 1),\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 const heroLimit = ancestors.length || 0; // 0-indexed\n if (heroLimit >= limit) {\n setLimit(heroLimit + 1);\n }\n\n console.log({ allStatuses, descendantLevelsCount });\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 level,\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={level}\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 •{' '}\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 class=\"descendant descendant-more\">\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 { t } = useLingui();\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 // If not open, delay render replies\n const [renderReplies, setRenderReplies] = useState(openBefore || open);\n useEffect(() => {\n let timer;\n if (!openBefore && !open) {\n timer = setTimeout(() => setRenderReplies(true), 100);\n }\n return () => clearTimeout(timer);\n }, [openBefore, open]);\n\n const Container = open ? 'div' : 'details';\n const isDetails = Container === 'details';\n\n return (\n <Container\n ref={detailsRef}\n class=\"replies\"\n open={isDetails ? openBefore || open : undefined}\n onToggle={\n isDetails\n ? (e) => {\n const { open } = e.target;\n // use first reply as ID\n cachedRepliesToggle[replies[0].id] = open;\n }\n : undefined\n }\n style={{\n '--comments-level': level,\n }}\n data-comments-level={level}\n data-comments-level-overflow={level > 4}\n >\n {!open && (\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 ·{' '}\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 »\n </Link>\n )}\n </summary>\n )}\n {renderReplies && (\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={r.level}\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 )}\n </Container>\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 { Trans, useLingui } from '@lingui/react/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 const { t } = useLingui();\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 AnnualReport from './pages/annual-report';\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 () => {\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 },\n 15 * 60 * 1000,\n);\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 // Don't reset theme color if media modal is showing\n // Media modal will set its own theme color based on the media's color\n const showingMediaModal =\n document.getElementsByClassName('media-modal-container').length > 0;\n if (showingMediaModal) return;\n\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 <Route path=\"/annual_report/:year\" element={<AnnualReport />} />\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","t","_useLingui","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","_t","settings","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","i18n","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","_t2","permission","label","components","alert2","alert","focusDeck","timer","columns","getElementById","focusedColumn","focus","firstVisibleColumn","Array","from","column","getBoundingClientRect","modals","modal","modalFocusElement","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","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","text","blankCopy","follower","followersCount","shortenNumber","fetchFollowing","followingCount","excludeRelationshipAttrs","hideTime","_i18n","daysSinceLastPost","FAMILIAR_FOLLOWERS_LIMIT","sameInstance","setRelationshipUIState","relationship","setRelationship","following","showingReblogs","currentInfo","setCurrentInfo","notifying","followedBy","blocking","blockedBy","muting","mutingNotifications","requested","domainBlocking","endorsed","privateNote","acctWithInstance","setIsSelf","q","fetchRelationships","relationships","relationship2","showAddRemoveLists","setShowAddRemoveLists","showPrivateNoteModal","setLists","updateAccount","showTranslatedBio","showEditProfile","setShowPrivateNoteModal","lists2","currentAuthenticated","onMenuChange","setShowTranslatedBio","handle","niceAccountURL","newRelationship","counter","duration","error","setShowEditProfile","relationshipUIState","Loader","loading","TranslatedBioSheet","EditProfileSheet","AddRemoveListsSheet","luminence","alpha","urlObj","host","state","getHTMLText","fieldsText","Math","path","_t4","_t3","listsContainingAccount","setListsContainingAccount","reloadCount","listsContainingAccount2","setShowListAddEditModal","inList","showListAddEditModal","accountIds","result","PrivateNoteSheet","initialNote","_t5","textareaRef","_b","e2","trim","_t6","setAccount","source","fieldsAttributesRef","displayName2","note2","fieldsAttributesFields","field","fieldsAttributes","FieldsAttributesRow","hasValue","setHasValue","AccountHandleInfo","server","encodedAcct","dir","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","isArray","theAccount","j","_types","newAccounts","reloadGenericAccounts","post","Status","showStats","InView","MediaAltModal","forceTranslate","setForceTranslate","differentLanguage","localeMatch","l","supportsTTS","speak","whiteSpace","textWrap","TranslationBlock","sourceLanguage","classToType","obj","unpack","keyOrder","k","PI","TWOPI","PITHIRD","DEG2RAD","RAD2DEG","multiplyMatrices","A","B","B_cols","product","row","col","labConstants","compand","linear","sign","xyz2rgb","z","MtxAdaptMa","MtxAdaptMaI","MtxXYZ2RGB","RefWhiteRGB","Xn","Yn","Zn","LAB_CONSTANTS","As","Bs","Cs","Ad","Bd","Cd","X1","Y1","Z1","X2","Y2","Z2","oklab2rgb","L","rest","X","Y","Z","OKLab_to_XYZ","b_","OKLab","LMStoXYZ","OKLabtoLMS","LMSnl","gammaAdjustSRGB","companded","rgb2xyz","MtxRGB2XYZ","rgb2oklab","xyz","XYZ_to_OKLab","XYZ","XYZtoLMS","LMStoOKLab","LMS","sin","cos","lch2lab","h","oklch2rgb","sqrt","atan2","round","lab2lch","rgb2oklch","MediaModal","statusID","carouselRef","currentIndex","setCurrentIndex","carouselFocusItem","useLayoutEffect","scrollIntoView","prevStatusID","scrollLeft","clientWidth","differentStatusID","scrollTo","isRTL","behavior","showControls","setShowControls","handleSwipe","addEventListener","removeEventListener","handleScroll","abs","passive","mediaOkColors","media","blurhash","averageColor","getBlurHashAverageColor","mediaAccentColors","okColor","light","dark","default","mediaAccentGradients","range","join","lightGradient","darkGradient","toastRef","hideToast","currentColor","$meta","metaColor","mediaColor","colorScheme","content","accentColor","description","showMediaAlt","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","required","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","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","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","s","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","contains","showShortcutsSettings","showEmbedModal","showReportModal","FollowRequestButtons","requestState","setRequestState","hasRelationship","followRequests","authorize","Error","NOTIFICATION_ICONS","severed_relationships","moderation_warning","emoji_reaction","annual_report","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","year","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","annualReport","_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","isMultiColumnMode","shortcutsColumnsMode","menuRef","hasLists","formattedShortcuts","pin","handler","closeMenu","updatesButton","instanceRef","overflow","viewScroll","menuClassName","position","SubMenu2","groupBoosts","newValues","boostStash","serialBoosts","item","boostStashID","items","half","floor","slice","dedupeBoosts","boostedStatusIDs","filteredItems","boosterID","groupContext","contexts","contextIndex","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","acc","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","Media","showSpoilerMedia","NavMenu","showFollowing","bindLongPress","useLongPress","threshold","detect","cancelOnMovement","buttonRef","menuState","setMenuState","boundingBoxPadding","safeBoundingBoxPadding","mutesIterator","fetchMutes","mutes","blocksIterator","fetchBlocks","blocks","buttonClickTS","squircle","ControlledMenu","anchorRef","containerProps","zIndex","portal","body","unmountOnClose","appVersion","commitHash","__COMMIT_HASH__","confirm","ListMenu","supportsLists","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","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","startButtonRef","oldID","toString","setRender","render","endButtonRef","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","monthYear","fetchAccountPromiseRef","useTitle","fetchPromise","cachedAccount","featuredTags","filterBarRef","TimelineStart","month2","date","validity","MonthPicker","active","allowSwitch","offsetLeft","fetchAccountStatuses","masto2","monthFieldRef","yearFieldRef","checkValidity","minYear","minMonth","maxYear","maxMonth","AnnualReport","setResults","annualReports","report2","datePlaceholder","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","st","yes","del","setSelectedFilterCategory","setSortBy","formatRange","setGroupBy","transform","imageDescription","publishedAt","labAverageColor","filterCounts","author","paddingInline","showSeparator","IntersectionPostLineItem","isFollowedTags","PostLine","isReplyTo","show","setShow","IntersectionObserver","unobserve","MEDIA_DENSITY","CARD_DENSITY","pollContent","cur","htmlContentLength","PostPeek","density","_thread","readingExpandSpoilers","showMedia","showPostContent","isThread","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","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","GROUP_TYPES","groupable","fixNotifications","massageNotifications2","notificationGroups","sampleAccountIds","statusId","groupNotifications2","groupNotifications","newGroupNotifications","gn","latestPageNotificationAt","mostRecentNotificationId","newGroupNotifications1","notificationsMap","virtualType","mappedNotification","ma","mappedAccount","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","setAnnualReportNotification","annualReportNotification2","annualReportYear","getFullYear","statusLink","today","todaySubHeading","forceOpts","setShowNotificationsSettings","announcement","notificationsPolicy","open","onToggle","request","pendingRequestsCount","NotificationRequestModalButton","NotificationRequestButtons","annualReportNotification","notificationDay","differentDay","toDateString","subHeading","newPolicy","AnnouncementBlock","contact","contactAccount","startsAt","endsAt","published","allDay","reactions","publishedAtDate","read","publishedDateText","updatedAtText","reaction","me","fetchNotficationsByAccount","showModal","setShowModal","notifs","setNotifications","hasRequestState","Public","isLocal","publicIterator","fetchPublic","remote","prompt","SHORT_LIMIT","Search","offsetRef","statusResults","setStatusResults","accountResults","setAccountResults","hashtagResults","setHashtagResults","typeResults","setTypeResultsFunc","loadResults","_c","_d","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","$column","currentFocusedColumn","prevColKey","nextColKey","Home","NotificationsLink","notificationLinkRef","NotificationsMenu","NOTIFICATIONS_DISPLAY_LIMIT","hasFollowRequests","setHasFollowRequests","statusPostRegexes","getInstanceStatusObject","regex","match","getInstanceStatusURL","HttpRoute","statusObject","statusURL","Lists","instancesListURL","dec2hex","dec","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","createdAtSort","StatusThread","navigation","translate","setStatuses","heroStatusRef","totalDescendants","scrollOffsets","lastInitContextTS","reloadHero","heroTimer","cachedStatuses","reallyCachedStatuses","heroFetch","pRetry","contextFetch","hasStatus","heroStatus2","_replies","level","nextLevel","descendantLevelsCount","expandReplies","_r","weight","descendants","ancestors2","ancestors","missingStatuses","ancestorsIsThread","nestedDescendants","__replies","heroAccountID","ancestor","threadifyStatus","offsetTop","heroLimit","setLimit","showRefresh","setShowRefresh","allStatuses","scrollPosition","initContext","interval","newScrollOffsets","contextURL","newScrollTop","statusWeightCache","heroContentText","apiCache","heroDisplayName","postInstance","hasDescendants","div","innerHTML","activeStatusRect","activeStatus","postSameInstance","nextStatus","allStatusLinks","activeStatusIndex","some","heroPointer","topmostStatusLink","heroInView","prevStatus","statusLinkRect","details","initialPageState","handleMediaClick","handleStatusLinkClick","descendant","isHero","requestAnimationFrame","setHeroInView","setReachTopPost","isLinkable","SubComments","enableTranslate","onStatusLinkClick","showActionsBar","prevLocationIsStatusPage","prevEntry","hasParentThread","openAll","getIDs","statusesList","renderStatus","spoilerButton","viewMode","moreStatusesKeys","onAnimationEnd","back","reachTopPost","arr","setViewMode","button","full","buttons","accWeight","parentLink","diveDeep","replies2","replies3","totalComments","sameCount","totalWeight","calcStatusWeight","openBefore","detailsRef","renderReplies","Container","isDetails","shortReply","open2","dataset","setRenderReplies","MEDIA_VIRTUAL_LENGTH","CARD_VIRTUAL_LENGTH","cachedWeight","mediaLength","pollLength","POLL_VIRTUAL_LENGTH","cardLength","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","setInterval","unfurledLinks","postInNotifications","$post","unfurled","keysCount","ICONS","nonIdleEvents","setIdle","debouncedSetIdle","onNonIdle","isIOS","tempColor","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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