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AAe,EAAI+B,EACZ,EACEssB,GACC,EACFxhC,CAEFmhC,YAAiB,EACnB,GAAAnlC,EAAA,SAAAW,EAC4BuY,SAErB,IAAC5P,CAAgB3I,iBAAyB,MAAA0H,EAAYkzB,GAAAhzB,CAAA,EAAA0G,EAAExB,GAAAzN,EAAAW,CAAA,EAAA8kC,EAC3Dp9B,EAAA,aAAA4G,CAAA,EAACy2B,EACFD,GAAA,YAAAA,EAAA,QAAAj8B,EAAA0F,EAAAy2B,MAAA,UAAAC,KAAA,MAAAp8B,EAAA,OAAA0F,GAAA,GACJw2B,GAAA,MAAAA,EAAA,QAGN,EAAAG,EAAA,GAIHxD,SAAgBhf,IAAK7Z,GAAGxJ,MAAIW,iDAAkB,yBAAQ,+BACtD,SAAQA,MAAU,SAAA6I,EAAA,GAChBnB,oBACA4G,SACAw2B,SAAoBh6B,EACpBi6B,kBAAeD,EAIrB,CAAKC,CAAsB,EAAAl8B,EAAA,SAAAA,EAAA,GAC3B,CAAe,GAERk8B,QAAkBl8B,EC14E3B,IAAAqkB,GAAA,CAAO;;;;;;;;;;;;;;;;;;;;;;ukPCAP,IAAAA,GAAA,CAASmJ,4BAAqC","names":["getAccount","id","accounts","store","local","getJSON","find","a","info","getAccountByAccessToken","accessToken","getAccountByInstance","instance","instanceURL","getCurrentAccount","window","__IGNORE_GET_ACCOUNT_ERROR__","currentAccount","account","getCurrentAccountNS","saveAccount","acc","updateAccount","accountInfo","displayName","currentInstance","getCurrentInstance","instances","e","location","getInstanceConfiguration","configuration","maxMediaAttachments","maxTootChars","pleroma","pollLimits","statuses","polls","maxCharactersPerOption","maxExpiration","getCurrentInstanceConfiguration","get","key","localStorage","getItem","console","JSON","value","set","setJSON","warn","session","sessionStorage","setItem","data","del","DEFAULT_INSTANCE","apis","accountApis","__ACCOUNT_APIS__","currentAccountApi","initClient","test","replace","toLowerCase","url","client","masto","createRestAPIClient","timeout","initInstance","uri","streamingApi","urls","domain","streaming","streamClient","createStreamingAPIClient","implementation","initAccount","vapidKey","mastoAccount","initPreferences","preferences","accountID","authenticated","_b","_c","instanceAccount","_e","_showToast","showToast","props","text","onClick","delay","rest","toast","Toastify","className","destination","gravity","position","setTimeout","isMastodonLinkMaybe","pathname","hash","URL","_moize","moize","mem","fn","opts","maxSize","isDeepEqual","pmem","isPromise","rateLimit","interval","queue","isRunning","executeNext","length","shift","args","callFn","apply","push","throttle","pThrottle","limit","denylistDomains","failedUnfurls","_unfurlMastodonLink","snapStates","snapshot","states","RegExp","unfurledLinks","Promise","resolve","debug","remoteInstanceFetch","theURL","urlAfterHash","urlObj","hostname","statusRegex","path","statusMatch","masto2","status","mastoSearchFetch","q","type","results","then","handleFulfill","result","selfURL","instance2","saveStatus","reject","handleCatch","finalPromise","unfurlMastodonLink","proxy","appVersion","prevLocation","currentLocation","statusThreadNumber","home","homeNew","homeLast","homeLastFetchTime","notifications","notificationsLast","notificationsNew","notificationsShowNew","notificationsLastFetchTime","reloadStatusPage","reloadGenericAccounts","counter","spoilers","spoilersMedia","scrollPositions","statusQuotes","statusFollowedTags","routeNotification","showCompose","showSettings","showAccount","showAccounts","showDrafts","showMediaModal","showShortcutsSettings","showKeyboardShortcutsHelp","showGenericAccounts","showMediaAlt","shortcuts","settings","autoRefresh","shortcutsViewMode","shortcutsColumnsMode","boostsCarousel","contentTranslation","contentTranslationTargetLanguage","contentTranslationHideLanguages","contentTranslationAutoInline","mediaAltGenerator","cloakMode","states$1","initStates","subscribeKey","v","subscribe","changes","prevValue","statusKey","getStatus","statusID","skipThreading","skipUnfurling","override","oldStatus","_pinned","threadifyStatus","unfurlStatus","_threadifyStatus","propInstance","api","traverse","index","fetchIndex","inReplyToAccountId","inReplyToId","prevStatus","r","fetchStatus","fauxDiv","content","document","sKey","i","splice","useInterval","deps","immediate","savedCallback","useRef","useEffect","current","setInterval","tick","clearInterval","openCompose","width","screenWidth","height","screenHeight","screen","left","Math","max","top","min","winUID","uid","random","newWin","open","__COMPOSE__","alert","SIZES","s","m","l","xl","xxl","ICONS","x","__vitePreload","heart","bookmark","check-circle","x-circle","transfer","rocket","arrow-left","arrow-right","arrow-up","arrow-down","earth","lock","unlock","eye-close","eye-open","message","comment","comment2","notification","follow","follow-add","poll","pencil","quill","at","attachment","upload","gear","more","external","popout","popin","plus","chevron-left","chevron-right","chevron-down","reply","thread","group","bot","menu","list","search","hashtag","shortcut","user","following","pin","bus","link","history","share","sparkles","sparkles2","exit","translate","play","trash","mute","unmute","block","unblock","flag","time","refresh","emoji2","filter","chart","react","layout4","layout5","announce","round","arrow-up-circle","arrow-down-circle","clipboard","account-edit","account-warning","keyboard","cloud","month","media","speak","building","ICONDATA","SVGICon","size","body","rotate","flip","_jsx","viewBox","dangerouslySetInnerHTML","__html","style","transform","isShallowEqual","Object","keys","Icon","icon","alt","title","class","iconSize","iconBlock","Array","iconData","setIconData","useState","currentIcon","iconB","useCloseWatcher","watcher","CloseWatcher","addEventListener","destroy","useCloseWatcher$1","$modalContainer","getElementById","Modal","children","onClose","modalRef","timer","focusElement","querySelector","focus","clearTimeout","supportsCloseWatcher","escRef","useHotkeys","enabled","keydown","keyup","ref","node","target","currentTarget","tabIndex","onFocus","createPortal","Loader","abrupt","hidden","xxxl","alphaCache","canvas","OffscreenCanvas","createElement","ctx","getContext","willReadFrequently","Avatar","squircle","avatarRef","isMissing","src","loading","decoding","crossOrigin","undefined","onError","onLoad","dataset","loaded","queueMicrotask","drawImage","allPixels","getImageData","hasAlpha","pixel","classList","add","clearRect","Link","forwardRef","routerLocation","useLocation","trim","to","restProps","includes","parsedHash","origin","searchParams","searchParamsStr","from","entries","map","encodeURIComponent","join","isActive","decodeURIComponent","href","parentNode","closest","stopPropagation","root","documentElement","getComputedStyle","defaultBoundingBoxPadding","safeAreaInsets","getSafeAreaInsets","safeAreaInsetTop","getPropertyValue","safeAreaInsetRight","safeAreaInsetBottom","safeAreaInsetLeft","parseInt","requestAnimationFrame","safeBoundingBoxPadding","paddings","CSS","supports","passive","Menu2","containerProps","instanceRef","_instanceRef","useWindowSize","Menu","boundingBoxPadding","repositionFlag","unmountOnClose","closeMenu","MenuConfirm","subMenu","confirm","confirmLabel","menuItemClassName","menuFooter","MenuItem","cloneElement","Parent","SubMenu","menuRef","_jsxs","openTrigger","direction","overflow","gap","menuClassName","menuButton","label","itemProps","onPointerMove","pointerType","openMenu","onPointerLeave","EmojiText","emojis","indexOf","regex","shortcode","elements","split","word","emoji","staticUrl","srcset","nameCollator","Intl","Collator","sensitivity","NameText","showAvatar","showAcct","short","acct","avatar","avatarStatic","username","_","acct1","acct2","match","trimmedUsername","trimmedDisplayName","shortenedDisplayName","shortenedAlphaNumericDisplayName","compare","preventDefault","_Fragment","memo","dayjs","extend","dayjsTwitter","localizedFormat","relativeTime","dtf","DateTimeFormat","RelativeTime","datetime","format","date","dateStr","now","diff","year","twitter","toDate","fromNow","toISOString","_localeMatch","localeMatch","locales","resolvedOptions","locale","navigator","languages","localeTargetLanguages","translationTargetLanguages","code","getTranslateTargetLanguage","fromSettings","localeCode2Text","DisplayNames","of","emojifyText","forEach","whitelistLinkClasses","_enhanceContent","postEnhanceDOM","enhancedContent","dom","innerHTML","hasLink","hasCodeBlock","querySelectorAll","setAttribute","c","remove","textContent","links","usernames","innerText","hasChildren","some","u","d","slice","textNodes","extractTextNodes","html","nodeValue","replaceWith","childNodes","p","pre","br","nextParagraphs","currentBlock","nextElementSibling","next","tagName","codeText","replaceAll","rejectFilter","prevIndex","hashtagStuffedParagraphs","hashtagCount","nodeType","Node","TEXT_NODE","linkText","startsWith","enhanceContent","defaultRejectFilter","defaultRejectFilterMap","fromEntries","nodeName","rejectFilterMap","assign","reduce","cur","walk","createTreeWalker","NodeFilter","SHOW_TEXT","acceptNode","FILTER_REJECT","FILTER_ACCEPT","nextNode","div","getHTMLText","handleContentLinks","mentions","previewMode","statusURL","metaKey","ctrlKey","shiftKey","altKey","which","prevText","previousSibling","textBeforeLinkIsAt","endsWith","textStartsWithAt","contains","targetText","getAttribute","mention","textBeforeLinkIsHash","tag","_DateTimeFormat","dateYear","hideTime","formatOpts","currentYear","Date","getFullYear","day","hour","minute","niceDateTime","dtfOpts","NumberFormat","shortenNumber","notation","AccountBlock","skeleton","avatarSize","useAvatarStatic","internal","showActivity","showStats","accountInstance","hideDisplayName","relationship","excludeRelationshipAttrs","statusesCount","lastStatusAt","fields","note","followersCount","verifiedField","f","verifiedAt","excludedRelationship","hasRelationship","followedBy","requested","supportsCache","feature","version","range","features","satisfies","includePrerelease","loose","define_import_meta_env_default","draftsStore","createStore","drafts","val","getMany","delMany","clear","db","visibilityIconsMap","public","unlisted","private","direct","Poll","lang","readOnly","votePoll","uiState","setUIState","expired","expiresAt","multiple","options","ownVotes","voted","votersCount","votesCount","expiresAtDate","pollVotesCount","roundPrecision","showResults","setShowResults","optionsHaveVoteCounts","every","o","dir","option","optionVotesCount","percentage","toFixed","isLeading","disabled","onSubmit","form","formData","FormData","choices","name","marginLeft","FilterContext","createContext","_isFiltered","filtered","filterContext","appliedFilters","hasContext","context","isHidden","filterAction","action","filterTitles","titles","titlesStr","isFiltered","filteredItem","item","currentAccountID","isSelf","filterState","filteredItems","items","htmlContentLength","el","supportsTTS","speechSynthesis","speaking","cancel","utterance","SpeechSynthesisUtterance","statusPeek","spoilerText","mediaAttachments","image","gifv","video","audio","unknown","useTruncated","onResize","useThrottledCallback","scrollHeight","truncated","_height","maxHeight","computedHeight","toggle","useResizeObserver","box","isSafari","userAgent","dataAltLabel","AltBadge","MEDIA_CAPTION_LIMIT","isMediaCaptionLong","caption","Media","showOriginal","autoAnimate","showCaption","altIndex","blurhash","description","meta","previewRemoteUrl","previewUrl","remoteUrl","original","small","mediaURL","remoteMediaURL","orientation","rgbAverageColor","getBlurHashAverageColor","videoRef","focalPosition","y","mediaRef","onUpdate","useCallback","scale","make3dTransformValue","removeProperty","setProperty","touchAction","pinchZoomEnabled","setPinchZoomEnabled","quickPinchZoomProps","draggableUnZoomed","inertiaFriction","doubleTapZoomOutOnMaxScale","useMemo","isVideoMaybe","isImage","parentRef","imageSmallerThanParent","setImageSmallerThanParent","useLayoutEffect","offsetWidth","offsetHeight","smaller","maxAspectHeight","innerHeight","averageColorStyle","mediaStyles","aspectRatio","longDesc","showInlineDesc","Figure","Fragment","display","fetch","mode","backgroundImage","backgroundSize","QuickPinchZoom","objectPosition","shortDuration","duration","isGIF","loopable","formattedDuration","formatDuration","hoverAnimate","autoGIFAnimate","showProgress","videoHTML","pause","onMouseEnter","onMouseLeave","onBlur","poster","preload","playsinline","loop","muted","onTimeUpdate","container","currentTime","controls","autoplay","MenuLink","FocusableItem","detail","SHOW_COMMENT_COUNT_LIMIT","INLINE_TRANSLATE_LIMIT","fetchAccount","v1","$select","memFetchAccount","visibilityText","isIOS","ontouchstart","REACTIONS_LIMIT","getPollText","getPostText","Status","contentTextWeight","enableCommentHint","withinContext","enableTranslate","forceTranslate","_forceTranslate","onMediaClick","quoted","onStatusLinkClick","showFollowedTags","sameInstance","useSnapshot","accountId","accountURL","accountEmojis","repliesCount","reblogged","reblogsCount","favourited","favouritesCount","bookmarked","sensitive","visibility","language","editedAt","card","createdAt","reblog","tags","_deleted","useContext","filterInfo","debugHover","FilteredStatus","editedAtDate","inReplyToAccountRef","createdAtDate","setInReplyToAccount","inReplyToAccount","account2","catch","mentionSelf","readingExpandSpoilers","showSpoiler","readingExpandMedia","prefs","showSpoilerMedia","setForceTranslate","targetLanguage","contentLength","inlineTranslate","isSizeLarge","showEdited","setShowEdited","spoilerContentRef","statusRef","contentRef","mediaContainerRef","readMoreText","textWeight","editedDateText","_a","mediaNoDesc","replyToStatus","boostStatus","unauthInteractionErrorMessage","confirmText","yes","newStatus","favouriteStatus","differentLanguage","fetchBoostedLikedByAccounts","firstLoad","favouriteIterator","reblogResults","reblogIterator","favouriteResults","_types","done","MenuHeader","StatusMenuItems","createdDateText","MenuDivider","fetchAccounts","showReactions","replyStatus","postText","nicePostURL","editStatus","cachedStatus","setIsContextMenuOpen","contextMenuProps","setContextMenuProps","showContextMenu","bindLongPressContext","useLongPress","clientX","clientY","isContextMenuOpen","hotkeysEnabled","fRef","rRef","dRef","confirmBoostStatus","bRef","activeStatus","spoilerButton","spoilerMediaButton","canBoost","xRef","showMultipleMediaCaptions","displayedMediaAttachments","attachments","indices","showCommentHint","isThread","showCommentCount","nodeRef","containsQuestion","contextMenuRef","portal","QuoteStatuses","newPoll","pollResponse","TranslationBlock","mini","captionChildren","StatusButton","checked","bookmarkStatus","count","EditedAtModal","selfReferential","providerName","providerUrl","authorName","authorUrl","imageDescription","embedUrl","publishedAt","hasText","isLandscape","cardStatusURL","blurhashImage","setCardStatusURL","imageData","w","putImageData","videoID","fetchStatusHistory","editHistory","setEditHistory","editHistory2","setIconAlt","buttonTitle","iconAlt","host","minutes","restPath","seconds","toString","filterTitleStr","statusPeekText","bindLongPressPeek","isReblog","actualStatusID","isFollowedTags","setShowPeek","threshold","captureEvent","ssKey","showPeek","statusPeekRef","quotes","uniqueQuotes","arr","q2","level"],"sources":["../../src/utils/store-utils.js","../../src/utils/store.js","../../src/utils/api.js","../../src/utils/show-toast.js","../../src/utils/isMastodonLinkMaybe.jsx","../../src/utils/mem.js","../../src/utils/pmem.js","../../src/utils/ratelimit.js","../../src/utils/unfurl-link.jsx","../../src/utils/states.js","../../src/utils/useInterval.js","../../src/utils/open-compose.js","../../src/components/icon.jsx","../../src/utils/useCloseWatcher.js","../../src/components/modal.jsx","../../src/components/loader.jsx","../../src/components/avatar.jsx","../../src/components/link.jsx","../../src/utils/safe-bounding-box-padding.js","../../src/components/menu2.jsx","../../src/components/menu-confirm.jsx","../../src/components/emoji-text.jsx","../../src/components/name-text.jsx","../../src/components/relative-time.jsx","../../src/utils/locale-match.jsx","../../src/utils/get-translate-target-language.jsx","../../src/utils/localeCode2Text.jsx","../../src/utils/emojify-text.js","../../src/utils/enhance-content.js","../../src/utils/getHTMLText.jsx","../../src/utils/handle-content-links.js","../../src/utils/nice-date-time.js","../../src/utils/shorten-number.jsx","../../src/components/account-block.jsx","../../src/utils/supports.js","../../src/components/translation-block.jsx","../../src/utils/db.js","../../src/utils/visibility-icons-map.js","../../src/components/poll.jsx","../../src/utils/filter-context.js","../../src/utils/filters.jsx","../../src/utils/html-content-length.js","../../src/utils/speech.js","../../src/utils/status-peek.jsx","../../src/utils/useTruncated.js","../../src/components/media.jsx","../../src/components/menu-link.jsx","../../src/components/status.jsx","../../src/components/compose.jsx","../../src/utils/useTitle.js"],"sourcesContent":["import store from './store';\n\nexport function getAccount(id) {\n const accounts = store.local.getJSON('accounts') || [];\n return accounts.find((a) => a.info.id === id) || accounts[0];\n}\n\nexport function getAccountByAccessToken(accessToken) {\n const accounts = store.local.getJSON('accounts') || [];\n return accounts.find((a) => a.accessToken === accessToken);\n}\n\nexport function getAccountByInstance(instance) {\n const accounts = store.local.getJSON('accounts') || [];\n return accounts.find((a) => a.instanceURL === instance);\n}\n\nexport function getCurrentAccount() {\n if (!window.__IGNORE_GET_ACCOUNT_ERROR__) {\n // Track down getCurrentAccount() calls before account-based states are initialized\n console.error('getCurrentAccount() called before states are initialized');\n if (import.meta.env.DEV) console.trace();\n }\n const currentAccount = store.session.get('currentAccount');\n const account = getAccount(currentAccount);\n return account;\n}\n\nexport function getCurrentAccountNS() {\n const account = getCurrentAccount();\n const {\n instanceURL,\n info: { id },\n } = account;\n return `${id}@${instanceURL}`;\n}\n\nexport function saveAccount(account) {\n const accounts = store.local.getJSON('accounts') || [];\n const acc = accounts.find((a) => a.info.id === account.info.id);\n if (acc) {\n acc.info = account.info;\n acc.instanceURL = account.instanceURL;\n acc.accessToken = account.accessToken;\n acc.vapidKey = account.vapidKey;\n } else {\n accounts.push(account);\n }\n store.local.setJSON('accounts', accounts);\n store.session.set('currentAccount', account.info.id);\n}\n\nexport function updateAccount(accountInfo) {\n // Only update if displayName or avatar or avatar_static is different\n const accounts = store.local.getJSON('accounts') || [];\n const acc = accounts.find((a) => a.info.id === accountInfo.id);\n if (acc) {\n if (\n acc.info.displayName !== accountInfo.displayName ||\n acc.info.avatar !== accountInfo.avatar ||\n acc.info.avatar_static !== accountInfo.avatar_static\n ) {\n acc.info = {\n ...acc.info,\n ...accountInfo,\n };\n store.local.setJSON('accounts', accounts);\n }\n }\n}\n\nlet currentInstance = null;\nexport function getCurrentInstance() {\n if (currentInstance) return currentInstance;\n try {\n const account = getCurrentAccount();\n const instances = store.local.getJSON('instances');\n const instance = account.instanceURL.toLowerCase();\n return (currentInstance = instances[instance]);\n } catch (e) {\n console.error(e);\n alert(`Failed to load instance configuration. Please try again.\\n\\n${e}`);\n // Temporary fix for corrupted data\n store.local.del('instances');\n location.reload();\n return {};\n }\n}\n\n// Massage these instance configurations to match the Mastodon API\n// - Pleroma\nfunction getInstanceConfiguration(instance) {\n const {\n configuration,\n maxMediaAttachments,\n maxTootChars,\n pleroma,\n pollLimits,\n } = instance;\n\n const statuses = configuration?.statuses || {};\n if (maxMediaAttachments) {\n statuses.maxMediaAttachments ??= maxMediaAttachments;\n }\n if (maxTootChars) {\n statuses.maxCharacters ??= maxTootChars;\n }\n\n const polls = configuration?.polls || {};\n if (pollLimits) {\n polls.maxCharactersPerOption ??= pollLimits.maxOptionChars;\n polls.maxExpiration ??= pollLimits.maxExpiration;\n polls.maxOptions ??= pollLimits.maxOptions;\n polls.minExpiration ??= pollLimits.minExpiration;\n }\n\n return {\n ...configuration,\n statuses,\n polls,\n };\n}\n\nexport function getCurrentInstanceConfiguration() {\n const instance = getCurrentInstance();\n return getInstanceConfiguration(instance);\n}\n","import { getCurrentAccountNS } from './store-utils';\n\nconst local = {\n get: (key) => {\n try {\n return localStorage.getItem(key);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n getJSON: (key) => {\n try {\n return JSON.parse(local.get(key));\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n set: (key, value) => {\n try {\n return localStorage.setItem(key, value);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n setJSON: (key, value) => {\n try {\n return local.set(key, JSON.stringify(value));\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n del: (key) => {\n try {\n return localStorage.removeItem(key);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n};\n\nconst session = {\n get: (key) => {\n try {\n return sessionStorage.getItem(key);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n getJSON: (key) => {\n try {\n return JSON.parse(session.get(key));\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n set: (key, value) => {\n try {\n return sessionStorage.setItem(key, value);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n setJSON: (key, value) => {\n try {\n return session.set(key, JSON.stringify(value));\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n del: (key) => {\n try {\n return sessionStorage.removeItem(key);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n};\n\n// Store with account namespace (id@domain.tld) <- uses id, not username\nconst account = {\n get: (key) => {\n try {\n return local.getJSON(key)[getCurrentAccountNS()];\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n set: (key, value) => {\n try {\n const data = local.getJSON(key) || {};\n data[getCurrentAccountNS()] = value;\n return local.setJSON(key, data);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n del: (key) => {\n try {\n const data = local.getJSON(key) || {};\n delete data[getCurrentAccountNS()];\n return local.setJSON(key, data);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n};\n\nexport default { local, session, account };\n","import { createRestAPIClient, createStreamingAPIClient } from 'masto';\n\nimport store from './store';\nimport {\n getAccount,\n getAccountByAccessToken,\n getAccountByInstance,\n getCurrentAccount,\n saveAccount,\n} from './store-utils';\n\n// Default *fallback* instance\nconst DEFAULT_INSTANCE = 'mastodon.social';\n\n// Per-instance masto instance\n// Useful when only one account is logged in\n// I'm not sure if I'll ever allow multiple logged-in accounts but oh well...\n// E.g. apis['mastodon.social']\nconst apis = {};\n\n// Per-account masto instance\n// Note: There can be many accounts per instance\n// Useful when multiple accounts are logged in or when certain actions require a specific account\n// Just in case if I need this one day.\n// E.g. accountApis['mastodon.social']['ACCESS_TOKEN']\nconst accountApis = {};\nwindow.__ACCOUNT_APIS__ = accountApis;\n\n// Current account masto instance\nlet currentAccountApi;\n\nexport function initClient({ instance, accessToken }) {\n if (/^https?:\\/\\//.test(instance)) {\n instance = instance\n .replace(/^https?:\\/\\//, '')\n .replace(/\\/+$/, '')\n .toLowerCase();\n }\n const url = instance ? `https://${instance}` : `https://${DEFAULT_INSTANCE}`;\n\n const masto = createRestAPIClient({\n url,\n accessToken, // Can be null\n timeout: 30_000, // Unfortunatly this is global instead of per-request\n });\n\n const client = {\n masto,\n instance,\n accessToken,\n };\n apis[instance] = client;\n if (!accountApis[instance]) accountApis[instance] = {};\n if (accessToken) accountApis[instance][accessToken] = client;\n\n return client;\n}\n\n// Get the instance information\n// The config is needed for composing\nexport async function initInstance(client, instance) {\n console.log('INIT INSTANCE', client, instance);\n const { masto, accessToken } = client;\n // Request v2, fallback to v1 if fail\n let info;\n try {\n info = await masto.v2.instance.fetch();\n } catch (e) {}\n if (!info) {\n try {\n info = await masto.v1.instance.fetch();\n } catch (e) {}\n }\n if (!info) return;\n console.log(info);\n const {\n // v1\n uri,\n urls: { streamingApi } = {},\n // v2\n domain,\n configuration: { urls: { streaming } = {} } = {},\n } = info;\n const instances = store.local.getJSON('instances') || {};\n if (uri || domain) {\n instances[\n (domain || uri)\n .replace(/^https?:\\/\\//, '')\n .replace(/\\/+$/, '')\n .toLowerCase()\n ] = info;\n }\n if (instance) {\n instances[instance.toLowerCase()] = info;\n }\n store.local.setJSON('instances', instances);\n // This is a weird place to put this but here's updating the masto instance with the streaming API URL set in the configuration\n // Reason: Streaming WebSocket URL may change, unlike the standard API REST URLs\n const supportsWebSocket = 'WebSocket' in window;\n if (supportsWebSocket && (streamingApi || streaming)) {\n console.log('🎏 Streaming API URL:', streaming || streamingApi);\n // masto.config.props.streamingApiUrl = streaming || streamingApi;\n // Legacy masto.ws\n const streamClient = createStreamingAPIClient({\n streamingApiUrl: streaming || streamingApi,\n accessToken,\n implementation: WebSocket,\n });\n client.streaming = streamClient;\n // masto.ws = streamClient;\n console.log('🎏 Streaming API client:', client);\n }\n}\n\n// Get the account information and store it\nexport async function initAccount(client, instance, accessToken, vapidKey) {\n const { masto } = client;\n const mastoAccount = await masto.v1.accounts.verifyCredentials();\n\n console.log('CURRENTACCOUNT SET', mastoAccount.id);\n store.session.set('currentAccount', mastoAccount.id);\n\n saveAccount({\n info: mastoAccount,\n instanceURL: instance.toLowerCase(),\n accessToken,\n vapidKey,\n });\n}\n\n// Get preferences\nexport async function initPreferences(client) {\n try {\n const { masto } = client;\n const preferences = await masto.v1.preferences.fetch();\n store.account.set('preferences', preferences);\n } catch (e) {\n // silently fail\n console.error(e);\n }\n}\n\n// Get the masto instance\n// If accountID is provided, get the masto instance for that account\nexport function api({ instance, accessToken, accountID, account } = {}) {\n // Always lowercase and trim the instance\n if (instance) {\n instance = instance.toLowerCase().trim();\n }\n\n // If instance and accessToken are provided, get the masto instance for that account\n if (instance && accessToken) {\n const client =\n accountApis[instance]?.[accessToken] ||\n initClient({ instance, accessToken });\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: true,\n instance,\n };\n }\n\n if (accessToken) {\n // If only accessToken is provided, get the masto instance for that accessToken\n console.log('X 1', accountApis);\n for (const instance in accountApis) {\n if (accountApis[instance][accessToken]) {\n console.log('X 2', accountApis, instance, accessToken);\n const client = accountApis[instance][accessToken];\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: true,\n instance,\n };\n } else {\n console.log('X 3', accountApis, instance, accessToken);\n const account = getAccountByAccessToken(accessToken);\n if (account) {\n const accessToken = account.accessToken;\n const instance = account.instanceURL.toLowerCase().trim();\n const client = initClient({ instance, accessToken });\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: true,\n instance,\n };\n } else {\n throw new Error(`Access token not found`);\n }\n }\n }\n }\n\n // If account is provided, get the masto instance for that account\n if (account || accountID) {\n account = account || getAccount(accountID);\n if (account) {\n const accessToken = account.accessToken;\n const instance = account.instanceURL.toLowerCase().trim();\n const client =\n accountApis[instance]?.[accessToken] ||\n initClient({ instance, accessToken });\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: true,\n instance,\n };\n } else {\n throw new Error(`Account ${accountID} not found`);\n }\n }\n\n const currentAccount = getCurrentAccount();\n\n // If only instance is provided, get the masto instance for that instance\n if (instance) {\n if (currentAccountApi?.instance === instance) {\n return {\n masto: currentAccountApi.masto,\n streaming: currentAccountApi.streaming,\n client: currentAccountApi,\n authenticated: true,\n instance,\n };\n }\n\n if (currentAccount?.instanceURL === instance) {\n const { accessToken } = currentAccount;\n currentAccountApi =\n accountApis[instance]?.[accessToken] ||\n initClient({ instance, accessToken });\n return {\n masto: currentAccountApi.masto,\n streaming: currentAccountApi.streaming,\n client: currentAccountApi,\n authenticated: true,\n instance,\n };\n }\n\n const instanceAccount = getAccountByInstance(instance);\n if (instanceAccount) {\n const accessToken = instanceAccount.accessToken;\n const client =\n accountApis[instance]?.[accessToken] ||\n initClient({ instance, accessToken });\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: true,\n instance,\n };\n }\n\n const client = apis[instance] || initClient({ instance });\n const { masto, streaming, accessToken } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: !!accessToken,\n instance,\n };\n }\n\n // If no instance is provided, get the masto instance for the current account\n if (currentAccountApi) {\n return {\n masto: currentAccountApi.masto,\n streaming: currentAccountApi.streaming,\n client: currentAccountApi,\n authenticated: true,\n instance: currentAccountApi.instance,\n };\n }\n if (currentAccount) {\n const { accessToken, instanceURL: instance } = currentAccount;\n currentAccountApi =\n accountApis[instance]?.[accessToken] ||\n initClient({ instance, accessToken });\n return {\n masto: currentAccountApi.masto,\n streaming: currentAccountApi.streaming,\n client: currentAccountApi,\n authenticated: true,\n instance,\n };\n }\n\n // If no instance is provided and no account is logged in, get the masto instance for DEFAULT_INSTANCE\n const client =\n apis[DEFAULT_INSTANCE] || initClient({ instance: DEFAULT_INSTANCE });\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: false,\n instance: DEFAULT_INSTANCE,\n };\n}\n\nwindow.__API__ = {\n currentAccountApi,\n apis,\n accountApis,\n};\n","import Toastify from 'toastify-js';\n\nwindow._showToast = showToast;\n\nfunction showToast(props) {\n if (typeof props === 'string') {\n props = { text: props };\n }\n const { onClick, delay, ...rest } = props;\n const toast = Toastify({\n className: `${onClick || props.destination ? 'shiny-pill' : ''}`,\n gravity: 'bottom',\n position: 'center',\n ...rest,\n onClick: () => {\n onClick?.(toast); // Pass in the object itself!\n },\n });\n if (delay) {\n setTimeout(() => {\n toast.showToast();\n }, delay);\n } else {\n toast.showToast();\n }\n return toast;\n}\n\nexport default showToast;\n","export default function isMastodonLinkMaybe(url) {\n try {\n const { pathname, hash } = new URL(url);\n return (\n /^\\/.*\\/\\d+$/i.test(pathname) ||\n /^\\/(@[^/]+|users\\/[^/]+)\\/(statuses|posts)\\/\\w+\\/?$/i.test(pathname) || // GoToSocial, Takahe\n /^\\/notes\\/[a-z0-9]+$/i.test(pathname) || // Misskey, Firefish\n /^\\/(notice|objects)\\/[a-z0-9-]+$/i.test(pathname) || // Pleroma\n /#\\/[^\\/]+\\.[^\\/]+\\/s\\/.+/i.test(hash) // Phanpy 🫣\n );\n } catch (e) {\n return false;\n }\n}\n","import moize from 'moize';\n\nwindow._moize = moize;\n\nexport default function mem(fn, opts = {}) {\n return moize(fn, { ...opts, maxSize: 50, isDeepEqual: true });\n}\n","import mem from './mem';\n\nexport default function pmem(fn, opts = {}) {\n return mem(fn, { isPromise: true, ...opts });\n}\n","// Rate limit repeated function calls and queue them to set interval\nexport default function rateLimit(fn, interval) {\n let queue = [];\n let isRunning = false;\n\n function executeNext() {\n if (queue.length === 0) {\n isRunning = false;\n return;\n }\n\n const nextFn = queue.shift();\n nextFn();\n setTimeout(executeNext, interval);\n }\n\n return function (...args) {\n const callFn = () => fn.apply(this, args);\n queue.push(callFn);\n\n if (!isRunning) {\n isRunning = true;\n setTimeout(executeNext, interval);\n }\n };\n}\n","import pThrottle from 'p-throttle';\nimport { snapshot } from 'valtio/vanilla';\n\nimport { api } from './api';\nimport states, { saveStatus } from './states';\n\nexport const throttle = pThrottle({\n limit: 1,\n interval: 1000,\n});\n\nconst denylistDomains = /(twitter|github)\\.com/i;\nconst failedUnfurls = {};\nfunction _unfurlMastodonLink(instance, url) {\n const snapStates = snapshot(states);\n if (denylistDomains.test(url)) {\n return;\n }\n if (failedUnfurls[url]) {\n return;\n }\n const instanceRegex = new RegExp(instance + '/');\n if (instanceRegex.test(snapStates.unfurledLinks[url]?.url)) {\n return Promise.resolve(snapStates.unfurledLinks[url]);\n }\n console.debug('🦦 Unfurling URL', url);\n\n let remoteInstanceFetch;\n let theURL = url;\n\n // https://elk.zone/domain.com/@stest/123 -> https://domain.com/@stest/123\n if (/\\/\\/elk\\.[^\\/]+\\/[^\\/]+\\.[^\\/]+/i.test(theURL)) {\n theURL = theURL.replace(/elk\\.[^\\/]+\\//i, '');\n }\n\n // https://trunks.social/status/domain.com/@stest/123 -> https://domain.com/@stest/123\n if (/\\/\\/trunks\\.[^\\/]+\\/status\\/[^\\/]+\\.[^\\/]+/i.test(theURL)) {\n theURL = theURL.replace(/trunks\\.[^\\/]+\\/status\\//i, '');\n }\n\n // https://phanpy.social/#/domain.com/s/123 -> https://domain.com/statuses/123\n if (/\\/#\\/[^\\/]+\\.[^\\/]+\\/s\\/.+/i.test(theURL)) {\n const urlAfterHash = theURL.split('/#/')[1];\n const finalURL = urlAfterHash.replace(/\\/s\\//i, '/@fakeUsername/');\n theURL = `https://${finalURL}`;\n }\n\n let urlObj;\n try {\n urlObj = new URL(theURL);\n } catch (e) {\n return;\n }\n const domain = urlObj.hostname;\n const path = urlObj.pathname;\n // Regex /:username/:id, where username = @username or @username@domain, id = number\n const statusRegex = /\\/@([^@\\/]+)@?([^\\/]+)?\\/(\\d+)$/i;\n const statusMatch = statusRegex.exec(path);\n if (statusMatch) {\n const id = statusMatch[3];\n const { masto } = api({ instance: domain });\n remoteInstanceFetch = masto.v1.statuses\n .$select(id)\n .fetch()\n .then((status) => {\n if (status?.id) {\n return {\n status,\n instance: domain,\n };\n } else {\n throw new Error('No results');\n }\n });\n }\n\n const { masto } = api({ instance });\n const mastoSearchFetch = masto.v2.search\n .fetch({\n q: theURL,\n type: 'statuses',\n resolve: true,\n limit: 1,\n })\n .then((results) => {\n if (results.statuses.length > 0) {\n const status = results.statuses[0];\n return {\n status,\n instance,\n };\n } else {\n throw new Error('No results');\n }\n });\n\n function handleFulfill(result) {\n const { status, instance } = result;\n const { id } = status;\n const selfURL = `/${instance}/s/${id}`;\n console.debug('🦦 Unfurled URL', url, id, selfURL);\n const data = {\n id,\n instance,\n url: selfURL,\n };\n states.unfurledLinks[url] = data;\n saveStatus(status, instance, {\n skipThreading: true,\n });\n return data;\n }\n function handleCatch(e) {\n failedUnfurls[url] = true;\n }\n\n if (remoteInstanceFetch) {\n // return Promise.any([remoteInstanceFetch, mastoSearchFetch])\n // .then(handleFulfill)\n // .catch(handleCatch);\n // If mastoSearchFetch is fulfilled within 3s, return it, else return remoteInstanceFetch\n const finalPromise = Promise.race([\n mastoSearchFetch,\n new Promise((resolve, reject) => setTimeout(reject, 3000)),\n ]).catch(() => {\n // If remoteInstanceFetch is fullfilled, return it, else return mastoSearchFetch\n return remoteInstanceFetch.catch(() => mastoSearchFetch);\n });\n return finalPromise.then(handleFulfill).catch(handleCatch);\n } else {\n return mastoSearchFetch.then(handleFulfill).catch(handleCatch);\n }\n}\n\nconst unfurlMastodonLink = throttle(_unfurlMastodonLink);\nexport default unfurlMastodonLink;\n","import { proxy, subscribe } from 'valtio';\nimport { subscribeKey } from 'valtio/utils';\n\nimport { api } from './api';\nimport isMastodonLinkMaybe from './isMastodonLinkMaybe';\nimport pmem from './pmem';\nimport rateLimit from './ratelimit';\nimport store from './store';\nimport unfurlMastodonLink from './unfurl-link';\n\nconst states = proxy({\n appVersion: {},\n // history: [],\n prevLocation: null,\n currentLocation: null,\n statuses: {},\n statusThreadNumber: {},\n home: [],\n // specialHome: [],\n homeNew: [],\n homeLast: null, // Last item in 'home' list\n homeLastFetchTime: null,\n notifications: [],\n notificationsLast: null, // Last read notification\n notificationsNew: [],\n notificationsShowNew: false,\n notificationsLastFetchTime: null,\n reloadStatusPage: 0,\n reloadGenericAccounts: {\n id: null,\n counter: 0,\n },\n spoilers: {},\n spoilersMedia: {},\n scrollPositions: {},\n unfurledLinks: {},\n statusQuotes: {},\n statusFollowedTags: {},\n accounts: {},\n routeNotification: null,\n // Modals\n showCompose: false,\n showSettings: false,\n showAccount: false,\n showAccounts: false,\n showDrafts: false,\n showMediaModal: false,\n showShortcutsSettings: false,\n showKeyboardShortcutsHelp: false,\n showGenericAccounts: false,\n showMediaAlt: false,\n // Shortcuts\n shortcuts: [],\n // Settings\n settings: {\n autoRefresh: false,\n shortcutsViewMode: null,\n shortcutsColumnsMode: false,\n boostsCarousel: true,\n contentTranslation: true,\n contentTranslationTargetLanguage: null,\n contentTranslationHideLanguages: [],\n contentTranslationAutoInline: false,\n mediaAltGenerator: false,\n cloakMode: false,\n },\n});\n\nexport default states;\n\nexport function initStates() {\n // init all account based states\n // all keys that uses store.account.get() should be initialized here\n states.notificationsLast = store.account.get('notificationsLast') || null;\n states.shortcuts = store.account.get('shortcuts') ?? [];\n states.settings.autoRefresh =\n store.account.get('settings-autoRefresh') ?? false;\n states.settings.shortcutsViewMode =\n store.account.get('settings-shortcutsViewMode') ?? null;\n if (store.account.get('settings-shortcutsColumnsMode')) {\n states.settings.shortcutsColumnsMode = true;\n }\n states.settings.boostsCarousel =\n store.account.get('settings-boostsCarousel') ?? true;\n states.settings.contentTranslation =\n store.account.get('settings-contentTranslation') ?? true;\n states.settings.contentTranslationTargetLanguage =\n store.account.get('settings-contentTranslationTargetLanguage') || null;\n states.settings.contentTranslationHideLanguages =\n store.account.get('settings-contentTranslationHideLanguages') || [];\n states.settings.contentTranslationAutoInline =\n store.account.get('settings-contentTranslationAutoInline') ?? false;\n states.settings.mediaAltGenerator =\n store.account.get('settings-mediaAltGenerator') ?? false;\n states.settings.cloakMode = store.account.get('settings-cloakMode') ?? false;\n}\n\nsubscribeKey(states, 'notificationsLast', (v) => {\n console.log('CHANGE', v);\n store.account.set('notificationsLast', states.notificationsLast);\n});\nsubscribe(states, (changes) => {\n console.debug('STATES change', changes);\n for (const [action, path, value, prevValue] of changes) {\n if (path.join('.') === 'settings.autoRefresh') {\n store.account.set('settings-autoRefresh', !!value);\n }\n if (path.join('.') === 'settings.boostsCarousel') {\n store.account.set('settings-boostsCarousel', !!value);\n }\n if (path.join('.') === 'settings.shortcutsViewMode') {\n store.account.set('settings-shortcutsViewMode', value);\n }\n if (path.join('.') === 'settings.contentTranslation') {\n store.account.set('settings-contentTranslation', !!value);\n }\n if (path.join('.') === 'settings.contentTranslationAutoInline') {\n store.account.set('settings-contentTranslationAutoInline', !!value);\n }\n if (path.join('.') === 'settings.contentTranslationTargetLanguage') {\n console.log('SET', value);\n store.account.set('settings-contentTranslationTargetLanguage', value);\n }\n if (/^settings\\.contentTranslationHideLanguages/i.test(path.join('.'))) {\n store.account.set(\n 'settings-contentTranslationHideLanguages',\n states.settings.contentTranslationHideLanguages,\n );\n }\n if (path.join('.') === 'settings.mediaAltGenerator') {\n store.account.set('settings-mediaAltGenerator', !!value);\n }\n if (path?.[0] === 'shortcuts') {\n store.account.set('shortcuts', states.shortcuts);\n }\n if (path.join('.') === 'settings.cloakMode') {\n store.account.set('settings-cloakMode', !!value);\n }\n }\n});\n\nexport function hideAllModals() {\n states.showCompose = false;\n states.showSettings = false;\n states.showAccount = false;\n states.showAccounts = false;\n states.showDrafts = false;\n states.showMediaModal = false;\n states.showShortcutsSettings = false;\n states.showKeyboardShortcutsHelp = false;\n states.showGenericAccounts = false;\n states.showMediaAlt = false;\n}\n\nexport function statusKey(id, instance) {\n if (!id) return;\n return instance ? `${instance}/${id}` : id;\n}\n\nexport function getStatus(statusID, instance) {\n if (instance) {\n const key = statusKey(statusID, instance);\n return states.statuses[key];\n }\n return states.statuses[statusID];\n}\n\nexport function saveStatus(status, instance, opts) {\n if (typeof instance === 'object') {\n opts = instance;\n instance = null;\n }\n const {\n override = true,\n skipThreading = false,\n skipUnfurling = false,\n } = opts || {};\n if (!status) return;\n const oldStatus = getStatus(status.id, instance);\n if (!override && oldStatus) return;\n queueMicrotask(() => {\n const key = statusKey(status.id, instance);\n if (oldStatus?._pinned) status._pinned = oldStatus._pinned;\n // if (oldStatus?._filtered) status._filtered = oldStatus._filtered;\n states.statuses[key] = status;\n if (status.reblog) {\n const key = statusKey(status.reblog.id, instance);\n states.statuses[key] = status.reblog;\n }\n });\n\n // THREAD TRAVERSER\n if (!skipThreading) {\n queueMicrotask(() => {\n threadifyStatus(status.reblog || status, instance);\n });\n }\n\n // UNFURLER\n if (!skipUnfurling) {\n queueMicrotask(() => {\n unfurlStatus(status.reblog || status, instance);\n });\n }\n}\n\nfunction _threadifyStatus(status, propInstance) {\n const { masto, instance } = api({ instance: propInstance });\n // Return all statuses in the thread, via inReplyToId, if inReplyToAccountId === account.id\n let fetchIndex = 0;\n async function traverse(status, index = 0) {\n const { inReplyToId, inReplyToAccountId } = status;\n if (!inReplyToId || inReplyToAccountId !== status.account.id) {\n return [status];\n }\n if (inReplyToId && inReplyToAccountId !== status.account.id) {\n throw 'Not a thread';\n // Possibly thread of replies by multiple people?\n }\n const key = statusKey(inReplyToId, instance);\n let prevStatus = states.statuses[key];\n if (!prevStatus) {\n if (fetchIndex++ > 3) throw 'Too many fetches for thread'; // Some people revive old threads\n await new Promise((r) => setTimeout(r, 500 * fetchIndex)); // Be nice to rate limits\n // prevStatus = await masto.v1.statuses.$.select(inReplyToId).fetch();\n prevStatus = await fetchStatus(inReplyToId, masto);\n saveStatus(prevStatus, instance, { skipThreading: true });\n }\n // Prepend so that first status in thread will be index 0\n return [...(await traverse(prevStatus, ++index)), status];\n }\n return traverse(status)\n .then((statuses) => {\n if (statuses.length > 1) {\n console.debug('THREAD', statuses);\n statuses.forEach((status, index) => {\n const key = statusKey(status.id, instance);\n states.statusThreadNumber[key] = index + 1;\n });\n }\n })\n .catch((e) => {\n console.error(e, status);\n });\n}\nexport const threadifyStatus = rateLimit(_threadifyStatus, 100);\n\nconst fauxDiv = document.createElement('div');\nexport function unfurlStatus(status, instance) {\n const { instance: currentInstance } = api();\n const content = status?.content;\n const hasLink = / {\n const url = a.href;\n const isPostItself = url === status.url || url === status.uri;\n return !isPostItself && isMastodonLinkMaybe(url);\n })\n .forEach((a, i) => {\n unfurlMastodonLink(currentInstance, a.href).then((result) => {\n if (!result) return;\n if (!sKey) return;\n if (!Array.isArray(states.statusQuotes[sKey])) {\n states.statusQuotes[sKey] = [];\n }\n if (!states.statusQuotes[sKey][i]) {\n states.statusQuotes[sKey].splice(i, 0, result);\n }\n });\n });\n }\n}\n\nconst fetchStatus = pmem((statusID, masto) => {\n return masto.v1.statuses.$select(statusID).fetch();\n});\n","import { useEffect, useRef } from 'preact/hooks';\n\nfunction useInterval(fn, delay, deps, immediate) {\n const savedCallback = useRef(fn);\n useEffect(() => {\n savedCallback.current = fn;\n }, [fn, deps]);\n\n useEffect(() => {\n if (!immediate || delay === null || delay === false) return;\n savedCallback.current();\n }, [immediate]);\n\n useEffect(() => {\n if (delay === null || delay === false) return;\n const tick = () => savedCallback.current();\n const id = setInterval(tick, delay);\n return () => clearInterval(id);\n }, [delay]);\n}\n\nexport default useInterval;\n","export default function openCompose(opts) {\n const url = new URL('/compose/', window.location);\n const { width: screenWidth, height: screenHeight } = window.screen;\n const left = Math.max(0, (screenWidth - 600) / 2);\n const top = Math.max(0, (screenHeight - 450) / 2);\n const width = Math.min(screenWidth, 600);\n const height = Math.min(screenHeight, 450);\n const winUID = opts?.uid || Math.random();\n const newWin = window.open(\n url,\n 'compose' + winUID,\n `width=${width},height=${height},left=${left},top=${top}`,\n );\n\n if (newWin) {\n // if (masto) {\n // newWin.masto = masto;\n // }\n\n newWin.__COMPOSE__ = opts;\n } else {\n alert('Looks like your browser is blocking popups.');\n }\n\n return newWin;\n}\n","import moize from 'moize';\nimport { useEffect, useRef, useState } from 'preact/hooks';\n\nconst SIZES = {\n s: 12,\n m: 16,\n l: 20,\n xl: 24,\n xxl: 32,\n};\n\nexport const ICONS = {\n x: () => import('@iconify-icons/mingcute/close-line'),\n heart: () => import('@iconify-icons/mingcute/heart-line'),\n bookmark: () => import('@iconify-icons/mingcute/bookmark-line'),\n 'check-circle': () => import('@iconify-icons/mingcute/check-circle-line'),\n 'x-circle': () => import('@iconify-icons/mingcute/close-circle-line'),\n transfer: () => import('@iconify-icons/mingcute/transfer-4-line'),\n rocket: () => import('@iconify-icons/mingcute/rocket-line'),\n 'arrow-left': () => import('@iconify-icons/mingcute/arrow-left-line'),\n 'arrow-right': () => import('@iconify-icons/mingcute/arrow-right-line'),\n 'arrow-up': () => import('@iconify-icons/mingcute/arrow-up-line'),\n 'arrow-down': () => import('@iconify-icons/mingcute/arrow-down-line'),\n earth: () => import('@iconify-icons/mingcute/earth-line'),\n lock: () => import('@iconify-icons/mingcute/lock-line'),\n unlock: () => import('@iconify-icons/mingcute/unlock-line'),\n 'eye-close': () => import('@iconify-icons/mingcute/eye-close-line'),\n 'eye-open': () => import('@iconify-icons/mingcute/eye-2-line'),\n message: () => import('@iconify-icons/mingcute/mail-line'),\n comment: () => import('@iconify-icons/mingcute/chat-3-line'),\n comment2: () => import('@iconify-icons/mingcute/comment-2-line'),\n home: () => import('@iconify-icons/mingcute/home-3-line'),\n notification: () => import('@iconify-icons/mingcute/notification-line'),\n follow: () => import('@iconify-icons/mingcute/user-follow-line'),\n 'follow-add': () => import('@iconify-icons/mingcute/user-add-line'),\n poll: [() => import('@iconify-icons/mingcute/chart-bar-line'), '90deg'],\n pencil: () => import('@iconify-icons/mingcute/pencil-line'),\n quill: () => import('@iconify-icons/mingcute/quill-pen-line'),\n at: () => import('@iconify-icons/mingcute/at-line'),\n attachment: () => import('@iconify-icons/mingcute/attachment-line'),\n upload: () => import('@iconify-icons/mingcute/upload-3-line'),\n gear: () => import('@iconify-icons/mingcute/settings-3-line'),\n more: () => import('@iconify-icons/mingcute/more-3-line'),\n external: () => import('@iconify-icons/mingcute/external-link-line'),\n popout: () => import('@iconify-icons/mingcute/external-link-line'),\n popin: [() => import('@iconify-icons/mingcute/external-link-line'), '180deg'],\n plus: () => import('@iconify-icons/mingcute/add-circle-line'),\n 'chevron-left': () => import('@iconify-icons/mingcute/left-line'),\n 'chevron-right': () => import('@iconify-icons/mingcute/right-line'),\n 'chevron-down': () => import('@iconify-icons/mingcute/down-line'),\n reply: [\n () => import('@iconify-icons/mingcute/share-forward-line'),\n '180deg',\n 'horizontal',\n ],\n thread: () => import('@iconify-icons/mingcute/route-line'),\n group: () => import('@iconify-icons/mingcute/group-line'),\n bot: () => import('@iconify-icons/mingcute/android-2-line'),\n menu: () => import('@iconify-icons/mingcute/rows-4-line'),\n list: () => import('@iconify-icons/mingcute/list-check-line'),\n search: () => import('@iconify-icons/mingcute/search-2-line'),\n hashtag: () => import('@iconify-icons/mingcute/hashtag-line'),\n info: () => import('@iconify-icons/mingcute/information-line'),\n shortcut: () => import('@iconify-icons/mingcute/lightning-line'),\n user: () => import('@iconify-icons/mingcute/user-4-line'),\n following: () => import('@iconify-icons/mingcute/walk-line'),\n pin: () => import('@iconify-icons/mingcute/pin-line'),\n bus: () => import('@iconify-icons/mingcute/bus-2-line'),\n link: () => import('@iconify-icons/mingcute/link-2-line'),\n history: () => import('@iconify-icons/mingcute/history-line'),\n share: () => import('@iconify-icons/mingcute/share-2-line'),\n sparkles: () => import('@iconify-icons/mingcute/sparkles-line'),\n sparkles2: () => import('@iconify-icons/mingcute/sparkles-2-line'),\n exit: () => import('@iconify-icons/mingcute/exit-line'),\n translate: () => import('@iconify-icons/mingcute/translate-line'),\n play: () => import('@iconify-icons/mingcute/play-fill'),\n trash: () => import('@iconify-icons/mingcute/delete-2-line'),\n mute: () => import('@iconify-icons/mingcute/volume-mute-line'),\n unmute: () => import('@iconify-icons/mingcute/volume-line'),\n block: () => import('@iconify-icons/mingcute/forbid-circle-line'),\n unblock: [\n () => import('@iconify-icons/mingcute/forbid-circle-line'),\n '180deg',\n ],\n flag: () => import('@iconify-icons/mingcute/flag-4-line'),\n time: () => import('@iconify-icons/mingcute/time-line'),\n refresh: () => import('@iconify-icons/mingcute/refresh-2-line'),\n emoji2: () => import('@iconify-icons/mingcute/emoji-2-line'),\n filter: () => import('@iconify-icons/mingcute/filter-2-line'),\n chart: () => import('@iconify-icons/mingcute/chart-line-line'),\n react: () => import('@iconify-icons/mingcute/react-line'),\n layout4: () => import('@iconify-icons/mingcute/layout-4-line'),\n layout5: () => import('@iconify-icons/mingcute/layout-5-line'),\n announce: () => import('@iconify-icons/mingcute/announcement-line'),\n alert: () => import('@iconify-icons/mingcute/alert-line'),\n round: () => import('@iconify-icons/mingcute/round-fill'),\n 'arrow-up-circle': () =>\n import('@iconify-icons/mingcute/arrow-up-circle-line'),\n 'arrow-down-circle': () =>\n import('@iconify-icons/mingcute/arrow-down-circle-line'),\n clipboard: () => import('@iconify-icons/mingcute/clipboard-line'),\n 'account-edit': () => import('@iconify-icons/mingcute/user-edit-line'),\n 'account-warning': () => import('@iconify-icons/mingcute/user-warning-line'),\n keyboard: () => import('@iconify-icons/mingcute/keyboard-line'),\n cloud: () => import('@iconify-icons/mingcute/cloud-line'),\n month: () => import('@iconify-icons/mingcute/calendar-month-line'),\n media: () => import('@iconify-icons/mingcute/photo-album-line'),\n speak: () => import('@iconify-icons/mingcute/radar-line'),\n building: () => import('@iconify-icons/mingcute/building-5-line'),\n};\n\nconst ICONDATA = {};\n\n// Memoize the dangerouslySetInnerHTML of the SVGs\nconst SVGICon = moize(\n function ({ size, width, height, body, rotate, flip }) {\n return (\n \n );\n },\n {\n isShallowEqual: true,\n maxSize: Object.keys(ICONS).length,\n },\n);\n\nfunction Icon({\n icon,\n size = 'm',\n alt,\n title,\n class: className = '',\n style = {},\n}) {\n if (!icon) return null;\n\n const iconSize = SIZES[size];\n let iconBlock = ICONS[icon];\n if (!iconBlock) {\n console.warn(`Icon ${icon} not found`);\n return null;\n }\n\n let rotate, flip;\n if (Array.isArray(iconBlock)) {\n [iconBlock, rotate, flip] = iconBlock;\n }\n\n const [iconData, setIconData] = useState(ICONDATA[icon]);\n const currentIcon = useRef(icon);\n useEffect(() => {\n if (iconData && currentIcon.current === icon) return;\n (async () => {\n const iconB = await iconBlock();\n setIconData(iconB.default);\n ICONDATA[icon] = iconB.default;\n })();\n currentIcon.current = icon;\n }, [icon]);\n\n return (\n \n {iconData && (\n // \n \n )}\n \n );\n}\n\nexport default Icon;\n","import { useEffect } from 'preact/hooks';\n\nfunction useCloseWatcher(fn, deps = []) {\n if (!fn || typeof fn !== 'function') return;\n useEffect(() => {\n const watcher = new CloseWatcher();\n watcher.addEventListener('close', fn);\n return () => {\n watcher.destroy();\n };\n }, deps);\n}\n\nexport default window.CloseWatcher ? useCloseWatcher : () => {};\n","import './modal.css';\n\nimport { createPortal } from 'preact/compat';\nimport { useEffect, useRef } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport useCloseWatcher from '../utils/useCloseWatcher';\n\nconst $modalContainer = document.getElementById('modal-container');\n\nfunction Modal({ children, onClose, onClick, class: className }) {\n if (!children) return null;\n\n const modalRef = useRef();\n useEffect(() => {\n let timer = setTimeout(() => {\n const focusElement = modalRef.current?.querySelector('[tabindex=\"-1\"]');\n if (focusElement) {\n focusElement.focus();\n }\n }, 100);\n return () => clearTimeout(timer);\n }, []);\n\n const supportsCloseWatcher = window.CloseWatcher;\n const escRef = useHotkeys(\n 'esc',\n () => {\n setTimeout(() => {\n onClose?.();\n }, 0);\n },\n {\n enabled: !supportsCloseWatcher && !!onClose,\n // Using keyup and setTimeout above\n // This will run \"later\" to prevent clash with esc handlers from other components\n keydown: false,\n keyup: true,\n },\n [onClose],\n );\n useCloseWatcher(onClose, [onClose]);\n\n const Modal = (\n {\n modalRef.current = node;\n escRef.current = node?.querySelector?.('[tabindex=\"-1\"]') || node;\n }}\n className={className}\n onClick={(e) => {\n onClick?.(e);\n if (e.target === e.currentTarget) {\n onClose?.(e);\n }\n }}\n tabIndex=\"-1\"\n onFocus={(e) => {\n if (e.target === e.currentTarget) {\n modalRef.current?.querySelector?.('[tabindex=\"-1\"]')?.focus?.();\n }\n }}\n >\n {children}\n \n );\n\n return createPortal(Modal, $modalContainer);\n\n // return createPortal(children, $modalContainer);\n}\n\nexport default Modal;\n","import './loader.css';\n\nfunction Loader({ abrupt, hidden, ...props }) {\n return (\n inside and it's difficult to preventDefault/stopPropagation from the nested \n 2. isActive doesn't work properly with the weird routes that's set up in this app, due to the faux \"location\" to make the modals work and prevent unmounting\n 3. Not using because it modifies history.state that *persists* across page reloads. I don't need that, so using valtio's states instead.\n*/\n\nconst Link = forwardRef((props, ref) => {\n let routerLocation;\n try {\n routerLocation = useLocation();\n } catch (e) {}\n let hash = (location.hash || '').replace(/^#/, '').trim();\n if (hash === '') hash = '/';\n const { to, ...restProps } = props;\n\n // Handle encodeURIComponent of searchParams values\n if (!!hash && hash !== '/' && hash.includes('?')) {\n try {\n const parsedHash = new URL(hash, location.origin); // Fake base URL\n if (parsedHash.searchParams.size) {\n const searchParamsStr = Array.from(parsedHash.searchParams.entries())\n .map(([key, value]) => `${key}=${encodeURIComponent(value)}`)\n .join('&');\n hash = parsedHash.pathname + '?' + searchParamsStr;\n }\n } catch (e) {}\n }\n\n const isActive = hash === to || decodeURIComponent(hash) === to;\n return (\n {\n if (e.currentTarget?.parentNode?.closest('a')) {\n // If this is nested inside another \n e.stopPropagation();\n }\n if (routerLocation) states.prevLocation = routerLocation;\n props.onClick?.(e);\n }}\n />\n );\n});\n\nexport default Link;\n","const root = document.documentElement;\nconst style = getComputedStyle(root);\nconst defaultBoundingBoxPadding = 8;\n\nlet safeAreaInsets = [0, 0, 0, 0];\nfunction getSafeAreaInsets() {\n // Get safe area inset variables from root\n const safeAreaInsetTop = style.getPropertyValue('--sai-top');\n const safeAreaInsetRight = style.getPropertyValue('--sai-right');\n const safeAreaInsetBottom = style.getPropertyValue('--sai-bottom');\n const safeAreaInsetLeft = style.getPropertyValue('--sai-left');\n safeAreaInsets = [\n // top, right, bottom, left (clockwise)\n Math.max(0, parseInt(safeAreaInsetTop, 10)),\n Math.max(0, parseInt(safeAreaInsetRight, 10)),\n Math.max(0, parseInt(safeAreaInsetBottom, 10)),\n Math.max(0, parseInt(safeAreaInsetLeft, 10)),\n ];\n}\nrequestAnimationFrame(getSafeAreaInsets);\n\nfunction safeBoundingBoxPadding(paddings = []) {\n const str = safeAreaInsets\n .map((v, i) => (v || defaultBoundingBoxPadding) + (paddings[i] || 0))\n .join(' ');\n // console.log(str);\n return str;\n}\n\n// Update safe area insets when orientation or resize\nif (CSS.supports('top: env(safe-area-inset-top)')) {\n window.addEventListener('resize', getSafeAreaInsets, { passive: true });\n}\n\nexport default safeBoundingBoxPadding;\n","import { Menu } from '@szhsin/react-menu';\nimport { useWindowSize } from '@uidotdev/usehooks';\nimport { useRef } from 'preact/hooks';\n\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\n\n// It's like Menu but with sensible defaults, bug fixes and improvements.\nfunction Menu2(props) {\n const { containerProps, instanceRef: _instanceRef } = props;\n const size = useWindowSize();\n const instanceRef = _instanceRef?.current ? _instanceRef : useRef();\n\n return (\n {\n if (e.target === e.currentTarget) {\n instanceRef.current?.closeMenu?.();\n }\n containerProps?.onClick?.(e);\n },\n ...containerProps,\n }}\n />\n );\n}\n\nexport default Menu2;\n","import { Menu, MenuItem, SubMenu } from '@szhsin/react-menu';\nimport { cloneElement } from 'preact';\nimport { useRef } from 'preact/hooks';\n\nimport Menu2 from './menu2';\n\nfunction MenuConfirm({\n subMenu = false,\n confirm = true,\n confirmLabel,\n menuItemClassName,\n menuFooter,\n ...props\n}) {\n const { children, onClick, ...restProps } = props;\n if (!confirm) {\n if (subMenu) return ;\n if (onClick) {\n return cloneElement(children, {\n onClick,\n });\n }\n return children;\n }\n const Parent = subMenu ? SubMenu : Menu2;\n const menuRef = useRef();\n return (\n {\n if (e.pointerType === 'touch') {\n menuRef.current?.openMenu?.();\n }\n },\n onPointerLeave: (e) => {\n if (e.pointerType === 'touch') {\n menuRef.current?.openMenu?.();\n }\n },\n }}\n >\n \n {confirmLabel}\n \n {menuFooter}\n \n );\n}\n\nexport default MenuConfirm;\n","function EmojiText({ text, emojis }) {\n if (!text) return '';\n if (!emojis?.length) return text;\n if (text.indexOf(':') === -1) return text;\n const regex = new RegExp(\n `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n 'g',\n );\n const elements = text.split(regex).map((word) => {\n const emoji = emojis.find((e) => e.shortcode === word);\n if (emoji) {\n const { url, staticUrl } = emoji;\n return (\n \n \n \n \n );\n }\n return word;\n });\n return elements;\n}\n\nexport default EmojiText;\n","import './name-text.css';\n\nimport { memo } from 'preact/compat';\n\nimport states from '../utils/states';\n\nimport Avatar from './avatar';\nimport EmojiText from './emoji-text';\n\nconst nameCollator = new Intl.Collator('en', {\n sensitivity: 'base',\n});\n\nfunction NameText({\n account,\n instance,\n showAvatar,\n showAcct,\n short,\n external,\n onClick,\n}) {\n const { acct, avatar, avatarStatic, id, url, displayName, emojis, bot } =\n account;\n let { username } = account;\n const [_, acct1, acct2] = acct.match(/([^@]+)(@.+)/i) || [, acct];\n\n const trimmedUsername = username.toLowerCase().trim();\n const trimmedDisplayName = (displayName || '').toLowerCase().trim();\n const shortenedDisplayName = trimmedDisplayName\n .replace(/(\\:(\\w|\\+|\\-)+\\:)(?=|[\\!\\.\\?]|$)/g, '') // Remove shortcodes, regex from https://regex101.com/r/iE9uV0/1\n .replace(/\\s+/g, ''); // E.g. \"My name\" === \"myname\"\n const shortenedAlphaNumericDisplayName = shortenedDisplayName.replace(\n /[^a-z0-9]/gi,\n '',\n ); // Remove non-alphanumeric characters\n\n if (\n !short &&\n (trimmedUsername === trimmedDisplayName ||\n trimmedUsername === shortenedDisplayName ||\n trimmedUsername === shortenedAlphaNumericDisplayName ||\n nameCollator.compare(trimmedUsername, shortenedDisplayName) === 0)\n ) {\n username = null;\n }\n\n return (\n {\n if (external) return;\n e.preventDefault();\n e.stopPropagation();\n if (onClick) return onClick(e);\n states.showAccount = {\n account,\n instance,\n };\n }}\n >\n {showAvatar && (\n <>\n {' '}\n \n )}\n {displayName && !short ? (\n <>\n \n \n \n {!showAcct && username && (\n <>\n {' '}\n @{username}\n \n )}\n \n ) : short ? (\n {username}\n ) : (\n {username}\n )}\n {showAcct && (\n <>\n
\n \n @{acct1}\n {acct2}\n \n \n )}\n
\n );\n}\n\nexport default memo(NameText);\n","// Twitter-style relative time component\n// Seconds = 1s\n// Minutes = 1m\n// Hours = 1h\n// Days = 1d\n// After 7 days, use DD/MM/YYYY or MM/DD/YYYY\nimport dayjs from 'dayjs';\nimport dayjsTwitter from 'dayjs-twitter';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport relativeTime from 'dayjs/plugin/relativeTime';\n\ndayjs.extend(dayjsTwitter);\ndayjs.extend(localizedFormat);\ndayjs.extend(relativeTime);\n\nconst dtf = new Intl.DateTimeFormat();\n\nexport default function RelativeTime({ datetime, format }) {\n if (!datetime) return null;\n const date = dayjs(datetime);\n let dateStr;\n if (format === 'micro') {\n // If date <= 1 day ago or day is within this year\n const now = dayjs();\n const dayDiff = now.diff(date, 'day');\n if (dayDiff <= 1 || now.year() === date.year()) {\n dateStr = date.twitter();\n } else {\n dateStr = dtf.format(date.toDate());\n }\n } else {\n dateStr = date.fromNow();\n }\n\n return (\n \n );\n}\n","import { match } from '@formatjs/intl-localematcher';\n\nimport mem from './mem';\n\nfunction _localeMatch(...args) {\n // Wrap in try/catch because localeMatcher throws on invalid locales\n try {\n return match(...args);\n } catch (e) {\n const defaultLocale = args[2];\n return defaultLocale || false;\n }\n}\nconst localeMatch = mem(_localeMatch);\n\nexport default localeMatch;\n","import translationTargetLanguages from '../data/lingva-target-languages';\n\nimport localeMatch from './locale-match';\nimport states from './states';\n\nconst locales = [\n new Intl.DateTimeFormat().resolvedOptions().locale,\n ...navigator.languages,\n];\n\nconst localeTargetLanguages = localeMatch(\n locales,\n translationTargetLanguages.map((l) => l.code.replace('_', '-')), // The underscore will fail Intl.Locale inside `match`\n 'en',\n);\n\nfunction getTranslateTargetLanguage(fromSettings = false) {\n if (fromSettings) {\n const { contentTranslationTargetLanguage } = states.settings;\n if (contentTranslationTargetLanguage) {\n return contentTranslationTargetLanguage;\n }\n }\n return localeTargetLanguages;\n}\n\nexport default getTranslateTargetLanguage;\n","export default function localeCode2Text(code) {\n try {\n return new Intl.DisplayNames(navigator.languages, {\n type: 'language',\n }).of(code);\n } catch (e) {\n console.error(e);\n return null;\n }\n}\n","function emojifyText(text, emojis = []) {\n if (!text) return '';\n if (!emojis.length) return text;\n if (text.indexOf(':') === -1) return text;\n // Replace shortcodes in text with emoji\n // emojis = [{ shortcode: 'smile', url: 'https://example.com/emoji.png' }]\n emojis.forEach((emoji) => {\n const { shortcode, staticUrl, url } = emoji;\n text = text.replace(\n new RegExp(`:${shortcode}:`, 'g'),\n `\":${shortcode}:\"`,\n );\n });\n // console.log(text, emojis);\n return text;\n}\n\nexport default emojifyText;\n","import emojifyText from './emojify-text';\nimport mem from './mem';\n\nconst fauxDiv = document.createElement('div');\nconst whitelistLinkClasses = ['u-url', 'mention', 'hashtag'];\n\nfunction _enhanceContent(content, opts = {}) {\n const { emojis, postEnhanceDOM = () => {} } = opts;\n let enhancedContent = content;\n const dom = document.createElement('div');\n dom.innerHTML = enhancedContent;\n const hasLink = / {\n link.setAttribute('target', '_blank');\n });\n\n // Remove all classes except `u-url`, `mention`, `hashtag`\n const links = dom.querySelectorAll('a[class]');\n links.forEach((link) => {\n link.classList.forEach((c) => {\n if (!whitelistLinkClasses.includes(c)) {\n link.classList.remove(c);\n }\n });\n });\n }\n\n // Add 'has-url-text' to all links that contains a url\n if (hasLink) {\n const links = dom.querySelectorAll('a[href]');\n links.forEach((link) => {\n if (/^https?:\\/\\//i.test(link.textContent.trim())) {\n link.classList.add('has-url-text');\n }\n });\n }\n\n // Spanify un-spanned mentions\n if (hasLink) {\n const links = dom.querySelectorAll('a[href]');\n const usernames = [];\n links.forEach((link) => {\n const text = link.innerText.trim();\n const hasChildren = link.querySelector('*');\n // If text looks like @username@domain, then it's a mention\n if (/^@[^@]+(@[^@]+)?$/g.test(text)) {\n // Only show @username\n const [_, username, domain] = text.split('@');\n if (!hasChildren) {\n if (\n !usernames.some(([u]) => u === username) ||\n usernames.some(([u, d]) => u === username && d === domain)\n ) {\n link.innerHTML = `@${username}`;\n usernames.push([username, domain]);\n } else {\n link.innerHTML = `@${username}@${domain}`;\n }\n }\n link.classList.add('mention');\n }\n // If text looks like #hashtag, then it's a hashtag\n if (/^#[^#]+$/g.test(text)) {\n if (!hasChildren) link.innerHTML = `#${text.slice(1)}`;\n link.classList.add('mention', 'hashtag');\n }\n });\n }\n\n // EMOJIS\n // ======\n // Convert :shortcode: to \n let textNodes;\n if (enhancedContent.includes(':')) {\n textNodes = extractTextNodes(dom);\n textNodes.forEach((node) => {\n let html = node.nodeValue\n .replace(/&/g, '&')\n .replace(//g, '>');\n if (emojis) {\n html = emojifyText(html, emojis);\n }\n fauxDiv.innerHTML = html;\n // const nodes = [...fauxDiv.childNodes];\n node.replaceWith(...fauxDiv.childNodes);\n });\n }\n\n // CODE BLOCKS\n // ===========\n // Convert ```code``` to
code
\n if (hasCodeBlock) {\n const blocks = [...dom.querySelectorAll('p')].filter((p) =>\n /^```[^]+```$/g.test(p.innerText.trim()),\n );\n blocks.forEach((block) => {\n const pre = document.createElement('pre');\n // Replace
with newlines\n block.querySelectorAll('br').forEach((br) => br.replaceWith('\\n'));\n pre.innerHTML = `${block.innerHTML.trim()}`;\n block.replaceWith(pre);\n });\n }\n\n // Convert multi-paragraph code blocks to
code
\n if (hasCodeBlock) {\n const paragraphs = [...dom.querySelectorAll('p')];\n // Filter out paragraphs with ``` in beginning only\n const codeBlocks = paragraphs.filter((p) => /^```/g.test(p.innerText));\n // For each codeBlocks, get all paragraphs until the last paragraph with ``` at the end only\n codeBlocks.forEach((block) => {\n const nextParagraphs = [block];\n let hasCodeBlock = false;\n let currentBlock = block;\n while (currentBlock.nextElementSibling) {\n const next = currentBlock.nextElementSibling;\n if (next && next.tagName === 'P') {\n if (/```$/g.test(next.innerText)) {\n nextParagraphs.push(next);\n hasCodeBlock = true;\n break;\n } else {\n nextParagraphs.push(next);\n }\n } else {\n break;\n }\n currentBlock = next;\n }\n if (hasCodeBlock) {\n const pre = document.createElement('pre');\n nextParagraphs.forEach((p) => {\n // Replace
with newlines\n p.querySelectorAll('br').forEach((br) => br.replaceWith('\\n'));\n });\n const codeText = nextParagraphs.map((p) => p.innerHTML).join('\\n\\n');\n pre.innerHTML = `${codeText}`;\n block.replaceWith(pre);\n nextParagraphs.forEach((p) => p.remove());\n }\n });\n }\n\n // INLINE CODE\n // ===========\n // Convert `code` to code\n if (enhancedContent.includes('`')) {\n textNodes = extractTextNodes(dom);\n textNodes.forEach((node) => {\n let html = node.nodeValue\n .replace(/&/g, '&')\n .replace(//g, '>');\n if (/`[^`]+`/g.test(html)) {\n html = html.replaceAll(/(`[^]+?`)/g, '$1');\n }\n fauxDiv.innerHTML = html;\n // const nodes = [...fauxDiv.childNodes];\n node.replaceWith(...fauxDiv.childNodes);\n });\n }\n\n // TWITTER USERNAMES\n // =================\n // Convert @username@twitter.com to
@username@twitter.com\n if (/twitter\\.com/i.test(enhancedContent)) {\n textNodes = extractTextNodes(dom, {\n rejectFilter: ['A'],\n });\n textNodes.forEach((node) => {\n let html = node.nodeValue\n .replace(/&/g, '&')\n .replace(//g, '>');\n if (/@[a-zA-Z0-9_]+@twitter\\.com/g.test(html)) {\n html = html.replaceAll(\n /(@([a-zA-Z0-9_]+)@twitter\\.com)/g,\n '$1',\n );\n }\n fauxDiv.innerHTML = html;\n // const nodes = [...fauxDiv.childNodes];\n node.replaceWith(...fauxDiv.childNodes);\n });\n }\n\n // HASHTAG STUFFING\n // ================\n // Get the

that contains a lot of hashtags, add a class to it\n if (enhancedContent.includes('#')) {\n let prevIndex = null;\n const hashtagStuffedParagraphs = [...dom.querySelectorAll('p')].filter(\n (p, index) => {\n let hashtagCount = 0;\n for (let i = 0; i < p.childNodes.length; i++) {\n const node = p.childNodes[i];\n\n if (node.nodeType === Node.TEXT_NODE) {\n const text = node.textContent.trim();\n if (text !== '') {\n return false;\n }\n } else if (node.tagName === 'BR') {\n // Ignore
\n } else if (node.tagName === 'A') {\n const linkText = node.textContent.trim();\n if (!linkText || !linkText.startsWith('#')) {\n return false;\n } else {\n hashtagCount++;\n }\n } else {\n return false;\n }\n }\n // Only consider \"stuffing\" if:\n // - there are more than 3 hashtags\n // - there are more than 1 hashtag in adjacent paragraphs\n if (hashtagCount > 3) {\n prevIndex = index;\n return true;\n }\n if (hashtagCount > 1 && prevIndex && index === prevIndex + 1) {\n prevIndex = index;\n return true;\n }\n },\n );\n if (hashtagStuffedParagraphs?.length) {\n hashtagStuffedParagraphs.forEach((p) => {\n p.classList.add('hashtag-stuffing');\n p.title = p.innerText;\n });\n }\n }\n\n if (postEnhanceDOM) {\n queueMicrotask(() => postEnhanceDOM(dom));\n // postEnhanceDOM(dom); // mutate dom\n }\n\n enhancedContent = dom.innerHTML;\n\n return enhancedContent;\n}\nconst enhanceContent = mem(_enhanceContent);\n\nconst defaultRejectFilter = [\n // Document metadata\n 'STYLE',\n // Image and multimedia\n 'IMG',\n 'VIDEO',\n 'AUDIO',\n 'AREA',\n 'MAP',\n 'TRACK',\n // Embedded content\n 'EMBED',\n 'IFRAME',\n 'OBJECT',\n 'PICTURE',\n 'PORTAL',\n 'SOURCE',\n // SVG and MathML\n 'SVG',\n 'MATH',\n // Scripting\n 'CANVAS',\n 'NOSCRIPT',\n 'SCRIPT',\n // Forms\n 'INPUT',\n 'OPTION',\n 'TEXTAREA',\n // Web Components\n 'SLOT',\n 'TEMPLATE',\n];\nconst defaultRejectFilterMap = Object.fromEntries(\n defaultRejectFilter.map((nodeName) => [nodeName, true]),\n);\nfunction extractTextNodes(dom, opts = {}) {\n const textNodes = [];\n const rejectFilterMap = Object.assign(\n {},\n defaultRejectFilterMap,\n opts.rejectFilter?.reduce((acc, cur) => {\n acc[cur] = true;\n return acc;\n }, {}),\n );\n const walk = document.createTreeWalker(\n dom,\n NodeFilter.SHOW_TEXT,\n {\n acceptNode(node) {\n if (rejectFilterMap[node.parentNode.nodeName]) {\n return NodeFilter.FILTER_REJECT;\n }\n return NodeFilter.FILTER_ACCEPT;\n },\n },\n false,\n );\n let node;\n while ((node = walk.nextNode())) {\n textNodes.push(node);\n }\n return textNodes;\n}\n\nexport default enhanceContent;\n","import mem from './mem';\n\nconst div = document.createElement('div');\nfunction getHTMLText(html) {\n if (!html) return '';\n div.innerHTML = html\n .replace(/<\\/p>/g, '

\\n\\n')\n .replace(/<\\/li>/g, '\\n');\n div.querySelectorAll('br').forEach((br) => {\n br.replaceWith('\\n');\n });\n return div.innerText.replace(/[\\r\\n]{3,}/g, '\\n\\n').trim();\n}\n\nexport default mem(getHTMLText);\n","import states from './states';\n\nfunction handleContentLinks(opts) {\n const { mentions = [], instance, previewMode, statusURL } = opts || {};\n return (e) => {\n let { target } = e;\n target = target.closest('a');\n if (!target) return;\n\n // If cmd/ctrl/shift/alt key is pressed or middle-click, let the browser handle it\n if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.which === 2) {\n return;\n }\n\n const prevText = target.previousSibling?.textContent;\n const textBeforeLinkIsAt = prevText?.endsWith('@');\n const textStartsWithAt = target.innerText.startsWith('@');\n if (\n (target.classList.contains('u-url') && textStartsWithAt) ||\n (textBeforeLinkIsAt && !textStartsWithAt)\n ) {\n const targetText = (\n target.querySelector('span') || target\n ).innerText.trim();\n const username = targetText.replace(/^@/, '');\n const url = target.getAttribute('href');\n const mention = mentions.find(\n (mention) =>\n mention.username === username ||\n mention.acct === username ||\n mention.url === url,\n );\n if (mention) {\n e.preventDefault();\n e.stopPropagation();\n states.showAccount = {\n account: mention.acct,\n instance,\n };\n } else if (!/^http/i.test(targetText)) {\n console.log('mention not found', targetText);\n e.preventDefault();\n e.stopPropagation();\n const href = target.getAttribute('href');\n states.showAccount = {\n account: href,\n instance,\n };\n }\n } else if (!previewMode) {\n const textBeforeLinkIsHash = prevText?.endsWith('#');\n if (target.classList.contains('hashtag') || textBeforeLinkIsHash) {\n e.preventDefault();\n e.stopPropagation();\n const tag = target.innerText.replace(/^#/, '').trim();\n const hashURL = instance ? `#/${instance}/t/${tag}` : `#/t/${tag}`;\n console.log({ hashURL });\n location.hash = hashURL;\n } else if (\n states.unfurledLinks[target.href]?.url &&\n statusURL !== target.href\n ) {\n // If unfurled AND not self-referential\n e.preventDefault();\n e.stopPropagation();\n states.prevLocation = {\n pathname: location.hash.replace(/^#/, ''),\n };\n location.hash = `#${states.unfurledLinks[target.href].url}`;\n }\n }\n };\n}\n\nexport default handleContentLinks;\n","import mem from './mem';\n\nconst { locale } = new Intl.DateTimeFormat().resolvedOptions();\n\nconst _DateTimeFormat = (opts) => {\n const { dateYear, hideTime, formatOpts } = opts || {};\n const currentYear = new Date().getFullYear();\n return Intl.DateTimeFormat(locale, {\n // Show year if not current year\n year: dateYear === currentYear ? undefined : 'numeric',\n month: 'short',\n day: 'numeric',\n // Hide time if requested\n hour: hideTime ? undefined : 'numeric',\n minute: hideTime ? undefined : 'numeric',\n ...formatOpts,\n });\n};\nconst DateTimeFormat = mem(_DateTimeFormat);\n\nfunction niceDateTime(date, dtfOpts) {\n if (!(date instanceof Date)) {\n date = new Date(date);\n }\n const DTF = DateTimeFormat({\n dateYear: date.getFullYear(),\n ...dtfOpts,\n });\n const dateText = DTF.format(date);\n return dateText;\n}\n\nexport default niceDateTime;\n","const { locale } = Intl.NumberFormat().resolvedOptions();\nconst shortenNumber = Intl.NumberFormat(locale, {\n notation: 'compact',\n}).format;\nexport default shortenNumber;\n","import './account-block.css';\n\n// import { useNavigate } from 'react-router-dom';\nimport enhanceContent from '../utils/enhance-content';\nimport niceDateTime from '../utils/nice-date-time';\nimport shortenNumber from '../utils/shorten-number';\nimport states from '../utils/states';\n\nimport Avatar from './avatar';\nimport EmojiText from './emoji-text';\nimport Icon from './icon';\n\nfunction AccountBlock({\n skeleton,\n account,\n avatarSize = 'xl',\n useAvatarStatic = false,\n instance,\n external,\n internal,\n onClick,\n showActivity = false,\n showStats = false,\n accountInstance,\n hideDisplayName = false,\n relationship = {},\n excludeRelationshipAttrs = [],\n}) {\n if (skeleton) {\n return (\n
\n \n \n ████████\n
\n @██████\n
\n
\n );\n }\n\n if (!account) {\n return null;\n }\n\n // const navigate = useNavigate();\n\n const {\n id,\n acct,\n avatar,\n avatarStatic,\n displayName,\n username,\n emojis,\n url,\n statusesCount,\n lastStatusAt,\n bot,\n fields,\n note,\n group,\n followersCount,\n } = account;\n let [_, acct1, acct2] = acct.match(/([^@]+)(@.+)/i) || [, acct];\n if (accountInstance) {\n acct2 = `@${accountInstance}`;\n }\n\n const verifiedField = fields?.find((f) => !!f.verifiedAt && !!f.value);\n\n const excludedRelationship = {};\n for (const r in relationship) {\n if (!excludeRelationshipAttrs.includes(r)) {\n excludedRelationship[r] = relationship[r];\n }\n }\n const hasRelationship =\n excludedRelationship.following ||\n excludedRelationship.followedBy ||\n excludedRelationship.requested;\n\n return (\n {\n if (external) return;\n e.preventDefault();\n if (onClick) return onClick(e);\n if (internal) {\n // navigate(`/${instance}/a/${id}`);\n location.hash = `/${instance}/a/${id}`;\n } else {\n states.showAccount = {\n account,\n instance,\n };\n }\n }}\n >\n \n \n {!hideDisplayName && (\n <>\n {displayName ? (\n \n \n \n ) : (\n {username}\n )}\n \n )}{' '}\n \n @{acct1}\n \n {acct2}\n \n {showActivity && (\n <>\n
\n \n Posts: {statusesCount}\n {!!lastStatusAt && (\n <>\n {' '}\n · Last posted:{' '}\n {niceDateTime(lastStatusAt, {\n hideTime: true,\n })}\n \n )}\n \n \n )}\n {showStats && (\n
\n {bot && (\n <>\n \n Automated\n \n \n )}\n {!!group && (\n <>\n \n Group\n \n \n )}\n {hasRelationship && (\n
\n
\n {excludedRelationship.following &&\n excludedRelationship.followedBy ? (\n Mutual\n ) : excludedRelationship.requested ? (\n Requested\n ) : excludedRelationship.following ? (\n Following\n ) : excludedRelationship.followedBy ? (\n Follows you\n ) : null}\n
\n
\n )}\n {!!followersCount && (\n \n {shortenNumber(followersCount)}{' '}\n {followersCount === 1 ? 'follower' : 'followers'}\n \n )}\n {!!verifiedField && (\n \n {' '}\n \n \n )}\n
\n )}\n
\n \n );\n}\n\nexport default AccountBlock;\n","import { satisfies } from 'compare-versions';\n\nimport features from '../data/features.json';\n\nimport { getCurrentInstance } from './store-utils';\n\nconst supportsCache = {};\n\nfunction supports(feature) {\n try {\n const { version, domain } = getCurrentInstance();\n const key = `${domain}-${feature}`;\n if (supportsCache[key]) return supportsCache[key];\n const range = features[feature];\n if (!range) return false;\n return (supportsCache[key] = satisfies(version, range, {\n includePrerelease: true,\n loose: true,\n }));\n } catch (e) {\n return false;\n }\n}\n\nexport default supports;\n","import './translation-block.css';\n\nimport pRetry from 'p-retry';\nimport pThrottle from 'p-throttle';\nimport { useEffect, useRef, useState } from 'preact/hooks';\n\nimport sourceLanguages from '../data/lingva-source-languages';\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport localeCode2Text from '../utils/localeCode2Text';\nimport pmem from '../utils/pmem';\n\nimport Icon from './icon';\nimport Loader from './loader';\n\nconst { PHANPY_LINGVA_INSTANCES } = import.meta.env;\nconst LINGVA_INSTANCES = PHANPY_LINGVA_INSTANCES\n ? PHANPY_LINGVA_INSTANCES.split(/\\s+/)\n : [];\n\nconst throttle = pThrottle({\n limit: 1,\n interval: 2000,\n});\n\nlet currentLingvaInstance = 0;\n\nfunction _lingvaTranslate(text, source, target) {\n console.log('TRANSLATE', text, source, target);\n const fetchCall = () => {\n let instance = LINGVA_INSTANCES[currentLingvaInstance];\n return fetch(\n `https://${instance}/api/v1/${source}/${target}/${encodeURIComponent(\n text,\n )}`,\n )\n .then((res) => {\n if (!res.ok) throw new Error(res.statusText);\n return res.json();\n })\n .then((res) => {\n return {\n provider: 'lingva',\n content: res.translation,\n detectedSourceLanguage: res.info?.detectedSource,\n info: res.info,\n };\n });\n };\n return pRetry(fetchCall, {\n retries: 3,\n onFailedAttempt: (e) => {\n currentLingvaInstance =\n (currentLingvaInstance + 1) % LINGVA_INSTANCES.length;\n console.log(\n 'Retrying translation with another instance',\n currentLingvaInstance,\n );\n },\n });\n // return masto.v1.statuses.$select(id).translate({\n // lang: DEFAULT_LANG,\n // });\n}\nconst TRANSLATED_MAX_AGE = 1000 * 60 * 60; // 1 hour\nconst lingvaTranslate = pmem(_lingvaTranslate, {\n maxAge: TRANSLATED_MAX_AGE,\n});\nconst throttledLingvaTranslate = pmem(throttle(lingvaTranslate), {\n // I know, this is double-layered memoization\n maxAge: TRANSLATED_MAX_AGE,\n});\n\nfunction TranslationBlock({\n forceTranslate,\n sourceLanguage,\n onTranslate,\n text = '',\n mini,\n}) {\n const targetLang = getTranslateTargetLanguage(true);\n const [uiState, setUIState] = useState('default');\n const [pronunciationContent, setPronunciationContent] = useState(null);\n const [translatedContent, setTranslatedContent] = useState(null);\n const [detectedLang, setDetectedLang] = useState(null);\n const detailsRef = useRef();\n\n const sourceLangText = sourceLanguage\n ? localeCode2Text(sourceLanguage)\n : null;\n const targetLangText = localeCode2Text(targetLang);\n const apiSourceLang = useRef('auto');\n\n if (!onTranslate) {\n onTranslate = mini ? throttledLingvaTranslate : lingvaTranslate;\n }\n\n const translate = async () => {\n setUIState('loading');\n try {\n const { content, detectedSourceLanguage, provider, error, ...props } =\n await onTranslate(text, apiSourceLang.current, targetLang);\n if (content) {\n if (detectedSourceLanguage) {\n const detectedLangText = localeCode2Text(detectedSourceLanguage);\n setDetectedLang(detectedLangText);\n }\n if (provider === 'lingva') {\n const pronunciation = props?.info?.pronunciation?.query;\n if (pronunciation) {\n setPronunciationContent(pronunciation);\n }\n }\n setTranslatedContent(content);\n setUIState('default');\n if (!mini && content.trim() !== text.trim()) {\n detailsRef.current.open = true;\n detailsRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }\n } else {\n if (error) console.error(error);\n setUIState('error');\n }\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n };\n\n useEffect(() => {\n if (forceTranslate) {\n translate();\n }\n }, [forceTranslate]);\n\n if (mini) {\n if (\n !!translatedContent &&\n translatedContent.trim() !== text.trim() &&\n detectedLang !== targetLangText\n ) {\n return (\n
\n
\n
\n \n \n {translatedContent}\n \n
\n
\n
\n );\n }\n return null;\n }\n\n return (\n {\n e.preventDefault();\n }}\n >\n
\n \n {\n e.preventDefault();\n e.stopPropagation();\n detailsRef.current.open = !detailsRef.current.open;\n if (uiState === 'loading') return;\n if (!translatedContent) translate();\n }}\n >\n {' '}\n \n {uiState === 'loading'\n ? 'Translating…'\n : sourceLanguage && sourceLangText && !detectedLang\n ? `Translate from ${sourceLangText}`\n : `Translate`}\n \n \n \n
\n
\n {\n apiSourceLang.current = e.target.value;\n translate();\n }}\n >\n {sourceLanguages.map((l) => (\n \n ))}\n {' '}\n → {targetLangText}\n
\n {uiState === 'error' ? (\n

Failed to translate

\n ) : (\n !!translatedContent && (\n <>\n \n {translatedContent}\n \n {!!pronunciationContent && (\n {\n e.target.classList.toggle('expand');\n }}\n >\n {pronunciationContent}\n \n )}\n \n )\n )}\n
\n
\n \n );\n}\n\nexport default LINGVA_INSTANCES?.length ? TranslationBlock : () => null;\n","import {\n clear,\n createStore,\n del,\n delMany,\n get,\n getMany,\n keys,\n set,\n} from 'idb-keyval';\n\nconst draftsStore = createStore('drafts-db', 'drafts-store');\n\n// Add additonal `draftsStore` parameter to all methods\n\nconst drafts = {\n set: (key, val) => set(key, val, draftsStore),\n get: (key) => get(key, draftsStore),\n getMany: (keys) => getMany(keys, draftsStore),\n del: (key) => del(key, draftsStore),\n delMany: (keys) => delMany(keys, draftsStore),\n clear: () => clear(draftsStore),\n keys: () => keys(draftsStore),\n};\n\nexport default {\n drafts,\n};\n","export default {\n public: 'earth',\n unlisted: 'group',\n private: 'lock',\n direct: 'message',\n};\n","import { useState } from 'preact/hooks';\n\nimport shortenNumber from '../utils/shorten-number';\n\nimport EmojiText from './emoji-text';\nimport Icon from './icon';\nimport RelativeTime from './relative-time';\n\nexport default function Poll({\n poll,\n lang,\n readOnly,\n refresh = () => {},\n votePoll = () => {},\n}) {\n const [uiState, setUIState] = useState('default');\n const {\n expired,\n expiresAt,\n id,\n multiple,\n options,\n ownVotes,\n voted,\n votersCount,\n votesCount,\n emojis,\n } = poll;\n const expiresAtDate = !!expiresAt && new Date(expiresAt); // Update poll at point of expiry\n // NOTE: Disable this because setTimeout runs immediately if delay is too large\n // https://stackoverflow.com/a/56718027/20838\n // useEffect(() => {\n // let timeout;\n // if (!expired && expiresAtDate) {\n // const ms = expiresAtDate.getTime() - Date.now() + 1; // +1 to give it a little buffer\n // if (ms > 0) {\n // timeout = setTimeout(() => {\n // setUIState('loading');\n // (async () => {\n // // await refresh();\n // setUIState('default');\n // })();\n // }, ms);\n // }\n // }\n // return () => {\n // clearTimeout(timeout);\n // };\n // }, [expired, expiresAtDate]);\n\n const pollVotesCount = votersCount || votesCount;\n let roundPrecision = 0;\n\n if (pollVotesCount <= 1000) {\n roundPrecision = 0;\n } else if (pollVotesCount <= 10000) {\n roundPrecision = 1;\n } else if (pollVotesCount <= 100000) {\n roundPrecision = 2;\n }\n\n const [showResults, setShowResults] = useState(false);\n const optionsHaveVoteCounts = options.every((o) => o.votesCount !== null);\n\n return (\n \n {(showResults && optionsHaveVoteCounts) || voted || expired ? (\n <>\n
\n {options.map((option, i) => {\n const { title, votesCount: optionVotesCount } = option;\n const percentage = pollVotesCount\n ? ((optionVotesCount / pollVotesCount) * 100).toFixed(\n roundPrecision,\n )\n : 0; // check if current poll choice is the leading one\n\n const isLeading =\n optionVotesCount > 0 &&\n optionVotesCount ===\n Math.max(...options.map((o) => o.votesCount));\n return (\n \n
\n \n \n \n {voted && ownVotes.includes(i) && (\n <>\n {' '}\n \n \n )}\n
\n \n {percentage}%\n
\n \n );\n })}\n \n {!expired && !voted && (\n {\n e.preventDefault();\n setShowResults(false);\n }}\n >\n Hide results\n \n )}\n \n ) : (\n {\n e.preventDefault();\n const form = e.target;\n const formData = new FormData(form);\n const choices = [];\n formData.forEach((value, key) => {\n if (key === 'poll') {\n choices.push(value);\n }\n });\n if (!choices.length) return;\n setUIState('loading');\n await votePoll(choices);\n setUIState('default');\n }}\n >\n
\n {options.map((option, i) => {\n const { title } = option;\n return (\n
\n \n
\n );\n })}\n
\n {!readOnly && (\n \n Vote\n \n )}\n \n )}\n

