From 37bbec07b8bbe4bbe41700d4754c3d45f37d5154 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Thu, 14 Mar 2024 14:22:37 +0300 Subject: [PATCH 01/88] CI fix --- .github/workflows/update-build-release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index dc116e1..9e9d693 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -63,12 +63,12 @@ jobs: outputs: - commited: ${{ steps.outputs.commited != '' }} - commit_long_sha: ${{ steps.outputs.commit_long_sha }} - commit_name: ${{ steps.outputs.commit_name }} - tag_name: ${{ steps.outputs.tag_name }} - release_name: ${{ steps.outputs.release_name }} - version: ${{ steps.outputs.VERSION }} + commited: ${{ steps.outputs.outputs.commited != '' }} + commit_long_sha: ${{ steps.outputs.outputs.commit_long_sha }} + commit_name: ${{ steps.outputs.outputs.commit_name }} + tag_name: ${{ steps.outputs.outputs.tag_name }} + release_name: ${{ steps.outputs.outputs.release_name }} + version: ${{ steps.outputs.outputs.VERSION }} build: @@ -81,7 +81,7 @@ jobs: upload-release: needs: [build, update_packages] - if: ${{ needs.update_packages.outputs.commited && github.ref_name == 'main' }} + if: ${{ needs.update_packages.outputs.commited && github.ref_name == 'master' }} runs-on: ubuntu-latest steps: - name: Checkout From 02f8ddac800f7403564cd9ef9f4ad3dd9b82bcdf Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 14 Mar 2024 11:23:44 +0000 Subject: [PATCH 02/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 16 ++++++++-------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index d14b988..a7b8a9c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver="5.0.14" +pkgver="5.0.15" pkgrel="1" pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("custom") depends=("electron29" "libpulse" "xdg-utils") makedepends=("p7zip" "nodejs" "asar" "jq" "python") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.14.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") -sha256sums=("c10c6c4b5d596f9bf490a231d7c13bbd2627109f71c9c57aa4e2b034e31252f4" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.15.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") +sha256sums=("b404778d70bc501e4ecec7496a43ca21f2dcb6dde4fbf872689b78aad822fb77" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.14.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.15.exe" } package() { diff --git a/flake.lock b/flake.lock index 54f2b75..1561db3 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-6YOx1r40nBcexbeqmQn5/FkuUaHxRrg4Qn1mEwPVnTs=", + "narHash": "sha256-GcwM5Qng7G1oS7Mo/F0LLItMfdd+5W9iHtaKQAdxz3s=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.14.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.15.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.14.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.15.exe" } } }, diff --git a/flake.nix b/flake.nix index eb705bf..c9902ff 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.14.exe; + ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.15.exe; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index aadbd85..96651ed 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,14 +1,14 @@ { "ym": { - "version": "5.0.14", - "exe_name": "Yandex_Music_x64_5.0.14.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.14.exe", - "exe_sha256": "c10c6c4b5d596f9bf490a231d7c13bbd2627109f71c9c57aa4e2b034e31252f4" + "version": "5.0.15", + "exe_name": "Yandex_Music_x64_5.0.15.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.15.exe", + "exe_sha256": "b404778d70bc501e4ecec7496a43ca21f2dcb6dde4fbf872689b78aad822fb77" }, "electron": { - "version": "29.1.1", - "x64": "https://github.com/electron/electron/releases/download/v29.1.1/electron-v29.1.1-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.1.1/electron-v29.1.1-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.1.1/electron-v29.1.1-linux-arm64.zip" + "version": "29.1.4", + "x64": "https://github.com/electron/electron/releases/download/v29.1.4/electron-v29.1.4-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.1.4/electron-v29.1.4-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.1.4/electron-v29.1.4-linux-arm64.zip" } } \ No newline at end of file From e85339f00a835f95939ac3c0916bcefc961d2b8e Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Thu, 14 Mar 2024 14:44:52 +0300 Subject: [PATCH 03/88] Add default electron bin path --- build_tarball.sh | 2 +- templates/PKGBUILD | 2 +- templates/default.conf | 2 +- templates/yandex-music.sh | 5 +---- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/build_tarball.sh b/build_tarball.sh index 91b70dc..2ef0874 100644 --- a/build_tarball.sh +++ b/build_tarball.sh @@ -37,11 +37,11 @@ build_tarball(){ install -Dm644 "./templates/desktop" "${app_dir}/usr/share/applications/yandex-music.desktop" install -Dm644 "./templates/default.conf" "${app_dir}/usr/lib/yandex-music/default.conf" - sed -i "s|%electron_path%|/usr/lib/yandex-music/electron/electron|g" "${app_dir}/usr/lib/yandex-music/default.conf" install -Dm644 "./LICENSE.md" "${app_dir}/usr/share/licenses/yandex-music/LICENSE" mv "${TEMPDIR}/electron-${arch}/" "${app_dir}/usr/lib/yandex-music/electron" install -Dm755 "./templates/yandex-music.sh" "${app_dir}/usr/bin/yandex-music" + sed -i "s|%electron_path%|/usr/lib/yandex-music/electron/electron|g" "${app_dir}/usr/bin/yandex-music" cd "${app_dir}" tar -czf "${OUTPUT_DIR}/yandex-music_${version}_${arch}.tar.gz" * diff --git a/templates/PKGBUILD b/templates/PKGBUILD index c1e56e0..4b1b549 100644 --- a/templates/PKGBUILD +++ b/templates/PKGBUILD @@ -31,9 +31,9 @@ package() { install -Dm644 "$srcdir/yandex-music-linux/templates/desktop" "$pkgdir/usr/share/applications/yandex-music.desktop" install -Dm644 "$srcdir/yandex-music-linux/templates/default.conf" "$pkgdir/usr/lib/yandex-music/default.conf" - sed -i "s|%electron_path%|/usr/bin/electron29|g" "$pkgdir/usr/lib/yandex-music/default.conf" install -Dm644 "$srcdir/yandex-music-linux/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" install -Dm755 "$srcdir/yandex-music-linux/templates/yandex-music.sh" "$pkgdir/usr/bin/yandex-music" + sed -i "s|%electron_path%|/usr/bin/electron29|g" "$pkgdir/usr/bin/yandex-music" } diff --git a/templates/default.conf b/templates/default.conf index 522dd2a..cfaeac5 100644 --- a/templates/default.conf +++ b/templates/default.conf @@ -1,2 +1,2 @@ -ELECTRON_BIN=%electron_path% +ELECTRON_CUSTOM_BIN= ELECTRON_ARGS="--no-sandbox" \ No newline at end of file diff --git a/templates/yandex-music.sh b/templates/yandex-music.sh index 1a1ac59..4098ac6 100644 --- a/templates/yandex-music.sh +++ b/templates/yandex-music.sh @@ -20,9 +20,6 @@ if [ "$XDG_SESSION_TYPE" == "wayland" ]; then WAYLAND_FLAGS="--enable-features=UseOzonePlatform --ozone-platform=wayland" fi -if [ -z "$ELECTRON_BIN" ]; then - echo "ELECTRON_BIN is not set" - exit 1 -fi +ELECTRON_BIN=${ELECTRON_CUSTOM_BIN:-%electron_path%} exec "${ELECTRON_BIN}" /usr/lib/yandex-music/yandex-music.asar "${ELECTRON_ARGS}" "${WAYLAND_FLAGS}" \ No newline at end of file From 3bbc30ffe7d7840f3c7f26d1efb93f20ba6e0ca4 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 14 Mar 2024 11:48:10 +0000 Subject: [PATCH 04/88] Update packages --- PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index a7b8a9c..c8b7e12 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -31,9 +31,9 @@ package() { install -Dm644 "$srcdir/yandex-music-linux/templates/desktop" "$pkgdir/usr/share/applications/yandex-music.desktop" install -Dm644 "$srcdir/yandex-music-linux/templates/default.conf" "$pkgdir/usr/lib/yandex-music/default.conf" - sed -i "s|%electron_path%|/usr/bin/electron29|g" "$pkgdir/usr/lib/yandex-music/default.conf" install -Dm644 "$srcdir/yandex-music-linux/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" install -Dm755 "$srcdir/yandex-music-linux/templates/yandex-music.sh" "$pkgdir/usr/bin/yandex-music" + sed -i "s|%electron_path%|/usr/bin/electron29|g" "$pkgdir/usr/bin/yandex-music" } From 9c375fee357484ed0d5f461d1ee5b919b1839c77 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Thu, 14 Mar 2024 18:38:33 +0300 Subject: [PATCH 05/88] Prettify release notes --- utility/extract_release_notes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utility/extract_release_notes.py b/utility/extract_release_notes.py index 509d164..eab2c16 100644 --- a/utility/extract_release_notes.py +++ b/utility/extract_release_notes.py @@ -16,7 +16,7 @@ def build_html(data, first_launch=False): html += f"

{element['value']}

".replace('\n', '
') continue if element['value'] == '\n': - html += "
" + continue else: html += f"{element['value']}".replace('\n', '
') elif element['type'] == 8: From dbc2ce566ede5ad0f36c5bd8e3d651ffeaa7c148 Mon Sep 17 00:00:00 2001 From: Yury Shvedov Date: Fri, 15 Mar 2024 08:25:38 +0300 Subject: [PATCH 06/88] [nix] Make compatible with NIXOS_OZONE_WL #65 Change-Id: Idc29e7479892f5fdd9f739bd1ab20ada57e5dcde --- nix/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nix/default.nix b/nix/default.nix index 95b6638..d1e66df 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -56,7 +56,8 @@ stdenvNoCC.mkDerivation # use makeWrapper on electron binary to make it call our asar package makeWrapper "${electron}/bin/electron" "$out/bin/yandex-music" \ - --add-flags "$out/share/nodejs/yandex-music.asar" + --add-flags "$out/share/nodejs/yandex-music.asar" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" install -Dm644 "./app/favicon.png" "$out/share/pixmaps/yandex-music.png" install -Dm644 "./app/favicon.png" "$out/share/icons/hicolor/48x48/apps/yandex-music.png" From 4182defb82bb899c9889f6ff946543631a065e64 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 21 Mar 2024 00:33:07 +0000 Subject: [PATCH 07/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 16 ++++++++-------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index c8b7e12..d6ed69f 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver="5.0.15" +pkgver="5.0.16" pkgrel="1" pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("custom") depends=("electron29" "libpulse" "xdg-utils") makedepends=("p7zip" "nodejs" "asar" "jq" "python") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.15.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") -sha256sums=("b404778d70bc501e4ecec7496a43ca21f2dcb6dde4fbf872689b78aad822fb77" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.16.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") +sha256sums=("0b70fa4723eecd98828f6184c65e916c15fd884946e511e7b57ffd30d11ba5fc" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.15.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.16.exe" } package() { diff --git a/flake.lock b/flake.lock index 1561db3..9301db6 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-GcwM5Qng7G1oS7Mo/F0LLItMfdd+5W9iHtaKQAdxz3s=", + "narHash": "sha256-piqhY9Q91PrxJNk6FHg3x57zU6hF2/Mr4eYOdklF+74=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.15.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.16.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.15.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.16.exe" } } }, diff --git a/flake.nix b/flake.nix index c9902ff..af0c63e 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.15.exe; + ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.16.exe; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 96651ed..4e04b7b 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,14 +1,14 @@ { "ym": { - "version": "5.0.15", - "exe_name": "Yandex_Music_x64_5.0.15.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.15.exe", - "exe_sha256": "b404778d70bc501e4ecec7496a43ca21f2dcb6dde4fbf872689b78aad822fb77" + "version": "5.0.16", + "exe_name": "Yandex_Music_x64_5.0.16.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.16.exe", + "exe_sha256": "0b70fa4723eecd98828f6184c65e916c15fd884946e511e7b57ffd30d11ba5fc" }, "electron": { - "version": "29.1.4", - "x64": "https://github.com/electron/electron/releases/download/v29.1.4/electron-v29.1.4-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.1.4/electron-v29.1.4-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.1.4/electron-v29.1.4-linux-arm64.zip" + "version": "29.1.5", + "x64": "https://github.com/electron/electron/releases/download/v29.1.5/electron-v29.1.5-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.1.5/electron-v29.1.5-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.1.5/electron-v29.1.5-linux-arm64.zip" } } \ No newline at end of file From 49bc8dcbac69a222f889a7d925579f22608e0479 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 23 Mar 2024 00:31:01 +0000 Subject: [PATCH 08/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index d6ed69f..1d0aaff 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver="5.0.16" +pkgver="5.0.17" pkgrel="1" pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("custom") depends=("electron29" "libpulse" "xdg-utils") makedepends=("p7zip" "nodejs" "asar" "jq" "python") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.16.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") -sha256sums=("0b70fa4723eecd98828f6184c65e916c15fd884946e511e7b57ffd30d11ba5fc" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") +sha256sums=("e8553abe97f1c1d9c72a2fb25620c838e7ef6c871cebb051ec0ae3ae4c125960" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.16.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.17.exe" } package() { diff --git a/flake.lock b/flake.lock index 9301db6..d1fa612 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-piqhY9Q91PrxJNk6FHg3x57zU6hF2/Mr4eYOdklF+74=", + "narHash": "sha256-6vpaeMqDZvFix4O1ziXrtpOJEw+PKjJkUH402W7weuo=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.16.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.16.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe" } } }, diff --git a/flake.nix b/flake.nix index af0c63e..b69545c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.16.exe; + ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 4e04b7b..31dff89 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.0.16", - "exe_name": "Yandex_Music_x64_5.0.16.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.16.exe", - "exe_sha256": "0b70fa4723eecd98828f6184c65e916c15fd884946e511e7b57ffd30d11ba5fc" + "version": "5.0.17", + "exe_name": "Yandex_Music_x64_5.0.17.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe", + "exe_sha256": "e8553abe97f1c1d9c72a2fb25620c838e7ef6c871cebb051ec0ae3ae4c125960" }, "electron": { "version": "29.1.5", From ead75fa1e49d6b05a56dbf6effac737ad95fee36 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 28 Mar 2024 00:31:54 +0000 Subject: [PATCH 09/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index 31dff89..5bb85e9 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "e8553abe97f1c1d9c72a2fb25620c838e7ef6c871cebb051ec0ae3ae4c125960" }, "electron": { - "version": "29.1.5", - "x64": "https://github.com/electron/electron/releases/download/v29.1.5/electron-v29.1.5-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.1.5/electron-v29.1.5-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.1.5/electron-v29.1.5-linux-arm64.zip" + "version": "29.1.6", + "x64": "https://github.com/electron/electron/releases/download/v29.1.6/electron-v29.1.6-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.1.6/electron-v29.1.6-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.1.6/electron-v29.1.6-linux-arm64.zip" } } \ No newline at end of file From 18f478cda1f4c30d7533f4fd45be3e40f34b7a90 Mon Sep 17 00:00:00 2001 From: UserSv4 Date: Mon, 1 Apr 2024 09:52:49 +0400 Subject: [PATCH 10/88] Remove URL literals --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index b69545c..90f31a1 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe"; ymExe.flake = false; }; From d3b677721b9033cc5764fd414d23b055499b8292 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 1 Apr 2024 08:04:33 +0000 Subject: [PATCH 11/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 1d0aaff..2d226ae 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver="5.0.17" +pkgver="5.0.18" pkgrel="1" pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("custom") depends=("electron29" "libpulse" "xdg-utils") makedepends=("p7zip" "nodejs" "asar" "jq" "python") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") -sha256sums=("e8553abe97f1c1d9c72a2fb25620c838e7ef6c871cebb051ec0ae3ae4c125960" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") +sha256sums=("8882b4e0965de2fc81f39b43f763c2c9dcd9bc88ed99df47b59e34d9697d2049" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.17.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.18.exe" } package() { diff --git a/flake.lock b/flake.lock index d1fa612..9e0029b 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-6vpaeMqDZvFix4O1ziXrtpOJEw+PKjJkUH402W7weuo=", + "narHash": "sha256-5qYIQZHWVgB9iC608LWv5E+ATzqBzowmUcZgHuf0uuo=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe" } } }, diff --git a/flake.nix b/flake.nix index 90f31a1..79266d0 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe"; + ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 5bb85e9..4214471 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.0.17", - "exe_name": "Yandex_Music_x64_5.0.17.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.17.exe", - "exe_sha256": "e8553abe97f1c1d9c72a2fb25620c838e7ef6c871cebb051ec0ae3ae4c125960" + "version": "5.0.18", + "exe_name": "Yandex_Music_x64_5.0.18.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe", + "exe_sha256": "8882b4e0965de2fc81f39b43f763c2c9dcd9bc88ed99df47b59e34d9697d2049" }, "electron": { "version": "29.1.6", From 7b34faaf2875319f171c4bd249413db314f343e9 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Mon, 1 Apr 2024 11:38:24 +0300 Subject: [PATCH 12/88] Fix nix url generation --- utility/generate_packages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utility/generate_packages.py b/utility/generate_packages.py index 95343dc..f0936fb 100644 --- a/utility/generate_packages.py +++ b/utility/generate_packages.py @@ -52,7 +52,7 @@ def generate_nix(): flake = f.read() _start_index = flake.find("ymExe.url = ") _end_index = flake.find(";", _start_index) - flake = flake.replace(flake[_start_index:_end_index+1], f'ymExe.url = {version_info["ym"]["exe_link"]};') + flake = flake.replace(flake[_start_index:_end_index+1], f'ymExe.url = "{version_info["ym"]["exe_link"]}";') with open(flake_path, "w") as f: f.write(flake) From e3b179f54abf3ff43794c77e1b5e866838384a7f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 1 Apr 2024 08:39:20 +0000 Subject: [PATCH 13/88] Update packages --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 79266d0..4565d6d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe"; ymExe.flake = false; }; From 8d1f8d59aa3e2db58888a6a00cc13645bded2911 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 5 Apr 2024 00:32:58 +0000 Subject: [PATCH 14/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index 4214471..0dd4061 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "8882b4e0965de2fc81f39b43f763c2c9dcd9bc88ed99df47b59e34d9697d2049" }, "electron": { - "version": "29.1.6", - "x64": "https://github.com/electron/electron/releases/download/v29.1.6/electron-v29.1.6-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.1.6/electron-v29.1.6-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.1.6/electron-v29.1.6-linux-arm64.zip" + "version": "29.2.0", + "x64": "https://github.com/electron/electron/releases/download/v29.2.0/electron-v29.2.0-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.2.0/electron-v29.2.0-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.2.0/electron-v29.2.0-linux-arm64.zip" } } \ No newline at end of file From 14ac2e6ad6fa7dc208ab695c0c304f4ec5f3da54 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 10 Apr 2024 00:32:06 +0000 Subject: [PATCH 15/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 2d226ae..0e6f634 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver="5.0.18" +pkgver="5.0.19" pkgrel="1" pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("custom") depends=("electron29" "libpulse" "xdg-utils") makedepends=("p7zip" "nodejs" "asar" "jq" "python") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") -sha256sums=("8882b4e0965de2fc81f39b43f763c2c9dcd9bc88ed99df47b59e34d9697d2049" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.19.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") +sha256sums=("7f178788a7244450bceffacd6d3fb9ef98504d235de15e15bd8dbcf344373d68" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.18.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.19.exe" } package() { diff --git a/flake.lock b/flake.lock index 9e0029b..e91318b 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-5qYIQZHWVgB9iC608LWv5E+ATzqBzowmUcZgHuf0uuo=", + "narHash": "sha256-kjPMSRZY9VTZCYXGwXAu3fIuErLWAll0bcIlbejuoZM=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.19.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.19.exe" } } }, diff --git a/flake.nix b/flake.nix index 4565d6d..3b534a2 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.19.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 0dd4061..ea639ea 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.0.18", - "exe_name": "Yandex_Music_x64_5.0.18.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.18.exe", - "exe_sha256": "8882b4e0965de2fc81f39b43f763c2c9dcd9bc88ed99df47b59e34d9697d2049" + "version": "5.0.19", + "exe_name": "Yandex_Music_x64_5.0.19.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.19.exe", + "exe_sha256": "7f178788a7244450bceffacd6d3fb9ef98504d235de15e15bd8dbcf344373d68" }, "electron": { "version": "29.2.0", From 2e0ab5fd01c18322494096ae6db4f5ee67752c3d Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Wed, 10 Apr 2024 13:28:46 +0300 Subject: [PATCH 16/88] Fix github actions tagging --- .github/workflows/update-build-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index 9e9d693..74fc865 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -125,6 +125,7 @@ jobs: tag_name: ${{ needs.update_packages.outputs.tag_name}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_SHA: ${{ needs.update_packages.outputs.commit_long_sha }} - name: Upload files to a GitHub release uses: ncipollo/release-action@v1.13.0 From 84627cd27f8a1c7617834b990d340fac36e967c4 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Wed, 10 Apr 2024 13:29:01 +0300 Subject: [PATCH 17/88] Fix executable for multiple arguments #71 --- templates/yandex-music.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/yandex-music.sh b/templates/yandex-music.sh index 4098ac6..23bd71f 100644 --- a/templates/yandex-music.sh +++ b/templates/yandex-music.sh @@ -22,4 +22,4 @@ fi ELECTRON_BIN=${ELECTRON_CUSTOM_BIN:-%electron_path%} -exec "${ELECTRON_BIN}" /usr/lib/yandex-music/yandex-music.asar "${ELECTRON_ARGS}" "${WAYLAND_FLAGS}" \ No newline at end of file +exec "${ELECTRON_BIN}" "/usr/lib/yandex-music/yandex-music.asar" "${ELECTRON_ARGS} ${WAYLAND_FLAGS}" \ No newline at end of file From c7e66872943c746d571462a2681f46ee5a9b3a38 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 11 Apr 2024 00:33:06 +0000 Subject: [PATCH 18/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index ea639ea..d19c226 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "7f178788a7244450bceffacd6d3fb9ef98504d235de15e15bd8dbcf344373d68" }, "electron": { - "version": "29.2.0", - "x64": "https://github.com/electron/electron/releases/download/v29.2.0/electron-v29.2.0-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.2.0/electron-v29.2.0-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.2.0/electron-v29.2.0-linux-arm64.zip" + "version": "29.3.0", + "x64": "https://github.com/electron/electron/releases/download/v29.3.0/electron-v29.3.0-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.3.0/electron-v29.3.0-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.3.0/electron-v29.3.0-linux-arm64.zip" } } \ No newline at end of file From c19fe9ce6208070bbf9f3ed084ef6a1ee5a96d52 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Thu, 11 Apr 2024 20:36:17 +0300 Subject: [PATCH 19/88] New fix for executable. Potentially fix #71 --- templates/yandex-music.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/yandex-music.sh b/templates/yandex-music.sh index 23bd71f..11e9d5e 100644 --- a/templates/yandex-music.sh +++ b/templates/yandex-music.sh @@ -22,4 +22,4 @@ fi ELECTRON_BIN=${ELECTRON_CUSTOM_BIN:-%electron_path%} -exec "${ELECTRON_BIN}" "/usr/lib/yandex-music/yandex-music.asar" "${ELECTRON_ARGS} ${WAYLAND_FLAGS}" \ No newline at end of file +exec "${ELECTRON_BIN}" "/usr/lib/yandex-music/yandex-music.asar" $ELECTRON_ARGS $WAYLAND_FLAGS \ No newline at end of file From 1eb40738353e82b375e60d55b8b03228b4b5b515 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 13 Apr 2024 00:28:10 +0000 Subject: [PATCH 20/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 0e6f634..4469aaa 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver="5.0.19" +pkgver="5.0.20" pkgrel="1" pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("custom") depends=("electron29" "libpulse" "xdg-utils") makedepends=("p7zip" "nodejs" "asar" "jq" "python") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.19.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") -sha256sums=("7f178788a7244450bceffacd6d3fb9ef98504d235de15e15bd8dbcf344373d68" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.20.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") +sha256sums=("561c0c219fe0bf70687aa9eeae45bdfbe71a844bd5987b8d60f5a9d8aedaefda" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.19.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.20.exe" } package() { diff --git a/flake.lock b/flake.lock index e91318b..5c11a7e 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-kjPMSRZY9VTZCYXGwXAu3fIuErLWAll0bcIlbejuoZM=", + "narHash": "sha256-wBxlw1SwxOTrtju3NQMfHrvjDCfnjmjYgxJI+F7Hxlg=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.19.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.20.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.19.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.20.exe" } } }, diff --git a/flake.nix b/flake.nix index 3b534a2..b8e1072 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.19.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.20.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index d19c226..95bcb24 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.0.19", - "exe_name": "Yandex_Music_x64_5.0.19.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.19.exe", - "exe_sha256": "7f178788a7244450bceffacd6d3fb9ef98504d235de15e15bd8dbcf344373d68" + "version": "5.0.20", + "exe_name": "Yandex_Music_x64_5.0.20.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.20.exe", + "exe_sha256": "561c0c219fe0bf70687aa9eeae45bdfbe71a844bd5987b8d60f5a9d8aedaefda" }, "electron": { "version": "29.3.0", From 9cbd041f188174ffd5c519c629a7f8ab746acc9b Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 19 Apr 2024 00:32:43 +0000 Subject: [PATCH 21/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index 95bcb24..f5d1ec7 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "561c0c219fe0bf70687aa9eeae45bdfbe71a844bd5987b8d60f5a9d8aedaefda" }, "electron": { - "version": "29.3.0", - "x64": "https://github.com/electron/electron/releases/download/v29.3.0/electron-v29.3.0-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.3.0/electron-v29.3.0-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.3.0/electron-v29.3.0-linux-arm64.zip" + "version": "29.3.1", + "x64": "https://github.com/electron/electron/releases/download/v29.3.1/electron-v29.3.1-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.3.1/electron-v29.3.1-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.3.1/electron-v29.3.1-linux-arm64.zip" } } \ No newline at end of file From f29f5e93d10d0ad745be22f2d0f4e60f77613d5f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 20 Apr 2024 00:32:18 +0000 Subject: [PATCH 22/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 4469aaa..efb3d07 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver="5.0.20" +pkgver="5.0.21" pkgrel="1" pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("custom") depends=("electron29" "libpulse" "xdg-utils") makedepends=("p7zip" "nodejs" "asar" "jq" "python") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.20.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") -sha256sums=("561c0c219fe0bf70687aa9eeae45bdfbe71a844bd5987b8d60f5a9d8aedaefda" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.21.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") +sha256sums=("1fb4a39debc484fbc68e16a46a9485d4c51b13c31fc9459dfe2d0bd149c0da76" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.20.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.21.exe" } package() { diff --git a/flake.lock b/flake.lock index 5c11a7e..44fe136 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-wBxlw1SwxOTrtju3NQMfHrvjDCfnjmjYgxJI+F7Hxlg=", + "narHash": "sha256-ce+R4orAqc3c/X0ZKJbY03MN9uiwSuZjaXleMY+V2xk=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.20.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.21.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.20.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.21.exe" } } }, diff --git a/flake.nix b/flake.nix index b8e1072..7f2a43e 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.20.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.21.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index f5d1ec7..c0e79d9 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.0.20", - "exe_name": "Yandex_Music_x64_5.0.20.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.20.exe", - "exe_sha256": "561c0c219fe0bf70687aa9eeae45bdfbe71a844bd5987b8d60f5a9d8aedaefda" + "version": "5.0.21", + "exe_name": "Yandex_Music_x64_5.0.21.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.21.exe", + "exe_sha256": "1fb4a39debc484fbc68e16a46a9485d4c51b13c31fc9459dfe2d0bd149c0da76" }, "electron": { "version": "29.3.1", From 9aa97d93023f01338483901047efe7a92b14ebd9 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Sat, 20 Apr 2024 14:04:50 +0300 Subject: [PATCH 23/88] Fix #72 --- repack.sh | 2 +- utility/extract_release_notes.py | 25 ++++++------------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/repack.sh b/repack.sh index 7ce5e27..64c00b1 100755 --- a/repack.sh +++ b/repack.sh @@ -133,6 +133,6 @@ asar pack "$TEMPDIR/app" "$dst/yandex-music.asar" for ext in png svg; do mv "$TEMPDIR/app/build/next-desktop/favicon.$ext" "$dst" done -python "$SCRIPT_DIR/utility/extract_release_notes.py" "$TEMPDIR/app/build/next-desktop/album.txt" "$dst/release_notes.json" +python "$SCRIPT_DIR/utility/extract_release_notes.py" "$TEMPDIR/app/main/translations/compiled/ru.json" "$dst/release_notes.json" echo "Done" diff --git a/utility/extract_release_notes.py b/utility/extract_release_notes.py index eab2c16..cfb970d 100644 --- a/utility/extract_release_notes.py +++ b/utility/extract_release_notes.py @@ -24,27 +24,14 @@ def build_html(data, first_launch=False): return html with open(file_name, "r", encoding='utf-8') as file: - full_text = file.read() + translation = json.load(file) notes = {} -position = full_text.find("desktop-release-notes.") -while position != -1: - start_position = position - while full_text[position] != '"': - position += 1 - name = full_text[start_position:position] - position += 2 - start_position = position - braces_count = 1 - while braces_count > 0: - position += 1 - if full_text[position] == '{' or full_text[position] == '[': - braces_count += 1 - elif full_text[position] == '}' or full_text[position] == ']': - braces_count -= 1 - data = full_text[start_position:position + 1] - notes[name] = build_html(json.loads(data), True) - position = full_text.find("desktop-release-notes.", position) +element_key: str +for element_key in translation.keys(): + if not element_key.startswith("desktop-release-notes."): + continue + notes[element_key] = build_html(translation[element_key], True) with open(save_file_name, "w", encoding='utf-8') as file: file.write(json.dumps(notes, ensure_ascii=False, indent=4)) \ No newline at end of file From a49b665381c6027099a0376cf65eb6912ef3e0d6 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Wed, 24 Apr 2024 20:12:28 +0300 Subject: [PATCH 24/88] Make tray optional, fix window lifecycle --- patches/0003-Create-app-tray-icon.patch | 68 +++++++++++++++++++------ templates/default.conf | 3 +- 2 files changed, 55 insertions(+), 16 deletions(-) diff --git a/patches/0003-Create-app-tray-icon.patch b/patches/0003-Create-app-tray-icon.patch index 7956999..8b39e3a 100644 --- a/patches/0003-Create-app-tray-icon.patch +++ b/patches/0003-Create-app-tray-icon.patch @@ -1,4 +1,4 @@ -diff --git a/main/lib/createTray.js b/main/lib/createTray.js +diff --git a/./app/main/lib/createTray.js b/./app1/main/lib/createTray.js --- a/main/lib/createTray.js +++ b/main/lib/createTray.js @@ -0,0 +1,20 @@ @@ -7,7 +7,7 @@ diff --git a/main/lib/createTray.js b/main/lib/createTray.js + +function createTray(window) { + const iconPath = path.join(__dirname, '../../build/next-desktop/favicon.png'); -+ const tray = new Tray(iconPath); ++ const tray = new Tray(iconPath); + const contextMenu = Menu.buildFromTemplate([ + {label: 'Открыть', click: () => window.show()}, + {label: 'Закрыть Яндекс Музыку', click: () => app.quit()} @@ -23,22 +23,60 @@ diff --git a/main/lib/createTray.js b/main/lib/createTray.js + +exports.createTray = createTray; + diff --git a/main/index.js b/main/index.js --- a/main/index.js +++ b/main/index.js -@@ -23,6 +23,7 @@ const handleMetrikaRequests_js_1 = require("./lib/handlers/handleMetrikaRequests - const loadURL_js_1 = require("./lib/loadURL.js"); - const safeRedirects_js_1 = require("./lib/safeRedirects.js"); - const handleWindowSessionEvents_js_1 = require("./lib/handlers/handleWindowSessionEvents.js"); -+const {createTray} = require('./lib/createTray.js'); - (0, handleError_js_1.handleUncaughtException)(); - (0, singleInstance_js_1.checkForSingleInstance)(); - (0, handleDeeplink_js_1.handleDeeplinkOnApplicationStartup)(); -@@ -30,6 +31,7 @@ const handleWindowSessionEvents_js_1 = require("./lib/handlers/handleWindowSessi - await electron_1.app.whenReady(); - (0, menu_js_1.setupMenu)(); - const window = await (0, createWindow_js_1.createWindow)(); -+ createTray(window); +@@ -33,6 +33,9 @@ const handleWindowSessionEvents_js_1 = require("./lib/handlers/handleWindowSessi (0, safeRedirects_js_1.safeRedirects)(window); (0, handleWindowLifecycleEvents_js_1.handleWindowLifecycleEvents)(window); (0, handleWindowSessionEvents_js_1.handleWindowSessionEvents)(window); ++ const {createTray} = require('./lib/createTray.js'); ++ const trayEnabled = process.env.TRAY_ENABLED && process.env.TRAY_ENABLED > 0; ++ if (trayEnabled){createTray(window);} + (0, events_js_1.handleApplicationEvents)(window); + (0, handleExternalLink_js_1.handleExternalLink)(window); + (0, logger_js_1.logWindowLifecycle)(window); + +diff --git a/./app/main/lib/handlers/handleWindowLifecycleEvents.js b/./app1/main/lib/handlers/handleWindowLifecycleEvents.js +--- a/main/lib/handlers/handleWindowLifecycleEvents.js ++++ b/main/lib/handlers/handleWindowLifecycleEvents.js +@@ -29,9 +29,8 @@ const handleWindowLifecycleEvents = (window) => { + state_js_1.state.willQuit = true; + }); + electron_1.app.on('window-all-closed', () => { +- if (node_os_1.default.platform() === platform_js_1.Platform.WINDOWS) { +- electron_1.app.quit(); +- } ++ const trayEnabled = process.env.TRAY_ENABLED && process.env.TRAY_ENABLED > 0; ++ if (!trayEnabled) {electron_1.app.quit();} + }); + electron_1.app.on('browser-window-blur', () => { + setBlurredTime(); +@@ -49,22 +48,11 @@ const handleWindowLifecycleEvents = (window) => { + checkAndUpdateApplicationData(window); + }); + window.on('close', (event) => { +- if (node_os_1.default.platform() !== platform_js_1.Platform.MACOS) { +- return; +- } +- if (state_js_1.state.willQuit) { +- return; +- } ++ const trayEnabled = process.env.TRAY_ENABLED && process.env.TRAY_ENABLED > 0; ++ if (!trayEnabled) {electron_1.app.quit();} ++ if (state_js_1.state.willQuit) {return;} + event.preventDefault(); +- if (window.isFullScreen()) { +- window.once('leave-full-screen', () => { +- (0, createWindow_js_1.toggleWindowVisibility)(window, false); +- }); +- window.setFullScreen(false); +- } +- else { +- (0, createWindow_js_1.toggleWindowVisibility)(window, false); +- } ++ (0, createWindow_js_1.toggleWindowVisibility)(window, false); + }); + }; + exports.handleWindowLifecycleEvents = handleWindowLifecycleEvents; \ No newline at end of file diff --git a/templates/default.conf b/templates/default.conf index cfaeac5..012180e 100644 --- a/templates/default.conf +++ b/templates/default.conf @@ -1,2 +1,3 @@ ELECTRON_CUSTOM_BIN= -ELECTRON_ARGS="--no-sandbox" \ No newline at end of file +ELECTRON_ARGS="--no-sandbox" +TRAY_ENABLED=0 \ No newline at end of file From ffbb74b2b1daf881d69e74790c0cde0832bd815d Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko <100789522+cucumber-sp@users.noreply.github.com> Date: Wed, 24 Apr 2024 20:26:39 +0300 Subject: [PATCH 25/88] Update README.md --- README.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 94a4674..2d40d0f 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,19 @@ Native YandexMusic client for Linux. Built using repacking of Windows client (El - [Installation](#installation) - [Arch Linux](#arch-linux) - [Debian/Ubuntu](#debianubuntu) + - [RPM-based](#rpm-based) +- [Configuration](#configuration) + - [Configuration file](#configuration-file) + - [Custom Electron binary](#custom-electron-binary) + - [Electron arguments](#electron-arguments) + - [Tray mode](#tray-mode) - [Manual Build](#manual-build) - [Prerequisites](#prerequisites) - [Extract app only](#extract-app-only) - [ASAR archive](#asar-archive) - [Arch Linux](#arch-linux-1) - [Debian/Ubuntu](#debianubuntu-1) + - [RPM-based](#rpm-based-1) - [Run with nix](#run-with-nix) - [Run with flakes](#run-with-flakes) - [Run old style](#run-old-style) @@ -28,8 +35,6 @@ Native YandexMusic client for Linux. Built using repacking of Windows client (El ### Arch Linux -*** - #### AUR You can obtain the latest version of package from `AUR` using one of the [AUR Helpers](https://wiki.archlinux.org/title/AUR_helpers). Then install it with `yandex-music` as package name. @@ -54,8 +59,6 @@ pacman -U yandex-music--any.pkg.tar.zst ### Debian/Ubuntu -*** - #### APT Package is currently unavailable at APT. We're still working on it @@ -72,6 +75,61 @@ dpkg -i yandex-music__.deb *** +### RPM-based + +#### DNF + +Package is currently unavailable at DNF. We're still working on it + +#### Binary package file + +Download prebuilt binary package from [Releases](https://github.com/cucumber-sp/yandex-music-linux/releases) section. +Unfortunatelly, we only provide packages for x64 architecture. If you need package for different architecture, you can build it manually. + +Then you can install it with the following command + +```bash +rpm -i yandex-music--1.x86_64.rpm +``` + +*** + +## Configuration + +### Configuration file + +You can find configuration file at `HOME/.config/yandex-music.conf`. It's a simple `key=value` file that's sourced before launching the app. This means you can set environment variables and other options there. + +*** + +### Custom Electron binary + +You can set path to custom Electron binary with `ELECTRON_CUSTOM_BIN` option. For example: + +```bash +ELECTRON_CUSTOM_BIN=/usr/bin/electron +``` + +*** + +### Electron arguments + +You can set custom Electron flags with `ELECTRON_ARGS` option. By default it's set to `--no-sandbox`. For example: + +```bash +ELECTRON_ARGS="--no-sandbox --trace-warnings" +``` + +*** + +### Tray mode + +Tray mode is disabled by default. It allows program to be minimized to tray instead of closing. To enable it set `TRAY_ENABLED` option to `1`. + +![image](https://github.com/cucumber-sp/yandex-music-linux/assets/100789522/5998ba7f-9ee7-4725-9d51-fbe5510a799d) + +*** + ## Manual Build ### Prerequisites @@ -137,6 +195,14 @@ bash build_deb.sh [-a default=x64] *** +### RPM-based + +You can build `.rpm` binary package using the following command: + +```bash +bash build_rpm.sh [-a default=x64] +``` + ## Run with nix The `yandex-music` package has unlicensed license, so you need to have From 816180521ec7479687d48e6bfd3839af93cbe3ff Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Wed, 24 Apr 2024 20:38:22 +0300 Subject: [PATCH 26/88] Fix tray env variable --- templates/yandex-music.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/yandex-music.sh b/templates/yandex-music.sh index 11e9d5e..1107b6e 100644 --- a/templates/yandex-music.sh +++ b/templates/yandex-music.sh @@ -22,4 +22,6 @@ fi ELECTRON_BIN=${ELECTRON_CUSTOM_BIN:-%electron_path%} +export TRAY_ENABLED=${TRAY_ENABLED:-0} + exec "${ELECTRON_BIN}" "/usr/lib/yandex-music/yandex-music.asar" $ELECTRON_ARGS $WAYLAND_FLAGS \ No newline at end of file From 80f8a38409981ecfebd1a135e22b39ab87aadd64 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko <100789522+cucumber-sp@users.noreply.github.com> Date: Sat, 27 Apr 2024 20:10:35 +0300 Subject: [PATCH 27/88] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2d40d0f..f72944b 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ pacman -U yandex-music--any.pkg.tar.zst #### APT -Package is currently unavailable at APT. We're still working on it +Package is currently unavailable at APT. If you'd like to help us with publishing, feel free to open new issue. #### Binary package file @@ -79,7 +79,7 @@ dpkg -i yandex-music__.deb #### DNF -Package is currently unavailable at DNF. We're still working on it +Package is currently unavailable at DNF. If you'd like to help us with publishing, feel free to open new issue. #### Binary package file From 8c7f4a7ce54c3dcf3cd9d21ce1416bf81800939b Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 27 Apr 2024 17:11:37 +0000 Subject: [PATCH 28/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index efb3d07..5571891 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver="5.0.21" +pkgver="5.1.2" pkgrel="1" pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("custom") depends=("electron29" "libpulse" "xdg-utils") makedepends=("p7zip" "nodejs" "asar" "jq" "python") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.21.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") -sha256sums=("1fb4a39debc484fbc68e16a46a9485d4c51b13c31fc9459dfe2d0bd149c0da76" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") +sha256sums=("55cff215176cee24ed9a6758a853f61663b59688a0382f361a610f74f6bc7877" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.0.21.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.1.2.exe" } package() { diff --git a/flake.lock b/flake.lock index 44fe136..f2e40a0 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-ce+R4orAqc3c/X0ZKJbY03MN9uiwSuZjaXleMY+V2xk=", + "narHash": "sha256-XOVTcbSrFhVLTq+35EYK8TCyhWjw7hEpa3HijnhE7B4=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.21.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.21.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe" } } }, diff --git a/flake.nix b/flake.nix index 7f2a43e..ce99d5e 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.21.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index c0e79d9..7f3cfea 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.0.21", - "exe_name": "Yandex_Music_x64_5.0.21.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.21.exe", - "exe_sha256": "1fb4a39debc484fbc68e16a46a9485d4c51b13c31fc9459dfe2d0bd149c0da76" + "version": "5.1.2", + "exe_name": "Yandex_Music_x64_5.1.2.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe", + "exe_sha256": "55cff215176cee24ed9a6758a853f61663b59688a0382f361a610f74f6bc7877" }, "electron": { "version": "29.3.1", From e265ecb08cc939cbd817aa0d060bd2dd30c0e78c Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Sat, 27 Apr 2024 20:40:19 +0300 Subject: [PATCH 29/88] Update patches --- patches/0001-Add-package-licence.patch | 3 ++- patches/0002-Add-package-icon.patch | 5 +++-- patches/0003-Create-app-tray-icon.patch | 11 +++++++---- patches/0004-Fix-window-resize.patch | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/patches/0001-Add-package-licence.patch b/patches/0001-Add-package-licence.patch index 13bb32b..873bbde 100644 --- a/patches/0001-Add-package-licence.patch +++ b/patches/0001-Add-package-licence.patch @@ -1,7 +1,7 @@ diff --git a/package.json b/package.json --- a/package.json +++ b/package.json -@@ -39,5 +39,6 @@ +@@ -42,5 +42,6 @@ "COPYRIGHT": "Яндекс Музыка", "TRADEMARK": "Яндекс Музыка", "DEEPLINK_PROTOCOL": "yandexmusic" @@ -9,3 +9,4 @@ diff --git a/package.json b/package.json + }, + "license": "UNLICENSED" } + \ No newline at end of file diff --git a/patches/0002-Add-package-icon.patch b/patches/0002-Add-package-icon.patch index b8d42ba..ff3529f 100644 --- a/patches/0002-Add-package-icon.patch +++ b/patches/0002-Add-package-icon.patch @@ -1,7 +1,7 @@ diff --git a/package.json b/package.json --- a/package.json +++ b/package.json -@@ -40,5 +40,9 @@ +@@ -43,5 +43,9 @@ "TRADEMARK": "Яндекс Музыка", "DEEPLINK_PROTOCOL": "yandexmusic" }, @@ -10,5 +10,6 @@ diff --git a/package.json b/package.json + "icon": { + "48x48": "build/next-desktop/favicon.png", + "scalable": "build/next-desktop/favicon.svg" -+ } ++ } } + \ No newline at end of file diff --git a/patches/0003-Create-app-tray-icon.patch b/patches/0003-Create-app-tray-icon.patch index 8b39e3a..be38b01 100644 --- a/patches/0003-Create-app-tray-icon.patch +++ b/patches/0003-Create-app-tray-icon.patch @@ -1,7 +1,7 @@ -diff --git a/./app/main/lib/createTray.js b/./app1/main/lib/createTray.js +diff --git a/main/lib/createTray.js b/main/lib/createTray.js --- a/main/lib/createTray.js +++ b/main/lib/createTray.js -@@ -0,0 +1,20 @@ +@@ -0,0 +1,21 @@ +const { app, Menu, Tray, nativeImage } = require('electron'); +const path = require('path'); + @@ -22,6 +22,7 @@ diff --git a/./app/main/lib/createTray.js b/./app1/main/lib/createTray.js +} + +exports.createTray = createTray; ++ diff --git a/main/index.js b/main/index.js @@ -38,7 +39,8 @@ diff --git a/main/index.js b/main/index.js (0, handleExternalLink_js_1.handleExternalLink)(window); (0, logger_js_1.logWindowLifecycle)(window); -diff --git a/./app/main/lib/handlers/handleWindowLifecycleEvents.js b/./app1/main/lib/handlers/handleWindowLifecycleEvents.js + +diff --git a/main/lib/handlers/handleWindowLifecycleEvents.js b/main/lib/handlers/handleWindowLifecycleEvents.js --- a/main/lib/handlers/handleWindowLifecycleEvents.js +++ b/main/lib/handlers/handleWindowLifecycleEvents.js @@ -29,9 +29,8 @@ const handleWindowLifecycleEvents = (window) => { @@ -79,4 +81,5 @@ diff --git a/./app/main/lib/handlers/handleWindowLifecycleEvents.js b/./app1/mai + (0, createWindow_js_1.toggleWindowVisibility)(window, false); }); }; - exports.handleWindowLifecycleEvents = handleWindowLifecycleEvents; \ No newline at end of file + exports.handleWindowLifecycleEvents = handleWindowLifecycleEvents; + \ No newline at end of file diff --git a/patches/0004-Fix-window-resize.patch b/patches/0004-Fix-window-resize.patch index c1c9ae1..3aa647b 100644 --- a/patches/0004-Fix-window-resize.patch +++ b/patches/0004-Fix-window-resize.patch @@ -1,7 +1,7 @@ diff --git a/main/lib/createWindow.js b/main/lib/createWindow.js --- a/main/lib/createWindow.js +++ b/main/lib/createWindow.js -@@ -16,8 +16,6 @@ const createWindow = async () => { +@@ -25,8 +25,6 @@ const createWindow = async () => { x: 16, y: 10 }, From 8ba485e264882a9b7c3023d59a54c0722dabe094 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Mon, 29 Apr 2024 13:14:14 +0300 Subject: [PATCH 30/88] Update tag workflow --- .github/workflows/update-build-release.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index 74fc865..6677fe5 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -120,12 +120,11 @@ jobs: - run: rm -rf dist/release_notes.json - name: Tag Repo - uses: richardsimko/update-tag@v1 + uses: rickstaa/action-create-tag@v1 with: - tag_name: ${{ needs.update_packages.outputs.tag_name}} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_SHA: ${{ needs.update_packages.outputs.commit_long_sha }} + tag: ${{ needs.update_packages.outputs.tag_name}} + force_push_tag: true + commit_sha: ${{ needs.update_packages.outputs.commit_long_sha }} - name: Upload files to a GitHub release uses: ncipollo/release-action@v1.13.0 From 2faaa8251fd6d1c9c514511d3db38ac3d2cb6a66 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Mon, 29 Apr 2024 13:22:43 +0300 Subject: [PATCH 31/88] Cleanup in PKGBUILD template --- templates/PKGBUILD | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/PKGBUILD b/templates/PKGBUILD index 4b1b549..9a9b308 100644 --- a/templates/PKGBUILD +++ b/templates/PKGBUILD @@ -1,16 +1,16 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver="%version%" -pkgrel="%release%" +pkgver=%version% +pkgrel=%release% pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") url="https://github.com/cucumber-sp/yandex-music-linux" -license=("custom") -depends=("electron29" "libpulse" "xdg-utils") -makedepends=("p7zip" "nodejs" "asar" "jq" "python") +license=("Unlicense") +depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") +makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("%exe_link%" "git+https://github.com/cucumber-sp/yandex-music-linux") +source=("%exe_link%" "git+${url}#tag=v${pkgver}") sha256sums=("%exe_sha256%" "SKIP") build() { From 733b740e81c2c19caf3d1140c2aeb0ef47d45c53 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 29 Apr 2024 10:23:37 +0000 Subject: [PATCH 32/88] Update packages --- PKGBUILD | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 5571891..514ec50 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,16 +1,16 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver="5.1.2" -pkgrel="1" +pkgver=5.1.2 +pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") url="https://github.com/cucumber-sp/yandex-music-linux" -license=("custom") -depends=("electron29" "libpulse" "xdg-utils") -makedepends=("p7zip" "nodejs" "asar" "jq" "python") +license=("Unlicense") +depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") +makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe" "git+https://github.com/cucumber-sp/yandex-music-linux") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe" "git+${url}#tag=v${pkgver}") sha256sums=("55cff215176cee24ed9a6758a853f61663b59688a0382f361a610f74f6bc7877" "SKIP") build() { From 367d93d0562014149f88ab09c3326184b1cdb950 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 4 May 2024 00:32:27 +0000 Subject: [PATCH 33/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index 7f3cfea..465d4f2 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "55cff215176cee24ed9a6758a853f61663b59688a0382f361a610f74f6bc7877" }, "electron": { - "version": "29.3.1", - "x64": "https://github.com/electron/electron/releases/download/v29.3.1/electron-v29.3.1-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.3.1/electron-v29.3.1-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.3.1/electron-v29.3.1-linux-arm64.zip" + "version": "29.3.2", + "x64": "https://github.com/electron/electron/releases/download/v29.3.2/electron-v29.3.2-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.3.2/electron-v29.3.2-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.3.2/electron-v29.3.2-linux-arm64.zip" } } \ No newline at end of file From 9022ad769c1a2dc700d06bdd5aaa9cfac7730cf7 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 7 May 2024 00:33:33 +0000 Subject: [PATCH 34/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 514ec50..5bb7725 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.1.2 +pkgver=5.1.4 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("55cff215176cee24ed9a6758a853f61663b59688a0382f361a610f74f6bc7877" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.4.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("f40388238a32a1785ec16ca4babbc6da204329f1f04b53cf88d4c95e63771569" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.1.2.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.1.4.exe" } package() { diff --git a/flake.lock b/flake.lock index f2e40a0..f86fb88 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-XOVTcbSrFhVLTq+35EYK8TCyhWjw7hEpa3HijnhE7B4=", + "narHash": "sha256-b5fq2cPOCbs3qqi8Jz5vSy7y9LZjoweC8mohRABKd80=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.4.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.4.exe" } } }, diff --git a/flake.nix b/flake.nix index ce99d5e..57fae89 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.4.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 465d4f2..3752cde 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.1.2", - "exe_name": "Yandex_Music_x64_5.1.2.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.2.exe", - "exe_sha256": "55cff215176cee24ed9a6758a853f61663b59688a0382f361a610f74f6bc7877" + "version": "5.1.4", + "exe_name": "Yandex_Music_x64_5.1.4.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.4.exe", + "exe_sha256": "f40388238a32a1785ec16ca4babbc6da204329f1f04b53cf88d4c95e63771569" }, "electron": { "version": "29.3.2", From 57ec0a8fff59e410a5a0e28f22c4c07f6c39ea46 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko <100789522+cucumber-sp@users.noreply.github.com> Date: Tue, 7 May 2024 07:33:07 +0300 Subject: [PATCH 35/88] Update update-build-release.yml --- .github/workflows/update-build-release.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index 6677fe5..fb38166 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -49,6 +49,14 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_OUTPUT echo "release_name=$release_name" >> $GITHUB_OUTPUT echo "tag_name=$tag_name" >> $GITHUB_OUTPUT + + - name: Tag Repo + uses: rickstaa/action-create-tag@v1 + if: ${{ steps.commit.outputs.commited || github.event.head_commit }} + with: + tag: ${{ steps.version.outputs.tag_name }}" + force_push_tag: true + commit_sha: ${{ steps.commit.outputs.commit_long_sha || github.event.head_commit.id}} - name: Outputs id: outputs @@ -118,14 +126,7 @@ jobs: run: echo "release_html=$(jq -r --arg version "${{ needs.update_packages.outputs.version }}" '.["desktop-release-notes." + $version]' ./dist/release_notes.json)" >> $GITHUB_OUTPUT - run: rm -rf dist/release_notes.json - - - name: Tag Repo - uses: rickstaa/action-create-tag@v1 - with: - tag: ${{ needs.update_packages.outputs.tag_name}} - force_push_tag: true - commit_sha: ${{ needs.update_packages.outputs.commit_long_sha }} - + - name: Upload files to a GitHub release uses: ncipollo/release-action@v1.13.0 with: From 06759153e5e843b34c4f0d0b5bd3fa0ce848df2f Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko <100789522+cucumber-sp@users.noreply.github.com> Date: Tue, 7 May 2024 07:35:07 +0300 Subject: [PATCH 36/88] Update update-build-release.yml --- .github/workflows/update-build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index fb38166..601e472 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -54,7 +54,7 @@ jobs: uses: rickstaa/action-create-tag@v1 if: ${{ steps.commit.outputs.commited || github.event.head_commit }} with: - tag: ${{ steps.version.outputs.tag_name }}" + tag: ${{ steps.version.outputs.tag_name }} force_push_tag: true commit_sha: ${{ steps.commit.outputs.commit_long_sha || github.event.head_commit.id}} From c3d30592eca14294056e0f814120fb098825168a Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 10 May 2024 00:33:33 +0000 Subject: [PATCH 37/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index 3752cde..a6257e0 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "f40388238a32a1785ec16ca4babbc6da204329f1f04b53cf88d4c95e63771569" }, "electron": { - "version": "29.3.2", - "x64": "https://github.com/electron/electron/releases/download/v29.3.2/electron-v29.3.2-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.3.2/electron-v29.3.2-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.3.2/electron-v29.3.2-linux-arm64.zip" + "version": "29.3.3", + "x64": "https://github.com/electron/electron/releases/download/v29.3.3/electron-v29.3.3-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.3.3/electron-v29.3.3-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.3.3/electron-v29.3.3-linux-arm64.zip" } } \ No newline at end of file From ee6326f373e7f9fe7d65a695bc56fc1a015f74da Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Sun, 12 May 2024 14:36:31 +0300 Subject: [PATCH 38/88] Fix for nix version --- .github/workflows/update-build-release.yml | 2 +- utility/generate_packages.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index 601e472..9ed6157 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Install dependencies - run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git jq nix python python-requests + run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git jq nix python python-requests gcc-libs - name: Checkout uses: actions/checkout@v4 diff --git a/utility/generate_packages.py b/utility/generate_packages.py index f0936fb..07bcd50 100644 --- a/utility/generate_packages.py +++ b/utility/generate_packages.py @@ -38,6 +38,7 @@ def generate_arch(): def is_nix_version_2_19(): version = subprocess.run(["nix", "--version"], capture_output=True, text=True).stdout.split()[2] + print(f"Nix version: {version}") major, minor, _ = map(int, version.split(".")) if major > 2 or (minor >= 19 and major == 2): return True From 9945a892a48a4bd2110678eb435417c343232572 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 16 May 2024 00:34:12 +0000 Subject: [PATCH 39/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index a6257e0..edcb049 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "f40388238a32a1785ec16ca4babbc6da204329f1f04b53cf88d4c95e63771569" }, "electron": { - "version": "29.3.3", - "x64": "https://github.com/electron/electron/releases/download/v29.3.3/electron-v29.3.3-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.3.3/electron-v29.3.3-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.3.3/electron-v29.3.3-linux-arm64.zip" + "version": "29.4.0", + "x64": "https://github.com/electron/electron/releases/download/v29.4.0/electron-v29.4.0-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.4.0/electron-v29.4.0-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.4.0/electron-v29.4.0-linux-arm64.zip" } } \ No newline at end of file From 92d8a9f46f0e341b9ba82c1521fed1dcf9998d12 Mon Sep 17 00:00:00 2001 From: Andrey Onischenko <100789522+cucumber-sp@users.noreply.github.com> Date: Sat, 18 May 2024 15:40:19 +0300 Subject: [PATCH 40/88] Update README.md for APT support --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f72944b..2eb7b6e 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,16 @@ pacman -U yandex-music--any.pkg.tar.zst #### APT -Package is currently unavailable at APT. If you'd like to help us with publishing, feel free to open new issue. +Download key and add repository to mirror list +```bash +curl -fsSL https://apt.cucumber-space.online/key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/cucumber-space.key.gpg +echo 'deb [signed-by=/etc/apt/keyrings/cucumber-space.key.gpg] https://apt.cucumber-space.online ./' > /etc/apt/sources.list.d/cucumber-space.list +sudo apt update +``` +Then you can install app with +```bash +sudo apt install yandex-music +``` #### Binary package file From 0e1d4ce56dda3666ba3734f9e577dfb9500e993d Mon Sep 17 00:00:00 2001 From: Andrey Onischenko <100789522+cucumber-sp@users.noreply.github.com> Date: Sat, 18 May 2024 16:00:23 +0300 Subject: [PATCH 41/88] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2eb7b6e..23062ec 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ pacman -U yandex-music--any.pkg.tar.zst Download key and add repository to mirror list ```bash curl -fsSL https://apt.cucumber-space.online/key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/cucumber-space.key.gpg -echo 'deb [signed-by=/etc/apt/keyrings/cucumber-space.key.gpg] https://apt.cucumber-space.online ./' > /etc/apt/sources.list.d/cucumber-space.list +echo 'deb [signed-by=/etc/apt/keyrings/cucumber-space.key.gpg] https://apt.cucumber-space.online ./' | sudo tee /etc/apt/sources.list.d/cucumber-space.list > /dev/null sudo apt update ``` Then you can install app with From e26f27b7651be7256c5310ad4fb1901066358971 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 21 May 2024 16:27:43 +0000 Subject: [PATCH 42/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 5bb7725..79a3baf 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.1.4 +pkgver=5.2.2 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.4.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("f40388238a32a1785ec16ca4babbc6da204329f1f04b53cf88d4c95e63771569" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.2.2.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("327e5b0ac6c255afb0dc285c2e559cbe042a677bb32becc91bcb2e773c682385" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.1.4.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.2.2.exe" } package() { diff --git a/flake.lock b/flake.lock index f86fb88..64e3572 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-b5fq2cPOCbs3qqi8Jz5vSy7y9LZjoweC8mohRABKd80=", + "narHash": "sha256-YqVVIpJeo8j0G8/zVaqYdZaynhvIem7FGcDbEwItlEg=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.4.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.2.2.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.4.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.2.2.exe" } } }, diff --git a/flake.nix b/flake.nix index 57fae89..1b4ace6 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.4.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.2.2.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index edcb049..84638d7 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.1.4", - "exe_name": "Yandex_Music_x64_5.1.4.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.1.4.exe", - "exe_sha256": "f40388238a32a1785ec16ca4babbc6da204329f1f04b53cf88d4c95e63771569" + "version": "5.2.2", + "exe_name": "Yandex_Music_x64_5.2.2.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.2.2.exe", + "exe_sha256": "327e5b0ac6c255afb0dc285c2e559cbe042a677bb32becc91bcb2e773c682385" }, "electron": { "version": "29.4.0", From e774ea65d94fd3b6e2776bb0cb85f9ab718ab9fd Mon Sep 17 00:00:00 2001 From: Andrey Onischenko <100789522+cucumber-sp@users.noreply.github.com> Date: Tue, 21 May 2024 19:34:42 +0300 Subject: [PATCH 43/88] Update update-build-release.yml --- .github/workflows/update-build-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index 9ed6157..7ba0620 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -52,7 +52,6 @@ jobs: - name: Tag Repo uses: rickstaa/action-create-tag@v1 - if: ${{ steps.commit.outputs.commited || github.event.head_commit }} with: tag: ${{ steps.version.outputs.tag_name }} force_push_tag: true From d1984db95ca224a2939ae0ee82fbe95c57d9229c Mon Sep 17 00:00:00 2001 From: Yury Shvedov Date: Wed, 22 May 2024 14:23:12 +0300 Subject: [PATCH 44/88] [nix] Fix configuration Reuse common shell for nix package. Add options for nix-way configuration of yandex music. Change-Id: I71a209a8ca8b5e3c5c08349b8da5ba91182a919e --- README.md | 27 +++++++++---------- build_tarball.sh | 5 ++-- flake.nix | 56 +++++++++++++++++++-------------------- nix/default.nix | 18 ++++++++++--- nix/module.nix | 53 ++++++++++++++++++++++++++++++++++++ templates/PKGBUILD | 1 + templates/yandex-music.sh | 2 +- 7 files changed, 111 insertions(+), 51 deletions(-) create mode 100644 nix/module.nix diff --git a/README.md b/README.md index 23062ec..7365d8d 100644 --- a/README.md +++ b/README.md @@ -244,27 +244,24 @@ nix-build --expr '(import {}).callPackage ./nix {}' }; ``` -2. Import module in your `configuration.nix` or `home-manager.nix` - +2. Import module in your `configuration.nix`: ```nix imports = [ - yandex-music.nixosModule + yandex-music.nixosModules.default ]; ``` -3. Add package `yandex-music` + or in `home-manager.nix`: + ```nix + imports = [ + yandex-music.homeManagerModules.default + ]; + ``` - For `configuration.nix`: + +3. Enable `yandex-music` ```nix - environment.systemPackages = with pkgs; [ - yandex-music - ]; - ``` - For Home Manager: - - ```nix - home.packages = with pkgs; [ - yandex-music - ]; + programs.yandex-music.enable = true; + programs.yandex-music.tray.enable = true; # to enable tray support ``` diff --git a/build_tarball.sh b/build_tarball.sh index 2ef0874..f9be65e 100644 --- a/build_tarball.sh +++ b/build_tarball.sh @@ -34,7 +34,7 @@ build_tarball(){ install -Dm644 "${TEMPDIR}/app/favicon.png" "${app_dir}/usr/share/pixmaps/yandex-music.png" install -Dm644 "${TEMPDIR}/app/favicon.png" "${app_dir}/usr/share/icons/hicolor/48x48/apps/yandex-music.png" install -Dm644 "${TEMPDIR}/app/favicon.svg" "${app_dir}/usr/share/icons/hicolor/scalable/apps/yandex-music.svg" - + install -Dm644 "./templates/desktop" "${app_dir}/usr/share/applications/yandex-music.desktop" install -Dm644 "./templates/default.conf" "${app_dir}/usr/lib/yandex-music/default.conf" install -Dm644 "./LICENSE.md" "${app_dir}/usr/share/licenses/yandex-music/LICENSE" @@ -42,6 +42,7 @@ build_tarball(){ install -Dm755 "./templates/yandex-music.sh" "${app_dir}/usr/bin/yandex-music" sed -i "s|%electron_path%|/usr/lib/yandex-music/electron/electron|g" "${app_dir}/usr/bin/yandex-music" + sed -i "s|%asar_path%|/usr/lib/yandex-music/yandex-music.asar|g" "${app_dir}/usr/bin/yandex-music" cd "${app_dir}" tar -czf "${OUTPUT_DIR}/yandex-music_${version}_${arch}.tar.gz" * @@ -128,4 +129,4 @@ fi if [ ${arm64} -eq 1 ]; then download_electron_binary "arm64" build_tarball "arm64" -fi \ No newline at end of file +fi diff --git a/flake.nix b/flake.nix index 1b4ace6..f916e27 100644 --- a/flake.nix +++ b/flake.nix @@ -7,35 +7,33 @@ }; outputs = { self, ymExe, nixpkgs, flake-utils }: - let - yandex-music-with = pkgs: pkgs.callPackage ./nix { - inherit ymExe; - }; - in - flake-utils.lib.eachDefaultSystem - (system: - let - pkgs = import nixpkgs { inherit system; }; - in - { - packages = rec { - yandex-music = yandex-music-with pkgs; - yandex-music-noflakes = pkgs.callPackage ./nix {}; - default = yandex-music; - }; - } - ) // { - nixosModules = rec { - yandex-music = { - nixpkgs.overlays = [ - (final: prev: { - yandex-music = yandex-music-with prev; - }) - ]; + let + yandex-music-with = pkgs: pkgs.callPackage ./nix { + inherit ymExe; }; - default = yandex-music; - }; + modules = isHm: rec { + yandex-music = { + imports = [ (import ./nix/module.nix { inherit isHm yandex-music-with; }) ]; + }; + default = yandex-music; + }; + in + flake-utils.lib.eachDefaultSystem + (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + packages = rec { + yandex-music = yandex-music-with pkgs; + yandex-music-noflakes = pkgs.callPackage ./nix { }; + default = yandex-music; + }; + } + ) // { + nixosModules = modules false; + homeManagerModules = modules true; - nixosModule = self.nixosModules.default; - }; + nixosModule = self.nixosModules.default; + }; } diff --git a/nix/default.nix b/nix/default.nix index d1e66df..35363f9 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -10,6 +10,8 @@ , electron , ymExe ? null +, electronArguments ? "" +, trayEnabled ? false }: let version_info = with builtins; fromJSON (readFile ../utility/version_info.json); @@ -32,6 +34,7 @@ stdenvNoCC.mkDerivation utility = ./../utility; icons = ./../icons; desktopItem = ../templates/desktop; + ymScript = ../templates/yandex-music.sh; src = if ymExe != null then ymExe @@ -54,10 +57,17 @@ stdenvNoCC.mkDerivation mkdir -p "$out/share/nodejs" mv app/yandex-music.asar "$out/share/nodejs" - # use makeWrapper on electron binary to make it call our asar package - makeWrapper "${electron}/bin/electron" "$out/bin/yandex-music" \ - --add-flags "$out/share/nodejs/yandex-music.asar" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" + CONFIG_FILE="$out/share/yandex-music.conf" + echo "TRAY_ENABLED=${if trayEnabled then "1" else "0"}" >> "$CONFIG_FILE" + echo "ELECTRON_ARGS=\"${electronArguments}\"" >> "$CONFIG_FILE" + + + install -Dm755 "$ymScript" "$out/bin/yandex-music" + sed -i "s|%electron_path%|${electron}/bin/electron|g" "$out/bin/yandex-music" + sed -i "s|%asar_path%|$out/share/nodejs/yandex-music.asar|g" "$out/bin/yandex-music" + + wrapProgram "$out/bin/yandex-music" \ + --set-default YANDEX_MUSIC_CONFIG "$CONFIG_FILE" install -Dm644 "./app/favicon.png" "$out/share/pixmaps/yandex-music.png" install -Dm644 "./app/favicon.png" "$out/share/icons/hicolor/48x48/apps/yandex-music.png" diff --git a/nix/module.nix b/nix/module.nix new file mode 100644 index 0000000..f81c461 --- /dev/null +++ b/nix/module.nix @@ -0,0 +1,53 @@ +{ yandex-music-with +, isHm ? false +}: +{ lib, pkgs, config, ... }: +let + cfg = config.programs.yandex-music; + +in +{ + imports = [{ + nixpkgs.overlays = [ + (final: prev: { + yandex-music = yandex-music-with prev; + }) + ]; + }]; + + options = { + programs.yandex-music = { + enable = lib.mkEnableOption "yandex music application"; + tray.enable = lib.mkEnableOption "tray icon for yandex music application"; + electronArguments = lib.mkOption { + description = "Extra electron arguments"; + example = "--no-sandbox --trace-warnings"; + type = lib.types.str; + default = ""; + }; + package = lib.mkOption { + description = "Finalized package of yandex music application"; + type = lib.types.package; + default = pkgs.yandex-music.override { + trayEnabled = cfg.tray.enable; + electronArguments = cfg.electronArguments; + }; + }; + }; + }; + + config = lib.mkIf cfg.enable ( + if isHm then + { + home.packages = [ + cfg.package + ]; + } + else + { + environment.systemPackages = [ + cfg.package + ]; + } + ); +} diff --git a/templates/PKGBUILD b/templates/PKGBUILD index 9a9b308..537c2a4 100644 --- a/templates/PKGBUILD +++ b/templates/PKGBUILD @@ -36,4 +36,5 @@ package() { install -Dm755 "$srcdir/yandex-music-linux/templates/yandex-music.sh" "$pkgdir/usr/bin/yandex-music" sed -i "s|%electron_path%|/usr/bin/electron29|g" "$pkgdir/usr/bin/yandex-music" + sed -i "s|%asar_path%|/usr/lib/yandex-music/yandex-music.asar|g" "$pkgdir/usr/bin/yandex-music" } diff --git a/templates/yandex-music.sh b/templates/yandex-music.sh index 1107b6e..321263c 100644 --- a/templates/yandex-music.sh +++ b/templates/yandex-music.sh @@ -24,4 +24,4 @@ ELECTRON_BIN=${ELECTRON_CUSTOM_BIN:-%electron_path%} export TRAY_ENABLED=${TRAY_ENABLED:-0} -exec "${ELECTRON_BIN}" "/usr/lib/yandex-music/yandex-music.asar" $ELECTRON_ARGS $WAYLAND_FLAGS \ No newline at end of file +exec "${ELECTRON_BIN}" "%asar_path%" $ELECTRON_ARGS $WAYLAND_FLAGS From e0e7b4e860cea2552008182e8a84f78e6529773b Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 22 May 2024 15:37:51 +0000 Subject: [PATCH 45/88] Update packages --- PKGBUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/PKGBUILD b/PKGBUILD index 79a3baf..966e687 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -36,4 +36,5 @@ package() { install -Dm755 "$srcdir/yandex-music-linux/templates/yandex-music.sh" "$pkgdir/usr/bin/yandex-music" sed -i "s|%electron_path%|/usr/bin/electron29|g" "$pkgdir/usr/bin/yandex-music" + sed -i "s|%asar_path%|/usr/lib/yandex-music/yandex-music.asar|g" "$pkgdir/usr/bin/yandex-music" } From 4454bf0c609b6e07b29b6d761a370f3a22fe8a02 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 23 May 2024 00:34:17 +0000 Subject: [PATCH 46/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index 84638d7..5d98931 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "327e5b0ac6c255afb0dc285c2e559cbe042a677bb32becc91bcb2e773c682385" }, "electron": { - "version": "29.4.0", - "x64": "https://github.com/electron/electron/releases/download/v29.4.0/electron-v29.4.0-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.4.0/electron-v29.4.0-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.4.0/electron-v29.4.0-linux-arm64.zip" + "version": "29.4.1", + "x64": "https://github.com/electron/electron/releases/download/v29.4.1/electron-v29.4.1-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.4.1/electron-v29.4.1-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.4.1/electron-v29.4.1-linux-arm64.zip" } } \ No newline at end of file From df91aea5ad8fa0faab55cdd3566272ab845d545e Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Thu, 23 May 2024 12:01:06 +0300 Subject: [PATCH 47/88] Add deeplink handler to desktop file --- templates/desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/desktop b/templates/desktop index ff34882..aefda5f 100644 --- a/templates/desktop +++ b/templates/desktop @@ -9,4 +9,5 @@ Icon=yandex-music Type=Application StartupNotify=true StartupWMClass=YandexMusic +MimeType=x-scheme-handler/yandexmusic Categories=Audio;Music;Player;AudioVideo From a8a45629e5453b068516d7c212afb9b08bbb322a Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 30 May 2024 00:34:54 +0000 Subject: [PATCH 48/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index 5d98931..ddc0588 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "327e5b0ac6c255afb0dc285c2e559cbe042a677bb32becc91bcb2e773c682385" }, "electron": { - "version": "29.4.1", - "x64": "https://github.com/electron/electron/releases/download/v29.4.1/electron-v29.4.1-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.4.1/electron-v29.4.1-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.4.1/electron-v29.4.1-linux-arm64.zip" + "version": "29.4.2", + "x64": "https://github.com/electron/electron/releases/download/v29.4.2/electron-v29.4.2-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.4.2/electron-v29.4.2-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.4.2/electron-v29.4.2-linux-arm64.zip" } } \ No newline at end of file From 04bb3aaa490566e65c27c9a50dc8eca05f5426ee Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 4 Jun 2024 00:34:59 +0000 Subject: [PATCH 49/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 966e687..8118056 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.2.2 +pkgver=5.3.2 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.2.2.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("327e5b0ac6c255afb0dc285c2e559cbe042a677bb32becc91bcb2e773c682385" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.3.2.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("2bce0db392f3a2354e196d76463f5f02ba245d123dff45dac5fe344e3f304eb6" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.2.2.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.3.2.exe" } package() { diff --git a/flake.lock b/flake.lock index 64e3572..be0a1d4 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-YqVVIpJeo8j0G8/zVaqYdZaynhvIem7FGcDbEwItlEg=", + "narHash": "sha256-G1ANZmAsX6UhBvAZaBIjAep0a7PNY51yUM81qdUTb8E=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.2.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.3.2.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.2.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.3.2.exe" } } }, diff --git a/flake.nix b/flake.nix index f916e27..611c06e 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.2.2.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.3.2.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index ddc0588..2397533 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.2.2", - "exe_name": "Yandex_Music_x64_5.2.2.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.2.2.exe", - "exe_sha256": "327e5b0ac6c255afb0dc285c2e559cbe042a677bb32becc91bcb2e773c682385" + "version": "5.3.2", + "exe_name": "Yandex_Music_x64_5.3.2.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.3.2.exe", + "exe_sha256": "2bce0db392f3a2354e196d76463f5f02ba245d123dff45dac5fe344e3f304eb6" }, "electron": { "version": "29.4.2", From 06ba5be9c6e7436ebc57715e567a0896114def54 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 8 Jun 2024 00:35:45 +0000 Subject: [PATCH 50/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 8118056..eb94db9 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.3.2 +pkgver=5.4.2 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.3.2.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("2bce0db392f3a2354e196d76463f5f02ba245d123dff45dac5fe344e3f304eb6" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.4.2.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("a1dea7bcfd59cf5009c5af2d640986c6394e96fdafdb8927d9bf8a42340407b2" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.3.2.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.4.2.exe" } package() { diff --git a/flake.lock b/flake.lock index be0a1d4..5966fbb 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-G1ANZmAsX6UhBvAZaBIjAep0a7PNY51yUM81qdUTb8E=", + "narHash": "sha256-xbIeD8VU9eStVsPFj8rH85LtyuKA0J9ZAn1ZnOczXaQ=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.3.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.4.2.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.3.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.4.2.exe" } } }, diff --git a/flake.nix b/flake.nix index 611c06e..7b0a6f4 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.3.2.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.4.2.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 2397533..1747da7 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.3.2", - "exe_name": "Yandex_Music_x64_5.3.2.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.3.2.exe", - "exe_sha256": "2bce0db392f3a2354e196d76463f5f02ba245d123dff45dac5fe344e3f304eb6" + "version": "5.4.2", + "exe_name": "Yandex_Music_x64_5.4.2.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.4.2.exe", + "exe_sha256": "a1dea7bcfd59cf5009c5af2d640986c6394e96fdafdb8927d9bf8a42340407b2" }, "electron": { "version": "29.4.2", From c4ae616019df1573643bb28e8869264a374eb65c Mon Sep 17 00:00:00 2001 From: Andrey Onischenko <100789522+cucumber-sp@users.noreply.github.com> Date: Mon, 10 Jun 2024 08:50:25 +0300 Subject: [PATCH 51/88] Update update-build-release.yml --- .github/workflows/update-build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index 7ba0620..4c44cf5 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Install dependencies - run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git jq nix python python-requests gcc-libs + run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git jq nix python python-requests gcc-libs glibc - name: Checkout uses: actions/checkout@v4 From 36fc971fc479f2e201caaffb3a5615f0e1c2eaa6 Mon Sep 17 00:00:00 2001 From: Andrey Onischenko <100789522+cucumber-sp@users.noreply.github.com> Date: Mon, 10 Jun 2024 09:13:51 +0300 Subject: [PATCH 52/88] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf61ced..81adb0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: image: archlinux:latest steps: - name: Install packages - run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git sudo base-devel p7zip nodejs jq asar electron29 libpulse dpkg unzip xdg-utils python rpm-tools + run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git sudo base-devel p7zip nodejs jq asar electron29 libpulse dpkg unzip xdg-utils python rpm-tools glibc - name: Checkout uses: actions/checkout@v4 with: From e9c408ea20f4b9601209ef9a891874f452675fc7 Mon Sep 17 00:00:00 2001 From: Andrey Onischenko <100789522+cucumber-sp@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:52:40 +0300 Subject: [PATCH 53/88] Update update-build-release.yml --- .github/workflows/update-build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index 4c44cf5..6dfa5f4 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Install dependencies - run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git jq nix python python-requests gcc-libs glibc + run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git jq nix python python-requests openssl gcc-libs glibc - name: Checkout uses: actions/checkout@v4 From 34e875f43de071e7dd6c609ede033f0fc2cbce13 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 20 Jun 2024 11:53:54 +0000 Subject: [PATCH 54/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index eb94db9..71d838a 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.4.2 +pkgver=5.5.0 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.4.2.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("a1dea7bcfd59cf5009c5af2d640986c6394e96fdafdb8927d9bf8a42340407b2" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.5.0.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("94d800c5a378fe1c9df54c8f10b08a008cd36a55ba6bfdd950eb0aa8775cf9a3" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.4.2.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.5.0.exe" } package() { diff --git a/flake.lock b/flake.lock index 5966fbb..69d65c6 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-xbIeD8VU9eStVsPFj8rH85LtyuKA0J9ZAn1ZnOczXaQ=", + "narHash": "sha256-972K+6Grj18VAZJFYHDScXag+jNpWuCPYhjol//ahes=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.4.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.5.0.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.4.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.5.0.exe" } } }, diff --git a/flake.nix b/flake.nix index 7b0a6f4..54dca8b 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.4.2.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.5.0.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 1747da7..6c5c032 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.4.2", - "exe_name": "Yandex_Music_x64_5.4.2.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.4.2.exe", - "exe_sha256": "a1dea7bcfd59cf5009c5af2d640986c6394e96fdafdb8927d9bf8a42340407b2" + "version": "5.5.0", + "exe_name": "Yandex_Music_x64_5.5.0.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.5.0.exe", + "exe_sha256": "94d800c5a378fe1c9df54c8f10b08a008cd36a55ba6bfdd950eb0aa8775cf9a3" }, "electron": { "version": "29.4.2", From 10a10e060fe60a3fe97a31983c84de646355adfd Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Thu, 20 Jun 2024 15:08:10 +0300 Subject: [PATCH 55/88] Patches update --- patches/0001-Add-package-licence.patch | 8 ++++---- patches/0002-Add-package-icon.patch | 6 +++--- patches/0003-Create-app-tray-icon.patch | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/patches/0001-Add-package-licence.patch b/patches/0001-Add-package-licence.patch index 873bbde..dd8ff15 100644 --- a/patches/0001-Add-package-licence.patch +++ b/patches/0001-Add-package-licence.patch @@ -1,10 +1,10 @@ diff --git a/package.json b/package.json --- a/package.json +++ b/package.json -@@ -42,5 +42,6 @@ - "COPYRIGHT": "Яндекс Музыка", - "TRADEMARK": "Яндекс Музыка", - "DEEPLINK_PROTOCOL": "yandexmusic" +@@ -51,5 +51,6 @@ + "kk", + "az" + ] - } + }, + "license": "UNLICENSED" diff --git a/patches/0002-Add-package-icon.patch b/patches/0002-Add-package-icon.patch index ff3529f..93cb5f0 100644 --- a/patches/0002-Add-package-icon.patch +++ b/patches/0002-Add-package-icon.patch @@ -1,9 +1,9 @@ diff --git a/package.json b/package.json --- a/package.json +++ b/package.json -@@ -43,5 +43,9 @@ - "TRADEMARK": "Яндекс Музыка", - "DEEPLINK_PROTOCOL": "yandexmusic" +@@ -52,5 +52,9 @@ + "az" + ] }, - "license": "UNLICENSED" + "license": "UNLICENSED", diff --git a/patches/0003-Create-app-tray-icon.patch b/patches/0003-Create-app-tray-icon.patch index be38b01..2eef730 100644 --- a/patches/0003-Create-app-tray-icon.patch +++ b/patches/0003-Create-app-tray-icon.patch @@ -28,16 +28,16 @@ diff --git a/main/lib/createTray.js b/main/lib/createTray.js diff --git a/main/index.js b/main/index.js --- a/main/index.js +++ b/main/index.js -@@ -33,6 +33,9 @@ const handleWindowSessionEvents_js_1 = require("./lib/handlers/handleWindowSessi - (0, safeRedirects_js_1.safeRedirects)(window); - (0, handleWindowLifecycleEvents_js_1.handleWindowLifecycleEvents)(window); - (0, handleWindowSessionEvents_js_1.handleWindowSessionEvents)(window); +@@ -42,6 +42,9 @@ Logger_js_1.Logger.setupLogger(); + (0, handleDeeplink_js_1.handleDeeplink)(window); + (0, handleMetrikaRequests_js_1.handleMetrikaRequests)(window); + (0, handleCrash_js_1.handleCrash)(); + const {createTray} = require('./lib/createTray.js'); + const trayEnabled = process.env.TRAY_ENABLED && process.env.TRAY_ENABLED > 0; + if (trayEnabled){createTray(window);} - (0, events_js_1.handleApplicationEvents)(window); - (0, handleExternalLink_js_1.handleExternalLink)(window); - (0, logger_js_1.logWindowLifecycle)(window); + await (0, loadURL_js_1.loadURL)(window); + if (node_os_1.default.platform() === platform_js_1.Platform.WINDOWS) { + (0, customTitleBar_js_1.createCustomTitleBar)(window); diff --git a/main/lib/handlers/handleWindowLifecycleEvents.js b/main/lib/handlers/handleWindowLifecycleEvents.js From 7cfb49a86ab495ec1f66949d6892a2ed33789b5e Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 28 Jun 2024 00:36:04 +0000 Subject: [PATCH 56/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index 6c5c032..002be22 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "94d800c5a378fe1c9df54c8f10b08a008cd36a55ba6bfdd950eb0aa8775cf9a3" }, "electron": { - "version": "29.4.2", - "x64": "https://github.com/electron/electron/releases/download/v29.4.2/electron-v29.4.2-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.4.2/electron-v29.4.2-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.4.2/electron-v29.4.2-linux-arm64.zip" + "version": "29.4.3", + "x64": "https://github.com/electron/electron/releases/download/v29.4.3/electron-v29.4.3-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.4.3/electron-v29.4.3-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.4.3/electron-v29.4.3-linux-arm64.zip" } } \ No newline at end of file From a0d8c449be87264fe27fb05fd8f900578d9eeaed Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 4 Jul 2024 00:36:06 +0000 Subject: [PATCH 57/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 71d838a..a314225 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.5.0 +pkgver=5.6.0 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.5.0.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("94d800c5a378fe1c9df54c8f10b08a008cd36a55ba6bfdd950eb0aa8775cf9a3" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.6.0.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("65991fc9bd01d81a802f869bfd01212ddde38bcf817c298d6e7242c1c415e804" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.5.0.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.6.0.exe" } package() { diff --git a/flake.lock b/flake.lock index 69d65c6..d99ea8c 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-972K+6Grj18VAZJFYHDScXag+jNpWuCPYhjol//ahes=", + "narHash": "sha256-fY6WFe1fdaS95gismmP6dmfHUIQOqadxTrDgjKSC9GY=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.5.0.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.6.0.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.5.0.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.6.0.exe" } } }, diff --git a/flake.nix b/flake.nix index 54dca8b..6bcf2f6 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.5.0.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.6.0.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 002be22..ecab234 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.5.0", - "exe_name": "Yandex_Music_x64_5.5.0.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.5.0.exe", - "exe_sha256": "94d800c5a378fe1c9df54c8f10b08a008cd36a55ba6bfdd950eb0aa8775cf9a3" + "version": "5.6.0", + "exe_name": "Yandex_Music_x64_5.6.0.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.6.0.exe", + "exe_sha256": "65991fc9bd01d81a802f869bfd01212ddde38bcf817c298d6e7242c1c415e804" }, "electron": { "version": "29.4.3", From d952c2af10d60cc0f633492041f48668e682e17d Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Thu, 4 Jul 2024 08:23:31 +0300 Subject: [PATCH 58/88] Fix repack --- patches/0003-Create-app-tray-icon.patch | 6 +++--- patches/0004-Fix-window-resize.patch | 2 +- repack.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/patches/0003-Create-app-tray-icon.patch b/patches/0003-Create-app-tray-icon.patch index 2eef730..57db2b0 100644 --- a/patches/0003-Create-app-tray-icon.patch +++ b/patches/0003-Create-app-tray-icon.patch @@ -28,7 +28,7 @@ diff --git a/main/lib/createTray.js b/main/lib/createTray.js diff --git a/main/index.js b/main/index.js --- a/main/index.js +++ b/main/index.js -@@ -42,6 +42,9 @@ Logger_js_1.Logger.setupLogger(); +@@ -46,6 +46,9 @@ Logger_js_1.Logger.setupLogger(); (0, handleDeeplink_js_1.handleDeeplink)(window); (0, handleMetrikaRequests_js_1.handleMetrikaRequests)(window); (0, handleCrash_js_1.handleCrash)(); @@ -43,7 +43,7 @@ diff --git a/main/index.js b/main/index.js diff --git a/main/lib/handlers/handleWindowLifecycleEvents.js b/main/lib/handlers/handleWindowLifecycleEvents.js --- a/main/lib/handlers/handleWindowLifecycleEvents.js +++ b/main/lib/handlers/handleWindowLifecycleEvents.js -@@ -29,9 +29,8 @@ const handleWindowLifecycleEvents = (window) => { +@@ -28,9 +28,8 @@ const handleWindowLifecycleEvents = (window) => { state_js_1.state.willQuit = true; }); electron_1.app.on('window-all-closed', () => { @@ -55,7 +55,7 @@ diff --git a/main/lib/handlers/handleWindowLifecycleEvents.js b/main/lib/handler }); electron_1.app.on('browser-window-blur', () => { setBlurredTime(); -@@ -49,22 +48,11 @@ const handleWindowLifecycleEvents = (window) => { +@@ -51,22 +50,11 @@ const handleWindowLifecycleEvents = (window) => { checkAndUpdateApplicationData(window); }); window.on('close', (event) => { diff --git a/patches/0004-Fix-window-resize.patch b/patches/0004-Fix-window-resize.patch index 3aa647b..8ad7409 100644 --- a/patches/0004-Fix-window-resize.patch +++ b/patches/0004-Fix-window-resize.patch @@ -1,7 +1,7 @@ diff --git a/main/lib/createWindow.js b/main/lib/createWindow.js --- a/main/lib/createWindow.js +++ b/main/lib/createWindow.js -@@ -25,8 +25,6 @@ const createWindow = async () => { +@@ -45,8 +45,6 @@ const createWindow = async () => { x: 16, y: 10 }, diff --git a/repack.sh b/repack.sh index 64c00b1..1667876 100755 --- a/repack.sh +++ b/repack.sh @@ -84,7 +84,7 @@ done echo "Title Fixed" echo "Replacing Icons" -cp -drf "$SCRIPT_DIR/icons/." "./build/next-desktop/" +cp -drf "$SCRIPT_DIR/icons/." "./app/" echo "Replaced Icons" # applying patches @@ -131,7 +131,7 @@ echo "Packing" cd "$curdir" asar pack "$TEMPDIR/app" "$dst/yandex-music.asar" for ext in png svg; do - mv "$TEMPDIR/app/build/next-desktop/favicon.$ext" "$dst" + mv "$TEMPDIR/app/app/favicon.$ext" "$dst" done python "$SCRIPT_DIR/utility/extract_release_notes.py" "$TEMPDIR/app/main/translations/compiled/ru.json" "$dst/release_notes.json" From f9b9ca59bd6b02668dbfad03be09cfa100949536 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Thu, 4 Jul 2024 08:40:06 +0300 Subject: [PATCH 59/88] github CI upload fix --- .github/workflows/update-build-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index 6dfa5f4..cf61d50 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -97,7 +97,7 @@ jobs: ref: ${{ needs.update_packages.outputs.commit_long_sha }} - name: Publish package changes to AUR - uses: KSXGitHub/github-actions-deploy-aur@v2.7.0 + uses: KSXGitHub/github-actions-deploy-aur@v2.7.2 with: pkgname: "yandex-music" pkgbuild: "PKGBUILD" @@ -107,7 +107,7 @@ jobs: commit_email: "loraner123@gmail.com" ssh_private_key: "${{ secrets.AUR_SSH_PRIVATE_KEY }}" commit_message: "${{ needs.update_packages.outputs.commit_name }}" - ssh_keyscan_types: "rsa,dsa,ecdsa,ed25519" + ssh_keyscan_types: "rsa,ecdsa,ed25519" - name: Download artifact uses: actions/download-artifact@v4 From 3d7cd18d57a46bceeda437d0bbbb7eacbb1253fd Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Thu, 4 Jul 2024 17:28:51 +0300 Subject: [PATCH 60/88] Tray icon path fix --- patches/0003-Create-app-tray-icon.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/0003-Create-app-tray-icon.patch b/patches/0003-Create-app-tray-icon.patch index 57db2b0..4cf3adb 100644 --- a/patches/0003-Create-app-tray-icon.patch +++ b/patches/0003-Create-app-tray-icon.patch @@ -6,7 +6,7 @@ diff --git a/main/lib/createTray.js b/main/lib/createTray.js +const path = require('path'); + +function createTray(window) { -+ const iconPath = path.join(__dirname, '../../build/next-desktop/favicon.png'); ++ const iconPath = path.join(__dirname, '../../app/favicon.png'); + const tray = new Tray(iconPath); + const contextMenu = Menu.buildFromTemplate([ + {label: 'Открыть', click: () => window.show()}, From 9199c4567a43839ebe5c4af0fd855fa60602f4f3 Mon Sep 17 00:00:00 2001 From: asalde_le1 <57564314+asaldele1@users.noreply.github.com> Date: Fri, 5 Jul 2024 20:12:00 +0300 Subject: [PATCH 61/88] Create "Add OS spoof" patch --- patches/0005-Add-OS-spoof.patch | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 patches/0005-Add-OS-spoof.patch diff --git a/patches/0005-Add-OS-spoof.patch b/patches/0005-Add-OS-spoof.patch new file mode 100644 index 0000000..7e02378 --- /dev/null +++ b/patches/0005-Add-OS-spoof.patch @@ -0,0 +1,9 @@ +diff --git a/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js b/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js +--- a/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js ++++ b/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js +@@ -1,4 +1,4 @@ +-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4720,9889,2121,3799,1521,1593,9880,8910,2499,105,5001,4870,2286,1871,9264],{35582:function(e,t,i){"use strict";i.r(t);var a,o,r,n,l,s,d,u,c,C,h,m,p,v,E,f,_,y,A,P,L,x,b,g,N,V,S,T,w,R,M,H,k,j,B,Z,I,O,q,D,U,z,F,W,Y,G,K,J,$,X,Q,ee,et,ei,ea,eo,er,en,el,es,ed,eu,ec,eC,eh,em,ep,ev,eE,ef,e_,ey,eA,eP,eL,ex,eb,eg,eN,eV,eS,eT,ew,eR,eM,eH,ek,ej,eB,eZ,eI,eO,eq,eD,eU=i(99616);function ez(){return(ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let e=(0,n.useRouter)(),t=(0,c.uK)(),i=t.get(c.xi),o=(0,l.useCallback)(()=>{i.authorizationUrl&&e.push(i.authorizationUrl)},[i.authorizationUrl,e]);return(0,a.jsxs)("div",{className:h().root,children:[(0,a.jsx)(u.Heading,{className:(0,r.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(s.Z,{id:"authorization.enter-title"})}),(0,a.jsx)(u.Caption,{className:(0,r.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(s.Z,{id:"authorization.enter-text"})}),(0,a.jsx)(d.z,{onClick:o,className:h().button,role:"link",color:"primary",size:"l",radius:"xxxl",children:(0,a.jsx)(u.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(s.Z,{id:"authorization.enter-button"})})})]})}),p=(0,o.Pi)(e=>{let{children:t}=e,{user:i}=(0,c.oR)();return i.isAuthorized?t:(0,a.jsx)(m,{})})},40466:function(e,t,i){"use strict";i.r(t),i.d(t,{WithBetaUser:function(){return A}});var a=i(8759),o=i(33423),r=i(35338),n=i(11769),l=i(99616),s=i(65244),d=i(2814),u=i(15527),c=i(13410),C=i(28036),h=i(1918),m=i(57921),p=i(39479),v=i(5674),E=i(44285),f=i(99800),_=i.n(f);let y=(0,o.Pi)(e=>{let{withoutExperiment:t=!1,showLoginButton:o=!1,showUserProfile:f=!1,withOffer:y=!1}=e,A=(0,n.useRouter)(),P=(0,v.uK)(),{settings:L}=(0,v.oR)(),{formatMessage:x}=(0,s.Z)(),b=P.get(v.xi),g=P.get(v.U5),N=(0,v.yy)(g.oldWebHost),V=(0,l.useMemo)(()=>L.layout===v.t8.Mobile?i(25811).Z.src:i(11737).Z.src,[L.layout]),S=(0,l.useCallback)(()=>{b.authorizationUrl&&A.push(b.authorizationUrl)},[b.authorizationUrl,A]);(0,v.NO)(!0);let T=(0,l.useMemo)(()=>y?(0,a.jsx)(h.Heading,{variant:"h1",size:"xl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-header"})}):t?(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-header",values:{br:(0,a.jsx)("br",{})}})}):(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-header",values:{br:(0,a.jsx)("br",{})}})}),[y,t]),w=(0,l.useMemo)(()=>t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})})})]}):y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().offerText,children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})})})]}),[y,t]),R=(0,l.useMemo)(()=>{if(o)return(0,a.jsx)(u.z,{onClick:S,className:_().loginButton,role:"link",color:"primary",size:"m",radius:"xxxl",children:(0,a.jsx)(d.Z,{id:"authorization.enter-button"})});if(y){let e="https://".concat(N,"/pay");return(0,a.jsx)(E.rU,{className:_().offerButtonLink,href:e,"aria-label":x({id:"payment.offer-button"}),target:"_blank",children:(0,a.jsx)(u.z,{className:(0,r.W)(_().offerButton,_().offerButton_important),role:"link",color:"plus",size:"l",radius:"m",withRipple:!1,children:(0,a.jsx)(d.Z,{id:"payment.offer-button"})})})}},[x,S,N,o,y]);return(0,v.ZP)(!0),(0,a.jsxs)("div",{className:(0,r.W)(_().root),children:[(0,a.jsx)(m.TF,{withSecondaryColor:!0}),(0,a.jsx)("div",{className:_().logoContainer,children:(0,a.jsx)(c.T,{alignIcon:"center",lang:"ru",className:_().logo})}),T,w,R,(0,a.jsx)("img",{className:_().image,src:V}),f&&(0,a.jsx)(p.Iw,{className:_().user,withMeta:L.layout!==v.t8.Mobile,variant:L.layout===v.t8.Mobile?"mobile":"desktop",usernameClassName:(0,r.W)(_().username,_().important)})]})}),A=(0,o.Pi)(e=>{let{children:t}=e,{user:i,experiments:o}=(0,v.oR)();return i.isAuthorized?o.checkExperiment(v.pe.WebNext,"on")&&!i.isChild?i.hasPlus||o.checkExperiment(v.pe.WebNextFreemium,"on")?t:(0,a.jsx)(y,{withOffer:!0,showUserProfile:!0}):(0,a.jsx)(y,{withoutExperiment:!0,showUserProfile:!0}):(0,a.jsx)(y,{showLoginButton:!0})})},12286:function(e,t,i){"use strict";i.r(t);var a=i(8759),o=i(35338),r=i(99616),n=i(92318),l=i(89788),s=i(5674),d=i(37500),u=i.n(d),c=i(21535);t.default=e=>{let{children:t}=e,{state:i,toggleTrue:d}=(0,n.O)(!1),{state:C,toggleTrue:h}=(0,n.O)(!1),m=(0,r.useMemo)(()=>{let e=new l.JC;return(0,s.NK)(e.get(s.BU.Theme),(0,s.Q$)())},[]),p=(0,r.useCallback)(e=>{let t=c.env.ASSET_PREFIX||"";return"".concat(t,"/video/splash_screen/splash_screen_").concat(m,".").concat(e)},[m]),v=(0,r.useMemo)(()=>({isVisible:!i}),[i]);return(0,a.jsxs)(s.IP.Provider,{value:v,children:[!i&&(0,a.jsx)("div",{className:(0,o.W)(u().root,u()["root_".concat(m)],{[u().root_hidden]:C}),onAnimationEnd:d,children:(0,a.jsxs)("video",{className:u().video,autoPlay:!0,muted:!0,playsInline:!0,onEnded:h,onError:d,children:[(0,a.jsx)("source",{src:p("webm"),type:"video/webm"}),(0,a.jsx)("source",{src:p("mp4"),type:"video/mp4"})]})}),t]})}},44495:function(e,t,i){"use strict";i.r(t),i.d(t,{DesktopInitializer:function(){return d}});var a=i(8759),o=i(35338),r=i(99616),n=i(48769),l=i(57921),s=i(5674);let d=()=>{let e=(0,s.Xf)(),{dictionary:t}=(0,s.ZS)();{let{theme:e}=(0,s.Fg)(),t=(0,s.sv)();(0,l.Tk)(),(0,l.Er)(),(0,l.bO)(),(0,l.vs)(),(0,l.Zw)(),(0,r.useEffect)(()=>{(0,l.Yl)(),(0,l.l7)()},[]),(0,r.useEffect)(()=>{let e=(0,s.bo)();e&&t.count(e,"appVersion")},[t]),(0,r.useEffect)(()=>{(0,l.F5)(e),t.count(e,"appTheme")},[e])}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Notification,{className:(0,o.W)({updateNotificationContainer:!0,updateNotificationContainer_application_windows:e===s.t4.WINDOWS,updateNotificationContainer_application_macos:e===s.t4.MACOS}),enableMultiContainer:!0,containerId:s.W$.APPLICATION_UPDATE,position:"top-center"}),(0,a.jsx)(l.Pj,{dictionary:t})]})}},49842:function(e,t,i){"use strict";i.r(t),i.d(t,{UrlInitializer:function(){return n}});var a=i(33423),o=i(11769),r=i(5674);let n=(0,a.Pi)(e=>{let{host:t}=e,{location:i}=(0,r.oR)(),a=(0,o.usePathname)(),n=(0,o.useSearchParams)().toString(),l=window.location.host,s=t||l,d="https://".concat(s),u="https://".concat(s).concat(a).concat(n?"?":"").concat(n);d=s,u="".concat(s).concat(a).concat(n?"?":"").concat(n),i.setPathname(a),i.setSearchParams(n),i.setHost(s),i.setTld((0,r.p$)(s)||"ru"),i.setOrigin(d),i.setHref(u)})},85816:function(e,t,i){"use strict";i.r(t),i.d(t,{WebInitializer:function(){return s}});var a=i(8759);i(99616);var o=i(5674),r=i(33423);let n=(0,r.Pi)(e=>{let{children:t,userIp:i}=e,{location:a}=(0,o.oR)();return t}),l=e=>{let{children:t}=e;return t},s=e=>{let{userIp:t}=e,i=(0,o.uK)(),r=i.get(o.V0);return r.get(o.BU.DisallowDeeplinksRedirect),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l,{}),(0,a.jsx)(n,{userIp:t})]})}},52207:function(e,t,i){"use strict";i.r(t),i.d(t,{NavigationEvents:function(){return n}});var a=i(11769),o=i(99616),r=i(5674);let n=()=>{let e=(0,r.sv)(),t=(0,a.usePathname)(),i=(0,a.useSearchParams)();return(0,o.useEffect)(()=>{let a="".concat(t).concat(i.size>0?"?".concat(i):"");e.hit(a)},[t,i,e]),null}},75576:function(e,t,i){"use strict";i.r(t),i.d(t,{AnalyticsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(82834),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.sv)(),s=(0,n.wL)(),d=(0,n.uK)(),u=d.get(n.V0),c=(0,o.useMemo)(()=>{if(l)return l;let e="on"===u.get(n.BU.AllowAnalyticsLogs),t=(0,r.HQ)(e=>i.count(e,"evgen"),s,e),a=(0,r.hz)(),o=(0,r.y_)();return l=new r.yx(t,a,o)},[u,s,i]);return(0,a.jsx)(n.fC.Provider,{value:c,children:(0,a.jsx)(n.tK,{children:t})})}},83622:function(e,t,i){"use strict";i.r(t),i.d(t,{HistoryProvider:function(){return s}});var a=i(8759),o=i(11769),r=i(99616),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.uK)(),s=(0,o.useRouter)(),d=(0,o.usePathname)(),u=(0,o.useSearchParams)(),[c,C]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1),[p,v]=(0,r.useState)(null),E=(0,r.useMemo)(()=>{if(l)return l;let e=i.get(n.Ar);return l=new n.QQ(e)},[i]),f=(0,r.useCallback)(()=>{E&&(C(E.canBack),m(E.canForward),v(E.state))},[E]),_=(0,r.useCallback)(e=>{E&&(E.replaceState(e),s.replace(e.href))},[E,s]),y=(0,r.useCallback)(e=>{E&&(E.pushState(e),f())},[E,f]),A=(0,r.useCallback)(()=>{E&&(E.back(),f(),s.back())},[E,s,f]),P=(0,r.useCallback)(()=>{E&&(E.forward(),f(),s.forward())},[E,s,f]);return(0,r.useEffect)(()=>{var e;let t=[d,u.toString()].join("?");(!(null==E?void 0:E.state)||(null==E?void 0:null===(e=E.state)||void 0===e?void 0:e.isLocationNotEqual(t)))&&y({href:t})},[E,d,u,y]),(0,a.jsx)(n.Tl.Provider,{value:{pushState:y,replaceState:_,canForward:h,canBack:c,back:A,forward:P,state:p},children:t})}},75707:function(e,t,i){"use strict";i.r(t),i.d(t,{LayoutProvider:function(){return d},setClientSideLayout:function(){return s}});var a=i(8759),o=i(57285),r=i(33423),n=i(99616),l=i(5674);let s=e=>{document.body.classList.remove("desktop"),e.setLayout((0,l.jP)(window.innerWidth))},d=(0,r.Pi)(e=>{let{children:t,userAgent:i}=e,{settings:r}=(0,l.oR)(),d=(0,l.Xf)(),[u,c]=(0,n.useState)(null);d&&r.setPlatform(d),r.layout;let C=(0,n.useMemo)(()=>(0,o.Z)(()=>{s(r)},100),[r]),h=(0,n.useCallback)(e=>{c(e)},[]);(0,n.useLayoutEffect)(()=>{s(r)},[r]),(0,n.useEffect)(()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}),[C]);let m=(0,n.useMemo)(()=>({contentRef:u,setContentRef:h}),[u,h]);return(0,a.jsx)(l.VY.Provider,{value:m,children:t})})},29371:function(e,t,i){"use strict";i.r(t),i.d(t,{PrefetchDataProvider:function(){return s}});var a=i(33423),o=i(99616),r=i(5674),n=i(75707);let l=async(e,t,i)=>{let{user:a,library:o,experiments:n,pinsCollection:l}=e;if(t?await a.getAbout():a.setUnauthorized(),a.puid&&i.setPassportUid(a.puid),await n.getData(),a.isAuthorized){let e=[a.getSettings(),o.getData()];n.checkExperiment(r.pe.WebPins,"on")&&e.push(l.getData()),await Promise.all(e)}},s=(0,a.Pi)(e=>{let{children:t}=e,i=(0,r.oR)(),a=(0,r.uK)(),s=a.get(r.xi),d=a.get(r.Hz),u=s.hasAuthorizationCredentials;return(0,n.setClientSideLayout)(i.settings),i.user.account.loadingState===r.Gu.IDLE&&(0,o.use)(l(i,u,d)),t})},85709:function(e,t,i){"use strict";i.r(t),i.d(t,{ShortcutsProvider:function(){return d}});var a=i(8759),o=i(33423),r=i(99616),n=i(98125),l=i(5674);let s=null,d=(0,o.Pi)(e=>{let{children:t}=e,i=(0,l.R$)(),o=(0,l.uK)(),d=o.get(l.V0),u=(0,n.K)(),{sonataState:c}=(0,l.oR)(),C=(0,r.useMemo)(()=>(s||(s=new l.OI(new l.yr)),s),[]);return(0,r.useEffect)(()=>(null==C||C.addShortcutsListener(l.yx.DECREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.decreaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.INCREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.increaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.TOGGLE_MUTE,async()=>{let e=null==i?void 0:i.state.playerState.volume.value;void 0!==e&&await u(e)}),()=>{null==C||C.removeShortcutsListener(l.yx.DECREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.INCREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.TOGGLE_MUTE)}),[C,i,d,u]),(0,r.useEffect)(()=>{if(!c.isGenerativeContext)return null==C||C.addShortcutsListener(l.yx.MOVE_BACKWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value)&&await i.moveBackward()}),null==C||C.addShortcutsListener(l.yx.MOVE_FORWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value)&&await (null==i?void 0:i.moveForward())}),null==C||C.addShortcutsListener(l.yx.SLIDE_BACKWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideBackward(2))}),null==C||C.addShortcutsListener(l.yx.SLIDE_FORWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideForward(2))}),()=>{null==C||C.removeShortcutsListener(l.yx.MOVE_FORWARD),null==C||C.removeShortcutsListener(l.yx.MOVE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_FORWARD)}},[C,i,d,c.isGenerativeContext]),(0,a.jsx)(l.cw.Provider,{value:C,children:t})})},48085:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataProvider:function(){return eu}});var a,o,r,n,l=i(8759),s=i(33423),d=i(99616),u=i(8124);class c extends Error{constructor(e){super(e),this.name="AudioError"}}let C={BAD_STATE:"action is not permited from current state"},h={EVENT_PLAY:"play",EVENT_STOP:"stop",EVENT_PAUSE:"pause",EVENT_RESUME:"resume",EVENT_PROGRESS:"progress",EVENT_SEEKED:"seeked",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_LOADING:"loading",EVENT_LOADED:"loaded",EVENT_ENDED:"ended",EVENT_CRASHED:"crashed",EVENT_ERROR:"error",EVENT_STALLED:"stalled",EVENT_CANPLAY:"canplay",EVENT_PLAYING:"playing",HLS_EVENT_ERROR:"hlserror",EVENT_DESTROY:"destroy",EVENT_STATE:"state",EVENT_SWAP:"swap",STATE_INIT:"init",STATE_CRASHED:"crashed",STATE_IDLE:"idle",STATE_PLAYING:"playing",STATE_PAUSED:"paused"};var m=i(23681);let p={updateInterval:30,EMPTY_SOUND:"data:audio/mp3;base64,//uQZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAADAAAC2QBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA8TEFNRTMuOThyBK8AAAAAAAAAADQgJAimTQABzAAAAtmIVtmVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQZAAO4AAAf4AAAAgAAA/wAAABAoQDLmAAACBYgGYMAAAE+oH///////0WKFRVzjKnAmjp+XX9qP//////p0USaKtMwpjZNhNFyEM61QAAOAP////////nfSpMQU1FMy45OC4yqqr/+xBEDI/wAAB/gAAACAxgGaMAAAEAAAH+AAAAIAAAP8AAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/7EGQoD/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",EVENT_NATIVE_PLAY:"play",EVENT_NATIVE_PAUSE:"pause",EVENT_NATIVE_TIMEUPDATE:"timeupdate",EVENT_NATIVE_ENDED:"ended",EVENT_NATIVE_DURATION:"durationchange",EVENT_NATIVE_LOADING:"progress",EVENT_NATIVE_META:"loadedmetadata",EVENT_NATIVE_CANPLAY:"canplay",EVENT_NATIVE_PLAYING:"playing",EVENT_NATIVE_ERROR:"error",EVENT_NATIVE_STALLED:"stalled",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_SEEKED:"seeked",promiseLoadedEvents:["progress"],promisePlayingEvents:["timeupdate"],promiseMetadataEvents:["loadedmetadata","canplay"],loaderInteruptReasons:["load","stop","startPlay","play","destroy"]};class v{isOnlyDeviceVolume(){let e=!0;try{let t=document.createElement("audio");t.volume=.63,e=Math.abs(t.volume-.63)>.01}catch(t){e=!0}return e}parseParams(e){let t=e.split("?")[1];return t&&t.length?t.split("&").reduce(function(e,t){let i=t.split("="),a=i[0],o=i[1];return a&&o&&(e[a]=o),e},{}):{}}updateUrl(e,t){let i=this.parseParams(e),a="";for(let e in Object.assign(i,t),i)Object.prototype.hasOwnProperty.call(i,e)&&(a+=`${e}=${i[e]}`);return e+(a?`?${a}`:"")}getCookie(e){let t=document.cookie.split(";").reduce((e,t)=>{let[i,a]=t.trim().split("=");return i&&a?{...e,[i]:a}:e},{})[e];return t||""}}let E=1,f=()=>{let e=document.createElement("audio");return e.autoplay=!1,e.loop=!1,e.preload="auto",e.crossOrigin="anonymous",e};class _{audio=f();browser=new v;emitter;src="";position=0;lastGoodTime=0;lastUpdate=0;notLoading=!0;shouldUseHlsPlayer;shouldPause=!1;shouldPlay=!1;playing=!1;ended=!1;promiseMode=!1;isHlsTrack=!1;promises={};audioContext=null;loaderTimer=null;promiseCheckTO=null;retry=0;playerInitializationTime;clearInitListener=null;clearNativePauseListener=null;hls=null;isAutoplayable=!1;name=E++;whenReady;constructor(e,t){this.shouldUseHlsPlayer=e,this.playerInitializationTime=Date.now(),this.emitter=t,this.startupAudio=this.startupAudio.bind(this),this.updateProgress=this.updateProgress.bind(this),this.onNativeLoading=this.onNativeLoading.bind(this),this.onNativeEnded=this.onNativeEnded.bind(this),this.onNativeError=this.onNativeError.bind(this),this.onNativePause=this.onNativePause.bind(this),this.onNativePlay=this.onNativePlay.bind(this),this.onNativeSeeked=this.onNativeSeeked.bind(this),this.onNativeStalled=this.onNativeStalled.bind(this),this.onNativeCanplay=this.onNativeCanplay.bind(this),this.onNativePlaying=this.onNativePlaying.bind(this),this.onNativeVolumeChange=this.onNativeVolumeChange.bind(this),this.onNativeRatechange=this.onNativeRatechange.bind(this),this.whenReady=this.init()}updateProgress(){let e=Number(new Date);if(e-this.lastUpdate=this.audio.duration-.1&&this.emitter.emit(h.EVENT_LOADED)}}onNativeEnded(){this.ended=!0,this.playing=!1,this.shouldPause=!0,this.emitter.emit(h.EVENT_ENDED)}onNativeError(){this.src&&this.src!==p.EMPTY_SOUND&&(this.audio&&this.audio.error&&this.emitter.emit(h.EVENT_ERROR,this.audio.error),this.playing=!1)}onNativePause(){this.emitter.emit(h.EVENT_PAUSE),this.shouldPause=!1}onNativePlay(){this.emitter.emit(h.EVENT_PLAY),this.shouldPlay=!1}onNativeSeeked(){this.emitter.emit(h.EVENT_SEEKED)}onNativeStalled(){this.emitter.emit(h.EVENT_STALLED)}onNativeCanplay(){this.emitter.emit(h.EVENT_CANPLAY)}onNativePlaying(){this.playing&&this.emitter.emit(h.EVENT_PLAYING)}onNativeVolumeChange(){this.emitter.emit(h.EVENT_VOLUMECHANGE,this.volumeLevel)}onNativeRatechange(){this.emitter.emit(h.EVENT_RATECHANGE,this.playbackRate)}initUserEvents(){document.body.addEventListener("mousedown",this.startupAudio,!0),document.body.addEventListener("keydown",this.startupAudio,!0),document.body.addEventListener("touchstart",this.startupAudio,!0)}deinitUserEvents(){document.body.removeEventListener("mousedown",this.startupAudio,!0),document.body.removeEventListener("keydown",this.startupAudio,!0),document.body.removeEventListener("touchstart",this.startupAudio,!0)}initNativeEvents(){this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.addEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.addEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.addEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.addEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.addEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.addEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.addEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.addEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}deinitNativeEvents(){this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.removeEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.removeEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.removeEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.removeEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.removeEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.removeEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.removeEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}init(){return this.initEvents().then(()=>{this.shouldUseHlsPlayer&&this.initHls()})}initEvents(){return new Promise(e=>{this.initUserEvents(),this.initNativeEvents(),e()})}startupAudio(){this.audioContext&&this.audioContext.resume(),this.deinitUserEvents();let e=()=>{this.shouldPlay=!1,this.isAutoplayable=!0},t=e=>{this.shouldPlay=!1,console.info(`_startupAudio:failReason:${e||""}`)},i=()=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i)),this.promiseMode)return;let t=()=>{this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,t),e()};this.clearNativePauseListener=()=>{this.audio&&this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t)},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t),this.audio.pause(),this.shouldPause=!0)};this.clearInitListener=()=>{this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i))},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_META,i),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,i),this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{e(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,t("audio.play")}))}initAndCheckAutoplay(){return new Promise(e=>{let t=()=>{this.shouldPlay=!1,this.isAutoplayable=!0,e()},i=t=>{this.shouldPlay=!1,this.isAutoplayable=!1,console.info(this,`initAndCheckAutoplay:failReason:${t||""}`),e()},a=e=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_META,a),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,a)),this.promiseMode)return;if(e.type===p.EVENT_NATIVE_ERROR||e.type===p.EVENT_NATIVE_META){i(e.type);return}let o=e=>{if(e.type===p.EVENT_NATIVE_ERROR){i(e.type);return}this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,o),t()};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,o),this.audio.pause()),this.shouldPause=!0};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_META,a),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,a),this.audio.src=p.EMPTY_SOUND,this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{t(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,i("audio.play")}))})}breakStartup(e){this.deinitUserEvents(),this.clearInitListener&&this.clearInitListener(),this.clearNativePauseListener&&this.clearNativePauseListener(),console.warn("_startupAudio:interrupted",e)}waitFor(e,t,i){let a;let o=this.promises[e];if(o)a=o.promise();else{let o=()=>{},r=[new Promise((e,t)=>{o=t})],n={},l=e=>new Promise(i=>{let a=()=>{t()&&i()};this.audio&&(this.audio.addEventListener(e,a),n[e]=a)}),s=()=>{for(let e of Object.keys(n))if(this.audio){let t=n[e];t&&this.audio.removeEventListener(e,t)}};for(let e of i)r.push(l(e));let d=Promise.race(r);d.then(s).catch(s),this.promises[e]={promise:()=>d,reject:o},a=d}return a}cancelWait(e,t){let i;(i=this.promises[e])&&(delete this.promises[e],i.reject(t))}abortPromises(e){for(let t in this.promises)Object.prototype.hasOwnProperty.call(this.promises,t)&&this.cancelWait(t,e)}promiseMetadataCheck(){return!!this.audio&&this.audio.readyState>this.audio.HAVE_METADATA}promiseMetadata(){return this.waitFor("metadata",()=>this.promiseMetadataCheck(),p.promiseMetadataEvents)}promiseLoadedCheck(){if(this.loaderTimer?clearTimeout(this.loaderTimer):this.loaderTimer=setTimeout(()=>{this.cancelWait("loaded","timeout")},5e3),this.audio){let e=Math.min(this.position+45,this.audio.duration),t=this.audio.buffered.end(0)-this.audio.buffered.start(0);return 0!==this.audio.buffered.length&&t>=e}return!1}promiseLoaded(){let e=this.waitFor("loaded",()=>this.promiseLoadedCheck(),p.promiseLoadedEvents),t=()=>{this.loaderTimer&&clearTimeout(this.loaderTimer)};return e.then(t).catch(t),e}promisePlayingCheck(){if(this.audio){let e=Math.min(this.position+.2,this.audio.duration);return this.promiseCheckTO&&clearTimeout(this.promiseCheckTO),0!==this.audio.currentTime||this.audio.paused||(this.promiseCheckTO=setTimeout(()=>{this.audio&&0===this.audio.currentTime&&!this.audio.paused&&(this.audio.currentTime=1)},1e3)),this.audio.currentTime>=e}return!1}promisePlaying(){return this.waitFor("playing",()=>this.promisePlayingCheck(),p.promisePlayingEvents)}promiseStartPlaying(){let e,t=!1;if(this.promises.startPlaying)e=this.promises.startPlaying.promise();else{let i,a=()=>{},o=new Promise((e,o)=>{this.promisePlaying().then(()=>{t=!0,clearTimeout(i),e()}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),this.promiseLoaded().then(()=>{t||(i=setTimeout(()=>{o("timeout"),this.cancelWait("playing","timeout"),console.warn("startPlaying:failed")},5e3))}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),a=o});this.promises.startPlaying={promise:()=>o,reject:a},e=this.promises.startPlaying.promise()}return e}load(e){this.abortPromises("load"),this.breakStartup("load"),this.ended=!1,this.playing=!1,this.notLoading=!0,this.position=0,this.lastGoodTime=0,this.src=e,this.audio&&(/\.m3u8$/.test(e)?(this.isHlsTrack=!0,this.destroyHls(),this.initHls(),this.hls?.loadSource(this.getHlsPlayingEntityUrl(e))):(this.isHlsTrack=!1,this.audio.src=e),this.audio.load())}stop(){this.abortPromises("stop"),this.breakStartup("stop"),this.isHlsTrack&&this.destroyHls(),this.load("")}startPlay(){this.audio&&(this.audio.currentTime=this.position),this.playing&&(this.breakStartup("startPlay"),this.shouldPlay=!0,this.audio&&this.audio.play().catch(e=>{console.error(e)}),this.hls&&this.hls.startLoad(),this.promiseStartPlaying().then(()=>{this.retry=0}))}play(e){this.retry=0,this.loadMetadata(e)}loadMetadata(e){this.playing||(this.breakStartup("play"),this.ended=!1,this.playing=!0,null!=e&&(this.position=e),this.promiseMetadata().then(()=>this.startPlay()).catch(e=>{"string"==typeof e&&p.loaderInteruptReasons.includes(e)||console.error(e)}))}initHls(){this.hls||(this.hls=new m.ZP({liveDurationInfinity:!0,maxBufferSize:3e6}),this.audio&&this.hls.attachMedia(this.audio),this.initHlsEvents())}initHlsEvents(){this.hls&&(this.hls.on(m.ZP.Events.ERROR,(e,t)=>{if(t.fatal&&this.hls)switch(t.type){case m.ZP.ErrorTypes.NETWORK_ERROR:this.retry++,this.retry>2?(this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)):this.hls.startLoad();break;case m.ZP.ErrorTypes.MEDIA_ERROR:this.hls.recoverMediaError();break;default:this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)}}),this.hls.on(m.ZP.Events.DESTROYING,()=>{this.hls=null}))}getHlsPlayingEntityUrl(e){let t="";for(;t.length<44;)t+=(Math.random()+1).toString(36).substring(3);t=t.slice(0,44);let i=this.playerInitializationTime.toString().slice(0,10),a=`${t}xWEBx0001x${i}`;return this.browser.updateUrl(e,{vsid:a})}destroyHls(){this.retry=0,this.hls&&(this.hls.stopLoad(),this.hls.destroy(),this.hls=null)}pause(){this.shouldPause=!0,this.playing=!1,this.isHlsTrack&&this.hls&&this.hls.stopLoad(),this.audio&&(this.audio.pause(),this.position=this.audio.currentTime)}setPosition(e){if(!isFinite(e)){console.warn("setPositionFailed",e);return}this.position=e,this.promiseMetadata().then(()=>{this.audio&&(this.audio.currentTime=this.position)})}destroy(){this.audio&&(this.shouldPause=!0,this.audio.pause(),this.deinitNativeEvents()),this.abortPromises("destroy"),this.deinitUserEvents(),this.promises={}}get currentTime(){return this.audio?this.audio.currentTime:null}get duration(){return this.audio?this.audio.duration:null}get loaded(){let e;if(this.audio&&this.audio.buffered.length){let t=this.audio.buffered.length-1;e=this.audio.buffered.end(t)}else e=null;return e}get volumeLevel(){return this.audio?this.audio.volume:0}set volumeLevel(e){this.audio&&(this.audio.volume=e)}set defaultPlaybackRate(e){this.audio&&(this.audio.defaultPlaybackRate=e)}get playbackRate(){return this.audio?this.audio.playbackRate:1}set playbackRate(e){this.audio&&(this.audio.playbackRate=e)}get audioSrc(){return this.src}get audioNotLoading(){return this.notLoading}get autoplayable(){return this.isAutoplayable}}let y=1;class A{browser=new v;emitter;loader;name=y++;type="html5";whenReady;constructor(e,t){this.emitter=t,this.loader=new _(e,t),this.whenReady=this.loader.whenReady}get source(){return this.loader.audio}play(e,t){this.loader.load(e),this.loader.play(t)}setSrc(e,t){this.loader.load(e),this.loader.setPosition(t)}pause(){this.loader.pause()}resume(){this.loader.play()}stop(){this.loader.stop(),this.emitter.emit(h.EVENT_STOP)}destroy(){this.loader.destroy(),this.emitter.emit(h.EVENT_DESTROY)}getPosition(){return this.loader.currentTime}setPosition(e){this.loader.setPosition(e-.001)}getDuration(){return this.loader.duration}getLoaded(){return this.loader.loaded?this.loader.loaded:0}get volumeLevel(){return this.loader.volumeLevel}set volumeLevel(e){this.loader.volumeLevel=Math.min(1,e)}get speedLevel(){return this.loader.playbackRate}set speedLevel(e){this.loader.defaultPlaybackRate=e,this.loader.playbackRate=e}getSrc(){return""!==this.loader.audioSrc?this.loader.audioSrc:null}isDeviceVolume(){return this.browser.isOnlyDeviceVolume()}isAutoplayable(){return this.loader.autoplayable}}let P=1;class L{emitter=new u.v;played=0;lastSkip=0;playId=null;shouldUseHlsPlayer;implementation;promises={};name=P++;state=h.STATE_INIT;constructor(e=!1){this.shouldUseHlsPlayer=e,window.addEventListener("beforeunload",()=>this.onBeforeUnload(),!0),this.implementation=new A(this.shouldUseHlsPlayer,this.emitter),this.onAudioPlayerInit()}get source(){return this.implementation?.source}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}onAudioPlayerInit(){this.handleImplementationEvents(),this.setState(h.STATE_IDLE)}handleImplementationEvents(){this.emitter.on(h.EVENT_PLAY,()=>{this.implementationEventHandler(h.EVENT_PLAY)}),this.emitter.on(h.EVENT_ENDED,()=>{this.implementationEventHandler(h.EVENT_ENDED)}),this.emitter.on(h.EVENT_SWAP,()=>{this.implementationEventHandler(h.EVENT_SWAP)}),this.emitter.on(h.EVENT_STOP,()=>{this.implementationEventHandler(h.EVENT_STOP)}),this.emitter.on(h.EVENT_ERROR,()=>{this.implementationEventHandler(h.EVENT_ERROR)}),this.emitter.on(h.HLS_EVENT_ERROR,()=>{this.implementationEventHandler(h.HLS_EVENT_ERROR)}),this.emitter.on(h.EVENT_PAUSE,()=>{this.implementationEventHandler(h.EVENT_PAUSE)}),this.emitter.on(h.EVENT_CRASHED,()=>{this.implementationEventHandler(h.EVENT_CRASHED)})}implementationEventHandler(e){switch(e){case h.EVENT_PLAY:this.setState(h.STATE_PLAYING);break;case h.EVENT_ENDED:case h.EVENT_SWAP:case h.EVENT_STOP:case h.EVENT_ERROR:case h.HLS_EVENT_ERROR:this.setState(h.STATE_IDLE);break;case h.EVENT_PAUSE:this.setState(h.STATE_PAUSED);break;case h.EVENT_CRASHED:this.setState(h.STATE_CRASHED)}}onBeforeUnload(){"undefined"!=typeof window&&navigator&&1===navigator.maxTouchPoints||this.destroy()}setState(e){if(e===h.STATE_PAUSED&&this.state!==h.STATE_PLAYING)return;let t=this.state!==e;this.state=e,t&&this.emitter.emit(h.EVENT_STATE,e)}waitEvents(e,t,i){let a=()=>{},o=()=>{},r=new Promise((e,t)=>{a=e,o=t});this.promises[e]={promise:()=>r,reject:o};let n=()=>{for(let e of t)this.off(e,a);for(let e of i)this.off(e,o);delete this.promises[e]};for(let e of t)this.on(e,a);let l=e=>t=>{let i=t instanceof Error?t:new c(e);o(i)};for(let e of i)this.on(e,l(e));return r.then(n).catch(n),r}getState(){return this.state}getSrc(){return this.implementation?this.implementation.getSrc():null}play(e,t){this.played=0,this.lastSkip=0,this.generatePlayId(),this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PLAY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_PLAY),this.promises.whenStop&&this.promises.whenStop.reject(h.EVENT_PLAY);let i=this.waitEvents("whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]);return this.implementation&&this.implementation.play(e,t),i}setSrc(e,t){this.implementation&&this.implementation.setSrc(e,t)}restart(){return this.getDuration()?(this.generatePlayId(),this.setPosition(0),this.played=0,this.lastSkip=0,this.resume()):Promise.reject(new c(C.BAD_STATE))}stop(){let e;return this.implementation&&(this.implementation.stop(),Promise.resolve()),this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_STOP),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_STOP),e=this.promises.whenStop?this.promises.whenStop.promise():this.waitEvents("_whenStop",[h.EVENT_STOP],[h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.stop(),e}pause(){let e;return this.state!==h.STATE_PLAYING?Promise.reject(new c(C.BAD_STATE)):(this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PAUSE),e=this.promises.whenPause?this.promises.whenPause.promise():this.waitEvents("_whenPause",[h.EVENT_PAUSE],[h.EVENT_STOP,h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.pause(),e)}resume(){let e;return this.state!==h.STATE_PLAYING||this.promises.whenPause?this.state===h.STATE_IDLE||this.state===h.STATE_PAUSED||this.state===h.STATE_PLAYING?(this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_RESUME),e=this.promises.whenPlay?this.promises.whenPlay.promise():this.waitEvents("_whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.resume(),e.then(()=>{this.emitter.emit(h.EVENT_RESUME)})):Promise.reject(new c(C.BAD_STATE)):Promise.resolve()}destroy(){this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_DESTROY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_DESTROY),this.implementation&&this.implementation.destroy()}getPosition(){let e=null;return this.implementation&&(e=this.implementation.getPosition()),e||0}setPosition(e){return this.implementation&&this.implementation.setPosition(e),this.played+=this.getPosition()-this.lastSkip,this.lastSkip=e,e}getDuration(){let e=null;return this.implementation&&(e=this.implementation.getDuration()),null===e?0:e}getLoaded(){return this.implementation?this.implementation.getLoaded():0}getPlayed(){let e=this.getPosition();return this.played+=e-this.lastSkip,this.lastSkip=e,this.played}getVolume(){return this.implementation?this.implementation.volumeLevel:0}setVolume(e){let t=0;return this.implementation&&(this.implementation.volumeLevel=e,t=e),t}getSpeed(){return this.implementation?this.implementation.speedLevel:0}setSpeed(e){let t=0;return this.implementation&&(this.implementation.speedLevel=e,t=e),t}isDeviceVolume(){return!this.implementation||this.implementation.isDeviceVolume()}isAutoplayable(){let e=null;return this.implementation&&(e=this.implementation.isAutoplayable()),null!==e&&e}generatePlayId(){this.playId=Math.random().toString().slice(2)}getPlayId(){return this.playId}}class x{pauseHandlers=[];core=new L;get source(){return this.core.source}play(e,t){return this.core.play(e,t)}setSrc(e,t){this.core.setSrc(e,t)}setProgress(e){let t=this.core.setPosition(e);return Promise.resolve(t)}pause(){return this.core.pause()}resume(){return this.core.resume()}setVolume(e){let t=this.core.setVolume(e);return Promise.resolve(t)}setSpeed(e){let t=this.core.setSpeed(e);return Promise.resolve(t)}stop(){return this.core.stop()}onAudioEnd(e){this.core.on(h.EVENT_ENDED,e)}onAudioPaused(e){let t=()=>{"paused"===this.core.getState()&&e()};this.pauseHandlers.push({handler:t,originalCallback:e}),this.core.on(h.EVENT_STATE,t)}onAudioResume(e){this.core.on(h.EVENT_RESUME,e)}onAudioUpdatingProgress(e){this.core.on(h.EVENT_PROGRESS,e)}onAudioSeeked(e){this.core.on(h.EVENT_SEEKED,e)}onAudioStalled(e){this.core.on(h.EVENT_STALLED,e)}onAudioCanplay(e){this.core.on(h.EVENT_CANPLAY,e)}onAudioPlaying(e){this.core.on(h.EVENT_PLAYING,e)}onAudioError(e){this.core.on(h.EVENT_ERROR,e)}onAudioVolumeChange(e){this.core.on(h.EVENT_VOLUMECHANGE,e)}onAudioSpeedChange(e){this.core.on(h.EVENT_RATECHANGE,e)}offAudioEnd(e){this.core.off(h.EVENT_ENDED,e)}offAudioPaused(e){let t=this.pauseHandlers.find(t=>t.originalCallback===e);t&&this.core.off(h.EVENT_STATE,t.handler)}offAudioResume(e){this.core.off(h.EVENT_RESUME,e)}offAudioUpdatingProgress(e){this.core.off(h.EVENT_PROGRESS,e)}offAudioSeeked(e){this.core.off(h.EVENT_SEEKED,e)}offAudioStalled(e){this.core.off(h.EVENT_STALLED,e)}offAudioCanplay(e){this.core.off(h.EVENT_CANPLAY,e)}offAudioPlaying(e){this.core.off(h.EVENT_PLAYING,e)}offAudioError(e){this.core.off(h.EVENT_ERROR,e)}offAudioVolumeChange(e){this.core.off(h.EVENT_VOLUMECHANGE,e)}offAudioSpeedChange(e){this.core.off(h.EVENT_RATECHANGE,e)}}var b=i(57413),g=i(14408),N=i(68244);class V{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("ApplyContextPlugin",()=>{let e=i.state.currentContext.value;e&&e instanceof N.$n&&e.apply({hooks:t,playback:i})})}}let S=null;function T(e){let t=e.state.queueState.index.value,i=e.state.currentContext.value,a=void 0!==e.state.queueState.order.value[t-1];i&&(i.availableActions.moveBackward.value=a),null!==S&&(S(),S=null),0===t&&(S=e.state.playerState.progress.onChange(e=>{i&&(i.availableActions.moveBackward.value=!!e&&e.position>N.lz)}))}var w=i(34603);function R(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:a}=i.entity.data,o=(0,b.xA)(t)||(0,b.Q7)(t)||"type"in a&&a.type&&w.UE.includes(a.type);o?(t.availableActions.repeat.value=!1,t.availableActions.shuffle.value=!1,e.state.queueState.repeat.value!==N.zq.NONE&&e.setRepeatMode(N.zq.NONE),e.state.queueState.shuffle.value&&e.toggleShuffle()):(t.availableActions.repeat.value=!0,t.availableActions.shuffle.value=!0)}}let M=e=>{let t="albums"in e&&e.albums&&e.albums.length>0&&e.albums[0]&&e.albums[0].type===w.VZ.PODCAST,i="type"in e&&e.type===w.Vc.PODCAST;return!!(i||t)};function H(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:e}=i.entity.data,a=M(e);t.availableActions.speed.value=!!a}}class k{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),t.beforeMediaStartPlaying.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),i.state.queueState.entityList.onChange(()=>{T(i)}),i.state.queueState.index.onChange(()=>{T(i)})}}class j{apply(e){let{playback:t,hooks:i}=e;t.state.playerState.event.onChange(()=>{let{currentEntity:e}=t.state.queueState;if(e.value)switch(t.state.playerState.event.value){case N.KX.PAUSED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.PAUSED}`});break;case N.KX.STALLED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.STALLED}`});break;case N.KX.PLAYING:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:`event-${N.KX.PLAYING}`});break;case N.KX.MEDIA_ELEMENT_ERROR:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.MEDIA_ELEMENT_ERROR}`})}}),i.beforeEntityPlayingProcessStart.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.clearTimeStagesOfPlayback(),Promise.resolve()}),i.afterMediaStartPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:"hook-afterMediaStartPlaying"}),Promise.resolve()}),i.afterMediaEndPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-afterMediaEndPlaying"}),Promise.resolve()}),i.beforeEntityChange.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeEntityChange"}),Promise.resolve()}),i.beforeContextSet.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeContextSet"}),Promise.resolve()})}}var B=i(42503),Z=i(59899);function I(){let e=new Date;return e.toISOString()}function O(e){let t;let{contextEntityPair:i,totalPlayedSeconds:a,endPositionSeconds:o,type:r,maxPlayerStage:n}=e,{entity:l,context:s}=i,d=String(l.data.meta.id),u=function(e){let t;if("albums"in e.data.meta){let{data:{meta:{albums:i}}}=e;if(i){let e=i[0];e&&(t=String(e.id))}}return t}(l),c=0;"durationMs"in l.data.meta&&l.data.meta.durationMs&&(c=l.data.meta.durationMs/1e3);let C=a,h=o;.5>Math.abs(c-a)&&(C=c),.5>Math.abs(c-o)&&(h=c),t=(0,b.Q7)(s)?{generativeStreamId:String(s.data.meta.stream?.id)}:{trackId:d};let m={playId:l.playId,timestamp:I(),totalPlayedSeconds:C,endPositionSeconds:h,trackLengthSeconds:c,albumId:u,from:s.from,context:s.data.type,contextItem:String(s.data.meta.id),addTracksToPlayerTime:l.addTracksToPlayerTime,audioAuto:"none",audioOutputName:"Динамик",audioOutputType:"Speaker",maxPlayerStage:n,...t};if((0,b.xA)(s)&&s.data.meta.session&&(m.radioSessionId=s.data.meta.session.radioSessionId,m.context="radio",m.contextItem=s.data.meta.session.wave.stationId),(0,b.KT)(s)&&(m.playlistId=`${s.data.meta.uid}:${s.data.meta.kind}`,m.contextItem=`${s.data.meta.uid}:${s.data.meta.kind}`),(0,b.dt)(s)){let e=[b.Zc.Search,b.Zc.Other],t=s.data.overrideContextType??b.Zc.Other;m.context=t,e.includes(t)&&(m.contextItem=null)}return{type:r,isSent:!1,data:m}}(a=r||(r={})).START="start",a.END="end";var q=i(63278);class D extends q.y{name="PlaysException";constructor(e,{code:t="E_PLAYS",...i}={}){super(e,{code:t,...i}),Object.setPrototypeOf(this,D.prototype)}}class U{entityPlaysMap={};playerStageByEntitiesPlayId=new Map;playsResource;variables;constructor(e){let{httpClient:t,playsResourceConfig:i,variables:a}=e;this.playsResource=new w.ol(t,i),this.variables=a||{}}apply(e){let{hooks:t,playback:i}=e;i.state.playerState.event.onChange(()=>{let{currentEntity:e}=i.state.queueState;e.value&&i.state.playerState.event.value===N.KX.PLAYING&&this.changePlayerStageByPlayId({playId:e.value.entity.playId,stage:w.KZ.PLAY})}),t.beforeEntityPlayingProcessStart.tapPromise("PlaysPlugin",()=>new Promise(e=>{this.sendStartEntityPlay(i,t),e()})),t.afterMediaEndPlaying.tapPromise("PlaysPlugin",()=>new Promise(e=>{let{index:{value:a},entityList:{value:o},repeat:{value:r}}=i.state.queueState;(a===o.length-1||r===N.zq.ONE)&&this.sendEndEntityPlay(i,t),e()})),t.afterError.tapPromise("PlaysPlugin",e=>((e instanceof Z.Tb||e instanceof N.YR)&&this.sendEndEntityPlay(i,t),Promise.resolve())),t.beforeContextSet.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()})),t.beforeEntityChange.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()}))}sendStartEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a){a.entity.playId=(0,B.Z)(),a.entity.addTracksToPlayerTime=`${Math.random().toString().slice(2)}-${Math.ceil(Number(new Date)/1e3)}`;let o=O({type:r.START,contextEntityPair:a,totalPlayedSeconds:0,endPositionSeconds:0});this.saveEntityPlay(o),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!0,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.variables.disableSendPlaysOnTrackStart?i():this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}sendEndEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a&&!(0,b.Q7)(a.context)){let o,n;let{entity:l}=a,s=this.entityPlaysMap[l.playId],d=!1;if(s&&(d=!!s.find(e=>e.type===r.END)),d){i();return}let u=a.entity.totalPlayedSeconds;this.variables.enableSendMaxPlayerStage&&(n=this.playerStageByEntitiesPlayId.get(l.playId)||w.KZ.PREPARE),o=0===u?O({type:r.END,contextEntityPair:a,totalPlayedSeconds:.1,endPositionSeconds:.1,maxPlayerStage:n}):O({type:r.END,contextEntityPair:a,totalPlayedSeconds:u,endPositionSeconds:e.state.playerState.progress.value.position,maxPlayerStage:n}),this.saveEntityPlay(o),this.playerStageByEntitiesPlayId.delete(o.data.playId),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!1,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}saveEntityPlay(e){let t=this.entityPlaysMap[e.data.playId];void 0===t?this.entityPlaysMap[e.data.playId]=[e]:t.push(e)}changePlayerStageByPlayId({playId:e,stage:t}){this.playerStageByEntitiesPlayId.set(e,t)}}(o=n||(n={})).PLAY="play",o.PAUSE="pause",o.NEXT="nexttrack",o.PREV="previoustrack",o.SEEK="seekto",o.STOP="stop";let z=[40,50,80,100,200,300,400],F=[n.PLAY,n.PAUSE,n.STOP,n.SEEK];class W{browserName;browserVersion;constructor({browserName:e,browserVersion:t}){this.browserName=e,this.browserVersion=t}isSupported(){return"mediaSession"in window.navigator&&"MediaMetadata"in window}handleMediaActionEvents(e,t){let{action:i}=e;switch(i){case n.PLAY:t.resume();break;case n.PAUSE:case n.STOP:t.pause();break;case n.NEXT:t.moveForward();break;case n.PREV:t.moveBackward();break;case n.SEEK:{if((0,g.OX)(t.state.queueState.currentEntity.value?.entity))return;let{seekTime:i}=e;i&&t.setProgress(i)}}}prepareMetadata(e){let t,i;let a={title:e.title};if("artists"in e){let t=(e.artists||[]).map(e=>e.name).join(", ");a.artist=t}if("albums"in e){let t=e.albums?.[0]?.title;a.album=t}return"coverUri"in e&&(t=e.coverUri),"imageUrl"in e&&(t=e.imageUrl),t&&(i=z.map(e=>{let i=`${e}x${e}`;return"Safari"===this.browserName&&(i=`${2*e}x${2*e}`),{sizes:i,src:`https://${t.replace("%%",i)}`,type:"image/jpg"}})),a.artwork=i,a}updateMetadata(e){if(!e)return;let t=this.prepareMetadata(e);window.navigator.mediaSession.metadata=new MediaMetadata(t)}handlePlayerEvents(e){let t,i;e.state.playerState.event.onChange(()=>{(e.state.playerState.event.value===N.KX.START||e.state.playerState.event.value===N.KX.UPDATING_PROGRESS)&&(this.updateMetadata(e.state.queueState.currentEntity.value?.entity.data.meta),(0,g.OX)(e.state.queueState.currentEntity.value?.entity)?navigator.mediaSession.setPositionState({duration:0,position:0}):navigator.mediaSession.setPositionState(),F.forEach(t=>{try{window.navigator.mediaSession.setActionHandler(t,t=>this.handleMediaActionEvents(t,e))}catch{console.log(`The media session action "${t}" is not supported yet.`)}}))}),e.state.currentContext.onChange(()=>{t?.(),i?.(),t=e.state.currentContext.value?.availableActions.moveBackward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveBackward.value??!1;window.navigator.mediaSession.setActionHandler(n.PREV,t?t=>this.handleMediaActionEvents(t,e):null)}),i=e.state.currentContext.value?.availableActions.moveForward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveForward.value??!1;window.navigator.mediaSession.setActionHandler(n.NEXT,t?t=>this.handleMediaActionEvents(t,e):null)})})}apply(e){let{playback:t}=e;this.isSupported()&&this.handlePlayerEvents(t)}}class Y{logger;constructor(e){let{logger:t}=e;this.logger=t}apply(e){let{hooks:t,playback:i}=e;t.afterError.tapPromise("LoggerPlugin",e=>{let t;let a=i.state.queueState.currentEntity.value?i.state.queueState.currentEntity.value.entity.mediaSource:null;return(t=e instanceof q.y?e:new q.y("Error in Sonata player",{code:"E_SONATA",cause:e})).name=`[Sonata] ${t.name}`,this.logger.error(t,{...t.data,...a||{},code:t.code,cause:t.cause,stack:t.stack}),Promise.resolve()})}}let G=[b.Ak.Album,b.Ak.Artist,b.Ak.Playlist,b.Ak.Various],K=(e,t)=>{let i=e.state.currentContext.value?.data;if(!i)return"";let a=i.type,o=e.state.queueState.entityList.value.length||0;return a===b.Ak.Various&&1===o&&(a="track"),i.type===b.Ak.Various&&i.overrideContextType&&(a=i.overrideContextType),`${t}-radio-${a}-autoflow`},J=e=>{let t=e.state.currentContext.value?.data;if(t){if(t.type===b.Ak.Album)return[`album:${t.meta.id}`];if(t.type===b.Ak.Artist)return[`artist:${t.meta.id}`];if(t.type===b.Ak.Playlist&&t.meta.owner?.uid&&t.meta.kind)return[`playlist:${t.meta.owner?.uid}_${t.meta.kind}`];if(t.type===b.Ak.Various){if(t.overrideAutoflowSeeds)return t.overrideAutoflowSeeds;let i=e.state.queueState.currentEntity.value?.entity.data.meta.id;return[`track:${i}`]}}};class ${contextFactory;platform;constructor({contextFactory:e,platform:t}){this.contextFactory=e,this.platform=t}apply(e){let{playback:t,hooks:i}=e;i.afterContextEnd.tapPromise("AutoflowPlugin",()=>{let e=t.state.currentContext.value?.data.type;return e&&G.includes(e)&&this.playAutoflow(t),Promise.resolve()})}playAutoflow(e){let t=e.state.currentContext.value?.data.type,i=J(e);if(!(t&&i))return;let a=this.contextFactory.create({data:{type:b.Ak.Vibe,meta:{id:b.Ak.Vibe},seeds:i,from:K(e,this.platform),includeTracksInResponse:!0}});e.playContext({context:a,loadContextMeta:!0})}}class X{quality;constructor(e){this.quality=e}apply(e){let{playback:t,hooks:i}=e;this.quality.onChange(()=>{t.state.playerState.status.value!==N.Xz.IDLE&&t.reloadEntity().catch(e=>{i.afterError.promise(e)})})}}class Q{streamsResource;timeoutId=0;constructor(e){let{httpClient:t,streamsResourceConfig:i}=e;this.streamsResource=new w.hd(t,i)}apply(e){let{hooks:t,playback:i}=e;t.beforeEntityChange.tapPromise("ContinuePlayingPlugin",()=>{let{position:e,duration:t}=this.getTimingsFromPlayback(i);return new Promise(a=>{e!==t&&this.checkBeforeProgressSync(i),a()})}),i.state.playerState.status.onChange(e=>{let{position:t,duration:a}=this.getTimingsFromPlayback(i);if(e===N.Xz.PAUSED||e===N.Xz.STOPPED){if(e===N.Xz.PAUSED&&t===a)return;this.clearTimeout(),this.checkBeforeProgressSync(i)}e===N.Xz.PLAYING&&this.shouldSendProgressSync(i)&&this.setTimeout(i)})}checkBeforeProgressSync(e){if(this.clearTimeout(),!this.shouldSendProgressSync(e))return;let{position:t,duration:i}=this.getTimingsFromPlayback(e),a=e.state.queueState.currentEntity.value?.entity.data.meta.id;Number.isFinite(i)&&Number.isFinite(t)&&i&&t&&a&&(this.sendProgressSync({duration:i,position:t,trackId:a}),e.state.playerState.status.value===N.Xz.PLAYING&&this.setTimeout(e))}sendProgressSync(e){let t=new Date().toISOString(),{duration:i,position:a,trackId:o}=e;this.streamsResource.progressSync({lastSyncTimestamp:t,trackStreams:[{trackId:o,positionSec:a,trackLengthSec:i,finished:a===i,timestamp:t}]})}shouldSendProgressSync(e){let t=e.state.queueState.currentEntity.value?.entity.data.meta;return!!(t&&"rememberPosition"in t&&t.rememberPosition)}setTimeout(e){this.clearTimeout(),this.timeoutId=window.setTimeout(()=>{this.checkBeforeProgressSync(e)},18e4)}clearTimeout(){window.clearTimeout(this.timeoutId)}getTimingsFromPlayback(e){return{duration:Math.floor(e.state.playerState.progress.value.duration),position:Math.floor(e.state.playerState.progress.value.position)}}}var ee=i(45412),et=i(86502),ei=i(66026),ea=i(57921),eo=i(69559),er=i(68085),en=i(5674);let el=null,es=null,ed=null,eu=(0,s.Pi)(e=>{let{children:t,hostTld:i,userAgent:a,quality:o}=e,r=(0,en.uK)(),{sonataState:n,experiments:s,library:u,user:c}=(0,en.oR)(),C=(0,en.wL)(),h=r.get(en.V0),{language:m}=(0,en.ZS)(),p=(0,d.useMemo)(()=>(el||(el=new Z.$J(o)),el),[o]),v=(0,d.useMemo)(()=>{if(es)return es;let e=r.get(en.U5),t=r.get(en.pI),o=t({credentials:"include"}),n=r.get(en.xi),{resources:l,player:{gateway:{prefixUrl:d,headers:c}}}=e,{timeouts:h,retryPolicyConfig:v}=l.musicExternalApi,E=new b.Tg({httpClient:o,logger:C,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,resourceTimeoutsConfig:h,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},contextVariables:{vibe:{get sendFeedbackToSessionTracks(){return s.checkExperiment(en.pe.WebNextWaveNewFeedbacks,"on")}}}}}),f=new g.nS({likeStore:u}),{overembed:_,externalDomain:y,...A}={params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},overembed:e.player.overembed,externalDomain:e.player.externalDomain},P=new Z.Ez({downloadInfoProviderParams:{httpClient:o,resourceConfig:{...A,overembed:_,externalDomain:y},secretKey:e.player.secretKey,mediaConfigController:p},getFileInfoProviderParams:{httpClient:o,resourceConfig:A,secretKey:e.player.secretKey,mediaConfigController:p,transport:w.J7.RAW,variables:{get useNewCorrespondenceBetweenQualityParams(){return s.checkExperiment(en.pe.WebNextEnableNewQuality,"on")}}},variables:{get switchToStrmWithoutEncrypt(){return s.checkExperiment(en.pe.WebNextSwitchToStrmWithoutEncrypt,"on")}}}),L=new Z.sd({httpClient:o,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}}),N=new x;return es=new et.$7({contextFactory:E,entityFactory:f,audioCore:N,mediaProvider:P,entityProvider:L,windowPaginationConfig:{windowSize:30,setupQueueWindowSize:80},config:{mediaElementErrorReloadCount:2},plugins:[new k,new V,new j,new U({httpClient:o,playsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}},variables:{get disableSendPlaysOnTrackStart(){return s.checkExperiment(en.pe.WebNextDisableSendPlaysOnTrackStart,"on")},get enableSendMaxPlayerStage(){return s.checkExperiment(en.pe.WebPlayAudioSendPrepare,"on")}}}),new W({browserName:a.browserName,browserVersion:a.browserVersion}),new Y({logger:C}),new $({contextFactory:E,platform:"desktop"}),new X(p.quality),new Q({httpClient:o,streamsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}})]})},[s,r,C,i,p,a.browserName,a.browserVersion,m,u]),E=(0,d.useMemo)(()=>(ed||(null==v?void 0:v.source)&&(ed="Safari"===a.browserName?new ei.Qz:new ei.WZ(v.source)),ed),[null==v?void 0:v.source,a.browserName]);v&&(0,ea.A4)(v),(0,d.useEffect)(()=>{let e,t,i,a,o;let r=null==v?void 0:v.state.queueState.currentEntity.onChange(e=>{var t;let i=null==e?void 0:e.context.data.type,a=null==e?void 0:e.context.data.meta.id;n.setEntityMeta(null!==(t=null==e?void 0:e.entity)&&void 0!==t?t:null),i&&n.setContextType(i),a&&n.setContextId(a)}),l=null==v?void 0:v.state.queueState.order.onChange(e=>{let t=v.state.queueState.index.value;if(e){let i=e[t];v.state.queueState.order.value.length>0&&"number"==typeof i&&n.setCurrentlyPlayingTrackIndex(i)}}),s=null==v?void 0:v.state.playerState.status.onChange(e=>{e&&(n.setStatus(e),(0,ea.Pt)({isPlaying:e===et.Xz.PLAYING}))}),d=null==v?void 0:v.state.currentContext.onChange(()=>{var r,l,s,d,u,c,C,m,p,E,f;null===(r=e)||void 0===r||r(),null===(l=t)||void 0===l||l(),null===(s=i)||void 0===s||s(),null===(d=a)||void 0===d||d(),null===(u=o)||void 0===u||u();let _=null!==(f=h.get(en.BU.YmPlayerRepeatMode))&&void 0!==f?f:ee.zq.NONE;v.setRepeatMode(_);let y=!!h.get(en.BU.YmPlayerShuffle);v.setShuffle(y),e=null==v?void 0:null===(c=v.state.currentContext.value)||void 0===c?void 0:c.availableActions.moveBackward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value);n.setCanMoveBackward(t),(0,ea.Pt)({canMoveBackward:t})}),t=null==v?void 0:null===(C=v.state.currentContext.value)||void 0===C?void 0:C.availableActions.moveForward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value);n.setCanMoveForward(t),(0,ea.Pt)({canMoveForward:t})}),i=null==v?void 0:null===(m=v.state.currentContext.value)||void 0===m?void 0:m.availableActions.repeat.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.repeat.value;"boolean"==typeof t&&n.setCanChangeRepeatMode(t)}),a=null==v?void 0:null===(p=v.state.currentContext.value)||void 0===p?void 0:p.availableActions.shuffle.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.shuffle.value;"boolean"==typeof t&&n.setCanShuffle(t)}),o=null==v?void 0:null===(E=v.state.currentContext.value)||void 0===E?void 0:E.availableActions.speed.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.speed.value;"boolean"==typeof t&&(n.setCanSpeed(t),!t&&v&&v.setSpeed(1))})}),u=null==v?void 0:v.state.playerState.volume.onChange(()=>{let e=v.state.playerState.volume.value;"number"==typeof e&&n.setVolume(e)}),c=null==v?void 0:v.state.queueState.repeat.onChange(()=>{let e=v.state.queueState.repeat.value;n.setRepeatMode(e),h.set(en.BU.YmPlayerRepeatMode,e)}),C=null==v?void 0:v.state.queueState.shuffle.onChange(()=>{let e=v.state.queueState.shuffle.value;n.setShuffle(e),h.set(en.BU.YmPlayerShuffle,e)});return()=>{null==r||r(),null==l||l(),null==s||s(),null==d||d(),null==u||u(),null==c||c(),null==C||C()}},[v,n,h]),(0,d.useEffect)(()=>{let e=h.get(en.BU.YmPlayerVolume);"number"==typeof e?(null==v||v.setVolume(e),n.setVolume(e)):(null==v||v.setVolume(1),n.setVolume(1))},[h,v,n]);let f=(0,d.useMemo)(()=>{let e=s.checkExperiment(en.pe.WebNextEnableNewQuality,"on");if(!c.hasPlus)return Z.nJ.PREVIEW;let t=h.get(en.BU.YmPlayerQuality);return(e||t!==Z.nJ.HQ_PLUS)&&t||(h.set(en.BU.YmPlayerQuality,Z.nJ.HQ),Z.nJ.HQ)},[s,c.hasPlus,h]);return(0,d.useEffect)(()=>{p.setQuality(f),n.setQuality(f)},[p,n,f]),(0,l.jsx)(en.Xe.Provider,{value:p,children:(0,l.jsx)(en.R8.Provider,{value:v,children:(0,l.jsx)(eo.y5.Provider,{value:E,children:t})})})})},42622:function(e,t,i){"use strict";i.r(t),i.d(t,{ThemeProvider:function(){return n}});var a=i(8759),o=i(99616),r=i(5674);let n=e=>{let{children:t}=e,i=(0,r.uK)(),n=i.get(r.V0),l=(0,r.oz)(),[s,d]=(0,o.useState)((0,r.NK)(n.get(r.BU.Theme),l));(0,o.useEffect)(()=>{(0,r.kz)(n.get(r.BU.Theme))},[n]),(0,o.useEffect)(()=>{n.get(r.BU.Theme)===r.rL&&d(l)},[l,n]);let u=(0,o.useMemo)(()=>({theme:s,setTheme:d}),[s]);return(0,a.jsx)(r.Ni.Provider,{value:u,children:t})}},19976:function(e,t,i){"use strict";i.r(t),i.d(t,{TranslationsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(17516),n=i(28151),l=i(5674);let s=e=>{let{children:t}=e,{dictionary:i,language:s,defaultLanguage:d}=(0,l.ZS)(),u=(0,l.wL)(),c=(0,o.useCallback)(e=>{if("code"in e&&e.code===r.bc.MISSING_DATA)return;let t=e&&"object"==typeof e&&"code"in e&&e.code,i="IntlProviderError";t&&(i+=":".concat(t)),u.error(i,{error:null==e?void 0:e.message,stack:null==e?void 0:e.stack})},[u]);return(0,a.jsx)(n.Z,{onError:c,defaultLocale:d,locale:s,messages:i,children:t})}},98125:function(e,t,i){"use strict";i.d(t,{F:function(){return v},K:function(){return h}});var a=i(8759),o=i(35338),r=i(33423),n=i(99616),l=i(65244),s=i(454),d=i(15527),u=i(14581),c=i(22926),C=i(5674);let h=()=>{let e=(0,C.uK)(),t=e.get(C.V0),i=(0,C.R$)();return(0,n.useCallback)(async e=>{var a;if(0!==e)t.set(C.BU.YmPlayerPrevVolume,e),await (null==i?void 0:i.setVolume(0)),t.set(C.BU.YmPlayerVolume,0);else{let e=null!==(a=t.get(C.BU.YmPlayerPrevVolume))&&void 0!==a?a:1;t.remove(C.BU.YmPlayerPrevVolume),await (null==i?void 0:i.setVolume(e)),t.set(C.BU.YmPlayerVolume,e)}},[i,t])};var m=i(73939),p=i.n(m);let v=(0,r.Pi)(e=>{var t,i;let{className:r}=e,{formatMessage:m}=(0,l.Z)(),v=(0,C.uK)(),E=(0,C.R$)(),{sonataState:f}=(0,C.oR)(),_=h(),y=v.get(C.V0),A=null!==(i=null!==(t=y.get(C.BU.YmPlayerVolume))&&void 0!==t?t:f.volume)&&void 0!==i?i:1,P=(0,n.useCallback)(e=>{null==E||E.setVolume(e),y.set(C.BU.YmPlayerVolume,e)},[E,y]),L=(0,n.useCallback)(async()=>{await _(f.volume)},[_,f.volume]),x=m(0===f.volume?{id:"player-actions.volume-on"}:{id:"player-actions.volume-off"});return(0,a.jsxs)("div",{className:(0,o.W)(p().root,r),children:[(0,a.jsx)(d.z,{radius:"round",size:"xxxs",variant:"text",withRipple:!1,onClick:L,"aria-label":x,icon:(0,a.jsx)(u.J,{size:"xs",className:p().icon,variant:0===A?"volumeOff":"volume"}),className:p().button,...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_BUTTON)}),(0,a.jsx)(c.i,{thumbSize:"s",trackSize:"s",value:A,maxValue:1,step:.01,onChange:P,"aria-label":m({id:"player-actions.volume-control"}),...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_SLIDER)})]})})},65151:function(e,t,i){"use strict";i.d(t,{t:function(){return s}});var a=i(8759),o=i(99616),r=i(45412),n=i(5674),l=i(34512);let s=()=>{let{notify:e}=(0,n.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,n.oR)(),s=(0,n.R$)();return(0,o.useCallback)(()=>{if(null===t.entityMeta||!t.canChangeRepeatMode)return;let o=r.zq.NONE;switch(t.repeatMode){case r.zq.NONE:o=r.zq.CONTEXT;break;case r.zq.CONTEXT:o=r.zq.ONE}null==s||s.setRepeatMode(o),e((0,a.jsx)(l.NotificationRepeat,{repeatMode:o}),{containerId:i.isOpened?n.W$.FULLSCREEN_INFO:n.W$.INFO})},[i.isOpened,e,s,t.canChangeRepeatMode,t.entityMeta,t.repeatMode])}},37960:function(e,t,i){"use strict";i.d(t,{m:function(){return l}});var a=i(8759),o=i(99616),r=i(5674),n=i(74758);let l=()=>{let{notify:e}=(0,r.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,r.oR)(),l=(0,r.R$)();return(0,o.useCallback)(()=>{null!==t.entityMeta&&t.canShuffle&&(null==l||l.toggleShuffle(),e((0,a.jsx)(n.NotificationShuffle,{shuffle:!!(null==l?void 0:l.state.queueState.shuffle.value)}),{containerId:i.isOpened?r.W$.FULLSCREEN_INFO:r.W$.INFO}))},[i.isOpened,e,l,t.canShuffle,t.entityMeta])}},34512:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationRepeat:function(){return h}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(45412),s=i(14581),d=i(1918),u=i(44285),c=i(55075),C=i.n(c);let h=e=>{let{repeatMode:t,closeToast:i}=e,c=t===l.zq.ONE?"repeat_one":"repeat",h=(0,r.useMemo)(()=>{let e;switch(t){case l.zq.CONTEXT:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-context"});break;case l.zq.ONE:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-track"});break;case l.zq.NONE:default:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-none"})}return(0,a.jsx)(d.Caption,{className:C().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(u.Yj,{cover:(0,a.jsx)(s.J,{className:(0,o.W)(C().icon,{[C().icon_unset]:t===l.zq.NONE}),size:"xs",variant:c}),message:h,closeToast:i})}},74758:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationShuffle:function(){return C}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(14581),s=i(1918),d=i(44285),u=i(46520),c=i.n(u);let C=e=>{let{shuffle:t,closeToast:i}=e,u=(0,r.useMemo)(()=>{let e;return e=t?(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-enabled"}):(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-disabled"}),(0,a.jsx)(s.Caption,{className:c().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(d.Yj,{cover:(0,a.jsx)(l.J,{className:(0,o.W)(c().icon,{[c().icon_unset]:!t}),size:"xs",variant:"shuffle"}),message:u,closeToast:i})}},6769:function(e,t,i){"use strict";i.r(t),i.d(t,{RepeatButton:function(){return m}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(45412),s=i(15527),d=i(14581),u=i(65151),c=i(20873),C=i.n(c);let h=(e,t,i)=>t(e===l.zq.NONE||i?{id:"player-actions.repeat"}:e===l.zq.ONE?{id:"player-actions.repeat-one"}:{id:"player-actions.repeat-context"}),m=e=>{let{isDisabled:t,repeatMode:i,className:c,iconClassName:m,size:p="xxxs",iconSize:v="xs",color:E,variant:f="default"}=e,_=(0,u.t)(),{formatMessage:y}=(0,r.Z)(),A=t||i!==l.zq.ONE?"repeat":"repeat_one",P=h(i,y,t);return(0,a.jsx)(s.z,{className:c,radius:"round",size:p,variant:f,color:E,disabled:t,withRipple:!1,"aria-label":P,"aria-pressed":!t&&i!==l.zq.NONE,onClick:_,icon:(0,a.jsx)(d.J,{size:v,variant:A,className:(0,o.W)(C().repeatIcon,C()["repeatIcon_".concat(i)],{[C().repeatIcon_disabled]:t},m)}),...(0,n.BA)(n.bG.sonata.REPEAT_BUTTON)})}},66403:function(e,t,i){"use strict";i.r(t),i.d(t,{ShuffleButton:function(){return C}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(15527),s=i(14581),d=i(37960),u=i(94406),c=i.n(u);let C=e=>{let{isDisabled:t,shuffle:i,className:u,size:C="xxxs",variant:h="default",iconSize:m="xs",color:p}=e,v=(0,d.m)(),{formatMessage:E}=(0,r.Z)();return(0,a.jsx)(l.z,{className:u,radius:"round",size:C,variant:h,color:p,withRipple:!1,disabled:t,"aria-label":E({id:"player-actions.shuffle"}),"aria-pressed":!t&&i,icon:(0,a.jsx)(s.J,{variant:"shuffle",size:m,className:(0,o.W)(c().shuffleIcon,{[c().shuffleIcon_disabled]:t,[c().shuffleIcon_on]:!t&&i,[c().shuffleIcon_off]:!t&&!i})}),onClick:v,...(0,n.BA)(n.bG.sonata.SHUFFLE_BUTTON)})}},21871:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataControls:function(){return w}});var a=i(8759),o=i(33423),r=i(99616),n=i(86502),l=i(5674),s=i(65151),d=i(37960),u=i(35338),c=i(65244),C=i(454),h=i(15527),m=i(14581),p=i(44285),v=i(6769),E=i(66403),f=i(19035),_=i.n(f);let y=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,shuffle:s,onClickNext:d,onClickPrev:f,onClickPlayPause:y,canChangeRepeatMode:A,className:P}=e,{formatMessage:L}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(_().root,P),children:[(0,a.jsx)("div",{className:_().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:_().sonataButton,size:"xxxs",variant:"text",iconSize:"xs",isDisabled:t,shuffle:s})}),(0,a.jsxs)("div",{className:_().sonataButtons,children:[(0,a.jsx)(h.z,{className:_().sonataButton,variant:"text",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":L({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:f,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:_().sonataButton,iconSize:"l",variant:"filled",isPlaying:i,iconClassName:_().playButtonIcon,onClick:y}),(0,a.jsx)(h.z,{className:_().sonataButton,radius:"round",size:"m",variant:"text",disabled:!r,withRipple:!1,"aria-label":L({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:d,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:_().buttonContainer,children:(t||A)&&(0,a.jsx)(v.RepeatButton,{className:_().sonataButton,size:"xxxs",variant:"text",isDisabled:t,iconSize:"xs",repeatMode:o})})]})});var A=i(57004);let P=e=>{let{disabled:t,isPlaying:i,onClickPlayPause:o,className:r}=e;return(0,a.jsx)(A.PlayButton,{className:r,size:"s",disabled:t,isPlaying:i,onClick:o})};var L=i(24516),x=i.n(L);let b=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,onClickNext:s,onClickPrev:d,onClickPlayPause:f,canChangeRepeatMode:_,shuffle:y,className:A}=e,{formatMessage:P}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(x().root,A),children:[(0,a.jsx)("div",{className:x().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:x().sonataButton,size:"s",iconSize:"xxs",color:"secondary",isDisabled:t,shuffle:y})}),(0,a.jsxs)("div",{className:x().sonataButtons,children:[(0,a.jsx)(h.z,{className:x().sonataButton,color:"secondary",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":P({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:d,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:x().sonataButton,iconSize:"m",size:"l",radius:"round",color:"secondary",buttonVariant:"default",isPlaying:i,iconClassName:x().playPauseButtonIcon,onClick:f}),(0,a.jsx)(h.z,{className:x().sonataButton,radius:"round",size:"m",color:"secondary",disabled:!r,withRipple:!1,"aria-label":P({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:s,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:x().buttonContainer,children:(t||_)&&(0,a.jsx)(v.RepeatButton,{className:x().sonataButton,size:"s",color:"secondary",isDisabled:t,iconSize:"xxs",repeatMode:o})})]})});var g=i(57413),N=i(43310),V=i(3273),S=i.n(V);let T=(0,o.Pi)(e=>{let{isPlaying:t,canMoveForward:i,canMoveBackward:o,onClickNext:n,onClickPrev:s,onClickPlayPause:d,className:C}=e,{formatMessage:v}=(0,c.Z)(),{user:E,sonataState:f}=(0,l.oR)(),_=(0,l.XU)(),y=f.entityMeta,A=f.contextType===g.Ak.Generative,P=E.isAuthorized&&!A,L=(0,N.SB)(f.entityMeta),x=(0,N.KX)(f.entityMeta);return(0,r.useEffect)(()=>{if(!f.isGenerativeContext)return null==_||_.addShortcutsListener(l.yx.LIKE,L),null==_||_.addShortcutsListener(l.yx.DISLIKE,x),()=>{null==_||_.removeShortcutsListener(l.yx.LIKE),null==_||_.removeShortcutsListener(l.yx.DISLIKE)}},[x,L,_,f.isGenerativeContext]),(0,a.jsxs)("div",{className:(0,u.W)(S().root,C),children:[(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.Q1,{isDisliked:y.isDisliked,onClick:x})}),(0,a.jsxs)("div",{className:S().sonataButtons,children:[(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",color:"secondary",size:"m",radius:"round",disabled:!o,withRipple:!1,"aria-label":v({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:s}),(0,a.jsx)(p.JM,{className:S().sonataButton,iconSize:"xxl",variant:"filled",color:"secondary",isPlaying:t,iconClassName:S().playPauseButtonIcon,onClick:d}),(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",radius:"round",size:"m",color:"secondary",disabled:!i,withRipple:!1,"aria-label":v({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:n})]}),(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.dJ,{isLiked:y.isLiked,onClick:L})})]})}),w=(0,o.Pi)(e=>{var t,i;let{isMobile:o,entityMeta:u,isFullscreen:c,className:C}=e,{sonataState:h,vibe:m}=(0,l.oR)(),p=(0,l.XU)(),v=(0,l.R$)(),{togglePlay:E}=(0,l.Qh)({seeds:null!==(i=null===(t=m.meta)||void 0===t?void 0:t.seeds)&&void 0!==i?i:[],pageIdForFrom:l.Rh.HOME,blockIdForFrom:l.BE.RUP_MAIN_RADIO}),f=(0,r.useMemo)(()=>{let e=[n.Xz.PLAYING,n.Xz.LOADING_MEDIA_SOURCE,n.Xz.LOADING_MEDIA_DATA];return e.includes(h.status)},[h.status]),_=(0,r.useCallback)(()=>{u?null==v||v.togglePause():E()},[u,v,E]),A=(0,r.useCallback)(()=>{null==v||v.moveForward()},[v]),L=(0,r.useCallback)(()=>{null==v||v.moveBackward()},[v]),x=(0,d.m)(),g=(0,s.t)();(0,r.useEffect)(()=>{if(!c)return null==p||p.addShortcutsListener(l.yx.TOGGLE_PLAY,_),null==p||p.addShortcutsListener(l.yx.TOGGLE_REPEAT,g),null==p||p.addShortcutsListener(l.yx.TOGGLE_SHUFFLE,x),()=>{null==p||p.removeShortcutsListener(l.yx.TOGGLE_PLAY),null==p||p.removeShortcutsListener(l.yx.TOGGLE_SHUFFLE),null==p||p.removeShortcutsListener(l.yx.TOGGLE_REPEAT)}},[c,_,g,x,p]);let N=(0,r.useMemo)(()=>c?o?T:b:o?P:y,[o,c]);return(0,a.jsx)(N,{className:C,disabled:null===h.entityMeta,isPlaying:f,canMoveBackward:h.canMoveBackward,canMoveForward:h.canMoveForward,canShuffle:h.canShuffle,shuffle:h.shuffle,onClickPlayPause:_,onClickNext:A,onClickPrev:L,canChangeRepeatMode:h.canChangeRepeatMode,repeatMode:h.repeatMode})})},68085:function(e,t,i){"use strict";i.d(t,{$:function(){return d}});var a,o,r=i(28307),n=i(93991),l=i(39351);(a=o||(o={})).WEB="YandexMusicWebNext",a.DESKTOP="YandexMusicDesktopApp";let s=(e,t)=>"".concat(e,"/").concat(t),d=()=>{{let e=(0,l.b)()||"1.0",t="".concat(o.DESKTOP).concat((0,n.y)((0,r.X)()));return s(t,e)}}},93991:function(e,t,i){"use strict";i.d(t,{y:function(){return o}});var a=i(38060);let o=e=>{switch(e){case"win32":return a.B.WINDOWS;case"darwin":return a.B.MACOS;case"linux":return a.B.LINUX}return null}},38060:function(e,t,i){"use strict";var a,o;i.d(t,{B:function(){return a}}),(o=a||(a={})).WINDOWS="Windows",o.MACOS="MacOS",o.LINUX="Linux"},2365:function(e,t,i){"use strict";i.d(t,{T:function(){return a.NotFound}});var a=i(54529)},54529:function(e,t,i){"use strict";i.r(t),i.d(t,{NotFound:function(){return m}});var a=i(8759),o=i(35338),r=i(33423),n=i(2814),l=i(15527),s=i(14581),d=i(1918),u=i(42769),c=i(5674),C=i(94170),h=i.n(C);let m=(0,r.Pi)(e=>{let{className:t}=e,{contentRef:i}=(0,c.$Y)(),r=(0,c.s0)("/");return(0,c.ZP)(!0),(0,a.jsxs)("div",{className:(0,o.W)(h().root,{[h().root_desktop]:!i},t),children:[(0,a.jsx)(u.n,{withBackwardFallback:"/",className:h().navigation,withForwardControl:!1}),(0,a.jsxs)("div",{className:h().content,children:[(0,a.jsx)(s.J,{className:h().icon,variant:"musicLogo",size:"xxl"}),(0,a.jsx)(d.Heading,{className:(0,o.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist"})}),(0,a.jsx)(d.Caption,{className:(0,o.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist-description"})}),(0,a.jsx)(l.z,{onClick:r,className:h().button,role:"link",color:"secondary",size:"l",radius:"xxxl",children:(0,a.jsx)(d.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(n.Z,{id:"navigation.page-main"})})})]})]})})},48157:function(e,t,i){"use strict";i.d(t,{hx:function(){return O},f3:function(){return ea},Vm:function(){return eg},KC:function(){return eT}});var a,o=i(8759),r=i(35338),n=i(33423),l=i(99616),s=i.t(l,2),d=i(65244),u=i(2814),c=i(454),C=i(57413),h=i(15527),m=i(14581),p=i(96437),v=i(1918),E=i(96911),f=i(96169),_=i(81446),y=i(5674),A=i(44285);let P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.filter(e=>!e.composer),i=t.filter(e=>!e.various),a=e.filter(e=>e.composer&&!e.various),o=[];return i.length>0?o=i:t.length>0&&(o=t),o.concat(a)};var L=i(33779),x=i.n(L),b=i(13236),g=i(41342),N=i.n(g);let V=(0,n.Pi)(e=>{let{className:t,text:i="",maxTextLength:a,minTextLength:n,variant:s="input",shouldFinishOnKeyPress:d=!1,placeholder:u,onChangeFinish:c}=e,[C,h]=(0,l.useState)(i),m=(0,l.useRef)(!1),p=(0,l.useRef)(null),v=(0,l.useCallback)(e=>{h(e.target.value)},[]),E=(0,l.useCallback)(e=>{if(d&&["Enter","Escape"].includes(e.key)){var t;"Escape"===e.key&&(m.current=!0),null===(t=e.currentTarget)||void 0===t||t.blur()}},[d]),f=(0,l.useCallback)(()=>{let e=C.trim();m.current||n&&e.length{p.current&&(p.current.selectionStart=p.current.value.length,p.current.selectionEnd=p.current.value.length)},[]),(0,l.useLayoutEffect)(()=>{let e=p.current;if(e){e.style.height="0px";let t=e.scrollHeight;e.style.height="".concat(t,"px")}},[p,C]);let _=(0,l.useMemo)(()=>"textarea"===s?e=>(0,o.jsx)("textarea",{ref:p,rows:6,...e}):e=>(0,o.jsx)("input",{...e}),[s]);return(0,o.jsx)(_,{className:(0,r.W)(N().root,t,{[N().root_textarea]:"textarea"===s}),type:"text",value:C,maxLength:a,onBlur:f,onChange:v,onKeyDown:E,placeholder:u,autoFocus:!0})});var S=i(74081),T=i.n(S);let w=(0,n.Pi)(e=>{let{title:t="","aria-labelledby":i,canChange:a=!1,onChange:n,maxTitleLength:s,version:u="",onVersionClick:C,className:p}=e,{settings:E}=(0,y.oR)(),{formatMessage:f}=(0,d.Z)(),[_,A]=(0,l.useState)(!1),P=(0,l.useRef)(null),L=E.layout===y.t8.Mobile,x=t.length+u.length,g=x>25,N=(0,l.useMemo)(()=>L?T().font_mobile:g?T().font_long:T().font_short,[L,g]),S=!L&&a&&_,w=(0,l.useCallback)(()=>{var e;A(!0),null===(e=P.current)||void 0===e||e.focus()},[]),R=(0,l.useCallback)(e=>{A(!1),null==n||n(e)},[n]);return(0,o.jsxs)(o.Fragment,{children:[!S&&(0,o.jsxs)("div",{className:(0,r.W)(T().root,p),children:[(0,o.jsx)(b.b4,{title:t,className:T().stickyTitle,children:(0,o.jsxs)(v.Heading,{variant:"h2",id:i,className:(0,r.W)(T().heading,{[T().heading_withVersion]:u}),...(0,c.BA)(c.QM.pageHeader.ENTITY_TITLE),children:[(0,o.jsx)(v.Caption,{className:(0,r.W)(T().font,N,T().title),variant:"span",children:t}),u&&(0,o.jsx)(v.Caption,{onClick:C,className:(0,r.W)(T().font,N,T().version,{[T().version_withOtherVersions]:C}),variant:"span",...(0,c.BA)(c.QM.pageHeader.ENTITY_VERSION),children:" ".concat(u)})]})}),a&&(0,o.jsx)("div",{className:(0,r.W)(T().editButton,{[T().editButton_centered]:!g&&!L}),children:(0,o.jsx)(h.z,{onClick:w,"aria-label":f({id:"playlist-actions.change-title"}),icon:(0,o.jsx)(m.J,{size:"xxs",variant:"pencil"}),size:"s",radius:"round",...(0,c.BA)(c.QM.pageHeader.EDIT_TITLE_BUTTON)})})]}),S&&(0,o.jsx)("div",{className:T().textFieldContainer,children:(0,o.jsx)(V,{text:t,className:(0,r.W)(T().font,N,T().textField,T().title,{[T().textField_long]:g&&!L}),onChangeFinish:R,maxTextLength:s,minTextLength:1,placeholder:f({id:"playlist-actions.enter-title"}),shouldFinishOnKeyPress:!0})})]})}),R=(0,n.Pi)(e=>{let{"aria-labelledby":t,entityName:i,title:a,meta:n,controls:s,className:d,forwardRef:u,canChangeTitle:C=!1,maxTitleLength:h,onTitleChange:m,cover:p,version:E,onVersionClick:f,disclaimerLabel:_,entityNameIcon:y}=e,A=(0,l.isValidElement)(_),P=(0,l.useMemo)(()=>A?(0,o.jsx)("div",{className:x().entityContainer,children:_}):(0,o.jsxs)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:x().entityName,children:[i,y]}),[_,i,y,A]);return(0,o.jsxs)("div",{className:(0,r.W)(x().root,d),ref:u,...(0,c.BA)(c.QM.pageHeader.ENTITY_HEADER),children:[(0,o.jsx)("div",{className:x().coverCell,children:p}),(0,o.jsxs)("div",{className:x().content,children:[(0,o.jsxs)("div",{className:x().info,children:[P,(0,o.jsx)(w,{className:(0,r.W)(x().title,{[x().title_withDisclaimerLabel]:A}),title:a,"aria-labelledby":t,canChange:C,maxTitleLength:h,onChange:m,version:E,onVersionClick:f}),!!n&&(0,o.jsx)("div",{className:(0,r.W)(x().meta,{[x().meta_withDisclaimerLabel]:A}),children:n})]}),(0,o.jsx)("div",{className:x().controls,children:s})]})]})}),M=(0,l.forwardRef)((e,t)=>(0,o.jsx)(R,{forwardRef:t,...e}));var H=i(86252),k=i.n(H);let j=e=>{let{coverVariant:t,coverUri:i,isAvailable:a,className:r,withBookmateBadge:n}=e;return(0,o.jsxs)(p.Paper,{radius:"round"===t?"round":"m",className:r,children:[(0,o.jsx)(A.BE,{fit:"cover",src:i,size:300,className:k().coverImage,withAvatarReplace:!0,isAvailable:a}),n&&(0,o.jsx)(m.J,{variant:"bookmateBadge",className:k().bookmateBadge})]})};var B=i(89998),Z=i.n(B);let I=(0,n.Pi)(e=>{var t,i,a;let n,{album:s,className:L,"aria-labelledby":x,forwardRef:b,onVersionClick:g}=e,N=(0,y.x5)({pageId:y.Rh.ALBUM,blockId:y.aU.ALBUM}),{formatMessage:V}=(0,d.Z)(),{settings:S,sonataState:{status:T,unloadedEntitiesData:w},experiments:R}=(0,y.oR)(),[H,k]=(0,l.useState)(!1),B=(0,f.SB)(s),I=(0,f.BV)(s),O=S.layout===y.t8.Mobile,q=R.checkExperiment(y.pe.WebPins,"on")&&!O,D=(0,f.TL)(s),U=(0,y.uK)(),z=U.get(y.U5),F=z.features.nonMusic&&s.isPodcast;F&&(n=s.isLiked?V({id:"interface-actions.subscribed"}):V({id:"interface-actions.subscribe"}));let W=(0,l.useMemo)(()=>P(s.artists),[s.artists]),Y=(null==W?void 0:W.length)===1&&!(null===(t=W[0])||void 0===t?void 0:t.decomposed)&&!(null===(i=W[0])||void 0===i?void 0:i.various),G=(0,f.H0)(s.type),{isPlaying:K,togglePlay:J}=(0,y.qm)({playContextParams:{contextData:{type:C.Ak.Album,meta:{id:s.id},from:N},loadContextMeta:!0,entitiesData:w},sonataStatus:T}),$=(0,o.jsxs)("div",{className:Z().meta,children:[Y&&(0,o.jsx)(p.Paper,{radius:"round",className:Z().artistCover,children:(0,o.jsx)(A.BE,{src:null===(a=W[0])||void 0===a?void 0:a.coverUri,size:30,withAvatarReplace:!0})}),(0,o.jsx)(_.jO,{artists:W,lineClamp:O?1:void 0,className:Z().artists,spoilerClassName:Z().artistsSpoiler,visibleArtistsCount:O?void 0:2,linkClassName:Z().artistLink,captionClassName:Z().artistLabel,variant:O?"breakAll":"breakWord"}),s.year&&(0,o.jsx)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:(0,r.W)(Z().year,{[Z().year_dot]:W.length>0}),...(0,c.BA)(c.QM.pageHeader.ALBUM_RELEASE_DATE),children:s.year})]}),X=(0,l.useMemo)(()=>O?(0,o.jsx)(A.JM,{className:Z().playControl,color:"primary",buttonVariant:"default",iconSize:"xxl",isPlaying:K,onClick:J,variant:"filled",disabled:!s.isAvailable}):(0,o.jsx)(A.JM,{className:Z().playControl,withRipple:!0,buttonVariant:"default",radius:"xxxl",size:"s",color:"primary",iconSize:"xxs",isPlaying:K,onClick:J,disabled:!s.isAvailable,children:(0,o.jsx)(u.Z,{id:"player-actions.listen"})}),[s.isAvailable,O,K,J]),Q=(0,l.useMemo)(()=>{let e=O?"l":"s",t=O?"m":"xxs";return(0,o.jsxs)("div",{className:Z().controls,children:[X,(0,o.jsx)(A.dJ,{className:Z().likeControl,isLiked:s.isLiked,onClick:B,variant:"default",size:e,iconSize:t,iconClassName:Z().likeIcon,withRipple:!O,disabled:!s.isAvailable,"aria-label":n}),q&&(0,o.jsx)(A.RT,{onClick:I,isPinned:s.isPinned,isDisabled:!s.isAvailable,className:Z().pinControl}),(0,o.jsx)(E.oK,{album:s,open:H,onOpenChange:k,reference:(0,o.jsx)(h.z,{className:Z().menuControl,size:e,radius:"round",withRipple:!O,"aria-label":V({id:"interface-actions.context-menu"}),icon:(0,o.jsx)(m.J,{size:t,variant:"more"}),...(0,c.BA)(c.QM.pageHeader.ALBUM_HEADER_CONTEXT_MENU)})})]})},[O,X,s,B,n,q,I,H,V]),ee=(0,l.useMemo)(()=>{if(D)return(0,o.jsx)(m.J,{variant:"bookmateLogo",className:Z().bookmateLogo})},[D]);return(0,o.jsx)(M,{ref:b,className:L,controls:Q,meta:$,entityName:G,entityNameIcon:ee,title:s.title,cover:(0,o.jsx)(j,{coverVariant:"square",coverUri:s.coverUri,isAvailable:s.isAvailable,withBookmateBadge:D}),"aria-labelledby":x,version:s.version,onVersionClick:g})}),O=(0,l.forwardRef)((e,t)=>(0,o.jsx)(I,{forwardRef:t,...e}));var q=i(34603),D={5881:(e,t,i)=>{function a(){for(var e,t,i=0,a="";ia,default:()=>o});let o=a},5025:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"LizdJ2L0HW7JWOvPrfly"}},435:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_controls_xxs:"tRaaBpDMg9Qu8v6gKjtn",root_entity_xxs:"M9zvtlcpLUVn6DKdcHhj",root_text_xxs:"ln0PYYwDmFnfYxCDJsFU",root_controls_xs:"n5AeWEsJC3_AYXcbK4Lt",root_entity_xs:"__hrMKGmNbw54T54IUyh",root_text_xs:"SehSa7OyRpC2nzYTVb2Q",root_controls_s:"_oBLf5gprWsKjCw4Ce58",root_entity_s:"mxSPe5xpZnie9gpIqacd",root_text_s:"Ai2iRN9elHpk_u5splD6",root_controls_m:"tk7ahHRDYXJMMB879KUA",root_entity_m:"Z_WIr2W8JU4MPQek3hgR",root_text_m:"g3qWNP6xl__7qxNmtrvd",root_controls_l:"grvxapJE3vGArOKDWf6n",root_entity_l:"Esj5A1UeSi4xV4tZ839D",root_text_l:"V3WU123oO65AxsprotU9",root_weight_normal:"ZYV27jeWd30QDXu4GhaH",root_weight_medium:"_3_Mxw7Si7j2g4kWjlpR",root_weight_bold:"Vi7Rd0SZWqD17F0872TB"}},5668:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_size_xs:"qJJ288377iHlWN_RXeEE",root_size_s:"_sd8Q9d_Ttn0Ufe4ISWS",root_size_m:"Ctk8dbecq31Qh7isOJPQ",root_size_l:"M_Djh6ppIkCO3A2k_BTA",root_size_xl:"dtxlzGQMPAbM2MEndXWX",root_size_xxl:"IUb9XLplTAoZqne9rNUL",root_size_xxxl:"ZYZamUwql_rfFR4RpI2B",root_size_xxxxl:"ZBZyxow5njdq8z5dnRPY",root_weight_bold:"nSU6fV9y80WrZEfafvww",root_weight_black:"KBeGPPK4DinQzAP41Y_N"}},3594:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"_MWOVuZRvUQdXKTMcOPx",root_clamp:"LezmJlldtbHWqU7l1950",root_clamp_oneline:"oyQL2RSmoNbNQf3Vc6YI",root_clamp_multiline:"jMyoZB5J9iZbzJmWOrF0"}},6161:(e,t,i)=>{/** ++(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4720,9889,2121,3799,1521,1593,9880,8910,2499,105,5001,4870,2286,1871,9264],{35582:function(e,t,i){"use strict";i.r(t);var a,o,r,n,l,s,d,u,c,C,h,m,p,v,E,f,_,y,A,P,L,x,b,g,N,V,S,T,w,R,M,H,k,j,B,Z,I,O,q,D,U,z,F,W,Y,G,K,J,$,X,Q,ee,et,ei,ea,eo,er,en,el,es,ed,eu,ec,eC,eh,em,ep,ev,eE,ef,e_,ey,eA,eP,eL,ex,eb,eg,eN,eV,eS,eT,ew,eR,eM,eH,ek,ej,eB,eZ,eI,eO,eq,eD,eU=i(99616);function ez(){return(ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let e=(0,n.useRouter)(),t=(0,c.uK)(),i=t.get(c.xi),o=(0,l.useCallback)(()=>{i.authorizationUrl&&e.push(i.authorizationUrl)},[i.authorizationUrl,e]);return(0,a.jsxs)("div",{className:h().root,children:[(0,a.jsx)(u.Heading,{className:(0,r.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(s.Z,{id:"authorization.enter-title"})}),(0,a.jsx)(u.Caption,{className:(0,r.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(s.Z,{id:"authorization.enter-text"})}),(0,a.jsx)(d.z,{onClick:o,className:h().button,role:"link",color:"primary",size:"l",radius:"xxxl",children:(0,a.jsx)(u.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(s.Z,{id:"authorization.enter-button"})})})]})}),p=(0,o.Pi)(e=>{let{children:t}=e,{user:i}=(0,c.oR)();return i.isAuthorized?t:(0,a.jsx)(m,{})})},40466:function(e,t,i){"use strict";i.r(t),i.d(t,{WithBetaUser:function(){return A}});var a=i(8759),o=i(33423),r=i(35338),n=i(11769),l=i(99616),s=i(65244),d=i(2814),u=i(15527),c=i(13410),C=i(28036),h=i(1918),m=i(57921),p=i(39479),v=i(5674),E=i(44285),f=i(99800),_=i.n(f);let y=(0,o.Pi)(e=>{let{withoutExperiment:t=!1,showLoginButton:o=!1,showUserProfile:f=!1,withOffer:y=!1}=e,A=(0,n.useRouter)(),P=(0,v.uK)(),{settings:L}=(0,v.oR)(),{formatMessage:x}=(0,s.Z)(),b=P.get(v.xi),g=P.get(v.U5),N=(0,v.yy)(g.oldWebHost),V=(0,l.useMemo)(()=>L.layout===v.t8.Mobile?i(25811).Z.src:i(11737).Z.src,[L.layout]),S=(0,l.useCallback)(()=>{b.authorizationUrl&&A.push(b.authorizationUrl)},[b.authorizationUrl,A]);(0,v.NO)(!0);let T=(0,l.useMemo)(()=>y?(0,a.jsx)(h.Heading,{variant:"h1",size:"xl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-header"})}):t?(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-header",values:{br:(0,a.jsx)("br",{})}})}):(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-header",values:{br:(0,a.jsx)("br",{})}})}),[y,t]),w=(0,l.useMemo)(()=>t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})})})]}):y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().offerText,children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})})})]}),[y,t]),R=(0,l.useMemo)(()=>{if(o)return(0,a.jsx)(u.z,{onClick:S,className:_().loginButton,role:"link",color:"primary",size:"m",radius:"xxxl",children:(0,a.jsx)(d.Z,{id:"authorization.enter-button"})});if(y){let e="https://".concat(N,"/pay");return(0,a.jsx)(E.rU,{className:_().offerButtonLink,href:e,"aria-label":x({id:"payment.offer-button"}),target:"_blank",children:(0,a.jsx)(u.z,{className:(0,r.W)(_().offerButton,_().offerButton_important),role:"link",color:"plus",size:"l",radius:"m",withRipple:!1,children:(0,a.jsx)(d.Z,{id:"payment.offer-button"})})})}},[x,S,N,o,y]);return(0,v.ZP)(!0),(0,a.jsxs)("div",{className:(0,r.W)(_().root),children:[(0,a.jsx)(m.TF,{withSecondaryColor:!0}),(0,a.jsx)("div",{className:_().logoContainer,children:(0,a.jsx)(c.T,{alignIcon:"center",lang:"ru",className:_().logo})}),T,w,R,(0,a.jsx)("img",{className:_().image,src:V}),f&&(0,a.jsx)(p.Iw,{className:_().user,withMeta:L.layout!==v.t8.Mobile,variant:L.layout===v.t8.Mobile?"mobile":"desktop",usernameClassName:(0,r.W)(_().username,_().important)})]})}),A=(0,o.Pi)(e=>{let{children:t}=e,{user:i,experiments:o}=(0,v.oR)();return i.isAuthorized?o.checkExperiment(v.pe.WebNext,"on")&&!i.isChild?i.hasPlus||o.checkExperiment(v.pe.WebNextFreemium,"on")?t:(0,a.jsx)(y,{withOffer:!0,showUserProfile:!0}):(0,a.jsx)(y,{withoutExperiment:!0,showUserProfile:!0}):(0,a.jsx)(y,{showLoginButton:!0})})},12286:function(e,t,i){"use strict";i.r(t);var a=i(8759),o=i(35338),r=i(99616),n=i(92318),l=i(89788),s=i(5674),d=i(37500),u=i.n(d),c=i(21535);t.default=e=>{let{children:t}=e,{state:i,toggleTrue:d}=(0,n.O)(!1),{state:C,toggleTrue:h}=(0,n.O)(!1),m=(0,r.useMemo)(()=>{let e=new l.JC;return(0,s.NK)(e.get(s.BU.Theme),(0,s.Q$)())},[]),p=(0,r.useCallback)(e=>{let t=c.env.ASSET_PREFIX||"";return"".concat(t,"/video/splash_screen/splash_screen_").concat(m,".").concat(e)},[m]),v=(0,r.useMemo)(()=>({isVisible:!i}),[i]);return(0,a.jsxs)(s.IP.Provider,{value:v,children:[!i&&(0,a.jsx)("div",{className:(0,o.W)(u().root,u()["root_".concat(m)],{[u().root_hidden]:C}),onAnimationEnd:d,children:(0,a.jsxs)("video",{className:u().video,autoPlay:!0,muted:!0,playsInline:!0,onEnded:h,onError:d,children:[(0,a.jsx)("source",{src:p("webm"),type:"video/webm"}),(0,a.jsx)("source",{src:p("mp4"),type:"video/mp4"})]})}),t]})}},44495:function(e,t,i){"use strict";i.r(t),i.d(t,{DesktopInitializer:function(){return d}});var a=i(8759),o=i(35338),r=i(99616),n=i(48769),l=i(57921),s=i(5674);let d=()=>{let e=(0,s.Xf)(),{dictionary:t}=(0,s.ZS)();{let{theme:e}=(0,s.Fg)(),t=(0,s.sv)();(0,l.Tk)(),(0,l.Er)(),(0,l.bO)(),(0,l.vs)(),(0,l.Zw)(),(0,r.useEffect)(()=>{(0,l.Yl)(),(0,l.l7)()},[]),(0,r.useEffect)(()=>{let e=(0,s.bo)();e&&t.count(e,"appVersion")},[t]),(0,r.useEffect)(()=>{(0,l.F5)(e),t.count(e,"appTheme")},[e])}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Notification,{className:(0,o.W)({updateNotificationContainer:!0,updateNotificationContainer_application_windows:e===s.t4.WINDOWS,updateNotificationContainer_application_macos:e===s.t4.MACOS}),enableMultiContainer:!0,containerId:s.W$.APPLICATION_UPDATE,position:"top-center"}),(0,a.jsx)(l.Pj,{dictionary:t})]})}},49842:function(e,t,i){"use strict";i.r(t),i.d(t,{UrlInitializer:function(){return n}});var a=i(33423),o=i(11769),r=i(5674);let n=(0,a.Pi)(e=>{let{host:t}=e,{location:i}=(0,r.oR)(),a=(0,o.usePathname)(),n=(0,o.useSearchParams)().toString(),l=window.location.host,s=t||l,d="https://".concat(s),u="https://".concat(s).concat(a).concat(n?"?":"").concat(n);d=s,u="".concat(s).concat(a).concat(n?"?":"").concat(n),i.setPathname(a),i.setSearchParams(n),i.setHost(s),i.setTld((0,r.p$)(s)||"ru"),i.setOrigin(d),i.setHref(u)})},85816:function(e,t,i){"use strict";i.r(t),i.d(t,{WebInitializer:function(){return s}});var a=i(8759);i(99616);var o=i(5674),r=i(33423);let n=(0,r.Pi)(e=>{let{children:t,userIp:i}=e,{location:a}=(0,o.oR)();return t}),l=e=>{let{children:t}=e;return t},s=e=>{let{userIp:t}=e,i=(0,o.uK)(),r=i.get(o.V0);return r.get(o.BU.DisallowDeeplinksRedirect),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l,{}),(0,a.jsx)(n,{userIp:t})]})}},52207:function(e,t,i){"use strict";i.r(t),i.d(t,{NavigationEvents:function(){return n}});var a=i(11769),o=i(99616),r=i(5674);let n=()=>{let e=(0,r.sv)(),t=(0,a.usePathname)(),i=(0,a.useSearchParams)();return(0,o.useEffect)(()=>{let a="".concat(t).concat(i.size>0?"?".concat(i):"");e.hit(a)},[t,i,e]),null}},75576:function(e,t,i){"use strict";i.r(t),i.d(t,{AnalyticsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(82834),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.sv)(),s=(0,n.wL)(),d=(0,n.uK)(),u=d.get(n.V0),c=(0,o.useMemo)(()=>{if(l)return l;let e="on"===u.get(n.BU.AllowAnalyticsLogs),t=(0,r.HQ)(e=>i.count(e,"evgen"),s,e),a=(0,r.hz)(),o=(0,r.y_)();return l=new r.yx(t,a,o)},[u,s,i]);return(0,a.jsx)(n.fC.Provider,{value:c,children:(0,a.jsx)(n.tK,{children:t})})}},83622:function(e,t,i){"use strict";i.r(t),i.d(t,{HistoryProvider:function(){return s}});var a=i(8759),o=i(11769),r=i(99616),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.uK)(),s=(0,o.useRouter)(),d=(0,o.usePathname)(),u=(0,o.useSearchParams)(),[c,C]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1),[p,v]=(0,r.useState)(null),E=(0,r.useMemo)(()=>{if(l)return l;let e=i.get(n.Ar);return l=new n.QQ(e)},[i]),f=(0,r.useCallback)(()=>{E&&(C(E.canBack),m(E.canForward),v(E.state))},[E]),_=(0,r.useCallback)(e=>{E&&(E.replaceState(e),s.replace(e.href))},[E,s]),y=(0,r.useCallback)(e=>{E&&(E.pushState(e),f())},[E,f]),A=(0,r.useCallback)(()=>{E&&(E.back(),f(),s.back())},[E,s,f]),P=(0,r.useCallback)(()=>{E&&(E.forward(),f(),s.forward())},[E,s,f]);return(0,r.useEffect)(()=>{var e;let t=[d,u.toString()].join("?");(!(null==E?void 0:E.state)||(null==E?void 0:null===(e=E.state)||void 0===e?void 0:e.isLocationNotEqual(t)))&&y({href:t})},[E,d,u,y]),(0,a.jsx)(n.Tl.Provider,{value:{pushState:y,replaceState:_,canForward:h,canBack:c,back:A,forward:P,state:p},children:t})}},75707:function(e,t,i){"use strict";i.r(t),i.d(t,{LayoutProvider:function(){return d},setClientSideLayout:function(){return s}});var a=i(8759),o=i(57285),r=i(33423),n=i(99616),l=i(5674);let s=e=>{document.body.classList.remove("desktop"),e.setLayout((0,l.jP)(window.innerWidth))},d=(0,r.Pi)(e=>{let{children:t,userAgent:i}=e,{settings:r}=(0,l.oR)(),d=(0,l.Xf)(),[u,c]=(0,n.useState)(null);d&&r.setPlatform(d),r.layout;let C=(0,n.useMemo)(()=>(0,o.Z)(()=>{s(r)},100),[r]),h=(0,n.useCallback)(e=>{c(e)},[]);(0,n.useLayoutEffect)(()=>{s(r)},[r]),(0,n.useEffect)(()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}),[C]);let m=(0,n.useMemo)(()=>({contentRef:u,setContentRef:h}),[u,h]);return(0,a.jsx)(l.VY.Provider,{value:m,children:t})})},29371:function(e,t,i){"use strict";i.r(t),i.d(t,{PrefetchDataProvider:function(){return s}});var a=i(33423),o=i(99616),r=i(5674),n=i(75707);let l=async(e,t,i)=>{let{user:a,library:o,experiments:n,pinsCollection:l}=e;if(t?await a.getAbout():a.setUnauthorized(),a.puid&&i.setPassportUid(a.puid),await n.getData(),a.isAuthorized){let e=[a.getSettings(),o.getData()];n.checkExperiment(r.pe.WebPins,"on")&&e.push(l.getData()),await Promise.all(e)}},s=(0,a.Pi)(e=>{let{children:t}=e,i=(0,r.oR)(),a=(0,r.uK)(),s=a.get(r.xi),d=a.get(r.Hz),u=s.hasAuthorizationCredentials;return(0,n.setClientSideLayout)(i.settings),i.user.account.loadingState===r.Gu.IDLE&&(0,o.use)(l(i,u,d)),t})},85709:function(e,t,i){"use strict";i.r(t),i.d(t,{ShortcutsProvider:function(){return d}});var a=i(8759),o=i(33423),r=i(99616),n=i(98125),l=i(5674);let s=null,d=(0,o.Pi)(e=>{let{children:t}=e,i=(0,l.R$)(),o=(0,l.uK)(),d=o.get(l.V0),u=(0,n.K)(),{sonataState:c}=(0,l.oR)(),C=(0,r.useMemo)(()=>(s||(s=new l.OI(new l.yr)),s),[]);return(0,r.useEffect)(()=>(null==C||C.addShortcutsListener(l.yx.DECREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.decreaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.INCREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.increaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.TOGGLE_MUTE,async()=>{let e=null==i?void 0:i.state.playerState.volume.value;void 0!==e&&await u(e)}),()=>{null==C||C.removeShortcutsListener(l.yx.DECREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.INCREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.TOGGLE_MUTE)}),[C,i,d,u]),(0,r.useEffect)(()=>{if(!c.isGenerativeContext)return null==C||C.addShortcutsListener(l.yx.MOVE_BACKWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value)&&await i.moveBackward()}),null==C||C.addShortcutsListener(l.yx.MOVE_FORWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value)&&await (null==i?void 0:i.moveForward())}),null==C||C.addShortcutsListener(l.yx.SLIDE_BACKWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideBackward(2))}),null==C||C.addShortcutsListener(l.yx.SLIDE_FORWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideForward(2))}),()=>{null==C||C.removeShortcutsListener(l.yx.MOVE_FORWARD),null==C||C.removeShortcutsListener(l.yx.MOVE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_FORWARD)}},[C,i,d,c.isGenerativeContext]),(0,a.jsx)(l.cw.Provider,{value:C,children:t})})},48085:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataProvider:function(){return eu}});var a,o,r,n,l=i(8759),s=i(33423),d=i(99616),u=i(8124);class c extends Error{constructor(e){super(e),this.name="AudioError"}}let C={BAD_STATE:"action is not permited from current state"},h={EVENT_PLAY:"play",EVENT_STOP:"stop",EVENT_PAUSE:"pause",EVENT_RESUME:"resume",EVENT_PROGRESS:"progress",EVENT_SEEKED:"seeked",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_LOADING:"loading",EVENT_LOADED:"loaded",EVENT_ENDED:"ended",EVENT_CRASHED:"crashed",EVENT_ERROR:"error",EVENT_STALLED:"stalled",EVENT_CANPLAY:"canplay",EVENT_PLAYING:"playing",HLS_EVENT_ERROR:"hlserror",EVENT_DESTROY:"destroy",EVENT_STATE:"state",EVENT_SWAP:"swap",STATE_INIT:"init",STATE_CRASHED:"crashed",STATE_IDLE:"idle",STATE_PLAYING:"playing",STATE_PAUSED:"paused"};var m=i(23681);let p={updateInterval:30,EMPTY_SOUND:"data:audio/mp3;base64,//uQZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAADAAAC2QBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA8TEFNRTMuOThyBK8AAAAAAAAAADQgJAimTQABzAAAAtmIVtmVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQZAAO4AAAf4AAAAgAAA/wAAABAoQDLmAAACBYgGYMAAAE+oH///////0WKFRVzjKnAmjp+XX9qP//////p0USaKtMwpjZNhNFyEM61QAAOAP////////nfSpMQU1FMy45OC4yqqr/+xBEDI/wAAB/gAAACAxgGaMAAAEAAAH+AAAAIAAAP8AAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/7EGQoD/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",EVENT_NATIVE_PLAY:"play",EVENT_NATIVE_PAUSE:"pause",EVENT_NATIVE_TIMEUPDATE:"timeupdate",EVENT_NATIVE_ENDED:"ended",EVENT_NATIVE_DURATION:"durationchange",EVENT_NATIVE_LOADING:"progress",EVENT_NATIVE_META:"loadedmetadata",EVENT_NATIVE_CANPLAY:"canplay",EVENT_NATIVE_PLAYING:"playing",EVENT_NATIVE_ERROR:"error",EVENT_NATIVE_STALLED:"stalled",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_SEEKED:"seeked",promiseLoadedEvents:["progress"],promisePlayingEvents:["timeupdate"],promiseMetadataEvents:["loadedmetadata","canplay"],loaderInteruptReasons:["load","stop","startPlay","play","destroy"]};class v{isOnlyDeviceVolume(){let e=!0;try{let t=document.createElement("audio");t.volume=.63,e=Math.abs(t.volume-.63)>.01}catch(t){e=!0}return e}parseParams(e){let t=e.split("?")[1];return t&&t.length?t.split("&").reduce(function(e,t){let i=t.split("="),a=i[0],o=i[1];return a&&o&&(e[a]=o),e},{}):{}}updateUrl(e,t){let i=this.parseParams(e),a="";for(let e in Object.assign(i,t),i)Object.prototype.hasOwnProperty.call(i,e)&&(a+=`${e}=${i[e]}`);return e+(a?`?${a}`:"")}getCookie(e){let t=document.cookie.split(";").reduce((e,t)=>{let[i,a]=t.trim().split("=");return i&&a?{...e,[i]:a}:e},{})[e];return t||""}}let E=1,f=()=>{let e=document.createElement("audio");return e.autoplay=!1,e.loop=!1,e.preload="auto",e.crossOrigin="anonymous",e};class _{audio=f();browser=new v;emitter;src="";position=0;lastGoodTime=0;lastUpdate=0;notLoading=!0;shouldUseHlsPlayer;shouldPause=!1;shouldPlay=!1;playing=!1;ended=!1;promiseMode=!1;isHlsTrack=!1;promises={};audioContext=null;loaderTimer=null;promiseCheckTO=null;retry=0;playerInitializationTime;clearInitListener=null;clearNativePauseListener=null;hls=null;isAutoplayable=!1;name=E++;whenReady;constructor(e,t){this.shouldUseHlsPlayer=e,this.playerInitializationTime=Date.now(),this.emitter=t,this.startupAudio=this.startupAudio.bind(this),this.updateProgress=this.updateProgress.bind(this),this.onNativeLoading=this.onNativeLoading.bind(this),this.onNativeEnded=this.onNativeEnded.bind(this),this.onNativeError=this.onNativeError.bind(this),this.onNativePause=this.onNativePause.bind(this),this.onNativePlay=this.onNativePlay.bind(this),this.onNativeSeeked=this.onNativeSeeked.bind(this),this.onNativeStalled=this.onNativeStalled.bind(this),this.onNativeCanplay=this.onNativeCanplay.bind(this),this.onNativePlaying=this.onNativePlaying.bind(this),this.onNativeVolumeChange=this.onNativeVolumeChange.bind(this),this.onNativeRatechange=this.onNativeRatechange.bind(this),this.whenReady=this.init()}updateProgress(){let e=Number(new Date);if(e-this.lastUpdate=this.audio.duration-.1&&this.emitter.emit(h.EVENT_LOADED)}}onNativeEnded(){this.ended=!0,this.playing=!1,this.shouldPause=!0,this.emitter.emit(h.EVENT_ENDED)}onNativeError(){this.src&&this.src!==p.EMPTY_SOUND&&(this.audio&&this.audio.error&&this.emitter.emit(h.EVENT_ERROR,this.audio.error),this.playing=!1)}onNativePause(){this.emitter.emit(h.EVENT_PAUSE),this.shouldPause=!1}onNativePlay(){this.emitter.emit(h.EVENT_PLAY),this.shouldPlay=!1}onNativeSeeked(){this.emitter.emit(h.EVENT_SEEKED)}onNativeStalled(){this.emitter.emit(h.EVENT_STALLED)}onNativeCanplay(){this.emitter.emit(h.EVENT_CANPLAY)}onNativePlaying(){this.playing&&this.emitter.emit(h.EVENT_PLAYING)}onNativeVolumeChange(){this.emitter.emit(h.EVENT_VOLUMECHANGE,this.volumeLevel)}onNativeRatechange(){this.emitter.emit(h.EVENT_RATECHANGE,this.playbackRate)}initUserEvents(){document.body.addEventListener("mousedown",this.startupAudio,!0),document.body.addEventListener("keydown",this.startupAudio,!0),document.body.addEventListener("touchstart",this.startupAudio,!0)}deinitUserEvents(){document.body.removeEventListener("mousedown",this.startupAudio,!0),document.body.removeEventListener("keydown",this.startupAudio,!0),document.body.removeEventListener("touchstart",this.startupAudio,!0)}initNativeEvents(){this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.addEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.addEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.addEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.addEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.addEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.addEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.addEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.addEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}deinitNativeEvents(){this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.removeEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.removeEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.removeEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.removeEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.removeEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.removeEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.removeEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}init(){return this.initEvents().then(()=>{this.shouldUseHlsPlayer&&this.initHls()})}initEvents(){return new Promise(e=>{this.initUserEvents(),this.initNativeEvents(),e()})}startupAudio(){this.audioContext&&this.audioContext.resume(),this.deinitUserEvents();let e=()=>{this.shouldPlay=!1,this.isAutoplayable=!0},t=e=>{this.shouldPlay=!1,console.info(`_startupAudio:failReason:${e||""}`)},i=()=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i)),this.promiseMode)return;let t=()=>{this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,t),e()};this.clearNativePauseListener=()=>{this.audio&&this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t)},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t),this.audio.pause(),this.shouldPause=!0)};this.clearInitListener=()=>{this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i))},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_META,i),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,i),this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{e(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,t("audio.play")}))}initAndCheckAutoplay(){return new Promise(e=>{let t=()=>{this.shouldPlay=!1,this.isAutoplayable=!0,e()},i=t=>{this.shouldPlay=!1,this.isAutoplayable=!1,console.info(this,`initAndCheckAutoplay:failReason:${t||""}`),e()},a=e=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_META,a),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,a)),this.promiseMode)return;if(e.type===p.EVENT_NATIVE_ERROR||e.type===p.EVENT_NATIVE_META){i(e.type);return}let o=e=>{if(e.type===p.EVENT_NATIVE_ERROR){i(e.type);return}this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,o),t()};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,o),this.audio.pause()),this.shouldPause=!0};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_META,a),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,a),this.audio.src=p.EMPTY_SOUND,this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{t(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,i("audio.play")}))})}breakStartup(e){this.deinitUserEvents(),this.clearInitListener&&this.clearInitListener(),this.clearNativePauseListener&&this.clearNativePauseListener(),console.warn("_startupAudio:interrupted",e)}waitFor(e,t,i){let a;let o=this.promises[e];if(o)a=o.promise();else{let o=()=>{},r=[new Promise((e,t)=>{o=t})],n={},l=e=>new Promise(i=>{let a=()=>{t()&&i()};this.audio&&(this.audio.addEventListener(e,a),n[e]=a)}),s=()=>{for(let e of Object.keys(n))if(this.audio){let t=n[e];t&&this.audio.removeEventListener(e,t)}};for(let e of i)r.push(l(e));let d=Promise.race(r);d.then(s).catch(s),this.promises[e]={promise:()=>d,reject:o},a=d}return a}cancelWait(e,t){let i;(i=this.promises[e])&&(delete this.promises[e],i.reject(t))}abortPromises(e){for(let t in this.promises)Object.prototype.hasOwnProperty.call(this.promises,t)&&this.cancelWait(t,e)}promiseMetadataCheck(){return!!this.audio&&this.audio.readyState>this.audio.HAVE_METADATA}promiseMetadata(){return this.waitFor("metadata",()=>this.promiseMetadataCheck(),p.promiseMetadataEvents)}promiseLoadedCheck(){if(this.loaderTimer?clearTimeout(this.loaderTimer):this.loaderTimer=setTimeout(()=>{this.cancelWait("loaded","timeout")},5e3),this.audio){let e=Math.min(this.position+45,this.audio.duration),t=this.audio.buffered.end(0)-this.audio.buffered.start(0);return 0!==this.audio.buffered.length&&t>=e}return!1}promiseLoaded(){let e=this.waitFor("loaded",()=>this.promiseLoadedCheck(),p.promiseLoadedEvents),t=()=>{this.loaderTimer&&clearTimeout(this.loaderTimer)};return e.then(t).catch(t),e}promisePlayingCheck(){if(this.audio){let e=Math.min(this.position+.2,this.audio.duration);return this.promiseCheckTO&&clearTimeout(this.promiseCheckTO),0!==this.audio.currentTime||this.audio.paused||(this.promiseCheckTO=setTimeout(()=>{this.audio&&0===this.audio.currentTime&&!this.audio.paused&&(this.audio.currentTime=1)},1e3)),this.audio.currentTime>=e}return!1}promisePlaying(){return this.waitFor("playing",()=>this.promisePlayingCheck(),p.promisePlayingEvents)}promiseStartPlaying(){let e,t=!1;if(this.promises.startPlaying)e=this.promises.startPlaying.promise();else{let i,a=()=>{},o=new Promise((e,o)=>{this.promisePlaying().then(()=>{t=!0,clearTimeout(i),e()}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),this.promiseLoaded().then(()=>{t||(i=setTimeout(()=>{o("timeout"),this.cancelWait("playing","timeout"),console.warn("startPlaying:failed")},5e3))}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),a=o});this.promises.startPlaying={promise:()=>o,reject:a},e=this.promises.startPlaying.promise()}return e}load(e){this.abortPromises("load"),this.breakStartup("load"),this.ended=!1,this.playing=!1,this.notLoading=!0,this.position=0,this.lastGoodTime=0,this.src=e,this.audio&&(/\.m3u8$/.test(e)?(this.isHlsTrack=!0,this.destroyHls(),this.initHls(),this.hls?.loadSource(this.getHlsPlayingEntityUrl(e))):(this.isHlsTrack=!1,this.audio.src=e),this.audio.load())}stop(){this.abortPromises("stop"),this.breakStartup("stop"),this.isHlsTrack&&this.destroyHls(),this.load("")}startPlay(){this.audio&&(this.audio.currentTime=this.position),this.playing&&(this.breakStartup("startPlay"),this.shouldPlay=!0,this.audio&&this.audio.play().catch(e=>{console.error(e)}),this.hls&&this.hls.startLoad(),this.promiseStartPlaying().then(()=>{this.retry=0}))}play(e){this.retry=0,this.loadMetadata(e)}loadMetadata(e){this.playing||(this.breakStartup("play"),this.ended=!1,this.playing=!0,null!=e&&(this.position=e),this.promiseMetadata().then(()=>this.startPlay()).catch(e=>{"string"==typeof e&&p.loaderInteruptReasons.includes(e)||console.error(e)}))}initHls(){this.hls||(this.hls=new m.ZP({liveDurationInfinity:!0,maxBufferSize:3e6}),this.audio&&this.hls.attachMedia(this.audio),this.initHlsEvents())}initHlsEvents(){this.hls&&(this.hls.on(m.ZP.Events.ERROR,(e,t)=>{if(t.fatal&&this.hls)switch(t.type){case m.ZP.ErrorTypes.NETWORK_ERROR:this.retry++,this.retry>2?(this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)):this.hls.startLoad();break;case m.ZP.ErrorTypes.MEDIA_ERROR:this.hls.recoverMediaError();break;default:this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)}}),this.hls.on(m.ZP.Events.DESTROYING,()=>{this.hls=null}))}getHlsPlayingEntityUrl(e){let t="";for(;t.length<44;)t+=(Math.random()+1).toString(36).substring(3);t=t.slice(0,44);let i=this.playerInitializationTime.toString().slice(0,10),a=`${t}xWEBx0001x${i}`;return this.browser.updateUrl(e,{vsid:a})}destroyHls(){this.retry=0,this.hls&&(this.hls.stopLoad(),this.hls.destroy(),this.hls=null)}pause(){this.shouldPause=!0,this.playing=!1,this.isHlsTrack&&this.hls&&this.hls.stopLoad(),this.audio&&(this.audio.pause(),this.position=this.audio.currentTime)}setPosition(e){if(!isFinite(e)){console.warn("setPositionFailed",e);return}this.position=e,this.promiseMetadata().then(()=>{this.audio&&(this.audio.currentTime=this.position)})}destroy(){this.audio&&(this.shouldPause=!0,this.audio.pause(),this.deinitNativeEvents()),this.abortPromises("destroy"),this.deinitUserEvents(),this.promises={}}get currentTime(){return this.audio?this.audio.currentTime:null}get duration(){return this.audio?this.audio.duration:null}get loaded(){let e;if(this.audio&&this.audio.buffered.length){let t=this.audio.buffered.length-1;e=this.audio.buffered.end(t)}else e=null;return e}get volumeLevel(){return this.audio?this.audio.volume:0}set volumeLevel(e){this.audio&&(this.audio.volume=e)}set defaultPlaybackRate(e){this.audio&&(this.audio.defaultPlaybackRate=e)}get playbackRate(){return this.audio?this.audio.playbackRate:1}set playbackRate(e){this.audio&&(this.audio.playbackRate=e)}get audioSrc(){return this.src}get audioNotLoading(){return this.notLoading}get autoplayable(){return this.isAutoplayable}}let y=1;class A{browser=new v;emitter;loader;name=y++;type="html5";whenReady;constructor(e,t){this.emitter=t,this.loader=new _(e,t),this.whenReady=this.loader.whenReady}get source(){return this.loader.audio}play(e,t){this.loader.load(e),this.loader.play(t)}setSrc(e,t){this.loader.load(e),this.loader.setPosition(t)}pause(){this.loader.pause()}resume(){this.loader.play()}stop(){this.loader.stop(),this.emitter.emit(h.EVENT_STOP)}destroy(){this.loader.destroy(),this.emitter.emit(h.EVENT_DESTROY)}getPosition(){return this.loader.currentTime}setPosition(e){this.loader.setPosition(e-.001)}getDuration(){return this.loader.duration}getLoaded(){return this.loader.loaded?this.loader.loaded:0}get volumeLevel(){return this.loader.volumeLevel}set volumeLevel(e){this.loader.volumeLevel=Math.min(1,e)}get speedLevel(){return this.loader.playbackRate}set speedLevel(e){this.loader.defaultPlaybackRate=e,this.loader.playbackRate=e}getSrc(){return""!==this.loader.audioSrc?this.loader.audioSrc:null}isDeviceVolume(){return this.browser.isOnlyDeviceVolume()}isAutoplayable(){return this.loader.autoplayable}}let P=1;class L{emitter=new u.v;played=0;lastSkip=0;playId=null;shouldUseHlsPlayer;implementation;promises={};name=P++;state=h.STATE_INIT;constructor(e=!1){this.shouldUseHlsPlayer=e,window.addEventListener("beforeunload",()=>this.onBeforeUnload(),!0),this.implementation=new A(this.shouldUseHlsPlayer,this.emitter),this.onAudioPlayerInit()}get source(){return this.implementation?.source}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}onAudioPlayerInit(){this.handleImplementationEvents(),this.setState(h.STATE_IDLE)}handleImplementationEvents(){this.emitter.on(h.EVENT_PLAY,()=>{this.implementationEventHandler(h.EVENT_PLAY)}),this.emitter.on(h.EVENT_ENDED,()=>{this.implementationEventHandler(h.EVENT_ENDED)}),this.emitter.on(h.EVENT_SWAP,()=>{this.implementationEventHandler(h.EVENT_SWAP)}),this.emitter.on(h.EVENT_STOP,()=>{this.implementationEventHandler(h.EVENT_STOP)}),this.emitter.on(h.EVENT_ERROR,()=>{this.implementationEventHandler(h.EVENT_ERROR)}),this.emitter.on(h.HLS_EVENT_ERROR,()=>{this.implementationEventHandler(h.HLS_EVENT_ERROR)}),this.emitter.on(h.EVENT_PAUSE,()=>{this.implementationEventHandler(h.EVENT_PAUSE)}),this.emitter.on(h.EVENT_CRASHED,()=>{this.implementationEventHandler(h.EVENT_CRASHED)})}implementationEventHandler(e){switch(e){case h.EVENT_PLAY:this.setState(h.STATE_PLAYING);break;case h.EVENT_ENDED:case h.EVENT_SWAP:case h.EVENT_STOP:case h.EVENT_ERROR:case h.HLS_EVENT_ERROR:this.setState(h.STATE_IDLE);break;case h.EVENT_PAUSE:this.setState(h.STATE_PAUSED);break;case h.EVENT_CRASHED:this.setState(h.STATE_CRASHED)}}onBeforeUnload(){"undefined"!=typeof window&&navigator&&1===navigator.maxTouchPoints||this.destroy()}setState(e){if(e===h.STATE_PAUSED&&this.state!==h.STATE_PLAYING)return;let t=this.state!==e;this.state=e,t&&this.emitter.emit(h.EVENT_STATE,e)}waitEvents(e,t,i){let a=()=>{},o=()=>{},r=new Promise((e,t)=>{a=e,o=t});this.promises[e]={promise:()=>r,reject:o};let n=()=>{for(let e of t)this.off(e,a);for(let e of i)this.off(e,o);delete this.promises[e]};for(let e of t)this.on(e,a);let l=e=>t=>{let i=t instanceof Error?t:new c(e);o(i)};for(let e of i)this.on(e,l(e));return r.then(n).catch(n),r}getState(){return this.state}getSrc(){return this.implementation?this.implementation.getSrc():null}play(e,t){this.played=0,this.lastSkip=0,this.generatePlayId(),this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PLAY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_PLAY),this.promises.whenStop&&this.promises.whenStop.reject(h.EVENT_PLAY);let i=this.waitEvents("whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]);return this.implementation&&this.implementation.play(e,t),i}setSrc(e,t){this.implementation&&this.implementation.setSrc(e,t)}restart(){return this.getDuration()?(this.generatePlayId(),this.setPosition(0),this.played=0,this.lastSkip=0,this.resume()):Promise.reject(new c(C.BAD_STATE))}stop(){let e;return this.implementation&&(this.implementation.stop(),Promise.resolve()),this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_STOP),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_STOP),e=this.promises.whenStop?this.promises.whenStop.promise():this.waitEvents("_whenStop",[h.EVENT_STOP],[h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.stop(),e}pause(){let e;return this.state!==h.STATE_PLAYING?Promise.reject(new c(C.BAD_STATE)):(this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PAUSE),e=this.promises.whenPause?this.promises.whenPause.promise():this.waitEvents("_whenPause",[h.EVENT_PAUSE],[h.EVENT_STOP,h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.pause(),e)}resume(){let e;return this.state!==h.STATE_PLAYING||this.promises.whenPause?this.state===h.STATE_IDLE||this.state===h.STATE_PAUSED||this.state===h.STATE_PLAYING?(this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_RESUME),e=this.promises.whenPlay?this.promises.whenPlay.promise():this.waitEvents("_whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.resume(),e.then(()=>{this.emitter.emit(h.EVENT_RESUME)})):Promise.reject(new c(C.BAD_STATE)):Promise.resolve()}destroy(){this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_DESTROY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_DESTROY),this.implementation&&this.implementation.destroy()}getPosition(){let e=null;return this.implementation&&(e=this.implementation.getPosition()),e||0}setPosition(e){return this.implementation&&this.implementation.setPosition(e),this.played+=this.getPosition()-this.lastSkip,this.lastSkip=e,e}getDuration(){let e=null;return this.implementation&&(e=this.implementation.getDuration()),null===e?0:e}getLoaded(){return this.implementation?this.implementation.getLoaded():0}getPlayed(){let e=this.getPosition();return this.played+=e-this.lastSkip,this.lastSkip=e,this.played}getVolume(){return this.implementation?this.implementation.volumeLevel:0}setVolume(e){let t=0;return this.implementation&&(this.implementation.volumeLevel=e,t=e),t}getSpeed(){return this.implementation?this.implementation.speedLevel:0}setSpeed(e){let t=0;return this.implementation&&(this.implementation.speedLevel=e,t=e),t}isDeviceVolume(){return!this.implementation||this.implementation.isDeviceVolume()}isAutoplayable(){let e=null;return this.implementation&&(e=this.implementation.isAutoplayable()),null!==e&&e}generatePlayId(){this.playId=Math.random().toString().slice(2)}getPlayId(){return this.playId}}class x{pauseHandlers=[];core=new L;get source(){return this.core.source}play(e,t){return this.core.play(e,t)}setSrc(e,t){this.core.setSrc(e,t)}setProgress(e){let t=this.core.setPosition(e);return Promise.resolve(t)}pause(){return this.core.pause()}resume(){return this.core.resume()}setVolume(e){let t=this.core.setVolume(e);return Promise.resolve(t)}setSpeed(e){let t=this.core.setSpeed(e);return Promise.resolve(t)}stop(){return this.core.stop()}onAudioEnd(e){this.core.on(h.EVENT_ENDED,e)}onAudioPaused(e){let t=()=>{"paused"===this.core.getState()&&e()};this.pauseHandlers.push({handler:t,originalCallback:e}),this.core.on(h.EVENT_STATE,t)}onAudioResume(e){this.core.on(h.EVENT_RESUME,e)}onAudioUpdatingProgress(e){this.core.on(h.EVENT_PROGRESS,e)}onAudioSeeked(e){this.core.on(h.EVENT_SEEKED,e)}onAudioStalled(e){this.core.on(h.EVENT_STALLED,e)}onAudioCanplay(e){this.core.on(h.EVENT_CANPLAY,e)}onAudioPlaying(e){this.core.on(h.EVENT_PLAYING,e)}onAudioError(e){this.core.on(h.EVENT_ERROR,e)}onAudioVolumeChange(e){this.core.on(h.EVENT_VOLUMECHANGE,e)}onAudioSpeedChange(e){this.core.on(h.EVENT_RATECHANGE,e)}offAudioEnd(e){this.core.off(h.EVENT_ENDED,e)}offAudioPaused(e){let t=this.pauseHandlers.find(t=>t.originalCallback===e);t&&this.core.off(h.EVENT_STATE,t.handler)}offAudioResume(e){this.core.off(h.EVENT_RESUME,e)}offAudioUpdatingProgress(e){this.core.off(h.EVENT_PROGRESS,e)}offAudioSeeked(e){this.core.off(h.EVENT_SEEKED,e)}offAudioStalled(e){this.core.off(h.EVENT_STALLED,e)}offAudioCanplay(e){this.core.off(h.EVENT_CANPLAY,e)}offAudioPlaying(e){this.core.off(h.EVENT_PLAYING,e)}offAudioError(e){this.core.off(h.EVENT_ERROR,e)}offAudioVolumeChange(e){this.core.off(h.EVENT_VOLUMECHANGE,e)}offAudioSpeedChange(e){this.core.off(h.EVENT_RATECHANGE,e)}}var b=i(57413),g=i(14408),N=i(68244);class V{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("ApplyContextPlugin",()=>{let e=i.state.currentContext.value;e&&e instanceof N.$n&&e.apply({hooks:t,playback:i})})}}let S=null;function T(e){let t=e.state.queueState.index.value,i=e.state.currentContext.value,a=void 0!==e.state.queueState.order.value[t-1];i&&(i.availableActions.moveBackward.value=a),null!==S&&(S(),S=null),0===t&&(S=e.state.playerState.progress.onChange(e=>{i&&(i.availableActions.moveBackward.value=!!e&&e.position>N.lz)}))}var w=i(34603);function R(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:a}=i.entity.data,o=(0,b.xA)(t)||(0,b.Q7)(t)||"type"in a&&a.type&&w.UE.includes(a.type);o?(t.availableActions.repeat.value=!1,t.availableActions.shuffle.value=!1,e.state.queueState.repeat.value!==N.zq.NONE&&e.setRepeatMode(N.zq.NONE),e.state.queueState.shuffle.value&&e.toggleShuffle()):(t.availableActions.repeat.value=!0,t.availableActions.shuffle.value=!0)}}let M=e=>{let t="albums"in e&&e.albums&&e.albums.length>0&&e.albums[0]&&e.albums[0].type===w.VZ.PODCAST,i="type"in e&&e.type===w.Vc.PODCAST;return!!(i||t)};function H(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:e}=i.entity.data,a=M(e);t.availableActions.speed.value=!!a}}class k{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),t.beforeMediaStartPlaying.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),i.state.queueState.entityList.onChange(()=>{T(i)}),i.state.queueState.index.onChange(()=>{T(i)})}}class j{apply(e){let{playback:t,hooks:i}=e;t.state.playerState.event.onChange(()=>{let{currentEntity:e}=t.state.queueState;if(e.value)switch(t.state.playerState.event.value){case N.KX.PAUSED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.PAUSED}`});break;case N.KX.STALLED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.STALLED}`});break;case N.KX.PLAYING:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:`event-${N.KX.PLAYING}`});break;case N.KX.MEDIA_ELEMENT_ERROR:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.MEDIA_ELEMENT_ERROR}`})}}),i.beforeEntityPlayingProcessStart.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.clearTimeStagesOfPlayback(),Promise.resolve()}),i.afterMediaStartPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:"hook-afterMediaStartPlaying"}),Promise.resolve()}),i.afterMediaEndPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-afterMediaEndPlaying"}),Promise.resolve()}),i.beforeEntityChange.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeEntityChange"}),Promise.resolve()}),i.beforeContextSet.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeContextSet"}),Promise.resolve()})}}var B=i(42503),Z=i(59899);function I(){let e=new Date;return e.toISOString()}function O(e){let t;let{contextEntityPair:i,totalPlayedSeconds:a,endPositionSeconds:o,type:r,maxPlayerStage:n}=e,{entity:l,context:s}=i,d=String(l.data.meta.id),u=function(e){let t;if("albums"in e.data.meta){let{data:{meta:{albums:i}}}=e;if(i){let e=i[0];e&&(t=String(e.id))}}return t}(l),c=0;"durationMs"in l.data.meta&&l.data.meta.durationMs&&(c=l.data.meta.durationMs/1e3);let C=a,h=o;.5>Math.abs(c-a)&&(C=c),.5>Math.abs(c-o)&&(h=c),t=(0,b.Q7)(s)?{generativeStreamId:String(s.data.meta.stream?.id)}:{trackId:d};let m={playId:l.playId,timestamp:I(),totalPlayedSeconds:C,endPositionSeconds:h,trackLengthSeconds:c,albumId:u,from:s.from,context:s.data.type,contextItem:String(s.data.meta.id),addTracksToPlayerTime:l.addTracksToPlayerTime,audioAuto:"none",audioOutputName:"Динамик",audioOutputType:"Speaker",maxPlayerStage:n,...t};if((0,b.xA)(s)&&s.data.meta.session&&(m.radioSessionId=s.data.meta.session.radioSessionId,m.context="radio",m.contextItem=s.data.meta.session.wave.stationId),(0,b.KT)(s)&&(m.playlistId=`${s.data.meta.uid}:${s.data.meta.kind}`,m.contextItem=`${s.data.meta.uid}:${s.data.meta.kind}`),(0,b.dt)(s)){let e=[b.Zc.Search,b.Zc.Other],t=s.data.overrideContextType??b.Zc.Other;m.context=t,e.includes(t)&&(m.contextItem=null)}return{type:r,isSent:!1,data:m}}(a=r||(r={})).START="start",a.END="end";var q=i(63278);class D extends q.y{name="PlaysException";constructor(e,{code:t="E_PLAYS",...i}={}){super(e,{code:t,...i}),Object.setPrototypeOf(this,D.prototype)}}class U{entityPlaysMap={};playerStageByEntitiesPlayId=new Map;playsResource;variables;constructor(e){let{httpClient:t,playsResourceConfig:i,variables:a}=e;this.playsResource=new w.ol(t,i),this.variables=a||{}}apply(e){let{hooks:t,playback:i}=e;i.state.playerState.event.onChange(()=>{let{currentEntity:e}=i.state.queueState;e.value&&i.state.playerState.event.value===N.KX.PLAYING&&this.changePlayerStageByPlayId({playId:e.value.entity.playId,stage:w.KZ.PLAY})}),t.beforeEntityPlayingProcessStart.tapPromise("PlaysPlugin",()=>new Promise(e=>{this.sendStartEntityPlay(i,t),e()})),t.afterMediaEndPlaying.tapPromise("PlaysPlugin",()=>new Promise(e=>{let{index:{value:a},entityList:{value:o},repeat:{value:r}}=i.state.queueState;(a===o.length-1||r===N.zq.ONE)&&this.sendEndEntityPlay(i,t),e()})),t.afterError.tapPromise("PlaysPlugin",e=>((e instanceof Z.Tb||e instanceof N.YR)&&this.sendEndEntityPlay(i,t),Promise.resolve())),t.beforeContextSet.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()})),t.beforeEntityChange.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()}))}sendStartEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a){a.entity.playId=(0,B.Z)(),a.entity.addTracksToPlayerTime=`${Math.random().toString().slice(2)}-${Math.ceil(Number(new Date)/1e3)}`;let o=O({type:r.START,contextEntityPair:a,totalPlayedSeconds:0,endPositionSeconds:0});this.saveEntityPlay(o),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!0,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.variables.disableSendPlaysOnTrackStart?i():this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}sendEndEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a&&!(0,b.Q7)(a.context)){let o,n;let{entity:l}=a,s=this.entityPlaysMap[l.playId],d=!1;if(s&&(d=!!s.find(e=>e.type===r.END)),d){i();return}let u=a.entity.totalPlayedSeconds;this.variables.enableSendMaxPlayerStage&&(n=this.playerStageByEntitiesPlayId.get(l.playId)||w.KZ.PREPARE),o=0===u?O({type:r.END,contextEntityPair:a,totalPlayedSeconds:.1,endPositionSeconds:.1,maxPlayerStage:n}):O({type:r.END,contextEntityPair:a,totalPlayedSeconds:u,endPositionSeconds:e.state.playerState.progress.value.position,maxPlayerStage:n}),this.saveEntityPlay(o),this.playerStageByEntitiesPlayId.delete(o.data.playId),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!1,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}saveEntityPlay(e){let t=this.entityPlaysMap[e.data.playId];void 0===t?this.entityPlaysMap[e.data.playId]=[e]:t.push(e)}changePlayerStageByPlayId({playId:e,stage:t}){this.playerStageByEntitiesPlayId.set(e,t)}}(o=n||(n={})).PLAY="play",o.PAUSE="pause",o.NEXT="nexttrack",o.PREV="previoustrack",o.SEEK="seekto",o.STOP="stop";let z=[40,50,80,100,200,300,400],F=[n.PLAY,n.PAUSE,n.STOP,n.SEEK];class W{browserName;browserVersion;constructor({browserName:e,browserVersion:t}){this.browserName=e,this.browserVersion=t}isSupported(){return"mediaSession"in window.navigator&&"MediaMetadata"in window}handleMediaActionEvents(e,t){let{action:i}=e;switch(i){case n.PLAY:t.resume();break;case n.PAUSE:case n.STOP:t.pause();break;case n.NEXT:t.moveForward();break;case n.PREV:t.moveBackward();break;case n.SEEK:{if((0,g.OX)(t.state.queueState.currentEntity.value?.entity))return;let{seekTime:i}=e;i&&t.setProgress(i)}}}prepareMetadata(e){let t,i;let a={title:e.title};if("artists"in e){let t=(e.artists||[]).map(e=>e.name).join(", ");a.artist=t}if("albums"in e){let t=e.albums?.[0]?.title;a.album=t}return"coverUri"in e&&(t=e.coverUri),"imageUrl"in e&&(t=e.imageUrl),t&&(i=z.map(e=>{let i=`${e}x${e}`;return"Safari"===this.browserName&&(i=`${2*e}x${2*e}`),{sizes:i,src:`https://${t.replace("%%",i)}`,type:"image/jpg"}})),a.artwork=i,a}updateMetadata(e){if(!e)return;let t=this.prepareMetadata(e);window.navigator.mediaSession.metadata=new MediaMetadata(t)}handlePlayerEvents(e){let t,i;e.state.playerState.event.onChange(()=>{(e.state.playerState.event.value===N.KX.START||e.state.playerState.event.value===N.KX.UPDATING_PROGRESS)&&(this.updateMetadata(e.state.queueState.currentEntity.value?.entity.data.meta),(0,g.OX)(e.state.queueState.currentEntity.value?.entity)?navigator.mediaSession.setPositionState({duration:0,position:0}):navigator.mediaSession.setPositionState(),F.forEach(t=>{try{window.navigator.mediaSession.setActionHandler(t,t=>this.handleMediaActionEvents(t,e))}catch{console.log(`The media session action "${t}" is not supported yet.`)}}))}),e.state.currentContext.onChange(()=>{t?.(),i?.(),t=e.state.currentContext.value?.availableActions.moveBackward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveBackward.value??!1;window.navigator.mediaSession.setActionHandler(n.PREV,t?t=>this.handleMediaActionEvents(t,e):null)}),i=e.state.currentContext.value?.availableActions.moveForward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveForward.value??!1;window.navigator.mediaSession.setActionHandler(n.NEXT,t?t=>this.handleMediaActionEvents(t,e):null)})})}apply(e){let{playback:t}=e;this.isSupported()&&this.handlePlayerEvents(t)}}class Y{logger;constructor(e){let{logger:t}=e;this.logger=t}apply(e){let{hooks:t,playback:i}=e;t.afterError.tapPromise("LoggerPlugin",e=>{let t;let a=i.state.queueState.currentEntity.value?i.state.queueState.currentEntity.value.entity.mediaSource:null;return(t=e instanceof q.y?e:new q.y("Error in Sonata player",{code:"E_SONATA",cause:e})).name=`[Sonata] ${t.name}`,this.logger.error(t,{...t.data,...a||{},code:t.code,cause:t.cause,stack:t.stack}),Promise.resolve()})}}let G=[b.Ak.Album,b.Ak.Artist,b.Ak.Playlist,b.Ak.Various],K=(e,t)=>{let i=e.state.currentContext.value?.data;if(!i)return"";let a=i.type,o=e.state.queueState.entityList.value.length||0;return a===b.Ak.Various&&1===o&&(a="track"),i.type===b.Ak.Various&&i.overrideContextType&&(a=i.overrideContextType),`${t}-radio-${a}-autoflow`},J=e=>{let t=e.state.currentContext.value?.data;if(t){if(t.type===b.Ak.Album)return[`album:${t.meta.id}`];if(t.type===b.Ak.Artist)return[`artist:${t.meta.id}`];if(t.type===b.Ak.Playlist&&t.meta.owner?.uid&&t.meta.kind)return[`playlist:${t.meta.owner?.uid}_${t.meta.kind}`];if(t.type===b.Ak.Various){if(t.overrideAutoflowSeeds)return t.overrideAutoflowSeeds;let i=e.state.queueState.currentEntity.value?.entity.data.meta.id;return[`track:${i}`]}}};class ${contextFactory;platform;constructor({contextFactory:e,platform:t}){this.contextFactory=e,this.platform=t}apply(e){let{playback:t,hooks:i}=e;i.afterContextEnd.tapPromise("AutoflowPlugin",()=>{let e=t.state.currentContext.value?.data.type;return e&&G.includes(e)&&this.playAutoflow(t),Promise.resolve()})}playAutoflow(e){let t=e.state.currentContext.value?.data.type,i=J(e);if(!(t&&i))return;let a=this.contextFactory.create({data:{type:b.Ak.Vibe,meta:{id:b.Ak.Vibe},seeds:i,from:K(e,this.platform),includeTracksInResponse:!0}});e.playContext({context:a,loadContextMeta:!0})}}class X{quality;constructor(e){this.quality=e}apply(e){let{playback:t,hooks:i}=e;this.quality.onChange(()=>{t.state.playerState.status.value!==N.Xz.IDLE&&t.reloadEntity().catch(e=>{i.afterError.promise(e)})})}}class Q{streamsResource;timeoutId=0;constructor(e){let{httpClient:t,streamsResourceConfig:i}=e;this.streamsResource=new w.hd(t,i)}apply(e){let{hooks:t,playback:i}=e;t.beforeEntityChange.tapPromise("ContinuePlayingPlugin",()=>{let{position:e,duration:t}=this.getTimingsFromPlayback(i);return new Promise(a=>{e!==t&&this.checkBeforeProgressSync(i),a()})}),i.state.playerState.status.onChange(e=>{let{position:t,duration:a}=this.getTimingsFromPlayback(i);if(e===N.Xz.PAUSED||e===N.Xz.STOPPED){if(e===N.Xz.PAUSED&&t===a)return;this.clearTimeout(),this.checkBeforeProgressSync(i)}e===N.Xz.PLAYING&&this.shouldSendProgressSync(i)&&this.setTimeout(i)})}checkBeforeProgressSync(e){if(this.clearTimeout(),!this.shouldSendProgressSync(e))return;let{position:t,duration:i}=this.getTimingsFromPlayback(e),a=e.state.queueState.currentEntity.value?.entity.data.meta.id;Number.isFinite(i)&&Number.isFinite(t)&&i&&t&&a&&(this.sendProgressSync({duration:i,position:t,trackId:a}),e.state.playerState.status.value===N.Xz.PLAYING&&this.setTimeout(e))}sendProgressSync(e){let t=new Date().toISOString(),{duration:i,position:a,trackId:o}=e;this.streamsResource.progressSync({lastSyncTimestamp:t,trackStreams:[{trackId:o,positionSec:a,trackLengthSec:i,finished:a===i,timestamp:t}]})}shouldSendProgressSync(e){let t=e.state.queueState.currentEntity.value?.entity.data.meta;return!!(t&&"rememberPosition"in t&&t.rememberPosition)}setTimeout(e){this.clearTimeout(),this.timeoutId=window.setTimeout(()=>{this.checkBeforeProgressSync(e)},18e4)}clearTimeout(){window.clearTimeout(this.timeoutId)}getTimingsFromPlayback(e){return{duration:Math.floor(e.state.playerState.progress.value.duration),position:Math.floor(e.state.playerState.progress.value.position)}}}var ee=i(45412),et=i(86502),ei=i(66026),ea=i(57921),eo=i(69559),er=i(68085),en=i(5674);let el=null,es=null,ed=null,eu=(0,s.Pi)(e=>{let{children:t,hostTld:i,userAgent:a,quality:o}=e,r=(0,en.uK)(),{sonataState:n,experiments:s,library:u,user:c}=(0,en.oR)(),C=(0,en.wL)(),h=r.get(en.V0),{language:m}=(0,en.ZS)(),p=(0,d.useMemo)(()=>(el||(el=new Z.$J(o)),el),[o]),v=(0,d.useMemo)(()=>{if(es)return es;let e=r.get(en.U5),t=r.get(en.pI),o=t({credentials:"include"}),n=r.get(en.xi),{resources:l,player:{gateway:{prefixUrl:d,headers:c}}}=e,{timeouts:h,retryPolicyConfig:v}=l.musicExternalApi,E=new b.Tg({httpClient:o,logger:C,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,resourceTimeoutsConfig:h,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},contextVariables:{vibe:{get sendFeedbackToSessionTracks(){return s.checkExperiment(en.pe.WebNextWaveNewFeedbacks,"on")}}}}}),f=new g.nS({likeStore:u}),{overembed:_,externalDomain:y,...A}={params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},overembed:e.player.overembed,externalDomain:e.player.externalDomain},P=new Z.Ez({downloadInfoProviderParams:{httpClient:o,resourceConfig:{...A,overembed:_,externalDomain:y},secretKey:e.player.secretKey,mediaConfigController:p},getFileInfoProviderParams:{httpClient:o,resourceConfig:A,secretKey:e.player.secretKey,mediaConfigController:p,transport:w.J7.RAW,variables:{get useNewCorrespondenceBetweenQualityParams(){return s.checkExperiment(en.pe.WebNextEnableNewQuality,"on")}}},variables:{get switchToStrmWithoutEncrypt(){return s.checkExperiment(en.pe.WebNextSwitchToStrmWithoutEncrypt,"on")}}}),L=new Z.sd({httpClient:o,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}}),N=new x;return es=new et.$7({contextFactory:E,entityFactory:f,audioCore:N,mediaProvider:P,entityProvider:L,windowPaginationConfig:{windowSize:30,setupQueueWindowSize:80},config:{mediaElementErrorReloadCount:2},plugins:[new k,new V,new j,new U({httpClient:o,playsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}},variables:{get disableSendPlaysOnTrackStart(){return s.checkExperiment(en.pe.WebNextDisableSendPlaysOnTrackStart,"on")},get enableSendMaxPlayerStage(){return s.checkExperiment(en.pe.WebPlayAudioSendPrepare,"on")}}}),new W({browserName:a.browserName,browserVersion:a.browserVersion}),new Y({logger:C}),new $({contextFactory:E,platform:"desktop"}),new X(p.quality),new Q({httpClient:o,streamsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}})]})},[s,r,C,i,p,a.browserName,a.browserVersion,m,u]),E=(0,d.useMemo)(()=>(ed||(null==v?void 0:v.source)&&(ed="Safari"===a.browserName?new ei.Qz:new ei.WZ(v.source)),ed),[null==v?void 0:v.source,a.browserName]);v&&(0,ea.A4)(v),(0,d.useEffect)(()=>{let e,t,i,a,o;let r=null==v?void 0:v.state.queueState.currentEntity.onChange(e=>{var t;let i=null==e?void 0:e.context.data.type,a=null==e?void 0:e.context.data.meta.id;n.setEntityMeta(null!==(t=null==e?void 0:e.entity)&&void 0!==t?t:null),i&&n.setContextType(i),a&&n.setContextId(a)}),l=null==v?void 0:v.state.queueState.order.onChange(e=>{let t=v.state.queueState.index.value;if(e){let i=e[t];v.state.queueState.order.value.length>0&&"number"==typeof i&&n.setCurrentlyPlayingTrackIndex(i)}}),s=null==v?void 0:v.state.playerState.status.onChange(e=>{e&&(n.setStatus(e),(0,ea.Pt)({isPlaying:e===et.Xz.PLAYING}))}),d=null==v?void 0:v.state.currentContext.onChange(()=>{var r,l,s,d,u,c,C,m,p,E,f;null===(r=e)||void 0===r||r(),null===(l=t)||void 0===l||l(),null===(s=i)||void 0===s||s(),null===(d=a)||void 0===d||d(),null===(u=o)||void 0===u||u();let _=null!==(f=h.get(en.BU.YmPlayerRepeatMode))&&void 0!==f?f:ee.zq.NONE;v.setRepeatMode(_);let y=!!h.get(en.BU.YmPlayerShuffle);v.setShuffle(y),e=null==v?void 0:null===(c=v.state.currentContext.value)||void 0===c?void 0:c.availableActions.moveBackward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value);n.setCanMoveBackward(t),(0,ea.Pt)({canMoveBackward:t})}),t=null==v?void 0:null===(C=v.state.currentContext.value)||void 0===C?void 0:C.availableActions.moveForward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value);n.setCanMoveForward(t),(0,ea.Pt)({canMoveForward:t})}),i=null==v?void 0:null===(m=v.state.currentContext.value)||void 0===m?void 0:m.availableActions.repeat.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.repeat.value;"boolean"==typeof t&&n.setCanChangeRepeatMode(t)}),a=null==v?void 0:null===(p=v.state.currentContext.value)||void 0===p?void 0:p.availableActions.shuffle.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.shuffle.value;"boolean"==typeof t&&n.setCanShuffle(t)}),o=null==v?void 0:null===(E=v.state.currentContext.value)||void 0===E?void 0:E.availableActions.speed.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.speed.value;"boolean"==typeof t&&(n.setCanSpeed(t),!t&&v&&v.setSpeed(1))})}),u=null==v?void 0:v.state.playerState.volume.onChange(()=>{let e=v.state.playerState.volume.value;"number"==typeof e&&n.setVolume(e)}),c=null==v?void 0:v.state.queueState.repeat.onChange(()=>{let e=v.state.queueState.repeat.value;n.setRepeatMode(e),h.set(en.BU.YmPlayerRepeatMode,e)}),C=null==v?void 0:v.state.queueState.shuffle.onChange(()=>{let e=v.state.queueState.shuffle.value;n.setShuffle(e),h.set(en.BU.YmPlayerShuffle,e)});return()=>{null==r||r(),null==l||l(),null==s||s(),null==d||d(),null==u||u(),null==c||c(),null==C||C()}},[v,n,h]),(0,d.useEffect)(()=>{let e=h.get(en.BU.YmPlayerVolume);"number"==typeof e?(null==v||v.setVolume(e),n.setVolume(e)):(null==v||v.setVolume(1),n.setVolume(1))},[h,v,n]);let f=(0,d.useMemo)(()=>{let e=s.checkExperiment(en.pe.WebNextEnableNewQuality,"on");if(!c.hasPlus)return Z.nJ.PREVIEW;let t=h.get(en.BU.YmPlayerQuality);return(e||t!==Z.nJ.HQ_PLUS)&&t||(h.set(en.BU.YmPlayerQuality,Z.nJ.HQ),Z.nJ.HQ)},[s,c.hasPlus,h]);return(0,d.useEffect)(()=>{p.setQuality(f),n.setQuality(f)},[p,n,f]),(0,l.jsx)(en.Xe.Provider,{value:p,children:(0,l.jsx)(en.R8.Provider,{value:v,children:(0,l.jsx)(eo.y5.Provider,{value:E,children:t})})})})},42622:function(e,t,i){"use strict";i.r(t),i.d(t,{ThemeProvider:function(){return n}});var a=i(8759),o=i(99616),r=i(5674);let n=e=>{let{children:t}=e,i=(0,r.uK)(),n=i.get(r.V0),l=(0,r.oz)(),[s,d]=(0,o.useState)((0,r.NK)(n.get(r.BU.Theme),l));(0,o.useEffect)(()=>{(0,r.kz)(n.get(r.BU.Theme))},[n]),(0,o.useEffect)(()=>{n.get(r.BU.Theme)===r.rL&&d(l)},[l,n]);let u=(0,o.useMemo)(()=>({theme:s,setTheme:d}),[s]);return(0,a.jsx)(r.Ni.Provider,{value:u,children:t})}},19976:function(e,t,i){"use strict";i.r(t),i.d(t,{TranslationsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(17516),n=i(28151),l=i(5674);let s=e=>{let{children:t}=e,{dictionary:i,language:s,defaultLanguage:d}=(0,l.ZS)(),u=(0,l.wL)(),c=(0,o.useCallback)(e=>{if("code"in e&&e.code===r.bc.MISSING_DATA)return;let t=e&&"object"==typeof e&&"code"in e&&e.code,i="IntlProviderError";t&&(i+=":".concat(t)),u.error(i,{error:null==e?void 0:e.message,stack:null==e?void 0:e.stack})},[u]);return(0,a.jsx)(n.Z,{onError:c,defaultLocale:d,locale:s,messages:i,children:t})}},98125:function(e,t,i){"use strict";i.d(t,{F:function(){return v},K:function(){return h}});var a=i(8759),o=i(35338),r=i(33423),n=i(99616),l=i(65244),s=i(454),d=i(15527),u=i(14581),c=i(22926),C=i(5674);let h=()=>{let e=(0,C.uK)(),t=e.get(C.V0),i=(0,C.R$)();return(0,n.useCallback)(async e=>{var a;if(0!==e)t.set(C.BU.YmPlayerPrevVolume,e),await (null==i?void 0:i.setVolume(0)),t.set(C.BU.YmPlayerVolume,0);else{let e=null!==(a=t.get(C.BU.YmPlayerPrevVolume))&&void 0!==a?a:1;t.remove(C.BU.YmPlayerPrevVolume),await (null==i?void 0:i.setVolume(e)),t.set(C.BU.YmPlayerVolume,e)}},[i,t])};var m=i(73939),p=i.n(m);let v=(0,r.Pi)(e=>{var t,i;let{className:r}=e,{formatMessage:m}=(0,l.Z)(),v=(0,C.uK)(),E=(0,C.R$)(),{sonataState:f}=(0,C.oR)(),_=h(),y=v.get(C.V0),A=null!==(i=null!==(t=y.get(C.BU.YmPlayerVolume))&&void 0!==t?t:f.volume)&&void 0!==i?i:1,P=(0,n.useCallback)(e=>{null==E||E.setVolume(e),y.set(C.BU.YmPlayerVolume,e)},[E,y]),L=(0,n.useCallback)(async()=>{await _(f.volume)},[_,f.volume]),x=m(0===f.volume?{id:"player-actions.volume-on"}:{id:"player-actions.volume-off"});return(0,a.jsxs)("div",{className:(0,o.W)(p().root,r),children:[(0,a.jsx)(d.z,{radius:"round",size:"xxxs",variant:"text",withRipple:!1,onClick:L,"aria-label":x,icon:(0,a.jsx)(u.J,{size:"xs",className:p().icon,variant:0===A?"volumeOff":"volume"}),className:p().button,...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_BUTTON)}),(0,a.jsx)(c.i,{thumbSize:"s",trackSize:"s",value:A,maxValue:1,step:.01,onChange:P,"aria-label":m({id:"player-actions.volume-control"}),...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_SLIDER)})]})})},65151:function(e,t,i){"use strict";i.d(t,{t:function(){return s}});var a=i(8759),o=i(99616),r=i(45412),n=i(5674),l=i(34512);let s=()=>{let{notify:e}=(0,n.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,n.oR)(),s=(0,n.R$)();return(0,o.useCallback)(()=>{if(null===t.entityMeta||!t.canChangeRepeatMode)return;let o=r.zq.NONE;switch(t.repeatMode){case r.zq.NONE:o=r.zq.CONTEXT;break;case r.zq.CONTEXT:o=r.zq.ONE}null==s||s.setRepeatMode(o),e((0,a.jsx)(l.NotificationRepeat,{repeatMode:o}),{containerId:i.isOpened?n.W$.FULLSCREEN_INFO:n.W$.INFO})},[i.isOpened,e,s,t.canChangeRepeatMode,t.entityMeta,t.repeatMode])}},37960:function(e,t,i){"use strict";i.d(t,{m:function(){return l}});var a=i(8759),o=i(99616),r=i(5674),n=i(74758);let l=()=>{let{notify:e}=(0,r.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,r.oR)(),l=(0,r.R$)();return(0,o.useCallback)(()=>{null!==t.entityMeta&&t.canShuffle&&(null==l||l.toggleShuffle(),e((0,a.jsx)(n.NotificationShuffle,{shuffle:!!(null==l?void 0:l.state.queueState.shuffle.value)}),{containerId:i.isOpened?r.W$.FULLSCREEN_INFO:r.W$.INFO}))},[i.isOpened,e,l,t.canShuffle,t.entityMeta])}},34512:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationRepeat:function(){return h}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(45412),s=i(14581),d=i(1918),u=i(44285),c=i(55075),C=i.n(c);let h=e=>{let{repeatMode:t,closeToast:i}=e,c=t===l.zq.ONE?"repeat_one":"repeat",h=(0,r.useMemo)(()=>{let e;switch(t){case l.zq.CONTEXT:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-context"});break;case l.zq.ONE:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-track"});break;case l.zq.NONE:default:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-none"})}return(0,a.jsx)(d.Caption,{className:C().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(u.Yj,{cover:(0,a.jsx)(s.J,{className:(0,o.W)(C().icon,{[C().icon_unset]:t===l.zq.NONE}),size:"xs",variant:c}),message:h,closeToast:i})}},74758:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationShuffle:function(){return C}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(14581),s=i(1918),d=i(44285),u=i(46520),c=i.n(u);let C=e=>{let{shuffle:t,closeToast:i}=e,u=(0,r.useMemo)(()=>{let e;return e=t?(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-enabled"}):(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-disabled"}),(0,a.jsx)(s.Caption,{className:c().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(d.Yj,{cover:(0,a.jsx)(l.J,{className:(0,o.W)(c().icon,{[c().icon_unset]:!t}),size:"xs",variant:"shuffle"}),message:u,closeToast:i})}},6769:function(e,t,i){"use strict";i.r(t),i.d(t,{RepeatButton:function(){return m}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(45412),s=i(15527),d=i(14581),u=i(65151),c=i(20873),C=i.n(c);let h=(e,t,i)=>t(e===l.zq.NONE||i?{id:"player-actions.repeat"}:e===l.zq.ONE?{id:"player-actions.repeat-one"}:{id:"player-actions.repeat-context"}),m=e=>{let{isDisabled:t,repeatMode:i,className:c,iconClassName:m,size:p="xxxs",iconSize:v="xs",color:E,variant:f="default"}=e,_=(0,u.t)(),{formatMessage:y}=(0,r.Z)(),A=t||i!==l.zq.ONE?"repeat":"repeat_one",P=h(i,y,t);return(0,a.jsx)(s.z,{className:c,radius:"round",size:p,variant:f,color:E,disabled:t,withRipple:!1,"aria-label":P,"aria-pressed":!t&&i!==l.zq.NONE,onClick:_,icon:(0,a.jsx)(d.J,{size:v,variant:A,className:(0,o.W)(C().repeatIcon,C()["repeatIcon_".concat(i)],{[C().repeatIcon_disabled]:t},m)}),...(0,n.BA)(n.bG.sonata.REPEAT_BUTTON)})}},66403:function(e,t,i){"use strict";i.r(t),i.d(t,{ShuffleButton:function(){return C}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(15527),s=i(14581),d=i(37960),u=i(94406),c=i.n(u);let C=e=>{let{isDisabled:t,shuffle:i,className:u,size:C="xxxs",variant:h="default",iconSize:m="xs",color:p}=e,v=(0,d.m)(),{formatMessage:E}=(0,r.Z)();return(0,a.jsx)(l.z,{className:u,radius:"round",size:C,variant:h,color:p,withRipple:!1,disabled:t,"aria-label":E({id:"player-actions.shuffle"}),"aria-pressed":!t&&i,icon:(0,a.jsx)(s.J,{variant:"shuffle",size:m,className:(0,o.W)(c().shuffleIcon,{[c().shuffleIcon_disabled]:t,[c().shuffleIcon_on]:!t&&i,[c().shuffleIcon_off]:!t&&!i})}),onClick:v,...(0,n.BA)(n.bG.sonata.SHUFFLE_BUTTON)})}},21871:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataControls:function(){return w}});var a=i(8759),o=i(33423),r=i(99616),n=i(86502),l=i(5674),s=i(65151),d=i(37960),u=i(35338),c=i(65244),C=i(454),h=i(15527),m=i(14581),p=i(44285),v=i(6769),E=i(66403),f=i(19035),_=i.n(f);let y=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,shuffle:s,onClickNext:d,onClickPrev:f,onClickPlayPause:y,canChangeRepeatMode:A,className:P}=e,{formatMessage:L}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(_().root,P),children:[(0,a.jsx)("div",{className:_().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:_().sonataButton,size:"xxxs",variant:"text",iconSize:"xs",isDisabled:t,shuffle:s})}),(0,a.jsxs)("div",{className:_().sonataButtons,children:[(0,a.jsx)(h.z,{className:_().sonataButton,variant:"text",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":L({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:f,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:_().sonataButton,iconSize:"l",variant:"filled",isPlaying:i,iconClassName:_().playButtonIcon,onClick:y}),(0,a.jsx)(h.z,{className:_().sonataButton,radius:"round",size:"m",variant:"text",disabled:!r,withRipple:!1,"aria-label":L({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:d,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:_().buttonContainer,children:(t||A)&&(0,a.jsx)(v.RepeatButton,{className:_().sonataButton,size:"xxxs",variant:"text",isDisabled:t,iconSize:"xs",repeatMode:o})})]})});var A=i(57004);let P=e=>{let{disabled:t,isPlaying:i,onClickPlayPause:o,className:r}=e;return(0,a.jsx)(A.PlayButton,{className:r,size:"s",disabled:t,isPlaying:i,onClick:o})};var L=i(24516),x=i.n(L);let b=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,onClickNext:s,onClickPrev:d,onClickPlayPause:f,canChangeRepeatMode:_,shuffle:y,className:A}=e,{formatMessage:P}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(x().root,A),children:[(0,a.jsx)("div",{className:x().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:x().sonataButton,size:"s",iconSize:"xxs",color:"secondary",isDisabled:t,shuffle:y})}),(0,a.jsxs)("div",{className:x().sonataButtons,children:[(0,a.jsx)(h.z,{className:x().sonataButton,color:"secondary",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":P({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:d,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:x().sonataButton,iconSize:"m",size:"l",radius:"round",color:"secondary",buttonVariant:"default",isPlaying:i,iconClassName:x().playPauseButtonIcon,onClick:f}),(0,a.jsx)(h.z,{className:x().sonataButton,radius:"round",size:"m",color:"secondary",disabled:!r,withRipple:!1,"aria-label":P({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:s,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:x().buttonContainer,children:(t||_)&&(0,a.jsx)(v.RepeatButton,{className:x().sonataButton,size:"s",color:"secondary",isDisabled:t,iconSize:"xxs",repeatMode:o})})]})});var g=i(57413),N=i(43310),V=i(3273),S=i.n(V);let T=(0,o.Pi)(e=>{let{isPlaying:t,canMoveForward:i,canMoveBackward:o,onClickNext:n,onClickPrev:s,onClickPlayPause:d,className:C}=e,{formatMessage:v}=(0,c.Z)(),{user:E,sonataState:f}=(0,l.oR)(),_=(0,l.XU)(),y=f.entityMeta,A=f.contextType===g.Ak.Generative,P=E.isAuthorized&&!A,L=(0,N.SB)(f.entityMeta),x=(0,N.KX)(f.entityMeta);return(0,r.useEffect)(()=>{if(!f.isGenerativeContext)return null==_||_.addShortcutsListener(l.yx.LIKE,L),null==_||_.addShortcutsListener(l.yx.DISLIKE,x),()=>{null==_||_.removeShortcutsListener(l.yx.LIKE),null==_||_.removeShortcutsListener(l.yx.DISLIKE)}},[x,L,_,f.isGenerativeContext]),(0,a.jsxs)("div",{className:(0,u.W)(S().root,C),children:[(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.Q1,{isDisliked:y.isDisliked,onClick:x})}),(0,a.jsxs)("div",{className:S().sonataButtons,children:[(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",color:"secondary",size:"m",radius:"round",disabled:!o,withRipple:!1,"aria-label":v({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:s}),(0,a.jsx)(p.JM,{className:S().sonataButton,iconSize:"xxl",variant:"filled",color:"secondary",isPlaying:t,iconClassName:S().playPauseButtonIcon,onClick:d}),(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",radius:"round",size:"m",color:"secondary",disabled:!i,withRipple:!1,"aria-label":v({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:n})]}),(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.dJ,{isLiked:y.isLiked,onClick:L})})]})}),w=(0,o.Pi)(e=>{var t,i;let{isMobile:o,entityMeta:u,isFullscreen:c,className:C}=e,{sonataState:h,vibe:m}=(0,l.oR)(),p=(0,l.XU)(),v=(0,l.R$)(),{togglePlay:E}=(0,l.Qh)({seeds:null!==(i=null===(t=m.meta)||void 0===t?void 0:t.seeds)&&void 0!==i?i:[],pageIdForFrom:l.Rh.HOME,blockIdForFrom:l.BE.RUP_MAIN_RADIO}),f=(0,r.useMemo)(()=>{let e=[n.Xz.PLAYING,n.Xz.LOADING_MEDIA_SOURCE,n.Xz.LOADING_MEDIA_DATA];return e.includes(h.status)},[h.status]),_=(0,r.useCallback)(()=>{u?null==v||v.togglePause():E()},[u,v,E]),A=(0,r.useCallback)(()=>{null==v||v.moveForward()},[v]),L=(0,r.useCallback)(()=>{null==v||v.moveBackward()},[v]),x=(0,d.m)(),g=(0,s.t)();(0,r.useEffect)(()=>{if(!c)return null==p||p.addShortcutsListener(l.yx.TOGGLE_PLAY,_),null==p||p.addShortcutsListener(l.yx.TOGGLE_REPEAT,g),null==p||p.addShortcutsListener(l.yx.TOGGLE_SHUFFLE,x),()=>{null==p||p.removeShortcutsListener(l.yx.TOGGLE_PLAY),null==p||p.removeShortcutsListener(l.yx.TOGGLE_SHUFFLE),null==p||p.removeShortcutsListener(l.yx.TOGGLE_REPEAT)}},[c,_,g,x,p]);let N=(0,r.useMemo)(()=>c?o?T:b:o?P:y,[o,c]);return(0,a.jsx)(N,{className:C,disabled:null===h.entityMeta,isPlaying:f,canMoveBackward:h.canMoveBackward,canMoveForward:h.canMoveForward,canShuffle:h.canShuffle,shuffle:h.shuffle,onClickPlayPause:_,onClickNext:A,onClickPrev:L,canChangeRepeatMode:h.canChangeRepeatMode,repeatMode:h.repeatMode})})},68085:function(e,t,i){"use strict";i.d(t,{$:function(){return d}});var a,o,r=i(28307),n=i(93991),l=i(39351);(a=o||(o={})).WEB="YandexMusicWebNext",a.DESKTOP="YandexMusicDesktopApp";let s=(e,t)=>"".concat(e,"/").concat(t),d=()=>{{let e=(0,l.b)()||"1.0",t="".concat(o.DESKTOP).concat((0,n.y)((0,r.X)()));return s(t,e)}}},93991:function(e,t,i){"use strict";i.d(t,{y:function(){return o}});var a=i(38060);let o=e=>{switch(e){case"win32":return a.B.WINDOWS;case"darwin":return a.B.MACOS;case"linux":return a.B.WINDOWS}return null}},38060:function(e,t,i){"use strict";var a,o;i.d(t,{B:function(){return a}}),(o=a||(a={})).WINDOWS="Windows",o.MACOS="MacOS",o.LINUX="Linux"},2365:function(e,t,i){"use strict";i.d(t,{T:function(){return a.NotFound}});var a=i(54529)},54529:function(e,t,i){"use strict";i.r(t),i.d(t,{NotFound:function(){return m}});var a=i(8759),o=i(35338),r=i(33423),n=i(2814),l=i(15527),s=i(14581),d=i(1918),u=i(42769),c=i(5674),C=i(94170),h=i.n(C);let m=(0,r.Pi)(e=>{let{className:t}=e,{contentRef:i}=(0,c.$Y)(),r=(0,c.s0)("/");return(0,c.ZP)(!0),(0,a.jsxs)("div",{className:(0,o.W)(h().root,{[h().root_desktop]:!i},t),children:[(0,a.jsx)(u.n,{withBackwardFallback:"/",className:h().navigation,withForwardControl:!1}),(0,a.jsxs)("div",{className:h().content,children:[(0,a.jsx)(s.J,{className:h().icon,variant:"musicLogo",size:"xxl"}),(0,a.jsx)(d.Heading,{className:(0,o.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist"})}),(0,a.jsx)(d.Caption,{className:(0,o.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist-description"})}),(0,a.jsx)(l.z,{onClick:r,className:h().button,role:"link",color:"secondary",size:"l",radius:"xxxl",children:(0,a.jsx)(d.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(n.Z,{id:"navigation.page-main"})})})]})]})})},48157:function(e,t,i){"use strict";i.d(t,{hx:function(){return O},f3:function(){return ea},Vm:function(){return eg},KC:function(){return eT}});var a,o=i(8759),r=i(35338),n=i(33423),l=i(99616),s=i.t(l,2),d=i(65244),u=i(2814),c=i(454),C=i(57413),h=i(15527),m=i(14581),p=i(96437),v=i(1918),E=i(96911),f=i(96169),_=i(81446),y=i(5674),A=i(44285);let P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.filter(e=>!e.composer),i=t.filter(e=>!e.various),a=e.filter(e=>e.composer&&!e.various),o=[];return i.length>0?o=i:t.length>0&&(o=t),o.concat(a)};var L=i(33779),x=i.n(L),b=i(13236),g=i(41342),N=i.n(g);let V=(0,n.Pi)(e=>{let{className:t,text:i="",maxTextLength:a,minTextLength:n,variant:s="input",shouldFinishOnKeyPress:d=!1,placeholder:u,onChangeFinish:c}=e,[C,h]=(0,l.useState)(i),m=(0,l.useRef)(!1),p=(0,l.useRef)(null),v=(0,l.useCallback)(e=>{h(e.target.value)},[]),E=(0,l.useCallback)(e=>{if(d&&["Enter","Escape"].includes(e.key)){var t;"Escape"===e.key&&(m.current=!0),null===(t=e.currentTarget)||void 0===t||t.blur()}},[d]),f=(0,l.useCallback)(()=>{let e=C.trim();m.current||n&&e.length{p.current&&(p.current.selectionStart=p.current.value.length,p.current.selectionEnd=p.current.value.length)},[]),(0,l.useLayoutEffect)(()=>{let e=p.current;if(e){e.style.height="0px";let t=e.scrollHeight;e.style.height="".concat(t,"px")}},[p,C]);let _=(0,l.useMemo)(()=>"textarea"===s?e=>(0,o.jsx)("textarea",{ref:p,rows:6,...e}):e=>(0,o.jsx)("input",{...e}),[s]);return(0,o.jsx)(_,{className:(0,r.W)(N().root,t,{[N().root_textarea]:"textarea"===s}),type:"text",value:C,maxLength:a,onBlur:f,onChange:v,onKeyDown:E,placeholder:u,autoFocus:!0})});var S=i(74081),T=i.n(S);let w=(0,n.Pi)(e=>{let{title:t="","aria-labelledby":i,canChange:a=!1,onChange:n,maxTitleLength:s,version:u="",onVersionClick:C,className:p}=e,{settings:E}=(0,y.oR)(),{formatMessage:f}=(0,d.Z)(),[_,A]=(0,l.useState)(!1),P=(0,l.useRef)(null),L=E.layout===y.t8.Mobile,x=t.length+u.length,g=x>25,N=(0,l.useMemo)(()=>L?T().font_mobile:g?T().font_long:T().font_short,[L,g]),S=!L&&a&&_,w=(0,l.useCallback)(()=>{var e;A(!0),null===(e=P.current)||void 0===e||e.focus()},[]),R=(0,l.useCallback)(e=>{A(!1),null==n||n(e)},[n]);return(0,o.jsxs)(o.Fragment,{children:[!S&&(0,o.jsxs)("div",{className:(0,r.W)(T().root,p),children:[(0,o.jsx)(b.b4,{title:t,className:T().stickyTitle,children:(0,o.jsxs)(v.Heading,{variant:"h2",id:i,className:(0,r.W)(T().heading,{[T().heading_withVersion]:u}),...(0,c.BA)(c.QM.pageHeader.ENTITY_TITLE),children:[(0,o.jsx)(v.Caption,{className:(0,r.W)(T().font,N,T().title),variant:"span",children:t}),u&&(0,o.jsx)(v.Caption,{onClick:C,className:(0,r.W)(T().font,N,T().version,{[T().version_withOtherVersions]:C}),variant:"span",...(0,c.BA)(c.QM.pageHeader.ENTITY_VERSION),children:" ".concat(u)})]})}),a&&(0,o.jsx)("div",{className:(0,r.W)(T().editButton,{[T().editButton_centered]:!g&&!L}),children:(0,o.jsx)(h.z,{onClick:w,"aria-label":f({id:"playlist-actions.change-title"}),icon:(0,o.jsx)(m.J,{size:"xxs",variant:"pencil"}),size:"s",radius:"round",...(0,c.BA)(c.QM.pageHeader.EDIT_TITLE_BUTTON)})})]}),S&&(0,o.jsx)("div",{className:T().textFieldContainer,children:(0,o.jsx)(V,{text:t,className:(0,r.W)(T().font,N,T().textField,T().title,{[T().textField_long]:g&&!L}),onChangeFinish:R,maxTextLength:s,minTextLength:1,placeholder:f({id:"playlist-actions.enter-title"}),shouldFinishOnKeyPress:!0})})]})}),R=(0,n.Pi)(e=>{let{"aria-labelledby":t,entityName:i,title:a,meta:n,controls:s,className:d,forwardRef:u,canChangeTitle:C=!1,maxTitleLength:h,onTitleChange:m,cover:p,version:E,onVersionClick:f,disclaimerLabel:_,entityNameIcon:y}=e,A=(0,l.isValidElement)(_),P=(0,l.useMemo)(()=>A?(0,o.jsx)("div",{className:x().entityContainer,children:_}):(0,o.jsxs)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:x().entityName,children:[i,y]}),[_,i,y,A]);return(0,o.jsxs)("div",{className:(0,r.W)(x().root,d),ref:u,...(0,c.BA)(c.QM.pageHeader.ENTITY_HEADER),children:[(0,o.jsx)("div",{className:x().coverCell,children:p}),(0,o.jsxs)("div",{className:x().content,children:[(0,o.jsxs)("div",{className:x().info,children:[P,(0,o.jsx)(w,{className:(0,r.W)(x().title,{[x().title_withDisclaimerLabel]:A}),title:a,"aria-labelledby":t,canChange:C,maxTitleLength:h,onChange:m,version:E,onVersionClick:f}),!!n&&(0,o.jsx)("div",{className:(0,r.W)(x().meta,{[x().meta_withDisclaimerLabel]:A}),children:n})]}),(0,o.jsx)("div",{className:x().controls,children:s})]})]})}),M=(0,l.forwardRef)((e,t)=>(0,o.jsx)(R,{forwardRef:t,...e}));var H=i(86252),k=i.n(H);let j=e=>{let{coverVariant:t,coverUri:i,isAvailable:a,className:r,withBookmateBadge:n}=e;return(0,o.jsxs)(p.Paper,{radius:"round"===t?"round":"m",className:r,children:[(0,o.jsx)(A.BE,{fit:"cover",src:i,size:300,className:k().coverImage,withAvatarReplace:!0,isAvailable:a}),n&&(0,o.jsx)(m.J,{variant:"bookmateBadge",className:k().bookmateBadge})]})};var B=i(89998),Z=i.n(B);let I=(0,n.Pi)(e=>{var t,i,a;let n,{album:s,className:L,"aria-labelledby":x,forwardRef:b,onVersionClick:g}=e,N=(0,y.x5)({pageId:y.Rh.ALBUM,blockId:y.aU.ALBUM}),{formatMessage:V}=(0,d.Z)(),{settings:S,sonataState:{status:T,unloadedEntitiesData:w},experiments:R}=(0,y.oR)(),[H,k]=(0,l.useState)(!1),B=(0,f.SB)(s),I=(0,f.BV)(s),O=S.layout===y.t8.Mobile,q=R.checkExperiment(y.pe.WebPins,"on")&&!O,D=(0,f.TL)(s),U=(0,y.uK)(),z=U.get(y.U5),F=z.features.nonMusic&&s.isPodcast;F&&(n=s.isLiked?V({id:"interface-actions.subscribed"}):V({id:"interface-actions.subscribe"}));let W=(0,l.useMemo)(()=>P(s.artists),[s.artists]),Y=(null==W?void 0:W.length)===1&&!(null===(t=W[0])||void 0===t?void 0:t.decomposed)&&!(null===(i=W[0])||void 0===i?void 0:i.various),G=(0,f.H0)(s.type),{isPlaying:K,togglePlay:J}=(0,y.qm)({playContextParams:{contextData:{type:C.Ak.Album,meta:{id:s.id},from:N},loadContextMeta:!0,entitiesData:w},sonataStatus:T}),$=(0,o.jsxs)("div",{className:Z().meta,children:[Y&&(0,o.jsx)(p.Paper,{radius:"round",className:Z().artistCover,children:(0,o.jsx)(A.BE,{src:null===(a=W[0])||void 0===a?void 0:a.coverUri,size:30,withAvatarReplace:!0})}),(0,o.jsx)(_.jO,{artists:W,lineClamp:O?1:void 0,className:Z().artists,spoilerClassName:Z().artistsSpoiler,visibleArtistsCount:O?void 0:2,linkClassName:Z().artistLink,captionClassName:Z().artistLabel,variant:O?"breakAll":"breakWord"}),s.year&&(0,o.jsx)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:(0,r.W)(Z().year,{[Z().year_dot]:W.length>0}),...(0,c.BA)(c.QM.pageHeader.ALBUM_RELEASE_DATE),children:s.year})]}),X=(0,l.useMemo)(()=>O?(0,o.jsx)(A.JM,{className:Z().playControl,color:"primary",buttonVariant:"default",iconSize:"xxl",isPlaying:K,onClick:J,variant:"filled",disabled:!s.isAvailable}):(0,o.jsx)(A.JM,{className:Z().playControl,withRipple:!0,buttonVariant:"default",radius:"xxxl",size:"s",color:"primary",iconSize:"xxs",isPlaying:K,onClick:J,disabled:!s.isAvailable,children:(0,o.jsx)(u.Z,{id:"player-actions.listen"})}),[s.isAvailable,O,K,J]),Q=(0,l.useMemo)(()=>{let e=O?"l":"s",t=O?"m":"xxs";return(0,o.jsxs)("div",{className:Z().controls,children:[X,(0,o.jsx)(A.dJ,{className:Z().likeControl,isLiked:s.isLiked,onClick:B,variant:"default",size:e,iconSize:t,iconClassName:Z().likeIcon,withRipple:!O,disabled:!s.isAvailable,"aria-label":n}),q&&(0,o.jsx)(A.RT,{onClick:I,isPinned:s.isPinned,isDisabled:!s.isAvailable,className:Z().pinControl}),(0,o.jsx)(E.oK,{album:s,open:H,onOpenChange:k,reference:(0,o.jsx)(h.z,{className:Z().menuControl,size:e,radius:"round",withRipple:!O,"aria-label":V({id:"interface-actions.context-menu"}),icon:(0,o.jsx)(m.J,{size:t,variant:"more"}),...(0,c.BA)(c.QM.pageHeader.ALBUM_HEADER_CONTEXT_MENU)})})]})},[O,X,s,B,n,q,I,H,V]),ee=(0,l.useMemo)(()=>{if(D)return(0,o.jsx)(m.J,{variant:"bookmateLogo",className:Z().bookmateLogo})},[D]);return(0,o.jsx)(M,{ref:b,className:L,controls:Q,meta:$,entityName:G,entityNameIcon:ee,title:s.title,cover:(0,o.jsx)(j,{coverVariant:"square",coverUri:s.coverUri,isAvailable:s.isAvailable,withBookmateBadge:D}),"aria-labelledby":x,version:s.version,onVersionClick:g})}),O=(0,l.forwardRef)((e,t)=>(0,o.jsx)(I,{forwardRef:t,...e}));var q=i(34603),D={5881:(e,t,i)=>{function a(){for(var e,t,i=0,a="";ia,default:()=>o});let o=a},5025:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"LizdJ2L0HW7JWOvPrfly"}},435:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_controls_xxs:"tRaaBpDMg9Qu8v6gKjtn",root_entity_xxs:"M9zvtlcpLUVn6DKdcHhj",root_text_xxs:"ln0PYYwDmFnfYxCDJsFU",root_controls_xs:"n5AeWEsJC3_AYXcbK4Lt",root_entity_xs:"__hrMKGmNbw54T54IUyh",root_text_xs:"SehSa7OyRpC2nzYTVb2Q",root_controls_s:"_oBLf5gprWsKjCw4Ce58",root_entity_s:"mxSPe5xpZnie9gpIqacd",root_text_s:"Ai2iRN9elHpk_u5splD6",root_controls_m:"tk7ahHRDYXJMMB879KUA",root_entity_m:"Z_WIr2W8JU4MPQek3hgR",root_text_m:"g3qWNP6xl__7qxNmtrvd",root_controls_l:"grvxapJE3vGArOKDWf6n",root_entity_l:"Esj5A1UeSi4xV4tZ839D",root_text_l:"V3WU123oO65AxsprotU9",root_weight_normal:"ZYV27jeWd30QDXu4GhaH",root_weight_medium:"_3_Mxw7Si7j2g4kWjlpR",root_weight_bold:"Vi7Rd0SZWqD17F0872TB"}},5668:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_size_xs:"qJJ288377iHlWN_RXeEE",root_size_s:"_sd8Q9d_Ttn0Ufe4ISWS",root_size_m:"Ctk8dbecq31Qh7isOJPQ",root_size_l:"M_Djh6ppIkCO3A2k_BTA",root_size_xl:"dtxlzGQMPAbM2MEndXWX",root_size_xxl:"IUb9XLplTAoZqne9rNUL",root_size_xxxl:"ZYZamUwql_rfFR4RpI2B",root_size_xxxxl:"ZBZyxow5njdq8z5dnRPY",root_weight_bold:"nSU6fV9y80WrZEfafvww",root_weight_black:"KBeGPPK4DinQzAP41Y_N"}},3594:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"_MWOVuZRvUQdXKTMcOPx",root_clamp:"LezmJlldtbHWqU7l1950",root_clamp_oneline:"oyQL2RSmoNbNQf3Vc6YI",root_clamp_multiline:"jMyoZB5J9iZbzJmWOrF0"}},6161:(e,t,i)=>{/** + * @license React + * react-jsx-runtime.production.min.js + * From 4bb0a269ed66e57bb44fec1551bd385a02819f1c Mon Sep 17 00:00:00 2001 From: asalde_le1 <57564314+asaldele1@users.noreply.github.com> Date: Fri, 5 Jul 2024 22:25:42 +0300 Subject: [PATCH 62/88] Change the way OS spofing works --- repack.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repack.sh b/repack.sh index 1667876..f0d80d3 100755 --- a/repack.sh +++ b/repack.sh @@ -67,13 +67,13 @@ curdir="$PWD" cd "$TEMPDIR/app" -# fixing secretKey issue echo "Fixing SecretKey" +echo "Spoofing OS" find "./" -type f \( -name "*.js" -o -name "*.js.map" \) -print0 | while IFS= read -r -d $'\0' file; do # Use 'sed' to perform the replacement in-place sed -i "s/secretKey:this.secretKey/secretKey:'superSecretKey'/g" "$file" + sed -i "s/B.LINUX/B.WINDOWS/g" "$file" done -echo "SecretKey replaced" # fixing titile echo "Fixing Title" From a40dedfd9a0b602b12095f41ba33637867d3a6f2 Mon Sep 17 00:00:00 2001 From: Andrey Onischenko <100789522+cucumber-sp@users.noreply.github.com> Date: Fri, 5 Jul 2024 22:35:47 +0300 Subject: [PATCH 63/88] Delete patches/0005-Add-OS-spoof.patch --- patches/0005-Add-OS-spoof.patch | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 patches/0005-Add-OS-spoof.patch diff --git a/patches/0005-Add-OS-spoof.patch b/patches/0005-Add-OS-spoof.patch deleted file mode 100644 index 7e02378..0000000 --- a/patches/0005-Add-OS-spoof.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff --git a/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js b/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js ---- a/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js -+++ b/app/_next/static/chunks/app/(product)/layout-9789348d9aaa7892.js -@@ -1,4 +1,4 @@ --(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4720,9889,2121,3799,1521,1593,9880,8910,2499,105,5001,4870,2286,1871,9264],{35582:function(e,t,i){"use strict";i.r(t);var a,o,r,n,l,s,d,u,c,C,h,m,p,v,E,f,_,y,A,P,L,x,b,g,N,V,S,T,w,R,M,H,k,j,B,Z,I,O,q,D,U,z,F,W,Y,G,K,J,$,X,Q,ee,et,ei,ea,eo,er,en,el,es,ed,eu,ec,eC,eh,em,ep,ev,eE,ef,e_,ey,eA,eP,eL,ex,eb,eg,eN,eV,eS,eT,ew,eR,eM,eH,ek,ej,eB,eZ,eI,eO,eq,eD,eU=i(99616);function ez(){return(ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let e=(0,n.useRouter)(),t=(0,c.uK)(),i=t.get(c.xi),o=(0,l.useCallback)(()=>{i.authorizationUrl&&e.push(i.authorizationUrl)},[i.authorizationUrl,e]);return(0,a.jsxs)("div",{className:h().root,children:[(0,a.jsx)(u.Heading,{className:(0,r.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(s.Z,{id:"authorization.enter-title"})}),(0,a.jsx)(u.Caption,{className:(0,r.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(s.Z,{id:"authorization.enter-text"})}),(0,a.jsx)(d.z,{onClick:o,className:h().button,role:"link",color:"primary",size:"l",radius:"xxxl",children:(0,a.jsx)(u.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(s.Z,{id:"authorization.enter-button"})})})]})}),p=(0,o.Pi)(e=>{let{children:t}=e,{user:i}=(0,c.oR)();return i.isAuthorized?t:(0,a.jsx)(m,{})})},40466:function(e,t,i){"use strict";i.r(t),i.d(t,{WithBetaUser:function(){return A}});var a=i(8759),o=i(33423),r=i(35338),n=i(11769),l=i(99616),s=i(65244),d=i(2814),u=i(15527),c=i(13410),C=i(28036),h=i(1918),m=i(57921),p=i(39479),v=i(5674),E=i(44285),f=i(99800),_=i.n(f);let y=(0,o.Pi)(e=>{let{withoutExperiment:t=!1,showLoginButton:o=!1,showUserProfile:f=!1,withOffer:y=!1}=e,A=(0,n.useRouter)(),P=(0,v.uK)(),{settings:L}=(0,v.oR)(),{formatMessage:x}=(0,s.Z)(),b=P.get(v.xi),g=P.get(v.U5),N=(0,v.yy)(g.oldWebHost),V=(0,l.useMemo)(()=>L.layout===v.t8.Mobile?i(25811).Z.src:i(11737).Z.src,[L.layout]),S=(0,l.useCallback)(()=>{b.authorizationUrl&&A.push(b.authorizationUrl)},[b.authorizationUrl,A]);(0,v.NO)(!0);let T=(0,l.useMemo)(()=>y?(0,a.jsx)(h.Heading,{variant:"h1",size:"xl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-header"})}):t?(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-header",values:{br:(0,a.jsx)("br",{})}})}):(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-header",values:{br:(0,a.jsx)("br",{})}})}),[y,t]),w=(0,l.useMemo)(()=>t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})})})]}):y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().offerText,children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})})})]}),[y,t]),R=(0,l.useMemo)(()=>{if(o)return(0,a.jsx)(u.z,{onClick:S,className:_().loginButton,role:"link",color:"primary",size:"m",radius:"xxxl",children:(0,a.jsx)(d.Z,{id:"authorization.enter-button"})});if(y){let e="https://".concat(N,"/pay");return(0,a.jsx)(E.rU,{className:_().offerButtonLink,href:e,"aria-label":x({id:"payment.offer-button"}),target:"_blank",children:(0,a.jsx)(u.z,{className:(0,r.W)(_().offerButton,_().offerButton_important),role:"link",color:"plus",size:"l",radius:"m",withRipple:!1,children:(0,a.jsx)(d.Z,{id:"payment.offer-button"})})})}},[x,S,N,o,y]);return(0,v.ZP)(!0),(0,a.jsxs)("div",{className:(0,r.W)(_().root),children:[(0,a.jsx)(m.TF,{withSecondaryColor:!0}),(0,a.jsx)("div",{className:_().logoContainer,children:(0,a.jsx)(c.T,{alignIcon:"center",lang:"ru",className:_().logo})}),T,w,R,(0,a.jsx)("img",{className:_().image,src:V}),f&&(0,a.jsx)(p.Iw,{className:_().user,withMeta:L.layout!==v.t8.Mobile,variant:L.layout===v.t8.Mobile?"mobile":"desktop",usernameClassName:(0,r.W)(_().username,_().important)})]})}),A=(0,o.Pi)(e=>{let{children:t}=e,{user:i,experiments:o}=(0,v.oR)();return i.isAuthorized?o.checkExperiment(v.pe.WebNext,"on")&&!i.isChild?i.hasPlus||o.checkExperiment(v.pe.WebNextFreemium,"on")?t:(0,a.jsx)(y,{withOffer:!0,showUserProfile:!0}):(0,a.jsx)(y,{withoutExperiment:!0,showUserProfile:!0}):(0,a.jsx)(y,{showLoginButton:!0})})},12286:function(e,t,i){"use strict";i.r(t);var a=i(8759),o=i(35338),r=i(99616),n=i(92318),l=i(89788),s=i(5674),d=i(37500),u=i.n(d),c=i(21535);t.default=e=>{let{children:t}=e,{state:i,toggleTrue:d}=(0,n.O)(!1),{state:C,toggleTrue:h}=(0,n.O)(!1),m=(0,r.useMemo)(()=>{let e=new l.JC;return(0,s.NK)(e.get(s.BU.Theme),(0,s.Q$)())},[]),p=(0,r.useCallback)(e=>{let t=c.env.ASSET_PREFIX||"";return"".concat(t,"/video/splash_screen/splash_screen_").concat(m,".").concat(e)},[m]),v=(0,r.useMemo)(()=>({isVisible:!i}),[i]);return(0,a.jsxs)(s.IP.Provider,{value:v,children:[!i&&(0,a.jsx)("div",{className:(0,o.W)(u().root,u()["root_".concat(m)],{[u().root_hidden]:C}),onAnimationEnd:d,children:(0,a.jsxs)("video",{className:u().video,autoPlay:!0,muted:!0,playsInline:!0,onEnded:h,onError:d,children:[(0,a.jsx)("source",{src:p("webm"),type:"video/webm"}),(0,a.jsx)("source",{src:p("mp4"),type:"video/mp4"})]})}),t]})}},44495:function(e,t,i){"use strict";i.r(t),i.d(t,{DesktopInitializer:function(){return d}});var a=i(8759),o=i(35338),r=i(99616),n=i(48769),l=i(57921),s=i(5674);let d=()=>{let e=(0,s.Xf)(),{dictionary:t}=(0,s.ZS)();{let{theme:e}=(0,s.Fg)(),t=(0,s.sv)();(0,l.Tk)(),(0,l.Er)(),(0,l.bO)(),(0,l.vs)(),(0,l.Zw)(),(0,r.useEffect)(()=>{(0,l.Yl)(),(0,l.l7)()},[]),(0,r.useEffect)(()=>{let e=(0,s.bo)();e&&t.count(e,"appVersion")},[t]),(0,r.useEffect)(()=>{(0,l.F5)(e),t.count(e,"appTheme")},[e])}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Notification,{className:(0,o.W)({updateNotificationContainer:!0,updateNotificationContainer_application_windows:e===s.t4.WINDOWS,updateNotificationContainer_application_macos:e===s.t4.MACOS}),enableMultiContainer:!0,containerId:s.W$.APPLICATION_UPDATE,position:"top-center"}),(0,a.jsx)(l.Pj,{dictionary:t})]})}},49842:function(e,t,i){"use strict";i.r(t),i.d(t,{UrlInitializer:function(){return n}});var a=i(33423),o=i(11769),r=i(5674);let n=(0,a.Pi)(e=>{let{host:t}=e,{location:i}=(0,r.oR)(),a=(0,o.usePathname)(),n=(0,o.useSearchParams)().toString(),l=window.location.host,s=t||l,d="https://".concat(s),u="https://".concat(s).concat(a).concat(n?"?":"").concat(n);d=s,u="".concat(s).concat(a).concat(n?"?":"").concat(n),i.setPathname(a),i.setSearchParams(n),i.setHost(s),i.setTld((0,r.p$)(s)||"ru"),i.setOrigin(d),i.setHref(u)})},85816:function(e,t,i){"use strict";i.r(t),i.d(t,{WebInitializer:function(){return s}});var a=i(8759);i(99616);var o=i(5674),r=i(33423);let n=(0,r.Pi)(e=>{let{children:t,userIp:i}=e,{location:a}=(0,o.oR)();return t}),l=e=>{let{children:t}=e;return t},s=e=>{let{userIp:t}=e,i=(0,o.uK)(),r=i.get(o.V0);return r.get(o.BU.DisallowDeeplinksRedirect),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l,{}),(0,a.jsx)(n,{userIp:t})]})}},52207:function(e,t,i){"use strict";i.r(t),i.d(t,{NavigationEvents:function(){return n}});var a=i(11769),o=i(99616),r=i(5674);let n=()=>{let e=(0,r.sv)(),t=(0,a.usePathname)(),i=(0,a.useSearchParams)();return(0,o.useEffect)(()=>{let a="".concat(t).concat(i.size>0?"?".concat(i):"");e.hit(a)},[t,i,e]),null}},75576:function(e,t,i){"use strict";i.r(t),i.d(t,{AnalyticsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(82834),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.sv)(),s=(0,n.wL)(),d=(0,n.uK)(),u=d.get(n.V0),c=(0,o.useMemo)(()=>{if(l)return l;let e="on"===u.get(n.BU.AllowAnalyticsLogs),t=(0,r.HQ)(e=>i.count(e,"evgen"),s,e),a=(0,r.hz)(),o=(0,r.y_)();return l=new r.yx(t,a,o)},[u,s,i]);return(0,a.jsx)(n.fC.Provider,{value:c,children:(0,a.jsx)(n.tK,{children:t})})}},83622:function(e,t,i){"use strict";i.r(t),i.d(t,{HistoryProvider:function(){return s}});var a=i(8759),o=i(11769),r=i(99616),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.uK)(),s=(0,o.useRouter)(),d=(0,o.usePathname)(),u=(0,o.useSearchParams)(),[c,C]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1),[p,v]=(0,r.useState)(null),E=(0,r.useMemo)(()=>{if(l)return l;let e=i.get(n.Ar);return l=new n.QQ(e)},[i]),f=(0,r.useCallback)(()=>{E&&(C(E.canBack),m(E.canForward),v(E.state))},[E]),_=(0,r.useCallback)(e=>{E&&(E.replaceState(e),s.replace(e.href))},[E,s]),y=(0,r.useCallback)(e=>{E&&(E.pushState(e),f())},[E,f]),A=(0,r.useCallback)(()=>{E&&(E.back(),f(),s.back())},[E,s,f]),P=(0,r.useCallback)(()=>{E&&(E.forward(),f(),s.forward())},[E,s,f]);return(0,r.useEffect)(()=>{var e;let t=[d,u.toString()].join("?");(!(null==E?void 0:E.state)||(null==E?void 0:null===(e=E.state)||void 0===e?void 0:e.isLocationNotEqual(t)))&&y({href:t})},[E,d,u,y]),(0,a.jsx)(n.Tl.Provider,{value:{pushState:y,replaceState:_,canForward:h,canBack:c,back:A,forward:P,state:p},children:t})}},75707:function(e,t,i){"use strict";i.r(t),i.d(t,{LayoutProvider:function(){return d},setClientSideLayout:function(){return s}});var a=i(8759),o=i(57285),r=i(33423),n=i(99616),l=i(5674);let s=e=>{document.body.classList.remove("desktop"),e.setLayout((0,l.jP)(window.innerWidth))},d=(0,r.Pi)(e=>{let{children:t,userAgent:i}=e,{settings:r}=(0,l.oR)(),d=(0,l.Xf)(),[u,c]=(0,n.useState)(null);d&&r.setPlatform(d),r.layout;let C=(0,n.useMemo)(()=>(0,o.Z)(()=>{s(r)},100),[r]),h=(0,n.useCallback)(e=>{c(e)},[]);(0,n.useLayoutEffect)(()=>{s(r)},[r]),(0,n.useEffect)(()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}),[C]);let m=(0,n.useMemo)(()=>({contentRef:u,setContentRef:h}),[u,h]);return(0,a.jsx)(l.VY.Provider,{value:m,children:t})})},29371:function(e,t,i){"use strict";i.r(t),i.d(t,{PrefetchDataProvider:function(){return s}});var a=i(33423),o=i(99616),r=i(5674),n=i(75707);let l=async(e,t,i)=>{let{user:a,library:o,experiments:n,pinsCollection:l}=e;if(t?await a.getAbout():a.setUnauthorized(),a.puid&&i.setPassportUid(a.puid),await n.getData(),a.isAuthorized){let e=[a.getSettings(),o.getData()];n.checkExperiment(r.pe.WebPins,"on")&&e.push(l.getData()),await Promise.all(e)}},s=(0,a.Pi)(e=>{let{children:t}=e,i=(0,r.oR)(),a=(0,r.uK)(),s=a.get(r.xi),d=a.get(r.Hz),u=s.hasAuthorizationCredentials;return(0,n.setClientSideLayout)(i.settings),i.user.account.loadingState===r.Gu.IDLE&&(0,o.use)(l(i,u,d)),t})},85709:function(e,t,i){"use strict";i.r(t),i.d(t,{ShortcutsProvider:function(){return d}});var a=i(8759),o=i(33423),r=i(99616),n=i(98125),l=i(5674);let s=null,d=(0,o.Pi)(e=>{let{children:t}=e,i=(0,l.R$)(),o=(0,l.uK)(),d=o.get(l.V0),u=(0,n.K)(),{sonataState:c}=(0,l.oR)(),C=(0,r.useMemo)(()=>(s||(s=new l.OI(new l.yr)),s),[]);return(0,r.useEffect)(()=>(null==C||C.addShortcutsListener(l.yx.DECREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.decreaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.INCREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.increaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.TOGGLE_MUTE,async()=>{let e=null==i?void 0:i.state.playerState.volume.value;void 0!==e&&await u(e)}),()=>{null==C||C.removeShortcutsListener(l.yx.DECREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.INCREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.TOGGLE_MUTE)}),[C,i,d,u]),(0,r.useEffect)(()=>{if(!c.isGenerativeContext)return null==C||C.addShortcutsListener(l.yx.MOVE_BACKWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value)&&await i.moveBackward()}),null==C||C.addShortcutsListener(l.yx.MOVE_FORWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value)&&await (null==i?void 0:i.moveForward())}),null==C||C.addShortcutsListener(l.yx.SLIDE_BACKWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideBackward(2))}),null==C||C.addShortcutsListener(l.yx.SLIDE_FORWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideForward(2))}),()=>{null==C||C.removeShortcutsListener(l.yx.MOVE_FORWARD),null==C||C.removeShortcutsListener(l.yx.MOVE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_FORWARD)}},[C,i,d,c.isGenerativeContext]),(0,a.jsx)(l.cw.Provider,{value:C,children:t})})},48085:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataProvider:function(){return eu}});var a,o,r,n,l=i(8759),s=i(33423),d=i(99616),u=i(8124);class c extends Error{constructor(e){super(e),this.name="AudioError"}}let C={BAD_STATE:"action is not permited from current state"},h={EVENT_PLAY:"play",EVENT_STOP:"stop",EVENT_PAUSE:"pause",EVENT_RESUME:"resume",EVENT_PROGRESS:"progress",EVENT_SEEKED:"seeked",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_LOADING:"loading",EVENT_LOADED:"loaded",EVENT_ENDED:"ended",EVENT_CRASHED:"crashed",EVENT_ERROR:"error",EVENT_STALLED:"stalled",EVENT_CANPLAY:"canplay",EVENT_PLAYING:"playing",HLS_EVENT_ERROR:"hlserror",EVENT_DESTROY:"destroy",EVENT_STATE:"state",EVENT_SWAP:"swap",STATE_INIT:"init",STATE_CRASHED:"crashed",STATE_IDLE:"idle",STATE_PLAYING:"playing",STATE_PAUSED:"paused"};var m=i(23681);let p={updateInterval:30,EMPTY_SOUND:"data:audio/mp3;base64,//uQZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAADAAAC2QBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA8TEFNRTMuOThyBK8AAAAAAAAAADQgJAimTQABzAAAAtmIVtmVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQZAAO4AAAf4AAAAgAAA/wAAABAoQDLmAAACBYgGYMAAAE+oH///////0WKFRVzjKnAmjp+XX9qP//////p0USaKtMwpjZNhNFyEM61QAAOAP////////nfSpMQU1FMy45OC4yqqr/+xBEDI/wAAB/gAAACAxgGaMAAAEAAAH+AAAAIAAAP8AAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/7EGQoD/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",EVENT_NATIVE_PLAY:"play",EVENT_NATIVE_PAUSE:"pause",EVENT_NATIVE_TIMEUPDATE:"timeupdate",EVENT_NATIVE_ENDED:"ended",EVENT_NATIVE_DURATION:"durationchange",EVENT_NATIVE_LOADING:"progress",EVENT_NATIVE_META:"loadedmetadata",EVENT_NATIVE_CANPLAY:"canplay",EVENT_NATIVE_PLAYING:"playing",EVENT_NATIVE_ERROR:"error",EVENT_NATIVE_STALLED:"stalled",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_SEEKED:"seeked",promiseLoadedEvents:["progress"],promisePlayingEvents:["timeupdate"],promiseMetadataEvents:["loadedmetadata","canplay"],loaderInteruptReasons:["load","stop","startPlay","play","destroy"]};class v{isOnlyDeviceVolume(){let e=!0;try{let t=document.createElement("audio");t.volume=.63,e=Math.abs(t.volume-.63)>.01}catch(t){e=!0}return e}parseParams(e){let t=e.split("?")[1];return t&&t.length?t.split("&").reduce(function(e,t){let i=t.split("="),a=i[0],o=i[1];return a&&o&&(e[a]=o),e},{}):{}}updateUrl(e,t){let i=this.parseParams(e),a="";for(let e in Object.assign(i,t),i)Object.prototype.hasOwnProperty.call(i,e)&&(a+=`${e}=${i[e]}`);return e+(a?`?${a}`:"")}getCookie(e){let t=document.cookie.split(";").reduce((e,t)=>{let[i,a]=t.trim().split("=");return i&&a?{...e,[i]:a}:e},{})[e];return t||""}}let E=1,f=()=>{let e=document.createElement("audio");return e.autoplay=!1,e.loop=!1,e.preload="auto",e.crossOrigin="anonymous",e};class _{audio=f();browser=new v;emitter;src="";position=0;lastGoodTime=0;lastUpdate=0;notLoading=!0;shouldUseHlsPlayer;shouldPause=!1;shouldPlay=!1;playing=!1;ended=!1;promiseMode=!1;isHlsTrack=!1;promises={};audioContext=null;loaderTimer=null;promiseCheckTO=null;retry=0;playerInitializationTime;clearInitListener=null;clearNativePauseListener=null;hls=null;isAutoplayable=!1;name=E++;whenReady;constructor(e,t){this.shouldUseHlsPlayer=e,this.playerInitializationTime=Date.now(),this.emitter=t,this.startupAudio=this.startupAudio.bind(this),this.updateProgress=this.updateProgress.bind(this),this.onNativeLoading=this.onNativeLoading.bind(this),this.onNativeEnded=this.onNativeEnded.bind(this),this.onNativeError=this.onNativeError.bind(this),this.onNativePause=this.onNativePause.bind(this),this.onNativePlay=this.onNativePlay.bind(this),this.onNativeSeeked=this.onNativeSeeked.bind(this),this.onNativeStalled=this.onNativeStalled.bind(this),this.onNativeCanplay=this.onNativeCanplay.bind(this),this.onNativePlaying=this.onNativePlaying.bind(this),this.onNativeVolumeChange=this.onNativeVolumeChange.bind(this),this.onNativeRatechange=this.onNativeRatechange.bind(this),this.whenReady=this.init()}updateProgress(){let e=Number(new Date);if(e-this.lastUpdate=this.audio.duration-.1&&this.emitter.emit(h.EVENT_LOADED)}}onNativeEnded(){this.ended=!0,this.playing=!1,this.shouldPause=!0,this.emitter.emit(h.EVENT_ENDED)}onNativeError(){this.src&&this.src!==p.EMPTY_SOUND&&(this.audio&&this.audio.error&&this.emitter.emit(h.EVENT_ERROR,this.audio.error),this.playing=!1)}onNativePause(){this.emitter.emit(h.EVENT_PAUSE),this.shouldPause=!1}onNativePlay(){this.emitter.emit(h.EVENT_PLAY),this.shouldPlay=!1}onNativeSeeked(){this.emitter.emit(h.EVENT_SEEKED)}onNativeStalled(){this.emitter.emit(h.EVENT_STALLED)}onNativeCanplay(){this.emitter.emit(h.EVENT_CANPLAY)}onNativePlaying(){this.playing&&this.emitter.emit(h.EVENT_PLAYING)}onNativeVolumeChange(){this.emitter.emit(h.EVENT_VOLUMECHANGE,this.volumeLevel)}onNativeRatechange(){this.emitter.emit(h.EVENT_RATECHANGE,this.playbackRate)}initUserEvents(){document.body.addEventListener("mousedown",this.startupAudio,!0),document.body.addEventListener("keydown",this.startupAudio,!0),document.body.addEventListener("touchstart",this.startupAudio,!0)}deinitUserEvents(){document.body.removeEventListener("mousedown",this.startupAudio,!0),document.body.removeEventListener("keydown",this.startupAudio,!0),document.body.removeEventListener("touchstart",this.startupAudio,!0)}initNativeEvents(){this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.addEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.addEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.addEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.addEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.addEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.addEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.addEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.addEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}deinitNativeEvents(){this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.removeEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.removeEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.removeEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.removeEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.removeEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.removeEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.removeEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}init(){return this.initEvents().then(()=>{this.shouldUseHlsPlayer&&this.initHls()})}initEvents(){return new Promise(e=>{this.initUserEvents(),this.initNativeEvents(),e()})}startupAudio(){this.audioContext&&this.audioContext.resume(),this.deinitUserEvents();let e=()=>{this.shouldPlay=!1,this.isAutoplayable=!0},t=e=>{this.shouldPlay=!1,console.info(`_startupAudio:failReason:${e||""}`)},i=()=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i)),this.promiseMode)return;let t=()=>{this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,t),e()};this.clearNativePauseListener=()=>{this.audio&&this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t)},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t),this.audio.pause(),this.shouldPause=!0)};this.clearInitListener=()=>{this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i))},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_META,i),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,i),this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{e(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,t("audio.play")}))}initAndCheckAutoplay(){return new Promise(e=>{let t=()=>{this.shouldPlay=!1,this.isAutoplayable=!0,e()},i=t=>{this.shouldPlay=!1,this.isAutoplayable=!1,console.info(this,`initAndCheckAutoplay:failReason:${t||""}`),e()},a=e=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_META,a),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,a)),this.promiseMode)return;if(e.type===p.EVENT_NATIVE_ERROR||e.type===p.EVENT_NATIVE_META){i(e.type);return}let o=e=>{if(e.type===p.EVENT_NATIVE_ERROR){i(e.type);return}this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,o),t()};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,o),this.audio.pause()),this.shouldPause=!0};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_META,a),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,a),this.audio.src=p.EMPTY_SOUND,this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{t(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,i("audio.play")}))})}breakStartup(e){this.deinitUserEvents(),this.clearInitListener&&this.clearInitListener(),this.clearNativePauseListener&&this.clearNativePauseListener(),console.warn("_startupAudio:interrupted",e)}waitFor(e,t,i){let a;let o=this.promises[e];if(o)a=o.promise();else{let o=()=>{},r=[new Promise((e,t)=>{o=t})],n={},l=e=>new Promise(i=>{let a=()=>{t()&&i()};this.audio&&(this.audio.addEventListener(e,a),n[e]=a)}),s=()=>{for(let e of Object.keys(n))if(this.audio){let t=n[e];t&&this.audio.removeEventListener(e,t)}};for(let e of i)r.push(l(e));let d=Promise.race(r);d.then(s).catch(s),this.promises[e]={promise:()=>d,reject:o},a=d}return a}cancelWait(e,t){let i;(i=this.promises[e])&&(delete this.promises[e],i.reject(t))}abortPromises(e){for(let t in this.promises)Object.prototype.hasOwnProperty.call(this.promises,t)&&this.cancelWait(t,e)}promiseMetadataCheck(){return!!this.audio&&this.audio.readyState>this.audio.HAVE_METADATA}promiseMetadata(){return this.waitFor("metadata",()=>this.promiseMetadataCheck(),p.promiseMetadataEvents)}promiseLoadedCheck(){if(this.loaderTimer?clearTimeout(this.loaderTimer):this.loaderTimer=setTimeout(()=>{this.cancelWait("loaded","timeout")},5e3),this.audio){let e=Math.min(this.position+45,this.audio.duration),t=this.audio.buffered.end(0)-this.audio.buffered.start(0);return 0!==this.audio.buffered.length&&t>=e}return!1}promiseLoaded(){let e=this.waitFor("loaded",()=>this.promiseLoadedCheck(),p.promiseLoadedEvents),t=()=>{this.loaderTimer&&clearTimeout(this.loaderTimer)};return e.then(t).catch(t),e}promisePlayingCheck(){if(this.audio){let e=Math.min(this.position+.2,this.audio.duration);return this.promiseCheckTO&&clearTimeout(this.promiseCheckTO),0!==this.audio.currentTime||this.audio.paused||(this.promiseCheckTO=setTimeout(()=>{this.audio&&0===this.audio.currentTime&&!this.audio.paused&&(this.audio.currentTime=1)},1e3)),this.audio.currentTime>=e}return!1}promisePlaying(){return this.waitFor("playing",()=>this.promisePlayingCheck(),p.promisePlayingEvents)}promiseStartPlaying(){let e,t=!1;if(this.promises.startPlaying)e=this.promises.startPlaying.promise();else{let i,a=()=>{},o=new Promise((e,o)=>{this.promisePlaying().then(()=>{t=!0,clearTimeout(i),e()}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),this.promiseLoaded().then(()=>{t||(i=setTimeout(()=>{o("timeout"),this.cancelWait("playing","timeout"),console.warn("startPlaying:failed")},5e3))}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),a=o});this.promises.startPlaying={promise:()=>o,reject:a},e=this.promises.startPlaying.promise()}return e}load(e){this.abortPromises("load"),this.breakStartup("load"),this.ended=!1,this.playing=!1,this.notLoading=!0,this.position=0,this.lastGoodTime=0,this.src=e,this.audio&&(/\.m3u8$/.test(e)?(this.isHlsTrack=!0,this.destroyHls(),this.initHls(),this.hls?.loadSource(this.getHlsPlayingEntityUrl(e))):(this.isHlsTrack=!1,this.audio.src=e),this.audio.load())}stop(){this.abortPromises("stop"),this.breakStartup("stop"),this.isHlsTrack&&this.destroyHls(),this.load("")}startPlay(){this.audio&&(this.audio.currentTime=this.position),this.playing&&(this.breakStartup("startPlay"),this.shouldPlay=!0,this.audio&&this.audio.play().catch(e=>{console.error(e)}),this.hls&&this.hls.startLoad(),this.promiseStartPlaying().then(()=>{this.retry=0}))}play(e){this.retry=0,this.loadMetadata(e)}loadMetadata(e){this.playing||(this.breakStartup("play"),this.ended=!1,this.playing=!0,null!=e&&(this.position=e),this.promiseMetadata().then(()=>this.startPlay()).catch(e=>{"string"==typeof e&&p.loaderInteruptReasons.includes(e)||console.error(e)}))}initHls(){this.hls||(this.hls=new m.ZP({liveDurationInfinity:!0,maxBufferSize:3e6}),this.audio&&this.hls.attachMedia(this.audio),this.initHlsEvents())}initHlsEvents(){this.hls&&(this.hls.on(m.ZP.Events.ERROR,(e,t)=>{if(t.fatal&&this.hls)switch(t.type){case m.ZP.ErrorTypes.NETWORK_ERROR:this.retry++,this.retry>2?(this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)):this.hls.startLoad();break;case m.ZP.ErrorTypes.MEDIA_ERROR:this.hls.recoverMediaError();break;default:this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)}}),this.hls.on(m.ZP.Events.DESTROYING,()=>{this.hls=null}))}getHlsPlayingEntityUrl(e){let t="";for(;t.length<44;)t+=(Math.random()+1).toString(36).substring(3);t=t.slice(0,44);let i=this.playerInitializationTime.toString().slice(0,10),a=`${t}xWEBx0001x${i}`;return this.browser.updateUrl(e,{vsid:a})}destroyHls(){this.retry=0,this.hls&&(this.hls.stopLoad(),this.hls.destroy(),this.hls=null)}pause(){this.shouldPause=!0,this.playing=!1,this.isHlsTrack&&this.hls&&this.hls.stopLoad(),this.audio&&(this.audio.pause(),this.position=this.audio.currentTime)}setPosition(e){if(!isFinite(e)){console.warn("setPositionFailed",e);return}this.position=e,this.promiseMetadata().then(()=>{this.audio&&(this.audio.currentTime=this.position)})}destroy(){this.audio&&(this.shouldPause=!0,this.audio.pause(),this.deinitNativeEvents()),this.abortPromises("destroy"),this.deinitUserEvents(),this.promises={}}get currentTime(){return this.audio?this.audio.currentTime:null}get duration(){return this.audio?this.audio.duration:null}get loaded(){let e;if(this.audio&&this.audio.buffered.length){let t=this.audio.buffered.length-1;e=this.audio.buffered.end(t)}else e=null;return e}get volumeLevel(){return this.audio?this.audio.volume:0}set volumeLevel(e){this.audio&&(this.audio.volume=e)}set defaultPlaybackRate(e){this.audio&&(this.audio.defaultPlaybackRate=e)}get playbackRate(){return this.audio?this.audio.playbackRate:1}set playbackRate(e){this.audio&&(this.audio.playbackRate=e)}get audioSrc(){return this.src}get audioNotLoading(){return this.notLoading}get autoplayable(){return this.isAutoplayable}}let y=1;class A{browser=new v;emitter;loader;name=y++;type="html5";whenReady;constructor(e,t){this.emitter=t,this.loader=new _(e,t),this.whenReady=this.loader.whenReady}get source(){return this.loader.audio}play(e,t){this.loader.load(e),this.loader.play(t)}setSrc(e,t){this.loader.load(e),this.loader.setPosition(t)}pause(){this.loader.pause()}resume(){this.loader.play()}stop(){this.loader.stop(),this.emitter.emit(h.EVENT_STOP)}destroy(){this.loader.destroy(),this.emitter.emit(h.EVENT_DESTROY)}getPosition(){return this.loader.currentTime}setPosition(e){this.loader.setPosition(e-.001)}getDuration(){return this.loader.duration}getLoaded(){return this.loader.loaded?this.loader.loaded:0}get volumeLevel(){return this.loader.volumeLevel}set volumeLevel(e){this.loader.volumeLevel=Math.min(1,e)}get speedLevel(){return this.loader.playbackRate}set speedLevel(e){this.loader.defaultPlaybackRate=e,this.loader.playbackRate=e}getSrc(){return""!==this.loader.audioSrc?this.loader.audioSrc:null}isDeviceVolume(){return this.browser.isOnlyDeviceVolume()}isAutoplayable(){return this.loader.autoplayable}}let P=1;class L{emitter=new u.v;played=0;lastSkip=0;playId=null;shouldUseHlsPlayer;implementation;promises={};name=P++;state=h.STATE_INIT;constructor(e=!1){this.shouldUseHlsPlayer=e,window.addEventListener("beforeunload",()=>this.onBeforeUnload(),!0),this.implementation=new A(this.shouldUseHlsPlayer,this.emitter),this.onAudioPlayerInit()}get source(){return this.implementation?.source}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}onAudioPlayerInit(){this.handleImplementationEvents(),this.setState(h.STATE_IDLE)}handleImplementationEvents(){this.emitter.on(h.EVENT_PLAY,()=>{this.implementationEventHandler(h.EVENT_PLAY)}),this.emitter.on(h.EVENT_ENDED,()=>{this.implementationEventHandler(h.EVENT_ENDED)}),this.emitter.on(h.EVENT_SWAP,()=>{this.implementationEventHandler(h.EVENT_SWAP)}),this.emitter.on(h.EVENT_STOP,()=>{this.implementationEventHandler(h.EVENT_STOP)}),this.emitter.on(h.EVENT_ERROR,()=>{this.implementationEventHandler(h.EVENT_ERROR)}),this.emitter.on(h.HLS_EVENT_ERROR,()=>{this.implementationEventHandler(h.HLS_EVENT_ERROR)}),this.emitter.on(h.EVENT_PAUSE,()=>{this.implementationEventHandler(h.EVENT_PAUSE)}),this.emitter.on(h.EVENT_CRASHED,()=>{this.implementationEventHandler(h.EVENT_CRASHED)})}implementationEventHandler(e){switch(e){case h.EVENT_PLAY:this.setState(h.STATE_PLAYING);break;case h.EVENT_ENDED:case h.EVENT_SWAP:case h.EVENT_STOP:case h.EVENT_ERROR:case h.HLS_EVENT_ERROR:this.setState(h.STATE_IDLE);break;case h.EVENT_PAUSE:this.setState(h.STATE_PAUSED);break;case h.EVENT_CRASHED:this.setState(h.STATE_CRASHED)}}onBeforeUnload(){"undefined"!=typeof window&&navigator&&1===navigator.maxTouchPoints||this.destroy()}setState(e){if(e===h.STATE_PAUSED&&this.state!==h.STATE_PLAYING)return;let t=this.state!==e;this.state=e,t&&this.emitter.emit(h.EVENT_STATE,e)}waitEvents(e,t,i){let a=()=>{},o=()=>{},r=new Promise((e,t)=>{a=e,o=t});this.promises[e]={promise:()=>r,reject:o};let n=()=>{for(let e of t)this.off(e,a);for(let e of i)this.off(e,o);delete this.promises[e]};for(let e of t)this.on(e,a);let l=e=>t=>{let i=t instanceof Error?t:new c(e);o(i)};for(let e of i)this.on(e,l(e));return r.then(n).catch(n),r}getState(){return this.state}getSrc(){return this.implementation?this.implementation.getSrc():null}play(e,t){this.played=0,this.lastSkip=0,this.generatePlayId(),this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PLAY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_PLAY),this.promises.whenStop&&this.promises.whenStop.reject(h.EVENT_PLAY);let i=this.waitEvents("whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]);return this.implementation&&this.implementation.play(e,t),i}setSrc(e,t){this.implementation&&this.implementation.setSrc(e,t)}restart(){return this.getDuration()?(this.generatePlayId(),this.setPosition(0),this.played=0,this.lastSkip=0,this.resume()):Promise.reject(new c(C.BAD_STATE))}stop(){let e;return this.implementation&&(this.implementation.stop(),Promise.resolve()),this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_STOP),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_STOP),e=this.promises.whenStop?this.promises.whenStop.promise():this.waitEvents("_whenStop",[h.EVENT_STOP],[h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.stop(),e}pause(){let e;return this.state!==h.STATE_PLAYING?Promise.reject(new c(C.BAD_STATE)):(this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PAUSE),e=this.promises.whenPause?this.promises.whenPause.promise():this.waitEvents("_whenPause",[h.EVENT_PAUSE],[h.EVENT_STOP,h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.pause(),e)}resume(){let e;return this.state!==h.STATE_PLAYING||this.promises.whenPause?this.state===h.STATE_IDLE||this.state===h.STATE_PAUSED||this.state===h.STATE_PLAYING?(this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_RESUME),e=this.promises.whenPlay?this.promises.whenPlay.promise():this.waitEvents("_whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.resume(),e.then(()=>{this.emitter.emit(h.EVENT_RESUME)})):Promise.reject(new c(C.BAD_STATE)):Promise.resolve()}destroy(){this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_DESTROY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_DESTROY),this.implementation&&this.implementation.destroy()}getPosition(){let e=null;return this.implementation&&(e=this.implementation.getPosition()),e||0}setPosition(e){return this.implementation&&this.implementation.setPosition(e),this.played+=this.getPosition()-this.lastSkip,this.lastSkip=e,e}getDuration(){let e=null;return this.implementation&&(e=this.implementation.getDuration()),null===e?0:e}getLoaded(){return this.implementation?this.implementation.getLoaded():0}getPlayed(){let e=this.getPosition();return this.played+=e-this.lastSkip,this.lastSkip=e,this.played}getVolume(){return this.implementation?this.implementation.volumeLevel:0}setVolume(e){let t=0;return this.implementation&&(this.implementation.volumeLevel=e,t=e),t}getSpeed(){return this.implementation?this.implementation.speedLevel:0}setSpeed(e){let t=0;return this.implementation&&(this.implementation.speedLevel=e,t=e),t}isDeviceVolume(){return!this.implementation||this.implementation.isDeviceVolume()}isAutoplayable(){let e=null;return this.implementation&&(e=this.implementation.isAutoplayable()),null!==e&&e}generatePlayId(){this.playId=Math.random().toString().slice(2)}getPlayId(){return this.playId}}class x{pauseHandlers=[];core=new L;get source(){return this.core.source}play(e,t){return this.core.play(e,t)}setSrc(e,t){this.core.setSrc(e,t)}setProgress(e){let t=this.core.setPosition(e);return Promise.resolve(t)}pause(){return this.core.pause()}resume(){return this.core.resume()}setVolume(e){let t=this.core.setVolume(e);return Promise.resolve(t)}setSpeed(e){let t=this.core.setSpeed(e);return Promise.resolve(t)}stop(){return this.core.stop()}onAudioEnd(e){this.core.on(h.EVENT_ENDED,e)}onAudioPaused(e){let t=()=>{"paused"===this.core.getState()&&e()};this.pauseHandlers.push({handler:t,originalCallback:e}),this.core.on(h.EVENT_STATE,t)}onAudioResume(e){this.core.on(h.EVENT_RESUME,e)}onAudioUpdatingProgress(e){this.core.on(h.EVENT_PROGRESS,e)}onAudioSeeked(e){this.core.on(h.EVENT_SEEKED,e)}onAudioStalled(e){this.core.on(h.EVENT_STALLED,e)}onAudioCanplay(e){this.core.on(h.EVENT_CANPLAY,e)}onAudioPlaying(e){this.core.on(h.EVENT_PLAYING,e)}onAudioError(e){this.core.on(h.EVENT_ERROR,e)}onAudioVolumeChange(e){this.core.on(h.EVENT_VOLUMECHANGE,e)}onAudioSpeedChange(e){this.core.on(h.EVENT_RATECHANGE,e)}offAudioEnd(e){this.core.off(h.EVENT_ENDED,e)}offAudioPaused(e){let t=this.pauseHandlers.find(t=>t.originalCallback===e);t&&this.core.off(h.EVENT_STATE,t.handler)}offAudioResume(e){this.core.off(h.EVENT_RESUME,e)}offAudioUpdatingProgress(e){this.core.off(h.EVENT_PROGRESS,e)}offAudioSeeked(e){this.core.off(h.EVENT_SEEKED,e)}offAudioStalled(e){this.core.off(h.EVENT_STALLED,e)}offAudioCanplay(e){this.core.off(h.EVENT_CANPLAY,e)}offAudioPlaying(e){this.core.off(h.EVENT_PLAYING,e)}offAudioError(e){this.core.off(h.EVENT_ERROR,e)}offAudioVolumeChange(e){this.core.off(h.EVENT_VOLUMECHANGE,e)}offAudioSpeedChange(e){this.core.off(h.EVENT_RATECHANGE,e)}}var b=i(57413),g=i(14408),N=i(68244);class V{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("ApplyContextPlugin",()=>{let e=i.state.currentContext.value;e&&e instanceof N.$n&&e.apply({hooks:t,playback:i})})}}let S=null;function T(e){let t=e.state.queueState.index.value,i=e.state.currentContext.value,a=void 0!==e.state.queueState.order.value[t-1];i&&(i.availableActions.moveBackward.value=a),null!==S&&(S(),S=null),0===t&&(S=e.state.playerState.progress.onChange(e=>{i&&(i.availableActions.moveBackward.value=!!e&&e.position>N.lz)}))}var w=i(34603);function R(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:a}=i.entity.data,o=(0,b.xA)(t)||(0,b.Q7)(t)||"type"in a&&a.type&&w.UE.includes(a.type);o?(t.availableActions.repeat.value=!1,t.availableActions.shuffle.value=!1,e.state.queueState.repeat.value!==N.zq.NONE&&e.setRepeatMode(N.zq.NONE),e.state.queueState.shuffle.value&&e.toggleShuffle()):(t.availableActions.repeat.value=!0,t.availableActions.shuffle.value=!0)}}let M=e=>{let t="albums"in e&&e.albums&&e.albums.length>0&&e.albums[0]&&e.albums[0].type===w.VZ.PODCAST,i="type"in e&&e.type===w.Vc.PODCAST;return!!(i||t)};function H(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:e}=i.entity.data,a=M(e);t.availableActions.speed.value=!!a}}class k{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),t.beforeMediaStartPlaying.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),i.state.queueState.entityList.onChange(()=>{T(i)}),i.state.queueState.index.onChange(()=>{T(i)})}}class j{apply(e){let{playback:t,hooks:i}=e;t.state.playerState.event.onChange(()=>{let{currentEntity:e}=t.state.queueState;if(e.value)switch(t.state.playerState.event.value){case N.KX.PAUSED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.PAUSED}`});break;case N.KX.STALLED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.STALLED}`});break;case N.KX.PLAYING:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:`event-${N.KX.PLAYING}`});break;case N.KX.MEDIA_ELEMENT_ERROR:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.MEDIA_ELEMENT_ERROR}`})}}),i.beforeEntityPlayingProcessStart.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.clearTimeStagesOfPlayback(),Promise.resolve()}),i.afterMediaStartPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:"hook-afterMediaStartPlaying"}),Promise.resolve()}),i.afterMediaEndPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-afterMediaEndPlaying"}),Promise.resolve()}),i.beforeEntityChange.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeEntityChange"}),Promise.resolve()}),i.beforeContextSet.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeContextSet"}),Promise.resolve()})}}var B=i(42503),Z=i(59899);function I(){let e=new Date;return e.toISOString()}function O(e){let t;let{contextEntityPair:i,totalPlayedSeconds:a,endPositionSeconds:o,type:r,maxPlayerStage:n}=e,{entity:l,context:s}=i,d=String(l.data.meta.id),u=function(e){let t;if("albums"in e.data.meta){let{data:{meta:{albums:i}}}=e;if(i){let e=i[0];e&&(t=String(e.id))}}return t}(l),c=0;"durationMs"in l.data.meta&&l.data.meta.durationMs&&(c=l.data.meta.durationMs/1e3);let C=a,h=o;.5>Math.abs(c-a)&&(C=c),.5>Math.abs(c-o)&&(h=c),t=(0,b.Q7)(s)?{generativeStreamId:String(s.data.meta.stream?.id)}:{trackId:d};let m={playId:l.playId,timestamp:I(),totalPlayedSeconds:C,endPositionSeconds:h,trackLengthSeconds:c,albumId:u,from:s.from,context:s.data.type,contextItem:String(s.data.meta.id),addTracksToPlayerTime:l.addTracksToPlayerTime,audioAuto:"none",audioOutputName:"Динамик",audioOutputType:"Speaker",maxPlayerStage:n,...t};if((0,b.xA)(s)&&s.data.meta.session&&(m.radioSessionId=s.data.meta.session.radioSessionId,m.context="radio",m.contextItem=s.data.meta.session.wave.stationId),(0,b.KT)(s)&&(m.playlistId=`${s.data.meta.uid}:${s.data.meta.kind}`,m.contextItem=`${s.data.meta.uid}:${s.data.meta.kind}`),(0,b.dt)(s)){let e=[b.Zc.Search,b.Zc.Other],t=s.data.overrideContextType??b.Zc.Other;m.context=t,e.includes(t)&&(m.contextItem=null)}return{type:r,isSent:!1,data:m}}(a=r||(r={})).START="start",a.END="end";var q=i(63278);class D extends q.y{name="PlaysException";constructor(e,{code:t="E_PLAYS",...i}={}){super(e,{code:t,...i}),Object.setPrototypeOf(this,D.prototype)}}class U{entityPlaysMap={};playerStageByEntitiesPlayId=new Map;playsResource;variables;constructor(e){let{httpClient:t,playsResourceConfig:i,variables:a}=e;this.playsResource=new w.ol(t,i),this.variables=a||{}}apply(e){let{hooks:t,playback:i}=e;i.state.playerState.event.onChange(()=>{let{currentEntity:e}=i.state.queueState;e.value&&i.state.playerState.event.value===N.KX.PLAYING&&this.changePlayerStageByPlayId({playId:e.value.entity.playId,stage:w.KZ.PLAY})}),t.beforeEntityPlayingProcessStart.tapPromise("PlaysPlugin",()=>new Promise(e=>{this.sendStartEntityPlay(i,t),e()})),t.afterMediaEndPlaying.tapPromise("PlaysPlugin",()=>new Promise(e=>{let{index:{value:a},entityList:{value:o},repeat:{value:r}}=i.state.queueState;(a===o.length-1||r===N.zq.ONE)&&this.sendEndEntityPlay(i,t),e()})),t.afterError.tapPromise("PlaysPlugin",e=>((e instanceof Z.Tb||e instanceof N.YR)&&this.sendEndEntityPlay(i,t),Promise.resolve())),t.beforeContextSet.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()})),t.beforeEntityChange.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()}))}sendStartEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a){a.entity.playId=(0,B.Z)(),a.entity.addTracksToPlayerTime=`${Math.random().toString().slice(2)}-${Math.ceil(Number(new Date)/1e3)}`;let o=O({type:r.START,contextEntityPair:a,totalPlayedSeconds:0,endPositionSeconds:0});this.saveEntityPlay(o),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!0,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.variables.disableSendPlaysOnTrackStart?i():this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}sendEndEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a&&!(0,b.Q7)(a.context)){let o,n;let{entity:l}=a,s=this.entityPlaysMap[l.playId],d=!1;if(s&&(d=!!s.find(e=>e.type===r.END)),d){i();return}let u=a.entity.totalPlayedSeconds;this.variables.enableSendMaxPlayerStage&&(n=this.playerStageByEntitiesPlayId.get(l.playId)||w.KZ.PREPARE),o=0===u?O({type:r.END,contextEntityPair:a,totalPlayedSeconds:.1,endPositionSeconds:.1,maxPlayerStage:n}):O({type:r.END,contextEntityPair:a,totalPlayedSeconds:u,endPositionSeconds:e.state.playerState.progress.value.position,maxPlayerStage:n}),this.saveEntityPlay(o),this.playerStageByEntitiesPlayId.delete(o.data.playId),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!1,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}saveEntityPlay(e){let t=this.entityPlaysMap[e.data.playId];void 0===t?this.entityPlaysMap[e.data.playId]=[e]:t.push(e)}changePlayerStageByPlayId({playId:e,stage:t}){this.playerStageByEntitiesPlayId.set(e,t)}}(o=n||(n={})).PLAY="play",o.PAUSE="pause",o.NEXT="nexttrack",o.PREV="previoustrack",o.SEEK="seekto",o.STOP="stop";let z=[40,50,80,100,200,300,400],F=[n.PLAY,n.PAUSE,n.STOP,n.SEEK];class W{browserName;browserVersion;constructor({browserName:e,browserVersion:t}){this.browserName=e,this.browserVersion=t}isSupported(){return"mediaSession"in window.navigator&&"MediaMetadata"in window}handleMediaActionEvents(e,t){let{action:i}=e;switch(i){case n.PLAY:t.resume();break;case n.PAUSE:case n.STOP:t.pause();break;case n.NEXT:t.moveForward();break;case n.PREV:t.moveBackward();break;case n.SEEK:{if((0,g.OX)(t.state.queueState.currentEntity.value?.entity))return;let{seekTime:i}=e;i&&t.setProgress(i)}}}prepareMetadata(e){let t,i;let a={title:e.title};if("artists"in e){let t=(e.artists||[]).map(e=>e.name).join(", ");a.artist=t}if("albums"in e){let t=e.albums?.[0]?.title;a.album=t}return"coverUri"in e&&(t=e.coverUri),"imageUrl"in e&&(t=e.imageUrl),t&&(i=z.map(e=>{let i=`${e}x${e}`;return"Safari"===this.browserName&&(i=`${2*e}x${2*e}`),{sizes:i,src:`https://${t.replace("%%",i)}`,type:"image/jpg"}})),a.artwork=i,a}updateMetadata(e){if(!e)return;let t=this.prepareMetadata(e);window.navigator.mediaSession.metadata=new MediaMetadata(t)}handlePlayerEvents(e){let t,i;e.state.playerState.event.onChange(()=>{(e.state.playerState.event.value===N.KX.START||e.state.playerState.event.value===N.KX.UPDATING_PROGRESS)&&(this.updateMetadata(e.state.queueState.currentEntity.value?.entity.data.meta),(0,g.OX)(e.state.queueState.currentEntity.value?.entity)?navigator.mediaSession.setPositionState({duration:0,position:0}):navigator.mediaSession.setPositionState(),F.forEach(t=>{try{window.navigator.mediaSession.setActionHandler(t,t=>this.handleMediaActionEvents(t,e))}catch{console.log(`The media session action "${t}" is not supported yet.`)}}))}),e.state.currentContext.onChange(()=>{t?.(),i?.(),t=e.state.currentContext.value?.availableActions.moveBackward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveBackward.value??!1;window.navigator.mediaSession.setActionHandler(n.PREV,t?t=>this.handleMediaActionEvents(t,e):null)}),i=e.state.currentContext.value?.availableActions.moveForward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveForward.value??!1;window.navigator.mediaSession.setActionHandler(n.NEXT,t?t=>this.handleMediaActionEvents(t,e):null)})})}apply(e){let{playback:t}=e;this.isSupported()&&this.handlePlayerEvents(t)}}class Y{logger;constructor(e){let{logger:t}=e;this.logger=t}apply(e){let{hooks:t,playback:i}=e;t.afterError.tapPromise("LoggerPlugin",e=>{let t;let a=i.state.queueState.currentEntity.value?i.state.queueState.currentEntity.value.entity.mediaSource:null;return(t=e instanceof q.y?e:new q.y("Error in Sonata player",{code:"E_SONATA",cause:e})).name=`[Sonata] ${t.name}`,this.logger.error(t,{...t.data,...a||{},code:t.code,cause:t.cause,stack:t.stack}),Promise.resolve()})}}let G=[b.Ak.Album,b.Ak.Artist,b.Ak.Playlist,b.Ak.Various],K=(e,t)=>{let i=e.state.currentContext.value?.data;if(!i)return"";let a=i.type,o=e.state.queueState.entityList.value.length||0;return a===b.Ak.Various&&1===o&&(a="track"),i.type===b.Ak.Various&&i.overrideContextType&&(a=i.overrideContextType),`${t}-radio-${a}-autoflow`},J=e=>{let t=e.state.currentContext.value?.data;if(t){if(t.type===b.Ak.Album)return[`album:${t.meta.id}`];if(t.type===b.Ak.Artist)return[`artist:${t.meta.id}`];if(t.type===b.Ak.Playlist&&t.meta.owner?.uid&&t.meta.kind)return[`playlist:${t.meta.owner?.uid}_${t.meta.kind}`];if(t.type===b.Ak.Various){if(t.overrideAutoflowSeeds)return t.overrideAutoflowSeeds;let i=e.state.queueState.currentEntity.value?.entity.data.meta.id;return[`track:${i}`]}}};class ${contextFactory;platform;constructor({contextFactory:e,platform:t}){this.contextFactory=e,this.platform=t}apply(e){let{playback:t,hooks:i}=e;i.afterContextEnd.tapPromise("AutoflowPlugin",()=>{let e=t.state.currentContext.value?.data.type;return e&&G.includes(e)&&this.playAutoflow(t),Promise.resolve()})}playAutoflow(e){let t=e.state.currentContext.value?.data.type,i=J(e);if(!(t&&i))return;let a=this.contextFactory.create({data:{type:b.Ak.Vibe,meta:{id:b.Ak.Vibe},seeds:i,from:K(e,this.platform),includeTracksInResponse:!0}});e.playContext({context:a,loadContextMeta:!0})}}class X{quality;constructor(e){this.quality=e}apply(e){let{playback:t,hooks:i}=e;this.quality.onChange(()=>{t.state.playerState.status.value!==N.Xz.IDLE&&t.reloadEntity().catch(e=>{i.afterError.promise(e)})})}}class Q{streamsResource;timeoutId=0;constructor(e){let{httpClient:t,streamsResourceConfig:i}=e;this.streamsResource=new w.hd(t,i)}apply(e){let{hooks:t,playback:i}=e;t.beforeEntityChange.tapPromise("ContinuePlayingPlugin",()=>{let{position:e,duration:t}=this.getTimingsFromPlayback(i);return new Promise(a=>{e!==t&&this.checkBeforeProgressSync(i),a()})}),i.state.playerState.status.onChange(e=>{let{position:t,duration:a}=this.getTimingsFromPlayback(i);if(e===N.Xz.PAUSED||e===N.Xz.STOPPED){if(e===N.Xz.PAUSED&&t===a)return;this.clearTimeout(),this.checkBeforeProgressSync(i)}e===N.Xz.PLAYING&&this.shouldSendProgressSync(i)&&this.setTimeout(i)})}checkBeforeProgressSync(e){if(this.clearTimeout(),!this.shouldSendProgressSync(e))return;let{position:t,duration:i}=this.getTimingsFromPlayback(e),a=e.state.queueState.currentEntity.value?.entity.data.meta.id;Number.isFinite(i)&&Number.isFinite(t)&&i&&t&&a&&(this.sendProgressSync({duration:i,position:t,trackId:a}),e.state.playerState.status.value===N.Xz.PLAYING&&this.setTimeout(e))}sendProgressSync(e){let t=new Date().toISOString(),{duration:i,position:a,trackId:o}=e;this.streamsResource.progressSync({lastSyncTimestamp:t,trackStreams:[{trackId:o,positionSec:a,trackLengthSec:i,finished:a===i,timestamp:t}]})}shouldSendProgressSync(e){let t=e.state.queueState.currentEntity.value?.entity.data.meta;return!!(t&&"rememberPosition"in t&&t.rememberPosition)}setTimeout(e){this.clearTimeout(),this.timeoutId=window.setTimeout(()=>{this.checkBeforeProgressSync(e)},18e4)}clearTimeout(){window.clearTimeout(this.timeoutId)}getTimingsFromPlayback(e){return{duration:Math.floor(e.state.playerState.progress.value.duration),position:Math.floor(e.state.playerState.progress.value.position)}}}var ee=i(45412),et=i(86502),ei=i(66026),ea=i(57921),eo=i(69559),er=i(68085),en=i(5674);let el=null,es=null,ed=null,eu=(0,s.Pi)(e=>{let{children:t,hostTld:i,userAgent:a,quality:o}=e,r=(0,en.uK)(),{sonataState:n,experiments:s,library:u,user:c}=(0,en.oR)(),C=(0,en.wL)(),h=r.get(en.V0),{language:m}=(0,en.ZS)(),p=(0,d.useMemo)(()=>(el||(el=new Z.$J(o)),el),[o]),v=(0,d.useMemo)(()=>{if(es)return es;let e=r.get(en.U5),t=r.get(en.pI),o=t({credentials:"include"}),n=r.get(en.xi),{resources:l,player:{gateway:{prefixUrl:d,headers:c}}}=e,{timeouts:h,retryPolicyConfig:v}=l.musicExternalApi,E=new b.Tg({httpClient:o,logger:C,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,resourceTimeoutsConfig:h,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},contextVariables:{vibe:{get sendFeedbackToSessionTracks(){return s.checkExperiment(en.pe.WebNextWaveNewFeedbacks,"on")}}}}}),f=new g.nS({likeStore:u}),{overembed:_,externalDomain:y,...A}={params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},overembed:e.player.overembed,externalDomain:e.player.externalDomain},P=new Z.Ez({downloadInfoProviderParams:{httpClient:o,resourceConfig:{...A,overembed:_,externalDomain:y},secretKey:e.player.secretKey,mediaConfigController:p},getFileInfoProviderParams:{httpClient:o,resourceConfig:A,secretKey:e.player.secretKey,mediaConfigController:p,transport:w.J7.RAW,variables:{get useNewCorrespondenceBetweenQualityParams(){return s.checkExperiment(en.pe.WebNextEnableNewQuality,"on")}}},variables:{get switchToStrmWithoutEncrypt(){return s.checkExperiment(en.pe.WebNextSwitchToStrmWithoutEncrypt,"on")}}}),L=new Z.sd({httpClient:o,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}}),N=new x;return es=new et.$7({contextFactory:E,entityFactory:f,audioCore:N,mediaProvider:P,entityProvider:L,windowPaginationConfig:{windowSize:30,setupQueueWindowSize:80},config:{mediaElementErrorReloadCount:2},plugins:[new k,new V,new j,new U({httpClient:o,playsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}},variables:{get disableSendPlaysOnTrackStart(){return s.checkExperiment(en.pe.WebNextDisableSendPlaysOnTrackStart,"on")},get enableSendMaxPlayerStage(){return s.checkExperiment(en.pe.WebPlayAudioSendPrepare,"on")}}}),new W({browserName:a.browserName,browserVersion:a.browserVersion}),new Y({logger:C}),new $({contextFactory:E,platform:"desktop"}),new X(p.quality),new Q({httpClient:o,streamsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}})]})},[s,r,C,i,p,a.browserName,a.browserVersion,m,u]),E=(0,d.useMemo)(()=>(ed||(null==v?void 0:v.source)&&(ed="Safari"===a.browserName?new ei.Qz:new ei.WZ(v.source)),ed),[null==v?void 0:v.source,a.browserName]);v&&(0,ea.A4)(v),(0,d.useEffect)(()=>{let e,t,i,a,o;let r=null==v?void 0:v.state.queueState.currentEntity.onChange(e=>{var t;let i=null==e?void 0:e.context.data.type,a=null==e?void 0:e.context.data.meta.id;n.setEntityMeta(null!==(t=null==e?void 0:e.entity)&&void 0!==t?t:null),i&&n.setContextType(i),a&&n.setContextId(a)}),l=null==v?void 0:v.state.queueState.order.onChange(e=>{let t=v.state.queueState.index.value;if(e){let i=e[t];v.state.queueState.order.value.length>0&&"number"==typeof i&&n.setCurrentlyPlayingTrackIndex(i)}}),s=null==v?void 0:v.state.playerState.status.onChange(e=>{e&&(n.setStatus(e),(0,ea.Pt)({isPlaying:e===et.Xz.PLAYING}))}),d=null==v?void 0:v.state.currentContext.onChange(()=>{var r,l,s,d,u,c,C,m,p,E,f;null===(r=e)||void 0===r||r(),null===(l=t)||void 0===l||l(),null===(s=i)||void 0===s||s(),null===(d=a)||void 0===d||d(),null===(u=o)||void 0===u||u();let _=null!==(f=h.get(en.BU.YmPlayerRepeatMode))&&void 0!==f?f:ee.zq.NONE;v.setRepeatMode(_);let y=!!h.get(en.BU.YmPlayerShuffle);v.setShuffle(y),e=null==v?void 0:null===(c=v.state.currentContext.value)||void 0===c?void 0:c.availableActions.moveBackward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value);n.setCanMoveBackward(t),(0,ea.Pt)({canMoveBackward:t})}),t=null==v?void 0:null===(C=v.state.currentContext.value)||void 0===C?void 0:C.availableActions.moveForward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value);n.setCanMoveForward(t),(0,ea.Pt)({canMoveForward:t})}),i=null==v?void 0:null===(m=v.state.currentContext.value)||void 0===m?void 0:m.availableActions.repeat.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.repeat.value;"boolean"==typeof t&&n.setCanChangeRepeatMode(t)}),a=null==v?void 0:null===(p=v.state.currentContext.value)||void 0===p?void 0:p.availableActions.shuffle.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.shuffle.value;"boolean"==typeof t&&n.setCanShuffle(t)}),o=null==v?void 0:null===(E=v.state.currentContext.value)||void 0===E?void 0:E.availableActions.speed.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.speed.value;"boolean"==typeof t&&(n.setCanSpeed(t),!t&&v&&v.setSpeed(1))})}),u=null==v?void 0:v.state.playerState.volume.onChange(()=>{let e=v.state.playerState.volume.value;"number"==typeof e&&n.setVolume(e)}),c=null==v?void 0:v.state.queueState.repeat.onChange(()=>{let e=v.state.queueState.repeat.value;n.setRepeatMode(e),h.set(en.BU.YmPlayerRepeatMode,e)}),C=null==v?void 0:v.state.queueState.shuffle.onChange(()=>{let e=v.state.queueState.shuffle.value;n.setShuffle(e),h.set(en.BU.YmPlayerShuffle,e)});return()=>{null==r||r(),null==l||l(),null==s||s(),null==d||d(),null==u||u(),null==c||c(),null==C||C()}},[v,n,h]),(0,d.useEffect)(()=>{let e=h.get(en.BU.YmPlayerVolume);"number"==typeof e?(null==v||v.setVolume(e),n.setVolume(e)):(null==v||v.setVolume(1),n.setVolume(1))},[h,v,n]);let f=(0,d.useMemo)(()=>{let e=s.checkExperiment(en.pe.WebNextEnableNewQuality,"on");if(!c.hasPlus)return Z.nJ.PREVIEW;let t=h.get(en.BU.YmPlayerQuality);return(e||t!==Z.nJ.HQ_PLUS)&&t||(h.set(en.BU.YmPlayerQuality,Z.nJ.HQ),Z.nJ.HQ)},[s,c.hasPlus,h]);return(0,d.useEffect)(()=>{p.setQuality(f),n.setQuality(f)},[p,n,f]),(0,l.jsx)(en.Xe.Provider,{value:p,children:(0,l.jsx)(en.R8.Provider,{value:v,children:(0,l.jsx)(eo.y5.Provider,{value:E,children:t})})})})},42622:function(e,t,i){"use strict";i.r(t),i.d(t,{ThemeProvider:function(){return n}});var a=i(8759),o=i(99616),r=i(5674);let n=e=>{let{children:t}=e,i=(0,r.uK)(),n=i.get(r.V0),l=(0,r.oz)(),[s,d]=(0,o.useState)((0,r.NK)(n.get(r.BU.Theme),l));(0,o.useEffect)(()=>{(0,r.kz)(n.get(r.BU.Theme))},[n]),(0,o.useEffect)(()=>{n.get(r.BU.Theme)===r.rL&&d(l)},[l,n]);let u=(0,o.useMemo)(()=>({theme:s,setTheme:d}),[s]);return(0,a.jsx)(r.Ni.Provider,{value:u,children:t})}},19976:function(e,t,i){"use strict";i.r(t),i.d(t,{TranslationsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(17516),n=i(28151),l=i(5674);let s=e=>{let{children:t}=e,{dictionary:i,language:s,defaultLanguage:d}=(0,l.ZS)(),u=(0,l.wL)(),c=(0,o.useCallback)(e=>{if("code"in e&&e.code===r.bc.MISSING_DATA)return;let t=e&&"object"==typeof e&&"code"in e&&e.code,i="IntlProviderError";t&&(i+=":".concat(t)),u.error(i,{error:null==e?void 0:e.message,stack:null==e?void 0:e.stack})},[u]);return(0,a.jsx)(n.Z,{onError:c,defaultLocale:d,locale:s,messages:i,children:t})}},98125:function(e,t,i){"use strict";i.d(t,{F:function(){return v},K:function(){return h}});var a=i(8759),o=i(35338),r=i(33423),n=i(99616),l=i(65244),s=i(454),d=i(15527),u=i(14581),c=i(22926),C=i(5674);let h=()=>{let e=(0,C.uK)(),t=e.get(C.V0),i=(0,C.R$)();return(0,n.useCallback)(async e=>{var a;if(0!==e)t.set(C.BU.YmPlayerPrevVolume,e),await (null==i?void 0:i.setVolume(0)),t.set(C.BU.YmPlayerVolume,0);else{let e=null!==(a=t.get(C.BU.YmPlayerPrevVolume))&&void 0!==a?a:1;t.remove(C.BU.YmPlayerPrevVolume),await (null==i?void 0:i.setVolume(e)),t.set(C.BU.YmPlayerVolume,e)}},[i,t])};var m=i(73939),p=i.n(m);let v=(0,r.Pi)(e=>{var t,i;let{className:r}=e,{formatMessage:m}=(0,l.Z)(),v=(0,C.uK)(),E=(0,C.R$)(),{sonataState:f}=(0,C.oR)(),_=h(),y=v.get(C.V0),A=null!==(i=null!==(t=y.get(C.BU.YmPlayerVolume))&&void 0!==t?t:f.volume)&&void 0!==i?i:1,P=(0,n.useCallback)(e=>{null==E||E.setVolume(e),y.set(C.BU.YmPlayerVolume,e)},[E,y]),L=(0,n.useCallback)(async()=>{await _(f.volume)},[_,f.volume]),x=m(0===f.volume?{id:"player-actions.volume-on"}:{id:"player-actions.volume-off"});return(0,a.jsxs)("div",{className:(0,o.W)(p().root,r),children:[(0,a.jsx)(d.z,{radius:"round",size:"xxxs",variant:"text",withRipple:!1,onClick:L,"aria-label":x,icon:(0,a.jsx)(u.J,{size:"xs",className:p().icon,variant:0===A?"volumeOff":"volume"}),className:p().button,...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_BUTTON)}),(0,a.jsx)(c.i,{thumbSize:"s",trackSize:"s",value:A,maxValue:1,step:.01,onChange:P,"aria-label":m({id:"player-actions.volume-control"}),...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_SLIDER)})]})})},65151:function(e,t,i){"use strict";i.d(t,{t:function(){return s}});var a=i(8759),o=i(99616),r=i(45412),n=i(5674),l=i(34512);let s=()=>{let{notify:e}=(0,n.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,n.oR)(),s=(0,n.R$)();return(0,o.useCallback)(()=>{if(null===t.entityMeta||!t.canChangeRepeatMode)return;let o=r.zq.NONE;switch(t.repeatMode){case r.zq.NONE:o=r.zq.CONTEXT;break;case r.zq.CONTEXT:o=r.zq.ONE}null==s||s.setRepeatMode(o),e((0,a.jsx)(l.NotificationRepeat,{repeatMode:o}),{containerId:i.isOpened?n.W$.FULLSCREEN_INFO:n.W$.INFO})},[i.isOpened,e,s,t.canChangeRepeatMode,t.entityMeta,t.repeatMode])}},37960:function(e,t,i){"use strict";i.d(t,{m:function(){return l}});var a=i(8759),o=i(99616),r=i(5674),n=i(74758);let l=()=>{let{notify:e}=(0,r.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,r.oR)(),l=(0,r.R$)();return(0,o.useCallback)(()=>{null!==t.entityMeta&&t.canShuffle&&(null==l||l.toggleShuffle(),e((0,a.jsx)(n.NotificationShuffle,{shuffle:!!(null==l?void 0:l.state.queueState.shuffle.value)}),{containerId:i.isOpened?r.W$.FULLSCREEN_INFO:r.W$.INFO}))},[i.isOpened,e,l,t.canShuffle,t.entityMeta])}},34512:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationRepeat:function(){return h}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(45412),s=i(14581),d=i(1918),u=i(44285),c=i(55075),C=i.n(c);let h=e=>{let{repeatMode:t,closeToast:i}=e,c=t===l.zq.ONE?"repeat_one":"repeat",h=(0,r.useMemo)(()=>{let e;switch(t){case l.zq.CONTEXT:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-context"});break;case l.zq.ONE:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-track"});break;case l.zq.NONE:default:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-none"})}return(0,a.jsx)(d.Caption,{className:C().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(u.Yj,{cover:(0,a.jsx)(s.J,{className:(0,o.W)(C().icon,{[C().icon_unset]:t===l.zq.NONE}),size:"xs",variant:c}),message:h,closeToast:i})}},74758:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationShuffle:function(){return C}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(14581),s=i(1918),d=i(44285),u=i(46520),c=i.n(u);let C=e=>{let{shuffle:t,closeToast:i}=e,u=(0,r.useMemo)(()=>{let e;return e=t?(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-enabled"}):(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-disabled"}),(0,a.jsx)(s.Caption,{className:c().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(d.Yj,{cover:(0,a.jsx)(l.J,{className:(0,o.W)(c().icon,{[c().icon_unset]:!t}),size:"xs",variant:"shuffle"}),message:u,closeToast:i})}},6769:function(e,t,i){"use strict";i.r(t),i.d(t,{RepeatButton:function(){return m}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(45412),s=i(15527),d=i(14581),u=i(65151),c=i(20873),C=i.n(c);let h=(e,t,i)=>t(e===l.zq.NONE||i?{id:"player-actions.repeat"}:e===l.zq.ONE?{id:"player-actions.repeat-one"}:{id:"player-actions.repeat-context"}),m=e=>{let{isDisabled:t,repeatMode:i,className:c,iconClassName:m,size:p="xxxs",iconSize:v="xs",color:E,variant:f="default"}=e,_=(0,u.t)(),{formatMessage:y}=(0,r.Z)(),A=t||i!==l.zq.ONE?"repeat":"repeat_one",P=h(i,y,t);return(0,a.jsx)(s.z,{className:c,radius:"round",size:p,variant:f,color:E,disabled:t,withRipple:!1,"aria-label":P,"aria-pressed":!t&&i!==l.zq.NONE,onClick:_,icon:(0,a.jsx)(d.J,{size:v,variant:A,className:(0,o.W)(C().repeatIcon,C()["repeatIcon_".concat(i)],{[C().repeatIcon_disabled]:t},m)}),...(0,n.BA)(n.bG.sonata.REPEAT_BUTTON)})}},66403:function(e,t,i){"use strict";i.r(t),i.d(t,{ShuffleButton:function(){return C}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(15527),s=i(14581),d=i(37960),u=i(94406),c=i.n(u);let C=e=>{let{isDisabled:t,shuffle:i,className:u,size:C="xxxs",variant:h="default",iconSize:m="xs",color:p}=e,v=(0,d.m)(),{formatMessage:E}=(0,r.Z)();return(0,a.jsx)(l.z,{className:u,radius:"round",size:C,variant:h,color:p,withRipple:!1,disabled:t,"aria-label":E({id:"player-actions.shuffle"}),"aria-pressed":!t&&i,icon:(0,a.jsx)(s.J,{variant:"shuffle",size:m,className:(0,o.W)(c().shuffleIcon,{[c().shuffleIcon_disabled]:t,[c().shuffleIcon_on]:!t&&i,[c().shuffleIcon_off]:!t&&!i})}),onClick:v,...(0,n.BA)(n.bG.sonata.SHUFFLE_BUTTON)})}},21871:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataControls:function(){return w}});var a=i(8759),o=i(33423),r=i(99616),n=i(86502),l=i(5674),s=i(65151),d=i(37960),u=i(35338),c=i(65244),C=i(454),h=i(15527),m=i(14581),p=i(44285),v=i(6769),E=i(66403),f=i(19035),_=i.n(f);let y=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,shuffle:s,onClickNext:d,onClickPrev:f,onClickPlayPause:y,canChangeRepeatMode:A,className:P}=e,{formatMessage:L}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(_().root,P),children:[(0,a.jsx)("div",{className:_().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:_().sonataButton,size:"xxxs",variant:"text",iconSize:"xs",isDisabled:t,shuffle:s})}),(0,a.jsxs)("div",{className:_().sonataButtons,children:[(0,a.jsx)(h.z,{className:_().sonataButton,variant:"text",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":L({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:f,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:_().sonataButton,iconSize:"l",variant:"filled",isPlaying:i,iconClassName:_().playButtonIcon,onClick:y}),(0,a.jsx)(h.z,{className:_().sonataButton,radius:"round",size:"m",variant:"text",disabled:!r,withRipple:!1,"aria-label":L({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:d,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:_().buttonContainer,children:(t||A)&&(0,a.jsx)(v.RepeatButton,{className:_().sonataButton,size:"xxxs",variant:"text",isDisabled:t,iconSize:"xs",repeatMode:o})})]})});var A=i(57004);let P=e=>{let{disabled:t,isPlaying:i,onClickPlayPause:o,className:r}=e;return(0,a.jsx)(A.PlayButton,{className:r,size:"s",disabled:t,isPlaying:i,onClick:o})};var L=i(24516),x=i.n(L);let b=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,onClickNext:s,onClickPrev:d,onClickPlayPause:f,canChangeRepeatMode:_,shuffle:y,className:A}=e,{formatMessage:P}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(x().root,A),children:[(0,a.jsx)("div",{className:x().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:x().sonataButton,size:"s",iconSize:"xxs",color:"secondary",isDisabled:t,shuffle:y})}),(0,a.jsxs)("div",{className:x().sonataButtons,children:[(0,a.jsx)(h.z,{className:x().sonataButton,color:"secondary",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":P({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:d,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:x().sonataButton,iconSize:"m",size:"l",radius:"round",color:"secondary",buttonVariant:"default",isPlaying:i,iconClassName:x().playPauseButtonIcon,onClick:f}),(0,a.jsx)(h.z,{className:x().sonataButton,radius:"round",size:"m",color:"secondary",disabled:!r,withRipple:!1,"aria-label":P({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:s,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:x().buttonContainer,children:(t||_)&&(0,a.jsx)(v.RepeatButton,{className:x().sonataButton,size:"s",color:"secondary",isDisabled:t,iconSize:"xxs",repeatMode:o})})]})});var g=i(57413),N=i(43310),V=i(3273),S=i.n(V);let T=(0,o.Pi)(e=>{let{isPlaying:t,canMoveForward:i,canMoveBackward:o,onClickNext:n,onClickPrev:s,onClickPlayPause:d,className:C}=e,{formatMessage:v}=(0,c.Z)(),{user:E,sonataState:f}=(0,l.oR)(),_=(0,l.XU)(),y=f.entityMeta,A=f.contextType===g.Ak.Generative,P=E.isAuthorized&&!A,L=(0,N.SB)(f.entityMeta),x=(0,N.KX)(f.entityMeta);return(0,r.useEffect)(()=>{if(!f.isGenerativeContext)return null==_||_.addShortcutsListener(l.yx.LIKE,L),null==_||_.addShortcutsListener(l.yx.DISLIKE,x),()=>{null==_||_.removeShortcutsListener(l.yx.LIKE),null==_||_.removeShortcutsListener(l.yx.DISLIKE)}},[x,L,_,f.isGenerativeContext]),(0,a.jsxs)("div",{className:(0,u.W)(S().root,C),children:[(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.Q1,{isDisliked:y.isDisliked,onClick:x})}),(0,a.jsxs)("div",{className:S().sonataButtons,children:[(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",color:"secondary",size:"m",radius:"round",disabled:!o,withRipple:!1,"aria-label":v({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:s}),(0,a.jsx)(p.JM,{className:S().sonataButton,iconSize:"xxl",variant:"filled",color:"secondary",isPlaying:t,iconClassName:S().playPauseButtonIcon,onClick:d}),(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",radius:"round",size:"m",color:"secondary",disabled:!i,withRipple:!1,"aria-label":v({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:n})]}),(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.dJ,{isLiked:y.isLiked,onClick:L})})]})}),w=(0,o.Pi)(e=>{var t,i;let{isMobile:o,entityMeta:u,isFullscreen:c,className:C}=e,{sonataState:h,vibe:m}=(0,l.oR)(),p=(0,l.XU)(),v=(0,l.R$)(),{togglePlay:E}=(0,l.Qh)({seeds:null!==(i=null===(t=m.meta)||void 0===t?void 0:t.seeds)&&void 0!==i?i:[],pageIdForFrom:l.Rh.HOME,blockIdForFrom:l.BE.RUP_MAIN_RADIO}),f=(0,r.useMemo)(()=>{let e=[n.Xz.PLAYING,n.Xz.LOADING_MEDIA_SOURCE,n.Xz.LOADING_MEDIA_DATA];return e.includes(h.status)},[h.status]),_=(0,r.useCallback)(()=>{u?null==v||v.togglePause():E()},[u,v,E]),A=(0,r.useCallback)(()=>{null==v||v.moveForward()},[v]),L=(0,r.useCallback)(()=>{null==v||v.moveBackward()},[v]),x=(0,d.m)(),g=(0,s.t)();(0,r.useEffect)(()=>{if(!c)return null==p||p.addShortcutsListener(l.yx.TOGGLE_PLAY,_),null==p||p.addShortcutsListener(l.yx.TOGGLE_REPEAT,g),null==p||p.addShortcutsListener(l.yx.TOGGLE_SHUFFLE,x),()=>{null==p||p.removeShortcutsListener(l.yx.TOGGLE_PLAY),null==p||p.removeShortcutsListener(l.yx.TOGGLE_SHUFFLE),null==p||p.removeShortcutsListener(l.yx.TOGGLE_REPEAT)}},[c,_,g,x,p]);let N=(0,r.useMemo)(()=>c?o?T:b:o?P:y,[o,c]);return(0,a.jsx)(N,{className:C,disabled:null===h.entityMeta,isPlaying:f,canMoveBackward:h.canMoveBackward,canMoveForward:h.canMoveForward,canShuffle:h.canShuffle,shuffle:h.shuffle,onClickPlayPause:_,onClickNext:A,onClickPrev:L,canChangeRepeatMode:h.canChangeRepeatMode,repeatMode:h.repeatMode})})},68085:function(e,t,i){"use strict";i.d(t,{$:function(){return d}});var a,o,r=i(28307),n=i(93991),l=i(39351);(a=o||(o={})).WEB="YandexMusicWebNext",a.DESKTOP="YandexMusicDesktopApp";let s=(e,t)=>"".concat(e,"/").concat(t),d=()=>{{let e=(0,l.b)()||"1.0",t="".concat(o.DESKTOP).concat((0,n.y)((0,r.X)()));return s(t,e)}}},93991:function(e,t,i){"use strict";i.d(t,{y:function(){return o}});var a=i(38060);let o=e=>{switch(e){case"win32":return a.B.WINDOWS;case"darwin":return a.B.MACOS;case"linux":return a.B.LINUX}return null}},38060:function(e,t,i){"use strict";var a,o;i.d(t,{B:function(){return a}}),(o=a||(a={})).WINDOWS="Windows",o.MACOS="MacOS",o.LINUX="Linux"},2365:function(e,t,i){"use strict";i.d(t,{T:function(){return a.NotFound}});var a=i(54529)},54529:function(e,t,i){"use strict";i.r(t),i.d(t,{NotFound:function(){return m}});var a=i(8759),o=i(35338),r=i(33423),n=i(2814),l=i(15527),s=i(14581),d=i(1918),u=i(42769),c=i(5674),C=i(94170),h=i.n(C);let m=(0,r.Pi)(e=>{let{className:t}=e,{contentRef:i}=(0,c.$Y)(),r=(0,c.s0)("/");return(0,c.ZP)(!0),(0,a.jsxs)("div",{className:(0,o.W)(h().root,{[h().root_desktop]:!i},t),children:[(0,a.jsx)(u.n,{withBackwardFallback:"/",className:h().navigation,withForwardControl:!1}),(0,a.jsxs)("div",{className:h().content,children:[(0,a.jsx)(s.J,{className:h().icon,variant:"musicLogo",size:"xxl"}),(0,a.jsx)(d.Heading,{className:(0,o.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist"})}),(0,a.jsx)(d.Caption,{className:(0,o.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist-description"})}),(0,a.jsx)(l.z,{onClick:r,className:h().button,role:"link",color:"secondary",size:"l",radius:"xxxl",children:(0,a.jsx)(d.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(n.Z,{id:"navigation.page-main"})})})]})]})})},48157:function(e,t,i){"use strict";i.d(t,{hx:function(){return O},f3:function(){return ea},Vm:function(){return eg},KC:function(){return eT}});var a,o=i(8759),r=i(35338),n=i(33423),l=i(99616),s=i.t(l,2),d=i(65244),u=i(2814),c=i(454),C=i(57413),h=i(15527),m=i(14581),p=i(96437),v=i(1918),E=i(96911),f=i(96169),_=i(81446),y=i(5674),A=i(44285);let P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.filter(e=>!e.composer),i=t.filter(e=>!e.various),a=e.filter(e=>e.composer&&!e.various),o=[];return i.length>0?o=i:t.length>0&&(o=t),o.concat(a)};var L=i(33779),x=i.n(L),b=i(13236),g=i(41342),N=i.n(g);let V=(0,n.Pi)(e=>{let{className:t,text:i="",maxTextLength:a,minTextLength:n,variant:s="input",shouldFinishOnKeyPress:d=!1,placeholder:u,onChangeFinish:c}=e,[C,h]=(0,l.useState)(i),m=(0,l.useRef)(!1),p=(0,l.useRef)(null),v=(0,l.useCallback)(e=>{h(e.target.value)},[]),E=(0,l.useCallback)(e=>{if(d&&["Enter","Escape"].includes(e.key)){var t;"Escape"===e.key&&(m.current=!0),null===(t=e.currentTarget)||void 0===t||t.blur()}},[d]),f=(0,l.useCallback)(()=>{let e=C.trim();m.current||n&&e.length{p.current&&(p.current.selectionStart=p.current.value.length,p.current.selectionEnd=p.current.value.length)},[]),(0,l.useLayoutEffect)(()=>{let e=p.current;if(e){e.style.height="0px";let t=e.scrollHeight;e.style.height="".concat(t,"px")}},[p,C]);let _=(0,l.useMemo)(()=>"textarea"===s?e=>(0,o.jsx)("textarea",{ref:p,rows:6,...e}):e=>(0,o.jsx)("input",{...e}),[s]);return(0,o.jsx)(_,{className:(0,r.W)(N().root,t,{[N().root_textarea]:"textarea"===s}),type:"text",value:C,maxLength:a,onBlur:f,onChange:v,onKeyDown:E,placeholder:u,autoFocus:!0})});var S=i(74081),T=i.n(S);let w=(0,n.Pi)(e=>{let{title:t="","aria-labelledby":i,canChange:a=!1,onChange:n,maxTitleLength:s,version:u="",onVersionClick:C,className:p}=e,{settings:E}=(0,y.oR)(),{formatMessage:f}=(0,d.Z)(),[_,A]=(0,l.useState)(!1),P=(0,l.useRef)(null),L=E.layout===y.t8.Mobile,x=t.length+u.length,g=x>25,N=(0,l.useMemo)(()=>L?T().font_mobile:g?T().font_long:T().font_short,[L,g]),S=!L&&a&&_,w=(0,l.useCallback)(()=>{var e;A(!0),null===(e=P.current)||void 0===e||e.focus()},[]),R=(0,l.useCallback)(e=>{A(!1),null==n||n(e)},[n]);return(0,o.jsxs)(o.Fragment,{children:[!S&&(0,o.jsxs)("div",{className:(0,r.W)(T().root,p),children:[(0,o.jsx)(b.b4,{title:t,className:T().stickyTitle,children:(0,o.jsxs)(v.Heading,{variant:"h2",id:i,className:(0,r.W)(T().heading,{[T().heading_withVersion]:u}),...(0,c.BA)(c.QM.pageHeader.ENTITY_TITLE),children:[(0,o.jsx)(v.Caption,{className:(0,r.W)(T().font,N,T().title),variant:"span",children:t}),u&&(0,o.jsx)(v.Caption,{onClick:C,className:(0,r.W)(T().font,N,T().version,{[T().version_withOtherVersions]:C}),variant:"span",...(0,c.BA)(c.QM.pageHeader.ENTITY_VERSION),children:" ".concat(u)})]})}),a&&(0,o.jsx)("div",{className:(0,r.W)(T().editButton,{[T().editButton_centered]:!g&&!L}),children:(0,o.jsx)(h.z,{onClick:w,"aria-label":f({id:"playlist-actions.change-title"}),icon:(0,o.jsx)(m.J,{size:"xxs",variant:"pencil"}),size:"s",radius:"round",...(0,c.BA)(c.QM.pageHeader.EDIT_TITLE_BUTTON)})})]}),S&&(0,o.jsx)("div",{className:T().textFieldContainer,children:(0,o.jsx)(V,{text:t,className:(0,r.W)(T().font,N,T().textField,T().title,{[T().textField_long]:g&&!L}),onChangeFinish:R,maxTextLength:s,minTextLength:1,placeholder:f({id:"playlist-actions.enter-title"}),shouldFinishOnKeyPress:!0})})]})}),R=(0,n.Pi)(e=>{let{"aria-labelledby":t,entityName:i,title:a,meta:n,controls:s,className:d,forwardRef:u,canChangeTitle:C=!1,maxTitleLength:h,onTitleChange:m,cover:p,version:E,onVersionClick:f,disclaimerLabel:_,entityNameIcon:y}=e,A=(0,l.isValidElement)(_),P=(0,l.useMemo)(()=>A?(0,o.jsx)("div",{className:x().entityContainer,children:_}):(0,o.jsxs)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:x().entityName,children:[i,y]}),[_,i,y,A]);return(0,o.jsxs)("div",{className:(0,r.W)(x().root,d),ref:u,...(0,c.BA)(c.QM.pageHeader.ENTITY_HEADER),children:[(0,o.jsx)("div",{className:x().coverCell,children:p}),(0,o.jsxs)("div",{className:x().content,children:[(0,o.jsxs)("div",{className:x().info,children:[P,(0,o.jsx)(w,{className:(0,r.W)(x().title,{[x().title_withDisclaimerLabel]:A}),title:a,"aria-labelledby":t,canChange:C,maxTitleLength:h,onChange:m,version:E,onVersionClick:f}),!!n&&(0,o.jsx)("div",{className:(0,r.W)(x().meta,{[x().meta_withDisclaimerLabel]:A}),children:n})]}),(0,o.jsx)("div",{className:x().controls,children:s})]})]})}),M=(0,l.forwardRef)((e,t)=>(0,o.jsx)(R,{forwardRef:t,...e}));var H=i(86252),k=i.n(H);let j=e=>{let{coverVariant:t,coverUri:i,isAvailable:a,className:r,withBookmateBadge:n}=e;return(0,o.jsxs)(p.Paper,{radius:"round"===t?"round":"m",className:r,children:[(0,o.jsx)(A.BE,{fit:"cover",src:i,size:300,className:k().coverImage,withAvatarReplace:!0,isAvailable:a}),n&&(0,o.jsx)(m.J,{variant:"bookmateBadge",className:k().bookmateBadge})]})};var B=i(89998),Z=i.n(B);let I=(0,n.Pi)(e=>{var t,i,a;let n,{album:s,className:L,"aria-labelledby":x,forwardRef:b,onVersionClick:g}=e,N=(0,y.x5)({pageId:y.Rh.ALBUM,blockId:y.aU.ALBUM}),{formatMessage:V}=(0,d.Z)(),{settings:S,sonataState:{status:T,unloadedEntitiesData:w},experiments:R}=(0,y.oR)(),[H,k]=(0,l.useState)(!1),B=(0,f.SB)(s),I=(0,f.BV)(s),O=S.layout===y.t8.Mobile,q=R.checkExperiment(y.pe.WebPins,"on")&&!O,D=(0,f.TL)(s),U=(0,y.uK)(),z=U.get(y.U5),F=z.features.nonMusic&&s.isPodcast;F&&(n=s.isLiked?V({id:"interface-actions.subscribed"}):V({id:"interface-actions.subscribe"}));let W=(0,l.useMemo)(()=>P(s.artists),[s.artists]),Y=(null==W?void 0:W.length)===1&&!(null===(t=W[0])||void 0===t?void 0:t.decomposed)&&!(null===(i=W[0])||void 0===i?void 0:i.various),G=(0,f.H0)(s.type),{isPlaying:K,togglePlay:J}=(0,y.qm)({playContextParams:{contextData:{type:C.Ak.Album,meta:{id:s.id},from:N},loadContextMeta:!0,entitiesData:w},sonataStatus:T}),$=(0,o.jsxs)("div",{className:Z().meta,children:[Y&&(0,o.jsx)(p.Paper,{radius:"round",className:Z().artistCover,children:(0,o.jsx)(A.BE,{src:null===(a=W[0])||void 0===a?void 0:a.coverUri,size:30,withAvatarReplace:!0})}),(0,o.jsx)(_.jO,{artists:W,lineClamp:O?1:void 0,className:Z().artists,spoilerClassName:Z().artistsSpoiler,visibleArtistsCount:O?void 0:2,linkClassName:Z().artistLink,captionClassName:Z().artistLabel,variant:O?"breakAll":"breakWord"}),s.year&&(0,o.jsx)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:(0,r.W)(Z().year,{[Z().year_dot]:W.length>0}),...(0,c.BA)(c.QM.pageHeader.ALBUM_RELEASE_DATE),children:s.year})]}),X=(0,l.useMemo)(()=>O?(0,o.jsx)(A.JM,{className:Z().playControl,color:"primary",buttonVariant:"default",iconSize:"xxl",isPlaying:K,onClick:J,variant:"filled",disabled:!s.isAvailable}):(0,o.jsx)(A.JM,{className:Z().playControl,withRipple:!0,buttonVariant:"default",radius:"xxxl",size:"s",color:"primary",iconSize:"xxs",isPlaying:K,onClick:J,disabled:!s.isAvailable,children:(0,o.jsx)(u.Z,{id:"player-actions.listen"})}),[s.isAvailable,O,K,J]),Q=(0,l.useMemo)(()=>{let e=O?"l":"s",t=O?"m":"xxs";return(0,o.jsxs)("div",{className:Z().controls,children:[X,(0,o.jsx)(A.dJ,{className:Z().likeControl,isLiked:s.isLiked,onClick:B,variant:"default",size:e,iconSize:t,iconClassName:Z().likeIcon,withRipple:!O,disabled:!s.isAvailable,"aria-label":n}),q&&(0,o.jsx)(A.RT,{onClick:I,isPinned:s.isPinned,isDisabled:!s.isAvailable,className:Z().pinControl}),(0,o.jsx)(E.oK,{album:s,open:H,onOpenChange:k,reference:(0,o.jsx)(h.z,{className:Z().menuControl,size:e,radius:"round",withRipple:!O,"aria-label":V({id:"interface-actions.context-menu"}),icon:(0,o.jsx)(m.J,{size:t,variant:"more"}),...(0,c.BA)(c.QM.pageHeader.ALBUM_HEADER_CONTEXT_MENU)})})]})},[O,X,s,B,n,q,I,H,V]),ee=(0,l.useMemo)(()=>{if(D)return(0,o.jsx)(m.J,{variant:"bookmateLogo",className:Z().bookmateLogo})},[D]);return(0,o.jsx)(M,{ref:b,className:L,controls:Q,meta:$,entityName:G,entityNameIcon:ee,title:s.title,cover:(0,o.jsx)(j,{coverVariant:"square",coverUri:s.coverUri,isAvailable:s.isAvailable,withBookmateBadge:D}),"aria-labelledby":x,version:s.version,onVersionClick:g})}),O=(0,l.forwardRef)((e,t)=>(0,o.jsx)(I,{forwardRef:t,...e}));var q=i(34603),D={5881:(e,t,i)=>{function a(){for(var e,t,i=0,a="";ia,default:()=>o});let o=a},5025:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"LizdJ2L0HW7JWOvPrfly"}},435:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_controls_xxs:"tRaaBpDMg9Qu8v6gKjtn",root_entity_xxs:"M9zvtlcpLUVn6DKdcHhj",root_text_xxs:"ln0PYYwDmFnfYxCDJsFU",root_controls_xs:"n5AeWEsJC3_AYXcbK4Lt",root_entity_xs:"__hrMKGmNbw54T54IUyh",root_text_xs:"SehSa7OyRpC2nzYTVb2Q",root_controls_s:"_oBLf5gprWsKjCw4Ce58",root_entity_s:"mxSPe5xpZnie9gpIqacd",root_text_s:"Ai2iRN9elHpk_u5splD6",root_controls_m:"tk7ahHRDYXJMMB879KUA",root_entity_m:"Z_WIr2W8JU4MPQek3hgR",root_text_m:"g3qWNP6xl__7qxNmtrvd",root_controls_l:"grvxapJE3vGArOKDWf6n",root_entity_l:"Esj5A1UeSi4xV4tZ839D",root_text_l:"V3WU123oO65AxsprotU9",root_weight_normal:"ZYV27jeWd30QDXu4GhaH",root_weight_medium:"_3_Mxw7Si7j2g4kWjlpR",root_weight_bold:"Vi7Rd0SZWqD17F0872TB"}},5668:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_size_xs:"qJJ288377iHlWN_RXeEE",root_size_s:"_sd8Q9d_Ttn0Ufe4ISWS",root_size_m:"Ctk8dbecq31Qh7isOJPQ",root_size_l:"M_Djh6ppIkCO3A2k_BTA",root_size_xl:"dtxlzGQMPAbM2MEndXWX",root_size_xxl:"IUb9XLplTAoZqne9rNUL",root_size_xxxl:"ZYZamUwql_rfFR4RpI2B",root_size_xxxxl:"ZBZyxow5njdq8z5dnRPY",root_weight_bold:"nSU6fV9y80WrZEfafvww",root_weight_black:"KBeGPPK4DinQzAP41Y_N"}},3594:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"_MWOVuZRvUQdXKTMcOPx",root_clamp:"LezmJlldtbHWqU7l1950",root_clamp_oneline:"oyQL2RSmoNbNQf3Vc6YI",root_clamp_multiline:"jMyoZB5J9iZbzJmWOrF0"}},6161:(e,t,i)=>{/** -+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4720,9889,2121,3799,1521,1593,9880,8910,2499,105,5001,4870,2286,1871,9264],{35582:function(e,t,i){"use strict";i.r(t);var a,o,r,n,l,s,d,u,c,C,h,m,p,v,E,f,_,y,A,P,L,x,b,g,N,V,S,T,w,R,M,H,k,j,B,Z,I,O,q,D,U,z,F,W,Y,G,K,J,$,X,Q,ee,et,ei,ea,eo,er,en,el,es,ed,eu,ec,eC,eh,em,ep,ev,eE,ef,e_,ey,eA,eP,eL,ex,eb,eg,eN,eV,eS,eT,ew,eR,eM,eH,ek,ej,eB,eZ,eI,eO,eq,eD,eU=i(99616);function ez(){return(ez=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let e=(0,n.useRouter)(),t=(0,c.uK)(),i=t.get(c.xi),o=(0,l.useCallback)(()=>{i.authorizationUrl&&e.push(i.authorizationUrl)},[i.authorizationUrl,e]);return(0,a.jsxs)("div",{className:h().root,children:[(0,a.jsx)(u.Heading,{className:(0,r.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(s.Z,{id:"authorization.enter-title"})}),(0,a.jsx)(u.Caption,{className:(0,r.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(s.Z,{id:"authorization.enter-text"})}),(0,a.jsx)(d.z,{onClick:o,className:h().button,role:"link",color:"primary",size:"l",radius:"xxxl",children:(0,a.jsx)(u.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(s.Z,{id:"authorization.enter-button"})})})]})}),p=(0,o.Pi)(e=>{let{children:t}=e,{user:i}=(0,c.oR)();return i.isAuthorized?t:(0,a.jsx)(m,{})})},40466:function(e,t,i){"use strict";i.r(t),i.d(t,{WithBetaUser:function(){return A}});var a=i(8759),o=i(33423),r=i(35338),n=i(11769),l=i(99616),s=i(65244),d=i(2814),u=i(15527),c=i(13410),C=i(28036),h=i(1918),m=i(57921),p=i(39479),v=i(5674),E=i(44285),f=i(99800),_=i.n(f);let y=(0,o.Pi)(e=>{let{withoutExperiment:t=!1,showLoginButton:o=!1,showUserProfile:f=!1,withOffer:y=!1}=e,A=(0,n.useRouter)(),P=(0,v.uK)(),{settings:L}=(0,v.oR)(),{formatMessage:x}=(0,s.Z)(),b=P.get(v.xi),g=P.get(v.U5),N=(0,v.yy)(g.oldWebHost),V=(0,l.useMemo)(()=>L.layout===v.t8.Mobile?i(25811).Z.src:i(11737).Z.src,[L.layout]),S=(0,l.useCallback)(()=>{b.authorizationUrl&&A.push(b.authorizationUrl)},[b.authorizationUrl,A]);(0,v.NO)(!0);let T=(0,l.useMemo)(()=>y?(0,a.jsx)(h.Heading,{variant:"h1",size:"xl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-header"})}):t?(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-header",values:{br:(0,a.jsx)("br",{})}})}):(0,a.jsx)(h.Heading,{variant:"h1",size:"xxl",weight:"bold",className:(0,r.W)(_().title,_().text),children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-header",values:{br:(0,a.jsx)("br",{})}})}),[y,t]),w=(0,l.useMemo)(()=>t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.beta-text-short"})})})]}):y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().offerText,children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.offer-text"})})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Caption,{variant:"span",type:"text",size:"l",className:_().text,children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})}),(0,a.jsx)(C.y,{children:(0,a.jsx)(h.Heading,{variant:"h2",children:(0,a.jsx)(d.Z,{id:"welcome-page.not-auth-text",values:{br:(0,a.jsx)("br",{})}})})})]}),[y,t]),R=(0,l.useMemo)(()=>{if(o)return(0,a.jsx)(u.z,{onClick:S,className:_().loginButton,role:"link",color:"primary",size:"m",radius:"xxxl",children:(0,a.jsx)(d.Z,{id:"authorization.enter-button"})});if(y){let e="https://".concat(N,"/pay");return(0,a.jsx)(E.rU,{className:_().offerButtonLink,href:e,"aria-label":x({id:"payment.offer-button"}),target:"_blank",children:(0,a.jsx)(u.z,{className:(0,r.W)(_().offerButton,_().offerButton_important),role:"link",color:"plus",size:"l",radius:"m",withRipple:!1,children:(0,a.jsx)(d.Z,{id:"payment.offer-button"})})})}},[x,S,N,o,y]);return(0,v.ZP)(!0),(0,a.jsxs)("div",{className:(0,r.W)(_().root),children:[(0,a.jsx)(m.TF,{withSecondaryColor:!0}),(0,a.jsx)("div",{className:_().logoContainer,children:(0,a.jsx)(c.T,{alignIcon:"center",lang:"ru",className:_().logo})}),T,w,R,(0,a.jsx)("img",{className:_().image,src:V}),f&&(0,a.jsx)(p.Iw,{className:_().user,withMeta:L.layout!==v.t8.Mobile,variant:L.layout===v.t8.Mobile?"mobile":"desktop",usernameClassName:(0,r.W)(_().username,_().important)})]})}),A=(0,o.Pi)(e=>{let{children:t}=e,{user:i,experiments:o}=(0,v.oR)();return i.isAuthorized?o.checkExperiment(v.pe.WebNext,"on")&&!i.isChild?i.hasPlus||o.checkExperiment(v.pe.WebNextFreemium,"on")?t:(0,a.jsx)(y,{withOffer:!0,showUserProfile:!0}):(0,a.jsx)(y,{withoutExperiment:!0,showUserProfile:!0}):(0,a.jsx)(y,{showLoginButton:!0})})},12286:function(e,t,i){"use strict";i.r(t);var a=i(8759),o=i(35338),r=i(99616),n=i(92318),l=i(89788),s=i(5674),d=i(37500),u=i.n(d),c=i(21535);t.default=e=>{let{children:t}=e,{state:i,toggleTrue:d}=(0,n.O)(!1),{state:C,toggleTrue:h}=(0,n.O)(!1),m=(0,r.useMemo)(()=>{let e=new l.JC;return(0,s.NK)(e.get(s.BU.Theme),(0,s.Q$)())},[]),p=(0,r.useCallback)(e=>{let t=c.env.ASSET_PREFIX||"";return"".concat(t,"/video/splash_screen/splash_screen_").concat(m,".").concat(e)},[m]),v=(0,r.useMemo)(()=>({isVisible:!i}),[i]);return(0,a.jsxs)(s.IP.Provider,{value:v,children:[!i&&(0,a.jsx)("div",{className:(0,o.W)(u().root,u()["root_".concat(m)],{[u().root_hidden]:C}),onAnimationEnd:d,children:(0,a.jsxs)("video",{className:u().video,autoPlay:!0,muted:!0,playsInline:!0,onEnded:h,onError:d,children:[(0,a.jsx)("source",{src:p("webm"),type:"video/webm"}),(0,a.jsx)("source",{src:p("mp4"),type:"video/mp4"})]})}),t]})}},44495:function(e,t,i){"use strict";i.r(t),i.d(t,{DesktopInitializer:function(){return d}});var a=i(8759),o=i(35338),r=i(99616),n=i(48769),l=i(57921),s=i(5674);let d=()=>{let e=(0,s.Xf)(),{dictionary:t}=(0,s.ZS)();{let{theme:e}=(0,s.Fg)(),t=(0,s.sv)();(0,l.Tk)(),(0,l.Er)(),(0,l.bO)(),(0,l.vs)(),(0,l.Zw)(),(0,r.useEffect)(()=>{(0,l.Yl)(),(0,l.l7)()},[]),(0,r.useEffect)(()=>{let e=(0,s.bo)();e&&t.count(e,"appVersion")},[t]),(0,r.useEffect)(()=>{(0,l.F5)(e),t.count(e,"appTheme")},[e])}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Notification,{className:(0,o.W)({updateNotificationContainer:!0,updateNotificationContainer_application_windows:e===s.t4.WINDOWS,updateNotificationContainer_application_macos:e===s.t4.MACOS}),enableMultiContainer:!0,containerId:s.W$.APPLICATION_UPDATE,position:"top-center"}),(0,a.jsx)(l.Pj,{dictionary:t})]})}},49842:function(e,t,i){"use strict";i.r(t),i.d(t,{UrlInitializer:function(){return n}});var a=i(33423),o=i(11769),r=i(5674);let n=(0,a.Pi)(e=>{let{host:t}=e,{location:i}=(0,r.oR)(),a=(0,o.usePathname)(),n=(0,o.useSearchParams)().toString(),l=window.location.host,s=t||l,d="https://".concat(s),u="https://".concat(s).concat(a).concat(n?"?":"").concat(n);d=s,u="".concat(s).concat(a).concat(n?"?":"").concat(n),i.setPathname(a),i.setSearchParams(n),i.setHost(s),i.setTld((0,r.p$)(s)||"ru"),i.setOrigin(d),i.setHref(u)})},85816:function(e,t,i){"use strict";i.r(t),i.d(t,{WebInitializer:function(){return s}});var a=i(8759);i(99616);var o=i(5674),r=i(33423);let n=(0,r.Pi)(e=>{let{children:t,userIp:i}=e,{location:a}=(0,o.oR)();return t}),l=e=>{let{children:t}=e;return t},s=e=>{let{userIp:t}=e,i=(0,o.uK)(),r=i.get(o.V0);return r.get(o.BU.DisallowDeeplinksRedirect),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l,{}),(0,a.jsx)(n,{userIp:t})]})}},52207:function(e,t,i){"use strict";i.r(t),i.d(t,{NavigationEvents:function(){return n}});var a=i(11769),o=i(99616),r=i(5674);let n=()=>{let e=(0,r.sv)(),t=(0,a.usePathname)(),i=(0,a.useSearchParams)();return(0,o.useEffect)(()=>{let a="".concat(t).concat(i.size>0?"?".concat(i):"");e.hit(a)},[t,i,e]),null}},75576:function(e,t,i){"use strict";i.r(t),i.d(t,{AnalyticsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(82834),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.sv)(),s=(0,n.wL)(),d=(0,n.uK)(),u=d.get(n.V0),c=(0,o.useMemo)(()=>{if(l)return l;let e="on"===u.get(n.BU.AllowAnalyticsLogs),t=(0,r.HQ)(e=>i.count(e,"evgen"),s,e),a=(0,r.hz)(),o=(0,r.y_)();return l=new r.yx(t,a,o)},[u,s,i]);return(0,a.jsx)(n.fC.Provider,{value:c,children:(0,a.jsx)(n.tK,{children:t})})}},83622:function(e,t,i){"use strict";i.r(t),i.d(t,{HistoryProvider:function(){return s}});var a=i(8759),o=i(11769),r=i(99616),n=i(5674);let l=null,s=e=>{let{children:t}=e,i=(0,n.uK)(),s=(0,o.useRouter)(),d=(0,o.usePathname)(),u=(0,o.useSearchParams)(),[c,C]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1),[p,v]=(0,r.useState)(null),E=(0,r.useMemo)(()=>{if(l)return l;let e=i.get(n.Ar);return l=new n.QQ(e)},[i]),f=(0,r.useCallback)(()=>{E&&(C(E.canBack),m(E.canForward),v(E.state))},[E]),_=(0,r.useCallback)(e=>{E&&(E.replaceState(e),s.replace(e.href))},[E,s]),y=(0,r.useCallback)(e=>{E&&(E.pushState(e),f())},[E,f]),A=(0,r.useCallback)(()=>{E&&(E.back(),f(),s.back())},[E,s,f]),P=(0,r.useCallback)(()=>{E&&(E.forward(),f(),s.forward())},[E,s,f]);return(0,r.useEffect)(()=>{var e;let t=[d,u.toString()].join("?");(!(null==E?void 0:E.state)||(null==E?void 0:null===(e=E.state)||void 0===e?void 0:e.isLocationNotEqual(t)))&&y({href:t})},[E,d,u,y]),(0,a.jsx)(n.Tl.Provider,{value:{pushState:y,replaceState:_,canForward:h,canBack:c,back:A,forward:P,state:p},children:t})}},75707:function(e,t,i){"use strict";i.r(t),i.d(t,{LayoutProvider:function(){return d},setClientSideLayout:function(){return s}});var a=i(8759),o=i(57285),r=i(33423),n=i(99616),l=i(5674);let s=e=>{document.body.classList.remove("desktop"),e.setLayout((0,l.jP)(window.innerWidth))},d=(0,r.Pi)(e=>{let{children:t,userAgent:i}=e,{settings:r}=(0,l.oR)(),d=(0,l.Xf)(),[u,c]=(0,n.useState)(null);d&&r.setPlatform(d),r.layout;let C=(0,n.useMemo)(()=>(0,o.Z)(()=>{s(r)},100),[r]),h=(0,n.useCallback)(e=>{c(e)},[]);(0,n.useLayoutEffect)(()=>{s(r)},[r]),(0,n.useEffect)(()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}),[C]);let m=(0,n.useMemo)(()=>({contentRef:u,setContentRef:h}),[u,h]);return(0,a.jsx)(l.VY.Provider,{value:m,children:t})})},29371:function(e,t,i){"use strict";i.r(t),i.d(t,{PrefetchDataProvider:function(){return s}});var a=i(33423),o=i(99616),r=i(5674),n=i(75707);let l=async(e,t,i)=>{let{user:a,library:o,experiments:n,pinsCollection:l}=e;if(t?await a.getAbout():a.setUnauthorized(),a.puid&&i.setPassportUid(a.puid),await n.getData(),a.isAuthorized){let e=[a.getSettings(),o.getData()];n.checkExperiment(r.pe.WebPins,"on")&&e.push(l.getData()),await Promise.all(e)}},s=(0,a.Pi)(e=>{let{children:t}=e,i=(0,r.oR)(),a=(0,r.uK)(),s=a.get(r.xi),d=a.get(r.Hz),u=s.hasAuthorizationCredentials;return(0,n.setClientSideLayout)(i.settings),i.user.account.loadingState===r.Gu.IDLE&&(0,o.use)(l(i,u,d)),t})},85709:function(e,t,i){"use strict";i.r(t),i.d(t,{ShortcutsProvider:function(){return d}});var a=i(8759),o=i(33423),r=i(99616),n=i(98125),l=i(5674);let s=null,d=(0,o.Pi)(e=>{let{children:t}=e,i=(0,l.R$)(),o=(0,l.uK)(),d=o.get(l.V0),u=(0,n.K)(),{sonataState:c}=(0,l.oR)(),C=(0,r.useMemo)(()=>(s||(s=new l.OI(new l.yr)),s),[]);return(0,r.useEffect)(()=>(null==C||C.addShortcutsListener(l.yx.DECREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.decreaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.INCREASE_VOLUME,async()=>{let e=await (null==i?void 0:i.increaseVolume(.05));d.set(l.BU.YmPlayerVolume,e)}),null==C||C.addShortcutsListener(l.yx.TOGGLE_MUTE,async()=>{let e=null==i?void 0:i.state.playerState.volume.value;void 0!==e&&await u(e)}),()=>{null==C||C.removeShortcutsListener(l.yx.DECREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.INCREASE_VOLUME),null==C||C.removeShortcutsListener(l.yx.TOGGLE_MUTE)}),[C,i,d,u]),(0,r.useEffect)(()=>{if(!c.isGenerativeContext)return null==C||C.addShortcutsListener(l.yx.MOVE_BACKWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value)&&await i.moveBackward()}),null==C||C.addShortcutsListener(l.yx.MOVE_FORWARD,async()=>{var e;(null==i?void 0:null===(e=i.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value)&&await (null==i?void 0:i.moveForward())}),null==C||C.addShortcutsListener(l.yx.SLIDE_BACKWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideBackward(2))}),null==C||C.addShortcutsListener(l.yx.SLIDE_FORWARD,async()=>{let e=null==i?void 0:i.state.playerState.progress.value.duration;e&&await (null==i?void 0:i.slideForward(2))}),()=>{null==C||C.removeShortcutsListener(l.yx.MOVE_FORWARD),null==C||C.removeShortcutsListener(l.yx.MOVE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_BACKWARD),null==C||C.removeShortcutsListener(l.yx.SLIDE_FORWARD)}},[C,i,d,c.isGenerativeContext]),(0,a.jsx)(l.cw.Provider,{value:C,children:t})})},48085:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataProvider:function(){return eu}});var a,o,r,n,l=i(8759),s=i(33423),d=i(99616),u=i(8124);class c extends Error{constructor(e){super(e),this.name="AudioError"}}let C={BAD_STATE:"action is not permited from current state"},h={EVENT_PLAY:"play",EVENT_STOP:"stop",EVENT_PAUSE:"pause",EVENT_RESUME:"resume",EVENT_PROGRESS:"progress",EVENT_SEEKED:"seeked",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_LOADING:"loading",EVENT_LOADED:"loaded",EVENT_ENDED:"ended",EVENT_CRASHED:"crashed",EVENT_ERROR:"error",EVENT_STALLED:"stalled",EVENT_CANPLAY:"canplay",EVENT_PLAYING:"playing",HLS_EVENT_ERROR:"hlserror",EVENT_DESTROY:"destroy",EVENT_STATE:"state",EVENT_SWAP:"swap",STATE_INIT:"init",STATE_CRASHED:"crashed",STATE_IDLE:"idle",STATE_PLAYING:"playing",STATE_PAUSED:"paused"};var m=i(23681);let p={updateInterval:30,EMPTY_SOUND:"data:audio/mp3;base64,//uQZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAADAAAC2QBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA8TEFNRTMuOThyBK8AAAAAAAAAADQgJAimTQABzAAAAtmIVtmVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQZAAO4AAAf4AAAAgAAA/wAAABAoQDLmAAACBYgGYMAAAE+oH///////0WKFRVzjKnAmjp+XX9qP//////p0USaKtMwpjZNhNFyEM61QAAOAP////////nfSpMQU1FMy45OC4yqqr/+xBEDI/wAAB/gAAACAxgGaMAAAEAAAH+AAAAIAAAP8AAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv/7EGQoD/AAAGkAAAAIAAANIAAAAQAAAaQAAAAgAAA0gAAABKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",EVENT_NATIVE_PLAY:"play",EVENT_NATIVE_PAUSE:"pause",EVENT_NATIVE_TIMEUPDATE:"timeupdate",EVENT_NATIVE_ENDED:"ended",EVENT_NATIVE_DURATION:"durationchange",EVENT_NATIVE_LOADING:"progress",EVENT_NATIVE_META:"loadedmetadata",EVENT_NATIVE_CANPLAY:"canplay",EVENT_NATIVE_PLAYING:"playing",EVENT_NATIVE_ERROR:"error",EVENT_NATIVE_STALLED:"stalled",EVENT_VOLUMECHANGE:"volumechange",EVENT_RATECHANGE:"ratechange",EVENT_SEEKED:"seeked",promiseLoadedEvents:["progress"],promisePlayingEvents:["timeupdate"],promiseMetadataEvents:["loadedmetadata","canplay"],loaderInteruptReasons:["load","stop","startPlay","play","destroy"]};class v{isOnlyDeviceVolume(){let e=!0;try{let t=document.createElement("audio");t.volume=.63,e=Math.abs(t.volume-.63)>.01}catch(t){e=!0}return e}parseParams(e){let t=e.split("?")[1];return t&&t.length?t.split("&").reduce(function(e,t){let i=t.split("="),a=i[0],o=i[1];return a&&o&&(e[a]=o),e},{}):{}}updateUrl(e,t){let i=this.parseParams(e),a="";for(let e in Object.assign(i,t),i)Object.prototype.hasOwnProperty.call(i,e)&&(a+=`${e}=${i[e]}`);return e+(a?`?${a}`:"")}getCookie(e){let t=document.cookie.split(";").reduce((e,t)=>{let[i,a]=t.trim().split("=");return i&&a?{...e,[i]:a}:e},{})[e];return t||""}}let E=1,f=()=>{let e=document.createElement("audio");return e.autoplay=!1,e.loop=!1,e.preload="auto",e.crossOrigin="anonymous",e};class _{audio=f();browser=new v;emitter;src="";position=0;lastGoodTime=0;lastUpdate=0;notLoading=!0;shouldUseHlsPlayer;shouldPause=!1;shouldPlay=!1;playing=!1;ended=!1;promiseMode=!1;isHlsTrack=!1;promises={};audioContext=null;loaderTimer=null;promiseCheckTO=null;retry=0;playerInitializationTime;clearInitListener=null;clearNativePauseListener=null;hls=null;isAutoplayable=!1;name=E++;whenReady;constructor(e,t){this.shouldUseHlsPlayer=e,this.playerInitializationTime=Date.now(),this.emitter=t,this.startupAudio=this.startupAudio.bind(this),this.updateProgress=this.updateProgress.bind(this),this.onNativeLoading=this.onNativeLoading.bind(this),this.onNativeEnded=this.onNativeEnded.bind(this),this.onNativeError=this.onNativeError.bind(this),this.onNativePause=this.onNativePause.bind(this),this.onNativePlay=this.onNativePlay.bind(this),this.onNativeSeeked=this.onNativeSeeked.bind(this),this.onNativeStalled=this.onNativeStalled.bind(this),this.onNativeCanplay=this.onNativeCanplay.bind(this),this.onNativePlaying=this.onNativePlaying.bind(this),this.onNativeVolumeChange=this.onNativeVolumeChange.bind(this),this.onNativeRatechange=this.onNativeRatechange.bind(this),this.whenReady=this.init()}updateProgress(){let e=Number(new Date);if(e-this.lastUpdate=this.audio.duration-.1&&this.emitter.emit(h.EVENT_LOADED)}}onNativeEnded(){this.ended=!0,this.playing=!1,this.shouldPause=!0,this.emitter.emit(h.EVENT_ENDED)}onNativeError(){this.src&&this.src!==p.EMPTY_SOUND&&(this.audio&&this.audio.error&&this.emitter.emit(h.EVENT_ERROR,this.audio.error),this.playing=!1)}onNativePause(){this.emitter.emit(h.EVENT_PAUSE),this.shouldPause=!1}onNativePlay(){this.emitter.emit(h.EVENT_PLAY),this.shouldPlay=!1}onNativeSeeked(){this.emitter.emit(h.EVENT_SEEKED)}onNativeStalled(){this.emitter.emit(h.EVENT_STALLED)}onNativeCanplay(){this.emitter.emit(h.EVENT_CANPLAY)}onNativePlaying(){this.playing&&this.emitter.emit(h.EVENT_PLAYING)}onNativeVolumeChange(){this.emitter.emit(h.EVENT_VOLUMECHANGE,this.volumeLevel)}onNativeRatechange(){this.emitter.emit(h.EVENT_RATECHANGE,this.playbackRate)}initUserEvents(){document.body.addEventListener("mousedown",this.startupAudio,!0),document.body.addEventListener("keydown",this.startupAudio,!0),document.body.addEventListener("touchstart",this.startupAudio,!0)}deinitUserEvents(){document.body.removeEventListener("mousedown",this.startupAudio,!0),document.body.removeEventListener("keydown",this.startupAudio,!0),document.body.removeEventListener("touchstart",this.startupAudio,!0)}initNativeEvents(){this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.addEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.addEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.addEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.addEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.addEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.addEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.addEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.addEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.addEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}deinitNativeEvents(){this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,this.onNativePause),this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,this.onNativePlay),this.audio.removeEventListener(p.EVENT_NATIVE_ENDED,this.onNativeEnded),this.audio.removeEventListener(p.EVENT_NATIVE_TIMEUPDATE,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_DURATION,this.updateProgress),this.audio.removeEventListener(p.EVENT_NATIVE_LOADING,this.onNativeLoading),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,this.onNativeError),this.audio.removeEventListener(p.EVENT_SEEKED,this.onNativeSeeked),this.audio.removeEventListener(p.EVENT_NATIVE_STALLED,this.onNativeStalled),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,this.onNativeCanplay),this.audio.removeEventListener(p.EVENT_NATIVE_PLAYING,this.onNativePlaying),this.audio.removeEventListener(p.EVENT_VOLUMECHANGE,this.onNativeVolumeChange),this.audio.removeEventListener(p.EVENT_RATECHANGE,this.onNativeRatechange))}init(){return this.initEvents().then(()=>{this.shouldUseHlsPlayer&&this.initHls()})}initEvents(){return new Promise(e=>{this.initUserEvents(),this.initNativeEvents(),e()})}startupAudio(){this.audioContext&&this.audioContext.resume(),this.deinitUserEvents();let e=()=>{this.shouldPlay=!1,this.isAutoplayable=!0},t=e=>{this.shouldPlay=!1,console.info(`_startupAudio:failReason:${e||""}`)},i=()=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i)),this.promiseMode)return;let t=()=>{this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,t),e()};this.clearNativePauseListener=()=>{this.audio&&this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t)},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,t),this.audio.pause(),this.shouldPause=!0)};this.clearInitListener=()=>{this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.removeEventListener(p.EVENT_NATIVE_META,i),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,i))},this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,i),this.audio.addEventListener(p.EVENT_NATIVE_META,i),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,i),this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{e(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,t("audio.play")}))}initAndCheckAutoplay(){return new Promise(e=>{let t=()=>{this.shouldPlay=!1,this.isAutoplayable=!0,e()},i=t=>{this.shouldPlay=!1,this.isAutoplayable=!1,console.info(this,`initAndCheckAutoplay:failReason:${t||""}`),e()},a=e=>{if(this.audio&&(this.audio.removeEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.removeEventListener(p.EVENT_NATIVE_META,a),this.audio.removeEventListener(p.EVENT_NATIVE_ERROR,a)),this.promiseMode)return;if(e.type===p.EVENT_NATIVE_ERROR||e.type===p.EVENT_NATIVE_META){i(e.type);return}let o=e=>{if(e.type===p.EVENT_NATIVE_ERROR){i(e.type);return}this.audio&&this.audio.removeEventListener(p.EVENT_NATIVE_PAUSE,o),t()};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PAUSE,o),this.audio.pause()),this.shouldPause=!0};this.audio&&(this.audio.addEventListener(p.EVENT_NATIVE_PLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_CANPLAY,a),this.audio.addEventListener(p.EVENT_NATIVE_META,a),this.audio.addEventListener(p.EVENT_NATIVE_ERROR,a),this.audio.src=p.EMPTY_SOUND,this.audio.load(),this.shouldPlay=!0,this.promiseMode=!0,this.audio.play().then(()=>{t(),this.shouldPause=!0,this.shouldPlay=!1,this.audio&&this.audio.pause()}).catch(()=>{this.shouldPause=!0,this.shouldPlay=!1,i("audio.play")}))})}breakStartup(e){this.deinitUserEvents(),this.clearInitListener&&this.clearInitListener(),this.clearNativePauseListener&&this.clearNativePauseListener(),console.warn("_startupAudio:interrupted",e)}waitFor(e,t,i){let a;let o=this.promises[e];if(o)a=o.promise();else{let o=()=>{},r=[new Promise((e,t)=>{o=t})],n={},l=e=>new Promise(i=>{let a=()=>{t()&&i()};this.audio&&(this.audio.addEventListener(e,a),n[e]=a)}),s=()=>{for(let e of Object.keys(n))if(this.audio){let t=n[e];t&&this.audio.removeEventListener(e,t)}};for(let e of i)r.push(l(e));let d=Promise.race(r);d.then(s).catch(s),this.promises[e]={promise:()=>d,reject:o},a=d}return a}cancelWait(e,t){let i;(i=this.promises[e])&&(delete this.promises[e],i.reject(t))}abortPromises(e){for(let t in this.promises)Object.prototype.hasOwnProperty.call(this.promises,t)&&this.cancelWait(t,e)}promiseMetadataCheck(){return!!this.audio&&this.audio.readyState>this.audio.HAVE_METADATA}promiseMetadata(){return this.waitFor("metadata",()=>this.promiseMetadataCheck(),p.promiseMetadataEvents)}promiseLoadedCheck(){if(this.loaderTimer?clearTimeout(this.loaderTimer):this.loaderTimer=setTimeout(()=>{this.cancelWait("loaded","timeout")},5e3),this.audio){let e=Math.min(this.position+45,this.audio.duration),t=this.audio.buffered.end(0)-this.audio.buffered.start(0);return 0!==this.audio.buffered.length&&t>=e}return!1}promiseLoaded(){let e=this.waitFor("loaded",()=>this.promiseLoadedCheck(),p.promiseLoadedEvents),t=()=>{this.loaderTimer&&clearTimeout(this.loaderTimer)};return e.then(t).catch(t),e}promisePlayingCheck(){if(this.audio){let e=Math.min(this.position+.2,this.audio.duration);return this.promiseCheckTO&&clearTimeout(this.promiseCheckTO),0!==this.audio.currentTime||this.audio.paused||(this.promiseCheckTO=setTimeout(()=>{this.audio&&0===this.audio.currentTime&&!this.audio.paused&&(this.audio.currentTime=1)},1e3)),this.audio.currentTime>=e}return!1}promisePlaying(){return this.waitFor("playing",()=>this.promisePlayingCheck(),p.promisePlayingEvents)}promiseStartPlaying(){let e,t=!1;if(this.promises.startPlaying)e=this.promises.startPlaying.promise();else{let i,a=()=>{},o=new Promise((e,o)=>{this.promisePlaying().then(()=>{t=!0,clearTimeout(i),e()}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),this.promiseLoaded().then(()=>{t||(i=setTimeout(()=>{o("timeout"),this.cancelWait("playing","timeout"),console.warn("startPlaying:failed")},5e3))}).catch(e=>{t=!0,clearTimeout(i),this.cancelWait("startPlaying",e)}),a=o});this.promises.startPlaying={promise:()=>o,reject:a},e=this.promises.startPlaying.promise()}return e}load(e){this.abortPromises("load"),this.breakStartup("load"),this.ended=!1,this.playing=!1,this.notLoading=!0,this.position=0,this.lastGoodTime=0,this.src=e,this.audio&&(/\.m3u8$/.test(e)?(this.isHlsTrack=!0,this.destroyHls(),this.initHls(),this.hls?.loadSource(this.getHlsPlayingEntityUrl(e))):(this.isHlsTrack=!1,this.audio.src=e),this.audio.load())}stop(){this.abortPromises("stop"),this.breakStartup("stop"),this.isHlsTrack&&this.destroyHls(),this.load("")}startPlay(){this.audio&&(this.audio.currentTime=this.position),this.playing&&(this.breakStartup("startPlay"),this.shouldPlay=!0,this.audio&&this.audio.play().catch(e=>{console.error(e)}),this.hls&&this.hls.startLoad(),this.promiseStartPlaying().then(()=>{this.retry=0}))}play(e){this.retry=0,this.loadMetadata(e)}loadMetadata(e){this.playing||(this.breakStartup("play"),this.ended=!1,this.playing=!0,null!=e&&(this.position=e),this.promiseMetadata().then(()=>this.startPlay()).catch(e=>{"string"==typeof e&&p.loaderInteruptReasons.includes(e)||console.error(e)}))}initHls(){this.hls||(this.hls=new m.ZP({liveDurationInfinity:!0,maxBufferSize:3e6}),this.audio&&this.hls.attachMedia(this.audio),this.initHlsEvents())}initHlsEvents(){this.hls&&(this.hls.on(m.ZP.Events.ERROR,(e,t)=>{if(t.fatal&&this.hls)switch(t.type){case m.ZP.ErrorTypes.NETWORK_ERROR:this.retry++,this.retry>2?(this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)):this.hls.startLoad();break;case m.ZP.ErrorTypes.MEDIA_ERROR:this.hls.recoverMediaError();break;default:this.destroyHls(),this.playing=!1,this.emitter.emit(h.EVENT_ERROR,t)}}),this.hls.on(m.ZP.Events.DESTROYING,()=>{this.hls=null}))}getHlsPlayingEntityUrl(e){let t="";for(;t.length<44;)t+=(Math.random()+1).toString(36).substring(3);t=t.slice(0,44);let i=this.playerInitializationTime.toString().slice(0,10),a=`${t}xWEBx0001x${i}`;return this.browser.updateUrl(e,{vsid:a})}destroyHls(){this.retry=0,this.hls&&(this.hls.stopLoad(),this.hls.destroy(),this.hls=null)}pause(){this.shouldPause=!0,this.playing=!1,this.isHlsTrack&&this.hls&&this.hls.stopLoad(),this.audio&&(this.audio.pause(),this.position=this.audio.currentTime)}setPosition(e){if(!isFinite(e)){console.warn("setPositionFailed",e);return}this.position=e,this.promiseMetadata().then(()=>{this.audio&&(this.audio.currentTime=this.position)})}destroy(){this.audio&&(this.shouldPause=!0,this.audio.pause(),this.deinitNativeEvents()),this.abortPromises("destroy"),this.deinitUserEvents(),this.promises={}}get currentTime(){return this.audio?this.audio.currentTime:null}get duration(){return this.audio?this.audio.duration:null}get loaded(){let e;if(this.audio&&this.audio.buffered.length){let t=this.audio.buffered.length-1;e=this.audio.buffered.end(t)}else e=null;return e}get volumeLevel(){return this.audio?this.audio.volume:0}set volumeLevel(e){this.audio&&(this.audio.volume=e)}set defaultPlaybackRate(e){this.audio&&(this.audio.defaultPlaybackRate=e)}get playbackRate(){return this.audio?this.audio.playbackRate:1}set playbackRate(e){this.audio&&(this.audio.playbackRate=e)}get audioSrc(){return this.src}get audioNotLoading(){return this.notLoading}get autoplayable(){return this.isAutoplayable}}let y=1;class A{browser=new v;emitter;loader;name=y++;type="html5";whenReady;constructor(e,t){this.emitter=t,this.loader=new _(e,t),this.whenReady=this.loader.whenReady}get source(){return this.loader.audio}play(e,t){this.loader.load(e),this.loader.play(t)}setSrc(e,t){this.loader.load(e),this.loader.setPosition(t)}pause(){this.loader.pause()}resume(){this.loader.play()}stop(){this.loader.stop(),this.emitter.emit(h.EVENT_STOP)}destroy(){this.loader.destroy(),this.emitter.emit(h.EVENT_DESTROY)}getPosition(){return this.loader.currentTime}setPosition(e){this.loader.setPosition(e-.001)}getDuration(){return this.loader.duration}getLoaded(){return this.loader.loaded?this.loader.loaded:0}get volumeLevel(){return this.loader.volumeLevel}set volumeLevel(e){this.loader.volumeLevel=Math.min(1,e)}get speedLevel(){return this.loader.playbackRate}set speedLevel(e){this.loader.defaultPlaybackRate=e,this.loader.playbackRate=e}getSrc(){return""!==this.loader.audioSrc?this.loader.audioSrc:null}isDeviceVolume(){return this.browser.isOnlyDeviceVolume()}isAutoplayable(){return this.loader.autoplayable}}let P=1;class L{emitter=new u.v;played=0;lastSkip=0;playId=null;shouldUseHlsPlayer;implementation;promises={};name=P++;state=h.STATE_INIT;constructor(e=!1){this.shouldUseHlsPlayer=e,window.addEventListener("beforeunload",()=>this.onBeforeUnload(),!0),this.implementation=new A(this.shouldUseHlsPlayer,this.emitter),this.onAudioPlayerInit()}get source(){return this.implementation?.source}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}onAudioPlayerInit(){this.handleImplementationEvents(),this.setState(h.STATE_IDLE)}handleImplementationEvents(){this.emitter.on(h.EVENT_PLAY,()=>{this.implementationEventHandler(h.EVENT_PLAY)}),this.emitter.on(h.EVENT_ENDED,()=>{this.implementationEventHandler(h.EVENT_ENDED)}),this.emitter.on(h.EVENT_SWAP,()=>{this.implementationEventHandler(h.EVENT_SWAP)}),this.emitter.on(h.EVENT_STOP,()=>{this.implementationEventHandler(h.EVENT_STOP)}),this.emitter.on(h.EVENT_ERROR,()=>{this.implementationEventHandler(h.EVENT_ERROR)}),this.emitter.on(h.HLS_EVENT_ERROR,()=>{this.implementationEventHandler(h.HLS_EVENT_ERROR)}),this.emitter.on(h.EVENT_PAUSE,()=>{this.implementationEventHandler(h.EVENT_PAUSE)}),this.emitter.on(h.EVENT_CRASHED,()=>{this.implementationEventHandler(h.EVENT_CRASHED)})}implementationEventHandler(e){switch(e){case h.EVENT_PLAY:this.setState(h.STATE_PLAYING);break;case h.EVENT_ENDED:case h.EVENT_SWAP:case h.EVENT_STOP:case h.EVENT_ERROR:case h.HLS_EVENT_ERROR:this.setState(h.STATE_IDLE);break;case h.EVENT_PAUSE:this.setState(h.STATE_PAUSED);break;case h.EVENT_CRASHED:this.setState(h.STATE_CRASHED)}}onBeforeUnload(){"undefined"!=typeof window&&navigator&&1===navigator.maxTouchPoints||this.destroy()}setState(e){if(e===h.STATE_PAUSED&&this.state!==h.STATE_PLAYING)return;let t=this.state!==e;this.state=e,t&&this.emitter.emit(h.EVENT_STATE,e)}waitEvents(e,t,i){let a=()=>{},o=()=>{},r=new Promise((e,t)=>{a=e,o=t});this.promises[e]={promise:()=>r,reject:o};let n=()=>{for(let e of t)this.off(e,a);for(let e of i)this.off(e,o);delete this.promises[e]};for(let e of t)this.on(e,a);let l=e=>t=>{let i=t instanceof Error?t:new c(e);o(i)};for(let e of i)this.on(e,l(e));return r.then(n).catch(n),r}getState(){return this.state}getSrc(){return this.implementation?this.implementation.getSrc():null}play(e,t){this.played=0,this.lastSkip=0,this.generatePlayId(),this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PLAY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_PLAY),this.promises.whenStop&&this.promises.whenStop.reject(h.EVENT_PLAY);let i=this.waitEvents("whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]);return this.implementation&&this.implementation.play(e,t),i}setSrc(e,t){this.implementation&&this.implementation.setSrc(e,t)}restart(){return this.getDuration()?(this.generatePlayId(),this.setPosition(0),this.played=0,this.lastSkip=0,this.resume()):Promise.reject(new c(C.BAD_STATE))}stop(){let e;return this.implementation&&(this.implementation.stop(),Promise.resolve()),this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_STOP),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_STOP),e=this.promises.whenStop?this.promises.whenStop.promise():this.waitEvents("_whenStop",[h.EVENT_STOP],[h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.stop(),e}pause(){let e;return this.state!==h.STATE_PLAYING?Promise.reject(new c(C.BAD_STATE)):(this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_PAUSE),e=this.promises.whenPause?this.promises.whenPause.promise():this.waitEvents("_whenPause",[h.EVENT_PAUSE],[h.EVENT_STOP,h.EVENT_PLAY,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.pause(),e)}resume(){let e;return this.state!==h.STATE_PLAYING||this.promises.whenPause?this.state===h.STATE_IDLE||this.state===h.STATE_PAUSED||this.state===h.STATE_PLAYING?(this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_RESUME),e=this.promises.whenPlay?this.promises.whenPlay.promise():this.waitEvents("_whenPlay",[h.EVENT_PLAY],[h.EVENT_STOP,h.EVENT_ERROR,h.HLS_EVENT_ERROR,h.EVENT_CRASHED]),this.implementation&&this.implementation.resume(),e.then(()=>{this.emitter.emit(h.EVENT_RESUME)})):Promise.reject(new c(C.BAD_STATE)):Promise.resolve()}destroy(){this.played=0,this.lastSkip=0,this.promises.whenPlay&&this.promises.whenPlay.reject(h.EVENT_DESTROY),this.promises.whenPause&&this.promises.whenPause.reject(h.EVENT_DESTROY),this.implementation&&this.implementation.destroy()}getPosition(){let e=null;return this.implementation&&(e=this.implementation.getPosition()),e||0}setPosition(e){return this.implementation&&this.implementation.setPosition(e),this.played+=this.getPosition()-this.lastSkip,this.lastSkip=e,e}getDuration(){let e=null;return this.implementation&&(e=this.implementation.getDuration()),null===e?0:e}getLoaded(){return this.implementation?this.implementation.getLoaded():0}getPlayed(){let e=this.getPosition();return this.played+=e-this.lastSkip,this.lastSkip=e,this.played}getVolume(){return this.implementation?this.implementation.volumeLevel:0}setVolume(e){let t=0;return this.implementation&&(this.implementation.volumeLevel=e,t=e),t}getSpeed(){return this.implementation?this.implementation.speedLevel:0}setSpeed(e){let t=0;return this.implementation&&(this.implementation.speedLevel=e,t=e),t}isDeviceVolume(){return!this.implementation||this.implementation.isDeviceVolume()}isAutoplayable(){let e=null;return this.implementation&&(e=this.implementation.isAutoplayable()),null!==e&&e}generatePlayId(){this.playId=Math.random().toString().slice(2)}getPlayId(){return this.playId}}class x{pauseHandlers=[];core=new L;get source(){return this.core.source}play(e,t){return this.core.play(e,t)}setSrc(e,t){this.core.setSrc(e,t)}setProgress(e){let t=this.core.setPosition(e);return Promise.resolve(t)}pause(){return this.core.pause()}resume(){return this.core.resume()}setVolume(e){let t=this.core.setVolume(e);return Promise.resolve(t)}setSpeed(e){let t=this.core.setSpeed(e);return Promise.resolve(t)}stop(){return this.core.stop()}onAudioEnd(e){this.core.on(h.EVENT_ENDED,e)}onAudioPaused(e){let t=()=>{"paused"===this.core.getState()&&e()};this.pauseHandlers.push({handler:t,originalCallback:e}),this.core.on(h.EVENT_STATE,t)}onAudioResume(e){this.core.on(h.EVENT_RESUME,e)}onAudioUpdatingProgress(e){this.core.on(h.EVENT_PROGRESS,e)}onAudioSeeked(e){this.core.on(h.EVENT_SEEKED,e)}onAudioStalled(e){this.core.on(h.EVENT_STALLED,e)}onAudioCanplay(e){this.core.on(h.EVENT_CANPLAY,e)}onAudioPlaying(e){this.core.on(h.EVENT_PLAYING,e)}onAudioError(e){this.core.on(h.EVENT_ERROR,e)}onAudioVolumeChange(e){this.core.on(h.EVENT_VOLUMECHANGE,e)}onAudioSpeedChange(e){this.core.on(h.EVENT_RATECHANGE,e)}offAudioEnd(e){this.core.off(h.EVENT_ENDED,e)}offAudioPaused(e){let t=this.pauseHandlers.find(t=>t.originalCallback===e);t&&this.core.off(h.EVENT_STATE,t.handler)}offAudioResume(e){this.core.off(h.EVENT_RESUME,e)}offAudioUpdatingProgress(e){this.core.off(h.EVENT_PROGRESS,e)}offAudioSeeked(e){this.core.off(h.EVENT_SEEKED,e)}offAudioStalled(e){this.core.off(h.EVENT_STALLED,e)}offAudioCanplay(e){this.core.off(h.EVENT_CANPLAY,e)}offAudioPlaying(e){this.core.off(h.EVENT_PLAYING,e)}offAudioError(e){this.core.off(h.EVENT_ERROR,e)}offAudioVolumeChange(e){this.core.off(h.EVENT_VOLUMECHANGE,e)}offAudioSpeedChange(e){this.core.off(h.EVENT_RATECHANGE,e)}}var b=i(57413),g=i(14408),N=i(68244);class V{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("ApplyContextPlugin",()=>{let e=i.state.currentContext.value;e&&e instanceof N.$n&&e.apply({hooks:t,playback:i})})}}let S=null;function T(e){let t=e.state.queueState.index.value,i=e.state.currentContext.value,a=void 0!==e.state.queueState.order.value[t-1];i&&(i.availableActions.moveBackward.value=a),null!==S&&(S(),S=null),0===t&&(S=e.state.playerState.progress.onChange(e=>{i&&(i.availableActions.moveBackward.value=!!e&&e.position>N.lz)}))}var w=i(34603);function R(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:a}=i.entity.data,o=(0,b.xA)(t)||(0,b.Q7)(t)||"type"in a&&a.type&&w.UE.includes(a.type);o?(t.availableActions.repeat.value=!1,t.availableActions.shuffle.value=!1,e.state.queueState.repeat.value!==N.zq.NONE&&e.setRepeatMode(N.zq.NONE),e.state.queueState.shuffle.value&&e.toggleShuffle()):(t.availableActions.repeat.value=!0,t.availableActions.shuffle.value=!0)}}let M=e=>{let t="albums"in e&&e.albums&&e.albums.length>0&&e.albums[0]&&e.albums[0].type===w.VZ.PODCAST,i="type"in e&&e.type===w.Vc.PODCAST;return!!(i||t)};function H(e){let{value:t}=e.state.currentContext,{value:i}=e.state.queueState.currentEntity,a=void 0!==t;if(a&&void 0!==i){let{meta:e}=i.entity.data,a=M(e);t.availableActions.speed.value=!!a}}class k{apply(e){let{hooks:t,playback:i}=e;t.afterContextSet.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),t.beforeMediaStartPlaying.tap("AvailableActionsPlugin",()=>{R(i),H(i)}),i.state.queueState.entityList.onChange(()=>{T(i)}),i.state.queueState.index.onChange(()=>{T(i)})}}class j{apply(e){let{playback:t,hooks:i}=e;t.state.playerState.event.onChange(()=>{let{currentEntity:e}=t.state.queueState;if(e.value)switch(t.state.playerState.event.value){case N.KX.PAUSED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.PAUSED}`});break;case N.KX.STALLED:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.STALLED}`});break;case N.KX.PLAYING:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:`event-${N.KX.PLAYING}`});break;case N.KX.MEDIA_ELEMENT_ERROR:e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:`event-${N.KX.MEDIA_ELEMENT_ERROR}`})}}),i.beforeEntityPlayingProcessStart.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.clearTimeStagesOfPlayback(),Promise.resolve()}),i.afterMediaStartPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.PLAYING,reason:"hook-afterMediaStartPlaying"}),Promise.resolve()}),i.afterMediaEndPlaying.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-afterMediaEndPlaying"}),Promise.resolve()}),i.beforeEntityChange.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeEntityChange"}),Promise.resolve()}),i.beforeContextSet.tapPromise("TotalPlayedTimePlugin",()=>{let{currentEntity:e}=t.state.queueState;return e.value&&e.value.entity.saveTimeStageOfPlayback({stage:g.EE.NOT_PLAYING,reason:"hook-beforeContextSet"}),Promise.resolve()})}}var B=i(42503),Z=i(59899);function I(){let e=new Date;return e.toISOString()}function O(e){let t;let{contextEntityPair:i,totalPlayedSeconds:a,endPositionSeconds:o,type:r,maxPlayerStage:n}=e,{entity:l,context:s}=i,d=String(l.data.meta.id),u=function(e){let t;if("albums"in e.data.meta){let{data:{meta:{albums:i}}}=e;if(i){let e=i[0];e&&(t=String(e.id))}}return t}(l),c=0;"durationMs"in l.data.meta&&l.data.meta.durationMs&&(c=l.data.meta.durationMs/1e3);let C=a,h=o;.5>Math.abs(c-a)&&(C=c),.5>Math.abs(c-o)&&(h=c),t=(0,b.Q7)(s)?{generativeStreamId:String(s.data.meta.stream?.id)}:{trackId:d};let m={playId:l.playId,timestamp:I(),totalPlayedSeconds:C,endPositionSeconds:h,trackLengthSeconds:c,albumId:u,from:s.from,context:s.data.type,contextItem:String(s.data.meta.id),addTracksToPlayerTime:l.addTracksToPlayerTime,audioAuto:"none",audioOutputName:"Динамик",audioOutputType:"Speaker",maxPlayerStage:n,...t};if((0,b.xA)(s)&&s.data.meta.session&&(m.radioSessionId=s.data.meta.session.radioSessionId,m.context="radio",m.contextItem=s.data.meta.session.wave.stationId),(0,b.KT)(s)&&(m.playlistId=`${s.data.meta.uid}:${s.data.meta.kind}`,m.contextItem=`${s.data.meta.uid}:${s.data.meta.kind}`),(0,b.dt)(s)){let e=[b.Zc.Search,b.Zc.Other],t=s.data.overrideContextType??b.Zc.Other;m.context=t,e.includes(t)&&(m.contextItem=null)}return{type:r,isSent:!1,data:m}}(a=r||(r={})).START="start",a.END="end";var q=i(63278);class D extends q.y{name="PlaysException";constructor(e,{code:t="E_PLAYS",...i}={}){super(e,{code:t,...i}),Object.setPrototypeOf(this,D.prototype)}}class U{entityPlaysMap={};playerStageByEntitiesPlayId=new Map;playsResource;variables;constructor(e){let{httpClient:t,playsResourceConfig:i,variables:a}=e;this.playsResource=new w.ol(t,i),this.variables=a||{}}apply(e){let{hooks:t,playback:i}=e;i.state.playerState.event.onChange(()=>{let{currentEntity:e}=i.state.queueState;e.value&&i.state.playerState.event.value===N.KX.PLAYING&&this.changePlayerStageByPlayId({playId:e.value.entity.playId,stage:w.KZ.PLAY})}),t.beforeEntityPlayingProcessStart.tapPromise("PlaysPlugin",()=>new Promise(e=>{this.sendStartEntityPlay(i,t),e()})),t.afterMediaEndPlaying.tapPromise("PlaysPlugin",()=>new Promise(e=>{let{index:{value:a},entityList:{value:o},repeat:{value:r}}=i.state.queueState;(a===o.length-1||r===N.zq.ONE)&&this.sendEndEntityPlay(i,t),e()})),t.afterError.tapPromise("PlaysPlugin",e=>((e instanceof Z.Tb||e instanceof N.YR)&&this.sendEndEntityPlay(i,t),Promise.resolve())),t.beforeContextSet.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()})),t.beforeEntityChange.tapPromise("PlaysPlugin",()=>new Promise(e=>{i.state.queueState.currentEntity.value&&i.state.currentContext.value?(0,b.xA)(i.state.currentContext.value)?this.sendEndEntityPlay(i,t).then(e):(this.sendEndEntityPlay(i,t),e()):e()}))}sendStartEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a){a.entity.playId=(0,B.Z)(),a.entity.addTracksToPlayerTime=`${Math.random().toString().slice(2)}-${Math.ceil(Number(new Date)/1e3)}`;let o=O({type:r.START,contextEntityPair:a,totalPlayedSeconds:0,endPositionSeconds:0});this.saveEntityPlay(o),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!0,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.variables.disableSendPlaysOnTrackStart?i():this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}sendEndEntityPlay(e,t){return new Promise(i=>{let a=e.state.queueState.currentEntity.value;try{if(a&&!(0,b.Q7)(a.context)){let o,n;let{entity:l}=a,s=this.entityPlaysMap[l.playId],d=!1;if(s&&(d=!!s.find(e=>e.type===r.END)),d){i();return}let u=a.entity.totalPlayedSeconds;this.variables.enableSendMaxPlayerStage&&(n=this.playerStageByEntitiesPlayId.get(l.playId)||w.KZ.PREPARE),o=0===u?O({type:r.END,contextEntityPair:a,totalPlayedSeconds:.1,endPositionSeconds:.1,maxPlayerStage:n}):O({type:r.END,contextEntityPair:a,totalPlayedSeconds:u,endPositionSeconds:e.state.playerState.progress.value.position,maxPlayerStage:n}),this.saveEntityPlay(o),this.playerStageByEntitiesPlayId.delete(o.data.playId),o.data.totalPlayedSeconds>2e3&&t.afterError.promise(new D("Plays error. Too big play time",{code:"E_PLAYS_BIG_PLAY_TIME",data:{timeStagesOfPlayback:a.entity.timeStagesOfPlayback,contextId:a.context.data.meta.id,entityId:a.entity.data.meta.id,totalPlayedSeconds:o.data.totalPlayedSeconds,trackLengthSeconds:o.data.trackLengthSeconds,playId:o.data.playId,isOnStart:!1,entityListLength:e.state.queueState.entityList.value.length,index:e.state.queueState.index.value,repeat:e.state.queueState.repeat.value}})),this.playsResource.sendPlays({clientNow:I(),plays:[o.data]}).then(()=>{o.isSent=!0,i()}).catch(e=>{o.isSent=!1;let r="",n="";a&&(r=a.context.data.meta.id,n=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:e,data:{contextId:r,entityId:n}})),i()})}else i()}catch(r){let e="",o="";a&&(e=a.context.data.meta.id,o=a.entity.data.meta.id),t.afterError.promise(new D("Error while sending plays",{cause:r,data:{contextId:e,entityId:o}})),i()}})}saveEntityPlay(e){let t=this.entityPlaysMap[e.data.playId];void 0===t?this.entityPlaysMap[e.data.playId]=[e]:t.push(e)}changePlayerStageByPlayId({playId:e,stage:t}){this.playerStageByEntitiesPlayId.set(e,t)}}(o=n||(n={})).PLAY="play",o.PAUSE="pause",o.NEXT="nexttrack",o.PREV="previoustrack",o.SEEK="seekto",o.STOP="stop";let z=[40,50,80,100,200,300,400],F=[n.PLAY,n.PAUSE,n.STOP,n.SEEK];class W{browserName;browserVersion;constructor({browserName:e,browserVersion:t}){this.browserName=e,this.browserVersion=t}isSupported(){return"mediaSession"in window.navigator&&"MediaMetadata"in window}handleMediaActionEvents(e,t){let{action:i}=e;switch(i){case n.PLAY:t.resume();break;case n.PAUSE:case n.STOP:t.pause();break;case n.NEXT:t.moveForward();break;case n.PREV:t.moveBackward();break;case n.SEEK:{if((0,g.OX)(t.state.queueState.currentEntity.value?.entity))return;let{seekTime:i}=e;i&&t.setProgress(i)}}}prepareMetadata(e){let t,i;let a={title:e.title};if("artists"in e){let t=(e.artists||[]).map(e=>e.name).join(", ");a.artist=t}if("albums"in e){let t=e.albums?.[0]?.title;a.album=t}return"coverUri"in e&&(t=e.coverUri),"imageUrl"in e&&(t=e.imageUrl),t&&(i=z.map(e=>{let i=`${e}x${e}`;return"Safari"===this.browserName&&(i=`${2*e}x${2*e}`),{sizes:i,src:`https://${t.replace("%%",i)}`,type:"image/jpg"}})),a.artwork=i,a}updateMetadata(e){if(!e)return;let t=this.prepareMetadata(e);window.navigator.mediaSession.metadata=new MediaMetadata(t)}handlePlayerEvents(e){let t,i;e.state.playerState.event.onChange(()=>{(e.state.playerState.event.value===N.KX.START||e.state.playerState.event.value===N.KX.UPDATING_PROGRESS)&&(this.updateMetadata(e.state.queueState.currentEntity.value?.entity.data.meta),(0,g.OX)(e.state.queueState.currentEntity.value?.entity)?navigator.mediaSession.setPositionState({duration:0,position:0}):navigator.mediaSession.setPositionState(),F.forEach(t=>{try{window.navigator.mediaSession.setActionHandler(t,t=>this.handleMediaActionEvents(t,e))}catch{console.log(`The media session action "${t}" is not supported yet.`)}}))}),e.state.currentContext.onChange(()=>{t?.(),i?.(),t=e.state.currentContext.value?.availableActions.moveBackward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveBackward.value??!1;window.navigator.mediaSession.setActionHandler(n.PREV,t?t=>this.handleMediaActionEvents(t,e):null)}),i=e.state.currentContext.value?.availableActions.moveForward.onChange(()=>{let t=e.state.currentContext.value?.availableActions.moveForward.value??!1;window.navigator.mediaSession.setActionHandler(n.NEXT,t?t=>this.handleMediaActionEvents(t,e):null)})})}apply(e){let{playback:t}=e;this.isSupported()&&this.handlePlayerEvents(t)}}class Y{logger;constructor(e){let{logger:t}=e;this.logger=t}apply(e){let{hooks:t,playback:i}=e;t.afterError.tapPromise("LoggerPlugin",e=>{let t;let a=i.state.queueState.currentEntity.value?i.state.queueState.currentEntity.value.entity.mediaSource:null;return(t=e instanceof q.y?e:new q.y("Error in Sonata player",{code:"E_SONATA",cause:e})).name=`[Sonata] ${t.name}`,this.logger.error(t,{...t.data,...a||{},code:t.code,cause:t.cause,stack:t.stack}),Promise.resolve()})}}let G=[b.Ak.Album,b.Ak.Artist,b.Ak.Playlist,b.Ak.Various],K=(e,t)=>{let i=e.state.currentContext.value?.data;if(!i)return"";let a=i.type,o=e.state.queueState.entityList.value.length||0;return a===b.Ak.Various&&1===o&&(a="track"),i.type===b.Ak.Various&&i.overrideContextType&&(a=i.overrideContextType),`${t}-radio-${a}-autoflow`},J=e=>{let t=e.state.currentContext.value?.data;if(t){if(t.type===b.Ak.Album)return[`album:${t.meta.id}`];if(t.type===b.Ak.Artist)return[`artist:${t.meta.id}`];if(t.type===b.Ak.Playlist&&t.meta.owner?.uid&&t.meta.kind)return[`playlist:${t.meta.owner?.uid}_${t.meta.kind}`];if(t.type===b.Ak.Various){if(t.overrideAutoflowSeeds)return t.overrideAutoflowSeeds;let i=e.state.queueState.currentEntity.value?.entity.data.meta.id;return[`track:${i}`]}}};class ${contextFactory;platform;constructor({contextFactory:e,platform:t}){this.contextFactory=e,this.platform=t}apply(e){let{playback:t,hooks:i}=e;i.afterContextEnd.tapPromise("AutoflowPlugin",()=>{let e=t.state.currentContext.value?.data.type;return e&&G.includes(e)&&this.playAutoflow(t),Promise.resolve()})}playAutoflow(e){let t=e.state.currentContext.value?.data.type,i=J(e);if(!(t&&i))return;let a=this.contextFactory.create({data:{type:b.Ak.Vibe,meta:{id:b.Ak.Vibe},seeds:i,from:K(e,this.platform),includeTracksInResponse:!0}});e.playContext({context:a,loadContextMeta:!0})}}class X{quality;constructor(e){this.quality=e}apply(e){let{playback:t,hooks:i}=e;this.quality.onChange(()=>{t.state.playerState.status.value!==N.Xz.IDLE&&t.reloadEntity().catch(e=>{i.afterError.promise(e)})})}}class Q{streamsResource;timeoutId=0;constructor(e){let{httpClient:t,streamsResourceConfig:i}=e;this.streamsResource=new w.hd(t,i)}apply(e){let{hooks:t,playback:i}=e;t.beforeEntityChange.tapPromise("ContinuePlayingPlugin",()=>{let{position:e,duration:t}=this.getTimingsFromPlayback(i);return new Promise(a=>{e!==t&&this.checkBeforeProgressSync(i),a()})}),i.state.playerState.status.onChange(e=>{let{position:t,duration:a}=this.getTimingsFromPlayback(i);if(e===N.Xz.PAUSED||e===N.Xz.STOPPED){if(e===N.Xz.PAUSED&&t===a)return;this.clearTimeout(),this.checkBeforeProgressSync(i)}e===N.Xz.PLAYING&&this.shouldSendProgressSync(i)&&this.setTimeout(i)})}checkBeforeProgressSync(e){if(this.clearTimeout(),!this.shouldSendProgressSync(e))return;let{position:t,duration:i}=this.getTimingsFromPlayback(e),a=e.state.queueState.currentEntity.value?.entity.data.meta.id;Number.isFinite(i)&&Number.isFinite(t)&&i&&t&&a&&(this.sendProgressSync({duration:i,position:t,trackId:a}),e.state.playerState.status.value===N.Xz.PLAYING&&this.setTimeout(e))}sendProgressSync(e){let t=new Date().toISOString(),{duration:i,position:a,trackId:o}=e;this.streamsResource.progressSync({lastSyncTimestamp:t,trackStreams:[{trackId:o,positionSec:a,trackLengthSec:i,finished:a===i,timestamp:t}]})}shouldSendProgressSync(e){let t=e.state.queueState.currentEntity.value?.entity.data.meta;return!!(t&&"rememberPosition"in t&&t.rememberPosition)}setTimeout(e){this.clearTimeout(),this.timeoutId=window.setTimeout(()=>{this.checkBeforeProgressSync(e)},18e4)}clearTimeout(){window.clearTimeout(this.timeoutId)}getTimingsFromPlayback(e){return{duration:Math.floor(e.state.playerState.progress.value.duration),position:Math.floor(e.state.playerState.progress.value.position)}}}var ee=i(45412),et=i(86502),ei=i(66026),ea=i(57921),eo=i(69559),er=i(68085),en=i(5674);let el=null,es=null,ed=null,eu=(0,s.Pi)(e=>{let{children:t,hostTld:i,userAgent:a,quality:o}=e,r=(0,en.uK)(),{sonataState:n,experiments:s,library:u,user:c}=(0,en.oR)(),C=(0,en.wL)(),h=r.get(en.V0),{language:m}=(0,en.ZS)(),p=(0,d.useMemo)(()=>(el||(el=new Z.$J(o)),el),[o]),v=(0,d.useMemo)(()=>{if(es)return es;let e=r.get(en.U5),t=r.get(en.pI),o=t({credentials:"include"}),n=r.get(en.xi),{resources:l,player:{gateway:{prefixUrl:d,headers:c}}}=e,{timeouts:h,retryPolicyConfig:v}=l.musicExternalApi,E=new b.Tg({httpClient:o,logger:C,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,resourceTimeoutsConfig:h,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},contextVariables:{vibe:{get sendFeedbackToSessionTracks(){return s.checkExperiment(en.pe.WebNextWaveNewFeedbacks,"on")}}}}}),f=new g.nS({likeStore:u}),{overembed:_,externalDomain:y,...A}={params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c},overembed:e.player.overembed,externalDomain:e.player.externalDomain},P=new Z.Ez({downloadInfoProviderParams:{httpClient:o,resourceConfig:{...A,overembed:_,externalDomain:y},secretKey:e.player.secretKey,mediaConfigController:p},getFileInfoProviderParams:{httpClient:o,resourceConfig:A,secretKey:e.player.secretKey,mediaConfigController:p,transport:w.J7.RAW,variables:{get useNewCorrespondenceBetweenQualityParams(){return s.checkExperiment(en.pe.WebNextEnableNewQuality,"on")}}},variables:{get switchToStrmWithoutEncrypt(){return s.checkExperiment(en.pe.WebNextSwitchToStrmWithoutEncrypt,"on")}}}),L=new Z.sd({httpClient:o,config:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},retryPolicyConfig:v,timeouts:h.tracksResource,gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}}),N=new x;return es=new et.$7({contextFactory:E,entityFactory:f,audioCore:N,mediaProvider:P,entityProvider:L,windowPaginationConfig:{windowSize:30,setupQueueWindowSize:80},config:{mediaElementErrorReloadCount:2},plugins:[new k,new V,new j,new U({httpClient:o,playsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}},variables:{get disableSendPlaysOnTrackStart(){return s.checkExperiment(en.pe.WebNextDisableSendPlaysOnTrackStart,"on")},get enableSendMaxPlayerStage(){return s.checkExperiment(en.pe.WebPlayAudioSendPrepare,"on")}}}),new W({browserName:a.browserName,browserVersion:a.browserVersion}),new Y({logger:C}),new $({contextFactory:E,platform:"desktop"}),new X(p.quality),new Q({httpClient:o,streamsResourceConfig:{params:{common:{client:(0,er.$)(),language:m,oauth:n.token}},gateway:{prefixUrl:(0,en.zJ)(d,i),headers:c}}})]})},[s,r,C,i,p,a.browserName,a.browserVersion,m,u]),E=(0,d.useMemo)(()=>(ed||(null==v?void 0:v.source)&&(ed="Safari"===a.browserName?new ei.Qz:new ei.WZ(v.source)),ed),[null==v?void 0:v.source,a.browserName]);v&&(0,ea.A4)(v),(0,d.useEffect)(()=>{let e,t,i,a,o;let r=null==v?void 0:v.state.queueState.currentEntity.onChange(e=>{var t;let i=null==e?void 0:e.context.data.type,a=null==e?void 0:e.context.data.meta.id;n.setEntityMeta(null!==(t=null==e?void 0:e.entity)&&void 0!==t?t:null),i&&n.setContextType(i),a&&n.setContextId(a)}),l=null==v?void 0:v.state.queueState.order.onChange(e=>{let t=v.state.queueState.index.value;if(e){let i=e[t];v.state.queueState.order.value.length>0&&"number"==typeof i&&n.setCurrentlyPlayingTrackIndex(i)}}),s=null==v?void 0:v.state.playerState.status.onChange(e=>{e&&(n.setStatus(e),(0,ea.Pt)({isPlaying:e===et.Xz.PLAYING}))}),d=null==v?void 0:v.state.currentContext.onChange(()=>{var r,l,s,d,u,c,C,m,p,E,f;null===(r=e)||void 0===r||r(),null===(l=t)||void 0===l||l(),null===(s=i)||void 0===s||s(),null===(d=a)||void 0===d||d(),null===(u=o)||void 0===u||u();let _=null!==(f=h.get(en.BU.YmPlayerRepeatMode))&&void 0!==f?f:ee.zq.NONE;v.setRepeatMode(_);let y=!!h.get(en.BU.YmPlayerShuffle);v.setShuffle(y),e=null==v?void 0:null===(c=v.state.currentContext.value)||void 0===c?void 0:c.availableActions.moveBackward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveBackward.value);n.setCanMoveBackward(t),(0,ea.Pt)({canMoveBackward:t})}),t=null==v?void 0:null===(C=v.state.currentContext.value)||void 0===C?void 0:C.availableActions.moveForward.onChange(()=>{var e;let t=!!(null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.moveForward.value);n.setCanMoveForward(t),(0,ea.Pt)({canMoveForward:t})}),i=null==v?void 0:null===(m=v.state.currentContext.value)||void 0===m?void 0:m.availableActions.repeat.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.repeat.value;"boolean"==typeof t&&n.setCanChangeRepeatMode(t)}),a=null==v?void 0:null===(p=v.state.currentContext.value)||void 0===p?void 0:p.availableActions.shuffle.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.shuffle.value;"boolean"==typeof t&&n.setCanShuffle(t)}),o=null==v?void 0:null===(E=v.state.currentContext.value)||void 0===E?void 0:E.availableActions.speed.onChange(()=>{var e;let t=null==v?void 0:null===(e=v.state.currentContext.value)||void 0===e?void 0:e.availableActions.speed.value;"boolean"==typeof t&&(n.setCanSpeed(t),!t&&v&&v.setSpeed(1))})}),u=null==v?void 0:v.state.playerState.volume.onChange(()=>{let e=v.state.playerState.volume.value;"number"==typeof e&&n.setVolume(e)}),c=null==v?void 0:v.state.queueState.repeat.onChange(()=>{let e=v.state.queueState.repeat.value;n.setRepeatMode(e),h.set(en.BU.YmPlayerRepeatMode,e)}),C=null==v?void 0:v.state.queueState.shuffle.onChange(()=>{let e=v.state.queueState.shuffle.value;n.setShuffle(e),h.set(en.BU.YmPlayerShuffle,e)});return()=>{null==r||r(),null==l||l(),null==s||s(),null==d||d(),null==u||u(),null==c||c(),null==C||C()}},[v,n,h]),(0,d.useEffect)(()=>{let e=h.get(en.BU.YmPlayerVolume);"number"==typeof e?(null==v||v.setVolume(e),n.setVolume(e)):(null==v||v.setVolume(1),n.setVolume(1))},[h,v,n]);let f=(0,d.useMemo)(()=>{let e=s.checkExperiment(en.pe.WebNextEnableNewQuality,"on");if(!c.hasPlus)return Z.nJ.PREVIEW;let t=h.get(en.BU.YmPlayerQuality);return(e||t!==Z.nJ.HQ_PLUS)&&t||(h.set(en.BU.YmPlayerQuality,Z.nJ.HQ),Z.nJ.HQ)},[s,c.hasPlus,h]);return(0,d.useEffect)(()=>{p.setQuality(f),n.setQuality(f)},[p,n,f]),(0,l.jsx)(en.Xe.Provider,{value:p,children:(0,l.jsx)(en.R8.Provider,{value:v,children:(0,l.jsx)(eo.y5.Provider,{value:E,children:t})})})})},42622:function(e,t,i){"use strict";i.r(t),i.d(t,{ThemeProvider:function(){return n}});var a=i(8759),o=i(99616),r=i(5674);let n=e=>{let{children:t}=e,i=(0,r.uK)(),n=i.get(r.V0),l=(0,r.oz)(),[s,d]=(0,o.useState)((0,r.NK)(n.get(r.BU.Theme),l));(0,o.useEffect)(()=>{(0,r.kz)(n.get(r.BU.Theme))},[n]),(0,o.useEffect)(()=>{n.get(r.BU.Theme)===r.rL&&d(l)},[l,n]);let u=(0,o.useMemo)(()=>({theme:s,setTheme:d}),[s]);return(0,a.jsx)(r.Ni.Provider,{value:u,children:t})}},19976:function(e,t,i){"use strict";i.r(t),i.d(t,{TranslationsProvider:function(){return s}});var a=i(8759),o=i(99616),r=i(17516),n=i(28151),l=i(5674);let s=e=>{let{children:t}=e,{dictionary:i,language:s,defaultLanguage:d}=(0,l.ZS)(),u=(0,l.wL)(),c=(0,o.useCallback)(e=>{if("code"in e&&e.code===r.bc.MISSING_DATA)return;let t=e&&"object"==typeof e&&"code"in e&&e.code,i="IntlProviderError";t&&(i+=":".concat(t)),u.error(i,{error:null==e?void 0:e.message,stack:null==e?void 0:e.stack})},[u]);return(0,a.jsx)(n.Z,{onError:c,defaultLocale:d,locale:s,messages:i,children:t})}},98125:function(e,t,i){"use strict";i.d(t,{F:function(){return v},K:function(){return h}});var a=i(8759),o=i(35338),r=i(33423),n=i(99616),l=i(65244),s=i(454),d=i(15527),u=i(14581),c=i(22926),C=i(5674);let h=()=>{let e=(0,C.uK)(),t=e.get(C.V0),i=(0,C.R$)();return(0,n.useCallback)(async e=>{var a;if(0!==e)t.set(C.BU.YmPlayerPrevVolume,e),await (null==i?void 0:i.setVolume(0)),t.set(C.BU.YmPlayerVolume,0);else{let e=null!==(a=t.get(C.BU.YmPlayerPrevVolume))&&void 0!==a?a:1;t.remove(C.BU.YmPlayerPrevVolume),await (null==i?void 0:i.setVolume(e)),t.set(C.BU.YmPlayerVolume,e)}},[i,t])};var m=i(73939),p=i.n(m);let v=(0,r.Pi)(e=>{var t,i;let{className:r}=e,{formatMessage:m}=(0,l.Z)(),v=(0,C.uK)(),E=(0,C.R$)(),{sonataState:f}=(0,C.oR)(),_=h(),y=v.get(C.V0),A=null!==(i=null!==(t=y.get(C.BU.YmPlayerVolume))&&void 0!==t?t:f.volume)&&void 0!==i?i:1,P=(0,n.useCallback)(e=>{null==E||E.setVolume(e),y.set(C.BU.YmPlayerVolume,e)},[E,y]),L=(0,n.useCallback)(async()=>{await _(f.volume)},[_,f.volume]),x=m(0===f.volume?{id:"player-actions.volume-on"}:{id:"player-actions.volume-off"});return(0,a.jsxs)("div",{className:(0,o.W)(p().root,r),children:[(0,a.jsx)(d.z,{radius:"round",size:"xxxs",variant:"text",withRipple:!1,onClick:L,"aria-label":x,icon:(0,a.jsx)(u.J,{size:"xs",className:p().icon,variant:0===A?"volumeOff":"volume"}),className:p().button,...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_BUTTON)}),(0,a.jsx)(c.i,{thumbSize:"s",trackSize:"s",value:A,maxValue:1,step:.01,onChange:P,"aria-label":m({id:"player-actions.volume-control"}),...(0,s.BA)(s.bG.changeVolume.CHANGE_VOLUME_SLIDER)})]})})},65151:function(e,t,i){"use strict";i.d(t,{t:function(){return s}});var a=i(8759),o=i(99616),r=i(45412),n=i(5674),l=i(34512);let s=()=>{let{notify:e}=(0,n.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,n.oR)(),s=(0,n.R$)();return(0,o.useCallback)(()=>{if(null===t.entityMeta||!t.canChangeRepeatMode)return;let o=r.zq.NONE;switch(t.repeatMode){case r.zq.NONE:o=r.zq.CONTEXT;break;case r.zq.CONTEXT:o=r.zq.ONE}null==s||s.setRepeatMode(o),e((0,a.jsx)(l.NotificationRepeat,{repeatMode:o}),{containerId:i.isOpened?n.W$.FULLSCREEN_INFO:n.W$.INFO})},[i.isOpened,e,s,t.canChangeRepeatMode,t.entityMeta,t.repeatMode])}},37960:function(e,t,i){"use strict";i.d(t,{m:function(){return l}});var a=i(8759),o=i(99616),r=i(5674),n=i(74758);let l=()=>{let{notify:e}=(0,r.d$)(),{sonataState:t,modals:{fullscreenPlayerModal:i}}=(0,r.oR)(),l=(0,r.R$)();return(0,o.useCallback)(()=>{null!==t.entityMeta&&t.canShuffle&&(null==l||l.toggleShuffle(),e((0,a.jsx)(n.NotificationShuffle,{shuffle:!!(null==l?void 0:l.state.queueState.shuffle.value)}),{containerId:i.isOpened?r.W$.FULLSCREEN_INFO:r.W$.INFO}))},[i.isOpened,e,l,t.canShuffle,t.entityMeta])}},34512:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationRepeat:function(){return h}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(45412),s=i(14581),d=i(1918),u=i(44285),c=i(55075),C=i.n(c);let h=e=>{let{repeatMode:t,closeToast:i}=e,c=t===l.zq.ONE?"repeat_one":"repeat",h=(0,r.useMemo)(()=>{let e;switch(t){case l.zq.CONTEXT:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-context"});break;case l.zq.ONE:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-track"});break;case l.zq.NONE:default:e=(0,a.jsx)(n.Z,{id:"notifications-info.change-repeat-none"})}return(0,a.jsx)(d.Caption,{className:C().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(u.Yj,{cover:(0,a.jsx)(s.J,{className:(0,o.W)(C().icon,{[C().icon_unset]:t===l.zq.NONE}),size:"xs",variant:c}),message:h,closeToast:i})}},74758:function(e,t,i){"use strict";i.r(t),i.d(t,{NotificationShuffle:function(){return C}});var a=i(8759),o=i(35338),r=i(99616),n=i(2814),l=i(14581),s=i(1918),d=i(44285),u=i(46520),c=i.n(u);let C=e=>{let{shuffle:t,closeToast:i}=e,u=(0,r.useMemo)(()=>{let e;return e=t?(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-enabled"}):(0,a.jsx)(n.Z,{id:"notifications-info.shuffle-disabled"}),(0,a.jsx)(s.Caption,{className:c().message,variant:"div",type:"controls",size:"m",children:e})},[t]);return(0,a.jsx)(d.Yj,{cover:(0,a.jsx)(l.J,{className:(0,o.W)(c().icon,{[c().icon_unset]:!t}),size:"xs",variant:"shuffle"}),message:u,closeToast:i})}},6769:function(e,t,i){"use strict";i.r(t),i.d(t,{RepeatButton:function(){return m}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(45412),s=i(15527),d=i(14581),u=i(65151),c=i(20873),C=i.n(c);let h=(e,t,i)=>t(e===l.zq.NONE||i?{id:"player-actions.repeat"}:e===l.zq.ONE?{id:"player-actions.repeat-one"}:{id:"player-actions.repeat-context"}),m=e=>{let{isDisabled:t,repeatMode:i,className:c,iconClassName:m,size:p="xxxs",iconSize:v="xs",color:E,variant:f="default"}=e,_=(0,u.t)(),{formatMessage:y}=(0,r.Z)(),A=t||i!==l.zq.ONE?"repeat":"repeat_one",P=h(i,y,t);return(0,a.jsx)(s.z,{className:c,radius:"round",size:p,variant:f,color:E,disabled:t,withRipple:!1,"aria-label":P,"aria-pressed":!t&&i!==l.zq.NONE,onClick:_,icon:(0,a.jsx)(d.J,{size:v,variant:A,className:(0,o.W)(C().repeatIcon,C()["repeatIcon_".concat(i)],{[C().repeatIcon_disabled]:t},m)}),...(0,n.BA)(n.bG.sonata.REPEAT_BUTTON)})}},66403:function(e,t,i){"use strict";i.r(t),i.d(t,{ShuffleButton:function(){return C}});var a=i(8759),o=i(35338),r=i(65244),n=i(454),l=i(15527),s=i(14581),d=i(37960),u=i(94406),c=i.n(u);let C=e=>{let{isDisabled:t,shuffle:i,className:u,size:C="xxxs",variant:h="default",iconSize:m="xs",color:p}=e,v=(0,d.m)(),{formatMessage:E}=(0,r.Z)();return(0,a.jsx)(l.z,{className:u,radius:"round",size:C,variant:h,color:p,withRipple:!1,disabled:t,"aria-label":E({id:"player-actions.shuffle"}),"aria-pressed":!t&&i,icon:(0,a.jsx)(s.J,{variant:"shuffle",size:m,className:(0,o.W)(c().shuffleIcon,{[c().shuffleIcon_disabled]:t,[c().shuffleIcon_on]:!t&&i,[c().shuffleIcon_off]:!t&&!i})}),onClick:v,...(0,n.BA)(n.bG.sonata.SHUFFLE_BUTTON)})}},21871:function(e,t,i){"use strict";i.r(t),i.d(t,{SonataControls:function(){return w}});var a=i(8759),o=i(33423),r=i(99616),n=i(86502),l=i(5674),s=i(65151),d=i(37960),u=i(35338),c=i(65244),C=i(454),h=i(15527),m=i(14581),p=i(44285),v=i(6769),E=i(66403),f=i(19035),_=i.n(f);let y=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,shuffle:s,onClickNext:d,onClickPrev:f,onClickPlayPause:y,canChangeRepeatMode:A,className:P}=e,{formatMessage:L}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(_().root,P),children:[(0,a.jsx)("div",{className:_().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:_().sonataButton,size:"xxxs",variant:"text",iconSize:"xs",isDisabled:t,shuffle:s})}),(0,a.jsxs)("div",{className:_().sonataButtons,children:[(0,a.jsx)(h.z,{className:_().sonataButton,variant:"text",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":L({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:f,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:_().sonataButton,iconSize:"l",variant:"filled",isPlaying:i,iconClassName:_().playButtonIcon,onClick:y}),(0,a.jsx)(h.z,{className:_().sonataButton,radius:"round",size:"m",variant:"text",disabled:!r,withRipple:!1,"aria-label":L({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:d,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:_().buttonContainer,children:(t||A)&&(0,a.jsx)(v.RepeatButton,{className:_().sonataButton,size:"xxxs",variant:"text",isDisabled:t,iconSize:"xs",repeatMode:o})})]})});var A=i(57004);let P=e=>{let{disabled:t,isPlaying:i,onClickPlayPause:o,className:r}=e;return(0,a.jsx)(A.PlayButton,{className:r,size:"s",disabled:t,isPlaying:i,onClick:o})};var L=i(24516),x=i.n(L);let b=(0,o.Pi)(e=>{let{disabled:t,isPlaying:i,repeatMode:o,canMoveForward:r,canMoveBackward:n,canShuffle:l,onClickNext:s,onClickPrev:d,onClickPlayPause:f,canChangeRepeatMode:_,shuffle:y,className:A}=e,{formatMessage:P}=(0,c.Z)();return(0,a.jsxs)("div",{className:(0,u.W)(x().root,A),children:[(0,a.jsx)("div",{className:x().buttonContainer,children:(t||l)&&(0,a.jsx)(E.ShuffleButton,{className:x().sonataButton,size:"s",iconSize:"xxs",color:"secondary",isDisabled:t,shuffle:y})}),(0,a.jsxs)("div",{className:x().sonataButtons,children:[(0,a.jsx)(h.z,{className:x().sonataButton,color:"secondary",size:"m",radius:"round",disabled:!n,withRipple:!1,"aria-label":P({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:d,...(0,C.BA)(C.bG.sonata.PREVIOUS_TRACK_BUTTON)}),(0,a.jsx)(p.JM,{className:x().sonataButton,iconSize:"m",size:"l",radius:"round",color:"secondary",buttonVariant:"default",isPlaying:i,iconClassName:x().playPauseButtonIcon,onClick:f}),(0,a.jsx)(h.z,{className:x().sonataButton,radius:"round",size:"m",color:"secondary",disabled:!r,withRipple:!1,"aria-label":P({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:s,...(0,C.BA)(C.bG.sonata.NEXT_TRACK_BUTTON)})]}),(0,a.jsx)("div",{className:x().buttonContainer,children:(t||_)&&(0,a.jsx)(v.RepeatButton,{className:x().sonataButton,size:"s",color:"secondary",isDisabled:t,iconSize:"xxs",repeatMode:o})})]})});var g=i(57413),N=i(43310),V=i(3273),S=i.n(V);let T=(0,o.Pi)(e=>{let{isPlaying:t,canMoveForward:i,canMoveBackward:o,onClickNext:n,onClickPrev:s,onClickPlayPause:d,className:C}=e,{formatMessage:v}=(0,c.Z)(),{user:E,sonataState:f}=(0,l.oR)(),_=(0,l.XU)(),y=f.entityMeta,A=f.contextType===g.Ak.Generative,P=E.isAuthorized&&!A,L=(0,N.SB)(f.entityMeta),x=(0,N.KX)(f.entityMeta);return(0,r.useEffect)(()=>{if(!f.isGenerativeContext)return null==_||_.addShortcutsListener(l.yx.LIKE,L),null==_||_.addShortcutsListener(l.yx.DISLIKE,x),()=>{null==_||_.removeShortcutsListener(l.yx.LIKE),null==_||_.removeShortcutsListener(l.yx.DISLIKE)}},[x,L,_,f.isGenerativeContext]),(0,a.jsxs)("div",{className:(0,u.W)(S().root,C),children:[(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.Q1,{isDisliked:y.isDisliked,onClick:x})}),(0,a.jsxs)("div",{className:S().sonataButtons,children:[(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",color:"secondary",size:"m",radius:"round",disabled:!o,withRipple:!1,"aria-label":v({id:"player-actions.previous-track"}),icon:(0,a.jsx)(m.J,{variant:"previous"}),onClick:s}),(0,a.jsx)(p.JM,{className:S().sonataButton,iconSize:"xxl",variant:"filled",color:"secondary",isPlaying:t,iconClassName:S().playPauseButtonIcon,onClick:d}),(0,a.jsx)(h.z,{className:S().sonataButton,variant:"text",radius:"round",size:"m",color:"secondary",disabled:!i,withRipple:!1,"aria-label":v({id:"player-actions.next-track"}),icon:(0,a.jsx)(m.J,{variant:"next"}),onClick:n})]}),(0,a.jsx)("div",{className:S().buttonContainer,children:y&&P&&(0,a.jsx)(p.dJ,{isLiked:y.isLiked,onClick:L})})]})}),w=(0,o.Pi)(e=>{var t,i;let{isMobile:o,entityMeta:u,isFullscreen:c,className:C}=e,{sonataState:h,vibe:m}=(0,l.oR)(),p=(0,l.XU)(),v=(0,l.R$)(),{togglePlay:E}=(0,l.Qh)({seeds:null!==(i=null===(t=m.meta)||void 0===t?void 0:t.seeds)&&void 0!==i?i:[],pageIdForFrom:l.Rh.HOME,blockIdForFrom:l.BE.RUP_MAIN_RADIO}),f=(0,r.useMemo)(()=>{let e=[n.Xz.PLAYING,n.Xz.LOADING_MEDIA_SOURCE,n.Xz.LOADING_MEDIA_DATA];return e.includes(h.status)},[h.status]),_=(0,r.useCallback)(()=>{u?null==v||v.togglePause():E()},[u,v,E]),A=(0,r.useCallback)(()=>{null==v||v.moveForward()},[v]),L=(0,r.useCallback)(()=>{null==v||v.moveBackward()},[v]),x=(0,d.m)(),g=(0,s.t)();(0,r.useEffect)(()=>{if(!c)return null==p||p.addShortcutsListener(l.yx.TOGGLE_PLAY,_),null==p||p.addShortcutsListener(l.yx.TOGGLE_REPEAT,g),null==p||p.addShortcutsListener(l.yx.TOGGLE_SHUFFLE,x),()=>{null==p||p.removeShortcutsListener(l.yx.TOGGLE_PLAY),null==p||p.removeShortcutsListener(l.yx.TOGGLE_SHUFFLE),null==p||p.removeShortcutsListener(l.yx.TOGGLE_REPEAT)}},[c,_,g,x,p]);let N=(0,r.useMemo)(()=>c?o?T:b:o?P:y,[o,c]);return(0,a.jsx)(N,{className:C,disabled:null===h.entityMeta,isPlaying:f,canMoveBackward:h.canMoveBackward,canMoveForward:h.canMoveForward,canShuffle:h.canShuffle,shuffle:h.shuffle,onClickPlayPause:_,onClickNext:A,onClickPrev:L,canChangeRepeatMode:h.canChangeRepeatMode,repeatMode:h.repeatMode})})},68085:function(e,t,i){"use strict";i.d(t,{$:function(){return d}});var a,o,r=i(28307),n=i(93991),l=i(39351);(a=o||(o={})).WEB="YandexMusicWebNext",a.DESKTOP="YandexMusicDesktopApp";let s=(e,t)=>"".concat(e,"/").concat(t),d=()=>{{let e=(0,l.b)()||"1.0",t="".concat(o.DESKTOP).concat((0,n.y)((0,r.X)()));return s(t,e)}}},93991:function(e,t,i){"use strict";i.d(t,{y:function(){return o}});var a=i(38060);let o=e=>{switch(e){case"win32":return a.B.WINDOWS;case"darwin":return a.B.MACOS;case"linux":return a.B.WINDOWS}return null}},38060:function(e,t,i){"use strict";var a,o;i.d(t,{B:function(){return a}}),(o=a||(a={})).WINDOWS="Windows",o.MACOS="MacOS",o.LINUX="Linux"},2365:function(e,t,i){"use strict";i.d(t,{T:function(){return a.NotFound}});var a=i(54529)},54529:function(e,t,i){"use strict";i.r(t),i.d(t,{NotFound:function(){return m}});var a=i(8759),o=i(35338),r=i(33423),n=i(2814),l=i(15527),s=i(14581),d=i(1918),u=i(42769),c=i(5674),C=i(94170),h=i.n(C);let m=(0,r.Pi)(e=>{let{className:t}=e,{contentRef:i}=(0,c.$Y)(),r=(0,c.s0)("/");return(0,c.ZP)(!0),(0,a.jsxs)("div",{className:(0,o.W)(h().root,{[h().root_desktop]:!i},t),children:[(0,a.jsx)(u.n,{withBackwardFallback:"/",className:h().navigation,withForwardControl:!1}),(0,a.jsxs)("div",{className:h().content,children:[(0,a.jsx)(s.J,{className:h().icon,variant:"musicLogo",size:"xxl"}),(0,a.jsx)(d.Heading,{className:(0,o.W)(h().title,h().important),variant:"h3",size:"xs",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist"})}),(0,a.jsx)(d.Caption,{className:(0,o.W)(h().text,h().important),variant:"span",type:"text",size:"l",weight:"normal",children:(0,a.jsx)(n.Z,{id:"page-error.page-does-not-exist-description"})}),(0,a.jsx)(l.z,{onClick:r,className:h().button,role:"link",color:"secondary",size:"l",radius:"xxxl",children:(0,a.jsx)(d.Caption,{type:"controls",variant:"span",size:"m",children:(0,a.jsx)(n.Z,{id:"navigation.page-main"})})})]})]})})},48157:function(e,t,i){"use strict";i.d(t,{hx:function(){return O},f3:function(){return ea},Vm:function(){return eg},KC:function(){return eT}});var a,o=i(8759),r=i(35338),n=i(33423),l=i(99616),s=i.t(l,2),d=i(65244),u=i(2814),c=i(454),C=i(57413),h=i(15527),m=i(14581),p=i(96437),v=i(1918),E=i(96911),f=i(96169),_=i(81446),y=i(5674),A=i(44285);let P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.filter(e=>!e.composer),i=t.filter(e=>!e.various),a=e.filter(e=>e.composer&&!e.various),o=[];return i.length>0?o=i:t.length>0&&(o=t),o.concat(a)};var L=i(33779),x=i.n(L),b=i(13236),g=i(41342),N=i.n(g);let V=(0,n.Pi)(e=>{let{className:t,text:i="",maxTextLength:a,minTextLength:n,variant:s="input",shouldFinishOnKeyPress:d=!1,placeholder:u,onChangeFinish:c}=e,[C,h]=(0,l.useState)(i),m=(0,l.useRef)(!1),p=(0,l.useRef)(null),v=(0,l.useCallback)(e=>{h(e.target.value)},[]),E=(0,l.useCallback)(e=>{if(d&&["Enter","Escape"].includes(e.key)){var t;"Escape"===e.key&&(m.current=!0),null===(t=e.currentTarget)||void 0===t||t.blur()}},[d]),f=(0,l.useCallback)(()=>{let e=C.trim();m.current||n&&e.length{p.current&&(p.current.selectionStart=p.current.value.length,p.current.selectionEnd=p.current.value.length)},[]),(0,l.useLayoutEffect)(()=>{let e=p.current;if(e){e.style.height="0px";let t=e.scrollHeight;e.style.height="".concat(t,"px")}},[p,C]);let _=(0,l.useMemo)(()=>"textarea"===s?e=>(0,o.jsx)("textarea",{ref:p,rows:6,...e}):e=>(0,o.jsx)("input",{...e}),[s]);return(0,o.jsx)(_,{className:(0,r.W)(N().root,t,{[N().root_textarea]:"textarea"===s}),type:"text",value:C,maxLength:a,onBlur:f,onChange:v,onKeyDown:E,placeholder:u,autoFocus:!0})});var S=i(74081),T=i.n(S);let w=(0,n.Pi)(e=>{let{title:t="","aria-labelledby":i,canChange:a=!1,onChange:n,maxTitleLength:s,version:u="",onVersionClick:C,className:p}=e,{settings:E}=(0,y.oR)(),{formatMessage:f}=(0,d.Z)(),[_,A]=(0,l.useState)(!1),P=(0,l.useRef)(null),L=E.layout===y.t8.Mobile,x=t.length+u.length,g=x>25,N=(0,l.useMemo)(()=>L?T().font_mobile:g?T().font_long:T().font_short,[L,g]),S=!L&&a&&_,w=(0,l.useCallback)(()=>{var e;A(!0),null===(e=P.current)||void 0===e||e.focus()},[]),R=(0,l.useCallback)(e=>{A(!1),null==n||n(e)},[n]);return(0,o.jsxs)(o.Fragment,{children:[!S&&(0,o.jsxs)("div",{className:(0,r.W)(T().root,p),children:[(0,o.jsx)(b.b4,{title:t,className:T().stickyTitle,children:(0,o.jsxs)(v.Heading,{variant:"h2",id:i,className:(0,r.W)(T().heading,{[T().heading_withVersion]:u}),...(0,c.BA)(c.QM.pageHeader.ENTITY_TITLE),children:[(0,o.jsx)(v.Caption,{className:(0,r.W)(T().font,N,T().title),variant:"span",children:t}),u&&(0,o.jsx)(v.Caption,{onClick:C,className:(0,r.W)(T().font,N,T().version,{[T().version_withOtherVersions]:C}),variant:"span",...(0,c.BA)(c.QM.pageHeader.ENTITY_VERSION),children:" ".concat(u)})]})}),a&&(0,o.jsx)("div",{className:(0,r.W)(T().editButton,{[T().editButton_centered]:!g&&!L}),children:(0,o.jsx)(h.z,{onClick:w,"aria-label":f({id:"playlist-actions.change-title"}),icon:(0,o.jsx)(m.J,{size:"xxs",variant:"pencil"}),size:"s",radius:"round",...(0,c.BA)(c.QM.pageHeader.EDIT_TITLE_BUTTON)})})]}),S&&(0,o.jsx)("div",{className:T().textFieldContainer,children:(0,o.jsx)(V,{text:t,className:(0,r.W)(T().font,N,T().textField,T().title,{[T().textField_long]:g&&!L}),onChangeFinish:R,maxTextLength:s,minTextLength:1,placeholder:f({id:"playlist-actions.enter-title"}),shouldFinishOnKeyPress:!0})})]})}),R=(0,n.Pi)(e=>{let{"aria-labelledby":t,entityName:i,title:a,meta:n,controls:s,className:d,forwardRef:u,canChangeTitle:C=!1,maxTitleLength:h,onTitleChange:m,cover:p,version:E,onVersionClick:f,disclaimerLabel:_,entityNameIcon:y}=e,A=(0,l.isValidElement)(_),P=(0,l.useMemo)(()=>A?(0,o.jsx)("div",{className:x().entityContainer,children:_}):(0,o.jsxs)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:x().entityName,children:[i,y]}),[_,i,y,A]);return(0,o.jsxs)("div",{className:(0,r.W)(x().root,d),ref:u,...(0,c.BA)(c.QM.pageHeader.ENTITY_HEADER),children:[(0,o.jsx)("div",{className:x().coverCell,children:p}),(0,o.jsxs)("div",{className:x().content,children:[(0,o.jsxs)("div",{className:x().info,children:[P,(0,o.jsx)(w,{className:(0,r.W)(x().title,{[x().title_withDisclaimerLabel]:A}),title:a,"aria-labelledby":t,canChange:C,maxTitleLength:h,onChange:m,version:E,onVersionClick:f}),!!n&&(0,o.jsx)("div",{className:(0,r.W)(x().meta,{[x().meta_withDisclaimerLabel]:A}),children:n})]}),(0,o.jsx)("div",{className:x().controls,children:s})]})]})}),M=(0,l.forwardRef)((e,t)=>(0,o.jsx)(R,{forwardRef:t,...e}));var H=i(86252),k=i.n(H);let j=e=>{let{coverVariant:t,coverUri:i,isAvailable:a,className:r,withBookmateBadge:n}=e;return(0,o.jsxs)(p.Paper,{radius:"round"===t?"round":"m",className:r,children:[(0,o.jsx)(A.BE,{fit:"cover",src:i,size:300,className:k().coverImage,withAvatarReplace:!0,isAvailable:a}),n&&(0,o.jsx)(m.J,{variant:"bookmateBadge",className:k().bookmateBadge})]})};var B=i(89998),Z=i.n(B);let I=(0,n.Pi)(e=>{var t,i,a;let n,{album:s,className:L,"aria-labelledby":x,forwardRef:b,onVersionClick:g}=e,N=(0,y.x5)({pageId:y.Rh.ALBUM,blockId:y.aU.ALBUM}),{formatMessage:V}=(0,d.Z)(),{settings:S,sonataState:{status:T,unloadedEntitiesData:w},experiments:R}=(0,y.oR)(),[H,k]=(0,l.useState)(!1),B=(0,f.SB)(s),I=(0,f.BV)(s),O=S.layout===y.t8.Mobile,q=R.checkExperiment(y.pe.WebPins,"on")&&!O,D=(0,f.TL)(s),U=(0,y.uK)(),z=U.get(y.U5),F=z.features.nonMusic&&s.isPodcast;F&&(n=s.isLiked?V({id:"interface-actions.subscribed"}):V({id:"interface-actions.subscribe"}));let W=(0,l.useMemo)(()=>P(s.artists),[s.artists]),Y=(null==W?void 0:W.length)===1&&!(null===(t=W[0])||void 0===t?void 0:t.decomposed)&&!(null===(i=W[0])||void 0===i?void 0:i.various),G=(0,f.H0)(s.type),{isPlaying:K,togglePlay:J}=(0,y.qm)({playContextParams:{contextData:{type:C.Ak.Album,meta:{id:s.id},from:N},loadContextMeta:!0,entitiesData:w},sonataStatus:T}),$=(0,o.jsxs)("div",{className:Z().meta,children:[Y&&(0,o.jsx)(p.Paper,{radius:"round",className:Z().artistCover,children:(0,o.jsx)(A.BE,{src:null===(a=W[0])||void 0===a?void 0:a.coverUri,size:30,withAvatarReplace:!0})}),(0,o.jsx)(_.jO,{artists:W,lineClamp:O?1:void 0,className:Z().artists,spoilerClassName:Z().artistsSpoiler,visibleArtistsCount:O?void 0:2,linkClassName:Z().artistLink,captionClassName:Z().artistLabel,variant:O?"breakAll":"breakWord"}),s.year&&(0,o.jsx)(v.Caption,{variant:"div",type:"text",size:"m",weight:"medium",className:(0,r.W)(Z().year,{[Z().year_dot]:W.length>0}),...(0,c.BA)(c.QM.pageHeader.ALBUM_RELEASE_DATE),children:s.year})]}),X=(0,l.useMemo)(()=>O?(0,o.jsx)(A.JM,{className:Z().playControl,color:"primary",buttonVariant:"default",iconSize:"xxl",isPlaying:K,onClick:J,variant:"filled",disabled:!s.isAvailable}):(0,o.jsx)(A.JM,{className:Z().playControl,withRipple:!0,buttonVariant:"default",radius:"xxxl",size:"s",color:"primary",iconSize:"xxs",isPlaying:K,onClick:J,disabled:!s.isAvailable,children:(0,o.jsx)(u.Z,{id:"player-actions.listen"})}),[s.isAvailable,O,K,J]),Q=(0,l.useMemo)(()=>{let e=O?"l":"s",t=O?"m":"xxs";return(0,o.jsxs)("div",{className:Z().controls,children:[X,(0,o.jsx)(A.dJ,{className:Z().likeControl,isLiked:s.isLiked,onClick:B,variant:"default",size:e,iconSize:t,iconClassName:Z().likeIcon,withRipple:!O,disabled:!s.isAvailable,"aria-label":n}),q&&(0,o.jsx)(A.RT,{onClick:I,isPinned:s.isPinned,isDisabled:!s.isAvailable,className:Z().pinControl}),(0,o.jsx)(E.oK,{album:s,open:H,onOpenChange:k,reference:(0,o.jsx)(h.z,{className:Z().menuControl,size:e,radius:"round",withRipple:!O,"aria-label":V({id:"interface-actions.context-menu"}),icon:(0,o.jsx)(m.J,{size:t,variant:"more"}),...(0,c.BA)(c.QM.pageHeader.ALBUM_HEADER_CONTEXT_MENU)})})]})},[O,X,s,B,n,q,I,H,V]),ee=(0,l.useMemo)(()=>{if(D)return(0,o.jsx)(m.J,{variant:"bookmateLogo",className:Z().bookmateLogo})},[D]);return(0,o.jsx)(M,{ref:b,className:L,controls:Q,meta:$,entityName:G,entityNameIcon:ee,title:s.title,cover:(0,o.jsx)(j,{coverVariant:"square",coverUri:s.coverUri,isAvailable:s.isAvailable,withBookmateBadge:D}),"aria-labelledby":x,version:s.version,onVersionClick:g})}),O=(0,l.forwardRef)((e,t)=>(0,o.jsx)(I,{forwardRef:t,...e}));var q=i(34603),D={5881:(e,t,i)=>{function a(){for(var e,t,i=0,a="";ia,default:()=>o});let o=a},5025:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"LizdJ2L0HW7JWOvPrfly"}},435:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_controls_xxs:"tRaaBpDMg9Qu8v6gKjtn",root_entity_xxs:"M9zvtlcpLUVn6DKdcHhj",root_text_xxs:"ln0PYYwDmFnfYxCDJsFU",root_controls_xs:"n5AeWEsJC3_AYXcbK4Lt",root_entity_xs:"__hrMKGmNbw54T54IUyh",root_text_xs:"SehSa7OyRpC2nzYTVb2Q",root_controls_s:"_oBLf5gprWsKjCw4Ce58",root_entity_s:"mxSPe5xpZnie9gpIqacd",root_text_s:"Ai2iRN9elHpk_u5splD6",root_controls_m:"tk7ahHRDYXJMMB879KUA",root_entity_m:"Z_WIr2W8JU4MPQek3hgR",root_text_m:"g3qWNP6xl__7qxNmtrvd",root_controls_l:"grvxapJE3vGArOKDWf6n",root_entity_l:"Esj5A1UeSi4xV4tZ839D",root_text_l:"V3WU123oO65AxsprotU9",root_weight_normal:"ZYV27jeWd30QDXu4GhaH",root_weight_medium:"_3_Mxw7Si7j2g4kWjlpR",root_weight_bold:"Vi7Rd0SZWqD17F0872TB"}},5668:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root_size_xs:"qJJ288377iHlWN_RXeEE",root_size_s:"_sd8Q9d_Ttn0Ufe4ISWS",root_size_m:"Ctk8dbecq31Qh7isOJPQ",root_size_l:"M_Djh6ppIkCO3A2k_BTA",root_size_xl:"dtxlzGQMPAbM2MEndXWX",root_size_xxl:"IUb9XLplTAoZqne9rNUL",root_size_xxxl:"ZYZamUwql_rfFR4RpI2B",root_size_xxxxl:"ZBZyxow5njdq8z5dnRPY",root_weight_bold:"nSU6fV9y80WrZEfafvww",root_weight_black:"KBeGPPK4DinQzAP41Y_N"}},3594:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});let a={root:"_MWOVuZRvUQdXKTMcOPx",root_clamp:"LezmJlldtbHWqU7l1950",root_clamp_oneline:"oyQL2RSmoNbNQf3Vc6YI",root_clamp_multiline:"jMyoZB5J9iZbzJmWOrF0"}},6161:(e,t,i)=>{/** - * @license React - * react-jsx-runtime.production.min.js - * From 0b74f0e71d1b289518d75e5dd6e3d821987cdb8d Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 12 Jul 2024 00:36:36 +0000 Subject: [PATCH 64/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index ecab234..409a204 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "65991fc9bd01d81a802f869bfd01212ddde38bcf817c298d6e7242c1c415e804" }, "electron": { - "version": "29.4.3", - "x64": "https://github.com/electron/electron/releases/download/v29.4.3/electron-v29.4.3-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.4.3/electron-v29.4.3-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.4.3/electron-v29.4.3-linux-arm64.zip" + "version": "29.4.4", + "x64": "https://github.com/electron/electron/releases/download/v29.4.4/electron-v29.4.4-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.4.4/electron-v29.4.4-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.4.4/electron-v29.4.4-linux-arm64.zip" } } \ No newline at end of file From 744e83a774a6d89f1e3c19bfce0524da45b81441 Mon Sep 17 00:00:00 2001 From: Andrey Onischenko <100789522+cucumber-sp@users.noreply.github.com> Date: Mon, 15 Jul 2024 09:08:36 +0300 Subject: [PATCH 65/88] Fix workflow consuming too much space --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81adb0b..de4fd63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: image: archlinux:latest steps: - name: Install packages - run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git sudo base-devel p7zip nodejs jq asar electron29 libpulse dpkg unzip xdg-utils python rpm-tools glibc + run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git sudo base-devel p7zip nodejs jq asar dpkg unzip python rpm-tools glibc - name: Checkout uses: actions/checkout@v4 with: @@ -32,7 +32,7 @@ jobs: run: mkdir /home/build && chgrp nobody /home/build && chmod g+ws /home/build && setfacl -m u::rwx,g::rwx /home/build && setfacl -d --set u::rwx,g::rwx,o::- /home/build && chown nobody . - name: Make Arch package - run: sudo -u nobody makepkg --log && mv *.pkg.tar.zst dist/ + run: mkdir -p arch && cp PKGBUILD arch && cd arch && sudo -u nobody makepkg -d --log && mv *.pkg.tar.zst ../dist/ && cd .. && rm -rf arch - name: Build tarball packages run: bash ./build_tarball.sh -a all && cp tar/* dist/ From a4ea3e11649c3c7a423dd20054b69ffa1ed22a00 Mon Sep 17 00:00:00 2001 From: Andrey Onischenko <100789522+cucumber-sp@users.noreply.github.com> Date: Mon, 15 Jul 2024 09:13:41 +0300 Subject: [PATCH 66/88] Fix build permissions in workflow --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de4fd63..470b4f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,10 +29,10 @@ jobs: run: mkdir -p dist - name: Fix permissions for build - run: mkdir /home/build && chgrp nobody /home/build && chmod g+ws /home/build && setfacl -m u::rwx,g::rwx /home/build && setfacl -d --set u::rwx,g::rwx,o::- /home/build && chown nobody . + run: mkdir /home/build && chgrp nobody /home/build && chmod g+ws /home/build && setfacl -m u::rwx,g::rwx /home/build && setfacl -d --set u::rwx,g::rwx,o::- /home/build && chown nobody . && mkdir -p arch && chown nobody arch - name: Make Arch package - run: mkdir -p arch && cp PKGBUILD arch && cd arch && sudo -u nobody makepkg -d --log && mv *.pkg.tar.zst ../dist/ && cd .. && rm -rf arch + run: cp PKGBUILD arch && cd arch && sudo -u nobody makepkg -d --log && mv *.pkg.tar.zst ../dist/ && cd .. && rm -rf arch - name: Build tarball packages run: bash ./build_tarball.sh -a all && cp tar/* dist/ From cb2e73dd25014403974ce4dc8683e02b4a94242e Mon Sep 17 00:00:00 2001 From: Andrey Onischenko <100789522+cucumber-sp@users.noreply.github.com> Date: Mon, 15 Jul 2024 09:19:36 +0300 Subject: [PATCH 67/88] Fix build dependencies in workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 470b4f7..28c2028 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: image: archlinux:latest steps: - name: Install packages - run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git sudo base-devel p7zip nodejs jq asar dpkg unzip python rpm-tools glibc + run: pacman -Syy -q --noconfirm && pacman -S -q --noconfirm git sudo base-devel p7zip nodejs jq asar dpkg unzip python rpm-tools glibc icu - name: Checkout uses: actions/checkout@v4 with: From ad45b1935dbb0f23304b75c89b50a9b5260b4ad4 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 18 Jul 2024 00:36:26 +0000 Subject: [PATCH 68/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 16 ++++++++-------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index a314225..82d6b99 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.6.0 +pkgver=5.7.14 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.6.0.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("65991fc9bd01d81a802f869bfd01212ddde38bcf817c298d6e7242c1c415e804" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.7.14.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("2df722b286643a604d9e6df451005e121a30b8e35ae9d08aa5db6ca589ce676f" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.6.0.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.7.14.exe" } package() { diff --git a/flake.lock b/flake.lock index d99ea8c..42fc9df 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-fY6WFe1fdaS95gismmP6dmfHUIQOqadxTrDgjKSC9GY=", + "narHash": "sha256-9tCDJ0wbvkAkwcoDy0wzyaN+tugoJWlnEimlr0Pmfqk=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.6.0.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.7.14.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.6.0.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.7.14.exe" } } }, diff --git a/flake.nix b/flake.nix index 6bcf2f6..69af9a3 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.6.0.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.7.14.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 409a204..95becb8 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,14 +1,14 @@ { "ym": { - "version": "5.6.0", - "exe_name": "Yandex_Music_x64_5.6.0.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.6.0.exe", - "exe_sha256": "65991fc9bd01d81a802f869bfd01212ddde38bcf817c298d6e7242c1c415e804" + "version": "5.7.14", + "exe_name": "Yandex_Music_x64_5.7.14.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.7.14.exe", + "exe_sha256": "2df722b286643a604d9e6df451005e121a30b8e35ae9d08aa5db6ca589ce676f" }, "electron": { - "version": "29.4.4", - "x64": "https://github.com/electron/electron/releases/download/v29.4.4/electron-v29.4.4-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.4.4/electron-v29.4.4-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.4.4/electron-v29.4.4-linux-arm64.zip" + "version": "29.4.5", + "x64": "https://github.com/electron/electron/releases/download/v29.4.5/electron-v29.4.5-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.4.5/electron-v29.4.5-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.4.5/electron-v29.4.5-linux-arm64.zip" } } \ No newline at end of file From 7c46e1f25eeb23ab48146dccfcd718a01a2cd3e9 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Fri, 19 Jul 2024 19:14:18 +0300 Subject: [PATCH 69/88] Workflow fix --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28c2028..0a991d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: run: mkdir /home/build && chgrp nobody /home/build && chmod g+ws /home/build && setfacl -m u::rwx,g::rwx /home/build && setfacl -d --set u::rwx,g::rwx,o::- /home/build && chown nobody . && mkdir -p arch && chown nobody arch - name: Make Arch package - run: cp PKGBUILD arch && cd arch && sudo -u nobody makepkg -d --log && mv *.pkg.tar.zst ../dist/ && cd .. && rm -rf arch + run: cp PKGBUILD arch && cd arch && sudo -u nobody makepkg -d --log && mv *.pkg.tar.zst ../dist/ && mv ./src/app/yandex-music.asar ../dist/ && mv ./src/app/release_notes.json ../dist/ && cd .. && rm -rf arch - name: Build tarball packages run: bash ./build_tarball.sh -a all && cp tar/* dist/ @@ -43,9 +43,6 @@ jobs: - name: Build RPM packages run: bash ./build_rpm.sh && mv rpm/*.rpm dist - - name: Retrieve Asar and release notes - run: mv ./src/app/yandex-music.asar dist/yandex-music.asar && mv ./src/app/release_notes.json dist/release_notes.json - - name: Upload Arch artifacts uses: actions/upload-artifact@v4 with: From ae11fc4bcb2c5e33f231cec95ea69cf8af30df68 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 31 Jul 2024 00:30:48 +0000 Subject: [PATCH 70/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 82d6b99..4816f73 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.7.14 +pkgver=5.8.2 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.7.14.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("2df722b286643a604d9e6df451005e121a30b8e35ae9d08aa5db6ca589ce676f" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.2.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("affb07a8ffc789f6362efcee4a40f583128ee556ef928cfd7e939f35ccc7f8ed" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.7.14.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.8.2.exe" } package() { diff --git a/flake.lock b/flake.lock index 42fc9df..0d1d650 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-9tCDJ0wbvkAkwcoDy0wzyaN+tugoJWlnEimlr0Pmfqk=", + "narHash": "sha256-VompnmRIiPlllaitUCB5TGP5tDujjixjIzGoBiBBer8=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.7.14.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.2.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.7.14.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.2.exe" } } }, diff --git a/flake.nix b/flake.nix index 69af9a3..01a951c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.7.14.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.2.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 95becb8..cbd1856 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.7.14", - "exe_name": "Yandex_Music_x64_5.7.14.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.7.14.exe", - "exe_sha256": "2df722b286643a604d9e6df451005e121a30b8e35ae9d08aa5db6ca589ce676f" + "version": "5.8.2", + "exe_name": "Yandex_Music_x64_5.8.2.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.2.exe", + "exe_sha256": "affb07a8ffc789f6362efcee4a40f583128ee556ef928cfd7e939f35ccc7f8ed" }, "electron": { "version": "29.4.5", From 38300dcb1f0457080500e594adaf88fdd8a808dc Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 2 Aug 2024 00:37:14 +0000 Subject: [PATCH 71/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 4816f73..a48e311 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.8.2 +pkgver=5.8.3 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.2.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("affb07a8ffc789f6362efcee4a40f583128ee556ef928cfd7e939f35ccc7f8ed" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.3.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("6c49f4847e68563b68e7871cc1ef0373b38fdc75d7a75056b9d4f9ff8630d397" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.8.2.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.8.3.exe" } package() { diff --git a/flake.lock b/flake.lock index 0d1d650..749ae88 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-VompnmRIiPlllaitUCB5TGP5tDujjixjIzGoBiBBer8=", + "narHash": "sha256-x8j2rQilAD1e2oDIhsfhIDWIbtxC2oIv/AhfuwRmnak=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.3.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.3.exe" } } }, diff --git a/flake.nix b/flake.nix index 01a951c..8e7ec73 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.2.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.3.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index cbd1856..8acd1ce 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.8.2", - "exe_name": "Yandex_Music_x64_5.8.2.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.2.exe", - "exe_sha256": "affb07a8ffc789f6362efcee4a40f583128ee556ef928cfd7e939f35ccc7f8ed" + "version": "5.8.3", + "exe_name": "Yandex_Music_x64_5.8.3.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.3.exe", + "exe_sha256": "6c49f4847e68563b68e7871cc1ef0373b38fdc75d7a75056b9d4f9ff8630d397" }, "electron": { "version": "29.4.5", From 3faca83173eae4b6767b4146003891767294c28f Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Sun, 4 Aug 2024 23:52:48 +0300 Subject: [PATCH 72/88] Refresh patches --- patches/0001-Add-package-licence.patch | 3 +-- patches/0002-Add-package-icon.patch | 15 --------------- ...icon.patch => 0002-Create-app-tray-icon.patch} | 9 ++++----- ...-resize.patch => 0003-Fix-window-resize.patch} | 0 4 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 patches/0002-Add-package-icon.patch rename patches/{0003-Create-app-tray-icon.patch => 0002-Create-app-tray-icon.patch} (92%) rename patches/{0004-Fix-window-resize.patch => 0003-Fix-window-resize.patch} (100%) diff --git a/patches/0001-Add-package-licence.patch b/patches/0001-Add-package-licence.patch index dd8ff15..88fc6b9 100644 --- a/patches/0001-Add-package-licence.patch +++ b/patches/0001-Add-package-licence.patch @@ -1,7 +1,7 @@ diff --git a/package.json b/package.json --- a/package.json +++ b/package.json -@@ -51,5 +51,6 @@ +@@ -50,5 +50,6 @@ "kk", "az" ] @@ -9,4 +9,3 @@ diff --git a/package.json b/package.json + }, + "license": "UNLICENSED" } - \ No newline at end of file diff --git a/patches/0002-Add-package-icon.patch b/patches/0002-Add-package-icon.patch deleted file mode 100644 index 93cb5f0..0000000 --- a/patches/0002-Add-package-icon.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/package.json b/package.json ---- a/package.json -+++ b/package.json -@@ -52,5 +52,9 @@ - "az" - ] - }, -- "license": "UNLICENSED" -+ "license": "UNLICENSED", -+ "icon": { -+ "48x48": "build/next-desktop/favicon.png", -+ "scalable": "build/next-desktop/favicon.svg" -+ } - } - \ No newline at end of file diff --git a/patches/0003-Create-app-tray-icon.patch b/patches/0002-Create-app-tray-icon.patch similarity index 92% rename from patches/0003-Create-app-tray-icon.patch rename to patches/0002-Create-app-tray-icon.patch index 4cf3adb..dddb3e6 100644 --- a/patches/0003-Create-app-tray-icon.patch +++ b/patches/0002-Create-app-tray-icon.patch @@ -43,7 +43,7 @@ diff --git a/main/index.js b/main/index.js diff --git a/main/lib/handlers/handleWindowLifecycleEvents.js b/main/lib/handlers/handleWindowLifecycleEvents.js --- a/main/lib/handlers/handleWindowLifecycleEvents.js +++ b/main/lib/handlers/handleWindowLifecycleEvents.js -@@ -28,9 +28,8 @@ const handleWindowLifecycleEvents = (window) => { +@@ -31,9 +31,8 @@ const handleWindowLifecycleEvents = (window) => { state_js_1.state.willQuit = true; }); electron_1.app.on('window-all-closed', () => { @@ -55,7 +55,7 @@ diff --git a/main/lib/handlers/handleWindowLifecycleEvents.js b/main/lib/handler }); electron_1.app.on('browser-window-blur', () => { setBlurredTime(); -@@ -51,22 +50,11 @@ const handleWindowLifecycleEvents = (window) => { +@@ -54,22 +53,11 @@ const handleWindowLifecycleEvents = (window) => { checkAndUpdateApplicationData(window); }); window.on('close', (event) => { @@ -80,6 +80,5 @@ diff --git a/main/lib/handlers/handleWindowLifecycleEvents.js b/main/lib/handler - } + (0, createWindow_js_1.toggleWindowVisibility)(window, false); }); - }; - exports.handleWindowLifecycleEvents = handleWindowLifecycleEvents; - \ No newline at end of file + const webContents = window.webContents; + webContents.on('did-fail-load', (event, errorCode, errorDescription, validatedUrl) => { diff --git a/patches/0004-Fix-window-resize.patch b/patches/0003-Fix-window-resize.patch similarity index 100% rename from patches/0004-Fix-window-resize.patch rename to patches/0003-Fix-window-resize.patch From bde0ca039a964bb7d81eb9409bf1ae02e733999e Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Mon, 5 Aug 2024 00:04:05 +0300 Subject: [PATCH 73/88] Dev tools support. Closes #86 --- README.md | 6 ++++++ patches/0004-Dev-Tools-from-config.patch | 14 ++++++++++++++ templates/default.conf | 3 ++- templates/yandex-music.sh | 1 + 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 patches/0004-Dev-Tools-from-config.patch diff --git a/README.md b/README.md index 7365d8d..8c18fd0 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,12 @@ Tray mode is disabled by default. It allows program to be minimized to tray inst *** +### Dev tools + +Chromium developer/debug tools can be enabled by setting `DEV_TOOLS` option to `1`. + +*** + ## Manual Build ### Prerequisites diff --git a/patches/0004-Dev-Tools-from-config.patch b/patches/0004-Dev-Tools-from-config.patch new file mode 100644 index 0000000..300d14e --- /dev/null +++ b/patches/0004-Dev-Tools-from-config.patch @@ -0,0 +1,14 @@ +diff --git a/main/config.js b/main/config.js +--- a/main/config.js ++++ b/main/config.js +@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.applyCommonConfig = exports.config = void 0; + const package_json_1 = __importDefault(require("../package.json")); ++const devTools = process.env.DEV_TOOLS && process.env.DEV_TOOLS > 0; + exports.config = { +- enableDevTools: false, ++ enableDevTools: devTools, + enableWebSecurity: true, + enableAutoUpdate: true, + bypassCSP: false, diff --git a/templates/default.conf b/templates/default.conf index 012180e..b875b3a 100644 --- a/templates/default.conf +++ b/templates/default.conf @@ -1,3 +1,4 @@ ELECTRON_CUSTOM_BIN= ELECTRON_ARGS="--no-sandbox" -TRAY_ENABLED=0 \ No newline at end of file +TRAY_ENABLED=0 +DEV_TOOLS=0 \ No newline at end of file diff --git a/templates/yandex-music.sh b/templates/yandex-music.sh index 321263c..83f2b14 100644 --- a/templates/yandex-music.sh +++ b/templates/yandex-music.sh @@ -23,5 +23,6 @@ fi ELECTRON_BIN=${ELECTRON_CUSTOM_BIN:-%electron_path%} export TRAY_ENABLED=${TRAY_ENABLED:-0} +export DEV_TOOLS=${DEV_TOOLS:-0} exec "${ELECTRON_BIN}" "%asar_path%" $ELECTRON_ARGS $WAYLAND_FLAGS From 6ab6b6eefff499ae4f6256b9a049efc2e1195ad3 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 7 Aug 2024 00:37:54 +0000 Subject: [PATCH 74/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index a48e311..137ae3d 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.8.3 +pkgver=5.9.4 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.3.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("6c49f4847e68563b68e7871cc1ef0373b38fdc75d7a75056b9d4f9ff8630d397" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.9.4.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("b886496c7faa18ceda522a6ca8c8c38f4a0c863fbb7fd186991995887205e531" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.8.3.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.9.4.exe" } package() { diff --git a/flake.lock b/flake.lock index 749ae88..5cc9f73 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-x8j2rQilAD1e2oDIhsfhIDWIbtxC2oIv/AhfuwRmnak=", + "narHash": "sha256-nMmUZov3j/vEs9+/5dbP1xSx80U9plrkqWkAtUTgeo8=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.3.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.9.4.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.3.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.9.4.exe" } } }, diff --git a/flake.nix b/flake.nix index 8e7ec73..636c8e1 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.3.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.9.4.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 8acd1ce..1ac57c9 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.8.3", - "exe_name": "Yandex_Music_x64_5.8.3.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.8.3.exe", - "exe_sha256": "6c49f4847e68563b68e7871cc1ef0373b38fdc75d7a75056b9d4f9ff8630d397" + "version": "5.9.4", + "exe_name": "Yandex_Music_x64_5.9.4.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.9.4.exe", + "exe_sha256": "b886496c7faa18ceda522a6ca8c8c38f4a0c863fbb7fd186991995887205e531" }, "electron": { "version": "29.4.5", From b7ad3a1c637a17c6cc31f5bf0a5f06e6671d9720 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 10 Aug 2024 00:37:37 +0000 Subject: [PATCH 75/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 137ae3d..704b9d8 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.9.4 +pkgver=5.10.2 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.9.4.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("b886496c7faa18ceda522a6ca8c8c38f4a0c863fbb7fd186991995887205e531" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.10.2.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("63751dc9541935a9d13485bed51f5df2a670f827a2df718cdc3fad4eaea75938" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.9.4.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.10.2.exe" } package() { diff --git a/flake.lock b/flake.lock index 5cc9f73..a3a0e04 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-nMmUZov3j/vEs9+/5dbP1xSx80U9plrkqWkAtUTgeo8=", + "narHash": "sha256-2k/5pJa5VVJ+s/XF+2RTCE3n6YwA1d37mHO93wAWcOw=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.9.4.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.10.2.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.9.4.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.10.2.exe" } } }, diff --git a/flake.nix b/flake.nix index 636c8e1..dbef348 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.9.4.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.10.2.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 1ac57c9..7cfe428 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.9.4", - "exe_name": "Yandex_Music_x64_5.9.4.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.9.4.exe", - "exe_sha256": "b886496c7faa18ceda522a6ca8c8c38f4a0c863fbb7fd186991995887205e531" + "version": "5.10.2", + "exe_name": "Yandex_Music_x64_5.10.2.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.10.2.exe", + "exe_sha256": "63751dc9541935a9d13485bed51f5df2a670f827a2df718cdc3fad4eaea75938" }, "electron": { "version": "29.4.5", From 583e7eafc91048b6975acb176abcd53c863ee79a Mon Sep 17 00:00:00 2001 From: BungaaFACE Date: Fri, 16 Aug 2024 01:44:33 +0300 Subject: [PATCH 76/88] fix: fixed OS spoof for getting secretKey function --- repack.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repack.sh b/repack.sh index f0d80d3..f529b6f 100755 --- a/repack.sh +++ b/repack.sh @@ -71,9 +71,10 @@ echo "Fixing SecretKey" echo "Spoofing OS" find "./" -type f \( -name "*.js" -o -name "*.js.map" \) -print0 | while IFS= read -r -d $'\0' file; do # Use 'sed' to perform the replacement in-place - sed -i "s/secretKey:this.secretKey/secretKey:'superSecretKey'/g" "$file" + sed -i "s/case a.t.MACOS:e=\"uz0zSpaYCLmgk6C7YLdo5F\"/case a.t.LINUX:e=\"kzqU4XhfCaY6B6JTHODeq5\"/g" "$file" sed -i "s/B.LINUX/B.WINDOWS/g" "$file" done +echo "OS spoofed" # fixing titile echo "Fixing Title" From 0a5a03ce69886ec6c5f85c3dde807e7806525945 Mon Sep 17 00:00:00 2001 From: Vladislav Kachura Date: Sat, 17 Aug 2024 00:24:23 +0300 Subject: [PATCH 77/88] Update repack.sh --- repack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repack.sh b/repack.sh index f529b6f..7f0118a 100755 --- a/repack.sh +++ b/repack.sh @@ -71,7 +71,7 @@ echo "Fixing SecretKey" echo "Spoofing OS" find "./" -type f \( -name "*.js" -o -name "*.js.map" \) -print0 | while IFS= read -r -d $'\0' file; do # Use 'sed' to perform the replacement in-place - sed -i "s/case a.t.MACOS:e=\"uz0zSpaYCLmgk6C7YLdo5F\"/case a.t.LINUX:e=\"kzqU4XhfCaY6B6JTHODeq5\"/g" "$file" + sed -i "s/a.t.WINDOWS/a.t.LINUX/g" "$file" sed -i "s/B.LINUX/B.WINDOWS/g" "$file" done echo "OS spoofed" From 96cf1789075c337b4d86099ce8e09f67a52cfbed Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Aug 2024 21:59:31 +0000 Subject: [PATCH 78/88] Update packages --- utility/version_info.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utility/version_info.json b/utility/version_info.json index 7cfe428..6103b98 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -6,9 +6,9 @@ "exe_sha256": "63751dc9541935a9d13485bed51f5df2a670f827a2df718cdc3fad4eaea75938" }, "electron": { - "version": "29.4.5", - "x64": "https://github.com/electron/electron/releases/download/v29.4.5/electron-v29.4.5-linux-x64.zip", - "armv7l": "https://github.com/electron/electron/releases/download/v29.4.5/electron-v29.4.5-linux-armv7l.zip", - "arm64": "https://github.com/electron/electron/releases/download/v29.4.5/electron-v29.4.5-linux-arm64.zip" + "version": "29.4.6", + "x64": "https://github.com/electron/electron/releases/download/v29.4.6/electron-v29.4.6-linux-x64.zip", + "armv7l": "https://github.com/electron/electron/releases/download/v29.4.6/electron-v29.4.6-linux-armv7l.zip", + "arm64": "https://github.com/electron/electron/releases/download/v29.4.6/electron-v29.4.6-linux-arm64.zip" } } \ No newline at end of file From 4ac238a00ca0b36e9755e55e54a22d3107ba443c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 22 Aug 2024 00:38:38 +0000 Subject: [PATCH 79/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 704b9d8..95bf4b5 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.10.2 +pkgver=5.13.2 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.10.2.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("63751dc9541935a9d13485bed51f5df2a670f827a2df718cdc3fad4eaea75938" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.13.2.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("ac7a489a59e074358559f544a26143ca81a6bdfa41481242f3419b76eaffdb0b" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.10.2.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.13.2.exe" } package() { diff --git a/flake.lock b/flake.lock index a3a0e04..1d82350 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-2k/5pJa5VVJ+s/XF+2RTCE3n6YwA1d37mHO93wAWcOw=", + "narHash": "sha256-8oPwDSsM8UtxltyVtUASneqWaeIn4NFhIpnsA7dSIk0=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.10.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.13.2.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.10.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.13.2.exe" } } }, diff --git a/flake.nix b/flake.nix index dbef348..dc85ae1 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.10.2.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.13.2.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 6103b98..c14e0dc 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.10.2", - "exe_name": "Yandex_Music_x64_5.10.2.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.10.2.exe", - "exe_sha256": "63751dc9541935a9d13485bed51f5df2a670f827a2df718cdc3fad4eaea75938" + "version": "5.13.2", + "exe_name": "Yandex_Music_x64_5.13.2.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.13.2.exe", + "exe_sha256": "ac7a489a59e074358559f544a26143ca81a6bdfa41481242f3419b76eaffdb0b" }, "electron": { "version": "29.4.6", From dbcf4e76f4a4b0e99dae1bf6b4121cc2ae84e766 Mon Sep 17 00:00:00 2001 From: Ben Puls Date: Thu, 29 Aug 2024 18:52:02 +0500 Subject: [PATCH 80/88] Refactor code to improve readability --- utility/extract_release_notes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utility/extract_release_notes.py b/utility/extract_release_notes.py index cfb970d..cbe17c6 100644 --- a/utility/extract_release_notes.py +++ b/utility/extract_release_notes.py @@ -7,7 +7,8 @@ if len(sys.argv) < 3: file_name = sys.argv[1] save_file_name = sys.argv[2] - + + def build_html(data, first_launch=False): html = "" for i, element in enumerate(data): @@ -23,6 +24,7 @@ def build_html(data, first_launch=False): html += f"<{element['value']}>{build_html(element['children'])}" return html + with open(file_name, "r", encoding='utf-8') as file: translation = json.load(file) @@ -34,4 +36,4 @@ for element_key in translation.keys(): notes[element_key] = build_html(translation[element_key], True) with open(save_file_name, "w", encoding='utf-8') as file: - file.write(json.dumps(notes, ensure_ascii=False, indent=4)) \ No newline at end of file + file.write(json.dumps(notes, ensure_ascii=False, indent=4)) From 6ab3b696ed9c1037fdffd97329b6991dc6e695a2 Mon Sep 17 00:00:00 2001 From: Ben Puls Date: Thu, 29 Aug 2024 18:53:47 +0500 Subject: [PATCH 81/88] Refactor sorting imports --- utility/extract_release_notes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utility/extract_release_notes.py b/utility/extract_release_notes.py index cbe17c6..b3c8e24 100644 --- a/utility/extract_release_notes.py +++ b/utility/extract_release_notes.py @@ -1,5 +1,5 @@ -import sys import json +import sys if len(sys.argv) < 3: print("Usage: python extract_release_notes.py ") From f6f00319ed395cb0b0a6179d8e9ddbd1151f5eff Mon Sep 17 00:00:00 2001 From: Ben Puls Date: Thu, 29 Aug 2024 18:55:40 +0500 Subject: [PATCH 82/88] Refactor code to improve readability --- utility/generate_packages.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/utility/generate_packages.py b/utility/generate_packages.py index 07bcd50..429cc77 100644 --- a/utility/generate_packages.py +++ b/utility/generate_packages.py @@ -3,12 +3,14 @@ import os import shutil import subprocess + def check_dependency(dependency): if shutil.which(dependency): return True print(f"{dependency} not installed.") return False + script_dir = os.path.dirname(os.path.realpath(__file__)) # loading versions information from json @@ -16,6 +18,7 @@ version_info_path = os.path.join(script_dir, "version_info.json") with open(version_info_path, "r") as f: version_info = json.load(f) + # Arch def generate_arch(): pkgbuild_template = os.path.join(script_dir, "../templates/PKGBUILD") @@ -35,7 +38,7 @@ def generate_arch(): # Nix - + def is_nix_version_2_19(): version = subprocess.run(["nix", "--version"], capture_output=True, text=True).stdout.split()[2] print(f"Nix version: {version}") @@ -44,6 +47,7 @@ def is_nix_version_2_19(): return True return False + def generate_nix(): nixcmd = "nix --extra-experimental-features nix-command --extra-experimental-features flakes" flake_path = os.path.join(script_dir, "../flake.nix") @@ -53,14 +57,14 @@ def generate_nix(): flake = f.read() _start_index = flake.find("ymExe.url = ") _end_index = flake.find(";", _start_index) - flake = flake.replace(flake[_start_index:_end_index+1], f'ymExe.url = "{version_info["ym"]["exe_link"]}";') + flake = flake.replace(flake[_start_index:_end_index + 1], f'ymExe.url = "{version_info["ym"]["exe_link"]}";') with open(flake_path, "w") as f: f.write(flake) if not check_dependency("nix"): print("flake.nix was updated, but nix is not installed to update flake.lock") return - + if is_nix_version_2_19(): subprocess.run(f"{nixcmd} flake update ymExe", shell=True) else: @@ -71,4 +75,4 @@ def generate_nix(): generate_arch() -generate_nix() \ No newline at end of file +generate_nix() From b8643efe295a520e84bad016f7f2ebde7e9621a3 Mon Sep 17 00:00:00 2001 From: Ben Puls Date: Thu, 29 Aug 2024 18:56:28 +0500 Subject: [PATCH 83/88] Refactor code and sorting imports --- utility/update_version.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utility/update_version.py b/utility/update_version.py index 4148cbb..e3fb4bb 100644 --- a/utility/update_version.py +++ b/utility/update_version.py @@ -4,6 +4,7 @@ import json import os import shutil import tempfile + import requests YM_VERSIONS_URL = "https://music-desktop-application.s3.yandex.net/stable/download.json" @@ -13,17 +14,21 @@ ELECTRON_DOWNLOAD_URL = "https://github.com/electron/electron/releases/download/ script_dir = os.path.dirname(os.path.realpath(__file__)) tempdir = tempfile.mkdtemp() + def clear(): shutil.rmtree(tempdir) + atexit.register(clear) + def assert_dependency(dependency): if shutil.which(dependency): return print(f"{dependency} not installed.") exit(1) + # loading versions json versions_obj = requests.get(YM_VERSIONS_URL).json() exe_link = versions_obj["windows"] @@ -74,4 +79,4 @@ version_file = os.path.join(script_dir, "version_info.json") with open(version_file, "w") as f: f.write(json.dumps(version_info, indent=4)) -print(f"Version info written to {version_file}") \ No newline at end of file +print(f"Version info written to {version_file}") From 1ef08132c6f12ffa16773b4d7e44fdaafbb91053 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 30 Aug 2024 00:39:34 +0000 Subject: [PATCH 84/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 95bf4b5..5db8939 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.13.2 +pkgver=5.14.0 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.13.2.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("ac7a489a59e074358559f544a26143ca81a6bdfa41481242f3419b76eaffdb0b" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.14.0.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("b7a0a974666e68b5ed324a72ca9f53dcbdb35271e2b48fe5adc6bc6c8876e03d" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.13.2.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.14.0.exe" } package() { diff --git a/flake.lock b/flake.lock index 1d82350..2d9c987 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-8oPwDSsM8UtxltyVtUASneqWaeIn4NFhIpnsA7dSIk0=", + "narHash": "sha256-GBSL5XmBPkAYGqRmO3CH6HOvt8Ltq0mU/MWoPbUneSk=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.13.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.14.0.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.13.2.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.14.0.exe" } } }, diff --git a/flake.nix b/flake.nix index dc85ae1..a8d199d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.13.2.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.14.0.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index c14e0dc..8b6669f 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.13.2", - "exe_name": "Yandex_Music_x64_5.13.2.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.13.2.exe", - "exe_sha256": "ac7a489a59e074358559f544a26143ca81a6bdfa41481242f3419b76eaffdb0b" + "version": "5.14.0", + "exe_name": "Yandex_Music_x64_5.14.0.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.14.0.exe", + "exe_sha256": "b7a0a974666e68b5ed324a72ca9f53dcbdb35271e2b48fe5adc6bc6c8876e03d" }, "electron": { "version": "29.4.6", From da34799eddff8ed4f508635e56c790d88f9af112 Mon Sep 17 00:00:00 2001 From: Yury Shvedov Date: Tue, 3 Sep 2024 09:47:50 +0300 Subject: [PATCH 85/88] Readme: yandex-music now is in nixpkgs Change-Id: I350caf64c0a151b394b7345d30260cba69d8a224 --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8c18fd0..89e10e1 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,16 @@ Native YandexMusic client for Linux. Built using repacking of Windows client (El - [ASAR archive](#asar-archive) - [Arch Linux](#arch-linux-1) - [Debian/Ubuntu](#debianubuntu-1) - - [RPM-based](#rpm-based-1) + - [RPM-based](#rpm-based-1) - [Run with nix](#run-with-nix) - - [Run with flakes](#run-with-flakes) - - [Run old style](#run-old-style) - - [Install to NixOS](#install-to-nixos) + - [NixOS unstable](#nixos-unstable) + - [Run from unstable channel with flakes](#run-from-unstable-channel-with-flakes) + - [Install from unstable channel](#install-from-unstable-channel) + - [Overriding](#overriding) + - [Built-in module](#built-in-module) + - [Run with flakes](#run-with-flakes) + - [Run old style](#run-old-style) + - [Install to NixOS](#install-to-nixos) ## Screenshots ![image](https://github.com/cucumber-sp/yandex-music-linux/assets/100789522/ab2f69ee-efc4-4a33-8110-131b4c4ff4de) @@ -223,7 +228,42 @@ bash build_rpm.sh [-a default=x64] The `yandex-music` package has unlicensed license, so you need to have `allowUnfree` option enabled. -### Run with flakes +### NixOS unstable + +The `yandex-music` package is +[available](https://github.com/NixOS/nixpkgs/pull/337425) at nixos-unstable +channel. + +#### Run from unstable channel with flakes + +```bash +nix run github:NixOS/nixpkgs/nixos-unstable#yandex-music +``` + +#### Install from unstable channel + +Add next to your configuration: + +```nix +environment.systemPackages = with pkgs; [ yandex-music ]; +``` + +#### Overriding + +There is several option of package available to override: + +```nix +yandex-music.override { + trayEnabled = true; # Whenether to enable tray support + electronArguments = ""; # Extra arguments to electron executable +} +``` + +### Built-in module + +This repository contains its own nix-related receipts. + +#### Run with flakes Execute next to build and run yandex music directly from github @@ -231,7 +271,7 @@ Execute next to build and run yandex music directly from github nix run github:cucumber-sp/yandex-music-linux ``` -### Run old style +#### Run old style Execute next in this repository to build yandex-music package without using flakes. @@ -240,7 +280,7 @@ flakes. nix-build --expr '(import {}).callPackage ./nix {}' ``` -### Install to NixOS +#### Install to NixOS 1. Add input in your flake.nix From 98fed92683e2e5a49999d04b5559edd02eddf627 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 5 Sep 2024 00:39:38 +0000 Subject: [PATCH 86/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 5db8939..e392b52 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.14.0 +pkgver=5.15.0 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.14.0.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("b7a0a974666e68b5ed324a72ca9f53dcbdb35271e2b48fe5adc6bc6c8876e03d" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.15.0.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("14396a25b35199f28175d3c15924ec75560cbae6f5fb6767ec7f326637723e36" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.14.0.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.15.0.exe" } package() { diff --git a/flake.lock b/flake.lock index 2d9c987..3a52f60 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-GBSL5XmBPkAYGqRmO3CH6HOvt8Ltq0mU/MWoPbUneSk=", + "narHash": "sha256-JcdIfz+evOf0D5YlQsmOEzGVkCgcGHoEpbGzTIwkmgw=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.14.0.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.15.0.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.14.0.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.15.0.exe" } } }, diff --git a/flake.nix b/flake.nix index a8d199d..bba4d04 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.14.0.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.15.0.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index 8b6669f..b66c7ce 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.14.0", - "exe_name": "Yandex_Music_x64_5.14.0.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.14.0.exe", - "exe_sha256": "b7a0a974666e68b5ed324a72ca9f53dcbdb35271e2b48fe5adc6bc6c8876e03d" + "version": "5.15.0", + "exe_name": "Yandex_Music_x64_5.15.0.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.15.0.exe", + "exe_sha256": "14396a25b35199f28175d3c15924ec75560cbae6f5fb6767ec7f326637723e36" }, "electron": { "version": "29.4.6", From d446a98850abccfe28a78363c96468a2a8109cfc Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 18 Sep 2024 00:40:25 +0000 Subject: [PATCH 87/88] Update packages --- PKGBUILD | 8 ++++---- flake.lock | 6 +++--- flake.nix | 2 +- utility/version_info.json | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index e392b52..95826f7 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com pkgname=yandex-music -pkgver=5.15.0 +pkgver=5.18.2 pkgrel=1 pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" arch=("any") @@ -10,11 +10,11 @@ license=("Unlicense") depends=("electron29" "libpulse" "xdg-utils" "bash" "hicolor-icon-theme") makedepends=("p7zip" "nodejs" "asar" "jq" "python" "git") -source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.15.0.exe" "git+${url}#tag=v${pkgver}") -sha256sums=("14396a25b35199f28175d3c15924ec75560cbae6f5fb6767ec7f326637723e36" "SKIP") +source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.18.2.exe" "git+${url}#tag=v${pkgver}") +sha256sums=("a513eb6aa4bd05bae8503f5578a8e91d778794ffe4eb3a450040903570106941" "SKIP") build() { - bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.15.0.exe" + bash "$srcdir/yandex-music-linux/repack.sh" "$srcdir/Yandex_Music_x64_5.18.2.exe" } package() { diff --git a/flake.lock b/flake.lock index 3a52f60..dc9b5c2 100644 --- a/flake.lock +++ b/flake.lock @@ -56,13 +56,13 @@ "ymExe": { "flake": false, "locked": { - "narHash": "sha256-JcdIfz+evOf0D5YlQsmOEzGVkCgcGHoEpbGzTIwkmgw=", + "narHash": "sha256-DtSXyYlViRVFWka3SLVaJjB/r6lgaQEPbCM7uXvmtHI=", "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.15.0.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.18.2.exe" }, "original": { "type": "file", - "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.15.0.exe" + "url": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.18.2.exe" } } }, diff --git a/flake.nix b/flake.nix index bba4d04..85ce0f2 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Native Yandex Music desktop client"; inputs = { - ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.15.0.exe"; + ymExe.url = "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.18.2.exe"; ymExe.flake = false; }; diff --git a/utility/version_info.json b/utility/version_info.json index b66c7ce..961a6d0 100644 --- a/utility/version_info.json +++ b/utility/version_info.json @@ -1,9 +1,9 @@ { "ym": { - "version": "5.15.0", - "exe_name": "Yandex_Music_x64_5.15.0.exe", - "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.15.0.exe", - "exe_sha256": "14396a25b35199f28175d3c15924ec75560cbae6f5fb6767ec7f326637723e36" + "version": "5.18.2", + "exe_name": "Yandex_Music_x64_5.18.2.exe", + "exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.18.2.exe", + "exe_sha256": "a513eb6aa4bd05bae8503f5578a8e91d778794ffe4eb3a450040903570106941" }, "electron": { "version": "29.4.6", From cd5f79e0e175961966062379cd80c869631dde99 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Tue, 24 Sep 2024 01:58:07 +0300 Subject: [PATCH 88/88] Update wayland flags --- templates/yandex-music.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/yandex-music.sh b/templates/yandex-music.sh index 83f2b14..6c67ded 100644 --- a/templates/yandex-music.sh +++ b/templates/yandex-music.sh @@ -17,7 +17,7 @@ source "$CONFIG_FILE" WAYLAND_FLAGS="" if [ "$XDG_SESSION_TYPE" == "wayland" ]; then - WAYLAND_FLAGS="--enable-features=UseOzonePlatform --ozone-platform=wayland" + WAYLAND_FLAGS="--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --ozone-platform=wayland" fi ELECTRON_BIN=${ELECTRON_CUSTOM_BIN:-%electron_path%}