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AM,QAAAhJ,CAAO,CAAE,CAE1D,CAED,OAAOgN,CACR,CACH,CAEA2C,GAAK,QAAU,QACfA,GAAK,YAAc1F,GACnB0F,GAAK,WAAaxF,GAClBwF,GAAK,OAAS7G,EAGZ6G,GAAK,WAAanhE,GAIlBigE,GAASL,EAAc","names":["_extends","n","e","t","r","reservedModifierKeywords","mappedKeys","mapKey","key","isHotkeyModifier","parseKeysHookInput","keys","splitKey","parseHotkey","hotkey","combinationKey","description","k","modifiers","singleCharKeys","pushToCurrentlyPressedKeys","removeFromCurrentlyPressedKeys","currentlyPressedKeys","isReadonlyArray","value","isHotkeyPressed","hotkeyArray","maybePreventDefault","preventDefault","isHotkeyEnabled","enabled","isKeyboardEventTriggeredByInput","ev","isHotkeyEnabledOnTag","event","enabledOnTags","target","composed","targetTagName","isCustomElement","tag","_targetTagName","element","isScopeActive","activeScopes","scopes","scope","isHotkeyMatchingKeyboardEvent","ignoreModifiers","alt","meta","mod","shift","ctrl","pressedKeyUppercase","code","ctrlKey","metaKey","shiftKey","altKey","keyCode","pressedKey","BoundHotkeysProxyProvider","createContext","useBoundHotkeysProxy","useContext","deepEqual","x","y","isEqual","HotkeysContext","useHotkeysContext","useDeepEqualMemo","ref","useRef","stopPropagation","useSafeLayoutEffect","useLayoutEffect","useEffect","useHotkeys","callback","options","dependencies","_useState","useState","setRef","hasTriggeredRef","_options","_keys","_deps","memoisedCB","useCallback","cbRef","memoisedOptions","_useHotkeysContext","enabledScopes","proxy","listener","isKeyUp","_e$target","rootNode","_hotkey$keys","handleKeyDown","handleKeyUp","domNode","root","factory","module","this","global","Toastify","version","divElement","property","avatarElement","closeElement","width","self","getAxisOffsetAValue","xOffset","yOffset","rootElement","elementToInsert","toastElement","topLeftOffsetSize","topRightOffsetSize","offsetSize","allToasts","classUsed","i","containsClass","height","offset","axis","elem","yourClass","window","_showToast","showToast","props","text","onClick","delay","rest","toast","className","destination","gravity","position","setTimeout","useInterval","fn","deps","immediate","savedCallback","current","id","setInterval","tick","clearInterval","openCompose","opts","url","URL","parse","location","screenWidth","screenHeight","screen","left","Math","max","top","min","winUID","uid","random","newWin","open","__COMPOSE__","alert","_i18n","_","isSafari","test","navigator","userAgent","openOSK","fauxEl","document","createElement","style","opacity","body","appendChild","focus","removeChild","ICONS","__vitePreload","heart","bookmark","check-circle","x-circle","transfer","rocket","rtl","arrow-up","arrow-down","earth","lock","unlock","eye-close","eye-open","message","comment","comment2","home","notification","follow","follow-add","poll","pencil","quill","at","attachment","upload","gear","more","more2","external","popout","popin","rotate","plus","chevron-down","reply","flip","thread","group","bot","menu","list","search","hashtag","info","shortcut","user","following","pin","unpin","bus","link","history","share","sparkles","sparkles2","exit","translate","play","trash","mute","unmute","block","unblock","flag","time","refresh","emoji2","filter","filters","chart","react","layout4","layout5","announce","round","arrow-up-circle","arrow-down-circle","clipboard","account-edit","account-warning","keyboard","cloud","month","media","speak","building","history2","copy","quote","settings","heart-break","user-x","minimize","celebrate","SIZES","s","m","l","xl","xxl","ICONDATA","SVGICon","moize","_jsx","viewBox","dangerouslySetInnerHTML","__html","transform","isShallowEqual","maxSize","Object","length","matchesArg","cacheKeyArg","keyArg","icon","Icon","size","title","class","iconSize","iconBlock","warn","Array","iconData","setIconData","currentIcon","iconB","useCloseWatcher","watcher","CloseWatcher","addEventListener","destroy","useCloseWatcher$1","$modalContainer","getElementById","getBackdropThemeColor","getComputedStyle","documentElement","getPropertyValue","Modal","children","onClose","minimized","modalRef","timer","focusElement","querySelector","clearTimeout","supportsCloseWatcher","escRef","keydown","keyup","$deckContainers","querySelectorAll","page","tabIndex","forEach","$deckContainer","setAttribute","removeAttribute","$meta","metaColor","store","local","get","backdropColor","console","colorScheme","log","content","Modal2","_a","node","_b","createPortal","ReactPropTypesSecret","ReactPropTypesSecret_1","require$$0","emptyFunction","emptyFunctionWithReset","factoryWithThrowingShims","shim","propName","componentName","propFullName","secret","err","getShim","ReactPropTypes","ReactIs","throwOnDirectAccess","propTypesModule","isMenuOpen","state","batchedUpdates","unstable_batchedUpdates","getTransition","transition","name","safeCall","arg","internalKey","getName","component","mergeProps","source","targetProp","sourceProp","parsePadding","paddingStr","padding","right","getScrollAncestor","overflow","overflowX","overflowY","commonProps","isDisabled","isHovering","indexOfNode","nodeList","stylePropTypes","oneOfType","string","func","menuPropTypes","object","bool","number","oneOf","rootMenuPropTypes","exact","uncontrolledMenuPropTypes","useBEM","useMemo","blockElement","classString","expandedClassName","menuContainerClass","menuClass","menuArrowClass","menuItemClass","menuDividerClass","menuHeaderClass","menuGroupClass","subMenuClass","HoverItemContext","MenuListItemContext","MenuListContext","EventHandlersContext","RadioGroupContext","SettingsContext","Keys","HoverActionTypes","CloseReason","FocusPositions","MenuStateMap","positionAbsolute","roleNone","roleMenuitem","MenuContainer","containerRef","containerProps","isOpen","theming","itemTransition","jsx","createSubmenuCtx","count","closeDelay","pending","settled","useItems","menuRef","focusRef","hoverItem","setHoverItem","mutableState","updateItems","item","isMounted","items","index","dispatch","actionType","nextIndex","hoverIndex","sortItems","orderedNodes","a","newItem","prevItem","getNativeDimension","transformed","untransformed","getNormalizedClientRect","rect","getPositionHelpers","menuScroll","boundingBoxPadding","menuRect","containerRect","boundingRect","getLeftOverflow","getRightOverflow","getTopOverflow","getBottomOverflow","leftOverflow","rightOverflow","topOverflow","bottomOverflow","placeArrowVertical","arrowRef","menuY","anchorRect","placeLeftorRight","placeLeftorRightY","placeLeftX","placeRightX","confineHorizontally","confineVertically","arrow","direction","computedDirection","placeArrowHorizontal","menuX","placeToporBottom","placeToporBottomX","placeTopY","placeBottomY","positionMenu","align","gap","positionHelpers","isHorizontal","horizontalOffset","verticalOffset","arrowElt","useIsomorphicLayoutEffect","instance","useCombinedRef","refA","refB","offScreen","MenuList","ariaLabel","menuClassName","menuStyle","arrowProps","anchorPoint","anchorRef","focusProps","externalRef","parentScrollingRef","setDownOverflow","repositionFlag","captureFocus","endTransition","menuItemFocus","restProps","menuPosition","setMenuPosition","arrowPosition","setArrowPosition","overflowData","setOverflowData","expandedDirection","setExpandedDirection","submenuCtx","reposSubmenu","forceReposSubmenu","useReducer","c","boundingBoxRef","rootMenuRef","rootAnchorRef","scrollNodesRef","reposition","viewScroll","submenuCloseDelay","parentSubmenuCtx","reposFlag","prevOpen","openTransition","closeTransition","scrollNodes","onKeyDown","onAnimationEnd","onPointerMove","onPointerLeave","handlePosition","noOverflowCheck","_anchorRef$current","arrowX","arrowY","menuHeight","overflowAmt","anchorScroll","scroll","handleScroll","scrollObservers","o","hasOverflow","parentScroll","targetList","resizeObserver","entries","flushSync","resizeObserverOptions","anchor","alwaysUpdate","setItemFocus","menuElt","itemContext","maxHeight","listContext","overflowStyle","arrowModifiers","_arrowClassName","ControlledMenu","forwardRef","initialMounted","unmountOnClose","transitionTimeout","submenuOpenDelay","portal","onItemClick","eventHandlers","isCheckorRadio","keepOpen","menuList","PRE_ENTER","ENTERING","ENTERED","PRE_EXIT","EXITING","EXITED","UNMOUNTED","STATUS","getState","status","startOrEnd","unmounted","getEndStatus","unmountOnExit","getTimeout","timeout","nextTick","transitState","updateState","setState","latestState","timeoutId","onChange","useTransitionState","enter","preEnter","preExit","initialEntered","mountOnEnter","enterTimeout","exitTimeout","toggle","toEnter","enterStage","useMenuState","initialOpen","toggleMenu","useTransition","useMenuStateAndFocus","menuProps","setMenuItemFocus","openMenu","useClick","onToggle","skipOpen","useMenuChange","onMenuChange","Menu","_1","menuButton","instanceRef","stateProps","buttonRef","anchorProps","handleClose","button","buttonProps","renderButton","cloneElement","useImperativeHandle","Fragment","withHovering","WrappedComponent","Component","memo","WithHovering","itemRef","useItemEffect","SubMenu","disabled","label","openTrigger","_2","itemProps","parentMenuRef","parentDir","parentOverflow","isParentOpen","isPortal","_openMenu","timerId","stopTimer","args","setHover","delayOpen","onKeyDownOfRoot","handled","externalItemRef","itemClassName","restItemProps","mergedItemProps","getMenuList","container","useItemState","unsetHover","onBlur","keepHover","MenuItem","href","type","checked","restStateProps","radioGroup","isRadio","isCheckBox","isAnchor","isChecked","handleClick","mergedProps","menuItemProps","FocusableItem","renderChildren","MenuDivider","MenuHeader","MenuGroup","takeOverflow","setOverflowStyle","xxxl","alphaCache","canvas","OffscreenCanvas","ctx","getContext","willReadFrequently","imageSmoothingEnabled","MISSING_IMAGE_PATH_REGEX","Avatar","squircle","avatarRef","isMissing","src","loading","decoding","fetchPriority","crossOrigin","undefined","onError","onLoad","dataset","loaded","drawImage","allPixels","getImageData","hasAlpha","data","pixel","classList","add","clearRect","mem","Link","routerLocation","useLocation","hash","replace","trim","to","includes","parsedHash","origin","searchParams","searchParamsStr","from","map","encodeURIComponent","join","pathname","isActive","decodeURIComponent","currentTarget","parentNode","closest","prevLocation","IS_RTL","observer","MutationObserver","mutations","mutation","dir","isRTL","observe","defaultBoundingBoxPadding","safeAreaInsets","getSafeAreaInsets","safeAreaInsetTop","safeAreaInsetRight","safeAreaInsetBottom","safeAreaInsetLeft","parseInt","requestAnimationFrame","safeBoundingBoxPadding","paddings","v","CSS","supports","passive","useWindowSize","setSize","handleResize","innerWidth","innerHeight","removeEventListener","Menu2","_instanceRef","rtlAlign","closeMenu","SubMenu2","pointerType","MenuConfirm","subMenu","confirm","confirmLabel","menuItemClassName","menuFooter","menuExtras","_jsxs","MenuLink","detail","CustomEmoji","staticUrl","srcset","shortcodesRegexp","shortcodes","RegExp","EmojiText","emojis","indexOf","regex","shortcode","elements","split","word","emoji","find","nameCollator","locale","sensitivity","Intl","Collator","ACCT_REGEX","SHORTCODES_REGEX","SPACES_REGEX","NON_ALPHA_NUMERIC_REGEX","NameText","account","showAvatar","showAcct","short","i18n","useLingui","acct","avatar","avatarStatic","displayName","username","acct1","acct2","match","api","trimmedUsername","toLowerCase","trimmedDisplayName","shortenedDisplayName","shortenedAlphaNumericDisplayName","hideUsername","compare","which","internalURL","states","showAccount","_Fragment","codeMappings","zh_HANT","IntlDN","DisplayNames","_localeCode2Text","fallback","of","anotherText","localeCode2Text","isValidDate","Date","isNaN","getTime","date","resolvedLocale","DateTimeFormat","resolvedOptions","DTF","regionlessLocale","lang","localeMatch","RTF","RelativeTimeFormat","minute","hour","day","rtfFromNow","rtf","seconds","now","absSeconds","abs","format","floor","twitterFromNow","values","0","RelativeTime","datetime","renderCount","rerender","dateStr","dt","str","getFullYear","year","dateStyle","toISOString","toLocaleString","raf","rafRerender","scheduleRerender","cancelAnimationFrame","locales","languages","localeTargetLanguages","translationTargetLanguages","getTranslateTargetLanguage","fromSettings","contentTranslationTargetLanguage","BYTES_UNITS","prettyBytes","bytes","unitIndex","log2","unit","unitDisplay","maximumFractionDigits","semver","validateAndParse","isWildcard","tryParse","forceType","b","compareStrings","ap","bp","compareSegments","compareVersions","v1","v2","n1","n2","p1","p2","operator","assertValidOperator","res","operatorResMap","allowedOperators","op","satisfies","range","v3","vp","r1","r2","r3","rp","nonZero","containPixelfed","notContainPixelfed","containPleroma","containAkkoma","platformFeatures","supportsCache","feature","domain","getCurrentInstance","softwareName","getCurrentNodeInfo","software","features","doesSoftwareMatch","includePrerelease","loose","maxInt","base","tMin","tMax","skew","damp","initialBias","initialN","delimiter","regexPunycode","regexNonASCII","regexSeparators","errors","baseMinusTMin","stringFromCharCode","error","array","result","mapDomain","parts","labels","encoded","ucs2decode","output","counter","extra","ucs2encode","codePoints","basicToDigit","codePoint","digitToBasic","digit","adapt","delta","numPoints","firstTime","decode","input","inputLength","bias","basic","j","oldi","w","baseMinusT","out","encode","currentValue","basicLength","handledCPCount","handledCPCountPlusOne","q","qMinusT","toUnicode","toASCII","punycode","emojifyText","fauxDiv","whitelistLinkClasses","HTML_CHARS_REGEX","escapeHTML","html","LINK_REGEX","HTTP_LINK_REGEX","MENTION_REGEX","HASHTAG_REGEX","CODE_BLOCK_REGEX","CODE_BLOCK_START_REGEX","CODE_BLOCK_END_REGEX","INLINE_CODE_REGEX","TWITTER_DOMAIN_REGEX","TWITTER_MENTION_REGEX","TWITTER_MENTION_CAPTURE_REGEX","CODE_INLINE_CAPTURE_REGEX","createDOM","isDocumentFragment","tpl","innerHTML","_enhanceContent","returnDOM","postEnhanceDOM","enhancedContent","dom","hasLink","hasCodeBlock","noTargetBlankLinks","links","remove","textContent","shortenLink","usernames","innerText","hasChildren","some","u","d","push","slice","textNodes","extractTextNodes","nodeValue","replaceWith","childNodes","blocks","p","pre","br","codeBlocks","nextParagraphs","currentBlock","nextElementSibling","next","tagName","codeText","replaceAll","rejectFilter","prevIndex","hashtagStuffedParagraphs","hashtagCount","nodeType","Node","TEXT_NODE","linkText","startsWith","imgs","img","getAttribute","naturalWidth","naturalHeight","setProperty","span","replaceChild","queueMicrotask","enhanceContent","defaultRejectFilter","defaultRejectFilterMap","fromEntries","nodeName","URL_PREFIX_REGEX","URL_DISPLAY_LENGTH","prefix","displayURL","suffix","cutoff","rejectFilterMap","assign","reduce","acc","cur","walk","createTreeWalker","NodeFilter","SHOW_TEXT","acceptNode","FILTER_REJECT","FILTER_ACCEPT","nextNode","div","getHTMLText","preProcess","el","append","handleContentLinks","mentions","previewMode","statusURL","prevText","previousSibling","textBeforeLinkIsAt","endsWith","textStartsWithAt","contains","targetText","mention","textBeforeLinkIsHash","hashURL","i18nDuration","duration","defaultLocale","_DateTimeFormat","dateYear","hideTime","formatOpts","forceOpts","loc","currentYear","niceDateTime","dtfOpts","shortenNumber","num","notation","roundingMode","TOAST_DURATION","showCompose","composerState","AccountBlock","skeleton","avatarSize","useAvatarStatic","internal","showActivity","showStats","accountInstance","hideDisplayName","relationship","excludeRelationshipAttrs","_useLingui","statusesCount","lastStatusAt","fields","note","followersCount","createdAt","locked","verifiedField","f","verifiedAt","excludedRelationship","hasRelationship","followedBy","requested","_t","_Trans","components","RetryOperation","timeouts","retry_operation","currentTime","timeoutOps","counts","mainError","mainErrorCount","exports","attempt","obj","methods","method","original","retry","objectToString","isError","errorMessages","isNetworkError","AbortError","decorateErrorWithCounts","attemptNumber","retriesLeft","pRetry","resolve","reject","operation","abortHandler","cleanUp","finalError","__defProp","__defNormalProp","__publicField","observerMap","RootIds","rootId","unsupportedValue","getRootId","optionsToId","createObserver","thresholds","entry","inView","threshold","fallbackInView","bounds","callbacks","isPlainChildren","InView","React.Component","prevProps","rootMargin","trackVisibility","as","triggerOnce","skip","initialInView","React.createElement","useInView","React2.useState","React2.useRef","React2.useEffect","unobserve","entryTarget","previousEntryTarget","TOP","shazamIDs","LazyShazam","hasID","visible","setVisible","visibleStart","setVisibleStart","getBoundingClientRect","bottom","hidden","PHANPY_LINGVA_INSTANCES","import","LINGVA_INSTANCES","throttle","pThrottle","limit","interval","currentLingvaInstance","_lingvaTranslate","fetchCall","fetch","ok","provider","translation","detectedSourceLanguage","detectedSource","retries","onFailedAttempt","TRANSLATED_MAX_AGE","lingvaTranslate","pmem","forceTranslate","sourceLanguage","onTranslate","mini","autoDetected","uiState","setUIState","targetLang","setTranslatedContent","pronunciationContent","detailsRef","translatedContent","sourceLangText","targetLangText","apiSourceLang","detectedLangText","setDetectedLang","pronunciation","query","setPronunciationContent","detectedLang","sourceLanguages","common","showCommon","native","abrupt","TranslationBlock$1","TranslationBlock","promisifyRequest","request","createStore","dbName","storeName","dbp","txMode","db","defaultGetStoreFunc","defaultGetStore","customStore","set","getMany","del","delMany","clear","eachCursor","cursor","initDB","val","drafts","catchup","fetchRelationships","accounts","relationshipsMap","masto","currentAccount","getCurrentAccountID","uniqueAccountIds","relationships","LiteYTEmbed","shadowDom","nonce","oldVal","newVal","isIntersectionObserver","autoplay","wantsNoCookie","embedTarget","iframeHTML","posterUrlWebp","posterUrlJpeg","kind","linkElem","context","digitLookup","decode83","start","end","pow","PI","PI2","sRGBToLinear","linearTosRGB","signSqr","fastCos","cos","getBlurHashAverageColor","blurHash","decodeBlurHash","punch","sizeFlag","numX","numY","g","basis","basisY","colorIndex","pixelIndex","maximumValue","colors","averageColor","cosinesY","cosinesX","bytesPerRow","pixels","addIndentation_1","splittedHtml","char","level","opened","indented","elTag","newIndented","removeEmptyLines","nonFormattedString","toLines","markup","splittedMarkup","mergedLines","currentElement","line","addIndentation","mergeAttributesWithElements","require$$1","splitted","A","z","U","X","Y","R","G","J","M","C","L","P","I","T","E","h","B","D","Poll","readOnly","votePoll","expired","expiresAt","multiple","ownVotes","voted","votersCount","votesCount","expiresAtDate","pollVotesCount","roundPrecision","showResults","setShowResults","optionsHaveVoteCounts","every","option","optionVotesCount","ratio","percentage","isLeading","onSubmit","form","formData","FormData","choices","1","FilterContext","_isFiltered","filtered","filterContext","appliedFilters","hasContext","filterAction","action","filterTitles","titles","titlesStr","isFiltered","filteredItem","currentAccountID","filterState","filteredItems","htmlContentLength","supportsTTS","speechSynthesis","speaking","cancel","utterance","SpeechSynthesisUtterance","statusPeek","spoilerText","mediaAttachments","image","gifv","video","audio","unknown","F","useResolvedElement","subscriber","refOrElement","lastReportRef","refOrElementRef","cbElementRef","evaluateSubscription","cbElement","extractSize","boxProp","sizeType","useResizeObserver","onResize","onResizeRef","resizeObserverRef","didUnmount","previous","refCallback","reportedWidth","reportedHeight","newWidth","newHeight","newSize","useTruncated","useThrottledCallback","scrollHeight","truncated","_height","computedHeight","box","visibilityIconsMap","public","unlisted","private","direct","styleRoot","styleChild","styles","isSsr","isTouch","make3dTransformValue","scale","getOffsetBounds","containerDimension","childDimension","centerContained","diff","classnames","other","sqrt","isMac","isDragInteraction","isZoomInteraction","isZoomGesture","wheelEvent","cancelEvent","getDistance","calculateScale","startTouches","endTouches","startDistance","endDistance","isCloseTo","expected","swing","getPointByPageCoordinates","touch","getPageCoordinatesByTouches","touches","sum","getVectorAvg","vectors","clamp","shouldInterceptWheel","getElementSize","offsetWidth","offsetHeight","calculateVelocity","startPoint","endPoint","comparePoints","noup","zeroPoint","PinchZoom","_super","__extends","_this","__assign","createRef","clickEvent","touchEndEvent","touchStartEvent","touchMoveEvent","pageX","pageY","deltaY","deltaMode","scaleDelta","likeTouchEvent","center","dScale","inertiaFriction","inertia","renderFrame","prevOffset","currentCoordinates","prevPoint","newScale","touchCenter","needZoomOut","zoomFactor","startZoomFactor","updateProgress","progress","elWidth","elHeight","minOffsetX","maxOffsetX","_c","minOffsetY","maxOffsetY","__x","__y","animated","startOffset","containerCenter","diffZoomFactor","diffOffset","updateFrame","originalZoomFactor","lastCenter","sanitizedOffset","targetOffset","scaleFactor","offsetLeft","offsetTop","_document","_html","_body","scrollTop","scrollLeft","posTop","posLeft","frameFn","startTime","timeFn","frameTime","xZoomFactor","yZoomFactor","eventName","_i","newInteraction","interaction","fingers","mouseEvent","isEnd","isStart","child","Children","React","any","formatDuration","hours","minutes","toString","padStart","dataAltLabel","AltBadge","showMediaAlt","MEDIA_CAPTION_LIMIT","MEDIA_CAPTION_LIMIT_LONGER","isMediaCaptionLong","caption","Media","showOriginal","autoAnimate","showCaption","allowLongerCaption","altIndex","checkAspectRatio","blurhash","previewRemoteUrl","previewUrl","remoteUrl","small","mediaURL","remoteMediaURL","hasDimensions","orientation","rgbAverageColor","videoRef","focalPosition","toFixed","mediaRef","onUpdate","removeProperty","touchAction","pinchZoomEnabled","setPinchZoomEnabled","quickPinchZoomProps","draggableUnZoomed","tapZoomFactor","doubleTapToggleZoom","Parent","remoteMediaURLObj","getURLObj","isVideoMaybe","isAudioMaybe","isImage","parentRef","imageSmallerThanParent","setImageSmallerThanParent","smaller","maxAspectHeight","averageColorStyle","mediaStyles","aspectRatio","longDesc","showInlineDesc","Figure","hasNaturalAspectRatio","setHasNaturalAspectRatio","display","mode","backgroundImage","backgroundSize","QuickPinchZoom","objectPosition","$media","clientWidth","clientHeight","minDimension","hasSmallDimension","displayNaturalHeight","hasDuration","shortDuration","isGIF","loopable","formattedDuration","hoverAnimate","autoGIFAnimate","showProgress","gifHTML","videoHTML","pause","onMouseEnter","onMouseLeave","onFocus","poster","preload","playsinline","loop","muted","onTimeUpdate","disablePictureInPicture","onLoadedMetadata","controls","autoPlay","oldProps","newProps","oldMedia","newMedia","SHOW_COMMENT_COUNT_LIMIT","INLINE_TRANSLATE_LIMIT","fetchAccount","$select","memFetchAccount","visibilityText","isIOS","ontouchstart","REACTIONS_LIMIT","getPollText","getPostText","forgivingQSA","selectors","selector","isTranslateble","getHTMLTextForDetectLang","HTTP_REGEX","PostContent","post","language","divRef","replaceChildren","cloneNode","SIZE_CLASS","detectLang","detectAll","accuracy","readMoreText","DIFFERENT_LANG_CHECK","checkDifferentLanguage","contentTranslationHideLanguages","targetLanguage","different","Status","statusID","propInstance","contentTextWeight","enableCommentHint","withinContext","enableTranslate","_forceTranslate","onMediaClick","quoted","onStatusLinkClick","showFollowedTags","allowContextMenu","showActionsBar","showReplyParent","mediaFirst","authenticated","currentInstance","sameInstance","sKey","statusKey","snapStates","useSnapshot","statuses","accountId","accountURL","accountEmojis","repliesCount","reblogged","reblogsCount","favourited","favouritesCount","bookmarked","sensitive","visibility","_language","editedAt","card","inReplyToId","inReplyToAccountId","reblog","uri","tags","pinned","_deleted","_pinned","emojiReactions","languageAutoDetected","setLanguageAutoDetected","detected","hasMediaAttachments","isSelf","filterInfo","debugHover","FilteredStatus","createdAtDate","editedAtDate","inReplyToAccountRef","setInReplyToAccount","inReplyToAccount","account2","catch","mentionSelf","readingExpandSpoilers","showSpoiler","readingExpandMedia","showSpoilerMedia","FollowedTagsParent","setForceTranslate","StatusParent","contentTranslation","inlineTranslate","contentTranslationAutoInline","isSizeLarge","showEdited","setShowEdited","showEmbed","setShowEmbed","contentLength","statusRef","unauthInteractionErrorMessage","createdDateText","editedDateText","canBoost","textWeight","mediaNoDesc","replyToStatus","statusMonthsAgo","confirmBoostStatus","newStatus","saveStatus","favouriteStatusNotify","favouriteStatus","done","bookmarkStatus","bookmarkStatusNotify","2","differentLanguage","setDifferentLanguage","reblogIterator","favouriteIterator","firstLoad","favouriteResults","reblogResults","_types","isPublic","isPinnable","StatusMenuItems","replyStatus","draftStatus","4","fetchBoostedLikedByAccounts","heading","fetchAccounts","showReactions","postText","nicePostURL","maxWidth","cachedStatus","getStatus","isContextMenuOpen","setIsContextMenuOpen","contextMenuProps","setContextMenuProps","bindLongPressContext","useLongPress","showContextMenu","clientX","clientY","hotkeysEnabled","fRef","dRef","captureEvent","bRef","rRef","xRef","activeStatus","spoilerButton","spoilerMediaButton","showMultipleMediaCaptions","displayedMediaAttachments","attachments","indices","showCommentHint","isThread","showCommentCount","StatusCompact","containsQuestion","nodeRef","selection","anchorNode","contextMenuRef","actionsRef","StatusButton","spoilerContentRef","spoilersMedia","postID","contentRef","QuoteStatuses","inert","pollResponse","newPoll","polls","then","MultipleMediaFigure","mediaContainerRef","captionChildren","_d","selfReferential","selfAuthor","emojiReaction","me","url2","isShortCode","EditedAtModal","carouselRef","moreThanOne","setCurrentIndex","currentIndex","getDomain","isCardPost","Byline","authors","author","providerName","providerUrl","authorName","authorUrl","imageDescription","embedUrl","publishedAt","hasText","isLandscape","cardStatusURL","isMastodonLinkMaybe","unfurlMastodonLink","setCardStatusURL","unfurledLinks","hasIframeHTML","blurhashImage","setBlurhashImage","blob","isPost","putImageData","convertToBlob","videoID","nocookie","editHistory","setEditHistory","_t2","Loader","generateHTMLCode","id2","contentHTML","sourceMediaURL","previewMediaURL","mediaHTML","prettify","htmlCode","EmbedModal","_t3","download","otherProps","buttonTitle","setButtonTitle","setIconAlt","host","iconAlt","path","urlObj","statusReply","restPath","srKey","statusPeekText","filterTitleStr","_t4","isReblog","showPeek","setShowPeek","isFollowedTags","detect","bindLongPressPeek","cancelOnMovement","ssKey","actualStatusID","statusPeekRef","quotes","uniqueQuotes","arr","q2","statusQuotes","IDX","HEX","len","isArray","getTag","INFINITY","baseToString","isString","isNumber","isBoolean","isObjectLike","isObject","isDefined","isBlank","INCORRECT_INDEX_TYPE","LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY","PATTERN_LENGTH_TOO_LARGE","MISSING_KEY_PROPERTY","INVALID_KEY_WEIGHT_VALUE","hasOwn","KeyStore","totalWeight","createKey","keyId","weight","getFn","createKeyPath","createKeyId","deepGet","MatchOptions","BasicOptions","FuzzyOptions","AdvancedOptions","Config","SPACE","norm","mantissa","cache","numTokens","FuseIndex","fieldNormWeight","docs","records","idx","doc","docIndex","record","keyIndex","subRecords","stack","nestedArrIndex","subRecord","createIndex","myIndex","parseIndex","computeScore$1","pattern","currentLocation","expectedLocation","distance","ignoreLocation","proximity","convertMaskToIndices","matchmask","minMatchCharLength","MAX_BITS","patternAlphabet","findAllMatches","includeMatches","patternLen","textLen","currentThreshold","bestLocation","computeMatches","matchMask","score","lastBitArr","finalScore","binMax","mask","binMin","binMid","finish","bitArr","charMatch","createPatternAlphabet","BitapSearch","isCaseSensitive","addChunk","startIndex","remainder","allIndices","totalScore","hasMatches","alphabet","isMatch","BaseMatch","getMatch","exp","matches","ExactMatch","InverseExactMatch","PrefixExactMatch","InversePrefixExactMatch","SuffixExactMatch","InverseSuffixExactMatch","FuzzyMatch","IncludeMatch","searchers","searchersLen","SPACE_RE","OR_TOKEN","parseQuery","results","queryItem","found","searcher","token","MultiMatchSet","ExtendedSearch","numMatches","qLen","pLen","registeredSearchers","register","createSearcher","searcherClass","LogicalOperator","KeyType","isExpression","isPath","isLeaf","convertToExplicit","auto","isQueryPath","computeScore","ignoreFieldNorm","transformMatches","transformScore","includeScore","transformers","transformer","Fuse","predicate","shouldSort","sortFn","expression","evaluate","resultMap","expResults"],"ignoreList":[0,1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,63,64,65,66,68,78,79,80,81,82,83,86,89,90,91,92,93,94,101,102,105,106,107,108,112,113],"sources":["../../node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js","../../node_modules/toastify-js/src/toastify.js","../../src/utils/show-toast.js","../../src/utils/useInterval.js","../../src/utils/open-compose.js","../../src/utils/open-osk.js","../../src/components/ICONS.jsx","../../src/components/icon.jsx","../../src/utils/useCloseWatcher.js","../../src/components/modal.jsx","../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../node_modules/prop-types/factoryWithThrowingShims.js","../../node_modules/prop-types/index.js","../../node_modules/@szhsin/react-menu/dist/es/utils/utils.js","../../node_modules/@szhsin/react-menu/dist/es/utils/propTypes.js","../../node_modules/@szhsin/react-menu/dist/es/hooks/useBEM.js","../../node_modules/@szhsin/react-menu/dist/es/utils/constants.js","../../node_modules/@szhsin/react-menu/dist/es/components/MenuContainer.js","../../node_modules/@szhsin/react-menu/dist/es/utils/submenuCtx.js","../../node_modules/@szhsin/react-menu/dist/es/hooks/useItems.js","../../node_modules/@szhsin/react-menu/dist/es/positionUtils/getNormalizedClientRect.js","../../node_modules/@szhsin/react-menu/dist/es/positionUtils/getPositionHelpers.js","../../node_modules/@szhsin/react-menu/dist/es/positionUtils/placeArrowVertical.js","../../node_modules/@szhsin/react-menu/dist/es/positionUtils/placeLeftorRight.js","../../node_modules/@szhsin/react-menu/dist/es/positionUtils/placeArrowHorizontal.js","../../node_modules/@szhsin/react-menu/dist/es/positionUtils/placeToporBottom.js","../../node_modules/@szhsin/react-menu/dist/es/positionUtils/positionMenu.js","../../node_modules/@szhsin/react-menu/dist/es/hooks/useIsomorphicLayoutEffect.js","../../node_modules/@szhsin/react-menu/dist/es/hooks/useCombinedRef.js","../../node_modules/@szhsin/react-menu/dist/es/components/MenuList.js","../../node_modules/@szhsin/react-menu/dist/es/components/ControlledMenu.js","../../node_modules/react-transition-state/dist/es/hooks/utils.js","../../node_modules/react-transition-state/dist/es/hooks/useTransitionState.js","../../node_modules/@szhsin/react-menu/dist/es/hooks/useMenuState.js","../../node_modules/@szhsin/react-menu/dist/es/hooks/useMenuStateAndFocus.js","../../node_modules/@szhsin/react-menu/dist/es/hooks/useClick.js","../../node_modules/@szhsin/react-menu/dist/es/hooks/useMenuChange.js","../../node_modules/@szhsin/react-menu/dist/es/components/Menu.js","../../node_modules/@szhsin/react-menu/dist/es/utils/withHovering.js","../../node_modules/@szhsin/react-menu/dist/es/hooks/useItemEffect.js","../../node_modules/@szhsin/react-menu/dist/es/components/SubMenu.js","../../node_modules/@szhsin/react-menu/dist/es/hooks/useItemState.js","../../node_modules/@szhsin/react-menu/dist/es/components/MenuItem.js","../../node_modules/@szhsin/react-menu/dist/es/components/FocusableItem.js","../../node_modules/@szhsin/react-menu/dist/es/components/MenuDivider.js","../../node_modules/@szhsin/react-menu/dist/es/components/MenuHeader.js","../../node_modules/@szhsin/react-menu/dist/es/components/MenuGroup.js","../../src/components/avatar.jsx","../../src/components/link.jsx","../../src/utils/is-rtl.js","../../src/utils/safe-bounding-box-padding.js","../../src/utils/useWindowSize.js","../../src/components/menu2.jsx","../../src/components/submenu2.jsx","../../src/components/menu-confirm.jsx","../../src/components/menu-link.jsx","../../src/components/custom-emoji.jsx","../../src/components/emoji-text.jsx","../../src/components/name-text.jsx","../../src/utils/localeCode2Text.js","../../src/components/relative-time.jsx","../../src/utils/get-translate-target-language.js","../../src/utils/pretty-bytes.js","../../node_modules/compare-versions/lib/esm/utils.js","../../node_modules/compare-versions/lib/esm/compareVersions.js","../../node_modules/compare-versions/lib/esm/compare.js","../../node_modules/compare-versions/lib/esm/satisfies.js","../../src/utils/supports.js","../../node_modules/punycode/punycode.es6.js","../../src/utils/emojify-text.js","../../src/utils/enhance-content.js","../../src/utils/getHTMLText.js","../../src/utils/handle-content-links.js","../../src/utils/i18n-duration.js","../../src/utils/nice-date-time.js","../../src/utils/shorten-number.js","../../src/utils/show-compose.js","../../src/components/account-block.jsx","../../node_modules/retry/lib/retry_operation.js","../../node_modules/retry/lib/retry.js","../../node_modules/retry/index.js","../../node_modules/is-network-error/index.js","../../node_modules/p-retry/index.js","../../node_modules/react-intersection-observer/dist/index.mjs","../../src/components/lazy-shazam.jsx","../../src/components/translation-block.jsx","../../node_modules/idb-keyval/dist/index.js","../../src/utils/db.js","../../src/utils/relationships.js","../../node_modules/@justinribeiro/lite-youtube/lite-youtube.js","../../node_modules/fast-blurhash/index.js","../../node_modules/html-prettify/src/utils/addIndentation.js","../../node_modules/html-prettify/src/utils/toLines.js","../../node_modules/html-prettify/src/index.js","../../node_modules/use-long-press/index.mjs","../../src/components/poll.jsx","../../src/utils/filter-context.js","../../src/utils/filters.js","../../src/utils/html-content-length.js","../../src/utils/speech.js","../../src/utils/status-peek.js","../../node_modules/use-debounce/dist/index.module.js","../../node_modules/use-resize-observer/dist/bundle.esm.js","../../src/utils/useTruncated.js","../../src/utils/visibility-icons-map.js","../../node_modules/react-quick-pinch-zoom/esm/PinchZoom/styles.css.js","../../node_modules/react-quick-pinch-zoom/esm/utils.js","../../node_modules/react-quick-pinch-zoom/esm/PinchZoom/getOffsetBounds.js","../../node_modules/react-quick-pinch-zoom/esm/PinchZoom/component.js","../../src/utils/format-duration.js","../../src/components/media.jsx","../../src/components/status.jsx","../../node_modules/uid/single/index.mjs","../../node_modules/fuse.js/dist/fuse.mjs"],"sourcesContent":["import { useContext, createContext, useState, useCallback, useRef, useLayoutEffect, useEffect } from 'react';\nimport { jsx } from 'react/jsx-runtime';\n\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\n\nvar reservedModifierKeywords = ['shift', 'alt', 'meta', 'mod', 'ctrl'];\nvar mappedKeys = {\n esc: 'escape',\n \"return\": 'enter',\n '.': 'period',\n ',': 'comma',\n '-': 'slash',\n ' ': 'space',\n '`': 'backquote',\n '#': 'backslash',\n '+': 'bracketright',\n ShiftLeft: 'shift',\n ShiftRight: 'shift',\n AltLeft: 'alt',\n AltRight: 'alt',\n MetaLeft: 'meta',\n MetaRight: 'meta',\n OSLeft: 'meta',\n OSRight: 'meta',\n ControlLeft: 'ctrl',\n ControlRight: 'ctrl'\n};\nfunction mapKey(key) {\n return (key && mappedKeys[key] || key || '').trim().toLowerCase().replace(/key|digit|numpad|arrow/, '');\n}\nfunction isHotkeyModifier(key) {\n return reservedModifierKeywords.includes(key);\n}\nfunction parseKeysHookInput(keys, splitKey) {\n if (splitKey === void 0) {\n splitKey = ',';\n }\n return keys.split(splitKey);\n}\nfunction parseHotkey(hotkey, combinationKey, description) {\n if (combinationKey === void 0) {\n combinationKey = '+';\n }\n var keys = hotkey.toLocaleLowerCase().split(combinationKey).map(function (k) {\n return mapKey(k);\n });\n var modifiers = {\n alt: keys.includes('alt'),\n ctrl: keys.includes('ctrl') || keys.includes('control'),\n shift: keys.includes('shift'),\n meta: keys.includes('meta'),\n mod: keys.includes('mod')\n };\n var singleCharKeys = keys.filter(function (k) {\n return !reservedModifierKeywords.includes(k);\n });\n return _extends({}, modifiers, {\n keys: singleCharKeys,\n description: description,\n hotkey: hotkey\n });\n}\n\n(function () {\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', function (e) {\n if (e.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n pushToCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);\n });\n document.addEventListener('keyup', function (e) {\n if (e.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n removeFromCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);\n });\n }\n if (typeof window !== 'undefined') {\n window.addEventListener('blur', function () {\n currentlyPressedKeys.clear();\n });\n }\n})();\nvar currentlyPressedKeys = /*#__PURE__*/new Set();\n// https://github.com/microsoft/TypeScript/issues/17002\nfunction isReadonlyArray(value) {\n return Array.isArray(value);\n}\nfunction isHotkeyPressed(key, splitKey) {\n if (splitKey === void 0) {\n splitKey = ',';\n }\n var hotkeyArray = isReadonlyArray(key) ? key : key.split(splitKey);\n return hotkeyArray.every(function (hotkey) {\n return currentlyPressedKeys.has(hotkey.trim().toLowerCase());\n });\n}\nfunction pushToCurrentlyPressedKeys(key) {\n var hotkeyArray = Array.isArray(key) ? key : [key];\n /*\r\n Due to a weird behavior on macOS we need to clear the set if the user pressed down the meta key and presses another key.\r\n https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser\r\n Otherwise the set will hold all ever pressed keys while the meta key is down which leads to wrong results.\r\n */\n if (currentlyPressedKeys.has('meta')) {\n currentlyPressedKeys.forEach(function (key) {\n return !isHotkeyModifier(key) && currentlyPressedKeys[\"delete\"](key.toLowerCase());\n });\n }\n hotkeyArray.forEach(function (hotkey) {\n return currentlyPressedKeys.add(hotkey.toLowerCase());\n });\n}\nfunction removeFromCurrentlyPressedKeys(key) {\n var hotkeyArray = Array.isArray(key) ? key : [key];\n /*\r\n Due to a weird behavior on macOS we need to clear the set if the user pressed down the meta key and presses another key.\r\n https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser\r\n Otherwise the set will hold all ever pressed keys while the meta key is down which leads to wrong results.\r\n */\n if (key === 'meta') {\n currentlyPressedKeys.clear();\n } else {\n hotkeyArray.forEach(function (hotkey) {\n return currentlyPressedKeys[\"delete\"](hotkey.toLowerCase());\n });\n }\n}\n\nfunction maybePreventDefault(e, hotkey, preventDefault) {\n if (typeof preventDefault === 'function' && preventDefault(e, hotkey) || preventDefault === true) {\n e.preventDefault();\n }\n}\nfunction isHotkeyEnabled(e, hotkey, enabled) {\n if (typeof enabled === 'function') {\n return enabled(e, hotkey);\n }\n return enabled === true || enabled === undefined;\n}\nfunction isKeyboardEventTriggeredByInput(ev) {\n return isHotkeyEnabledOnTag(ev, ['input', 'textarea', 'select']);\n}\nfunction isHotkeyEnabledOnTag(event, enabledOnTags) {\n if (enabledOnTags === void 0) {\n enabledOnTags = false;\n }\n var target = event.target,\n composed = event.composed;\n var targetTagName = null;\n if (isCustomElement(target) && composed) {\n targetTagName = event.composedPath()[0] && event.composedPath()[0].tagName;\n } else {\n targetTagName = target && target.tagName;\n }\n if (isReadonlyArray(enabledOnTags)) {\n return Boolean(targetTagName && enabledOnTags && enabledOnTags.some(function (tag) {\n var _targetTagName;\n return tag.toLowerCase() === ((_targetTagName = targetTagName) == null ? void 0 : _targetTagName.toLowerCase());\n }));\n }\n return Boolean(targetTagName && enabledOnTags && enabledOnTags);\n}\nfunction isCustomElement(element) {\n // We just do a basic check w/o any complex RegEx or validation against the list of legacy names containing a hyphen,\n // as none of them is likely to be an event target, and it won't hurt anyway if we miss.\n // see: https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname\n return !!element.tagName && !element.tagName.startsWith(\"-\") && element.tagName.includes(\"-\");\n}\nfunction isScopeActive(activeScopes, scopes) {\n if (activeScopes.length === 0 && scopes) {\n console.warn('A hotkey has the \"scopes\" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>');\n return true;\n }\n if (!scopes) {\n return true;\n }\n return activeScopes.some(function (scope) {\n return scopes.includes(scope);\n }) || activeScopes.includes('*');\n}\nvar isHotkeyMatchingKeyboardEvent = function isHotkeyMatchingKeyboardEvent(e, hotkey, ignoreModifiers) {\n if (ignoreModifiers === void 0) {\n ignoreModifiers = false;\n }\n var alt = hotkey.alt,\n meta = hotkey.meta,\n mod = hotkey.mod,\n shift = hotkey.shift,\n ctrl = hotkey.ctrl,\n keys = hotkey.keys;\n var pressedKeyUppercase = e.key,\n code = e.code,\n ctrlKey = e.ctrlKey,\n metaKey = e.metaKey,\n shiftKey = e.shiftKey,\n altKey = e.altKey;\n var keyCode = mapKey(code);\n var pressedKey = pressedKeyUppercase.toLowerCase();\n if (!(keys != null && keys.includes(keyCode)) && !(keys != null && keys.includes(pressedKey)) && !['ctrl', 'control', 'unknown', 'meta', 'alt', 'shift', 'os'].includes(keyCode)) {\n return false;\n }\n if (!ignoreModifiers) {\n // We check the pressed keys for compatibility with the keyup event. In keyup events the modifier flags are not set.\n if (alt === !altKey && pressedKey !== 'alt') {\n return false;\n }\n if (shift === !shiftKey && pressedKey !== 'shift') {\n return false;\n }\n // Mod is a special key name that is checking for meta on macOS and ctrl on other platforms\n if (mod) {\n if (!metaKey && !ctrlKey) {\n return false;\n }\n } else {\n if (meta === !metaKey && pressedKey !== 'meta' && pressedKey !== 'os') {\n return false;\n }\n if (ctrl === !ctrlKey && pressedKey !== 'ctrl' && pressedKey !== 'control') {\n return false;\n }\n }\n }\n // All modifiers are correct, now check the key\n // If the key is set, we check for the key\n if (keys && keys.length === 1 && (keys.includes(pressedKey) || keys.includes(keyCode))) {\n return true;\n } else if (keys) {\n // Check if all keys are present in pressedDownKeys set\n return isHotkeyPressed(keys);\n } else if (!keys) {\n // If the key is not set, we only listen for modifiers, that check went alright, so we return true\n return true;\n }\n // There is nothing that matches.\n return false;\n};\n\nvar BoundHotkeysProxyProvider = /*#__PURE__*/createContext(undefined);\nvar useBoundHotkeysProxy = function useBoundHotkeysProxy() {\n return useContext(BoundHotkeysProxyProvider);\n};\nfunction BoundHotkeysProxyProviderProvider(_ref) {\n var addHotkey = _ref.addHotkey,\n removeHotkey = _ref.removeHotkey,\n children = _ref.children;\n return /*#__PURE__*/jsx(BoundHotkeysProxyProvider.Provider, {\n value: {\n addHotkey: addHotkey,\n removeHotkey: removeHotkey\n },\n children: children\n });\n}\n\nfunction deepEqual(x, y) {\n //@ts-ignore\n return x && y && typeof x === 'object' && typeof y === 'object' ? Object.keys(x).length === Object.keys(y).length &&\n //@ts-ignore\n Object.keys(x).reduce(function (isEqual, key) {\n return isEqual && deepEqual(x[key], y[key]);\n }, true) : x === y;\n}\n\nvar HotkeysContext = /*#__PURE__*/createContext({\n hotkeys: [],\n enabledScopes: [],\n toggleScope: function toggleScope() {},\n enableScope: function enableScope() {},\n disableScope: function disableScope() {}\n});\nvar useHotkeysContext = function useHotkeysContext() {\n return useContext(HotkeysContext);\n};\nvar HotkeysProvider = function HotkeysProvider(_ref) {\n var _ref$initiallyActiveS = _ref.initiallyActiveScopes,\n initiallyActiveScopes = _ref$initiallyActiveS === void 0 ? ['*'] : _ref$initiallyActiveS,\n children = _ref.children;\n var _useState = useState((initiallyActiveScopes == null ? void 0 : initiallyActiveScopes.length) > 0 ? initiallyActiveScopes : ['*']),\n internalActiveScopes = _useState[0],\n setInternalActiveScopes = _useState[1];\n var _useState2 = useState([]),\n boundHotkeys = _useState2[0],\n setBoundHotkeys = _useState2[1];\n var enableScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.includes('*')) {\n return [scope];\n }\n return Array.from(new Set([].concat(prev, [scope])));\n });\n }, []);\n var disableScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.filter(function (s) {\n return s !== scope;\n }).length === 0) {\n return ['*'];\n } else {\n return prev.filter(function (s) {\n return s !== scope;\n });\n }\n });\n }, []);\n var toggleScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.includes(scope)) {\n if (prev.filter(function (s) {\n return s !== scope;\n }).length === 0) {\n return ['*'];\n } else {\n return prev.filter(function (s) {\n return s !== scope;\n });\n }\n } else {\n if (prev.includes('*')) {\n return [scope];\n }\n return Array.from(new Set([].concat(prev, [scope])));\n }\n });\n }, []);\n var addBoundHotkey = useCallback(function (hotkey) {\n setBoundHotkeys(function (prev) {\n return [].concat(prev, [hotkey]);\n });\n }, []);\n var removeBoundHotkey = useCallback(function (hotkey) {\n setBoundHotkeys(function (prev) {\n return prev.filter(function (h) {\n return !deepEqual(h, hotkey);\n });\n });\n }, []);\n return /*#__PURE__*/jsx(HotkeysContext.Provider, {\n value: {\n enabledScopes: internalActiveScopes,\n hotkeys: boundHotkeys,\n enableScope: enableScope,\n disableScope: disableScope,\n toggleScope: toggleScope\n },\n children: /*#__PURE__*/jsx(BoundHotkeysProxyProviderProvider, {\n addHotkey: addBoundHotkey,\n removeHotkey: removeBoundHotkey,\n children: children\n })\n });\n};\n\nfunction useDeepEqualMemo(value) {\n var ref = useRef(undefined);\n if (!deepEqual(ref.current, value)) {\n ref.current = value;\n }\n return ref.current;\n}\n\nvar stopPropagation = function stopPropagation(e) {\n e.stopPropagation();\n e.preventDefault();\n e.stopImmediatePropagation();\n};\nvar useSafeLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\nfunction useHotkeys(keys, callback, options, dependencies) {\n var _useState = useState(null),\n ref = _useState[0],\n setRef = _useState[1];\n var hasTriggeredRef = useRef(false);\n var _options = !(options instanceof Array) ? options : !(dependencies instanceof Array) ? dependencies : undefined;\n var _keys = isReadonlyArray(keys) ? keys.join(_options == null ? void 0 : _options.splitKey) : keys;\n var _deps = options instanceof Array ? options : dependencies instanceof Array ? dependencies : undefined;\n var memoisedCB = useCallback(callback, _deps != null ? _deps : []);\n var cbRef = useRef(memoisedCB);\n if (_deps) {\n cbRef.current = memoisedCB;\n } else {\n cbRef.current = callback;\n }\n var memoisedOptions = useDeepEqualMemo(_options);\n var _useHotkeysContext = useHotkeysContext(),\n enabledScopes = _useHotkeysContext.enabledScopes;\n var proxy = useBoundHotkeysProxy();\n useSafeLayoutEffect(function () {\n if ((memoisedOptions == null ? void 0 : memoisedOptions.enabled) === false || !isScopeActive(enabledScopes, memoisedOptions == null ? void 0 : memoisedOptions.scopes)) {\n return;\n }\n var listener = function listener(e, isKeyUp) {\n var _e$target;\n if (isKeyUp === void 0) {\n isKeyUp = false;\n }\n if (isKeyboardEventTriggeredByInput(e) && !isHotkeyEnabledOnTag(e, memoisedOptions == null ? void 0 : memoisedOptions.enableOnFormTags)) {\n return;\n }\n // TODO: SINCE THE EVENT IS NOW ATTACHED TO THE REF, THE ACTIVE ELEMENT CAN NEVER BE INSIDE THE REF. THE HOTKEY ONLY TRIGGERS IF THE\n // REF IS THE ACTIVE ELEMENT. THIS IS A PROBLEM SINCE FOCUSED SUB COMPONENTS WON'T TRIGGER THE HOTKEY.\n if (ref !== null) {\n var rootNode = ref.getRootNode();\n if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement !== ref && !ref.contains(rootNode.activeElement)) {\n stopPropagation(e);\n return;\n }\n }\n if ((_e$target = e.target) != null && _e$target.isContentEditable && !(memoisedOptions != null && memoisedOptions.enableOnContentEditable)) {\n return;\n }\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n var _hotkey$keys;\n var hotkey = parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey);\n if (isHotkeyMatchingKeyboardEvent(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.ignoreModifiers) || (_hotkey$keys = hotkey.keys) != null && _hotkey$keys.includes('*')) {\n if (memoisedOptions != null && memoisedOptions.ignoreEventWhen != null && memoisedOptions.ignoreEventWhen(e)) {\n return;\n }\n if (isKeyUp && hasTriggeredRef.current) {\n return;\n }\n maybePreventDefault(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.preventDefault);\n if (!isHotkeyEnabled(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.enabled)) {\n stopPropagation(e);\n return;\n }\n // Execute the user callback for that hotkey\n cbRef.current(e, hotkey);\n if (!isKeyUp) {\n hasTriggeredRef.current = true;\n }\n }\n });\n };\n var handleKeyDown = function handleKeyDown(event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n pushToCurrentlyPressedKeys(mapKey(event.code));\n if ((memoisedOptions == null ? void 0 : memoisedOptions.keydown) === undefined && (memoisedOptions == null ? void 0 : memoisedOptions.keyup) !== true || memoisedOptions != null && memoisedOptions.keydown) {\n listener(event);\n }\n };\n var handleKeyUp = function handleKeyUp(event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n removeFromCurrentlyPressedKeys(mapKey(event.code));\n hasTriggeredRef.current = false;\n if (memoisedOptions != null && memoisedOptions.keyup) {\n listener(event, true);\n }\n };\n var domNode = ref || (_options == null ? void 0 : _options.document) || document;\n // @ts-ignore\n domNode.addEventListener('keyup', handleKeyUp);\n // @ts-ignore\n domNode.addEventListener('keydown', handleKeyDown);\n if (proxy) {\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n return proxy.addHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));\n });\n }\n return function () {\n // @ts-ignore\n domNode.removeEventListener('keyup', handleKeyUp);\n // @ts-ignore\n domNode.removeEventListener('keydown', handleKeyDown);\n if (proxy) {\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n return proxy.removeHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));\n });\n }\n };\n }, [ref, _keys, memoisedOptions, enabledScopes]);\n return setRef;\n}\n\nfunction useRecordHotkeys() {\n var _useState = useState(new Set()),\n keys = _useState[0],\n setKeys = _useState[1];\n var _useState2 = useState(false),\n isRecording = _useState2[0],\n setIsRecording = _useState2[1];\n var handler = useCallback(function (event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n setKeys(function (prev) {\n var newKeys = new Set(prev);\n newKeys.add(mapKey(event.code));\n return newKeys;\n });\n }, []);\n var stop = useCallback(function () {\n if (typeof document !== 'undefined') {\n document.removeEventListener('keydown', handler);\n setIsRecording(false);\n }\n }, [handler]);\n var start = useCallback(function () {\n setKeys(new Set());\n if (typeof document !== 'undefined') {\n stop();\n document.addEventListener('keydown', handler);\n setIsRecording(true);\n }\n }, [handler, stop]);\n var resetKeys = useCallback(function () {\n setKeys(new Set());\n }, []);\n return [keys, {\n start: start,\n stop: stop,\n resetKeys: resetKeys,\n isRecording: isRecording\n }];\n}\n\nexport { HotkeysProvider, isHotkeyPressed, useHotkeys, useHotkeysContext, useRecordHotkeys };\n//# sourceMappingURL=react-hotkeys-hook.esm.js.map\n","/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n(function(root, factory) {\n if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Toastify = factory();\n }\n})(this, function(global) {\n // Object initialization\n var Toastify = function(options) {\n // Returning a new init object\n return new Toastify.lib.init(options);\n },\n // Library version\n version = \"1.12.0\";\n\n // Set the default global options\n Toastify.defaults = {\n oldestFirst: true,\n text: \"Toastify is awesome!\",\n node: undefined,\n duration: 3000,\n selector: undefined,\n callback: function () {\n },\n destination: undefined,\n newWindow: false,\n close: false,\n gravity: \"toastify-top\",\n positionLeft: false,\n position: '',\n backgroundColor: '',\n avatar: \"\",\n className: \"\",\n stopOnFocus: true,\n onClick: function () {\n },\n offset: {x: 0, y: 0},\n escapeMarkup: true,\n ariaLive: 'polite',\n style: {background: ''}\n };\n\n // Defining the prototype of the object\n Toastify.lib = Toastify.prototype = {\n toastify: version,\n\n constructor: Toastify,\n\n // Initializing the object with required parameters\n init: function(options) {\n // Verifying and validating the input object\n if (!options) {\n options = {};\n }\n\n // Creating the options object\n this.options = {};\n\n this.toastElement = null;\n\n // Validating the options\n this.options.text = options.text || Toastify.defaults.text; // Display message\n this.options.node = options.node || Toastify.defaults.node; // Display content as node\n this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration\n this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector\n this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display\n this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination\n this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window\n this.options.close = options.close || Toastify.defaults.close; // Show toast close icon\n this.options.gravity = options.gravity === \"bottom\" ? \"toastify-bottom\" : Toastify.defaults.gravity; // toast position - top or bottom\n this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right\n this.options.position = options.position || Toastify.defaults.position; // toast position - left or right\n this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color\n this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path\n this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast\n this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus\n this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click\n this.options.offset = options.offset || Toastify.defaults.offset; // toast offset\n this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;\n this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;\n this.options.style = options.style || Toastify.defaults.style;\n if(options.backgroundColor) {\n this.options.style.background = options.backgroundColor;\n }\n\n // Returning the current object for chaining functions\n return this;\n },\n\n // Building the DOM element\n buildToast: function() {\n // Validating if the options are defined\n if (!this.options) {\n throw \"Toastify is not initialized\";\n }\n\n // Creating the DOM object\n var divElement = document.createElement(\"div\");\n divElement.className = \"toastify on \" + this.options.className;\n\n // Positioning toast to left or right or center\n if (!!this.options.position) {\n divElement.className += \" toastify-\" + this.options.position;\n } else {\n // To be depreciated in further versions\n if (this.options.positionLeft === true) {\n divElement.className += \" toastify-left\";\n console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')\n } else {\n // Default position\n divElement.className += \" toastify-right\";\n }\n }\n\n // Assigning gravity of element\n divElement.className += \" \" + this.options.gravity;\n\n if (this.options.backgroundColor) {\n // This is being deprecated in favor of using the style HTML DOM property\n console.warn('DEPRECATION NOTICE: \"backgroundColor\" is being deprecated. Please use the \"style.background\" property.');\n }\n\n // Loop through our style object and apply styles to divElement\n for (var property in this.options.style) {\n divElement.style[property] = this.options.style[property];\n }\n\n // Announce the toast to screen readers\n if (this.options.ariaLive) {\n divElement.setAttribute('aria-live', this.options.ariaLive)\n }\n\n // Adding the toast message/node\n if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {\n // If we have a valid node, we insert it\n divElement.appendChild(this.options.node)\n } else {\n if (this.options.escapeMarkup) {\n divElement.innerText = this.options.text;\n } else {\n divElement.innerHTML = this.options.text;\n }\n\n if (this.options.avatar !== \"\") {\n var avatarElement = document.createElement(\"img\");\n avatarElement.src = this.options.avatar;\n\n avatarElement.className = \"toastify-avatar\";\n\n if (this.options.position == \"left\" || this.options.positionLeft === true) {\n // Adding close icon on the left of content\n divElement.appendChild(avatarElement);\n } else {\n // Adding close icon on the right of content\n divElement.insertAdjacentElement(\"afterbegin\", avatarElement);\n }\n }\n }\n\n // Adding a close icon to the toast\n if (this.options.close === true) {\n // Create a span for close element\n var closeElement = document.createElement(\"button\");\n closeElement.type = \"button\";\n closeElement.setAttribute(\"aria-label\", \"Close\");\n closeElement.className = \"toast-close\";\n closeElement.innerHTML = \"✖\";\n\n // Triggering the removal of toast from DOM on close click\n closeElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.removeElement(this.toastElement);\n window.clearTimeout(this.toastElement.timeOutValue);\n }.bind(this)\n );\n\n //Calculating screen width\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Adding the close icon to the toast element\n // Display on the right if screen width is less than or equal to 360px\n if ((this.options.position == \"left\" || this.options.positionLeft === true) && width > 360) {\n // Adding close icon on the left of content\n divElement.insertAdjacentElement(\"afterbegin\", closeElement);\n } else {\n // Adding close icon on the right of content\n divElement.appendChild(closeElement);\n }\n }\n\n // Clear timeout while toast is focused\n if (this.options.stopOnFocus && this.options.duration > 0) {\n var self = this;\n // stop countdown\n divElement.addEventListener(\n \"mouseover\",\n function(event) {\n window.clearTimeout(divElement.timeOutValue);\n }\n )\n // add back the timeout\n divElement.addEventListener(\n \"mouseleave\",\n function() {\n divElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n self.removeElement(divElement);\n },\n self.options.duration\n )\n }\n )\n }\n\n // Adding an on-click destination path\n if (typeof this.options.destination !== \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n if (this.options.newWindow === true) {\n window.open(this.options.destination, \"_blank\");\n } else {\n window.location = this.options.destination;\n }\n }.bind(this)\n );\n }\n\n if (typeof this.options.onClick === \"function\" && typeof this.options.destination === \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.options.onClick();\n }.bind(this)\n );\n }\n\n // Adding offset\n if(typeof this.options.offset === \"object\") {\n\n var x = getAxisOffsetAValue(\"x\", this.options);\n var y = getAxisOffsetAValue(\"y\", this.options);\n\n var xOffset = this.options.position == \"left\" ? x : \"-\" + x;\n var yOffset = this.options.gravity == \"toastify-top\" ? y : \"-\" + y;\n\n divElement.style.transform = \"translate(\" + xOffset + \",\" + yOffset + \")\";\n\n }\n\n // Returning the generated element\n return divElement;\n },\n\n // Displaying the toast\n showToast: function() {\n // Creating the DOM object for the toast\n this.toastElement = this.buildToast();\n\n // Getting the root element to with the toast needs to be added\n var rootElement;\n if (typeof this.options.selector === \"string\") {\n rootElement = document.getElementById(this.options.selector);\n } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {\n rootElement = this.options.selector;\n } else {\n rootElement = document.body;\n }\n\n // Validating if root element is present in DOM\n if (!rootElement) {\n throw \"Root element is not defined\";\n }\n\n // Adding the DOM element\n var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;\n rootElement.insertBefore(this.toastElement, elementToInsert);\n\n // Repositioning the toasts in case multiple toasts are present\n Toastify.reposition();\n\n if (this.options.duration > 0) {\n this.toastElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n this.removeElement(this.toastElement);\n }.bind(this),\n this.options.duration\n ); // Binding `this` for function invocation\n }\n\n // Supporting function chaining\n return this;\n },\n\n hideToast: function() {\n if (this.toastElement.timeOutValue) {\n clearTimeout(this.toastElement.timeOutValue);\n }\n this.removeElement(this.toastElement);\n },\n\n // Removing the element from the DOM\n removeElement: function(toastElement) {\n // Hiding the element\n // toastElement.classList.remove(\"on\");\n toastElement.className = toastElement.className.replace(\" on\", \"\");\n\n // Removing the element from DOM after transition end\n window.setTimeout(\n function() {\n // remove options node if any\n if (this.options.node && this.options.node.parentNode) {\n this.options.node.parentNode.removeChild(this.options.node);\n }\n\n // Remove the element from the DOM, only when the parent node was not removed before.\n if (toastElement.parentNode) {\n toastElement.parentNode.removeChild(toastElement);\n }\n\n // Calling the callback function\n this.options.callback.call(toastElement);\n\n // Repositioning the toasts again\n Toastify.reposition();\n }.bind(this),\n 400\n ); // Binding `this` for function invocation\n },\n };\n\n // Positioning the toasts on the DOM\n Toastify.reposition = function() {\n\n // Top margins with gravity\n var topLeftOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var topRightOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var offsetSize = {\n top: 15,\n bottom: 15,\n };\n\n // Get all toast messages on the DOM\n var allToasts = document.getElementsByClassName(\"toastify\");\n\n var classUsed;\n\n // Modifying the position of each toast element\n for (var i = 0; i < allToasts.length; i++) {\n // Getting the applied gravity\n if (containsClass(allToasts[i], \"toastify-top\") === true) {\n classUsed = \"toastify-top\";\n } else {\n classUsed = \"toastify-bottom\";\n }\n\n var height = allToasts[i].offsetHeight;\n classUsed = classUsed.substr(9, classUsed.length-1)\n // Spacing between toasts\n var offset = 15;\n\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Show toast in center if screen with less than or equal to 360px\n if (width <= 360) {\n // Setting the position\n allToasts[i].style[classUsed] = offsetSize[classUsed] + \"px\";\n\n offsetSize[classUsed] += height + offset;\n } else {\n if (containsClass(allToasts[i], \"toastify-left\") === true) {\n // Setting the position\n allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + \"px\";\n\n topLeftOffsetSize[classUsed] += height + offset;\n } else {\n // Setting the position\n allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + \"px\";\n\n topRightOffsetSize[classUsed] += height + offset;\n }\n }\n }\n\n // Supporting function chaining\n return this;\n };\n\n // Helper function to get offset.\n function getAxisOffsetAValue(axis, options) {\n\n if(options.offset[axis]) {\n if(isNaN(options.offset[axis])) {\n return options.offset[axis];\n }\n else {\n return options.offset[axis] + 'px';\n }\n }\n\n return '0px';\n\n }\n\n function containsClass(elem, yourClass) {\n if (!elem || typeof yourClass !== \"string\") {\n return false;\n } else if (\n elem.className &&\n elem.className\n .trim()\n .split(/\\s+/gi)\n .indexOf(yourClass) > -1\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n // Setting up the prototype for the init object\n Toastify.lib.init.prototype = Toastify.lib;\n\n // Returning the Toastify function to be assigned to the window object/module\n return Toastify;\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","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","import { t } from '@lingui/core/macro';\n\nexport default function openCompose(opts) {\n const url = URL.parse('/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(t`Looks like your browser is blocking popups.`);\n }\n\n return newWin;\n}\n","const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // https://stackoverflow.com/a/23522755\n\nexport default function openOSK() {\n if (isSafari) {\n const fauxEl = document.createElement('input');\n fauxEl.style.position = 'absolute';\n fauxEl.style.top = '0';\n fauxEl.style.left = '0';\n fauxEl.style.opacity = '0';\n document.body.appendChild(fauxEl);\n fauxEl.focus();\n setTimeout(() => {\n document.body.removeChild(fauxEl);\n }, 500);\n }\n}\n","export 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': {\n module: () => import('@iconify-icons/mingcute/arrow-left-line'),\n rtl: true,\n },\n 'arrow-right': {\n module: () => import('@iconify-icons/mingcute/arrow-right-line'),\n rtl: true,\n },\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: {\n module: () => import('@iconify-icons/mingcute/chat-3-line'),\n rtl: true,\n },\n comment2: {\n module: () => import('@iconify-icons/mingcute/comment-2-line'),\n rtl: true,\n },\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 more2: () => import('@iconify-icons/mingcute/more-1-fill'),\n external: {\n module: () => import('@iconify-icons/mingcute/external-link-line'),\n rtl: true,\n },\n popout: {\n module: () => import('@iconify-icons/mingcute/external-link-line'),\n rtl: true,\n },\n popin: {\n module: () => import('@iconify-icons/mingcute/external-link-line'),\n rotate: '180deg',\n rtl: true,\n },\n plus: () => import('@iconify-icons/mingcute/add-circle-line'),\n 'chevron-left': {\n module: () => import('@iconify-icons/mingcute/left-line'),\n rtl: true,\n },\n 'chevron-right': {\n module: () => import('@iconify-icons/mingcute/right-line'),\n rtl: true,\n },\n 'chevron-down': () => import('@iconify-icons/mingcute/down-line'),\n reply: {\n module: () => import('@iconify-icons/mingcute/share-forward-line'),\n rotate: '180deg',\n flip: 'horizontal',\n rtl: true,\n },\n thread: () => import('@iconify-icons/mingcute/route-line'),\n group: {\n module: () => import('@iconify-icons/mingcute/group-line'),\n rtl: true,\n },\n bot: () => import('@iconify-icons/mingcute/android-2-line'),\n menu: () => import('@iconify-icons/mingcute/rows-4-line'),\n list: {\n module: () => import('@iconify-icons/mingcute/list-check-line'),\n rtl: true,\n },\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 unpin: [() => import('@iconify-icons/mingcute/pin-line'), '180deg'],\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: {\n module: () => import('@iconify-icons/mingcute/exit-line'),\n rtl: true,\n },\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: {\n module: () => import('@iconify-icons/mingcute/volume-mute-line'),\n rtl: true,\n },\n unmute: {\n module: () => import('@iconify-icons/mingcute/volume-line'),\n rtl: true,\n },\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-1-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 filters: () => import('@iconify-icons/mingcute/filter-line'),\n chart: () => import('@iconify-icons/mingcute/chart-line-line'),\n react: () => import('@iconify-icons/mingcute/react-line'),\n layout4: {\n module: () => import('@iconify-icons/mingcute/layout-4-line'),\n rtl: true,\n },\n layout5: () => import('@iconify-icons/mingcute/layout-5-line'),\n announce: {\n module: () => import('@iconify-icons/mingcute/announcement-line'),\n rtl: true,\n },\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: {\n module: () => import('@iconify-icons/mingcute/clipboard-line'),\n rtl: true,\n },\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: {\n module: () => import('@iconify-icons/mingcute/calendar-month-line'),\n rtl: true,\n },\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 history2: {\n module: () => import('@iconify-icons/mingcute/history-2-line'),\n rtl: true,\n },\n document: () => import('@iconify-icons/mingcute/document-line'),\n 'arrows-right': {\n module: () => import('@iconify-icons/mingcute/arrows-right-line'),\n rtl: true,\n },\n code: () => import('@iconify-icons/mingcute/code-line'),\n copy: () => import('@iconify-icons/mingcute/copy-2-line'),\n quote: {\n module: () => import('@iconify-icons/mingcute/quote-left-line'),\n rtl: true,\n },\n settings: () => import('@iconify-icons/mingcute/settings-6-line'),\n 'heart-break': () => import('@iconify-icons/mingcute/heart-crack-line'),\n 'user-x': () => import('@iconify-icons/mingcute/user-x-line'),\n minimize: () => import('@iconify-icons/mingcute/arrows-down-line'),\n celebrate: () => import('@iconify-icons/mingcute/celebrate-line'),\n};\n","import moize from 'moize';\nimport { useEffect, useRef, useState } from 'preact/hooks';\n\nimport { ICONS } from './ICONS';\n\nconst SIZES = {\n s: 12,\n m: 16,\n l: 20,\n xl: 24,\n xxl: 32,\n};\n\nconst ICONDATA = {};\n\n// Memoize the dangerouslySetInnerHTML of the SVGs\nconst SVGICon = moize(\n function ({ width, height, body, rotate, flip }) {\n return (\n <svg\n viewBox={`0 0 ${width} ${height}`}\n dangerouslySetInnerHTML={{ __html: body }}\n style={{\n transform: `${rotate ? `rotate(${rotate})` : ''} ${\n flip ? `scaleX(-1)` : ''\n }`,\n }}\n />\n );\n },\n {\n isShallowEqual: true,\n maxSize: Object.keys(ICONS).length,\n matchesArg: (cacheKeyArg, keyArg) =>\n cacheKeyArg.icon === keyArg.icon && cacheKeyArg.body === keyArg.body,\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,\n flip,\n rtl = false;\n if (Array.isArray(iconBlock)) {\n [iconBlock, rotate, flip] = iconBlock;\n } else if (typeof iconBlock === 'object') {\n ({ rotate, flip, rtl } = iconBlock);\n iconBlock = iconBlock.module;\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 <span\n class={`icon ${className} ${rtl ? 'rtl-flip' : ''}`}\n title={title || alt}\n style={{\n width: `${iconSize}px`,\n height: `${iconSize}px`,\n ...style,\n }}\n data-icon={icon}\n >\n {iconData && (\n // <svg\n // width={iconSize}\n // height={iconSize}\n // viewBox={`0 0 ${iconData.width} ${iconData.height}`}\n // dangerouslySetInnerHTML={{ __html: iconData.body }}\n // style={{\n // transform: `${rotate ? `rotate(${rotate})` : ''} ${\n // flip ? `scaleX(-1)` : ''\n // }`,\n // }}\n // />\n <SVGICon\n icon={icon}\n width={iconData.width}\n height={iconData.height}\n body={iconData.body}\n rotate={rotate}\n flip={flip}\n />\n )}\n </span>\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, useLayoutEffect, useRef } from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\n\nimport store from '../utils/store';\nimport useCloseWatcher from '../utils/useCloseWatcher';\n\nconst $modalContainer = document.getElementById('modal-container');\n\nfunction getBackdropThemeColor() {\n return getComputedStyle(document.documentElement).getPropertyValue(\n '--backdrop-theme-color',\n );\n}\n\nfunction Modal({ children, onClose, onClick, class: className, minimized }) {\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 useEffect(() => {\n const $deckContainers = document.querySelectorAll('.deck-container');\n if (minimized) {\n // Similar to focusDeck in focus-deck.jsx\n // Focus last deck\n const page = $deckContainers[$deckContainers.length - 1]; // last one\n if (page && page.tabIndex === -1) {\n page.focus();\n }\n } else {\n if (children) {\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.setAttribute('inert', '');\n });\n } else {\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.removeAttribute('inert');\n });\n }\n }\n return () => {\n $deckContainers.forEach(($deckContainer) => {\n $deckContainer.removeAttribute('inert');\n });\n };\n }, [children, minimized]);\n\n const $meta = useRef();\n const metaColor = useRef();\n useLayoutEffect(() => {\n if (children && !minimized) {\n const theme = store.local.get('theme');\n if (theme) {\n const backdropColor = getBackdropThemeColor();\n console.log({ backdropColor });\n $meta.current = document.querySelector(\n `meta[name=\"theme-color\"][data-theme-setting=\"manual\"]`,\n );\n if ($meta.current) {\n metaColor.current = $meta.current.content;\n $meta.current.content = backdropColor;\n }\n } else {\n const colorScheme = window.matchMedia('(prefers-color-scheme: dark)')\n .matches\n ? 'dark'\n : 'light';\n const backdropColor = getBackdropThemeColor();\n console.log({ backdropColor });\n $meta.current = document.querySelector(\n `meta[name=\"theme-color\"][media*=\"${colorScheme}\"]`,\n );\n if ($meta.current) {\n metaColor.current = $meta.current.content;\n $meta.current.content = backdropColor;\n }\n }\n } else {\n // Reset meta color\n if ($meta.current && metaColor.current) {\n $meta.current.content = metaColor.current;\n }\n }\n return () => {\n // Reset meta color\n if ($meta.current && metaColor.current) {\n $meta.current.content = metaColor.current;\n }\n };\n }, [children, minimized]);\n\n const Modal = (\n <div\n ref={(node) => {\n modalRef.current = node;\n escRef(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={minimized ? 0 : '-1'}\n inert={minimized}\n onFocus={(e) => {\n try {\n if (e.target === e.currentTarget) {\n const focusElement =\n modalRef.current?.querySelector('[tabindex=\"-1\"]');\n const isFocusable =\n !!focusElement &&\n getComputedStyle(focusElement)?.pointerEvents !== 'none';\n if (focusElement && isFocusable) {\n focusElement.focus();\n }\n }\n } catch (err) {\n console.error(err);\n }\n }}\n >\n {children}\n </div>\n );\n\n return createPortal(Modal, $modalContainer);\n\n // return createPortal(children, $modalContainer);\n}\n\nexport default Modal;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","import { unstable_batchedUpdates } from 'react-dom';\n\nconst isMenuOpen = state => !!state && state[0] === 'o';\nconst batchedUpdates = unstable_batchedUpdates || (callback => callback());\nconst values = Object.values || (obj => Object.keys(obj).map(key => obj[key]));\nconst getTransition = (transition, name) => transition === true || !!(transition && transition[name]);\nconst safeCall = (fn, arg) => typeof fn === 'function' ? fn(arg) : fn;\nconst internalKey = '_szhsinMenu';\nconst getName = component => component[internalKey];\nconst defineName = (name, component) => Object.defineProperty(component, internalKey, {\n value: name\n});\nconst mergeProps = (target, source) => {\n source && Object.keys(source).forEach(key => {\n const targetProp = target[key];\n const sourceProp = source[key];\n if (typeof sourceProp === 'function' && targetProp) {\n target[key] = (...arg) => {\n sourceProp(...arg);\n targetProp(...arg);\n };\n } else {\n target[key] = sourceProp;\n }\n });\n return target;\n};\nconst parsePadding = paddingStr => {\n if (typeof paddingStr !== 'string') return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n const padding = paddingStr.trim().split(/\\s+/, 4).map(parseFloat);\n const top = !isNaN(padding[0]) ? padding[0] : 0;\n const right = !isNaN(padding[1]) ? padding[1] : top;\n return {\n top,\n right,\n bottom: !isNaN(padding[2]) ? padding[2] : top,\n left: !isNaN(padding[3]) ? padding[3] : right\n };\n};\nconst getScrollAncestor = node => {\n while (node) {\n node = node.parentNode;\n if (!node || node === document.body || !node.parentNode) return;\n const {\n overflow,\n overflowX,\n overflowY\n } = getComputedStyle(node);\n if (/auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX)) return node;\n }\n};\nfunction commonProps(isDisabled, isHovering) {\n return {\n 'aria-disabled': isDisabled || undefined,\n tabIndex: isHovering ? 0 : -1\n };\n}\nfunction indexOfNode(nodeList, node) {\n for (let i = 0; i < nodeList.length; i++) {\n if (nodeList[i] === node) return i;\n }\n return -1;\n}\n\nexport { batchedUpdates, commonProps, defineName, getName, getScrollAncestor, getTransition, indexOfNode, isMenuOpen, mergeProps, parsePadding, safeCall, values };\n","import { oneOfType, string, func, object, bool, number, oneOf, exact } from 'prop-types';\n\nconst stylePropTypes = name => ({\n [name ? `${name}ClassName` : 'className']: oneOfType([string, func])\n});\nconst menuPropTypes = {\n className: string,\n ...stylePropTypes('menu'),\n arrowProps: object,\n focusProps: object,\n menuStyle: object,\n arrow: bool,\n setDownOverflow: bool,\n gap: number,\n shift: number,\n align: /*#__PURE__*/oneOf(['start', 'center', 'end']),\n direction: /*#__PURE__*/oneOf(['left', 'right', 'top', 'bottom']),\n position: /*#__PURE__*/oneOf(['auto', 'anchor', 'initial']),\n overflow: /*#__PURE__*/oneOf(['auto', 'visible', 'hidden'])\n};\nconst rootMenuPropTypes = {\n ...menuPropTypes,\n containerProps: object,\n initialMounted: bool,\n unmountOnClose: bool,\n transition: /*#__PURE__*/oneOfType([bool, /*#__PURE__*/exact({\n open: bool,\n close: bool,\n item: bool\n })]),\n transitionTimeout: number,\n boundingBoxRef: object,\n boundingBoxPadding: string,\n reposition: /*#__PURE__*/oneOf(['auto', 'initial']),\n repositionFlag: /*#__PURE__*/oneOfType([string, number]),\n viewScroll: /*#__PURE__*/oneOf(['auto', 'close', 'initial']),\n submenuOpenDelay: number,\n submenuCloseDelay: number,\n portal: /*#__PURE__*/oneOfType([bool, /*#__PURE__*/exact({\n target: object,\n stablePosition: bool\n })]),\n theming: string,\n onItemClick: func\n};\nconst uncontrolledMenuPropTypes = {\n instanceRef: /*#__PURE__*/oneOfType([object, func]),\n onMenuChange: func\n};\n\nexport { menuPropTypes, rootMenuPropTypes, stylePropTypes, uncontrolledMenuPropTypes };\n","import { useMemo } from 'react';\n\nconst useBEM = ({\n block,\n element,\n modifiers,\n className\n}) => useMemo(() => {\n const blockElement = element ? `${block}__${element}` : block;\n let classString = blockElement;\n modifiers && Object.keys(modifiers).forEach(name => {\n const value = modifiers[name];\n if (value) classString += ` ${blockElement}--${value === true ? name : `${name}-${value}`}`;\n });\n let expandedClassName = typeof className === 'function' ? className(modifiers) : className;\n if (typeof expandedClassName === 'string') {\n expandedClassName = expandedClassName.trim();\n if (expandedClassName) classString += ` ${expandedClassName}`;\n }\n return classString;\n}, [block, element, modifiers, className]);\n\nexport { useBEM };\n","import { createContext } from 'react';\n\nconst menuContainerClass = 'szh-menu-container';\nconst menuClass = 'szh-menu';\nconst menuButtonClass = 'szh-menu-button';\nconst menuArrowClass = 'arrow';\nconst menuItemClass = 'item';\nconst menuDividerClass = 'divider';\nconst menuHeaderClass = 'header';\nconst menuGroupClass = 'group';\nconst subMenuClass = 'submenu';\nconst radioGroupClass = 'radio-group';\nconst HoverItemContext = /*#__PURE__*/createContext();\nconst MenuListItemContext = /*#__PURE__*/createContext({});\nconst MenuListContext = /*#__PURE__*/createContext({});\nconst EventHandlersContext = /*#__PURE__*/createContext({});\nconst RadioGroupContext = /*#__PURE__*/createContext({});\nconst SettingsContext = /*#__PURE__*/createContext({});\nconst Keys = /*#__PURE__*/Object.freeze({\n ENTER: 'Enter',\n ESC: 'Escape',\n SPACE: ' ',\n HOME: 'Home',\n END: 'End',\n LEFT: 'ArrowLeft',\n RIGHT: 'ArrowRight',\n UP: 'ArrowUp',\n DOWN: 'ArrowDown'\n});\nconst HoverActionTypes = /*#__PURE__*/Object.freeze({\n RESET: 0,\n SET: 1,\n UNSET: 2,\n INCREASE: 3,\n DECREASE: 4,\n FIRST: 5,\n LAST: 6,\n SET_INDEX: 7\n});\nconst CloseReason = /*#__PURE__*/Object.freeze({\n CLICK: 'click',\n CANCEL: 'cancel',\n BLUR: 'blur',\n SCROLL: 'scroll'\n});\nconst FocusPositions = /*#__PURE__*/Object.freeze({\n FIRST: 'first',\n LAST: 'last'\n});\nconst MenuStateMap = /*#__PURE__*/Object.freeze({\n entering: 'opening',\n entered: 'open',\n exiting: 'closing',\n exited: 'closed'\n});\nconst positionAbsolute = 'absolute';\nconst roleNone = 'none';\nconst roleMenuitem = 'menuitem';\n\nexport { CloseReason, EventHandlersContext, FocusPositions, HoverActionTypes, HoverItemContext, Keys, MenuListContext, MenuListItemContext, MenuStateMap, RadioGroupContext, SettingsContext, menuArrowClass, menuButtonClass, menuClass, menuContainerClass, menuDividerClass, menuGroupClass, menuHeaderClass, menuItemClass, positionAbsolute, radioGroupClass, roleMenuitem, roleNone, subMenuClass };\n","import { useMemo } from 'react';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps, getTransition, safeCall } from '../utils/utils.js';\nimport { useBEM } from '../hooks/useBEM.js';\nimport { menuContainerClass, Keys, CloseReason } from '../utils/constants.js';\n\nconst MenuContainer = ({\n className,\n containerRef,\n containerProps,\n children,\n isOpen,\n theming,\n transition,\n onClose\n}) => {\n const itemTransition = getTransition(transition, 'item');\n const onKeyDown = ({\n key\n }) => {\n switch (key) {\n case Keys.ESC:\n safeCall(onClose, {\n key,\n reason: CloseReason.CANCEL\n });\n break;\n }\n };\n const onBlur = e => {\n if (isOpen && !e.currentTarget.contains(e.relatedTarget)) {\n safeCall(onClose, {\n reason: CloseReason.BLUR\n });\n }\n };\n return /*#__PURE__*/jsx(\"div\", {\n ...mergeProps({\n onKeyDown,\n onBlur\n }, containerProps),\n className: useBEM({\n block: menuContainerClass,\n modifiers: useMemo(() => ({\n theme: theming,\n itemTransition\n }), [theming, itemTransition]),\n className\n }),\n style: {\n position: 'absolute',\n ...(containerProps == null ? void 0 : containerProps.style)\n },\n ref: containerRef,\n children: children\n });\n};\n\nexport { MenuContainer };\n","const createSubmenuCtx = () => {\n let timer,\n count = 0;\n return {\n toggle: isOpen => {\n isOpen ? count++ : count--;\n count = Math.max(count, 0);\n },\n on: (closeDelay, pending, settled) => {\n if (count) {\n if (!timer) timer = setTimeout(() => {\n timer = 0;\n pending();\n }, closeDelay);\n } else {\n settled == null || settled();\n }\n },\n off: () => {\n if (timer) {\n clearTimeout(timer);\n timer = 0;\n }\n }\n };\n};\n\nexport { createSubmenuCtx };\n","import { useState, useRef, useCallback } from 'react';\nimport { HoverActionTypes } from '../utils/constants.js';\nimport { indexOfNode } from '../utils/utils.js';\n\nconst useItems = (menuRef, focusRef) => {\n const [hoverItem, setHoverItem] = useState();\n const stateRef = useRef({\n items: [],\n hoverIndex: -1,\n sorted: false\n });\n const mutableState = stateRef.current;\n const updateItems = useCallback((item, isMounted) => {\n const {\n items\n } = mutableState;\n if (!item) {\n mutableState.items = [];\n } else if (isMounted) {\n items.push(item);\n } else {\n const index = items.indexOf(item);\n if (index > -1) {\n items.splice(index, 1);\n if (item.contains(document.activeElement)) {\n focusRef.current.focus();\n setHoverItem();\n }\n }\n }\n mutableState.hoverIndex = -1;\n mutableState.sorted = false;\n }, [mutableState, focusRef]);\n const dispatch = useCallback((actionType, item, nextIndex) => {\n const {\n items,\n hoverIndex\n } = mutableState;\n const sortItems = () => {\n if (mutableState.sorted) return;\n const orderedNodes = menuRef.current.querySelectorAll('.szh-menu__item');\n items.sort((a, b) => indexOfNode(orderedNodes, a) - indexOfNode(orderedNodes, b));\n mutableState.sorted = true;\n };\n let index = -1,\n newItem = undefined;\n switch (actionType) {\n case HoverActionTypes.RESET:\n break;\n case HoverActionTypes.SET:\n newItem = item;\n break;\n case HoverActionTypes.UNSET:\n newItem = prevItem => prevItem === item ? undefined : prevItem;\n break;\n case HoverActionTypes.FIRST:\n sortItems();\n index = 0;\n newItem = items[index];\n break;\n case HoverActionTypes.LAST:\n sortItems();\n index = items.length - 1;\n newItem = items[index];\n break;\n case HoverActionTypes.SET_INDEX:\n sortItems();\n index = nextIndex;\n newItem = items[index];\n break;\n case HoverActionTypes.INCREASE:\n sortItems();\n index = hoverIndex;\n if (index < 0) index = items.indexOf(item);\n index++;\n if (index >= items.length) index = 0;\n newItem = items[index];\n break;\n case HoverActionTypes.DECREASE:\n sortItems();\n index = hoverIndex;\n if (index < 0) index = items.indexOf(item);\n index--;\n if (index < 0) index = items.length - 1;\n newItem = items[index];\n break;\n default:\n if (process.env.NODE_ENV !== 'production') throw new Error(`[React-Menu] Unknown hover action type: ${actionType}`);\n }\n if (!newItem) index = -1;\n setHoverItem(newItem);\n mutableState.hoverIndex = index;\n }, [menuRef, mutableState]);\n return {\n hoverItem,\n dispatch,\n updateItems\n };\n};\n\nexport { useItems };\n","const getNativeDimension = (transformed, untransformed) => Math.round(transformed) === untransformed ? transformed : untransformed;\nconst getNormalizedClientRect = element => {\n const rect = element.getBoundingClientRect();\n rect.width = getNativeDimension(rect.width, element.offsetWidth);\n rect.height = getNativeDimension(rect.height, element.offsetHeight);\n return rect;\n};\n\nexport { getNormalizedClientRect };\n","import { getNormalizedClientRect } from './getNormalizedClientRect.js';\nimport { parsePadding } from '../utils/utils.js';\n\nconst getPositionHelpers = (containerRef, menuRef, menuScroll, boundingBoxPadding) => {\n const menuRect = getNormalizedClientRect(menuRef.current);\n const containerRect = containerRef.current.getBoundingClientRect();\n const boundingRect = menuScroll === window ? {\n left: 0,\n top: 0,\n right: document.documentElement.clientWidth,\n bottom: window.innerHeight\n } : menuScroll.getBoundingClientRect();\n const padding = parsePadding(boundingBoxPadding);\n const getLeftOverflow = x => x + containerRect.left - boundingRect.left - padding.left;\n const getRightOverflow = x => x + containerRect.left + menuRect.width - boundingRect.right + padding.right;\n const getTopOverflow = y => y + containerRect.top - boundingRect.top - padding.top;\n const getBottomOverflow = y => y + containerRect.top + menuRect.height - boundingRect.bottom + padding.bottom;\n const confineHorizontally = x => {\n let leftOverflow = getLeftOverflow(x);\n if (leftOverflow < 0) {\n x -= leftOverflow;\n } else {\n const rightOverflow = getRightOverflow(x);\n if (rightOverflow > 0) {\n x -= rightOverflow;\n leftOverflow = getLeftOverflow(x);\n if (leftOverflow < 0) x -= leftOverflow;\n }\n }\n return x;\n };\n const confineVertically = y => {\n let topOverflow = getTopOverflow(y);\n if (topOverflow < 0) {\n y -= topOverflow;\n } else {\n const bottomOverflow = getBottomOverflow(y);\n if (bottomOverflow > 0) {\n y -= bottomOverflow;\n topOverflow = getTopOverflow(y);\n if (topOverflow < 0) y -= topOverflow;\n }\n }\n return y;\n };\n return {\n menuRect,\n containerRect,\n getLeftOverflow,\n getRightOverflow,\n getTopOverflow,\n getBottomOverflow,\n confineHorizontally,\n confineVertically\n };\n};\n\nexport { getPositionHelpers };\n","const placeArrowVertical = ({\n arrowRef,\n menuY,\n anchorRect,\n containerRect,\n menuRect\n}) => {\n let y = anchorRect.top - containerRect.top - menuY + anchorRect.height / 2;\n const offset = arrowRef.current.offsetHeight * 1.25;\n y = Math.max(offset, y);\n y = Math.min(y, menuRect.height - offset);\n return y;\n};\n\nexport { placeArrowVertical };\n","import { placeArrowVertical } from './placeArrowVertical.js';\n\nconst placeLeftorRight = ({\n anchorRect,\n containerRect,\n menuRect,\n placeLeftorRightY,\n placeLeftX,\n placeRightX,\n getLeftOverflow,\n getRightOverflow,\n confineHorizontally,\n confineVertically,\n arrowRef,\n arrow,\n direction,\n position\n}) => {\n let computedDirection = direction;\n let y = placeLeftorRightY;\n if (position !== 'initial') {\n y = confineVertically(y);\n if (position === 'anchor') {\n y = Math.min(y, anchorRect.bottom - containerRect.top);\n y = Math.max(y, anchorRect.top - containerRect.top - menuRect.height);\n }\n }\n let x, leftOverflow, rightOverflow;\n if (computedDirection === 'left') {\n x = placeLeftX;\n if (position !== 'initial') {\n leftOverflow = getLeftOverflow(x);\n if (leftOverflow < 0) {\n rightOverflow = getRightOverflow(placeRightX);\n if (rightOverflow <= 0 || -leftOverflow > rightOverflow) {\n x = placeRightX;\n computedDirection = 'right';\n }\n }\n }\n } else {\n x = placeRightX;\n if (position !== 'initial') {\n rightOverflow = getRightOverflow(x);\n if (rightOverflow > 0) {\n leftOverflow = getLeftOverflow(placeLeftX);\n if (leftOverflow >= 0 || -leftOverflow < rightOverflow) {\n x = placeLeftX;\n computedDirection = 'left';\n }\n }\n }\n }\n if (position === 'auto') x = confineHorizontally(x);\n const arrowY = arrow ? placeArrowVertical({\n menuY: y,\n arrowRef,\n anchorRect,\n containerRect,\n menuRect\n }) : undefined;\n return {\n arrowY,\n x,\n y,\n computedDirection\n };\n};\n\nexport { placeLeftorRight };\n","const placeArrowHorizontal = ({\n arrowRef,\n menuX,\n anchorRect,\n containerRect,\n menuRect\n}) => {\n let x = anchorRect.left - containerRect.left - menuX + anchorRect.width / 2;\n const offset = arrowRef.current.offsetWidth * 1.25;\n x = Math.max(offset, x);\n x = Math.min(x, menuRect.width - offset);\n return x;\n};\n\nexport { placeArrowHorizontal };\n","import { placeArrowHorizontal } from './placeArrowHorizontal.js';\n\nconst placeToporBottom = ({\n anchorRect,\n containerRect,\n menuRect,\n placeToporBottomX,\n placeTopY,\n placeBottomY,\n getTopOverflow,\n getBottomOverflow,\n confineHorizontally,\n confineVertically,\n arrowRef,\n arrow,\n direction,\n position\n}) => {\n let computedDirection = direction === 'top' ? 'top' : 'bottom';\n let x = placeToporBottomX;\n if (position !== 'initial') {\n x = confineHorizontally(x);\n if (position === 'anchor') {\n x = Math.min(x, anchorRect.right - containerRect.left);\n x = Math.max(x, anchorRect.left - containerRect.left - menuRect.width);\n }\n }\n let y, topOverflow, bottomOverflow;\n if (computedDirection === 'top') {\n y = placeTopY;\n if (position !== 'initial') {\n topOverflow = getTopOverflow(y);\n if (topOverflow < 0) {\n bottomOverflow = getBottomOverflow(placeBottomY);\n if (bottomOverflow <= 0 || -topOverflow > bottomOverflow) {\n y = placeBottomY;\n computedDirection = 'bottom';\n }\n }\n }\n } else {\n y = placeBottomY;\n if (position !== 'initial') {\n bottomOverflow = getBottomOverflow(y);\n if (bottomOverflow > 0) {\n topOverflow = getTopOverflow(placeTopY);\n if (topOverflow >= 0 || -topOverflow < bottomOverflow) {\n y = placeTopY;\n computedDirection = 'top';\n }\n }\n }\n }\n if (position === 'auto') y = confineVertically(y);\n const arrowX = arrow ? placeArrowHorizontal({\n menuX: x,\n arrowRef,\n anchorRect,\n containerRect,\n menuRect\n }) : undefined;\n return {\n arrowX,\n x,\n y,\n computedDirection\n };\n};\n\nexport { placeToporBottom };\n","import { placeLeftorRight } from './placeLeftorRight.js';\nimport { placeToporBottom } from './placeToporBottom.js';\n\nconst positionMenu = ({\n arrow,\n align,\n direction,\n gap,\n shift,\n position,\n anchorRect,\n arrowRef,\n positionHelpers\n}) => {\n const {\n menuRect,\n containerRect\n } = positionHelpers;\n const isHorizontal = direction === 'left' || direction === 'right';\n let horizontalOffset = isHorizontal ? gap : shift;\n let verticalOffset = isHorizontal ? shift : gap;\n if (arrow) {\n const arrowElt = arrowRef.current;\n if (isHorizontal) {\n horizontalOffset += arrowElt.offsetWidth;\n } else {\n verticalOffset += arrowElt.offsetHeight;\n }\n }\n const placeLeftX = anchorRect.left - containerRect.left - menuRect.width - horizontalOffset;\n const placeRightX = anchorRect.right - containerRect.left + horizontalOffset;\n const placeTopY = anchorRect.top - containerRect.top - menuRect.height - verticalOffset;\n const placeBottomY = anchorRect.bottom - containerRect.top + verticalOffset;\n let placeToporBottomX, placeLeftorRightY;\n if (align === 'end') {\n placeToporBottomX = anchorRect.right - containerRect.left - menuRect.width;\n placeLeftorRightY = anchorRect.bottom - containerRect.top - menuRect.height;\n } else if (align === 'center') {\n placeToporBottomX = anchorRect.left - containerRect.left - (menuRect.width - anchorRect.width) / 2;\n placeLeftorRightY = anchorRect.top - containerRect.top - (menuRect.height - anchorRect.height) / 2;\n } else {\n placeToporBottomX = anchorRect.left - containerRect.left;\n placeLeftorRightY = anchorRect.top - containerRect.top;\n }\n placeToporBottomX += horizontalOffset;\n placeLeftorRightY += verticalOffset;\n const options = {\n ...positionHelpers,\n anchorRect,\n placeLeftX,\n placeRightX,\n placeLeftorRightY,\n placeTopY,\n placeBottomY,\n placeToporBottomX,\n arrowRef,\n arrow,\n direction,\n position\n };\n switch (direction) {\n case 'left':\n case 'right':\n return placeLeftorRight(options);\n case 'top':\n case 'bottom':\n default:\n return placeToporBottom(options);\n }\n};\n\nexport { positionMenu };\n","import { useLayoutEffect, useEffect } from 'react';\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect as useLayoutEffect };\n","import { useMemo } from 'react';\n\nfunction setRef(ref, instance) {\n typeof ref === 'function' ? ref(instance) : ref.current = instance;\n}\nconst useCombinedRef = (refA, refB) => useMemo(() => {\n if (!refA) return refB;\n if (!refB) return refA;\n return instance => {\n setRef(refA, instance);\n setRef(refB, instance);\n };\n}, [refA, refB]);\n\nexport { useCombinedRef };\n","import { useState, useReducer, useContext, useRef, useCallback, useEffect, useMemo } from 'react';\nimport { flushSync } from 'react-dom';\nimport { MenuContainer } from './MenuContainer.js';\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { createSubmenuCtx } from '../utils/submenuCtx.js';\nimport { SettingsContext, MenuListContext, HoverActionTypes, menuClass, menuArrowClass, positionAbsolute, roleNone, MenuListItemContext, HoverItemContext, Keys, CloseReason, FocusPositions } from '../utils/constants.js';\nimport { useItems } from '../hooks/useItems.js';\nimport { getScrollAncestor, commonProps, mergeProps, safeCall, isMenuOpen, getTransition, batchedUpdates } from '../utils/utils.js';\nimport { getPositionHelpers } from '../positionUtils/getPositionHelpers.js';\nimport { positionMenu } from '../positionUtils/positionMenu.js';\nimport { useLayoutEffect as useIsomorphicLayoutEffect } from '../hooks/useIsomorphicLayoutEffect.js';\nimport { useBEM } from '../hooks/useBEM.js';\nimport { useCombinedRef } from '../hooks/useCombinedRef.js';\n\nconst offScreen = -9999;\nconst MenuList = ({\n ariaLabel,\n menuClassName,\n menuStyle,\n arrow,\n arrowProps = {},\n anchorPoint,\n anchorRef,\n containerRef,\n containerProps,\n focusProps,\n externalRef,\n parentScrollingRef,\n align = 'start',\n direction = 'bottom',\n position = 'auto',\n overflow = 'visible',\n setDownOverflow,\n repositionFlag,\n captureFocus = true,\n state,\n endTransition,\n isDisabled,\n menuItemFocus,\n gap = 0,\n shift = 0,\n children,\n onClose,\n ...restProps\n}) => {\n const [menuPosition, setMenuPosition] = useState({\n x: offScreen,\n y: offScreen\n });\n const [arrowPosition, setArrowPosition] = useState({});\n const [overflowData, setOverflowData] = useState();\n const [expandedDirection, setExpandedDirection] = useState(direction);\n const [submenuCtx] = useState(createSubmenuCtx);\n const [reposSubmenu, forceReposSubmenu] = useReducer(c => c + 1, 1);\n const {\n transition,\n boundingBoxRef,\n boundingBoxPadding,\n rootMenuRef,\n rootAnchorRef,\n scrollNodesRef,\n reposition,\n viewScroll,\n submenuCloseDelay\n } = useContext(SettingsContext);\n const {\n submenuCtx: parentSubmenuCtx,\n reposSubmenu: reposFlag = repositionFlag\n } = useContext(MenuListContext);\n const menuRef = useRef(null);\n const focusRef = useRef();\n const arrowRef = useRef();\n const prevOpen = useRef(false);\n const {\n hoverItem,\n dispatch,\n updateItems\n } = useItems(menuRef, focusRef);\n const isOpen = isMenuOpen(state);\n const openTransition = getTransition(transition, 'open');\n const closeTransition = getTransition(transition, 'close');\n const scrollNodes = scrollNodesRef.current;\n const onKeyDown = e => {\n switch (e.key) {\n case Keys.HOME:\n dispatch(HoverActionTypes.FIRST);\n break;\n case Keys.END:\n dispatch(HoverActionTypes.LAST);\n break;\n case Keys.UP:\n dispatch(HoverActionTypes.DECREASE, hoverItem);\n break;\n case Keys.DOWN:\n dispatch(HoverActionTypes.INCREASE, hoverItem);\n break;\n case Keys.SPACE:\n if (e.target && e.target.className.indexOf(menuClass) !== -1) {\n e.preventDefault();\n }\n return;\n default:\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n };\n const onAnimationEnd = () => {\n if (state === 'closing') {\n setOverflowData();\n }\n safeCall(endTransition);\n };\n const onPointerMove = e => {\n e.stopPropagation();\n submenuCtx.on(submenuCloseDelay, () => {\n dispatch(HoverActionTypes.RESET);\n focusRef.current.focus();\n });\n };\n const onPointerLeave = e => {\n if (e.target === e.currentTarget) submenuCtx.off();\n };\n const handlePosition = useCallback(noOverflowCheck => {\n var _anchorRef$current;\n const anchorRect = anchorRef ? (_anchorRef$current = anchorRef.current) == null ? void 0 : _anchorRef$current.getBoundingClientRect() : anchorPoint ? {\n left: anchorPoint.x,\n right: anchorPoint.x,\n top: anchorPoint.y,\n bottom: anchorPoint.y,\n width: 0,\n height: 0\n } : null;\n if (!anchorRect) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[React-Menu] Menu might not be positioned properly as one of the anchorRef or anchorPoint prop should be provided. If `anchorRef` is provided, the anchor must be mounted before menu is open.');\n }\n return;\n }\n if (!scrollNodes.menu) {\n scrollNodes.menu = (boundingBoxRef ? boundingBoxRef.current : getScrollAncestor(rootMenuRef.current)) || window;\n }\n const positionHelpers = getPositionHelpers(containerRef, menuRef, scrollNodes.menu, boundingBoxPadding);\n let {\n arrowX,\n arrowY,\n x,\n y,\n computedDirection\n } = positionMenu({\n arrow,\n align,\n direction,\n gap,\n shift,\n position,\n anchorRect,\n arrowRef,\n positionHelpers\n });\n const {\n menuRect\n } = positionHelpers;\n const menuHeight = menuRect.height;\n if (!noOverflowCheck && overflow !== 'visible') {\n const {\n getTopOverflow,\n getBottomOverflow\n } = positionHelpers;\n let height, overflowAmt;\n const bottomOverflow = getBottomOverflow(y);\n if (bottomOverflow > 0) {\n height = menuHeight - bottomOverflow;\n overflowAmt = bottomOverflow;\n } else {\n const topOverflow = getTopOverflow(y);\n if (topOverflow < 0) {\n height = menuHeight + topOverflow;\n overflowAmt = 0 - topOverflow;\n if (height >= 0) y -= topOverflow;\n }\n }\n if (height >= 0) {\n setOverflowData({\n height,\n overflowAmt\n });\n }\n }\n if (arrow) setArrowPosition({\n x: arrowX,\n y: arrowY\n });\n setMenuPosition({\n x,\n y\n });\n setExpandedDirection(computedDirection);\n }, [arrow, align, boundingBoxPadding, direction, gap, shift, position, overflow, anchorPoint, anchorRef, containerRef, boundingBoxRef, rootMenuRef, scrollNodes]);\n useIsomorphicLayoutEffect(() => {\n if (isOpen) {\n handlePosition();\n if (prevOpen.current) forceReposSubmenu();\n }\n prevOpen.current = isOpen;\n }, [isOpen, handlePosition, reposFlag]);\n useIsomorphicLayoutEffect(() => {\n if (overflowData && !setDownOverflow) menuRef.current.scrollTop = 0;\n }, [overflowData, setDownOverflow]);\n useIsomorphicLayoutEffect(() => updateItems, [updateItems]);\n useEffect(() => {\n let {\n menu: menuScroll\n } = scrollNodes;\n if (!isOpen || !menuScroll) return;\n menuScroll = menuScroll.addEventListener ? menuScroll : window;\n if (!scrollNodes.anchors) {\n scrollNodes.anchors = [];\n let anchorScroll = getScrollAncestor(rootAnchorRef && rootAnchorRef.current);\n while (anchorScroll && anchorScroll !== menuScroll) {\n scrollNodes.anchors.push(anchorScroll);\n anchorScroll = getScrollAncestor(anchorScroll);\n }\n }\n let scroll = viewScroll;\n if (scrollNodes.anchors.length && scroll === 'initial') scroll = 'auto';\n if (scroll === 'initial') return;\n const handleScroll = () => {\n if (scroll === 'auto') {\n batchedUpdates(() => handlePosition(true));\n } else {\n safeCall(onClose, {\n reason: CloseReason.SCROLL\n });\n }\n };\n const scrollObservers = scrollNodes.anchors.concat(viewScroll !== 'initial' ? menuScroll : []);\n scrollObservers.forEach(o => o.addEventListener('scroll', handleScroll));\n return () => scrollObservers.forEach(o => o.removeEventListener('scroll', handleScroll));\n }, [rootAnchorRef, scrollNodes, isOpen, onClose, viewScroll, handlePosition]);\n const hasOverflow = !!overflowData && overflowData.overflowAmt > 0;\n useEffect(() => {\n if (hasOverflow || !isOpen || !parentScrollingRef) return;\n const handleScroll = () => batchedUpdates(handlePosition);\n const parentScroll = parentScrollingRef.current;\n parentScroll.addEventListener('scroll', handleScroll);\n return () => parentScroll.removeEventListener('scroll', handleScroll);\n }, [isOpen, hasOverflow, parentScrollingRef, handlePosition]);\n useEffect(() => {\n if (!isOpen || typeof ResizeObserver !== 'function' || reposition === 'initial') return;\n const targetList = [];\n const resizeObserver = new ResizeObserver(entries => entries.forEach(({\n target\n }) => {\n if (targetList.indexOf(target) < 0) {\n targetList.push(target);\n } else {\n flushSync(() => {\n handlePosition();\n forceReposSubmenu();\n });\n }\n }));\n const resizeObserverOptions = {\n box: 'border-box'\n };\n resizeObserver.observe(menuRef.current, resizeObserverOptions);\n const anchor = anchorRef == null ? void 0 : anchorRef.current;\n anchor && resizeObserver.observe(anchor, resizeObserverOptions);\n return () => resizeObserver.disconnect();\n }, [isOpen, reposition, anchorRef, handlePosition]);\n useEffect(() => {\n if (!isOpen) {\n dispatch(HoverActionTypes.RESET);\n if (!closeTransition) setOverflowData();\n return;\n }\n const {\n position,\n alwaysUpdate\n } = menuItemFocus || {};\n const setItemFocus = () => {\n if (position === FocusPositions.FIRST) {\n dispatch(HoverActionTypes.FIRST);\n } else if (position === FocusPositions.LAST) {\n dispatch(HoverActionTypes.LAST);\n } else if (position >= -1) {\n dispatch(HoverActionTypes.SET_INDEX, undefined, position);\n }\n };\n if (alwaysUpdate) {\n setItemFocus();\n } else if (captureFocus) {\n const id = setTimeout(() => {\n const menuElt = menuRef.current;\n if (menuElt && !menuElt.contains(document.activeElement)) {\n focusRef.current.focus();\n setItemFocus();\n }\n }, openTransition ? 170 : 100);\n return () => clearTimeout(id);\n }\n }, [isOpen, openTransition, closeTransition, captureFocus, menuItemFocus, dispatch]);\n const itemContext = useMemo(() => ({\n isParentOpen: isOpen,\n submenuCtx,\n dispatch,\n updateItems\n }), [isOpen, submenuCtx, dispatch, updateItems]);\n let maxHeight, overflowAmt;\n if (overflowData) {\n setDownOverflow ? overflowAmt = overflowData.overflowAmt : maxHeight = overflowData.height;\n }\n const listContext = useMemo(() => ({\n reposSubmenu,\n submenuCtx,\n overflow,\n overflowAmt,\n parentMenuRef: menuRef,\n parentDir: expandedDirection\n }), [reposSubmenu, submenuCtx, overflow, overflowAmt, expandedDirection]);\n const overflowStyle = maxHeight >= 0 ? {\n maxHeight,\n overflow\n } : undefined;\n const modifiers = useMemo(() => ({\n state,\n align,\n dir: expandedDirection\n }), [state, align, expandedDirection]);\n const arrowModifiers = useMemo(() => ({\n dir: expandedDirection\n }), [expandedDirection]);\n const _arrowClassName = useBEM({\n block: menuClass,\n element: menuArrowClass,\n modifiers: arrowModifiers,\n className: arrowProps.className\n });\n const menu = /*#__PURE__*/jsxs(\"ul\", {\n role: \"menu\",\n \"aria-label\": ariaLabel,\n ...commonProps(isDisabled),\n ...mergeProps({\n onPointerEnter: parentSubmenuCtx == null ? void 0 : parentSubmenuCtx.off,\n onPointerMove,\n onPointerLeave,\n onKeyDown,\n onAnimationEnd\n }, restProps),\n ref: useCombinedRef(externalRef, menuRef),\n className: useBEM({\n block: menuClass,\n modifiers,\n className: menuClassName\n }),\n style: {\n ...menuStyle,\n ...overflowStyle,\n margin: 0,\n display: state === 'closed' ? 'none' : undefined,\n position: positionAbsolute,\n left: menuPosition.x,\n top: menuPosition.y\n },\n children: [/*#__PURE__*/jsx(\"li\", {\n tabIndex: -1,\n role: roleNone,\n style: {\n position: positionAbsolute,\n left: 0,\n top: 0,\n display: 'block',\n outline: 'none'\n },\n ref: focusRef,\n ...focusProps\n }), arrow && /*#__PURE__*/jsx(\"li\", {\n role: roleNone,\n ...arrowProps,\n className: _arrowClassName,\n style: {\n display: 'block',\n position: positionAbsolute,\n left: arrowPosition.x,\n top: arrowPosition.y,\n ...arrowProps.style\n },\n ref: arrowRef\n }), /*#__PURE__*/jsx(MenuListContext.Provider, {\n value: listContext,\n children: /*#__PURE__*/jsx(MenuListItemContext.Provider, {\n value: itemContext,\n children: /*#__PURE__*/jsx(HoverItemContext.Provider, {\n value: hoverItem,\n children: safeCall(children, modifiers)\n })\n })\n })]\n });\n return containerProps ? /*#__PURE__*/jsx(MenuContainer, {\n ...containerProps,\n isOpen: isOpen,\n children: menu\n }) : menu;\n};\n\nexport { MenuList };\n","import { forwardRef, useRef, useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { oneOf, exact, number, object, bool, oneOfType, string, func } from 'prop-types';\nimport { MenuList } from './MenuList.js';\nimport { jsx } from 'react/jsx-runtime';\nimport { rootMenuPropTypes } from '../utils/propTypes.js';\nimport { safeCall, values } from '../utils/utils.js';\nimport { MenuStateMap, Keys, CloseReason, SettingsContext, EventHandlersContext } from '../utils/constants.js';\n\nconst ControlledMenu = /*#__PURE__*/forwardRef(function ControlledMenu({\n 'aria-label': ariaLabel,\n className,\n containerProps,\n initialMounted,\n unmountOnClose,\n transition,\n transitionTimeout,\n boundingBoxRef,\n boundingBoxPadding,\n reposition = 'auto',\n submenuOpenDelay = 300,\n submenuCloseDelay = 150,\n viewScroll = 'initial',\n portal,\n theming,\n onItemClick,\n ...restProps\n}, externalRef) {\n const containerRef = useRef(null);\n const scrollNodesRef = useRef({});\n const {\n anchorRef,\n state,\n onClose\n } = restProps;\n const settings = useMemo(() => ({\n initialMounted,\n unmountOnClose,\n transition,\n transitionTimeout,\n boundingBoxRef,\n boundingBoxPadding,\n rootMenuRef: containerRef,\n rootAnchorRef: anchorRef,\n scrollNodesRef,\n reposition,\n viewScroll,\n submenuOpenDelay,\n submenuCloseDelay\n }), [initialMounted, unmountOnClose, transition, transitionTimeout, anchorRef, boundingBoxRef, boundingBoxPadding, reposition, viewScroll, submenuOpenDelay, submenuCloseDelay]);\n const eventHandlers = useMemo(() => ({\n handleClick(event, isCheckorRadio) {\n if (!event.stopPropagation) safeCall(onItemClick, event);\n let keepOpen = event.keepOpen;\n if (keepOpen === undefined) {\n keepOpen = isCheckorRadio && event.key === Keys.SPACE;\n }\n if (!keepOpen) {\n safeCall(onClose, {\n value: event.value,\n key: event.key,\n reason: CloseReason.CLICK\n });\n }\n },\n handleClose(key) {\n safeCall(onClose, {\n key,\n reason: CloseReason.CLICK\n });\n }\n }), [onItemClick, onClose]);\n if (!state) return null;\n const menuList = /*#__PURE__*/jsx(SettingsContext.Provider, {\n value: settings,\n children: /*#__PURE__*/jsx(EventHandlersContext.Provider, {\n value: eventHandlers,\n children: /*#__PURE__*/jsx(MenuList, {\n ...restProps,\n ariaLabel: ariaLabel || 'Menu',\n externalRef: externalRef,\n containerRef: containerRef,\n containerProps: {\n className,\n containerRef,\n containerProps,\n theming,\n transition,\n onClose\n }\n })\n })\n });\n if (portal === true && typeof document !== 'undefined') {\n return /*#__PURE__*/createPortal(menuList, document.body);\n } else if (portal) {\n return portal.target ? /*#__PURE__*/createPortal(menuList, portal.target) : portal.stablePosition ? null : menuList;\n }\n return menuList;\n});\nprocess.env.NODE_ENV !== \"production\" ? ControlledMenu.propTypes = {\n ...rootMenuPropTypes,\n state: /*#__PURE__*/oneOf( /*#__PURE__*/values(MenuStateMap)),\n anchorPoint: /*#__PURE__*/exact({\n x: number,\n y: number\n }),\n anchorRef: object,\n captureFocus: bool,\n menuItemFocus: /*#__PURE__*/exact({\n position: /*#__PURE__*/oneOfType([string, number]),\n alwaysUpdate: bool\n }),\n onClose: func\n} : void 0;\n\nexport { ControlledMenu };\n","const PRE_ENTER = 0;\nconst ENTERING = 1;\nconst ENTERED = 2;\nconst PRE_EXIT = 3;\nconst EXITING = 4;\nconst EXITED = 5;\nconst UNMOUNTED = 6;\nconst STATUS = ['preEnter', 'entering', 'entered', 'preExit', 'exiting', 'exited', 'unmounted'];\nconst getState = status => ({\n _s: status,\n status: STATUS[status],\n isEnter: status < PRE_EXIT,\n isMounted: status !== UNMOUNTED,\n isResolved: status === ENTERED || status > EXITING\n});\nconst startOrEnd = unmounted => unmounted ? UNMOUNTED : EXITED;\nconst getEndStatus = (status, unmountOnExit) => {\n switch (status) {\n case ENTERING:\n case PRE_ENTER:\n return ENTERED;\n case EXITING:\n case PRE_EXIT:\n return startOrEnd(unmountOnExit);\n }\n};\nconst getTimeout = timeout => typeof timeout === 'object' ? [timeout.enter, timeout.exit] : [timeout, timeout];\nconst nextTick = (transitState, status) => setTimeout(() => {\n // Reading document.body.offsetTop can force browser to repaint before transition to the next state\n isNaN(document.body.offsetTop) || transitState(status + 1);\n}, 0);\n\nexport { ENTERED, ENTERING, EXITED, EXITING, PRE_ENTER, PRE_EXIT, STATUS, UNMOUNTED, getEndStatus, getState, getTimeout, nextTick, startOrEnd };\n","import { useState, useRef, useCallback, useEffect } from 'react';\nimport { getState, ENTERED, startOrEnd, getTimeout, getEndStatus, PRE_EXIT, nextTick, PRE_ENTER, EXITING, ENTERING } from './utils.js';\n\nconst updateState = (status, setState, latestState, timeoutId, onChange) => {\n clearTimeout(timeoutId.current);\n const state = getState(status);\n setState(state);\n latestState.current = state;\n onChange && onChange({\n current: state\n });\n};\nconst useTransitionState = ({\n enter = true,\n exit = true,\n preEnter,\n preExit,\n timeout,\n initialEntered,\n mountOnEnter,\n unmountOnExit,\n onStateChange: onChange\n} = {}) => {\n const [state, setState] = useState(() => getState(initialEntered ? ENTERED : startOrEnd(mountOnEnter)));\n const latestState = useRef(state);\n const timeoutId = useRef();\n const [enterTimeout, exitTimeout] = getTimeout(timeout);\n const endTransition = useCallback(() => {\n const status = getEndStatus(latestState.current._s, unmountOnExit);\n status && updateState(status, setState, latestState, timeoutId, onChange);\n }, [onChange, unmountOnExit]);\n const toggle = useCallback(toEnter => {\n const transitState = status => {\n updateState(status, setState, latestState, timeoutId, onChange);\n switch (status) {\n case ENTERING:\n if (enterTimeout >= 0) timeoutId.current = setTimeout(endTransition, enterTimeout);\n break;\n case EXITING:\n if (exitTimeout >= 0) timeoutId.current = setTimeout(endTransition, exitTimeout);\n break;\n case PRE_ENTER:\n case PRE_EXIT:\n timeoutId.current = nextTick(transitState, status);\n break;\n }\n };\n const enterStage = latestState.current.isEnter;\n if (typeof toEnter !== 'boolean') toEnter = !enterStage;\n if (toEnter) {\n !enterStage && transitState(enter ? preEnter ? PRE_ENTER : ENTERING : ENTERED);\n } else {\n enterStage && transitState(exit ? preExit ? PRE_EXIT : EXITING : startOrEnd(unmountOnExit));\n }\n }, [endTransition, onChange, enter, exit, preEnter, preExit, enterTimeout, exitTimeout, unmountOnExit]);\n useEffect(() => () => clearTimeout(timeoutId.current), []);\n return [state, toggle, endTransition];\n};\n\nexport { useTransitionState };\n","import { useTransition } from 'react-transition-state';\nimport { getTransition } from '../utils/utils.js';\nimport { MenuStateMap } from '../utils/constants.js';\n\nconst useMenuState = ({\n initialOpen,\n initialMounted,\n unmountOnClose,\n transition,\n transitionTimeout = 500\n} = {}) => {\n const [{\n status\n }, toggleMenu, endTransition] = useTransition({\n initialEntered: initialOpen,\n mountOnEnter: !initialMounted,\n unmountOnExit: unmountOnClose,\n timeout: transitionTimeout,\n enter: getTransition(transition, 'open'),\n exit: getTransition(transition, 'close')\n });\n return [{\n state: MenuStateMap[status],\n endTransition\n }, toggleMenu];\n};\n\nexport { useMenuState };\n","import { useState } from 'react';\nimport { useMenuState } from './useMenuState.js';\n\nconst useMenuStateAndFocus = options => {\n const [menuProps, toggleMenu] = useMenuState(options);\n const [menuItemFocus, setMenuItemFocus] = useState();\n const openMenu = (position, alwaysUpdate) => {\n setMenuItemFocus({\n position,\n alwaysUpdate\n });\n toggleMenu(true);\n };\n return [{\n menuItemFocus,\n ...menuProps\n }, toggleMenu, openMenu];\n};\n\nexport { useMenuStateAndFocus };\n","import { useState } from 'react';\n\nconst useClick = (state, onToggle) => {\n if (process.env.NODE_ENV !== 'production' && typeof onToggle !== 'function') {\n throw new Error('[React-Menu] useClick/useHover requires a function in the second parameter.');\n }\n const [skipOpen] = useState({});\n return {\n onMouseDown: () => {\n skipOpen.v = state && state !== 'closed';\n },\n onClick: e => skipOpen.v ? skipOpen.v = false : onToggle(true, e)\n };\n};\n\nexport { useClick };\n","import { useRef, useEffect } from 'react';\nimport { safeCall } from '../utils/utils.js';\n\nconst useMenuChange = (onMenuChange, isOpen) => {\n const prevOpen = useRef(isOpen);\n useEffect(() => {\n if (prevOpen.current !== isOpen) safeCall(onMenuChange, {\n open: isOpen\n });\n prevOpen.current = isOpen;\n }, [onMenuChange, isOpen]);\n};\n\nexport { useMenuChange };\n","import { forwardRef, useRef, useCallback, useImperativeHandle, Fragment, cloneElement } from 'react';\nimport { oneOfType, element, func } from 'prop-types';\nimport { ControlledMenu } from './ControlledMenu.js';\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { useMenuStateAndFocus } from '../hooks/useMenuStateAndFocus.js';\nimport { useClick } from '../hooks/useClick.js';\nimport { useCombinedRef } from '../hooks/useCombinedRef.js';\nimport { useMenuChange } from '../hooks/useMenuChange.js';\nimport { rootMenuPropTypes, uncontrolledMenuPropTypes } from '../utils/propTypes.js';\nimport { safeCall, mergeProps, getName, isMenuOpen } from '../utils/utils.js';\nimport { FocusPositions, Keys } from '../utils/constants.js';\n\nconst Menu = /*#__PURE__*/forwardRef(function Menu({\n 'aria-label': ariaLabel,\n captureFocus: _,\n initialOpen: _1,\n menuButton,\n instanceRef,\n onMenuChange,\n ...restProps\n}, externalRef) {\n const [stateProps, toggleMenu, openMenu] = useMenuStateAndFocus(restProps);\n const {\n state\n } = stateProps;\n const isOpen = isMenuOpen(state);\n const buttonRef = useRef(null);\n const anchorProps = useClick(state, (_, e) => openMenu(!e.detail ? FocusPositions.FIRST : undefined));\n const handleClose = useCallback(e => {\n toggleMenu(false);\n if (e.key) buttonRef.current.focus();\n }, [toggleMenu]);\n const onKeyDown = e => {\n switch (e.key) {\n case Keys.UP:\n openMenu(FocusPositions.LAST);\n break;\n case Keys.DOWN:\n openMenu(FocusPositions.FIRST);\n break;\n default:\n return;\n }\n e.preventDefault();\n };\n const button = safeCall(menuButton, {\n open: isOpen\n });\n if (!button || !button.type) throw new Error('Menu requires a menuButton prop.');\n const buttonProps = {\n ref: useCombinedRef(button.ref, buttonRef),\n ...mergeProps({\n onKeyDown,\n ...anchorProps\n }, button.props)\n };\n if (getName(button.type) === 'MenuButton') {\n buttonProps.isOpen = isOpen;\n }\n const renderButton = /*#__PURE__*/cloneElement(button, buttonProps);\n useMenuChange(onMenuChange, isOpen);\n useImperativeHandle(instanceRef, () => ({\n openMenu,\n closeMenu: () => toggleMenu(false)\n }));\n return /*#__PURE__*/jsxs(Fragment, {\n children: [renderButton, /*#__PURE__*/jsx(ControlledMenu, {\n ...restProps,\n ...stateProps,\n \"aria-label\": ariaLabel || (typeof button.props.children === 'string' ? button.props.children : 'Menu'),\n anchorRef: buttonRef,\n ref: externalRef,\n onClose: handleClose\n })]\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Menu.propTypes = {\n ...rootMenuPropTypes,\n ...uncontrolledMenuPropTypes,\n menuButton: oneOfType([element, func]).isRequired\n} : void 0;\n\nexport { Menu };\n","import { forwardRef, useRef, useContext, memo } from 'react';\nimport { HoverItemContext } from './constants.js';\nimport { jsx } from 'react/jsx-runtime';\n\nconst withHovering = (name, WrappedComponent) => {\n const Component = /*#__PURE__*/memo(WrappedComponent);\n const WithHovering = /*#__PURE__*/forwardRef((props, ref) => {\n const itemRef = useRef(null);\n return /*#__PURE__*/jsx(Component, {\n ...props,\n itemRef: itemRef,\n externalRef: ref,\n isHovering: useContext(HoverItemContext) === itemRef.current\n });\n });\n WithHovering.displayName = `WithHovering(${name})`;\n return WithHovering;\n};\n\nexport { withHovering };\n","import { useLayoutEffect as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js';\n\nconst useItemEffect = (isDisabled, itemRef, updateItems) => {\n useIsomorphicLayoutEffect(() => {\n if (process.env.NODE_ENV !== 'production' && !updateItems) {\n throw new Error(`[React-Menu] This menu item or submenu should be rendered under a menu: ${itemRef.current.outerHTML}`);\n }\n if (isDisabled) return;\n const item = itemRef.current;\n updateItems(item, true);\n return () => {\n updateItems(item);\n };\n }, [isDisabled, itemRef, updateItems]);\n};\n\nexport { useItemEffect };\n","import { useContext, useRef, useState, useEffect, useImperativeHandle, useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { bool, oneOf, oneOfType, node, func, shape } from 'prop-types';\nimport { MenuList } from './MenuList.js';\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { withHovering } from '../utils/withHovering.js';\nimport { menuPropTypes, uncontrolledMenuPropTypes, stylePropTypes } from '../utils/propTypes.js';\nimport { useMenuStateAndFocus } from '../hooks/useMenuStateAndFocus.js';\nimport { useItemEffect } from '../hooks/useItemEffect.js';\nimport { useMenuChange } from '../hooks/useMenuChange.js';\nimport { useBEM } from '../hooks/useBEM.js';\nimport { SettingsContext, MenuListContext, MenuListItemContext, menuClass, subMenuClass, roleNone, roleMenuitem, menuItemClass, HoverActionTypes, Keys, FocusPositions } from '../utils/constants.js';\nimport { useCombinedRef } from '../hooks/useCombinedRef.js';\nimport { mergeProps, commonProps, safeCall, isMenuOpen, batchedUpdates } from '../utils/utils.js';\n\nconst SubMenu = /*#__PURE__*/withHovering('SubMenu', function SubMenu({\n 'aria-label': ariaLabel,\n className,\n disabled,\n direction,\n label,\n openTrigger,\n onMenuChange,\n isHovering,\n instanceRef,\n itemRef,\n captureFocus: _1,\n repositionFlag: _2,\n itemProps = {},\n ...restProps\n}) {\n const settings = useContext(SettingsContext);\n const {\n rootMenuRef,\n submenuOpenDelay,\n submenuCloseDelay\n } = settings;\n const {\n parentMenuRef,\n parentDir,\n overflow: parentOverflow\n } = useContext(MenuListContext);\n const {\n isParentOpen,\n submenuCtx,\n dispatch,\n updateItems\n } = useContext(MenuListItemContext);\n const isPortal = parentOverflow !== 'visible';\n const [stateProps, toggleMenu, _openMenu] = useMenuStateAndFocus(settings);\n const {\n state\n } = stateProps;\n const isDisabled = !!disabled;\n const isOpen = isMenuOpen(state);\n const containerRef = useRef(null);\n const [timerId] = useState({\n v: 0\n });\n const stopTimer = () => {\n submenuCtx.off();\n if (timerId.v) {\n clearTimeout(timerId.v);\n timerId.v = 0;\n }\n };\n const openMenu = (...args) => {\n stopTimer();\n setHover();\n !isDisabled && _openMenu(...args);\n };\n const setHover = () => !isHovering && !isDisabled && dispatch(HoverActionTypes.SET, itemRef.current);\n const delayOpen = delay => {\n setHover();\n if (!openTrigger) timerId.v = setTimeout(() => batchedUpdates(openMenu), Math.max(delay, 0));\n };\n const onPointerMove = e => {\n if (isDisabled) return;\n e.stopPropagation();\n if (timerId.v || isOpen) return;\n submenuCtx.on(submenuCloseDelay, () => delayOpen(submenuOpenDelay - submenuCloseDelay), () => delayOpen(submenuOpenDelay));\n };\n const onPointerLeave = () => {\n stopTimer();\n if (!isOpen) dispatch(HoverActionTypes.UNSET, itemRef.current);\n };\n const onKeyDown = e => {\n if (!isHovering) return;\n switch (e.key) {\n case Keys.ENTER:\n e.preventDefault();\n case Keys.SPACE:\n case Keys.RIGHT:\n openTrigger !== 'none' && openMenu(FocusPositions.FIRST);\n }\n };\n const onKeyDownOfRoot = e => {\n let handled = false;\n switch (e.key) {\n case Keys.LEFT:\n if (isOpen) {\n itemRef.current.focus();\n toggleMenu(false);\n handled = true;\n }\n break;\n case Keys.RIGHT:\n if (!isOpen) handled = true;\n break;\n }\n if (handled) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n useItemEffect(isDisabled, itemRef, updateItems);\n useMenuChange(onMenuChange, isOpen);\n useEffect(() => submenuCtx.toggle(isOpen), [submenuCtx, isOpen]);\n useEffect(() => () => clearTimeout(timerId.v), [timerId]);\n useEffect(() => {\n if (isHovering && isParentOpen) {\n itemRef.current.focus();\n } else {\n toggleMenu(false);\n }\n }, [isHovering, isParentOpen, toggleMenu, itemRef]);\n useImperativeHandle(instanceRef, () => ({\n openMenu: (...args) => {\n isParentOpen && openMenu(...args);\n },\n closeMenu: () => {\n if (isOpen) {\n itemRef.current.focus();\n toggleMenu(false);\n }\n }\n }));\n const modifiers = useMemo(() => ({\n open: isOpen,\n hover: isHovering,\n disabled: isDisabled,\n submenu: true\n }), [isOpen, isHovering, isDisabled]);\n const {\n ref: externalItemRef,\n className: itemClassName,\n ...restItemProps\n } = itemProps;\n const mergedItemProps = mergeProps({\n onPointerEnter: submenuCtx.off,\n onPointerMove,\n onPointerLeave,\n onKeyDown,\n onClick: () => openTrigger !== 'none' && openMenu()\n }, restItemProps);\n const getMenuList = () => {\n const menuList = /*#__PURE__*/jsx(MenuList, {\n ...restProps,\n ...stateProps,\n ariaLabel: ariaLabel || (typeof label === 'string' ? label : 'Submenu'),\n anchorRef: itemRef,\n containerRef: isPortal ? rootMenuRef : containerRef,\n direction: direction || (parentDir === 'right' || parentDir === 'left' ? parentDir : 'right'),\n parentScrollingRef: isPortal && parentMenuRef,\n isDisabled: isDisabled\n });\n const container = rootMenuRef.current;\n return isPortal && container ? /*#__PURE__*/createPortal(menuList, container) : menuList;\n };\n return /*#__PURE__*/jsxs(\"li\", {\n className: useBEM({\n block: menuClass,\n element: subMenuClass,\n className\n }),\n style: {\n position: 'relative'\n },\n role: roleNone,\n ref: containerRef,\n onKeyDown: onKeyDownOfRoot,\n children: [/*#__PURE__*/jsx(\"div\", {\n role: roleMenuitem,\n \"aria-haspopup\": true,\n \"aria-expanded\": isOpen,\n ...commonProps(isDisabled, isHovering),\n ...mergedItemProps,\n ref: useCombinedRef(externalItemRef, itemRef),\n className: useBEM({\n block: menuClass,\n element: menuItemClass,\n modifiers,\n className: itemClassName\n }),\n children: useMemo(() => safeCall(label, modifiers), [label, modifiers])\n }), state && getMenuList()]\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? SubMenu.propTypes = {\n ...menuPropTypes,\n ...uncontrolledMenuPropTypes,\n disabled: bool,\n openTrigger: /*#__PURE__*/oneOf(['none', 'clickOnly']),\n label: /*#__PURE__*/oneOfType([node, func]),\n itemProps: /*#__PURE__*/shape({\n ...stylePropTypes()\n })\n} : void 0;\n\nexport { SubMenu };\n","import { useContext, useEffect } from 'react';\nimport { useItemEffect } from './useItemEffect.js';\nimport { SettingsContext, MenuListItemContext, HoverActionTypes } from '../utils/constants.js';\n\nconst useItemState = (itemRef, focusRef, isHovering, isDisabled) => {\n const {\n submenuCloseDelay\n } = useContext(SettingsContext);\n const {\n isParentOpen,\n submenuCtx,\n dispatch,\n updateItems\n } = useContext(MenuListItemContext);\n const setHover = () => {\n !isHovering && !isDisabled && dispatch(HoverActionTypes.SET, itemRef.current);\n };\n const unsetHover = () => {\n !isDisabled && dispatch(HoverActionTypes.UNSET, itemRef.current);\n };\n const onBlur = e => {\n if (isHovering && !e.currentTarget.contains(e.relatedTarget)) unsetHover();\n };\n const onPointerMove = e => {\n if (!isDisabled) {\n e.stopPropagation();\n submenuCtx.on(submenuCloseDelay, setHover, setHover);\n }\n };\n const onPointerLeave = (_, keepHover) => {\n submenuCtx.off();\n !keepHover && unsetHover();\n };\n useItemEffect(isDisabled, itemRef, updateItems);\n useEffect(() => {\n if (isHovering && isParentOpen) {\n focusRef.current && focusRef.current.focus();\n }\n }, [focusRef, isHovering, isParentOpen]);\n return {\n setHover,\n onBlur,\n onPointerMove,\n onPointerLeave\n };\n};\n\nexport { useItemState };\n","import { useContext, useMemo } from 'react';\nimport { any, string, oneOf, bool, oneOfType, node, func } from 'prop-types';\nimport { jsx } from 'react/jsx-runtime';\nimport { useItemState } from '../hooks/useItemState.js';\nimport { EventHandlersContext, RadioGroupContext, roleMenuitem, menuClass, menuItemClass, roleNone, Keys } from '../utils/constants.js';\nimport { useCombinedRef } from '../hooks/useCombinedRef.js';\nimport { useBEM } from '../hooks/useBEM.js';\nimport { withHovering } from '../utils/withHovering.js';\nimport { stylePropTypes } from '../utils/propTypes.js';\nimport { mergeProps, commonProps, safeCall } from '../utils/utils.js';\n\nconst MenuItem = /*#__PURE__*/withHovering('MenuItem', function MenuItem({\n className,\n value,\n href,\n type,\n checked,\n disabled,\n children,\n onClick,\n isHovering,\n itemRef,\n externalRef,\n ...restProps\n}) {\n const isDisabled = !!disabled;\n const {\n setHover,\n ...restStateProps\n } = useItemState(itemRef, itemRef, isHovering, isDisabled);\n const eventHandlers = useContext(EventHandlersContext);\n const radioGroup = useContext(RadioGroupContext);\n const isRadio = type === 'radio';\n const isCheckBox = type === 'checkbox';\n const isAnchor = !!href && !isDisabled && !isRadio && !isCheckBox;\n const isChecked = isRadio ? radioGroup.value === value : isCheckBox ? !!checked : false;\n const handleClick = e => {\n if (isDisabled) {\n e.stopPropagation();\n e.preventDefault();\n return;\n }\n const event = {\n value,\n syntheticEvent: e\n };\n if (e.key !== undefined) event.key = e.key;\n if (isCheckBox) event.checked = !isChecked;\n if (isRadio) event.name = radioGroup.name;\n safeCall(onClick, event);\n if (isRadio) safeCall(radioGroup.onRadioChange, event);\n eventHandlers.handleClick(event, isCheckBox || isRadio);\n };\n const handleKeyDown = e => {\n if (!isHovering) return;\n switch (e.key) {\n case Keys.ENTER:\n e.preventDefault();\n case Keys.SPACE:\n isAnchor ? itemRef.current.click() : handleClick(e);\n }\n };\n const modifiers = useMemo(() => ({\n type,\n disabled: isDisabled,\n hover: isHovering,\n checked: isChecked,\n anchor: isAnchor\n }), [type, isDisabled, isHovering, isChecked, isAnchor]);\n const mergedProps = mergeProps({\n ...restStateProps,\n onPointerDown: setHover,\n onKeyDown: handleKeyDown,\n onClick: handleClick\n }, restProps);\n const menuItemProps = {\n role: isRadio ? 'menuitemradio' : isCheckBox ? 'menuitemcheckbox' : roleMenuitem,\n 'aria-checked': isRadio || isCheckBox ? isChecked : undefined,\n ...commonProps(isDisabled, isHovering),\n ...mergedProps,\n ref: useCombinedRef(externalRef, itemRef),\n className: useBEM({\n block: menuClass,\n element: menuItemClass,\n modifiers,\n className\n }),\n children: useMemo(() => safeCall(children, modifiers), [children, modifiers])\n };\n return isAnchor ? /*#__PURE__*/jsx(\"li\", {\n role: roleNone,\n children: /*#__PURE__*/jsx(\"a\", {\n href: href,\n ...menuItemProps\n })\n }) : /*#__PURE__*/jsx(\"li\", {\n ...menuItemProps\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? MenuItem.propTypes = {\n ...stylePropTypes(),\n value: any,\n href: string,\n type: /*#__PURE__*/oneOf(['checkbox', 'radio']),\n checked: bool,\n disabled: bool,\n children: /*#__PURE__*/oneOfType([node, func]),\n onClick: func\n} : void 0;\n\nexport { MenuItem };\n","import { useRef, useContext, useMemo } from 'react';\nimport { bool, func } from 'prop-types';\nimport { jsx } from 'react/jsx-runtime';\nimport { useItemState } from '../hooks/useItemState.js';\nimport { useCombinedRef } from '../hooks/useCombinedRef.js';\nimport { useBEM } from '../hooks/useBEM.js';\nimport { withHovering } from '../utils/withHovering.js';\nimport { stylePropTypes } from '../utils/propTypes.js';\nimport { EventHandlersContext, roleMenuitem, menuClass, menuItemClass } from '../utils/constants.js';\nimport { safeCall, mergeProps, commonProps } from '../utils/utils.js';\n\nconst FocusableItem = /*#__PURE__*/withHovering('FocusableItem', function FocusableItem({\n className,\n disabled,\n children,\n isHovering,\n itemRef,\n externalRef,\n ...restProps\n}) {\n const isDisabled = !!disabled;\n const ref = useRef(null);\n const {\n setHover,\n onPointerLeave,\n ...restStateProps\n } = useItemState(itemRef, ref, isHovering, isDisabled);\n const {\n handleClose\n } = useContext(EventHandlersContext);\n const modifiers = useMemo(() => ({\n disabled: isDisabled,\n hover: isHovering,\n focusable: true\n }), [isDisabled, isHovering]);\n const renderChildren = useMemo(() => safeCall(children, {\n ...modifiers,\n ref,\n closeMenu: handleClose\n }), [children, modifiers, handleClose]);\n const mergedProps = mergeProps({\n ...restStateProps,\n onPointerLeave: e => onPointerLeave(e, true),\n onFocus: setHover\n }, restProps);\n return /*#__PURE__*/jsx(\"li\", {\n role: roleMenuitem,\n ...commonProps(isDisabled),\n ...mergedProps,\n ref: useCombinedRef(externalRef, itemRef),\n className: useBEM({\n block: menuClass,\n element: menuItemClass,\n modifiers,\n className\n }),\n children: renderChildren\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? FocusableItem.propTypes = {\n ...stylePropTypes(),\n disabled: bool,\n children: func\n} : void 0;\n\nexport { FocusableItem };\n","import { memo, forwardRef } from 'react';\nimport { jsx } from 'react/jsx-runtime';\nimport { useBEM } from '../hooks/useBEM.js';\nimport { menuClass, menuDividerClass } from '../utils/constants.js';\nimport { stylePropTypes } from '../utils/propTypes.js';\n\nconst MenuDivider = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function MenuDivider({\n className,\n ...restProps\n}, externalRef) {\n return /*#__PURE__*/jsx(\"li\", {\n role: \"separator\",\n ...restProps,\n ref: externalRef,\n className: useBEM({\n block: menuClass,\n element: menuDividerClass,\n className\n })\n });\n}));\nprocess.env.NODE_ENV !== \"production\" ? MenuDivider.propTypes = {\n ...stylePropTypes()\n} : void 0;\n\nexport { MenuDivider };\n","import { memo, forwardRef } from 'react';\nimport { jsx } from 'react/jsx-runtime';\nimport { useBEM } from '../hooks/useBEM.js';\nimport { roleNone, menuClass, menuHeaderClass } from '../utils/constants.js';\nimport { stylePropTypes } from '../utils/propTypes.js';\n\nconst MenuHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function MenuHeader({\n className,\n ...restProps\n}, externalRef) {\n return /*#__PURE__*/jsx(\"li\", {\n role: roleNone,\n ...restProps,\n ref: externalRef,\n className: useBEM({\n block: menuClass,\n element: menuHeaderClass,\n className\n })\n });\n}));\nprocess.env.NODE_ENV !== \"production\" ? MenuHeader.propTypes = {\n ...stylePropTypes()\n} : void 0;\n\nexport { MenuHeader };\n","import { forwardRef, useRef, useState, useContext } from 'react';\nimport { bool } from 'prop-types';\nimport { jsx } from 'react/jsx-runtime';\nimport { useLayoutEffect as useIsomorphicLayoutEffect } from '../hooks/useIsomorphicLayoutEffect.js';\nimport { getNormalizedClientRect } from '../positionUtils/getNormalizedClientRect.js';\nimport { useCombinedRef } from '../hooks/useCombinedRef.js';\nimport { useBEM } from '../hooks/useBEM.js';\nimport { MenuListContext, menuClass, menuGroupClass } from '../utils/constants.js';\nimport { stylePropTypes } from '../utils/propTypes.js';\n\nconst MenuGroup = /*#__PURE__*/forwardRef(function MenuGroup({\n className,\n style,\n takeOverflow,\n ...restProps\n}, externalRef) {\n const ref = useRef(null);\n const [overflowStyle, setOverflowStyle] = useState();\n const {\n overflow,\n overflowAmt\n } = useContext(MenuListContext);\n useIsomorphicLayoutEffect(() => {\n let maxHeight;\n if (takeOverflow && overflowAmt >= 0) {\n maxHeight = getNormalizedClientRect(ref.current).height - overflowAmt;\n if (maxHeight < 0) maxHeight = 0;\n }\n setOverflowStyle(maxHeight >= 0 ? {\n maxHeight,\n overflow\n } : undefined);\n }, [takeOverflow, overflow, overflowAmt]);\n useIsomorphicLayoutEffect(() => {\n if (overflowStyle) ref.current.scrollTop = 0;\n }, [overflowStyle]);\n return /*#__PURE__*/jsx(\"div\", {\n ...restProps,\n ref: useCombinedRef(externalRef, ref),\n className: useBEM({\n block: menuClass,\n element: menuGroupClass,\n className\n }),\n style: {\n ...style,\n ...overflowStyle\n }\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? MenuGroup.propTypes = {\n ...stylePropTypes(),\n takeOverflow: bool\n} : void 0;\n\nexport { MenuGroup };\n","import './avatar.css';\n\nimport { useRef } from 'preact/hooks';\n\nimport mem from '../utils/mem';\n\nconst SIZES = {\n s: 16,\n m: 20,\n l: 24,\n xl: 32,\n xxl: 50,\n xxxl: 64,\n};\n\nconst alphaCache = {};\n\nconst canvas = window.OffscreenCanvas\n ? new OffscreenCanvas(1, 1)\n : document.createElement('canvas');\nconst ctx = canvas.getContext('2d', {\n willReadFrequently: true,\n});\nctx.imageSmoothingEnabled = false;\n\nconst MISSING_IMAGE_PATH_REGEX = /missing\\.png$/;\n\nfunction Avatar({ url, size, alt = '', squircle, ...props }) {\n size = SIZES[size] || size || SIZES.m;\n const avatarRef = useRef();\n const isMissing = MISSING_IMAGE_PATH_REGEX.test(url);\n return (\n <span\n ref={avatarRef}\n class={`avatar ${squircle ? 'squircle' : ''} ${\n alphaCache[url] ? 'has-alpha' : ''\n }`}\n style={{\n width: size,\n height: size,\n }}\n title={alt}\n {...props}\n >\n {!!url && (\n <img\n src={url}\n width={size}\n height={size}\n alt={alt}\n loading=\"lazy\"\n decoding=\"async\"\n fetchPriority=\"low\"\n crossOrigin={\n alphaCache[url] === undefined && !isMissing\n ? 'anonymous'\n : undefined\n }\n onError={(e) => {\n if (e.target.crossOrigin) {\n e.target.crossOrigin = null;\n e.target.src = url;\n }\n }}\n onLoad={(e) => {\n if (avatarRef.current) avatarRef.current.dataset.loaded = true;\n if (alphaCache[url] !== undefined) return;\n if (isMissing) return;\n setTimeout(() => {\n try {\n // Check if image has alpha channel\n const { width, height } = e.target;\n if (canvas.width !== width) canvas.width = width;\n if (canvas.height !== height) canvas.height = height;\n ctx.drawImage(e.target, 0, 0);\n const allPixels = ctx.getImageData(0, 0, width, height);\n // At least 10% of pixels have alpha <= 128\n const hasAlpha =\n allPixels.data.filter(\n (pixel, i) => i % 4 === 3 && pixel <= 128,\n ).length /\n (allPixels.data.length / 4) >\n 0.1;\n if (hasAlpha) {\n // console.log('hasAlpha', hasAlpha, allPixels.data);\n avatarRef.current.classList.add('has-alpha');\n }\n alphaCache[url] = hasAlpha;\n ctx.clearRect(0, 0, width, height);\n } catch (e) {\n // Silent fail\n alphaCache[url] = false;\n }\n }, 1);\n }}\n />\n )}\n </span>\n );\n}\n\nexport default mem(Avatar);\n","import { forwardRef } from 'preact/compat';\nimport { useLocation } from 'react-router-dom';\n\nimport states from '../utils/states';\n\n/* NOTES\n =====\n Initially this uses <NavLink> from react-router-dom, but it doesn't work:\n 1. It interferes with nested <a> inside <a> and it's difficult to preventDefault/stopPropagation from the nested <a>\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 <Link state/> 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 const parsedHash = URL.parse(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 }\n\n const isActive = hash === to || decodeURIComponent(hash) === to;\n return (\n <a\n ref={ref}\n href={`#${to}`}\n {...restProps}\n class={`${props.class || ''} ${isActive ? 'is-active' : ''}`}\n onClick={(e) => {\n if (e.currentTarget?.parentNode?.closest('a')) {\n // If this <a> is nested inside another <a>\n e.stopPropagation();\n }\n if (routerLocation) states.prevLocation = routerLocation;\n props.onClick?.(e);\n }}\n />\n );\n});\n\nexport default Link;\n","let IS_RTL = false;\n\n// Use MutationObserver to detect RTL\nconst observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.type === 'attributes') {\n const { dir } = mutation.target;\n if (dir === 'rtl') {\n IS_RTL = true;\n } else {\n IS_RTL = false;\n }\n console.log({ IS_RTL });\n // Fire custom event 'dirchange' on document\n // document.dispatchEvent(new Event('dirchange'));\n }\n });\n});\nobserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n});\n\nexport default function isRTL() {\n return IS_RTL;\n // return document.documentElement.dir === 'rtl';\n}\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 { useLayoutEffect, useState } from 'preact/hooks';\n\nexport default function useWindowSize() {\n const [size, setSize] = useState({\n width: null,\n height: null,\n });\n\n useLayoutEffect(() => {\n const handleResize = () => {\n setSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n };\n\n handleResize();\n window.addEventListener('resize', handleResize, {\n passive: true,\n });\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n return size;\n}\n","import { Menu } from '@szhsin/react-menu';\nimport { useRef } from 'preact/hooks';\n\nimport isRTL from '../utils/is-rtl';\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\nimport useWindowSize from '../utils/useWindowSize';\n\n// It's like Menu but with sensible defaults, bug fixes and improvements.\nfunction Menu2(props) {\n const { containerProps, instanceRef: _instanceRef, align } = props;\n const size = useWindowSize();\n const instanceRef = _instanceRef?.current ? _instanceRef : useRef();\n\n // Values: start, end, center\n // Note: don't mess with 'center'\n const rtlAlign = isRTL()\n ? align === 'end'\n ? 'start'\n : align === 'start'\n ? 'end'\n : align\n : align;\n\n return (\n <Menu\n boundingBoxPadding={safeBoundingBoxPadding()}\n repositionFlag={`${size.width}x${size.height}`}\n unmountOnClose\n {...props}\n align={rtlAlign}\n instanceRef={instanceRef}\n containerProps={{\n onClick: (e) => {\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 { SubMenu } from '@szhsin/react-menu';\nimport { useRef } from 'preact/hooks';\n\nexport default function SubMenu2(props) {\n const menuRef = useRef();\n return (\n <SubMenu\n {...props}\n instanceRef={menuRef}\n // Test fix for bug; submenus not opening on Android\n itemProps={{\n onPointerMove: (e) => {\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 ...props.itemProps,\n }}\n />\n );\n}\n","import { MenuItem } from '@szhsin/react-menu';\nimport { cloneElement } from 'preact';\n\nimport Menu2 from './menu2';\nimport SubMenu2 from './submenu2';\n\nfunction MenuConfirm({\n subMenu = false,\n confirm = true,\n confirmLabel,\n menuItemClassName,\n menuFooter,\n menuExtras,\n ...props\n}) {\n const { children, onClick, ...restProps } = props;\n if (!confirm) {\n if (subMenu) return <MenuItem {...props} />;\n if (onClick) {\n return cloneElement(children, {\n onClick,\n });\n }\n return children;\n }\n const Parent = subMenu ? SubMenu2 : Menu2;\n return (\n <Parent\n openTrigger=\"clickOnly\"\n direction=\"bottom\"\n overflow=\"auto\"\n gap={-8}\n shift={8}\n menuClassName=\"menu-emphasized\"\n {...restProps}\n menuButton={subMenu ? undefined : children}\n label={subMenu ? children : undefined}\n >\n <MenuItem className={menuItemClassName} onClick={onClick}>\n {confirmLabel}\n </MenuItem>\n {menuExtras}\n {menuFooter}\n </Parent>\n );\n}\n\nexport default MenuConfirm;\n","import { FocusableItem } from '@szhsin/react-menu';\n\nimport Link from './link';\n\nfunction MenuLink(props) {\n const { className, disabled, ...restProps } = props;\n return (\n <FocusableItem className={className} disabled={disabled}>\n {({ ref, closeMenu }) => (\n <Link\n {...restProps}\n ref={ref}\n onClick={({ detail }) =>\n closeMenu(detail === 0 ? 'Enter' : undefined)\n }\n />\n )}\n </FocusableItem>\n );\n}\n\nexport default MenuLink;\n","export default function CustomEmoji({ staticUrl, alt, url }) {\n return (\n <picture>\n {staticUrl && (\n <source srcset={staticUrl} media=\"(prefers-reduced-motion: reduce)\" />\n )}\n <img\n key={alt || url}\n src={url}\n alt={alt}\n class=\"shortcode-emoji emoji\"\n width=\"16\"\n height=\"16\"\n loading=\"lazy\"\n decoding=\"async\"\n fetchPriority=\"low\"\n />\n </picture>\n );\n}\n","import { memo } from 'preact/compat';\n\nimport mem from '../utils/mem';\n\nimport CustomEmoji from './custom-emoji';\n\nconst shortcodesRegexp = mem((shortcodes) => {\n return new RegExp(`:(${shortcodes.join('|')}):`, 'g');\n});\n\nfunction 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 regex = shortcodesRegexp(emojis.map((e) => e.shortcode));\n const elements = text.split(regex).map((word, i) => {\n const emoji = emojis.find((e) => e.shortcode === word);\n if (emoji) {\n const { url, staticUrl } = emoji;\n return (\n <CustomEmoji\n staticUrl={staticUrl}\n alt={word}\n url={url}\n key={word + '-' + i} // Handle >= 2 same shortcodes\n />\n );\n }\n return word;\n });\n return elements;\n}\n\nexport default mem(EmojiText);\n\n// export default memo(\n// EmojiText,\n// (oldProps, newProps) =>\n// oldProps.text === newProps.text &&\n// oldProps.emojis?.length === newProps.emojis?.length,\n// );\n","import './name-text.css';\n\nimport { useLingui } from '@lingui/react';\nimport { memo } from 'preact/compat';\n\nimport { api } from '../utils/api';\nimport mem from '../utils/mem';\nimport states from '../utils/states';\n\nimport Avatar from './avatar';\nimport EmojiText from './emoji-text';\n\nconst nameCollator = mem((locale) => {\n const options = {\n sensitivity: 'base',\n };\n try {\n return new Intl.Collator(locale || undefined, options);\n } catch (e) {\n return new Intl.Collator(undefined, options);\n }\n});\n\nconst ACCT_REGEX = /([^@]+)(@.+)/i;\nconst SHORTCODES_REGEX = /(\\:(\\w|\\+|\\-)+\\:)(?=|[\\!\\.\\?]|$)/g;\nconst SPACES_REGEX = /\\s+/g;\nconst NON_ALPHA_NUMERIC_REGEX = /[^a-z0-9@\\.]/gi;\n\nfunction NameText({\n account,\n instance,\n showAvatar,\n showAcct,\n short,\n external,\n onClick,\n}) {\n const { i18n } = useLingui();\n const {\n acct,\n avatar,\n avatarStatic,\n id,\n url,\n displayName,\n emojis,\n bot,\n username,\n } = account;\n const [_, acct1, acct2] = acct.match(ACCT_REGEX) || [, acct];\n\n if (!instance) instance = api().instance;\n\n const trimmedUsername = username.toLowerCase().trim();\n const trimmedDisplayName = (displayName || '').toLowerCase().trim();\n const shortenedDisplayName = trimmedDisplayName\n .replace(SHORTCODES_REGEX, '') // Remove shortcodes, regex from https://regex101.com/r/iE9uV0/1\n .replace(SPACES_REGEX, ''); // E.g. \"My name\" === \"myname\"\n const shortenedAlphaNumericDisplayName = shortenedDisplayName.replace(\n NON_ALPHA_NUMERIC_REGEX,\n '',\n ); // Remove non-alphanumeric characters\n\n const hideUsername =\n (!short &&\n (trimmedUsername === trimmedDisplayName ||\n trimmedUsername === shortenedDisplayName ||\n trimmedUsername === shortenedAlphaNumericDisplayName ||\n nameCollator(i18n.locale).compare(\n trimmedUsername,\n shortenedDisplayName,\n ) === 0)) ||\n shortenedAlphaNumericDisplayName === acct.toLowerCase();\n\n return (\n <a\n class={`name-text ${showAcct ? 'show-acct' : ''} ${short ? 'short' : ''}`}\n href={url}\n target={external ? '_blank' : null}\n title={\n displayName\n ? `${displayName} (${acct2 ? '' : '@'}${acct})`\n : `${acct2 ? '' : '@'}${acct}`\n }\n onClick={(e) => {\n if (external) return;\n if (e.shiftKey) return; // Save link? 🤷♂️\n e.preventDefault();\n e.stopPropagation();\n if (onClick) return onClick(e);\n if (e.metaKey || e.ctrlKey || e.shiftKey || e.which === 2) {\n const internalURL = `#/${instance}/a/${id}`;\n window.open(internalURL, '_blank');\n return;\n }\n states.showAccount = {\n account,\n instance,\n };\n }}\n >\n {showAvatar && (\n <>\n <Avatar url={avatarStatic || avatar} squircle={bot} />{' '}\n </>\n )}\n {displayName && !short ? (\n <>\n <b dir=\"auto\">\n <EmojiText text={displayName} emojis={emojis} />\n </b>\n {!showAcct && !hideUsername && (\n <>\n {' '}\n <i class=\"bidi-isolate\">@{username}</i>\n </>\n )}\n </>\n ) : short ? (\n <i>{username}</i>\n ) : (\n <b>{username}</b>\n )}\n {showAcct && (\n <>\n <br />\n <i class=\"bidi-isolate\">\n {acct2 ? '' : '@'}\n {acct1}\n {!!acct2 && <span class=\"ib\">{acct2}</span>}\n </i>\n </>\n )}\n </a>\n );\n}\n\nexport default mem(NameText);\n\n// export default memo(NameText, (oldProps, newProps) => {\n// // Only care about account.id, the other props usually don't change\n// const { account } = oldProps;\n// const { account: newAccount } = newProps;\n// return account?.acct === newAccount?.acct;\n// });\n","import { i18n } from '@lingui/core';\n\nimport mem from './mem';\n\n// Some codes are not supported by Intl.DisplayNames\n// These are mapped to other codes as fallback\nconst codeMappings = {\n 'zh-YUE': 'YUE',\n zh_HANT: 'zh-Hant',\n};\n\nconst IntlDN = mem(\n (locale) =>\n new Intl.DisplayNames(locale || undefined, {\n type: 'language',\n }),\n);\n\nfunction _localeCode2Text(code) {\n let locale;\n let fallback;\n if (typeof code === 'object') {\n ({ code, locale, fallback } = code);\n }\n try {\n const text = IntlDN(locale || i18n.locale).of(code);\n if (text !== code) return text;\n if (!fallback) {\n const anotherText = IntlDN(code).of(code);\n if (anotherText !== code) return anotherText;\n }\n return fallback || '';\n } catch (e) {\n if (codeMappings[code]) {\n try {\n const text = IntlDN(codeMappings[locale] || locale || i18n.locale).of(\n codeMappings[code],\n );\n if (text !== codeMappings[code]) return text;\n return fallback || '';\n } catch (e2) {\n console.warn(code, e2);\n }\n }\n return fallback || '';\n }\n}\n\nexport default mem(_localeCode2Text);\n","import { i18n } from '@lingui/core';\nimport { t } from '@lingui/core/macro';\nimport { useEffect, useMemo, useReducer } from 'preact/hooks';\n\nimport localeMatch from '../utils/locale-match';\nimport mem from '../utils/mem';\n\nfunction isValidDate(value) {\n if (value instanceof Date) {\n return !isNaN(value.getTime());\n } else {\n const date = new Date(value);\n return !isNaN(date.getTime());\n }\n}\n\nconst resolvedLocale = mem(\n () => new Intl.DateTimeFormat().resolvedOptions().locale,\n);\nconst DTF = mem((locale, opts = {}) => {\n const regionlessLocale = locale.replace(/-[a-z]+$/i, '');\n const lang = localeMatch([regionlessLocale], [resolvedLocale()], locale);\n try {\n return new Intl.DateTimeFormat(lang, opts);\n } catch (e) {}\n try {\n return new Intl.DateTimeFormat(locale, opts);\n } catch (e) {}\n return new Intl.DateTimeFormat(undefined, opts);\n});\nconst RTF = mem((locale) => new Intl.RelativeTimeFormat(locale || undefined));\n\nconst minute = 60;\nconst hour = 60 * minute;\nconst day = 24 * hour;\n\nconst rtfFromNow = (date) => {\n // date = Date object\n const rtf = RTF(i18n.locale);\n const seconds = (date.getTime() - Date.now()) / 1000;\n const absSeconds = Math.abs(seconds);\n if (absSeconds < minute) {\n return rtf.format(seconds, 'second');\n } else if (absSeconds < hour) {\n return rtf.format(Math.floor(seconds / minute), 'minute');\n } else if (absSeconds < day) {\n return rtf.format(Math.floor(seconds / hour), 'hour');\n } else {\n return rtf.format(Math.floor(seconds / day), 'day');\n }\n};\n\nconst twitterFromNow = (date) => {\n // date = Date object\n const seconds = (Date.now() - date.getTime()) / 1000;\n if (seconds < minute) {\n return t({\n comment: 'Relative time in seconds, as short as possible',\n message: `${seconds < 1 ? 1 : Math.floor(seconds)}s`,\n });\n } else if (seconds < hour) {\n return t({\n comment: 'Relative time in minutes, as short as possible',\n message: `${Math.floor(seconds / minute)}m`,\n });\n } else {\n return t({\n comment: 'Relative time in hours, as short as possible',\n message: `${Math.floor(seconds / hour)}h`,\n });\n }\n};\n\nexport default function RelativeTime({ datetime, format }) {\n if (!datetime) return null;\n const [renderCount, rerender] = useReducer((x) => x + 1, 0);\n const date = useMemo(() => new Date(datetime), [datetime]);\n const [dateStr, dt, title] = useMemo(() => {\n if (!isValidDate(date)) return ['' + datetime, '', ''];\n let str;\n if (format === 'micro') {\n // If date <= 1 day ago or day is within this year\n const now = new Date();\n const dayDiff = (now.getTime() - date.getTime()) / 1000 / day;\n if (dayDiff <= 1) {\n str = twitterFromNow(date);\n } else {\n const sameYear = now.getFullYear() === date.getFullYear();\n if (sameYear) {\n str = DTF(i18n.locale, {\n year: undefined,\n month: 'short',\n day: 'numeric',\n }).format(date);\n } else {\n str = DTF(i18n.locale, {\n dateStyle: 'short',\n }).format(date);\n }\n }\n }\n if (!str) str = rtfFromNow(date);\n return [str, date.toISOString(), date.toLocaleString()];\n }, [date, format, renderCount]);\n\n useEffect(() => {\n if (!isValidDate(date)) return;\n let timeout;\n let raf;\n function rafRerender() {\n raf = requestAnimationFrame(() => {\n rerender();\n scheduleRerender();\n });\n }\n function scheduleRerender() {\n // If less than 1 minute, rerender every 10s\n // If less than 1 hour rerender every 1m\n // Else, don't need to rerender\n const seconds = (Date.now() - date.getTime()) / 1000;\n if (seconds < minute) {\n timeout = setTimeout(rafRerender, 10_000);\n } else if (seconds < hour) {\n timeout = setTimeout(rafRerender, 60_000);\n }\n }\n scheduleRerender();\n return () => {\n clearTimeout(timeout);\n cancelAnimationFrame(raf);\n };\n }, []);\n\n return (\n <time datetime={dt} title={title}>\n {dateStr}\n </time>\n );\n}\n","import translationTargetLanguages from '../data/lingva-target-languages';\n\nimport localeMatch from './locale-match';\nimport mem from './mem';\nimport states from './states';\n\nconst locales = mem(() => [\n new Intl.DateTimeFormat().resolvedOptions().locale,\n ...navigator.languages,\n]);\n\nconst localeTargetLanguages = () =>\n 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","import { i18n } from '@lingui/core';\n\n// https://tc39.es/ecma402/#table-sanctioned-single-unit-identifiers\nconst BYTES_UNITS = [\n 'byte',\n 'kilobyte',\n 'megabyte',\n 'gigabyte',\n 'terabyte',\n 'petabyte',\n];\nexport default function prettyBytes(bytes) {\n const unitIndex = Math.min(\n Math.floor(Math.log2(bytes) / 10),\n BYTES_UNITS.length - 1,\n );\n const value = bytes / 1024 ** unitIndex;\n return i18n.number(value, {\n style: 'unit',\n unit: BYTES_UNITS[unitIndex],\n unitDisplay: 'narrow',\n maximumFractionDigits: 0,\n });\n}\n","export const semver = /^[v^~<>=]*?(\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+))?(?:-([\\da-z\\-]+(?:\\.[\\da-z\\-]+)*))?(?:\\+[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?)?)?$/i;\nexport const validateAndParse = (version) => {\n if (typeof version !== 'string') {\n throw new TypeError('Invalid argument expected string');\n }\n const match = version.match(semver);\n if (!match) {\n throw new Error(`Invalid argument not valid semver ('${version}' received)`);\n }\n match.shift();\n return match;\n};\nconst isWildcard = (s) => s === '*' || s === 'x' || s === 'X';\nconst tryParse = (v) => {\n const n = parseInt(v, 10);\n return isNaN(n) ? v : n;\n};\nconst forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];\nconst compareStrings = (a, b) => {\n if (isWildcard(a) || isWildcard(b))\n return 0;\n const [ap, bp] = forceType(tryParse(a), tryParse(b));\n if (ap > bp)\n return 1;\n if (ap < bp)\n return -1;\n return 0;\n};\nexport const compareSegments = (a, b) => {\n for (let i = 0; i < Math.max(a.length, b.length); i++) {\n const r = compareStrings(a[i] || '0', b[i] || '0');\n if (r !== 0)\n return r;\n }\n return 0;\n};\n//# sourceMappingURL=utils.js.map","import { compareSegments, validateAndParse } from './utils.js';\n/**\n * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.\n * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.\n * @param v1 - First version to compare\n * @param v2 - Second version to compare\n * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).\n */\nexport const compareVersions = (v1, v2) => {\n // validate input and split into segments\n const n1 = validateAndParse(v1);\n const n2 = validateAndParse(v2);\n // pop off the patch\n const p1 = n1.pop();\n const p2 = n2.pop();\n // validate numbers\n const r = compareSegments(n1, n2);\n if (r !== 0)\n return r;\n // validate pre-release\n if (p1 && p2) {\n return compareSegments(p1.split('.'), p2.split('.'));\n }\n else if (p1 || p2) {\n return p1 ? -1 : 1;\n }\n return 0;\n};\n//# sourceMappingURL=compareVersions.js.map","import { compareVersions } from './compareVersions.js';\n/**\n * Compare [semver](https://semver.org/) version strings using the specified operator.\n *\n * @param v1 First version to compare\n * @param v2 Second version to compare\n * @param operator Allowed arithmetic operator to use\n * @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.\n *\n * @example\n * ```\n * compare('10.1.8', '10.0.4', '>'); // return true\n * compare('10.0.1', '10.0.1', '='); // return true\n * compare('10.1.1', '10.2.2', '<'); // return true\n * compare('10.1.1', '10.2.2', '<='); // return true\n * compare('10.1.1', '10.2.2', '>='); // return false\n * ```\n */\nexport const compare = (v1, v2, operator) => {\n // validate input operator\n assertValidOperator(operator);\n // since result of compareVersions can only be -1 or 0 or 1\n // a simple map can be used to replace switch\n const res = compareVersions(v1, v2);\n return operatorResMap[operator].includes(res);\n};\nconst operatorResMap = {\n '>': [1],\n '>=': [0, 1],\n '=': [0],\n '<=': [-1, 0],\n '<': [-1],\n '!=': [-1, 1],\n};\nconst allowedOperators = Object.keys(operatorResMap);\nconst assertValidOperator = (op) => {\n if (typeof op !== 'string') {\n throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);\n }\n if (allowedOperators.indexOf(op) === -1) {\n throw new Error(`Invalid operator, expected one of ${allowedOperators.join('|')}`);\n }\n};\n//# sourceMappingURL=compare.js.map","import { compare } from './compare.js';\nimport { compareSegments, validateAndParse } from './utils.js';\n/**\n * Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.\n *\n * @param version Version number to match\n * @param range Range pattern for version\n * @returns `true` if the version number is within the range, `false` otherwise.\n *\n * @example\n * ```\n * satisfies('1.1.0', '^1.0.0'); // return true\n * satisfies('1.1.0', '~1.0.0'); // return false\n * ```\n */\nexport const satisfies = (version, range) => {\n // clean input\n range = range.replace(/([><=]+)\\s+/g, '$1');\n // handle multiple comparators\n if (range.includes('||')) {\n return range.split('||').some((r) => satisfies(version, r));\n }\n else if (range.includes(' - ')) {\n const [a, b] = range.split(' - ', 2);\n return satisfies(version, `>=${a} <=${b}`);\n }\n else if (range.includes(' ')) {\n return range\n .trim()\n .replace(/\\s{2,}/g, ' ')\n .split(' ')\n .every((r) => satisfies(version, r));\n }\n // if no range operator then \"=\"\n const m = range.match(/^([<>=~^]+)/);\n const op = m ? m[1] : '=';\n // if gt/lt/eq then operator compare\n if (op !== '^' && op !== '~')\n return compare(version, range, op);\n // else range of either \"~\" or \"^\" is assumed\n const [v1, v2, v3, , vp] = validateAndParse(version);\n const [r1, r2, r3, , rp] = validateAndParse(range);\n const v = [v1, v2, v3];\n const r = [r1, r2 !== null && r2 !== void 0 ? r2 : 'x', r3 !== null && r3 !== void 0 ? r3 : 'x'];\n // validate pre-release\n if (rp) {\n if (!vp)\n return false;\n if (compareSegments(v, r) !== 0)\n return false;\n if (compareSegments(vp.split('.'), rp.split('.')) === -1)\n return false;\n }\n // first non-zero number\n const nonZero = r.findIndex((v) => v !== '0') + 1;\n // pointer to where segments can be >=\n const i = op === '~' ? 2 : nonZero > 1 ? nonZero : 1;\n // before pointer must be equal\n if (compareSegments(v.slice(0, i), r.slice(0, i)) !== 0)\n return false;\n // after pointer must be >=\n if (compareSegments(v.slice(i), r.slice(i)) === -1)\n return false;\n return true;\n};\n//# sourceMappingURL=satisfies.js.map","import { satisfies } from 'compare-versions';\n\nimport features from '../data/features.json';\n\nimport { getCurrentInstance, getCurrentNodeInfo } from './store-utils';\n\n// Non-semver(?) UA string detection\nconst containPixelfed = /pixelfed/i;\nconst notContainPixelfed = /^(?!.*pixelfed).*$/i;\nconst containPleroma = /pleroma/i;\nconst containAkkoma = /akkoma/i;\nconst containGTS = /gotosocial/i;\nconst platformFeatures = {\n '@mastodon/lists': notContainPixelfed,\n '@mastodon/filters': notContainPixelfed,\n '@mastodon/mentions': notContainPixelfed,\n '@mastodon/trending-hashtags': notContainPixelfed,\n '@mastodon/trending-links': notContainPixelfed,\n '@mastodon/post-bookmark': notContainPixelfed,\n '@mastodon/post-edit': notContainPixelfed,\n '@mastodon/profile-edit': notContainPixelfed,\n '@mastodon/profile-private-note': notContainPixelfed,\n '@pixelfed/trending': containPixelfed,\n '@pixelfed/home-include-reblogs': containPixelfed,\n '@pixelfed/global-feed': containPixelfed,\n '@pleroma/local-visibility-post': containPleroma,\n '@akkoma/local-visibility-post': containAkkoma,\n};\n\nconst supportsCache = {};\n\nfunction supports(feature) {\n try {\n let { version, domain } = getCurrentInstance();\n let softwareName = getCurrentNodeInfo()?.software?.name || 'mastodon';\n\n if (softwareName === 'hometown') {\n // Hometown is a Mastodon fork and inherits its features\n softwareName = 'mastodon';\n }\n\n const key = `${domain}-${feature}`;\n if (supportsCache[key]) return supportsCache[key];\n\n if (platformFeatures[feature]) {\n return (supportsCache[key] = platformFeatures[feature].test(version));\n }\n\n const range = features[feature];\n if (!range) return false;\n\n // '@mastodon/blah' => 'mastodon'\n const featureSoftware = feature.match(/^@([a-z]+)\\//)[1];\n\n const doesSoftwareMatch = featureSoftware === softwareName.toLowerCase();\n return (supportsCache[key] =\n doesSoftwareMatch &&\n satisfies(version, range, {\n includePrerelease: true,\n loose: true,\n }));\n } catch (e) {\n return false;\n }\n}\n\nexport default supports;\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7F]/; // Note: U+007F DEL is excluded too.\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, callback) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = callback(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {String} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(domain, callback) {\n\tconst parts = domain.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tdomain = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tdomain = domain.replace(regexSeparators, '\\x2E');\n\tconst labels = domain.split('.');\n\tconst encoded = map(labels, callback).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = codePoints => String.fromCodePoint(...codePoints);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint >= 0x30 && codePoint < 0x3A) {\n\t\treturn 26 + (codePoint - 0x30);\n\t}\n\tif (codePoint >= 0x41 && codePoint < 0x5B) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint >= 0x61 && codePoint < 0x7B) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tconst oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\t\t\tif (digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tconst inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tconst basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue === n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.3.1',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };\nexport default punycode;\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 `<picture><source srcset=\"${staticUrl}\" media=\"(prefers-reduced-motion: reduce)\"></source><img class=\"shortcode-emoji emoji\" src=\"${url}\" alt=\":${shortcode}:\" width=\"16\" height=\"16\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"low\" /></picture>`,\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\nconst HTML_CHARS_REGEX = /[&<>]/g;\nfunction escapeHTML(html) {\n return html.replace(\n HTML_CHARS_REGEX,\n (c) =>\n ({\n '&': '&',\n '<': '<',\n '>': '>',\n })[c],\n );\n}\n\nconst LINK_REGEX = /<a/i;\nconst HTTP_LINK_REGEX = /^https?:\\/\\//i;\nconst MENTION_REGEX = /^@[^@]+(@[^@]+)?$/;\nconst HASHTAG_REGEX = /^#[^#]+$/;\nconst CODE_BLOCK_REGEX = /^```[^]+```$/;\nconst CODE_BLOCK_START_REGEX = /^```/;\nconst CODE_BLOCK_END_REGEX = /```$/;\nconst INLINE_CODE_REGEX = /`[^`]+`/;\nconst TWITTER_DOMAIN_REGEX = /(twitter|x)\\.com/i;\nconst TWITTER_MENTION_REGEX = /@[a-zA-Z0-9_]+@(twitter|x)\\.com/;\nconst TWITTER_MENTION_CAPTURE_REGEX = /(@([a-zA-Z0-9_]+)@(twitter|x)\\.com)/g;\nconst CODE_INLINE_CAPTURE_REGEX = /(`[^]+?`)/g;\n\nfunction createDOM(html, isDocumentFragment) {\n if (isDocumentFragment) {\n const tpl = document.createElement('template');\n tpl.innerHTML = html;\n return tpl.content;\n } else {\n const tpl = document.createElement('div');\n tpl.innerHTML = html;\n return tpl;\n }\n}\n\nfunction _enhanceContent(content, opts = {}) {\n const { emojis, returnDOM, postEnhanceDOM = () => {} } = opts;\n let enhancedContent = content;\n // const dom = document.createElement('div');\n // dom.innerHTML = enhancedContent;\n const dom = createDOM(enhancedContent, returnDOM);\n const hasLink = LINK_REGEX.test(enhancedContent);\n const hasCodeBlock = enhancedContent.includes('```');\n\n if (hasLink) {\n // Add target=\"_blank\" to all links with no target=\"_blank\"\n // E.g. `note` in `account`\n const noTargetBlankLinks = dom.querySelectorAll('a:not([target=\"_blank\"])');\n for (const link of noTargetBlankLinks) {\n link.setAttribute('target', '_blank');\n }\n\n // Remove all classes except `u-url`, `mention`, `hashtag`\n const links = dom.querySelectorAll('a[class]');\n for (const link of links) {\n for (const c of link.classList) {\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 for (const link of links) {\n if (HTTP_LINK_REGEX.test(link.textContent.trim())) {\n link.classList.add('has-url-text');\n shortenLink(link);\n }\n }\n }\n\n // Spanify un-spanned mentions\n if (hasLink) {\n const links = dom.querySelectorAll('a[href]');\n const usernames = [];\n for (const link of links) {\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 (MENTION_REGEX.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 = `@<span>${username}</span>`;\n usernames.push([username, domain]);\n } else {\n link.innerHTML = `@<span>${username}@${domain}</span>`;\n }\n }\n link.classList.add('mention');\n }\n // If text looks like #hashtag, then it's a hashtag\n if (HASHTAG_REGEX.test(text)) {\n if (!hasChildren) link.innerHTML = `#<span>${text.slice(1)}</span>`;\n link.classList.add('mention', 'hashtag');\n }\n }\n }\n\n // EMOJIS\n // ======\n // Convert :shortcode: to <img />\n let textNodes;\n if (enhancedContent.includes(':') && emojis?.length) {\n textNodes = extractTextNodes(dom);\n for (const node of textNodes) {\n let html = escapeHTML(node.nodeValue);\n html = emojifyText(html, emojis);\n fauxDiv.innerHTML = html;\n node.replaceWith(...fauxDiv.childNodes);\n }\n }\n\n // CODE BLOCKS\n // ===========\n // Convert ```code``` to <pre><code>code</code></pre>\n if (hasCodeBlock) {\n const blocks = [...dom.querySelectorAll('p')].filter((p) =>\n CODE_BLOCK_REGEX.test(p.innerText.trim()),\n );\n for (const block of blocks) {\n const pre = document.createElement('pre');\n // Replace <br /> with newlines\n for (const br of block.querySelectorAll('br')) {\n br.replaceWith('\\n');\n }\n pre.innerHTML = `<code>${block.innerHTML.trim()}</code>`;\n block.replaceWith(pre);\n }\n }\n\n // Convert multi-paragraph code blocks to <pre><code>code</code></pre>\n if (hasCodeBlock) {\n const paragraphs = [...dom.querySelectorAll('p')];\n // Filter out paragraphs with ``` in beginning only\n const codeBlocks = paragraphs.filter((p) =>\n CODE_BLOCK_START_REGEX.test(p.innerText),\n );\n // For each codeBlocks, get all paragraphs until the last paragraph with ``` at the end only\n for (const block of codeBlocks) {\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 (CODE_BLOCK_END_REGEX.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 for (const p of nextParagraphs) {\n // Replace <br /> with newlines\n for (const br of p.querySelectorAll('br')) {\n br.replaceWith('\\n');\n }\n }\n const codeText = nextParagraphs.map((p) => p.innerHTML).join('\\n\\n');\n pre.innerHTML = `<code tabindex=\"0\">${codeText}</code>`;\n block.replaceWith(pre);\n for (const p of nextParagraphs) {\n p.remove();\n }\n }\n }\n }\n\n // INLINE CODE\n // ===========\n // Convert `code` to <code>code</code>\n if (enhancedContent.includes('`')) {\n textNodes = extractTextNodes(dom);\n for (const node of textNodes) {\n let html = escapeHTML(node.nodeValue);\n if (INLINE_CODE_REGEX.test(html)) {\n html = html.replaceAll(CODE_INLINE_CAPTURE_REGEX, '<code>$1</code>');\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 <a href=\"https://twitter.com/username\">@username@twitter.com</a>\n if (TWITTER_DOMAIN_REGEX.test(enhancedContent)) {\n textNodes = extractTextNodes(dom, {\n rejectFilter: ['A'],\n });\n for (const node of textNodes) {\n let html = escapeHTML(node.nodeValue);\n if (TWITTER_MENTION_REGEX.test(html)) {\n html = html.replaceAll(\n TWITTER_MENTION_CAPTURE_REGEX,\n '<a href=\"https://twitter.com/$2\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">$1</a>',\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 <p> 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 <br />\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 for (const p of hashtagStuffedParagraphs) {\n p.classList.add('hashtag-stuffing');\n p.title = p.innerText;\n }\n }\n }\n\n // ADD ASPECT RATIO TO ALL IMAGES\n if (enhancedContent.includes('<img')) {\n const imgs = dom.querySelectorAll('img');\n for (let i = 0; i < imgs.length; i++) {\n const img = imgs[i];\n const width = img.getAttribute('width') || img.naturalWidth;\n const height = img.getAttribute('height') || img.naturalHeight;\n if (width && height) {\n img.style.setProperty('--original-aspect-ratio', `${width}/${height}`);\n }\n }\n }\n\n // FIX CLOAK MODE FOR SAFARI\n // Workaround for Safari so that `text-decoration-thickness` works\n // Wrap child text nodes in spans\n for (const node of dom.childNodes) {\n if (node.nodeType === Node.TEXT_NODE) {\n const span = document.createElement('span');\n span.textContent = node.textContent;\n dom.replaceChild(span, node);\n }\n }\n\n if (postEnhanceDOM) {\n queueMicrotask(() => postEnhanceDOM(dom));\n // postEnhanceDOM(dom); // mutate dom\n }\n\n return returnDOM ? dom : dom.innerHTML;\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);\n\nconst URL_PREFIX_REGEX = /^(https?:\\/\\/(www\\.)?|xmpp:)/;\nconst URL_DISPLAY_LENGTH = 30;\n// Similar to https://github.com/mastodon/mastodon/blob/1666b1955992e16f4605b414c6563ca25b3a3f18/app/lib/text_formatter.rb#L54-L69\nfunction shortenLink(link) {\n if (!link || link.querySelector?.('*')) {\n return;\n }\n try {\n const url = link.innerText.trim();\n const prefix = (url.match(URL_PREFIX_REGEX) || [])[0] || '';\n if (!prefix) return;\n const displayURL = url.slice(\n prefix.length,\n prefix.length + URL_DISPLAY_LENGTH,\n );\n const suffix = url.slice(prefix.length + URL_DISPLAY_LENGTH);\n const cutoff = url.slice(prefix.length).length > URL_DISPLAY_LENGTH;\n link.innerHTML = `<span class=\"invisible\">${prefix}</span><span class=${\n cutoff ? 'ellipsis' : ''\n }>${displayURL}</span><span class=\"invisible\">${suffix}</span>`;\n } catch (e) {}\n}\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, opts) {\n if (!html) return '';\n const { preProcess } = opts || {};\n\n div.innerHTML = html\n .replace(/<\\/p>/g, '</p>\\n\\n')\n .replace(/<\\/li>/g, '</li>\\n');\n div.querySelectorAll('br').forEach((br) => {\n br.replaceWith('\\n');\n });\n\n preProcess?.(div);\n\n // MASTODON-SPECIFIC classes\n // Remove .invisible\n div.querySelectorAll('.invisible').forEach((el) => {\n el.remove();\n });\n // Add … at end of .ellipsis\n div.querySelectorAll('.ellipsis').forEach((el) => {\n el.append('...');\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') ||\n target.classList.contains('mention')) &&\n 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 // Only fallback to acct/username check if url doesn't match\n const mention =\n mentions.find((mention) => mention.url === url) ||\n mentions.find(\n (mention) =>\n mention.acct === username || mention.username === username,\n );\n console.warn('MENTION', mention, url);\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 { i18n } from '@lingui/core';\n\nexport default function i18nDuration(duration, unit) {\n return () =>\n i18n.number(duration, {\n style: 'unit',\n unit,\n unitDisplay: 'long',\n });\n}\n","import { i18n } from '@lingui/core';\n\nimport localeMatch from './locale-match';\nimport mem from './mem';\n\nconst defaultLocale = mem(\n () => new Intl.DateTimeFormat().resolvedOptions().locale,\n);\n\nconst _DateTimeFormat = (opts) => {\n const { locale, dateYear, hideTime, formatOpts, forceOpts } = opts || {};\n const regionlessLocale = locale.replace(/-[a-z]+$/i, '');\n const loc = localeMatch([regionlessLocale], [defaultLocale], locale);\n const currentYear = new Date().getFullYear();\n const options = forceOpts || {\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 try {\n return Intl.DateTimeFormat(loc, options);\n } catch (e) {}\n try {\n return Intl.DateTimeFormat(locale, options);\n } catch (e) {}\n return Intl.DateTimeFormat(undefined, options);\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 locale: i18n.locale,\n ...dtfOpts,\n });\n const dateText = DTF.format(date);\n return dateText;\n}\n\nexport default niceDateTime;\n","import { i18n } from '@lingui/core';\n\nexport default function shortenNumber(num) {\n try {\n return i18n.number(num, {\n notation: 'compact',\n roundingMode: 'floor',\n });\n } catch (e) {\n return num;\n }\n}\n","import { t } from '@lingui/core/macro';\n\nimport openOSK from './open-osk';\nimport showToast from './show-toast';\nimport states from './states';\n\nconst TOAST_DURATION = 5_000; // 5 seconds\n\nexport default function showCompose(opts) {\n if (!opts) opts = true;\n\n if (states.showCompose) {\n if (states.composerState.minimized) {\n showToast({\n duration: TOAST_DURATION,\n text: t`A draft post is currently minimized. Post or discard it before creating a new one.`,\n });\n } else {\n showToast({\n duration: TOAST_DURATION,\n text: t`A post is currently open. Post or discard it before creating a new one.`,\n });\n }\n return;\n }\n\n openOSK();\n states.showCompose = opts;\n}\n","import './account-block.css';\n\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\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 const { t } = useLingui();\n if (skeleton) {\n return (\n <div class=\"account-block skeleton\">\n <Avatar size={avatarSize} />\n <span>\n <b>████████</b>\n <br />\n <span class=\"account-block-acct\">██████</span>\n </span>\n </div>\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 createdAt,\n locked,\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 <a\n class=\"account-block\"\n href={url}\n target={external ? '_blank' : null}\n title={acct2 ? acct : `@${acct}`}\n onClick={(e) => {\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 <div class=\"avatar-container\">\n <Avatar\n url={useAvatarStatic ? avatarStatic : avatar || avatarStatic}\n size={avatarSize}\n squircle={bot}\n />\n </div>\n <span class=\"account-block-content\">\n {!hideDisplayName && (\n <>\n {displayName ? (\n <b>\n <EmojiText text={displayName} emojis={emojis} />\n </b>\n ) : (\n <b>{username}</b>\n )}\n </>\n )}{' '}\n <span class=\"account-block-acct bidi-isolate\">\n {acct2 ? '' : '@'}\n {acct1}\n <wbr />\n {acct2}\n {locked && (\n <>\n {' '}\n <Icon icon=\"lock\" size=\"s\" alt={t`Locked`} />\n </>\n )}\n </span>\n {showActivity && (\n <div class=\"account-block-stats\">\n <Trans>Posts: {shortenNumber(statusesCount)}</Trans>\n {!!lastStatusAt && (\n <>\n {' '}\n ·{' '}\n <Trans>\n Last posted:{' '}\n {niceDateTime(lastStatusAt, {\n hideTime: true,\n })}\n </Trans>\n </>\n )}\n </div>\n )}\n {showStats && (\n <div class=\"account-block-stats\">\n {bot && (\n <>\n <span class=\"tag collapsed\">\n <Icon icon=\"bot\" /> <Trans>Automated</Trans>\n </span>\n </>\n )}\n {!!group && (\n <>\n <span class=\"tag collapsed\">\n <Icon icon=\"group\" /> <Trans>Group</Trans>\n </span>\n </>\n )}\n {hasRelationship && (\n <div key={relationship.id} class=\"shazam-container-horizontal\">\n <div class=\"shazam-container-inner\">\n {excludedRelationship.following &&\n excludedRelationship.followedBy ? (\n <span class=\"tag minimal\">\n <Trans>Mutual</Trans>\n </span>\n ) : excludedRelationship.requested ? (\n <span class=\"tag minimal\">\n <Trans>Requested</Trans>\n </span>\n ) : excludedRelationship.following ? (\n <span class=\"tag minimal\">\n <Trans>Following</Trans>\n </span>\n ) : excludedRelationship.followedBy ? (\n <span class=\"tag minimal\">\n <Trans>Follows you</Trans>\n </span>\n ) : null}\n </div>\n </div>\n )}\n {!!followersCount && (\n <span class=\"ib\">\n <Plural\n value={followersCount}\n one=\"# follower\"\n other=\"# followers\"\n />\n </span>\n )}\n {!!verifiedField && (\n <span class=\"verified-field\">\n <Icon icon=\"check-circle\" size=\"s\" alt={t`Verified`} />{' '}\n <span\n dangerouslySetInnerHTML={{\n __html: enhanceContent(verifiedField.value, { emojis }),\n }}\n />\n </span>\n )}\n {!bot &&\n !group &&\n !hasRelationship &&\n !followersCount &&\n !verifiedField &&\n !!createdAt && (\n <span class=\"created-at\">\n <Trans>\n Joined{' '}\n <time datetime={createdAt}>\n {niceDateTime(createdAt, {\n hideTime: true,\n })}\n </time>\n </Trans>\n </span>\n )}\n </div>\n )}\n </span>\n </a>\n );\n}\n\nexport default AccountBlock;\n","function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n","var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n","module.exports = require('./lib/retry');","const objectToString = Object.prototype.toString;\n\nconst isError = value => objectToString.call(value) === '[object Error]';\n\nconst errorMessages = new Set([\n\t'Failed to fetch', // Chrome\n\t'NetworkError when attempting to fetch resource.', // Firefox\n\t'The Internet connection appears to be offline.', // Safari 16\n\t'Load failed', // Safari 17+\n\t'Network request failed', // `cross-fetch`\n\t'fetch failed', // Undici (Node.js)\n]);\n\nexport default function isNetworkError(error) {\n\tconst isValid = error\n\t\t&& isError(error)\n\t\t&& error.name === 'TypeError'\n\t\t&& typeof error.message === 'string';\n\n\tif (!isValid) {\n\t\treturn false;\n\t}\n\n\t// We do an extra check for Safari 17+ as it has a very generic error message.\n\t// Network errors in Safari have no stack.\n\tif (error.message === 'Load failed') {\n\t\treturn error.stack === undefined;\n\t}\n\n\treturn errorMessages.has(error.message);\n}\n","import retry from 'retry';\nimport isNetworkError from 'is-network-error';\n\nexport class AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\n\t\tif (message instanceof Error) {\n\t\t\tthis.originalError = message;\n\t\t\t({message} = message);\n\t\t} else {\n\t\t\tthis.originalError = new Error(message);\n\t\t\tthis.originalError.stack = this.stack;\n\t\t}\n\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\nconst decorateErrorWithCounts = (error, attemptNumber, options) => {\n\t// Minus 1 from attemptNumber because the first attempt does not count as a retry\n\tconst retriesLeft = options.retries - (attemptNumber - 1);\n\n\terror.attemptNumber = attemptNumber;\n\terror.retriesLeft = retriesLeft;\n\treturn error;\n};\n\nexport default async function pRetry(input, options) {\n\treturn new Promise((resolve, reject) => {\n\t\toptions = {...options};\n\t\toptions.onFailedAttempt ??= () => {};\n\t\toptions.shouldRetry ??= () => true;\n\t\toptions.retries ??= 10;\n\n\t\tconst operation = retry.operation(options);\n\n\t\tconst abortHandler = () => {\n\t\t\toperation.stop();\n\t\t\treject(options.signal?.reason);\n\t\t};\n\n\t\tif (options.signal && !options.signal.aborted) {\n\t\t\toptions.signal.addEventListener('abort', abortHandler, {once: true});\n\t\t}\n\n\t\tconst cleanUp = () => {\n\t\t\toptions.signal?.removeEventListener('abort', abortHandler);\n\t\t\toperation.stop();\n\t\t};\n\n\t\toperation.attempt(async attemptNumber => {\n\t\t\ttry {\n\t\t\t\tconst result = await input(attemptNumber);\n\t\t\t\tcleanUp();\n\t\t\t\tresolve(result);\n\t\t\t} catch (error) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!(error instanceof Error)) {\n\t\t\t\t\t\tthrow new TypeError(`Non-error was thrown: \"${error}\". You should only throw errors.`);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error instanceof AbortError) {\n\t\t\t\t\t\tthrow error.originalError;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error instanceof TypeError && !isNetworkError(error)) {\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorateErrorWithCounts(error, attemptNumber, options);\n\n\t\t\t\t\tif (!(await options.shouldRetry(error))) {\n\t\t\t\t\t\toperation.stop();\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\n\t\t\t\t\tawait options.onFailedAttempt(error);\n\n\t\t\t\t\tif (!operation.retry(error)) {\n\t\t\t\t\t\tthrow operation.mainError();\n\t\t\t\t\t}\n\t\t\t\t} catch (finalError) {\n\t\t\t\t\tdecorateErrorWithCounts(finalError, attemptNumber, options);\n\t\t\t\t\tcleanUp();\n\t\t\t\t\treject(finalError);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/InView.tsx\nimport * as React from \"react\";\n\n// src/observe.ts\nvar observerMap = /* @__PURE__ */ new Map();\nvar RootIds = /* @__PURE__ */ new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = void 0;\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\nfunction getRootId(root) {\n if (!root) return \"0\";\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(\n (key) => options[key] !== void 0\n ).map((key) => {\n return `${key}_${key === \"root\" ? getRootId(options.root) : options[key]}`;\n }).toString();\n}\nfunction createObserver(options) {\n const id = optionsToId(options);\n let instance = observerMap.get(id);\n if (!instance) {\n const elements = /* @__PURE__ */ new Map();\n let thresholds;\n const observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n var _a;\n const inView = entry.isIntersecting && thresholds.some((threshold) => entry.intersectionRatio >= threshold);\n if (options.trackVisibility && typeof entry.isVisible === \"undefined\") {\n entry.isVisible = inView;\n }\n (_a = elements.get(entry.target)) == null ? void 0 : _a.forEach((callback) => {\n callback(inView, entry);\n });\n });\n }, options);\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id,\n observer,\n elements\n };\n observerMap.set(id, instance);\n }\n return instance;\n}\nfunction observe(element, callback, options = {}, fallbackInView = unsupportedValue) {\n if (typeof window.IntersectionObserver === \"undefined\" && fallbackInView !== void 0) {\n const bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === \"number\" ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return () => {\n };\n }\n const { id, observer, elements } = createObserver(options);\n const callbacks = elements.get(element) || [];\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n callbacks.splice(callbacks.indexOf(callback), 1);\n if (callbacks.length === 0) {\n elements.delete(element);\n observer.unobserve(element);\n }\n if (elements.size === 0) {\n observer.disconnect();\n observerMap.delete(id);\n }\n };\n}\n\n// src/InView.tsx\nfunction isPlainChildren(props) {\n return typeof props.children !== \"function\";\n}\nvar InView = class extends React.Component {\n constructor(props) {\n super(props);\n __publicField(this, \"node\", null);\n __publicField(this, \"_unobserveCb\", null);\n __publicField(this, \"handleNode\", (node) => {\n if (this.node) {\n this.unobserve();\n if (!node && !this.props.triggerOnce && !this.props.skip) {\n this.setState({ inView: !!this.props.initialInView, entry: void 0 });\n }\n }\n this.node = node ? node : null;\n this.observeNode();\n });\n __publicField(this, \"handleChange\", (inView, entry) => {\n if (inView && this.props.triggerOnce) {\n this.unobserve();\n }\n if (!isPlainChildren(this.props)) {\n this.setState({ inView, entry });\n }\n if (this.props.onChange) {\n this.props.onChange(inView, entry);\n }\n });\n this.state = {\n inView: !!props.initialInView,\n entry: void 0\n };\n }\n componentDidMount() {\n this.unobserve();\n this.observeNode();\n }\n componentDidUpdate(prevProps) {\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n }\n componentWillUnmount() {\n this.unobserve();\n }\n observeNode() {\n if (!this.node || this.props.skip) return;\n const {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n fallbackInView\n } = this.props;\n this._unobserveCb = observe(\n this.node,\n this.handleChange,\n {\n threshold,\n root,\n rootMargin,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n }\n unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n this._unobserveCb = null;\n }\n }\n render() {\n const { children } = this.props;\n if (typeof children === \"function\") {\n const { inView, entry } = this.state;\n return children({ inView, entry, ref: this.handleNode });\n }\n const {\n as,\n triggerOnce,\n threshold,\n root,\n rootMargin,\n onChange,\n skip,\n trackVisibility,\n delay,\n initialInView,\n fallbackInView,\n ...props\n } = this.props;\n return React.createElement(\n as || \"div\",\n { ref: this.handleNode, ...props },\n children\n );\n }\n};\n\n// src/useInView.tsx\nimport * as React2 from \"react\";\nfunction useInView({\n threshold,\n delay,\n trackVisibility,\n rootMargin,\n root,\n triggerOnce,\n skip,\n initialInView,\n fallbackInView,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = React2.useState(null);\n const callback = React2.useRef(onChange);\n const [state, setState] = React2.useState({\n inView: !!initialInView,\n entry: void 0\n });\n callback.current = onChange;\n React2.useEffect(\n () => {\n if (skip || !ref) return;\n let unobserve;\n unobserve = observe(\n ref,\n (inView, entry) => {\n setState({\n inView,\n entry\n });\n if (callback.current) callback.current(inView, entry);\n if (entry.isIntersecting && triggerOnce && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n },\n {\n root,\n rootMargin,\n threshold,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n return () => {\n if (unobserve) {\n unobserve();\n }\n };\n },\n // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // If the threshold is an array, convert it to a string, so it won't change between renders.\n Array.isArray(threshold) ? threshold.toString() : threshold,\n ref,\n root,\n rootMargin,\n triggerOnce,\n skip,\n trackVisibility,\n fallbackInView,\n delay\n ]\n );\n const entryTarget = (_a = state.entry) == null ? void 0 : _a.target;\n const previousEntryTarget = React2.useRef(void 0);\n if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {\n previousEntryTarget.current = entryTarget;\n setState({\n inView: !!initialInView,\n entry: void 0\n });\n }\n const result = [setRef, state.inView, state.entry];\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\nexport {\n InView,\n defaultFallbackInView,\n observe,\n useInView\n};\n//# sourceMappingURL=index.mjs.map","/*\n Rendered but hidden. Only show when visible\n*/\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useInView } from 'react-intersection-observer';\n\n// The sticky header, usually at the top\nconst TOP = 48;\n\nconst shazamIDs = {};\n\nexport default function LazyShazam({ id, children }) {\n const containerRef = useRef();\n const hasID = !!shazamIDs[id];\n const [visible, setVisible] = useState(false);\n const [visibleStart, setVisibleStart] = useState(hasID || false);\n\n const { ref } = useInView({\n root: null,\n rootMargin: `-${TOP}px 0px 0px 0px`,\n trackVisibility: true,\n delay: 1000,\n onChange: (inView) => {\n if (inView) {\n setVisible(true);\n if (id) shazamIDs[id] = true;\n }\n },\n triggerOnce: true,\n skip: visibleStart || visible,\n });\n\n useEffect(() => {\n if (!containerRef.current) return;\n const rect = containerRef.current.getBoundingClientRect();\n if (rect.bottom > TOP) {\n if (rect.top < window.innerHeight) {\n setVisible(true);\n } else {\n setVisibleStart(true);\n }\n if (id) shazamIDs[id] = true;\n }\n }, []);\n\n if (visibleStart) return children;\n\n return (\n <div\n ref={containerRef}\n class=\"shazam-container no-animation\"\n hidden={!visible}\n >\n <div ref={ref} class=\"shazam-container-inner\">\n {children}\n </div>\n </div>\n );\n}\n","import './translation-block.css';\n\nimport { Trans, useLingui } from '@lingui/react/macro';\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 LazyShazam from './lazy-shazam';\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 autoDetected,\n}) {\n const { t } = useLingui();\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 <LazyShazam>\n <div class=\"status-translation-block-mini\">\n <Icon\n icon=\"translate\"\n alt={t`Auto-translated from ${sourceLangText}`}\n />\n <output\n lang={targetLang}\n dir=\"auto\"\n title={pronunciationContent || ''}\n >\n {translatedContent}\n </output>\n </div>\n </LazyShazam>\n );\n }\n return null;\n }\n\n return (\n <div\n class=\"status-translation-block\"\n onClick={(e) => {\n e.preventDefault();\n }}\n >\n <details ref={detailsRef}>\n <summary>\n <button\n type=\"button\"\n onClick={async (e) => {\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 <Icon icon=\"translate\" />{' '}\n <span>\n {uiState === 'loading'\n ? t`Translating…`\n : sourceLanguage && sourceLangText && !detectedLang\n ? autoDetected\n ? t`Translate from ${sourceLangText} (auto-detected)`\n : t`Translate from ${sourceLangText}`\n : t`Translate`}\n </span>\n </button>\n </summary>\n <div class=\"translated-block\">\n <div class=\"translation-info insignificant\">\n <select\n class=\"translated-source-select\"\n disabled={uiState === 'loading'}\n onChange={(e) => {\n apiSourceLang.current = e.target.value;\n translate();\n }}\n >\n {sourceLanguages.map((l) => {\n const common = localeCode2Text({\n code: l.code,\n fallback: l.name,\n });\n const native = localeCode2Text({\n code: l.code,\n locale: l.code,\n });\n const showCommon = common !== native;\n return (\n <option value={l.code}>\n {l.code === 'auto'\n ? t`Auto (${detectedLang ?? '…'})`\n : showCommon\n ? `${native} - ${common}`\n : native}\n </option>\n );\n })}\n </select>{' '}\n <span>→ {targetLangText}</span>\n <Loader abrupt hidden={uiState !== 'loading'} />\n </div>\n {uiState === 'error' ? (\n <p class=\"ui-state\">\n <Trans>Failed to translate</Trans>\n </p>\n ) : (\n !!translatedContent && (\n <>\n <output class=\"translated-content\" lang={targetLang} dir=\"auto\">\n {translatedContent}\n </output>\n {!!pronunciationContent && (\n <output\n class=\"translated-pronunciation-content\"\n tabIndex={-1}\n onClick={(e) => {\n e.target.classList.toggle('expand');\n }}\n >\n {pronunciationContent}\n </output>\n )}\n </>\n )\n )}\n </div>\n </details>\n </div>\n );\n}\n\nexport default LINGVA_INSTANCES?.length ? TranslationBlock : () => null;\n","function promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction delMany(keys, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n keys.forEach((key) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(store.getAllKeys()),\n promisifyRequest(store.getAll()),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n const items = [];\n return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","import {\n clear,\n createStore,\n del,\n delMany,\n get,\n getMany,\n keys,\n set,\n} from 'idb-keyval';\n\nfunction initDB(dbName, storeName) {\n const store = createStore(dbName, storeName);\n return {\n set: (key, val) => set(key, val, store),\n get: (key) => get(key, store),\n getMany: (keys) => getMany(keys, store),\n del: (key) => del(key, store),\n delMany: (keys) => delMany(keys, store),\n clear: () => clear(store),\n keys: () => keys(store),\n };\n}\n\nexport default {\n drafts: initDB('drafts-db', 'drafts-store'),\n catchup: initDB('catchup-db', 'catchup-store'),\n};\n","import { api } from './api';\nimport { getCurrentAccountID } from './store-utils';\n\nexport async function fetchRelationships(accounts, relationshipsMap = {}) {\n if (!accounts?.length) return;\n const { masto } = api();\n\n const currentAccount = getCurrentAccountID();\n const uniqueAccountIds = accounts.reduce((acc, a) => {\n // 1. Ignore duplicate accounts\n // 2. Ignore accounts that are already inside relationshipsMap\n // 3. Ignore currently logged in account\n if (\n !acc.includes(a.id) &&\n !relationshipsMap[a.id] &&\n a.id !== currentAccount\n ) {\n acc.push(a.id);\n }\n return acc;\n }, []);\n if (!uniqueAccountIds.length) return null;\n\n try {\n const relationships = await masto.v1.accounts.relationships.fetch({\n id: uniqueAccountIds,\n });\n const newRelationshipsMap = relationships.reduce((acc, r) => {\n acc[r.id] = r;\n return acc;\n }, {});\n return newRelationshipsMap;\n } catch (e) {\n console.error(e);\n // It's okay to fail\n return null;\n }\n}\n","export class LiteYTEmbed extends HTMLElement {\n constructor() {\n super();\n this.isIframeLoaded = false;\n this.setupDom();\n }\n static get observedAttributes() {\n return ['videoid', 'playlistid', 'videoplay', 'videotitle'];\n }\n connectedCallback() {\n this.addEventListener('pointerover', () => LiteYTEmbed.warmConnections(this), {\n once: true,\n });\n this.addEventListener('click', () => this.addIframe());\n }\n get videoId() {\n return encodeURIComponent(this.getAttribute('videoid') || '');\n }\n set videoId(id) {\n this.setAttribute('videoid', id);\n }\n get playlistId() {\n return encodeURIComponent(this.getAttribute('playlistid') || '');\n }\n set playlistId(id) {\n this.setAttribute('playlistid', id);\n }\n get videoTitle() {\n return this.getAttribute('videotitle') || 'Video';\n }\n set videoTitle(title) {\n this.setAttribute('videotitle', title);\n }\n get videoPlay() {\n return this.getAttribute('videoplay') || 'Play';\n }\n set videoPlay(name) {\n this.setAttribute('videoplay', name);\n }\n get videoStartAt() {\n return this.getAttribute('videoStartAt') || '0';\n }\n get autoLoad() {\n return this.hasAttribute('autoload');\n }\n get autoPause() {\n return this.hasAttribute('autopause');\n }\n get noCookie() {\n return this.hasAttribute('nocookie');\n }\n get posterQuality() {\n return this.getAttribute('posterquality') || 'hqdefault';\n }\n get posterLoading() {\n return (this.getAttribute('posterloading') ||\n 'lazy');\n }\n get params() {\n return `start=${this.videoStartAt}&${this.getAttribute('params')}`;\n }\n set params(opts) {\n this.setAttribute('params', opts);\n }\n setupDom() {\n const shadowDom = this.attachShadow({ mode: 'open' });\n let nonce = '';\n if (window.liteYouTubeNonce) {\n nonce = `nonce=\"${window.liteYouTubeNonce}\"`;\n }\n shadowDom.innerHTML = `\n <style ${nonce}>\n :host {\n --aspect-ratio: var(--lite-youtube-aspect-ratio, 16 / 9);\n --aspect-ratio-short: var(--lite-youtube-aspect-ratio-short, 9 / 16);\n --frame-shadow-visible: var(--lite-youtube-frame-shadow-visible, yes);\n contain: content;\n display: block;\n position: relative;\n width: 100%;\n aspect-ratio: var(--aspect-ratio);\n }\n\n @media (max-width: 40em) {\n :host([short]) {\n aspect-ratio: var(--aspect-ratio-short);\n }\n }\n\n #frame, #fallbackPlaceholder, iframe {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n }\n\n #frame {\n cursor: pointer;\n }\n\n #fallbackPlaceholder, slot[name=image]::slotted(*) {\n object-fit: cover;\n width: 100%;\n }\n\n @container style(--frame-shadow-visible: yes) {\n #frame::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n background-image: linear-gradient(180deg, #111 -20%, transparent 90%);\n height: 60px;\n width: 100%;\n z-index: 1;\n }\n }\n\n #playButton {\n width: 68px;\n height: 48px;\n background-color: transparent;\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 68 48\"><path d=\"M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z\" fill=\"red\"/><path d=\"M45 24 27 14v20\" fill=\"white\"/></svg>');\n z-index: 1;\n border: 0;\n border-radius: inherit;\n }\n\n #playButton:before {\n content: '';\n border-style: solid;\n border-width: 11px 0 11px 19px;\n border-color: transparent transparent transparent #fff;\n }\n\n #playButton,\n #playButton:before {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate3d(-50%, -50%, 0);\n cursor: inherit;\n }\n\n /* Post-click styles */\n .activated {\n cursor: unset;\n }\n\n #frame.activated::before,\n #frame.activated > #playButton {\n display: none;\n }\n </style>\n <div id=\"frame\">\n <picture>\n <slot name=\"image\">\n <source id=\"webpPlaceholder\" type=\"image/webp\">\n <source id=\"jpegPlaceholder\" type=\"image/jpeg\">\n <img id=\"fallbackPlaceholder\" referrerpolicy=\"origin\" loading=\"lazy\">\n </slot>\n </picture>\n <button id=\"playButton\"></button>\n </div>\n `;\n this.domRefFrame = shadowDom.querySelector('#frame');\n this.domRefImg = {\n fallback: shadowDom.querySelector('#fallbackPlaceholder'),\n webp: shadowDom.querySelector('#webpPlaceholder'),\n jpeg: shadowDom.querySelector('#jpegPlaceholder'),\n };\n this.domRefPlayButton = shadowDom.querySelector('#playButton');\n }\n setupComponent() {\n this.initImagePlaceholder();\n this.domRefPlayButton.setAttribute('aria-label', `${this.videoPlay}: ${this.videoTitle}`);\n this.setAttribute('title', `${this.videoPlay}: ${this.videoTitle}`);\n if (this.autoLoad || this.isYouTubeShort() || this.autoPause) {\n this.initIntersectionObserver();\n }\n }\n attributeChangedCallback(name, oldVal, newVal) {\n if (oldVal !== newVal) {\n this.setupComponent();\n if (this.domRefFrame.classList.contains('activated')) {\n this.domRefFrame.classList.remove('activated');\n this.shadowRoot.querySelector('iframe').remove();\n this.isIframeLoaded = false;\n }\n }\n }\n addIframe(isIntersectionObserver = false) {\n if (!this.isIframeLoaded) {\n let autoplay = isIntersectionObserver ? 0 : 1;\n const wantsNoCookie = this.noCookie ? '-nocookie' : '';\n let embedTarget;\n if (this.playlistId) {\n embedTarget = `?listType=playlist&list=${this.playlistId}&`;\n }\n else {\n embedTarget = `${this.videoId}?`;\n }\n if (this.autoPause) {\n this.params = `enablejsapi=1`;\n }\n if (this.isYouTubeShort()) {\n this.params = `loop=1&mute=1&modestbranding=1&playsinline=1&rel=0&enablejsapi=1&playlist=${this.videoId}`;\n autoplay = 1;\n }\n const iframeHTML = `\n<iframe credentialless frameborder=\"0\" title=\"${this.videoTitle}\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen\n src=\"https://www.youtube${wantsNoCookie}.com/embed/${embedTarget}autoplay=${autoplay}&${this.params}\"\n></iframe>`;\n this.domRefFrame.insertAdjacentHTML('beforeend', iframeHTML);\n this.domRefFrame.classList.add('activated');\n this.isIframeLoaded = true;\n this.attemptShortAutoPlay();\n this.dispatchEvent(new CustomEvent('liteYoutubeIframeLoaded', {\n detail: {\n videoId: this.videoId,\n },\n bubbles: true,\n cancelable: true,\n }));\n }\n }\n initImagePlaceholder() {\n const posterUrlWebp = `https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;\n const posterUrlJpeg = `https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;\n this.domRefImg.fallback.loading = this.posterLoading;\n this.domRefImg.webp.srcset = posterUrlWebp;\n this.domRefImg.jpeg.srcset = posterUrlJpeg;\n this.domRefImg.fallback.src = posterUrlJpeg;\n this.domRefImg.fallback.setAttribute('aria-label', `${this.videoPlay}: ${this.videoTitle}`);\n this.domRefImg?.fallback?.setAttribute('alt', `${this.videoPlay}: ${this.videoTitle}`);\n }\n initIntersectionObserver() {\n const options = {\n root: null,\n rootMargin: '0px',\n threshold: 0,\n };\n const observer = new IntersectionObserver((entries, observer) => {\n entries.forEach(entry => {\n if (entry.isIntersecting && !this.isIframeLoaded) {\n LiteYTEmbed.warmConnections(this);\n this.addIframe(true);\n observer.unobserve(this);\n }\n });\n }, options);\n observer.observe(this);\n if (this.autoPause) {\n const windowPause = new IntersectionObserver((e, o) => {\n e.forEach(entry => {\n if (entry.intersectionRatio !== 1) {\n this.shadowRoot\n .querySelector('iframe')\n ?.contentWindow?.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}', '*');\n }\n });\n }, { threshold: 1 });\n windowPause.observe(this);\n }\n }\n attemptShortAutoPlay() {\n if (this.isYouTubeShort()) {\n setTimeout(() => {\n this.shadowRoot\n .querySelector('iframe')\n ?.contentWindow?.postMessage('{\"event\":\"command\",\"func\":\"' + 'playVideo' + '\",\"args\":\"\"}', '*');\n }, 2000);\n }\n }\n isYouTubeShort() {\n return (this.getAttribute('short') === '' &&\n window.matchMedia('(max-width: 40em)').matches);\n }\n static addPrefetch(kind, url) {\n const linkElem = document.createElement('link');\n linkElem.rel = kind;\n linkElem.href = url;\n linkElem.crossOrigin = 'true';\n document.head.append(linkElem);\n }\n static warmConnections(context) {\n if (LiteYTEmbed.isPreconnected || window.liteYouTubeIsPreconnected)\n return;\n LiteYTEmbed.addPrefetch('preconnect', 'https://i.ytimg.com/');\n LiteYTEmbed.addPrefetch('preconnect', 'https://s.ytimg.com');\n if (!context.noCookie) {\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube.com');\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.google.com');\n LiteYTEmbed.addPrefetch('preconnect', 'https://googleads.g.doubleclick.net');\n LiteYTEmbed.addPrefetch('preconnect', 'https://static.doubleclick.net');\n }\n else {\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube-nocookie.com');\n }\n LiteYTEmbed.isPreconnected = true;\n window.liteYouTubeIsPreconnected = true;\n }\n}\nLiteYTEmbed.isPreconnected = false;\ncustomElements.define('lite-youtube', LiteYTEmbed);\n//# sourceMappingURL=lite-youtube.js.map","const digitLookup = new Uint8Array(128);\nfor (let i = 0; i < 83; i++) {\n digitLookup[\n '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~'.charCodeAt(\n i,\n )\n ] = i;\n}\nconst decode83 = (str, start, end) => {\n let value = 0;\n while (start < end) {\n value *= 83;\n value += digitLookup[str.charCodeAt(start++)];\n }\n return value;\n};\n\nconst pow = Math.pow;\nconst PI = Math.PI;\nconst PI2 = PI * 2;\n\nconst d = 3294.6;\nconst e = 269.025;\nconst sRGBToLinear = (value) =>\n value > 10.31475 ? pow(value / e + 0.052132, 2.4) : value / d;\n\nconst linearTosRGB = (v) =>\n ~~(v > 0.00001227 ? e * pow(v, 0.416666) - 13.025 : v * d + 1);\n\nconst signSqr = (x) => (x < 0 ? -1 : 1) * x * x;\n\n/**\n * Fast approximate cosine implementation\n * Based on FTrig https://github.com/netcell/FTrig\n */\nconst fastCos = (x) => {\n x += PI / 2;\n while (x > PI) {\n x -= PI2;\n }\n const cos = 1.27323954 * x - 0.405284735 * signSqr(x);\n return 0.225 * (signSqr(cos) - cos) + cos;\n};\n\n/**\n * Extracts average color from BlurHash image\n * @param {string} blurHash BlurHash image string\n * @returns {[number, number, number]}\n */\nexport function getBlurHashAverageColor(blurHash) {\n const val = decode83(blurHash, 2, 6);\n return [val >> 16, (val >> 8) & 255, val & 255];\n}\n\n/**\n * Decodes BlurHash image\n * @param {string} blurHash BlurHash image string\n * @param {number} width Output image width\n * @param {number} height Output image height\n * @param {?number} punch\n * @returns {Uint8ClampedArray}\n */\nexport function decodeBlurHash(blurHash, width, height, punch) {\n const sizeFlag = decode83(blurHash, 0, 1);\n const numX = (sizeFlag % 9) + 1;\n const numY = ~~(sizeFlag / 9) + 1;\n const size = numX * numY;\n\n let i = 0,\n j = 0,\n x = 0,\n y = 0,\n r = 0,\n g = 0,\n b = 0,\n basis = 0,\n basisY = 0,\n colorIndex = 0,\n pixelIndex = 0,\n value = 0;\n\n const maximumValue = ((decode83(blurHash, 1, 2) + 1) / 13446) * (punch | 1);\n\n const colors = new Float64Array(size * 3);\n\n const averageColor = getBlurHashAverageColor(blurHash);\n for (i = 0; i < 3; i++) {\n colors[i] = sRGBToLinear(averageColor[i]);\n }\n\n for (i = 1; i < size; i++) {\n value = decode83(blurHash, 4 + i * 2, 6 + i * 2);\n colors[i * 3] = signSqr(~~(value / 361) - 9) * maximumValue;\n colors[i * 3 + 1] = signSqr((~~(value / 19) % 19) - 9) * maximumValue;\n colors[i * 3 + 2] = signSqr((value % 19) - 9) * maximumValue;\n }\n\n const cosinesY = new Float64Array(numY * height);\n const cosinesX = new Float64Array(numX * width);\n for (j = 0; j < numY; j++) {\n for (y = 0; y < height; y++) {\n cosinesY[j * height + y] = fastCos((PI * y * j) / height);\n }\n }\n for (i = 0; i < numX; i++) {\n for (x = 0; x < width; x++) {\n cosinesX[i * width + x] = fastCos((PI * x * i) / width);\n }\n }\n\n const bytesPerRow = width * 4;\n const pixels = new Uint8ClampedArray(bytesPerRow * height);\n\n for (y = 0; y < height; y++) {\n for (x = 0; x < width; x++) {\n r = g = b = 0;\n for (j = 0; j < numY; j++) {\n basisY = cosinesY[j * height + y];\n for (i = 0; i < numX; i++) {\n basis = cosinesX[i * width + x] * basisY;\n colorIndex = (i + j * numX) * 3;\n r += colors[colorIndex] * basis;\n g += colors[colorIndex + 1] * basis;\n b += colors[colorIndex + 2] * basis;\n }\n }\n\n pixelIndex = 4 * x + y * bytesPerRow;\n pixels[pixelIndex] = linearTosRGB(r);\n pixels[pixelIndex + 1] = linearTosRGB(g);\n pixels[pixelIndex + 2] = linearTosRGB(b);\n pixels[pixelIndex + 3] = 255; // alpha\n }\n }\n return pixels;\n}\n","/**\n * @param {string[]} splittedHtml\n * @param {{ char?: string; count?: number}} options\n * @returns {string}\n */\nconst addIndentation = (splittedHtml, options = {}) => {\n const char = options.char || ' '\n const count = options.count || 2\n\n let level = 0\n const opened = []\n\n return splittedHtml.reverse().reduce((indented, elTag) => {\n if (opened.length\n && level\n && opened[level]\n /* if current element tag is the same as previously opened one */\n && opened[level] === elTag.substring(1, opened[level].length + 1)\n ) {\n opened.splice(level, 1)\n level--\n }\n\n const indentation = char.repeat(level ? level * count : 0)\n\n const newIndented = [\n `${indentation}${elTag}`,\n ...indented,\n ]\n\n // if current element tag is closing tag\n // add it to opened elements\n if (elTag.substring(0, 2) === '</') {\n level++\n opened[level] = elTag.substring(2, elTag.length - 1)\n }\n\n return newIndented\n }, []).join('\\n')\n}\n\nmodule.exports = addIndentation\n","/**\n * @param {string} nonFormattedString Any non formatted string\n * @returns {string[]} Array of strings separated on new lines\n */\nconst removeEmptyLines = (nonFormattedString) => (\n // Replace\n // - 1 or more spaces or tabs at the start of line\n // - 1 or more spaces or tabs at the end of line\n // - empty lines\n // with empty string\n nonFormattedString.trim().replace(/(^(\\s|\\t)+|(( |\\t)+)$)/gm, '')\n)\n\n/**\n * @param {string} markup\n * @returns {string[]} Array of strings splitted on new lines without empty lines\n */\nconst mergeAttributesWithElements = (markup) => {\n const splittedMarkup = removeEmptyLines(markup).split('\\n')\n\n const mergedLines = []\n let currentElement = ''\n for (let i = 0; i < splittedMarkup.length; i += 1) {\n const line = splittedMarkup[i]\n\n // If line is closing element/tag separate closing tag from rest of the line with space\n if (line.endsWith('/>')) {\n mergedLines.push(`${currentElement}${line.slice(0, -2)} />`)\n currentElement = ''\n // eslint-disable-next-line no-continue\n continue\n }\n\n if (line.endsWith('>')) {\n mergedLines.push(`${currentElement}${\n line.startsWith('>') || line.startsWith('<') ? '' : ' '\n }${line}`)\n currentElement = ''\n // eslint-disable-next-line no-continue\n continue\n }\n\n currentElement += currentElement.length ? ` ${line}` : line\n }\n\n return mergedLines\n}\n\nmodule.exports = {\n mergeAttributesWithElements,\n removeEmptyLines,\n}\n","const addIndentation = require('./utils/addIndentation')\nconst { mergeAttributesWithElements } = require('./utils/toLines')\n\n/**\n * @param {string} markup\n * @param {{ char?: string; count?: number }} options\n * @returns {string}\n */\nconst prettify = (markup, options = {}) => {\n const splitted = mergeAttributesWithElements(markup)\n\n return addIndentation(splitted, options)\n}\n\nmodule.exports = prettify\n","import { useRef as s, useCallback as h, useEffect as g } from \"react\";\nvar l = /* @__PURE__ */ ((e) => (e.Mouse = \"mouse\", e.Touch = \"touch\", e.Pointer = \"pointer\", e))(l || {}), d = /* @__PURE__ */ ((e) => (e.CancelledByMovement = \"cancelled-by-movement\", e.CancelledByRelease = \"cancelled-by-release\", e.CancelledOutsideElement = \"cancelled-outside-element\", e))(d || {});\nconst A = () => typeof window == \"object\" ? window?.PointerEvent ?? null : null, z = () => typeof window == \"object\" ? window?.TouchEvent ?? null : null;\nfunction U(e) {\n const { nativeEvent: t } = e, u = z();\n return u && t instanceof u || \"touches\" in e;\n}\nfunction X(e) {\n const t = A();\n return e.nativeEvent instanceof MouseEvent && !(t && e.nativeEvent instanceof t);\n}\nfunction Y(e) {\n const { nativeEvent: t } = e;\n if (!t)\n return !1;\n const u = A();\n return u && t instanceof u || \"pointerId\" in t;\n}\nfunction R(e) {\n return X(e) || U(e) || Y(e);\n}\nfunction j(e) {\n return U(e) ? {\n x: e.touches[0].pageX,\n y: e.touches[0].pageY\n } : X(e) || Y(e) ? {\n x: e.pageX,\n y: e.pageY\n } : null;\n}\nfunction G(e) {\n return {\n target: e.target,\n currentTarget: e.currentTarget,\n nativeEvent: e,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n persist: () => {\n }\n };\n}\nfunction J(e, {\n threshold: t = 400,\n captureEvent: u = !1,\n detect: y = l.Pointer,\n cancelOnMovement: w = !1,\n cancelOutsideElement: v = !0,\n filterEvents: p,\n onStart: M,\n onMove: C,\n onFinish: L,\n onCancel: b\n} = {}) {\n const P = s(!1), c = s(!1), I = s(), a = s(), T = s(e), f = s(null), E = h(\n (n) => (r) => {\n c.current || R(r) && (p !== void 0 && !p(r) || (u && r.persist(), M?.(r, { context: n }), f.current = j(r), c.current = !0, I.current = r.currentTarget, a.current = setTimeout(() => {\n T.current && (T.current(r, { context: n }), P.current = !0);\n }, t)));\n },\n [u, p, M, t]\n ), i = h(\n (n) => (r, o) => {\n R(r) && c.current && (f.current = null, u && r.persist(), P.current ? L?.(r, { context: n }) : c.current && b?.(r, { context: n, reason: o ?? d.CancelledByRelease }), P.current = !1, c.current = !1, a.current !== void 0 && clearTimeout(a.current));\n },\n [u, L, b]\n ), m = h(\n (n) => (r) => {\n if (C?.(r, { context: n }), w !== !1 && f.current) {\n const o = j(r);\n if (o) {\n const B = w === !0 ? 25 : w, D = {\n x: Math.abs(o.x - f.current.x),\n y: Math.abs(o.y - f.current.y)\n };\n (D.x > B || D.y > B) && i(n)(r, d.CancelledByMovement);\n }\n }\n },\n [i, w, C]\n ), q = h(\n (n) => {\n if (e === null)\n return {};\n switch (y) {\n case l.Mouse: {\n const r = {\n onMouseDown: E(n),\n onMouseMove: m(n),\n onMouseUp: i(n)\n };\n return v && (r.onMouseLeave = (o) => {\n i(n)(o, d.CancelledOutsideElement);\n }), r;\n }\n case l.Touch:\n return {\n onTouchStart: E(n),\n onTouchMove: m(n),\n onTouchEnd: i(n)\n };\n case l.Pointer: {\n const r = {\n onPointerDown: E(n),\n onPointerMove: m(n),\n onPointerUp: i(n)\n };\n return v && (r.onPointerLeave = (o) => i(n)(o, d.CancelledOutsideElement)), r;\n }\n }\n },\n [e, i, v, y, m, E]\n );\n return g(() => {\n if (!window)\n return;\n function n(r) {\n const o = G(r);\n i()(o);\n }\n return window.addEventListener(\"mouseup\", n), window.addEventListener(\"touchend\", n), window.addEventListener(\"pointerup\", n), () => {\n window.removeEventListener(\"mouseup\", n), window.removeEventListener(\"touchend\", n), window.removeEventListener(\"pointerup\", n);\n };\n }, [i]), g(\n () => () => {\n a.current !== void 0 && clearTimeout(a.current);\n },\n []\n ), g(() => {\n T.current = e;\n }, [e]), q;\n}\nexport {\n d as LongPressCallbackReason,\n l as LongPressEventType,\n J as useLongPress\n};\n","import { i18n } from '@lingui/core';\nimport { plural } from '@lingui/core/macro';\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\nimport { 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 { t } = useLingui();\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 = multiple ? 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 <div\n lang={lang}\n dir=\"auto\"\n class={`poll ${readOnly ? 'read-only' : ''} ${\n uiState === 'loading' ? 'loading' : ''\n }`}\n >\n {(showResults && optionsHaveVoteCounts) || voted || expired ? (\n <>\n <div class=\"poll-options\">\n {options.map((option, i) => {\n const { title, votesCount: optionVotesCount } = option;\n const ratio = pollVotesCount\n ? optionVotesCount / pollVotesCount\n : 0;\n const percentage = ratio\n ? ratio.toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n maximumFractionDigits: roundPrecision,\n })\n : '0%';\n\n const isLeading =\n optionVotesCount > 0 &&\n optionVotesCount ===\n Math.max(...options.map((o) => o.votesCount));\n return (\n <div\n key={`${i}-${title}-${optionVotesCount}`}\n class={`poll-option poll-result ${\n isLeading ? 'poll-option-leading' : ''\n }`}\n style={{\n '--percentage': `${ratio * 100}%`,\n }}\n >\n <div class=\"poll-option-title\">\n <span>\n <EmojiText text={title} emojis={emojis} />\n </span>\n {voted && ownVotes.includes(i) && (\n <>\n {' '}\n <Icon icon=\"check-circle\" alt={t`Voted`} />\n </>\n )}\n </div>\n <div\n class=\"poll-option-votes\"\n title={plural(optionVotesCount, {\n one: `# vote`,\n other: `# votes`,\n })}\n >\n {percentage}\n </div>\n </div>\n );\n })}\n </div>\n {!expired && !voted && (\n <button\n class=\"poll-vote-button plain2\"\n disabled={uiState === 'loading'}\n onClick={(e) => {\n e.preventDefault();\n setShowResults(false);\n }}\n >\n <Icon icon=\"arrow-left\" size=\"s\" /> <Trans>Hide results</Trans>\n </button>\n )}\n </>\n ) : (\n <form\n onSubmit={async (e) => {\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 <div class=\"poll-options\">\n {options.map((option, i) => {\n const { title } = option;\n return (\n <div class=\"poll-option\">\n <label class=\"poll-label\">\n <input\n type={multiple ? 'checkbox' : 'radio'}\n name=\"poll\"\n value={i}\n disabled={uiState === 'loading'}\n readOnly={readOnly}\n />\n <span class=\"poll-option-title\">\n <EmojiText text={title} emojis={emojis} />\n </span>\n </label>\n </div>\n );\n })}\n </div>\n {!readOnly && (\n <button\n class=\"poll-vote-button\"\n type=\"submit\"\n disabled={uiState === 'loading'}\n >\n <Trans>Vote</Trans>\n </button>\n )}\n </form>\n )}\n <p class=\"poll-meta\">\n {!expired && !readOnly && (\n <button\n type=\"button\"\n class=\"plain small\"\n disabled={uiState === 'loading'}\n onClick={(e) => {\n e.preventDefault();\n setUIState('loading');\n\n (async () => {\n await refresh();\n setUIState('default');\n })();\n }}\n title={t`Refresh`}\n >\n <Icon icon=\"refresh\" alt={t`Refresh`} />\n </button>\n )}\n {!voted && !expired && !readOnly && optionsHaveVoteCounts && (\n <button\n type=\"button\"\n class=\"plain small\"\n disabled={uiState === 'loading'}\n onClick={(e) => {\n e.preventDefault();\n setShowResults(!showResults);\n }}\n title={showResults ? t`Hide results` : t`Show results`}\n >\n <Icon\n icon={showResults ? 'eye-open' : 'eye-close'}\n alt={showResults ? t`Hide results` : t`Show results`}\n />{' '}\n </button>\n )}\n {!expired && !readOnly && ' '}\n <Plural\n value={votesCount}\n one={\n <Trans>\n <span title={votesCount}>{shortenNumber(votesCount)}</span> vote\n </Trans>\n }\n other={\n <Trans>\n <span title={votesCount}>{shortenNumber(votesCount)}</span> votes\n </Trans>\n }\n />\n {!!votersCount && votersCount !== votesCount && (\n <>\n {' '}\n •{' '}\n <Plural\n value={votersCount}\n one={\n <Trans>\n <span title={votersCount}>{shortenNumber(votersCount)}</span>{' '}\n voter\n </Trans>\n }\n other={\n <Trans>\n <span title={votersCount}>{shortenNumber(votersCount)}</span>{' '}\n voters\n </Trans>\n }\n />\n </>\n )}{' '}\n •{' '}\n {expired ? (\n !!expiresAtDate ? (\n <Trans>\n Ended <RelativeTime datetime={expiresAtDate} />\n </Trans>\n ) : (\n t`Ended`\n )\n ) : !!expiresAtDate ? (\n <Trans>\n Ending <RelativeTime datetime={expiresAtDate} />\n </Trans>\n ) : (\n t`Ending`\n )}\n </p>\n </div>\n );\n}\n","import { createContext } from 'preact';\n\nconst FilterContext = createContext();\nexport default FilterContext;\n","import mem from './mem';\nimport { getCurrentAccountID } from './store-utils';\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 = getCurrentAccountID();\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. <span class=\"invisible\">https://</span>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?.options?.length) {\n text += `\\n\\n📊:\\n${poll.options\n .map((o) => `${poll.multiple ? '▪️' : '•'} ${o.title}`)\n .join('\\n')}`;\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 as r,useEffect as n,useMemo as t,useState as e,useCallback as u}from\"react\";function c(e,u,c){var i=this,a=r(null),o=r(0),f=r(null),l=r([]),v=r(),m=r(),d=r(e),g=r(!0);d.current=e;var p=\"undefined\"!=typeof window,w=!u&&0!==u&&p;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");u=+u||0;var s=!!(c=c||{}).leading,x=!(\"trailing\"in c)||!!c.trailing,h=\"maxWait\"in c,y=\"debounceOnServer\"in c&&!!c.debounceOnServer,F=h?Math.max(+c.maxWait||0,u):null;n(function(){return g.current=!0,function(){g.current=!1}},[]);var A=t(function(){var r=function(r){var n=l.current,t=v.current;return l.current=v.current=null,o.current=r,m.current=d.current.apply(t,n)},n=function(r,n){w&&cancelAnimationFrame(f.current),f.current=w?requestAnimationFrame(r):setTimeout(r,n)},t=function(r){if(!g.current)return!1;var n=r-a.current;return!a.current||n>=u||n<0||h&&r-o.current>=F},e=function(n){return f.current=null,x&&l.current?r(n):(l.current=v.current=null,m.current)},c=function r(){var c=Date.now();if(t(c))return e(c);if(g.current){var i=u-(c-a.current),f=h?Math.min(i,F-(c-o.current)):i;n(r,f)}},A=function(){if(p||y){var e=Date.now(),d=t(e);if(l.current=[].slice.call(arguments),v.current=i,a.current=e,d){if(!f.current&&g.current)return o.current=a.current,n(c,u),s?r(a.current):m.current;if(h)return n(c,u),r(a.current)}return f.current||n(c,u),m.current}};return A.cancel=function(){f.current&&(w?cancelAnimationFrame(f.current):clearTimeout(f.current)),o.current=0,l.current=a.current=v.current=f.current=null},A.isPending=function(){return!!f.current},A.flush=function(){return f.current?e(Date.now()):m.current},A},[s,h,u,F,x,w,p,y]);return A}function i(r,n){return r===n}function a(n,t,a){var o=a&&a.equalityFn||i,f=r(n),l=e({})[1],v=c(u(function(r){f.current=r,l({})},[l]),t,a),m=r(n);return o(m.current,n)||(v(n),m.current=n),[f.current,v]}function o(r,n,t){var e=void 0===t?{}:t,u=e.leading,i=e.trailing;return c(r,n,{maxWait:n,leading:void 0===u||u,trailing:void 0===i||i})}export{a as useDebounce,c as useDebouncedCallback,o as useThrottledCallback};\n//# sourceMappingURL=index.module.js.map\n","import { useRef, useEffect, useCallback, useState, useMemo } from 'react';\n\n// This could've been more streamlined with internal state instead of abusing\n// refs to such extent, but then composing hooks and components could not opt out of unnecessary renders.\nfunction useResolvedElement(subscriber, refOrElement) {\n var lastReportRef = useRef(null);\n var refOrElementRef = useRef(null);\n refOrElementRef.current = refOrElement;\n var cbElementRef = useRef(null); // Calling re-evaluation after each render without using a dep array,\n // as the ref object's current value could've changed since the last render.\n\n useEffect(function () {\n evaluateSubscription();\n });\n var evaluateSubscription = useCallback(function () {\n var cbElement = cbElementRef.current;\n var refOrElement = refOrElementRef.current; // Ugly ternary. But smaller than an if-else block.\n\n var element = cbElement ? cbElement : refOrElement ? refOrElement instanceof Element ? refOrElement : refOrElement.current : null;\n\n if (lastReportRef.current && lastReportRef.current.element === element && lastReportRef.current.subscriber === subscriber) {\n return;\n }\n\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n }\n\n lastReportRef.current = {\n element: element,\n subscriber: subscriber,\n // Only calling the subscriber, if there's an actual element to report.\n // Setting cleanup to undefined unless a subscriber returns one, as an existing cleanup function would've been just called.\n cleanup: element ? subscriber(element) : undefined\n };\n }, [subscriber]); // making sure we call the cleanup function on unmount\n\n useEffect(function () {\n return function () {\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n lastReportRef.current = null;\n }\n };\n }, []);\n return useCallback(function (element) {\n cbElementRef.current = element;\n evaluateSubscription();\n }, [evaluateSubscription]);\n}\n\n// We're only using the first element of the size sequences, until future versions of the spec solidify on how\n// exactly it'll be used for fragments in multi-column scenarios:\n// From the spec:\n// > The box size properties are exposed as FrozenArray in order to support elements that have multiple fragments,\n// > which occur in multi-column scenarios. However the current definitions of content rect and border box do not\n// > mention how those boxes are affected by multi-column layout. In this spec, there will only be a single\n// > ResizeObserverSize returned in the FrozenArray, which will correspond to the dimensions of the first column.\n// > A future version of this spec will extend the returned FrozenArray to contain the per-fragment size information.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface)\n//\n// Also, testing these new box options revealed that in both Chrome and FF everything is returned in the callback,\n// regardless of the \"box\" option.\n// The spec states the following on this:\n// > This does not have any impact on which box dimensions are returned to the defined callback when the event\n// > is fired, it solely defines which box the author wishes to observe layout changes on.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// I'm not exactly clear on what this means, especially when you consider a later section stating the following:\n// > This section is non-normative. An author may desire to observe more than one CSS box.\n// > In this case, author will need to use multiple ResizeObservers.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// Which is clearly not how current browser implementations behave, and seems to contradict the previous quote.\n// For this reason I decided to only return the requested size,\n// even though it seems we have access to results for all box types.\n// This also means that we get to keep the current api, being able to return a simple { width, height } pair,\n// regardless of box option.\nfunction extractSize(entry, boxProp, sizeType) {\n if (!entry[boxProp]) {\n if (boxProp === \"contentBoxSize\") {\n // The dimensions in `contentBoxSize` and `contentRect` are equivalent according to the spec.\n // See the 6th step in the description for the RO algorithm:\n // https://drafts.csswg.org/resize-observer/#create-and-populate-resizeobserverentry-h\n // > Set this.contentRect to logical this.contentBoxSize given target and observedBox of \"content-box\".\n // In real browser implementations of course these objects differ, but the width/height values should be equivalent.\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n\n return undefined;\n } // A couple bytes smaller than calling Array.isArray() and just as effective here.\n\n\n return entry[boxProp][0] ? entry[boxProp][0][sizeType] : // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current\n // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.\n // @ts-ignore\n entry[boxProp][sizeType];\n}\n\nfunction useResizeObserver(opts) {\n if (opts === void 0) {\n opts = {};\n }\n\n // Saving the callback as a ref. With this, I don't need to put onResize in the\n // effect dep array, and just passing in an anonymous function without memoising\n // will not reinstantiate the hook's ResizeObserver.\n var onResize = opts.onResize;\n var onResizeRef = useRef(undefined);\n onResizeRef.current = onResize;\n var round = opts.round || Math.round; // Using a single instance throughout the hook's lifetime\n\n var resizeObserverRef = useRef();\n\n var _useState = useState({\n width: undefined,\n height: undefined\n }),\n size = _useState[0],\n setSize = _useState[1]; // In certain edge cases the RO might want to report a size change just after\n // the component unmounted.\n\n\n var didUnmount = useRef(false);\n useEffect(function () {\n didUnmount.current = false;\n return function () {\n didUnmount.current = true;\n };\n }, []); // Using a ref to track the previous width / height to avoid unnecessary renders.\n\n var previous = useRef({\n width: undefined,\n height: undefined\n }); // This block is kinda like a useEffect, only it's called whenever a new\n // element could be resolved based on the ref option. It also has a cleanup\n // function.\n\n var refCallback = useResolvedElement(useCallback(function (element) {\n // We only use a single Resize Observer instance, and we're instantiating it on demand, only once there's something to observe.\n // This instance is also recreated when the `box` option changes, so that a new observation is fired if there was a previously observed element with a different box option.\n if (!resizeObserverRef.current || resizeObserverRef.current.box !== opts.box || resizeObserverRef.current.round !== round) {\n resizeObserverRef.current = {\n box: opts.box,\n round: round,\n instance: new ResizeObserver(function (entries) {\n var entry = entries[0];\n var boxProp = opts.box === \"border-box\" ? \"borderBoxSize\" : opts.box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n var reportedWidth = extractSize(entry, boxProp, \"inlineSize\");\n var reportedHeight = extractSize(entry, boxProp, \"blockSize\");\n var newWidth = reportedWidth ? round(reportedWidth) : undefined;\n var newHeight = reportedHeight ? round(reportedHeight) : undefined;\n\n if (previous.current.width !== newWidth || previous.current.height !== newHeight) {\n var newSize = {\n width: newWidth,\n height: newHeight\n };\n previous.current.width = newWidth;\n previous.current.height = newHeight;\n\n if (onResizeRef.current) {\n onResizeRef.current(newSize);\n } else {\n if (!didUnmount.current) {\n setSize(newSize);\n }\n }\n }\n })\n };\n }\n\n resizeObserverRef.current.instance.observe(element, {\n box: opts.box\n });\n return function () {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.instance.unobserve(element);\n }\n };\n }, [opts.box, round]), opts.ref);\n return useMemo(function () {\n return {\n ref: refCallback,\n width: size.width,\n height: size.height\n };\n }, [refCallback, size.width, size.height]);\n}\n\nexport { useResizeObserver as default };\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","export default {\n public: 'earth',\n unlisted: 'group',\n private: 'lock',\n direct: 'message',\n local: 'building',\n};\n","export var styleRoot = 'kvfysmfp';\nexport var styleChild = 'ufhsfnkm';\nexport var styles = \".\".concat(styleRoot, \"{overflow:hidden;touch-action:none}.\").concat(styleChild, \"{transform-origin: 0 0}\");\n","var isSsr = typeof window === 'undefined';\nexport var isTouch = function () {\n return !isSsr && ('ontouchstart' in window || navigator.maxTouchPoints > 0);\n};\nexport var make2dTransformValue = function (_a) {\n var x = _a.x, y = _a.y, scale = _a.scale;\n return \"scale(\".concat(scale, \") translate(\").concat(x, \"px, \").concat(y, \"px)\");\n};\nexport var make3dTransformValue = function (_a) {\n var x = _a.x, y = _a.y, scale = _a.scale;\n return \"scale3d(\".concat(scale, \",\").concat(scale, \", 1) translate3d(\").concat(x, \"px, \").concat(y, \"px, 0)\");\n};\nexport var hasTranslate3DSupport = function () {\n var css = !isSsr && window.CSS;\n return css && css.supports && css.supports('transform', 'translate3d(0,0,0)');\n};\n","var min = Math.min, max = Math.max;\nexport function getOffsetBounds(_a) {\n var containerDimension = _a.containerDimension, childDimension = _a.childDimension, padding = _a.padding, centerContained = _a.centerContained;\n var diff = childDimension - containerDimension;\n if (diff + 2 * padding <= 0 && centerContained) {\n return [diff / 2, diff / 2];\n }\n else {\n return [min(diff + padding, 0) - padding, max(0, diff + padding)];\n }\n}\n","import { __assign, __extends } from \"tslib\";\nimport React, { Component, createRef, Children, cloneElement } from 'react';\nimport { styleRoot, styleChild, styles } from './styles.css';\nimport { isTouch } from '../utils';\nimport { getOffsetBounds } from './getOffsetBounds';\nvar classnames = function (base, other) {\n return other ? \"\".concat(base, \" \").concat(other) : base;\n};\nvar abs = Math.abs, min = Math.min, sqrt = Math.sqrt;\nvar isSsr = typeof window === 'undefined';\nvar isMac = isSsr ? false : /(Mac)/i.test(navigator.platform);\nvar isDragInteraction = function (i) { return i === 'drag'; };\nvar isZoomInteraction = function (i) { return i === 'zoom'; };\nvar isZoomGesture = function (wheelEvent) { return isMac && wheelEvent.ctrlKey; };\nvar cancelEvent = function (event) {\n event.stopPropagation();\n event.preventDefault();\n};\nvar getDistance = function (a, b) {\n var x = a.x - b.x;\n var y = a.y - b.y;\n return sqrt(x * x + y * y);\n};\nvar calculateScale = function (startTouches, endTouches) {\n var startDistance = getDistance(startTouches[0], startTouches[1]);\n var endDistance = getDistance(endTouches[0], endTouches[1]);\n return endDistance / startDistance;\n};\nvar isCloseTo = function (value, expected) {\n return value > expected - 0.01 && value < expected + 0.01;\n};\nvar swing = function (p) { return -Math.cos(p * Math.PI) / 2 + 0.5; };\nvar getPointByPageCoordinates = function (touch) { return ({\n x: touch.pageX,\n y: touch.pageY,\n}); };\nvar getPageCoordinatesByTouches = function (touches) {\n return Array.from(touches).map(getPointByPageCoordinates);\n};\nvar sum = function (a, b) { return a + b; };\nvar getVectorAvg = function (vectors) { return ({\n x: vectors.map(function (_a) {\n var x = _a.x;\n return x;\n }).reduce(sum, 0) / vectors.length,\n y: vectors.map(function (_a) {\n var y = _a.y;\n return y;\n }).reduce(sum, 0) / vectors.length,\n}); };\nvar clamp = function (min, max, value) {\n return value < min ? min : value > max ? max : value;\n};\nvar shouldInterceptWheel = function (event) {\n return !(event.ctrlKey || event.metaKey);\n};\nvar getElementSize = function (element) {\n if (element) {\n var offsetWidth = element.offsetWidth, offsetHeight = element.offsetHeight;\n // Any DOMElement\n if (offsetWidth && offsetHeight) {\n return { width: offsetWidth, height: offsetHeight };\n }\n // Svg support\n var style = getComputedStyle(element);\n var width = parseFloat(style.width);\n var height = parseFloat(style.height);\n if (height && width) {\n return { width: width, height: height };\n }\n }\n return { width: 0, height: 0 };\n};\nvar calculateVelocity = function (startPoint, endPoint) { return ({\n x: endPoint.x - startPoint.x,\n y: endPoint.y - startPoint.y,\n}); };\nvar comparePoints = function (p1, p2) { return p1.x === p2.x && p1.y === p2.y; };\nvar noup = function () { };\nvar zeroPoint = { x: 0, y: 0 };\nvar PinchZoom = /** @class */ (function (_super) {\n __extends(PinchZoom, _super);\n function PinchZoom() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._prevDragMovePoint = null;\n _this._containerObserver = null;\n _this._fingers = 0;\n _this._firstMove = true;\n _this._initialOffset = __assign({}, zeroPoint);\n _this._interaction = null;\n _this._isDoubleTap = false;\n _this._isOffsetsSet = false;\n _this._lastDragPosition = null;\n _this._lastScale = 1;\n _this._lastTouchStart = 0;\n _this._lastZoomCenter = null;\n _this._listenMouseMove = false;\n _this._nthZoom = 0;\n _this._offset = __assign({}, zeroPoint);\n _this._startOffset = __assign({}, zeroPoint);\n _this._startTouches = null;\n _this._updatePlaned = false;\n _this._wheelTimeOut = null;\n _this._zoomFactor = 1;\n _this._initialZoomFactor = 1;\n _this._draggingPoint = __assign({}, zeroPoint);\n // It help reduce behavior difference between touch and mouse events\n _this._ignoreNextClick = false;\n // @ts-ignore\n _this._containerRef = createRef();\n _this._handleClick = function (clickEvent) {\n if (_this._ignoreNextClick) {\n _this._ignoreNextClick = false;\n clickEvent.stopPropagation();\n }\n };\n _this._onResize = function () {\n var _a;\n if ((_a = _this._containerRef) === null || _a === void 0 ? void 0 : _a.current) {\n _this._updateInitialZoomFactor();\n _this._setupOffsets();\n _this._update();\n }\n };\n _this._handlerOnTouchEnd = _this._handlerIfEnable(function (touchEndEvent) {\n _this._fingers = touchEndEvent.touches.length;\n if (_this.props.shouldCancelHandledTouchEndEvents &&\n (isZoomInteraction(_this._interaction) ||\n (isDragInteraction(_this._interaction) &&\n (_this._startOffset.x !== _this._offset.x ||\n _this._startOffset.y !== _this._offset.y)))) {\n cancelEvent(touchEndEvent);\n }\n if (isDragInteraction(_this._interaction) && !_this._enoughToDrag()) {\n _this._handleClick(touchEndEvent);\n }\n _this._updateInteraction(touchEndEvent);\n });\n _this._handlerOnTouchStart = _this._handlerIfEnable(function (touchStartEvent) {\n _this._firstMove = true;\n _this._fingers = touchStartEvent.touches.length;\n _this._detectDoubleTap(touchStartEvent);\n });\n _this._handlerOnTouchMove = _this._handlerIfEnable(function (touchMoveEvent) {\n if (_this._isDoubleTap) {\n return;\n }\n _this._collectInertia(touchMoveEvent);\n if (_this._firstMove) {\n _this._updateInteraction(touchMoveEvent);\n if (_this._interaction) {\n cancelEvent(touchMoveEvent);\n }\n _this._startOffset = __assign({}, _this._offset);\n _this._startTouches = getPageCoordinatesByTouches(touchMoveEvent.touches);\n }\n else {\n if (isZoomInteraction(_this._interaction)) {\n if (_this._startTouches &&\n _this._startTouches.length === 2 &&\n touchMoveEvent.touches.length === 2) {\n _this._handleZoom(touchMoveEvent, calculateScale(_this._startTouches, getPageCoordinatesByTouches(touchMoveEvent.touches)));\n }\n }\n else if (isDragInteraction(_this._interaction)) {\n _this._handleDrag(touchMoveEvent);\n }\n if (_this._interaction) {\n cancelEvent(touchMoveEvent);\n _this._update();\n }\n }\n _this._firstMove = false;\n });\n _this._handlerWheel = function (wheelEvent) {\n if (_this.props.shouldInterceptWheel(wheelEvent)) {\n return;\n }\n cancelEvent(wheelEvent);\n var pageX = wheelEvent.pageX, pageY = wheelEvent.pageY, deltaY = wheelEvent.deltaY, deltaMode = wheelEvent.deltaMode;\n var scaleDelta = 1;\n if (isZoomGesture(wheelEvent) || deltaMode === 1) {\n scaleDelta = 15;\n }\n var likeTouchEvent = {\n touches: [\n // @ts-ignore\n { pageX: pageX, pageY: pageY },\n ],\n };\n var center = _this._getOffsetByFirstTouch(likeTouchEvent);\n var dScale = deltaY * scaleDelta;\n _this._stopAnimation();\n _this._scaleTo(_this._zoomFactor - dScale / _this.props.wheelScaleFactor, center);\n _this._update();\n clearTimeout(\n // @ts-ignore\n _this._wheelTimeOut);\n _this._wheelTimeOut = setTimeout(function () { return _this._sanitize(); }, 100);\n };\n // @ts-ignore\n _this._handlers = _this.props.isTouch()\n ? [\n ['touchstart', _this._handlerOnTouchStart],\n ['touchend', _this._handlerOnTouchEnd],\n ['touchmove', _this._handlerOnTouchMove],\n ]\n : [\n [\n 'mousemove',\n _this.simulate(_this._handlerOnTouchMove),\n _this.props._document,\n ],\n [\n 'mouseup',\n _this.simulate(_this._handlerOnTouchEnd),\n _this.props._document,\n ],\n ['mousedown', _this.simulate(_this._handlerOnTouchStart)],\n ['click', _this._handleClick],\n ['wheel', _this._handlerWheel],\n ];\n return _this;\n }\n PinchZoom.prototype._handleDragStart = function (event) {\n this._ignoreNextClick = true;\n this.props.onDragStart();\n this._stopAnimation();\n this._resetInertia();\n this._lastDragPosition = null;\n this._hasInteraction = true;\n this._draggingPoint = this._offset;\n this._handleDrag(event);\n };\n PinchZoom.prototype._handleDrag = function (event) {\n var touch = this._getOffsetByFirstTouch(event);\n if (this._enoughToDrag()) {\n this._drag(touch, this._lastDragPosition);\n }\n else {\n this._virtualDrag(touch, this._lastDragPosition);\n }\n this._offset = this._sanitizeOffset(this._offset);\n this._lastDragPosition = touch;\n };\n PinchZoom.prototype._resetInertia = function () {\n this._velocity = null;\n this._prevDragMovePoint = null;\n };\n PinchZoom.prototype._realizeInertia = function () {\n var _this = this;\n var _a = this.props, inertiaFriction = _a.inertiaFriction, inertia = _a.inertia;\n if (!inertia || !this._velocity) {\n return;\n }\n var _b = this._velocity, x = _b.x, y = _b.y;\n if (x || y) {\n this._stopAnimation();\n this._resetInertia();\n var renderFrame = function () {\n x *= inertiaFriction;\n y *= inertiaFriction;\n if (!x && !y) {\n return _this._stopAnimation();\n }\n var prevOffset = __assign({}, _this._offset);\n _this._addOffset({ x: x, y: y });\n _this._offset = _this._sanitizeOffset(_this._offset);\n if (comparePoints(prevOffset, _this._offset)) {\n return _this._stopAnimation();\n }\n _this._update({ isAnimation: true });\n };\n this._animate(renderFrame, { duration: 9999 });\n }\n };\n PinchZoom.prototype._collectInertia = function (_a) {\n var touches = _a.touches;\n if (!this.props.inertia) {\n return;\n }\n var currentCoordinates = getPageCoordinatesByTouches(touches)[0];\n var prevPoint = this._prevDragMovePoint;\n if (prevPoint) {\n this._velocity = calculateVelocity(currentCoordinates, prevPoint);\n }\n this._prevDragMovePoint = currentCoordinates;\n };\n PinchZoom.prototype._handleDragEnd = function () {\n this.props.onDragEnd();\n this._end();\n this._realizeInertia();\n };\n PinchZoom.prototype._handleZoomStart = function () {\n this.props.onZoomStart();\n this._stopAnimation();\n this._lastScale = 1;\n this._nthZoom = 0;\n this._lastZoomCenter = null;\n this._hasInteraction = true;\n };\n PinchZoom.prototype._handleZoom = function (event, newScale) {\n var touchCenter = getVectorAvg(this._getOffsetTouches(event));\n var scale = newScale / this._lastScale;\n this._lastScale = newScale;\n // The first touch events are thrown away since they are not precise\n this._nthZoom += 1;\n if (this._nthZoom > 3) {\n this._scale(scale, touchCenter);\n this._drag(touchCenter, this._lastZoomCenter);\n if (this.props.enforceBoundsDuringZoom) {\n this._offset = this._sanitizeOffset(this._offset);\n }\n }\n this._lastZoomCenter = touchCenter;\n };\n PinchZoom.prototype._handleZoomEnd = function () {\n this.props.onZoomEnd();\n this._end();\n };\n PinchZoom.prototype._handleDoubleTap = function (event) {\n var _this = this;\n if (this._hasInteraction || this.props.tapZoomFactor === 0) {\n return;\n }\n var needZoomOut = (this.props.doubleTapZoomOutOnMaxScale &&\n this._zoomFactor === this.props.maxZoom) ||\n (this.props.doubleTapToggleZoom && this._zoomFactor > 1);\n this.props.onDoubleTap();\n this._ignoreNextClick = true;\n var zoomFactor = this._zoomFactor + this.props.tapZoomFactor;\n var startZoomFactor = this._zoomFactor;\n var updateProgress = function (progress) {\n _this._scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);\n };\n var center = this._getOffsetByFirstTouch(event);\n this._isDoubleTap = true;\n if (startZoomFactor > zoomFactor) {\n center = this._getCurrentZoomCenter();\n }\n needZoomOut ? this._zoomOutAnimation() : this._animate(updateProgress);\n };\n PinchZoom.prototype._computeInitialOffset = function () {\n var rect = this._getContainerRect();\n var _a = this._getChildSize(), width = _a.width, height = _a.height;\n var x = -abs(width * this._getInitialZoomFactor() - rect.width) / 2;\n var y = -abs(height * this._getInitialZoomFactor() - rect.height) / 2;\n this._initialOffset = { x: x, y: y };\n };\n PinchZoom.prototype._resetOffset = function () {\n this._offset = __assign({}, this._initialOffset);\n };\n PinchZoom.prototype._setupOffsets = function () {\n if (this.props.setOffsetsOnce && this._isOffsetsSet) {\n return;\n }\n this._isOffsetsSet = true;\n this._computeInitialOffset();\n this._resetOffset();\n };\n PinchZoom.prototype._sanitizeOffset = function (offset) {\n var rect = this._getContainerRect();\n var _a = this._getChildSize(), width = _a.width, height = _a.height;\n var elWidth = width * this._getInitialZoomFactor() * this._zoomFactor;\n var elHeight = height * this._getInitialZoomFactor() * this._zoomFactor;\n var _b = getOffsetBounds({\n containerDimension: rect.width,\n childDimension: elWidth,\n padding: this.props.horizontalPadding,\n centerContained: this.props.centerContained,\n }), minOffsetX = _b[0], maxOffsetX = _b[1];\n var _c = getOffsetBounds({\n containerDimension: rect.height,\n childDimension: elHeight,\n padding: this.props.verticalPadding,\n centerContained: this.props.centerContained,\n }), minOffsetY = _c[0], maxOffsetY = _c[1];\n return {\n x: clamp(minOffsetX, maxOffsetX, offset.x),\n y: clamp(minOffsetY, maxOffsetY, offset.y),\n };\n };\n PinchZoom.prototype.alignCenter = function (options) {\n var _this = this;\n var _a = __assign({ duration: 250, animated: true }, options), __x = _a.x, __y = _a.y, scale = _a.scale, animated = _a.animated, duration = _a.duration;\n // Bug-Fix: https://github.com/retyui/react-quick-pinch-zoom/issues/58\n var x = __x * this._initialZoomFactor;\n var y = __y * this._initialZoomFactor;\n var startZoomFactor = this._zoomFactor;\n var startOffset = __assign({}, this._offset);\n var rect = this._getContainerRect();\n var containerCenter = { x: rect.width / 2, y: rect.height / 2 };\n this._zoomFactor = 1;\n this._offset = { x: -(containerCenter.x - x), y: -(containerCenter.y - y) };\n this._scaleTo(scale, containerCenter);\n this._stopAnimation();\n if (!animated) {\n return this._update();\n }\n var diffZoomFactor = this._zoomFactor - startZoomFactor;\n var diffOffset = {\n x: this._offset.x - startOffset.x,\n y: this._offset.y - startOffset.y,\n };\n this._zoomFactor = startZoomFactor;\n this._offset = __assign({}, startOffset);\n var updateFrame = function (progress) {\n var x = startOffset.x + diffOffset.x * progress;\n var y = startOffset.y + diffOffset.y * progress;\n _this._zoomFactor = startZoomFactor + diffZoomFactor * progress;\n _this._offset = _this._sanitizeOffset({ x: x, y: y });\n _this._update();\n };\n this._animate(updateFrame, {\n callback: function () { return _this._sanitize(); },\n duration: duration,\n });\n };\n PinchZoom.prototype.scaleTo = function (options) {\n var _this = this;\n var _a = __assign({ duration: 250, animated: true }, options), x = _a.x, y = _a.y, scale = _a.scale, animated = _a.animated, duration = _a.duration;\n var startZoomFactor = this._zoomFactor;\n var startOffset = __assign({}, this._offset);\n this._zoomFactor = 1;\n this._offset = { x: 0, y: 0 };\n this._scaleTo(scale, { x: x, y: y });\n this._stopAnimation();\n if (!animated) {\n return this._update();\n }\n var diffZoomFactor = this._zoomFactor - startZoomFactor;\n var diffOffset = {\n x: this._offset.x - startOffset.x,\n y: this._offset.y - startOffset.y,\n };\n this._zoomFactor = startZoomFactor;\n this._offset = __assign({}, startOffset);\n var updateFrame = function (progress) {\n var x = startOffset.x + diffOffset.x * progress;\n var y = startOffset.y + diffOffset.y * progress;\n _this._zoomFactor = startZoomFactor + diffZoomFactor * progress;\n _this._offset = { x: x, y: y };\n _this._update();\n };\n this._animate(updateFrame, { callback: function () { return _this._sanitize(); }, duration: duration });\n };\n PinchZoom.prototype._scaleTo = function (zoomFactor, center) {\n this._scale(zoomFactor / this._zoomFactor, center);\n this._offset = this._sanitizeOffset(this._offset);\n };\n PinchZoom.prototype._scale = function (scale, center) {\n scale = this._scaleZoomFactor(scale);\n this._addOffset({\n x: (scale - 1) * (center.x + this._offset.x),\n y: (scale - 1) * (center.y + this._offset.y),\n });\n this.props.onZoomUpdate();\n };\n PinchZoom.prototype._scaleZoomFactor = function (scale) {\n var originalZoomFactor = this._zoomFactor;\n this._zoomFactor *= scale;\n this._zoomFactor = clamp(this.props.minZoom, this.props.maxZoom, this._zoomFactor);\n return this._zoomFactor / originalZoomFactor;\n };\n PinchZoom.prototype._canDrag = function () {\n return this.props.draggableUnZoomed || !isCloseTo(this._zoomFactor, 1);\n };\n PinchZoom.prototype._drag = function (center, lastCenter) {\n if (lastCenter) {\n var y = -(center.y - lastCenter.y);\n var x = -(center.x - lastCenter.x);\n if (!this.props.lockDragAxis) {\n this._addOffset({\n x: x,\n y: y,\n });\n }\n else {\n // lock scroll to position that was changed the most\n if (abs(x) > abs(y)) {\n this._addOffset({\n x: x,\n y: 0,\n });\n }\n else {\n this._addOffset({\n y: y,\n x: 0,\n });\n }\n }\n this.props.onDragUpdate();\n }\n };\n PinchZoom.prototype._virtualDrag = function (center, lastCenter) {\n if (lastCenter) {\n var y = -(center.y - lastCenter.y);\n var x = -(center.x - lastCenter.x);\n this._draggingPoint = {\n x: x + this._draggingPoint.x,\n y: y + this._draggingPoint.y,\n };\n }\n };\n PinchZoom.prototype._addOffset = function (offset) {\n var _a = this._offset, x = _a.x, y = _a.y;\n this._offset = {\n x: x + offset.x,\n y: y + offset.y,\n };\n };\n PinchZoom.prototype._sanitize = function () {\n if (this._zoomFactor < this.props.zoomOutFactor) {\n this._resetInertia();\n this._zoomOutAnimation();\n }\n else if (this._isInsaneOffset()) {\n this._sanitizeOffsetAnimation();\n }\n };\n PinchZoom.prototype._isInsaneOffset = function () {\n var offset = this._offset;\n var sanitizedOffset = this._sanitizeOffset(offset);\n return sanitizedOffset.x !== offset.x || sanitizedOffset.y !== offset.y;\n };\n PinchZoom.prototype._sanitizeOffsetAnimation = function () {\n var _this = this;\n var targetOffset = this._sanitizeOffset(this._offset);\n var startOffset = __assign({}, this._offset);\n var updateProgress = function (progress) {\n var x = startOffset.x + progress * (targetOffset.x - startOffset.x);\n var y = startOffset.y + progress * (targetOffset.y - startOffset.y);\n _this._offset = { x: x, y: y };\n _this._update();\n };\n this._animate(updateProgress);\n };\n PinchZoom.prototype._zoomOutAnimation = function () {\n var _this = this;\n if (this._zoomFactor === 1) {\n return;\n }\n var startZoomFactor = this._zoomFactor;\n var zoomFactor = 1;\n var center = this._getCurrentZoomCenter();\n var updateProgress = function (progress) {\n var scaleFactor = startZoomFactor + progress * (zoomFactor - startZoomFactor);\n _this._scaleTo(scaleFactor, center);\n };\n this._animate(updateProgress);\n };\n PinchZoom.prototype._getInitialZoomFactor = function () {\n return this._initialZoomFactor;\n };\n PinchZoom.prototype._getCurrentZoomCenter = function () {\n var _a = this._offset, x = _a.x, y = _a.y;\n var offsetLeft = x - this._initialOffset.x;\n var offsetTop = y - this._initialOffset.y;\n return {\n x: -1 * x - offsetLeft / (1 / this._zoomFactor - 1),\n y: -1 * y - offsetTop / (1 / this._zoomFactor - 1),\n };\n };\n PinchZoom.prototype._getOffsetByFirstTouch = function (event) {\n return this._getOffsetTouches(event)[0];\n };\n PinchZoom.prototype._getOffsetTouches = function (event) {\n var _document = this.props._document;\n var _html = _document.documentElement;\n var _body = _document.body;\n var _a = this._getContainerRect(), top = _a.top, left = _a.left;\n var scrollTop = _html.scrollTop || _body.scrollTop;\n var scrollLeft = _html.scrollLeft || _body.scrollLeft;\n var posTop = top + scrollTop;\n var posLeft = left + scrollLeft;\n return getPageCoordinatesByTouches(event.touches).map(function (_a) {\n var x = _a.x, y = _a.y;\n return ({\n x: x - posLeft,\n y: y - posTop,\n });\n });\n };\n PinchZoom.prototype._animate = function (frameFn, options) {\n var _this = this;\n var startTime = new Date().getTime();\n var _a = __assign({ timeFn: swing, callback: function () { }, duration: this.props.animationDuration }, options), timeFn = _a.timeFn, callback = _a.callback, duration = _a.duration;\n var renderFrame = function () {\n if (!_this._inAnimation) {\n return;\n }\n var frameTime = new Date().getTime() - startTime;\n var progress = frameTime / duration;\n if (frameTime >= duration) {\n frameFn(1);\n _this._stopAnimation();\n callback();\n _this._update();\n }\n else {\n progress = timeFn(progress);\n frameFn(progress);\n _this._update({ isAnimation: true });\n requestAnimationFrame(renderFrame);\n }\n };\n this._inAnimation = true;\n requestAnimationFrame(renderFrame);\n };\n PinchZoom.prototype._stopAnimation = function () {\n this._inAnimation = false;\n };\n PinchZoom.prototype._end = function () {\n this._hasInteraction = false;\n this._sanitize();\n this._update();\n };\n PinchZoom.prototype._getContainerRect = function () {\n var div = this._containerRef.current;\n return div.getBoundingClientRect();\n };\n PinchZoom.prototype._getChildSize = function () {\n var div = this._containerRef.current;\n return getElementSize(div === null || div === void 0 ? void 0 : div.firstElementChild);\n };\n PinchZoom.prototype._updateInitialZoomFactor = function () {\n var rect = this._getContainerRect();\n var size = this._getChildSize();\n var xZoomFactor = rect.width / size.width;\n var yZoomFactor = rect.height / size.height;\n this._initialZoomFactor = min(xZoomFactor, yZoomFactor);\n };\n PinchZoom.prototype._bindEvents = function () {\n var _this = this;\n var div = this._containerRef.current;\n if (window.ResizeObserver) {\n this._containerObserver = new ResizeObserver(this._onResize);\n this._containerObserver.observe(div);\n }\n else {\n window.addEventListener('resize', this._onResize);\n }\n this._handlers.forEach(function (_a) {\n var eventName = _a[0], fn = _a[1], target = _a[2];\n (target || div).addEventListener(eventName, fn, true);\n });\n Array.from(div.querySelectorAll('img')).forEach(function (img) {\n return img.addEventListener('load', _this._onResize);\n });\n };\n PinchZoom.prototype._unSubscribe = function () {\n var _this = this;\n var div = this._containerRef.current;\n if (this._containerObserver) {\n this._containerObserver.disconnect();\n this._containerObserver = null;\n }\n window.removeEventListener('resize', this._onResize);\n this._handlers.forEach(function (_a) {\n var eventName = _a[0], fn = _a[1], target = _a[2];\n (target || div).removeEventListener(eventName, fn, true);\n });\n Array.from(div.querySelectorAll('img')).forEach(function (img) {\n return img.removeEventListener('load', _this._onResize);\n });\n };\n PinchZoom.prototype._update = function (options) {\n var _this = this;\n if (this._updatePlaned) {\n return;\n }\n var updateFrame = function () {\n var scale = _this._getInitialZoomFactor() * _this._zoomFactor;\n var x = -_this._offset.x / scale;\n var y = -_this._offset.y / scale;\n _this.props.onUpdate({ scale: scale, x: x, y: y });\n };\n if (options === null || options === void 0 ? void 0 : options.isAnimation) {\n return updateFrame();\n }\n this._updatePlaned = true;\n requestAnimationFrame(function () {\n _this._updatePlaned = false;\n updateFrame();\n });\n };\n PinchZoom.prototype._handlerIfEnable = function (fn) {\n var _this = this;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (_this.props.enabled) {\n fn.apply(void 0, args);\n }\n };\n };\n PinchZoom.prototype._setInteraction = function (newInteraction, event) {\n var interaction = this._interaction;\n if (interaction !== newInteraction) {\n if (interaction && !newInteraction) {\n if (isZoomInteraction(interaction)) {\n this._handleZoomEnd();\n }\n else if (isDragInteraction(interaction)) {\n this._handleDragEnd();\n }\n }\n if (isZoomInteraction(newInteraction)) {\n this._handleZoomStart();\n }\n else if (isDragInteraction(newInteraction)) {\n this._handleDragStart(event);\n }\n }\n this._interaction = newInteraction;\n };\n PinchZoom.prototype._distanceBetweenNumbers = function (a, b) {\n return a > b ? a - b : b - a;\n };\n PinchZoom.prototype._enoughToDrag = function () {\n if (this._distanceBetweenNumbers(this._startOffset.x, this._draggingPoint.x) >\n 5 ||\n this._distanceBetweenNumbers(this._startOffset.y, this._draggingPoint.y) >\n 5)\n return true;\n return false;\n };\n PinchZoom.prototype._updateInteraction = function (event) {\n var fingers = this._fingers;\n if (fingers === 2) {\n return this._setInteraction('zoom', event);\n }\n if (fingers === 1 && this._canDrag()) {\n return this._setInteraction('drag', event);\n }\n this._setInteraction(null, event);\n };\n PinchZoom.prototype._detectDoubleTap = function (event) {\n var time = new Date().getTime();\n if (this._fingers > 1) {\n this._lastTouchStart = 0;\n }\n if (time - this._lastTouchStart < 300) {\n cancelEvent(event);\n this._handleDoubleTap(event);\n if (isZoomInteraction(this._interaction)) {\n this._handleZoomEnd();\n }\n else if (isDragInteraction(this._interaction)) {\n this._handleDragEnd();\n }\n }\n else {\n this._isDoubleTap = false;\n }\n if (this._fingers === 1) {\n this._lastTouchStart = time;\n }\n };\n PinchZoom.prototype.simulate = function (fn) {\n var _this = this;\n return function (mouseEvent) {\n var pageX = mouseEvent.pageX, pageY = mouseEvent.pageY, type = mouseEvent.type;\n var isEnd = type === 'mouseup';\n var isStart = type === 'mousedown';\n if (isStart) {\n mouseEvent.preventDefault();\n _this._listenMouseMove = true;\n }\n if (_this._listenMouseMove) {\n // @ts-ignore\n mouseEvent.touches = isEnd ? [] : [{ pageX: pageX, pageY: pageY }];\n fn(\n // @ts-ignore\n mouseEvent);\n }\n if (isEnd) {\n _this._listenMouseMove = false;\n }\n };\n };\n PinchZoom.prototype.componentDidMount = function () {\n this._bindEvents();\n this._update();\n };\n PinchZoom.prototype.componentWillUnmount = function () {\n this._stopAnimation();\n this._unSubscribe();\n };\n PinchZoom.prototype.render = function () {\n var _a = this.props, children = _a.children, containerProps = _a.containerProps;\n var child = Children.only(children);\n var props = containerProps || {};\n return (React.createElement(React.Fragment, null,\n React.createElement(\"style\", null, styles),\n React.createElement(\"div\", __assign({}, props, { ref: this._containerRef, className: classnames(styleRoot, props.className) }), cloneElement(child, {\n className: classnames(styleChild, child.props.className),\n }))));\n };\n PinchZoom.defaultProps = {\n animationDuration: 250,\n draggableUnZoomed: true,\n enforceBoundsDuringZoom: false,\n centerContained: false,\n enabled: true,\n inertia: true,\n inertiaFriction: 0.96,\n horizontalPadding: 0,\n isTouch: isTouch,\n lockDragAxis: false,\n maxZoom: 5,\n minZoom: 0.5,\n onDoubleTap: noup,\n onDragEnd: noup,\n onDragStart: noup,\n onDragUpdate: noup,\n onZoomEnd: noup,\n onZoomStart: noup,\n onZoomUpdate: noup,\n setOffsetsOnce: false,\n shouldInterceptWheel: shouldInterceptWheel,\n shouldCancelHandledTouchEndEvents: false,\n tapZoomFactor: 1,\n verticalPadding: 0,\n wheelScaleFactor: 1500,\n zoomOutFactor: 1.3,\n doubleTapZoomOutOnMaxScale: false,\n doubleTapToggleZoom: false,\n // @ts-expect-error\n _document: isSsr ? null : window.document,\n };\n return PinchZoom;\n}(Component));\nif (process.env.NODE_ENV !== 'production') {\n var _a = require('prop-types'), any = _a.any, element = _a.element, object = _a.object, number = _a.number, func = _a.func, bool = _a.bool;\n // @ts-ignore\n PinchZoom.propTypes = {\n children: element,\n containerProps: object,\n wheelScaleFactor: number,\n animationDuration: number,\n draggableUnZoomed: bool,\n enforceBoundsDuringZoom: bool,\n centerContained: bool,\n enabled: bool,\n horizontalPadding: number,\n lockDragAxis: bool,\n onUpdate: func.isRequired,\n maxZoom: number,\n minZoom: number,\n onDoubleTap: func,\n onDragEnd: func,\n onDragStart: func,\n onDragUpdate: func,\n onZoomEnd: func,\n onZoomStart: func,\n onZoomUpdate: func,\n setOffsetsOnce: bool,\n tapZoomFactor: number,\n verticalPadding: number,\n zoomOutFactor: number,\n doubleTapZoomOutOnMaxScale: bool,\n doubleTapToggleZoom: bool,\n isTouch: func,\n _document: any,\n };\n}\nexport default PinchZoom;\n","export default function formatDuration(time) {\n if (!time) return;\n let hours = Math.floor(time / 3600);\n let minutes = Math.floor((time % 3600) / 60);\n let seconds = Math.round(time % 60);\n\n if (hours === 0) {\n return `${minutes}:${seconds.toString().padStart(2, '0')}`;\n } else {\n return `${hours}:${minutes.toString().padStart(2, '0')}:${seconds\n .toString()\n .padStart(2, '0')}`;\n }\n}\n","import { useLingui } from '@lingui/react/macro';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\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 formatDuration from '../utils/format-duration';\nimport mem from '../utils/mem';\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Link from './link';\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 { t } = useLingui();\n const { alt, lang, index, ...rest } = props;\n if (!alt || !alt.trim()) return null;\n return (\n <button\n type=\"button\"\n class=\"alt-badge clickable\"\n {...rest}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n states.showMediaAlt = {\n alt,\n lang,\n };\n }}\n title={t`Media description`}\n >\n {dataAltLabel}\n {!!index && <sup>{index}</sup>}\n </button>\n );\n};\n\nconst MEDIA_CAPTION_LIMIT = 140;\nconst MEDIA_CAPTION_LIMIT_LONGER = 280;\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 allowLongerCaption,\n altIndex,\n checkAspectRatio = true,\n onClick = () => {},\n}) {\n let {\n blurhash,\n description,\n meta,\n previewRemoteUrl,\n previewUrl,\n remoteUrl,\n url,\n type,\n } = media;\n if (/no\\-preview\\./i.test(previewUrl)) {\n previewUrl = null;\n }\n const { original = {}, small, focus } = meta || {};\n\n const width = showOriginal\n ? original?.width\n : small?.width || original?.width;\n const height = showOriginal\n ? original?.height\n : small?.height || original?.height;\n const mediaURL = showOriginal ? url : previewUrl || url;\n const remoteMediaURL = showOriginal\n ? remoteUrl\n : previewRemoteUrl || remoteUrl;\n const hasDimensions = width && height;\n const orientation = hasDimensions\n ? width > height\n ? 'landscape'\n : 'portrait'\n : null;\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 tapZoomFactor: 2,\n doubleTapToggleZoom: 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) => <Link to={to} {...props} /> : 'div'),\n [to],\n );\n\n const remoteMediaURLObj = remoteMediaURL ? getURLObj(remoteMediaURL) : null;\n const isVideoMaybe =\n type === 'unknown' &&\n remoteMediaURLObj &&\n /\\.(mp4|m4r|m4v|mov|webm)$/i.test(remoteMediaURLObj.pathname);\n const isAudioMaybe =\n type === 'unknown' &&\n remoteMediaURLObj &&\n /\\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(remoteMediaURLObj.pathname);\n const isImage =\n type === 'image' ||\n (type === 'unknown' && previewUrl && !isVideoMaybe && !isAudioMaybe);\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 let showInlineDesc =\n !!showCaption && !showOriginal && !!description && !longDesc;\n if (\n allowLongerCaption &&\n !showInlineDesc &&\n description?.length <= MEDIA_CAPTION_LIMIT_LONGER\n ) {\n showInlineDesc = true;\n }\n const Figure = !showInlineDesc\n ? Fragment\n : (props) => {\n const { children, ...restProps } = props;\n return (\n <figure {...restProps}>\n {children}\n <figcaption\n class=\"media-caption\"\n lang={lang}\n dir=\"auto\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: description,\n lang,\n };\n }}\n >\n {description}\n </figcaption>\n </figure>\n );\n };\n\n const [hasNaturalAspectRatio, setHasNaturalAspectRatio] = useState(undefined);\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 <Figure>\n <Parent\n ref={parentRef}\n class={`media media-image ${className}`}\n onClick={onClick}\n data-orientation={orientation}\n data-has-alt={!showInlineDesc || undefined}\n data-has-natural-aspect-ratio={hasNaturalAspectRatio || undefined}\n style={\n showOriginal\n ? {\n backgroundImage: `url(${previewUrl})`,\n backgroundSize: imageSmallerThanParent\n ? `${width}px ${height}px`\n : undefined,\n ...averageColorStyle,\n }\n : mediaStyles\n }\n >\n {showOriginal ? (\n <QuickPinchZoom {...quickPinchZoomProps}>\n <img\n ref={mediaRef}\n src={mediaURL}\n alt={description}\n width={width}\n height={height}\n data-orientation={orientation}\n loading=\"eager\"\n decoding=\"sync\"\n onLoad={(e) => {\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 (\n src === mediaURL &&\n remoteMediaURL &&\n mediaURL !== remoteMediaURL\n ) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n </QuickPinchZoom>\n ) : (\n <>\n <img\n src={mediaURL}\n alt={showInlineDesc ? '' : description}\n width={width}\n height={height}\n data-orientation={orientation}\n loading=\"lazy\"\n style={{\n // backgroundColor:\n // rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n // backgroundPosition: focalBackgroundPosition || 'center',\n // Duration based on width or height in pixels\n objectPosition: focalPosition || 'center',\n // 100px per second (rough estimate)\n // Clamp between 5s and 120s\n '--anim-duration': `${Math.min(\n Math.max(Math.max(width, height) / 100, 5),\n 120,\n )}s`,\n }}\n onLoad={(e) => {\n // e.target.closest('.media-image').style.backgroundImage = '';\n e.target.dataset.loaded = true;\n const $media = e.target.closest('.media');\n if (!hasDimensions && $media) {\n const { naturalWidth, naturalHeight } = e.target;\n $media.dataset.orientation =\n naturalWidth > naturalHeight ? 'landscape' : 'portrait';\n $media.style.setProperty('--width', `${naturalWidth}px`);\n $media.style.setProperty('--height', `${naturalHeight}px`);\n $media.style.aspectRatio = `${naturalWidth}/${naturalHeight}`;\n }\n\n // Check natural aspect ratio vs display aspect ratio\n if (checkAspectRatio && $media) {\n const {\n clientWidth,\n clientHeight,\n naturalWidth,\n naturalHeight,\n } = e.target;\n if (\n clientWidth &&\n clientHeight &&\n naturalWidth &&\n naturalHeight\n ) {\n const minDimension = 88;\n if (\n naturalWidth < minDimension ||\n naturalHeight < minDimension\n ) {\n $media.dataset.hasSmallDimension = true;\n } else {\n const displayNaturalHeight =\n (naturalHeight * clientWidth) / naturalWidth;\n const almostSimilarHeight =\n Math.abs(displayNaturalHeight - clientHeight) < 5;\n\n if (almostSimilarHeight) {\n setHasNaturalAspectRatio(true);\n }\n }\n }\n }\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 <AltBadge alt={description} lang={lang} index={altIndex} />\n )}\n </>\n )}\n </Parent>\n </Figure>\n );\n } else if (type === 'gifv' || type === 'video' || isVideoMaybe) {\n const hasDuration = original.duration > 0;\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 // This string is only for autoplay + muted to work on Mobile Safari\n const gifHTML = `\n <video\n src=\"${url}\"\n poster=\"${previewUrl}\"\n width=\"${width}\"\n height=\"${height}\"\n data-orientation=\"${orientation}\"\n preload=\"auto\"\n autoplay\n muted\n playsinline\n ${loopable ? 'loop' : ''}\n ondblclick=\"this.paused ? this.play() : this.pause()\"\n ${\n showProgress\n ? \"ontimeupdate=\\\"this.closest('.media-gif') && this.closest('.media-gif').style.setProperty('--progress', `${~~((this.currentTime / this.duration) * 100)}%`)\\\"\"\n : ''\n }\n ></video>\n `;\n\n const videoHTML = `\n <video\n src=\"${url}\"\n poster=\"${previewUrl}\"\n width=\"${width}\"\n height=\"${height}\"\n data-orientation=\"${orientation}\"\n preload=\"auto\"\n autoplay\n playsinline\n ${loopable ? 'loop' : ''}\n controls\n ></video>\n `;\n\n return (\n <Figure>\n <Parent\n class={`media ${className} media-${isGIF ? 'gif' : 'video'} ${\n autoGIFAnimate ? 'media-contain' : ''\n } ${hoverAnimate ? 'media-hover-animate' : ''}`}\n data-orientation={orientation}\n data-formatted-duration={\n !showOriginal ? formattedDuration : undefined\n }\n data-label={\n isGIF && !showOriginal && !autoGIFAnimate ? 'GIF' : undefined\n }\n data-has-alt={!showInlineDesc || undefined}\n // style={{\n // backgroundColor:\n // rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n // }}\n style={!showOriginal && mediaStyles}\n onClick={(e) => {\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 <QuickPinchZoom {...quickPinchZoomProps} enabled>\n <div\n ref={mediaRef}\n dangerouslySetInnerHTML={{\n __html: gifHTML,\n }}\n />\n </QuickPinchZoom>\n ) : isGIF ? (\n <div\n class=\"video-container\"\n dangerouslySetInnerHTML={{\n __html: gifHTML,\n }}\n />\n ) : (\n <div\n class=\"video-container\"\n dangerouslySetInnerHTML={{ __html: videoHTML }}\n />\n )\n ) : isGIF ? (\n <video\n ref={videoRef}\n src={url}\n poster={previewUrl}\n width={width}\n height={height}\n data-orientation={orientation}\n preload=\"auto\"\n // controls\n playsinline\n loop\n muted\n onTimeUpdate={\n showProgress\n ? (e) => {\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 {previewUrl ? (\n <img\n src={previewUrl}\n alt={showInlineDesc ? '' : description}\n width={width}\n height={height}\n data-orientation={orientation}\n loading=\"lazy\"\n decoding=\"async\"\n onLoad={(e) => {\n if (!hasDimensions) {\n const $media = e.target.closest('.media');\n if ($media) {\n const { naturalHeight, naturalWidth } = e.target;\n $media.dataset.orientation =\n naturalWidth > naturalHeight\n ? 'landscape'\n : 'portrait';\n $media.style.setProperty(\n '--width',\n `${naturalWidth}px`,\n );\n $media.style.setProperty(\n '--height',\n `${naturalHeight}px`,\n );\n $media.style.aspectRatio = `${naturalWidth}/${naturalHeight}`;\n }\n }\n }}\n />\n ) : (\n <video\n src={url + '#t=0.1'} // Make Safari show 1st-frame preview\n width={width}\n height={height}\n data-orientation={orientation}\n preload=\"metadata\"\n muted\n disablePictureInPicture\n onLoadedMetadata={(e) => {\n if (!hasDuration) {\n const { duration } = e.target;\n if (duration) {\n const formattedDuration = formatDuration(duration);\n const container = e.target.closest('.media-video');\n if (container) {\n container.dataset.formattedDuration =\n formattedDuration;\n }\n }\n }\n }}\n />\n )}\n <div class=\"media-play\">\n <Icon icon=\"play\" size=\"xl\" alt=\"▶\" />\n </div>\n </>\n )}\n {!showOriginal && !showInlineDesc && (\n <AltBadge alt={description} lang={lang} index={altIndex} />\n )}\n </Parent>\n </Figure>\n );\n } else if (type === 'audio' || isAudioMaybe) {\n const formattedDuration = formatDuration(original.duration);\n return (\n <Figure>\n <Parent\n class={`media media-audio ${className}`}\n data-formatted-duration={\n !showOriginal ? formattedDuration : undefined\n }\n data-has-alt={!showInlineDesc || undefined}\n onClick={onClick}\n style={!showOriginal && mediaStyles}\n >\n {showOriginal ? (\n <audio src={remoteUrl || url} preload=\"none\" controls autoPlay />\n ) : previewUrl ? (\n <img\n src={previewUrl}\n alt={showInlineDesc ? '' : description}\n width={width}\n height={height}\n data-orientation={orientation}\n loading=\"lazy\"\n onError={(e) => {\n try {\n // Remove self if broken\n e.target?.remove?.();\n } catch (e) {}\n }}\n />\n ) : null}\n {!showOriginal && (\n <>\n <div class=\"media-play\">\n <Icon icon=\"play\" size=\"xl\" alt=\"▶\" />\n </div>\n {!showInlineDesc && (\n <AltBadge alt={description} lang={lang} index={altIndex} />\n )}\n </>\n )}\n </Parent>\n </Figure>\n );\n }\n}\n\nfunction getURLObj(url) {\n // Fake base URL if url doesn't have https:// prefix\n return URL.parse(url, location.origin);\n}\n\nexport default memo(Media, (oldProps, newProps) => {\n const oldMedia = oldProps.media || {};\n const newMedia = newProps.media || {};\n\n return (\n oldMedia?.id === newMedia?.id &&\n oldMedia.url === newMedia.url &&\n oldProps.to === newProps.to &&\n oldProps.class === newProps.class\n );\n});\n","import './status.css';\nimport '@justinribeiro/lite-youtube';\n\nimport { msg, plural } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/macro';\nimport {\n ControlledMenu,\n Menu,\n MenuDivider,\n MenuHeader,\n MenuItem,\n} from '@szhsin/react-menu';\nimport { decodeBlurHash, getBlurHashAverageColor } from 'fast-blurhash';\nimport { shallowEqual } from 'fast-equals';\nimport prettify from 'html-prettify';\nimport pThrottle from 'p-throttle';\nimport { Fragment } from 'preact';\nimport { forwardRef, memo } from 'preact/compat';\nimport {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\n// import { detectAll } from 'tinyld/light';\nimport { useLongPress } from 'use-long-press';\nimport { useSnapshot } from 'valtio';\n\nimport CustomEmoji from '../components/custom-emoji';\nimport EmojiText from '../components/emoji-text';\nimport LazyShazam from '../components/lazy-shazam';\nimport Loader from '../components/loader';\nimport MenuConfirm from '../components/menu-confirm';\nimport Menu2 from '../components/menu2';\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 isRTL from '../utils/is-rtl';\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 showCompose from '../utils/show-compose';\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 { getCurrentAccountID } from '../utils/store-utils';\nimport supports from '../utils/supports';\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, { 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\nconst throttle = pThrottle({\n limit: 1,\n interval: 1000,\n});\nfunction fetchAccount(id, masto) {\n return masto.v1.accounts.$select(id).fetch();\n}\nconst memFetchAccount = pmem(throttle(fetchAccount));\n\nconst visibilityText = {\n public: msg`Public`,\n local: msg`Local`,\n unlisted: msg`Unlisted`,\n private: msg`Followers only`,\n direct: msg`Private mention`,\n};\n\nconst isIOS =\n window.ontouchstart !== undefined &&\n /iPad|iPhone|iPod/.test(navigator.userAgent);\n\nconst rtf = new Intl.RelativeTimeFormat();\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 forgivingQSA(selectors = [], dom = document) {\n // Run QSA for list of selectors\n // If a selector return invalid selector error, try the next one\n for (const selector of selectors) {\n try {\n return dom.querySelectorAll(selector);\n } catch (e) {}\n }\n return [];\n}\n\nfunction isTranslateble(content) {\n if (!content) return false;\n content = content.trim();\n if (!content) return false;\n const text = getHTMLText(content, {\n preProcess: (dom) => {\n // Remove .mention, pre, code, a:has(.invisible)\n for (const a of forgivingQSA(\n ['.mention, pre, code, a:has(.invisible)', '.mention, pre, code'],\n dom,\n )) {\n a.remove();\n }\n },\n });\n return !!text;\n}\n\nfunction getHTMLTextForDetectLang(content) {\n return getHTMLText(content, {\n preProcess: (dom) => {\n // Remove anything that can skew the language detection\n\n // Remove .mention, .hashtag, pre, code, a:has(.invisible)\n for (const a of forgivingQSA(\n [\n '.mention, .hashtag, pre, code, a:has(.invisible)',\n '.mention, .hashtag, pre, code',\n ],\n dom,\n )) {\n a.remove();\n }\n\n // Remove links that contains text that starts with https?://\n for (const a of dom.querySelectorAll('a')) {\n const text = a.innerText.trim();\n if (text.startsWith('https://') || text.startsWith('http://')) {\n a.remove();\n }\n }\n },\n });\n}\n\nconst HTTP_REGEX = /^http/i;\nconst PostContent =\n /*memo(*/\n ({ post, instance, previewMode }) => {\n const { content, emojis, language, mentions, url } = post;\n\n const divRef = useRef();\n useLayoutEffect(() => {\n if (!divRef.current) return;\n const dom = enhanceContent(content, {\n emojis,\n returnDOM: true,\n });\n // Remove target=\"_blank\" from links\n for (const a of dom.querySelectorAll('a.u-url[target=\"_blank\"]')) {\n if (!HTTP_REGEX.test(a.innerText.trim())) {\n a.removeAttribute('target');\n }\n }\n divRef.current.replaceChildren(dom.cloneNode(true));\n }, [content, emojis.length]);\n\n return (\n <div\n ref={divRef}\n lang={language}\n dir=\"auto\"\n class=\"inner-content\"\n onClick={handleContentLinks({\n mentions,\n instance,\n previewMode,\n statusURL: url,\n })}\n // dangerouslySetInnerHTML={{\n // __html: enhanceContent(content, {\n // emojis,\n // postEnhanceDOM: (dom) => {\n // // Remove target=\"_blank\" from links\n // dom.querySelectorAll('a.u-url[target=\"_blank\"]').forEach((a) => {\n // if (!/http/i.test(a.innerText.trim())) {\n // a.removeAttribute('target');\n // }\n // });\n // },\n // }),\n // }}\n />\n );\n }; /*,\n (oldProps, newProps) => {\n const { post: oldPost } = oldProps;\n const { post: newPost } = newProps;\n return oldPost.content === newPost.content;\n },\n);*/\n\nconst SIZE_CLASS = {\n s: 'small',\n m: 'medium',\n l: 'large',\n};\n\nconst detectLang = pmem(async (text) => {\n const { detectAll } = await import('tinyld/light');\n text = text?.trim();\n\n // Ref: https://github.com/komodojp/tinyld/blob/develop/docs/benchmark.md\n // 500 should be enough for now, also the default max chars for Mastodon\n if (text?.length > 500) {\n return null;\n }\n const langs = detectAll(text);\n const lang = langs[0];\n if (lang?.lang && lang?.accuracy > 0.5) {\n // If > 50% accurate, use it\n // It can be accurate if < 50% but better be safe\n // Though > 50% also can be inaccurate 🤷♂️\n return lang.lang;\n }\n return null;\n});\n\nconst readMoreText = msg`Read more →`;\n\n// All this work just to make sure this only lazy-run once\n// Because first run is slow due to intl-localematcher\nconst DIFFERENT_LANG_CHECK = {};\nconst checkDifferentLanguage = (\n language,\n contentTranslationHideLanguages = [],\n) => {\n if (!language) return false;\n const targetLanguage = getTranslateTargetLanguage(true);\n const different =\n language !== targetLanguage &&\n !localeMatch([language], [targetLanguage]) &&\n !contentTranslationHideLanguages.find(\n (l) => language === l || localeMatch([language], [l]),\n );\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages] = true;\n return different;\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 allowContextMenu,\n showActionsBar,\n showReplyParent,\n mediaFirst,\n}) {\n const { _, t } = useLingui();\n\n if (skeleton) {\n return (\n <div\n class={`status skeleton ${\n mediaFirst ? 'status-media-first small' : ''\n }`}\n >\n {!mediaFirst && <Avatar size=\"xxl\" />}\n <div class=\"container\">\n <div class=\"meta\">\n {(size === 's' || mediaFirst) && <Avatar size=\"m\" />} ███ ████████\n </div>\n <div class=\"content-container\">\n {mediaFirst && <div class=\"media-first-container\" />}\n <div class={`content ${mediaFirst ? 'media-first-content' : ''}`}>\n <p>████ ████████</p>\n </div>\n </div>\n </div>\n </div>\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: _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 pinned,\n // Non-API props\n _deleted,\n _pinned,\n // _filtered,\n // Non-Mastodon\n emojiReactions,\n } = status;\n\n const [languageAutoDetected, setLanguageAutoDetected] = useState(null);\n useEffect(() => {\n if (!content) return;\n if (_language) return;\n if (languageAutoDetected) return;\n let timer;\n timer = setTimeout(async () => {\n let detected = await detectLang(getHTMLTextForDetectLang(content));\n setLanguageAutoDetected(detected);\n }, 1000);\n return () => clearTimeout(timer);\n }, [content, _language]);\n const language = _language || languageAutoDetected;\n\n // if (!mediaAttachments?.length) mediaFirst = false;\n const hasMediaAttachments = !!mediaAttachments?.length;\n if (mediaFirst && hasMediaAttachments) size = 's';\n\n const currentAccount = useMemo(() => {\n return getCurrentAccountID();\n }, []);\n const isSelf = useMemo(() => {\n return currentAccount && currentAccount === accountId;\n }, [accountId, currentAccount]);\n\n const filterContext = useContext(FilterContext);\n const filterInfo =\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 <FilteredStatus\n status={status}\n filterInfo={filterInfo}\n instance={instance}\n containerProps={{\n onMouseEnter: debugHover,\n }}\n showFollowedTags\n quoted={quoted}\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']?.toLowerCase() || '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 <div\n data-state-post-id={sKey}\n class=\"status-group\"\n onMouseEnter={debugHover}\n >\n <div class=\"status-pre-meta\">\n <Icon icon=\"group\" size=\"l\" alt={t`Group`} />{' '}\n <NameText account={status.account} instance={instance} showAvatar />\n </div>\n <Status\n status={statusID ? null : reblog}\n statusID={statusID ? reblog.id : null}\n instance={instance}\n size={size}\n contentTextWeight={contentTextWeight}\n readOnly={readOnly}\n mediaFirst={mediaFirst}\n />\n </div>\n );\n }\n\n return (\n <div\n data-state-post-id={sKey}\n class=\"status-reblog\"\n onMouseEnter={debugHover}\n >\n <div class=\"status-pre-meta\">\n <Icon icon=\"rocket\" size=\"l\" />{' '}\n <Trans>\n <NameText account={status.account} instance={instance} showAvatar />{' '}\n <span>boosted</span>\n </Trans>\n </div>\n <Status\n status={statusID ? null : reblog}\n statusID={statusID ? reblog.id : null}\n instance={instance}\n size={size}\n contentTextWeight={contentTextWeight}\n readOnly={readOnly}\n enableCommentHint\n mediaFirst={mediaFirst}\n />\n </div>\n );\n }\n\n // Check followedTags\n const FollowedTagsParent = useCallback(\n ({ children }) => (\n <div\n data-state-post-id={sKey}\n class=\"status-followed-tags\"\n onMouseEnter={debugHover}\n >\n <div class=\"status-pre-meta\">\n <Icon icon=\"hashtag\" size=\"l\" />{' '}\n {snapStates.statusFollowedTags[sKey].slice(0, 3).map((tag) => (\n <Link\n key={tag}\n to={instance ? `/${instance}/t/${tag}` : `/t/${tag}`}\n class=\"status-followed-tag-item\"\n >\n {tag}\n </Link>\n ))}\n </div>\n {children}\n </div>\n ),\n [sKey, instance, snapStates.statusFollowedTags[sKey]],\n );\n const StatusParent =\n showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length\n ? FollowedTagsParent\n : Fragment;\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 const [showEmbed, setShowEmbed] = useState(false);\n\n const spoilerContentRef = useTruncated();\n const contentRef = useTruncated();\n const mediaContainerRef = useTruncated();\n\n const statusRef = useRef(null);\n\n const unauthInteractionErrorMessage = t`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 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\n const statusMonthsAgo = useMemo(() => {\n return Math.floor(\n (new Date() - createdAtDate) / (1000 * 60 * 60 * 24 * 30),\n );\n }, [createdAtDate]);\n\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 } else {\n const newStatus = await masto.v1.statuses.$select(id).reblog();\n saveStatus(newStatus, instance);\n }\n return true;\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 alert(unauthInteractionErrorMessage);\n return false;\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 return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const favouriteStatusNotify = async () => {\n try {\n const done = await favouriteStatus();\n if (!isSizeLarge && done) {\n showToast(\n favourited\n ? t`Unliked @${username || acct}'s post`\n : t`Liked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n };\n\n const bookmarkStatus = async () => {\n if (!supports('@mastodon/post-bookmark')) return;\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\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 return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const bookmarkStatusNotify = async () => {\n try {\n const done = await bookmarkStatus();\n if (!isSizeLarge && done) {\n showToast(\n bookmarked\n ? t`Unbookmarked @${username || acct}'s post`\n : t`Bookmarked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\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 const contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages || [];\n const [differentLanguage, setDifferentLanguage] = useState(\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages]\n ? checkDifferentLanguage(language, contentTranslationHideLanguages)\n : false,\n );\n useEffect(() => {\n if (\n !language ||\n differentLanguage ||\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages]\n ) {\n return;\n }\n let timeout = setTimeout(() => {\n const different = checkDifferentLanguage(\n language,\n contentTranslationHideLanguages,\n );\n if (different) setDifferentLanguage(different);\n }, 1);\n return () => clearTimeout(timeout);\n }, [language, differentLanguage, contentTranslationHideLanguages]);\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 actionsRef = useRef();\n const isPublic = ['public', 'unlisted'].includes(visibility);\n const isPinnable = ['public', 'unlisted', 'private'].includes(visibility);\n const StatusMenuItems = (\n <>\n {!isSizeLarge && sameInstance && (\n <>\n <div class=\"menu-control-group-horizontal status-menu\">\n <MenuItem onClick={replyStatus}>\n <Icon icon=\"comment\" />\n <span>\n {repliesCount > 0 ? shortenNumber(repliesCount) : t`Reply`}\n </span>\n </MenuItem>\n <MenuConfirm\n subMenu\n confirmLabel={\n <>\n <Icon icon=\"rocket\" />\n <span>{reblogged ? t`Unboost` : t`Boost`}</span>\n </>\n }\n className={`menu-reblog ${reblogged ? 'checked' : ''}`}\n menuExtras={\n <MenuItem\n onClick={() => {\n showCompose({\n draftStatus: {\n status: `\\n${url}`,\n },\n });\n }}\n >\n <Icon icon=\"quote\" />\n <span>\n <Trans>Quote</Trans>\n </span>\n </MenuItem>\n }\n menuFooter={\n mediaNoDesc && !reblogged ? (\n <div class=\"footer\">\n <Icon icon=\"alert\" />\n <Trans>Some media have no descriptions.</Trans>\n </div>\n ) : (\n statusMonthsAgo >= 3 && (\n <div class=\"footer\">\n <Icon icon=\"info\" />\n <span>\n <Trans>\n Old post (\n <strong>\n {rtf.format(-statusMonthsAgo, 'month')}\n </strong>\n )\n </Trans>\n </span>\n </div>\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 ? t`Unboosted @${username || acct}'s post`\n : t`Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n }}\n >\n <Icon icon=\"rocket\" />\n <span>\n {reblogsCount > 0\n ? shortenNumber(reblogsCount)\n : reblogged\n ? t`Unboost`\n : t`Boost…`}\n </span>\n </MenuConfirm>\n <MenuItem\n onClick={favouriteStatusNotify}\n className={`menu-favourite ${favourited ? 'checked' : ''}`}\n >\n <Icon icon=\"heart\" />\n <span>\n {favouritesCount > 0\n ? shortenNumber(favouritesCount)\n : favourited\n ? t`Unlike`\n : t`Like`}\n </span>\n </MenuItem>\n {supports('@mastodon/post-bookmark') && (\n <MenuItem\n onClick={bookmarkStatusNotify}\n className={`menu-bookmark ${bookmarked ? 'checked' : ''}`}\n >\n <Icon icon=\"bookmark\" />\n <span>{bookmarked ? t`Unbookmark` : t`Bookmark`}</span>\n </MenuItem>\n )}\n </div>\n </>\n )}\n {!isSizeLarge && sameInstance && (isSizeLarge || showActionsBar) && (\n <MenuDivider />\n )}\n {(isSizeLarge || showActionsBar) && (\n <>\n <MenuItem\n onClick={() => {\n states.showGenericAccounts = {\n heading: t`Boosted/Liked by…`,\n fetchAccounts: fetchBoostedLikedByAccounts,\n instance,\n showReactions: true,\n postID: sKey,\n };\n }}\n >\n <Icon icon=\"react\" />\n <span>\n <Trans>Boosted/Liked by…</Trans>\n </span>\n </MenuItem>\n </>\n )}\n {!mediaFirst && (\n <>\n {(enableTranslate || !language || differentLanguage) && (\n <MenuDivider />\n )}\n {enableTranslate ? (\n <div class={supportsTTS ? 'menu-horizontal' : ''}>\n <MenuItem\n disabled={forceTranslate}\n onClick={() => {\n setForceTranslate(true);\n }}\n >\n <Icon icon=\"translate\" />\n <span>\n <Trans>Translate</Trans>\n </span>\n </MenuItem>\n {supportsTTS && (\n <MenuItem\n onClick={() => {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n }}\n >\n <Icon icon=\"speak\" />\n <span>\n <Trans>Speak</Trans>\n </span>\n </MenuItem>\n )}\n </div>\n ) : (\n (!language || differentLanguage) && (\n <div class={supportsTTS ? 'menu-horizontal' : ''}>\n <MenuLink\n to={`${instance ? `/${instance}` : ''}/s/${id}?translate=1`}\n >\n <Icon icon=\"translate\" />\n <span>\n <Trans>Translate</Trans>\n </span>\n </MenuLink>\n {supportsTTS && (\n <MenuItem\n onClick={() => {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n }}\n >\n <Icon icon=\"speak\" />\n <span>\n <Trans>Speak</Trans>\n </span>\n </MenuItem>\n )}\n </div>\n )\n )}\n </>\n )}\n {((!isSizeLarge && sameInstance) ||\n enableTranslate ||\n !language ||\n differentLanguage) && <MenuDivider />}\n {!isSizeLarge && (\n <>\n <MenuLink\n to={instance ? `/${instance}/s/${id}` : `/s/${id}`}\n onClick={(e) => {\n onStatusLinkClick(e, status);\n }}\n >\n <Icon icon=\"arrows-right\" />\n <small>\n <Trans>\n View post by{' '}\n <span class=\"bidi-isolate\">@{username || acct}</span>\n </Trans>\n <br />\n <span class=\"more-insignificant\">\n {_(visibilityText[visibility])} • {createdDateText}\n </span>\n </small>\n </MenuLink>\n </>\n )}\n {!!editedAt && (\n <>\n <MenuItem\n onClick={() => {\n setShowEdited(id);\n }}\n >\n <Icon icon=\"history\" />\n <small>\n <Trans>Show Edit History</Trans>\n <br />\n <span class=\"more-insignificant\">\n <Trans>Edited: {editedDateText}</Trans>\n </span>\n </small>\n </MenuItem>\n </>\n )}\n <MenuItem href={url} target=\"_blank\">\n <Icon icon=\"external\" />\n <small\n class=\"menu-double-lines\"\n style={{\n maxWidth: '16em',\n }}\n >\n {nicePostURL(url)}\n </small>\n </MenuItem>\n <div class=\"menu-horizontal\">\n <MenuItem\n onClick={() => {\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(url);\n showToast(t`Link copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy link`);\n }\n }}\n >\n <Icon icon=\"link\" />\n <span>\n <Trans>Copy</Trans>\n </span>\n </MenuItem>\n {isPublic &&\n navigator?.share &&\n navigator?.canShare?.({\n url,\n }) && (\n <MenuItem\n onClick={() => {\n try {\n navigator.share({\n url,\n });\n } catch (e) {\n console.error(e);\n alert(t`Sharing doesn't seem to work.`);\n }\n }}\n >\n <Icon icon=\"share\" />\n <span>\n <Trans>Share…</Trans>\n </span>\n </MenuItem>\n )}\n </div>\n {isPublic && isSizeLarge && (\n <MenuItem\n onClick={() => {\n setShowEmbed(true);\n }}\n >\n <Icon icon=\"code\" />\n <span>\n <Trans>Embed post</Trans>\n </span>\n </MenuItem>\n )}\n {(isSelf || mentionSelf) && <MenuDivider />}\n {(isSelf || mentionSelf) && (\n <MenuItem\n onClick={async () => {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [muted ? 'unmute' : 'mute']();\n saveStatus(newStatus, instance);\n showToast(\n muted ? t`Conversation unmuted` : t`Conversation muted`,\n );\n } catch (e) {\n console.error(e);\n showToast(\n muted\n ? t`Unable to unmute conversation`\n : t`Unable to mute conversation`,\n );\n }\n }}\n >\n {muted ? (\n <>\n <Icon icon=\"unmute\" />\n <span>\n <Trans>Unmute conversation</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"mute\" />\n <span>\n <Trans>Mute conversation</Trans>\n </span>\n </>\n )}\n </MenuItem>\n )}\n {isSelf && isPinnable && (\n <MenuItem\n onClick={async () => {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [pinned ? 'unpin' : 'pin']();\n saveStatus(newStatus, instance);\n showToast(\n pinned\n ? t`Post unpinned from profile`\n : t`Post pinned to profile`,\n );\n } catch (e) {\n console.error(e);\n showToast(\n pinned ? t`Unable to unpin post` : t`Unable to pin post`,\n );\n }\n }}\n >\n {pinned ? (\n <>\n <Icon icon=\"unpin\" />\n <span>\n <Trans>Unpin from profile</Trans>\n </span>\n </>\n ) : (\n <>\n <Icon icon=\"pin\" />\n <span>\n <Trans>Pin to profile</Trans>\n </span>\n </>\n )}\n </MenuItem>\n )}\n {isSelf && (\n <div class=\"menu-horizontal\">\n {supports('@mastodon/post-edit') && (\n <MenuItem\n onClick={() => {\n showCompose({\n editStatus: status,\n });\n }}\n >\n <Icon icon=\"pencil\" />\n <span>\n <Trans>Edit</Trans>\n </span>\n </MenuItem>\n )}\n {isSizeLarge && (\n <MenuConfirm\n subMenu\n confirmLabel={\n <>\n <Icon icon=\"trash\" />\n <span>\n <Trans>Delete this post?</Trans>\n </span>\n </>\n }\n itemProps={{\n className: 'danger',\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(t`Post deleted`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to delete post`);\n }\n })();\n // }\n }}\n >\n <Icon icon=\"trash\" />\n <span>\n <Trans>Delete…</Trans>\n </span>\n </MenuConfirm>\n )}\n </div>\n )}\n {!isSelf && isSizeLarge && (\n <>\n <MenuDivider />\n <MenuItem\n className=\"danger\"\n onClick={() => {\n states.showReportModal = {\n account: status.account,\n post: status,\n };\n }}\n >\n <Icon icon=\"flag\" />\n <span>\n <Trans>Report post…</Trans>\n </span>\n </MenuItem>\n </>\n )}\n </>\n );\n\n const contextMenuRef = useRef();\n const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);\n const [contextMenuProps, setContextMenuProps] = useState({});\n\n const showContextMenu =\n allowContextMenu || (!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 (\n link &&\n statusRef.current.contains(link) &&\n !link.getAttribute('href').startsWith('#')\n )\n 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('f, l', favouriteStatusNotify, {\n enabled: hotkeysEnabled,\n });\n const dRef = useHotkeys('d', bookmarkStatusNotify, {\n enabled: hotkeysEnabled,\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 ? t`Unboosted @${username || acct}'s post`\n : t`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 <div\n key={media.id}\n data-caption-index={indices.map((i) => 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 <sup>{indices.map((i) => i + 1).join(' ')}</sup> {media.description}\n </div>\n ));\n\n // return displayedMediaAttachments.map(\n // (media, i) =>\n // !!media.description && (\n // <div\n // key={media.id}\n // data-caption-index={i + 1}\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 // <sup>{i + 1}</sup> {media.description}\n // </div>\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 <StatusParent>\n {showReplyParent && !!(inReplyToId && inReplyToAccountId) && (\n <StatusCompact sKey={sKey} />\n )}\n <article\n data-state-post-id={sKey}\n ref={(node) => {\n statusRef.current = node;\n // Use parent node if it's in focus\n // Use case: <a><status /></a>\n // When navigating (j/k), the <a> is focused instead of <status />\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(nodeRef);\n fRef(nodeRef);\n dRef(nodeRef);\n bRef(nodeRef);\n xRef(nodeRef);\n }}\n tabindex=\"-1\"\n class={`status ${\n !withinContext && inReplyToId && inReplyToAccount\n ? 'status-reply-to'\n : ''\n } visibility-${visibility} ${_pinned ? 'status-pinned' : ''} ${\n SIZE_CLASS[size]\n } ${_deleted ? 'status-deleted' : ''} ${quoted ? 'status-card' : ''} ${\n isContextMenuOpen ? 'status-menu-open' : ''\n } ${mediaFirst && hasMediaAttachments ? 'status-media-first' : ''}`}\n onMouseEnter={debugHover}\n onContextMenu={(e) => {\n if (!showContextMenu) return;\n if (e.metaKey) return;\n // console.log('context menu', e);\n const link = e.target.closest('a');\n if (\n link &&\n statusRef.current.contains(link) &&\n !link.getAttribute('href').startsWith('#')\n )\n return;\n\n // If there's selected text, don't show custom context menu\n const selection = window.getSelection?.();\n if (selection.toString().length > 0) {\n const { anchorNode } = selection;\n if (statusRef.current?.contains(anchorNode)) {\n return;\n }\n }\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 <ControlledMenu\n ref={contextMenuRef}\n state={isContextMenuOpen ? 'open' : undefined}\n {...contextMenuProps}\n onClose={(e) => {\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 </ControlledMenu>\n )}\n {showActionsBar &&\n size !== 'l' &&\n !previewMode &&\n !readOnly &&\n !_deleted &&\n !quoted && (\n <div\n class={`status-actions ${\n isContextMenuOpen === 'actions-bar' ? 'open' : ''\n }`}\n ref={actionsRef}\n >\n <StatusButton\n size=\"s\"\n title={t`Reply`}\n alt={t`Reply`}\n class=\"reply-button\"\n icon=\"comment\"\n iconSize=\"m\"\n onClick={replyStatus}\n />\n <StatusButton\n size=\"s\"\n checked={favourited}\n title={[t`Like`, t`Unlike`]}\n alt={[t`Like`, t`Liked`]}\n class=\"favourite-button\"\n icon=\"heart\"\n iconSize=\"m\"\n count={favouritesCount}\n onClick={favouriteStatusNotify}\n />\n <button\n type=\"button\"\n title={t`More`}\n class=\"plain more-button\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n setContextMenuProps({\n anchorRef: {\n current: e.currentTarget,\n },\n align: 'start',\n direction: 'left',\n gap: 0,\n shift: -8,\n });\n setIsContextMenuOpen('actions-bar');\n }}\n >\n <Icon icon=\"more2\" size=\"m\" alt={t`More`} />\n </button>\n </div>\n )}\n {size !== 'l' && (\n <div class=\"status-badge\">\n {reblogged && (\n <Icon class=\"reblog\" icon=\"rocket\" size=\"s\" alt={t`Boosted`} />\n )}\n {favourited && (\n <Icon class=\"favourite\" icon=\"heart\" size=\"s\" alt={t`Liked`} />\n )}\n {bookmarked && (\n <Icon\n class=\"bookmark\"\n icon=\"bookmark\"\n size=\"s\"\n alt={t`Bookmarked`}\n />\n )}\n {_pinned && (\n <Icon class=\"pin\" icon=\"pin\" size=\"s\" alt={t`Pinned`} />\n )}\n </div>\n )}\n {size !== 's' && (\n <a\n href={accountURL}\n tabindex=\"-1\"\n // target=\"_blank\"\n title={`@${acct}`}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n states.showAccount = {\n account: status.account,\n instance,\n };\n }}\n >\n <Avatar url={avatarStatic || avatar} size=\"xxl\" squircle={bot} />\n </a>\n )}\n <div class=\"container\">\n <div class=\"meta\">\n <span class=\"meta-name\">\n <NameText\n account={status.account}\n instance={instance}\n showAvatar={size === 's'}\n showAcct={isSizeLarge}\n />\n </span>\n {/* {inReplyToAccount && !withinContext && size !== 's' && (\n <>\n {' '}\n <span class=\"ib\">\n <Icon icon=\"arrow-right\" class=\"arrow\" />{' '}\n <NameText account={inReplyToAccount} instance={instance} short />\n </span>\n </>\n )} */}\n {/* </span> */}{' '}\n {size !== 'l' &&\n (_deleted ? (\n <span class=\"status-deleted-tag\">\n <Trans>Deleted</Trans>\n </span>\n ) : url && !previewMode && !readOnly && !quoted ? (\n <Link\n to={instance ? `/${instance}/s/${id}` : `/s/${id}`}\n onClick={(e) => {\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 <Icon\n icon=\"comment2\"\n size=\"s\"\n // alt={`${repliesCount} ${\n // repliesCount === 1 ? 'reply' : 'replies'\n // }`}\n alt={plural(repliesCount, {\n one: '# reply',\n other: '# replies',\n })}\n />\n ) : (\n visibility !== 'public' &&\n visibility !== 'direct' && (\n <Icon\n icon={visibilityIconsMap[visibility]}\n alt={_(visibilityText[visibility])}\n size=\"s\"\n />\n )\n )}{' '}\n <RelativeTime datetime={createdAtDate} format=\"micro\" />\n {!previewMode && !readOnly && (\n <Icon icon=\"more2\" class=\"more\" alt={t`More`} />\n )}\n </Link>\n ) : (\n // <Menu\n // instanceRef={menuInstanceRef}\n // portal={{\n // target: document.body,\n // }}\n // containerProps={{\n // style: {\n // // Higher than the backdrop\n // zIndex: 1001,\n // },\n // onClick: (e) => {\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 // <Link\n // to={instance ? `/${instance}/s/${id}` : `/s/${id}`}\n // onClick={(e) => {\n // e.preventDefault();\n // e.stopPropagation();\n // onStatusLinkClick?.(e, status);\n // }}\n // class={`time ${open ? 'is-open' : ''}`}\n // >\n // <Icon\n // icon={visibilityIconsMap[visibility]}\n // alt={visibilityText[visibility]}\n // size=\"s\"\n // />{' '}\n // <RelativeTime datetime={createdAtDate} format=\"micro\" />\n // </Link>\n // )}\n // >\n // {StatusMenuItems}\n // </Menu>\n <span class=\"time\">\n {visibility !== 'public' && visibility !== 'direct' && (\n <>\n <Icon\n icon={visibilityIconsMap[visibility]}\n alt={_(visibilityText[visibility])}\n size=\"s\"\n />{' '}\n </>\n )}\n <RelativeTime datetime={createdAtDate} format=\"micro\" />\n </span>\n ))}\n </div>\n {visibility === 'direct' && (\n <>\n <div class=\"status-direct-badge\">\n <Trans>Private mention</Trans>\n </div>{' '}\n </>\n )}\n {!withinContext && (\n <>\n {isThread ? (\n <div class=\"status-thread-badge\">\n <Icon icon=\"thread\" size=\"s\" />\n <Trans>\n Thread\n {snapStates.statusThreadNumber[sKey]\n ? ` ${snapStates.statusThreadNumber[sKey]}/X`\n : ''}\n </Trans>\n </div>\n ) : (\n !!inReplyToId &&\n !!inReplyToAccount &&\n (!!spoilerText ||\n !mentions.find((mention) => {\n return mention.id === inReplyToAccountId;\n })) && (\n <div class=\"status-reply-badge\">\n <Icon icon=\"reply\" />{' '}\n <NameText\n account={inReplyToAccount}\n instance={instance}\n short\n />\n </div>\n )\n )}\n </>\n )}\n <div\n class={`content-container ${\n spoilerText || sensitive ? 'has-spoiler' : ''\n } ${showSpoiler ? 'show-spoiler' : ''} ${\n showSpoilerMedia ? 'show-media' : ''\n }`}\n data-content-text-weight={contentTextWeight ? textWeight() : null}\n style={\n (isSizeLarge || contentTextWeight) && {\n '--content-text-weight': textWeight(),\n }\n }\n >\n {mediaFirst && hasMediaAttachments ? (\n <>\n {(!!spoilerText || !!sensitive) && !readingExpandSpoilers && (\n <>\n {!!spoilerText && (\n <span\n class=\"spoiler-content media-first-spoiler-content\"\n lang={language}\n dir=\"auto\"\n ref={spoilerContentRef}\n data-read-more={_(readMoreText)}\n >\n <EmojiText text={spoilerText} emojis={emojis} />{' '}\n </span>\n )}\n <button\n class={`light spoiler-button media-first-spoiler-button ${\n showSpoiler ? 'spoiling' : ''\n }`}\n type=\"button\"\n onClick={(e) => {\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 <Icon icon={showSpoiler ? 'eye-open' : 'eye-close'} />{' '}\n {showSpoiler ? t`Show less` : t`Show content`}\n </button>\n </>\n )}\n <MediaFirstContainer\n mediaAttachments={mediaAttachments}\n language={language}\n postID={id}\n instance={instance}\n />\n {!!content && (\n <div class=\"media-first-content content\" ref={contentRef}>\n <PostContent\n post={status}\n instance={instance}\n previewMode={previewMode}\n />\n </div>\n )}\n </>\n ) : (\n <>\n {!!spoilerText && (\n <>\n <div\n class=\"content spoiler-content\"\n lang={language}\n dir=\"auto\"\n ref={spoilerContentRef}\n data-read-more={_(readMoreText)}\n >\n <p>\n <EmojiText text={spoilerText} emojis={emojis} />\n </p>\n </div>\n {readingExpandSpoilers || previewMode ? (\n <div class=\"spoiler-divider\">\n <Icon icon=\"eye-open\" /> <Trans>Content warning</Trans>\n </div>\n ) : (\n <button\n class={`light spoiler-button ${\n showSpoiler ? 'spoiling' : ''\n }`}\n type=\"button\"\n onClick={(e) => {\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 <Icon icon={showSpoiler ? 'eye-open' : 'eye-close'} />{' '}\n {showSpoiler ? t`Show less` : t`Show content`}\n </button>\n )}\n </>\n )}\n {!!content && (\n <div\n class=\"content\"\n ref={contentRef}\n data-read-more={_(readMoreText)}\n inert={!!spoilerText && !showSpoiler ? true : undefined}\n >\n <PostContent\n post={status}\n instance={instance}\n previewMode={previewMode}\n />\n <QuoteStatuses id={id} instance={instance} level={quoted} />\n </div>\n )}\n {!!poll && (\n <Poll\n lang={language}\n poll={poll}\n readOnly={readOnly || !sameInstance || !authenticated}\n onUpdate={(newPoll) => {\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 isTranslateble(content) &&\n differentLanguage) ||\n forceTranslate) && (\n <TranslationBlock\n forceTranslate={forceTranslate || inlineTranslate}\n mini={!isSizeLarge && !withinContext}\n sourceLanguage={language}\n autoDetected={languageAutoDetected}\n text={getPostText(status)}\n />\n )}\n {!previewMode &&\n sensitive &&\n !!mediaAttachments.length &&\n readingExpandMedia !== 'show_all' && (\n <button\n class={`plain spoiler-media-button ${\n showSpoilerMedia ? 'spoiling' : ''\n }`}\n type=\"button\"\n hidden={!readingExpandSpoilers && !!spoilerText}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoilerMedia) {\n delete states.spoilersMedia[id];\n } else {\n states.spoilersMedia[id] = true;\n }\n }}\n >\n <Icon\n icon={showSpoilerMedia ? 'eye-open' : 'eye-close'}\n />{' '}\n {showSpoilerMedia ? t`Show less` : t`Show media`}\n </button>\n )}\n {!!mediaAttachments.length &&\n (mediaAttachments.length > 1 &&\n (isSizeLarge || (withinContext && size === 'm')) ? (\n <div class=\"media-large-container\">\n {mediaAttachments.map((media, i) => (\n <div key={media.id} class={`media-container media-eq1`}>\n <Media\n media={media}\n autoAnimate\n showCaption\n allowLongerCaption={!content}\n lang={language}\n to={`/${instance}/s/${id}?${\n withinContext ? 'media' : 'media-only'\n }=${i + 1}`}\n onClick={\n onMediaClick\n ? (e) => onMediaClick(e, i, media, status)\n : undefined\n }\n />\n </div>\n ))}\n </div>\n ) : (\n <MultipleMediaFigure\n lang={language}\n enabled={showMultipleMediaCaptions}\n captionChildren={captionChildren}\n >\n <div\n ref={mediaContainerRef}\n class={`media-container media-eq${\n mediaAttachments.length\n } ${mediaAttachments.length > 2 ? 'media-gt2' : ''} ${\n mediaAttachments.length > 4 ? 'media-gt4' : ''\n }`}\n >\n {displayedMediaAttachments.map((media, i) => (\n <Media\n key={media.id}\n media={media}\n autoAnimate={isSizeLarge}\n showCaption={mediaAttachments.length === 1}\n allowLongerCaption={\n !content && mediaAttachments.length === 1\n }\n lang={language}\n altIndex={\n showMultipleMediaCaptions &&\n !!media.description &&\n i + 1\n }\n to={`/${instance}/s/${id}?${\n withinContext ? 'media' : 'media-only'\n }=${i + 1}`}\n onClick={\n onMediaClick\n ? (e) => {\n onMediaClick(e, i, media, status);\n }\n : undefined\n }\n checkAspectRatio={mediaAttachments.length === 1}\n />\n ))}\n </div>\n </MultipleMediaFigure>\n ))}\n {!!card &&\n /^https/i.test(card?.url) &&\n !sensitive &&\n !spoilerText &&\n !poll &&\n !mediaAttachments.length &&\n !snapStates.statusQuotes[sKey] && (\n <Card\n card={card}\n selfReferential={\n card?.url === status.url || card?.url === status.uri\n }\n selfAuthor={card?.authors?.some(\n (a) => a.account?.url === accountURL,\n )}\n instance={currentInstance}\n />\n )}\n </>\n )}\n </div>\n {!isSizeLarge && showCommentCount && (\n <div class=\"content-comment-hint insignificant\">\n <Icon icon=\"comment2\" alt={t`Replies`} /> {repliesCount}\n </div>\n )}\n {isSizeLarge && (\n <>\n <div class=\"extra-meta\">\n {_deleted ? (\n <span class=\"status-deleted-tag\">\n <Trans>Deleted</Trans>\n </span>\n ) : (\n <>\n {/* <Icon\n icon={visibilityIconsMap[visibility]}\n alt={visibilityText[visibility]}\n /> */}\n <span>{_(visibilityText[visibility])}</span> •{' '}\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n {\n // within a day\n new Date().getTime() - createdAtDate.getTime() <\n 86400000 && (\n <>\n <RelativeTime\n datetime={createdAtDate}\n format=\"micro\"\n />{' '}\n ‒{' '}\n </>\n )\n }\n <time\n class=\"created\"\n datetime={createdAtDate.toISOString()}\n title={createdAtDate.toLocaleString()}\n >\n {createdDateText}\n </time>\n </a>\n {editedAt && (\n <>\n {' '}\n • <Icon icon=\"pencil\" alt={t`Edited`} />{' '}\n <time\n tabIndex=\"0\"\n class=\"edited\"\n datetime={editedAtDate.toISOString()}\n onClick={() => {\n setShowEdited(id);\n }}\n >\n {editedDateText}\n </time>\n </>\n )}\n </>\n )}\n </div>\n {!!emojiReactions?.length && (\n <div class=\"emoji-reactions\">\n {emojiReactions.map((emojiReaction) => {\n const { name, count, me, url, staticUrl } = emojiReaction;\n if (url) {\n // Some servers return url and staticUrl\n return (\n <span\n class={`emoji-reaction tag ${\n me ? '' : 'insignificant'\n }`}\n >\n <CustomEmoji\n alt={name}\n url={url}\n staticUrl={staticUrl}\n />{' '}\n {count}\n </span>\n );\n }\n const isShortCode = /^:.+?:$/.test(name);\n if (isShortCode) {\n const emoji = emojis.find(\n (e) =>\n e.shortcode ===\n name.replace(/^:/, '').replace(/:$/, ''),\n );\n if (emoji) {\n return (\n <span\n class={`emoji-reaction tag ${\n me ? '' : 'insignificant'\n }`}\n >\n <CustomEmoji\n alt={name}\n url={emoji.url}\n staticUrl={emoji.staticUrl}\n />{' '}\n {count}\n </span>\n );\n }\n }\n return (\n <span\n class={`emoji-reaction tag ${\n me ? '' : 'insignificant'\n }`}\n >\n {name} {count}\n </span>\n );\n })}\n </div>\n )}\n <div class={`actions ${_deleted ? 'disabled' : ''}`}>\n <div class=\"action has-count\">\n <StatusButton\n title={t`Reply`}\n alt={t`Comments`}\n class=\"reply-button\"\n icon=\"comment\"\n count={repliesCount}\n onClick={replyStatus}\n />\n </div>\n {/* <div class=\"action has-count\">\n <StatusButton\n checked={reblogged}\n title={['Boost', 'Unboost']}\n alt={['Boost', 'Boosted']}\n class=\"reblog-button\"\n icon=\"rocket\"\n count={reblogsCount}\n onClick={boostStatus}\n disabled={!canBoost}\n />\n </div> */}\n <div class=\"action has-count\">\n <MenuConfirm\n disabled={!canBoost}\n onClick={confirmBoostStatus}\n confirmLabel={\n <>\n <Icon icon=\"rocket\" />\n <span>{reblogged ? t`Unboost` : t`Boost`}</span>\n </>\n }\n menuExtras={\n <MenuItem\n onClick={() => {\n showCompose({\n draftStatus: {\n status: `\\n${url}`,\n },\n });\n }}\n >\n <Icon icon=\"quote\" />\n <span>\n <Trans>Quote</Trans>\n </span>\n </MenuItem>\n }\n menuFooter={\n mediaNoDesc &&\n !reblogged && (\n <div class=\"footer\">\n <Icon icon=\"alert\" />\n <Trans>Some media have no descriptions.</Trans>\n </div>\n )\n }\n >\n <StatusButton\n checked={reblogged}\n title={[t`Boost`, t`Unboost`]}\n alt={[t`Boost`, t`Boosted`]}\n class=\"reblog-button\"\n icon=\"rocket\"\n count={reblogsCount}\n // onClick={boostStatus}\n disabled={!canBoost}\n />\n </MenuConfirm>\n </div>\n <div class=\"action has-count\">\n <StatusButton\n checked={favourited}\n title={[t`Like`, t`Unlike`]}\n alt={[t`Like`, t`Liked`]}\n class=\"favourite-button\"\n icon=\"heart\"\n count={favouritesCount}\n onClick={favouriteStatus}\n />\n </div>\n {supports('@mastodon/post-bookmark') && (\n <div class=\"action\">\n <StatusButton\n checked={bookmarked}\n title={[t`Bookmark`, t`Unbookmark`]}\n alt={[t`Bookmark`, t`Bookmarked`]}\n class=\"bookmark-button\"\n icon=\"bookmark\"\n onClick={bookmarkStatus}\n />\n </div>\n )}\n <Menu2\n portal={{\n target:\n document.querySelector('.status-deck') || document.body,\n }}\n align=\"end\"\n gap={4}\n overflow=\"auto\"\n viewScroll=\"close\"\n menuButton={\n <div class=\"action\">\n <button\n type=\"button\"\n title={t`More`}\n class=\"plain more-button\"\n >\n <Icon icon=\"more\" size=\"l\" alt={t`More`} />\n </button>\n </div>\n }\n >\n {StatusMenuItems}\n </Menu2>\n </div>\n </>\n )}\n </div>\n {!!showEdited && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowEdited(false);\n // statusRef.current?.focus();\n }\n }}\n >\n <EditedAtModal\n statusID={showEdited}\n instance={instance}\n fetchStatusHistory={() => {\n return masto.v1.statuses.$select(showEdited).history.list();\n }}\n onClose={() => {\n setShowEdited(false);\n statusRef.current?.focus();\n }}\n />\n </Modal>\n )}\n {!!showEmbed && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowEmbed(false);\n }\n }}\n >\n <EmbedModal\n post={status}\n instance={instance}\n onClose={() => {\n setShowEmbed(false);\n }}\n />\n </Modal>\n )}\n </article>\n </StatusParent>\n );\n}\n\nfunction MultipleMediaFigure(props) {\n const { enabled, children, lang, captionChildren } = props;\n if (!enabled || !captionChildren) return children;\n return (\n <figure class=\"media-figure-multiple\">\n {children}\n <figcaption lang={lang} dir=\"auto\">\n {captionChildren}\n </figcaption>\n </figure>\n );\n}\n\nfunction MediaFirstContainer(props) {\n const { mediaAttachments, language, postID, instance } = props;\n const moreThanOne = mediaAttachments.length > 1;\n\n const carouselRef = useRef();\n const [currentIndex, setCurrentIndex] = useState(0);\n\n useEffect(() => {\n let handleScroll = () => {\n const { clientWidth, scrollLeft } = carouselRef.current;\n const index = Math.round(Math.abs(scrollLeft) / clientWidth);\n setCurrentIndex(index);\n };\n if (carouselRef.current) {\n carouselRef.current.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n }\n return () => {\n if (carouselRef.current) {\n carouselRef.current.removeEventListener('scroll', handleScroll);\n }\n };\n }, []);\n\n return (\n <>\n <div class=\"media-first-container\">\n <div class=\"media-first-carousel\" ref={carouselRef}>\n {mediaAttachments.map((media, i) => (\n <div class=\"media-first-item\" key={media.id}>\n <Media\n media={media}\n lang={language}\n to={`/${instance}/s/${postID}?media=${i + 1}`}\n />\n </div>\n ))}\n </div>\n {moreThanOne && (\n <div class=\"media-carousel-controls\">\n <div class=\"carousel-indexer\">\n {currentIndex + 1}/{mediaAttachments.length}\n </div>\n <label class=\"media-carousel-button\">\n <button\n type=\"button\"\n class=\"carousel-button\"\n hidden={currentIndex === 0}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left:\n carouselRef.current.clientWidth *\n (currentIndex - 1) *\n (isRTL() ? -1 : 1),\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-left\" />\n </button>\n </label>\n <label class=\"media-carousel-button\">\n <button\n type=\"button\"\n class=\"carousel-button\"\n hidden={currentIndex === mediaAttachments.length - 1}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n carouselRef.current.focus();\n carouselRef.current.scrollTo({\n left:\n carouselRef.current.clientWidth *\n (currentIndex + 1) *\n (isRTL() ? -1 : 1),\n behavior: 'smooth',\n });\n }}\n >\n <Icon icon=\"arrow-right\" />\n </button>\n </label>\n </div>\n )}\n </div>\n {moreThanOne && (\n <div\n class=\"media-carousel-dots\"\n style={{\n '--dots-count': mediaAttachments.length,\n }}\n >\n {mediaAttachments.map((media, i) => (\n <span\n key={media.id}\n class={`carousel-dot ${i === currentIndex ? 'active' : ''}`}\n />\n ))}\n </div>\n )}\n </>\n );\n}\n\nfunction getDomain(url) {\n return punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n}\n\n// \"Post\": Quote post + card link preview combo\n// Assume all links from these domains are \"posts\"\n// Mastodon links are \"posts\" too but they are converted to real quote posts and there's too many domains to check\n// This is just \"Progressive Enhancement\"\nfunction isCardPost(domain) {\n return ['x.com', 'twitter.com', 'threads.net', 'bsky.app'].includes(domain);\n}\n\nfunction Byline({ authors, hidden, children }) {\n if (hidden) return children;\n if (!authors?.[0]?.account?.id) return children;\n const author = authors[0].account;\n\n return (\n <div class=\"card-byline\">\n {children}\n <div class=\"card-byline-author\">\n <Icon icon=\"link\" size=\"s\" />{' '}\n <small>\n <Trans comment=\"More from [Author]\">\n More from <NameText account={author} showAvatar />\n </Trans>\n </small>\n </div>\n </div>\n );\n}\n\nfunction Card({ card, selfReferential, selfAuthor, instance }) {\n const snapStates = useSnapshot(states);\n const {\n blurhash,\n title,\n description,\n html,\n providerName,\n providerUrl,\n authorName,\n authorUrl,\n width,\n height,\n image,\n imageDescription,\n url,\n type,\n embedUrl,\n language,\n publishedAt,\n authors,\n } = card;\n\n /* type\n link = Link OEmbed\n photo = Photo OEmbed\n video = Video OEmbed\n rich = iframe OEmbed. Not currently accepted, so won’t show up in practice.\n */\n\n const hasText = title || providerName || authorName;\n const isLandscape = width / height >= 1.2;\n const size = isLandscape ? 'large' : '';\n\n const [cardStatusURL, setCardStatusURL] = useState(null);\n // const [cardStatusID, setCardStatusID] = useState(null);\n useEffect(() => {\n if (hasText && image && !selfReferential && isMastodonLinkMaybe(url)) {\n unfurlMastodonLink(instance, url).then((result) => {\n if (!result) return;\n const { id, url } = result;\n setCardStatusURL('#' + url);\n\n // NOTE: This is for quote post\n // (async () => {\n // const { masto } = api({ instance });\n // const status = await masto.v1.statuses.$select(id).fetch();\n // saveStatus(status, instance);\n // setCardStatusID(id);\n // })();\n });\n }\n }, [hasText, image, selfReferential]);\n\n // if (cardStatusID) {\n // return (\n // <Status statusID={cardStatusID} instance={instance} size=\"s\" readOnly />\n // );\n // }\n\n if (snapStates.unfurledLinks[url]) return null;\n\n const hasIframeHTML = /<iframe/i.test(html);\n const handleClick = useCallback(\n (e) => {\n if (hasIframeHTML) {\n e.preventDefault();\n states.showEmbedModal = {\n html,\n url: url || embedUrl,\n width,\n height,\n };\n }\n },\n [hasIframeHTML],\n );\n\n const [blurhashImage, setBlurhashImage] = useState(null);\n if (hasText && (image || (type === 'photo' && blurhash))) {\n const domain = getDomain(url);\n const rgbAverageColor =\n image && blurhash ? getBlurHashAverageColor(blurhash) : null;\n if (!image) {\n const w = 44;\n const h = 44;\n const blurhashPixels = decodeBlurHash(blurhash, w, h);\n const canvas = window.OffscreenCanvas\n ? new OffscreenCanvas(1, 1)\n : document.createElement('canvas');\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext('2d');\n ctx.imageSmoothingEnabled = false;\n const imageData = ctx.createImageData(w, h);\n imageData.data.set(blurhashPixels);\n ctx.putImageData(imageData, 0, 0);\n try {\n if (window.OffscreenCanvas) {\n canvas.convertToBlob().then((blob) => {\n setBlurhashImage(URL.createObjectURL(blob));\n });\n } else {\n setBlurhashImage(canvas.toDataURL());\n }\n } catch (e) {\n // Silently fail\n console.error(e);\n }\n }\n\n const isPost = isCardPost(domain);\n\n return (\n <Byline hidden={!!selfAuthor} authors={authors}>\n <a\n href={cardStatusURL || url}\n target={cardStatusURL ? null : '_blank'}\n rel=\"nofollow noopener noreferrer\"\n class={`card link ${isPost ? 'card-post' : ''} ${\n blurhashImage ? '' : size\n }`}\n style={{\n '--average-color':\n rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n }}\n onClick={handleClick}\n >\n <div class=\"card-image\">\n <img\n src={image || blurhashImage}\n width={width}\n height={height}\n loading=\"lazy\"\n decoding=\"async\"\n fetchPriority=\"low\"\n alt={imageDescription || ''}\n onError={(e) => {\n try {\n e.target.style.display = 'none';\n } catch (e) {}\n }}\n style={{\n '--anim-duration':\n width &&\n height &&\n `${Math.min(\n Math.max(Math.max(width, height) / 100, 5),\n 120,\n )}s`,\n }}\n />\n </div>\n <div class=\"meta-container\" lang={language}>\n <p class=\"meta domain\">\n <span class=\"domain\">{domain}</span>{' '}\n {!!publishedAt && <>· </>}\n {!!publishedAt && (\n <>\n <RelativeTime datetime={publishedAt} format=\"micro\" />\n </>\n )}\n </p>\n <p class=\"title\" dir=\"auto\" title={title}>\n {title}\n </p>\n <p class=\"meta\" dir=\"auto\" title={description}>\n {description ||\n (!!publishedAt && (\n <RelativeTime datetime={publishedAt} format=\"micro\" />\n ))}\n </p>\n </div>\n </a>\n </Byline>\n );\n } else if (type === 'photo') {\n return (\n <a\n href={url}\n target=\"_blank\"\n rel=\"nofollow noopener noreferrer\"\n class=\"card photo\"\n onClick={handleClick}\n >\n <img\n src={embedUrl}\n width={width}\n height={height}\n alt={title || description}\n loading=\"lazy\"\n style={{\n height: 'auto',\n aspectRatio: `${width}/${height}`,\n }}\n />\n </a>\n );\n } else {\n if (type === 'video') {\n if (/youtube/i.test(providerName)) {\n // Get ID from e.g. https://www.youtube.com/watch?v=[VIDEO_ID]\n const videoID = url.match(/watch\\?v=([^&]+)/)?.[1];\n if (videoID) {\n return (\n <a class=\"card video\" onClick={handleClick}>\n <lite-youtube videoid={videoID} nocookie autoPause></lite-youtube>\n </a>\n );\n }\n }\n // return (\n // <div\n // class=\"card video\"\n // style={{\n // aspectRatio: `${width}/${height}`,\n // }}\n // dangerouslySetInnerHTML={{ __html: html }}\n // />\n // );\n }\n if (hasText && !image) {\n const domain = getDomain(url);\n const isPost = isCardPost(domain);\n return (\n <a\n href={cardStatusURL || url}\n target={cardStatusURL ? null : '_blank'}\n rel=\"nofollow noopener noreferrer\"\n class={`card link ${isPost ? 'card-post' : ''} no-image`}\n lang={language}\n dir=\"auto\"\n onClick={handleClick}\n >\n <div class=\"meta-container\">\n <p class=\"meta domain\">\n <span class=\"domain\">\n <Icon icon=\"link\" size=\"s\" /> <span>{domain}</span>\n </span>{' '}\n {!!publishedAt && <>· </>}\n {!!publishedAt && (\n <>\n <RelativeTime datetime={publishedAt} format=\"micro\" />\n </>\n )}\n </p>\n <p class=\"title\" title={title}>\n {title}\n </p>\n <p class=\"meta\" title={description || providerName || authorName}>\n {description || providerName || authorName}\n </p>\n </div>\n </a>\n );\n }\n }\n}\n\nfunction EditedAtModal({\n statusID,\n instance,\n fetchStatusHistory = () => {},\n onClose,\n}) {\n const { t } = useLingui();\n const [uiState, setUIState] = useState('default');\n const [editHistory, setEditHistory] = useState([]);\n\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const editHistory = await fetchStatusHistory();\n console.log(editHistory);\n setEditHistory(editHistory);\n setUIState('default');\n } catch (e) {\n console.error(e);\n setUIState('error');\n }\n })();\n }, []);\n\n return (\n <div id=\"edit-history\" class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Edit History</Trans>\n </h2>\n {uiState === 'error' && (\n <p>\n <Trans>Failed to load history</Trans>\n </p>\n )}\n {uiState === 'loading' && (\n <p>\n <Loader abrupt /> <Trans>Loading…</Trans>\n </p>\n )}\n </header>\n <main tabIndex=\"-1\">\n {editHistory.length > 0 && (\n <ol>\n {editHistory.map((status) => {\n const { createdAt } = status;\n const createdAtDate = new Date(createdAt);\n return (\n <li key={createdAt} class=\"history-item\">\n <h3>\n <time>\n {niceDateTime(createdAtDate, {\n formatOpts: {\n weekday: 'short',\n second: 'numeric',\n },\n })}\n </time>\n </h3>\n <Status\n status={status}\n instance={instance}\n size=\"s\"\n withinContext\n readOnly\n previewMode\n />\n </li>\n );\n })}\n </ol>\n )}\n </main>\n </div>\n );\n}\n\nfunction generateHTMLCode(post, instance, level = 0) {\n const {\n account: {\n url: accountURL,\n displayName,\n acct,\n username,\n emojis: accountEmojis,\n bot,\n group,\n },\n id,\n poll,\n spoilerText,\n language,\n editedAt,\n createdAt,\n content,\n mediaAttachments,\n url,\n emojis,\n } = post;\n\n const sKey = statusKey(id, instance);\n const quotes = states.statusQuotes[sKey] || [];\n const uniqueQuotes = quotes.filter(\n (q, i, arr) => arr.findIndex((q2) => q2.url === q.url) === i,\n );\n const quoteStatusesHTML =\n uniqueQuotes.length && level <= 2\n ? uniqueQuotes\n .map((quote) => {\n const { id, instance } = quote;\n const sKey = statusKey(id, instance);\n const s = states.statuses[sKey];\n if (s) {\n return generateHTMLCode(s, instance, ++level);\n }\n })\n .join('')\n : '';\n\n const createdAtDate = new Date(createdAt);\n // const editedAtDate = editedAt && new Date(editedAt);\n\n const contentHTML =\n emojifyText(content, emojis) +\n '\\n' +\n quoteStatusesHTML +\n '\\n' +\n (poll?.options?.length\n ? `\n <p>📊:</p>\n <ul>\n ${poll.options\n .map(\n (option) => `\n <li>\n ${option.title}\n ${option.votesCount >= 0 ? ` (${option.votesCount})` : ''}\n </li>\n `,\n )\n .join('')}\n </ul>`\n : '') +\n (mediaAttachments.length > 0\n ? '\\n' +\n mediaAttachments\n .map((media) => {\n const {\n description,\n meta,\n previewRemoteUrl,\n previewUrl,\n remoteUrl,\n url,\n type,\n } = media;\n const { original = {}, small } = meta || {};\n const width = small?.width || original?.width;\n const height = small?.height || original?.height;\n\n // Prefer remote over original\n const sourceMediaURL = remoteUrl || url;\n const previewMediaURL = previewRemoteUrl || previewUrl;\n const mediaURL = previewMediaURL || sourceMediaURL;\n\n const sourceMediaURLObj = sourceMediaURL\n ? URL.parse(sourceMediaURL)\n : null;\n const isVideoMaybe =\n type === 'unknown' &&\n sourceMediaURLObj &&\n /\\.(mp4|m4r|m4v|mov|webm)$/i.test(sourceMediaURLObj.pathname);\n const isAudioMaybe =\n type === 'unknown' &&\n sourceMediaURLObj &&\n /\\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(sourceMediaURLObj.pathname);\n const isImage =\n type === 'image' ||\n (type === 'unknown' &&\n previewMediaURL &&\n !isVideoMaybe &&\n !isAudioMaybe);\n const isVideo = type === 'gifv' || type === 'video' || isVideoMaybe;\n const isAudio = type === 'audio' || isAudioMaybe;\n\n let mediaHTML = '';\n if (isImage) {\n mediaHTML = `<img src=\"${mediaURL}\" width=\"${width}\" height=\"${height}\" alt=\"${description}\" loading=\"lazy\" />`;\n } else if (isVideo) {\n mediaHTML = `\n <video src=\"${sourceMediaURL}\" width=\"${width}\" height=\"${height}\" controls preload=\"auto\" poster=\"${previewMediaURL}\" loading=\"lazy\"></video>\n ${description ? `<figcaption>${description}</figcaption>` : ''}\n `;\n } else if (isAudio) {\n mediaHTML = `\n <audio src=\"${sourceMediaURL}\" controls preload=\"auto\"></audio>\n ${description ? `<figcaption>${description}</figcaption>` : ''}\n `;\n } else {\n mediaHTML = `\n <a href=\"${sourceMediaURL}\">📄 ${\n description || sourceMediaURL\n }</a>\n `;\n }\n\n return `<figure>${mediaHTML}</figure>`;\n })\n .join('\\n')\n : '');\n\n const htmlCode = `\n <blockquote lang=\"${language}\" cite=\"${url}\" data-source=\"fediverse\">\n ${\n spoilerText\n ? `\n <details>\n <summary>${spoilerText}</summary>\n ${contentHTML}\n </details>\n `\n : contentHTML\n }\n <footer>\n — ${emojifyText(\n displayName,\n accountEmojis,\n )} (@${acct}) <a href=\"${url}\"><time datetime=\"${createdAtDate.toISOString()}\">${createdAtDate.toLocaleString()}</time></a>\n </footer>\n </blockquote>\n `;\n\n return prettify(htmlCode);\n}\n\nfunction EmbedModal({ post, instance, onClose }) {\n const { t } = useLingui();\n const {\n account: {\n url: accountURL,\n displayName,\n username,\n emojis: accountEmojis,\n bot,\n group,\n },\n id,\n poll,\n spoilerText,\n language,\n editedAt,\n createdAt,\n content,\n mediaAttachments,\n url,\n emojis,\n } = post;\n\n const htmlCode = generateHTMLCode(post, instance);\n return (\n <div id=\"embed-post\" class=\"sheet\">\n {!!onClose && (\n <button type=\"button\" class=\"sheet-close\" onClick={onClose}>\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n )}\n <header>\n <h2>\n <Trans>Embed post</Trans>\n </h2>\n </header>\n <main tabIndex=\"-1\">\n <h3>\n <Trans>HTML Code</Trans>\n </h3>\n <textarea\n class=\"embed-code\"\n readonly\n onClick={(e) => {\n e.target.select();\n }}\n dir=\"auto\"\n >\n {htmlCode}\n </textarea>\n <button\n type=\"button\"\n onClick={() => {\n try {\n navigator.clipboard.writeText(htmlCode);\n showToast(t`HTML code copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy HTML code`);\n }\n }}\n >\n <Icon icon=\"clipboard\" />{' '}\n <span>\n <Trans>Copy</Trans>\n </span>\n </button>\n {!!mediaAttachments?.length && (\n <section>\n <p>\n <Trans>Media attachments:</Trans>\n </p>\n <ol class=\"links-list\">\n {mediaAttachments.map((media) => {\n return (\n <li key={media.id}>\n <a\n href={media.remoteUrl || media.url}\n target=\"_blank\"\n download\n >\n {media.remoteUrl || media.url}\n </a>\n </li>\n );\n })}\n </ol>\n </section>\n )}\n {!!accountEmojis?.length && (\n <section>\n <p>\n <Trans>Account Emojis:</Trans>\n </p>\n <ul>\n {accountEmojis.map((emoji) => {\n return (\n <li key={emoji.shortcode}>\n <picture>\n <source\n srcset={emoji.staticUrl}\n media=\"(prefers-reduced-motion: reduce)\"\n ></source>\n <img\n class=\"shortcode-emoji emoji\"\n src={emoji.url}\n alt={`:${emoji.shortcode}:`}\n width=\"16\"\n height=\"16\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </picture>{' '}\n <code>:{emoji.shortcode}:</code> (\n <a href={emoji.url} target=\"_blank\" download>\n URL\n </a>\n )\n {emoji.staticUrl ? (\n <>\n {' '}\n (\n <a href={emoji.staticUrl} target=\"_blank\" download>\n <Trans>static URL</Trans>\n </a>\n )\n </>\n ) : null}\n </li>\n );\n })}\n </ul>\n </section>\n )}\n {!!emojis?.length && (\n <section>\n <p>\n <Trans>Emojis:</Trans>\n </p>\n <ul>\n {emojis.map((emoji) => {\n return (\n <li key={emoji.shortcode}>\n <picture>\n <source\n srcset={emoji.staticUrl}\n media=\"(prefers-reduced-motion: reduce)\"\n ></source>\n <img\n class=\"shortcode-emoji emoji\"\n src={emoji.url}\n alt={`:${emoji.shortcode}:`}\n width=\"16\"\n height=\"16\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </picture>{' '}\n <code>:{emoji.shortcode}:</code> (\n <a href={emoji.url} target=\"_blank\" download>\n URL\n </a>\n )\n {emoji.staticUrl ? (\n <>\n {' '}\n (\n <a href={emoji.staticUrl} target=\"_blank\" download>\n <Trans>static URL</Trans>\n </a>\n )\n </>\n ) : null}\n </li>\n );\n })}\n </ul>\n </section>\n )}\n <section>\n <small>\n <p>\n <Trans>Notes:</Trans>\n </p>\n <ul>\n <li>\n <Trans>\n This is static, unstyled and scriptless. You may need to apply\n your own styles and edit as needed.\n </Trans>\n </li>\n <li>\n <Trans>\n Polls are not interactive, becomes a list with vote counts.\n </Trans>\n </li>\n <li>\n <Trans>\n Media attachments can be images, videos, audios or any file\n types.\n </Trans>\n </li>\n <li>\n <Trans>Post could be edited or deleted later.</Trans>\n </li>\n </ul>\n </small>\n </section>\n <h3>\n <Trans>Preview</Trans>\n </h3>\n <output\n class=\"embed-preview\"\n dangerouslySetInnerHTML={{ __html: htmlCode }}\n dir=\"auto\"\n />\n <p>\n <small>\n <Trans>Note: This preview is lightly styled.</Trans>\n </small>\n </p>\n </main>\n </div>\n );\n}\n\nconst StatusButton = forwardRef((props, ref) => {\n let {\n checked,\n count,\n class: className,\n title,\n alt,\n size,\n icon,\n iconSize = 'l',\n onClick,\n ...otherProps\n } = props;\n if (typeof title === 'string') {\n title = [title, title];\n }\n if (typeof alt === 'string') {\n alt = [alt, alt];\n }\n\n const [buttonTitle, setButtonTitle] = useState(title[0] || '');\n const [iconAlt, setIconAlt] = useState(alt[0] || '');\n\n useEffect(() => {\n if (checked) {\n setButtonTitle(title[1] || '');\n setIconAlt(alt[1] || '');\n } else {\n setButtonTitle(title[0] || '');\n setIconAlt(alt[0] || '');\n }\n }, [checked, title, alt]);\n\n return (\n <button\n ref={ref}\n type=\"button\"\n title={buttonTitle}\n class={`plain ${size ? 'small' : ''} ${className} ${\n checked ? 'checked' : ''\n }`}\n onClick={(e) => {\n if (!onClick) return;\n e.preventDefault();\n e.stopPropagation();\n onClick(e);\n }}\n {...otherProps}\n >\n <Icon icon={icon} size={iconSize} alt={iconAlt} />\n {!!count && (\n <>\n {' '}\n <small title={count}>{shortenNumber(count)}</small>\n </>\n )}\n </button>\n );\n});\n\nfunction nicePostURL(url) {\n if (!url) return;\n const urlObj = URL.parse(url);\n const { host, pathname } = urlObj;\n const path = pathname.replace(/\\/$/, '');\n // split only first slash\n const [_, username, restPath] = path.match(/\\/(@[^\\/]+)\\/(.*)/) || [];\n return (\n <>\n {punycode.toUnicode(host)}\n {username ? (\n <>\n /{username}\n <wbr />\n <span class=\"more-insignificant\">/{restPath}</span>\n </>\n ) : (\n <span class=\"more-insignificant\">{path}</span>\n )}\n </>\n );\n}\n\nfunction StatusCompact({ sKey }) {\n const snapStates = useSnapshot(states);\n const statusReply = snapStates.statusReply[sKey];\n if (!statusReply) return null;\n\n const { id, instance } = statusReply;\n const status = getStatus(id, instance);\n if (!status) return null;\n\n const {\n sensitive,\n spoilerText,\n account: { avatar, avatarStatic, bot } = {},\n visibility,\n content,\n language,\n filtered,\n } = status;\n if (sensitive || spoilerText) return null;\n if (!content) return null;\n\n const srKey = statusKey(id, instance);\n const statusPeekText = statusPeek(status);\n\n const filterContext = useContext(FilterContext);\n const filterInfo = isFiltered(filtered, filterContext);\n\n if (filterInfo?.action === 'hide') return null;\n\n const filterTitleStr = filterInfo?.titlesStr || '';\n\n return (\n <article\n class={`status compact-reply ${\n visibility === 'direct' ? 'visibility-direct' : ''\n }`}\n tabindex=\"-1\"\n data-state-post-id={srKey}\n >\n <Avatar url={avatarStatic || avatar} squircle={bot} />\n <div\n class=\"content-compact\"\n title={statusPeekText}\n lang={language}\n dir=\"auto\"\n >\n {filterInfo ? (\n <b class=\"status-filtered-badge badge-meta\" title={filterTitleStr}>\n <span>\n <Trans>Filtered</Trans>\n </span>\n <span>{filterTitleStr}</span>\n </b>\n ) : (\n <span>{statusPeekText}</span>\n )}\n </div>\n </article>\n );\n}\n\nfunction FilteredStatus({\n status,\n filterInfo,\n instance,\n containerProps = {},\n showFollowedTags,\n quoted,\n}) {\n const { _, t } = useLingui();\n const snapStates = useSnapshot(states);\n const {\n id: statusID,\n account: { avatar, avatarStatic, bot, group },\n createdAt,\n visibility,\n reblog,\n } = status;\n const isReblog = !!reblog;\n const filterTitleStr = filterInfo?.titlesStr || '';\n const createdAtDate = new Date(createdAt);\n const statusPeekText = statusPeek(status.reblog || status);\n\n const [showPeek, setShowPeek] = useState(false);\n const bindLongPressPeek = useLongPress(\n () => {\n setShowPeek(true);\n },\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 statusPeekRef = useTruncated();\n const sKey = statusKey(status.id, instance);\n const ssKey =\n statusKey(status.id, instance) +\n ' ' +\n (statusKey(reblog?.id, instance) || '');\n\n const actualStatusID = reblog?.id || statusID;\n const url = instance\n ? `/${instance}/s/${actualStatusID}`\n : `/s/${actualStatusID}`;\n const isFollowedTags =\n showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length;\n\n return (\n <div\n class={\n quoted\n ? ''\n : isReblog\n ? group\n ? 'status-group'\n : 'status-reblog'\n : isFollowedTags\n ? 'status-followed-tags'\n : ''\n }\n {...containerProps}\n // title={statusPeekText}\n onContextMenu={(e) => {\n e.preventDefault();\n setShowPeek(true);\n }}\n {...bindLongPressPeek()}\n >\n <article\n data-state-post-id={ssKey}\n class={`status filtered ${quoted ? 'status-card' : ''}`}\n tabindex=\"-1\"\n >\n <b\n class=\"status-filtered-badge clickable badge-meta\"\n title={filterTitleStr}\n onClick={(e) => {\n e.preventDefault();\n setShowPeek(true);\n }}\n >\n <span>\n <Trans>Filtered</Trans>\n </span>\n <span>{filterTitleStr}</span>\n </b>{' '}\n <Avatar url={avatarStatic || avatar} squircle={bot} />\n <span class=\"status-filtered-info\">\n <span class=\"status-filtered-info-1\">\n {isReblog ? (\n <Trans comment=\"[Name] [Visibility icon] boosted\">\n <NameText account={status.account} instance={instance} />{' '}\n <Icon\n icon={visibilityIconsMap[visibility]}\n alt={_(visibilityText[visibility])}\n size=\"s\"\n />{' '}\n boosted\n </Trans>\n ) : isFollowedTags ? (\n <>\n <NameText account={status.account} instance={instance} />{' '}\n <Icon\n icon={visibilityIconsMap[visibility]}\n alt={_(visibilityText[visibility])}\n size=\"s\"\n />{' '}\n <span>\n {snapStates.statusFollowedTags[sKey]\n .slice(0, 3)\n .map((tag) => (\n <span key={tag} class=\"status-followed-tag-item\">\n #{tag}\n </span>\n ))}\n </span>\n </>\n ) : (\n <>\n <NameText account={status.account} instance={instance} />{' '}\n <Icon\n icon={visibilityIconsMap[visibility]}\n alt={_(visibilityText[visibility])}\n size=\"s\"\n />{' '}\n <RelativeTime datetime={createdAtDate} format=\"micro\" />\n </>\n )}\n </span>\n <span class=\"status-filtered-info-2\">\n {isReblog && (\n <>\n <Avatar\n url={reblog.account.avatarStatic || reblog.account.avatar}\n squircle={bot}\n />{' '}\n </>\n )}\n {statusPeekText}\n </span>\n </span>\n </article>\n {!!showPeek && (\n <Modal\n onClick={(e) => {\n if (e.target === e.currentTarget) {\n setShowPeek(false);\n }\n }}\n >\n <div id=\"filtered-status-peek\" class=\"sheet\">\n <button\n type=\"button\"\n class=\"sheet-close\"\n onClick={() => setShowPeek(false)}\n >\n <Icon icon=\"x\" alt={t`Close`} />\n </button>\n <header>\n <b class=\"status-filtered-badge\">\n <Trans>Filtered</Trans>\n </b>{' '}\n {filterTitleStr}\n </header>\n <main tabIndex=\"-1\">\n <Link\n ref={statusPeekRef}\n class=\"status-link\"\n to={url}\n onClick={() => {\n setShowPeek(false);\n }}\n data-read-more={_(readMoreText)}\n >\n <Status status={status} instance={instance} size=\"s\" readOnly />\n </Link>\n </main>\n </div>\n </Modal>\n )}\n </div>\n );\n}\n\nconst QuoteStatuses = memo(({ id, instance, level = 0 }) => {\n if (!id || !instance) return;\n const { _ } = useLingui();\n const snapStates = useSnapshot(states);\n const sKey = statusKey(id, instance);\n const quotes = snapStates.statusQuotes[sKey];\n const uniqueQuotes = quotes?.filter(\n (q, i, arr) => arr.findIndex((q2) => q2.url === q.url) === i,\n );\n\n if (!uniqueQuotes?.length) return;\n if (level > 2) return;\n\n return uniqueQuotes.map((q) => {\n return (\n <LazyShazam id={q.instance + q.id}>\n <Link\n key={q.instance + q.id}\n to={`${q.instance ? `/${q.instance}` : ''}/s/${q.id}`}\n class=\"status-card-link\"\n data-read-more={_(readMoreText)}\n >\n <Status\n statusID={q.id}\n instance={q.instance}\n size=\"s\"\n quoted={level + 1}\n enableCommentHint\n />\n </Link>\n </LazyShazam>\n );\n });\n});\n\nexport default memo(Status, (oldProps, newProps) => {\n // Shallow equal all props except 'status'\n // This will be pure static until status ID changes\n const { status, ...restOldProps } = oldProps;\n const { status: newStatus, ...restNewProps } = newProps;\n return (\n status?.id === newStatus?.id && shallowEqual(restOldProps, restNewProps)\n );\n});\n","var IDX=36, HEX='';\nwhile (IDX--) HEX += IDX.toString(36);\n\nexport function uid(len) {\n\tvar str='', num = len || 11;\n\twhile (num--) str += HEX[Math.random() * 36 | 0];\n\treturn str;\n}\n","/**\n * Fuse.js v7.0.0 - Lightweight fuzzy-search (http://fusejs.io)\n *\n * Copyright (c) 2023 Kiro Risk (http://kiro.me)\n * All Rights Reserved. Apache Software License 2.0\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction isArray(value) {\n return !Array.isArray\n ? getTag(value) === '[object Array]'\n : Array.isArray(value)\n}\n\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js\nconst INFINITY = 1 / 0;\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value\n }\n let result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result\n}\n\nfunction toString(value) {\n return value == null ? '' : baseToString(value)\n}\n\nfunction isString(value) {\n return typeof value === 'string'\n}\n\nfunction isNumber(value) {\n return typeof value === 'number'\n}\n\n// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js\nfunction isBoolean(value) {\n return (\n value === true ||\n value === false ||\n (isObjectLike(value) && getTag(value) == '[object Boolean]')\n )\n}\n\nfunction isObject(value) {\n return typeof value === 'object'\n}\n\n// Checks if `value` is object-like.\nfunction isObjectLike(value) {\n return isObject(value) && value !== null\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null\n}\n\nfunction isBlank(value) {\n return !value.trim().length\n}\n\n// Gets the `toStringTag` of `value`.\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js\nfunction getTag(value) {\n return value == null\n ? value === undefined\n ? '[object Undefined]'\n : '[object Null]'\n : Object.prototype.toString.call(value)\n}\n\nconst EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';\n\nconst INCORRECT_INDEX_TYPE = \"Incorrect 'index' type\";\n\nconst LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) =>\n `Invalid value for key ${key}`;\n\nconst PATTERN_LENGTH_TOO_LARGE = (max) =>\n `Pattern length exceeds max of ${max}.`;\n\nconst MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;\n\nconst INVALID_KEY_WEIGHT_VALUE = (key) =>\n `Property 'weight' in key '${key}' must be a positive integer`;\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nclass KeyStore {\n constructor(keys) {\n this._keys = [];\n this._keyMap = {};\n\n let totalWeight = 0;\n\n keys.forEach((key) => {\n let obj = createKey(key);\n\n this._keys.push(obj);\n this._keyMap[obj.id] = obj;\n\n totalWeight += obj.weight;\n });\n\n // Normalize weights so that their sum is equal to 1\n this._keys.forEach((key) => {\n key.weight /= totalWeight;\n });\n }\n get(keyId) {\n return this._keyMap[keyId]\n }\n keys() {\n return this._keys\n }\n toJSON() {\n return JSON.stringify(this._keys)\n }\n}\n\nfunction createKey(key) {\n let path = null;\n let id = null;\n let src = null;\n let weight = 1;\n let getFn = null;\n\n if (isString(key) || isArray(key)) {\n src = key;\n path = createKeyPath(key);\n id = createKeyId(key);\n } else {\n if (!hasOwn.call(key, 'name')) {\n throw new Error(MISSING_KEY_PROPERTY('name'))\n }\n\n const name = key.name;\n src = name;\n\n if (hasOwn.call(key, 'weight')) {\n weight = key.weight;\n\n if (weight <= 0) {\n throw new Error(INVALID_KEY_WEIGHT_VALUE(name))\n }\n }\n\n path = createKeyPath(name);\n id = createKeyId(name);\n getFn = key.getFn;\n }\n\n return { path, id, weight, src, getFn }\n}\n\nfunction createKeyPath(key) {\n return isArray(key) ? key : key.split('.')\n}\n\nfunction createKeyId(key) {\n return isArray(key) ? key.join('.') : key\n}\n\nfunction get(obj, path) {\n let list = [];\n let arr = false;\n\n const deepGet = (obj, path, index) => {\n if (!isDefined(obj)) {\n return\n }\n if (!path[index]) {\n // If there's no path left, we've arrived at the object we care about.\n list.push(obj);\n } else {\n let key = path[index];\n\n const value = obj[key];\n\n if (!isDefined(value)) {\n return\n }\n\n // If we're at the last value in the path, and if it's a string/number/bool,\n // add it to the list\n if (\n index === path.length - 1 &&\n (isString(value) || isNumber(value) || isBoolean(value))\n ) {\n list.push(toString(value));\n } else if (isArray(value)) {\n arr = true;\n // Search each item in the array.\n for (let i = 0, len = value.length; i < len; i += 1) {\n deepGet(value[i], path, index + 1);\n }\n } else if (path.length) {\n // An object. Recurse further.\n deepGet(value, path, index + 1);\n }\n }\n };\n\n // Backwards compatibility (since path used to be a string)\n deepGet(obj, isString(path) ? path.split('.') : path, 0);\n\n return arr ? list : list[0]\n}\n\nconst MatchOptions = {\n // Whether the matches should be included in the result set. When `true`, each record in the result\n // set will include the indices of the matched characters.\n // These can consequently be used for highlighting purposes.\n includeMatches: false,\n // When `true`, the matching function will continue to the end of a search pattern even if\n // a perfect match has already been located in the string.\n findAllMatches: false,\n // Minimum number of characters that must be matched before a result is considered a match\n minMatchCharLength: 1\n};\n\nconst BasicOptions = {\n // When `true`, the algorithm continues searching to the end of the input even if a perfect\n // match is found before the end of the same input.\n isCaseSensitive: false,\n // When true, the matching function will continue to the end of a search pattern even if\n includeScore: false,\n // List of properties that will be searched. This also supports nested properties.\n keys: [],\n // Whether to sort the result list, by score\n shouldSort: true,\n // Default sort function: sort by ascending score, ascending index\n sortFn: (a, b) =>\n a.score === b.score ? (a.idx < b.idx ? -1 : 1) : a.score < b.score ? -1 : 1\n};\n\nconst FuzzyOptions = {\n // Approximately where in the text is the pattern expected to be found?\n location: 0,\n // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match\n // (of both letters and location), a threshold of '1.0' would match anything.\n threshold: 0.6,\n // Determines how close the match must be to the fuzzy location (specified above).\n // An exact letter match which is 'distance' characters away from the fuzzy location\n // would score as a complete mismatch. A distance of '0' requires the match be at\n // the exact location specified, a threshold of '1000' would require a perfect match\n // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.\n distance: 100\n};\n\nconst AdvancedOptions = {\n // When `true`, it enables the use of unix-like search commands\n useExtendedSearch: false,\n // The get function to use when fetching an object's properties.\n // The default will search nested paths *ie foo.bar.baz*\n getFn: get,\n // When `true`, search will ignore `location` and `distance`, so it won't matter\n // where in the string the pattern appears.\n // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score\n ignoreLocation: false,\n // When `true`, the calculation for the relevance score (used for sorting) will\n // ignore the field-length norm.\n // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm\n ignoreFieldNorm: false,\n // The weight to determine how much field length norm effects scoring.\n fieldNormWeight: 1\n};\n\nvar Config = {\n ...BasicOptions,\n ...MatchOptions,\n ...FuzzyOptions,\n ...AdvancedOptions\n};\n\nconst SPACE = /[^ ]+/g;\n\n// Field-length norm: the shorter the field, the higher the weight.\n// Set to 3 decimals to reduce index size.\nfunction norm(weight = 1, mantissa = 3) {\n const cache = new Map();\n const m = Math.pow(10, mantissa);\n\n return {\n get(value) {\n const numTokens = value.match(SPACE).length;\n\n if (cache.has(numTokens)) {\n return cache.get(numTokens)\n }\n\n // Default function is 1/sqrt(x), weight makes that variable\n const norm = 1 / Math.pow(numTokens, 0.5 * weight);\n\n // In place of `toFixed(mantissa)`, for faster computation\n const n = parseFloat(Math.round(norm * m) / m);\n\n cache.set(numTokens, n);\n\n return n\n },\n clear() {\n cache.clear();\n }\n }\n}\n\nclass FuseIndex {\n constructor({\n getFn = Config.getFn,\n fieldNormWeight = Config.fieldNormWeight\n } = {}) {\n this.norm = norm(fieldNormWeight, 3);\n this.getFn = getFn;\n this.isCreated = false;\n\n this.setIndexRecords();\n }\n setSources(docs = []) {\n this.docs = docs;\n }\n setIndexRecords(records = []) {\n this.records = records;\n }\n setKeys(keys = []) {\n this.keys = keys;\n this._keysMap = {};\n keys.forEach((key, idx) => {\n this._keysMap[key.id] = idx;\n });\n }\n create() {\n if (this.isCreated || !this.docs.length) {\n return\n }\n\n this.isCreated = true;\n\n // List is Array<String>\n if (isString(this.docs[0])) {\n this.docs.forEach((doc, docIndex) => {\n this._addString(doc, docIndex);\n });\n } else {\n // List is Array<Object>\n this.docs.forEach((doc, docIndex) => {\n this._addObject(doc, docIndex);\n });\n }\n\n this.norm.clear();\n }\n // Adds a doc to the end of the index\n add(doc) {\n const idx = this.size();\n\n if (isString(doc)) {\n this._addString(doc, idx);\n } else {\n this._addObject(doc, idx);\n }\n }\n // Removes the doc at the specified index of the index\n removeAt(idx) {\n this.records.splice(idx, 1);\n\n // Change ref index of every subsquent doc\n for (let i = idx, len = this.size(); i < len; i += 1) {\n this.records[i].i -= 1;\n }\n }\n getValueForItemAtKeyId(item, keyId) {\n return item[this._keysMap[keyId]]\n }\n size() {\n return this.records.length\n }\n _addString(doc, docIndex) {\n if (!isDefined(doc) || isBlank(doc)) {\n return\n }\n\n let record = {\n v: doc,\n i: docIndex,\n n: this.norm.get(doc)\n };\n\n this.records.push(record);\n }\n _addObject(doc, docIndex) {\n let record = { i: docIndex, $: {} };\n\n // Iterate over every key (i.e, path), and fetch the value at that key\n this.keys.forEach((key, keyIndex) => {\n let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);\n\n if (!isDefined(value)) {\n return\n }\n\n if (isArray(value)) {\n let subRecords = [];\n const stack = [{ nestedArrIndex: -1, value }];\n\n while (stack.length) {\n const { nestedArrIndex, value } = stack.pop();\n\n if (!isDefined(value)) {\n continue\n }\n\n if (isString(value) && !isBlank(value)) {\n let subRecord = {\n v: value,\n i: nestedArrIndex,\n n: this.norm.get(value)\n };\n\n subRecords.push(subRecord);\n } else if (isArray(value)) {\n value.forEach((item, k) => {\n stack.push({\n nestedArrIndex: k,\n value: item\n });\n });\n } else ;\n }\n record.$[keyIndex] = subRecords;\n } else if (isString(value) && !isBlank(value)) {\n let subRecord = {\n v: value,\n n: this.norm.get(value)\n };\n\n record.$[keyIndex] = subRecord;\n }\n });\n\n this.records.push(record);\n }\n toJSON() {\n return {\n keys: this.keys,\n records: this.records\n }\n }\n}\n\nfunction createIndex(\n keys,\n docs,\n { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}\n) {\n const myIndex = new FuseIndex({ getFn, fieldNormWeight });\n myIndex.setKeys(keys.map(createKey));\n myIndex.setSources(docs);\n myIndex.create();\n return myIndex\n}\n\nfunction parseIndex(\n data,\n { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}\n) {\n const { keys, records } = data;\n const myIndex = new FuseIndex({ getFn, fieldNormWeight });\n myIndex.setKeys(keys);\n myIndex.setIndexRecords(records);\n return myIndex\n}\n\nfunction computeScore$1(\n pattern,\n {\n errors = 0,\n currentLocation = 0,\n expectedLocation = 0,\n distance = Config.distance,\n ignoreLocation = Config.ignoreLocation\n } = {}\n) {\n const accuracy = errors / pattern.length;\n\n if (ignoreLocation) {\n return accuracy\n }\n\n const proximity = Math.abs(expectedLocation - currentLocation);\n\n if (!distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy\n }\n\n return accuracy + proximity / distance\n}\n\nfunction convertMaskToIndices(\n matchmask = [],\n minMatchCharLength = Config.minMatchCharLength\n) {\n let indices = [];\n let start = -1;\n let end = -1;\n let i = 0;\n\n for (let len = matchmask.length; i < len; i += 1) {\n let match = matchmask[i];\n if (match && start === -1) {\n start = i;\n } else if (!match && start !== -1) {\n end = i - 1;\n if (end - start + 1 >= minMatchCharLength) {\n indices.push([start, end]);\n }\n start = -1;\n }\n }\n\n // (i-1 - start) + 1 => i - start\n if (matchmask[i - 1] && i - start >= minMatchCharLength) {\n indices.push([start, i - 1]);\n }\n\n return indices\n}\n\n// Machine word size\nconst MAX_BITS = 32;\n\nfunction search(\n text,\n pattern,\n patternAlphabet,\n {\n location = Config.location,\n distance = Config.distance,\n threshold = Config.threshold,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n includeMatches = Config.includeMatches,\n ignoreLocation = Config.ignoreLocation\n } = {}\n) {\n if (pattern.length > MAX_BITS) {\n throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS))\n }\n\n const patternLen = pattern.length;\n // Set starting location at beginning text and initialize the alphabet.\n const textLen = text.length;\n // Handle the case when location > text.length\n const expectedLocation = Math.max(0, Math.min(location, textLen));\n // Highest score beyond which we give up.\n let currentThreshold = threshold;\n // Is there a nearby exact match? (speedup)\n let bestLocation = expectedLocation;\n\n // Performance: only computer matches when the minMatchCharLength > 1\n // OR if `includeMatches` is true.\n const computeMatches = minMatchCharLength > 1 || includeMatches;\n // A mask of the matches, used for building the indices\n const matchMask = computeMatches ? Array(textLen) : [];\n\n let index;\n\n // Get all exact matches, here for speed up\n while ((index = text.indexOf(pattern, bestLocation)) > -1) {\n let score = computeScore$1(pattern, {\n currentLocation: index,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n currentThreshold = Math.min(score, currentThreshold);\n bestLocation = index + patternLen;\n\n if (computeMatches) {\n let i = 0;\n while (i < patternLen) {\n matchMask[index + i] = 1;\n i += 1;\n }\n }\n }\n\n // Reset the best location\n bestLocation = -1;\n\n let lastBitArr = [];\n let finalScore = 1;\n let binMax = patternLen + textLen;\n\n const mask = 1 << (patternLen - 1);\n\n for (let i = 0; i < patternLen; i += 1) {\n // Scan for the best match; each iteration allows for one more error.\n // Run a binary search to determine how far from the match location we can stray\n // at this error level.\n let binMin = 0;\n let binMid = binMax;\n\n while (binMin < binMid) {\n const score = computeScore$1(pattern, {\n errors: i,\n currentLocation: expectedLocation + binMid,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n if (score <= currentThreshold) {\n binMin = binMid;\n } else {\n binMax = binMid;\n }\n\n binMid = Math.floor((binMax - binMin) / 2 + binMin);\n }\n\n // Use the result from this iteration as the maximum for the next.\n binMax = binMid;\n\n let start = Math.max(1, expectedLocation - binMid + 1);\n let finish = findAllMatches\n ? textLen\n : Math.min(expectedLocation + binMid, textLen) + patternLen;\n\n // Initialize the bit array\n let bitArr = Array(finish + 2);\n\n bitArr[finish + 1] = (1 << i) - 1;\n\n for (let j = finish; j >= start; j -= 1) {\n let currentLocation = j - 1;\n let charMatch = patternAlphabet[text.charAt(currentLocation)];\n\n if (computeMatches) {\n // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)\n matchMask[currentLocation] = +!!charMatch;\n }\n\n // First pass: exact match\n bitArr[j] = ((bitArr[j + 1] << 1) | 1) & charMatch;\n\n // Subsequent passes: fuzzy match\n if (i) {\n bitArr[j] |=\n ((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1 | lastBitArr[j + 1];\n }\n\n if (bitArr[j] & mask) {\n finalScore = computeScore$1(pattern, {\n errors: i,\n currentLocation,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n // This match will almost certainly be better than any existing match.\n // But check anyway.\n if (finalScore <= currentThreshold) {\n // Indeed it is\n currentThreshold = finalScore;\n bestLocation = currentLocation;\n\n // Already passed `loc`, downhill from here on in.\n if (bestLocation <= expectedLocation) {\n break\n }\n\n // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.\n start = Math.max(1, 2 * expectedLocation - bestLocation);\n }\n }\n }\n\n // No hope for a (better) match at greater error levels.\n const score = computeScore$1(pattern, {\n errors: i + 1,\n currentLocation: expectedLocation,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n if (score > currentThreshold) {\n break\n }\n\n lastBitArr = bitArr;\n }\n\n const result = {\n isMatch: bestLocation >= 0,\n // Count exact matches (those with a score of 0) to be \"almost\" exact\n score: Math.max(0.001, finalScore)\n };\n\n if (computeMatches) {\n const indices = convertMaskToIndices(matchMask, minMatchCharLength);\n if (!indices.length) {\n result.isMatch = false;\n } else if (includeMatches) {\n result.indices = indices;\n }\n }\n\n return result\n}\n\nfunction createPatternAlphabet(pattern) {\n let mask = {};\n\n for (let i = 0, len = pattern.length; i < len; i += 1) {\n const char = pattern.charAt(i);\n mask[char] = (mask[char] || 0) | (1 << (len - i - 1));\n }\n\n return mask\n}\n\nclass BitapSearch {\n constructor(\n pattern,\n {\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance,\n includeMatches = Config.includeMatches,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n isCaseSensitive = Config.isCaseSensitive,\n ignoreLocation = Config.ignoreLocation\n } = {}\n ) {\n this.options = {\n location,\n threshold,\n distance,\n includeMatches,\n findAllMatches,\n minMatchCharLength,\n isCaseSensitive,\n ignoreLocation\n };\n\n this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n\n this.chunks = [];\n\n if (!this.pattern.length) {\n return\n }\n\n const addChunk = (pattern, startIndex) => {\n this.chunks.push({\n pattern,\n alphabet: createPatternAlphabet(pattern),\n startIndex\n });\n };\n\n const len = this.pattern.length;\n\n if (len > MAX_BITS) {\n let i = 0;\n const remainder = len % MAX_BITS;\n const end = len - remainder;\n\n while (i < end) {\n addChunk(this.pattern.substr(i, MAX_BITS), i);\n i += MAX_BITS;\n }\n\n if (remainder) {\n const startIndex = len - MAX_BITS;\n addChunk(this.pattern.substr(startIndex), startIndex);\n }\n } else {\n addChunk(this.pattern, 0);\n }\n }\n\n searchIn(text) {\n const { isCaseSensitive, includeMatches } = this.options;\n\n if (!isCaseSensitive) {\n text = text.toLowerCase();\n }\n\n // Exact match\n if (this.pattern === text) {\n let result = {\n isMatch: true,\n score: 0\n };\n\n if (includeMatches) {\n result.indices = [[0, text.length - 1]];\n }\n\n return result\n }\n\n // Otherwise, use Bitap algorithm\n const {\n location,\n distance,\n threshold,\n findAllMatches,\n minMatchCharLength,\n ignoreLocation\n } = this.options;\n\n let allIndices = [];\n let totalScore = 0;\n let hasMatches = false;\n\n this.chunks.forEach(({ pattern, alphabet, startIndex }) => {\n const { isMatch, score, indices } = search(text, pattern, alphabet, {\n location: location + startIndex,\n distance,\n threshold,\n findAllMatches,\n minMatchCharLength,\n includeMatches,\n ignoreLocation\n });\n\n if (isMatch) {\n hasMatches = true;\n }\n\n totalScore += score;\n\n if (isMatch && indices) {\n allIndices = [...allIndices, ...indices];\n }\n });\n\n let result = {\n isMatch: hasMatches,\n score: hasMatches ? totalScore / this.chunks.length : 1\n };\n\n if (hasMatches && includeMatches) {\n result.indices = allIndices;\n }\n\n return result\n }\n}\n\nclass BaseMatch {\n constructor(pattern) {\n this.pattern = pattern;\n }\n static isMultiMatch(pattern) {\n return getMatch(pattern, this.multiRegex)\n }\n static isSingleMatch(pattern) {\n return getMatch(pattern, this.singleRegex)\n }\n search(/*text*/) {}\n}\n\nfunction getMatch(pattern, exp) {\n const matches = pattern.match(exp);\n return matches ? matches[1] : null\n}\n\n// Token: 'file\n\nclass ExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'exact'\n }\n static get multiRegex() {\n return /^=\"(.*)\"$/\n }\n static get singleRegex() {\n return /^=(.*)$/\n }\n search(text) {\n const isMatch = text === this.pattern;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, this.pattern.length - 1]\n }\n }\n}\n\n// Token: !fire\n\nclass InverseExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-exact'\n }\n static get multiRegex() {\n return /^!\"(.*)\"$/\n }\n static get singleRegex() {\n return /^!(.*)$/\n }\n search(text) {\n const index = text.indexOf(this.pattern);\n const isMatch = index === -1;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\n// Token: ^file\n\nclass PrefixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'prefix-exact'\n }\n static get multiRegex() {\n return /^\\^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^\\^(.*)$/\n }\n search(text) {\n const isMatch = text.startsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, this.pattern.length - 1]\n }\n }\n}\n\n// Token: !^fire\n\nclass InversePrefixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-prefix-exact'\n }\n static get multiRegex() {\n return /^!\\^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^!\\^(.*)$/\n }\n search(text) {\n const isMatch = !text.startsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\n// Token: .file$\n\nclass SuffixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'suffix-exact'\n }\n static get multiRegex() {\n return /^\"(.*)\"\\$$/\n }\n static get singleRegex() {\n return /^(.*)\\$$/\n }\n search(text) {\n const isMatch = text.endsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [text.length - this.pattern.length, text.length - 1]\n }\n }\n}\n\n// Token: !.file$\n\nclass InverseSuffixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-suffix-exact'\n }\n static get multiRegex() {\n return /^!\"(.*)\"\\$$/\n }\n static get singleRegex() {\n return /^!(.*)\\$$/\n }\n search(text) {\n const isMatch = !text.endsWith(this.pattern);\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\nclass FuzzyMatch extends BaseMatch {\n constructor(\n pattern,\n {\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance,\n includeMatches = Config.includeMatches,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n isCaseSensitive = Config.isCaseSensitive,\n ignoreLocation = Config.ignoreLocation\n } = {}\n ) {\n super(pattern);\n this._bitapSearch = new BitapSearch(pattern, {\n location,\n threshold,\n distance,\n includeMatches,\n findAllMatches,\n minMatchCharLength,\n isCaseSensitive,\n ignoreLocation\n });\n }\n static get type() {\n return 'fuzzy'\n }\n static get multiRegex() {\n return /^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^(.*)$/\n }\n search(text) {\n return this._bitapSearch.searchIn(text)\n }\n}\n\n// Token: 'file\n\nclass IncludeMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'include'\n }\n static get multiRegex() {\n return /^'\"(.*)\"$/\n }\n static get singleRegex() {\n return /^'(.*)$/\n }\n search(text) {\n let location = 0;\n let index;\n\n const indices = [];\n const patternLen = this.pattern.length;\n\n // Get all exact matches\n while ((index = text.indexOf(this.pattern, location)) > -1) {\n location = index + patternLen;\n indices.push([index, location - 1]);\n }\n\n const isMatch = !!indices.length;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices\n }\n }\n}\n\n// ❗Order is important. DO NOT CHANGE.\nconst searchers = [\n ExactMatch,\n IncludeMatch,\n PrefixExactMatch,\n InversePrefixExactMatch,\n InverseSuffixExactMatch,\n SuffixExactMatch,\n InverseExactMatch,\n FuzzyMatch\n];\n\nconst searchersLen = searchers.length;\n\n// Regex to split by spaces, but keep anything in quotes together\nconst SPACE_RE = / +(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)/;\nconst OR_TOKEN = '|';\n\n// Return a 2D array representation of the query, for simpler parsing.\n// Example:\n// \"^core go$ | rb$ | py$ xy$\" => [[\"^core\", \"go$\"], [\"rb$\"], [\"py$\", \"xy$\"]]\nfunction parseQuery(pattern, options = {}) {\n return pattern.split(OR_TOKEN).map((item) => {\n let query = item\n .trim()\n .split(SPACE_RE)\n .filter((item) => item && !!item.trim());\n\n let results = [];\n for (let i = 0, len = query.length; i < len; i += 1) {\n const queryItem = query[i];\n\n // 1. Handle multiple query match (i.e, once that are quoted, like `\"hello world\"`)\n let found = false;\n let idx = -1;\n while (!found && ++idx < searchersLen) {\n const searcher = searchers[idx];\n let token = searcher.isMultiMatch(queryItem);\n if (token) {\n results.push(new searcher(token, options));\n found = true;\n }\n }\n\n if (found) {\n continue\n }\n\n // 2. Handle single query matches (i.e, once that are *not* quoted)\n idx = -1;\n while (++idx < searchersLen) {\n const searcher = searchers[idx];\n let token = searcher.isSingleMatch(queryItem);\n if (token) {\n results.push(new searcher(token, options));\n break\n }\n }\n }\n\n return results\n })\n}\n\n// These extended matchers can return an array of matches, as opposed\n// to a singl match\nconst MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);\n\n/**\n * Command-like searching\n * ======================\n *\n * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,\n * search in a given text.\n *\n * Search syntax:\n *\n * | Token | Match type | Description |\n * | ----------- | -------------------------- | -------------------------------------- |\n * | `jscript` | fuzzy-match | Items that fuzzy match `jscript` |\n * | `=scheme` | exact-match | Items that are `scheme` |\n * | `'python` | include-match | Items that include `python` |\n * | `!ruby` | inverse-exact-match | Items that do not include `ruby` |\n * | `^java` | prefix-exact-match | Items that start with `java` |\n * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |\n * | `.js$` | suffix-exact-match | Items that end with `.js` |\n * | `!.go$` | inverse-suffix-exact-match | Items that do not end with `.go` |\n *\n * A single pipe character acts as an OR operator. For example, the following\n * query matches entries that start with `core` and end with either`go`, `rb`,\n * or`py`.\n *\n * ```\n * ^core go$ | rb$ | py$\n * ```\n */\nclass ExtendedSearch {\n constructor(\n pattern,\n {\n isCaseSensitive = Config.isCaseSensitive,\n includeMatches = Config.includeMatches,\n minMatchCharLength = Config.minMatchCharLength,\n ignoreLocation = Config.ignoreLocation,\n findAllMatches = Config.findAllMatches,\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance\n } = {}\n ) {\n this.query = null;\n this.options = {\n isCaseSensitive,\n includeMatches,\n minMatchCharLength,\n findAllMatches,\n ignoreLocation,\n location,\n threshold,\n distance\n };\n\n this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n this.query = parseQuery(this.pattern, this.options);\n }\n\n static condition(_, options) {\n return options.useExtendedSearch\n }\n\n searchIn(text) {\n const query = this.query;\n\n if (!query) {\n return {\n isMatch: false,\n score: 1\n }\n }\n\n const { includeMatches, isCaseSensitive } = this.options;\n\n text = isCaseSensitive ? text : text.toLowerCase();\n\n let numMatches = 0;\n let allIndices = [];\n let totalScore = 0;\n\n // ORs\n for (let i = 0, qLen = query.length; i < qLen; i += 1) {\n const searchers = query[i];\n\n // Reset indices\n allIndices.length = 0;\n numMatches = 0;\n\n // ANDs\n for (let j = 0, pLen = searchers.length; j < pLen; j += 1) {\n const searcher = searchers[j];\n const { isMatch, indices, score } = searcher.search(text);\n\n if (isMatch) {\n numMatches += 1;\n totalScore += score;\n if (includeMatches) {\n const type = searcher.constructor.type;\n if (MultiMatchSet.has(type)) {\n allIndices = [...allIndices, ...indices];\n } else {\n allIndices.push(indices);\n }\n }\n } else {\n totalScore = 0;\n numMatches = 0;\n allIndices.length = 0;\n break\n }\n }\n\n // OR condition, so if TRUE, return\n if (numMatches) {\n let result = {\n isMatch: true,\n score: totalScore / numMatches\n };\n\n if (includeMatches) {\n result.indices = allIndices;\n }\n\n return result\n }\n }\n\n // Nothing was matched\n return {\n isMatch: false,\n score: 1\n }\n }\n}\n\nconst registeredSearchers = [];\n\nfunction register(...args) {\n registeredSearchers.push(...args);\n}\n\nfunction createSearcher(pattern, options) {\n for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {\n let searcherClass = registeredSearchers[i];\n if (searcherClass.condition(pattern, options)) {\n return new searcherClass(pattern, options)\n }\n }\n\n return new BitapSearch(pattern, options)\n}\n\nconst LogicalOperator = {\n AND: '$and',\n OR: '$or'\n};\n\nconst KeyType = {\n PATH: '$path',\n PATTERN: '$val'\n};\n\nconst isExpression = (query) =>\n !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);\n\nconst isPath = (query) => !!query[KeyType.PATH];\n\nconst isLeaf = (query) =>\n !isArray(query) && isObject(query) && !isExpression(query);\n\nconst convertToExplicit = (query) => ({\n [LogicalOperator.AND]: Object.keys(query).map((key) => ({\n [key]: query[key]\n }))\n});\n\n// When `auto` is `true`, the parse function will infer and initialize and add\n// the appropriate `Searcher` instance\nfunction parse(query, options, { auto = true } = {}) {\n const next = (query) => {\n let keys = Object.keys(query);\n\n const isQueryPath = isPath(query);\n\n if (!isQueryPath && keys.length > 1 && !isExpression(query)) {\n return next(convertToExplicit(query))\n }\n\n if (isLeaf(query)) {\n const key = isQueryPath ? query[KeyType.PATH] : keys[0];\n\n const pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];\n\n if (!isString(pattern)) {\n throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key))\n }\n\n const obj = {\n keyId: createKeyId(key),\n pattern\n };\n\n if (auto) {\n obj.searcher = createSearcher(pattern, options);\n }\n\n return obj\n }\n\n let node = {\n children: [],\n operator: keys[0]\n };\n\n keys.forEach((key) => {\n const value = query[key];\n\n if (isArray(value)) {\n value.forEach((item) => {\n node.children.push(next(item));\n });\n }\n });\n\n return node\n };\n\n if (!isExpression(query)) {\n query = convertToExplicit(query);\n }\n\n return next(query)\n}\n\n// Practical scoring function\nfunction computeScore(\n results,\n { ignoreFieldNorm = Config.ignoreFieldNorm }\n) {\n results.forEach((result) => {\n let totalScore = 1;\n\n result.matches.forEach(({ key, norm, score }) => {\n const weight = key ? key.weight : null;\n\n totalScore *= Math.pow(\n score === 0 && weight ? Number.EPSILON : score,\n (weight || 1) * (ignoreFieldNorm ? 1 : norm)\n );\n });\n\n result.score = totalScore;\n });\n}\n\nfunction transformMatches(result, data) {\n const matches = result.matches;\n data.matches = [];\n\n if (!isDefined(matches)) {\n return\n }\n\n matches.forEach((match) => {\n if (!isDefined(match.indices) || !match.indices.length) {\n return\n }\n\n const { indices, value } = match;\n\n let obj = {\n indices,\n value\n };\n\n if (match.key) {\n obj.key = match.key.src;\n }\n\n if (match.idx > -1) {\n obj.refIndex = match.idx;\n }\n\n data.matches.push(obj);\n });\n}\n\nfunction transformScore(result, data) {\n data.score = result.score;\n}\n\nfunction format(\n results,\n docs,\n {\n includeMatches = Config.includeMatches,\n includeScore = Config.includeScore\n } = {}\n) {\n const transformers = [];\n\n if (includeMatches) transformers.push(transformMatches);\n if (includeScore) transformers.push(transformScore);\n\n return results.map((result) => {\n const { idx } = result;\n\n const data = {\n item: docs[idx],\n refIndex: idx\n };\n\n if (transformers.length) {\n transformers.forEach((transformer) => {\n transformer(result, data);\n });\n }\n\n return data\n })\n}\n\nclass Fuse {\n constructor(docs, options = {}, index) {\n this.options = { ...Config, ...options };\n\n if (\n this.options.useExtendedSearch &&\n !true\n ) {\n throw new Error(EXTENDED_SEARCH_UNAVAILABLE)\n }\n\n this._keyStore = new KeyStore(this.options.keys);\n\n this.setCollection(docs, index);\n }\n\n setCollection(docs, index) {\n this._docs = docs;\n\n if (index && !(index instanceof FuseIndex)) {\n throw new Error(INCORRECT_INDEX_TYPE)\n }\n\n this._myIndex =\n index ||\n createIndex(this.options.keys, this._docs, {\n getFn: this.options.getFn,\n fieldNormWeight: this.options.fieldNormWeight\n });\n }\n\n add(doc) {\n if (!isDefined(doc)) {\n return\n }\n\n this._docs.push(doc);\n this._myIndex.add(doc);\n }\n\n remove(predicate = (/* doc, idx */) => false) {\n const results = [];\n\n for (let i = 0, len = this._docs.length; i < len; i += 1) {\n const doc = this._docs[i];\n if (predicate(doc, i)) {\n this.removeAt(i);\n i -= 1;\n len -= 1;\n\n results.push(doc);\n }\n }\n\n return results\n }\n\n removeAt(idx) {\n this._docs.splice(idx, 1);\n this._myIndex.removeAt(idx);\n }\n\n getIndex() {\n return this._myIndex\n }\n\n search(query, { limit = -1 } = {}) {\n const {\n includeMatches,\n includeScore,\n shouldSort,\n sortFn,\n ignoreFieldNorm\n } = this.options;\n\n let results = isString(query)\n ? isString(this._docs[0])\n ? this._searchStringList(query)\n : this._searchObjectList(query)\n : this._searchLogical(query);\n\n computeScore(results, { ignoreFieldNorm });\n\n if (shouldSort) {\n results.sort(sortFn);\n }\n\n if (isNumber(limit) && limit > -1) {\n results = results.slice(0, limit);\n }\n\n return format(results, this._docs, {\n includeMatches,\n includeScore\n })\n }\n\n _searchStringList(query) {\n const searcher = createSearcher(query, this.options);\n const { records } = this._myIndex;\n const results = [];\n\n // Iterate over every string in the index\n records.forEach(({ v: text, i: idx, n: norm }) => {\n if (!isDefined(text)) {\n return\n }\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n results.push({\n item: text,\n idx,\n matches: [{ score, value: text, norm, indices }]\n });\n }\n });\n\n return results\n }\n\n _searchLogical(query) {\n\n const expression = parse(query, this.options);\n\n const evaluate = (node, item, idx) => {\n if (!node.children) {\n const { keyId, searcher } = node;\n\n const matches = this._findMatches({\n key: this._keyStore.get(keyId),\n value: this._myIndex.getValueForItemAtKeyId(item, keyId),\n searcher\n });\n\n if (matches && matches.length) {\n return [\n {\n idx,\n item,\n matches\n }\n ]\n }\n\n return []\n }\n\n const res = [];\n for (let i = 0, len = node.children.length; i < len; i += 1) {\n const child = node.children[i];\n const result = evaluate(child, item, idx);\n if (result.length) {\n res.push(...result);\n } else if (node.operator === LogicalOperator.AND) {\n return []\n }\n }\n return res\n };\n\n const records = this._myIndex.records;\n const resultMap = {};\n const results = [];\n\n records.forEach(({ $: item, i: idx }) => {\n if (isDefined(item)) {\n let expResults = evaluate(expression, item, idx);\n\n if (expResults.length) {\n // Dedupe when adding\n if (!resultMap[idx]) {\n resultMap[idx] = { idx, item, matches: [] };\n results.push(resultMap[idx]);\n }\n expResults.forEach(({ matches }) => {\n resultMap[idx].matches.push(...matches);\n });\n }\n }\n });\n\n return results\n }\n\n _searchObjectList(query) {\n const searcher = createSearcher(query, this.options);\n const { keys, records } = this._myIndex;\n const results = [];\n\n // List is Array<Object>\n records.forEach(({ $: item, i: idx }) => {\n if (!isDefined(item)) {\n return\n }\n\n let matches = [];\n\n // Iterate over every key (i.e, path), and fetch the value at that key\n keys.forEach((key, keyIndex) => {\n matches.push(\n ...this._findMatches({\n key,\n value: item[keyIndex],\n searcher\n })\n );\n });\n\n if (matches.length) {\n results.push({\n idx,\n item,\n matches\n });\n }\n });\n\n return results\n }\n _findMatches({ key, value, searcher }) {\n if (!isDefined(value)) {\n return []\n }\n\n let matches = [];\n\n if (isArray(value)) {\n value.forEach(({ v: text, i: idx, n: norm }) => {\n if (!isDefined(text)) {\n return\n }\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n matches.push({\n score,\n key,\n value: text,\n idx,\n norm,\n indices\n });\n }\n });\n } else {\n const { v: text, n: norm } = value;\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n matches.push({ score, key, value: text, norm, indices });\n }\n }\n\n return matches\n }\n}\n\nFuse.version = '7.0.0';\nFuse.createIndex = createIndex;\nFuse.parseIndex = parseIndex;\nFuse.config = Config;\n\n{\n Fuse.parseQuery = parse;\n}\n\n{\n register(ExtendedSearch);\n}\n\nexport { Fuse as default };\n"],"file":"assets/fuse-1Fw6A_G2.js"} |