\n {!expired && !readOnly && (\n {\n e.preventDefault();\n setUIState('loading');\n\n (async () => {\n await refresh();\n setUIState('default');\n })();\n }}\n title=\"Refresh\"\n >\n \n \n )}\n {!voted && !expired && !readOnly && optionsHaveVoteCounts && (\n {\n e.preventDefault();\n setShowResults(!showResults);\n }}\n title={showResults ? 'Hide results' : 'Show results'}\n >\n {' '}\n \n )}\n {!expired && !readOnly && ' '}\n {shortenNumber(votesCount)} vote\n {votesCount === 1 ? '' : 's'}\n {!!votersCount && votersCount !== votesCount && (\n <>\n {' '}\n • \n {shortenNumber(votersCount)}\n {' '}\n voter\n {votersCount === 1 ? '' : 's'}\n \n )}{' '}\n • {expired ? 'Ended' : 'Ending'}{' '}\n {!!expiresAtDate && }\n

{' '}\n \n );\n}\n","import { createContext } from 'preact';\n\nconst FilterContext = createContext();\nexport default FilterContext;\n","import mem from './mem';\nimport store from './store';\n\nfunction _isFiltered(filtered, filterContext) {\n if (!filtered?.length) return false;\n const appliedFilters = filtered.filter((f) => {\n const { filter } = f;\n const hasContext = filter.context.includes(filterContext);\n if (!hasContext) return false;\n if (!filter.expiresAt) return hasContext;\n return new Date(filter.expiresAt) > new Date();\n });\n if (!appliedFilters.length) return false;\n const isHidden = appliedFilters.some((f) => f.filter.filterAction === 'hide');\n if (isHidden)\n return {\n action: 'hide',\n };\n const isWarn = appliedFilters.some((f) => f.filter.filterAction === 'warn');\n if (isWarn) {\n const filterTitles = appliedFilters.map((f) => f.filter.title);\n return {\n action: 'warn',\n titles: filterTitles,\n titlesStr: filterTitles.join(' • '),\n };\n }\n return false;\n}\nexport const isFiltered = mem(_isFiltered);\n\nexport function filteredItem(item, filterContext, currentAccountID) {\n const { filtered } = item;\n if (!filtered?.length) return true;\n const isSelf = currentAccountID && item.account?.id === currentAccountID;\n if (isSelf) return true;\n const filterState = isFiltered(filtered, filterContext);\n if (!filterState) return true;\n if (filterState.action === 'hide') return false;\n // item._filtered = filterState;\n return true;\n}\nexport function filteredItems(items, filterContext) {\n if (!items?.length) return [];\n if (!filterContext) return items;\n const currentAccountID = store.session.get('currentAccount');\n return items.filter((item) =>\n filteredItem(item, filterContext, currentAccountID),\n );\n}\n","const div = document.createElement('div');\nexport default function htmlContentLength(html) {\n if (!html) return 0;\n div.innerHTML = html;\n // .invisible spans for links\n // e.g. https://mastodon.social\n div.querySelectorAll('.invisible').forEach((el) => {\n el.remove();\n });\n return div.innerText.length;\n}\n","export const supportsTTS = 'speechSynthesis' in window;\n\nexport function speak(text, lang) {\n if (!supportsTTS) return;\n try {\n if (speechSynthesis.speaking) {\n speechSynthesis.cancel();\n }\n const utterance = new SpeechSynthesisUtterance(text);\n if (lang) utterance.lang = lang;\n speechSynthesis.speak(utterance);\n } catch (e) {\n alert(e);\n }\n}\n","import getHTMLText from './getHTMLText';\n\nfunction statusPeek(status) {\n const { spoilerText, content, poll, mediaAttachments } = status;\n let text = '';\n if (spoilerText?.trim()) {\n text += spoilerText;\n } else {\n text += getHTMLText(content);\n }\n text = text.trim();\n if (poll) {\n text += ' 📊';\n }\n if (mediaAttachments?.length) {\n text +=\n ' ' +\n mediaAttachments\n .map(\n (m) =>\n ({\n image: '🖼️',\n gifv: '🎞️',\n video: '📹',\n audio: '🎵',\n unknown: '',\n }[m.type] || ''),\n )\n .join('');\n }\n return text;\n}\n\nexport default statusPeek;\n","import { useRef } from 'preact/hooks';\nimport { useThrottledCallback } from 'use-debounce';\nimport useResizeObserver from 'use-resize-observer';\n\nexport default function useTruncated({ className = 'truncated' } = {}) {\n const ref = useRef();\n const onResize = useThrottledCallback(({ height }) => {\n if (ref.current) {\n const { scrollHeight } = ref.current;\n let truncated = scrollHeight > height;\n if (truncated) {\n const { height: _height, maxHeight } = getComputedStyle(ref.current);\n const computedHeight = parseInt(maxHeight || _height, 10);\n truncated = scrollHeight > computedHeight;\n }\n ref.current.classList.toggle(className, truncated);\n }\n }, 300);\n useResizeObserver({\n ref,\n box: 'border-box',\n onResize,\n });\n return ref;\n}\n","import { getBlurHashAverageColor } from 'fast-blurhash';\nimport { Fragment } from 'preact';\nimport {\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport QuickPinchZoom, { make3dTransformValue } from 'react-quick-pinch-zoom';\n\nimport mem from '../utils/mem';\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Link from './link';\nimport { formatDuration } from './status';\n\nconst isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // https://stackoverflow.com/a/23522755\n\n/*\nMedia type\n===\nunknown = unsupported or unrecognized file type\nimage = Static image\ngifv = Looping, soundless animation\nvideo = Video clip\naudio = Audio track\n*/\n\nconst dataAltLabel = 'ALT';\nconst AltBadge = (props) => {\n const { alt, lang, index, ...rest } = props;\n if (!alt || !alt.trim()) return null;\n return (\n {\n e.stopPropagation();\n e.preventDefault();\n states.showMediaAlt = {\n alt,\n lang,\n };\n }}\n title=\"Media description\"\n >\n {dataAltLabel}\n {!!index && {index}}\n \n );\n};\n\nconst MEDIA_CAPTION_LIMIT = 140;\nexport const isMediaCaptionLong = mem((caption) =>\n caption?.length\n ? caption.length > MEDIA_CAPTION_LIMIT ||\n /[\\n\\r].*[\\n\\r]/.test(caption.trim())\n : false,\n);\n\nfunction Media({\n class: className = '',\n media,\n to,\n lang,\n showOriginal,\n autoAnimate,\n showCaption,\n altIndex,\n onClick = () => {},\n}) {\n const {\n blurhash,\n description,\n meta,\n previewRemoteUrl,\n previewUrl,\n remoteUrl,\n url,\n type,\n } = media;\n const { original = {}, small, focus } = meta || {};\n\n const width = showOriginal ? original?.width : small?.width;\n const height = showOriginal ? original?.height : small?.height;\n const mediaURL = showOriginal ? url : previewUrl || url;\n const remoteMediaURL = showOriginal\n ? remoteUrl\n : previewRemoteUrl || remoteUrl;\n const orientation = width >= height ? 'landscape' : 'portrait';\n\n const rgbAverageColor = blurhash ? getBlurHashAverageColor(blurhash) : null;\n\n const videoRef = useRef();\n\n let focalPosition;\n if (focus) {\n // Convert focal point to CSS background position\n // Formula from jquery-focuspoint\n // x = -1, y = 1 => 0% 0%\n // x = 0, y = 0 => 50% 50%\n // x = 1, y = -1 => 100% 100%\n const x = ((focus.x + 1) / 2) * 100;\n const y = ((1 - focus.y) / 2) * 100;\n focalPosition = `${x.toFixed(0)}% ${y.toFixed(0)}%`;\n }\n\n const mediaRef = useRef();\n const onUpdate = useCallback(({ x, y, scale }) => {\n const { current: media } = mediaRef;\n\n if (media) {\n const value = make3dTransformValue({ x, y, scale });\n\n if (scale === 1) {\n media.style.removeProperty('transform');\n } else {\n media.style.setProperty('transform', value);\n }\n\n media.closest('.media-zoom').style.touchAction =\n scale <= 1.01 ? 'pan-x' : '';\n }\n }, []);\n\n const [pinchZoomEnabled, setPinchZoomEnabled] = useState(false);\n const quickPinchZoomProps = {\n enabled: pinchZoomEnabled,\n draggableUnZoomed: false,\n inertiaFriction: 0.9,\n doubleTapZoomOutOnMaxScale: true,\n containerProps: {\n className: 'media-zoom',\n style: {\n overflow: 'visible',\n // width: 'inherit',\n // height: 'inherit',\n // justifyContent: 'inherit',\n // alignItems: 'inherit',\n // display: 'inherit',\n },\n },\n onUpdate,\n };\n\n const Parent = useMemo(\n () => (to ? (props) => : 'div'),\n [to],\n );\n\n const isVideoMaybe =\n type === 'unknown' &&\n /\\.(mp4|m4a|m4p|m4b|m4r|m4v|mov|webm)$/i.test(remoteMediaURL);\n const isImage =\n type === 'image' || (type === 'unknown' && previewUrl && !isVideoMaybe);\n\n const parentRef = useRef();\n const [imageSmallerThanParent, setImageSmallerThanParent] = useState(false);\n useLayoutEffect(() => {\n if (!isImage) return;\n if (!showOriginal) return;\n if (!parentRef.current) return;\n const { offsetWidth, offsetHeight } = parentRef.current;\n const smaller = width < offsetWidth && height < offsetHeight;\n if (smaller) setImageSmallerThanParent(smaller);\n }, [width, height]);\n\n const maxAspectHeight =\n window.innerHeight * (orientation === 'portrait' ? 0.45 : 0.33);\n const maxHeight = orientation === 'portrait' ? 0 : 160;\n const averageColorStyle = {\n '--average-color': rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n };\n const mediaStyles =\n width && height\n ? {\n '--width': `${width}px`,\n '--height': `${height}px`,\n // Calculate '--aspectWidth' based on aspect ratio calculated from '--width' and '--height', max height has to be 160px\n '--aspectWidth': `${\n (width / height) * Math.max(maxHeight, maxAspectHeight)\n }px`,\n aspectRatio: `${width} / ${height}`,\n ...averageColorStyle,\n }\n : {\n ...averageColorStyle,\n };\n\n const longDesc = isMediaCaptionLong(description);\n const showInlineDesc =\n !!showCaption && !showOriginal && !!description && !longDesc;\n const Figure = !showInlineDesc\n ? Fragment\n : (props) => {\n const { children, ...restProps } = props;\n return (\n
\n {children}\n {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: description,\n lang,\n };\n }}\n >\n {description}\n \n
\n );\n };\n\n if (isImage) {\n // Note: type: unknown might not have width/height\n quickPinchZoomProps.containerProps.style.display = 'inherit';\n\n useLayoutEffect(() => {\n if (!isSafari) return;\n if (!showOriginal) return;\n (async () => {\n try {\n await fetch(mediaURL, { mode: 'no-cors' });\n mediaRef.current.src = mediaURL;\n } catch (e) {\n // Ignore\n }\n })();\n }, [mediaURL]);\n\n return (\n
\n \n {showOriginal ? (\n \n {\n e.target.closest('.media-image').style.backgroundImage = '';\n e.target.closest('.media-zoom').style.display = '';\n setPinchZoomEnabled(true);\n }}\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL && mediaURL !== remoteMediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n \n ) : (\n <>\n {\n // e.target.closest('.media-image').style.backgroundImage = '';\n e.target.dataset.loaded = true;\n }}\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL && mediaURL !== remoteMediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n {!showInlineDesc && (\n \n )}\n \n )}\n \n
\n );\n } else if (type === 'gifv' || type === 'video' || isVideoMaybe) {\n const shortDuration = original.duration < 31;\n const isGIF = type === 'gifv' && shortDuration;\n // If GIF is too long, treat it as a video\n const loopable = original.duration < 61;\n const formattedDuration = formatDuration(original.duration);\n const hoverAnimate = !showOriginal && !autoAnimate && isGIF;\n const autoGIFAnimate = !showOriginal && autoAnimate && isGIF;\n const showProgress = original.duration > 5;\n\n const videoHTML = `\n \n `;\n\n return (\n
\n {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n onClick(e);\n }}\n onMouseEnter={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.play();\n } catch (e) {}\n }\n }}\n onMouseLeave={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n }}\n onFocus={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.play();\n } catch (e) {}\n }\n }}\n onBlur={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n }}\n >\n {showOriginal || autoGIFAnimate ? (\n isGIF && showOriginal ? (\n \n \n \n ) : (\n \n )\n ) : isGIF ? (\n {\n const { target } = e;\n const container = target?.closest('.media-gif');\n if (container) {\n const percentage =\n (target.currentTime / target.duration) * 100;\n container.style.setProperty(\n '--progress',\n `${percentage}%`,\n );\n }\n }\n : undefined\n }\n />\n ) : (\n <>\n \n
\n \n
\n \n )}\n {!showOriginal && !showInlineDesc && (\n \n )}\n \n
\n );\n } else if (type === 'audio') {\n const formattedDuration = formatDuration(original.duration);\n return (\n
\n \n {showOriginal ? (\n
\n );\n }\n}\n\nexport default Media;\n","import { FocusableItem } from '@szhsin/react-menu';\n\nimport Link from './link';\n\nfunction MenuLink(props) {\n return (\n \n {({ ref, closeMenu }) => (\n \n closeMenu(detail === 0 ? 'Enter' : undefined)\n }\n />\n )}\n \n );\n}\n\nexport default MenuLink;\n","import './status.css';\n\nimport '@justinribeiro/lite-youtube';\nimport {\n ControlledMenu,\n Menu,\n MenuDivider,\n MenuHeader,\n MenuItem,\n} from '@szhsin/react-menu';\nimport { decodeBlurHash, getBlurHashAverageColor } from 'fast-blurhash';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport { useLongPress } from 'use-long-press';\nimport { useSnapshot } from 'valtio';\n\nimport AccountBlock from '../components/account-block';\nimport EmojiText from '../components/emoji-text';\nimport Loader from '../components/loader';\nimport Menu2 from '../components/menu2';\nimport MenuConfirm from '../components/menu-confirm';\nimport Modal from '../components/modal';\nimport NameText from '../components/name-text';\nimport Poll from '../components/poll';\nimport { api } from '../utils/api';\nimport emojifyText from '../utils/emojify-text';\nimport enhanceContent from '../utils/enhance-content';\nimport FilterContext from '../utils/filter-context';\nimport { isFiltered } from '../utils/filters';\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport getHTMLText from '../utils/getHTMLText';\nimport handleContentLinks from '../utils/handle-content-links';\nimport htmlContentLength from '../utils/html-content-length';\nimport isMastodonLinkMaybe from '../utils/isMastodonLinkMaybe';\nimport localeMatch from '../utils/locale-match';\nimport niceDateTime from '../utils/nice-date-time';\nimport openCompose from '../utils/open-compose';\nimport pmem from '../utils/pmem';\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\nimport shortenNumber from '../utils/shorten-number';\nimport showToast from '../utils/show-toast';\nimport { speak, supportsTTS } from '../utils/speech';\nimport states, { getStatus, saveStatus, statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport store from '../utils/store';\nimport unfurlMastodonLink from '../utils/unfurl-link';\nimport useTruncated from '../utils/useTruncated';\nimport visibilityIconsMap from '../utils/visibility-icons-map';\n\nimport Avatar from './avatar';\nimport Icon from './icon';\nimport Link from './link';\nimport Media from './media';\nimport { isMediaCaptionLong } from './media';\nimport MenuLink from './menu-link';\nimport RelativeTime from './relative-time';\nimport TranslationBlock from './translation-block';\n\nconst SHOW_COMMENT_COUNT_LIMIT = 280;\nconst INLINE_TRANSLATE_LIMIT = 140;\n\nfunction fetchAccount(id, masto) {\n return masto.v1.accounts.$select(id).fetch();\n}\nconst memFetchAccount = pmem(fetchAccount);\n\nconst visibilityText = {\n public: 'Public',\n unlisted: 'Unlisted',\n private: 'Followers only',\n direct: 'Private mention',\n};\n\nconst isIOS =\n window.ontouchstart !== undefined &&\n /iPad|iPhone|iPod/.test(navigator.userAgent);\n\nconst REACTIONS_LIMIT = 80;\n\nfunction getPollText(poll) {\n if (!poll?.options?.length) return '';\n return `📊:\\n${poll.options\n .map(\n (option) =>\n `- ${option.title}${\n option.votesCount >= 0 ? ` (${option.votesCount})` : ''\n }`,\n )\n .join('\\n')}`;\n}\nfunction getPostText(status) {\n const { spoilerText, content, poll } = status;\n return (\n (spoilerText ? `${spoilerText}\\n\\n` : '') +\n getHTMLText(content) +\n getPollText(poll)\n );\n}\n\nfunction Status({\n statusID,\n status,\n instance: propInstance,\n size = 'm',\n contentTextWeight,\n readOnly,\n enableCommentHint,\n withinContext,\n skeleton,\n enableTranslate,\n forceTranslate: _forceTranslate,\n previewMode,\n // allowFilters,\n onMediaClick,\n quoted,\n onStatusLinkClick = () => {},\n showFollowedTags,\n}) {\n if (skeleton) {\n return (\n
\n \n
\n
███ ████████
\n
\n
\n

████ ████████

\n
\n
\n
\n
\n );\n }\n const { masto, instance, authenticated } = api({ instance: propInstance });\n const { instance: currentInstance } = api();\n const sameInstance = instance === currentInstance;\n\n let sKey = statusKey(statusID || status?.id, 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 tags,\n // Non-API props\n _deleted,\n _pinned,\n // _filtered,\n } = status;\n\n const currentAccount = useMemo(() => {\n return store.session.get('currentAccount');\n }, []);\n const isSelf = useMemo(() => {\n return currentAccount && currentAccount === accountId;\n }, [accountId, currentAccount]);\n\n const filterContext = useContext(FilterContext);\n const filterInfo =\n !isSelf && !readOnly && !previewMode && isFiltered(filtered, filterContext);\n\n if (filterInfo?.action === 'hide') {\n return null;\n }\n\n console.debug('RENDER Status', id, status?.account.displayName, quoted);\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...status,\n });\n }\n };\n\n if (/*allowFilters && */ size !== 'l' && filterInfo) {\n return (\n \n );\n }\n\n const createdAtDate = new Date(createdAt);\n const editedAtDate = new Date(editedAt);\n\n let inReplyToAccountRef = mentions?.find(\n (mention) => mention.id === inReplyToAccountId,\n );\n if (!inReplyToAccountRef && inReplyToAccountId === id) {\n inReplyToAccountRef = { url: accountURL, username, displayName };\n }\n const [inReplyToAccount, setInReplyToAccount] = useState(inReplyToAccountRef);\n if (!withinContext && !inReplyToAccount && inReplyToAccountId) {\n const account = states.accounts[inReplyToAccountId];\n if (account) {\n setInReplyToAccount(account);\n } else {\n memFetchAccount(inReplyToAccountId, masto)\n .then((account) => {\n setInReplyToAccount(account);\n states.accounts[account.id] = account;\n })\n .catch((e) => {});\n }\n }\n const mentionSelf =\n inReplyToAccountId === currentAccount ||\n mentions?.find((mention) => mention.id === currentAccount);\n\n const readingExpandSpoilers = useMemo(() => {\n const prefs = store.account.get('preferences') || {};\n return !!prefs['reading:expand:spoilers'];\n }, []);\n const readingExpandMedia = useMemo(() => {\n // default | show_all | hide_all\n // Ignore hide_all because it means hide *ALL* media including non-sensitive ones\n const prefs = store.account.get('preferences') || {};\n return prefs['reading:expand:media'] || 'default';\n }, []);\n // FOR TESTING:\n // const readingExpandSpoilers = true;\n // const readingExpandMedia = 'show_all';\n const showSpoiler =\n previewMode || readingExpandSpoilers || !!snapStates.spoilers[id];\n const showSpoilerMedia =\n previewMode ||\n readingExpandMedia === 'show_all' ||\n !!snapStates.spoilersMedia[id];\n\n if (reblog) {\n // If has statusID, means useItemID (cached in states)\n\n if (group) {\n return (\n \n
\n {' '}\n \n
\n \n \n );\n }\n\n return (\n \n
\n {' '}\n {' '}\n boosted\n
\n \n \n );\n }\n\n // Check followedTags\n if (showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length) {\n return (\n \n
\n {' '}\n {snapStates.statusFollowedTags[sKey].slice(0, 3).map((tag) => (\n \n {tag}\n \n ))}\n
\n \n \n );\n }\n\n const isSizeLarge = size === 'l';\n\n const [forceTranslate, setForceTranslate] = useState(_forceTranslate);\n const targetLanguage = getTranslateTargetLanguage(true);\n const contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages || [];\n const { contentTranslation, contentTranslationAutoInline } =\n snapStates.settings;\n if (!contentTranslation) enableTranslate = false;\n const inlineTranslate = useMemo(() => {\n if (\n !contentTranslation ||\n !contentTranslationAutoInline ||\n readOnly ||\n (withinContext && !isSizeLarge) ||\n previewMode ||\n spoilerText ||\n sensitive ||\n poll ||\n card ||\n mediaAttachments?.length\n ) {\n return false;\n }\n const contentLength = htmlContentLength(content);\n return contentLength > 0 && contentLength <= INLINE_TRANSLATE_LIMIT;\n }, [\n contentTranslation,\n contentTranslationAutoInline,\n readOnly,\n withinContext,\n isSizeLarge,\n previewMode,\n spoilerText,\n sensitive,\n poll,\n card,\n mediaAttachments,\n content,\n ]);\n\n const [showEdited, setShowEdited] = useState(false);\n\n const spoilerContentRef = useTruncated();\n const contentRef = useTruncated();\n const mediaContainerRef = useTruncated();\n const readMoreText = 'Read more →';\n\n const statusRef = useRef(null);\n\n const unauthInteractionErrorMessage = `Sorry, your current logged-in instance can't interact with this post from another instance.`;\n\n const textWeight = useCallback(\n () =>\n Math.max(\n Math.round((spoilerText.length + htmlContentLength(content)) / 140) ||\n 1,\n 1,\n ),\n [spoilerText, content],\n );\n\n const createdDateText = niceDateTime(createdAtDate);\n const editedDateText = editedAt && niceDateTime(editedAtDate);\n\n // Can boost if:\n // - authenticated AND\n // - visibility != direct OR\n // - visibility = private AND isSelf\n let canBoost =\n authenticated && visibility !== 'direct' && visibility !== 'private';\n if (visibility === 'private' && isSelf) {\n canBoost = true;\n }\n\n const replyStatus = (e) => {\n if (!sameInstance || !authenticated) {\n return alert(unauthInteractionErrorMessage);\n }\n // syntheticEvent comes from MenuItem\n if (e?.shiftKey || e?.syntheticEvent?.shiftKey) {\n const newWin = openCompose({\n replyToStatus: status,\n });\n if (newWin) return;\n }\n states.showCompose = {\n replyToStatus: status,\n };\n };\n\n // Check if media has no descriptions\n const mediaNoDesc = useMemo(() => {\n return mediaAttachments.some(\n (attachment) => !attachment.description?.trim?.(),\n );\n }, [mediaAttachments]);\n const boostStatus = async () => {\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n if (!reblogged) {\n let confirmText = 'Boost this post?';\n if (mediaNoDesc) {\n confirmText += '\\n\\n⚠️ Some media have no descriptions.';\n }\n const yes = confirm(confirmText);\n if (!yes) {\n return false;\n }\n }\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n reblogged: !reblogged,\n reblogsCount: reblogsCount + (reblogged ? -1 : 1),\n };\n if (reblogged) {\n const newStatus = await masto.v1.statuses.$select(id).unreblog();\n saveStatus(newStatus, instance);\n return true;\n } else {\n const newStatus = await masto.v1.statuses.$select(id).reblog();\n saveStatus(newStatus, instance);\n return true;\n }\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const confirmBoostStatus = async () => {\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n reblogged: !reblogged,\n reblogsCount: reblogsCount + (reblogged ? -1 : 1),\n };\n if (reblogged) {\n const newStatus = await masto.v1.statuses.$select(id).unreblog();\n saveStatus(newStatus, instance);\n return true;\n } else {\n const newStatus = await masto.v1.statuses.$select(id).reblog();\n saveStatus(newStatus, instance);\n return true;\n }\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n\n const favouriteStatus = async () => {\n if (!sameInstance || !authenticated) {\n return alert(unauthInteractionErrorMessage);\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n favourited: !favourited,\n favouritesCount: favouritesCount + (favourited ? -1 : 1),\n };\n if (favourited) {\n const newStatus = await masto.v1.statuses.$select(id).unfavourite();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).favourite();\n saveStatus(newStatus, instance);\n }\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n }\n };\n\n const bookmarkStatus = async () => {\n if (!sameInstance || !authenticated) {\n return alert(unauthInteractionErrorMessage);\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n bookmarked: !bookmarked,\n };\n if (bookmarked) {\n const newStatus = await masto.v1.statuses.$select(id).unbookmark();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).bookmark();\n saveStatus(newStatus, instance);\n }\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n }\n };\n\n const differentLanguage =\n !!language &&\n language !== targetLanguage &&\n !localeMatch([language], [targetLanguage]) &&\n !contentTranslationHideLanguages.find(\n (l) => language === l || localeMatch([language], [l]),\n );\n\n const reblogIterator = useRef();\n const favouriteIterator = useRef();\n async function fetchBoostedLikedByAccounts(firstLoad) {\n if (firstLoad) {\n reblogIterator.current = masto.v1.statuses\n .$select(statusID)\n .rebloggedBy.list({\n limit: REACTIONS_LIMIT,\n });\n favouriteIterator.current = masto.v1.statuses\n .$select(statusID)\n .favouritedBy.list({\n limit: REACTIONS_LIMIT,\n });\n }\n const [{ value: reblogResults }, { value: favouriteResults }] =\n await Promise.allSettled([\n reblogIterator.current.next(),\n favouriteIterator.current.next(),\n ]);\n if (reblogResults.value?.length || favouriteResults.value?.length) {\n const accounts = [];\n if (reblogResults.value?.length) {\n accounts.push(\n ...reblogResults.value.map((a) => {\n a._types = ['reblog'];\n return a;\n }),\n );\n }\n if (favouriteResults.value?.length) {\n accounts.push(\n ...favouriteResults.value.map((a) => {\n a._types = ['favourite'];\n return a;\n }),\n );\n }\n return {\n value: accounts,\n done: reblogResults.done && favouriteResults.done,\n };\n }\n return {\n value: [],\n done: true,\n };\n }\n\n const menuInstanceRef = useRef();\n const StatusMenuItems = (\n <>\n {!isSizeLarge && (\n <>\n \n \n {' '}\n {visibilityText[visibility]}\n {' '}\n \n {repliesCount > 0 && (\n \n {' '}\n {shortenNumber(repliesCount)}\n \n )}{' '}\n {reblogsCount > 0 && (\n \n {' '}\n {shortenNumber(reblogsCount)}\n \n )}{' '}\n {favouritesCount > 0 && (\n \n {' '}\n {shortenNumber(favouritesCount)}\n \n )}\n \n
\n {createdDateText}\n
\n {\n onStatusLinkClick(e, status);\n }}\n >\n \n View post by @{username || acct}\n \n \n )}\n {!!editedAt && (\n {\n setShowEdited(id);\n }}\n >\n \n \n Show Edit History\n
\n Edited: {editedDateText}\n
\n \n )}\n {(!isSizeLarge || !!editedAt) && }\n {isSizeLarge && (\n {\n states.showGenericAccounts = {\n heading: 'Boosted/Liked by…',\n fetchAccounts: fetchBoostedLikedByAccounts,\n instance,\n showReactions: true,\n };\n }}\n >\n \n \n Boosted/Liked by\n \n \n )}\n {!isSizeLarge && sameInstance && (\n <>\n
\n \n \n {reblogged ? 'Unboost?' : 'Boost to everyone?'}\n \n }\n menuFooter={\n mediaNoDesc &&\n !reblogged && (\n
\n \n Some media have no descriptions.\n
\n )\n }\n disabled={!canBoost}\n onClick={async () => {\n try {\n const done = await confirmBoostStatus();\n if (!isSizeLarge && done) {\n showToast(\n reblogged\n ? `Unboosted @${username || acct}'s post`\n : `Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n }}\n >\n \n {reblogged ? 'Unboost' : 'Boost…'}\n \n {\n try {\n favouriteStatus();\n if (!isSizeLarge) {\n showToast(\n favourited\n ? `Unliked @${username || acct}'s post`\n : `Liked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n }}\n >\n \n {favourited ? 'Unlike' : 'Like'}\n \n
\n
\n \n \n Reply\n \n {\n try {\n bookmarkStatus();\n if (!isSizeLarge) {\n showToast(\n bookmarked\n ? `Unbookmarked @${username || acct}'s post`\n : `Bookmarked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n }}\n >\n \n {bookmarked ? 'Unbookmark' : 'Bookmark'}\n \n
\n \n )}\n {enableTranslate ? (\n
\n {\n setForceTranslate(true);\n }}\n >\n \n Translate\n \n {supportsTTS && (\n {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n }}\n >\n \n Speak\n \n )}\n
\n ) : (\n (!language || differentLanguage) && (\n
\n \n \n Translate\n \n {supportsTTS && (\n {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n }}\n >\n \n Speak\n \n )}\n
\n )\n )}\n {((!isSizeLarge && sameInstance) || enableTranslate) && }\n \n \n {nicePostURL(url)}\n \n
\n {\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(url);\n showToast('Link copied');\n } catch (e) {\n console.error(e);\n showToast('Unable to copy link');\n }\n }}\n >\n \n Copy\n \n {navigator?.share &&\n navigator?.canShare?.({\n url,\n }) && (\n {\n try {\n navigator.share({\n url,\n });\n } catch (e) {\n console.error(e);\n alert(\"Sharing doesn't seem to work.\");\n }\n }}\n >\n \n Share…\n \n )}\n
\n {(isSelf || mentionSelf) && }\n {(isSelf || mentionSelf) && (\n {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [muted ? 'unmute' : 'mute']();\n saveStatus(newStatus, instance);\n showToast(muted ? 'Conversation unmuted' : 'Conversation muted');\n } catch (e) {\n console.error(e);\n showToast(\n muted\n ? 'Unable to unmute conversation'\n : 'Unable to mute conversation',\n );\n }\n }}\n >\n {muted ? (\n <>\n \n Unmute conversation\n \n ) : (\n <>\n \n Mute conversation\n \n )}\n \n )}\n {isSelf && (\n
\n {\n states.showCompose = {\n editStatus: status,\n };\n }}\n >\n \n Edit\n \n {isSizeLarge && (\n \n \n Delete this post?\n \n }\n menuItemClassName=\"danger\"\n onClick={() => {\n // const yes = confirm('Delete this post?');\n // if (yes) {\n (async () => {\n try {\n await masto.v1.statuses.$select(id).remove();\n const cachedStatus = getStatus(id, instance);\n cachedStatus._deleted = true;\n showToast('Deleted');\n } catch (e) {\n console.error(e);\n showToast('Unable to delete');\n }\n })();\n // }\n }}\n >\n \n Delete…\n \n )}\n
\n )}\n \n );\n\n const contextMenuRef = useRef();\n const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);\n const [contextMenuProps, setContextMenuProps] = useState({});\n\n const showContextMenu = !isSizeLarge && !previewMode && !_deleted && !quoted;\n\n // Only iOS/iPadOS browsers don't support contextmenu\n // Some comments report iPadOS might support contextmenu if a mouse is connected\n const bindLongPressContext = useLongPress(\n isIOS && showContextMenu\n ? (e) => {\n if (e.pointerType === 'mouse') return;\n // There's 'pen' too, but not sure if contextmenu event would trigger from a pen\n\n const { clientX, clientY } = e.touches?.[0] || e;\n // link detection copied from onContextMenu because here it works\n const link = e.target.closest('a');\n if (link && /^https?:\\/\\//.test(link.getAttribute('href'))) return;\n e.preventDefault();\n setContextMenuProps({\n anchorPoint: {\n x: clientX,\n y: clientY,\n },\n direction: 'right',\n });\n setIsContextMenuOpen(true);\n }\n : null,\n {\n threshold: 600,\n captureEvent: true,\n detect: 'touch',\n cancelOnMovement: 2, // true allows movement of up to 25 pixels\n },\n );\n\n const hotkeysEnabled = !readOnly && !previewMode && !quoted;\n const rRef = useHotkeys('r, shift+r', replyStatus, {\n enabled: hotkeysEnabled,\n });\n const fRef = useHotkeys(\n 'f, l',\n () => {\n try {\n favouriteStatus();\n if (!isSizeLarge) {\n showToast(\n favourited\n ? `Unliked @${username || acct}'s post`\n : `Liked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n },\n {\n enabled: hotkeysEnabled,\n },\n );\n const dRef = useHotkeys(\n 'd',\n () => {\n try {\n bookmarkStatus();\n if (!isSizeLarge) {\n showToast(\n bookmarked\n ? `Unbookmarked @${username || acct}'s post`\n : `Bookmarked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n },\n {\n enabled: hotkeysEnabled,\n },\n );\n const bRef = useHotkeys(\n 'shift+b',\n () => {\n (async () => {\n try {\n const done = await confirmBoostStatus();\n if (!isSizeLarge && done) {\n showToast(\n reblogged\n ? `Unboosted @${username || acct}'s post`\n : `Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n })();\n },\n {\n enabled: hotkeysEnabled && canBoost,\n },\n );\n const xRef = useHotkeys('x', (e) => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n if (activeStatus) {\n const spoilerButton = activeStatus.querySelector(\n '.spoiler-button:not(.spoiling)',\n );\n if (spoilerButton) {\n e.stopPropagation();\n spoilerButton.click();\n } else {\n const spoilerMediaButton = activeStatus.querySelector(\n '.spoiler-media-button:not(.spoiling)',\n );\n if (spoilerMediaButton) {\n e.stopPropagation();\n spoilerMediaButton.click();\n }\n }\n }\n });\n\n const displayedMediaAttachments = mediaAttachments.slice(\n 0,\n isSizeLarge ? undefined : 4,\n );\n const showMultipleMediaCaptions =\n mediaAttachments.length > 1 &&\n displayedMediaAttachments.some(\n (media) => !!media.description && !isMediaCaptionLong(media.description),\n );\n const captionChildren = useMemo(() => {\n if (!showMultipleMediaCaptions) return null;\n const attachments = [];\n displayedMediaAttachments.forEach((media, i) => {\n if (!media.description) return;\n const index = attachments.findIndex(\n (attachment) => attachment.media.description === media.description,\n );\n if (index === -1) {\n attachments.push({\n media,\n indices: [i],\n });\n } else {\n attachments[index].indices.push(i);\n }\n });\n return attachments.map(({ media, indices }) => (\n i + 1).join(' ')}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: media.description,\n lang: language,\n };\n }}\n title={media.description}\n >\n {indices.map((i) => i + 1).join(' ')} {media.description}\n \n ));\n\n // return displayedMediaAttachments.map(\n // (media, i) =>\n // !!media.description && (\n // {\n // e.preventDefault();\n // e.stopPropagation();\n // states.showMediaAlt = {\n // alt: media.description,\n // lang: language,\n // };\n // }}\n // title={media.description}\n // >\n // {i + 1} {media.description}\n // \n // ),\n // );\n }, [showMultipleMediaCaptions, displayedMediaAttachments, language]);\n\n const isThread = useMemo(() => {\n return (\n (!!inReplyToId && inReplyToAccountId === status.account?.id) ||\n !!snapStates.statusThreadNumber[sKey]\n );\n }, [\n inReplyToId,\n inReplyToAccountId,\n status.account?.id,\n snapStates.statusThreadNumber[sKey],\n ]);\n\n const showCommentHint = useMemo(() => {\n return (\n enableCommentHint &&\n !isThread &&\n !withinContext &&\n !inReplyToId &&\n visibility === 'public' &&\n repliesCount > 0\n );\n }, [\n enableCommentHint,\n isThread,\n withinContext,\n inReplyToId,\n repliesCount,\n visibility,\n ]);\n const showCommentCount = useMemo(() => {\n if (\n card ||\n poll ||\n sensitive ||\n spoilerText ||\n mediaAttachments?.length ||\n isThread ||\n withinContext ||\n inReplyToId ||\n repliesCount <= 0\n ) {\n return false;\n }\n const questionRegex = /[???︖❓❔⁇⁈⁉¿‽؟]/;\n const containsQuestion = questionRegex.test(content);\n if (!containsQuestion) return false;\n const contentLength = htmlContentLength(content);\n if (contentLength > 0 && contentLength <= SHOW_COMMENT_COUNT_LIMIT) {\n return true;\n }\n }, [\n card,\n poll,\n sensitive,\n spoilerText,\n mediaAttachments,\n reblog,\n isThread,\n withinContext,\n inReplyToId,\n repliesCount,\n content,\n ]);\n\n return (\n {\n statusRef.current = node;\n // Use parent node if it's in focus\n // Use case: \n // When navigating (j/k), the is focused instead of \n // Hotkey binding doesn't bubble up thus this hack\n const nodeRef =\n node?.closest?.(\n '.timeline-item, .timeline-item-alt, .status-link, .status-focus',\n ) || node;\n rRef.current = nodeRef;\n fRef.current = nodeRef;\n dRef.current = nodeRef;\n bRef.current = nodeRef;\n xRef.current = nodeRef;\n }}\n tabindex=\"-1\"\n class={`status ${\n !withinContext && inReplyToId && inReplyToAccount\n ? 'status-reply-to'\n : ''\n } visibility-${visibility} ${_pinned ? 'status-pinned' : ''} ${\n {\n s: 'small',\n m: 'medium',\n l: 'large',\n }[size]\n } ${_deleted ? 'status-deleted' : ''} ${quoted ? 'status-card' : ''}`}\n onMouseEnter={debugHover}\n onContextMenu={(e) => {\n // FIXME: this code isn't getting called on Chrome at all?\n if (!showContextMenu) return;\n if (e.metaKey) return;\n // console.log('context menu', e);\n const link = e.target.closest('a');\n if (link && /^https?:\\/\\//.test(link.getAttribute('href'))) return;\n e.preventDefault();\n setContextMenuProps({\n anchorPoint: {\n x: e.clientX,\n y: e.clientY,\n },\n direction: 'right',\n });\n setIsContextMenuOpen(true);\n }}\n {...(showContextMenu ? bindLongPressContext() : {})}\n >\n {showContextMenu && (\n {\n setIsContextMenuOpen(false);\n // statusRef.current?.focus?.();\n if (e?.reason === 'click') {\n statusRef.current?.closest('[tabindex]')?.focus?.();\n }\n }}\n portal={{\n target: document.body,\n }}\n containerProps={{\n style: {\n // Higher than the backdrop\n zIndex: 1001,\n },\n onClick: () => {\n contextMenuRef.current?.closeMenu?.();\n },\n }}\n overflow=\"auto\"\n boundingBoxPadding={safeBoundingBoxPadding()}\n unmountOnClose\n >\n {StatusMenuItems}\n \n )}\n {size !== 'l' && (\n
\n {reblogged && }\n {favourited && }\n {bookmarked && }\n {_pinned && }\n
\n )}\n {size !== 's' && (\n {\n e.preventDefault();\n e.stopPropagation();\n states.showAccount = {\n account: status.account,\n instance,\n };\n }}\n >\n \n
\n )}\n
\n
\n \n \n \n {/* {inReplyToAccount && !withinContext && size !== 's' && (\n <>\n {' '}\n \n {' '}\n \n \n \n )} */}\n {/* */}{' '}\n {size !== 'l' &&\n (_deleted ? (\n Deleted\n ) : url && !previewMode && !quoted ? (\n {\n if (\n e.metaKey ||\n e.ctrlKey ||\n e.shiftKey ||\n e.altKey ||\n e.which === 2\n ) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n onStatusLinkClick?.(e, status);\n setContextMenuProps({\n anchorRef: {\n current: e.currentTarget,\n },\n align: 'end',\n direction: 'bottom',\n gap: 4,\n });\n setIsContextMenuOpen(true);\n }}\n class={`time ${\n isContextMenuOpen && contextMenuProps?.anchorRef\n ? 'is-open'\n : ''\n }`}\n >\n {showCommentHint && !showCommentCount ? (\n \n ) : (\n \n )}{' '}\n \n \n ) : (\n // {\n // if (e.target === e.currentTarget)\n // menuInstanceRef.current?.closeMenu?.();\n // },\n // }}\n // align=\"end\"\n // gap={4}\n // overflow=\"auto\"\n // viewScroll=\"close\"\n // boundingBoxPadding=\"8 8 8 8\"\n // unmountOnClose\n // menuButton={({ open }) => (\n // {\n // e.preventDefault();\n // e.stopPropagation();\n // onStatusLinkClick?.(e, status);\n // }}\n // class={`time ${open ? 'is-open' : ''}`}\n // >\n // {' '}\n // \n // \n // )}\n // >\n // {StatusMenuItems}\n // \n \n {' '}\n \n \n ))}\n
\n {visibility === 'direct' && (\n <>\n
Private mention
{' '}\n \n )}\n {!withinContext && (\n <>\n {isThread ? (\n
\n \n Thread\n {snapStates.statusThreadNumber[sKey]\n ? ` ${snapStates.statusThreadNumber[sKey]}/X`\n : ''}\n
\n ) : (\n !!inReplyToId &&\n !!inReplyToAccount &&\n (!!spoilerText ||\n !mentions.find((mention) => {\n return mention.id === inReplyToAccountId;\n })) && (\n
\n {' '}\n \n
\n )\n )}\n \n )}\n \n {!!spoilerText && (\n <>\n \n

\n \n

\n
\n {readingExpandSpoilers || previewMode ? (\n
\n Content warning\n
\n ) : (\n {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoiler) {\n delete states.spoilers[id];\n if (!readingExpandSpoilers) {\n delete states.spoilersMedia[id];\n }\n } else {\n states.spoilers[id] = true;\n if (!readingExpandSpoilers) {\n states.spoilersMedia[id] = true;\n }\n }\n }}\n >\n {' '}\n {showSpoiler ? 'Show less' : 'Show content'}\n \n )}\n \n )}\n {!!content && (\n
\n {\n // Remove target=\"_blank\" from links\n dom\n .querySelectorAll('a.u-url[target=\"_blank\"]')\n .forEach((a) => {\n if (!/http/i.test(a.innerText.trim())) {\n a.removeAttribute('target');\n }\n });\n // if (previewMode) return;\n // Unfurl Mastodon links\n // Array.from(\n // dom.querySelectorAll(\n // 'a[href]:not(.u-url):not(.mention):not(.hashtag)',\n // ),\n // )\n // .filter((a) => {\n // const url = a.href;\n // const isPostItself =\n // url === status.url || url === status.uri;\n // return !isPostItself && isMastodonLinkMaybe(url);\n // })\n // .forEach((a, i) => {\n // unfurlMastodonLink(currentInstance, a.href).then(\n // (result) => {\n // if (!result) return;\n // a.removeAttribute('target');\n // if (!sKey) return;\n // if (!Array.isArray(states.statusQuotes[sKey])) {\n // states.statusQuotes[sKey] = [];\n // }\n // if (!states.statusQuotes[sKey][i]) {\n // states.statusQuotes[sKey].splice(i, 0, result);\n // }\n // },\n // );\n // });\n },\n }),\n }}\n />\n \n
\n )}\n {!!poll && (\n {\n states.statuses[sKey].poll = newPoll;\n }}\n refresh={() => {\n return masto.v1.polls\n .$select(poll.id)\n .fetch()\n .then((pollResponse) => {\n states.statuses[sKey].poll = pollResponse;\n })\n .catch((e) => {}); // Silently fail\n }}\n votePoll={(choices) => {\n return masto.v1.polls\n .$select(poll.id)\n .votes.create({\n choices,\n })\n .then((pollResponse) => {\n states.statuses[sKey].poll = pollResponse;\n })\n .catch((e) => {}); // Silently fail\n }}\n />\n )}\n {(((enableTranslate || inlineTranslate) &&\n !!content.trim() &&\n !!getHTMLText(emojifyText(content, emojis)) &&\n differentLanguage) ||\n forceTranslate) && (\n \n )}\n {!previewMode &&\n sensitive &&\n !!mediaAttachments.length &&\n readingExpandMedia !== 'show_all' && (\n