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,YAAY,GACxB,EACA,CACE,KAAM,yBACN,8BAAU,YAAY,GACxB,EACA,CACE,KAAM,iCACN,8BAAU,YAAY,GACxB,EACA,CACE,KAAM,IACN,8BAAU,aAAa,GACzB,CACF,CACF,CACF,EAEA,SAAwB,iBAAkB,CACxC,OAAO,UAAU,WAAW,CAC9B","names":["client","options","notifyOptions","query","state","result","isFetching","isRefetching","isFetchingNextPage","_b","_a","isFetchingPreviousPage","_d","_c","queryClient","isInitialLoading","fetchNextPage","hasNextPage","children","loaderMarginTop","style","className","_variant","loadMoreExtraContent","size","sentinelRef","useRef","isLoading","loadMoreClickCount","setLoadMoreClickCount","useState","innerVariant","useEffect","sentinelEl","observer","entry","content","jsxs","jsx","items","keepFirst","first","currentIndex","temporaryValue","randomIndex","id","defaultVolume","array","toAdd","index","copyOfArray","tail","action","getPointer","item","actionHandlers","details","key","cuedMedia","a","b","__publicField","lockType","document","element","type","handler","val","host","onChange","fscreen","set","get","subscription","orientation","adapter","onFullscreenChange","isFullscreen","isSupported","el","canFullscreen","video","adapters","onPipChange","factory","canPip","initialData","setInLocalStorage","value","_setInLocalStorage","store","listeners","internalListeners","s","e","payload","rates","qualities","tracks","trackId","quality","isVisible","isBuffering","media","queue","url","provider","keybindsHandler","initialQueue","isSeeking","isMuted","speed","newRepeat","currentRepeat","_e","newQueue","time","timeStr","resolve","reject","previousProvider","timeoutId","unsubscribe","mediaItems","queuePointer","afterCuedMedia","shuffledNewItems","m","mediaId","mediaToCue","newListeners","event","l","createContext","ReactExports","api","selector","equalityFn","slice","useContext","useMemo","overrideQueueAndPlay","queueId","lastTrack","response","src","track","queueGroupId","album","color","isDarkMode","radius","variant","disabled","buttonType","equalizerColor","isHover","setIsHover","modelIsQueued","modelIsPlaying","player","statusIcon","sharedProps","newIndex","t","model","kind","sortDescriptor","base","image","title","subtitle","link","likeButton","contextDialog","navigate","cloneElement","isLoggedIn","user","r","backendPayload","dialogContext","useCallback","data","closeMenu","loadTracks","setPlaylistPanelIsActive","addToPlaylist","playlists","p","playlist","authHandler","playlistPanelIsActive","description","close","contextValue","pathname","previousPathname","header","forwardRef","endIcon","startIcon","to","buttonProps","ref","Element","addToLibrary","getMessage","likeables","likeable","modelType","removeFromLibrary","label","copyLink","artistId","getRedirectUri","seed","absolute","artist_provider","trans","imgClassName","firstTrackImage","isMobile","height","code","inputRef","copied","artist","showRadioButton","canEdit","DeleteButton","deleteArtist","canDelete","isLiked","repostable","toggleRepost","isReposted","deleteAlbum","genre","trackIds","showAddToQueueButton","firstTrack","shouldShowRadio","headerProps","Fragment","DownloadTrackButton","base_url","hasPermission","deleteTracks","isCreator","playlistId","copyAlbumLink","isFollowing","followPlaylist","unFollowPlaylist","updatePlaylist","togglePublic","toggleCollaborative","deletePlaylist","follow","unfollow","owner","showProBadge","showBadge","channel","isNested","margin","genreName","queryKey","defaultOrderDir","defaultOrderBy","queryParams","searchQuery","props","initialPage","endpoint","paginate","transformResponse","willSortOrFilter","setSearchQuery","setSortDescriptor","initialQueryKey","pageParam","signal","params","lastResponse","firstPage","totalItems","slugOrId","meta","groupId","isCued","isPlaying","rowIndex","isHovered","trackIndex","setHover","d","hideTrackImage","selectedRows","removeTracks","row","hideArtist","hideAlbum","hideHeaderRow","hidePopularity","hideAddedAtColumn","renderRowAs","tableProps","filteredColumns","col","domProps","placeholderRowCount","bodyRef","scrollableRef","scrollOffset","getScrollElement","getScrollParent","virtualizer","instance","cb","offset","virtualRows","virtualHeight","virtualItem","dataCount","enabled","waveData","canvas","context","lineData","playerDuration","duration","currentTime","setCurrentTime","flushSync","pointer","disableCommenting","markerIsVisible","setMarkerIsVisible","newCommentInputRef","newCommentPositionRef","comments","commentBarContext","trackRef","getThumbPercent","useInteractOutside","comment","canvasRef","progressCanvasRef","isInView","setIsInView","setIsVisible","themeSelector","entries","onChangeEnd","sliderProps","thumbIds","newValue","err","commentable","inReplyTo","other","onSuccess","autoFocus","createComment","useObjectRef","inputIsExpanded","setInputIsExpanded","inputValue","setInputValue","clearInput","labels","showPlays","count","managesItem","buttonClassName","buttonGap","buttonSize","buttonRadius","memo","reposter","hideArtwork","hideActions","linksInNewTab","managesTrack","showWave","fn","wait","callFirst","timeout","debouncedFn","clear","flush","call","debounceWrapper","args","callNow","itemWidth","enablePrev","setEnablePrev","enableNext","setEnableNext","updateNavStatus","handleScroll","debounce","useLayoutEffect","firstGridItem","scrollAmount","contentModel","layout","nestedChannel","slot","settings","isSubscribed","adCode","useId","scrollParent","parentEl","promises","pattern","match","artistName","cancelToken","YoutubeCommand","YouTubePlayerState","results","site_name","pause","sourceEvent","providerApi","providerName","emit","guest_role","permissions","isActive","branding","logoUrl","newPlaylist","mediaIsCued","isAudioProvider","queueItems","miniPlayerIsHidden","button","subscribe","getCurrentTime","providerKey","iconSize","stopPropagation","playerReady","animationActive","setAnimationActive","QueuedTrack","PlaybackButtons","menu","hasUnreadNotif","registration","primaryArtist","menuItems","MenuItem","trackColor","fillColor","onPointerMove","seek","setIsSeeking","play","getState","pauseWhileSeeking","wasPlayingBeforeDragging","activeColor","isShuffling","repeating","buttonColor","volume","rightSidenavStatus","setRightSidenavStatus","isNumber","minWidth","videoId","posterURL","img","poster","internalStateRef","iframeRef","info","internalState","buffered","onCued","loadVideoById","origin","initialVideoId","setInitialVideoId","updateVideoIds","prevId","addGlobalListener","removeAllGlobalListeners","useGlobalListeners","youtubeApi","command","arg","initialVideoUrl","registerApi","internalProviderApi","muted","callback","start","loop","stop","updateCurrentTime","updateBuffered","timeRange","seconds","newTime","toggleTextTrackModes","newTrackId","textTracks","oldTrack","nextTrack","timeRafLoop","onTextTracksChange","autoPlay","events","caption","Suspense","hideDuringPlayback","fallback","posterUrl","shouldHidePoster","clickRef","togglePlay","isMaximized","isQueueOpen","overlayRef","playerClickHandler","haveVideo","cuedTrack","handleKeyDown","setQuery","isOpen","setIsOpen","encodedQuery","ComboBox","groupName","collection","activeIndex","ActionButtons","billing","showUploadButton","showTryProButton","isOverlay","hideQueue","actionButtons","footer","centerItems","isFirst","alt","links","text","href","attributes","attr","_ref","tagName","str","opts","tokens","token","profile","shortDescription","artistPage","genres","initialTracks","showingAll","setShowingAll","topTracks","viewMode","initialAlbums","AlbumTrackTable","onSortChange","albums","selectedAlbumLayout","setViewMode","similarArtists","similar","images","maxHeight","managesAlbum","activeTrack","isLast","playerActions","searchParams","haveSimilar","haveBio","activeTabs","tab","selectedTabId","i","currentUser","followUser","unfollowUser","mergedClassName","follower","selectedIndex","Children","firstLink","avatar","child","totalDuration","editor","hasTracks","indexOrIndexes","indexes","insertBefore","itemsToBeMoved","moved","insertionIndex","oldIndexes","ids","isTouchDevice","selectRow","domRef","previewRef","reorderTracks","sortableProps","oldIndex","mergeProps","PageContent","showUpvotesOnly","changeVote","upvotes","setUpvotes","downvotes","setDownvotes","currentVote","setCurrentVote","syncLocalState","replyFormVisible","setReplyFormVisible","showReplyButton","position","deleteComments","reportComment","isDeleteDialogOpen","setIsDeleteDialogOpen","showDeleteButton","handleReport","handleDelete","isConfirmed","auth","message","parts","canDeleteAllComments","perPage","linkifiedDescription","wrapperRef","contentRef","isOverflowing","setIsOverflowing","isShowingAll","setIsShowingAll","wrapperHeight","canView","showComments","allowCommenting","FocusScope","tag","userId","trackCount","isError","getPlaceholderItems","totalTracks","selectedValue","orderBy","orderDir","sortItems","releaseDate","repost","form","onBlur","invalid","error","formProps","formId","updateProfile","values","country","Option","tabLink","tabName","selectedTab","setSelectedTab","seedType","seedId","total","Image","tabIndex","_f","_g","_h","_i","_j","artists","users","showMore","icon","wrapIcon","EmbedContent","mediaItem","homepage"],"sources":["../../../node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js","../../../node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js","../../../common/resources/client/ui/infinite-scroll/infinite-scroll-sentinel.tsx","../../../common/resources/client/utils/array/shuffle-array.ts","../../../common/resources/client/player/utils/player-local-storage.ts","../../../common/resources/client/utils/array/prepend-to-array-at-index.ts","../../../common/resources/client/player/utils/reset-media-session.ts","../../../common/resources/client/player/player-queue.ts","../../../common/resources/client/player/handle-player-keybinds.ts","../../../common/resources/client/player/utils/init-player-media-session.ts","../../../common/resources/client/player/utils/is-same-media.ts","../../../common/resources/client/player/state/fullscreen/screen-orientation.ts","../../../common/resources/client/utils/platform.ts","../../../node_modules/fscreen/dist/fscreen.esm.js","../../../common/resources/client/player/state/fullscreen/create-native-fullscreen-adapter.ts","../../../common/resources/client/player/state/fullscreen/create-iphone-fullscreen-adapter.ts","../../../common/resources/client/player/state/fullscreen/fullscreen-slice.ts","../../../common/resources/client/player/state/pip/chrome-pip-adapter.ts","../../../common/resources/client/player/state/pip/safari-pip-adapter.ts","../../../common/resources/client/player/state/pip/pip-slice.ts","../../../common/resources/client/player/state/player-store.tsx","../../../common/resources/client/player/player-context.tsx","../../../node_modules/zustand/esm/traditional.mjs","../../../common/resources/client/player/hooks/use-player-store.tsx","../../../common/resources/client/player/hooks/use-player-actions.ts","../../../resources/client/web-player/requests/load-media-item-tracks.ts","../../../common/resources/client/player/utils/guess-player-provider.ts","../../../resources/client/web-player/tracks/utils/track-to-media-item.ts","../../../resources/client/web-player/tracks/equalizer-image/equalizer-white.gif","../../../resources/client/web-player/tracks/equalizer-image/equalizer-black.gif","../../../resources/client/web-player/tracks/equalizer-image/equalizer-image.tsx","../../../resources/client/web-player/playable-item/playback-toggle-button.tsx","../../../resources/client/web-player/queue-group-id.ts","../../../resources/client/web-player/playable-item/playable-grid-item.tsx","../../../resources/client/web-player/playlists/requests/use-auth-user-playlists.ts","../../../resources/client/web-player/playlists/requests/use-add-tracks-to-playlist.ts","../../../resources/client/web-player/use-auth-click-capture.ts","../../../resources/client/web-player/context-dialog/playlist-panel.tsx","../../../resources/client/web-player/context-dialog/context-dialog-layout.tsx","../../../resources/client/web-player/library/state/create-countable-store.ts","../../../resources/client/web-player/library/state/likes-store.ts","../../../resources/client/web-player/library/requests/use-add-items-to-library.ts","../../../resources/client/web-player/library/requests/use-remove-items-from-library.ts","../../../resources/client/web-player/context-dialog/toggle-in-library-menu-button.tsx","../../../resources/client/web-player/context-dialog/copy-link-menu-button.tsx","../../../resources/client/web-player/artists/requests/use-delete-artist.ts","../../../resources/client/web-player/radio/get-radio-link.ts","../../../resources/client/web-player/tracks/context-dialog/use-should-show-radio-button.ts","../../../resources/client/web-player/playlists/playlist-image.tsx","../../../resources/client/web-player/sharing/share-media-dialog.tsx","../../../resources/client/web-player/context-dialog/share-media-button.tsx","../../../resources/client/web-player/artists/artist-context-dialog.tsx","../../../resources/client/web-player/library/like-icon-button.tsx","../../../resources/client/web-player/artists/artist-grid-item.tsx","../../../resources/client/web-player/context-dialog/add-to-queue-menu-button.tsx","../../../resources/client/web-player/library/state/reposts-store.ts","../../../resources/client/web-player/reposts/use-toggle-repost.ts","../../../resources/client/web-player/context-dialog/toggle-repost-menu-button.tsx","../../../resources/client/web-player/albums/album-context-dialog.tsx","../../../resources/client/web-player/albums/album-grid-item.tsx","../../../resources/client/web-player/genres/genre-image.tsx","../../../resources/client/web-player/genres/genre-grid-item.tsx","../../../resources/client/web-player/tracks/requests/use-delete-tracks.ts","../../../resources/client/web-player/tracks/lyrics/requests/use-lyrics.ts","../../../common/resources/client/icons/media/media-microphone.tsx","../../../resources/client/web-player/tracks/lyrics/lyrics-dialog.tsx","../../../resources/client/web-player/tracks/utils/track-is-locally-uploaded.ts","../../../resources/client/web-player/tracks/context-dialog/track-context-dialog.tsx","../../../resources/client/web-player/tracks/track-grid-item.tsx","../../../resources/client/web-player/playlists/hooks/use-playlist-permissions.ts","../../../resources/client/web-player/playlists/hooks/use-is-following-playlist.ts","../../../resources/client/web-player/playlists/requests/use-delete-playlist.ts","../../../resources/client/web-player/playlists/requests/use-follow-playlist.ts","../../../resources/client/web-player/playlists/requests/use-unfollow-playlist.ts","../../../resources/client/web-player/playlists/playlist-context-dialog.tsx","../../../resources/client/web-player/playlists/playlist-page/follow-playlist-button.tsx","../../../resources/client/web-player/playlists/playlist-grid-item.tsx","../../../resources/client/web-player/users/user-default.svg","../../../resources/client/web-player/users/user-image.tsx","../../../resources/client/web-player/users/user-grid-item.tsx","../../../resources/client/web-player/channels/channel-content-grid-item.tsx","../../../resources/client/web-player/channels/antenna-icon.tsx","../../../resources/client/web-player/channels/channel-heading.tsx","../../../common/resources/client/ui/infinite-scroll/use-infinite-data.ts","../../../common/resources/client/channels/requests/use-paginated-channel-content.ts","../../../common/resources/client/channels/requests/use-channel-content.ts","../../../resources/client/web-player/channels/channel-content-grid.tsx","../../../resources/client/web-player/tracks/track-table/use-track-table-meta.ts","../../../resources/client/web-player/tracks/hooks/use-is-track-cued.ts","../../../resources/client/web-player/tracks/hooks/use-is-track-playing.ts","../../../resources/client/web-player/tracks/track-table/toggle-playback-column.tsx","../../../resources/client/web-player/tracks/track-table/track-name-column.tsx","../../../resources/client/web-player/tracks/context-dialog/table-track-context-dialog.tsx","../../../resources/client/web-player/playlists/requests/use-remove-tracks-from-playlist.ts","../../../resources/client/web-player/playlists/playlist-page/playlist-track-context-dialog.tsx","../../../resources/client/web-player/tracks/track-table/track-options-column.tsx","../../../resources/client/web-player/tracks/track-table/track-table.tsx","../../../resources/client/web-player/playlists/virtual-table-body.tsx","../../../resources/client/web-player/channels/channel-track-table.tsx","../../../resources/client/web-player/tracks/requests/use-track-wave-data.ts","../../../resources/client/web-player/tracks/waveform/draw-waveform.ts","../../../resources/client/web-player/player-controls/seekbar/use-track-seekbar.ts","../../../resources/client/web-player/tracks/waveform/comment-bar-context.tsx","../../../resources/client/web-player/tracks/waveform/comment-bar.tsx","../../../resources/client/web-player/tracks/waveform/waveform.tsx","../../../resources/client/web-player/player-controls/seekbar/track-seekbar.tsx","../../../common/resources/client/comments/requests/use-create-comment.ts","../../../common/resources/client/comments/new-comment-form.tsx","../../../resources/client/web-player/tracks/waveform/comment-bar-new-comment-form.tsx","../../../resources/client/web-player/library/like-button.tsx","../../../resources/client/web-player/reposts/repost-button.tsx","../../../resources/client/web-player/tracks/media-item-stats.tsx","../../../resources/client/web-player/tracks/track-actions-bar.tsx","../../../resources/client/web-player/tracks/track-list/track-list-item.tsx","../../../resources/client/web-player/tracks/track-list/track-list.tsx","../../../resources/client/web-player/channels/channel-track-list.tsx","../../../node_modules/just-debounce-it/index.mjs","../../../resources/client/web-player/channels/channel-content-carousel.tsx","../../../resources/client/web-player/channels/channel-content.tsx","../../../common/resources/client/admin/ads/ad-host.tsx","../../../resources/client/web-player/channels/channel-page.tsx","../../../resources/client/web-player/tracks/requests/find-youtube-videos-for-track.ts","../../../resources/client/web-player/state/player-overlay-store.ts","../../../common/resources/client/player/providers/youtube/youtube-types.ts","../../../resources/client/web-player/state/player-store-options.ts","../../../resources/client/web-player/layout/sidenav.tsx","../../../common/resources/client/player/hooks/use-is-media-playing.ts","../../../resources/client/web-player/overlay/use-mini-player-is-hidden.ts","../../../resources/client/web-player/layout/queue/queue-track-context-dialog.tsx","../../../resources/client/web-player/layout/queue/queue-sidenav.tsx","../../../resources/client/web-player/player-controls/use-cued-track.ts","../../../common/resources/client/player/hooks/use-current-time.ts","../../../common/resources/client/icons/media/media-play.tsx","../../../common/resources/client/icons/media/media-pause.tsx","../../../common/resources/client/player/ui/controls/play-button.tsx","../../../common/resources/client/icons/media/media-previous.tsx","../../../common/resources/client/player/ui/controls/previous-button.tsx","../../../common/resources/client/icons/media/media-next.tsx","../../../common/resources/client/player/ui/controls/next-button.tsx","../../../resources/client/web-player/player-controls/buffering-indicator.tsx","../../../resources/client/web-player/player-controls/mobile-player-controls.tsx","../../../common/resources/client/player/ui/controls/seeking/seekbar.tsx","../../../common/resources/client/player/ui/controls/formatted-current-time.tsx","../../../common/resources/client/player/ui/controls/formatted-player-duration.tsx","../../../resources/client/web-player/player-controls/seekbar/main-seekbar.tsx","../../../common/resources/client/icons/media/media-shuffle.tsx","../../../common/resources/client/icons/media/media-shuffle-on.tsx","../../../common/resources/client/player/ui/controls/shuffle-button.tsx","../../../common/resources/client/icons/media/media-repeat.tsx","../../../common/resources/client/icons/media/media-repeat-on.tsx","../../../common/resources/client/player/ui/controls/repeat-button.tsx","../../../resources/client/web-player/player-controls/playback-controls.tsx","../../../resources/client/web-player/player-controls/lyrics-button.tsx","../../../resources/client/web-player/player-controls/download-track-button.tsx","../../../common/resources/client/icons/media/media-queue-list.tsx","../../../common/resources/client/icons/media/media-mute.tsx","../../../common/resources/client/icons/media/media-volume-low.tsx","../../../common/resources/client/icons/media/media-volume-high.tsx","../../../common/resources/client/player/ui/controls/volume-controls.tsx","../../../resources/client/web-player/player-controls/desktop-player-controls.tsx","../../../common/resources/client/utils/number/is-number.ts","../../../common/resources/client/utils/http/load-image.ts","../../../common/resources/client/player/providers/youtube/load-youtube-poster.ts","../../../common/resources/client/player/providers/youtube/handle-youtube-embed-message.tsx","../../../common/resources/client/player/utils/youtube-id-from-src.ts","../../../common/resources/client/player/providers/youtube/use-youtube-provider-src.ts","../../../common/resources/client/player/providers/youtube/youtube-provider.tsx","../../../common/resources/client/utils/dom/create-ref-loop.ts","../../../common/resources/client/player/providers/html-media/use-html-media-internal-state.ts","../../../common/resources/client/player/providers/html-media/use-html-media-events.ts","../../../common/resources/client/player/providers/html-media/use-html-media-api.ts","../../../common/resources/client/player/providers/html-video-provider.tsx","../../../common/resources/client/player/providers/html-audio-provider.tsx","../../../common/resources/client/player/ui/player-outlet.tsx","../../../common/resources/client/player/ui/controls/player-poster.tsx","../../../common/resources/client/icons/media/media-fullscreen.tsx","../../../common/resources/client/player/hooks/use-player-click-handler.ts","../../../resources/client/web-player/overlay/player-overlay.tsx","../../../resources/client/web-player/search/requests/use-search-results.ts","../../../resources/client/web-player/search/search-autocomplete.tsx","../../../resources/client/web-player/layout/player-navbar.tsx","../../../resources/client/web-player/layout/web-player-layout.tsx","../../../resources/client/web-player/layout/media-page-header-layout.tsx","../../../common/resources/client/ui/remote-favicon.tsx","../../../resources/client/web-player/user-profile/profile-links.tsx","../../../node_modules/linkify-string/dist/linkify-string.es.js","../../../common/resources/client/utils/hooks/use-linkified-string.ts","../../../resources/client/web-player/user-profile/profile-description.tsx","../../../resources/client/web-player/artists/artist-page/artist-page-header.tsx","../../../resources/client/web-player/artists/artist-page/discography-panel/top-tracks-table.tsx","../../../resources/client/web-player/artists/requests/use-artist-albums.ts","../../../resources/client/web-player/artists/artist-page/discography-panel/no-discography-message.tsx","../../../resources/client/web-player/artists/artist-page/discography-panel/artist-albums-list.tsx","../../../resources/client/web-player/artists/artist-page/discography-panel/artist-albums-grid.tsx","../../../resources/client/web-player/artists/artist-page/discography-panel/discography-tab.tsx","../../../resources/client/web-player/artists/artist-page/similar-artists-panel.tsx","../../../resources/client/web-player/artists/artist-page/artist-about-panel.tsx","../../../resources/client/web-player/artists/artist-page/artist-tracks-panel.tsx","../../../resources/client/web-player/albums/album-list/album-list-item.tsx","../../../resources/client/web-player/albums/album-list/album-list.tsx","../../../resources/client/web-player/artists/artist-page/artist-albums-panel.tsx","../../../resources/client/web-player/artists/artist-page/use-artist-page-tabs.tsx","../../../common/resources/client/users/queries/use-followed-users.ts","../../../common/resources/client/users/queries/use-follow-user.ts","../../../common/resources/client/users/queries/use-unfollow-user.ts","../../../common/resources/client/users/follow-button.tsx","../../../resources/client/web-player/artists/artist-page/followers-panel/follower-list-item.tsx","../../../resources/client/web-player/artists/artist-page/artist-followers-panel.tsx","../../../resources/client/web-player/artists/artist-page/artist-page-tabs.tsx","../../../resources/client/web-player/artists/artist-page/artist-page.tsx","../../../resources/client/web-player/playlists/requests/use-playlist.ts","../../../common/resources/client/ui/images/avatar-group.tsx","../../../resources/client/web-player/layout/bullet-separated-items.tsx","../../../resources/client/web-player/playlists/playlist-page/playlist-page-header.tsx","../../../common/resources/client/utils/array/move-multiple-items-in-array.ts","../../../resources/client/web-player/playlists/requests/use-reorder-playlist-tracks.ts","../../../resources/client/web-player/playlists/playlist-page/playlist-table-row.tsx","../../../resources/client/web-player/layout/media-page-no-results-message.tsx","../../../resources/client/web-player/playlists/playlist-page/playlist-page.tsx","../../../common/resources/client/comments/requests/use-comments.ts","../../../common/resources/client/votes/requests/use-store-vote.ts","../../../common/resources/client/votes/thumb-buttons.tsx","../../../common/resources/client/reports/requests/use-submit-report.ts","../../../common/resources/client/comments/comment-list/comment-list-item.tsx","../../../common/resources/client/comments/comment-list/account-required-card.tsx","../../../common/resources/client/comments/comment-list/comment-list.tsx","../../../common/resources/client/ui/truncated-description.tsx","../../../resources/client/web-player/tracks/hooks/use-comment-permissions.ts","../../../resources/client/web-player/albums/album-page.tsx","../../../resources/client/web-player/library/requests/use-user-liked-tracks.ts","../../../resources/client/web-player/library/library-tracks-page.tsx","../../../resources/client/web-player/library/library-page-sort-dropdown.tsx","../../../resources/client/web-player/library/requests/use-user-liked-albums.ts","../../../resources/client/web-player/library/library-albums-page.tsx","../../../resources/client/web-player/library/requests/use-user-liked-artists.ts","../../../resources/client/web-player/library/library-artists-page.tsx","../../../resources/client/web-player/library/library-history-page.tsx","../../../resources/client/web-player/tracks/track-page.tsx","../../../resources/client/web-player/user-profile/requests/use-user-profile.tsx","../../../resources/client/web-player/user-profile/panels/profile-reposts-panel.tsx","../../../resources/client/web-player/user-profile/panels/profile-tracks-panel.tsx","../../../resources/client/web-player/library/requests/use-user-playlists.ts","../../../resources/client/web-player/user-profile/panels/profile-playlists-panel.tsx","../../../resources/client/web-player/user-profile/panels/profile-albums-panel.tsx","../../../resources/client/web-player/user-profile/panels/profile-artists-panel.tsx","../../../resources/client/web-player/user-profile/panels/profile-followers-panel.tsx","../../../resources/client/web-player/user-profile/panels/profile-followed-users-panel.tsx","../../../resources/client/web-player/user-profile/requests/use-update-user-profile.ts","../../../common/resources/client/ui/forms/combobox/form-combobox.tsx","../../../resources/client/web-player/user-profile/edit-profile-dialog.tsx","../../../resources/client/web-player/user-profile/header/profile-header.tsx","../../../resources/client/web-player/user-profile/user-profile-page.tsx","../../../resources/client/web-player/genres/tag-media-page.tsx","../../../resources/client/web-player/radio/requests/use-radio-recommendations.ts","../../../resources/client/web-player/radio/radio-page.tsx","../../../resources/client/web-player/search/search-results-page.tsx","../../../resources/client/web-player/library/library-page.tsx","../../../resources/client/web-player/library/library-playlists-page.tsx","../../../resources/client/web-player/tracks/track-embed.tsx","../../../resources/client/web-player/albums/album-embed.tsx","../../../resources/client/web-player/channels/homepage-channel-page.tsx","../../../resources/client/web-player/web-player-routes.tsx"],"sourcesContent":["// src/infiniteQueryObserver.ts\nimport { QueryObserver } from \"./queryObserver.js\";\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n} from \"./infiniteQueryBehavior.js\";\nvar InfiniteQueryObserver = class extends QueryObserver {\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(client, options) {\n super(client, options);\n }\n bindMethods() {\n super.bindMethods();\n this.fetchNextPage = this.fetchNextPage.bind(this);\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this);\n }\n setOptions(options, notifyOptions) {\n super.setOptions(\n {\n ...options,\n behavior: infiniteQueryBehavior()\n },\n notifyOptions\n );\n }\n getOptimisticResult(options) {\n options.behavior = infiniteQueryBehavior();\n return super.getOptimisticResult(options);\n }\n fetchNextPage(options) {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: \"forward\" }\n }\n });\n }\n fetchPreviousPage(options) {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: \"backward\" }\n }\n });\n }\n createResult(query, options) {\n const { state } = query;\n const result = super.createResult(query, options);\n const { isFetching, isRefetching } = result;\n const isFetchingNextPage = isFetching && state.fetchMeta?.fetchMore?.direction === \"forward\";\n const isFetchingPreviousPage = isFetching && state.fetchMeta?.fetchMore?.direction === \"backward\";\n return {\n ...result,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchingNextPage,\n isFetchingPreviousPage,\n isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage\n };\n }\n};\nexport {\n InfiniteQueryObserver\n};\n//# sourceMappingURL=infiniteQueryObserver.js.map","\"use client\";\n\n// src/useInfiniteQuery.ts\nimport { InfiniteQueryObserver } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nfunction useInfiniteQuery(options, queryClient) {\n return useBaseQuery(\n options,\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n InfiniteQueryObserver,\n queryClient\n );\n}\nexport {\n useInfiniteQuery\n};\n//# sourceMappingURL=useInfiniteQuery.js.map","import React, {ReactNode, useEffect, useRef, useState} from 'react';\nimport clsx from 'clsx';\nimport {UseInfiniteQueryResult} from '@tanstack/react-query/src/types';\nimport {Trans} from '@common/i18n/trans';\nimport {Button} from '@common/ui/buttons/button';\nimport {AnimatePresence, m} from 'framer-motion';\nimport {opacityAnimation} from '@common/ui/animation/opacity-animation';\nimport {ProgressCircle} from '@common/ui/progress/progress-circle';\n\nexport interface InfiniteScrollSentinelProps {\n loaderMarginTop?: string;\n children?: ReactNode;\n loadMoreExtraContent?: ReactNode;\n query: UseInfiniteQueryResult;\n style?: React.CSSProperties;\n className?: string;\n variant?: 'infiniteScroll' | 'loadMore';\n size?: 'sm' | 'md';\n}\nexport function InfiniteScrollSentinel({\n query: {isInitialLoading, fetchNextPage, isFetchingNextPage, hasNextPage},\n children,\n loaderMarginTop = 'mt-24',\n style,\n className,\n variant: _variant = 'infiniteScroll',\n loadMoreExtraContent,\n size = 'md',\n}: InfiniteScrollSentinelProps) {\n const sentinelRef = useRef(null);\n const isLoading = isFetchingNextPage || isInitialLoading;\n const [loadMoreClickCount, setLoadMoreClickCount] = useState(0);\n const innerVariant =\n _variant === 'loadMore' && loadMoreClickCount < 3\n ? 'loadMore'\n : 'infiniteScroll';\n\n useEffect(() => {\n const sentinelEl = sentinelRef.current;\n if (!sentinelEl || innerVariant === 'loadMore') return;\n const observer = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting && hasNextPage && !isLoading) {\n fetchNextPage();\n }\n });\n observer.observe(sentinelEl);\n return () => {\n observer.unobserve(sentinelEl);\n };\n }, [fetchNextPage, hasNextPage, isLoading, innerVariant]);\n\n let content: ReactNode;\n\n if (children) {\n // children might already be wrapped in AnimatePresence, so only wrap default loader with it\n content = isFetchingNextPage ? children : null;\n } else if (innerVariant === 'loadMore') {\n content = !isInitialLoading && hasNextPage && (\n
\n {loadMoreExtraContent}\n {\n fetchNextPage();\n setLoadMoreClickCount(loadMoreClickCount + 1);\n }}\n disabled={isLoading}\n >\n {loadMoreClickCount >= 2 && !isFetchingNextPage ? (\n \n ) : (\n \n )}\n \n
\n );\n } else {\n content = (\n \n {isFetchingNextPage && (\n \n \n \n )}\n \n );\n }\n\n return (\n \n
\n {content}\n
\n );\n}\n","export function shuffleArray(items: any[], keepFirst = false) {\n let first = keepFirst ? items.shift() : null;\n\n let currentIndex = items.length,\n temporaryValue,\n randomIndex;\n\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temporaryValue = items[currentIndex];\n items[currentIndex] = items[randomIndex];\n items[randomIndex] = temporaryValue;\n }\n\n if (first) {\n items.unshift(first);\n }\n\n return [...items];\n}\n","import {getFromLocalStorage} from '@common/utils/hooks/local-storage';\nimport {PlayerStoreOptions} from '@common/player/state/player-store-options';\nimport {PlayerState} from '@common/player/state/player-state';\n\nexport interface PersistablePlayerState {\n muted?: PlayerState['muted'];\n repeat?: PlayerState['repeat'];\n shuffling?: PlayerState['shuffling'];\n volume?: PlayerState['volume'];\n}\n\nexport interface PlayerInitialData {\n state?: PersistablePlayerState;\n queue?: PlayerState['originalQueue'];\n cuedMediaId?: string | number;\n}\n\nexport function getPlayerStateFromLocalStorage(\n id: string | number,\n options?: PlayerStoreOptions\n): PlayerInitialData {\n const defaultVolume = options?.defaultVolume || 30;\n return {\n state: {\n muted: getFromLocalStorage(`player.${id}.muted`) ?? false,\n repeat: getFromLocalStorage(`player.${id}.repeat`) ?? 'all',\n shuffling: getFromLocalStorage(`player.${id}.shuffling`) ?? false,\n volume: getFromLocalStorage(`player.${id}.volume`) ?? defaultVolume,\n },\n queue: getFromLocalStorage(`player.${id}.queue`, []),\n cuedMediaId: getFromLocalStorage(`player.${id}.cuedMediaId`),\n };\n}\n","export function prependToArrayAtIndex(array: T[], toAdd: T[], index = 0): T[] {\n const copyOfArray = [...array];\n const tail = copyOfArray.splice(index + 1);\n return [...copyOfArray, ...toAdd, ...tail];\n}\n","export function resetMediaSession() {\n if ('mediaSession' in navigator) {\n const actionHandlers: MediaSessionAction[] = [\n 'play',\n 'pause',\n 'previoustrack',\n 'nexttrack',\n 'stop',\n 'seekbackward',\n 'seekforward',\n 'seekto',\n ];\n actionHandlers.forEach(action =>\n navigator.mediaSession.setActionHandler(action, null)\n );\n navigator.mediaSession.metadata = null;\n navigator.mediaSession.playbackState = 'none';\n }\n}\n","import {MediaItem} from '@common/player/media-item';\nimport {PlayerState} from '@common/player/state/player-state';\n\nexport function playerQueue(state: () => PlayerState) {\n const getPointer = (): number => {\n if (state().cuedMedia) {\n return (\n state().shuffledQueue.findIndex(\n item => item.id === state().cuedMedia?.id\n ) || 0\n );\n }\n return 0;\n };\n const getCurrent = (): MediaItem | undefined => {\n return state().shuffledQueue[getPointer()];\n };\n const getFirst = (): MediaItem | undefined => {\n return state().shuffledQueue[0];\n };\n const getLast = (): MediaItem | undefined => {\n return state().shuffledQueue[state().shuffledQueue.length - 1];\n };\n const getNext = (): MediaItem | undefined => {\n return state().shuffledQueue[getPointer() + 1];\n };\n const getPrevious = (): MediaItem | undefined => {\n return state().shuffledQueue[getPointer() - 1];\n };\n const isLast = (): boolean => {\n return getPointer() === state().originalQueue.length - 1;\n };\n\n return {\n getPointer,\n getCurrent,\n getFirst,\n getLast,\n getNext,\n getPrevious,\n isLast,\n };\n}\n","import {PlayerState} from '@common/player/state/player-state';\nimport {isCtrlOrShiftPressed} from '@common/utils/keybinds/is-ctrl-or-shift-pressed';\n\nexport function handlePlayerKeybinds(\n e: KeyboardEvent,\n state: () => PlayerState\n) {\n if (\n ['input', 'textarea'].includes(\n (e.target as HTMLElement)?.tagName.toLowerCase()\n )\n )\n return;\n\n if (e.key === ' ' || e.key === 'k') {\n e.preventDefault();\n if (state().isPlaying) {\n state().pause();\n } else {\n state().play();\n }\n }\n\n if (e.key === 'ArrowRight' && isCtrlOrShiftPressed(e)) {\n e.preventDefault();\n state().playNext();\n }\n\n if (e.key === 'ArrowLeft' && isCtrlOrShiftPressed(e)) {\n e.preventDefault();\n state().playPrevious();\n }\n}\n","import {Optional} from 'utility-types';\nimport {PlayerState} from '@common/player/state/player-state';\nimport {PlayerStoreOptions} from '@common/player/state/player-store-options';\n\nexport function initPlayerMediaSession(\n state: () => PlayerState,\n options: PlayerStoreOptions\n) {\n if ('mediaSession' in navigator) {\n const actionHandlers: Optional<\n Record\n > = {\n play: () => state().play(),\n pause: () => state().pause(),\n previoustrack: () => state().playPrevious(),\n nexttrack: () => state().playNext(),\n stop: () => state().stop(),\n seekbackward: () => state().seek(state().getCurrentTime() - 10),\n seekforward: () => state().seek(state().getCurrentTime() + 10),\n seekto: details => state().seek(details.seekTime || 0),\n };\n for (const key in actionHandlers) {\n try {\n navigator.mediaSession.setActionHandler(\n key as MediaSessionAction,\n actionHandlers[key as MediaSessionAction]!\n );\n } catch (error) {}\n }\n const cuedMedia = state().cuedMedia;\n if (cuedMedia) {\n options.setMediaSessionMetadata?.(cuedMedia);\n }\n }\n}\n","import {MediaItem} from '@common/player/media-item';\n\nexport function isSameMedia(a?: MediaItem, b?: MediaItem): boolean {\n if (!a || !b) return false;\n return a.id === b.id && a.groupId === b.groupId;\n}\n","export class ScreenOrientation {\n protected currentLock: OrientationLockType | undefined;\n\n async lock(lockType: OrientationLockType = 'landscape') {\n if (!this.canOrientScreen() || this.currentLock) return;\n try {\n await (screen.orientation as any).lock(lockType);\n this.currentLock = lockType;\n } catch (e) {}\n }\n\n async unlock() {\n if (!this.canOrientScreen() || !this.currentLock) return;\n await screen.orientation.unlock();\n }\n\n canOrientScreen(): boolean {\n return (\n screen.orientation != null &&\n !!(screen.orientation as any).lock &&\n !!screen.orientation.unlock\n );\n }\n}\n\nexport type OrientationLockType =\n /**\n * Any is an orientation that means the screen can be locked to any one of portrait-primary,\n * portrait-secondary, landscape-primary and landscape-secondary.\n */\n | 'any'\n\n /**\n * Landscape is an orientation where the screen width is greater than the screen height and\n * depending on platform convention locking the screen to landscape can represent\n * landscape-primary, landscape-secondary or both.\n */\n | 'landscape'\n\n /**\n * Landscape-primary is an orientation where the screen width is greater than the screen height.\n * If the device's natural orientation is landscape, then it is in landscape-primary when held\n * in that position. If the device's natural orientation is portrait, the user agent sets\n * landscape-primary from the two options as shown in the screen orientation values table.\n */\n | 'landscape-primary'\n\n /**\n * Landscape-secondary is an orientation where the screen width is greater than the screen\n * height. If the device's natural orientation is landscape, it is in landscape-secondary when\n * rotated 180º from its natural orientation. If the device's natural orientation is portrait,\n * the user agent sets landscape-secondary from the two options as shown in the screen\n * orientation values table.\n */\n | 'landscape-secondary'\n\n /**\n * Natural is an orientation that refers to either portrait-primary or landscape-primary\n * depending on the device's usual orientation. This orientation is usually provided by the\n * underlying operating system.\n */\n | 'natural'\n\n /**\n * Portrait is an orientation where the screen width is less than or equal to the screen height\n * and depending on platform convention locking the screen to portrait can represent\n * portrait-primary, portrait-secondary or both.\n */\n | 'portrait'\n\n /**\n * Portrait-primary is an orientation where the screen width is less than or equal to the screen\n * height. If the device's natural orientation is portrait, then it is in portrait-primary when\n * held in that position. If the device's natural orientation is landscape, the user agent sets\n * portrait-primary from the two options as shown in the screen orientation values table.\n */\n | 'portrait-primary'\n\n /**\n * Portrait-secondary is an orientation where the screen width is less than or equal to the\n * screen height. If the device's natural orientation is portrait, then it is in\n * portrait-secondary when rotated 180º from its natural position. If the device's natural\n * orientation is landscape, the user agent sets portrait-secondary from the two options as\n * shown in the screen orientation values table.\n */\n | 'portrait-secondary';\n","export const IS_CLIENT = typeof window !== 'undefined';\nexport const UA = IS_CLIENT ? window.navigator?.userAgent.toLowerCase() : '';\nexport const IS_IOS = /iphone|ipad|ipod|ios|CriOS|FxiOS/.test(UA);\nexport const IS_ANDROID = /android/.test(UA);\nexport const IS_MOBILE = IS_CLIENT && (IS_IOS || IS_ANDROID);\nexport const IS_IPHONE =\n IS_CLIENT && /(iPhone|iPod)/gi.test(window.navigator?.platform);\nexport const IS_FIREFOX = /firefox/.test(UA);\n// @ts-ignore\nexport const IS_CHROME = IS_CLIENT && window.chrome;\nexport const IS_SAFARI =\n IS_CLIENT &&\n !IS_CHROME &&\n // @ts-ignore\n (window.safari || IS_IOS || /(apple|safari)/.test(UA));\n","var key = {\r\n fullscreenEnabled: 0,\r\n fullscreenElement: 1,\r\n requestFullscreen: 2,\r\n exitFullscreen: 3,\r\n fullscreenchange: 4,\r\n fullscreenerror: 5,\r\n fullscreen: 6\r\n};\r\nvar webkit = [\r\n 'webkitFullscreenEnabled',\r\n 'webkitFullscreenElement',\r\n 'webkitRequestFullscreen',\r\n 'webkitExitFullscreen',\r\n 'webkitfullscreenchange',\r\n 'webkitfullscreenerror',\r\n '-webkit-full-screen',\r\n];\r\nvar moz = [\r\n 'mozFullScreenEnabled',\r\n 'mozFullScreenElement',\r\n 'mozRequestFullScreen',\r\n 'mozCancelFullScreen',\r\n 'mozfullscreenchange',\r\n 'mozfullscreenerror',\r\n '-moz-full-screen',\r\n];\r\nvar ms = [\r\n 'msFullscreenEnabled',\r\n 'msFullscreenElement',\r\n 'msRequestFullscreen',\r\n 'msExitFullscreen',\r\n 'MSFullscreenChange',\r\n 'MSFullscreenError',\r\n '-ms-fullscreen',\r\n];\r\n// so it doesn't throw if no window or document\r\nvar document = typeof window !== 'undefined' && typeof window.document !== 'undefined' ? window.document : {};\r\nvar vendor = (('fullscreenEnabled' in document && Object.keys(key)) ||\r\n (webkit[0] in document && webkit) ||\r\n (moz[0] in document && moz) ||\r\n (ms[0] in document && ms) ||\r\n []);\r\nvar fscreen = {\r\n requestFullscreen: function (element) { return element[vendor[key.requestFullscreen]](); },\r\n requestFullscreenFunction: function (element) { return element[vendor[key.requestFullscreen]]; },\r\n get exitFullscreen() { return document[vendor[key.exitFullscreen]].bind(document); },\r\n get fullscreenPseudoClass() { return \":\" + vendor[key.fullscreen]; },\r\n addEventListener: function (type, handler, options) { return document.addEventListener(vendor[key[type]], handler, options); },\r\n removeEventListener: function (type, handler, options) { return document.removeEventListener(vendor[key[type]], handler, options); },\r\n get fullscreenEnabled() { return Boolean(document[vendor[key.fullscreenEnabled]]); },\r\n set fullscreenEnabled(val) { },\r\n get fullscreenElement() { return document[vendor[key.fullscreenElement]]; },\r\n set fullscreenElement(val) { },\r\n get onfullscreenchange() { return document[(\"on\" + vendor[key.fullscreenchange]).toLowerCase()]; },\r\n set onfullscreenchange(handler) { return document[(\"on\" + vendor[key.fullscreenchange]).toLowerCase()] = handler; },\r\n get onfullscreenerror() { return document[(\"on\" + vendor[key.fullscreenerror]).toLowerCase()]; },\r\n set onfullscreenerror(handler) { return document[(\"on\" + vendor[key.fullscreenerror]).toLowerCase()] = handler; },\r\n};\n\nexport default fscreen;\n//# sourceMappingURL=fscreen.esm.js.map\n","import {FullscreenAdapter} from '@common/player/state/fullscreen/fullscreen-adapter';\nimport fscreen from 'fscreen';\n\nexport function createNativeFullscreenAdapter(\n host: HTMLElement,\n onChange: () => void\n): FullscreenAdapter {\n host = host.closest('.fullscreen-host') ?? host;\n return {\n isFullscreen: () => {\n if (fscreen.fullscreenElement === host) return true;\n try {\n // Throws in iOS Safari...\n return host.matches(\n // @ts-expect-error - `fullscreenPseudoClass` is missing from `@types/fscreen`.\n fscreen.fullscreenPseudoClass\n );\n } catch (error) {\n return false;\n }\n },\n canFullScreen: () => {\n return fscreen.fullscreenEnabled;\n },\n enter: () => {\n return fscreen.requestFullscreen(host);\n },\n exit: () => {\n return fscreen.exitFullscreen();\n },\n bindEvents: () => {\n fscreen.addEventListener('fullscreenchange', onChange);\n fscreen.addEventListener('fullscreenerror', onChange);\n },\n unbindEvents: () => {\n fscreen.removeEventListener('fullscreenchange', onChange);\n fscreen.removeEventListener('fullscreenerror', onChange);\n },\n };\n}\n","import {FullscreenAdapter} from '@common/player/state/fullscreen/fullscreen-adapter';\nimport {IS_IPHONE} from '@common/utils/platform';\n\nexport function createIphoneFullscreenAdapter(\n host: HTMLVideoElement,\n onChange: () => void\n): FullscreenAdapter {\n return {\n /**\n * @link https://developer.apple.com/documentation/webkitjs/htmlvideoelement/1631913-webkitpresentationmode\n */\n isFullscreen: () => {\n return host.webkitPresentationMode === 'fullscreen';\n },\n /**\n * @link https://developer.apple.com/documentation/webkitjs/htmlvideoelement/1628805-webkitsupportsfullscreen\n */\n canFullScreen: () => {\n return (\n IS_IPHONE &&\n typeof host.webkitSetPresentationMode === 'function' &&\n (host.webkitSupportsFullscreen ?? false)\n );\n },\n enter: () => {\n return host.webkitSetPresentationMode?.('fullscreen');\n },\n exit: () => {\n return host.webkitSetPresentationMode?.('inline');\n },\n bindEvents: () => {\n host.removeEventListener('webkitpresentationmodechanged', onChange);\n },\n unbindEvents: () => {\n host.addEventListener('webkitpresentationmodechanged', onChange);\n },\n };\n}\n","import {StateCreator} from 'zustand';\nimport {\n PlayerState,\n ProviderListeners,\n} from '@common/player/state/player-state';\nimport {ScreenOrientation} from '@common/player/state/fullscreen/screen-orientation';\nimport {IS_IPHONE} from '@common/utils/platform';\nimport {FullscreenAdapter} from '@common/player/state/fullscreen/fullscreen-adapter';\nimport {createNativeFullscreenAdapter} from '@common/player/state/fullscreen/create-native-fullscreen-adapter';\nimport {createIphoneFullscreenAdapter} from '@common/player/state/fullscreen/create-iphone-fullscreen-adapter';\nimport {PipSlice} from '@common/player/state/pip/pip-slice';\n\nexport interface FullscreenSlice {\n isFullscreen: boolean;\n canFullscreen: boolean;\n enterFullscreen: () => void;\n exitFullscreen: () => void;\n toggleFullscreen: () => void;\n initFullscreen: () => void;\n destroyFullscreen: () => void;\n}\n\ntype BaseSliceCreator = StateCreator<\n FullscreenSlice & PlayerState & PipSlice,\n [['zustand/immer', unknown]],\n [],\n FullscreenSlice\n>;\n\ntype StoreLice = BaseSliceCreator extends (...a: infer U) => infer R\n ? (...a: [...U, Set>]) => R\n : never;\n\nconst iPhoneProviderBlacklist = ['youtube'];\n\nexport const createFullscreenSlice: StoreLice = (set, get) => {\n let subscription: () => void | undefined;\n const orientation = new ScreenOrientation();\n let adapter: FullscreenAdapter | undefined;\n\n const onFullscreenChange = async () => {\n const isFullscreen = adapter?.isFullscreen();\n if (isFullscreen) {\n // lock orientation to landscape\n orientation.lock();\n } else {\n orientation.unlock();\n }\n set({isFullscreen});\n };\n\n const isSupported = (): boolean => {\n // iPhone only allows putting video element in fullscreen, and\n // there's no way to get access to it with YouTube iframe api\n if (IS_IPHONE && iPhoneProviderBlacklist.includes(get().providerName!)) {\n return false;\n }\n return adapter?.canFullScreen() ?? false;\n };\n\n return {\n isFullscreen: false,\n canFullscreen: false,\n enterFullscreen: () => {\n if (!isSupported() || adapter?.isFullscreen()) return;\n\n // exit pip if it's active\n if (get().isPip) {\n get().exitPip();\n }\n return adapter?.enter();\n },\n exitFullscreen: () => {\n if (!adapter?.isFullscreen()) return;\n return adapter.exit();\n },\n toggleFullscreen: () => {\n if (get().isFullscreen) {\n get().exitFullscreen();\n } else {\n get().enterFullscreen();\n }\n },\n initFullscreen: () => {\n subscription = get().subscribe({\n providerReady: ({el}) => {\n // when changing adapters, remove previous adapter events and exit fullscreen\n adapter?.unbindEvents();\n if (get().isFullscreen) {\n adapter?.exit();\n }\n // create new adapter, and if fullscreen is supported, bind events\n adapter = IS_IPHONE\n ? createIphoneFullscreenAdapter(\n el as HTMLVideoElement,\n onFullscreenChange\n )\n : createNativeFullscreenAdapter(el, onFullscreenChange);\n const canFullscreen = isSupported();\n set({canFullscreen});\n if (canFullscreen) {\n adapter.bindEvents();\n }\n },\n });\n },\n destroyFullscreen: () => {\n get().exitFullscreen();\n subscription?.();\n },\n };\n};\n","import {PipAdapter} from '@common/player/state/pip/pip-adapter';\nimport {IS_CLIENT} from '@common/utils/platform';\n\nexport const createChromePipAdapter = (\n host: HTMLVideoElement,\n onChange: () => void\n): PipAdapter => {\n return {\n isSupported: () => canUsePiPInChrome(),\n isPip: () => {\n return host === document.pictureInPictureElement;\n },\n enter: () => {\n if (canUsePiPInChrome()) {\n return host.requestPictureInPicture();\n }\n },\n exit: () => {\n if (canUsePiPInChrome()) {\n return document.exitPictureInPicture();\n }\n },\n bindEvents: () => {\n if (canUsePiPInChrome()) {\n host.addEventListener('enterpictureinpicture', onChange);\n host.addEventListener('leavepictureinpicture', onChange);\n }\n },\n unbindEvents: () => {\n if (canUsePiPInChrome()) {\n host.removeEventListener('enterpictureinpicture', onChange);\n host.removeEventListener('leavepictureinpicture', onChange);\n }\n },\n };\n};\n\n/**\n * Checks if the native HTML5 video player can enter picture-in-picture (PIP) mode when using\n * the Chrome browser.\n *\n * @see https://developers.google.com/web/updates/2018/10/watch-video-using-picture-in-picture\n */\nlet _canUsePiPInChrome: boolean | undefined;\nconst canUsePiPInChrome = (): boolean => {\n if (!IS_CLIENT) return false;\n if (_canUsePiPInChrome == null) {\n const video = document.createElement('video');\n _canUsePiPInChrome =\n !!document.pictureInPictureEnabled && !video.disablePictureInPicture;\n }\n return _canUsePiPInChrome;\n};\n","import {PipAdapter} from '@common/player/state/pip/pip-adapter';\nimport {IS_CLIENT, IS_IPHONE} from '@common/utils/platform';\n\nexport const createSafariPipAdapter = (\n host: HTMLVideoElement,\n onChange: () => void\n): PipAdapter => {\n return {\n isSupported: () => canUsePiPInSafari(),\n isPip: () => {\n return host.webkitPresentationMode === 'picture-in-picture';\n },\n enter: () => {\n if (canUsePiPInSafari()) {\n return host.webkitSetPresentationMode?.('picture-in-picture');\n }\n },\n exit: () => {\n if (canUsePiPInSafari()) {\n return host.webkitSetPresentationMode?.('inline');\n }\n },\n bindEvents: () => {\n if (canUsePiPInSafari()) {\n host.addEventListener('webkitpresentationmodechanged', onChange);\n }\n },\n unbindEvents: () => {\n if (canUsePiPInSafari()) {\n host.removeEventListener('webkitpresentationmodechanged', onChange);\n }\n },\n };\n};\n\n/**\n * Checks if the native HTML5 video player can enter picture-in-picture (PIP) mode when using\n * the desktop Safari browser, iOS Safari appears to \"support\" PiP through the check, however PiP\n * does not function.\n *\n * @see https://developer.apple.com/documentation/webkitjs/adding_picture_in_picture_to_your_safari_media_controls\n */\nlet _canUsePiPInSafari: boolean | undefined;\nconst canUsePiPInSafari = (): boolean => {\n if (!IS_CLIENT) return false;\n const video = document.createElement('video');\n if (_canUsePiPInSafari == null) {\n _canUsePiPInSafari =\n // @ts-ignore\n !!video.webkitSupportsPresentationMode &&\n // @ts-ignore\n !!video.webkitSetPresentationMode &&\n !IS_IPHONE;\n }\n return _canUsePiPInSafari;\n};\n","import {StateCreator} from 'zustand';\nimport {\n PlayerState,\n ProviderListeners,\n} from '@common/player/state/player-state';\nimport {PipAdapter} from '@common/player/state/pip/pip-adapter';\nimport {createChromePipAdapter} from '@common/player/state/pip/chrome-pip-adapter';\nimport {createSafariPipAdapter} from '@common/player/state/pip/safari-pip-adapter';\n\nexport interface PipSlice {\n isPip: boolean;\n canPip: boolean;\n enterPip: () => void;\n exitPip: () => void;\n togglePip: () => void;\n initPip: () => void;\n destroyPip: () => void;\n}\n\ntype BaseSliceCreator = StateCreator<\n PipSlice & PlayerState,\n [['zustand/immer', unknown]],\n [],\n PipSlice\n>;\n\ntype StoreLice = BaseSliceCreator extends (...a: infer U) => infer R\n ? (...a: [...U, Set>]) => R\n : never;\n\nconst adapterFactories = [createChromePipAdapter, createSafariPipAdapter];\n\nexport const createPipSlice: StoreLice = (set, get) => {\n let subscription: () => void | undefined;\n let adapters: PipAdapter[] = [];\n\n const onPipChange = () => {\n set({isPip: adapters.some(a => a.isPip())});\n };\n\n const isSupported = (): boolean => {\n if (get().providerName !== 'htmlVideo') {\n return false;\n }\n return adapters.some(adapter => adapter.isSupported());\n };\n\n return {\n isPip: false,\n canPip: false,\n enterPip: async () => {\n if (get().isPip || !isSupported()) return;\n await adapters.find(a => a.isSupported())?.enter();\n },\n exitPip: async () => {\n if (!get().isPip) return;\n await adapters.find(a => a.isSupported())?.exit();\n },\n togglePip: () => {\n if (get().isPip) {\n get().exitPip();\n } else {\n get().enterPip();\n }\n },\n initPip: () => {\n subscription = get().subscribe({\n providerReady: ({el}) => {\n // when changing adapters, remove previous adapter events and exit pip\n adapters.every(a => a.unbindEvents());\n if (get().isPip) {\n adapters.every(a => a.exit());\n }\n // create new adapters, and if pip is supported on at least one, bind events\n adapters = adapterFactories.map(factory =>\n factory(el as HTMLVideoElement, onPipChange)\n );\n const canPip = isSupported();\n if (canPip) {\n adapters.every(a => a.bindEvents());\n }\n set({canPip});\n },\n });\n },\n destroyPip: () => {\n get().exitPip();\n subscription?.();\n },\n };\n};\n","import {createStore} from 'zustand';\nimport {immer} from 'zustand/middleware/immer';\nimport {MediaItem} from '@common/player/media-item';\nimport {setInLocalStorage as _setInLocalStorage} from '@common/utils/hooks/local-storage';\nimport {shuffleArray} from '@common/utils/array/shuffle-array';\nimport {PlayerStoreOptions} from '@common/player/state/player-store-options';\nimport {getPlayerStateFromLocalStorage} from '@common/player/utils/player-local-storage';\nimport {prependToArrayAtIndex} from '@common/utils/array/prepend-to-array-at-index';\nimport deepMerge from 'deepmerge';\nimport {resetMediaSession} from '@common/player/utils/reset-media-session';\nimport {playerQueue} from '@common/player/player-queue';\nimport type {\n PlayerState,\n ProviderListeners,\n RepeatMode,\n} from '@common/player/state/player-state';\nimport {handlePlayerKeybinds} from '@common/player/handle-player-keybinds';\nimport {initPlayerMediaSession} from '@common/player/utils/init-player-media-session';\nimport {isSameMedia} from '@common/player/utils/is-same-media';\nimport {\n createFullscreenSlice,\n FullscreenSlice,\n} from '@common/player/state/fullscreen/fullscreen-slice';\nimport {createPipSlice, PipSlice} from '@common/player/state/pip/pip-slice';\nimport {subscribeWithSelector} from 'zustand/middleware';\n\nexport const createPlayerStore = (\n id: string | number,\n options: PlayerStoreOptions,\n) => {\n // initialData from options should take priority over local storage data\n const initialData = deepMerge(\n getPlayerStateFromLocalStorage(id, options),\n options.initialData || {},\n );\n\n const setInLocalStorage = (key: string, value: any) => {\n _setInLocalStorage(`player.${id}.${key}`, value);\n };\n\n return createStore()(\n subscribeWithSelector(\n immer((set, get, store) => {\n const listeners = new Set>();\n const internalListeners: Partial = {\n play: () => {\n set(s => {\n s.isPlaying = true;\n s.playbackStarted = true;\n });\n },\n pause: () => {\n set(s => {\n s.isPlaying = false;\n s.controlsVisible = true;\n });\n },\n error: e => {\n set(s => {\n // there could be a number of non-fatal errors where player will continue to\n // work properly, like autoplay error from HTML5 video or buffer full from HLS\n if (e?.fatal) {\n s.isPlaying = false;\n }\n });\n },\n durationChange: payload => {\n set({mediaDuration: payload.duration});\n },\n streamTypeChange: payload => {\n set({streamType: payload.streamType});\n },\n buffered: payload => {\n //\n },\n playbackRateChange: payload => {\n set({playbackRate: payload.rate});\n },\n playbackRates: ({rates}) => {\n set({playbackRates: rates});\n },\n playbackQualities: ({qualities}) => {\n set({playbackQualities: qualities});\n },\n audioTracks: ({tracks}) => {\n set({audioTracks: tracks});\n },\n currentAudioTrackChange: ({trackId}) => {\n set({currentAudioTrack: trackId});\n },\n playbackQualityChange: ({quality}) => {\n set({playbackQuality: quality});\n },\n textTracks: ({tracks}) => {\n set({textTracks: tracks});\n },\n currentTextTrackChange: ({trackId}) => {\n set({currentTextTrack: trackId});\n },\n textTrackVisibilityChange: ({isVisible}) => {\n set({textTrackIsVisible: isVisible});\n },\n buffering: ({isBuffering}) => {\n set({isBuffering});\n },\n playbackEnd: async () => {\n const media = get().cuedMedia;\n\n // don't play next or repeat while seeking via seekbar\n if (get().isSeeking) return;\n if (queue.isLast() && options.loadMoreMediaItems) {\n const items = await options.loadMoreMediaItems(media);\n if (items?.length) {\n get().appendToQueue(items);\n }\n }\n\n get().playNext();\n },\n posterLoaded: ({url}) => {\n set({posterUrl: url});\n },\n providerReady: () => {\n const provider = get().providerApi;\n if (provider) {\n provider.setVolume(get().volume);\n provider.setMuted(get().muted);\n if (options.autoPlay) {\n provider.play();\n }\n set({providerReady: true});\n }\n },\n };\n\n const queue = playerQueue(get);\n\n const keybindsHandler = (e: KeyboardEvent) => {\n handlePlayerKeybinds(e, get);\n };\n\n const initialQueue = initialData.queue || [];\n return {\n options,\n ...createFullscreenSlice(set, get, store, listeners),\n ...createPipSlice(set, get, store, listeners),\n originalQueue: initialQueue,\n shuffledQueue: initialData.state?.shuffling\n ? shuffleArray(initialQueue)\n : initialQueue,\n isPlaying: false,\n isBuffering: false,\n streamType: null,\n playbackStarted: false,\n providerReady: false,\n pauseWhileSeeking: options.pauseWhileSeeking ?? true,\n isSeeking: false,\n setIsSeeking: (isSeeking: boolean) => {\n set({isSeeking});\n },\n controlsVisible: true,\n setControlsVisible: (isVisible: boolean) => {\n set(s => {\n s.controlsVisible = isVisible;\n });\n },\n volume: initialData.state?.volume ?? 30,\n setVolume: value => {\n get().providerApi?.setVolume(value);\n set(s => {\n s.volume = value;\n });\n setInLocalStorage('volume', value);\n },\n muted: initialData.state?.muted ?? false,\n setMuted: isMuted => {\n get().providerApi?.setMuted(isMuted);\n set(s => {\n s.muted = isMuted;\n });\n setInLocalStorage('muted', isMuted);\n },\n playbackRates: [],\n playbackRate: 1,\n setPlaybackRate: speed => {\n get().providerApi?.setPlaybackRate(speed);\n },\n playbackQuality: 'auto',\n setPlaybackQuality: quality => {\n get().providerApi?.setPlaybackQuality?.(quality);\n },\n playbackQualities: [],\n repeat: initialData.state?.repeat ?? 'all',\n toggleRepeatMode: () => {\n let newRepeat: RepeatMode = 'all';\n const currentRepeat = get().repeat;\n if (currentRepeat === 'all') {\n newRepeat = 'one';\n } else if (currentRepeat === 'one') {\n newRepeat = false;\n }\n\n set({repeat: newRepeat});\n setInLocalStorage('repeat', newRepeat);\n },\n shuffling: initialData.state?.shuffling ?? false,\n toggleShuffling: () => {\n let newQueue: MediaItem[] = [];\n\n if (get().shuffling) {\n newQueue = get().originalQueue;\n } else {\n newQueue = shuffleArray([...get().shuffledQueue]);\n }\n\n set(s => {\n s.shuffling = !s.shuffling;\n s.shuffledQueue = newQueue;\n });\n },\n mediaDuration: 0,\n seek: time => {\n const timeStr = `${time}`;\n if (timeStr.startsWith('+')) {\n time = get().getCurrentTime() + Number(time);\n } else if (timeStr.startsWith('-')) {\n time = get().getCurrentTime() - Number(timeStr.replace('-', ''));\n } else {\n time = Number(time);\n }\n get().providerApi?.seek(time);\n get().emit('seek', {time});\n },\n getCurrentTime: () => {\n return get().providerApi?.getCurrentTime() || 0;\n },\n play: async media => {\n // get currently active queue item, if none is provided\n if (media) {\n await get().cue(media);\n } else {\n media = get().cuedMedia || queue.getCurrent();\n }\n // if no media to play, stop player and bail\n if (!media) {\n get().stop();\n return;\n }\n await options.onBeforePlay?.();\n await get().providerApi?.play();\n },\n pause: () => {\n get().providerApi?.pause();\n },\n stop: () => {\n if (!get().isPlaying) return;\n get().pause();\n get().seek(0);\n },\n playNext: async () => {\n get().stop();\n let media = queue.getCurrent();\n\n if (get().repeat === 'all' && queue.isLast()) {\n media = queue.getFirst();\n } else if (get().repeat !== 'one') {\n media = queue.getNext();\n }\n\n // YouTube provider will not play the same tray unless we wait some time after playback end\n if (get().repeat === 'one' && get().providerName === 'youtube') {\n await new Promise(resolve => setTimeout(resolve, 50));\n }\n\n // allow user to handle playing next track\n if (options.onBeforePlayNext?.(media)) {\n return;\n }\n\n if (media) {\n await get().play(media);\n } else {\n get().seek(0);\n get().play();\n }\n },\n playPrevious: async () => {\n get().stop();\n let media = queue.getCurrent();\n\n if (get().repeat === 'all' && queue.getPointer() === 0) {\n media = queue.getLast();\n } else if (get().repeat !== 'one') {\n media = queue.getPrevious();\n }\n\n // allow user to handle playing previous track\n if (options.onBeforePlayPrevious?.(media)) {\n return;\n }\n\n if (media) {\n await get().play(media);\n } else {\n get().seek(0);\n get().play();\n }\n },\n cue: async media => {\n if (isSameMedia(media, get().cuedMedia)) return;\n\n get().emit('beforeCued', {previous: get().cuedMedia});\n\n return new Promise((resolve, reject) => {\n const previousProvider = get().providerName;\n\n // wait until media is cued on provider or 3 seconds\n const timeoutId = setTimeout(() => {\n unsubscribe();\n resolve();\n }, 3000);\n const unsubscribe = get().subscribe({\n cued: () => {\n clearTimeout(timeoutId);\n unsubscribe();\n resolve();\n },\n error: e => {\n clearTimeout(timeoutId);\n unsubscribe();\n reject('Could not cue media');\n },\n });\n\n set({\n cuedMedia: media,\n posterUrl: media.poster,\n providerName: media.provider,\n providerReady: previousProvider === media.provider,\n streamType: 'streamType' in media ? media.streamType : null,\n });\n\n if (media) {\n options.setMediaSessionMetadata?.(media);\n }\n\n if (options.persistQueueInLocalStorage) {\n setInLocalStorage('cuedMediaId', media.id);\n }\n });\n },\n async overrideQueue(\n mediaItems: MediaItem[],\n queuePointer: number = 0,\n ): Promise {\n if (!mediaItems?.length) return;\n const items = [...mediaItems];\n set(s => {\n s.shuffledQueue = get().shuffling\n ? shuffleArray(items, true)\n : items;\n s.originalQueue = items;\n });\n if (options.persistQueueInLocalStorage) {\n setInLocalStorage('queue', get().originalQueue.slice(0, 15));\n }\n const media =\n queuePointer > -1 ? mediaItems[queuePointer] : queue.getCurrent();\n if (media) {\n return get().cue(media);\n }\n },\n appendToQueue: (mediaItems, afterCuedMedia = true) => {\n const shuffledNewItems = get().shuffling\n ? shuffleArray([...mediaItems])\n : [...mediaItems];\n const index = afterCuedMedia ? queue.getPointer() : 0;\n set(s => {\n s.shuffledQueue = prependToArrayAtIndex(\n s.shuffledQueue,\n shuffledNewItems,\n index,\n );\n s.originalQueue = prependToArrayAtIndex(\n s.originalQueue,\n mediaItems,\n index,\n );\n });\n if (options.persistQueueInLocalStorage) {\n setInLocalStorage('queue', get().originalQueue.slice(0, 15));\n }\n },\n removeFromQueue: mediaItems => {\n set(s => {\n s.shuffledQueue = s.shuffledQueue.filter(\n item => !mediaItems.find(m => isSameMedia(m, item)),\n );\n s.originalQueue = s.originalQueue.filter(\n item => !mediaItems.find(m => isSameMedia(m, item)),\n );\n });\n if (options.persistQueueInLocalStorage) {\n setInLocalStorage('queue', get().originalQueue.slice(0, 15));\n }\n },\n textTracks: [],\n currentTextTrack: -1,\n setCurrentTextTrack: trackId => {\n get().providerApi?.setCurrentTextTrack?.(trackId);\n },\n textTrackIsVisible: false,\n setTextTrackVisibility: isVisible => {\n get().providerApi?.setTextTrackVisibility?.(isVisible);\n },\n audioTracks: [],\n currentAudioTrack: -1,\n setCurrentAudioTrack: trackId => {\n get().providerApi?.setCurrentAudioTrack?.(trackId);\n },\n destroy: () => {\n get().destroyFullscreen();\n get().destroyPip();\n options?.onDestroy?.();\n resetMediaSession();\n listeners.clear();\n document.removeEventListener('keydown', keybindsHandler);\n },\n init: async () => {\n // add initial and listeners from options, these will be present for the entire lifetime of the player\n get().initFullscreen();\n\n listeners.add(internalListeners);\n if (options.listeners) {\n listeners.add(options.listeners as Partial);\n }\n\n const mediaId =\n initialData.cuedMediaId || initialData.queue?.[0]?.id;\n const mediaToCue = initialData.queue?.find(\n media => media.id === mediaId,\n );\n if (mediaToCue) {\n await get().cue(mediaToCue);\n }\n initPlayerMediaSession(get, options);\n document.addEventListener('keydown', keybindsHandler);\n },\n subscribe: newListeners => {\n listeners.add(newListeners);\n return () => listeners.delete(newListeners);\n },\n emit(event, payload?: any) {\n listeners.forEach(l => l[event]?.({state: get(), ...payload}));\n },\n };\n }),\n ),\n );\n};\n","import {createContext, ReactNode, useState} from 'react';\nimport {createPlayerStore} from '@common/player/state/player-store';\nimport {PlayerStoreOptions} from '@common/player/state/player-store-options';\nimport type {PlayerStoreApi} from '@common/player/state/player-state';\n\nexport const PlayerStoreContext = createContext(null!);\n\ninterface PlayerContextProps {\n children: ReactNode;\n id: string | number;\n options: PlayerStoreOptions;\n}\nexport function PlayerContext({children, id, options}: PlayerContextProps) {\n //lazily create store object only once\n const [store] = useState(() => {\n return createPlayerStore(id, options);\n });\n\n return (\n \n {children}\n \n );\n}\n","import ReactExports from 'react';\nimport useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js';\nimport { createStore } from 'zustand/vanilla';\n\nconst { useDebugValue } = ReactExports;\nconst { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;\nfunction useStoreWithEqualityFn(api, selector = api.getState, equalityFn) {\n const slice = useSyncExternalStoreWithSelector(\n api.subscribe,\n api.getState,\n api.getServerState || api.getState,\n selector,\n equalityFn\n );\n useDebugValue(slice);\n return slice;\n}\nconst createWithEqualityFnImpl = (createState, defaultEqualityFn) => {\n const api = createStore(createState);\n const useBoundStoreWithEqualityFn = (selector, equalityFn = defaultEqualityFn) => useStoreWithEqualityFn(api, selector, equalityFn);\n Object.assign(useBoundStoreWithEqualityFn, api);\n return useBoundStoreWithEqualityFn;\n};\nconst createWithEqualityFn = (createState, defaultEqualityFn) => createState ? createWithEqualityFnImpl(createState, defaultEqualityFn) : createWithEqualityFnImpl;\n\nexport { createWithEqualityFn, useStoreWithEqualityFn };\n","import {StoreApi} from 'zustand';\nimport {useContext} from 'react';\nimport {PlayerStoreContext} from '@common/player/player-context';\nimport {PlayerState} from '@common/player/state/player-state';\nimport {FullscreenSlice} from '@common/player/state/fullscreen/fullscreen-slice';\nimport {PipSlice} from '@common/player/state/pip/pip-slice';\nimport {useStoreWithEqualityFn} from 'zustand/traditional';\n\ntype ExtractState = S extends {\n getState: () => infer T;\n}\n ? T\n : never;\n\ntype UsePlayerStore = {\n (): ExtractState>;\n (\n selector: (\n state: ExtractState>\n ) => U,\n equalityFn?: (a: U, b: U) => boolean\n ): U;\n};\n\n// @ts-ignore\nexport const usePlayerStore: UsePlayerStore = (selector, equalityFn) => {\n const store = useContext(PlayerStoreContext);\n return useStoreWithEqualityFn(store, selector, equalityFn);\n};\n","import {useContext, useMemo} from 'react';\nimport {PlayerStoreContext} from '@common/player/player-context';\nimport {MediaItem} from '@common/player/media-item';\n\nexport type PlayerActions = ReturnType;\n\nexport function usePlayerActions() {\n const store = useContext(PlayerStoreContext);\n\n return useMemo(() => {\n const s = store.getState();\n\n const overrideQueueAndPlay = async (\n mediaItems: MediaItem[],\n queuePointer?: number\n ) => {\n s.stop();\n await s.overrideQueue(mediaItems, queuePointer);\n return s.play();\n };\n\n return {\n play: s.play,\n playNext: s.playNext,\n playPrevious: s.playPrevious,\n pause: s.pause,\n subscribe: s.subscribe,\n emit: s.emit,\n getCurrentTime: s.getCurrentTime,\n seek: s.seek,\n toggleRepeatMode: s.toggleRepeatMode,\n toggleShuffling: s.toggleShuffling,\n getState: store.getState,\n setVolume: s.setVolume,\n setMuted: s.setMuted,\n appendToQueue: s.appendToQueue,\n removeFromQueue: s.removeFromQueue,\n enterFullscreen: s.enterFullscreen,\n exitFullscreen: s.exitFullscreen,\n toggleFullscreen: s.toggleFullscreen,\n enterPip: s.enterPip,\n exitPip: s.exitPip,\n setTextTrackVisibility: s.setTextTrackVisibility,\n setCurrentTextTrack: s.setCurrentTextTrack,\n setCurrentAudioTrack: s.setCurrentAudioTrack,\n setIsSeeking: s.setIsSeeking,\n setControlsVisible: s.setControlsVisible,\n cue: s.cue,\n overrideQueueAndPlay,\n overrideQueue: s.overrideQueue,\n setPlaybackRate: s.setPlaybackRate,\n setPlaybackQuality: s.setPlaybackQuality,\n };\n }, [store]);\n}\n","import {apiClient, queryClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Track} from '@app/web-player/tracks/track';\n\ninterface Response extends BackendResponse {\n tracks: Track[];\n}\n\nexport async function loadMediaItemTracks(\n queueId: string,\n lastTrack?: Track\n): Promise {\n const query = {\n queryKey: ['player/tracks', {queueId, trackId: lastTrack?.id}],\n queryFn: async () => loadTracks(queueId, lastTrack),\n staleTime: Infinity,\n };\n\n try {\n const response =\n queryClient.getQueryData(query.queryKey) ??\n (await queryClient.fetchQuery(query));\n return response?.tracks || [];\n } catch (e) {\n return [];\n }\n}\n\nfunction loadTracks(queueId: string, lastTrack?: Track): Promise {\n return apiClient\n .post('player/tracks', {queueId, lastTrack})\n .then(response => response.data);\n}\n","import {MediaItem} from '@common/player/media-item';\nimport {IS_IOS} from '@common/utils/platform';\n\nconst hlsRegex = /\\.(m3u8)($|\\?)/i;\nconst dashRegex = /\\.(mpd)($|\\?)/i;\nconst audioRegex =\n /\\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\\?)/i;\nconst youtubeUrlRegex =\n /(?:youtu\\.be|youtube|youtube\\.com|youtube-nocookie\\.com)\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=|)((?:\\w|-){11})/;\nconst youtubeIdRegex = /^((?:\\w|-){11})$/;\nexport function guessPlayerProvider(src: string): MediaItem['provider'] {\n if (youtubeUrlRegex.test(src) || youtubeIdRegex.test(src)) {\n return 'youtube';\n } else if (audioRegex.test(src)) {\n return 'htmlAudio';\n } else if (hlsRegex.test(src)) {\n if (IS_IOS) {\n return 'htmlVideo';\n } else {\n return 'hls';\n }\n } else if (dashRegex.test(src)) {\n return 'dash';\n } else {\n return 'htmlVideo';\n }\n}\n","import {Track} from '@app/web-player/tracks/track';\nimport {MediaItem} from '@common/player/media-item';\nimport {getTrackImageSrc} from '@app/web-player/tracks/track-image/track-image';\nimport {Album} from '@app/web-player/albums/album';\nimport {guessPlayerProvider} from '@common/player/utils/guess-player-provider';\n\nexport function trackToMediaItem(\n track: Track,\n queueGroupId?: string | number\n): MediaItem {\n const provider: MediaItem['provider'] = track.src\n ? guessPlayerProvider(track.src)\n : 'youtube';\n\n if (!track.src || provider === 'youtube') {\n return {\n id: track.id,\n provider: 'youtube',\n meta: track,\n src: track.src ? track.src : 'resolve',\n groupId: queueGroupId,\n };\n }\n\n return {\n id: track.id,\n src: track.src,\n provider,\n meta: track,\n poster: getTrackImageSrc(track),\n groupId: queueGroupId,\n };\n}\n\nexport function tracksToMediaItems(\n tracks: Track[],\n queueGroupId?: string,\n album?: Album\n) {\n return tracks.map(track => {\n if (album && !track.album) {\n track = {\n ...track,\n album: {...album, tracks: undefined},\n };\n }\n return trackToMediaItem(track);\n });\n}\n","export default \"__VITE_ASSET__11267b4b__\"","export default \"__VITE_ASSET__2dd5a730__\"","import white from './equalizer-white.gif';\nimport black from './equalizer-black.gif';\nimport clsx from 'clsx';\nimport {useIsDarkMode} from '@common/ui/themes/use-is-dark-mode';\n\ninterface EqualizerImageProps {\n className?: string;\n color?: 'black' | 'white';\n}\nexport function EqualizerImage({className, color}: EqualizerImageProps) {\n const isDarkMode = useIsDarkMode();\n\n if (!color) {\n color = isDarkMode ? 'white' : 'black';\n }\n\n return (\n \n \n \n );\n}\n","import {ComponentPropsWithoutRef, useState} from 'react';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {loadMediaItemTracks} from '@app/web-player/requests/load-media-item-tracks';\nimport {trackToMediaItem} from '@app/web-player/tracks/utils/track-to-media-item';\nimport {PauseIcon} from '@common/icons/material/Pause';\nimport {EqualizerImage} from '@app/web-player/tracks/equalizer-image/equalizer-image';\nimport {PlayArrowFilledIcon} from '@app/web-player/tracks/play-arrow-filled';\nimport {\n ButtonColor,\n ButtonVariant,\n} from '@common/ui/buttons/get-shared-button-style';\nimport {Button} from '@common/ui/buttons/button';\nimport {Trans} from '@common/i18n/trans';\nimport {Track} from '@app/web-player/tracks/track';\nimport {ButtonSize} from '@common/ui/buttons/button-size';\n\ninterface PlaybackToggleButtonProps {\n queueId?: string;\n // track that should be cued\n track?: Track;\n // queue should be overwritten with these tracks\n tracks?: Track[];\n radius?: string;\n variant?: ButtonVariant;\n color?: ButtonColor;\n disabled?: boolean;\n className?: string;\n buttonType: 'icon' | 'text';\n equalizerColor?: 'white' | 'black';\n size?: ButtonSize;\n}\nexport function PlaybackToggleButton({\n queueId,\n track,\n tracks,\n radius,\n variant,\n color,\n disabled,\n className,\n buttonType,\n equalizerColor = buttonType === 'text' ? 'white' : 'black',\n size,\n}: PlaybackToggleButtonProps) {\n const [isHover, setIsHover] = useState(false);\n const modelIsQueued = usePlayerStore(s => {\n // specified queue ID is cued\n if (s.cuedMedia && queueId && s.cuedMedia.groupId === queueId) {\n return true;\n }\n // specified track is cued\n if (s.cuedMedia && track && s.cuedMedia.meta.id === track.id) {\n return true;\n }\n return false;\n });\n const isPlaying = usePlayerStore(s => s.isPlaying);\n const modelIsPlaying = isPlaying && modelIsQueued;\n const player = usePlayerActions();\n\n const statusIcon = modelIsPlaying ? (\n isHover ? (\n \n ) : (\n \n )\n ) : (\n \n );\n\n const sharedProps: ComponentPropsWithoutRef<'button'> = {\n disabled,\n onPointerEnter: () => {\n setIsHover(true);\n },\n onPointerLeave: () => {\n setIsHover(false);\n },\n onClick: async () => {\n if (modelIsPlaying) {\n player.pause();\n } else if (modelIsQueued) {\n await player.play();\n } else {\n let newQueue: Track[] = [];\n let newIndex: number = 0;\n if (tracks) {\n newQueue = [...tracks];\n newIndex = track ? tracks.findIndex(t => t.id === track.id) : 0;\n } else if (track) {\n newQueue = [track];\n } else {\n newQueue = await loadMediaItemTracks(queueId!);\n }\n if (newQueue.length) {\n await player.overrideQueueAndPlay(\n newQueue.map(t => trackToMediaItem(t, queueId)),\n newIndex\n );\n }\n }\n },\n };\n\n if (buttonType === 'icon') {\n return (\n \n {statusIcon}\n \n );\n }\n\n return (\n \n {modelIsPlaying ? : }\n \n );\n}\n","interface MediaItem {\n id: number;\n model_type: string;\n}\n\nexport function queueGroupId(\n model: MediaItem,\n kind: string = '*',\n sortDescriptor?: {orderBy?: string; orderDir?: string}\n): string {\n let base = `${model.model_type}.${model.id}.${kind}`;\n if (sortDescriptor?.orderBy && sortDescriptor?.orderDir) {\n base += `.${sortDescriptor.orderBy.replace('.', '^')}|${\n sortDescriptor.orderDir\n }`;\n }\n return base;\n}\n","import {cloneElement, ReactElement, ReactNode} from 'react';\nimport {IconButton, IconButtonProps} from '@common/ui/buttons/icon-button';\nimport {MoreHorizIcon} from '@common/icons/material/MoreHoriz';\nimport {PlayableModel} from '@app/web-player/playable-item/playable-model';\nimport {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport clsx from 'clsx';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {Track, TRACK_MODEL} from '@app/web-player/tracks/track';\n\ninterface PlayableGridProps {\n image: ReactElement;\n title: ReactNode;\n subtitle?: ReactNode;\n model: PlayableModel;\n newQueue?: Track[];\n link: string;\n likeButton?: ReactElement;\n contextDialog: ReactElement;\n radius?: string;\n}\nexport function PlayableGridItem({\n image,\n title,\n subtitle,\n model,\n newQueue,\n link,\n likeButton,\n contextDialog,\n radius = 'rounded-panel',\n}: PlayableGridProps) {\n const navigate = useNavigate();\n return (\n
\n \n
\n navigate(link)}\n >\n {cloneElement(image, {\n size: 'w-full h-full',\n className: `${radius} shadow-md z-10`,\n })}\n
\n \n \n \n\n {radius !== 'rounded-full' && (\n \n \n \n \n {contextDialog}\n \n )}\n {radius !== 'rounded-full' &&\n likeButton &&\n // 3 buttons won't fit if item is fully rounded\n cloneElement(likeButton, {\n className: 'invisible md:group-hover:visible ml-auto',\n size: 'md',\n color: 'white',\n })}\n
\n \n {contextDialog}\n \n \n
{title}
\n
\n {subtitle}\n
\n \n \n );\n}\n","import {useQuery} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\nimport {useAuth} from '@common/auth/use-auth';\n\ninterface GetAuthUserPlaylistsResponse extends BackendResponse {\n playlists: Playlist[];\n}\n\nexport function useAuthUserPlaylists() {\n const {isLoggedIn, user} = useAuth();\n return useQuery({\n queryKey: ['playlists', 'library', user?.id, 'compact'],\n queryFn: () => fetchPlaylists(),\n enabled: isLoggedIn,\n initialData: () => {\n return {\n playlists: getBootstrapData().playlists || [],\n };\n },\n });\n}\n\nfunction fetchPlaylists(): Promise {\n return apiClient\n .get('users/me/playlists', {\n params: {perPage: 30, orderBy: 'updated_at', orderDir: 'desc'},\n })\n .then(response => {\n return {playlists: response.data.pagination.data};\n });\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {Track} from '@app/web-player/tracks/track';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\n\ninterface Response extends BackendResponse {\n playlist: Playlist;\n}\n\ninterface Payload {\n playlistId: number;\n tracks: Track[];\n}\n\nexport function useAddTracksToPlaylist() {\n return useMutation({\n mutationFn: (payload: Payload) => addTracks(payload),\n onSuccess: (response, {tracks}) => {\n toast(\n message('Added [one 1 track|other :count tracks] to playlist', {\n values: {count: tracks.length},\n }),\n );\n queryClient.invalidateQueries({\n queryKey: ['playlists', response.playlist.id],\n });\n queryClient.invalidateQueries({\n queryKey: ['tracks', 'playlist', response.playlist.id],\n });\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction addTracks(payload: Payload): Promise {\n const backendPayload = {\n ids: payload.tracks.map(track => track.id),\n };\n return apiClient\n .post(`playlists/${payload.playlistId}/tracks/add`, backendPayload)\n .then(r => r.data);\n}\n","import {MouseEvent, useCallback} from 'react';\nimport {useAuth} from '@common/auth/use-auth';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\n\nexport function useAuthClickCapture() {\n const dialogContext = useDialogContext();\n const {isLoggedIn} = useAuth();\n const navigate = useNavigate();\n\n return useCallback(\n (e: MouseEvent) => {\n if (!isLoggedIn) {\n e.preventDefault();\n e.stopPropagation();\n\n if (dialogContext) {\n dialogContext.close();\n }\n\n navigate('/login');\n }\n },\n [navigate, isLoggedIn, dialogContext]\n );\n}\n","import {useAuthUserPlaylists} from '@app/web-player/playlists/requests/use-auth-user-playlists';\nimport {m} from 'framer-motion';\nimport {Button} from '@common/ui/buttons/button';\nimport {KeyboardBackspaceIcon} from '@common/icons/material/KeyboardBackspace';\nimport {Trans} from '@common/i18n/trans';\nimport {\n ContextMenuButton,\n ContextMenuLayoutState,\n} from '@app/web-player/context-dialog/context-dialog-layout';\nimport {AddIcon} from '@common/icons/material/Add';\nimport {KeyboardArrowRightIcon} from '@common/icons/material/KeyboardArrowRight';\nimport {useContext, useMemo} from 'react';\nimport {useAddTracksToPlaylist} from '@app/web-player/playlists/requests/use-add-tracks-to-playlist';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {openDialog} from '@common/ui/overlays/store/dialog-store';\nimport {CreatePlaylistDialog} from '@app/web-player/playlists/crupdate-dialog/create-playlist-dialog';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {useAuth} from '@common/auth/use-auth';\nimport {useAuthClickCapture} from '@app/web-player/use-auth-click-capture';\n\nexport function PlaylistPanel() {\n const {data} = useAuthUserPlaylists();\n const {user} = useAuth();\n const {close: closeMenu} = useDialogContext();\n const {loadTracks, setPlaylistPanelIsActive} = useContext(\n ContextMenuLayoutState,\n );\n const addToPlaylist = useAddTracksToPlaylist();\n\n // only show playlists user created or ones that are collaborative\n const playlists = useMemo(() => {\n return data.playlists.filter(\n p => p.owner_id === user?.id || p.collaborative,\n );\n }, [data, user]);\n\n return (\n \n
\n }\n onClick={() => setPlaylistPanelIsActive(false)}\n >\n \n \n
\n
    \n }\n onClick={async () => {\n closeMenu();\n const [playlist, tracks] = await Promise.all([\n openDialog(CreatePlaylistDialog),\n loadTracks(),\n ]);\n if (tracks.length && playlist) {\n addToPlaylist.mutate({\n playlistId: playlist.id,\n tracks,\n });\n }\n }}\n className=\"text-primary\"\n >\n \n \n {playlists.map(playlist => (\n {\n closeMenu();\n const tracks = await loadTracks();\n if (tracks?.length && !addToPlaylist.isPending) {\n addToPlaylist.mutate({\n playlistId: playlist.id,\n tracks,\n });\n } else {\n toast(message('This item does not have tracks yet'));\n }\n }}\n >\n {playlist.name}\n \n ))}\n
\n \n );\n}\n\nexport function PlaylistPanelButton() {\n const authHandler = useAuthClickCapture();\n const {playlistPanelIsActive, setPlaylistPanelIsActive} = useContext(\n ContextMenuLayoutState,\n );\n return (\n }\n onClickCapture={authHandler}\n onClick={() => {\n setPlaylistPanelIsActive(!playlistPanelIsActive);\n }}\n >\n \n \n );\n}\n","import {AnimatePresence} from 'framer-motion';\nimport {\n cloneElement,\n ComponentPropsWithRef,\n createContext,\n forwardRef,\n ReactElement,\n ReactNode,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport {SvgIconProps} from '@common/icons/svg-icon';\nimport clsx from 'clsx';\nimport {PlaylistPanel} from '@app/web-player/context-dialog/playlist-panel';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Dialog} from '@common/ui/overlays/dialog/dialog';\nimport {DialogBody} from '@common/ui/overlays/dialog/dialog-body';\nimport {Link, To, useLocation} from 'react-router-dom';\nimport {usePrevious} from '@common/utils/hooks/use-previous';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\n\ninterface ContextMenuLayoutStateValue {\n playlistPanelIsActive: boolean;\n setPlaylistPanelIsActive: (value: boolean) => void;\n loadTracks: () => Promise;\n}\nexport const ContextMenuLayoutState =\n createContext(null!);\n\nexport interface ContextMenuLayoutProps {\n image?: ReactElement<{className: string}> | null;\n title?: ReactElement | null;\n description?: ReactElement;\n children: ReactNode;\n loadTracks: () => Promise;\n}\nexport function ContextDialogLayout({\n image,\n title,\n description,\n children,\n loadTracks,\n}: ContextMenuLayoutProps) {\n const [playlistPanelIsActive, setPlaylistPanelIsActive] = useState(false);\n const {close} = useDialogContext();\n const contextValue: ContextMenuLayoutStateValue = useMemo(() => {\n return {\n playlistPanelIsActive,\n setPlaylistPanelIsActive,\n loadTracks,\n };\n }, [playlistPanelIsActive, loadTracks]);\n\n const {pathname} = useLocation();\n\n // close dialog on route change\n const previousPathname = usePrevious(pathname);\n useEffect(() => {\n if (previousPathname && previousPathname !== pathname) {\n close();\n }\n }, [pathname, previousPathname, close]);\n\n const header =\n image || title ? (\n
\n {image && cloneElement(image, {className: 'w-44 h-44 rounded'})}\n
\n {title}\n {description && (\n
{description}
\n )}\n
\n
\n ) : null;\n\n return (\n \n \n {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n
\n {header}\n \n {playlistPanelIsActive ? (\n \n ) : (\n
    \n {children}\n
\n )}\n
\n
\n \n
\n
\n );\n}\n\ninterface ButtonMenuItemProps\n extends Omit, 'type'> {\n type?: 'button';\n}\n\ninterface LinkMenuItemProps\n extends Omit, 'type'> {\n type?: 'link';\n}\n\ntype ContextMenuListItemProps = (ButtonMenuItemProps | LinkMenuItemProps) & {\n children: ReactNode;\n endIcon?: ReactElement;\n startIcon?: ReactElement;\n className?: string;\n to?: To;\n};\nexport const ContextMenuButton = forwardRef(\n (\n {\n children,\n endIcon,\n startIcon,\n className,\n type = 'button',\n to,\n ...buttonProps\n },\n ref\n ) => {\n const Element = type === 'button' ? 'button' : Link;\n return (\n
  • \n \n {startIcon}\n \n {children}\n \n {endIcon}\n \n
  • \n );\n }\n);\n","import {create} from 'zustand';\nimport {immer} from 'zustand/middleware/immer';\nimport {TRACK_MODEL} from '@app/web-player/tracks/track';\nimport {ALBUM_MODEL} from '@app/web-player/albums/album';\nimport {ARTIST_MODEL} from '@app/web-player/artists/artist';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\nimport {Likeable} from '@app/web-player/library/likeable';\n\ninterface State {\n [TRACK_MODEL]: Record;\n [ALBUM_MODEL]: Record;\n [ARTIST_MODEL]: Record;\n has: (item: Likeable | Likeable[]) => boolean;\n add: (items: Likeable[]) => void;\n remove: (items: Likeable[]) => void;\n}\n\nexport function createCountableStore(key: 'likes' | 'reposts') {\n const items = getBootstrapData()[key];\n return create()(\n immer((set, get) => ({\n track: items?.track || {},\n album: items?.album || {},\n artist: (items && 'artist' in items && items?.artist) || {},\n has: item => {\n const items = Array.isArray(item) ? item : [item];\n return items.every(item => {\n return get()[item.model_type][item.id];\n });\n },\n add: items => {\n // will only be adding items with the same\n // type in one call, no need to group by type\n const type = items[0].model_type;\n set(state => {\n items.forEach(item => {\n state[type][item.id] = true;\n });\n });\n },\n remove: items => {\n const type = items[0].model_type;\n set(state => {\n items.forEach(item => {\n delete state[type][item.id];\n });\n });\n },\n }))\n );\n}\n","import {createCountableStore} from '@app/web-player/library/state/create-countable-store';\n\nexport const useLibraryStore = createCountableStore('likes');\n\nexport const userLibrary = useLibraryStore.getState;\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {Likeable} from '@app/web-player/library/likeable';\nimport {userLibrary} from '@app/web-player/library/state/likes-store';\n\ninterface Response extends BackendResponse {}\n\ninterface Payload {\n likeables: Likeable[];\n}\n\nexport function useAddItemsToLibrary() {\n return useMutation({\n mutationFn: (payload: Payload) => addToLibrary(payload),\n onSuccess: (response, payload) => {\n toast(getMessage(payload.likeables[0]));\n userLibrary().add(payload.likeables);\n // tracks/albums/artists\n queryClient.invalidateQueries({\n queryKey: [`${payload.likeables[0].model_type}s`, 'library'],\n });\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction addToLibrary(payload: Payload): Promise {\n const likeables = payload.likeables\n .filter(likeable => {\n return !userLibrary().has(likeable);\n })\n .map(likeable => {\n return {\n likeable_id: likeable.id,\n likeable_type: likeable.model_type,\n };\n });\n return apiClient\n .post('users/me/add-to-library', {likeables})\n .then(r => r.data);\n}\n\nfunction getMessage(likeable: Likeable) {\n switch (likeable.model_type) {\n case 'artist':\n return message('Added to your artists');\n case 'album':\n return message('Added to your albums');\n case 'track':\n return message('Added to your liked songs');\n }\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {Likeable} from '@app/web-player/library/likeable';\nimport {userLibrary} from '@app/web-player/library/state/likes-store';\n\ninterface Response extends BackendResponse {}\n\ninterface Payload {\n likeables: Likeable[];\n}\n\nexport function useRemoveItemsFromLibrary() {\n return useMutation({\n mutationFn: (payload: Payload) => addToLibrary(payload),\n onSuccess: (response, payload) => {\n toast(getMessage(payload.likeables[0]));\n userLibrary().remove(payload.likeables);\n // tracks/albums/artists\n queryClient.invalidateQueries({\n queryKey: [`${payload.likeables[0].model_type}s`, 'library'],\n });\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction addToLibrary(payload: Payload): Promise {\n const likeables = payload.likeables\n .filter(likeable => {\n return userLibrary().has(likeable);\n })\n .map(likeable => {\n return {\n likeable_id: likeable.id,\n likeable_type: likeable.model_type,\n };\n });\n return apiClient\n .post('users/me/remove-from-library', {likeables})\n .then(r => r.data);\n}\n\nfunction getMessage(likeable: Likeable) {\n switch (likeable.model_type) {\n case 'artist':\n return message('Removed from your artists');\n case 'album':\n return message('Removed from your albums');\n case 'track':\n return message('Removed from your liked songs');\n }\n}\n","import {ContextMenuButton} from '@app/web-player/context-dialog/context-dialog-layout';\nimport {Trans} from '@common/i18n/trans';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {useAddItemsToLibrary} from '@app/web-player/library/requests/use-add-items-to-library';\nimport {useRemoveItemsFromLibrary} from '@app/web-player/library/requests/use-remove-items-from-library';\nimport {useLibraryStore} from '@app/web-player/library/state/likes-store';\nimport {Likeable} from '@app/web-player/library/likeable';\nimport {useAuthClickCapture} from '@app/web-player/use-auth-click-capture';\n\ninterface ToggleInLibraryMenuButtonProps {\n items: Likeable[];\n modelType?: 'track' | 'album' | 'artist';\n}\nexport function ToggleInLibraryMenuButton({\n items,\n modelType,\n}: ToggleInLibraryMenuButtonProps) {\n const authHandler = useAuthClickCapture();\n const {close: closeMenu} = useDialogContext();\n const addToLibrary = useAddItemsToLibrary();\n const removeFromLibrary = useRemoveItemsFromLibrary();\n const allInLibrary = useLibraryStore(s => s.has(items));\n\n if (allInLibrary) {\n const label =\n modelType === 'artist' ? (\n \n ) : (\n \n );\n return (\n {\n closeMenu();\n removeFromLibrary.mutate({likeables: items});\n }}\n >\n {label}\n \n );\n }\n\n const label =\n modelType === 'artist' ? (\n \n ) : (\n \n );\n return (\n {\n closeMenu();\n addToLibrary.mutate({likeables: items});\n }}\n >\n {label}\n \n );\n}\n","import useCopyClipboard from 'react-use-clipboard';\nimport {getAlbumLink} from '@app/web-player/albums/album-link';\nimport {ReactNode} from 'react';\nimport {ContextMenuButton} from '@app/web-player/context-dialog/context-dialog-layout';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {Trans} from '@common/i18n/trans';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\n\ninterface CopyLinkMenuButtonProps {\n link: string;\n children: ReactNode;\n}\nexport function CopyLinkMenuButton({link, children}: CopyLinkMenuButtonProps) {\n const {close: closeMenu} = useDialogContext();\n const [, copyLink] = useCopyClipboard(link);\n\n return (\n {\n copyLink();\n closeMenu();\n toast(message('Copied link to clipboard'));\n }}\n >\n {children}\n \n );\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {useLocation} from 'react-router-dom';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {useAuth} from '@common/auth/use-auth';\n\ninterface Response extends BackendResponse {}\n\nexport function useDeleteArtist(artistId: number | string) {\n const {pathname} = useLocation();\n const navigate = useNavigate();\n const {getRedirectUri} = useAuth();\n\n return useMutation({\n mutationFn: () => deleteArtist(artistId),\n onSuccess: () => {\n toast(message('Artist deleted'));\n // navigate to homepage if we are on this artist page currently\n if (pathname.startsWith(`/artist/${artistId}`)) {\n navigate(getRedirectUri());\n }\n queryClient.invalidateQueries({queryKey: ['tracks']});\n queryClient.invalidateQueries({queryKey: ['albums']});\n queryClient.invalidateQueries({queryKey: ['artists']});\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction deleteArtist(artistId: number | string): Promise {\n return apiClient.delete(`artists/${artistId}`).then(r => r.data);\n}\n","import {slugifyString} from '@common/utils/string/slugify-string';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\n\nexport function getRadioLink(\n seed: {model_type: string; id: number; name: string},\n {absolute}: {absolute?: boolean} = {},\n): string {\n let link = `/radio/${seed.model_type}/${seed.id}/${slugifyString(seed.name)}`;\n if (absolute) {\n link = `${getBootstrapData().settings.base_url}${link}`;\n }\n return link;\n}\n","import {useSettings} from '@common/core/settings/use-settings';\n\nexport function useShouldShowRadioButton(): boolean {\n const {player, artist_provider} = useSettings();\n return !player?.hide_radio_button && artist_provider === 'spotify';\n}\n","import {useTrans} from '@common/i18n/use-trans';\nimport {message} from '@common/i18n/message';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {getTrackImageSrc} from '@app/web-player/tracks/track-image/track-image';\nimport clsx from 'clsx';\nimport {PlaylistPlayIcon} from '@common/icons/material/PlaylistPlay';\n\ninterface PlaylistImageProps {\n playlist: Playlist;\n className?: string;\n size?: string;\n}\nexport function PlaylistImage({playlist, className, size}: PlaylistImageProps) {\n const {trans} = useTrans();\n const src = getPlaylistImageSrc(playlist);\n const imgClassName = clsx(\n className,\n size,\n 'object-cover bg-fg-base/4',\n !src ? 'flex items-center justify-center' : 'block',\n );\n\n return src ? (\n \n ) : (\n \n \n \n );\n}\n\nexport function getPlaylistImageSrc(playlist: Playlist) {\n if (playlist.image) {\n return playlist.image;\n }\n const firstTrackImage = playlist.tracks?.[0]\n ? getTrackImageSrc(playlist.tracks[0])\n : null;\n if (firstTrackImage) {\n return firstTrackImage;\n }\n}\n","import {Artist} from '@app/web-player/artists/artist';\nimport {Album} from '@app/web-player/albums/album';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Dialog} from '@common/ui/overlays/dialog/dialog';\nimport {DialogHeader} from '@common/ui/overlays/dialog/dialog-header';\nimport {Trans} from '@common/i18n/trans';\nimport {DialogBody} from '@common/ui/overlays/dialog/dialog-body';\nimport {Tabs} from '@common/ui/tabs/tabs';\nimport {TabList} from '@common/ui/tabs/tab-list';\nimport {Tab} from '@common/ui/tabs/tab';\nimport {TabPanel, TabPanels} from '@common/ui/tabs/tab-panels';\nimport {SmallArtistImage} from '@app/web-player/artists/artist-image/small-artist-image';\nimport {AlbumImage} from '@app/web-player/albums/album-image/album-image';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {TextField} from '@common/ui/forms/input-field/text-field/text-field';\nimport {getArtistLink} from '@app/web-player/artists/artist-link';\nimport {getAlbumLink} from '@app/web-player/albums/album-link';\nimport {getTrackLink} from '@app/web-player/tracks/track-link';\nimport {Button} from '@common/ui/buttons/button';\nimport {useRef} from 'react';\nimport useCopyClipboard from 'react-use-clipboard';\nimport {ShareMediaButtons} from '@app/web-player/sharing/share-media-buttons';\nimport {DialogFooter} from '@common/ui/overlays/dialog/dialog-footer';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {PlaylistImage} from '@app/web-player/playlists/playlist-image';\nimport {getPlaylistLink} from '@app/web-player/playlists/playlist-link';\n\ninterface Props {\n item: Artist | Album | Track | Playlist;\n}\nexport function ShareMediaDialog({item}: Props) {\n const {close} = useDialogContext();\n return (\n \n \n \n \n \n {item.model_type === 'artist' || item.model_type === 'playlist' ? (\n \n ) : (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n \n \n \n \n );\n}\n\nfunction EmbedPanel({item}: Props) {\n const isMobile = useIsMobileMediaQuery();\n const link = `${getLink(item)}/embed`;\n const height = item.model_type === 'track' ? 174 : 384;\n\n const code = ``;\n\n return (\n
    \n {!isMobile && (\n \n )}\n {\n e.currentTarget.focus();\n e.currentTarget.select();\n }}\n />\n
    \n );\n}\n\nfunction SharePanel({item}: Props) {\n const link = getLink(item);\n const inputRef = useRef(null);\n const [copied, copyLink] = useCopyClipboard(link, {successDuration: 600});\n return (\n
    \n \n
    \n
    {item.name}
    \n {\n e.currentTarget.focus();\n e.currentTarget.select();\n }}\n value={link}\n endAppend={\n {\n inputRef.current?.select();\n copyLink();\n }}\n >\n {copied ? : }\n \n }\n />\n \n
    \n
    \n );\n}\n\ninterface MediaImageProps {\n item: Props['item'];\n className?: string;\n size?: string;\n}\nfunction MediaImage({item, className, size}: MediaImageProps) {\n switch (item.model_type) {\n case 'artist':\n return (\n \n );\n case 'album':\n return ;\n case 'track':\n return ;\n case 'playlist':\n return (\n \n );\n }\n}\n\nfunction getLink(item: Props['item']) {\n switch (item.model_type) {\n case 'artist':\n return getArtistLink(item, {absolute: true});\n case 'album':\n return getAlbumLink(item, {absolute: true});\n case 'track':\n return getTrackLink(item, {absolute: true});\n case 'playlist':\n return getPlaylistLink(item, {absolute: true});\n }\n}\n","import {ContextMenuButton} from '@app/web-player/context-dialog/context-dialog-layout';\nimport {Trans} from '@common/i18n/trans';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Artist} from '@app/web-player/artists/artist';\nimport {Album} from '@app/web-player/albums/album';\nimport {openDialog} from '@common/ui/overlays/store/dialog-store';\nimport React from 'react';\nimport {ShareMediaDialog} from '@app/web-player/sharing/share-media-dialog';\nimport {Playlist} from '@app/web-player/playlists/playlist';\n\ninterface Props {\n item: Track | Album | Artist | Playlist;\n}\nexport function ShareMediaButton({item}: Props) {\n const {close: closeMenu} = useDialogContext();\n return (\n {\n closeMenu();\n openDialog(ShareMediaDialog, {\n item,\n });\n }}\n >\n \n \n );\n}\n","import {Trans} from '@common/i18n/trans';\nimport {Track} from '@app/web-player/tracks/track';\nimport {\n ContextDialogLayout,\n ContextMenuButton,\n} from '@app/web-player/context-dialog/context-dialog-layout';\nimport React, {useCallback} from 'react';\nimport {ToggleInLibraryMenuButton} from '@app/web-player/context-dialog/toggle-in-library-menu-button';\nimport {CopyLinkMenuButton} from '@app/web-player/context-dialog/copy-link-menu-button';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {openDialog} from '@common/ui/overlays/store/dialog-store';\nimport {ConfirmationDialog} from '@common/ui/overlays/dialog/confirmation-dialog';\nimport {Artist} from '@app/web-player/artists/artist';\nimport {useArtistPermissions} from '@app/web-player/artists/use-artist-permissions';\nimport {SmallArtistImage} from '@app/web-player/artists/artist-image/small-artist-image';\nimport {ArtistLink, getArtistLink} from '@app/web-player/artists/artist-link';\nimport {useDeleteArtist} from '@app/web-player/artists/requests/use-delete-artist';\nimport {getRadioLink} from '@app/web-player/radio/get-radio-link';\nimport {useShouldShowRadioButton} from '@app/web-player/tracks/context-dialog/use-should-show-radio-button';\nimport {ShareMediaButton} from '@app/web-player/context-dialog/share-media-button';\n\ninterface ArtistContextDialogProps {\n artist: Artist;\n}\nexport function ArtistContextDialog({artist}: ArtistContextDialogProps) {\n const showRadioButton = useShouldShowRadioButton();\n const {canEdit} = useArtistPermissions(artist);\n const loadTracks = useCallback(() => {\n return loadArtistTracks(artist);\n }, [artist]);\n\n return (\n }\n title={}\n loadTracks={loadTracks}\n >\n \n {showRadioButton && (\n \n \n \n )}\n \n \n \n \n {canEdit && (\n \n \n \n )}\n {canEdit && (\n \n \n \n )}\n \n \n );\n}\n\nfunction DeleteButton({artist}: ArtistContextDialogProps) {\n const {close: closeMenu} = useDialogContext();\n const deleteArtist = useDeleteArtist(artist.id);\n const {canDelete} = useArtistPermissions(artist);\n\n if (!canDelete) {\n return null;\n }\n\n return (\n {\n closeMenu();\n openDialog(ConfirmationDialog, {\n isDanger: true,\n title: ,\n body: (\n \n ),\n confirm: ,\n onConfirm: () => {\n deleteArtist.mutate();\n },\n });\n }}\n >\n \n \n );\n}\n\n// tracks are never used/loaded in artist context dialog\nasync function loadArtistTracks(artist: Artist): Promise {\n return Promise.resolve([]);\n}\n","import {useAddItemsToLibrary} from '@app/web-player/library/requests/use-add-items-to-library';\nimport {useRemoveItemsFromLibrary} from '@app/web-player/library/requests/use-remove-items-from-library';\nimport {useLibraryStore} from '@app/web-player/library/state/likes-store';\nimport {Likeable} from '@app/web-player/library/likeable';\nimport {IconButton, IconButtonProps} from '@common/ui/buttons/icon-button';\nimport {FavoriteIcon} from '@common/icons/material/Favorite';\nimport {FavoriteBorderIcon} from '@common/icons/material/FavoriteBorder';\nimport {useAuthClickCapture} from '@app/web-player/use-auth-click-capture';\n\ninterface LikeIconButtonProps\n extends Omit {\n likeable: Likeable;\n}\nexport function LikeIconButton({\n likeable,\n size = 'sm',\n ...buttonProps\n}: LikeIconButtonProps) {\n const authHandler = useAuthClickCapture();\n const addToLibrary = useAddItemsToLibrary();\n const removeFromLibrary = useRemoveItemsFromLibrary();\n const isLiked = useLibraryStore(s => s.has(likeable));\n const isLoading = addToLibrary.isPending || removeFromLibrary.isPending;\n\n if (isLiked) {\n return (\n {\n e.stopPropagation();\n removeFromLibrary.mutate({likeables: [likeable]});\n }}\n >\n \n \n );\n }\n return (\n {\n e.stopPropagation();\n addToLibrary.mutate({likeables: [likeable]});\n }}\n >\n \n \n );\n}\n","import {Artist} from '@app/web-player/artists/artist';\nimport {SmallArtistImage} from '@app/web-player/artists/artist-image/small-artist-image';\nimport {PlayableGridItem} from '@app/web-player/playable-item/playable-grid-item';\nimport {ArtistContextDialog} from '@app/web-player/artists/artist-context-dialog';\nimport {ArtistLink, getArtistLink} from '@app/web-player/artists/artist-link';\nimport {LikeIconButton} from '@app/web-player/library/like-icon-button';\n\ninterface ArtistGridItemProps {\n artist: Artist;\n radius?: string;\n}\nexport function ArtistGridItem({\n artist,\n radius = 'rounded-full',\n}: ArtistGridItemProps) {\n return (\n }\n title={}\n model={artist}\n link={getArtistLink(artist)}\n likeButton={}\n contextDialog={}\n radius={radius}\n />\n );\n}\n","import {ContextMenuButton} from '@app/web-player/context-dialog/context-dialog-layout';\nimport {Trans} from '@common/i18n/trans';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {tracksToMediaItems} from '@app/web-player/tracks/utils/track-to-media-item';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Artist} from '@app/web-player/artists/artist';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {Album} from '@app/web-player/albums/album';\n\ntype MediaItem = Track[] | Album | Artist | Playlist;\n\ninterface AddToQueueButtonProps {\n item: MediaItem;\n loadTracks: () => Promise;\n}\nexport function AddToQueueButton({item, loadTracks}: AddToQueueButtonProps) {\n const {close: closeMenu} = useDialogContext();\n const player = usePlayerActions();\n\n return (\n {\n closeMenu();\n const tracks = await loadTracks();\n player.appendToQueue(\n tracksToMediaItems(\n tracks,\n Array.isArray(item) ? undefined : queueGroupId(item)\n )\n );\n }}\n >\n \n \n );\n}\n","import {createCountableStore} from '@app/web-player/library/state/create-countable-store';\n\nexport const useRepostsStore = createCountableStore('reposts');\n\nexport const userReposts = useRepostsStore.getState;\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useMutation} from '@tanstack/react-query';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Album} from '@app/web-player/albums/album';\nimport {userReposts} from '@app/web-player/library/state/reposts-store';\n\ninterface Response extends BackendResponse {\n action: 'added' | 'removed';\n}\n\ninterface Payload {\n repostable: Track | Album;\n}\n\nexport function useToggleRepost() {\n return useMutation({\n mutationFn: (payload: Payload) => toggleRepost(payload),\n onSuccess: (response, {repostable}) => {\n if (response.action === 'added') {\n userReposts().add([repostable]);\n } else {\n userReposts().remove([repostable]);\n }\n queryClient.invalidateQueries({queryKey: ['reposts']});\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction toggleRepost({repostable}: Payload): Promise {\n const payload = {\n repostable_id: repostable.id,\n repostable_type: repostable.model_type,\n };\n return apiClient.post('reposts/toggle', payload).then(r => r.data);\n}\n","import {ContextMenuButton} from '@app/web-player/context-dialog/context-dialog-layout';\nimport {Trans} from '@common/i18n/trans';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Album} from '@app/web-player/albums/album';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {useToggleRepost} from '@app/web-player/reposts/use-toggle-repost';\nimport {useRepostsStore} from '@app/web-player/library/state/reposts-store';\nimport {useAuthClickCapture} from '@app/web-player/use-auth-click-capture';\n\ninterface Props {\n item: Track | Album;\n}\nexport function ToggleRepostMenuButton({item}: Props) {\n const authHandler = useAuthClickCapture();\n const {close: closeMenu} = useDialogContext();\n const {player} = useSettings();\n const toggleRepost = useToggleRepost();\n const isReposted = useRepostsStore(s => s.has(item));\n if (!player?.enable_repost) return null;\n\n return (\n {\n closeMenu();\n toggleRepost.mutate({repostable: item});\n }}\n >\n {isReposted ? : }\n \n );\n}\n","import {Album} from '@app/web-player/albums/album';\nimport {AlbumImage} from '@app/web-player/albums/album-image/album-image';\nimport {AlbumLink, getAlbumLink} from '@app/web-player/albums/album-link';\nimport {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {Trans} from '@common/i18n/trans';\nimport {loadMediaItemTracks} from '@app/web-player/requests/load-media-item-tracks';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {Track} from '@app/web-player/tracks/track';\nimport {\n ContextDialogLayout,\n ContextMenuButton,\n} from '@app/web-player/context-dialog/context-dialog-layout';\nimport {PlaylistPanelButton} from '@app/web-player/context-dialog/playlist-panel';\nimport {useAlbumPermissions} from '@app/web-player/albums/use-album-permissions';\nimport React, {useCallback} from 'react';\nimport {AddToQueueButton} from '@app/web-player/context-dialog/add-to-queue-menu-button';\nimport {ToggleInLibraryMenuButton} from '@app/web-player/context-dialog/toggle-in-library-menu-button';\nimport {CopyLinkMenuButton} from '@app/web-player/context-dialog/copy-link-menu-button';\nimport {useDeleteAlbum} from '@app/web-player/albums/requests/use-delete-album';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {openDialog} from '@common/ui/overlays/store/dialog-store';\nimport {ConfirmationDialog} from '@common/ui/overlays/dialog/confirmation-dialog';\nimport {ToggleRepostMenuButton} from '@app/web-player/context-dialog/toggle-repost-menu-button';\nimport {getArtistLink} from '@app/web-player/artists/artist-link';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\nimport {ShareMediaButton} from '@app/web-player/context-dialog/share-media-button';\n\ninterface AlbumContextMenuProps {\n album: Album;\n}\nexport function AlbumContextDialog({album}: AlbumContextMenuProps) {\n const {canEdit} = useAlbumPermissions(album);\n const isMobile = useIsMobileMediaQuery();\n\n const loadTracks = useCallback(() => {\n return loadAlbumTracks(album);\n }, [album]);\n\n return (\n }\n title={}\n description={}\n loadTracks={loadTracks}\n >\n \n \n \n {album.artists?.[0] && (\n \n \n \n )}\n {!isMobile && (\n \n \n \n )}\n \n \n {canEdit && (\n \n \n \n )}\n {canEdit && (\n \n \n \n )}\n \n \n );\n}\n\nfunction DeleteButton({album}: AlbumContextMenuProps) {\n const {close: closeMenu} = useDialogContext();\n const deleteAlbum = useDeleteAlbum();\n const {canDelete} = useAlbumPermissions(album);\n\n if (!canDelete) {\n return null;\n }\n\n return (\n {\n closeMenu();\n openDialog(ConfirmationDialog, {\n isDanger: true,\n title: ,\n body: ,\n confirm: ,\n onConfirm: () => {\n deleteAlbum.mutate({albumId: album.id});\n },\n });\n }}\n >\n \n \n );\n}\n\nasync function loadAlbumTracks(album: Album): Promise {\n // load album tracks if not loaded already\n if (typeof album.tracks === 'undefined') {\n const tracks = await loadMediaItemTracks(queueGroupId(album));\n if (!tracks.length) {\n toast(message('This album has no tracks yet.'));\n }\n return tracks;\n }\n return album.tracks;\n}\n","import {Album} from '@app/web-player/albums/album';\nimport {AlbumImage} from '@app/web-player/albums/album-image/album-image';\nimport {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {PlayableGridItem} from '@app/web-player/playable-item/playable-grid-item';\nimport {AlbumLink, getAlbumLink} from '@app/web-player/albums/album-link';\nimport {AlbumContextDialog} from '@app/web-player/albums/album-context-dialog';\nimport {LikeIconButton} from '@app/web-player/library/like-icon-button';\n\ninterface AlbumGridItemProps {\n album: Album;\n}\nexport function AlbumGridItem({album}: AlbumGridItemProps) {\n return (\n }\n title={}\n subtitle={}\n link={getAlbumLink(album)}\n likeButton={}\n model={album}\n contextDialog={}\n />\n );\n}\n","import {useTrans} from '@common/i18n/use-trans';\nimport {message} from '@common/i18n/message';\nimport clsx from 'clsx';\nimport {Genre} from '@app/web-player/genres/genre';\nimport {LabelIcon} from '@common/icons/material/Label';\n\ninterface GenreImageProps {\n genre: Genre;\n className?: string;\n size?: string;\n}\nexport function GenreImage({genre, className, size}: GenreImageProps) {\n const {trans} = useTrans();\n const src = genre.image;\n const imgClassName = clsx(\n className,\n size,\n 'object-cover bg-fg-base/4',\n !src ? 'flex items-center justify-center' : 'block',\n );\n\n return src ? (\n \n ) : (\n \n \n \n );\n}\n","import {Genre} from '@app/web-player/genres/genre';\nimport {GenreImage} from '@app/web-player/genres/genre-image';\nimport {Link} from 'react-router-dom';\nimport {getGenreLink} from '@app/web-player/genres/genre-link';\nimport {Trans} from '@common/i18n/trans';\n\ninterface GenreGridItemProps {\n genre: Genre;\n}\nexport function GenreGridItem({genre}: GenreGridItemProps) {\n return (\n \n \n
    \n \n
    \n \n );\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {useLocation} from 'react-router-dom';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {useAuth} from '@common/auth/use-auth';\n\ninterface Response extends BackendResponse {}\n\ninterface Payload {\n trackIds: number[];\n}\n\nexport function useDeleteTracks() {\n const {pathname} = useLocation();\n const navigate = useNavigate();\n const {getRedirectUri} = useAuth();\n\n return useMutation({\n mutationFn: (payload: Payload) => deleteTracks(payload),\n onSuccess: async (response, {trackIds}) => {\n await queryClient.invalidateQueries({queryKey: ['tracks']});\n await queryClient.invalidateQueries({queryKey: ['channel']});\n toast(\n message('[one Track|other :count Tracks] deleted', {\n values: {count: trackIds.length},\n }),\n );\n // navigate to homepage if we are on this track page currently\n if (trackIds.some(trackId => pathname.startsWith(`/track/${trackId}`))) {\n navigate(getRedirectUri());\n }\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction deleteTracks({trackIds}: Payload): Promise {\n return apiClient.delete(`tracks/${trackIds.join(',')}`).then(r => r.data);\n}\n","import {useQuery} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Lyric} from '@app/web-player/tracks/lyrics/lyric';\n\ninterface Response extends BackendResponse {\n lyric?: Lyric;\n}\n\nexport function useLyrics(track: Track) {\n return useQuery({\n queryKey: ['lyrics', track.id],\n queryFn: () => fetchLyrics(track.id),\n });\n}\n\nfunction fetchLyrics(trackId: number) {\n return apiClient\n .get(`tracks/${trackId}/lyrics`)\n .then(response => response.data);\n}\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaMicrophoneIcon = createSvgIcon(\n [,,],\n 'MediaMicrophone',\n '0 0 32 32'\n);\n","import {Dialog} from '@common/ui/overlays/dialog/dialog';\nimport {DialogBody} from '@common/ui/overlays/dialog/dialog-body';\nimport {Track} from '@app/web-player/tracks/track';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {DialogHeader} from '@common/ui/overlays/dialog/dialog-header';\nimport {Trans} from '@common/i18n/trans';\nimport {useLyrics} from '@app/web-player/tracks/lyrics/requests/use-lyrics';\nimport {Skeleton} from '@common/ui/skeleton/skeleton';\nimport {AnimatePresence, m} from 'framer-motion';\nimport {opacityAnimation} from '@common/ui/animation/opacity-animation';\nimport {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {MediaMicrophoneIcon} from '@common/icons/media/media-microphone';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\n\ninterface Props {\n track: Track;\n}\nexport function LyricsDialog({track}: Props) {\n const {data, isLoading} = useLyrics(track);\n const {close} = useDialogContext();\n\n let content;\n\n if (data?.lyric?.text) {\n content = (\n \n );\n } else if (isLoading) {\n content = ;\n } else {\n content = (\n }\n imageHeight=\"h-auto\"\n title={}\n description={}\n />\n );\n }\n\n return (\n \n \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    {track.name}
    \n
    \n close()}\n />\n
    \n
    \n
    \n
    \n
    \n {content}\n
    \n
    \n
    \n
    \n );\n}\n\nfunction LyricSkeleton() {\n return (\n \n {[...new Array(8).keys()].map(key => (\n \n ))}\n \n );\n}\n","import {Track} from '@app/web-player/tracks/track';\n\nexport function trackIsLocallyUploaded(track: Track): boolean {\n return (\n track?.src != null &&\n (track.src.startsWith('storage') ||\n track.src.includes('storage/track_media'))\n );\n}\n","import {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {Trans} from '@common/i18n/trans';\nimport {Track} from '@app/web-player/tracks/track';\nimport {\n ContextDialogLayout,\n ContextMenuButton,\n ContextMenuLayoutProps,\n} from '@app/web-player/context-dialog/context-dialog-layout';\nimport {PlaylistPanelButton} from '@app/web-player/context-dialog/playlist-panel';\nimport {CopyLinkMenuButton} from '@app/web-player/context-dialog/copy-link-menu-button';\nimport {getTrackLink, TrackLink} from '@app/web-player/tracks/track-link';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {useTrackPermissions} from '@app/web-player/tracks/hooks/use-track-permissions';\nimport {AddToQueueButton} from '@app/web-player/context-dialog/add-to-queue-menu-button';\nimport React, {Fragment, ReactNode, useCallback} from 'react';\nimport {ToggleInLibraryMenuButton} from '@app/web-player/context-dialog/toggle-in-library-menu-button';\nimport {ToggleRepostMenuButton} from '@app/web-player/context-dialog/toggle-repost-menu-button';\nimport {getRadioLink} from '@app/web-player/radio/get-radio-link';\nimport {useShouldShowRadioButton} from '@app/web-player/tracks/context-dialog/use-should-show-radio-button';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {openDialog} from '@common/ui/overlays/store/dialog-store';\nimport {ConfirmationDialog} from '@common/ui/overlays/dialog/confirmation-dialog';\nimport {useDeleteTracks} from '@app/web-player/tracks/requests/use-delete-tracks';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\nimport {getArtistLink} from '@app/web-player/artists/artist-link';\nimport {getAlbumLink} from '@app/web-player/albums/album-link';\nimport {ShareMediaButton} from '@app/web-player/context-dialog/share-media-button';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {LyricsDialog} from '@app/web-player/tracks/lyrics/lyrics-dialog';\nimport {trackIsLocallyUploaded} from '@app/web-player/tracks/utils/track-is-locally-uploaded';\nimport {useAuth} from '@common/auth/use-auth';\nimport {downloadFileFromUrl} from '@common/uploads/utils/download-file-from-url';\n\nexport interface TrackContextDialogProps {\n tracks: Track[];\n children?: (tracks: Track[]) => ReactNode;\n showAddToQueueButton?: boolean;\n}\nexport function TrackContextDialog({\n children,\n tracks,\n showAddToQueueButton = true,\n}: TrackContextDialogProps) {\n const isMobile = useIsMobileMediaQuery();\n const firstTrack = tracks[0];\n const {canEdit, canDelete} = useTrackPermissions(tracks);\n const shouldShowRadio = useShouldShowRadioButton();\n const {player} = useSettings();\n const {close} = useDialogContext();\n\n const loadTracks = useCallback(() => {\n return Promise.resolve(tracks);\n }, [tracks]);\n\n const headerProps: Partial =\n tracks.length === 1\n ? {\n image: ,\n title: ,\n description: ,\n }\n : {};\n\n return (\n \n {showAddToQueueButton && (\n \n )}\n \n {children?.(tracks)}\n \n {tracks.length === 1 ? (\n \n {shouldShowRadio && (\n \n \n \n )}\n {isMobile && (\n \n {firstTrack.artists?.[0] && (\n \n \n \n )}\n {firstTrack.album && (\n \n \n \n )}\n \n \n \n \n )}\n {!player?.hide_lyrics && tracks.length === 1 && (\n {\n close();\n openDialog(LyricsDialog, {track: firstTrack});\n }}\n >\n \n \n )}\n {!isMobile && (\n \n \n \n )}\n {tracks.length === 1 && }\n {tracks.length === 1 && }\n {tracks.length === 1 ? (\n \n ) : null}\n {tracks.length === 1 && canEdit && (\n \n \n \n )}\n {tracks.length === 1 && canEdit && (\n \n \n \n )}\n \n ) : null}\n {canDelete && !isMobile && }\n \n );\n}\n\ninterface DownloadTrackButtonProps {\n track: Track;\n}\nfunction DownloadTrackButton({track}: DownloadTrackButtonProps) {\n const {player, base_url} = useSettings();\n const {close: closeMenu} = useDialogContext();\n const {hasPermission} = useAuth();\n\n if (\n !player?.enable_download ||\n !track ||\n !trackIsLocallyUploaded(track) ||\n !hasPermission('music.download')\n ) {\n return null;\n }\n\n return (\n {\n closeMenu();\n downloadFileFromUrl(`${base_url}/api/v1/tracks/${track.id}/download`);\n }}\n >\n \n \n );\n}\n\nfunction DeleteButton({tracks}: TrackContextDialogProps) {\n const {close: closeMenu} = useDialogContext();\n const {canDelete} = useTrackPermissions(tracks);\n\n if (!canDelete) {\n return null;\n }\n\n return (\n {\n closeMenu();\n openDialog(DeleteTrackDialog, {\n tracks,\n });\n }}\n >\n \n \n );\n}\n\ninterface DeleteTrackDialogProps {\n tracks: Track[];\n}\nfunction DeleteTrackDialog({tracks}: DeleteTrackDialogProps) {\n const deleteTracks = useDeleteTracks();\n const {close} = useDialogContext();\n return (\n }\n body={\n \n }\n isLoading={deleteTracks.isPending}\n confirm={}\n onConfirm={() => {\n deleteTracks.mutate(\n {trackIds: tracks.map(t => t.id)},\n {\n onSuccess: () => close(),\n },\n );\n }}\n />\n );\n}\n","import {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {PlayableGridItem} from '@app/web-player/playable-item/playable-grid-item';\nimport {Track} from '@app/web-player/tracks/track';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {getTrackLink, TrackLink} from '@app/web-player/tracks/track-link';\nimport {TrackContextDialog} from '@app/web-player/tracks/context-dialog/track-context-dialog';\nimport {LikeIconButton} from '@app/web-player/library/like-icon-button';\n\ninterface TrackGridItemProps {\n track: Track;\n newQueue?: Track[];\n}\nexport function TrackGridItem({track, newQueue}: TrackGridItemProps) {\n return (\n }\n title={}\n subtitle={}\n link={getTrackLink(track)}\n likeButton={}\n model={track}\n newQueue={newQueue}\n contextDialog={}\n />\n );\n}\n","import {Playlist} from '@app/web-player/playlists/playlist';\nimport {useAuth} from '@common/auth/use-auth';\n\nexport function usePlaylistPermissions(playlist: Playlist) {\n const {user} = useAuth();\n const isCreator: boolean = !!(user?.id && user.id === playlist.owner_id);\n return {canEdit: isCreator, canDelete: isCreator, isCreator};\n}\n","import {useAuthUserPlaylists} from '@app/web-player/playlists/requests/use-auth-user-playlists';\nimport {useAuth} from '@common/auth/use-auth';\n\nexport function useIsFollowingPlaylist(playlistId: number): boolean {\n const {data} = useAuthUserPlaylists();\n const {user} = useAuth();\n // if user is playlist creator, then he is not following it\n const playlist = data.playlists.find(p => p.id === +playlistId);\n if (playlist && user && user.id !== playlist.owner_id) {\n return true;\n }\n return false;\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {useLocation} from 'react-router-dom';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {useAuth} from '@common/auth/use-auth';\n\ninterface Response extends BackendResponse {}\n\nexport function useDeletePlaylist(playlistId: number | string) {\n const {pathname} = useLocation();\n const navigate = useNavigate();\n const {getRedirectUri} = useAuth();\n\n return useMutation({\n mutationFn: () => deletePlaylist(playlistId),\n onSuccess: () => {\n toast(message('Playlist deleted'));\n queryClient.invalidateQueries({queryKey: ['playlists']});\n // navigate to homepage if we are on this playlist page currently\n if (pathname.startsWith(`/playlist/${playlistId}`)) {\n navigate(getRedirectUri());\n }\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction deletePlaylist(playlistId: number | string): Promise {\n return apiClient.delete(`playlists/${playlistId}`).then(r => r.data);\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\n\ninterface Response extends BackendResponse {\n playlist: Playlist;\n}\n\nexport function useFollowPlaylist(playlist: Playlist) {\n return useMutation({\n mutationFn: () => followPlaylist(playlist.id),\n onSuccess: () => {\n toast(message('Following :name', {values: {name: playlist.name}}));\n queryClient.invalidateQueries({queryKey: ['playlists']});\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction followPlaylist(playlistId: number | string): Promise {\n return apiClient.post(`playlists/${playlistId}/follow`).then(r => r.data);\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\n\ninterface Response extends BackendResponse {\n playlist: Playlist;\n}\n\nexport function useUnfollowPlaylist(playlist: Playlist) {\n return useMutation({\n mutationFn: () => unfollowPlaylist(playlist.id),\n onSuccess: () => {\n toast(\n message('Stopped following :name', {values: {name: playlist.name}}),\n );\n queryClient.invalidateQueries({queryKey: ['playlists']});\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction unfollowPlaylist(playlistId: number | string): Promise {\n return apiClient.post(`playlists/${playlistId}/unfollow`).then(r => r.data);\n}\n","import {Trans} from '@common/i18n/trans';\nimport {loadMediaItemTracks} from '@app/web-player/requests/load-media-item-tracks';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {Track} from '@app/web-player/tracks/track';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {\n ContextDialogLayout,\n ContextMenuButton,\n} from '@app/web-player/context-dialog/context-dialog-layout';\nimport useCopyClipboard from 'react-use-clipboard';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {\n getPlaylistLink,\n PlaylistLink,\n} from '@app/web-player/playlists/playlist-link';\nimport {usePlaylistPermissions} from '@app/web-player/playlists/hooks/use-playlist-permissions';\nimport {PlaylistImage} from '@app/web-player/playlists/playlist-image';\nimport React, {Fragment, useCallback} from 'react';\nimport {useIsFollowingPlaylist} from '@app/web-player/playlists/hooks/use-is-following-playlist';\nimport {openDialog} from '@common/ui/overlays/store/dialog-store';\nimport {UpdatePlaylistDialog} from '@app/web-player/playlists/crupdate-dialog/update-playlist-dialog';\nimport {useUpdatePlaylist} from '@app/web-player/playlists/requests/use-update-playlist';\nimport {CheckIcon} from '@common/icons/material/Check';\nimport {ConfirmationDialog} from '@common/ui/overlays/dialog/confirmation-dialog';\nimport {useDeletePlaylist} from '@app/web-player/playlists/requests/use-delete-playlist';\nimport {useFollowPlaylist} from '@app/web-player/playlists/requests/use-follow-playlist';\nimport {useUnfollowPlaylist} from '@app/web-player/playlists/requests/use-unfollow-playlist';\nimport {AddToQueueButton} from '@app/web-player/context-dialog/add-to-queue-menu-button';\nimport {PlaylistOwnerName} from '@app/web-player/playlists/playlist-grid-item';\nimport {ShareMediaButton} from '@app/web-player/context-dialog/share-media-button';\n\ninterface PlaylistContextDialogProps {\n playlist: Playlist;\n}\nexport function PlaylistContextDialog({playlist}: PlaylistContextDialogProps) {\n const {close: closeMenu} = useDialogContext();\n const [, copyAlbumLink] = useCopyClipboard(\n getPlaylistLink(playlist, {absolute: true}),\n );\n const {canEdit} = usePlaylistPermissions(playlist);\n\n const loadTracks = useCallback(() => {\n return loadPlaylistTracks(playlist);\n }, [playlist]);\n\n return (\n }\n title={}\n description={}\n loadTracks={loadTracks}\n >\n \n \n \n \n {\n copyAlbumLink();\n closeMenu();\n toast(message('Copied link to clipboard'));\n }}\n >\n \n \n {playlist.public && }\n {canEdit && (\n {\n closeMenu();\n openDialog(UpdatePlaylistDialog, {playlist});\n }}\n >\n \n \n )}\n \n \n );\n}\n\ninterface FollowButtonsProps {\n playlist: Playlist;\n}\nfunction FollowButtons({playlist}: FollowButtonsProps) {\n const isFollowing = useIsFollowingPlaylist(playlist.id);\n const {close: closeMenu} = useDialogContext();\n const followPlaylist = useFollowPlaylist(playlist);\n const unFollowPlaylist = useUnfollowPlaylist(playlist);\n const {isCreator} = usePlaylistPermissions(playlist);\n\n // if user has created this playlist, bail\n if (isCreator) {\n return null;\n }\n\n return (\n \n {!isFollowing ? (\n {\n closeMenu();\n followPlaylist.mutate();\n }}\n >\n \n \n ) : (\n {\n closeMenu();\n unFollowPlaylist.mutate();\n }}\n >\n \n \n )}\n \n );\n}\n\nfunction TogglePublicButton({playlist}: FollowButtonsProps) {\n const {close: closeMenu} = useDialogContext();\n const updatePlaylist = useUpdatePlaylist({playlistId: playlist.id});\n const {isCreator} = usePlaylistPermissions(playlist);\n\n if (!isCreator) {\n return null;\n }\n\n const togglePublic = () => {\n closeMenu();\n updatePlaylist.mutate({public: !playlist.public});\n };\n\n return (\n togglePublic()}\n >\n {playlist.public ? (\n \n ) : (\n \n )}\n \n );\n}\n\nfunction ToggleCollaborativeButton({playlist}: FollowButtonsProps) {\n const {close: closeMenu} = useDialogContext();\n const updatePlaylist = useUpdatePlaylist({playlistId: playlist.id});\n const {isCreator} = usePlaylistPermissions(playlist);\n\n if (!isCreator) {\n return null;\n }\n\n const toggleCollaborative = () => {\n closeMenu();\n updatePlaylist.mutate({collaborative: !playlist.collaborative});\n };\n\n return (\n : undefined}\n onClick={() => toggleCollaborative()}\n >\n \n \n );\n}\n\nfunction DeleteButton({playlist}: FollowButtonsProps) {\n const {close: closeMenu} = useDialogContext();\n const deletePlaylist = useDeletePlaylist(playlist.id);\n const {canDelete} = usePlaylistPermissions(playlist);\n\n if (!canDelete) {\n return null;\n }\n\n return (\n {\n closeMenu();\n openDialog(ConfirmationDialog, {\n isDanger: true,\n title: ,\n body: (\n \n ),\n confirm: ,\n onConfirm: () => {\n deletePlaylist.mutate();\n },\n });\n }}\n >\n \n \n );\n}\n\nasync function loadPlaylistTracks(playlist: Playlist): Promise {\n // load playlist tracks if not loaded already\n if (typeof playlist.tracks === 'undefined') {\n const tracks = await loadMediaItemTracks(queueGroupId(playlist));\n if (!tracks.length) {\n toast(message('This playlist has no tracks yet.'));\n }\n return tracks;\n }\n return playlist.tracks;\n}\n","import {FavoriteIcon} from '@common/icons/material/Favorite';\nimport {FavoriteBorderIcon} from '@common/icons/material/FavoriteBorder';\nimport {Button} from '@common/ui/buttons/button';\nimport {Trans} from '@common/i18n/trans';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {useFollowPlaylist} from '@app/web-player/playlists/requests/use-follow-playlist';\nimport {useUnfollowPlaylist} from '@app/web-player/playlists/requests/use-unfollow-playlist';\nimport {useIsFollowingPlaylist} from '@app/web-player/playlists/hooks/use-is-following-playlist';\nimport {usePlaylistPermissions} from '@app/web-player/playlists/hooks/use-playlist-permissions';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {ButtonSize} from '@common/ui/buttons/button-size';\n\ninterface FollowPlaylistButtonProps {\n buttonType: 'icon' | 'text';\n className?: string;\n size?: ButtonSize;\n playlist: Playlist;\n radius?: string;\n}\nexport function FollowPlaylistButton({\n playlist,\n size = 'sm',\n className,\n buttonType = 'text',\n radius,\n}: FollowPlaylistButtonProps) {\n const {isCreator} = usePlaylistPermissions(playlist);\n const follow = useFollowPlaylist(playlist);\n const unfollow = useUnfollowPlaylist(playlist);\n const isFollowing = useIsFollowingPlaylist(playlist.id);\n const isLoading = follow.isPending || unfollow.isPending;\n\n if (isCreator) {\n return null;\n }\n\n if (buttonType === 'icon') {\n if (isFollowing) {\n return (\n unfollow.mutate()}\n >\n \n \n );\n }\n return (\n follow.mutate()}\n >\n \n \n );\n }\n\n if (isFollowing) {\n return (\n }\n disabled={isLoading}\n className={className}\n onClick={() => unfollow.mutate()}\n >\n \n \n );\n }\n return (\n }\n disabled={isLoading}\n className={className}\n onClick={() => follow.mutate()}\n >\n \n \n );\n}\n","import {PlayableGridItem} from '@app/web-player/playable-item/playable-grid-item';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {PlaylistImage} from '@app/web-player/playlists/playlist-image';\nimport {\n getPlaylistLink,\n PlaylistLink,\n} from '@app/web-player/playlists/playlist-link';\nimport {PlaylistContextDialog} from '@app/web-player/playlists/playlist-context-dialog';\nimport {Trans} from '@common/i18n/trans';\nimport {UserProfileLink} from '@app/web-player/users/user-profile-link';\nimport React from 'react';\nimport {FollowPlaylistButton} from '@app/web-player/playlists/playlist-page/follow-playlist-button';\n\ninterface PlaylistGridItemProps {\n playlist: Playlist;\n}\nexport function PlaylistGridItem({playlist}: PlaylistGridItemProps) {\n return (\n }\n title={}\n subtitle={}\n link={getPlaylistLink(playlist)}\n likeButton={\n \n }\n model={playlist}\n contextDialog={}\n />\n );\n}\n\nexport function PlaylistOwnerName({playlist}: PlaylistGridItemProps) {\n const owner = playlist.owner || playlist.editors?.[0];\n if (!owner) {\n return null;\n }\n return (\n ,\n }}\n />\n );\n}\n","export default \"__VITE_ASSET__6d84205f__\"","import {useTrans} from '@common/i18n/use-trans';\nimport {message} from '@common/i18n/message';\nimport {User} from '@common/auth/user';\nimport clsx from 'clsx';\nimport {Trans} from '@common/i18n/trans';\nimport {StarIcon} from '@common/icons/material/Star';\nimport userDefaultImage from './user-default.svg';\n\ninterface UserImageProps {\n user: User;\n className?: string;\n size?: string;\n showProBadge?: boolean;\n}\nexport function UserImage({\n user,\n className,\n size,\n showProBadge,\n}: UserImageProps) {\n const {trans} = useTrans();\n const showBadge = showProBadge && user.subscriptions?.find(s => s.valid);\n return (\n \n \n {showBadge && (\n \n
    \n \n
    \n \n \n )}\n \n );\n}\n\nexport function getUserImage(user: User): string {\n return user.avatar || userDefaultImage;\n}\n","import {Link} from 'react-router-dom';\nimport {getUserProfileLink} from '@app/web-player/users/user-profile-link';\nimport {UserImage} from '@app/web-player/users/user-image';\nimport {User} from '@common/auth/user';\nimport {Trans} from '@common/i18n/trans';\n\ninterface UserGridItemProps {\n user: User;\n}\nexport function UserGridItem({user}: UserGridItemProps) {\n return (\n
    \n \n \n \n
    \n
    \n {user.display_name}\n
    \n {user.followers_count ? (\n
    \n \n
    \n ) : null}\n
    \n
    \n );\n}\n","import {ARTIST_MODEL} from '@app/web-player/artists/artist';\nimport {ArtistGridItem} from '@app/web-player/artists/artist-grid-item';\nimport {ALBUM_MODEL} from '@app/web-player/albums/album';\nimport {AlbumGridItem} from '@app/web-player/albums/album-grid-item';\nimport {GENRE_MODEL} from '@app/web-player/genres/genre';\nimport {GenreGridItem} from '@app/web-player/genres/genre-grid-item';\nimport React from 'react';\nimport {Track, TRACK_MODEL} from '@app/web-player/tracks/track';\nimport {TrackGridItem} from '@app/web-player/tracks/track-grid-item';\nimport {PLAYLIST_MODEL} from '@app/web-player/playlists/playlist';\nimport {PlaylistGridItem} from '@app/web-player/playlists/playlist-grid-item';\nimport {USER_MODEL} from '@common/auth/user';\nimport {UserGridItem} from '@app/web-player/users/user-grid-item';\nimport {ChannelContentModel} from '@app/admin/channels/channel-content-config';\n\ninterface Props {\n item: ChannelContentModel;\n items?: ChannelContentModel[];\n}\nexport function ChannelContentGridItem({item, items}: Props) {\n switch (item.model_type) {\n case ARTIST_MODEL:\n return ;\n case ALBUM_MODEL:\n return ;\n case GENRE_MODEL:\n return ;\n case TRACK_MODEL:\n return ;\n case PLAYLIST_MODEL:\n return ;\n case USER_MODEL:\n return ;\n default:\n return null;\n }\n}\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const AntennaIcon = createSvgIcon(\n ,\n 'Radio'\n);\n","import React from 'react';\nimport {Link, useParams} from 'react-router-dom';\nimport {KeyboardArrowRightIcon} from '@common/icons/material/KeyboardArrowRight';\nimport clsx from 'clsx';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\nimport {Trans} from '@common/i18n/trans';\nimport {AntennaIcon} from '@app/web-player/channels/antenna-icon';\nimport {useShouldShowRadioButton} from '@app/web-player/tracks/context-dialog/use-should-show-radio-button';\nimport {getRadioLink} from '@app/web-player/radio/get-radio-link';\nimport {Channel} from '@common/channels/channel';\n\ninterface ChannelHeadingProps {\n channel: Channel;\n margin?: string;\n isNested?: boolean;\n}\nexport function ChannelHeading({\n channel,\n isNested,\n margin = isNested ? 'mb-16 md:mb-20' : 'mb-20 md:mb-40',\n}: ChannelHeadingProps) {\n const shouldShowRadio = useShouldShowRadioButton();\n if (channel.config.hideTitle) {\n return null;\n }\n if (!isNested) {\n if (shouldShowRadio && channel.restriction?.model_type === 'genre') {\n return (\n \n

    \n \n

    \n }>\n \n \n \n \n \n );\n }\n return (\n

    \n \n

    \n );\n }\n\n return (\n
    \n \n \n
    \n );\n}\n\ninterface ChannelLinkProps {\n channel: Channel;\n}\nfunction NestedChannelLink({channel}: ChannelLinkProps) {\n const {restriction: genreName} = useParams();\n return (\n \n \n \n );\n}\n","import {\n hashKey,\n InfiniteData,\n keepPreviousData,\n useInfiniteQuery,\n UseInfiniteQueryResult,\n} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {\n hasNextPage,\n PaginationResponse,\n} from '@common/http/backend-response/pagination-response';\nimport {useMemo, useRef, useState} from 'react';\nimport {SortDescriptor} from '@common/ui/tables/types/sort-descriptor';\nimport {GetDatatableDataParams} from '@common/datatable/requests/paginated-resources';\nimport {QueryKey} from '@tanstack/query-core/src/types';\n\nexport type UseInfiniteDataResult<\n T,\n E extends object = object,\n> = UseInfiniteQueryResult & E>> & {\n items: T[];\n totalItems: number | null;\n // initial load is done and no results were returned from backend\n noResults: boolean;\n // true when changing filters or sorting, not on initial load, background fetch or infinite load\n isReloading: boolean;\n sortDescriptor: SortDescriptor;\n setSortDescriptor: (sortDescriptor: SortDescriptor) => void;\n searchQuery: string;\n setSearchQuery: (searchQuery: string) => void;\n};\n\nfunction buildQueryKey(\n {\n queryKey,\n defaultOrderDir,\n defaultOrderBy,\n queryParams,\n }: UseInfiniteDataProps,\n sortDescriptor: SortDescriptor,\n searchQuery: string = '',\n) {\n // make sure to always set default order dir and col so query keys are consistent\n if (!sortDescriptor.orderBy) {\n sortDescriptor.orderBy = defaultOrderBy;\n }\n if (!sortDescriptor.orderDir) {\n sortDescriptor.orderDir = defaultOrderDir;\n }\n return [...queryKey, sortDescriptor, searchQuery, queryParams];\n}\n\ninterface Response extends BackendResponse {\n pagination: PaginationResponse;\n}\n\nexport interface UseInfiniteDataProps {\n initialPage?: PaginationResponse | null;\n queryKey: QueryKey;\n queryParams?: Record;\n endpoint: string;\n defaultOrderBy?: SortDescriptor['orderBy'];\n defaultOrderDir?: SortDescriptor['orderDir'];\n // whether user can sort items manually (table header, dropdown, etc)\n willSortOrFilter?: boolean;\n // ordering is not available with cursor pagination\n paginate?: 'simple' | 'lengthAware' | 'cursor';\n transformResponse?: (response: Response) => Response;\n}\nexport function useInfiniteData(\n props: UseInfiniteDataProps,\n): UseInfiniteDataResult {\n const {\n initialPage,\n endpoint,\n defaultOrderBy,\n defaultOrderDir,\n queryParams,\n paginate,\n transformResponse,\n willSortOrFilter = false,\n } = props;\n const [searchQuery, setSearchQuery] = useState('');\n const [sortDescriptor, setSortDescriptor] = useState({\n orderBy: defaultOrderBy,\n orderDir: defaultOrderDir,\n });\n\n const queryKey = buildQueryKey(props, sortDescriptor, searchQuery);\n const initialQueryKey = useRef(hashKey(queryKey)).current;\n\n const query = useInfiniteQuery({\n placeholderData: willSortOrFilter ? keepPreviousData : undefined,\n queryKey,\n queryFn: ({pageParam, signal}) => {\n const params: GetDatatableDataParams = {\n ...queryParams,\n perPage: initialPage?.per_page || queryParams?.perPage,\n query: searchQuery,\n paginate,\n ...sortDescriptor,\n };\n if (paginate === 'cursor') {\n params.cursor = pageParam;\n } else {\n params.page = pageParam || 1;\n }\n return fetchData(endpoint, params, transformResponse, signal);\n },\n initialPageParam: paginate === 'cursor' ? '' : 1,\n getNextPageParam: lastResponse => {\n if (!hasNextPage(lastResponse.pagination)) {\n return null;\n }\n if ('next_cursor' in lastResponse.pagination) {\n return lastResponse.pagination.next_cursor;\n }\n return lastResponse.pagination.current_page + 1;\n },\n initialData: () => {\n // initial data will be for initial query key only, remove\n // initial data if query key changes, so query is reset\n if (!initialPage || hashKey(queryKey) !== initialQueryKey) {\n return undefined;\n }\n\n return {\n pageParams: [undefined, 1],\n pages: [{pagination: initialPage}],\n };\n },\n });\n\n const items = useMemo(() => {\n return query.data?.pages.flatMap(p => p.pagination.data) || [];\n }, [query.data?.pages]);\n\n const firstPage = query.data?.pages[0].pagination;\n const totalItems =\n firstPage && 'total' in firstPage && firstPage.total\n ? firstPage.total\n : null;\n\n return {\n ...query,\n items,\n totalItems,\n noResults: query.data?.pages?.[0].pagination.data.length === 0,\n // can't use \"isRefetching\", it's true for some reason when changing sorting or filters\n isReloading:\n query.isFetching && !query.isFetchingNextPage && query.isPlaceholderData,\n sortDescriptor,\n setSortDescriptor,\n searchQuery,\n setSearchQuery,\n } as UseInfiniteDataResult;\n}\n\nasync function fetchData(\n endpoint: string,\n params: GetDatatableDataParams,\n transformResponse?: UseInfiniteDataProps['transformResponse'],\n signal?: AbortSignal,\n): Promise> {\n if (params.query) {\n await new Promise(resolve => setTimeout(resolve, 300));\n }\n return apiClient\n .get(endpoint, {params, signal: params.query ? signal : undefined})\n .then(r => {\n if (transformResponse) {\n return transformResponse(r.data);\n }\n return r.data;\n });\n}\n","import {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {Channel, ChannelContentItem} from '@common/channels/channel';\nimport {\n channelEndpoint,\n channelQueryKey,\n} from '@common/channels/requests/use-channel';\nimport {useChannelQueryParams} from '@common/channels/use-channel-query-params';\n\nexport function usePaginatedChannelContent<\n T extends ChannelContentItem = ChannelContentItem\n>(channel: Channel) {\n const queryParams = useChannelQueryParams(channel);\n return useInfiniteData({\n willSortOrFilter: true,\n initialPage: channel.content,\n queryKey: channelQueryKey(channel.id),\n endpoint: channelEndpoint(channel.id),\n paginate: 'simple',\n queryParams: {\n returnContentOnly: 'true',\n ...queryParams,\n },\n });\n}\n","import {hashKey, keepPreviousData, useQuery} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {Channel, ChannelContentItem} from '@common/channels/channel';\nimport {\n channelEndpoint,\n channelQueryKey,\n} from '@common/channels/requests/use-channel';\nimport {PaginatedBackendResponse} from '@common/http/backend-response/pagination-response';\nimport {useRef} from 'react';\nimport {useChannelQueryParams} from '@common/channels/use-channel-query-params';\n\ninterface Response\n extends PaginatedBackendResponse {}\n\nexport function useChannelContent<\n T extends ChannelContentItem = ChannelContentItem,\n>(channel: Channel) {\n const queryParams = useChannelQueryParams(channel);\n const queryKey = channelQueryKey(channel.id, queryParams);\n const initialQueryKey = useRef(hashKey(queryKey)).current;\n\n return useQuery({\n queryKey: channelQueryKey(channel.id, queryParams),\n queryFn: () => fetchChannelContent(channel.id, queryParams),\n placeholderData: keepPreviousData,\n initialData: () => {\n if (hashKey(queryKey) === initialQueryKey) {\n return channel.content?.data;\n }\n return undefined;\n },\n });\n}\n\nfunction fetchChannelContent(\n slugOrId: number | string,\n params: any,\n) {\n return apiClient\n .get>(channelEndpoint(slugOrId), {\n params: {\n ...params,\n paginate: 'simple',\n returnContentOnly: 'true',\n },\n })\n .then(response => response.data.pagination.data);\n}\n","import {ContentGrid} from '@app/web-player/playable-item/content-grid';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport React, {Fragment} from 'react';\nimport {ChannelContentProps} from '@app/web-player/channels/channel-content';\nimport {ChannelContentGridItem} from '@app/web-player/channels/channel-content-grid-item';\nimport {ChannelHeading} from '@app/web-player/channels/channel-heading';\nimport {usePaginatedChannelContent} from '@common/channels/requests/use-paginated-channel-content';\nimport {useChannelContent} from '@common/channels/requests/use-channel-content';\nimport {ChannelContentModel} from '@app/admin/channels/channel-content-config';\n\nexport function ChannelContentGrid(props: ChannelContentProps) {\n return (\n \n \n {props.isNested ? (\n \n ) : (\n \n )}\n \n );\n}\n\nfunction SimpleGrid({channel}: ChannelContentProps) {\n const {data} = useChannelContent(channel);\n return (\n \n {data?.map(item => (\n \n ))}\n \n );\n}\n\nfunction PaginatedGrid({channel}: ChannelContentProps) {\n const query = usePaginatedChannelContent(channel);\n return (\n
    \n \n {query.items.map(item => (\n \n ))}\n \n \n
    \n );\n}\n","import {useContext} from 'react';\nimport {TableContext} from '@common/ui/tables/table-context';\n\nexport interface TrackTableMeta {\n queueGroupId?: string | number;\n hideTrackImage?: boolean;\n}\n\nconst stableObj = {};\n\nexport function useTrackTableMeta() {\n const {meta} = useContext(TableContext);\n return (meta || stableObj) as TrackTableMeta;\n}\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\n\nexport function useIsTrackCued(\n trackId: number,\n groupId?: string | number\n): boolean {\n return usePlayerStore(s => {\n if (!s.cuedMedia?.meta.id || s.cuedMedia.meta.id !== trackId) {\n return false;\n }\n\n if (!s.cuedMedia?.groupId && !groupId) {\n return true;\n }\n\n if (groupId && s.cuedMedia.groupId === groupId) {\n return true;\n }\n\n return false;\n });\n}\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {useIsTrackCued} from '@app/web-player/tracks/hooks/use-is-track-cued';\n\nexport function useIsTrackPlaying(\n trackId: number,\n groupId?: string | number\n): boolean {\n const isCued = useIsTrackCued(trackId, groupId);\n const isPlaying = usePlayerStore(s => s.isPlaying);\n return isCued && isPlaying;\n}\n","import {Track} from '@app/web-player/tracks/track';\nimport {useTrans} from '@common/i18n/use-trans';\nimport React, {useContext, useState} from 'react';\nimport {TableContext} from '@common/ui/tables/table-context';\nimport {trackToMediaItem} from '@app/web-player/tracks/utils/track-to-media-item';\nimport {message} from '@common/i18n/message';\nimport {PauseIcon} from '@common/icons/material/Pause';\nimport {PlayArrowFilledIcon} from '@app/web-player/tracks/play-arrow-filled';\nimport clsx from 'clsx';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {useTrackTableMeta} from '@app/web-player/tracks/track-table/use-track-table-meta';\nimport {EqualizerImage} from '@app/web-player/tracks/equalizer-image/equalizer-image';\nimport {useIsTrackPlaying} from '@app/web-player/tracks/hooks/use-is-track-playing';\nimport {useIsTrackCued} from '@app/web-player/tracks/hooks/use-is-track-cued';\n\ninterface TogglePlaybackColumnProps {\n track: Track;\n rowIndex: number;\n isHovered: boolean;\n}\nexport function TogglePlaybackColumn({\n track,\n rowIndex,\n isHovered,\n}: TogglePlaybackColumnProps) {\n const {queueGroupId} = useTrackTableMeta();\n const isPlaying = useIsTrackPlaying(track.id, queueGroupId);\n const isCued = useIsTrackCued(track.id, queueGroupId);\n\n return (\n
    \n {isHovered || isPlaying ? (\n \n ) : (\n \n {rowIndex + 1}\n \n )}\n
    \n );\n}\n\ninterface TogglePlaybackButtonProps {\n track: Track;\n trackIndex: number;\n isPlaying: boolean;\n}\nfunction TogglePlaybackButton({\n track,\n trackIndex,\n isPlaying,\n}: TogglePlaybackButtonProps) {\n const {trans} = useTrans();\n const player = usePlayerActions();\n const {data} = useContext(TableContext);\n const {queueGroupId} = useTrackTableMeta();\n const [isHover, setHover] = useState(false);\n\n if (isPlaying) {\n return (\n setHover(true)}\n onPointerLeave={() => setHover(false)}\n aria-label={trans(message('Pause :name', {values: {name: track.name}}))}\n tabIndex={0}\n onClick={e => {\n e.stopPropagation();\n player.pause();\n }}\n >\n {isHover ? : }\n \n );\n }\n\n return (\n {\n e.stopPropagation();\n const newQueue = data.map(d =>\n trackToMediaItem(d as Track, queueGroupId)\n );\n player.overrideQueueAndPlay(newQueue, trackIndex);\n }}\n >\n \n \n );\n}\n","import {NameWithAvatar} from '@common/datatable/column-templates/name-with-avatar';\nimport React from 'react';\nimport {Track} from '@app/web-player/tracks/track';\nimport clsx from 'clsx';\nimport {useTrackTableMeta} from '@app/web-player/tracks/track-table/use-track-table-meta';\nimport {getTrackImageSrc} from '@app/web-player/tracks/track-image/track-image';\nimport {useIsTrackCued} from '@app/web-player/tracks/hooks/use-is-track-cued';\n\ninterface TrackNameColumnProps {\n track: Track;\n}\nexport function TrackNameColumn({track}: TrackNameColumnProps) {\n const {hideTrackImage, queueGroupId} = useTrackTableMeta();\n const isCued = useIsTrackCued(track.id, queueGroupId);\n\n return (\n \n {track.artists?.map(a => a.name).join(', ')}\n \n }\n labelClassName={clsx(\n isCued && 'text-primary',\n 'max-md:text-[15px] max-md:leading-6',\n )}\n />\n );\n}\n","import {Track} from '@app/web-player/tracks/track';\nimport {useContext, useMemo} from 'react';\nimport {TableContext} from '@common/ui/tables/table-context';\nimport {\n TrackContextDialog,\n TrackContextDialogProps,\n} from '@app/web-player/tracks/context-dialog/track-context-dialog';\n\ninterface TableTrackContextDialogProps\n extends Omit {}\nexport function TableTrackContextDialog({\n children,\n ...props\n}: TableTrackContextDialogProps) {\n const {selectedRows, data} = useContext(TableContext);\n const tracks = useMemo(() => {\n return selectedRows\n .map(trackId => data.find(track => track.id === trackId))\n .filter(t => !!t) as Track[];\n }, [selectedRows, data]);\n return (\n \n {children}\n \n );\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {Track} from '@app/web-player/tracks/track';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\n\ninterface Response extends BackendResponse {\n playlist: Playlist;\n}\n\ninterface Payload {\n playlistId: number;\n tracks: Track[];\n}\n\nexport function useRemoveTracksFromPlaylist() {\n return useMutation({\n mutationFn: (payload: Payload) => removeTracks(payload),\n onSuccess: (response, {tracks}) => {\n toast(\n message('Removed [one 1 track|other :count tracks] from playlist', {\n values: {count: tracks.length},\n }),\n );\n queryClient.invalidateQueries({\n queryKey: ['playlists', response.playlist.id],\n });\n queryClient.invalidateQueries({\n queryKey: ['tracks', 'playlist', response.playlist.id],\n });\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction removeTracks(payload: Payload): Promise {\n const backendPayload = {\n ids: payload.tracks.map(track => track.id),\n };\n return apiClient\n .post(`playlists/${payload.playlistId}/tracks/remove`, backendPayload)\n .then(r => r.data);\n}\n","import {Playlist} from '@app/web-player/playlists/playlist';\nimport {Trans} from '@common/i18n/trans';\nimport {ContextMenuButton} from '@app/web-player/context-dialog/context-dialog-layout';\nimport {useRemoveTracksFromPlaylist} from '@app/web-player/playlists/requests/use-remove-tracks-from-playlist';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {TableTrackContextDialog} from '@app/web-player/tracks/context-dialog/table-track-context-dialog';\nimport {useAuth} from '@common/auth/use-auth';\nimport {Track} from '@app/web-player/tracks/track';\n\ninterface PlaylistTrackContextDialogProps {\n playlist: Playlist;\n}\nexport function PlaylistTrackContextDialog({\n playlist,\n ...props\n}: PlaylistTrackContextDialogProps) {\n return (\n \n {tracks => (\n \n )}\n \n );\n}\n\ninterface RemoveFromPlaylistMenuItemProps {\n playlist: Playlist;\n tracks: Track[];\n}\nexport function RemoveFromPlaylistMenuItem({\n playlist,\n tracks,\n}: RemoveFromPlaylistMenuItemProps) {\n const {user} = useAuth();\n const removeTracks = useRemoveTracksFromPlaylist();\n const {close: closeMenu} = useDialogContext();\n const canRemove = playlist.owner_id === user?.id || playlist.collaborative;\n\n if (!canRemove) {\n return null;\n }\n\n return (\n {\n if (!removeTracks.isPending) {\n removeTracks.mutate({playlistId: playlist.id, tracks});\n closeMenu();\n }\n }}\n >\n \n \n );\n}\n","import React, {Fragment, useContext} from 'react';\nimport {Track} from '@app/web-player/tracks/track';\nimport clsx from 'clsx';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {MoreHorizIcon} from '@common/icons/material/MoreHoriz';\nimport {TrackContextDialog} from '@app/web-player/tracks/context-dialog/track-context-dialog';\nimport {LikeIconButton} from '@app/web-player/library/like-icon-button';\nimport {MoreVertIcon} from '@common/icons/material/MoreVert';\nimport {TableContext} from '@common/ui/tables/table-context';\nimport {RemoveFromPlaylistMenuItem} from '@app/web-player/playlists/playlist-page/playlist-track-context-dialog';\n\ninterface Props {\n track: Track;\n isHovered: boolean;\n}\nexport function TrackOptionsColumn({track, isHovered}: Props) {\n const isMobile = useIsMobileMediaQuery();\n const {meta} = useContext(TableContext);\n return (\n \n \n \n {isMobile ? : }\n \n \n {tracks =>\n meta.playlist ? (\n \n ) : null\n }\n \n \n {!isMobile && }\n \n );\n}\n","import {Track} from '@app/web-player/tracks/track';\nimport {Table, TableProps} from '@common/ui/tables/table';\nimport {ColumnConfig} from '@common/datatable/column-config';\nimport {Trans} from '@common/i18n/trans';\nimport React, {useMemo} from 'react';\nimport {AlbumLink} from '@app/web-player/albums/album-link';\nimport {ScheduleIcon} from '@common/icons/material/Schedule';\nimport {FormattedDuration} from '@common/i18n/formatted-duration';\nimport {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {TogglePlaybackColumn} from '@app/web-player/tracks/track-table/toggle-playback-column';\nimport {TrackNameColumn} from '@app/web-player/tracks/track-table/track-name-column';\nimport {TrackTableMeta} from '@app/web-player/tracks/track-table/use-track-table-meta';\nimport {Skeleton} from '@common/ui/skeleton/skeleton';\nimport {NameWithAvatarPlaceholder} from '@common/datatable/column-templates/name-with-avatar';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {RowElementProps} from '@common/ui/tables/table-row';\nimport {TableTrackContextDialog} from '@app/web-player/tracks/context-dialog/table-track-context-dialog';\nimport {TrendingUpIcon} from '@common/icons/material/TrendingUp';\nimport {FormattedRelativeTime} from '@common/i18n/formatted-relative-time';\nimport {trackToMediaItem} from '@app/web-player/tracks/utils/track-to-media-item';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {TrackOptionsColumn} from '@app/web-player/tracks/track-table/track-options-column';\nimport {TableDataItem} from '@common/ui/tables/types/table-data-item';\nimport {useIsMobileDevice} from '@common/utils/hooks/is-mobile-device';\nimport {Playlist} from '@app/web-player/playlists/playlist';\n\nconst columnConfig: ColumnConfig[] = [\n {\n key: 'index',\n header: () => #,\n align: 'center',\n width: 'w-24 flex-shrink-0',\n body: (track, row) => {\n if (row.isPlaceholder) {\n return ;\n }\n return (\n \n );\n },\n },\n {\n key: 'name',\n allowsSorting: true,\n width: 'flex-3 min-w-224',\n visibleInMode: 'all',\n header: () => ,\n body: (track, row) => {\n if (row.isPlaceholder) {\n return ;\n }\n return ;\n },\n },\n {\n key: 'artist',\n header: () => ,\n width: 'flex-2',\n body: (track, row) => {\n if (row.isPlaceholder) {\n return ;\n }\n return ;\n },\n },\n {\n key: 'album_name',\n allowsSorting: true,\n width: 'flex-2',\n header: () => ,\n body: (track, row) => {\n if (row.isPlaceholder) {\n return ;\n }\n return track.album ? : null;\n },\n },\n {\n key: 'added_at',\n sortingKey: 'likes.created_at',\n allowsSorting: true,\n maxWidth: 'max-w-112',\n header: () => ,\n body: (track, row) => {\n if (row.isPlaceholder) {\n return ;\n }\n return ;\n },\n },\n {\n key: 'options',\n align: 'end',\n width: 'w-36 md:w-84',\n header: () => ,\n hideHeader: true,\n visibleInMode: 'all',\n body: (track, row) => {\n if (row.isPlaceholder) {\n return (\n
    \n \n
    \n );\n }\n return ;\n },\n },\n {\n key: 'duration',\n allowsSorting: true,\n className: 'text-muted',\n maxWidth: 'max-w-48',\n align: 'end',\n header: () => ,\n body: (track, row) => {\n if (row.isPlaceholder) {\n return ;\n }\n return track.duration ? : null;\n },\n },\n {\n key: 'popularity',\n allowsSorting: true,\n className: 'text-muted',\n maxWidth: 'max-w-54',\n header: () => ,\n body: (track, row) => {\n if (row.isPlaceholder) {\n return ;\n }\n return (\n
    \n \n
    \n );\n },\n },\n];\n\nexport interface TrackTableProps {\n tracks: Track[] | TableDataItem[]; // might be passing in placeholder items for skeletons\n hideArtist?: boolean;\n hideAlbum?: boolean;\n hideTrackImage?: boolean;\n hidePopularity?: boolean;\n hideAddedAtColumn?: boolean;\n hideHeaderRow?: boolean;\n queueGroupId?: string | number;\n playlist?: Playlist;\n renderRowAs?: TableProps['renderRowAs'];\n sortDescriptor?: TableProps['sortDescriptor'];\n onSortChange?: TableProps['onSortChange'];\n enableSorting?: TableProps['enableSorting'];\n tableBody?: TableProps['tableBody'];\n className?: string;\n}\nexport function TrackTable({\n tracks,\n hideArtist = false,\n hideAlbum = false,\n hideHeaderRow = false,\n hideTrackImage = false,\n hidePopularity = true,\n hideAddedAtColumn = true,\n queueGroupId,\n renderRowAs,\n playlist,\n ...tableProps\n}: TrackTableProps) {\n const player = usePlayerActions();\n const isMobile = useIsMobileDevice();\n hideHeaderRow = hideHeaderRow || isMobile;\n\n const filteredColumns = useMemo(() => {\n return columnConfig.filter(col => {\n if (col.key === 'artist' && hideArtist) {\n return false;\n }\n if (col.key === 'album_name' && hideAlbum) {\n return false;\n }\n if (col.key === 'popularity' && hidePopularity) {\n return false;\n }\n if (col.key === 'added_at' && hideAddedAtColumn) {\n return false;\n }\n return true;\n });\n }, [hideArtist, hideAlbum, hidePopularity, hideAddedAtColumn]);\n\n const meta: TrackTableMeta = useMemo(() => {\n return {queueGroupId: queueGroupId, hideTrackImage, playlist};\n }, [queueGroupId, hideTrackImage, playlist]);\n\n return (\n {\n const newQueue = tracks.map(d =>\n trackToMediaItem(d as Track, queueGroupId),\n );\n player.overrideQueueAndPlay(newQueue, index);\n }}\n {...tableProps}\n />\n );\n}\n\nfunction TrackTableRowWithContextMenu({\n item,\n children,\n ...domProps\n}: RowElementProps) {\n const row =
    {children}
    ;\n if (item.isPlaceholder) {\n return row;\n }\n return (\n \n {row}\n \n \n );\n}\n","import {observeElementOffset, useVirtualizer} from '@tanstack/react-virtual';\nimport React, {Fragment, useContext, useEffect, useRef} from 'react';\nimport {TableRow} from '@common/ui/tables/table-row';\nimport {TableBodyProps} from '@common/ui/tables/table';\nimport {getScrollParent} from '@react-aria/utils';\nimport {TableContext} from '@common/ui/tables/table-context';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {UseInfiniteQueryResult} from '@tanstack/react-query/src/types';\n\ninterface VirtualTableBodyProps extends TableBodyProps {\n totalItems?: number;\n query: UseInfiniteQueryResult;\n}\nexport function VirtualTableBody({\n renderRowAs,\n totalItems = 0,\n query,\n}: VirtualTableBodyProps) {\n const {data} = useContext(TableContext);\n\n // make sure we are not rendering more placeholder rows than\n // there are items left to lazy load and at most 10 placeholders.\n // If total items is unknown, we will render 10 placeholders.\n const placeholderRowCount =\n totalItems <= 0 ? 10 : Math.min(totalItems - data.length, 10);\n\n // only use virtualizer if playlist has more than 3 pages\n return totalItems < 91 ? (\n \n ) : (\n \n );\n}\n\ninterface BodyProps extends TableBodyProps {\n placeholderRowCount: number;\n query: UseInfiniteQueryResult;\n}\nfunction Body({renderRowAs, placeholderRowCount, query}: BodyProps) {\n const {data} = useContext(TableContext);\n return (\n \n {data.map((track, index) => (\n \n ))}\n \n \n );\n}\n\nfunction VirtualizedBody({renderRowAs, placeholderRowCount, query}: BodyProps) {\n const {data} = useContext(TableContext);\n const bodyRef = useRef(null);\n const scrollableRef = useRef(null!);\n const scrollOffset = useRef(0);\n\n // virtualizer will not work with \"getScrollElement: () => scrollableRef.current\"\n // if scrollableRef.current is set in useEffect and is null on first render\n const getScrollElement = () => {\n if (scrollableRef.current) {\n return scrollableRef.current;\n }\n if (bodyRef.current) {\n scrollableRef.current = getScrollParent(bodyRef.current);\n }\n return scrollableRef.current;\n };\n\n useEffect(() => {\n if (bodyRef.current) {\n scrollOffset.current =\n bodyRef.current.getBoundingClientRect().top +\n getScrollElement().scrollTop;\n }\n }, [bodyRef]);\n\n const virtualizer = useVirtualizer({\n overscan: 10,\n count: data.length,\n getScrollElement,\n estimateSize: () => 48,\n // getScrollElement: () => scrollableRef.current,\n observeElementOffset: (instance, cb) => {\n return observeElementOffset(instance, offset => {\n cb(offset - scrollOffset.current);\n });\n },\n });\n\n const virtualRows = virtualizer.getVirtualItems();\n const virtualHeight = `${\n virtualizer.getTotalSize() +\n // if showing placeholder rows, extended height of virtual list to show them\n (query.isFetchingNextPage ? placeholderRowCount * 48 : 0)\n }px`;\n\n return (\n \n {virtualRows.map(virtualItem => {\n const item = data[virtualItem.index];\n return (\n \n );\n })}\n \n \n );\n}\n\ninterface SentinelProps extends BodyProps {\n dataCount: number;\n query: UseInfiniteQueryResult;\n style?: React.CSSProperties;\n}\nfunction Sentinel({\n dataCount,\n placeholderRowCount,\n renderRowAs,\n query,\n style,\n}: SentinelProps) {\n // show at least one placeholder row always\n return (\n \n {[...new Array(Math.max(placeholderRowCount, 1)).keys()].map(\n (key, index) => {\n const id = `placeholder-${key}`;\n return (\n \n );\n },\n )}\n \n );\n}\n","import React, {Fragment} from 'react';\nimport {ChannelContentProps} from '@app/web-player/channels/channel-content';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport {Track} from '@app/web-player/tracks/track';\nimport {VirtualTableBody} from '@app/web-player/playlists/virtual-table-body';\nimport {ChannelHeading} from '@app/web-player/channels/channel-heading';\nimport {usePaginatedChannelContent} from '@common/channels/requests/use-paginated-channel-content';\nimport {ChannelContentItem} from '@common/channels/channel';\n\nexport function ChannelTrackTable(\n props: ChannelContentProps>,\n) {\n return (\n \n \n {props.isNested ? (\n \n ) : (\n \n )}\n \n );\n}\n\nfunction SimpleTable({channel}: ChannelContentProps) {\n return (\n \n );\n}\n\nfunction PaginatedTable({channel}: ChannelContentProps) {\n const query = usePaginatedChannelContent>(channel);\n\n const totalItems =\n channel.content && 'total' in channel.content\n ? channel.content.total\n : undefined;\n\n return (\n }\n />\n );\n}\n","import {useQuery} from '@tanstack/react-query';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Comment} from '@common/comments/comment';\n\ninterface WaveDataResponse extends BackendResponse {\n waveData: number[][];\n comments: Comment[];\n}\n\nfunction queryKey(trackId: number | string) {\n return ['tracks', +trackId, 'wave-data'];\n}\n\nexport function invalidateWaveData(trackId: number | string) {\n queryClient.invalidateQueries({queryKey: queryKey(trackId)});\n}\n\nexport function useTrackWaveData(\n trackId: number | string,\n {enabled}: {enabled?: boolean} = {},\n) {\n return useQuery({\n queryKey: queryKey(trackId),\n queryFn: () => fetchWaveData(trackId),\n enabled,\n });\n}\n\nfunction fetchWaveData(trackId: number | string) {\n return apiClient\n .get(`tracks/${trackId}/wave`)\n .then(response => response.data);\n}\n","export function drawWaveform(\n waveData: number[][],\n canvas: HTMLCanvasElement,\n color: string\n) {\n const context = canvas.getContext('2d');\n if (!context) return;\n context.clearRect(0, 0, canvas.width, canvas.height);\n\n // mirror\n context.fillStyle = color;\n context.globalAlpha = 0.5;\n waveData.forEach(lineData => {\n const height = (55 / 100) * lineData[3];\n context.fillRect(\n lineData[0],\n lineData[1] + lineData[3] + 1,\n lineData[2],\n height\n );\n });\n\n // main\n context.fillStyle = color;\n context.globalAlpha = 1;\n waveData.forEach(lineData => {\n context.fillRect(lineData[0], lineData[1], lineData[2], lineData[3]);\n });\n}\n","import {Track} from '@app/web-player/tracks/track';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {\n tracksToMediaItems,\n trackToMediaItem,\n} from '@app/web-player/tracks/utils/track-to-media-item';\nimport {flushSync} from 'react-dom';\nimport {useEffect, useState} from 'react';\n\nexport function useTrackSeekbar(track: Track, queue?: Track[]) {\n const player = usePlayerActions();\n const cuedMedia = usePlayerStore(s => s.cuedMedia);\n\n // either use exact duration from provider if this track is cued, or use duration from track props\n const playerDuration = usePlayerStore(s => s.mediaDuration);\n const duration =\n cuedMedia?.id === track.id && playerDuration\n ? playerDuration\n : (track.duration || 0) / 1000;\n\n const [currentTime, setCurrentTime] = useState(\n track.id === player.getState().cuedMedia?.id ? player.getCurrentTime() : 0\n );\n\n useEffect(() => {\n return player.subscribe({\n progress: ({currentTime}) => {\n setCurrentTime(\n track.id === player.getState().cuedMedia?.id ? currentTime : 0\n );\n },\n });\n }, [player, track]);\n\n return {\n duration,\n minValue: 0,\n maxValue: duration,\n value: currentTime,\n onPointerDown: () => {\n player.setIsSeeking(true);\n player.pause();\n\n // flush so provider src is changed immediately. Without this seeking\n // will not work when clicking on a different track the first time\n if (player.getState().cuedMedia?.id !== track.id) {\n flushSync(() => {\n if (queue?.length) {\n const pointer = queue?.findIndex(t => t.id === track.id);\n player.overrideQueue(tracksToMediaItems(queue), pointer);\n } else {\n player.cue(trackToMediaItem(track));\n }\n });\n }\n },\n onChange: (value: number) => {\n player.getState().emit('progress', {currentTime: value});\n player.seek(value);\n },\n onChangeEnd: () => {\n player.setIsSeeking(false);\n player.play();\n },\n };\n}\n","import {\n createContext,\n MutableRefObject,\n RefObject,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\ninterface CommentBarContextValue {\n newCommentInputRef: RefObject;\n newCommentPositionRef: MutableRefObject;\n markerIsVisible: boolean;\n setMarkerIsVisible: (value: boolean) => void;\n disableCommenting: boolean;\n}\n\nexport const CommentBarContext = createContext(null!);\n\ninterface CommentBarContextProps {\n children: any;\n disableCommenting?: boolean;\n}\nexport function CommentBarContextProvider({\n children,\n disableCommenting = false,\n}: CommentBarContextProps) {\n const [markerIsVisible, setMarkerIsVisible] = useState(false);\n const newCommentInputRef = useRef(null);\n const newCommentPositionRef = useRef(0);\n const value: CommentBarContextValue = useMemo(() => {\n return {\n newCommentInputRef,\n newCommentPositionRef,\n markerIsVisible,\n setMarkerIsVisible,\n disableCommenting,\n };\n }, [markerIsVisible, disableCommenting]);\n return (\n \n {children}\n \n );\n}\n","import {getUserImage} from '@app/web-player/users/user-image';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {Dialog} from '@common/ui/overlays/dialog/dialog';\nimport {DialogBody} from '@common/ui/overlays/dialog/dialog-body';\nimport {useSlider} from '@common/ui/forms/slider/use-slider';\nimport {useAuth} from '@common/auth/use-auth';\nimport {useContext} from 'react';\nimport {Avatar} from '@common/ui/images/avatar';\nimport clsx from 'clsx';\nimport {useInteractOutside} from '@react-aria/interactions';\nimport {CommentBarContext} from '@app/web-player/tracks/waveform/comment-bar-context';\nimport {Comment} from '@common/comments/comment';\nimport {Track} from '@app/web-player/tracks/track';\n\ninterface CommentBarProps {\n comments: Comment[];\n track: Track;\n}\nexport function CommentBar({comments, track}: CommentBarProps) {\n const {user, hasPermission} = useAuth();\n const {\n newCommentInputRef,\n newCommentPositionRef,\n markerIsVisible,\n setMarkerIsVisible,\n ...commentBarContext\n } = useContext(CommentBarContext);\n\n const disableCommenting =\n commentBarContext.disableCommenting || !hasPermission('comments.create');\n\n const {domProps, groupId, trackRef, getThumbPercent} = useSlider({\n onChange: () => {\n setMarkerIsVisible(true);\n newCommentPositionRef.current = getThumbPercent(0) * 100;\n },\n onChangeEnd: () => {\n newCommentInputRef.current?.focus();\n },\n });\n\n useInteractOutside({\n ref: trackRef,\n onInteractOutside: e => {\n if (!newCommentInputRef.current?.contains(e.target as HTMLElement)) {\n setMarkerIsVisible(false);\n }\n },\n });\n\n return (\n \n {markerIsVisible ? (\n \n \n \n ) : null}\n {comments.map(comment => {\n if (!comment.user) return null;\n return (\n \n \n \n \n \n \n );\n })}\n \n );\n}\n\ninterface CommentDialogProps {\n comment: Comment;\n}\nfunction CommentDialog({comment}: CommentDialogProps) {\n return (\n \n \n
    \n {comment.user && (\n
    {comment.user.display_name}
    \n )}\n
    {comment.content}
    \n
    \n
    \n
    \n );\n}\n","import {Track} from '@app/web-player/tracks/track';\nimport {useEffect, useRef, useState} from 'react';\nimport {useTrackWaveData} from '@app/web-player/tracks/requests/use-track-wave-data';\nimport {\n WAVE_HEIGHT,\n WAVE_WIDTH,\n} from '@app/web-player/tracks/waveform/generate-waveform-data';\nimport clsx from 'clsx';\nimport {FormattedDuration} from '@common/i18n/formatted-duration';\nimport {useSlider} from '@common/ui/forms/slider/use-slider';\nimport {useThemeSelector} from '@common/ui/themes/theme-selector-context';\nimport {themeValueToHex} from '@common/ui/themes/utils/theme-value-to-hex';\nimport {AnimatePresence} from 'framer-motion';\nimport {drawWaveform} from '@app/web-player/tracks/waveform/draw-waveform';\nimport {useTrackSeekbar} from '@app/web-player/player-controls/seekbar/use-track-seekbar';\nimport {CommentBar} from '@app/web-player/tracks/waveform/comment-bar';\n\nconst durationClassName =\n 'text-[11px] absolute bottom-32 p-3 rounded text-white font-semibold z-30 pointer-events-none bg-black/80';\n\ninterface WaveformProps {\n track: Track;\n queue?: Track[];\n className?: string;\n}\nexport function Waveform({track, queue, className}: WaveformProps) {\n const ref = useRef(null);\n const canvasRef = useRef(null);\n const progressCanvasRef = useRef(null);\n // when wave is scrolled into view\n const [isInView, setIsInView] = useState(false);\n // after wave is drawn into canvas and fade in animation should start running\n const [isVisible, setIsVisible] = useState(false);\n const {data} = useTrackWaveData(track.id, {enabled: isInView});\n const themeSelector = useThemeSelector();\n\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries: IntersectionObserverEntry[]) => {\n entries.forEach(entry => {\n if (entry.isIntersecting && entry.target === ref.current) {\n setIsInView(true);\n observer.disconnect();\n }\n });\n },\n {root: document.body},\n );\n if (ref.current) {\n observer.observe(ref.current);\n }\n return () => observer.disconnect();\n }, []);\n\n useEffect(() => {\n if (canvasRef.current && data?.waveData && progressCanvasRef.current) {\n drawWaveform(data.waveData, canvasRef.current, '#666');\n drawWaveform(\n data.waveData,\n progressCanvasRef.current,\n themeValueToHex(themeSelector.selectedTheme.values['--be-primary']),\n );\n setIsVisible(true);\n }\n }, [data, themeSelector.selectedTheme]);\n\n const {value, onChange, onChangeEnd, duration, ...sliderProps} =\n useTrackSeekbar(track, queue);\n const {domProps, groupId, thumbIds, trackRef, getThumbPercent} = useSlider({\n ...sliderProps,\n value: [value],\n onChange: ([newValue]: number[]) => onChange(newValue),\n onChangeEnd: () => onChangeEnd(),\n });\n\n return (\n \n
    \n \n \n {value ? : '0:00'}\n \n
    \n \n \n \n
    \n \n
    \n \n
    \n \n {data?.comments && (\n \n )}\n
    \n
    \n );\n}\n","import {Slider} from '@common/ui/forms/slider/slider';\nimport {FormattedDuration} from '@common/i18n/formatted-duration';\nimport {useTrackSeekbar} from '@app/web-player/player-controls/seekbar/use-track-seekbar';\nimport {Track} from '@app/web-player/tracks/track';\nimport clsx from 'clsx';\n\ninterface TrackSeekbarProps {\n track: Track;\n queue?: Track[];\n className?: string;\n}\nexport function TrackSeekbar({track, queue, className}: TrackSeekbarProps) {\n const {duration, ...sliderProps} = useTrackSeekbar(track, queue);\n\n return (\n
    \n
    \n {sliderProps.value ? (\n \n ) : (\n '0:00'\n )}\n
    \n \n
    \n \n
    \n
    \n );\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useMutation, useQueryClient} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {Commentable} from '@common/comments/commentable';\nimport {Comment} from '@common/comments/comment';\n\ninterface Response extends BackendResponse {\n //\n}\n\nexport interface CreateCommentPayload {\n commentable: Commentable;\n content: string;\n inReplyTo?: Comment;\n}\n\nexport function useCreateComment() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (props: CreateCommentPayload) => createComment(props),\n onSuccess: async (response, props) => {\n await queryClient.invalidateQueries({\n queryKey: [\n 'comment',\n `${props.commentable.id}-${props.commentable.model_type}`,\n ],\n });\n toast(message('Comment posted'));\n },\n onError: err => showHttpErrorToast(err),\n });\n}\n\nfunction createComment({\n commentable,\n content,\n inReplyTo,\n ...other\n}: CreateCommentPayload): Promise {\n const payload = {\n commentable_id: commentable.id,\n commentable_type: commentable.model_type,\n content,\n inReplyTo,\n ...other,\n };\n return apiClient.post('comment', payload).then(r => r.data);\n}\n","import {Commentable} from '@common/comments/commentable';\nimport {Comment} from '@common/comments/comment';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {useAuth} from '@common/auth/use-auth';\nimport {useCreateComment} from '@common/comments/requests/use-create-comment';\nimport {RefObject, useState} from 'react';\nimport clsx from 'clsx';\nimport {TextField} from '@common/ui/forms/input-field/text-field/text-field';\nimport {Avatar} from '@common/ui/images/avatar';\nimport {message} from '@common/i18n/message';\nimport {Trans} from '@common/i18n/trans';\nimport {useObjectRef} from '@react-aria/utils';\nimport {Button} from '@common/ui/buttons/button';\n\nexport interface NewCommentFormProps {\n commentable: Commentable;\n inReplyTo?: Comment;\n onSuccess?: () => void;\n className?: string;\n autoFocus?: boolean;\n inputRef?: RefObject;\n // additional data that should be sent to backend when creating comments\n payload?: Record;\n}\nexport function NewCommentForm({\n commentable,\n inReplyTo,\n onSuccess,\n className,\n autoFocus,\n payload,\n ...props\n}: NewCommentFormProps) {\n const {trans} = useTrans();\n const {user} = useAuth();\n const createComment = useCreateComment();\n const inputRef = useObjectRef(props.inputRef);\n const [inputIsExpanded, setInputIsExpanded] = useState(false);\n const [inputValue, setInputValue] = useState('');\n\n const clearInput = () => {\n setInputIsExpanded(false);\n if (inputRef.current) {\n inputRef.current.blur();\n setInputValue('');\n }\n };\n\n return (\n {\n e.preventDefault();\n if (inputValue && !createComment.isPending) {\n createComment.mutate(\n {\n ...payload,\n commentable,\n content: inputValue,\n inReplyTo,\n },\n {\n onSuccess: () => {\n clearInput();\n onSuccess?.();\n },\n },\n );\n }\n }}\n >\n \n
    \n
    \n {user?.display_name}\n ),\n }}\n />\n
    \n setInputValue(e.target.value)}\n onFocus={() => setInputIsExpanded(true)}\n onBlur={() => {\n if (!inputValue) {\n setInputIsExpanded(false);\n }\n }}\n minLength={3}\n rows={inputIsExpanded ? 3 : 1}\n placeholder={\n inReplyTo\n ? trans(message('Write a reply'))\n : trans(message('Leave a comment'))\n }\n />\n {inputIsExpanded && (\n
    \n \n \n \n \n
    \n )}\n
    \n \n );\n}\n","import {\n NewCommentForm,\n NewCommentFormProps,\n} from '@common/comments/new-comment-form';\nimport React, {useContext} from 'react';\nimport {CommentBarContext} from '@app/web-player/tracks/waveform/comment-bar-context';\nimport {invalidateWaveData} from '@app/web-player/tracks/requests/use-track-wave-data';\nimport {useAuth} from '@common/auth/use-auth';\n\nexport function CommentBarNewCommentForm({\n commentable,\n className,\n}: NewCommentFormProps) {\n const {isLoggedIn} = useAuth();\n const {newCommentInputRef, newCommentPositionRef, setMarkerIsVisible} =\n useContext(CommentBarContext);\n\n if (!isLoggedIn) return null;\n\n return (\n {\n setMarkerIsVisible(false);\n invalidateWaveData(commentable.id);\n }}\n />\n );\n}\n","import {useAddItemsToLibrary} from '@app/web-player/library/requests/use-add-items-to-library';\nimport {useRemoveItemsFromLibrary} from '@app/web-player/library/requests/use-remove-items-from-library';\nimport {useLibraryStore} from '@app/web-player/library/state/likes-store';\nimport {Likeable} from '@app/web-player/library/likeable';\nimport {FavoriteIcon} from '@common/icons/material/Favorite';\nimport {FavoriteBorderIcon} from '@common/icons/material/FavoriteBorder';\nimport {Button, ButtonProps} from '@common/ui/buttons/button';\nimport {message} from '@common/i18n/message';\nimport {Trans} from '@common/i18n/trans';\nimport {useAuthClickCapture} from '@app/web-player/use-auth-click-capture';\n\ninterface LikeButtonProps extends Omit {\n likeable: Likeable;\n}\nexport function LikeButton({\n likeable,\n radius = 'rounded-full',\n disabled,\n ...buttonProps\n}: LikeButtonProps) {\n const authHandler = useAuthClickCapture();\n const addToLibrary = useAddItemsToLibrary();\n const removeFromLibrary = useRemoveItemsFromLibrary();\n const isLiked = useLibraryStore(s => s.has(likeable));\n const isLoading = addToLibrary.isPending || removeFromLibrary.isPending;\n\n const labels = getLabels(likeable);\n\n if (isLiked) {\n return (\n }\n disabled={disabled || isLoading}\n onClickCapture={authHandler}\n onClick={() => {\n removeFromLibrary.mutate({likeables: [likeable]});\n }}\n >\n \n \n );\n }\n return (\n }\n disabled={disabled || isLoading}\n onClickCapture={authHandler}\n onClick={() => {\n addToLibrary.mutate({likeables: [likeable]});\n }}\n >\n \n \n );\n}\n\nfunction getLabels(likeable: Likeable) {\n switch (likeable.model_type) {\n case 'artist':\n return {like: message('Follow'), removeLike: message('Following')};\n default:\n return {like: message('Like'), removeLike: message('Liked')};\n }\n}\n","import {Track} from '@app/web-player/tracks/track';\nimport {Album} from '@app/web-player/albums/album';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {useToggleRepost} from '@app/web-player/reposts/use-toggle-repost';\nimport {useRepostsStore} from '@app/web-player/library/state/reposts-store';\nimport {Button} from '@common/ui/buttons/button';\nimport {RepeatIcon} from '@common/icons/material/Repeat';\nimport clsx from 'clsx';\nimport {Trans} from '@common/i18n/trans';\nimport React from 'react';\nimport {ButtonSize} from '@common/ui/buttons/button-size';\nimport {useAuthClickCapture} from '@app/web-player/use-auth-click-capture';\n\ninterface RepostButtonProps {\n item: Track | Album;\n className?: string;\n size?: ButtonSize;\n radius?: string;\n disabled?: boolean;\n}\nexport function RepostButton({\n item,\n className,\n size = 'xs',\n radius,\n disabled,\n}: RepostButtonProps) {\n const authHandler = useAuthClickCapture();\n const {player} = useSettings();\n const toggleRepost = useToggleRepost();\n const isReposted = useRepostsStore(s => s.has(item));\n if (!player?.enable_repost) return null;\n\n return (\n }\n disabled={disabled || toggleRepost.isPending}\n onClickCapture={authHandler}\n onClick={() => toggleRepost.mutate({repostable: item})}\n >\n {isReposted ? : }\n \n );\n}\n","import React from 'react';\nimport clsx from 'clsx';\nimport {Track} from '@app/web-player/tracks/track';\nimport {PlayArrowFilledIcon} from '@app/web-player/tracks/play-arrow-filled';\nimport {FormattedNumber} from '@common/i18n/formatted-number';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\nimport {Trans} from '@common/i18n/trans';\nimport {FavoriteIcon} from '@common/icons/material/Favorite';\nimport {RepeatIcon} from '@common/icons/material/Repeat';\nimport {Album} from '@app/web-player/albums/album';\nimport {Artist} from '@app/web-player/artists/artist';\n\ninterface Props {\n item: Track | Album | Artist;\n className?: string;\n showPlays?: boolean;\n}\nexport function MediaItemStats({item, className, showPlays = true}: Props) {\n return (\n \n {showPlays && }\n \n {item.model_type !== 'artist' && }\n \n );\n}\n\ninterface PlayCountProps {\n item: Track | Album | Artist;\n}\nfunction PlayCount({item}: PlayCountProps) {\n if (!item.plays) return null;\n\n const count = (\n \n );\n\n return (\n }>\n
    \n \n {count}\n
    \n
    \n );\n}\n\ninterface LikesCountProps {\n item: Track | Album | Artist;\n}\nfunction LikesCount({item}: LikesCountProps) {\n if (!item.likes_count) return null;\n\n const count = ;\n\n return (\n }>\n
    \n \n {count}\n
    \n
    \n );\n}\n\ninterface RepostsCountProps {\n item: Track | Album;\n}\nfunction RepostsCount({item}: RepostsCountProps) {\n if (!item.reposts_count) return null;\n\n const count = ;\n\n return (\n }>\n
    \n \n {count}\n
    \n
    \n );\n}\n","import React, {ReactNode} from 'react';\nimport {LikeButton} from '@app/web-player/library/like-button';\nimport {RepostButton} from '@app/web-player/reposts/repost-button';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {Button} from '@common/ui/buttons/button';\nimport {ShareIcon} from '@common/icons/material/Share';\nimport {Trans} from '@common/i18n/trans';\nimport {MoreHorizIcon} from '@common/icons/material/MoreHoriz';\nimport {TrackContextDialog} from '@app/web-player/tracks/context-dialog/track-context-dialog';\nimport {MediaItemStats} from '@app/web-player/tracks/media-item-stats';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Album} from '@app/web-player/albums/album';\nimport {AlbumContextDialog} from '@app/web-player/albums/album-context-dialog';\nimport clsx from 'clsx';\nimport {ButtonSize} from '@common/ui/buttons/button-size';\nimport {ShareMediaDialog} from '@app/web-player/sharing/share-media-dialog';\n\ninterface Props {\n item: Track | Album;\n managesItem: boolean;\n buttonClassName?: string;\n buttonGap?: string;\n buttonSize?: ButtonSize;\n buttonRadius?: string;\n children?: ReactNode;\n className?: string;\n}\nexport function TrackActionsBar({\n item,\n managesItem,\n buttonClassName,\n buttonGap = 'mr-8',\n buttonSize = 'xs',\n buttonRadius = 'rounded',\n children,\n className,\n}: Props) {\n return (\n \n
    \n {children}\n \n \n \n }\n className={clsx(\n buttonGap,\n buttonClassName,\n 'hidden @[660px]:inline-flex',\n )}\n radius={buttonRadius}\n >\n \n \n \n \n \n }\n className={clsx(buttonGap, buttonClassName)}\n radius={buttonRadius}\n >\n \n \n \n \n
    \n \n \n );\n}\n\ninterface MoreDialogProps {\n item: Track | Album;\n}\nfunction MoreDialog({item}: MoreDialogProps) {\n if (item.model_type === 'track') {\n return ;\n }\n return ;\n}\n","import {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {Waveform} from '@app/web-player/tracks/waveform/waveform';\nimport {Track} from '@app/web-player/tracks/track';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {TrackSeekbar} from '@app/web-player/player-controls/seekbar/track-seekbar';\nimport {trackIsLocallyUploaded} from '@app/web-player/tracks/utils/track-is-locally-uploaded';\nimport {FormattedRelativeTime} from '@common/i18n/formatted-relative-time';\nimport {\n CommentBarContext,\n CommentBarContextProvider,\n} from '@app/web-player/tracks/waveform/comment-bar-context';\nimport {CommentBarNewCommentForm} from '@app/web-player/tracks/waveform/comment-bar-new-comment-form';\nimport React, {Fragment, memo, useContext} from 'react';\nimport {AnimatePresence} from 'framer-motion';\nimport {Chip} from '@common/ui/forms/input-field/chip-field/chip';\nimport {GenreLink} from '@app/web-player/genres/genre-link';\nimport {RepeatIcon} from '@common/icons/material/Repeat';\nimport {TrackLink} from '@app/web-player/tracks/track-link';\nimport {useTrackPermissions} from '@app/web-player/tracks/hooks/use-track-permissions';\nimport {User} from '@common/auth/user';\nimport {UserProfileLink} from '@app/web-player/users/user-profile-link';\nimport {TrackActionsBar} from '@app/web-player/tracks/track-actions-bar';\nimport clsx from 'clsx';\n\ninterface TrackListItemProps {\n track: Track;\n queue?: Track[];\n reposter?: User;\n className?: string;\n hideArtwork?: boolean;\n hideActions?: boolean;\n linksInNewTab?: boolean;\n}\nexport const TrackListItem = memo(\n ({\n track,\n queue,\n reposter,\n className,\n hideArtwork = false,\n hideActions = false,\n linksInNewTab = false,\n }: TrackListItemProps) => {\n const {player} = useSettings();\n const {managesTrack} = useTrackPermissions([track]);\n\n const showWave =\n player?.seekbar_type === 'waveform' && trackIsLocallyUploaded(track);\n\n return (\n \n {!hideArtwork && (\n \n )}\n
    \n
    \n \n
    \n
    \n \n {reposter && (\n \n \n \n \n )}\n
    \n
    \n \n
    \n
    \n
    \n \n {track.genres?.length ? (\n \n \n \n ) : null}\n
    \n
    \n
    \n {showWave ? (\n \n \n \n ) : (\n \n )}\n
    \n {!hideActions && (\n \n )}\n
    \n \n );\n },\n);\n\ninterface WaveformWithCommentsProps {\n track: Track;\n queue?: Track[];\n}\nexport function WaveformWithComments({\n track,\n queue,\n}: WaveformWithCommentsProps) {\n const {markerIsVisible} = useContext(CommentBarContext);\n return (\n \n \n \n {markerIsVisible && (\n \n )}\n \n \n );\n}\n","import {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport {TrackListItem} from '@app/web-player/tracks/track-list/track-list-item';\nimport React from 'react';\nimport {Track} from '@app/web-player/tracks/track';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {VirtualTableBody} from '@app/web-player/playlists/virtual-table-body';\nimport {UseInfiniteDataResult} from '@common/ui/infinite-scroll/use-infinite-data';\n\ninterface Props {\n tracks?: Track[];\n query?: UseInfiniteDataResult;\n}\nexport function TrackList({tracks, query}: Props) {\n const isMobile = useIsMobileMediaQuery();\n\n if (!tracks) {\n tracks = query ? query.items : [];\n }\n\n if (isMobile) {\n if (!query) {\n return ;\n }\n return (\n }\n />\n );\n }\n\n return (\n
    \n {tracks.map(track => (\n \n ))}\n {query && }\n
    \n );\n}\n","import React, {Fragment} from 'react';\nimport {ChannelContentProps} from '@app/web-player/channels/channel-content';\nimport {Track} from '@app/web-player/tracks/track';\nimport {ChannelHeading} from '@app/web-player/channels/channel-heading';\nimport {TrackList} from '@app/web-player/tracks/track-list/track-list';\nimport {usePaginatedChannelContent} from '@common/channels/requests/use-paginated-channel-content';\nimport {ChannelContentItem} from '@common/channels/channel';\n\nexport function ChannelTrackList(\n props: ChannelContentProps>,\n) {\n return (\n \n \n {props.isNested ? (\n \n ) : (\n \n )}\n \n );\n}\n\nfunction PaginatedList({channel}: ChannelContentProps) {\n const query = usePaginatedChannelContent>(channel);\n return ;\n}\n","var functionDebounce = debounce;\n\nfunction debounce(fn, wait, callFirst) {\n var timeout = null;\n var debouncedFn = null;\n\n var clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n\n debouncedFn = null;\n timeout = null;\n }\n };\n\n var flush = function() {\n var call = debouncedFn;\n clear();\n\n if (call) {\n call();\n }\n };\n\n var debounceWrapper = function() {\n if (!wait) {\n return fn.apply(this, arguments);\n }\n\n var context = this;\n var args = arguments;\n var callNow = callFirst && !timeout;\n clear();\n\n debouncedFn = function() {\n fn.apply(context, args);\n };\n\n timeout = setTimeout(function() {\n timeout = null;\n\n if (!callNow) {\n var call = debouncedFn;\n debouncedFn = null;\n\n return call();\n }\n }, wait);\n\n if (callNow) {\n return debouncedFn();\n }\n };\n\n debounceWrapper.cancel = clear;\n debounceWrapper.flush = flush;\n\n return debounceWrapper;\n}\n\nexport {functionDebounce as default};\n","import React, {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {KeyboardArrowRightIcon} from '@common/icons/material/KeyboardArrowRight';\nimport {KeyboardArrowLeftIcon} from '@common/icons/material/KeyboardArrowLeft';\nimport {ChannelContentProps} from '@app/web-player/channels/channel-content';\nimport {ChannelContentGridItem} from '@app/web-player/channels/channel-content-grid-item';\nimport {ChannelHeading} from '@app/web-player/channels/channel-heading';\nimport debounce from 'just-debounce-it';\n\nexport function ChannelContentCarousel(props: ChannelContentProps) {\n const {channel} = props;\n const ref = useRef(null);\n const itemWidth = useRef(0);\n\n const [enablePrev, setEnablePrev] = useState(false);\n const [enableNext, setEnableNext] = useState(true);\n\n const updateNavStatus = useCallback(() => {\n const el = ref.current;\n if (el && itemWidth.current) {\n setEnablePrev(el.scrollLeft > 0);\n setEnableNext(el.scrollWidth - el.scrollLeft !== el.clientWidth);\n }\n }, []);\n\n // enable/disable navigation buttons based on element scroll offset\n useEffect(() => {\n const el = ref.current;\n const handleScroll = debounce(() => updateNavStatus(), 100);\n if (el) {\n el.addEventListener('scroll', handleScroll);\n }\n return () => el?.removeEventListener('scroll', handleScroll);\n }, [updateNavStatus]);\n\n // get width for first grid item\n useLayoutEffect(() => {\n const el = ref.current;\n if (el) {\n const firstGridItem = el.children.item(0);\n const observer = new ResizeObserver(entries => {\n itemWidth.current = entries[0].contentRect.width;\n updateNavStatus();\n });\n if (firstGridItem) {\n observer.observe(firstGridItem);\n }\n return () => observer.unobserve(el);\n }\n }, [updateNavStatus]);\n\n const scrollAmount = () => {\n return itemWidth.current * (3 - 1);\n };\n\n return (\n
    \n
    \n \n
    \n {\n if (ref.current) {\n ref.current.scrollBy({left: -scrollAmount()});\n }\n }}\n >\n \n \n {\n if (ref.current) {\n ref.current.scrollBy({left: scrollAmount()});\n }\n }}\n >\n \n \n
    \n
    \n \n {channel.content?.data.map(item => (\n \n ))}\n
    \n \n );\n}\n","import {Track, TRACK_MODEL} from '@app/web-player/tracks/track';\nimport React, {Fragment} from 'react';\nimport {ChannelContentGrid} from '@app/web-player/channels/channel-content-grid';\nimport {ChannelTrackTable} from '@app/web-player/channels/channel-track-table';\nimport {ChannelTrackList} from '@app/web-player/channels/channel-track-list';\nimport {ChannelContentCarousel} from '@app/web-player/channels/channel-content-carousel';\nimport {ChannelHeading} from '@app/web-player/channels/channel-heading';\nimport {ChannelContentModel} from '@app/admin/channels/channel-content-config';\nimport {Channel, CHANNEL_MODEL} from '@common/channels/channel';\n\nexport interface ChannelContentProps<\n T extends ChannelContentModel = ChannelContentModel,\n> {\n channel: Channel;\n isNested?: boolean;\n}\nexport function ChannelContent(props: ChannelContentProps) {\n const {channel, isNested} = props;\n const contentModel = channel.config.contentModel;\n const layout = isNested ? channel.config.nestedLayout : channel.config.layout;\n if (!channel.content) {\n return null;\n }\n\n if (contentModel === TRACK_MODEL && layout === 'list') {\n return )} />;\n } else if (contentModel === TRACK_MODEL && layout === 'trackTable') {\n return )} />;\n } else if (contentModel === CHANNEL_MODEL) {\n return )} />;\n } else if (layout === 'carousel') {\n return ;\n } else {\n return ;\n }\n}\n\nfunction NestedChannels({channel}: ChannelContentProps) {\n return (\n \n \n {channel.content?.data.map(nestedChannel => (\n
    \n }\n isNested\n />\n
    \n ))}\n
    \n );\n}\n","import {useAuth} from '../../auth/use-auth';\nimport {memo, useEffect, useId, useMemo, useRef} from 'react';\nimport lazyLoader from '../../utils/http/lazy-loader';\nimport clsx from 'clsx';\nimport {useSettings} from '../../core/settings/use-settings';\nimport dot from 'dot-object';\nimport {Settings} from '@common/core/settings/settings';\nimport {getScrollParent} from '@react-aria/utils';\n\ninterface AdHostProps {\n slot: keyof Omit, 'disable'>;\n className?: string;\n}\nexport function AdHost({slot, className}: AdHostProps) {\n const settings = useSettings();\n const {isSubscribed} = useAuth();\n const adCode = useMemo(() => {\n return dot.pick(`ads.${slot}`, settings);\n }, [slot, settings]);\n\n if (settings.ads?.disable || isSubscribed || !adCode) return null;\n\n return ;\n}\n\ninterface InvariantAdProps {\n slot: string;\n adCode: string;\n className?: string;\n}\nconst InvariantAd = memo(\n ({slot, adCode, className}: InvariantAdProps) => {\n const ref = useRef(null);\n\n const id = useId();\n\n useEffect(() => {\n if (ref.current) {\n loadAdScripts(adCode, ref.current).then(() => {\n executeAdJavascript(adCode, id);\n });\n }\n return () => {\n // @ts-ignore\n delete window['google_ad_modifications'];\n };\n }, [adCode, id]);\n\n // remove height modifications added by adsense\n useEffect(() => {\n if (ref.current) {\n const scrollParent = getScrollParent(ref.current) as HTMLElement;\n if (scrollParent) {\n const observer = new MutationObserver(function () {\n scrollParent.style.height = '';\n scrollParent.style.minHeight = '';\n });\n observer.observe(scrollParent, {\n attributes: true,\n attributeFilter: ['style'],\n });\n return () => observer.disconnect();\n }\n }\n }, []);\n\n return (\n \n );\n },\n () => {\n // never re-render\n return false;\n },\n);\n\nfunction getAdHtml(adCode: string) {\n // strip out all script tags from ad code and leave only html\n return adCode\n ?.replace(/)<[^<]*)*<\\/script>/gi, '')\n .trim();\n}\n\n// Load any external scripts needed by ad.\nfunction loadAdScripts(adCode: string, parentEl: HTMLDivElement): Promise {\n const promises = [];\n\n // load ad code script\n const pattern = /]*>([\\s\\S]*?)<\\/script>/g;\n let content;\n\n while ((content = pattern.exec(adCode))) {\n if (content[1]) {\n const r = `var d = document.createElement('div'); d.innerHTML = $1; document.getElementById('${id}').appendChild(d.firstChild);`;\n const toEval = content[1].replace(/document.write\\((.+?)\\);/, r);\n eval(toEval);\n }\n }\n}\n","import React from 'react';\nimport {ChannelContent} from '@app/web-player/channels/channel-content';\nimport {PageStatus} from '@common/http/page-status';\nimport {AdHost} from '@common/admin/ads/ad-host';\nimport {useChannel} from '@common/channels/requests/use-channel';\nimport {PageMetaTags} from '@common/http/page-meta-tags';\n\ninterface ChannelPageProps {\n slugOrId?: string | number;\n}\nexport function ChannelPage({slugOrId}: ChannelPageProps) {\n const query = useChannel(slugOrId, 'channelPage');\n\n if (query.data) {\n return (\n
    \n \n
    \n \n \n \n
    \n
    \n );\n }\n\n return (\n \n );\n}\n","import {apiClient, queryClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Track} from '@app/web-player/tracks/track';\nimport {CancelTokenSource} from 'axios';\n\ninterface Response extends BackendResponse {\n results: {title: string; id: string}[];\n}\n\nconst endpoint = (track: Track) => {\n const artistName =\n track.artists?.[0]?.name || track.album?.artists?.[0]?.name;\n return `search/audio/${track.id}/${doubleEncode(artistName!)}/${doubleEncode(\n track.name\n )}`;\n};\n\nexport let isSearchingForYoutubeVideo = false;\n\nexport async function findYoutubeVideosForTrack(\n track: Track,\n cancelToken?: CancelTokenSource\n): Promise {\n const query = {\n queryKey: [endpoint(track)],\n queryFn: async () => findMatch(track, cancelToken),\n staleTime: Infinity,\n };\n\n const response =\n queryClient.getQueryData(query.queryKey) ??\n (await queryClient.fetchQuery(query));\n\n isSearchingForYoutubeVideo = false;\n\n return response?.results || [];\n}\n\nfunction findMatch(\n track: Track,\n cancelToken?: CancelTokenSource\n): Promise {\n isSearchingForYoutubeVideo = true;\n return apiClient\n .get(endpoint(track), {cancelToken: cancelToken?.token})\n .then(response => response.data);\n}\n\nfunction doubleEncode(value: string) {\n return encodeURIComponent(encodeURIComponent(value));\n}\n","import {create} from 'zustand';\nimport {immer} from 'zustand/middleware/immer';\n\ninterface OverlayState {\n isMaximized: boolean;\n isQueueOpen: boolean;\n open: () => void;\n toggle: () => void;\n toggleQueue: () => void;\n}\n\nexport const usePlayerOverlayStore = create()(\n immer((set, get) => ({\n isMaximized: false,\n isQueueOpen: false,\n open: () => {\n set(state => {\n state.isMaximized = true;\n state.isQueueOpen = false;\n });\n },\n toggle: () => {\n set(state => {\n state.isMaximized = !state.isMaximized;\n state.isQueueOpen = false;\n });\n },\n toggleQueue: () => {\n set(state => {\n state.isQueueOpen = !state.isQueueOpen;\n });\n },\n }))\n);\n\nexport const playerOverlayState = usePlayerOverlayStore.getState();\n","/**\n * @see https://developers.google.com/youtube/iframe_api_reference#Playback_controls\n */\nexport const enum YoutubeCommand {\n Play = 'playVideo',\n Pause = 'pauseVideo',\n Stop = 'stopVideo',\n Seek = 'seekTo',\n Cue = 'cueVideoById',\n CueAndPlay = 'loadVideoById',\n Mute = 'mute',\n Unmute = 'unMute',\n SetVolume = 'setVolume',\n SetPlaybackRate = 'setPlaybackRate',\n SetPlaybackQuality = 'setPlaybackQuality',\n}\n\nexport interface YouTubeCommandArg {\n [YoutubeCommand.Play]: void;\n [YoutubeCommand.Pause]: void;\n [YoutubeCommand.Stop]: void;\n [YoutubeCommand.Seek]: number;\n [YoutubeCommand.Cue]: string;\n [YoutubeCommand.CueAndPlay]: string;\n [YoutubeCommand.Mute]: void;\n [YoutubeCommand.Unmute]: void;\n [YoutubeCommand.SetVolume]: number;\n [YoutubeCommand.SetPlaybackRate]: number;\n [YoutubeCommand.SetPlaybackQuality]: string;\n}\n\n/**\n * @see https://developers.google.com/youtube/iframe_api_reference#onStateChange\n */\nexport const enum YouTubePlayerState {\n Unstarted = -1,\n Ended = 0,\n Playing = 1,\n Paused = 2,\n Buffering = 3,\n Cued = 5,\n}\n\nexport interface YoutubeInternalState {\n duration: number;\n currentTime: number;\n videoId?: string;\n lastTimeUpdate: number;\n playbackRate: number;\n playbackReady: boolean;\n buffered: number;\n state: YouTubePlayerState;\n firedPlaybackEnd: boolean;\n}\n\nexport const enum YouTubePlaybackQuality {\n Unknown = 'unknown',\n Tiny = 'tiny',\n Small = 'small',\n Medium = 'medium',\n Large = 'large',\n Hd720 = 'hd720',\n Hd1080 = 'hd1080',\n Highres = 'highres',\n Max = 'max',\n}\n\nexport interface YouTubeMessage {\n channel: string;\n event: 'initialDelivery' | 'onReady' | 'infoDelivery' | 'apiInfoDelivery';\n info?: YoutubeMessageInfo;\n}\n\nexport interface YoutubeMessageInfo {\n availablePlaybackRates?: number[];\n availableQualityLevels?: YouTubePlaybackQuality[];\n currentTime?: number;\n currentTimeLastUpdated?: number;\n videoLoadedFraction?: number;\n volume?: number;\n videoUrl?: string;\n videoData?: {\n author: string;\n title: string;\n video_id: string;\n errorCode?: string;\n };\n duration?: number;\n muted?: boolean;\n playbackQuality?: YouTubePlaybackQuality;\n playbackRate?: number;\n playerState?: YouTubePlayerState;\n}\n\nexport interface YoutubeProviderError {\n code?: string;\n videoId?: string;\n}\n\nexport interface YoutubeProviderInternalApi {\n loadVideoById: (videoId: string) => void;\n}\n","import {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\nimport {findYoutubeVideosForTrack} from '@app/web-player/tracks/requests/find-youtube-videos-for-track';\nimport {MediaItem, YoutubeMediaItem} from '@common/player/media-item';\nimport {apiClient} from '@common/http/query-client';\nimport {Track} from '@app/web-player/tracks/track';\nimport {playerOverlayState} from '@app/web-player/state/player-overlay-store';\nimport {loadMediaItemTracks} from '@app/web-player/requests/load-media-item-tracks';\nimport {tracksToMediaItems} from '@app/web-player/tracks/utils/track-to-media-item';\nimport {PlayerStoreOptions} from '@common/player/state/player-store-options';\nimport {\n YouTubePlayerState,\n YoutubeProviderError,\n YoutubeProviderInternalApi,\n} from '@common/player/providers/youtube/youtube-types';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\n\n// used to track play history for logging plays on backend (prevents logging play twice, unless track is fully played)\nconst trackPlays = new Set();\n\n// this is needed in order to stop YouTube embed from trying to\n// cue a video that will error out while valid video is already playing\nconst failedVideoId = ' ';\n\n// list of video Ids for which YouTube embed errored out\nconst failedVideoIds = new Set();\nlet tracksSkippedDueToError = 0;\n\nasync function resolveSrc(\n media: YoutubeMediaItem\n): Promise {\n const results = await findYoutubeVideosForTrack(media.meta!);\n // Find first video ID that did not error out yet\n const match = results?.find(r => !failedVideoIds.has(`${r.id}`))?.id;\n return {\n ...media,\n src: match || failedVideoId,\n };\n}\n\nfunction setMediaSessionMetadata(media: MediaItem) {\n if ('mediaSession' in navigator) {\n const track = media.meta;\n if (!track) return;\n const image = track.image || track.album?.image;\n navigator.mediaSession.metadata = new MediaMetadata({\n title: track.name,\n artist: track.artists?.[0]?.name,\n album: track.album?.name,\n artwork: image\n ? [\n {\n src: image,\n sizes: '300x300',\n type: 'image/jpg',\n },\n ]\n : undefined,\n });\n }\n}\n\nexport const playerStoreOptions: Partial = {\n persistQueueInLocalStorage: true,\n defaultVolume: getBootstrapData().settings.player?.default_volume,\n setMediaSessionMetadata,\n youtube: {\n srcResolver: resolveSrc,\n onStateChange: state => {\n if (state === YouTubePlayerState.Playing) {\n tracksSkippedDueToError = 0;\n }\n },\n },\n onBeforePlay: () => {\n const player = getBootstrapData().settings.player;\n // on mobile, YouTube embed playback needs to be started via user gesture\n // on YouTube embed itself, starting it with custom play button will not work\n if (\n player?.mobile?.auto_open_overlay &&\n // check if mobile\n window.matchMedia('(max-width: 768px)').matches\n ) {\n playerOverlayState.open();\n // wait for overlay animation to complete\n return new Promise(resolve => setTimeout(() => resolve(), 151));\n }\n },\n loadMoreMediaItems: async media => {\n if (media?.groupId) {\n const tracks = await loadMediaItemTracks(\n media.groupId as string,\n media.meta\n );\n return tracksToMediaItems(tracks);\n }\n },\n listeners: {\n // change document title to currently cued track name\n cued: ({state: {cuedMedia}}) => {\n if (!cuedMedia) return;\n const site_name = getBootstrapData().settings.branding.site_name;\n let title = `${cuedMedia.meta.name}`;\n const artistName = cuedMedia.meta.artists?.[0].name;\n\n if (artistName) {\n title = `${title} - ${artistName} - ${site_name}`;\n } else {\n title = `${title} - ${site_name}`;\n }\n\n document.title = title;\n },\n play: ({state: {cuedMedia, pause}}) => {\n // prevent playback if user does not have permission to play music\n const hasPermission = userHasPlayPermission();\n if (!hasPermission) {\n toast.danger(\n message('Your current plan does not allow music playback.')\n );\n pause();\n return;\n }\n // log track play\n if (cuedMedia && !trackPlays.has(cuedMedia.meta.id)) {\n trackPlays.add(cuedMedia.meta.id);\n apiClient.post(`tracks/plays/${cuedMedia.meta.id}/log`, {\n queueId: cuedMedia.groupId,\n });\n }\n },\n playbackEnd: ({state: {cuedMedia}}) => {\n // clear track play\n if (cuedMedia) {\n trackPlays.delete(cuedMedia.meta.id);\n }\n },\n error: async ({\n sourceEvent,\n state: {cuedMedia, providerApi, providerName, emit},\n }) => {\n const e = sourceEvent as YoutubeProviderError;\n if (providerName === 'youtube' && providerApi) {\n //const provider = state.provider as YoutubeProvider;\n logYoutubeError(e);\n\n if (e.videoId) {\n failedVideoIds.add(`${e.videoId}`);\n }\n\n const media = cuedMedia\n ? await resolveSrc(cuedMedia as YoutubeMediaItem)\n : null;\n\n // try to play alternative videos we fetched\n if (media?.src && media?.src !== failedVideoId) {\n await (\n providerApi.internalProviderApi as YoutubeProviderInternalApi\n ).loadVideoById(media.src);\n providerApi.play();\n\n // there are no more alternative videos to try, we can error out\n } else {\n tracksSkippedDueToError++;\n\n // try to play up to two next queued tracks if we can't play\n // a video for this one. If we can't play 3 tracks in a row\n // we can assume there's an issue with YouTube API and bail\n if (tracksSkippedDueToError <= 2) {\n emit('playbackEnd');\n }\n }\n } else {\n tracksSkippedDueToError = 0;\n }\n },\n },\n onDestroy: () => {\n tracksSkippedDueToError = 0;\n },\n};\n\nfunction logYoutubeError(e: YoutubeProviderError) {\n const code = e?.code;\n if (!e || !e.videoId) return;\n apiClient.post('youtube/log-client-error', {\n code,\n videoUrl: e.videoId,\n });\n}\n\nfunction userHasPlayPermission(): boolean {\n const user = getBootstrapData().user;\n const guest_role = getBootstrapData().guest_role;\n const permissions = user?.permissions || guest_role?.permissions;\n return permissions?.find(p => p.name === 'music.play') != null;\n}\n","import {useSettings} from '@common/core/settings/use-settings';\nimport {Link, NavLink} from 'react-router-dom';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {useIsDarkMode} from '@common/ui/themes/use-is-dark-mode';\nimport {CustomMenu} from '@common/menus/custom-menu';\nimport {Trans} from '@common/i18n/trans';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {PlaylistAddIcon} from '@common/icons/material/PlaylistAdd';\nimport {ReactNode} from 'react';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {CreatePlaylistDialog} from '@app/web-player/playlists/crupdate-dialog/create-playlist-dialog';\nimport {useAuthUserPlaylists} from '@app/web-player/playlists/requests/use-auth-user-playlists';\nimport {getPlaylistLink} from '@app/web-player/playlists/playlist-link';\nimport clsx from 'clsx';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {useAuthClickCapture} from '@app/web-player/use-auth-click-capture';\n\nconst menuItemClassName = (isActive: boolean): string => {\n return clsx(\n 'h-44 px-12 mx-12 hover:bg-hover rounded-button',\n isActive && 'text-primary',\n );\n};\n\ninterface Props {\n className?: string;\n}\nexport function Sidenav({className}: Props) {\n return (\n
    \n \n menuItemClassName(isActive)}\n />\n
    \n \n \n \n menuItemClassName(isActive)}\n />\n \n
    \n
    \n );\n}\n\ninterface SectionTitleProps {\n children?: ReactNode;\n}\nfunction SectionTitle({children}: SectionTitleProps) {\n return (\n
    \n {children}\n
    \n );\n}\n\nfunction Logo() {\n const {branding} = useSettings();\n const {trans} = useTrans();\n const isDarkMode = useIsDarkMode();\n const logoUrl = isDarkMode ? branding.logo_light : branding.logo_dark;\n\n return (\n \n \n \n );\n}\n\nfunction PlaylistSection() {\n const {data} = useAuthUserPlaylists();\n const navigate = useNavigate();\n const authHandler = useAuthClickCapture();\n\n return (\n
    \n
    \n \n \n \n {\n if (newPlaylist) {\n navigate(getPlaylistLink(newPlaylist));\n }\n }}\n >\n \n \n \n \n \n
    \n {data?.playlists?.map(playlist => (\n \n clsx(menuItemClassName(isActive), 'flex items-center text-sm')\n }\n >\n
    \n {playlist.name}\n
    \n \n ))}\n
    \n );\n}\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\n\nexport function useIsMediaPlaying(\n mediaId: string | number,\n groupId?: string | number\n): boolean {\n return usePlayerStore(s => {\n return (\n s.isPlaying &&\n s.cuedMedia?.id === mediaId &&\n (!groupId || groupId === s.cuedMedia.groupId)\n );\n });\n}\n","import {useSettings} from '@common/core/settings/use-settings';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\n\nexport function useMiniPlayerIsHidden() {\n const {player} = useSettings();\n const mediaIsCued = usePlayerStore(s => s.cuedMedia != null);\n const isAudioProvider = usePlayerStore(s => s.providerName === 'htmlAudio');\n const isMobile = useIsMobileMediaQuery();\n return player?.hide_video || !mediaIsCued || isMobile || isAudioProvider;\n}\n","import {TrackContextDialog} from '@app/web-player/tracks/context-dialog/track-context-dialog';\nimport React from 'react';\nimport {MediaItem} from '@common/player/media-item';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {ContextMenuButton} from '@app/web-player/context-dialog/context-dialog-layout';\nimport {Trans} from '@common/i18n/trans';\n\ninterface Props {\n queueItems: MediaItem[];\n}\nexport function QueueTrackContextDialog({queueItems}: Props) {\n return (\n item.meta)}\n showAddToQueueButton={false}\n >\n {() => }\n
    \n );\n}\n\ninterface RemoveFromQueueContextButton {\n queueItems: MediaItem[];\n}\nfunction RemoveFromQueueContextButton({\n queueItems,\n}: RemoveFromQueueContextButton) {\n const {close: closeMenu} = useDialogContext();\n const player = usePlayerActions();\n\n return (\n {\n closeMenu();\n player.removeFromQueue(queueItems);\n }}\n >\n \n \n );\n}\n","import {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {MediaItem} from '@common/player/media-item';\nimport {Track} from '@app/web-player/tracks/track';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport clsx from 'clsx';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport React, {ReactElement, useState} from 'react';\nimport {message} from '@common/i18n/message';\nimport {PauseIcon} from '@common/icons/material/Pause';\nimport {EqualizerImage} from '@app/web-player/tracks/equalizer-image/equalizer-image';\nimport {PlayArrowFilledIcon} from '@app/web-player/tracks/play-arrow-filled';\nimport {useIsMediaPlaying} from '@common/player/hooks/use-is-media-playing';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {useMiniPlayerIsHidden} from '@app/web-player/overlay/use-mini-player-is-hidden';\nimport {QueueTrackContextDialog} from '@app/web-player/layout/queue/queue-track-context-dialog';\n\nexport function QueueSidenav() {\n const queue = usePlayerStore(s => s.shuffledQueue);\n const miniPlayerIsHidden = useMiniPlayerIsHidden();\n return (\n
    \n \n {queue.map((media: MediaItem, index) => (\n // same media.id might be multiple times in the queue, use index as well to avoid errors\n \n ))}\n
    \n \n );\n}\n\ninterface QueueItemProps {\n media: MediaItem;\n}\nfunction QueueItem({media}: QueueItemProps) {\n const isCued = usePlayerStore(s => s.cuedMedia?.id === media.id);\n const isPlaying = useIsMediaPlaying(media.id);\n const [isHover, setHover] = useState(false);\n\n if (!media.meta) {\n return null;\n }\n\n return (\n \n setHover(true)}\n onPointerLeave={() => setHover(false)}\n className={clsx(\n 'flex items-center gap-10 p-8 border-b',\n isCued && 'bg-primary/80 text-white',\n )}\n >\n
    \n \n {(isHover || isPlaying) && (\n \n )}\n
    \n
    \n
    \n {media.meta.name}\n
    \n \n
    \n \n \n
    \n );\n}\n\ninterface TogglePlaybackOverlayProps {\n media: MediaItem;\n isHover: boolean;\n}\nfunction TogglePlaybackOverlay({media, isHover}: TogglePlaybackOverlayProps) {\n const isPlaying = useIsMediaPlaying(media.id);\n const {trans} = useTrans();\n const player = usePlayerActions();\n\n if (!media.meta) {\n return null;\n }\n\n let button: ReactElement;\n\n if (isPlaying) {\n button = (\n player.pause()}\n >\n {isHover ? : }\n \n );\n } else {\n button = (\n player.play(media)}\n >\n \n \n );\n }\n\n return (\n
    \n {button}\n
    \n );\n}\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {Track} from '@app/web-player/tracks/track';\n\nexport function useCuedTrack(): Track | undefined {\n const media = usePlayerStore(s => s.cuedMedia);\n if (!media) return;\n return media.meta as Track;\n}\n","import {useEffect, useState} from 'react';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\n\nexport function useCurrentTime() {\n const {subscribe, getCurrentTime} = usePlayerActions();\n const providerKey = usePlayerStore(s =>\n s.providerName && s.cuedMedia?.id\n ? `${s.providerName}+${s.cuedMedia.id}`\n : null\n );\n\n const [currentTime, setCurrentTime] = useState(() => getCurrentTime());\n\n useEffect(() => {\n return subscribe({\n progress: ({currentTime}) => setCurrentTime(currentTime),\n });\n }, [subscribe]);\n\n // update current time when media or provider changes\n useEffect(() => {\n if (providerKey) {\n setCurrentTime(getCurrentTime());\n }\n }, [providerKey, getCurrentTime]);\n\n return currentTime;\n}\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaPlayIcon = createSvgIcon(\n ,\n 'MediaPlay',\n '0 0 32 32'\n);\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaPauseIcon = createSvgIcon(\n [,,],\n 'MediaPause',\n '0 0 32 32'\n);\n","import {IconButton} from '@common/ui/buttons/icon-button';\nimport {ButtonProps} from '@common/ui/buttons/button';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {MediaPlayIcon} from '@common/icons/media/media-play';\nimport {MediaPauseIcon} from '@common/icons/media/media-pause';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\nimport {Trans} from '@common/i18n/trans';\n\ninterface Props {\n color?: ButtonProps['color'];\n size?: ButtonProps['size'];\n iconSize?: ButtonProps['size'];\n className?: string;\n stopPropagation?: boolean;\n}\nexport function PlayButton({\n size = 'md',\n iconSize = 'xl',\n color,\n stopPropagation,\n}: Props) {\n const isPlaying = usePlayerStore(s => s.isPlaying);\n const playerReady = usePlayerStore(s => s.providerReady);\n const player = usePlayerActions();\n\n const label = isPlaying ? (\n \n ) : (\n \n );\n\n return (\n \n {\n if (stopPropagation) {\n e.stopPropagation();\n }\n if (isPlaying) {\n player.pause();\n } else {\n player.play();\n }\n }}\n >\n {isPlaying ? : }\n \n \n );\n}\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaPreviousIcon = createSvgIcon(\n [,,],\n 'MediaPrevious',\n '0 0 32 32'\n);\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {ButtonProps} from '@common/ui/buttons/button';\nimport {MediaPreviousIcon} from '@common/icons/media/media-previous';\nimport {Trans} from '@common/i18n/trans';\nimport React from 'react';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\n\ninterface Props {\n color?: ButtonProps['color'];\n size?: ButtonProps['size'];\n iconSize?: ButtonProps['size'];\n className?: string;\n stopPropagation?: boolean;\n}\nexport function PreviousButton({\n size = 'md',\n iconSize,\n color,\n className,\n stopPropagation,\n}: Props) {\n const player = usePlayerActions();\n const playerReady = usePlayerStore(s => s.providerReady);\n\n return (\n }>\n {\n if (stopPropagation) {\n e.stopPropagation();\n }\n player.playPrevious();\n }}\n >\n \n \n \n );\n}\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaNextIcon = createSvgIcon(\n [,,],\n 'MediaNext',\n '0 0 32 32'\n);\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {ButtonProps} from '@common/ui/buttons/button';\nimport {MediaNextIcon} from '@common/icons/media/media-next';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\nimport {Trans} from '@common/i18n/trans';\nimport React from 'react';\n\ninterface Props {\n color?: ButtonProps['color'];\n size?: ButtonProps['size'];\n iconSize?: ButtonProps['size'];\n className?: string;\n stopPropagation?: boolean;\n}\nexport function NextButton({\n size = 'md',\n iconSize,\n color,\n className,\n stopPropagation,\n}: Props) {\n const player = usePlayerActions();\n const playerReady = usePlayerStore(s => s.providerReady);\n\n return (\n } usePortal={false}>\n {\n if (stopPropagation) {\n e.stopPropagation();\n }\n player.playNext();\n }}\n >\n \n \n \n );\n}\n","import clsx from 'clsx';\nimport {useContext, useEffect, useState} from 'react';\nimport {PlayerStoreContext} from '@common/player/player-context';\nimport {isSearchingForYoutubeVideo} from '@app/web-player/tracks/requests/find-youtube-videos-for-track';\n\nexport function BufferingIndicator() {\n const store = useContext(PlayerStoreContext);\n\n const [isVisible, setIsVisible] = useState(false);\n const [animationActive, setAnimationActive] = useState(false);\n\n useEffect(() => {\n return store.subscribe(\n s => s.isBuffering,\n isBuffering => {\n const isLoading = isBuffering || isSearchingForYoutubeVideo;\n if (isLoading) {\n // make loader visible only after animation is running\n setAnimationActive(true);\n setTimeout(() => {\n setIsVisible(true);\n });\n } else {\n setIsVisible(false);\n }\n }\n );\n }, [store]);\n\n return (\n {\n // stop animation only after opacity transition is done to avoid flickering\n if (!isVisible) {\n setAnimationActive(false);\n }\n }}\n >\n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n","import {useCuedTrack} from '@app/web-player/player-controls/use-cued-track';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport React, {useMemo} from 'react';\nimport {ProgressBar} from '@common/ui/progress/progress-bar';\nimport {CustomMenuItem} from '@common/menus/custom-menu';\nimport clsx from 'clsx';\nimport {useCustomMenu} from '@common/menus/use-custom-menu';\nimport {Trans} from '@common/i18n/trans';\nimport {NavbarAuthMenu} from '@common/ui/navigation/navbar/navbar-auth-menu';\nimport {PersonIcon} from '@common/icons/material/Person';\nimport {Badge} from '@common/ui/badge/badge';\nimport {useAuth} from '@common/auth/use-auth';\nimport {\n Menu,\n MenuItem,\n MenuTrigger,\n} from '@common/ui/navigation/menu/menu-trigger';\nimport {Item} from '@common/ui/forms/listbox/item';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {playerOverlayState} from '@app/web-player/state/player-overlay-store';\nimport {usePrimaryArtistForCurrentUser} from '@app/web-player/backstage/use-primary-artist-for-current-user';\nimport {MicIcon} from '@common/icons/material/Mic';\nimport {getArtistLink} from '@app/web-player/artists/artist-link';\nimport {useCurrentTime} from '@common/player/hooks/use-current-time';\nimport {PlayButton} from '@common/player/ui/controls/play-button';\nimport {PreviousButton} from '@common/player/ui/controls/previous-button';\nimport {NextButton} from '@common/player/ui/controls/next-button';\nimport {BufferingIndicator} from '@app/web-player/player-controls/buffering-indicator';\n\nexport function MobilePlayerControls() {\n return (\n
    \n \n \n
    \n );\n}\n\nfunction PlayerControls() {\n const mediaIsCued = usePlayerStore(s => s.cuedMedia != null);\n if (!mediaIsCued) return null;\n\n return (\n {\n playerOverlayState.toggle();\n }}\n >\n \n \n \n \n );\n}\n\nfunction QueuedTrack() {\n const track = useCuedTrack();\n\n if (!track) {\n return null;\n }\n\n return (\n
    \n \n
    \n
    \n {track.name}\n
    \n
    \n {track.artists?.map(a => a.name).join(', ')}\n
    \n
    \n
    \n );\n}\n\nfunction PlaybackButtons() {\n return (\n
    \n \n
    \n \n \n
    \n \n
    \n );\n}\n\nfunction PlayerProgressBar() {\n const duration = usePlayerStore(s => s.mediaDuration);\n const currentTime = useCurrentTime();\n return (\n \n );\n}\n\nfunction MobileNavbar() {\n const menu = useCustomMenu('mobile-bottom');\n if (!menu) return null;\n\n return (\n
    \n {menu.items.map(item => (\n \n clsx(\n 'text-xs whitespace-nowrap overflow-hidden',\n isActive && 'font-bold'\n )\n }\n key={item.id}\n item={item}\n />\n ))}\n \n
    \n );\n}\n\nfunction AccountButton() {\n const {user} = useAuth();\n const hasUnreadNotif = !!user?.unread_notifications_count;\n const navigate = useNavigate();\n const {registration} = useSettings();\n\n const primaryArtist = usePrimaryArtistForCurrentUser();\n const {player} = useSettings();\n const menuItems = useMemo(() => {\n if (primaryArtist) {\n return [\n }\n onSelected={() => {\n navigate(getArtistLink(primaryArtist));\n }}\n >\n \n ,\n ];\n }\n if (player?.show_become_artist_btn) {\n return [\n }\n onSelected={() => {\n navigate('/backstage/requests');\n }}\n >\n \n ,\n ];\n }\n\n return [];\n }, [primaryArtist, navigate, player?.show_become_artist_btn]);\n\n const button = (\n \n );\n\n if (!user) {\n return (\n \n {button}\n \n navigate('/login')}>\n \n \n {!registration.disable && (\n navigate('/register')}>\n \n \n )}\n \n \n );\n }\n\n return {button};\n}\n","import {Slider} from '@common/ui/forms/slider/slider';\nimport {UseSliderProps} from '@common/ui/forms/slider/use-slider';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {useCurrentTime} from '@common/player/hooks/use-current-time';\nimport {useRef} from 'react';\n\ninterface Props {\n trackColor?: UseSliderProps['trackColor'];\n fillColor?: UseSliderProps['fillColor'];\n className?: string;\n onPointerMove?: UseSliderProps['onPointerMove'];\n}\nexport function Seekbar({\n trackColor,\n fillColor,\n className,\n onPointerMove,\n}: Props) {\n const {pause, seek, setIsSeeking, play, getState} = usePlayerActions();\n const duration = usePlayerStore(s => s.mediaDuration);\n const playerReady = usePlayerStore(s => s.providerReady);\n const pauseWhileSeeking = usePlayerStore(s => s.pauseWhileSeeking);\n\n const currentTime = useCurrentTime();\n\n const wasPlayingBeforeDragging = useRef(false);\n\n return (\n {\n setIsSeeking(true);\n if (pauseWhileSeeking) {\n wasPlayingBeforeDragging.current =\n getState().isPlaying || getState().isBuffering;\n pause();\n }\n }}\n onChange={value => {\n getState().emit('progress', {currentTime: value});\n seek(value);\n }}\n onChangeEnd={() => {\n setIsSeeking(false);\n if (pauseWhileSeeking && wasPlayingBeforeDragging.current) {\n play();\n wasPlayingBeforeDragging.current = false;\n }\n }}\n />\n );\n}\n","import {useCurrentTime} from '@common/player/hooks/use-current-time';\nimport {FormattedDuration} from '@common/i18n/formatted-duration';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\n\ninterface Props {\n className?: string;\n}\nexport function FormattedCurrentTime({className}: Props) {\n const duration = usePlayerStore(s => s.mediaDuration);\n const currentTime = useCurrentTime();\n return (\n \n = 600}\n />\n \n );\n}\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {FormattedDuration} from '@common/i18n/formatted-duration';\n\ninterface Props {\n className?: string;\n}\nexport function FormattedPlayerDuration({className}: Props) {\n const duration = usePlayerStore(s => s.mediaDuration);\n return (\n \n = 600}\n />\n \n );\n}\n","import {Fragment} from 'react';\nimport {Seekbar} from '@common/player/ui/controls/seeking/seekbar';\nimport {FormattedCurrentTime} from '@common/player/ui/controls/formatted-current-time';\nimport {FormattedPlayerDuration} from '@common/player/ui/controls/formatted-player-duration';\n\nexport function MainSeekbar() {\n return (\n \n
    \n
    \n \n
    \n \n
    \n \n
    \n
    \n
    \n );\n}\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaShuffleIcon = createSvgIcon(\n ,\n 'MediaShuffle',\n '0 0 32 32'\n);\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaShuffleOnIcon = createSvgIcon(\n [,,],\n 'MediaShuffleOn',\n '0 0 32 32'\n);\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {ButtonProps} from '@common/ui/buttons/button';\nimport {MediaShuffleIcon} from '@common/icons/media/media-shuffle';\nimport {MediaShuffleOnIcon} from '@common/icons/media/media-shuffle-on';\nimport {Trans} from '@common/i18n/trans';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\n\ninterface Props {\n color?: ButtonProps['color'];\n activeColor?: ButtonProps['color'];\n size?: ButtonProps['size'];\n iconSize?: ButtonProps['size'];\n className?: string;\n}\nexport function ShuffleButton({\n size = 'md',\n iconSize,\n color,\n activeColor = 'primary',\n className,\n}: Props) {\n const playerReady = usePlayerStore(s => s.providerReady);\n const isShuffling = usePlayerStore(s => s.shuffling);\n const player = usePlayerActions();\n\n const label = isShuffling ? (\n \n ) : (\n \n );\n\n return (\n \n {\n player.toggleShuffling();\n }}\n >\n {isShuffling ? : }\n \n \n );\n}\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaRepeatIcon = createSvgIcon(\n [,,],\n 'MediaRepeat',\n '0 0 32 32'\n);\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaRepeatOnIcon = createSvgIcon(\n [,,,],\n 'MediaRepeatOn',\n '0 0 32 32'\n);\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {ButtonProps} from '@common/ui/buttons/button';\nimport {MediaRepeatIcon} from '@common/icons/media/media-repeat';\nimport {MediaRepeatOnIcon} from '@common/icons/media/media-repeat-on';\nimport {Trans} from '@common/i18n/trans';\nimport {ReactElement} from 'react';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\n\ninterface Props {\n color?: ButtonProps['color'];\n activeColor?: ButtonProps['color'];\n size?: ButtonProps['size'];\n iconSize?: ButtonProps['size'];\n className?: string;\n}\nexport function RepeatButton({\n size = 'md',\n iconSize,\n color,\n activeColor = 'primary',\n className,\n}: Props) {\n const playerReady = usePlayerStore(s => s.providerReady);\n const repeating = usePlayerStore(s => s.repeat);\n const player = usePlayerActions();\n\n let label: ReactElement;\n if (repeating === 'all') {\n label = ;\n } else if (repeating === 'one') {\n label = ;\n } else {\n label = ;\n }\n\n return (\n \n {\n player.toggleRepeatMode();\n }}\n >\n {repeating === 'one' ? : }\n \n \n );\n}\n","import {MainSeekbar} from '@app/web-player/player-controls/seekbar/main-seekbar';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\nimport clsx from 'clsx';\nimport {PlayButton} from '@common/player/ui/controls/play-button';\nimport {NextButton} from '@common/player/ui/controls/next-button';\nimport {PreviousButton} from '@common/player/ui/controls/previous-button';\nimport {ShuffleButton} from '@common/player/ui/controls/shuffle-button';\nimport {RepeatButton} from '@common/player/ui/controls/repeat-button';\nimport {BufferingIndicator} from '@app/web-player/player-controls/buffering-indicator';\n\ninterface Props {\n className?: string;\n}\nexport function PlaybackControls({className}: Props) {\n return (\n
    \n \n \n
    \n );\n}\n\nfunction PlaybackButtons() {\n const isMobile = useIsMobileMediaQuery();\n\n // need to add a gap on mobile between buttons and seekbar, otherwise seekbar will be impossible to tap\n return (\n \n \n \n
    \n \n \n
    \n \n \n \n );\n}\n","import {useSettings} from '@common/core/settings/use-settings';\nimport {useCuedTrack} from '@app/web-player/player-controls/use-cued-track';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {LyricsDialog} from '@app/web-player/tracks/lyrics/lyrics-dialog';\nimport {MediaMicrophoneIcon} from '@common/icons/media/media-microphone';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\nimport {Trans} from '@common/i18n/trans';\n\nexport function LyricsButton() {\n const {player} = useSettings();\n const track = useCuedTrack();\n\n if (!track || player?.hide_lyrics) {\n return null;\n }\n\n return (\n \n }>\n \n \n \n \n \n \n );\n}\n","import {useSettings} from '@common/core/settings/use-settings';\nimport {useCuedTrack} from '@app/web-player/player-controls/use-cued-track';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {trackIsLocallyUploaded} from '@app/web-player/tracks/utils/track-is-locally-uploaded';\nimport {DownloadIcon} from '@common/icons/material/Download';\nimport {downloadFileFromUrl} from '@common/uploads/utils/download-file-from-url';\nimport {useAuth} from '@common/auth/use-auth';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\nimport {Trans} from '@common/i18n/trans';\n\nexport function DownloadTrackButton() {\n const {player, base_url} = useSettings();\n const track = useCuedTrack();\n const {hasPermission} = useAuth();\n\n if (\n !player?.enable_download ||\n !track ||\n !trackIsLocallyUploaded(track) ||\n !hasPermission('music.download')\n ) {\n return null;\n }\n\n return (\n }>\n {\n downloadFileFromUrl(`${base_url}/api/v1/tracks/${track.id}/download`);\n }}\n >\n \n \n \n );\n}\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaQueueListIcon = createSvgIcon(\n [,,,],\n 'MediaQueueList',\n '0 0 32 32'\n);\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaMuteIcon = createSvgIcon(\n [,,],\n 'MediaMute',\n '0 0 32 32'\n);\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaVolumeLowIcon = createSvgIcon(\n [,,],\n 'MediaVolumeLow',\n '0 0 32 32'\n);\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaVolumeHighIcon = createSvgIcon(\n [,,,],\n 'MediaVolumeHigh',\n '0 0 32 32'\n);\n","import {Slider} from '@common/ui/forms/slider/slider';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {BaseSliderProps} from '@common/ui/forms/slider/base-slider';\nimport {ButtonProps} from '@common/ui/buttons/button';\nimport {MediaMuteIcon} from '@common/icons/media/media-mute';\nimport {MediaVolumeLowIcon} from '@common/icons/media/media-volume-low';\nimport {MediaVolumeHighIcon} from '@common/icons/media/media-volume-high';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\nimport {Trans} from '@common/i18n/trans';\nimport clsx from 'clsx';\n\ninterface Props {\n trackColor?: BaseSliderProps['trackColor'];\n fillColor?: BaseSliderProps['fillColor'];\n buttonColor?: ButtonProps['color'];\n className?: string;\n}\nexport function VolumeControls({\n trackColor,\n fillColor,\n buttonColor,\n className,\n}: Props) {\n const volume = usePlayerStore(s => s.volume);\n const player = usePlayerActions();\n const playerReady = usePlayerStore(s => s.providerReady);\n\n return (\n
    \n \n {\n player.setVolume(value);\n }}\n />\n
    \n );\n}\n\ninterface ToggleMuteButtonProps {\n color?: ButtonProps['color'];\n size?: ButtonProps['size'];\n iconSize?: ButtonProps['size'];\n}\nexport function ToggleMuteButton({\n color,\n size = 'sm',\n iconSize = 'md',\n}: ToggleMuteButtonProps) {\n const isMuted = usePlayerStore(s => s.muted);\n const volume = usePlayerStore(s => s.volume);\n const player = usePlayerActions();\n const playerReady = usePlayerStore(s => s.providerReady);\n\n if (isMuted) {\n return (\n } usePortal={false}>\n player.setMuted(false)}\n >\n \n \n \n );\n }\n return (\n }>\n player.setMuted(true)}\n >\n {volume < 40 ? : }\n \n \n );\n}\n","import {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {ReactNode, useContext} from 'react';\nimport {useCuedTrack} from '@app/web-player/player-controls/use-cued-track';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {PlaybackControls} from '@app/web-player/player-controls/playback-controls';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {LikeIconButton} from '@app/web-player/library/like-icon-button';\nimport {DashboardLayoutContext} from '@common/ui/layout/dashboard-layout-context';\nimport {\n playerOverlayState,\n usePlayerOverlayStore,\n} from '@app/web-player/state/player-overlay-store';\nimport {KeyboardArrowDownIcon} from '@common/icons/material/KeyboardArrowDown';\nimport {KeyboardArrowUpIcon} from '@common/icons/material/KeyboardArrowUp';\nimport {LyricsButton} from '@app/web-player/player-controls/lyrics-button';\nimport {DownloadTrackButton} from '@app/web-player/player-controls/download-track-button';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {getTrackLink, TrackLink} from '@app/web-player/tracks/track-link';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {TrackContextDialog} from '@app/web-player/tracks/context-dialog/track-context-dialog';\nimport {Link} from 'react-router-dom';\nimport {ArtistContextDialog} from '@app/web-player/artists/artist-context-dialog';\nimport {MediaQueueListIcon} from '@common/icons/media/media-queue-list';\nimport {VolumeControls} from '@common/player/ui/controls/volume-controls';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\nimport {Trans} from '@common/i18n/trans';\n\nexport function DesktopPlayerControls() {\n const mediaIsCued = usePlayerStore(s => s.cuedMedia != null);\n if (!mediaIsCued) return null;\n\n return (\n
    \n \n \n \n
    \n );\n}\n\nfunction QueuedTrack() {\n const track = useCuedTrack();\n let content: ReactNode;\n\n if (track) {\n content = (\n
    \n \n \n \n \n \n \n
    \n \n \n \n \n {track.artists?.length ? (\n \n
    \n \n
    \n \n
    \n ) : null}\n
    \n \n
    \n );\n } else {\n content = null;\n }\n\n return
    {content}
    ;\n}\n\nfunction SecondaryControls() {\n const {rightSidenavStatus, setRightSidenavStatus} = useContext(\n DashboardLayoutContext,\n );\n return (\n
    \n \n \n }>\n {\n setRightSidenavStatus(\n rightSidenavStatus === 'closed' ? 'open' : 'closed',\n );\n }}\n >\n \n \n \n \n \n
    \n );\n}\n\nfunction OverlayButton() {\n const isActive = usePlayerOverlayStore(s => s.isMaximized);\n const playerReady = usePlayerStore(s => s.providerReady);\n const {player} = useSettings();\n\n if (player?.hide_video_button) {\n return null;\n }\n\n return (\n }>\n {\n playerOverlayState.toggle();\n }}\n >\n {isActive ? : }\n \n \n );\n}\n","export function isNumber(value: any): value is number {\n return typeof value === 'number' && !Number.isNaN(value);\n}\n","/**\n * Load image avoiding xhr/fetch CORS issues. Server status can't be obtained this way\n * unfortunately, so this uses \"naturalWidth\" to determine if the image has been loaded. By\n * default, it checks if it is at least 1px.\n */\nexport const loadImage = (\n src: string,\n minWidth = 1\n): Promise =>\n new Promise((resolve, reject) => {\n const image = new Image();\n const handler = () => {\n // @ts-expect-error\n delete image.onload;\n // @ts-expect-error\n delete image.onerror;\n if (image.naturalWidth >= minWidth) {\n resolve(image);\n } else {\n reject('Could not load youtube image');\n }\n };\n Object.assign(image, {onload: handler, onerror: handler, src});\n });\n","import {loadImage} from '@common/utils/http/load-image';\n\nconst posterCache = new Map();\n\nexport async function loadYoutubePoster(\n videoId: string\n): Promise {\n if (!videoId) return;\n if (posterCache.has(videoId)) {\n return posterCache.get(videoId);\n }\n\n const posterURL = (quality: string) =>\n `https://i.ytimg.com/vi/${videoId}/${quality}.jpg`;\n\n /**\n * We are testing that the image has a min-width of 121px because if the thumbnail does not\n * exist YouTube returns a blank/error image that is 120px wide.\n */\n return loadImage(posterURL('maxresdefault'), 121) // 1080p (no padding)\n .catch(() => loadImage(posterURL('sddefault'), 121)) // 640p (padded 4:3)\n .catch(() => loadImage(posterURL('hqdefault'), 121)) // 480p (padded 4:3)\n .catch(() => {})\n .then(img => {\n if (!img) return;\n const poster = img.src;\n posterCache.set(videoId, poster);\n return poster;\n });\n}\n","import {\n YoutubeInternalState,\n YouTubeMessage,\n YoutubeMessageInfo,\n YouTubePlayerState,\n YoutubeProviderError,\n} from '@common/player/providers/youtube/youtube-types';\nimport {MutableRefObject, RefObject} from 'react';\nimport {PlayerStoreApi} from '@common/player/state/player-state';\nimport {isNumber} from '@common/utils/number/is-number';\nimport {loadYoutubePoster} from '@common/player/providers/youtube/load-youtube-poster';\n\nexport function handleYoutubeEmbedMessage(\n e: MessageEvent,\n internalStateRef: MutableRefObject,\n iframeRef: RefObject,\n store: PlayerStoreApi\n) {\n const data = (\n typeof e.data === 'string' ? JSON.parse(e.data) : e.data\n ) as YouTubeMessage;\n const info = data.info;\n const internalState = internalStateRef.current;\n const emit = store.getState().emit;\n if (!info) return;\n\n if (info.videoData?.video_id) {\n internalState.videoId = info.videoData.video_id;\n }\n\n if (info.videoData?.errorCode) {\n const event: YoutubeProviderError = {\n code: info.videoData.errorCode,\n videoId: internalState.videoId,\n };\n emit('error', {sourceEvent: event});\n }\n\n if (isNumber(info.duration) && info.duration !== internalState.duration) {\n internalState.duration = info.duration;\n emit('durationChange', {duration: internalState.duration});\n }\n\n if (\n isNumber(info.currentTime) &&\n info.currentTime !== internalState.currentTime\n ) {\n internalState.currentTime = info.currentTime;\n // don't fire progress events while seeking via seekbar\n if (!store.getState().isSeeking) {\n emit('progress', {currentTime: internalState.currentTime});\n }\n }\n\n if (isNumber(info.currentTimeLastUpdated)) {\n internalState.lastTimeUpdate = info.currentTimeLastUpdated;\n }\n\n if (isNumber(info.playbackRate)) {\n if (internalState.playbackRate !== info.playbackRate) {\n emit('playbackRateChange', {rate: info.playbackRate});\n }\n internalState.playbackRate = info.playbackRate;\n }\n\n if (isNumber(info.videoLoadedFraction)) {\n const buffered = info.videoLoadedFraction * internalState.duration;\n if (internalState.buffered !== buffered) {\n emit('buffered', {\n seconds: info.videoLoadedFraction * internalState.duration,\n });\n }\n internalState.buffered = buffered;\n }\n\n if (Array.isArray(info.availablePlaybackRates)) {\n emit('playbackRates', {rates: info.availablePlaybackRates});\n }\n\n if (isNumber(info.playerState)) {\n onYoutubeStateChange(info, internalStateRef, iframeRef, store);\n internalState.state = info.playerState;\n }\n}\n\nfunction onYoutubeStateChange(\n info: YoutubeMessageInfo,\n internalStateRef: MutableRefObject,\n iframeRef: RefObject,\n store: PlayerStoreApi\n) {\n const emit = store.getState().emit;\n const state = info.playerState!;\n\n const onCued = async () => {\n // load poster, if needed\n if (info.videoData?.video_id && !store.getState().cuedMedia?.poster) {\n const url = await loadYoutubePoster(info.videoData.video_id);\n if (url) {\n store.getState().emit('posterLoaded', {url});\n }\n }\n\n // mark provider as ready\n if (!internalStateRef.current.playbackReady) {\n emit('providerReady', {el: iframeRef.current!});\n internalStateRef.current.playbackReady = true;\n }\n emit('cued');\n };\n\n emit('youtubeStateChange', {state});\n emit('buffering', {isBuffering: state === YouTubePlayerState.Buffering});\n\n if (state !== YouTubePlayerState.Ended) {\n internalStateRef.current.firedPlaybackEnd = false;\n }\n\n switch (state) {\n case YouTubePlayerState.Unstarted:\n // When using autoplay, but autoplay fails, player will get \"unstarted\" event\n onCued();\n break;\n case YouTubePlayerState.Ended:\n // will sometimes fire twice without this, if player starts buffering as a result of seek to the end\n if (!internalStateRef.current.firedPlaybackEnd) {\n emit('playbackEnd');\n internalStateRef.current.firedPlaybackEnd = true;\n }\n break;\n case YouTubePlayerState.Playing:\n // When using autoplay, \"cued\" event is never fired, handle \"cued\" here instead\n onCued();\n emit('play');\n break;\n case YouTubePlayerState.Paused:\n emit('pause');\n break;\n case YouTubePlayerState.Cued:\n onCued();\n break;\n }\n}\n","export function youtubeIdFromSrc(src: string) {\n return src.match(/((?:\\w|-){11})/)?.[0];\n}\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {useCallback, useEffect, useState} from 'react';\nimport {YoutubeMediaItem} from '@common/player/media-item';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {youtubeIdFromSrc} from '@common/player/utils/youtube-id-from-src';\n\nconst queryString =\n '&controls=0&disablekb=1&enablejsapi=1&iv_load_policy=3&modestbranding=1&playsinline=1&rel=0&showinfo=0';\n\nexport function useYoutubeProviderSrc(\n loadVideoById: (videoId: string) => void\n) {\n const {getState, emit} = usePlayerActions();\n const options = usePlayerStore(s => s.options);\n const media = usePlayerStore(s => s.cuedMedia) as\n | YoutubeMediaItem\n | undefined;\n\n const origin = options.youtube?.useCookies\n ? 'https://www.youtube.com'\n : 'https://www.youtube-nocookie.com';\n\n const [initialVideoId, setInitialVideoId] = useState(() => {\n if (media?.src && media.src !== 'resolve') {\n return youtubeIdFromSrc(media.src);\n }\n });\n\n const updateVideoIds = useCallback(\n (src: string) => {\n const videoId = youtubeIdFromSrc(src);\n if (!videoId) return;\n\n // use setState callback, so we don't need to use \"initialVideoId\" in the dependency array\n setInitialVideoId(prevId => {\n if (!prevId) {\n return videoId;\n } else {\n // changing src of iframe will cause it to fully reload, use \"loadVideoById\" api method instead\n loadVideoById(videoId);\n return prevId;\n }\n });\n },\n [loadVideoById]\n );\n\n useEffect(() => {\n if (media?.src && media.src !== 'resolve') {\n updateVideoIds(media.src);\n } else if (media) {\n emit('buffering', {isBuffering: true});\n options.youtube?.srcResolver?.(media).then(item => {\n // check if resolved media matches the one currently in the store to prevent race conditions.\n // check against current value in store, because this callback will close over old value\n if (item?.src && getState().cuedMedia?.id === item.id) {\n updateVideoIds(item.src);\n }\n });\n }\n // only update when media id changes to prevent infinite loops\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [options, updateVideoIds, media?.id]);\n\n return {\n initialVideoUrl: initialVideoId\n ? `${origin}/embed/${initialVideoId}?${queryString}&autoplay=${\n options.autoPlay ? '1' : '0'\n }&mute=${getState().muted ? '1' : '0'}&start=${media?.initialTime ?? 0}`\n : undefined,\n origin,\n };\n}\n","import {useGlobalListeners} from '@react-aria/utils';\nimport {useCallback, useContext, useEffect, useRef} from 'react';\nimport {PlayerStoreContext} from '@common/player/player-context';\nimport {\n YoutubeCommand,\n YouTubeCommandArg,\n YoutubeInternalState,\n YoutubeProviderInternalApi,\n} from '@common/player/providers/youtube/youtube-types';\nimport {handleYoutubeEmbedMessage} from '@common/player/providers/youtube/handle-youtube-embed-message';\nimport {useYoutubeProviderSrc} from '@common/player/providers/youtube/use-youtube-provider-src';\n\nexport function YoutubeProvider() {\n const {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\n const iframeRef = useRef(null);\n\n const youtubeApi = useCallback(\n (\n command: T,\n arg?: YouTubeCommandArg[T]\n ) =>\n iframeRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: 'command',\n func: command,\n args: arg ? [arg] : undefined,\n }),\n '*'\n ),\n []\n );\n\n const loadVideoById = useCallback(\n (videoId: string) => {\n // using \"YoutubeCommand.Cue\" does not play video when changing sources,\n // it requires double click on play button without this\n youtubeApi(YoutubeCommand.CueAndPlay, videoId);\n },\n [youtubeApi]\n );\n\n const {initialVideoUrl, origin} = useYoutubeProviderSrc(loadVideoById);\n const store = useContext(PlayerStoreContext);\n\n const internalStateRef = useRef({\n duration: 0,\n currentTime: 0,\n lastTimeUpdate: 0,\n playbackRate: 1,\n state: -1,\n playbackReady: false,\n buffered: 0,\n firedPlaybackEnd: false,\n });\n\n const registerApi = useCallback(() => {\n const internalProviderApi: YoutubeProviderInternalApi = {\n loadVideoById,\n };\n store.setState({\n providerApi: {\n play: () => {\n youtubeApi(YoutubeCommand.Play);\n },\n pause: () => {\n youtubeApi(YoutubeCommand.Pause);\n },\n stop: () => {\n youtubeApi(YoutubeCommand.Stop);\n },\n seek: (time: number) => {\n if (time !== internalStateRef.current.currentTime) {\n youtubeApi(YoutubeCommand.Seek, time);\n }\n },\n setVolume: (volume: number) => {\n youtubeApi(YoutubeCommand.SetVolume, volume);\n },\n setMuted: (muted: boolean) => {\n if (muted) {\n youtubeApi(YoutubeCommand.Mute);\n } else {\n youtubeApi(YoutubeCommand.Unmute);\n }\n },\n setPlaybackRate: (value: number) => {\n youtubeApi(YoutubeCommand.SetPlaybackRate, value);\n },\n setPlaybackQuality: (value: string) => {\n youtubeApi(YoutubeCommand.SetPlaybackQuality, value);\n },\n getCurrentTime: () => {\n return internalStateRef.current.currentTime;\n },\n getSrc: () => {\n return internalStateRef.current.videoId;\n },\n internalProviderApi,\n },\n });\n }, [store, loadVideoById, youtubeApi]);\n\n useEffect(() => {\n addGlobalListener(window, 'message', event => {\n const e = event as MessageEvent;\n if (\n e.origin === origin &&\n e.source === iframeRef.current?.contentWindow\n ) {\n handleYoutubeEmbedMessage(e, internalStateRef, iframeRef, store);\n }\n });\n\n registerApi();\n\n return () => {\n removeAllGlobalListeners();\n };\n }, [addGlobalListener, removeAllGlobalListeners, store, origin, registerApi]);\n\n if (!initialVideoUrl) {\n return null;\n }\n\n return (\n {\n // window does not receive \"message\" events on safari without waiting a small amount of time for some reason\n setTimeout(() => {\n iframeRef.current?.contentWindow?.postMessage(\n JSON.stringify({event: 'listening'}),\n '*'\n );\n registerApi();\n });\n }}\n />\n );\n}\n","export function createRafLoop(callback: () => void) {\n let id: number | undefined;\n\n function start() {\n // Time updates are already in progress.\n if (!isUndefined(id)) return;\n loop();\n }\n\n function loop() {\n id = window.requestAnimationFrame(function rafLoop() {\n if (isUndefined(id)) return;\n callback();\n loop();\n });\n }\n\n function stop() {\n if (isNumber(id)) window.cancelAnimationFrame(id);\n id = undefined;\n }\n\n return {\n start,\n stop,\n };\n}\n\nfunction isUndefined(value: unknown): value is undefined {\n return typeof value === 'undefined';\n}\n\nfunction isNumber(value: any): value is number {\n return typeof value === 'number' && !Number.isNaN(value);\n}\n","import {\n MutableRefObject,\n RefObject,\n useCallback,\n useContext,\n useEffect,\n useRef,\n} from 'react';\nimport {createRafLoop} from '@common/utils/dom/create-ref-loop';\nimport {PlayerStoreContext} from '@common/player/player-context';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\n\nexport interface HtmlMediaInternalStateReturn {\n ref: RefObject;\n updateCurrentTime: () => void;\n updateBuffered: () => void;\n toggleTextTrackModes: (newTrackId: number, isVisible: boolean) => void;\n internalState: MutableRefObject<{\n currentTime: number;\n playbackReady: boolean;\n timeRafLoop: ReturnType;\n }>;\n}\n\nexport function useHtmlMediaInternalState(\n ref: RefObject\n): HtmlMediaInternalStateReturn {\n const store = useContext(PlayerStoreContext);\n const cuedMedia = usePlayerStore(s => s.cuedMedia);\n\n const internalState = useRef({\n currentTime: 0,\n buffered: 0,\n isMediaWaiting: false,\n playbackReady: false,\n /**\n * The `timeupdate` event fires surprisingly infrequently during playback, meaning your progress\n * bar (or whatever else is synced to the currentTime) moves in a choppy fashion. This helps\n * resolve that by retrieving time updates in a request animation frame loop.\n */\n timeRafLoop: createRafLoop(() => {\n updateCurrentTime();\n updateBuffered();\n }),\n });\n\n const updateBuffered = useCallback(() => {\n const timeRange = ref.current?.buffered;\n const seconds =\n !timeRange || timeRange.length === 0\n ? 0\n : timeRange.end(timeRange.length - 1);\n\n if (internalState.current.buffered !== seconds) {\n store.getState().emit('buffered', {seconds});\n internalState.current.buffered = seconds;\n }\n }, [ref, store]);\n\n const updateCurrentTime = useCallback(() => {\n const newTime = ref.current?.currentTime || 0;\n if (\n internalState.current.currentTime !== newTime &&\n !store.getState().isSeeking\n ) {\n store.getState().emit('progress', {currentTime: newTime});\n internalState.current.currentTime = newTime;\n }\n }, [internalState, store, ref]);\n\n const toggleTextTrackModes = useCallback(\n (newTrackId: number, isVisible: boolean) => {\n if (!ref.current) return;\n const {textTracks} = ref.current;\n\n if (newTrackId === -1) {\n Array.from(textTracks).forEach(track => {\n track.mode = 'disabled';\n });\n } else {\n const oldTrack = textTracks[store.getState().currentTextTrack];\n if (oldTrack) oldTrack.mode = 'disabled';\n }\n\n const nextTrack = textTracks[newTrackId];\n\n if (nextTrack) {\n nextTrack.mode = isVisible ? 'showing' : 'hidden';\n }\n\n store.getState().emit('currentTextTrackChange', {\n trackId: !isVisible ? -1 : newTrackId,\n });\n store\n .getState()\n .emit('textTrackVisibilityChange', {isVisible: isVisible});\n },\n [ref, store]\n );\n\n // stop current time loop on unmount\n useEffect(() => {\n const timeRafLoop = internalState.current.timeRafLoop;\n return () => {\n timeRafLoop.stop();\n };\n }, []);\n\n // reload metadata when new media is cued\n useEffect(() => {\n ref.current?.load();\n }, [cuedMedia?.src, ref]);\n\n return {\n ref,\n internalState,\n updateCurrentTime,\n toggleTextTrackModes,\n updateBuffered,\n };\n}\n","import {\n HTMLAttributes,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n} from 'react';\nimport {PlayerStoreContext} from '@common/player/player-context';\nimport {HtmlMediaInternalStateReturn} from '@common/player/providers/html-media/use-html-media-internal-state';\n\nconst defaultPlaybackRates = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];\n\nexport function useHtmlMediaEvents({\n ref,\n updateCurrentTime,\n updateBuffered,\n internalState,\n}: HtmlMediaInternalStateReturn): HTMLAttributes {\n const store = useContext(PlayerStoreContext);\n\n const onTextTracksChange = useCallback(() => {\n if (!ref.current) return;\n const tracks = Array.from(ref.current.textTracks).filter(\n t => t.label && (t.kind === 'subtitles' || t.kind === 'captions')\n );\n\n let trackId = -1;\n for (let id = 0; id < tracks.length; id += 1) {\n if (tracks[id].mode === 'hidden') {\n // Do not break in case there is a following track with showing.\n trackId = id;\n } else if (tracks[id].mode === 'showing') {\n trackId = id;\n break;\n }\n }\n\n const isVisible = trackId !== -1 && tracks[trackId].mode === 'showing';\n store.getState().emit('currentTextTrackChange', {trackId});\n store.getState().emit('textTrackVisibilityChange', {isVisible});\n store.getState().emit('textTracks', {tracks});\n }, [ref, store]);\n\n useEffect(() => {\n const el = ref.current;\n return () => {\n el?.textTracks.removeEventListener('change', onTextTracksChange);\n };\n }, [ref, onTextTracksChange]);\n\n return useMemo(() => {\n const emit = store.getState().emit;\n return {\n // set some common props used on audio/video/hls/dash providers\n autoPlay: false,\n onContextMenu: e => e.preventDefault(),\n controlsList: 'nodownload',\n preload: 'metadata',\n 'x-webkit-airplay': 'allow',\n onEnded: () => {\n emit('playbackEnd');\n updateCurrentTime();\n internalState.current.timeRafLoop.stop();\n },\n onStalled: e => {\n if (e.currentTarget.readyState < 3) {\n emit('buffering', {isBuffering: true});\n }\n },\n onWaiting: () => {\n emit('buffering', {isBuffering: true});\n },\n onPlaying: () => {\n emit('play');\n emit('buffering', {isBuffering: false});\n },\n onPause: e => {\n emit('pause');\n emit('buffering', {isBuffering: false});\n internalState.current.timeRafLoop.stop();\n },\n onSuspend: () => {\n emit('buffering', {isBuffering: false});\n },\n onSeeking: () => {\n updateCurrentTime();\n },\n onSeeked: () => {\n updateCurrentTime();\n },\n onTimeUpdate: () => {\n updateCurrentTime();\n },\n onError: e => {\n emit('error', {sourceEvent: e});\n },\n onDurationChange: e => {\n updateCurrentTime();\n emit('durationChange', {duration: e.currentTarget.duration});\n },\n onRateChange: e => {\n emit('playbackRateChange', {rate: e.currentTarget.playbackRate});\n },\n onLoadedMetadata: e => {\n if (!internalState.current.playbackReady) {\n emit('providerReady', {el: e.currentTarget});\n internalState.current.playbackReady = true;\n updateBuffered();\n onTextTracksChange();\n e.currentTarget.textTracks.addEventListener('change', () => {\n onTextTracksChange();\n });\n }\n emit('cued');\n emit('playbackRates', {rates: defaultPlaybackRates});\n },\n };\n }, [\n internalState,\n store,\n updateCurrentTime,\n onTextTracksChange,\n updateBuffered,\n ]);\n}\n","import {HtmlMediaInternalStateReturn} from '@common/player/providers/html-media/use-html-media-internal-state';\nimport {useContext, useMemo} from 'react';\nimport {PlayerStoreContext} from '@common/player/player-context';\nimport {PlayerProviderApi} from '@common/player/state/player-provider-api';\n\nexport function useHtmlMediaApi({\n ref,\n internalState,\n toggleTextTrackModes,\n}: HtmlMediaInternalStateReturn): PlayerProviderApi {\n const store = useContext(PlayerStoreContext);\n return useMemo(\n () => ({\n play: async () => {\n try {\n await ref.current?.play();\n } catch (e) {\n store.getState().emit('error', {sourceEvent: e});\n }\n internalState.current.timeRafLoop.start();\n },\n pause: () => {\n ref.current?.pause();\n internalState.current.timeRafLoop.stop();\n },\n stop: () => {\n if (ref.current) {\n ref.current.pause();\n ref.current.currentTime = 0;\n }\n },\n seek: (time: number) => {\n if (time !== internalState.current.currentTime && ref.current) {\n ref.current.currentTime = time;\n }\n },\n setVolume: (volume: number) => {\n if (ref.current) {\n ref.current.volume = volume / 100;\n }\n },\n setMuted: (muted: boolean) => {\n if (ref.current) {\n ref.current.muted = muted;\n }\n },\n setPlaybackRate: (value: number) => {\n if (ref.current) {\n ref.current.playbackRate = value;\n }\n },\n setTextTrackVisibility: isVisible => {\n toggleTextTrackModes(store.getState().currentTextTrack, isVisible);\n },\n setCurrentTextTrack: newTrackId => {\n toggleTextTrackModes(newTrackId, store.getState().textTrackIsVisible);\n },\n getCurrentTime: () => {\n return internalState.current.currentTime;\n },\n getSrc: () => {\n return ref.current?.src;\n },\n }),\n [ref, store, internalState, toggleTextTrackModes]\n );\n}\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {useContext, useEffect, useRef} from 'react';\nimport {PlayerStoreContext} from '@common/player/player-context';\nimport {useHtmlMediaInternalState} from '@common/player/providers/html-media/use-html-media-internal-state';\nimport {useHtmlMediaEvents} from '@common/player/providers/html-media/use-html-media-events';\nimport {useHtmlMediaApi} from '@common/player/providers/html-media/use-html-media-api';\n\nexport function HtmlVideoProvider() {\n const ref = useRef(null);\n\n const autoPlay = usePlayerStore(s => s.options.autoPlay);\n const muted = usePlayerStore(s => s.muted);\n const cuedMedia = usePlayerStore(s => s.cuedMedia);\n const store = useContext(PlayerStoreContext);\n\n const state = useHtmlMediaInternalState(ref);\n const events = useHtmlMediaEvents(state);\n const providerApi = useHtmlMediaApi(state);\n\n useEffect(() => {\n store.setState({\n providerApi,\n });\n }, [store, providerApi]);\n\n let src = cuedMedia?.src;\n if (src && cuedMedia?.initialTime) {\n src = `${src}#t=${cuedMedia.initialTime}`;\n }\n\n return (\n \n {cuedMedia?.captions?.map((caption, index) => (\n \n ))}\n \n );\n}\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {useContext, useEffect, useRef} from 'react';\nimport {PlayerStoreContext} from '@common/player/player-context';\nimport {useHtmlMediaInternalState} from '@common/player/providers/html-media/use-html-media-internal-state';\nimport {useHtmlMediaEvents} from '@common/player/providers/html-media/use-html-media-events';\nimport {useHtmlMediaApi} from '@common/player/providers/html-media/use-html-media-api';\n\nexport function HtmlAudioProvider() {\n const ref = useRef(null);\n\n const autoPlay = usePlayerStore(s => s.options.autoPlay);\n const muted = usePlayerStore(s => s.muted);\n const cuedMedia = usePlayerStore(s => s.cuedMedia);\n const store = useContext(PlayerStoreContext);\n\n const state = useHtmlMediaInternalState(ref);\n const events = useHtmlMediaEvents(state);\n const providerApi = useHtmlMediaApi(state);\n\n useEffect(() => {\n store.setState({\n providerApi,\n });\n }, [store, providerApi]);\n\n let src = cuedMedia?.src;\n if (src && cuedMedia?.initialTime) {\n src = `${src}#t=${cuedMedia.initialTime}`;\n }\n\n return (\n \n );\n}\n","import React, {memo, Suspense, useContext, useEffect} from 'react';\nimport {PlayerStoreContext} from '@common/player/player-context';\nimport {YoutubeProvider} from '@common/player/providers/youtube/youtube-provider';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {HtmlVideoProvider} from '@common/player/providers/html-video-provider';\nimport {HtmlAudioProvider} from '@common/player/providers/html-audio-provider';\n\nconst HlsProvider = React.lazy(\n () => import('@common/player/providers/hls-provider')\n);\nconst DashProvider = React.lazy(\n () => import('@common/player/providers/dash-provider')\n);\n\ninterface Props {\n className?: string;\n}\nexport const PlayerOutlet = memo(({className}: Props) => {\n const {getState} = useContext(PlayerStoreContext);\n\n useEffect(() => {\n getState().init();\n return getState().destroy;\n }, [getState]);\n\n return (\n
    \n \n
    \n );\n});\n\nfunction Provider() {\n const provider = usePlayerStore(s => s.providerName);\n switch (provider) {\n case 'youtube':\n return ;\n case 'htmlVideo':\n return ;\n case 'htmlAudio':\n return ;\n case 'hls':\n return (\n \n \n \n );\n case 'dash':\n return (\n \n \n \n );\n default:\n return null;\n }\n}\n","import {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport clsx from 'clsx';\nimport {HTMLAttributes, ReactElement} from 'react';\n\ninterface Props extends HTMLAttributes {\n hideDuringPlayback?: boolean;\n fallback?: ReactElement;\n}\nexport function PlayerPoster({\n className,\n hideDuringPlayback = true,\n fallback,\n ...domProps\n}: Props) {\n const posterUrl = usePlayerStore(s => s.posterUrl);\n const shouldHidePoster = usePlayerStore(\n s =>\n hideDuringPlayback && s.playbackStarted && s.providerName !== 'htmlAudio',\n );\n if (!posterUrl && !fallback) return null;\n return (\n \n {posterUrl ? (\n \n ) : (\n fallback\n )}\n \n );\n}\n","import {createSvgIcon} from '@common/icons/create-svg-icon';\n\nexport const MediaFullscreenIcon = createSvgIcon(\n [,,,,],\n 'MediaFullscreen',\n '0 0 32 32'\n);\n","import {useCallback, useRef} from 'react';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\n\nexport function usePlayerClickHandler() {\n const clickRef = useRef(0);\n const player = usePlayerActions();\n\n const togglePlay = useCallback(() => {\n if (player.getState().isPlaying) {\n player.pause();\n } else {\n player.play();\n }\n }, [player]);\n\n return useCallback(() => {\n if (!player.getState().providerReady) return;\n clickRef.current += 1;\n togglePlay();\n if (clickRef.current === 1) {\n setTimeout(() => {\n if (clickRef.current > 1) {\n player.toggleFullscreen();\n }\n clickRef.current = 0;\n }, 300);\n }\n }, [player, togglePlay]);\n}\n","import React, {\n Fragment,\n MutableRefObject,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport clsx from 'clsx';\nimport {\n playerOverlayState,\n usePlayerOverlayStore,\n} from '@app/web-player/state/player-overlay-store';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {KeyboardArrowDownIcon} from '@common/icons/material/KeyboardArrowDown';\nimport {PlaybackControls} from '@app/web-player/player-controls/playback-controls';\nimport {useCuedTrack} from '@app/web-player/player-controls/use-cued-track';\nimport {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {LikeIconButton} from '@app/web-player/library/like-icon-button';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {TrackContextDialog} from '@app/web-player/tracks/context-dialog/track-context-dialog';\nimport {MoreVertIcon} from '@common/icons/material/MoreVert';\nimport fscreen from 'fscreen';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport {LyricsButton} from '@app/web-player/player-controls/lyrics-button';\nimport {useMediaQuery} from '@common/utils/hooks/use-media-query';\nimport {DownloadTrackButton} from '@app/web-player/player-controls/download-track-button';\nimport {TrackLink} from '@app/web-player/tracks/track-link';\nimport {useLocation} from 'react-router-dom';\nimport {usePrevious} from '@common/utils/hooks/use-previous';\nimport {PlayerOutlet} from '@common/player/ui/player-outlet';\nimport {PlayerPoster} from '@common/player/ui/controls/player-poster';\nimport {MediaFullscreenIcon} from '@common/icons/media/media-fullscreen';\nimport {MediaQueueListIcon} from '@common/icons/media/media-queue-list';\nimport {useMiniPlayerIsHidden} from '@app/web-player/overlay/use-mini-player-is-hidden';\nimport {usePlayerClickHandler} from '@common/player/hooks/use-player-click-handler';\nimport {QueueTrackContextDialog} from '@app/web-player/layout/queue/queue-track-context-dialog';\nimport {RowElementProps} from '@common/ui/tables/table-row';\nimport {Track} from '@app/web-player/tracks/track';\nimport {TableContext} from '@common/ui/tables/table-context';\nimport {MediaItem} from '@common/player/media-item';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\n\nexport function PlayerOverlay() {\n const isMobile = useMediaQuery('(max-width: 1024px)');\n const isMaximized = usePlayerOverlayStore(s => s.isMaximized);\n const isQueueOpen = usePlayerOverlayStore(s => s.isQueueOpen);\n const isFullscreen = usePlayerStore(s => s.isFullscreen);\n const miniPlayerIsHidden = useMiniPlayerIsHidden();\n const overlayRef = useRef(null);\n const {pathname} = useLocation();\n const playerClickHandler = usePlayerClickHandler();\n const haveVideo = usePlayerStore(\n s => s.providerApi != null && s.providerName !== 'htmlAudio',\n );\n const previousPathname = usePrevious(pathname);\n const cuedTrack = useCuedTrack();\n\n // close overlay when route changes\n useEffect(() => {\n if (isMaximized && previousPathname && pathname !== previousPathname) {\n playerOverlayState.toggle();\n }\n }, [pathname, previousPathname, isMaximized]);\n\n useEffect(() => {\n if (!isMaximized) return;\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n playerOverlayState.toggle();\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isMaximized]);\n\n return (\n \n {isMaximized && (\n
    \n playerOverlayState.toggle()}\n >\n \n \n {isMobile && }\n {isMobile && }\n playerOverlayState.toggleQueue()}\n color={isQueueOpen ? 'primary' : undefined}\n >\n \n \n \n
    \n )}\n {\n // native video will be put into fullscreen, it will already handle click and double click events\n if (!isFullscreen) {\n playerClickHandler();\n }\n }}\n className={clsx(\n 'relative min-h-0 max-w-full flex-auto',\n isMaximized ? 'mx-auto mt-auto px-14' : 'h-full w-full',\n isMaximized && haveVideo ? 'aspect-video' : 'aspect-square max-h-400',\n )}\n >\n \n ) : undefined\n }\n />\n \n \n \n \n {isMaximized && (\n \n \n \n \n )}\n {isMaximized && isQueueOpen && }\n \n );\n}\n\ninterface FullscreenButtonProps {\n overlayRef: MutableRefObject;\n}\nfunction FullscreenButton({overlayRef}: FullscreenButtonProps) {\n const playerReady = usePlayerStore(s => s.providerReady);\n return (\n {\n if (!overlayRef.current) return;\n if (fscreen.fullscreenElement) {\n fscreen.exitFullscreen();\n } else {\n fscreen.requestFullscreen(overlayRef.current);\n }\n }}\n >\n \n \n );\n}\n\nfunction QueuedTrack() {\n const track = useCuedTrack();\n\n if (!track) {\n return null;\n }\n\n return (\n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n \n \n \n \n \n
    \n );\n}\n\nfunction PlayerQueue() {\n const queue = usePlayerStore(s => s.shuffledQueue);\n const tracks = queue.map(item => item.meta);\n return (\n
    \n \n
    \n );\n}\n\nfunction PlayerQueueRow({item, children, ...domProps}: RowElementProps) {\n const queue = usePlayerStore(s => s.shuffledQueue);\n const {selectedRows} = useContext(TableContext);\n const queueItems = useMemo(() => {\n return selectedRows\n .map(trackId => queue.find(item => item.meta.id === trackId))\n .filter(t => !!t) as MediaItem[];\n }, [queue, selectedRows]);\n\n const row =
    {children}
    ;\n if (item.isPlaceholder) {\n return row;\n }\n\n return (\n \n {row}\n \n \n );\n}\n","import {keepPreviousData, useQuery} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Artist} from '@app/web-player/artists/artist';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {User} from '@common/auth/user';\nimport {Genre} from '@app/web-player/genres/genre';\nimport {Tag} from '@common/tags/tag';\nimport {Album} from '@app/web-player/albums/album';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\n\ninterface SearchParams {\n query?: string;\n loader: 'search' | 'searchPage';\n}\n\nexport interface SearchResponse extends BackendResponse {\n query: string;\n loader: SearchParams['loader'];\n results: {\n artists?: Artist[];\n albums?: Album[];\n tracks?: Track[];\n playlists?: Playlist[];\n users?: User[];\n genres?: Genre[];\n tags?: Tag[];\n };\n}\n\nexport function useSearchResults(params: SearchParams) {\n return useQuery({\n queryKey: ['search', params],\n queryFn: ({signal}) => search(params, signal),\n enabled: !!params.query,\n placeholderData: !!params.query ? keepPreviousData : undefined,\n initialData: () => {\n const data = getBootstrapData().loaders?.[params.loader];\n if (data?.query == params.query && data?.loader === params.loader) {\n return data;\n }\n return undefined;\n },\n });\n}\n\nasync function search(params: SearchParams, signal: AbortSignal) {\n await new Promise(resolve => setTimeout(resolve, 300));\n return apiClient\n .get(`search`, {params, signal})\n .then(response => response.data);\n}\n","import {SearchIcon} from '@common/icons/material/Search';\nimport {message} from '@common/i18n/message';\nimport {Item} from '@common/ui/forms/listbox/item';\nimport {ComboBox} from '@common/ui/forms/combobox/combobox';\nimport React, {cloneElement, ReactElement, useState} from 'react';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {useSearchResults} from '@app/web-player/search/requests/use-search-results';\nimport {ARTIST_MODEL} from '@app/web-player/artists/artist';\nimport {ALBUM_MODEL} from '@app/web-player/albums/album';\nimport {TRACK_MODEL} from '@app/web-player/tracks/track';\nimport {USER_MODEL} from '@common/auth/user';\nimport {PLAYLIST_MODEL} from '@app/web-player/playlists/playlist';\nimport {Section} from '@common/ui/forms/listbox/section';\nimport {Trans} from '@common/i18n/trans';\nimport {SmallArtistImage} from '@app/web-player/artists/artist-image/small-artist-image';\nimport {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {\n getUserProfileLink,\n UserProfileLink,\n} from '@app/web-player/users/user-profile-link';\nimport {AlbumLink, getAlbumLink} from '@app/web-player/albums/album-link';\nimport {ArtistLink, getArtistLink} from '@app/web-player/artists/artist-link';\nimport {getTrackLink, TrackLink} from '@app/web-player/tracks/track-link';\nimport {UserImage} from '@app/web-player/users/user-image';\nimport {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {PlayableModel} from '@app/web-player/playable-item/playable-model';\nimport clsx from 'clsx';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {AlbumImage} from '@app/web-player/albums/album-image/album-image';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {\n getPlaylistLink,\n PlaylistLink,\n} from '@app/web-player/playlists/playlist-link';\nimport {PlaylistImage} from '@app/web-player/playlists/playlist-image';\nimport {PlaylistOwnerName} from '@app/web-player/playlists/playlist-grid-item';\nimport {useListboxContext} from '@common/ui/forms/listbox/listbox-context';\nimport {AnimatePresence, m} from 'framer-motion';\nimport {opacityAnimation} from '@common/ui/animation/opacity-animation';\nimport {useParams} from 'react-router-dom';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {ArtistContextDialog} from '@app/web-player/artists/artist-context-dialog';\nimport {AlbumContextDialog} from '@app/web-player/albums/album-context-dialog';\nimport {TrackContextDialog} from '@app/web-player/tracks/context-dialog/track-context-dialog';\nimport {PlaylistContextDialog} from '@app/web-player/playlists/playlist-context-dialog';\n\ninterface SearchAutocompleteProps {\n className?: string;\n}\nexport function SearchAutocomplete({className}: SearchAutocompleteProps) {\n const {searchQuery} = useParams();\n const {trans} = useTrans();\n const navigate = useNavigate();\n const [query, setQuery] = useState(searchQuery || '');\n const [isOpen, setIsOpen] = useState(false);\n const {isFetching, data} = useSearchResults({\n loader: 'search',\n query,\n });\n\n return (\n {\n e.preventDefault();\n const encodedQuery = encodeURIComponent(query.trim());\n if (encodedQuery) {\n setIsOpen(false);\n navigate(`/search/${encodedQuery}`);\n }\n }}\n className={clsx('flex flex-auto items-center gap-14', className)}\n >\n \n \n {Object.entries(data?.results || {}).map(([groupName, results]) => (\n
    }>\n {results.map(result => {\n const key = `${groupName}-${result.id}`;\n switch (result.model_type) {\n case ARTIST_MODEL:\n return (\n {\n navigate(getArtistLink(result));\n }}\n startIcon={\n \n \n \n }\n description={}\n textLabel={result.name}\n >\n \n
    \n \n
    \n \n \n \n );\n case ALBUM_MODEL:\n return (\n {\n navigate(getAlbumLink(result));\n }}\n startIcon={\n \n \n \n }\n description={}\n textLabel={result.name}\n >\n \n
    \n \n
    \n \n \n \n );\n case TRACK_MODEL:\n return (\n {\n navigate(getTrackLink(result));\n }}\n startIcon={\n \n \n \n }\n description={}\n textLabel={result.name}\n >\n \n
    \n \n
    \n \n \n \n );\n case USER_MODEL:\n return (\n {\n navigate(getUserProfileLink(result));\n }}\n startIcon={\n \n }\n description={\n result.followers_count ? (\n \n ) : null\n }\n textLabel={result.display_name}\n >\n \n \n );\n case PLAYLIST_MODEL:\n return (\n {\n navigate(getPlaylistLink(result));\n }}\n startIcon={\n \n \n \n }\n description={}\n textLabel={result.name}\n >\n \n
    \n \n
    \n \n \n \n );\n }\n })}\n
    \n ))}\n \n \n );\n}\n\ninterface PlayableImageProps {\n children: ReactElement<{size: string; className?: string}>;\n model: PlayableModel;\n className?: string;\n value: string;\n}\nfunction PlayableImage({\n children,\n model,\n className,\n value,\n}: PlayableImageProps) {\n const {\n collection,\n state: {activeIndex},\n } = useListboxContext();\n const index = collection.get(value)?.index;\n const isActive = activeIndex === index;\n\n const queueId = queueGroupId(model);\n const isPlaying = usePlayerStore(\n s => s.isPlaying && s.originalQueue[0]?.groupId === queueId,\n );\n\n return (\n {\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n {cloneElement(children, {\n size: 'w-full h-full',\n })}\n \n {isActive || isPlaying ? (\n \n \n \n ) : null}\n \n \n );\n}\n","import {useSettings} from '@common/core/settings/use-settings';\nimport {useAuth} from '@common/auth/use-auth';\nimport React, {Fragment, useMemo} from 'react';\nimport {Button} from '@common/ui/buttons/button';\nimport {Link} from 'react-router-dom';\nimport {Trans} from '@common/i18n/trans';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {usePrimaryArtistForCurrentUser} from '@app/web-player/backstage/use-primary-artist-for-current-user';\nimport {MenuItem} from '@common/ui/navigation/menu/menu-trigger';\nimport {MicIcon} from '@common/icons/material/Mic';\nimport {getArtistLink} from '@app/web-player/artists/artist-link';\nimport {Navbar} from '@common/ui/navigation/navbar/navbar';\nimport {SearchAutocomplete} from '@app/web-player/search/search-autocomplete';\nimport clsx from 'clsx';\n\ninterface Props {\n className?: string;\n}\nexport function PlayerNavbar({className}: Props) {\n const navigate = useNavigate();\n const primaryArtist = usePrimaryArtistForCurrentUser();\n const {player} = useSettings();\n const menuItems = useMemo(() => {\n if (primaryArtist) {\n return [\n }\n onSelected={() => {\n navigate(getArtistLink(primaryArtist));\n }}\n >\n \n ,\n ];\n }\n if (player?.show_become_artist_btn) {\n return [\n }\n onSelected={() => {\n navigate('/backstage/requests');\n }}\n >\n \n ,\n ];\n }\n\n return [];\n }, [primaryArtist, navigate, player?.show_become_artist_btn]);\n\n return (\n \n \n \n \n );\n}\n\nfunction ActionButtons() {\n const {player, billing} = useSettings();\n const {isLoggedIn, hasPermission, isSubscribed} = useAuth();\n\n const showUploadButton =\n player?.show_upload_btn && isLoggedIn && hasPermission('music.create');\n const showTryProButton =\n billing?.enable && hasPermission('plans.view') && !isSubscribed;\n\n return (\n \n {showTryProButton ? (\n \n \n \n ) : null}\n {showUploadButton ? (\n \n \n \n ) : null}\n \n );\n}\n","import {Outlet} from 'react-router-dom';\nimport {PlayerContext} from '@common/player/player-context';\nimport {playerStoreOptions} from '@app/web-player/state/player-store-options';\nimport React, {Fragment} from 'react';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {DashboardLayout} from '@common/ui/layout/dashboard-layout';\nimport {DashboardSidenav} from '@common/ui/layout/dashboard-sidenav';\nimport {Sidenav} from '@app/web-player/layout/sidenav';\nimport {DashboardContent} from '@common/ui/layout/dashboard-content';\nimport {QueueSidenav} from '@app/web-player/layout/queue/queue-sidenav';\nimport clsx from 'clsx';\nimport {useMediaQuery} from '@common/utils/hooks/use-media-query';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {MobilePlayerControls} from '@app/web-player/player-controls/mobile-player-controls';\nimport {DesktopPlayerControls} from '@app/web-player/player-controls/desktop-player-controls';\nimport {PlayerOverlay} from '@app/web-player/overlay/player-overlay';\nimport {PlayerNavbar} from '@app/web-player/layout/player-navbar';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\n\nexport function WebPlayerLayout() {\n const {player} = useSettings();\n const isMobile = useIsMobileMediaQuery();\n\n const content = isMobile ? (\n \n
    \n \n \n ) : (\n \n \n \n \n \n \n
    \n \n \n \n \n );\n\n return (\n \n {content}\n \n \n );\n}\n\ninterface MainProps {\n className?: string;\n}\nfunction Main({className}: MainProps) {\n return (\n \n
    \n \n
    \n
    \n );\n}\n\nfunction RightSidenav() {\n const isOverlay = useMediaQuery('(max-width: 1280px)');\n const hideQueue = usePlayerStore(s => !s.shuffledQueue.length);\n return (\n \n \n \n );\n}\n","import React, {cloneElement, ReactElement, ReactNode} from 'react';\nimport clsx from 'clsx';\n\ninterface MediaPageHeaderLayoutProps {\n className?: string;\n image: ReactElement<{size: string; className?: string}>;\n title: ReactNode;\n subtitle?: ReactNode;\n description?: ReactNode;\n actionButtons?: ReactNode;\n centerItems?: boolean;\n footer?: ReactNode;\n}\nexport function MediaPageHeaderLayout({\n className,\n image,\n title,\n subtitle,\n description,\n actionButtons,\n footer,\n centerItems = false,\n}: MediaPageHeaderLayoutProps) {\n return (\n \n {cloneElement(image, {\n size: image.props.size || 'w-256 h-256',\n className: clsx(image.props.className, 'mx-auto flex-shrink-0'),\n })}\n
    \n

    \n {title}\n

    \n {subtitle &&
    {subtitle}
    }\n {description ? (\n
    \n {description}\n
    \n ) : null}\n
    {actionButtons}
    \n {footer ?
    {footer}
    : null}\n
    \n \n );\n}\n\ninterface ActionButtonClassNameProps {\n isFirst?: boolean;\n}\nexport function actionButtonClassName({\n isFirst,\n}: ActionButtonClassNameProps = {}) {\n return clsx('min-h-40', isFirst ? 'min-w-128 mr-20' : 'mr-10 min-w-100');\n}\n","import {isAbsoluteUrl} from '../utils/urls/is-absolute-url';\nimport memoize from 'nano-memoize';\nimport clsx from 'clsx';\n\ninterface RemoteFaviconProps {\n url: string;\n className?: string;\n size?: string;\n alt?: string;\n}\nexport function RemoteFavicon({\n url,\n className,\n size = 'w-16 h-16',\n alt,\n}: RemoteFaviconProps) {\n if (!url) {\n return null;\n }\n\n const src = getFaviconSrc(url);\n\n return (\n \n );\n}\n\nconst getFaviconSrc = memoize((url: string): string => {\n if (url.includes('youtube')) {\n return 'https://www.youtube.com/s/desktop/ca54e1bd/img/favicon.ico';\n }\n\n // relative url to current site\n if (!isAbsoluteUrl(url)) {\n url = `${window.location.protocol}//${window.location.host}`;\n }\n const domain = new URL(url).origin;\n return 'https://www.google.com/s2/favicons?domain=' + domain;\n});\n","import {UserLink} from '@app/web-player/user-profile/user-link';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\nimport {RemoteFavicon} from '@common/ui/remote-favicon';\nimport {IconButton} from '@common/ui/buttons/icon-button';\n\ninterface ProfileLinksProps {\n links?: UserLink[];\n}\nexport function ProfileLinks({links}: ProfileLinksProps) {\n if (!links?.length) return null;\n return (\n
    \n {links.map(link => (\n \n \n \n \n \n ))}\n
    \n );\n}\n","import { Options, tokenize } from 'linkifyjs';\n\n/**\n\tConvert strings of text into linkable HTML text\n*/\nfunction escapeText(text) {\n return text.replace(/&/g, '&').replace(//g, '>');\n}\nfunction escapeAttr(href) {\n return href.replace(/\"/g, '"');\n}\nfunction attributesToString(attributes) {\n const result = [];\n for (const attr in attributes) {\n let val = attributes[attr] + '';\n result.push(`${attr}=\"${escapeAttr(val)}\"`);\n }\n return result.join(' ');\n}\nfunction defaultRender(_ref) {\n let {\n tagName,\n attributes,\n content\n } = _ref;\n return `<${tagName} ${attributesToString(attributes)}>${escapeText(content)}`;\n}\n\n/**\n * Convert a plan text string to an HTML string with links. Expects that the\n * given strings does not contain any HTML entities. Use the linkify-html\n * interface if you need to parse HTML entities.\n *\n * @param {string} str string to linkify\n * @param {import('linkifyjs').Opts} [opts] overridable options\n * @returns {string}\n */\nfunction linkifyStr(str, opts) {\n if (opts === void 0) {\n opts = {};\n }\n opts = new Options(opts, defaultRender);\n const tokens = tokenize(str);\n const result = [];\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (token.t === 'nl' && opts.get('nl2br')) {\n result.push('
    \\n');\n } else if (!token.isLink || !opts.check(token)) {\n result.push(escapeText(token.toString()));\n } else {\n result.push(opts.render(token));\n }\n }\n return result.join('');\n}\nif (!String.prototype.linkify) {\n Object.defineProperty(String.prototype, 'linkify', {\n writable: false,\n value: function linkify(options) {\n return linkifyStr(this, options);\n }\n });\n}\n\nexport { linkifyStr as default };\n","import {useMemo} from 'react';\nimport linkifyStr from 'linkify-string';\n\nexport function useLinkifiedString(text: string | null | undefined) {\n return useMemo(() => {\n if (!text) {\n return text;\n }\n return linkifyStr(text, {\n nl2br: true,\n attributes: {rel: 'nofollow'},\n });\n }, [text]);\n}\n","import {UserProfile} from '@app/web-player/user-profile/user-profile';\nimport {UserLink} from '@app/web-player/user-profile/user-link';\nimport {ProfileLinks} from '@app/web-player/user-profile/profile-links';\nimport {useLinkifiedString} from '@common/utils/hooks/use-linkified-string';\n\ninterface Props {\n profile?: UserProfile;\n links?: UserLink[];\n shortDescription?: boolean;\n}\nexport function ProfileDescription({profile, links, shortDescription}: Props) {\n const description = useLinkifiedString(profile?.description) || '';\n if (!profile) return null;\n return (\n
    \n {profile.description && (\n \n )}\n {profile.city || profile.country || links?.length ? (\n
    \n {(profile.city || profile.country) && (\n
    \n {profile.city}\n {profile.city && ','} {profile.country}\n
    \n )}\n \n
    \n ) : null}\n
    \n );\n}\n","import {Genre} from '@app/web-player/genres/genre';\nimport {Artist} from '@app/web-player/artists/artist';\nimport {Button} from '@common/ui/buttons/button';\nimport {Trans} from '@common/i18n/trans';\nimport {ArrowDropDownIcon} from '@common/icons/material/ArrowDropDown';\nimport {SmallArtistImage} from '@app/web-player/artists/artist-image/small-artist-image';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {LikeButton} from '@app/web-player/library/like-button';\nimport {\n actionButtonClassName,\n MediaPageHeaderLayout,\n} from '@app/web-player/layout/media-page-header-layout';\nimport {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {GenreLink} from '@app/web-player/genres/genre-link';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {ArtistContextDialog} from '@app/web-player/artists/artist-context-dialog';\nimport {ProfileDescription} from '@app/web-player/user-profile/profile-description';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {MediaItemStats} from '@app/web-player/tracks/media-item-stats';\nimport clsx from 'clsx';\n\ninterface ArtistPageHeaderProps {\n artist: Artist;\n}\nexport function ArtistPageHeader({artist}: ArtistPageHeaderProps) {\n const {artistPage} = useSettings();\n return (\n \n }\n title={artist.name}\n subtitle={}\n actionButtons={\n
    \n \n \n
    \n }\n footer={\n artistPage.showDescription && (\n \n )\n }\n />\n );\n}\n\ninterface GenreListProps {\n genres?: Genre[];\n}\nfunction GenreList({genres}: GenreListProps) {\n return (\n
      \n {genres?.slice(0, 5).map(genre => (\n
    • \n \n
    • \n ))}\n
    \n );\n}\n\ninterface ActionButtonsProps {\n artist: Artist;\n}\nfunction ActionButtons({artist}: ActionButtonsProps) {\n return (\n
    \n \n \n \n }\n className={actionButtonClassName()}\n >\n \n \n \n \n
    \n );\n}\n","import {useMemo, useState} from 'react';\nimport {Trans} from '@common/i18n/trans';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport {Button} from '@common/ui/buttons/button';\nimport {Track} from '@app/web-player/tracks/track';\n\ninterface TopTracksTableProps {\n tracks?: Track[];\n}\nexport function TopTracksTable({tracks: initialTracks}: TopTracksTableProps) {\n const [showingAll, setShowingAll] = useState(false);\n\n const topTracks = useMemo(() => {\n return {\n all: initialTracks || [],\n sliced: initialTracks?.slice(0, 5) || [],\n };\n }, [initialTracks]);\n\n return (\n
    \n

    \n \n

    \n \n {\n setShowingAll(!showingAll);\n }}\n >\n {showingAll ? (\n \n ) : (\n \n )}\n \n
    \n );\n}\n","import {useParams} from 'react-router-dom';\nimport {PaginationResponse} from '@common/http/backend-response/pagination-response';\nimport {Album} from '@app/web-player/albums/album';\nimport {assignAlbumToTracks} from '@app/web-player/albums/assign-album-to-tracks';\nimport {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\n\nexport type AlbumViewMode = 'list' | 'grid';\n\nexport const albumListViewPerPage = 5;\nexport const albumGridViewPerPage = 25;\n\nexport function useArtistAlbums(\n initialPage: PaginationResponse | null,\n viewMode: AlbumViewMode\n) {\n const {artistId} = useParams();\n\n return useInfiniteData({\n endpoint: `artists/${artistId}/albums`,\n queryKey: ['artists', +artistId!, 'albums', viewMode],\n paginate: 'simple',\n initialPage,\n transformResponse: response => {\n response.pagination.data = response.pagination.data.map(album =>\n assignAlbumToTracks(album)\n );\n return response;\n },\n });\n}\n","import {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {AlbumIcon} from '@common/icons/material/Album';\nimport {Trans} from '@common/i18n/trans';\n\nexport function NoDiscographyMessage() {\n return (\n }\n title={}\n />\n );\n}\n","import {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {Artist} from '@app/web-player/artists/artist';\nimport {PaginationResponse} from '@common/http/backend-response/pagination-response';\nimport {Album} from '@app/web-player/albums/album';\nimport {useArtistAlbums} from '@app/web-player/artists/requests/use-artist-albums';\nimport {AlbumImage} from '@app/web-player/albums/album-image/album-image';\nimport {AlbumLink} from '@app/web-player/albums/album-link';\nimport {FormattedDate} from '@common/i18n/formatted-date';\nimport {Button} from '@common/ui/buttons/button';\nimport {ArrowDropDownIcon} from '@common/icons/material/ArrowDropDown';\nimport {Trans} from '@common/i18n/trans';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {NoDiscographyMessage} from '@app/web-player/artists/artist-page/discography-panel/no-discography-message';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {AlbumContextDialog} from '@app/web-player/albums/album-context-dialog';\nimport {useSortableTableData} from '@common/ui/tables/use-sortable-table-data';\n\ninterface ArtistAlbumsListProps {\n artist: Artist;\n initialAlbums: PaginationResponse | null;\n}\nexport function ArtistAlbumsList({initialAlbums}: ArtistAlbumsListProps) {\n const query = useArtistAlbums(initialAlbums, 'list');\n const {isLoading, items} = query;\n\n if (!isLoading && !items.length) {\n return ;\n }\n\n return (\n
    \n {items.map(album => (\n
    \n
    \n \n
    \n

    \n \n

    \n {album.release_date && (\n
    \n \n
    \n )}\n \n }\n >\n \n \n \n \n
    \n
    \n \n
    \n ))}\n \n
    \n );\n}\n\ninterface AlbumTrackTableProps {\n album: Album;\n}\nfunction AlbumTrackTable({album}: AlbumTrackTableProps) {\n const {data, sortDescriptor, onSortChange} = useSortableTableData(\n album.tracks,\n );\n return (\n \n );\n}\n","import {Artist} from '@app/web-player/artists/artist';\nimport {PaginationResponse} from '@common/http/backend-response/pagination-response';\nimport {Album} from '@app/web-player/albums/album';\nimport {AlbumGridItem} from '@app/web-player/albums/album-grid-item';\nimport {useArtistAlbums} from '@app/web-player/artists/requests/use-artist-albums';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {NoDiscographyMessage} from '@app/web-player/artists/artist-page/discography-panel/no-discography-message';\nimport {ContentGrid} from '@app/web-player/playable-item/content-grid';\n\ninterface ArtistAlbumsGridProps {\n artist: Artist;\n initialAlbums: PaginationResponse | null;\n}\nexport function ArtistAlbumsGrid({initialAlbums}: ArtistAlbumsGridProps) {\n const query = useArtistAlbums(initialAlbums, 'grid');\n\n if (!query.isLoading && !query.items.length) {\n return ;\n }\n\n return (\n \n {query.items.map(album => (\n \n ))}\n \n \n );\n}\n","import {Artist} from '@app/web-player/artists/artist';\nimport {Trans} from '@common/i18n/trans';\nimport {SmallArtistImage} from '@app/web-player/artists/artist-image/small-artist-image';\nimport {Link} from 'react-router-dom';\nimport {getArtistLink} from '@app/web-player/artists/artist-link';\nimport {TopTracksTable} from '@app/web-player/artists/artist-page/discography-panel/top-tracks-table';\nimport {ArtistAlbumsList} from '@app/web-player/artists/artist-page/discography-panel/artist-albums-list';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {ViewAgendaIcon} from '@common/icons/material/ViewAgenda';\nimport {GridViewIcon} from '@common/icons/material/GridView';\nimport {ArtistAlbumsGrid} from '@app/web-player/artists/artist-page/discography-panel/artist-albums-grid';\nimport {Tooltip} from '@common/ui/tooltip/tooltip';\nimport {\n albumGridViewPerPage,\n albumListViewPerPage,\n} from '@app/web-player/artists/requests/use-artist-albums';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {AdHost} from '@common/admin/ads/ad-host';\nimport React from 'react';\nimport {\n albumLayoutKey,\n UseArtistResponse,\n} from '@app/web-player/artists/requests/use-artist';\nimport {useCookie} from '@common/utils/hooks/use-cookie';\n\ninterface DiscographyTabProps {\n data: UseArtistResponse;\n}\nexport function DiscographyTab({\n data: {artist, albums, selectedAlbumLayout},\n}: DiscographyTabProps) {\n const {player} = useSettings();\n const [viewMode, setViewMode] = useCookie(\n albumLayoutKey,\n selectedAlbumLayout || player?.default_artist_view || 'list',\n );\n return (\n
    \n
    \n \n
    \n
    \n

    \n \n

    \n }>\n setViewMode('list')}\n >\n \n \n \n }>\n setViewMode('grid')}\n >\n \n \n \n
    \n {viewMode === 'list' ? (\n \n ) : (\n \n )}\n
    \n
    \n );\n}\n\ninterface HeaderProps {\n artist: Artist;\n}\nfunction Header({artist}: HeaderProps) {\n if (!artist.top_tracks?.length) return null;\n const similarArtists = artist.similar?.slice(0, 4) || [];\n\n return (\n
    \n \n {similarArtists.length ? (\n
    \n

    \n \n

    \n
    \n {similarArtists.map(similar => (\n \n \n
    {similar.name}
    \n \n ))}\n
    \n
    \n ) : null}\n
    \n );\n}\n","import {Artist} from '@app/web-player/artists/artist';\nimport {ArtistGridItem} from '@app/web-player/artists/artist-grid-item';\nimport {ContentGrid} from '@app/web-player/playable-item/content-grid';\n\ninterface SimilarArtistsTabProps {\n artist: Artist;\n}\nexport function SimilarArtistsPanel({artist}: SimilarArtistsTabProps) {\n return (\n \n {artist.similar?.map(similar => (\n \n ))}\n \n );\n}\n","import {Artist} from '@app/web-player/artists/artist';\nimport {ImageZoomDialog} from '@common/ui/overlays/dialog/image-zoom-dialog';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {useLinkifiedString} from '@common/utils/hooks/use-linkified-string';\nimport {useMemo} from 'react';\n\ninterface ArtistAboutTabProps {\n artist: Artist;\n}\nexport function ArtistAboutPanel({artist}: ArtistAboutTabProps) {\n const description = useLinkifiedString(artist.profile?.description);\n\n const images = useMemo(() => {\n return artist.profile_images?.map(img => img.url) || [];\n }, [artist.profile_images]);\n\n return (\n
    \n
    \n {images.map((src, index) => (\n \n \n \n \n \n \n ))}\n
    \n \n
    \n );\n}\n","import {Artist} from '@app/web-player/artists/artist';\nimport {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {Track} from '@app/web-player/tracks/track';\nimport {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {AudiotrackIcon} from '@common/icons/material/Audiotrack';\nimport {Trans} from '@common/i18n/trans';\nimport React from 'react';\nimport {PaginationResponse} from '@common/http/backend-response/pagination-response';\nimport {TrackList} from '@app/web-player/tracks/track-list/track-list';\n\ninterface Props {\n artist: Artist;\n initialTracks?: PaginationResponse;\n}\nexport function ArtistTracksPanel({artist, initialTracks}: Props) {\n const query = useInfiniteData({\n queryKey: ['tracks', artist.id],\n endpoint: `artists/${artist.id}/tracks`,\n initialPage: initialTracks,\n });\n\n if (query.isLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n title={}\n description={\n \n }\n />\n );\n }\n\n return ;\n}\n","import {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {ArtistLinks} from '@app/web-player/artists/artist-links';\nimport {Track} from '@app/web-player/tracks/track';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {TrackSeekbar} from '@app/web-player/player-controls/seekbar/track-seekbar';\nimport {trackIsLocallyUploaded} from '@app/web-player/tracks/utils/track-is-locally-uploaded';\nimport {FormattedRelativeTime} from '@common/i18n/formatted-relative-time';\nimport {CommentBarContextProvider} from '@app/web-player/tracks/waveform/comment-bar-context';\nimport React, {Fragment, memo} from 'react';\nimport {Chip} from '@common/ui/forms/input-field/chip-field/chip';\nimport {GenreLink} from '@app/web-player/genres/genre-link';\nimport {Album} from '@app/web-player/albums/album';\nimport {RepeatIcon} from '@common/icons/material/Repeat';\nimport clsx from 'clsx';\nimport {User} from '@common/auth/user';\nimport {UserProfileLink} from '@app/web-player/users/user-profile-link';\nimport {useAlbumPermissions} from '@app/web-player/albums/use-album-permissions';\nimport {AlbumImage} from '@app/web-player/albums/album-image/album-image';\nimport {AlbumLink} from '@app/web-player/albums/album-link';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {FormattedNumber} from '@common/i18n/formatted-number';\nimport {PlayArrowFilledIcon} from '@app/web-player/tracks/play-arrow-filled';\nimport {usePlayerStore} from '@common/player/hooks/use-player-store';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {usePlayerActions} from '@common/player/hooks/use-player-actions';\nimport {tracksToMediaItems} from '@app/web-player/tracks/utils/track-to-media-item';\nimport {WaveformWithComments} from '@app/web-player/tracks/track-list/track-list-item';\nimport {TrackActionsBar} from '@app/web-player/tracks/track-actions-bar';\n\ninterface Props {\n album: Album;\n reposter?: User;\n className?: string;\n hideArtwork?: boolean;\n hideActions?: boolean;\n linksInNewTab?: boolean;\n maxHeight?: string;\n}\nexport const AlbumListItem = memo(\n ({\n album,\n reposter,\n className,\n hideArtwork,\n hideActions,\n linksInNewTab,\n maxHeight,\n }: Props) => {\n const queueId = queueGroupId(album);\n const {player} = useSettings();\n const {managesAlbum} = useAlbumPermissions(album);\n const tracks = album?.tracks || [];\n\n const media = usePlayerStore(s => s.cuedMedia);\n const activeTrack = tracks.find(t => t.id === media?.meta.id) || tracks[0];\n\n const showWave =\n player?.seekbar_type === 'waveform' &&\n trackIsLocallyUploaded(activeTrack);\n\n return (\n \n {!hideArtwork && (\n \n )}\n \n
    \n
    \n \n
    \n
    \n \n {reposter && (\n \n \n \n \n )}\n
    \n
    \n \n
    \n
    \n
    \n \n {album.genres?.length ? (\n \n \n \n ) : null}\n
    \n
    \n
    \n {showWave ? (\n \n \n \n ) : (\n \n )}\n
    \n
    \n
    \n {tracks.map((track, index) => {\n const isLast = index - 1 === album.tracks?.length;\n const isActive = activeTrack?.id === track.id;\n return (\n \n );\n })}\n
    \n {!hideActions && (\n \n )}\n \n \n );\n },\n);\n\ninterface TrackItemProps {\n track: Track;\n album: Album;\n index: number;\n isLast: boolean;\n isActive: boolean;\n}\nfunction TrackItem({track, index, isLast, isActive, album}: TrackItemProps) {\n const playerActions = usePlayerActions();\n return (\n {\n if (album.tracks?.length) {\n playerActions.overrideQueueAndPlay(\n tracksToMediaItems(album.tracks),\n index,\n );\n }\n }}\n >\n \n
    {index + 1}
    \n
    {track.name}
    \n {track.plays && track.plays > 0 ? (\n \n \n
    \n \n
    \n
    \n ) : null}\n \n );\n}\n","import {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\nimport React from 'react';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {UseInfiniteDataResult} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {Album} from '@app/web-player/albums/album';\nimport {ContentGrid} from '@app/web-player/playable-item/content-grid';\nimport {AlbumGridItem} from '@app/web-player/albums/album-grid-item';\nimport {AlbumListItem} from '@app/web-player/albums/album-list/album-list-item';\n\ninterface Props {\n albums?: Album[];\n query?: UseInfiniteDataResult;\n}\nexport function AlbumList({albums, query}: Props) {\n const isMobile = useIsMobileMediaQuery();\n if (!albums && query) {\n albums = query.items;\n } else {\n albums = [];\n }\n\n if (isMobile) {\n return (\n
    \n \n {albums.map(album => (\n \n ))}\n \n {query && }\n
    \n );\n }\n\n return (\n
    \n {albums.map(album => (\n \n ))}\n {query && }\n
    \n );\n}\n","import {Artist} from '@app/web-player/artists/artist';\nimport {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {Trans} from '@common/i18n/trans';\nimport React from 'react';\nimport {Album} from '@app/web-player/albums/album';\nimport {AlbumIcon} from '@common/icons/material/Album';\nimport {AlbumList} from '@app/web-player/albums/album-list/album-list';\n\ninterface Props {\n artist: Artist;\n}\nexport function ArtistAlbumsPanel({artist}: Props) {\n const query = useInfiniteData({\n queryKey: ['albums', artist.id],\n endpoint: `artists/${artist.id}/albums`,\n });\n\n if (query.isInitialLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n title={}\n description={\n \n }\n />\n );\n }\n\n return ;\n}\n","import {Artist} from '@app/web-player/artists/artist';\nimport {useSearchParams} from 'react-router-dom';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {useMemo} from 'react';\nimport {artistPageTabs} from '@app/web-player/artists/artist-page-tabs';\n\nexport function useArtistPageTabs(artist: Artist) {\n const [searchParams] = useSearchParams();\n const {artistPage} = useSettings();\n\n return useMemo(() => {\n const haveSimilar = artist.similar?.length;\n const haveBio =\n artist.profile_images?.length || artist.profile?.description;\n const activeTabs = artistPage?.tabs?.filter(tab => {\n if (!tab.active) {\n return false;\n }\n if (tab.id === artistPageTabs.similar && !haveSimilar) {\n return false;\n }\n if (tab.id === artistPageTabs.about && !haveBio) {\n return false;\n }\n return true;\n });\n const selectedTabId =\n artistPageTabs[searchParams.get('tab') as keyof typeof artistPageTabs];\n const i = activeTabs?.findIndex(t => t.id === selectedTabId);\n const selectedIndex = i > -1 ? i : 0;\n return {\n selectedIndex,\n activeTabs,\n };\n }, [artist, artistPage.tabs, searchParams]);\n}\n","import {useQuery} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useAuth} from '@common/auth/use-auth';\nimport {User} from '@common/auth/user';\n\ninterface Response extends BackendResponse {\n ids: number[];\n}\n\nexport function useFollowedUsers() {\n const {user} = useAuth();\n return useQuery({\n queryKey: ['users', 'followed', 'ids'],\n queryFn: () => fetchIds(),\n enabled: !!user,\n });\n}\n\nexport function useIsUserFollowing(user: User) {\n const {data, isLoading} = useFollowedUsers();\n return {\n isLoading,\n isFollowing: !!data?.ids.includes(user.id),\n };\n}\n\nfunction fetchIds() {\n return apiClient\n .get(`users/me/followed-users/ids`)\n .then(response => response.data);\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {User} from '@common/auth/user';\n\ninterface Response extends BackendResponse {}\n\ninterface Payload {\n user: User;\n}\n\nexport function useFollowUser() {\n return useMutation({\n mutationFn: (payload: Payload) => followUser(payload),\n onSuccess: async (response, {user}) => {\n await queryClient.invalidateQueries({queryKey: ['users']});\n toast(message('Following :name', {values: {name: user.display_name}}));\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction followUser({user}: Payload): Promise {\n return apiClient.post(`users/${user.id}/follow`).then(r => r.data);\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useMutation} from '@tanstack/react-query';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {User} from '@common/auth/user';\n\ninterface Response extends BackendResponse {}\n\ninterface Payload {\n user: User;\n}\n\nexport function useUnfollowUser() {\n return useMutation({\n mutationFn: (payload: Payload) => unfollowUser(payload),\n onSuccess: async (response, {user}) => {\n await queryClient.invalidateQueries({queryKey: ['users']});\n toast(\n message('Stopped following :name', {values: {name: user.display_name}}),\n );\n },\n onError: r => showHttpErrorToast(r),\n });\n}\n\nfunction unfollowUser({user}: Payload): Promise {\n return apiClient.post(`users/${user.id}/unfollow`).then(r => r.data);\n}\n","import {Button, ButtonProps} from '@common/ui/buttons/button';\nimport {useAuth} from '@common/auth/use-auth';\nimport {User} from '@common/auth/user';\nimport {useIsUserFollowing} from '@common/users/queries/use-followed-users';\nimport {useFollowUser} from '@common/users/queries/use-follow-user';\nimport {useUnfollowUser} from '@common/users/queries/use-unfollow-user';\nimport {Trans} from '@common/i18n/trans';\nimport clsx from 'clsx';\n\ninterface Props extends Omit {\n user: User;\n minWidth?: string | null;\n}\nexport function FollowButton({\n user,\n className,\n minWidth = 'min-w-82',\n ...buttonProps\n}: Props) {\n const {user: currentUser} = useAuth();\n const {isFollowing, isLoading} = useIsUserFollowing(user);\n const followUser = useFollowUser();\n const unfollowUser = useUnfollowUser();\n\n const mergedClassName = clsx(className, minWidth);\n\n if (isFollowing) {\n return (\n unfollowUser.mutate({user})}\n disabled={\n !currentUser ||\n currentUser?.id === user.id ||\n unfollowUser.isPending ||\n isLoading\n }\n >\n \n \n );\n }\n\n return (\n followUser.mutate({user})}\n disabled={\n !currentUser ||\n currentUser?.id === user.id ||\n followUser.isPending ||\n isLoading\n }\n >\n \n \n );\n}\n","import {User} from '@common/auth/user';\nimport {UserImage} from '@app/web-player/users/user-image';\nimport {UserProfileLink} from '@app/web-player/users/user-profile-link';\nimport {Trans} from '@common/i18n/trans';\nimport React from 'react';\nimport {FollowButton} from '@common/users/follow-button';\n\ninterface Props {\n follower: User;\n}\nexport function FollowerListItem({follower}: Props) {\n return (\n \n \n
    \n \n {follower.followers_count && follower.followers_count > 0 ? (\n
    \n \n
    \n ) : null}\n
    \n \n \n );\n}\n","import {Artist} from '@app/web-player/artists/artist';\nimport {Trans} from '@common/i18n/trans';\nimport {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {User} from '@common/auth/user';\nimport {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport React from 'react';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {BookmarkBorderIcon} from '@common/icons/material/BookmarkBorder';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {FollowerListItem} from '@app/web-player/artists/artist-page/followers-panel/follower-list-item';\n\ninterface Props {\n artist: Artist;\n}\nexport function ArtistFollowersPanel({artist}: Props) {\n const query = useInfiniteData({\n queryKey: ['artists', artist.id, 'followers'],\n endpoint: `artists/${artist.id}/followers`,\n });\n\n if (query.isInitialLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n description={\n \n }\n />\n );\n }\n\n return (\n
    \n {query.items.map(follower => (\n \n ))}\n \n
    \n );\n}\n","import {Link} from 'react-router-dom';\nimport {artistPageTabs} from '@app/web-player/artists/artist-page-tabs';\nimport {Tabs} from '@common/ui/tabs/tabs';\nimport {TabList} from '@common/ui/tabs/tab-list';\nimport {Tab} from '@common/ui/tabs/tab';\nimport {Trans} from '@common/i18n/trans';\nimport {TabPanel, TabPanels} from '@common/ui/tabs/tab-panels';\nimport {DiscographyTab} from '@app/web-player/artists/artist-page/discography-panel/discography-tab';\nimport {SimilarArtistsPanel} from '@app/web-player/artists/artist-page/similar-artists-panel';\nimport {ArtistAboutPanel} from '@app/web-player/artists/artist-page/artist-about-panel';\nimport {ArtistTracksPanel} from '@app/web-player/artists/artist-page/artist-tracks-panel';\nimport {ArtistAlbumsPanel} from '@app/web-player/artists/artist-page/artist-albums-panel';\nimport React from 'react';\nimport {UseArtistResponse} from '@app/web-player/artists/requests/use-artist';\nimport {useArtistPageTabs} from '@app/web-player/artists/artist-page/use-artist-page-tabs';\nimport {ArtistFollowersPanel} from '@app/web-player/artists/artist-page/artist-followers-panel';\n\ninterface Props {\n data: UseArtistResponse;\n}\nexport function ArtistPageTabs({data}: Props) {\n const {selectedIndex, activeTabs} = useArtistPageTabs(data.artist);\n return (\n \n \n {activeTabs.map(tab => {\n switch (tab.id) {\n case artistPageTabs.discography:\n return (\n \n \n \n );\n case artistPageTabs.similar:\n return (\n \n \n \n );\n case artistPageTabs.about:\n return (\n \n \n \n );\n case artistPageTabs.tracks:\n return (\n \n \n \n );\n case artistPageTabs.albums:\n return (\n \n \n \n );\n case artistPageTabs.followers:\n return (\n \n \n \n );\n }\n })}\n \n \n {activeTabs.map(tab => {\n switch (tab.id) {\n case artistPageTabs.discography:\n return (\n \n \n \n );\n case artistPageTabs.similar:\n return (\n \n \n \n );\n case artistPageTabs.about:\n return (\n \n \n \n );\n case artistPageTabs.tracks:\n return (\n \n \n \n );\n case artistPageTabs.albums:\n return (\n \n \n \n );\n case artistPageTabs.followers:\n return (\n \n \n \n );\n }\n })}\n \n \n );\n}\n","import {useArtist} from '@app/web-player/artists/requests/use-artist';\nimport {ArtistPageHeader} from '@app/web-player/artists/artist-page/artist-page-header';\nimport {PageMetaTags} from '@common/http/page-meta-tags';\nimport {PageStatus} from '@common/http/page-status';\nimport React from 'react';\nimport {ArtistPageTabs} from '@app/web-player/artists/artist-page/artist-page-tabs';\nimport {AdHost} from '@common/admin/ads/ad-host';\n\nexport function ArtistPage() {\n const query = useArtist({\n loader: 'artistPage',\n });\n\n if (query.data) {\n return (\n
    \n \n \n \n \n \n \n
    \n );\n }\n\n return (\n \n );\n}\n","import {useQuery} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useParams} from 'react-router-dom';\nimport {PaginationResponse} from '@common/http/backend-response/pagination-response';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\n\nexport interface GetPlaylistResponse extends BackendResponse {\n playlist: Playlist;\n tracks: PaginationResponse;\n totalDuration: number;\n loader: Params['loader'];\n}\n\ninterface Params {\n loader: 'playlistPage' | 'playlist';\n}\n\nexport function usePlaylist(params: Params) {\n const {playlistId} = useParams();\n return useQuery({\n queryKey: ['playlists', +playlistId!],\n queryFn: () => fetchPlaylist(playlistId!),\n initialData: () => {\n const data = getBootstrapData().loaders?.[params.loader];\n if (data?.playlist?.id == playlistId && data?.loader === params.loader) {\n return data;\n }\n return undefined;\n },\n });\n}\n\nfunction fetchPlaylist(\n playlistId: number | string,\n): Promise {\n return apiClient\n .get(`playlists/${playlistId}`)\n .then(response => response.data);\n}\n","import React, {Children, Fragment, ReactElement, ReactNode} from 'react';\nimport {AvatarProps} from '@common/ui/images/avatar';\nimport clsx from 'clsx';\nimport {Trans} from '@common/i18n/trans';\nimport {Link} from 'react-router-dom';\n\ninterface AvatarGroupProps {\n children: ReactNode;\n className?: string;\n}\nexport function AvatarGroup(props: AvatarGroupProps) {\n const children = Children.toArray(\n props.children\n ) as ReactElement[];\n\n if (!children.length) return null;\n\n const firstLink = children[0].props.link;\n const label = children[0].props.label;\n\n return (\n
    \n \n {children.map((avatar, index) => (\n \n {avatar}\n
    \n ))}\n \n
    \n {firstLink && label ? (\n \n {label}\n \n ) : null}\n {children.length > 1 && (\n \n {' '}\n \n \n )}\n
    \n \n );\n}\n","import React, {Children, Fragment, ReactNode} from 'react';\nimport clsx from 'clsx';\n\ninterface BulletSeparatedItemsProps {\n children: ReactNode;\n className?: string;\n}\n\nexport function BulletSeparatedItems({\n children,\n className,\n}: BulletSeparatedItemsProps) {\n const items = Children.toArray(children);\n return (\n
    \n {items.map((child, index) => (\n \n
    {child}
    \n {index < items.length - 1 ?
    : null}\n
    \n ))}\n
    \n );\n}\n","import {Playlist} from '@app/web-player/playlists/playlist';\nimport {\n getPlaylistImageSrc,\n PlaylistImage,\n} from '@app/web-player/playlists/playlist-image';\nimport {Trans} from '@common/i18n/trans';\nimport {FormattedDuration} from '@common/i18n/formatted-duration';\nimport React, {Fragment} from 'react';\nimport {FileUploadProvider} from '@common/uploads/uploader/file-upload-provider';\nimport {ImageSelector} from '@common/ui/images/image-selector';\nimport {ImageIcon} from '@common/icons/material/Image';\nimport {useUpdatePlaylist} from '@app/web-player/playlists/requests/use-update-playlist';\nimport {usePlaylistPermissions} from '@app/web-player/playlists/hooks/use-playlist-permissions';\nimport {Button} from '@common/ui/buttons/button';\nimport {ArrowDropDownIcon} from '@common/icons/material/ArrowDropDown';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {PlaylistContextDialog} from '@app/web-player/playlists/playlist-context-dialog';\nimport {FollowPlaylistButton} from '@app/web-player/playlists/playlist-page/follow-playlist-button';\nimport {AvatarGroup} from '@common/ui/images/avatar-group';\nimport {Avatar} from '@common/ui/images/avatar';\nimport {getUserProfileLink} from '@app/web-player/users/user-profile-link';\nimport {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {\n actionButtonClassName,\n MediaPageHeaderLayout,\n} from '@app/web-player/layout/media-page-header-layout';\nimport {BulletSeparatedItems} from '@app/web-player/layout/bullet-separated-items';\n\ninterface PlaylistPageHeaderProps {\n playlist: Playlist;\n totalDuration: number;\n queueId: string;\n}\nexport function PlaylistPageHeader({\n playlist,\n totalDuration,\n queueId,\n}: PlaylistPageHeaderProps) {\n return (\n \n }\n title={playlist.name}\n subtitle={\n \n {playlist.editors?.map(editor => (\n \n ))}\n \n }\n description={\n \n {playlist.description}\n {playlist.tracks_count ? (\n \n \n \n {playlist.collaborative && }\n \n ) : null}\n \n }\n actionButtons={\n 0}\n queueId={queueId}\n />\n }\n />\n \n );\n}\n\ninterface ImageContainerProps {\n playlist: Playlist;\n size?: string;\n className?: string;\n}\nfunction EditableImage({playlist, size, className}: ImageContainerProps) {\n const updatePlaylist = useUpdatePlaylist();\n const {canEdit} = usePlaylistPermissions(playlist);\n\n if (!canEdit) {\n return (\n \n );\n }\n\n return (\n \n {\n updatePlaylist.mutate({image: newValue});\n }}\n placeholderIcon={}\n stretchPreview\n />\n \n );\n}\n\ninterface ActionButtonsProps {\n playlist: Playlist;\n hasTracks: boolean;\n queueId: string;\n}\nfunction ActionButtons({playlist, hasTracks, queueId}: ActionButtonsProps) {\n return (\n
    \n \n \n \n }\n className={actionButtonClassName()}\n >\n \n \n \n \n
    \n );\n}\n","export function moveMultipleItemsInArray(\n array: T[],\n indexOrIndexes: number | number[],\n newIndex: number\n) {\n const indexes = Array.isArray(indexOrIndexes)\n ? indexOrIndexes\n : [indexOrIndexes];\n const insertBefore = array[newIndex + (newIndex < indexes[0] ? 0 : 1)];\n const itemsToBeMoved = indexes.map(i => array[i]);\n\n // in original sequence order, check for presence in the removal\n // list, *and* remove them from the original array\n const moved = [];\n for (let i = 0; i < array.length; ) {\n const value = array[i];\n if (itemsToBeMoved.indexOf(value) >= 0) {\n moved.push(value);\n array.splice(i, 1);\n } else {\n ++i;\n }\n }\n\n // find the new index of the insertion point\n let insertionIndex = array.indexOf(insertBefore);\n if (insertionIndex < 0) {\n insertionIndex = array.length;\n }\n\n // and add the elements back in\n array.splice(insertionIndex, 0, ...moved);\n\n return array;\n}\n","import {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useMutation} from '@tanstack/react-query';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {Track} from '@app/web-player/tracks/track';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {useParams} from 'react-router-dom';\nimport {moveMultipleItemsInArray} from '@common/utils/array/move-multiple-items-in-array';\n\ninterface Response extends BackendResponse {\n //\n}\n\ninterface Payload {\n tracks: Track[];\n oldIndexes: number | number[];\n newIndex: number;\n}\n\nexport function useReorderPlaylistTracks() {\n const {playlistId} = useParams();\n return useMutation({\n mutationFn: (payload: Payload) => reorderTracks(playlistId!, payload),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: ['tracks', 'playlist', +playlistId!],\n });\n },\n onError: err => showHttpErrorToast(err),\n });\n}\n\nfunction reorderTracks(\n playlistId: number | string,\n {tracks, oldIndexes, newIndex}: Payload,\n): Promise {\n const ids = tracks.map(t => t.id);\n moveMultipleItemsInArray(ids, oldIndexes, newIndex);\n return apiClient\n .post(`playlists/${playlistId}/tracks/order`, {ids})\n .then(r => r.data);\n}\n","import {RowElementProps} from '@common/ui/tables/table-row';\nimport {Track} from '@app/web-player/tracks/track';\nimport {useIsTouchDevice} from '@common/utils/hooks/is-touch-device';\nimport React, {Fragment, useContext, useRef} from 'react';\nimport {TableContext} from '@common/ui/tables/table-context';\nimport {DragPreviewRenderer} from '@common/ui/interactions/dnd/use-draggable';\nimport {useReorderPlaylistTracks} from '@app/web-player/playlists/requests/use-reorder-playlist-tracks';\nimport {useSortable} from '@common/ui/interactions/dnd/use-sortable';\nimport {usePlaylist} from '@app/web-player/playlists/requests/use-playlist';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {mergeProps} from '@react-aria/utils';\nimport {PlaylistTrackContextDialog} from '@app/web-player/playlists/playlist-page/playlist-track-context-dialog';\nimport {Trans} from '@common/i18n/trans';\nimport {DragPreview} from '@common/ui/interactions/dnd/drag-preview';\n\nexport function PlaylistTableRow({\n item,\n children,\n className,\n ...domProps\n}: RowElementProps) {\n const isTouchDevice = useIsTouchDevice();\n const {\n data: tracks,\n selectRow,\n selectedRows,\n sortDescriptor,\n } = useContext(TableContext);\n const domRef = useRef(null);\n const previewRef = useRef(null);\n const reorderTracks = useReorderPlaylistTracks();\n const {data} = usePlaylist({loader: 'playlistPage'});\n\n const {sortableProps} = useSortable({\n ref: domRef,\n disabled:\n (isTouchDevice ?? false) ||\n reorderTracks.isPending ||\n // disable drag and drop if table is sorted via header\n sortDescriptor?.orderBy !== 'position',\n item: item,\n items: tracks,\n type: 'playlistTrack',\n preview: previewRef,\n previewVariant: 'line',\n onDragEnd: () => {\n selectRow(null);\n },\n onSortStart: () => {\n // if dragging a row that is already selected, do nothing,\n // otherwise deselect all other rows and select this one\n if (!selectedRows.includes(item.id)) {\n selectRow(item);\n }\n },\n onSortEnd: (oldIndex, newIndex) => {\n reorderTracks.mutate({\n tracks: tracks as Track[],\n oldIndexes:\n selectedRows.length > 1\n ? selectedRows.map(id => tracks.findIndex(t => t.id === id))\n : oldIndex,\n newIndex,\n });\n },\n });\n\n return (\n \n \n \n {children}\n \n \n \n {!item.isPlaceholder && }\n \n );\n}\n\ninterface RowDragPreviewProps {\n track: Track;\n}\nconst RowDragPreview = React.forwardRef<\n DragPreviewRenderer,\n RowDragPreviewProps\n>(({track}, ref) => {\n const {selectedRows} = useContext(TableContext);\n\n const content =\n selectedRows.length > 1 ? (\n \n ) : (\n `${track.name} - ${track.artists?.[0]?.name}`\n );\n\n return (\n \n {() => (\n \n {content}\n \n )}\n \n );\n});\n","import {Trans} from '@common/i18n/trans';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport React, {ReactElement} from 'react';\n\ninterface MediaPageNoResultsMessage {\n description: ReactElement;\n searchQuery?: string;\n className?: string;\n}\nexport function MediaPageNoResultsMessage({\n description,\n searchQuery,\n className,\n}: MediaPageNoResultsMessage) {\n if (searchQuery) {\n return (\n }\n description={\n \n }\n />\n );\n }\n return (\n }\n description={description}\n />\n );\n}\n","import {usePlaylist} from '@app/web-player/playlists/requests/use-playlist';\nimport {Trans} from '@common/i18n/trans';\nimport {PaginationResponse} from '@common/http/backend-response/pagination-response';\nimport {Track} from '@app/web-player/tracks/track';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport React from 'react';\nimport {TextField} from '@common/ui/forms/input-field/text-field/text-field';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {message} from '@common/i18n/message';\nimport {SearchIcon} from '@common/icons/material/Search';\nimport {VirtualTableBody} from '@app/web-player/playlists/virtual-table-body';\nimport {PlaylistPageHeader} from '@app/web-player/playlists/playlist-page/playlist-page-header';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {PlaylistTableRow} from '@app/web-player/playlists/playlist-page/playlist-table-row';\nimport {MediaPageNoResultsMessage} from '@app/web-player/layout/media-page-no-results-message';\nimport {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {PageMetaTags} from '@common/http/page-meta-tags';\nimport {PageStatus} from '@common/http/page-status';\nimport {AdHost} from '@common/admin/ads/ad-host';\n\nexport function PlaylistPage() {\n const query = usePlaylist({loader: 'playlistPage'});\n\n if (query.data) {\n return (\n
    \n \n \n
    \n );\n }\n\n return (\n \n );\n}\n\ninterface PageContentProps {\n initialTracks: PaginationResponse;\n playlist: Playlist;\n totalDuration: number;\n}\nfunction PageContent({\n initialTracks,\n playlist,\n totalDuration,\n}: PageContentProps) {\n const {trans} = useTrans();\n const query = useInfiniteData({\n initialPage: initialTracks,\n queryKey: ['tracks', 'playlist', playlist.id],\n endpoint: `playlists/${playlist.id}/tracks`,\n defaultOrderBy: 'position',\n defaultOrderDir: 'asc',\n paginate: 'simple',\n willSortOrFilter: true,\n });\n const {\n isLoading,\n sortDescriptor,\n setSortDescriptor,\n searchQuery,\n setSearchQuery,\n items,\n } = query;\n const totalItems = playlist.tracks_count || 0;\n const queueId = queueGroupId(playlist, '*', sortDescriptor);\n\n return (\n
    \n \n \n setSearchQuery(e.target.value)}\n className=\"mb-44 mt-28 max-w-512 md:mb-24\"\n size=\"sm\"\n startAdornment={}\n placeholder={trans(message('Search within playlist'))}\n />\n }\n />\n {!items.length && !isLoading && (\n \n }\n />\n )}\n \n
    \n );\n}\n","import {Commentable} from '@common/comments/commentable';\nimport {Comment} from '@common/comments/comment';\nimport {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\n\ninterface QueryParams {\n perPage?: number;\n}\n\nexport function commentsQueryKey(\n commentable: Commentable,\n params: QueryParams = {}\n) {\n return ['comment', `${commentable.id}-${commentable.model_type}`, params];\n}\n\nexport function useComments(\n commentable: Commentable,\n params: QueryParams = {}\n) {\n return useInfiniteData({\n queryKey: commentsQueryKey(commentable, params),\n endpoint: 'commentable/comments',\n //paginate: 'cursor',\n queryParams: {\n commentable_type: commentable.model_type,\n commentable_id: commentable.id,\n ...params,\n },\n });\n}\n","import {useMutation} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {VotableModel} from '@common/votes/votable-model';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\n\ninterface Response extends BackendResponse {\n model: VotableModel;\n}\n\ninterface Payload {\n voteType: 'upvote' | 'downvote';\n}\n\nexport function useStoreVote(model: VotableModel) {\n return useMutation({\n mutationFn: (payload: Payload) => changeVote(model, payload),\n onSuccess: response => {\n //\n },\n onError: err => showHttpErrorToast(err),\n });\n}\n\nfunction changeVote(model: VotableModel, payload: Payload) {\n return apiClient\n .post('vote', {\n vote_type: payload.voteType,\n model_id: model.id,\n model_type: model.model_type,\n })\n .then(r => r.data);\n}\n","import {ThumbUpIcon} from '@common/icons/material/ThumbUp';\nimport {ThumbDownIcon} from '@common/icons/material/ThumbDown';\nimport {VotableModel} from '@common/votes/votable-model';\nimport {Button} from '@common/ui/buttons/button';\nimport {useStoreVote} from '@common/votes/requests/use-store-vote';\nimport {useState} from 'react';\nimport {FormattedNumber} from '@common/i18n/formatted-number';\nimport clsx from 'clsx';\n\ninterface Props {\n model: VotableModel;\n className?: string;\n showUpvotesOnly?: boolean;\n}\nexport function ThumbButtons({model, className, showUpvotesOnly}: Props) {\n const changeVote = useStoreVote(model);\n\n const [upvotes, setUpvotes] = useState(model.upvotes || 0);\n const [downvotes, setDownvotes] = useState(model.downvotes || 0);\n const [currentVote, setCurrentVote] = useState(model.current_vote);\n\n const syncLocalState = (model: VotableModel) => {\n setUpvotes(model.upvotes);\n setDownvotes(model.downvotes);\n setCurrentVote(model.current_vote);\n };\n\n return (\n
    \n {\n changeVote.mutate(\n {voteType: 'upvote'},\n {\n onSuccess: response => syncLocalState(response.model),\n },\n );\n }}\n >\n \n
    \n \n
    \n \n {!showUpvotesOnly && (\n {\n changeVote.mutate(\n {voteType: 'downvote'},\n {\n onSuccess: response => syncLocalState(response.model),\n },\n );\n }}\n >\n \n
    \n \n
    \n \n )}\n
    \n );\n}\n","import {useMutation} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {showHttpErrorToast} from '@common/utils/http/show-http-error-toast';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {Reportable} from '@common/reports/Reportable';\n\ninterface Response extends BackendResponse {\n model: Reportable;\n}\n\ninterface Payload {\n reason?: string;\n}\n\nexport function useSubmitReport(model: Reportable) {\n return useMutation({\n mutationFn: (payload: Payload) => submitReport(model, payload),\n onSuccess: () => {\n toast(message('Thanks for reporting. We will review this content.'));\n },\n onError: err => showHttpErrorToast(err),\n });\n}\n\nfunction submitReport(model: Reportable, payload: Payload) {\n return apiClient\n .post('report', {\n reason: payload.reason,\n model_id: model.id,\n model_type: model.model_type,\n })\n .then(r => r.data);\n}\n","import React, {Fragment, memo, useContext, useState} from 'react';\nimport {SiteConfigContext} from '@common/core/settings/site-config-context';\nimport {Link} from 'react-router-dom';\nimport {Comment} from '@common/comments/comment';\nimport {useAuth} from '@common/auth/use-auth';\nimport {UserAvatar} from '@common/ui/images/user-avatar';\nimport {Button} from '@common/ui/buttons/button';\nimport {Trans} from '@common/i18n/trans';\nimport {NewCommentForm} from '@common/comments/new-comment-form';\nimport {User} from '@common/auth/user';\nimport {Commentable} from '@common/comments/commentable';\nimport {useDeleteComments} from '@common/comments/requests/use-delete-comments';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {queryClient} from '@common/http/query-client';\nimport {ConfirmationDialog} from '@common/ui/overlays/dialog/confirmation-dialog';\nimport {FormattedDuration} from '@common/i18n/formatted-duration';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\nimport {ThumbButtons} from '@common/votes/thumb-buttons';\nimport {ReplyIcon} from '@common/icons/material/Reply';\nimport {MoreVertIcon} from '@common/icons/material/MoreVert';\nimport {\n Menu,\n MenuItem,\n MenuTrigger,\n} from '@common/ui/navigation/menu/menu-trigger';\nimport {FormattedRelativeTime} from '@common/i18n/formatted-relative-time';\nimport {useSubmitReport} from '@common/reports/requests/use-submit-report';\n\ninterface CommentListItemProps {\n comment: Comment;\n commentable: Commentable;\n canDelete?: boolean;\n}\nexport function CommentListItem({\n comment,\n commentable,\n // user can delete comment if they have created it, or they have relevant permissions on commentable\n canDelete,\n}: CommentListItemProps) {\n const isMobile = useIsMobileMediaQuery();\n const {user, hasPermission} = useAuth();\n const [replyFormVisible, setReplyFormVisible] = useState(false);\n const showReplyButton =\n user != null &&\n !comment.deleted &&\n !isMobile &&\n comment.depth < 5 &&\n hasPermission('comments.create');\n\n return (\n {\n if (isMobile) {\n setReplyFormVisible(!replyFormVisible);\n }\n }}\n >\n
    \n \n
    \n
    \n {comment.user && }\n \n {comment.position ? (\n \n ) : null}\n
    \n
    \n {comment.deleted ? (\n \n \n \n ) : (\n comment.content\n )}\n
    \n {!comment.deleted && (\n
    \n {showReplyButton && (\n }\n onClick={() => setReplyFormVisible(!replyFormVisible)}\n >\n \n \n )}\n \n \n
    \n )}\n
    \n
    \n {replyFormVisible ? (\n {\n setReplyFormVisible(false);\n }}\n />\n ) : null}\n \n );\n}\n\ninterface PositionProps {\n commentable: Commentable;\n position: number;\n}\nconst Position = memo(({commentable, position}: PositionProps) => {\n if (!commentable.duration) return null;\n const seconds = (position / 100) * (commentable.duration / 1000);\n return (\n \n ,\n }}\n />\n \n );\n});\n\ninterface DeleteCommentsButtonProps {\n comment: Comment;\n canDelete?: boolean;\n user: User | null;\n}\nexport function CommentOptionsTrigger({\n comment,\n canDelete,\n user,\n}: DeleteCommentsButtonProps) {\n const deleteComments = useDeleteComments();\n const reportComment = useSubmitReport(comment);\n\n const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);\n const showDeleteButton =\n (comment.user_id === user?.id || canDelete) && !comment.deleted;\n\n const handleReport = () => {\n reportComment.mutate({});\n };\n\n const handleDelete = (isConfirmed: boolean) => {\n setIsDeleteDialogOpen(false);\n if (isConfirmed) {\n deleteComments.mutate(\n {commentIds: [comment.id]},\n {\n onSuccess: () => {\n queryClient.invalidateQueries({queryKey: ['comment']});\n },\n },\n );\n }\n };\n\n return (\n \n \n \n \n handleReport()}>\n \n \n {showDeleteButton && (\n setIsDeleteDialogOpen(true)}\n >\n \n \n )}\n \n \n handleDelete(isConfirmed)}\n >\n }\n body={\n \n }\n confirm={}\n />\n \n \n );\n}\n\ninterface UserDisplayNameProps {\n user: User;\n}\nfunction UserDisplayName({user}: UserDisplayNameProps) {\n const {auth} = useContext(SiteConfigContext);\n if (auth.getUserProfileLink) {\n return (\n \n {user.display_name}\n \n );\n }\n return
    {user.display_name}
    ;\n}\n","import {useAuth} from '@common/auth/use-auth';\nimport {Trans} from '@common/i18n/trans';\nimport {Link} from 'react-router-dom';\nimport {LinkStyle} from '@common/ui/buttons/external-link';\nimport {MessageDescriptor} from '@common/i18n/message-descriptor';\n\ninterface Props {\n message: MessageDescriptor;\n}\nexport function AccountRequiredCard({message}: Props) {\n const {user} = useAuth();\n if (user) return null;\n return (\n
    \n
    \n \n
    \n
    \n (\n \n {parts}\n \n ),\n r: parts => (\n \n {parts}\n \n ),\n }}\n />\n
    \n
    \n );\n}\n","import {Comment} from '@common/comments/comment';\nimport {Trans} from '@common/i18n/trans';\nimport {CommentIcon} from '@common/icons/material/Comment';\nimport {Commentable} from '@common/comments/commentable';\nimport {useComments} from '@common/comments/requests/use-comments';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {AnimatePresence, m} from 'framer-motion';\nimport {opacityAnimation} from '@common/ui/animation/opacity-animation';\nimport {FormattedNumber} from '@common/i18n/formatted-number';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {CommentListItem} from '@common/comments/comment-list/comment-list-item';\nimport {Skeleton} from '@common/ui/skeleton/skeleton';\nimport {ReactNode} from 'react';\nimport {AccountRequiredCard} from '@common/comments/comment-list/account-required-card';\nimport {message} from '@common/i18n/message';\n\nconst accountRequiredMessage = message(\n 'Please login or create account to comment'\n);\n\ninterface CommentListProps {\n commentable: Commentable;\n canDeleteAllComments?: boolean;\n className?: string;\n children?: ReactNode;\n perPage?: number;\n}\nexport function CommentList({\n className,\n commentable,\n canDeleteAllComments = false,\n children,\n perPage = 25,\n}: CommentListProps) {\n const {items, totalItems, ...query} = useComments(commentable, {perPage});\n\n if (query.isError) {\n return null;\n }\n\n return (\n
    \n
    \n \n {query.isInitialLoading ? (\n \n ) : (\n }}\n />\n )}\n
    \n {children}\n \n \n {query.isInitialLoading ? (\n \n ) : (\n \n )}\n \n \n
    \n );\n}\n\ninterface CommentListItemsProps {\n comments: Comment[];\n canDeleteAllComments: boolean;\n commentable: Commentable;\n}\nfunction CommentListItems({\n comments,\n commentable,\n canDeleteAllComments,\n}: CommentListItemsProps) {\n if (!comments.length) {\n return (\n }\n description={}\n />\n );\n }\n\n return (\n \n {comments.map(comment => (\n \n ))}\n \n );\n}\n\ninterface CommentSkeletonsProps {\n count: number;\n}\nfunction CommentSkeletons({count}: CommentSkeletonsProps) {\n return (\n \n {[...new Array(count).keys()].map(index => (\n \n \n
    \n \n \n
    \n \n \n \n
    \n
    \n \n ))}\n
    \n );\n}\n","import {useLinkifiedString} from '@common/utils/hooks/use-linkified-string';\nimport {Fragment, useRef, useState} from 'react';\nimport {Button} from '@common/ui/buttons/button';\nimport {Trans} from '@common/i18n/trans';\nimport clsx from 'clsx';\nimport {useLayoutEffect} from '@react-aria/utils';\n\ninterface TruncatedDescriptionProps {\n description?: string;\n className?: string;\n}\n\nexport function TruncatedDescription({\n description,\n className,\n}: TruncatedDescriptionProps) {\n const linkifiedDescription = useLinkifiedString(description);\n const wrapperRef = useRef(null);\n const contentRef = useRef(null);\n const [isOverflowing, setIsOverflowing] = useState(false);\n const [isShowingAll, setIsShowingAll] = useState(false);\n\n useLayoutEffect(() => {\n const wrapperHeight =\n wrapperRef.current?.getBoundingClientRect().height || 0;\n const contentHeight = wrapperRef.current?.scrollHeight || 0;\n if (contentHeight > wrapperHeight) {\n setIsOverflowing(true);\n }\n }, []);\n\n if (!linkifiedDescription) return null;\n\n return (\n \n \n \n \n {isOverflowing && (\n setIsShowingAll(!isShowingAll)}\n >\n {isShowingAll ? (\n \n ) : (\n \n )}\n \n )}\n \n );\n}\n","import {useSettings} from '@common/core/settings/use-settings';\nimport {useAuth} from '@common/auth/use-auth';\n\nexport function useCommentPermissions() {\n const {player} = useSettings();\n const {hasPermission} = useAuth();\n const canView = player?.track_comments && hasPermission('comments.view');\n return {canView, canCreate: canView && hasPermission('comments.create')};\n}\n","import {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {Trans} from '@common/i18n/trans';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport React, {Fragment} from 'react';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {useAlbum} from '@app/web-player/albums/requests/use-album';\nimport {\n actionButtonClassName,\n MediaPageHeaderLayout,\n} from '@app/web-player/layout/media-page-header-layout';\nimport {AvatarGroup} from '@common/ui/images/avatar-group';\nimport {Avatar} from '@common/ui/images/avatar';\nimport {FormattedDuration} from '@common/i18n/formatted-duration';\nimport {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {AlbumImage} from '@app/web-player/albums/album-image/album-image';\nimport {Album} from '@app/web-player/albums/album';\nimport {getSmallArtistImage} from '@app/web-player/artists/artist-image/small-artist-image';\nimport {getArtistLink} from '@app/web-player/artists/artist-link';\nimport {FormattedDate} from '@common/i18n/formatted-date';\nimport {useSortableTableData} from '@common/ui/tables/use-sortable-table-data';\nimport {BulletSeparatedItems} from '@app/web-player/layout/bullet-separated-items';\nimport {CommentList} from '@common/comments/comment-list/comment-list';\nimport {useAlbumPermissions} from '@app/web-player/albums/use-album-permissions';\nimport {PageStatus} from '@common/http/page-status';\nimport {PageMetaTags} from '@common/http/page-meta-tags';\nimport {TrackActionsBar} from '@app/web-player/tracks/track-actions-bar';\nimport {FocusScope} from '@react-aria/focus';\nimport {ChipList} from '@common/ui/forms/input-field/chip-field/chip-list';\nimport {Chip} from '@common/ui/forms/input-field/chip-field/chip';\nimport {Link} from 'react-router-dom';\nimport {TruncatedDescription} from '@common/ui/truncated-description';\nimport {CommentBarContextProvider} from '@app/web-player/tracks/waveform/comment-bar-context';\nimport {CommentBarNewCommentForm} from '@app/web-player/tracks/waveform/comment-bar-new-comment-form';\nimport {AdHost} from '@common/admin/ads/ad-host';\nimport {useCommentPermissions} from '@app/web-player/tracks/hooks/use-comment-permissions';\n\nexport function AlbumPage() {\n const {canView: showComments, canCreate: allowCommenting} =\n useCommentPermissions();\n const query = useAlbum({loader: 'albumPage'});\n const {canEdit} = useAlbumPermissions(query.data?.album);\n\n if (query.data) {\n return (\n
    \n \n \n \n \n {allowCommenting ? (\n \n ) : null}\n \n {query.data.album.tags?.length ? (\n \n \n {query.data.album.tags.map(tag => (\n \n #{tag.display_name || tag.name}\n \n ))}\n \n \n ) : null}\n \n \n \n {showComments && (\n \n )}\n \n
    \n );\n }\n\n return (\n \n );\n}\n\ninterface AlbumTrackTableProps {\n album: Album;\n}\nfunction AlbumTrackTable({album}: AlbumTrackTableProps) {\n const {data, sortDescriptor, onSortChange} = useSortableTableData(\n album.tracks,\n );\n return (\n
    \n \n {!album.tracks?.length ? (\n }\n description={\n \n }\n />\n ) : null}\n
    \n );\n}\n\ninterface PlaylistPageHeaderProps {\n album: Album;\n}\nfunction AlbumPageHeader({album}: PlaylistPageHeaderProps) {\n const totalDuration = album.tracks?.reduce(\n (t, track) => t + (track.duration || 0),\n 0,\n );\n\n return (\n \n }\n title={album.name}\n subtitle={\n \n {album.artists?.map(artist => (\n \n ))}\n \n }\n description={\n \n {album.tracks?.length ? (\n \n ) : null}\n {album.tracks?.length ? (\n \n ) : null}\n \n \n }\n actionButtons={\n \n \n \n }\n />\n \n );\n}\n","import {\n useInfiniteData,\n UseInfiniteDataProps,\n} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {Track} from '@app/web-player/tracks/track';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\n\nexport const libraryTracksQueryKey = (userId: number | 'me') => {\n const user = getBootstrapData().user;\n // make sure we are using \"me\" as ID for current user\n // everywhere, so it's easier to invalidate queries\n if (userId === user?.id) {\n userId = 'me';\n }\n return ['tracks', 'library', userId];\n};\n\nexport function useUserLikedTracks(\n userId: number | 'me',\n options?: Partial>\n) {\n return useInfiniteData({\n queryKey: libraryTracksQueryKey(userId),\n endpoint: `users/${userId}/liked-tracks`,\n defaultOrderBy: 'likes.created_at',\n defaultOrderDir: 'desc',\n ...options,\n });\n}\n","import {StaticPageTitle} from '@common/seo/static-page-title';\nimport {Trans} from '@common/i18n/trans';\nimport {useLibraryStore} from '@app/web-player/library/state/likes-store';\nimport React from 'react';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport {VirtualTableBody} from '@app/web-player/playlists/virtual-table-body';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {useAuth} from '@common/auth/use-auth';\nimport {TextField} from '@common/ui/forms/input-field/text-field/text-field';\nimport {SearchIcon} from '@common/icons/material/Search';\nimport {message} from '@common/i18n/message';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {PageErrorMessage} from '@common/errors/page-error-message';\nimport {TableDataItem} from '@common/ui/tables/types/table-data-item';\nimport {MediaPageNoResultsMessage} from '@app/web-player/layout/media-page-no-results-message';\nimport {useUserLikedTracks} from '@app/web-player/library/requests/use-user-liked-tracks';\nimport {AdHost} from '@common/admin/ads/ad-host';\n\nexport function LibraryTracksPage() {\n const trackCount = useLibraryStore(s => Object.keys(s.track).length);\n\n const query = useUserLikedTracks('me', {willSortOrFilter: true});\n const {\n isInitialLoading,\n sortDescriptor,\n setSortDescriptor,\n searchQuery,\n setSearchQuery,\n items,\n isError,\n } = query;\n\n const {user} = useAuth();\n const {trans} = useTrans();\n const queueId = queueGroupId(user!, 'libraryTracks', sortDescriptor);\n\n if (isError) {\n return ;\n }\n\n return (\n
    \n \n \n \n \n
    \n

    \n {trackCount ? (\n \n ) : (\n \n )}\n

    \n \n setSearchQuery(e.target.value)}\n className=\"max-w-512 flex-auto\"\n size=\"sm\"\n startAdornment={}\n placeholder={trans(message('Search within tracks'))}\n />\n
    \n }\n />\n {!items.length && !isInitialLoading && (\n \n }\n />\n )}\n \n
    \n );\n}\n\nfunction getPlaceholderItems(totalTracks: number): TableDataItem[] {\n // 30 tracks per page by default\n return [...new Array(Math.min(totalTracks, 30)).keys()].map((key, index) => {\n return {\n isPlaceholder: true,\n id: `placeholder-${key}`,\n };\n });\n}\n","import {SortDescriptor} from '@common/ui/tables/types/sort-descriptor';\nimport {Menu, MenuTrigger} from '@common/ui/navigation/menu/menu-trigger';\nimport {Button} from '@common/ui/buttons/button';\nimport {ArrowDropDownIcon} from '@common/icons/material/ArrowDropDown';\nimport {Trans} from '@common/i18n/trans';\nimport {Item} from '@common/ui/forms/listbox/item';\nimport React from 'react';\nimport {MessageDescriptor} from '@common/i18n/message-descriptor';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {SortIcon} from '@common/icons/material/Sort';\n\ninterface Props {\n items: Record;\n sortDescriptor: SortDescriptor;\n setSortDescriptor: (sort: SortDescriptor) => void;\n}\nexport function LibraryPageSortDropdown({\n items,\n sortDescriptor,\n setSortDescriptor,\n}: Props) {\n const isMobile = useIsMobileMediaQuery();\n const selectedValue = `${sortDescriptor.orderBy}:${sortDescriptor.orderDir}`;\n return (\n {\n const [orderBy, orderDir] = (newValue as string).split(':');\n setSortDescriptor({\n orderBy,\n orderDir: orderDir as SortDescriptor['orderDir'],\n });\n }}\n >\n {isMobile ? (\n \n \n \n ) : (\n }\n >\n \n \n )}\n \n {Object.entries(items).map(([value, label]) => (\n \n \n \n ))}\n \n \n );\n}\n","import {\n useInfiniteData,\n UseInfiniteDataProps,\n} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {Album} from '@app/web-player/albums/album';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\n\nexport const libraryAlbumsQueryKey = (\n userId: number | 'me',\n queryParams?: Record\n) => {\n const user = getBootstrapData().user;\n // make sure we are using \"me\" as ID for current user\n // everywhere, so it's easier to invalidate queries\n if (userId === user?.id) {\n userId = 'me';\n }\n const key: any[] = ['albums', 'library', userId];\n if (queryParams) {\n key.push(queryParams);\n }\n return key;\n};\n\nexport function useUserLikedAlbums(\n userId: number | 'me',\n options?: Partial>\n) {\n return useInfiniteData({\n queryKey: libraryAlbumsQueryKey(userId),\n endpoint: `users/${userId}/liked-albums`,\n defaultOrderBy: 'likes.created_at',\n defaultOrderDir: 'desc',\n ...options,\n });\n}\n","import {StaticPageTitle} from '@common/seo/static-page-title';\nimport {Trans} from '@common/i18n/trans';\nimport {useLibraryStore} from '@app/web-player/library/state/likes-store';\nimport React from 'react';\nimport {TextField} from '@common/ui/forms/input-field/text-field/text-field';\nimport {SearchIcon} from '@common/icons/material/Search';\nimport {message} from '@common/i18n/message';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {PageErrorMessage} from '@common/errors/page-error-message';\nimport {AlbumGridItem} from '@app/web-player/albums/album-grid-item';\nimport {ContentGrid} from '@app/web-player/playable-item/content-grid';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {AnimatePresence, m} from 'framer-motion';\nimport {opacityAnimation} from '@common/ui/animation/opacity-animation';\nimport {MediaPageNoResultsMessage} from '@app/web-player/layout/media-page-no-results-message';\nimport {PlayableMediaGridSkeleton} from '@app/web-player/playable-item/player-media-grid-skeleton';\nimport {LibraryPageSortDropdown} from '@app/web-player/library/library-page-sort-dropdown';\nimport {useUserLikedAlbums} from '@app/web-player/library/requests/use-user-liked-albums';\nimport {AdHost} from '@common/admin/ads/ad-host';\n\nconst sortItems = {\n 'likes.created_at:desc': message('Recently added'),\n 'name:asc': message('A-Z'),\n 'release_date:desc': message('Release date'),\n};\n\nexport function LibraryAlbumsPage() {\n const {trans} = useTrans();\n const totalItems = useLibraryStore(s => Object.keys(s.album).length);\n const query = useUserLikedAlbums('me', {willSortOrFilter: true});\n const {\n isLoading,\n sortDescriptor,\n setSortDescriptor,\n searchQuery,\n setSearchQuery,\n items,\n isError,\n } = query;\n\n if (isError) {\n return ;\n }\n\n return (\n
    \n \n \n \n \n

    \n {totalItems ? (\n \n ) : (\n \n )}\n

    \n
    \n setSearchQuery(e.target.value)}\n className=\"max-w-512 flex-auto\"\n size=\"sm\"\n startAdornment={}\n placeholder={trans(message('Search within albums'))}\n />\n \n
    \n
    \n \n {isLoading ? (\n \n ) : (\n \n \n {items.map(album => (\n \n ))}\n \n \n \n )}\n \n
    \n {!items.length && !isLoading && (\n \n }\n />\n )}\n \n
    \n );\n}\n","import {\n useInfiniteData,\n UseInfiniteDataProps,\n} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\nimport {Artist} from '@app/web-player/artists/artist';\n\nexport const libraryArtistsQueryKey = (userId: number | 'me') => {\n const user = getBootstrapData().user;\n // make sure we are using \"me\" as ID for current user\n // everywhere, so it's easier to invalidate queries\n if (userId === user?.id) {\n userId = 'me';\n }\n return ['artists', 'library', userId];\n};\n\nexport function useUserLikedArtists(\n userId: number | 'me',\n options?: Partial>\n) {\n return useInfiniteData({\n queryKey: libraryArtistsQueryKey(userId),\n endpoint: `users/${userId}/liked-artists`,\n defaultOrderBy: 'likes.created_at',\n defaultOrderDir: 'desc',\n ...options,\n });\n}\n","import {StaticPageTitle} from '@common/seo/static-page-title';\nimport {Trans} from '@common/i18n/trans';\nimport {useLibraryStore} from '@app/web-player/library/state/likes-store';\nimport React from 'react';\nimport {TextField} from '@common/ui/forms/input-field/text-field/text-field';\nimport {SearchIcon} from '@common/icons/material/Search';\nimport {message} from '@common/i18n/message';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {PageErrorMessage} from '@common/errors/page-error-message';\nimport {ContentGrid} from '@app/web-player/playable-item/content-grid';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {AnimatePresence, m} from 'framer-motion';\nimport {opacityAnimation} from '@common/ui/animation/opacity-animation';\nimport {MediaPageNoResultsMessage} from '@app/web-player/layout/media-page-no-results-message';\nimport {ArtistGridItem} from '@app/web-player/artists/artist-grid-item';\nimport {PlayableMediaGridSkeleton} from '@app/web-player/playable-item/player-media-grid-skeleton';\nimport {LibraryPageSortDropdown} from '@app/web-player/library/library-page-sort-dropdown';\nimport {useUserLikedArtists} from '@app/web-player/library/requests/use-user-liked-artists';\nimport {AdHost} from '@common/admin/ads/ad-host';\n\nconst sortItems = {\n 'likes.created_at:desc': message('Recently added'),\n 'name:asc': message('A-Z'),\n};\n\nexport function LibraryArtistsPage() {\n const {trans} = useTrans();\n const totalItems = useLibraryStore(s => Object.keys(s.artist).length);\n const query = useUserLikedArtists('me', {willSortOrFilter: true});\n const {\n isInitialLoading,\n sortDescriptor,\n setSortDescriptor,\n searchQuery,\n setSearchQuery,\n items,\n isError,\n } = query;\n\n if (isError) {\n return ;\n }\n\n return (\n
    \n \n \n \n \n

    \n {totalItems ? (\n \n ) : (\n \n )}\n

    \n
    \n setSearchQuery(e.target.value)}\n className=\"max-w-512 flex-auto\"\n size=\"sm\"\n startAdornment={}\n placeholder={trans(message('Search within artists'))}\n />\n \n
    \n
    \n \n {isInitialLoading ? (\n \n ) : (\n \n \n {items.map(artist => (\n \n ))}\n \n \n \n )}\n \n
    \n {!items.length && !isInitialLoading && (\n \n }\n />\n )}\n \n
    \n );\n}\n","import {StaticPageTitle} from '@common/seo/static-page-title';\nimport {Trans} from '@common/i18n/trans';\nimport React from 'react';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport {VirtualTableBody} from '@app/web-player/playlists/virtual-table-body';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {useAuth} from '@common/auth/use-auth';\nimport {TextField} from '@common/ui/forms/input-field/text-field/text-field';\nimport {SearchIcon} from '@common/icons/material/Search';\nimport {message} from '@common/i18n/message';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {PageErrorMessage} from '@common/errors/page-error-message';\nimport {TableDataItem} from '@common/ui/tables/types/table-data-item';\nimport {MediaPageNoResultsMessage} from '@app/web-player/layout/media-page-no-results-message';\nimport {Track} from '@app/web-player/tracks/track';\nimport {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {AdHost} from '@common/admin/ads/ad-host';\n\nexport const libraryHistoryQueryKey = ['tracks', 'history', 'me'];\n\nexport function LibraryHistoryPage() {\n const {user} = useAuth();\n\n const query = useInfiniteData({\n queryKey: libraryHistoryQueryKey,\n endpoint: `tracks/plays/${user!.id}`,\n defaultOrderBy: 'track_plays.created_at',\n defaultOrderDir: 'desc',\n paginate: 'simple',\n willSortOrFilter: false,\n });\n const {isInitialLoading, searchQuery, setSearchQuery, items, isError} = query;\n\n const {trans} = useTrans();\n const queueId = queueGroupId(user!, 'playHistory');\n\n if (isError) {\n return ;\n }\n\n return (\n
    \n \n \n \n \n
    \n

    \n \n

    \n \n setSearchQuery(e.target.value)}\n className=\"max-w-512 flex-auto\"\n size=\"sm\"\n startAdornment={}\n placeholder={trans(message('Search within history'))}\n />\n
    \n }\n />\n {!items.length && !isInitialLoading && (\n }\n />\n )}\n \n
    \n );\n}\n\nfunction getPlaceholderItems(): TableDataItem[] {\n // 30 tracks per page by default\n return [...new Array(10).keys()].map(key => {\n return {\n isPlaceholder: true,\n id: `placeholder-${key}`,\n };\n });\n}\n","import {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {Trans} from '@common/i18n/trans';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport React, {Fragment} from 'react';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {\n actionButtonClassName,\n MediaPageHeaderLayout,\n} from '@app/web-player/layout/media-page-header-layout';\nimport {AvatarGroup} from '@common/ui/images/avatar-group';\nimport {Avatar} from '@common/ui/images/avatar';\nimport {FormattedDuration} from '@common/i18n/formatted-duration';\nimport {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {Album} from '@app/web-player/albums/album';\nimport {getSmallArtistImage} from '@app/web-player/artists/artist-image/small-artist-image';\nimport {getArtistLink} from '@app/web-player/artists/artist-link';\nimport {FormattedDate} from '@common/i18n/formatted-date';\nimport {useSortableTableData} from '@common/ui/tables/use-sortable-table-data';\nimport {BulletSeparatedItems} from '@app/web-player/layout/bullet-separated-items';\nimport {CommentList} from '@common/comments/comment-list/comment-list';\nimport {useTrack} from '@app/web-player/tracks/requests/use-track';\nimport {useTrackPermissions} from '@app/web-player/tracks/hooks/use-track-permissions';\nimport {Track} from '@app/web-player/tracks/track';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {AlbumImage} from '@app/web-player/albums/album-image/album-image';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {FormattedNumber} from '@common/i18n/formatted-number';\nimport {TruncatedDescription} from '@common/ui/truncated-description';\nimport {Waveform} from '@app/web-player/tracks/waveform/waveform';\nimport {CommentBarContextProvider} from '@app/web-player/tracks/waveform/comment-bar-context';\nimport {CommentBarNewCommentForm} from '@app/web-player/tracks/waveform/comment-bar-new-comment-form';\nimport {GenreLink} from '@app/web-player/genres/genre-link';\nimport {PageMetaTags} from '@common/http/page-meta-tags';\nimport {PageStatus} from '@common/http/page-status';\nimport {TrackActionsBar} from '@app/web-player/tracks/track-actions-bar';\nimport {Chip} from '@common/ui/forms/input-field/chip-field/chip';\nimport {ChipList} from '@common/ui/forms/input-field/chip-field/chip-list';\nimport {Link} from 'react-router-dom';\nimport {FocusScope} from '@react-aria/focus';\nimport {trackIsLocallyUploaded} from '@app/web-player/tracks/utils/track-is-locally-uploaded';\nimport {AdHost} from '@common/admin/ads/ad-host';\nimport {useCommentPermissions} from '@app/web-player/tracks/hooks/use-comment-permissions';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\n\nexport function TrackPage() {\n const {canView: showComments, canCreate: allowCommenting} =\n useCommentPermissions();\n const query = useTrack({loader: 'trackPage'});\n const {canEdit} = useTrackPermissions([query.data?.track]);\n\n if (query.data) {\n return (\n
    \n \n \n \n \n {allowCommenting ? (\n \n ) : null}\n \n {query.data.track.tags.length ? (\n \n \n {query.data.track.tags.map(tag => (\n \n #{tag.display_name || tag.name}\n \n ))}\n \n \n ) : null}\n \n {showComments ? (\n \n ) : null}\n {query.data.track.album && (\n \n )}\n \n
    \n );\n }\n\n return (\n \n );\n}\n\ninterface AlbumTrackTableProps {\n album: Album;\n}\nfunction AlbumTrackTable({album}: AlbumTrackTableProps) {\n const {data, sortDescriptor, onSortChange} = useSortableTableData(\n album.tracks,\n );\n return (\n
    \n
    \n \n
    \n
    \n \n
    \n
    {album.name}
    \n
    \n
    \n \n {!album.tracks?.length ? (\n }\n description={\n \n }\n />\n ) : null}\n
    \n );\n}\n\ninterface TrackPageHeaderProps {\n track: Track;\n}\nfunction TrackPageHeader({track}: TrackPageHeaderProps) {\n const isMobile = useIsMobileMediaQuery();\n const {player} = useSettings();\n const releaseDate = track.album?.release_date || track.created_at;\n const genre = track.genres?.[0];\n\n const showWave =\n !isMobile &&\n player?.seekbar_type === 'waveform' &&\n trackIsLocallyUploaded(track);\n\n return (\n \n }\n title={track.name}\n subtitle={\n \n {track.artists?.map(artist => (\n \n ))}\n \n }\n description={\n \n {track.duration ? (\n \n ) : null}\n {releaseDate && }\n {genre && }\n {track.plays && !player?.enable_repost ? (\n }}\n />\n ) : null}\n \n }\n actionButtons={\n \n \n \n }\n footer={\n showWave ? (\n \n ) : undefined\n }\n />\n \n );\n}\n","import {useQuery} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useParams} from 'react-router-dom';\nimport {User} from '@common/auth/user';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\n\nexport interface GetUserProfileResponse extends BackendResponse {\n user: User;\n loader: Params['loader'];\n}\n\ninterface Params {\n loader: 'userProfilePage';\n}\n\nexport function useUserProfile(params: Params) {\n const {userId} = useParams();\n return useQuery({\n queryKey: userProfileQueryKey(userId!),\n queryFn: () => fetchUser(userId!, params),\n initialData: () => {\n const data = getBootstrapData().loaders?.[params.loader];\n if (data?.user?.id == userId && data?.loader === params.loader) {\n return data;\n }\n return undefined;\n },\n });\n}\n\nfunction fetchUser(userId: number | string, params: Params) {\n return apiClient\n .get(`user-profile/${userId}`, {params})\n .then(response => response.data);\n}\n\nexport function userProfileQueryKey(userId: number | string) {\n return ['users', +userId, 'profile'];\n}\n","import {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {Repost} from '@app/web-player/reposts/repost';\nimport {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {AudiotrackIcon} from '@common/icons/material/Audiotrack';\nimport {Trans} from '@common/i18n/trans';\nimport {TrackListItem} from '@app/web-player/tracks/track-list/track-list-item';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport React from 'react';\nimport {ProfileContentProps} from '@app/web-player/user-profile/user-profile-page';\nimport {AlbumListItem} from '@app/web-player/albums/album-list/album-list-item';\nimport {ContentGrid} from '@app/web-player/playable-item/content-grid';\nimport {TrackGridItem} from '@app/web-player/tracks/track-grid-item';\nimport {AlbumGridItem} from '@app/web-player/albums/album-grid-item';\nimport {useIsMobileMediaQuery} from '@common/utils/hooks/is-mobile-media-query';\n\nexport function ProfileRepostsPanel({user}: ProfileContentProps) {\n const isMobile = useIsMobileMediaQuery();\n const query = useInfiniteData({\n queryKey: ['reposts', user.id],\n endpoint: `users/${user.id}/reposts`,\n });\n\n if (query.isLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n title={}\n description={\n \n }\n />\n );\n }\n\n if (isMobile) {\n return (\n
    \n \n {query.items.map(repost => {\n if (repost.repostable?.model_type === 'track') {\n return (\n \n );\n } else if (repost.repostable?.model_type === 'album') {\n return (\n \n );\n }\n return null;\n })}\n \n \n
    \n );\n }\n\n return (\n
    \n {query.items.map(repost => {\n if (repost.repostable?.model_type === 'track') {\n return (\n \n );\n } else if (repost.repostable?.model_type === 'album') {\n return (\n \n );\n }\n return null;\n })}\n \n
    \n );\n}\n","import {useUserLikedTracks} from '@app/web-player/library/requests/use-user-liked-tracks';\nimport {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {AudiotrackIcon} from '@common/icons/material/Audiotrack';\nimport {Trans} from '@common/i18n/trans';\nimport React from 'react';\nimport {ProfileContentProps} from '@app/web-player/user-profile/user-profile-page';\nimport {TrackList} from '@app/web-player/tracks/track-list/track-list';\n\nexport function ProfileTracksPanel({user}: ProfileContentProps) {\n const query = useUserLikedTracks(user.id);\n\n if (query.isLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n title={}\n description={\n \n }\n />\n );\n }\n\n return ;\n}\n","import {\n useInfiniteData,\n UseInfiniteDataProps,\n} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\nimport {Playlist} from '@app/web-player/playlists/playlist';\n\nexport const libraryPlaylistsQueryKey = (\n userId: number | 'me',\n queryParams?: Record\n) => {\n const user = getBootstrapData().user;\n // make sure we are using \"me\" as ID for current user\n // everywhere, so it's easier to invalidate queries\n if (userId === user?.id) {\n userId = 'me';\n }\n const key: any[] = ['playlists', 'library', userId];\n if (queryParams) {\n key.push(queryParams);\n }\n return key;\n};\n\nexport function useUserPlaylists(\n userId: number | 'me',\n options?: Partial>\n) {\n return useInfiniteData({\n queryKey: libraryPlaylistsQueryKey(userId),\n endpoint: `users/${userId}/playlists`,\n defaultOrderBy: 'updated_at',\n defaultOrderDir: 'desc',\n ...options,\n });\n}\n","import {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {Trans} from '@common/i18n/trans';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport React from 'react';\nimport {ProfileContentProps} from '@app/web-player/user-profile/user-profile-page';\nimport {ContentGrid} from '@app/web-player/playable-item/content-grid';\nimport {PlaylistGridItem} from '@app/web-player/playlists/playlist-grid-item';\nimport {QueueMusicIcon} from '@common/icons/material/QueueMusic';\nimport {useUserPlaylists} from '@app/web-player/library/requests/use-user-playlists';\n\nexport function ProfilePlaylistsPanel({user}: ProfileContentProps) {\n const query = useUserPlaylists(user.id);\n\n if (query.isInitialLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n title={}\n description={\n \n }\n />\n );\n }\n\n return (\n
    \n \n {query.items.map(playlist => (\n \n ))}\n \n \n
    \n );\n}\n","import {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {Trans} from '@common/i18n/trans';\nimport React from 'react';\nimport {ProfileContentProps} from '@app/web-player/user-profile/user-profile-page';\nimport {useUserLikedAlbums} from '@app/web-player/library/requests/use-user-liked-albums';\nimport {AlbumIcon} from '@common/icons/material/Album';\nimport {AlbumList} from '@app/web-player/albums/album-list/album-list';\n\nexport function ProfileAlbumsPanel({user}: ProfileContentProps) {\n const query = useUserLikedAlbums(user.id, {\n queryParams: {\n with: 'tracks',\n },\n });\n\n if (query.isInitialLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n title={}\n description={\n \n }\n />\n );\n }\n\n return ;\n}\n","import {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {Trans} from '@common/i18n/trans';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport React from 'react';\nimport {ProfileContentProps} from '@app/web-player/user-profile/user-profile-page';\nimport {ContentGrid} from '@app/web-player/playable-item/content-grid';\nimport {useUserLikedArtists} from '@app/web-player/library/requests/use-user-liked-artists';\nimport {MicIcon} from '@common/icons/material/Mic';\nimport {ArtistGridItem} from '@app/web-player/artists/artist-grid-item';\n\nexport function ProfileArtistsPanel({user}: ProfileContentProps) {\n const query = useUserLikedArtists(user.id);\n\n if (query.isInitialLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n title={}\n description={\n \n }\n />\n );\n }\n\n return (\n
    \n \n {query.items.map(artist => (\n \n ))}\n \n \n
    \n );\n}\n","import {Trans} from '@common/i18n/trans';\nimport {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {User} from '@common/auth/user';\nimport {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport React from 'react';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {BookmarkBorderIcon} from '@common/icons/material/BookmarkBorder';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {FollowerListItem} from '@app/web-player/artists/artist-page/followers-panel/follower-list-item';\n\ninterface Props {\n user: User;\n}\nexport function ProfileFollowersPanel({user}: Props) {\n const query = useInfiniteData({\n queryKey: ['users', user.id, 'followers'],\n endpoint: `users/${user.id}/followers`,\n });\n\n if (query.isLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n description={\n \n }\n />\n );\n }\n\n return (\n
    \n {query.items.map(follower => (\n \n ))}\n \n
    \n );\n}\n","import {Trans} from '@common/i18n/trans';\nimport {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {User} from '@common/auth/user';\nimport {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport React from 'react';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {BookmarkBorderIcon} from '@common/icons/material/BookmarkBorder';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {FollowerListItem} from '@app/web-player/artists/artist-page/followers-panel/follower-list-item';\n\ninterface Props {\n user: User;\n}\nexport function ProfileFollowedUsersPanel({user}: Props) {\n const query = useInfiniteData({\n queryKey: ['users', user.id, 'followed-users'],\n endpoint: `users/${user.id}/followed-users`,\n });\n\n if (query.isInitialLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n description={\n \n }\n />\n );\n }\n\n return (\n
    \n {query.items.map(follower => (\n \n ))}\n \n
    \n );\n}\n","import {useMutation} from '@tanstack/react-query';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {toast} from '@common/ui/toast/toast';\nimport {message} from '@common/i18n/message';\nimport {apiClient, queryClient} from '@common/http/query-client';\nimport {onFormQueryError} from '@common/errors/on-form-query-error';\nimport {UseFormReturn} from 'react-hook-form';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {Album} from '@app/web-player/albums/album';\nimport {useAuth} from '@common/auth/use-auth';\nimport {UserLink} from '@app/web-player/user-profile/user-link';\nimport {userProfileQueryKey} from '@app/web-player/user-profile/requests/use-user-profile';\n\ninterface Response extends BackendResponse {\n album: Album;\n}\n\nexport interface UpdateProfilePayload {\n user: {\n avatar?: string;\n first_name?: string;\n last_name?: string;\n username?: string;\n };\n profile: {\n city?: string;\n country?: string;\n description?: string;\n };\n links: UserLink[];\n}\n\nexport function useUpdateUserProfile(\n form: UseFormReturn,\n) {\n const {user} = useAuth();\n const {trans} = useTrans();\n return useMutation({\n mutationFn: (payload: UpdateProfilePayload) => updateProfile(payload),\n onSuccess: () => {\n toast(trans(message('Profile updated')));\n if (user) {\n queryClient.invalidateQueries({queryKey: userProfileQueryKey(user.id)});\n }\n },\n onError: err => onFormQueryError(err, form),\n });\n}\n\nfunction updateProfile(payload: UpdateProfilePayload): Promise {\n return apiClient.put('users/profile/update', payload).then(r => r.data);\n}\n","import {useController} from 'react-hook-form';\nimport {mergeProps} from '@react-aria/utils';\nimport React from 'react';\nimport {ComboBox, ComboboxProps} from './combobox';\n\ntype Props = ComboboxProps & {\n name: string;\n selectionMode?: 'single';\n};\nexport function FormComboBox({children, ...props}: Props) {\n const {\n field: {onChange, onBlur, value = '', ref},\n fieldState: {invalid, error},\n } = useController({\n name: props.name,\n });\n\n const formProps: Partial> = {\n onSelectionChange: onChange,\n onBlur,\n selectedValue: value,\n defaultInputValue: value,\n invalid,\n errorMessage: error?.message,\n };\n\n return (\n \n {children}\n \n );\n}\n","import {Dialog} from '@common/ui/overlays/dialog/dialog';\nimport {DialogHeader} from '@common/ui/overlays/dialog/dialog-header';\nimport {Trans} from '@common/i18n/trans';\nimport {DialogBody} from '@common/ui/overlays/dialog/dialog-body';\nimport {DialogFooter} from '@common/ui/overlays/dialog/dialog-footer';\nimport {Button} from '@common/ui/buttons/button';\nimport {useDialogContext} from '@common/ui/overlays/dialog/dialog-context';\nimport {\n UpdateProfilePayload,\n useUpdateUserProfile,\n} from '@app/web-player/user-profile/requests/use-update-user-profile';\nimport {useForm} from 'react-hook-form';\nimport {User} from '@common/auth/user';\nimport {Form} from '@common/ui/forms/form';\nimport {FormTextField} from '@common/ui/forms/input-field/text-field/text-field';\nimport {FormImageSelector} from '@common/ui/images/image-selector';\nimport {FileUploadProvider} from '@common/uploads/uploader/file-upload-provider';\nimport {ProfileLinksForm} from '@app/admin/artist-datatable-page/artist-form/profile-links-form';\nimport {Option} from '@common/ui/forms/combobox/combobox';\nimport {FormComboBox} from '@common/ui/forms/combobox/form-combobox';\nimport {useValueLists} from '@common/http/value-lists';\n\ninterface Props {\n user: User;\n}\nexport function EditProfileDialog({user}: Props) {\n const {close, formId} = useDialogContext();\n const {data} = useValueLists(['countries']);\n const form = useForm({\n defaultValues: {\n user: {\n username: user.username,\n avatar: user.avatar,\n first_name: user.first_name,\n last_name: user.last_name,\n },\n profile: {\n city: user.profile?.city,\n country: user.profile?.country,\n description: user.profile?.description,\n },\n links: user.links,\n },\n });\n const updateProfile = useUpdateUserProfile(form);\n return (\n \n \n \n \n \n \n updateProfile.mutate(values, {onSuccess: () => close()})\n }\n >\n \n
    \n }\n name=\"user.avatar\"\n diskPrefix=\"avatars\"\n variant=\"square\"\n previewSize=\"w-200 h-200\"\n className=\"max-md:mb-20\"\n />\n
    \n }\n className=\"mb-24\"\n />\n
    \n }\n className=\"flex-1 mb-24\"\n />\n }\n className=\"flex-1 mb-24\"\n />\n
    \n
    \n }\n className=\"flex-1 mb-24\"\n />\n }\n >\n {data?.countries?.map(country => (\n \n ))}\n \n
    \n }\n inputElementType=\"textarea\"\n rows={4}\n />\n
    \n
    \n
    \n
    \n \n
    \n \n
    \n
    \n \n
    \n \n {\n close();\n }}\n >\n \n \n \n \n \n \n
    \n );\n}\n","import {useAuth} from '@common/auth/use-auth';\nimport {\n actionButtonClassName,\n MediaPageHeaderLayout,\n} from '@app/web-player/layout/media-page-header-layout';\nimport {UserImage} from '@app/web-player/users/user-image';\nimport {BulletSeparatedItems} from '@app/web-player/layout/bullet-separated-items';\nimport {Link} from 'react-router-dom';\nimport {Trans} from '@common/i18n/trans';\nimport {ProfileDescription} from '@app/web-player/user-profile/profile-description';\nimport React from 'react';\nimport {User} from '@common/auth/user';\nimport {Button} from '@common/ui/buttons/button';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {EditIcon} from '@common/icons/material/Edit';\nimport {EditProfileDialog} from '@app/web-player/user-profile/edit-profile-dialog';\nimport {FollowButton} from '@common/users/follow-button';\n\ninterface ProfileHeaderProps {\n user: User;\n tabLink: (tabName: string) => string;\n}\n\nexport function ProfileHeader({user, tabLink}: ProfileHeaderProps) {\n const {user: currentUser} = useAuth();\n\n return (\n \n }\n title={user.display_name}\n subtitle={\n \n {user.followers_count && user.followers_count > 0 ? (\n \n \n \n ) : null}\n {user.followed_users_count && user.followed_users_count > 0 ? (\n \n \n \n ) : null}\n \n }\n actionButtons={\n
    \n \n {currentUser?.id === user.id && }\n
    \n }\n footer={}\n />\n );\n}\n\ninterface EditButtonProps {\n user: User;\n}\n\nfunction EditButton({user}: EditButtonProps) {\n return (\n \n }\n className={actionButtonClassName()}\n >\n \n \n \n \n );\n}\n","import {useUserProfile} from '@app/web-player/user-profile/requests/use-user-profile';\nimport {User} from '@common/auth/user';\nimport {PageStatus} from '@common/http/page-status';\nimport React, {Fragment, useCallback} from 'react';\nimport {Tabs} from '@common/ui/tabs/tabs';\nimport {TabList} from '@common/ui/tabs/tab-list';\nimport {Tab} from '@common/ui/tabs/tab';\nimport {Trans} from '@common/i18n/trans';\nimport {TabPanel, TabPanels} from '@common/ui/tabs/tab-panels';\nimport {Link, useParams} from 'react-router-dom';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {ProfileRepostsPanel} from '@app/web-player/user-profile/panels/profile-reposts-panel';\nimport {ProfileTracksPanel} from '@app/web-player/user-profile/panels/profile-tracks-panel';\nimport {ProfilePlaylistsPanel} from '@app/web-player/user-profile/panels/profile-playlists-panel';\nimport {ProfileAlbumsPanel} from '@app/web-player/user-profile/panels/profile-albums-panel';\nimport {ProfileArtistsPanel} from '@app/web-player/user-profile/panels/profile-artists-panel';\nimport {ProfileFollowersPanel} from '@app/web-player/user-profile/panels/profile-followers-panel';\nimport {ProfileFollowedUsersPanel} from '@app/web-player/user-profile/panels/profile-followed-users-panel';\nimport {ProfileHeader} from '@app/web-player/user-profile/header/profile-header';\nimport {getBootstrapData} from '@common/core/bootstrap-data/use-backend-bootstrap-data';\n\nconst profileTabs = [\n 'tracks',\n 'playlists',\n 'reposts',\n 'albums',\n 'artists',\n 'followers',\n 'following',\n];\n\nif (!getBootstrapData().settings.player?.enable_repost) {\n profileTabs.splice(2, 1);\n}\n\nexport function UserProfilePage() {\n const query = useUserProfile({loader: 'userProfilePage'});\n\n if (query.data) {\n return ;\n }\n\n return (\n \n );\n}\n\nexport interface ProfileContentProps {\n user: User;\n}\nfunction PageContent({user}: ProfileContentProps) {\n const {player} = useSettings();\n const {tabName = 'tracks'} = useParams();\n\n const selectedTab = profileTabs.indexOf(tabName) || 0;\n\n const tabLink = useCallback(\n (tabName: string) => {\n return `/user/${user.id}/${user.display_name}/${tabName}`;\n },\n [user],\n );\n\n return (\n \n \n \n \n \n \n \n \n \n \n {player?.enable_repost && (\n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {player?.enable_repost && (\n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n","import {useInfiniteData} from '@common/ui/infinite-scroll/use-infinite-data';\nimport {Track} from '@app/web-player/tracks/track';\nimport {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {AudiotrackIcon} from '@common/icons/material/Audiotrack';\nimport {Trans} from '@common/i18n/trans';\nimport React, {useState} from 'react';\nimport {Link, useParams} from 'react-router-dom';\nimport {Album} from '@app/web-player/albums/album';\nimport {AlbumIcon} from '@common/icons/material/Album';\nimport {Tabs} from '@common/ui/tabs/tabs';\nimport {TabList} from '@common/ui/tabs/tab-list';\nimport {Tab} from '@common/ui/tabs/tab';\nimport {TabPanel, TabPanels} from '@common/ui/tabs/tab-panels';\nimport {TrackList} from '@app/web-player/tracks/track-list/track-list';\nimport {AlbumList} from '@app/web-player/albums/album-list/album-list';\n\nconst tagTabNames = {\n tracks: 0,\n albums: 1,\n};\n\nexport function TagMediaPage() {\n const params = useParams();\n const tagName = params.tagName!;\n const tabName = params['*']?.split('/').pop() || tagTabNames.tracks;\n const [selectedTab, setSelectedTab] = useState(\n tagTabNames[tabName as keyof typeof tagTabNames] || 0,\n );\n\n return (\n
    \n

    \n {tabName === 'albums' ? (\n \n ) : (\n \n )}\n

    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n );\n}\n\ninterface TracksPanelProps {\n tagName: string;\n}\nfunction AlbumsPanel({tagName}: TracksPanelProps) {\n const query = useInfiniteData({\n queryKey: ['albums', 'tags', tagName],\n endpoint: `tags/${tagName}/albums`,\n });\n\n if (query.isLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n title={}\n description={\n \n }\n />\n );\n }\n\n return ;\n}\n\nfunction TracksPanel({tagName}: TracksPanelProps) {\n const query = useInfiniteData({\n queryKey: ['tracks', 'tags', tagName],\n endpoint: `tags/${tagName}/tracks`,\n });\n\n if (query.isLoading) {\n return ;\n }\n\n if (!query.items.length) {\n return (\n }\n title={}\n description={\n \n }\n />\n );\n }\n\n return ;\n}\n","import {useQuery} from '@tanstack/react-query';\nimport {apiClient} from '@common/http/query-client';\nimport {BackendResponse} from '@common/http/backend-response/backend-response';\nimport {useParams} from 'react-router-dom';\nimport {Track} from '@app/web-player/tracks/track';\nimport {Artist} from '@app/web-player/artists/artist';\nimport {Genre} from '@app/web-player/genres/genre';\n\nexport type RadioSeed = Artist | Track | Genre;\n\ninterface Response extends BackendResponse {\n type: 'artist' | 'genre' | 'track';\n seed: RadioSeed;\n recommendations: Track[];\n}\n\nexport function useRadioRecommendations() {\n const {seedType, seedId} = useParams();\n return useQuery({\n queryKey: ['radio', seedType, +seedId!],\n queryFn: () => fetchRecommendations(seedType!, seedId!),\n // different suggestions are returned every time, don't reload in background\n staleTime: Infinity,\n });\n}\n\nfunction fetchRecommendations(seedType: string, seedId: string | number) {\n return apiClient\n .get(`radio/${seedType}/${seedId}`)\n .then(response => response.data);\n}\n","import React, {useMemo} from 'react';\nimport {PageMetaTags} from '@common/http/page-meta-tags';\nimport {PageStatus} from '@common/http/page-status';\nimport {\n RadioSeed,\n useRadioRecommendations,\n} from '@app/web-player/radio/requests/use-radio-recommendations';\nimport {useSortableTableData} from '@common/ui/tables/use-sortable-table-data';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport {\n actionButtonClassName,\n MediaPageHeaderLayout,\n} from '@app/web-player/layout/media-page-header-layout';\nimport {TrackImage} from '@app/web-player/tracks/track-image/track-image';\nimport {Trans} from '@common/i18n/trans';\nimport {BulletSeparatedItems} from '@app/web-player/layout/bullet-separated-items';\nimport {FormattedDuration} from '@common/i18n/formatted-duration';\nimport {PlaybackToggleButton} from '@app/web-player/playable-item/playback-toggle-button';\nimport {queueGroupId} from '@app/web-player/queue-group-id';\nimport {SmallArtistImage} from '@app/web-player/artists/artist-image/small-artist-image';\nimport {GenreImage} from '@app/web-player/genres/genre-image';\nimport {useParams} from 'react-router-dom';\nimport {NotFoundPage} from '@common/ui/not-found-page/not-found-page';\nimport {AdHost} from '@common/admin/ads/ad-host';\n\nconst validSeeds: RadioSeed['model_type'][] = ['artist', 'track', 'genre'];\n\nexport function RadioPage() {\n const {seedType} = useParams();\n const query = useRadioRecommendations();\n const {data, onSortChange, sortDescriptor} = useSortableTableData(\n query.data?.recommendations,\n );\n\n const totalDuration = useMemo(() => {\n return data.reduce((total, track) => {\n return total + (track.duration || 0);\n }, 0);\n }, [data]);\n\n if (!validSeeds.includes(seedType as any)) {\n return ;\n }\n\n if (query.data) {\n const seed = query.data.seed;\n const queueId = queueGroupId(seed, 'radio');\n return (\n
    \n \n \n }\n title={\n \n }\n subtitle={\n \n \n \n \n \n }\n actionButtons={\n
    \n \n
    \n }\n />\n \n \n
    \n );\n }\n\n return (\n \n );\n}\n\ninterface SeedImageProps {\n seed: RadioSeed;\n}\nfunction Image({seed}: SeedImageProps) {\n switch (seed.model_type) {\n case 'artist':\n return (\n \n );\n case 'genre':\n return (\n \n );\n default:\n return (\n \n );\n }\n}\n\nfunction RadioType({seed}: SeedImageProps) {\n switch (seed.model_type) {\n case 'artist':\n return ;\n case 'genre':\n return ;\n default:\n return ;\n }\n}\n","import {\n SearchResponse,\n useSearchResults,\n} from '@app/web-player/search/requests/use-search-results';\nimport {Link, useParams} from 'react-router-dom';\nimport {PageStatus} from '@common/http/page-status';\nimport React, {Fragment, ReactNode, useEffect, useMemo, useState} from 'react';\nimport {Tabs} from '@common/ui/tabs/tabs';\nimport {TabList} from '@common/ui/tabs/tab-list';\nimport {Tab} from '@common/ui/tabs/tab';\nimport {Trans} from '@common/i18n/trans';\nimport {TabPanel, TabPanels} from '@common/ui/tabs/tab-panels';\nimport {Track} from '@app/web-player/tracks/track';\nimport {TrackTable} from '@app/web-player/tracks/track-table/track-table';\nimport {KeyboardArrowRightIcon} from '@common/icons/material/KeyboardArrowRight';\nimport {ContentGrid} from '@app/web-player/playable-item/content-grid';\nimport {ArtistGridItem} from '@app/web-player/artists/artist-grid-item';\nimport {AlbumGridItem} from '@app/web-player/albums/album-grid-item';\nimport {PlaylistGridItem} from '@app/web-player/playlists/playlist-grid-item';\nimport {UserGridItem} from '@app/web-player/users/user-grid-item';\nimport {Artist} from '@app/web-player/artists/artist';\nimport {Album} from '@app/web-player/albums/album';\nimport {Playlist} from '@app/web-player/playlists/playlist';\nimport {User} from '@common/auth/user';\nimport {IllustratedMessage} from '@common/ui/images/illustrated-message';\nimport {SearchIcon} from '@common/icons/material/Search';\nimport {useSettings} from '@common/core/settings/use-settings';\nimport {UseQueryResult} from '@tanstack/react-query';\nimport {TextField} from '@common/ui/forms/input-field/text-field/text-field';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {message} from '@common/i18n/message';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\n\nexport function SearchResultsPage() {\n const {searchQuery} = useParams();\n const query = useSearchResults({\n loader: 'searchPage',\n query: searchQuery,\n });\n\n return (\n \n \n \n \n );\n}\n\nfunction MobileSearchBar() {\n const {searchQuery = ''} = useParams();\n const navigate = useNavigate();\n const {trans} = useTrans();\n\n return (\n {\n navigate(`/search/${e.target.value}`, {replace: true});\n }}\n autoFocus\n className=\"w-full md:hidden\"\n size=\"lg\"\n placeholder={trans(message('Search...'))}\n />\n );\n}\n\ninterface PageContentProps {\n query: UseQueryResult;\n}\nfunction PageContent({query}: PageContentProps) {\n const {branding} = useSettings();\n\n if (query.data) {\n return ;\n }\n\n if (query.fetchStatus === 'idle') {\n return (\n }\n imageHeight=\"h-auto\"\n imageMargin=\"mb-12\"\n title={\n \n }\n description={\n \n }\n />\n );\n }\n\n return (\n \n );\n}\n\ninterface SearchResultsProps {\n results: SearchResponse['results'];\n}\nfunction SearchResults({results}: SearchResultsProps) {\n const {tabName = 'all', searchQuery} = useParams();\n const tabNames = useMemo(() => {\n const names = ['tracks', 'artists', 'albums', 'playlists', 'users'].filter(\n tabName => results[tabName as keyof SearchResponse['results']]?.length,\n );\n return ['all', ...names];\n }, [results]);\n\n const tabIndex = tabNames.indexOf(tabName as any);\n\n const [selectedTab, setSelectedTab] = useState(tabIndex > -1 ? tabIndex : 0);\n\n // change tab when url changes\n useEffect(() => {\n if (tabIndex !== selectedTab) {\n setSelectedTab(tabIndex);\n }\n }, [tabIndex, selectedTab]);\n\n const tabLink = (tabName?: string) => {\n let base = `/search/${searchQuery}`;\n if (tabName) {\n base += `/${tabName}`;\n }\n return base;\n };\n\n const haveResults = Object.entries(results).some(\n ([, items]) => items?.length,\n );\n\n if (!haveResults) {\n return (\n }\n imageHeight=\"h-auto\"\n title={\n \n }\n description={}\n />\n );\n }\n\n return (\n \n \n \n \n \n {results.tracks?.length ? (\n \n \n \n ) : null}\n {results.artists?.length ? (\n \n \n \n ) : null}\n {results.albums?.length ? (\n \n \n \n ) : null}\n {results.playlists?.length ? (\n \n \n \n ) : null}\n {results.users?.length ? (\n \n \n \n ) : null}\n \n \n \n \n \n {results.tracks?.length ? (\n \n \n \n ) : null}\n {results.artists?.length ? (\n \n \n \n ) : null}\n {results.albums?.length ? (\n \n \n \n ) : null}\n {results.playlists?.length ? (\n \n \n \n ) : null}\n {results.users?.length ? (\n \n \n \n ) : null}\n \n \n );\n}\n\nfunction TopResultsPanel({\n results: {artists, albums, tracks, playlists, users},\n}: SearchResultsProps) {\n return (\n \n {tracks?.length ? (\n \n ) : null}\n {artists?.length ? (\n \n ) : null}\n {albums?.length ? (\n \n ) : null}\n {playlists?.length ? (\n \n ) : null}\n {users?.length ? (\n \n ) : null}\n \n );\n}\n\ninterface TracksPanelProps {\n tracks: Track[];\n showMore?: boolean;\n}\nfunction TrackResults({tracks, showMore}: TracksPanelProps) {\n return (\n
    \n \n \n \n \n
    \n );\n}\n\ninterface ArtistResultsProps {\n artists: Artist[];\n showMore?: boolean;\n}\nfunction ArtistResults({artists, showMore}: ArtistResultsProps) {\n return (\n
    \n \n \n \n \n {artists.map(artist => (\n \n ))}\n \n
    \n );\n}\n\ninterface AlbumResultsProps {\n albums: Album[];\n showMore?: boolean;\n}\nfunction AlbumResults({albums, showMore}: AlbumResultsProps) {\n return (\n
    \n \n \n \n \n {albums.map(album => (\n \n ))}\n \n
    \n );\n}\n\ninterface PlaylistResultsProps {\n playlists: Playlist[];\n showMore?: boolean;\n}\nfunction PlaylistResults({playlists, showMore}: PlaylistResultsProps) {\n return (\n
    \n \n \n \n \n {playlists.map(album => (\n \n ))}\n \n
    \n );\n}\n\ninterface ProfileResultsProps {\n users: User[];\n showMore?: boolean;\n}\nfunction ProfileResults({users, showMore}: ProfileResultsProps) {\n return (\n
    \n \n \n \n \n {users.map(user => (\n \n ))}\n \n
    \n );\n}\n\ninterface PanelTitleProps {\n children: ReactNode;\n to?: string;\n}\nfunction PanelTitle({children, to}: PanelTitleProps) {\n return (\n

    \n {to ? (\n \n {children}\n \n \n ) : (\n children\n )}\n

    \n );\n}\n","import {Trans} from '@common/i18n/trans';\nimport {AudiotrackIcon} from '@common/icons/material/Audiotrack';\nimport {StaticPageTitle} from '@common/seo/static-page-title';\nimport React, {ReactElement, ReactNode} from 'react';\nimport {Link, Navigate} from 'react-router-dom';\nimport {AlbumIcon} from '@common/icons/material/Album';\nimport {MicIcon} from '@common/icons/material/Mic';\nimport {PlaylistPlayIcon} from '@common/icons/material/PlaylistPlay';\nimport {HistoryIcon} from '@common/icons/material/History';\nimport {SvgIconProps} from '@common/icons/svg-icon';\nimport {getPlaylistLink} from '@app/web-player/playlists/playlist-link';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {PlaylistAddIcon} from '@common/icons/material/PlaylistAdd';\nimport {CreatePlaylistDialog} from '@app/web-player/playlists/crupdate-dialog/create-playlist-dialog';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {useAuthClickCapture} from '@app/web-player/use-auth-click-capture';\nimport {useUserPlaylists} from '@app/web-player/library/requests/use-user-playlists';\nimport {PlaylistImage} from '@app/web-player/playlists/playlist-image';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {AdHost} from '@common/admin/ads/ad-host';\nimport {useIsTabletMediaQuery} from '@common/utils/hooks/is-tablet-media-query';\n\nexport function LibraryPage() {\n const navigate = useNavigate();\n const authHandler = useAuthClickCapture();\n const query = useUserPlaylists('me');\n const isSmallScreen = useIsTabletMediaQuery();\n\n if (!isSmallScreen) {\n return ;\n }\n\n return (\n
    \n \n \n \n \n
    \n

    \n \n

    \n {\n if (newPlaylist) {\n navigate(getPlaylistLink(newPlaylist));\n }\n }}\n >\n \n \n \n \n \n
    \n
    \n }\n to=\"/library/songs\"\n >\n \n \n } to=\"/library/playlists\">\n \n \n } to=\"/library/albums\">\n \n \n } to=\"/library/artists\">\n \n \n } to=\"/library/history\">\n \n \n {query.items.map(playlist => (\n \n }\n to={getPlaylistLink(playlist)}\n >\n {playlist.name}\n \n ))}\n \n
    \n
    \n );\n}\n\ninterface MenuItemProps {\n icon: ReactElement;\n children: ReactNode;\n to: string;\n wrapIcon?: boolean;\n}\nfunction MenuItem({icon, children, to, wrapIcon = true}: MenuItemProps) {\n return (\n \n {wrapIcon ? (\n
    {icon}
    \n ) : (\n icon\n )}\n {children}\n \n );\n}\n","import {StaticPageTitle} from '@common/seo/static-page-title';\nimport {Trans} from '@common/i18n/trans';\nimport React from 'react';\nimport {TextField} from '@common/ui/forms/input-field/text-field/text-field';\nimport {SearchIcon} from '@common/icons/material/Search';\nimport {message} from '@common/i18n/message';\nimport {useTrans} from '@common/i18n/use-trans';\nimport {PageErrorMessage} from '@common/errors/page-error-message';\nimport {ContentGrid} from '@app/web-player/playable-item/content-grid';\nimport {InfiniteScrollSentinel} from '@common/ui/infinite-scroll/infinite-scroll-sentinel';\nimport {AnimatePresence, m} from 'framer-motion';\nimport {opacityAnimation} from '@common/ui/animation/opacity-animation';\nimport {MediaPageNoResultsMessage} from '@app/web-player/layout/media-page-no-results-message';\nimport {PlayableMediaGridSkeleton} from '@app/web-player/playable-item/player-media-grid-skeleton';\nimport {LibraryPageSortDropdown} from '@app/web-player/library/library-page-sort-dropdown';\nimport {useUserPlaylists} from '@app/web-player/library/requests/use-user-playlists';\nimport {PlaylistGridItem} from '@app/web-player/playlists/playlist-grid-item';\nimport {useAuthUserPlaylists} from '@app/web-player/playlists/requests/use-auth-user-playlists';\nimport {getPlaylistLink} from '@app/web-player/playlists/playlist-link';\nimport {IconButton} from '@common/ui/buttons/icon-button';\nimport {PlaylistAddIcon} from '@common/icons/material/PlaylistAdd';\nimport {CreatePlaylistDialog} from '@app/web-player/playlists/crupdate-dialog/create-playlist-dialog';\nimport {DialogTrigger} from '@common/ui/overlays/dialog/dialog-trigger';\nimport {useNavigate} from '@common/utils/hooks/use-navigate';\nimport {useAuthClickCapture} from '@app/web-player/use-auth-click-capture';\nimport {AdHost} from '@common/admin/ads/ad-host';\n\nconst sortItems = {\n 'updated_at:desc': message('Recently updated'),\n 'name:asc': message('A-Z'),\n 'views:desc': message('Most viewed'),\n 'plays:desc': message('Most played'),\n};\n\nexport function LibraryPlaylistsPage() {\n const navigate = useNavigate();\n const authHandler = useAuthClickCapture();\n const {trans} = useTrans();\n const {data} = useAuthUserPlaylists();\n const totalItems = data.playlists.length;\n const query = useUserPlaylists('me', {willSortOrFilter: true});\n const {\n isInitialLoading,\n sortDescriptor,\n setSortDescriptor,\n searchQuery,\n setSearchQuery,\n items,\n isError,\n } = query;\n\n if (isError) {\n return ;\n }\n\n return (\n
    \n \n \n \n \n
    \n

    \n {totalItems ? (\n \n ) : (\n \n )}\n

    \n {\n if (newPlaylist) {\n navigate(getPlaylistLink(newPlaylist));\n }\n }}\n >\n \n \n \n \n \n
    \n\n
    \n setSearchQuery(e.target.value)}\n className=\"max-w-512 flex-auto\"\n size=\"sm\"\n startAdornment={}\n placeholder={trans(message('Search within playlists'))}\n />\n \n
    \n
    \n \n {isInitialLoading ? (\n \n ) : (\n \n \n {items.map(playlist => (\n \n ))}\n \n \n \n )}\n \n
    \n {!items.length && !isInitialLoading && (\n \n }\n />\n )}\n
    \n );\n}\n","import React, {useMemo} from 'react';\nimport {playerStoreOptions} from '@app/web-player/state/player-store-options';\nimport {PlayerContext} from '@common/player/player-context';\nimport {TrackListItem} from '@app/web-player/tracks/track-list/track-list-item';\nimport {useTrack} from '@app/web-player/tracks/requests/use-track';\nimport {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport {Track} from '@app/web-player/tracks/track';\nimport {trackToMediaItem} from '@app/web-player/tracks/utils/track-to-media-item';\nimport {PlayerStoreOptions} from '@common/player/state/player-store-options';\nimport {PlayerOutlet} from '@common/player/ui/player-outlet';\nimport {PlayerPoster} from '@common/player/ui/controls/player-poster';\n\nexport function TrackEmbed() {\n const {data} = useTrack({loader: 'trackPage'});\n return (\n
    \n {!data?.track ? (\n \n ) : (\n \n )}\n
    \n );\n}\n\ninterface EmbedContentProps {\n track: Track;\n}\nfunction EmbedContent({track}: EmbedContentProps) {\n const options: PlayerStoreOptions = useMemo(() => {\n const mediaItem = trackToMediaItem(track);\n return {\n ...playerStoreOptions,\n initialData: {\n queue: [mediaItem],\n cuedMediaId: mediaItem.id,\n state: {\n repeat: false,\n },\n },\n };\n }, [track]);\n return (\n \n
    \n
    \n \n \n
    \n \n
    \n
    \n );\n}\n","import React, {useMemo} from 'react';\nimport {playerStoreOptions} from '@app/web-player/state/player-store-options';\nimport {PlayerContext} from '@common/player/player-context';\nimport {FullPageLoader} from '@common/ui/progress/full-page-loader';\nimport {\n tracksToMediaItems,\n trackToMediaItem,\n} from '@app/web-player/tracks/utils/track-to-media-item';\nimport {useAlbum} from '@app/web-player/albums/requests/use-album';\nimport {Album} from '@app/web-player/albums/album';\nimport {AlbumListItem} from '@app/web-player/albums/album-list/album-list-item';\nimport {PlayerStoreOptions} from '@common/player/state/player-store-options';\nimport {PlayerOutlet} from '@common/player/ui/player-outlet';\nimport {PlayerPoster} from '@common/player/ui/controls/player-poster';\n\nexport function AlbumEmbed() {\n const {data} = useAlbum({loader: 'albumEmbed'});\n return (\n
    \n {!data?.album ? (\n \n ) : (\n \n )}\n
    \n );\n}\n\ninterface EmbedContentProps {\n album: Album;\n}\nfunction EmbedContent({album}: EmbedContentProps) {\n const options: PlayerStoreOptions = useMemo(() => {\n return {\n ...playerStoreOptions,\n initialData: {\n queue: album.tracks?.length ? tracksToMediaItems(album.tracks) : [],\n cuedMediaId: album.tracks?.length\n ? trackToMediaItem(album.tracks[0]).id\n : undefined,\n state: {\n repeat: false,\n },\n },\n };\n }, [album]);\n return (\n \n
    \n
    \n \n \n
    \n \n
    \n
    \n );\n}\n","import {useSettings} from '@common/core/settings/use-settings';\nimport {ChannelPage} from '@app/web-player/channels/channel-page';\nimport React from 'react';\n\nexport function HomepageChannelPage() {\n const {homepage} = useSettings();\n let slugOrId = 'discover';\n if (homepage.type.startsWith('channel') && homepage.value) {\n slugOrId = homepage.value;\n }\n return ;\n}\n","import {RouteObject, useRoutes} from 'react-router-dom';\nimport {ChannelPage} from '@app/web-player/channels/channel-page';\nimport React from 'react';\nimport {WebPlayerLayout} from '@app/web-player/layout/web-player-layout';\nimport {ArtistPage} from '@app/web-player/artists/artist-page/artist-page';\nimport {PlaylistPage} from '@app/web-player/playlists/playlist-page/playlist-page';\nimport {AlbumPage} from '@app/web-player/albums/album-page';\nimport {LibraryTracksPage} from '@app/web-player/library/library-tracks-page';\nimport {AuthRoute} from '@common/auth/guards/auth-route';\nimport {LibraryAlbumsPage} from '@app/web-player/library/library-albums-page';\nimport {LibraryArtistsPage} from '@app/web-player/library/library-artists-page';\nimport {LibraryHistoryPage} from '@app/web-player/library/library-history-page';\nimport {TrackPage} from '@app/web-player/tracks/track-page';\nimport {UserProfilePage} from '@app/web-player/user-profile/user-profile-page';\nimport {TagMediaPage} from '@app/web-player/genres/tag-media-page';\nimport {RadioPage} from '@app/web-player/radio/radio-page';\nimport {SearchResultsPage} from '@app/web-player/search/search-results-page';\nimport {LibraryPage} from '@app/web-player/library/library-page';\nimport {LibraryPlaylistsPage} from '@app/web-player/library/library-playlists-page';\nimport {TrackEmbed} from '@app/web-player/tracks/track-embed';\nimport {AlbumEmbed} from '@app/web-player/albums/album-embed';\nimport {HomepageChannelPage} from '@app/web-player/channels/homepage-channel-page';\nimport {NotFoundPage} from '@common/ui/not-found-page/not-found-page';\n\nconst RouteConfig: RouteObject[] = [\n {\n path: 'track/:trackId/:trackName/embed',\n element: ,\n },\n {\n path: 'album/:albumId/:artistName/:albumName/embed',\n element: ,\n },\n {\n path: '/',\n element: ,\n children: [\n {\n index: true,\n element: ,\n },\n // artists\n {\n path: 'artist/:artistId/:artistName',\n element: ,\n },\n {\n path: 'artist/:artistId',\n element: ,\n },\n // playlists\n {\n path: 'playlist/:playlistId/:playlistName',\n element: ,\n },\n // albums\n {\n path: 'album/:albumId/:artistName/:albumName',\n element: ,\n },\n // tracks\n {\n path: 'track/:trackId/:trackName',\n element: ,\n },\n // tags\n {\n path: 'tag/:tagName',\n element: ,\n },\n {\n path: 'tag/:tagName/tracks',\n element: ,\n },\n {\n path: 'tag/:tagName/albums',\n element: ,\n },\n // user profile\n {\n path: 'user/:userId/:userName',\n element: ,\n },\n {\n path: 'user/:userId/:userName/:tabName',\n element: ,\n },\n // radio\n {\n path: 'radio/:seedType/:seedId/:seeName',\n element: ,\n },\n // search\n {\n path: 'search',\n element: ,\n },\n {\n path: 'search/:searchQuery',\n element: ,\n },\n {\n path: 'search/:searchQuery/:tabName',\n element: ,\n },\n // library\n {\n path: '/library',\n element: (\n \n \n \n ),\n },\n {\n path: '/library/songs',\n element: (\n \n \n \n ),\n },\n {\n path: '/library/playlists',\n element: (\n \n \n \n ),\n },\n {\n path: '/library/albums',\n element: (\n \n \n \n ),\n },\n {\n path: '/library/artists',\n element: (\n \n \n \n ),\n },\n {\n path: '/library/history',\n element: (\n \n \n \n ),\n },\n // Channels\n {\n path: ':slugOrId',\n element: ,\n },\n {\n path: 'channel/:slugOrId',\n element: ,\n },\n {\n path: ':slugOrId/:restriction',\n element: ,\n },\n {\n path: 'channel/:slugOrId/:restriction',\n element: ,\n },\n {\n path: '*',\n element: ,\n },\n ],\n },\n];\n\nexport default function WebPlayerRoutes() {\n return useRoutes(RouteConfig);\n}\n"],"file":"assets/web-player-routes-e849a5e2.js"}