From c6ee16baf6e3e646fd95540055dbb84e75cf7d3d Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:53:12 +0100 Subject: [PATCH 01/67] github actions test #1 --- .github/workflows/buildapp.yml | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/buildapp.yml diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml new file mode 100644 index 0000000..e2dc937 --- /dev/null +++ b/.github/workflows/buildapp.yml @@ -0,0 +1,44 @@ +name: Build and Release bsky-desktop + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build bsky-desktop + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout Main + uses: actions/checkout@v4.2.1 + with: + path: main + submodules: recursive + + - name: Install Dependencies + run: npm i + + - name: Compile (For linux) + id: build_package + run: npm run dev + + - name: Upload Artifact + if: ${{ inputs.upload_artifact }} + uses: actions/upload-artifact@v4.4.3 + with: + name: bsky-desktop + path: ${{ github.workspace }}/dist/${{ steps.build_package.outputs.package }} + if-no-files-found: error + + - name: Create Release + id: create_release + uses: qnblackcat/action-gh-release@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: Tag_Name + name: Name + files: dist/*.appimage -- 2.39.5 From 53ad4f8504a1083e9e9466b2dd751d0389c519fd Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:54:28 +0100 Subject: [PATCH 02/67] github actions test 2 --- .github/workflows/buildapp.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index e2dc937..8ebbe47 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -1,5 +1,11 @@ name: Build and Release bsky-desktop +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -- 2.39.5 From 6d309db133a7e9a7e469226a404bd1029761d9f2 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:55:37 +0100 Subject: [PATCH 03/67] github actions test 3 --- .github/workflows/buildapp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 8ebbe47..00bff88 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -5,6 +5,7 @@ on: branches: [ $default-branch ] pull_request: branches: [ $default-branch ] + workflow_dispatch concurrency: group: ${{ github.workflow }}-${{ github.ref }} -- 2.39.5 From 02043b6ca8b41367f30b3254f56be3fe066cbdc6 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:59:56 +0100 Subject: [PATCH 04/67] github actions test 4 --- .github/workflows/buildapp.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 00bff88..e93861b 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -5,7 +5,14 @@ on: branches: [ $default-branch ] pull_request: branches: [ $default-branch ] - workflow_dispatch + workflow_dispatch: + inputs: + ermwattesigma: + description: "Test" + default: "Testing" + required: false + type: string + concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -13,7 +20,7 @@ concurrency: jobs: build: - name: Build bsky-desktop + name: Build bsky-desktop (Linux) runs-on: ubuntu-latest permissions: contents: write @@ -30,7 +37,7 @@ jobs: - name: Compile (For linux) id: build_package - run: npm run dev + run: npm run build - name: Upload Artifact if: ${{ inputs.upload_artifact }} -- 2.39.5 From 50da0f9ab1dceecc2fa4525d5c2e5386e661508e Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:03:03 +0100 Subject: [PATCH 05/67] github actions test 5 (added a cd..) --- .github/workflows/buildapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index e93861b..0e86897 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -33,7 +33,7 @@ jobs: submodules: recursive - name: Install Dependencies - run: npm i + run: cd .. && npm i - name: Compile (For linux) id: build_package -- 2.39.5 From f523132ed19d3da7568684e4f65c2d14c792a0f7 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:06:20 +0100 Subject: [PATCH 06/67] github actions test 6 --- .github/workflows/buildapp.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 0e86897..fe99838 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -2,16 +2,9 @@ name: Build and Release bsky-desktop on: push: - branches: [ $default-branch ] - pull_request: - branches: [ $default-branch ] + tags-ignore: + - '*beta*' workflow_dispatch: - inputs: - ermwattesigma: - description: "Test" - default: "Testing" - required: false - type: string concurrency: @@ -28,12 +21,9 @@ jobs: steps: - name: Checkout Main uses: actions/checkout@v4.2.1 - with: - path: main - submodules: recursive - + - name: Install Dependencies - run: cd .. && npm i + run: npm install - name: Compile (For linux) id: build_package -- 2.39.5 From ec2fae027b8b1eae37da8dd9b9ed1bb80b067356 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:07:06 +0100 Subject: [PATCH 07/67] github actions test 7 --- .github/workflows/buildapp.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index fe99838..984c307 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -2,11 +2,11 @@ name: Build and Release bsky-desktop on: push: - tags-ignore: - - '*beta*' + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] workflow_dispatch: - concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -15,14 +15,21 @@ jobs: build: name: Build bsky-desktop (Linux) runs-on: ubuntu-latest - permissions: - contents: write steps: - - name: Checkout Main - uses: actions/checkout@v4.2.1 - - - name: Install Dependencies + - name: Checkout git repo + uses: actions/checkout@v2 + + - name: setup node and npm + uses: actions/setup-node@master + with: + node-version: 16 + + - name: Get npm version action + id: npmv + uses: pchynoweth/action-get-npm-version@1.0.1 + + - name: Install dependencies run: npm install - name: Compile (For linux) @@ -45,4 +52,4 @@ jobs: with: tag_name: Tag_Name name: Name - files: dist/*.appimage + files: dist/*.appimage \ No newline at end of file -- 2.39.5 From 5a96840741c31cb6f45d9020d8c1d218bbcd31b4 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:09:50 +0100 Subject: [PATCH 08/67] github actions test 8 --- .github/workflows/buildapp.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 984c307..9b03b64 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -50,6 +50,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: Tag_Name - name: Name - files: dist/*.appimage \ No newline at end of file + tag_name: stable + name: + files: dist/bskyDesktop-*-linux-x64 \ No newline at end of file -- 2.39.5 From 3acdd06f220a3443ff072a8c5656e4e931d615f4 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:10:22 +0100 Subject: [PATCH 09/67] imagine forgoring the name --- .github/workflows/buildapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 9b03b64..57390f9 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -51,5 +51,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: stable - name: + name: bsky-desktop build files: dist/bskyDesktop-*-linux-x64 \ No newline at end of file -- 2.39.5 From 75edb36e4c2bbfdeb5cfa72f99273cd59fa9d2d0 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:12:29 +0100 Subject: [PATCH 10/67] the pattern :sku: --- .github/workflows/buildapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 57390f9..cfea4dc 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -52,4 +52,4 @@ jobs: with: tag_name: stable name: bsky-desktop build - files: dist/bskyDesktop-*-linux-x64 \ No newline at end of file + files: dist/bskyDesktop-* \ No newline at end of file -- 2.39.5 From 14825deb6339026c1e99de25e92cf1875a12fde3 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:15:10 +0100 Subject: [PATCH 11/67] github token? --- .github/workflows/buildapp.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index cfea4dc..f74a2af 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -35,6 +35,8 @@ jobs: - name: Compile (For linux) id: build_package run: npm run build + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Artifact if: ${{ inputs.upload_artifact }} -- 2.39.5 From 604e319f57261dbd64ac0138c4b462887485f6f1 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:18:44 +0100 Subject: [PATCH 12/67] if this dosent work i am asking ai 120% --- .github/workflows/buildapp.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index f74a2af..a410a15 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -38,13 +38,13 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload Artifact - if: ${{ inputs.upload_artifact }} - uses: actions/upload-artifact@v4.4.3 - with: - name: bsky-desktop - path: ${{ github.workspace }}/dist/${{ steps.build_package.outputs.package }} - if-no-files-found: error + # - name: Upload Artifact + # if: ${{ inputs.upload_artifact }} + # uses: actions/upload-artifact@v4.4.3 + # with: + # name: bsky-desktop + # path: ${{ github.workspace }}/dist/${{ steps.build_package.outputs.package }} + # if-no-files-found: error - name: Create Release id: create_release -- 2.39.5 From 2dc91fe833f3d67ef883121718819805185c3fd5 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:27:34 +0100 Subject: [PATCH 13/67] should work now (gh actions) --- .github/workflows/buildapp.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index a410a15..81a5488 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -32,9 +32,15 @@ jobs: - name: Install dependencies run: npm install - - name: Compile (For linux) + - name: Build (x64) id: build_package - run: npm run build + run: npm run build -- --arch x64 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build (arm64) + id: build_package + run: npm run build -- --arch arm64 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -52,6 +58,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: stable - name: bsky-desktop build + tag_name: "v${{ steps.npmv.outputs.version }}" + name: "bsky-desktop v${{ steps.npmv.outputs.version }}" files: dist/bskyDesktop-* \ No newline at end of file -- 2.39.5 From bb8c53f976a2dc96e1a5e41befeed4cdf1eb9adf Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:29:06 +0100 Subject: [PATCH 14/67] should work now (gh actions) --- .github/workflows/buildapp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 81a5488..c84f000 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -33,13 +33,13 @@ jobs: run: npm install - name: Build (x64) - id: build_package + id: build_package_x64 run: npm run build -- --arch x64 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build (arm64) - id: build_package + id: build_package_arm64 run: npm run build -- --arch arm64 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- 2.39.5 From 9963fcc8b1820e3dada266f74d861b15e4610a8e Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:37:36 +0100 Subject: [PATCH 15/67] it shoudl work --- .github/workflows/buildapp.yml | 100 +++++++++++++++++++++++++++++---- 1 file changed, 89 insertions(+), 11 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index c84f000..b71d2ab 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -12,15 +12,17 @@ concurrency: cancel-in-progress: true jobs: - build: + build-linux: name: Build bsky-desktop (Linux) runs-on: ubuntu-latest + env: + ext: ".AppImage" steps: - name: Checkout git repo uses: actions/checkout@v2 - - name: setup node and npm + - name: Setup node and npm uses: actions/setup-node@master with: node-version: 16 @@ -44,15 +46,88 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Upload Artifact - # if: ${{ inputs.upload_artifact }} - # uses: actions/upload-artifact@v4.4.3 - # with: - # name: bsky-desktop - # path: ${{ github.workspace }}/dist/${{ steps.build_package.outputs.package }} - # if-no-files-found: error + build-windows: + name: Build bsky-desktop (Windows) + runs-on: windows-latest + env: + ext: ".exe" - - name: Create Release + steps: + - name: Checkout git repo + uses: actions/checkout@v2 + + - name: Setup node and npm + uses: actions/setup-node@master + with: + node-version: 16 + + - name: Get npm version action + id: npmv + uses: pchynoweth/action-get-npm-version@1.0.1 + + - name: Install dependencies + run: npm install + + - name: Build (x64) + id: build_package_x64 + run: npm run build -- --arch x64 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build (arm64) + id: build_package_arm64 + run: npm run build -- --arch arm64 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build-macos: + name: Build bsky-desktop (macOS) + runs-on: macos-latest + env: + ext: ".dmg" + + steps: + - name: Checkout git repo + uses: actions/checkout@v2 + + - name: Setup node and npm + uses: actions/setup-node@master + with: + node-version: 16 + + - name: Get npm version action + id: npmv + uses: pchynoweth/action-get-npm-version@1.0.1 + + - name: Install dependencies + run: npm install + + - name: Build (x64) + id: build_package_x64 + run: npm run build -- --arch x64 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build (arm64) + id: build_package_arm64 + run: npm run build -- --arch arm64 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + release: + name: Create Release + runs-on: ubuntu-latest + needs: [build-linux, build-windows, build-macos] + + steps: + - name: Checkout git repo + uses: actions/checkout@v2 + + - name: Get npm version action + id: npmv + uses: pchynoweth/action-get-npm-version@1.0.1 + + - name: Upload Release id: create_release uses: qnblackcat/action-gh-release@master env: @@ -60,4 +135,7 @@ jobs: with: tag_name: "v${{ steps.npmv.outputs.version }}" name: "bsky-desktop v${{ steps.npmv.outputs.version }}" - files: dist/bskyDesktop-* \ No newline at end of file + files: | + dist/linux/*.AppImage + dist/windows/*.exe + dist/macos/*.dmg \ No newline at end of file -- 2.39.5 From 3c0230143f96fb5c4074a5558057155aeb42c164 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:45:33 +0100 Subject: [PATCH 16/67] work PLEASE --- .github/workflows/buildapp.yml | 58 ++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index b71d2ab..76fcb47 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v2 - name: Setup node and npm - uses: actions/setup-node@master + uses: actions/setup-node@v3 with: node-version: 16 @@ -35,16 +35,15 @@ jobs: run: npm install - name: Build (x64) - id: build_package_x64 run: npm run build -- --arch x64 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Build (arm64) - id: build_package_arm64 - run: npm run build -- --arch arm64 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Linux Artifacts + uses: actions/upload-artifact@v3 + with: + name: linux-artifacts + path: dist/*.AppImage build-windows: name: Build bsky-desktop (Windows) @@ -57,7 +56,7 @@ jobs: uses: actions/checkout@v2 - name: Setup node and npm - uses: actions/setup-node@master + uses: actions/setup-node@v3 with: node-version: 16 @@ -69,16 +68,15 @@ jobs: run: npm install - name: Build (x64) - id: build_package_x64 run: npm run build -- --arch x64 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Build (arm64) - id: build_package_arm64 - run: npm run build -- --arch arm64 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Windows Artifacts + uses: actions/upload-artifact@v3 + with: + name: windows-artifacts + path: dist/*.exe build-macos: name: Build bsky-desktop (macOS) @@ -91,7 +89,7 @@ jobs: uses: actions/checkout@v2 - name: Setup node and npm - uses: actions/setup-node@master + uses: actions/setup-node@v3 with: node-version: 16 @@ -103,16 +101,15 @@ jobs: run: npm install - name: Build (x64) - id: build_package_x64 run: npm run build -- --arch x64 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Build (arm64) - id: build_package_arm64 - run: npm run build -- --arch arm64 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload macOS Artifacts + uses: actions/upload-artifact@v3 + with: + name: macos-artifacts + path: dist/*.dmg release: name: Create Release @@ -120,8 +117,23 @@ jobs: needs: [build-linux, build-windows, build-macos] steps: - - name: Checkout git repo - uses: actions/checkout@v2 + - name: Download Linux Artifacts + uses: actions/download-artifact@v3 + with: + name: linux-artifacts + path: dist/linux + + - name: Download Windows Artifacts + uses: actions/download-artifact@v3 + with: + name: windows-artifacts + path: dist/windows + + - name: Download macOS Artifacts + uses: actions/download-artifact@v3 + with: + name: macos-artifacts + path: dist/macos - name: Get npm version action id: npmv -- 2.39.5 From 16472ff26f85cd96ecfc5e056b828c57145ec4ff Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:50:50 +0100 Subject: [PATCH 17/67] AHHHHHHHHHHHHhhhhhhhhhhhhhhhhhHHHHHHHHHHHHHHHH --- .github/workflows/buildapp.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 76fcb47..fe4b484 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -135,9 +135,9 @@ jobs: name: macos-artifacts path: dist/macos - - name: Get npm version action - id: npmv - uses: pchynoweth/action-get-npm-version@1.0.1 + # - name: Get npm version action + # id: npmv + # uses: pchynoweth/action-get-npm-version@1.0.1 - name: Upload Release id: create_release -- 2.39.5 From ae6a6a05660c2dab135e2011266f9f127114d968 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:58:30 +0100 Subject: [PATCH 18/67] trying to fix npm --- .github/workflows/buildapp.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index fe4b484..af17364 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -134,10 +134,15 @@ jobs: with: name: macos-artifacts path: dist/macos + + - name: Setup node and npm + uses: actions/setup-node@v3 + with: + node-version: 16 - # - name: Get npm version action - # id: npmv - # uses: pchynoweth/action-get-npm-version@1.0.1 + - name: Get npm version action + id: npmv + uses: pchynoweth/action-get-npm-version@1.0.1 - name: Upload Release id: create_release -- 2.39.5 From 43ed5cbaaad4da309495e4289c2b54dc467a8f83 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:04:49 +0100 Subject: [PATCH 19/67] trying to fix npm pt. 2 --- .github/workflows/buildapp.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index af17364..745d78a 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -117,6 +117,9 @@ jobs: needs: [build-linux, build-windows, build-macos] steps: + - name: Checkout git repo + uses: actions/checkout@v2 + - name: Download Linux Artifacts uses: actions/download-artifact@v3 with: @@ -134,11 +137,6 @@ jobs: with: name: macos-artifacts path: dist/macos - - - name: Setup node and npm - uses: actions/setup-node@v3 - with: - node-version: 16 - name: Get npm version action id: npmv -- 2.39.5 From 7983cf0708b7494ef2e6a987862f13906243692a Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:25:41 +0100 Subject: [PATCH 20/67] added ISSUE_TEMPLATEs --- .github/ISSUE_TEMPLATE/bug.yaml | 65 +++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.yaml diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml new file mode 100644 index 0000000..84f27d1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -0,0 +1,65 @@ +name: Bug +description: Make sure you complete the template. Otherwise, it will be closed without further explanation! +title: "[v] Replace this with your title" +labels: bug +body: +- type: checkboxes + attributes: + label: Is there an existing issue for this? + description: _Please check the [**issues**](https://github.com/oxmc/bsky-desktop/issues) page to see if someone has already reported the bug. **I DIDN\'T MAKE THIS CHECKBOX FOR COSMETIC.**_ + options: + - label: I have searched the existing issues + required: true + +- type: textarea + attributes: + label: Device information + description: + value: | + - OS: + - Hardware Specs: + - Etc: + validations: + required: true + +- type: textarea + attributes: + label: Describe the issue + description: _Please attach videos or screenshots if possible_ + validations: + required: true + +- type: textarea + attributes: + label: Steps to reproduce + description: _Please attach videos or screenshots if possible_ + value: | + 1. + 2. + validations: + required: true + +- type: textarea + id: logs + attributes: + label: Crash log + description: _If the app crashes, **please provide the crash log**. + render: shell + +- type: dropdown + attributes: + label: Are you using the latest version of bsky-destop? If not, why? + description: _Developers spent loads of time and effort to fix bugs & make improvements with every release. You might want to try and update to the [latest version](https://github.com/oxmc/bsky-desktop/releases) before reporting an issue._ + multiple: false + options: + - ✅ Yes, I'm using the latest version of bsky-desktop + - ❌ No, I'll explain with additional information below + validations: + required: true + +- type: textarea + attributes: + label: Additional information + validations: + required: false + -- 2.39.5 From 09da537481db3658ed736a886ecfab1da26f40e0 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:15:39 +0100 Subject: [PATCH 21/67] made it also push the yml files --- .github/workflows/buildapp.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 745d78a..b993da2 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -43,7 +43,9 @@ jobs: uses: actions/upload-artifact@v3 with: name: linux-artifacts - path: dist/*.AppImage + path: | + dist/*.AppImage + dist/latest-linux.yml build-windows: name: Build bsky-desktop (Windows) @@ -76,7 +78,9 @@ jobs: uses: actions/upload-artifact@v3 with: name: windows-artifacts - path: dist/*.exe + path: | + dist/latest-windows.yml + dist/*.exe build-macos: name: Build bsky-desktop (macOS) @@ -109,7 +113,9 @@ jobs: uses: actions/upload-artifact@v3 with: name: macos-artifacts - path: dist/*.dmg + path: | + dist/latest-macos.yml + dist/*.dmg release: name: Create Release @@ -152,5 +158,8 @@ jobs: name: "bsky-desktop v${{ steps.npmv.outputs.version }}" files: | dist/linux/*.AppImage + dist/linux/latest-linux.yml dist/windows/*.exe - dist/macos/*.dmg \ No newline at end of file + dist/windows/latest-windows.yml + dist/macos/*.dmg + dist/macos/latest-macos.yml \ No newline at end of file -- 2.39.5 From 6071cf45de9ff0e80378840391728ddc3513f147 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:21:08 +0100 Subject: [PATCH 22/67] fixxxxxx --- .github/workflows/buildapp.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index b993da2..cb87457 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -79,7 +79,7 @@ jobs: with: name: windows-artifacts path: | - dist/latest-windows.yml + dist/latest-win.yml dist/*.exe build-macos: @@ -114,7 +114,7 @@ jobs: with: name: macos-artifacts path: | - dist/latest-macos.yml + dist/latest-mac.yml dist/*.dmg release: @@ -160,6 +160,6 @@ jobs: dist/linux/*.AppImage dist/linux/latest-linux.yml dist/windows/*.exe - dist/windows/latest-windows.yml + dist/windows/latest-win.yml dist/macos/*.dmg - dist/macos/latest-macos.yml \ No newline at end of file + dist/macos/latest-mac.yml \ No newline at end of file -- 2.39.5 From 8bef5f4acad56baabdd6237b4a1399239e75aeb9 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:35:24 +0100 Subject: [PATCH 23/67] testing pt. 2 --- .github/workflows/buildapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index cb87457..70cdecd 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -114,7 +114,7 @@ jobs: with: name: macos-artifacts path: | - dist/latest-mac.yml + dist/*.yml dist/*.dmg release: -- 2.39.5 From 9dd7a0e43cd3ca258cc3ae81d8c0593c93237315 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:42:59 +0100 Subject: [PATCH 24/67] only latest-linux.yml for now :( --- .github/workflows/buildapp.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 70cdecd..61d1815 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -79,7 +79,6 @@ jobs: with: name: windows-artifacts path: | - dist/latest-win.yml dist/*.exe build-macos: @@ -114,7 +113,6 @@ jobs: with: name: macos-artifacts path: | - dist/*.yml dist/*.dmg release: @@ -160,6 +158,4 @@ jobs: dist/linux/*.AppImage dist/linux/latest-linux.yml dist/windows/*.exe - dist/windows/latest-win.yml - dist/macos/*.dmg - dist/macos/latest-mac.yml \ No newline at end of file + dist/macos/*.dmg \ No newline at end of file -- 2.39.5 From a0e33743be6df3460cbc14c6873988cea1c7d9fa Mon Sep 17 00:00:00 2001 From: oxmc Date: Thu, 19 Dec 2024 18:51:33 -0800 Subject: [PATCH 25/67] Update gha autobuild --- .github/workflows/buildapp.yml | 82 +++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 36 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 61d1815..5b7b5a7 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -15,32 +15,33 @@ jobs: build-linux: name: Build bsky-desktop (Linux) runs-on: ubuntu-latest + outputs: + artifact: ${{ steps.upload-artifact.outputs.artifact }} env: ext: ".AppImage" + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout git repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup node and npm uses: actions/setup-node@v3 with: node-version: 16 - - name: Get npm version action - id: npmv - uses: pchynoweth/action-get-npm-version@1.0.1 - - name: Install dependencies run: npm install - name: Build (x64) run: npm run build -- --arch x64 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build (arm64) + run: npm run build -- --arch arm64 - name: Upload Linux Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + id: upload-artifact with: name: linux-artifacts path: | @@ -50,112 +51,121 @@ jobs: build-windows: name: Build bsky-desktop (Windows) runs-on: windows-latest + outputs: + artifact: ${{ steps.upload-artifact.outputs.artifact }} env: ext: ".exe" + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout git repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup node and npm uses: actions/setup-node@v3 with: node-version: 16 - - name: Get npm version action - id: npmv - uses: pchynoweth/action-get-npm-version@1.0.1 - - name: Install dependencies run: npm install - name: Build (x64) run: npm run build -- --arch x64 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build (arm64) + run: npm run build -- --arch arm64 - name: Upload Windows Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + id: upload-artifact with: name: windows-artifacts path: | dist/*.exe + dist/latest-windows.yml build-macos: name: Build bsky-desktop (macOS) runs-on: macos-latest + outputs: + artifact: ${{ steps.upload-artifact.outputs.artifact }} env: ext: ".dmg" + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout git repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup node and npm uses: actions/setup-node@v3 with: node-version: 16 - - name: Get npm version action - id: npmv - uses: pchynoweth/action-get-npm-version@1.0.1 - - name: Install dependencies run: npm install - name: Build (x64) run: npm run build -- --arch x64 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build (arm64) + run: npm run build -- --arch arm64 - name: Upload macOS Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + id: upload-artifact with: name: macos-artifacts path: | dist/*.dmg + dist/latest-macos.yml release: name: Create Release runs-on: ubuntu-latest needs: [build-linux, build-windows, build-macos] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout git repo uses: actions/checkout@v2 + + - name: Get app version + id: version + uses: pchynoweth/action-get-npm-version@1.0.1 - name: Download Linux Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: linux-artifacts path: dist/linux - name: Download Windows Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: windows-artifacts path: dist/windows - name: Download macOS Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: macos-artifacts path: dist/macos - - - name: Get npm version action - id: npmv - uses: pchynoweth/action-get-npm-version@1.0.1 + + - name: Display structure of downloaded files + run: ls -R && ls -R dist && ls -R dist/linux && ls -R dist/windows && ls -R dist/macos - name: Upload Release id: create_release uses: qnblackcat/action-gh-release@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: "v${{ steps.npmv.outputs.version }}" - name: "bsky-desktop v${{ steps.npmv.outputs.version }}" + tag_name: "v${{ steps.version.outputs.version }}" + name: "bsky-desktop v${{ steps.version.outputs.version }}" files: | dist/linux/*.AppImage dist/linux/latest-linux.yml dist/windows/*.exe - dist/macos/*.dmg \ No newline at end of file + dist/windows/latest-windows.yml + dist/macos/*.dmg + dist/macos/latest-macos.yml \ No newline at end of file -- 2.39.5 From 5029622d3b6e84788e258cac09016ace98ba49a1 Mon Sep 17 00:00:00 2001 From: oxmc Date: Thu, 19 Dec 2024 19:03:41 -0800 Subject: [PATCH 26/67] fix gha? --- .github/workflows/buildapp.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 5b7b5a7..3198bc9 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -19,7 +19,7 @@ jobs: artifact: ${{ steps.upload-artifact.outputs.artifact }} env: ext: ".AppImage" - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GHT }} steps: - name: Checkout git repo @@ -55,7 +55,7 @@ jobs: artifact: ${{ steps.upload-artifact.outputs.artifact }} env: ext: ".exe" - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GHT }} steps: - name: Checkout git repo @@ -91,7 +91,7 @@ jobs: artifact: ${{ steps.upload-artifact.outputs.artifact }} env: ext: ".dmg" - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GHT }} steps: - name: Checkout git repo @@ -125,7 +125,7 @@ jobs: runs-on: ubuntu-latest needs: [build-linux, build-windows, build-macos] env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GHT }} steps: - name: Checkout git repo @@ -154,7 +154,7 @@ jobs: path: dist/macos - name: Display structure of downloaded files - run: ls -R && ls -R dist && ls -R dist/linux && ls -R dist/windows && ls -R dist/macos + run: ls -R dist - name: Upload Release id: create_release -- 2.39.5 From 2e46bcb42d064ccd6d6df3f20539ed1ead25a4c2 Mon Sep 17 00:00:00 2001 From: oxmc Date: Thu, 19 Dec 2024 19:31:15 -0800 Subject: [PATCH 27/67] Improve gha --- .github/workflows/buildapp.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 3198bc9..60a8b2f 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -18,7 +18,7 @@ jobs: outputs: artifact: ${{ steps.upload-artifact.outputs.artifact }} env: - ext: ".AppImage" + ext: "AppImage" GITHUB_TOKEN: ${{ secrets.GHT }} steps: @@ -46,7 +46,7 @@ jobs: name: linux-artifacts path: | dist/*.AppImage - dist/latest-linux.yml + dist/*.yml build-windows: name: Build bsky-desktop (Windows) @@ -54,7 +54,7 @@ jobs: outputs: artifact: ${{ steps.upload-artifact.outputs.artifact }} env: - ext: ".exe" + ext: "exe" GITHUB_TOKEN: ${{ secrets.GHT }} steps: @@ -82,7 +82,7 @@ jobs: name: windows-artifacts path: | dist/*.exe - dist/latest-windows.yml + dist/*.yml build-macos: name: Build bsky-desktop (macOS) @@ -90,7 +90,7 @@ jobs: outputs: artifact: ${{ steps.upload-artifact.outputs.artifact }} env: - ext: ".dmg" + ext: "dmg" GITHUB_TOKEN: ${{ secrets.GHT }} steps: @@ -118,7 +118,7 @@ jobs: name: macos-artifacts path: | dist/*.dmg - dist/latest-macos.yml + dist/*.yml release: name: Create Release @@ -133,7 +133,7 @@ jobs: - name: Get app version id: version - uses: pchynoweth/action-get-npm-version@1.0.1 + uses: pchynoweth/action-get-npm-version@1.1.1 - name: Download Linux Artifacts uses: actions/download-artifact@v4 @@ -158,14 +158,12 @@ jobs: - name: Upload Release id: create_release - uses: qnblackcat/action-gh-release@master + uses: softprops/action-gh-release@v2.2.0 with: tag_name: "v${{ steps.version.outputs.version }}" name: "bsky-desktop v${{ steps.version.outputs.version }}" + generate_release_notes: true files: | dist/linux/*.AppImage - dist/linux/latest-linux.yml dist/windows/*.exe - dist/windows/latest-windows.yml - dist/macos/*.dmg - dist/macos/latest-macos.yml \ No newline at end of file + dist/macos/*.dmg \ No newline at end of file -- 2.39.5 From 5cd319aad6fa7428a4233954ea9208f6bee27851 Mon Sep 17 00:00:00 2001 From: oxmc Date: Thu, 19 Dec 2024 19:47:57 -0800 Subject: [PATCH 28/67] Fix artifacts not being uploaded --- .github/workflows/buildapp.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 60a8b2f..cebfe83 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -46,7 +46,7 @@ jobs: name: linux-artifacts path: | dist/*.AppImage - dist/*.yml + dist/latest*.yml build-windows: name: Build bsky-desktop (Windows) @@ -82,7 +82,7 @@ jobs: name: windows-artifacts path: | dist/*.exe - dist/*.yml + dist/latest*.yml build-macos: name: Build bsky-desktop (macOS) @@ -118,7 +118,7 @@ jobs: name: macos-artifacts path: | dist/*.dmg - dist/*.yml + dist/latest*.yml release: name: Create Release @@ -158,7 +158,7 @@ jobs: - name: Upload Release id: create_release - uses: softprops/action-gh-release@v2.2.0 + uses: softprops/action-gh-release@v2.1.0 with: tag_name: "v${{ steps.version.outputs.version }}" name: "bsky-desktop v${{ steps.version.outputs.version }}" -- 2.39.5 From 6753ed7e7986781baa17a49dd0a3c78bb61dd959 Mon Sep 17 00:00:00 2001 From: oxmc Date: Thu, 19 Dec 2024 22:14:10 -0800 Subject: [PATCH 29/67] Start adding auto updates (does not function currently) --- .../{buildapp.yml => build-and-release.yml} | 16 +-- src/app/main.js | 63 +--------- src/app/utils/auto-update.js | 114 ++++++++++++++++++ src/app/utils/sysInfo.js | 2 + 4 files changed, 127 insertions(+), 68 deletions(-) rename .github/workflows/{buildapp.yml => build-and-release.yml} (92%) create mode 100644 src/app/utils/auto-update.js diff --git a/.github/workflows/buildapp.yml b/.github/workflows/build-and-release.yml similarity index 92% rename from .github/workflows/buildapp.yml rename to .github/workflows/build-and-release.yml index cebfe83..6403837 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/build-and-release.yml @@ -15,8 +15,6 @@ jobs: build-linux: name: Build bsky-desktop (Linux) runs-on: ubuntu-latest - outputs: - artifact: ${{ steps.upload-artifact.outputs.artifact }} env: ext: "AppImage" GITHUB_TOKEN: ${{ secrets.GHT }} @@ -51,8 +49,6 @@ jobs: build-windows: name: Build bsky-desktop (Windows) runs-on: windows-latest - outputs: - artifact: ${{ steps.upload-artifact.outputs.artifact }} env: ext: "exe" GITHUB_TOKEN: ${{ secrets.GHT }} @@ -87,8 +83,6 @@ jobs: build-macos: name: Build bsky-desktop (macOS) runs-on: macos-latest - outputs: - artifact: ${{ steps.upload-artifact.outputs.artifact }} env: ext: "dmg" GITHUB_TOKEN: ${{ secrets.GHT }} @@ -129,7 +123,7 @@ jobs: steps: - name: Checkout git repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get app version id: version @@ -156,6 +150,11 @@ jobs: - name: Display structure of downloaded files run: ls -R dist + - name: Merge latest .ymls + uses: mikefarah/yq@v4.44.6 + with: + cmd: yq ea '. as $item ireduce ({}; . * $item )' dist/*/*.yml > dist/combined.yml + - name: Upload Release id: create_release uses: softprops/action-gh-release@v2.1.0 @@ -166,4 +165,5 @@ jobs: files: | dist/linux/*.AppImage dist/windows/*.exe - dist/macos/*.dmg \ No newline at end of file + dist/macos/*.dmg + dist/combined.yml \ No newline at end of file diff --git a/src/app/main.js b/src/app/main.js index 5c64b2f..fdce1b5 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -1,4 +1,4 @@ -const { app, BrowserWindow, BrowserView, globalShortcut, ipcMain, ipcRenderer, Tray, Menu, protocol, session } = require("electron"); +const { app, BrowserWindow, BrowserView, globalShortcut, ipcMain, Tray, Menu, protocol, session } = require("electron"); const electronremote = require("@electron/remote/main"); //const asar = require('@electron/asar'); const windowStateKeeper = require("electron-window-state"); @@ -6,7 +6,7 @@ const { setupTitlebar, attachTitlebarToWindow } = require("./titlebar/main"); const openAboutWindow = require("./about-window/src/index").default; const badge = require('./badge'); const contextMenu = require('./context-menu'); -const asarUpdater = require('./utils/asarUpdater'); +const autoUpdater = require('./utils/auto-update'); //const loadCRX = require('./utils/loadCRX'); const log4js = require("log4js"); const path = require("path"); @@ -483,64 +483,7 @@ app.whenReady().then(() => { // Initialize the updater: logger.log("Initializing Updater"); - asarUpdater.init(); - - // updater events: - asarUpdater.on('available', (task) => { - //console.log('Update availible for', task) - logger.log("Update availible for", task.name); - global.PageView.webContents.send('ui:notif', JSON.stringify({ title: 'Update', message: 'An update is available' })); - if (global.splash) global.splash.webContents.send('ui:progtext', { title: 'Update Available', subtitle: 'An update is available! Downloading...' }); - global.isUpdating = true; - }); - asarUpdater.on('not-available', (task) => { - //console.log('not-available', task); - logger.log("No Updates Available for", task); - }); - asarUpdater.on('progress', (task, p) => { - console.log(task.name, p); - if (global.splash) global.splash.webContents.send('ui:progtext', { title: 'Downloading Update', subtitle: 'Downloading update...' }); - if (global.splash) global.splash.webContents.send('ui:progbar', { reason: 'update', prog: p }); - }); - asarUpdater.on('downloaded', (task) => { - //console.log('downloaded', task); - logger.log("Downloaded Update for,", task.name); - global.PageView.webContents.send('ui:notif', JSON.stringify({ title: 'Update Downloaded', message: 'Restarting to apply update...' })); - if (global.splash) global.splash.webContents.send('ui:progtext', { title: 'Update Downloaded', subtitle: 'Restarting to apply update...' }); - }); - asarUpdater.on('completed', (manifest, tasks) => { - console.log('completed', manifest, tasks); - if (tasks.length === 0) { - setTimeout(() => { - logger.log("Quitting and Installing Update"); - asarUpdater.quitAndInstall(); - }, 5000); - }; - //app.quit() - }); - asarUpdater.on('error', (err) => { - //console.error(err); - logger.error(err); - //app.quit() - }); - - // Set the feed URL (only works in packaged app): - if (app.isPackaged) { - logger.log("Setting Feed URL for app.asar"); - asarUpdater.setFeedURL(path.join(global.paths.app_root), 'https://cdn.oxmc.me/internal/bsky-desktop/update/core'); - }; - - //Check for updates: - logger.log("Checking for Updates"); - if (app.isPackaged) { - const UPDATE_CHECK = 1000 * 60 * 60 * 4 // 4 hours - setInterval(() => { - //asarUpdater.checkForUpdates(); - }, UPDATE_CHECK); - //asarUpdater.checkForUpdates(); - } else { - logger.warn("Not checking for updates as app is not packaged"); - }; + autoUpdater(); // Handle ipc for render: ipcMain.on('close-app', (event, arg) => { diff --git a/src/app/utils/auto-update.js b/src/app/utils/auto-update.js new file mode 100644 index 0000000..a0d817e --- /dev/null +++ b/src/app/utils/auto-update.js @@ -0,0 +1,114 @@ +const path = require('path'); +const os = require('os'); +const fs = require('fs'); +const childProcess = require('child_process'); +const { app } = require('electron'); +const log4js = require('log4js'); + +// import the asarUpdater module +const asarUpdater = require('./asarUpdater'); + +// Get system information +const SystemInfo = require('./sysInfo'); + +// Get the current system platform +const sys = new SystemInfo(); + +// Setup the logger +const logger = log4js.getLogger("bskydesktop"); + +function asarUpdate() { + asarUpdater.init(); + + // updater events: + asarUpdater.on('available', (task) => { + //console.log('Update availible for', task) + logger.log("Update availible for", task.name); + global.PageView.webContents.send('ui:notif', JSON.stringify({ title: 'Update', message: 'An update is available' })); + if (global.splash) global.splash.webContents.send('ui:progtext', { title: 'Update Available', subtitle: 'An update is available! Downloading...' }); + global.isUpdating = true; + }); + asarUpdater.on('not-available', (task) => { + //console.log('not-available', task); + logger.log("No Updates Available for", task); + }); + asarUpdater.on('progress', (task, p) => { + console.log(task.name, p); + if (global.splash) global.splash.webContents.send('ui:progtext', { title: 'Downloading Update', subtitle: 'Downloading update...' }); + if (global.splash) global.splash.webContents.send('ui:progbar', { reason: 'update', prog: p }); + }); + asarUpdater.on('downloaded', (task) => { + //console.log('downloaded', task); + logger.log("Downloaded Update for,", task.name); + global.PageView.webContents.send('ui:notif', JSON.stringify({ title: 'Update Downloaded', message: 'Restarting to apply update...' })); + if (global.splash) global.splash.webContents.send('ui:progtext', { title: 'Update Downloaded', subtitle: 'Restarting to apply update...' }); + }); + asarUpdater.on('completed', (manifest, tasks) => { + console.log('completed', manifest, tasks); + if (tasks.length === 0) { + setTimeout(() => { + logger.log("Quitting and Installing Update"); + asarUpdater.quitAndInstall(); + }, 5000); + }; + //app.quit() + }); + asarUpdater.on('error', (err) => { + //console.error(err); + logger.error(err); + //app.quit() + }); + + // Set the feed URL (only works in packaged app): + if (app.isPackaged) { + logger.log("Setting Feed URL for app.asar"); + asarUpdater.setFeedURL(path.join(global.paths.app_root), 'https://cdn.oxmc.me/internal/bsky-desktop/update/core'); + }; + + //Check for updates: + logger.log("Checking for Updates"); + if (app.isPackaged) { + const UPDATE_CHECK = 1000 * 60 * 60 * 4 // 4 hours + setInterval(() => { + //asarUpdater.checkForUpdates(); + }, UPDATE_CHECK); + //asarUpdater.checkForUpdates(); + } else { + logger.warn("Not checking for updates as app is not packaged"); + }; +} + +function checkForUpdates() { + // Check if the current system is Windows + if (sys.isWin()) { + // Check if the system is before Windows 10 + if (sys.laterThan('10.0.0')) { + // Check for updates, and if there are updates, download and install them + logger.log('Checking for updates (win)...'); + } else { + // Windows 10 and above are supported, but windows 7 and 8 are not supported + logger.error('Windows 7 and 8 are not supported, please upgrade to Windows 10 or above, not updating...'); + } + } + + // Check if the current system is macOS + if (sys.isMac()) { + // Check if the current version is later than macOS 10.15.0 + if (sys.laterThan('10.15.0')) { + // Check for updates, and if there are updates, download and install them + logger.log('Checking for updates (macOS)...'); + } else { + // macOS 10.15 and above are supported, but macOS 10.14 and below are not supported + logger.error('macOS 10.14 and below are not supported, please upgrade to macOS 10.15 or above, not updating...'); + } + } + + // Check if the current system is Linux + if (sys.isLinux()) { + // Check for updates, and if there are updates, download and install them (no system version check) + logger.log('Checking for updates (linux)...'); + asarUpdate(); + } +} + +module.exports = checkForUpdates; \ No newline at end of file diff --git a/src/app/utils/sysInfo.js b/src/app/utils/sysInfo.js index 2150acc..62658ee 100644 --- a/src/app/utils/sysInfo.js +++ b/src/app/utils/sysInfo.js @@ -59,6 +59,8 @@ class SystemInfo { } } +module.exports = SystemInfo; + // Usage Example //const sys = new SystemInfo(); //console.log(`Is Windows: ${sys.isWin()}`); -- 2.39.5 From 33eb3a931f2d412009eeb281e434be4f0a655db7 Mon Sep 17 00:00:00 2001 From: oxmc Date: Thu, 19 Dec 2024 22:15:08 -0800 Subject: [PATCH 30/67] Forgot to update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e6ca8d2..7f1b874 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bsky-desktop", - "version": "1.0.7", + "version": "1.0.8", "description": "A desktop app of bsky.app", "main": "src/app/main.js", "scripts": { -- 2.39.5 From 9e2bef0037b51f0a0ca76e4985512d5bc5eb389b Mon Sep 17 00:00:00 2001 From: Gizzy Date: Fri, 20 Dec 2024 08:52:26 +0000 Subject: [PATCH 31/67] AUR --- build/.SRCINFO | 13 +++++++++ build/PKGBUILD | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 build/.SRCINFO create mode 100644 build/PKGBUILD diff --git a/build/.SRCINFO b/build/.SRCINFO new file mode 100644 index 0000000..efdcc95 --- /dev/null +++ b/build/.SRCINFO @@ -0,0 +1,13 @@ +pkgbase = bskydesktop + pkgdesc = Bluesky Desktop - A decentralized social networking client distributed as an AppImage + pkgver = 1.0.8 + pkgrel = 1 + url = https://github.com/oxmc/bsky-desktop + arch = x86_64 + arch = aarch64 + license = MIT + makedepends = curl + depends = fuse2 + options = !strip + +pkgname = bskydesktop diff --git a/build/PKGBUILD b/build/PKGBUILD new file mode 100644 index 0000000..bdbfcc9 --- /dev/null +++ b/build/PKGBUILD @@ -0,0 +1,79 @@ +# Maintainer: GizzyUwU me@gizzy.pro +# Maintainer: oxmc contact@oxmc.is-a.dev + +pkgname=bskydesktop +pkgver=$(curl -s https://api.github.com/repos/oxmc/bsky-desktop/releases/latest | jq -r .tag_name | sed 's/v//') +pkgrel=1 +pkgdesc="Bluesky Desktop - A decentralized social networking client distributed as an AppImage" +arch=('x86_64' 'aarch64') +url="https://github.com/oxmc/bsky-desktop" +license=('AGPL-3.0-only') +depends=('fuse2') +makedepends=('curl') +options=('!strip') +icon_url="https://raw.githubusercontent.com/oxmc/bsky-desktop/refs/heads/main/src/ui/images/logo.png" +icon_name="bsky-desktop.png" + +prepare() { + latest_tag=$(curl -s "https://api.github.com/repos/oxmc/bsky-desktop/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') + echo "Latest release tag: $latest_tag" + + case "$CARCH" in + x86_64) + appimage_name="bskyDesktop-${latest_tag:1}-linux-x64.AppImage" + ;; + aarch64) + appimage_name="bskyDesktop-${latest_tag:1}-linux-arm64.AppImage" + ;; + *) + echo "Unsupported architecture: $CARCH" + exit 1 + ;; + esac + + source=( + "https://github.com/oxmc/bsky-desktop/releases/download/$latest_tag/$appimage_name" + "$icon_url" + ) + echo "AppImage source: ${source[0]}" + sha256sums=('SKIP' 'SKIP') + curl -L "${source[0]}" -o "$srcdir/bskyDesktop.appimage" + curl -L "${source[1]}" -o "$srcdir/$icon_name" +} + +package() { + appimage_dest="$pkgdir/opt/appimages/bsky-desktop" + bin_dest="$pkgdir/usr/bin/bsky-desktop" + desktop_file="$pkgdir/usr/share/applications/bsky-desktop.desktop" + icon_dest="$pkgdir/usr/share/icons/hicolor/128x128/apps/$icon_name" + + if [[ ! -f "$srcdir/bskyDesktop.appimage" ]]; then + echo "Error: AppImage file not found: $srcdir/bskyDesktop.appimage" + exit 1 + fi + if [[ ! -f "$srcdir/$icon_name" ]]; then + echo "Error: Icon file not found: $srcdir/$icon_name" + exit 1 + fi + + install -d "$pkgdir/opt/appimages" + install -Dm755 "$srcdir/bskyDesktop.appimage" "$appimage_dest" + + install -d "$(dirname "$bin_dest")" + ln -sf "/opt/appimages/bsky-desktop" "$bin_dest" + + install -d "$(dirname "$icon_dest")" + install -Dm644 "$srcdir/$icon_name" "$icon_dest" + + install -d "$(dirname "$desktop_file")" + install -Dm644 /dev/stdin "$desktop_file" < Date: Fri, 20 Dec 2024 09:38:11 +0000 Subject: [PATCH 32/67] Github Action --- .github/workflows/build-and-release.yml | 34 ++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 6403837..21940c7 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -2,9 +2,9 @@ name: Build and Release bsky-desktop on: push: - branches: [ $default-branch ] + branches: [$default-branch] pull_request: - branches: [ $default-branch ] + branches: [$default-branch] workflow_dispatch: concurrency: @@ -124,11 +124,11 @@ jobs: steps: - name: Checkout git repo uses: actions/checkout@v3 - + - name: Get app version id: version uses: pchynoweth/action-get-npm-version@1.1.1 - + - name: Download Linux Artifacts uses: actions/download-artifact@v4 with: @@ -146,7 +146,7 @@ jobs: with: name: macos-artifacts path: dist/macos - + - name: Display structure of downloaded files run: ls -R dist @@ -166,4 +166,26 @@ jobs: dist/linux/*.AppImage dist/windows/*.exe dist/macos/*.dmg - dist/combined.yml \ No newline at end of file + dist/combined.yml + + aur: + name: Publish to AUR + runs-on: ubuntu-latest + needs: release + env: + AUR_TOKEN: ${{ secrets.AUR_TOKEN }} + + steps: + - name: Checkout git repo + uses: actions/checkout@v3 + + - name: Publish AUR package + uses: KSXGitHub/github-actions-deploy-aur@3.0.1 + with: + pkgname: bskydesktop + pkgbuild: ./build/PKGBUILD + commit_username: ${{ secrets.AUR_USERNAME }} + commit_email: ${{ secrets.AUR_EMAIL }} + ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + commit_message: New Version + ssh_keyscan_types: rsa,ecdsa,ed25519 -- 2.39.5 From baa6e33fcd67d6f877e59a9f3b4207a6863de4df Mon Sep 17 00:00:00 2001 From: Gizzy Date: Fri, 20 Dec 2024 10:08:12 +0000 Subject: [PATCH 33/67] Checksum Implementation --- .github/workflows/build-and-release.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 21940c7..b05c1d8 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -46,6 +46,16 @@ jobs: dist/*.AppImage dist/latest*.yml + - name: Generate checksum + run: | + sha256sum dist/*.AppImage > sha256sum.txt + + - name: Upload checksums + uses: actions/upload-artifact@v4 + with: + name: checksums + path: sha256sum.txt + build-windows: name: Build bsky-desktop (Windows) runs-on: windows-latest @@ -179,6 +189,17 @@ jobs: - name: Checkout git repo uses: actions/checkout@v3 + - name: Download checksums + uses: actions/download-artifact@v4 + with: + name: checksums + path: ./sha256sum.txt + + - name: Extract checksum from sha256sum.txt + run: | + new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt) + sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD + - name: Publish AUR package uses: KSXGitHub/github-actions-deploy-aur@3.0.1 with: -- 2.39.5 From 52883d335df53b3de8ea649ed3cd7ce0bf0c512e Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Fri, 20 Dec 2024 02:29:02 -0800 Subject: [PATCH 34/67] Add new builds, and update ext --- .github/workflows/build-and-release.yml | 12 +- package.json | 4 + src/app/main.js | 8 +- src/app/utils/auto-update.js | 60 ++++++++-- src/app/utils/sysInfo.js | 33 +++++- src/ui/rend/bsky-ext.js | 142 +++++++++++++++++++++++- 6 files changed, 235 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index b05c1d8..93e058e 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -163,7 +163,7 @@ jobs: - name: Merge latest .ymls uses: mikefarah/yq@v4.44.6 with: - cmd: yq ea '. as $item ireduce ({}; . * $item )' dist/*/*.yml > dist/combined.yml + cmd: yq eval-all '. as $item ireduce ({}; . * $item )' dist/*/*.yml > merged.yml - name: Upload Release id: create_release @@ -176,7 +176,7 @@ jobs: dist/linux/*.AppImage dist/windows/*.exe dist/macos/*.dmg - dist/combined.yml + merged.yml aur: name: Publish to AUR @@ -184,24 +184,20 @@ jobs: needs: release env: AUR_TOKEN: ${{ secrets.AUR_TOKEN }} - steps: - name: Checkout git repo uses: actions/checkout@v3 - - name: Download checksums uses: actions/download-artifact@v4 with: name: checksums path: ./sha256sum.txt - - name: Extract checksum from sha256sum.txt run: | new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt) sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD - - name: Publish AUR package - uses: KSXGitHub/github-actions-deploy-aur@3.0.1 + uses: KSXGitHub/github-actions-deploy-aur@v3.0.1 with: pkgname: bskydesktop pkgbuild: ./build/PKGBUILD @@ -209,4 +205,4 @@ jobs: commit_email: ${{ secrets.AUR_EMAIL }} ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} commit_message: New Version - ssh_keyscan_types: rsa,ecdsa,ed25519 + ssh_keyscan_types: rsa,ecdsa,ed25519 \ No newline at end of file diff --git a/package.json b/package.json index 7f1b874..1454e5b 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,10 @@ ], "artifactName": "bsky-desktop.${ext}", "mac": { + "target": [ + "dmg", + "pkg" + ], "icon": "src/ui/images/logo.icns", "category": "Network" }, diff --git a/src/app/main.js b/src/app/main.js index fdce1b5..2dbad0d 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -44,11 +44,11 @@ global.urls = { // Settings urls: global.settings = { - general: `${global.urls.main}/settings`, - account: `${global.urls.main}/settings/account`, - appearance: `${global.urls.main}/settings/appearance`, - privacy: `${global.urls.main}/settings/privacy-and-security`, + general: `${global.urls.main}/settings` }; +global.settings.account = `${global.settings.general}/account`; +global.settings.appearance = `${global.settings.general}/appearance`; +global.settings.privacy = `${global.settings.general}/privacy-and-security`; // Badge options: const badgeOptions = { diff --git a/src/app/utils/auto-update.js b/src/app/utils/auto-update.js index a0d817e..87f00bb 100644 --- a/src/app/utils/auto-update.js +++ b/src/app/utils/auto-update.js @@ -79,33 +79,75 @@ function asarUpdate() { } function checkForUpdates() { + // Current system information + logger.log('Current system information:', sys.platform, sys.getVersion()); + // Check if the current system is Windows if (sys.isWin()) { // Check if the system is before Windows 10 - if (sys.laterThan('10.0.0')) { - // Check for updates, and if there are updates, download and install them - logger.log('Checking for updates (win)...'); - } else { + if (sys.earlierThan('10.0.0')) { // Windows 10 and above are supported, but windows 7 and 8 are not supported logger.error('Windows 7 and 8 are not supported, please upgrade to Windows 10 or above, not updating...'); + } else { + // Check for updates, and if there are updates, download and install them + logger.log('Checking for updates (win)...'); } } // Check if the current system is macOS if (sys.isMac()) { - // Check if the current version is later than macOS 10.15.0 - if (sys.laterThan('10.15.0')) { + let macArch = ''; + // Check the current version of macOS, and whether we can use the pkg installer + if (sys.laterThan('10.0.0')) { + // Check if system is after macOS 10 (11, 12, etc.) + if (sys.laterThan('11.0.0')) { + // macOS 11 and above support ARM64, check if system is ARM64 + logger.log('Checkking system architecture...'); + if (sys.isARM64()) { + // System is ARM64 (mac-arm64) + macArch = 'arm64'; + } else { + // System is Intel (mac-x64) + macArch = 'intel'; + } + } else { + // macOS 10 is mostly Intel, but some versions are ARM64 + macArch = 'intel'; + } // Check for updates, and if there are updates, download and install them - logger.log('Checking for updates (macOS)...'); + logger.log('Checking for updates (mac)...'); + + // Run the .pkg installer + const pkgPath = path.join(global.paths.updateDir, 'bsky-desktop.pkg'); + const command = `sudo installer -pkg ${pkgPath} -target /`; + + // Spawn a new shell + const shellProcess = spawn('sh', ['-c', command], { + stdio: 'inherit', // Pipe input/output to/from the shell + }); + + shellProcess.on('error', (err) => { + console.error('Failed to spawn shell:', err); + }); + + shellProcess.on('close', (code) => { + if (code === 0) { + console.log('Update installed successfully.'); + } else { + console.error(`Shell process exited with code ${code}.`); + } + }); } else { - // macOS 10.15 and above are supported, but macOS 10.14 and below are not supported - logger.error('macOS 10.14 and below are not supported, please upgrade to macOS 10.15 or above, not updating...'); + // macOS versions before 10 are not supported + logger.error('macOS versions before 10 are not supported, not updating...'); } } // Check if the current system is Linux if (sys.isLinux()) { // Check for updates, and if there are updates, download and install them (no system version check) + // Linux versions use AppImage, so we instead need to check for a new asar file so that the app can + // load the new asar instead of the packaged one (or even just delete the old appimage and download a new one) logger.log('Checking for updates (linux)...'); asarUpdate(); } diff --git a/src/app/utils/sysInfo.js b/src/app/utils/sysInfo.js index 62658ee..66f9bf7 100644 --- a/src/app/utils/sysInfo.js +++ b/src/app/utils/sysInfo.js @@ -5,6 +5,7 @@ class SystemInfo { constructor() { this.platform = os.platform(); // 'win32', 'darwin', 'linux' this.release = os.release(); // OS version + this.arch = os.arch(); // 'arm', 'arm64', 'x64', 'x86' this.versionInfo = this._getVersionInfo(); // Parsed version } @@ -23,6 +24,26 @@ class SystemInfo { return this.platform === 'linux'; } + // Check if current system architecture is ARM + isARM() { + return this.arch === 'arm'; + } + + // Check if current system architecture is ARM64 + isARM64() { + return this.arch === 'arm64'; + } + + // Check if current system architecture is x64 + isX64() { + return this.arch === 'x64'; + } + + // Check if current system architecture is x86 + isX86() { + return this.arch === 'x86'; + } + // Compare if current version is later than the given version laterThan(compareVersion) { const current = this.versionInfo; @@ -35,6 +56,11 @@ class SystemInfo { return false; } + // Compare if current version is earlier than the given version + earlierThan(compareVersion) { + return !this.laterThan(compareVersion); + } + // Private: Parse version strings (e.g., "10.0.19045" -> [10, 0, 19045]) _parseVersion(version) { return version.split('.').map((num) => parseInt(num, 10) || 0); @@ -57,6 +83,11 @@ class SystemInfo { return [0, 0, 0]; // Unknown system } } + + // Get current version as a string (e.g., "10.15.7") + getVersion() { + return this.versionInfo.join('.'); + } } module.exports = SystemInfo; @@ -66,6 +97,6 @@ module.exports = SystemInfo; //console.log(`Is Windows: ${sys.isWin()}`); //console.log(`Is macOS: ${sys.isMac()}`); //console.log(`Is Linux: ${sys.isLinux()}`); -//console.log(`Current Version Info: ${sys.versionInfo.join('.')}`); +//console.log(`Current Version Info: ${sys.getVersion()}`); //console.log(`Later than 10.0.19044: ${sys.laterThan('10.0.19044')}`); //console.log(`Later than 5.15.0 (Linux Kernel): ${sys.laterThan('5.15.0')}`); \ No newline at end of file diff --git a/src/ui/rend/bsky-ext.js b/src/ui/rend/bsky-ext.js index b635a1d..4e5492d 100644 --- a/src/ui/rend/bsky-ext.js +++ b/src/ui/rend/bsky-ext.js @@ -374,6 +374,15 @@ const BskyExt = { }, "regex": /discord\.com\/invite\/([a-zA-Z0-9_]+)/ }, + "discord_profile": { + "name": "Discord", + "type": "social", + "icon": "fab fa-discord", + "brand": { + "color": "#7289DA", + }, + "regex": /discord\.com\/users\/([a-zA-Z0-9_]+)/ + }, "discord.gg": { "name": "Discord", "type": "messaging", @@ -473,6 +482,33 @@ const BskyExt = { }, "regex": /irc:\/\/([a-zA-Z0-9_]+)/ }, + "itchio": { + "name": "Itch.io", + "type": "content", + "icon": "fab fa-itch-io", + "brand": { + "color": "#FA5C5C", + }, + "regex": /([a-zA-Z0-9_]+)\.itch\.io/ + }, + "etsy_shop": { + "name": "Etsy", + "type": "content", + "icon": "fab fa-etsy", + "brand": { + "color": "#D5641C", + }, + "regex": /etsy\.com\/shop\/([a-zA-Z0-9_]+)/ + }, + "etsy_user": { + "name": "Etsy", + "type": "content", + "icon": "fab fa-etsy", + "brand": { + "color": "#D5641C", + }, + "regex": /([a-zA-Z0-9_]+)\.etsy\.com/ + }, "email": { "name": "Email", "type": "messaging", @@ -498,7 +534,43 @@ const BskyExt = { "brand": { "color": "#1DA1F2", }, - "regex": /twitter\.com\/([a-zA-Z0-9_]+)/ + "regex": /(twitter\.com|x\.com)\/([a-zA-Z0-9_]+)\/?$/ + }, + "xbox": { + "name": "Xbox", + "type": "social", + "icon": "fab fa-xbox", + "brand": { + "color": "#107C10", + }, + "regex": /xbox\.com\/([a-zA-Z0-9_]+)/ + }, + "playstation": { + "name": "PlayStation", + "type": "social", + "icon": "fab fa-playstation", + "brand": { + "color": "#003087", + }, + "regex": /playstation\.com\/([a-zA-Z0-9_]+)/ + }, + "steam": { + "name": "Steam", + "type": "content", + "icon": "fab fa-steam", + "brand": { + "color": "#000000", + }, + "regex": /steamcommunity\.com\/id\/([a-zA-Z0-9_]+)/ + }, + "tiktok": { + "name": "TikTok", + "type": "social", + "icon": "fab fa-tiktok", + "brand": { + "color": "#000000", + }, + "regex": /tiktok\.com\/@([a-zA-Z0-9_]+)/ }, "instagram": { "name": "Instagram", @@ -729,6 +801,72 @@ const BskyExt = { } }, + /** + * @constant {Object} linkStylesOverrides - Style overrides for specific link types + */ + linkStylesOverrides: { + "bluesky": { + "default": { + "color": "rgb(0, 133, 255)", + "background": "#0000", + "border": "#0000", + }, + "hover": { + "color": "#fff", + "background": "#0000", + "border": "#0000" + } + }, + "discord": { + "default": { + "color": "#FFFFFF", + "background": "#7289DA", + "border": "#7289DA", + }, + "hover": { + "color": "#7289DA", + "background": "#FFFFFF", + "border": "#7289DA" + } + }, + "linktree": { + "default": { + "color": "#FFFFFF", + "background": "#39e09b", + "border": "#39e09b", + }, + "hover": { + "color": "#39e09b", + "background": "#FFFFFF", + "border": "#39e09b" + } + }, + "carrd": { + "default": { + "color": "#FFFFFF", + "background": "#2C2F33", + "border": "#2C2F33", + }, + "hover": { + "color": "#2C2F33", + "background": "#FFFFFF", + "border": "#2C2F33" + } + }, + "dribbble": { + "default": { + "color": "#FFFFFF", + "background": "#EA4C89", + "border": "#EA4C89", + }, + "hover": { + "color": "#EA4C89", + "background": "#FFFFFF", + "border": "#EA4C89" + } + }, + }, + /** * @constant {Object} buttonStyles - The button styles for the supported messaging apps * @@ -1109,7 +1247,7 @@ const BskyExt = { let header = bio.closest("[data-testid='profileView']"); // Get the profile header button group element - let buttonGroup = header.querySelector('[role="button"]').parentElement; + let buttonGroup = header.querySelector("div.css-175oi2r.r-2llsf > div:nth-child(1) > div > div:nth-child(2) > div.css-175oi2r.r-12vffkv"); // Check if the profile header button group element exists if (!buttonGroup) { -- 2.39.5 From a82d5d67e25959988529ee085f1f18eed3dce13e Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Fri, 20 Dec 2024 02:52:25 -0800 Subject: [PATCH 35/67] Add jq install and debug --- .github/workflows/build-and-release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 93e058e..71b50b5 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -184,18 +184,31 @@ jobs: needs: release env: AUR_TOKEN: ${{ secrets.AUR_TOKEN }} + steps: - name: Checkout git repo uses: actions/checkout@v3 + + - name: Install jq + run: sudo apt-get update && sudo apt-get install jq -y + - name: Download checksums uses: actions/download-artifact@v4 with: name: checksums path: ./sha256sum.txt + + - name: List downloaded files + run: ls -R + + - name: Show content of sha256sum.txt + run: cat sha256sum.txt + - name: Extract checksum from sha256sum.txt run: | new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt) sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD + - name: Publish AUR package uses: KSXGitHub/github-actions-deploy-aur@v3.0.1 with: -- 2.39.5 From 08fbe470ad045775e107276c316313bc340f8eb1 Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Fri, 20 Dec 2024 02:57:11 -0800 Subject: [PATCH 36/67] Change path in checksum download --- .github/workflows/build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 71b50b5..1c3b68d 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -196,7 +196,7 @@ jobs: uses: actions/download-artifact@v4 with: name: checksums - path: ./sha256sum.txt + path: . - name: List downloaded files run: ls -R -- 2.39.5 From 3a0941c67caa66e6cd212927c789d3aa057c990e Mon Sep 17 00:00:00 2001 From: Gizzy Date: Fri, 20 Dec 2024 10:59:57 +0000 Subject: [PATCH 37/67] AUR fix --- .github/workflows/build-and-release.yml | 6 +++++- build/PKGBUILD | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index b05c1d8..d3ce7c3 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -178,6 +178,9 @@ jobs: dist/macos/*.dmg dist/combined.yml + - name: Set version output + run: echo "releasever=${{ steps.create_release.outputs.tag_name }}" >> $GITHUB_ENV + aur: name: Publish to AUR runs-on: ubuntu-latest @@ -195,10 +198,11 @@ jobs: name: checksums path: ./sha256sum.txt - - name: Extract checksum from sha256sum.txt + - name: Extract checksum from sha256sum.txt and change build version run: | new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt) sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD + sed -i "s|pkgver=\"\"|pkgver=\"$releasever\"|" ./build/PKGBUILD - name: Publish AUR package uses: KSXGitHub/github-actions-deploy-aur@3.0.1 diff --git a/build/PKGBUILD b/build/PKGBUILD index bdbfcc9..615aa2d 100644 --- a/build/PKGBUILD +++ b/build/PKGBUILD @@ -2,7 +2,7 @@ # Maintainer: oxmc contact@oxmc.is-a.dev pkgname=bskydesktop -pkgver=$(curl -s https://api.github.com/repos/oxmc/bsky-desktop/releases/latest | jq -r .tag_name | sed 's/v//') +pkgver="" pkgrel=1 pkgdesc="Bluesky Desktop - A decentralized social networking client distributed as an AppImage" arch=('x86_64' 'aarch64') -- 2.39.5 From 9d337fa31562d45f0c38f8c7c8055cb99b48748a Mon Sep 17 00:00:00 2001 From: Gizzy Date: Fri, 20 Dec 2024 11:22:36 +0000 Subject: [PATCH 38/67] Changes how version tag is set in action --- .github/workflows/build-and-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index d3ce7c3..db6e05e 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -178,9 +178,8 @@ jobs: dist/macos/*.dmg dist/combined.yml - - name: Set version output - run: echo "releasever=${{ steps.create_release.outputs.tag_name }}" >> $GITHUB_ENV - + outputs: + version_tag: ${{ steps.version.outputs.version }} aur: name: Publish to AUR runs-on: ubuntu-latest @@ -200,9 +199,10 @@ jobs: - name: Extract checksum from sha256sum.txt and change build version run: | + echo releasever new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt) sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD - sed -i "s|pkgver=\"\"|pkgver=\"$releasever\"|" ./build/PKGBUILD + sed -i "s/^pkgver=.*$/pkgver=${{ needs.release.outputs.version_tag }}/" ./build/PKGBUILD - name: Publish AUR package uses: KSXGitHub/github-actions-deploy-aur@3.0.1 -- 2.39.5 From 6fece01fa966074f6050677a69398760403ae851 Mon Sep 17 00:00:00 2001 From: Gizzy Date: Fri, 20 Dec 2024 11:31:21 +0000 Subject: [PATCH 39/67] syntax error :nerd: --- .github/workflows/build-and-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index db6e05e..5fc8322 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -128,6 +128,8 @@ jobs: name: Create Release runs-on: ubuntu-latest needs: [build-linux, build-windows, build-macos] + outputs: + version_tag: ${{ steps.version.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GHT }} @@ -178,8 +180,6 @@ jobs: dist/macos/*.dmg dist/combined.yml - outputs: - version_tag: ${{ steps.version.outputs.version }} aur: name: Publish to AUR runs-on: ubuntu-latest -- 2.39.5 From cb0cfbe64059c4022e910573e315f206fc3d7b2a Mon Sep 17 00:00:00 2001 From: Gizzy Date: Fri, 20 Dec 2024 11:37:36 +0000 Subject: [PATCH 40/67] test --- .github/workflows/build-and-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 5fc8322..0bb6080 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -205,6 +205,7 @@ jobs: sed -i "s/^pkgver=.*$/pkgver=${{ needs.release.outputs.version_tag }}/" ./build/PKGBUILD - name: Publish AUR package + if: false uses: KSXGitHub/github-actions-deploy-aur@3.0.1 with: pkgname: bskydesktop -- 2.39.5 From d26d82121c4adf0d10c235cd62cd907c2badecc6 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:09:05 +0100 Subject: [PATCH 41/67] fixed an issue with the appimage --- package.json | 2 +- src/ui/images/icons/128x128.png | Bin 0 -> 2915 bytes src/ui/images/icons/16x16.png | Bin 0 -> 538 bytes src/ui/images/icons/256x256.png | Bin 0 -> 5966 bytes src/ui/images/icons/32x32.png | Bin 0 -> 939 bytes src/ui/images/icons/48x48.png | Bin 0 -> 1427 bytes src/ui/images/icons/64x64.png | Bin 0 -> 1733 bytes 7 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 src/ui/images/icons/128x128.png create mode 100644 src/ui/images/icons/16x16.png create mode 100644 src/ui/images/icons/256x256.png create mode 100644 src/ui/images/icons/32x32.png create mode 100644 src/ui/images/icons/48x48.png create mode 100644 src/ui/images/icons/64x64.png diff --git a/package.json b/package.json index 1454e5b..2b3b25d 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "target": [ "appimage" ], - "icon": "src/ui/images/logo.png", + "icon": "src/ui/images/icons", "category": "Network" }, "win": { diff --git a/src/ui/images/icons/128x128.png b/src/ui/images/icons/128x128.png new file mode 100644 index 0000000000000000000000000000000000000000..78cd3d7746cd9a5b81418fa133d3e2bd372987be GIT binary patch literal 2915 zcmeH}`8O2$8^=Fm8T(q<*DR%EyGF*|*elZ5E)m(vmSW5xU1Lv%tb>RtOC!Ws>MA5- zUs^;=n2{wT$-YjwI_G=N{TsgL+;g7y^E%IYetVziocEJtV{OjEDaHu^;IXtYK^_wO zTkOn-eSI>0=Maz(q&WgY=~0e495`-SIE4Vfb>z1o;9-FX08G_37wt?BmmvP&zxvOC z{|g5w_P%_F7dwkWTH6ACJ4|{p?xwYjtW8Q9`ZBNL(6_Z;%U?g%1t_ztGz_lJeoB-- z+kVh_N`2sE>Rzdk1S#gow6r0o)p zmQ+YR-`uG_Uc1r<`^;LVbovpaqo$tY@4}4;2vhvE?UpP%Ozlpr> zCf22uIcDJg@Yy)0WsXKs!SIqF9UD7(;*vv<oLyMK z;=?<3R!$OKTRt1X;t^rr6g8#1Pm2Dm!fD8PPY5}8c(s=drdgUQq?aM3X5lF$?w+*u z+`MC*xQs6D$0Fo@H9SXOojpg2kb+n_Y6*U4iS|4nc2KZnxJ9K=8C#6;kWC8X<(7fS z-upH|EQ<`p0{jc3+6KBW8|!?`La5({8$7a|)%};t77tTPaVQF|vJ_tg)9ed+GKst--3|~b4hGw;S*&*rWDKd z?DLT|DJv7|E$7wv24X>(;Ok~sC#^xLWuy;!IWcJHo&>x5uIUqU;Ky zL)18s@F6m_O>}&PNAJQ(g@_y(tW!r;8E3(Ot|ntjY&F!RTb+kVZP7a93QRO-1!cNb z@oHAFzU`Gbf9tp#v9LmlLJ44=9^+exe1&)3b=kggA0%iLhUGuK`!WWssSELH`2}0X zgP1kZcgM^WoxHkcswmV``+fFAi`sG??w6mDlk3 z1N+fVSDjVW?g9K??@`#a>w?8LG^QJi+3XNy;nZw|RW$+Ae(b~&Q&sb{3|2MntR;~{ z|2C{q+JtU*{W2TYXQ$l=a3ZFNO4%G&&6F)pEoAb-3XiZt`j39Q=&^H6;+)!@FKz~` zu&Vpc+>lYnXh2-R>D|8Xbu{@6^vZ52H357mJEQiNNkX}{bZX!hIqgE5lrmI=a9Sft zeks_@F_kUJm2_a z);~_!T)WGr9@V&PodiLX6vbgmy^%g=qbBaYh)$0sS_V0XYOvRwh~@)uYRlj{CgVN) z7EUsycJrZ)%#|yg{OxcF^YqoX1o* z&j8$7u)?27pm$}u177rklS7x@#)Zw$$kf?Yqz_jL^B_>5ev#rRDQ?&yGsQ&0qOYnA z&Ngj|&sHJJ-V=RrCD?KU7#o1Agt|&b-L5fZNo9E0r@t2{%ySHClS*9P z-cD%kDQn!9F`$(@t>9UsK2yxr41`xp`s+>o=YmVodSJEYs#AM227iigWZvqlOai2- z8Cn=#K3b2TvNT3EXiV_m$`fa!q0zTpqdy9+jG%TDz`kfokn ze~(&HFww7^&oPP8ImZ}3DQr&C+HnFMyh)Pj`Lk%}HW_zFuJk4yyUng|;4`cOo{C1H z`n}{a6BniVML=u}JVVeei`Oy3o*l#12==A?IT=#KaW2R2Vut0CAi5>QeWd%>s_rd? zj@rc`^K{k4wuJGZp8oA8a{OYQ@(pvtUQXOTZRkz9<{dsIB0Ec@?~_13w(0YVUb} z&72TBauq`h?-y9;v)sou<-#S|%u=p37G_cFsV_I&^^+RV{h1bMM8;4)33EUnc{@Nm z{)kK;Hsg^iBHe}%{43&@_L|b&aO9P5)!}=3>oZjd^~7Ht(aDAypODKuc4LjsKJT=@25G}xN7&F=8bpcKI7*d zzTGB<1IDEF!YN-wdT}@p!r{wGQwVv-x;#9n;W-gGAz$^1CVAXeS66aQQAg|p6gDW3G_fHG?3_fAj2r>9#C=(DgA*%i2Kv_b+T|YHjiy;U4o3y5o1= literal 0 HcmV?d00001 diff --git a/src/ui/images/icons/16x16.png b/src/ui/images/icons/16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..3fe3edf365a61f25596a65a2495302314b58311d GIT binary patch literal 538 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6XVU3I`u#fXMsm#F#`j) zFbFd;%$g$s6g(E-6XFV_8Cw4jbyS!$B^l@ur;;GQUUID>R zFPhjn+U}l@PyMog$<-Tk40gWywoRW=Y14Z7-p}ow>o#)l_EHz|2j&E~>) zJtBqT`R{9Y-94weugkvSiS2Lel%#+uF;}KvW=d|>GA(iXJMoaMgvsRZA*v=Xjx|Ip zop;F1zF?i@*gWyxwPOb^SFBjKc&T?YqohUC>hrgixXpMP>XwM!v+=izVzvwS+H^Yc o%$jdG=i|2f6g~WMzHt6m7N(ENg4*gSa-b;mboFyt=akR{0Q(Zm;TVG1yE2nK+nh`$&3Z8lq!W`u|6+lScrdxnI$1bF~qVPSIKem=o& zE&(2L{y|;^-_WN3fPcYQPuuox;nv4ULN@m0o86yb+i+gJL3V~ypW4!-KkWsPK1(a3 zU$mP|Tja>RB}l%JMKikRfz=G; zGynMV{qY24uHZSP$nEXz@aUxv*Bd1j_t8&^i`Uzp96Lp8TH6%{2aeh^229NDLIUJm zZvqqg<1ECk2jQTazy*0={md8WveRG>P?(Y@fD7i@|6l0zw2j@0ePs9a2K-U8QnS*i zfnt3{id_^gJA(fP8GhrJaT;nv&@|`g6?a5`DDf0Q+1mCIJUg63dpQ~6V8LNiVV8)+CL1c zRcR?J17#$JA?fI9APl%PN31HEGvHNmlU2qEbZRnrcc|WaQdg77mzb{!?b)Fl58wtrGD>`Q{JHk)Ya% z<@{4kAK;nn?3Ke&%jGodKChZ>!N2vp5gpQn>%gaF*W34Z=n#eiuL$T5ro}A`lrUw9 zeL<;kzlvd->62wfwRDu6qW!iCG?2mS*LP?3hpK6<{CV2qAAElDIpv-q4LQI*K>oNR z)|7{uA6Zmk3dPfva5IHz$9)_Mr#jQn940c6j){TUVhx)z;W=W9@qdA0)k8cM2CD>? zHS6i_c$|S3XP~nh;yOz+&`+cW-V>R~4ku{|Et3WJq3HX3tEVL3Oo4ZFI-}lRr@)51>tIjx_E|`D1<|yGk#XW=;7$3bA-jW{dy@hzk+z z7bo?DWNlZ;^JXPkQp6M2`4ZUnvouZ}aPyWh26iAiCQkC(GxDC6m<)73)a<{DyVE?r z9UX544Aj%HzPm+WtSqv;&X^S6uEb=o^E0c!_-abW%_CkN(7l1qmKcg$%6(q4eW^OO zeYcBrm&^FiG7cD8Wi18Bj*KrHK)LSfEPXAEFWwR;U{bWU;pFw#E zW+w`}X6mR$rzw%$zOTQ`OhMSWo~(E|1Fo;Q>hw5!&u=;15|*f~Cb(cjH*?h)Sv6*(pFCsFyhsZ#q$+p6#`W`H6g9p%@U5y&wnvO(W$OF-IEnc7KvcgD zDKMoo?Dn4@s(6UP5=_}DF`&AA*PpDdBh?U9AF@-ucGY=X@gQz|RzM3lZ!f+ez9=t@ zxGgMUOX{arTr>qNhiCMF|K7ZFxhBEDdKDB2_%32BbCl^JJ#xRN19208`8ycawA>ik zNnhPuqGyR8cSFEW#}0q-fMJ$80q6{uenMm0+{1@gng?%3C2a zxXB{Q;{gJQ34?EhZky=JZjMax0fuiSD*Jo!QaBFHBgog*C737P=J2vG`NBBsXXfP) zil8Tiy3;0)t3NhSkTlCe3pl>1QTATfA=Hx9&3s#zer~ZWANN3c8{7oDO;Bp@Pf&Nk){P(n$&TY zlEL4$NZ?Yrti^s2IC3HL%uk*n`XX}d?D|VUr_2n)(_zfK6wSlA(Z!`Ug)$ZW59n7) z3axTXtm#CvE!#Z(!8xcQVgTL}6cQIS>0VWzLm5;W6(?z>VAD$ITPG8(0q&t8m=Qy# z?)AA3s9`H(#z<}Yrh^=r^m`f)Avo0rI{I5)iX**9;U2Y?~(MR1Q3O+ z6@WtVVO?;wag=E~WNv)`i35t0*k>j7%-YzkpNCeJYgn6z{AR_Z{53n>oL3)04Qd$+ z{YfTy7KsOZ@rURjp`80H+H^LFdzWdNLJ>XAK$LU!nzHIfu<45)MbThAAqKy&jjjol z-m8r+aCQu3u(RC&esmTkP792sY2Da(cf=e7xe56|%NU7Gfc5g&l*(=HOwT&K$J> zjdKZsZkC9q2s%zHiL78Kf=OaGfd%ey1LFrNv?J}1m>zmI#xnML73KgdkCU+R%TzgN zzy5OEBg%Wv;#%>4R`&(?%GHsXlRt(d8KqhA)aBD_?*n?jMSv1ZhP9tfm7RTrZDQPf zdOuwp-tnTq3c|sPm?^o2&1-El*k+FY54WH7PD|t4nj*o90hr?Am6Rq(rnqiKfmm0Q zbb(AlTT`M90R04@8r&pi-%WqOM8}|dSvB4sa`F>8Brh=rffZ_>VY-zTww zzImcZT}yzshrc44Y>c|W19d()yg*jhv7yB0gZv@RwJYXFja zJcY&VlE<^vH!sdQ=OW5u(wNT%Z9u2G&otQ^8u7Ux^m|cXmzvgnh_lISfmZHaSbTB+ zIowtcaL%Gj?+f8iV{f|xn0F;!?}E*XyE7;~OKm>f%^?&7E`M3SHDtFTNDh`G_xm1? z$Xo~Ms<+a%ed1T?8VK^R9E;;cRn@b^hEKc}`Pq=Le6Y2{tku6@R9iAGb7Pv4wJHc* z^+`u+fZrBY__Qwcq!PH@YDI|9K9_c|`|4%$hmggN0T~?Yt7mEHt^%f)L^ihMB`0HQ zoT*Pwt%Q-ep7Y-XVU~`DMlC2pj>btZbeMe33?IAjcT;K)aHlmb!!@g-sQmfKBT^q1 z(VHRMwIxaCu2)ANA5Nu>X-%JksD0khhC8!myQ1vc@p^wA@rltf01DuC^00V90kQ${ z>X4)IzGk0-C2O>wFvhW87I$W;BP~4wj(Uzp5K3p%%zrV3IT+67lqAqEm<74ltSkQx zwZ$@3gK$D*LwUvH)=UnCo0DZ@s8Mn(nr_N7nRt(^er9TZ@&EE2UK%ivN zTUhJ|fr%JHzHr6T-d(sX2=eOl-G{D`4zdXeW+nA$tnP7kGX~n zQo$eESEgJSfNNB@-JL@jsdL)_04l`;`NyMZpzAa*HCd&35M|WGeGLHS2WKiJB2l;>O?(g8x<0Z(YPq;SpEvU9j%i8ruTgn7av zI*~VwBB^hKFz``DRJc_^_yQ_D{uT?yhct9F9Dp1xC5jR0F&vm~F}YvZ7xD&a3?Fb`J!T6@ODcn|3V&IJgbNIRR4aYY*m{A}alph(_n zXD7Jd1mZ-uHX&v@>Pg=muwfU|c%Nd4iWnv+zfT(nzm1$c4$SNx*}Ie`KITq%|5f8h z$jVn8s{Q|h_Xc^JY;K~RcJGx_qt&6MbW}o5vundQeWTc`j;$L zC;iNe=F9q{C;8EDN`mL*{$f;?YD1i@Zp0+8(Iu!!{W!G+n6p5A^ciDwTc?=%jcd19*+d{VDYz&yg=T=2UtA5 zlVPoZEXJ+I;r}oBv5U#!CW%vh2Ki?`%Jj+ z_~-49@3d~^F9FUIjIbESNAPv#eQHw?8tAb*Qe!IZp=Ie)BnLph_<0&KU{c$ z+i+HxNFFPmrHiuhUiou8PtNY~>cEG{^zc28ZE4uP=nJbS;10J=6c?cjnW=FhE5&S}soLAdfu%92^f8eYO zl3SDfX$5eVtpILfxd|3rADqY2cZE4b#R4pbenys>0+~)ibC{WU7 zpRmJ5K`2Y1-&BdAKP?R2Ku+2!SSup0RoydbeoKpXz<{J>@?`y+UB+48Dz#Z>`66|_ z3&vmg`&mL17f=Qb6``Ibz8U=NqGMTu7hI=oE(WbyEx8DA?x8`1b*Yos0u13WA)Hl_ zvd#)j&Gi6Lb0|Y|-hAsMP?nd#+IEgh`ffiVk3IT9Jx#+hgm5afK2B1$ZZ*u_cUg?| zr!K(4>tMIa-9(=zSr-*Ay>9C5)y;tOIoB!jQ5|3B3PDyPFB*h4luL|4tgJ#;bTGBp zoO9GVmEGHw0(Iu~z+U#vM)ei1hpQ~!h;4t-GFbr0cKY#}?6NUMmhbx+H-_EmB`v;A z2-SBc$2rn6bH!%il$bRCJAQz0nr}jpi>BhHP+qHvrY|Wn^W$d~ql!aVpYQQPEzYG1 zb2Zek049A^%IcQl2n&7g zU*B{0IE$2{!mEks%*f+amkl-b2Jzp7F_scNnu~d1Z1XV6)B$e?TW4EKdKKiYq|aO! zch>JDK2ka$lU4^(L`!!dU$qOubIqedt(qq1ktI$Ris`iiX!`xTaJ|Pw`V|! zQZcFxZQuV1qQr@433V}*(*BnGRk~_w-_j*by03}j9_XS)CWKp&2g@2|evsBkUN#mw zZ)CO2iZ)KL^r36AXJpEM0)E$(|ExR|fauSj)jVHCte;|!27Fyr`tNLZSaanW#*`l~ zZ$Ehg613;l`PU+r;~1VU;R9kOR=XJ}rxm={od{5(Lfp)&2SG6^yLo*tct$3H(GsQb zJV@fyv5L$2rf7LX^|Rk;6up9EMq7v?KArQBss1#?2IKv3TGx|ak$rC@Q&+uUgRi!1 zQBU|!QM=()$v3w)I=NTST6OJ@&ormAzMUuToof)E=>ZaquIFjxjKx@5&p9T%(#oq- z$~rEl%`%!``!NGDowJYt`Khv0v~%B@!5fwm9e26zcdwyHXZi!dRoCPY%iAbRA)cd} zEfwS9`;1j|Z!S=ks;+VQX?4B(XQle$9;616KhVdk4p#%$Fqqt%_w5~$cIZbH@sXrn zw=t*Ca$-JA3NQrSBLBEt%{Gucxv*0{n?R|9%HvL@Biw4-L?4hsL|Ah(c|7R+E@JH2fVwVo^|4y5Q O1IGFmdW|}m*#7}X!NZ~e literal 0 HcmV?d00001 diff --git a/src/ui/images/icons/32x32.png b/src/ui/images/icons/32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..fd4ba9651c1790ad51b87c29ac7419577151e0d8 GIT binary patch literal 939 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jPK-BC>eK@{oCO|{#S9GG z!XV7ZFl&wkP(fILPlzi}lA-ngD57o%$k!On0tReRNswPKgZ_j%L*shglmAz1>8v~S z_0L&#jdLG<-f{J~`|ZtDahaP>ukVpnJkrwtYv-!JPK->x|K?8KFRyy4DZO=4wCTOK z@AE%ru|I#D$;#pVeT5s_t4k+BfBSoVY5OGg%-;FsZtcdN2SK;D3yK}|<4l{K#3PWA z5~ZvW4~*XePZ!6KiaE(C3JenL-Arx@KbqAJp8C=LRo#b?UD@MexJstn1h#Ab2CRSf zOGw<1l)QiNX{+RahSJY_+B5}z^C}{Z1 zD8J0%rKQVqk;k$MD}Q}5Z#n&!ZJEPcLzkBD4{8&xB-AiG)QW4?ys(dbYmDTR#ADI{ z^PXAGV0xTw@I0IOss2HWU+M{5I_v+pNFF?1!KZe9T`|kD1Jgd5_+07vsM4ePkKBg>HBruFFeVWlq@$eP)NEw`QwJWfit{stZmG@%aV9lWQCn* zRriwnZ{I&{*WhZ&EngJ*u<)tbrY41BxdLr1TvrU8re#kMZ86GYyDatQ({=^Mm-Qbk zH#MEO9e%Jx;Xai0W zTjBYaJQ-XPn;Zl!IZvEmSGz8KThc(}0YkGRBg4r{k&074?WzRjDNk2Fmvv4FO#llH BsmK5T literal 0 HcmV?d00001 diff --git a/src/ui/images/icons/48x48.png b/src/ui/images/icons/48x48.png new file mode 100644 index 0000000000000000000000000000000000000000..74d770a400d5406ba9f64ed06a5c6f5a6de6fb28 GIT binary patch literal 1427 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sjKx9jPK-BC>eK@{oCO|{#S9GG z!XV7ZFl&wkP{I2EpAc7|Btz@}Q8YqAV3)h*K46S5EeY}qW?*v*@l;{uGWXSHc7FKh z`5ZZggv0MwC@CKM|L%kn6HC*n@138&O%O5Iee>V%eae^q{s^8XtntfdGvDo(t}PN* zZrCnl=UjHwg;wtI!fE`FB%*wXKs4*%Ers`F+} z{FEZP_roIHoONM|TVBkv68PzTg!|Qg_lu3?Vrs|N@0wx1Gmyjjb)_9o+oS7A57zig zM=bDQy!~}50|Qf!r;B4q#hm061wn(p7~Y`%q#aPaHTEd337}iCH{Qo-$hS~94 z7C2VI;d*Rd;ah*Uwv1!78jE<&btg(Kn)!W!*Ges&lmw3(f8|53)Y|zlJ73}p(PV4= zf4rG>+v2W5+aJu=6RO31nVYZYRhvXNCYo`tbDSX?+syrZ-}(%vx}M7qr8b3aUUZV{ z=6ZK?<&0PLJJ{Gv!(wK#^Bu`+V3u5^IK7Zpk$0i67 zlx`Ytv_ARfa%=evsabM)$5%=57)fRum}Jx)St~a~=(d50$3l%0@6w$gW*?Yj71R7V zbIOC0iF0}uJv@JX{R^`aAE&Sh@!H?`XT}G#JzVmN-{WNO#sycduxY*$W!;vP@gi{! zKfiU`Bqg@Ce|Z++YO5L;ott9}li7RLR*B5msU~mD@wDhhO>Fnd#>PZ1Vf!QLOgB>< z+G@T@dF;7<#q60u!sP=2YcBDG&A-m)muW01`MNRW@;+sct87`a;?MRSp2)m{XO@w; q(Yl|tDN>J{rPyMmIvA9Lm>G_V&oSgSk2nP?J3U?fT-G@yGywoo<%`S! literal 0 HcmV?d00001 diff --git a/src/ui/images/icons/64x64.png b/src/ui/images/icons/64x64.png new file mode 100644 index 0000000000000000000000000000000000000000..0caa05c3bc54ebada0c8b950733b91b4d8060fea GIT binary patch literal 1733 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!7>k44ofvPP)Tsw@I14-?iy0WW zg+Z8+Vb&Z81_mbc0G|+7pd>@<|4}p=0wjfixkP#{Fy-tm3GxeOkai34G?O%UmEvfB z_~-e-HXD9H+m6Hcn^=>7{eQN@iDmbXLzx0uM;5>MeXEX_uilwD6tLw?H3hpmY;Y#F!ttw^T)S- z4PH}!vid^)Uv7!gcmG}&h+j+Cv@SZdWWoC)rL>h#m&IGYIcqr2>%@dlOEq*B)s**7 zbG(tx#VImlwyNd|9<96IPFG&)wa_g*_Tgx!skiTzSL<#vFfhk?x;TbZ%y~Pl+T(Jd z$np1$F$t!IQ|GL)6rHLdzr>?yiGo_ntjAKgs^WNe#$@_VyjpZdFF4FCIMwz9}AtZBTjaJ}@^fd<+4ntQvSsXk>t$nbQx z?E!}GnqCSKi$e?VB)nMsea#kOW~W~-RBz|!#1=Wtlz)7)hcQtve4l zpVA(e_Gr_zhz9dei!%&frCJ+j`I;-S{ncBVwuWIxgv*)PD~{_dSd!9OjNV8)3sX4{lciO()zN@(>d6vq_Mm-PTZqwjW9-LRUukFeK zPOY#V^Wy|~S6mK!wPo{Tm6gx6%~Ps%?#VR7v~D^Y>@$OXW7~1wvzL~OrY~8@EfUOa zX*d7e`F^!WQ?C`@k6tzX$Ly-mM-C-Cmo{Hr@ne%_@w-U2z3)D+&fU Date: Fri, 20 Dec 2024 13:33:28 +0100 Subject: [PATCH 42/67] appimagelint test 1 --- .github/workflows/build-and-release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 972f375..12241f1 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -36,6 +36,14 @@ jobs: - name: Build (arm64) run: npm run build -- --arch arm64 + + - name: Download appimagelint + run: | + wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage + chmod +x appimagelint-x86_64.AppImage + + - name: Check the appimage(s) + run: ./appimagelint-x86_64.AppImage dist/*.AppImage - name: Upload Linux Artifacts uses: actions/upload-artifact@v4 -- 2.39.5 From 04ec30066d1ba5d34bc2a9575b7ad8538dec473b Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:36:57 +0100 Subject: [PATCH 43/67] appimagelint test 2 --- .github/workflows/build-and-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 12241f1..79c1fac 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -37,8 +37,9 @@ jobs: - name: Build (arm64) run: npm run build -- --arch arm64 - - name: Download appimagelint + - name: Download appimagelint and its deps run: | + sudo apt install fuse -y wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage chmod +x appimagelint-x86_64.AppImage -- 2.39.5 From 01e9154a333ff1e3a60e496afb4f96b48595d20d Mon Sep 17 00:00:00 2001 From: Gizzy Date: Fri, 20 Dec 2024 12:37:30 +0000 Subject: [PATCH 44/67] test --- .github/workflows/build-and-release.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 0bb6080..b75566a 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -204,14 +204,14 @@ jobs: sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD sed -i "s/^pkgver=.*$/pkgver=${{ needs.release.outputs.version_tag }}/" ./build/PKGBUILD - - name: Publish AUR package - if: false - uses: KSXGitHub/github-actions-deploy-aur@3.0.1 - with: - pkgname: bskydesktop - pkgbuild: ./build/PKGBUILD - commit_username: ${{ secrets.AUR_USERNAME }} - commit_email: ${{ secrets.AUR_EMAIL }} - ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} - commit_message: New Version - ssh_keyscan_types: rsa,ecdsa,ed25519 +# - name: Publish AUR package +# if: false +# uses: KSXGitHub/github-actions-deploy-aur@3.0.1 +# with: +# pkgname: bskydesktop +# pkgbuild: ./build/PKGBUILD +# commit_username: ${{ secrets.AUR_USERNAME }} +# commit_email: ${{ secrets.AUR_EMAIL }} +# ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} +# commit_message: New Version +# ssh_keyscan_types: rsa,ecdsa,ed25519 -- 2.39.5 From 53bf782ddcc5ad5e0f1e4f5b14162486a7eebf7f Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:43:35 +0100 Subject: [PATCH 45/67] appimagelint test 3 (libfuse) --- .github/workflows/build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 79c1fac..e8b2496 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -39,7 +39,7 @@ jobs: - name: Download appimagelint and its deps run: | - sudo apt install fuse -y + sudo apt install libfuse -y wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage chmod +x appimagelint-x86_64.AppImage -- 2.39.5 From 5539ae2c63075aa305cf035b03cc076a49bb6191 Mon Sep 17 00:00:00 2001 From: Gizzy Date: Fri, 20 Dec 2024 12:43:44 +0000 Subject: [PATCH 46/67] test --- .github/workflows/build-and-release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index b75566a..67dec95 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -197,9 +197,12 @@ jobs: name: checksums path: ./sha256sum.txt + - name: Get app version + id: version + uses: pchynoweth/action-get-npm-version@1.1.1 - name: Extract checksum from sha256sum.txt and change build version run: | - echo releasever + echo ${{ steps.version.outputs.version }} new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt) sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD sed -i "s/^pkgver=.*$/pkgver=${{ needs.release.outputs.version_tag }}/" ./build/PKGBUILD -- 2.39.5 From def3cd312de49c0304d1cdc39e0bcc0663aa800f Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:45:49 +0100 Subject: [PATCH 47/67] libfuse dosent exist ig --- .github/workflows/build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index e8b2496..79c1fac 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -39,7 +39,7 @@ jobs: - name: Download appimagelint and its deps run: | - sudo apt install libfuse -y + sudo apt install fuse -y wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage chmod +x appimagelint-x86_64.AppImage -- 2.39.5 From b68a85ac2ff95b5a6bd591e937edf0ecdcf86bd2 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:50:31 +0100 Subject: [PATCH 48/67] yq test 1 --- .github/workflows/build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 79c1fac..6599088 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -174,7 +174,7 @@ jobs: - name: Merge latest .ymls uses: mikefarah/yq@v4.44.6 with: - cmd: yq eval-all '. as $item ireduce ({}; . * $item )' dist/*/*.yml > merged.yml + cmd: yq eval-all 'select(fileIndex == 0) * select(fileIndex > 0)' dist/*/*.yml > merged.yml - name: Upload Release id: create_release -- 2.39.5 From 9947bfc3dc0fd5e21f2c00c43477322fb1c2f8ab Mon Sep 17 00:00:00 2001 From: Gizzy Date: Fri, 20 Dec 2024 12:52:53 +0000 Subject: [PATCH 49/67] test --- .github/workflows/build-and-release.yml | 139 ++++++++++++------------ 1 file changed, 70 insertions(+), 69 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 67dec95..866d820 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -56,78 +56,78 @@ jobs: name: checksums path: sha256sum.txt - build-windows: - name: Build bsky-desktop (Windows) - runs-on: windows-latest - env: - ext: "exe" - GITHUB_TOKEN: ${{ secrets.GHT }} + # build-windows: + # name: Build bsky-desktop (Windows) + # runs-on: windows-latest + # env: + # ext: "exe" + # GITHUB_TOKEN: ${{ secrets.GHT }} - steps: - - name: Checkout git repo - uses: actions/checkout@v3 + # steps: + # - name: Checkout git repo + # uses: actions/checkout@v3 - - name: Setup node and npm - uses: actions/setup-node@v3 - with: - node-version: 16 + # - name: Setup node and npm + # uses: actions/setup-node@v3 + # with: + # node-version: 16 - - name: Install dependencies - run: npm install + # - name: Install dependencies + # run: npm install - - name: Build (x64) - run: npm run build -- --arch x64 + # - name: Build (x64) + # run: npm run build -- --arch x64 - - name: Build (arm64) - run: npm run build -- --arch arm64 + # - name: Build (arm64) + # run: npm run build -- --arch arm64 - - name: Upload Windows Artifacts - uses: actions/upload-artifact@v4 - id: upload-artifact - with: - name: windows-artifacts - path: | - dist/*.exe - dist/latest*.yml + # - name: Upload Windows Artifacts + # uses: actions/upload-artifact@v4 + # id: upload-artifact + # with: + # name: windows-artifacts + # path: | + # dist/*.exe + # dist/latest*.yml - build-macos: - name: Build bsky-desktop (macOS) - runs-on: macos-latest - env: - ext: "dmg" - GITHUB_TOKEN: ${{ secrets.GHT }} + # build-macos: + # name: Build bsky-desktop (macOS) + # runs-on: macos-latest + # env: + # ext: "dmg" + # GITHUB_TOKEN: ${{ secrets.GHT }} - steps: - - name: Checkout git repo - uses: actions/checkout@v3 + # steps: + # - name: Checkout git repo + # uses: actions/checkout@v3 - - name: Setup node and npm - uses: actions/setup-node@v3 - with: - node-version: 16 + # - name: Setup node and npm + # uses: actions/setup-node@v3 + # with: + # node-version: 16 - - name: Install dependencies - run: npm install + # - name: Install dependencies + # run: npm install - - name: Build (x64) - run: npm run build -- --arch x64 + # - name: Build (x64) + # run: npm run build -- --arch x64 - - name: Build (arm64) - run: npm run build -- --arch arm64 + # - name: Build (arm64) + # run: npm run build -- --arch arm64 - - name: Upload macOS Artifacts - uses: actions/upload-artifact@v4 - id: upload-artifact - with: - name: macos-artifacts - path: | - dist/*.dmg - dist/latest*.yml + # - name: Upload macOS Artifacts + # uses: actions/upload-artifact@v4 + # id: upload-artifact + # with: + # name: macos-artifacts + # path: | + # dist/*.dmg + # dist/latest*.yml release: name: Create Release runs-on: ubuntu-latest - needs: [build-linux, build-windows, build-macos] + needs: [build-linux] outputs: version_tag: ${{ steps.version.outputs.version }} env: @@ -147,17 +147,17 @@ jobs: name: linux-artifacts path: dist/linux - - name: Download Windows Artifacts - uses: actions/download-artifact@v4 - with: - name: windows-artifacts - path: dist/windows + #- name: Download Windows Artifacts + # uses: actions/download-artifact@v4 + # with: + # name: windows-artifacts + # path: dist/windows - - name: Download macOS Artifacts - uses: actions/download-artifact@v4 - with: - name: macos-artifacts - path: dist/macos + #- name: Download macOS Artifacts + # uses: actions/download-artifact@v4 + # with: + # name: macos-artifacts + # path: dist/macos - name: Display structure of downloaded files run: ls -R dist @@ -176,9 +176,9 @@ jobs: generate_release_notes: true files: | dist/linux/*.AppImage - dist/windows/*.exe - dist/macos/*.dmg - dist/combined.yml + # dist/windows/*.exe + # dist/macos/*.dmg + # dist/combined.yml aur: name: Publish to AUR @@ -205,7 +205,8 @@ jobs: echo ${{ steps.version.outputs.version }} new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt) sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD - sed -i "s/^pkgver=.*$/pkgver=${{ needs.release.outputs.version_tag }}/" ./build/PKGBUILD + sed -i "s/^pkgver=.*$/pkgver=${{ steps.version.outputs.version }}/" ./build/PKGBUILD + cat ./build/PKGBUILD # - name: Publish AUR package # if: false -- 2.39.5 From 4ce43bdac3ebd1fbe7891a4c79ed76c4e518955f Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:57:38 +0100 Subject: [PATCH 50/67] yq test 2 --- .github/workflows/build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 6599088..ad51369 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -174,7 +174,7 @@ jobs: - name: Merge latest .ymls uses: mikefarah/yq@v4.44.6 with: - cmd: yq eval-all 'select(fileIndex == 0) * select(fileIndex > 0)' dist/*/*.yml > merged.yml + cmd: yq eval-all '. as $item ireduce ({}; . * $item )' dist/linux/*.yml dist/macos/*.yml dist/windows/*.yml > merged.yml - name: Upload Release id: create_release -- 2.39.5 From 10887b8358162f5e9eaff7f4ac4dfeadc51c2624 Mon Sep 17 00:00:00 2001 From: PlOszukiwacz <87446593+PlOszukiwaczDEV@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:01:43 +0100 Subject: [PATCH 51/67] yq revert --- .github/workflows/build-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index ad51369..6599088 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -174,7 +174,7 @@ jobs: - name: Merge latest .ymls uses: mikefarah/yq@v4.44.6 with: - cmd: yq eval-all '. as $item ireduce ({}; . * $item )' dist/linux/*.yml dist/macos/*.yml dist/windows/*.yml > merged.yml + cmd: yq eval-all 'select(fileIndex == 0) * select(fileIndex > 0)' dist/*/*.yml > merged.yml - name: Upload Release id: create_release -- 2.39.5 From 1232eea297358ac56a218ff0a6303574f357d2c6 Mon Sep 17 00:00:00 2001 From: Gizzy Date: Fri, 20 Dec 2024 13:21:39 +0000 Subject: [PATCH 52/67] remove a.yml --- a.yml | 222 ---------------------------------------------------------- 1 file changed, 222 deletions(-) delete mode 100644 a.yml diff --git a/a.yml b/a.yml deleted file mode 100644 index 1c980ee..0000000 --- a/a.yml +++ /dev/null @@ -1,222 +0,0 @@ -name: Build and Release bsky-desktop - -on: - push: - branches: [$default-branch] - pull_request: - branches: [$default-branch] - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build-linux: - name: Build bsky-desktop (Linux) - runs-on: ubuntu-latest - env: - ext: "AppImage" - GITHUB_TOKEN: ${{ secrets.GHT }} - - steps: - - name: Checkout git repo - uses: actions/checkout@v3 - - - name: Setup node and npm - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install dependencies - run: npm install - - - name: Build (x64) - run: npm run build -- --arch x64 - - - name: Build (arm64) - run: npm run build -- --arch arm64 - - - name: Upload Linux Artifacts - uses: actions/upload-artifact@v4 - id: upload-artifact - with: - name: linux-artifacts - path: | - dist/*.AppImage - dist/latest*.yml - - - name: Generate checksum - run: | - sha256sum dist/*.AppImage > sha256sum.txt - - - name: Upload checksums - uses: actions/upload-artifact@v4 - with: - name: checksums - path: sha256sum.txt - - # build-windows: - # name: Build bsky-desktop (Windows) - # runs-on: windows-latest - # env: - # ext: "exe" - # GITHUB_TOKEN: ${{ secrets.GHT }} - - # steps: - # - name: Checkout git repo - # uses: actions/checkout@v3 - - # - name: Setup node and npm - # uses: actions/setup-node@v3 - # with: - # node-version: 16 - - # - name: Install dependencies - # run: npm install - - # - name: Build (x64) - # run: npm run build -- --arch x64 - - # - name: Build (arm64) - # run: npm run build -- --arch arm64 - - # - name: Upload Windows Artifacts - # uses: actions/upload-artifact@v4 - # id: upload-artifact - # with: - # name: windows-artifacts - # path: | - # dist/*.exe - # dist/latest*.yml - - # build-macos: - # name: Build bsky-desktop (macOS) - # runs-on: macos-latest - # env: - # ext: "dmg" - # GITHUB_TOKEN: ${{ secrets.GHT }} - - # steps: - # - name: Checkout git repo - # uses: actions/checkout@v3 - - # - name: Setup node and npm - # uses: actions/setup-node@v3 - # with: - # node-version: 16 - - # - name: Install dependencies - # run: npm install - - # - name: Build (x64) - # run: npm run build -- --arch x64 - - # - name: Build (arm64) - # run: npm run build -- --arch arm64 - - # - name: Upload macOS Artifacts - # uses: actions/upload-artifact@v4 - # id: upload-artifact - # with: - # name: macos-artifacts - # path: | - # dist/*.dmg - # dist/latest*.yml - - release: - name: Create Release - runs-on: ubuntu-latest - needs: [build-linux] - outputs: - version_tag: ${{ steps.version.outputs.version }} - env: - GITHUB_TOKEN: ${{ secrets.GHT }} - - steps: - - name: Checkout git repo - uses: actions/checkout@v3 - - - name: Get app version - id: version - uses: pchynoweth/action-get-npm-version@1.1.1 - - - name: Download Linux Artifacts - uses: actions/download-artifact@v4 - with: - name: linux-artifacts - path: dist/linux - - #- name: Download Windows Artifacts - # uses: actions/download-artifact@v4 - # with: - # name: windows-artifacts - # path: dist/windows - - #- name: Download macOS Artifacts - # uses: actions/download-artifact@v4 - # with: - # name: macos-artifacts - # path: dist/macos - - - name: Display structure of downloaded files - run: ls -R dist - - - name: Merge latest .ymls - uses: mikefarah/yq@v4.44.6 - with: - cmd: yq ea '. as $item ireduce ({}; . * $item )' dist/*/*.yml > dist/combined.yml - - - name: Upload Release - id: create_release - uses: softprops/action-gh-release@v2.1.0 - with: - tag_name: "v${{ steps.version.outputs.version }}" - name: "bsky-desktop v${{ steps.version.outputs.version }}" - generate_release_notes: true - files: | - dist/linux/*.AppImage - # dist/windows/*.exe - # dist/macos/*.dmg - # dist/combined.yml - - aur: - name: Publish to AUR - runs-on: ubuntu-latest - needs: release - env: - AUR_TOKEN: ${{ secrets.AUR_TOKEN }} - - steps: - - name: Checkout git repo - uses: actions/checkout@v3 - - - name: Download checksums - uses: actions/download-artifact@v4 - with: - name: checksums - path: ./sha256sum.txt - - - name: Get app version - id: version - uses: pchynoweth/action-get-npm-version@1.1.1 - - - name: Extract checksum from sha256sum.txt and change build version - run: | - echo ${{ steps.version.outputs.version }} - new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt) - sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD - sed -i "s/^pkgver=.*$/pkgver=${{ steps.version.outputs.version }}/" ./build/PKGBUILD - cat ./build/PKGBUILD - -# - name: Publish AUR package -# if: false -# uses: KSXGitHub/github-actions-deploy-aur@3.0.1 -# with: -# pkgname: bskydesktop -# pkgbuild: ./build/PKGBUILD -# commit_username: ${{ secrets.AUR_USERNAME }} -# commit_email: ${{ secrets.AUR_EMAIL }} -# ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} -# commit_message: New Version -# ssh_keyscan_types: rsa,ecdsa,ed25519 -- 2.39.5 From 9c4a886799173c254a487e95d0e5d885eed53b03 Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Fri, 20 Dec 2024 08:22:49 -0800 Subject: [PATCH 53/67] Add extension support and work on auto update --- .github/workflows/build-and-release.yml | 52 +++++++++--------- build/PKGBUILD | 2 +- package.json | 2 +- src/app/main.js | 37 ++++++++++++- src/app/utils/auto-update.js | 13 +++-- src/app/utils/loadCRX.js | 73 +++++++++++++++++++++++-- 6 files changed, 139 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 0d2fea9..8d55f71 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -45,6 +45,10 @@ jobs: - name: Check the appimage(s) run: ./appimagelint-x86_64.AppImage dist/*.AppImage + + - name: Generate checksum + run: | + sha256sum dist/*.AppImage > sha256sum.txt - name: Upload Linux Artifacts uses: actions/upload-artifact@v4 @@ -54,16 +58,7 @@ jobs: path: | dist/*.AppImage dist/latest*.yml - - - name: Generate checksum - run: | - sha256sum dist/*.AppImage > sha256sum.txt - - - name: Upload checksums - uses: actions/upload-artifact@v4 - with: - name: checksums - path: sha256sum.txt + sha256sum.txt build-windows: name: Build bsky-desktop (Windows) @@ -89,6 +84,10 @@ jobs: - name: Build (arm64) run: npm run build -- --arch arm64 + + - name: Generate checksum + run: | + sha256sum dist/*.exe > sha256sum.txt - name: Upload Windows Artifacts uses: actions/upload-artifact@v4 @@ -98,6 +97,7 @@ jobs: path: | dist/*.exe dist/latest*.yml + sha256sum.txt build-macos: name: Build bsky-desktop (macOS) @@ -123,6 +123,11 @@ jobs: - name: Build (arm64) run: npm run build -- --arch arm64 + + - name: Generate checksum + run: | + sha256sum dist/*.dmg > sha256sum.txt + # sha256sum dist/*.pkg >> sha256sum.txt - name: Upload macOS Artifacts uses: actions/upload-artifact@v4 @@ -132,6 +137,7 @@ jobs: path: | dist/*.dmg dist/latest*.yml + sha256sum.txt release: name: Create Release @@ -170,11 +176,10 @@ jobs: - name: Display structure of downloaded files run: ls -R dist - - - name: Merge latest .ymls - uses: mikefarah/yq@v4.44.6 - with: - cmd: yq eval-all 'select(fileIndex == 0) * select(fileIndex > 0)' dist/*/*.yml > merged.yml + + - name: Combine checksums + run: | + cat dist/linux/sha256sum.txt dist/windows/sha256sum.txt dist/macos/sha256sum.txt > sha256sums.txt - name: Upload Release id: create_release @@ -187,7 +192,7 @@ jobs: dist/linux/*.AppImage dist/windows/*.exe dist/macos/*.dmg - merged.yml + sha256sums.txt aur: name: Publish to AUR @@ -200,20 +205,17 @@ jobs: - name: Checkout git repo uses: actions/checkout@v3 - - name: Install jq - run: sudo apt-get update && sudo apt-get install jq -y - - - name: Download checksums + - name: Download linux artifacts uses: actions/download-artifact@v4 with: - name: checksums - path: . + name: linux-artifacts + path: dist/linux - name: List downloaded files - run: ls -R + run: ls -R dist - name: Show content of sha256sum.txt - run: cat sha256sum.txt + run: cat dist/linux/sha256sum.txt - name: Get app version id: version @@ -221,7 +223,7 @@ jobs: - name: Extract checksum from sha256sum.txt and change build version run: | - new_checksum=$(awk 'NR==1 { print $1 }' ./sha256sum.txt) + new_checksum=$(awk 'NR==1 { print $1 }' ./dist/linux/sha256sum.txt) sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD sed -i "s/^pkgver=.*$/pkgver=${{ steps.version.outputs.version }}/" ./build/PKGBUILD diff --git a/build/PKGBUILD b/build/PKGBUILD index 615aa2d..fd38975 100644 --- a/build/PKGBUILD +++ b/build/PKGBUILD @@ -70,7 +70,7 @@ package() { [Desktop Entry] Name=Bluesky Desktop Comment=Bluesky Desktop Client -Exec=/usr/bin/bsky-desktop +Exec=/usr/bin/bsky-desktop %u Icon=bsky-desktop Terminal=false Type=Application diff --git a/package.json b/package.json index 2b3b25d..59737f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bsky-desktop", - "version": "1.0.8", + "version": "1.0.9", "description": "A desktop app of bsky.app", "main": "src/app/main.js", "scripts": { diff --git a/src/app/main.js b/src/app/main.js index 2dbad0d..4657989 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -7,7 +7,7 @@ const openAboutWindow = require("./about-window/src/index").default; const badge = require('./badge'); const contextMenu = require('./context-menu'); const autoUpdater = require('./utils/auto-update'); -//const loadCRX = require('./utils/loadCRX'); +const loadCRX = require('./utils/loadCRX'); const log4js = require("log4js"); const path = require("path"); const fs = require("fs"); @@ -36,6 +36,7 @@ global.paths = { temp: path.join(os.tmpdir(), global.appInfo.name), }; global.paths.updateDir = path.join(global.paths.data, 'update'); +global.paths.extensions = path.join(global.paths.data, 'extensions'); // URLs: global.urls = { @@ -119,6 +120,12 @@ if (!fs.existsSync(global.paths.updateDir)) { fs.mkdirSync(global.paths.updateDir, { recursive: true }); }; +// Create extensions directory if it does not exist: +if (!fs.existsSync(global.paths.extensions)) { + logger.info("Creating Extensions Directory"); + fs.mkdirSync(global.paths.extensions, { recursive: true }); +}; + // improve performance on linux? if (process.platform !== "win32" && process.platform !== "darwin") { logger.log("Disabling Hardware Acceleration and Transparent Visuals"); @@ -240,6 +247,34 @@ function createWindow() { // Badge count: (use mainWindow as that shows the badge on the taskbar) new badge(mainWindow, badgeOptions); + // Load extensions (.crx files): + logger.log("Checking for extensions"); + const extensions = fs.readdirSync(global.paths.extensions).filter((file) => file.endsWith('.crx')); + if (extensions.length > 0) { + logger.log(`Unpacking ${extensions.length} extensions and loading them`); + extensions.forEach((extension) => { + loadCRX(path.join(global.paths.extensions, extension)); + }); + } else { + // Check for unpacked extensions: + const unpackedExtensions = fs.readdirSync(global.paths.extensions).filter((file) => fs.lstatSync(path.join(global.paths.extensions, file)).isDirectory()); + + // Check if the directory contains a manifest.json file + unpackedExtensions.forEach((extension) => { + const manifestPath = path.join(global.paths.extensions, extension, 'manifest.json'); + if (fs.existsSync(manifestPath)) { + logger.log(`Loading unpacked extension: ${extension}`); + session.defaultSession.loadExtension(path.join(global.paths.extensions, extension)).then(({ id }) => { + logger.log(`Extension loaded with ID: ${id}`); + }).catch((error) => { + logger.error(`Failed to load extension: ${error}`); + }); + } else { + logger.warn(`Skipping directory ${extension} as it does not contain a manifest.json file`); + }; + }); + }; + logger.log("Main Window Created, Showing splashscreen"); splash.show(); //mainWindow.show(); diff --git a/src/app/utils/auto-update.js b/src/app/utils/auto-update.js index 87f00bb..3fe56ed 100644 --- a/src/app/utils/auto-update.js +++ b/src/app/utils/auto-update.js @@ -107,13 +107,14 @@ function checkForUpdates() { // System is ARM64 (mac-arm64) macArch = 'arm64'; } else { - // System is Intel (mac-x64) - macArch = 'intel'; + // System is x64 (mac-x64) + macArch = 'x64'; } } else { - // macOS 10 is mostly Intel, but some versions are ARM64 - macArch = 'intel'; + // macOS 10 is mostly x64, but some versions are ARM64 + macArch = 'x64'; } + logger.log('System architecture:', macArch); // Check for updates, and if there are updates, download and install them logger.log('Checking for updates (mac)...'); @@ -122,7 +123,7 @@ function checkForUpdates() { const command = `sudo installer -pkg ${pkgPath} -target /`; // Spawn a new shell - const shellProcess = spawn('sh', ['-c', command], { + /*const shellProcess = spawn('sh', ['-c', command], { stdio: 'inherit', // Pipe input/output to/from the shell }); @@ -136,7 +137,7 @@ function checkForUpdates() { } else { console.error(`Shell process exited with code ${code}.`); } - }); + });*/ } else { // macOS versions before 10 are not supported logger.error('macOS versions before 10 are not supported, not updating...'); diff --git a/src/app/utils/loadCRX.js b/src/app/utils/loadCRX.js index c817bf5..b17ec2e 100644 --- a/src/app/utils/loadCRX.js +++ b/src/app/utils/loadCRX.js @@ -3,30 +3,91 @@ const path = require('path'); const { session } = require('electron'); const AdmZip = require('adm-zip'); +/** + * Converts a CRX file buffer to a ZIP buffer. + * @param {Buffer} buf - The CRX file buffer. + * @returns {Buffer} - The ZIP buffer extracted from the CRX file. + */ +function crxToZip(buf) { + function calcLength(a, b, c, d) { + let length = 0; + length += a << 0; + length += b << 8; + length += c << 16; + length += (d << 24) >>> 0; + return length; + } + + // Check if the file is already a ZIP file + if (buf[0] === 80 && buf[1] === 75 && buf[2] === 3 && buf[3] === 4) { + return buf; + } + + // Validate CRX magic number + if (buf[0] !== 67 || buf[1] !== 114 || buf[2] !== 50 || buf[3] !== 52) { + throw new Error('Invalid CRX file: Missing Cr24 magic number'); + } + + const version = buf[4]; + const isV2 = version === 2; + const isV3 = version === 3; + + if ((!isV2 && !isV3) || buf[5] || buf[6] || buf[7]) { + throw new Error('Unsupported CRX format version.'); + } + + if (isV2) { + const publicKeyLength = calcLength(buf[8], buf[9], buf[10], buf[11]); + const signatureLength = calcLength(buf[12], buf[13], buf[14], buf[15]); + const zipStartOffset = 16 + publicKeyLength + signatureLength; + return buf.slice(zipStartOffset); + } + + const headerSize = calcLength(buf[8], buf[9], buf[10], buf[11]); + const zipStartOffset = 12 + headerSize; + return buf.slice(zipStartOffset); +} + /** * Unpacks a .crx file and loads it as an Electron extension. * @param {string} crxPath - Path to the .crx file. * @returns {Promise} - Resolves with the extension ID after loading. */ async function loadCRX(crxPath) { - const outputDir = path.join(__dirname, 'extensions', path.basename(crxPath, '.crx')); + const outputDir = path.join(global.paths.extensions, path.basename(crxPath, '.crx')); // Ensure the output directory exists if (!fs.existsSync(outputDir)) { fs.mkdirSync(outputDir, { recursive: true }); - // Extract the .crx file + // Read the CRX file const crxData = fs.readFileSync(crxPath); - const crxHeaderSize = crxData.readUInt32LE(8); // Extract header size from CRX - const zipData = crxData.slice(crxHeaderSize); - // Save the ZIP content + // Convert CRX to ZIP + const zipData = crxToZip(crxData); + + // Extract ZIP using AdmZip const zip = new AdmZip(zipData); - zip.extractAllTo(outputDir, true); + zip.getEntries().forEach((entry) => { + const fullPath = path.join(outputDir, entry.entryName); + + if (entry.isDirectory) { + fs.mkdirSync(fullPath, { recursive: true }); + } else { + fs.mkdirSync(path.dirname(fullPath), { recursive: true }); + fs.writeFileSync(fullPath, entry.getData()); + } + }); } // Load the unpacked extension into Electron try { + // Check for manifest.json + const manifestPath = path.join(outputDir, 'manifest.json'); + if (!fs.existsSync(manifestPath)) { + throw new Error('Extension is missing manifest.json'); + }; + // Load the extension const { id } = await session.defaultSession.loadExtension(outputDir); console.log(`Extension loaded with ID: ${id}`); return id; -- 2.39.5 From e4ca9882b9be1ad2b189f02390c2e0b60fa90518 Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Fri, 20 Dec 2024 08:26:41 -0800 Subject: [PATCH 54/67] fix macOS sha256 --- .github/workflows/build-and-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 8d55f71..b94d227 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -126,8 +126,8 @@ jobs: - name: Generate checksum run: | - sha256sum dist/*.dmg > sha256sum.txt - # sha256sum dist/*.pkg >> sha256sum.txt + shasum -a 256 dist/*.dmg > sha256sum.txt + # shasum -a 256 dist/*.pkg >> sha256sum.txt - name: Upload macOS Artifacts uses: actions/upload-artifact@v4 -- 2.39.5 From 3d67f6d5aef3ce404947092049a461d398bbf3eb Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Fri, 20 Dec 2024 08:36:27 -0800 Subject: [PATCH 55/67] change sha256 file paths --- .github/workflows/build-and-release.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index b94d227..7c2b685 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -39,7 +39,7 @@ jobs: - name: Download appimagelint and its deps run: | - sudo apt install fuse -y + sudo apt update && sudo apt install fuse -y wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage chmod +x appimagelint-x86_64.AppImage @@ -48,7 +48,7 @@ jobs: - name: Generate checksum run: | - sha256sum dist/*.AppImage > sha256sum.txt + sha256sum dist/*.AppImage > dist/sha256sum.txt - name: Upload Linux Artifacts uses: actions/upload-artifact@v4 @@ -58,7 +58,7 @@ jobs: path: | dist/*.AppImage dist/latest*.yml - sha256sum.txt + dist/sha256sum.txt build-windows: name: Build bsky-desktop (Windows) @@ -87,7 +87,7 @@ jobs: - name: Generate checksum run: | - sha256sum dist/*.exe > sha256sum.txt + sha256sum dist/*.exe > dist/sha256sum.txt - name: Upload Windows Artifacts uses: actions/upload-artifact@v4 @@ -97,7 +97,7 @@ jobs: path: | dist/*.exe dist/latest*.yml - sha256sum.txt + dist/sha256sum.txt build-macos: name: Build bsky-desktop (macOS) @@ -126,8 +126,7 @@ jobs: - name: Generate checksum run: | - shasum -a 256 dist/*.dmg > sha256sum.txt - # shasum -a 256 dist/*.pkg >> sha256sum.txt + shasum -a 256 dist/*.dmg > dist/sha256sum.txt - name: Upload macOS Artifacts uses: actions/upload-artifact@v4 @@ -137,7 +136,7 @@ jobs: path: | dist/*.dmg dist/latest*.yml - sha256sum.txt + dist/sha256sum.txt release: name: Create Release -- 2.39.5 From 685c2dc210626b3aed2bdb611f3e40d93074ea93 Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Fri, 20 Dec 2024 08:48:23 -0800 Subject: [PATCH 56/67] Fix sha256 method in aur build --- build/PKGBUILD | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/PKGBUILD b/build/PKGBUILD index fd38975..867e1c5 100644 --- a/build/PKGBUILD +++ b/build/PKGBUILD @@ -16,14 +16,17 @@ icon_name="bsky-desktop.png" prepare() { latest_tag=$(curl -s "https://api.github.com/repos/oxmc/bsky-desktop/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') + latest_sha256=$(curl -Ls "https://github.com/oxmc/bsky-desktop/releases/download/$latest_tag/sha256sums.txt" | grep "AppImage") echo "Latest release tag: $latest_tag" case "$CARCH" in x86_64) appimage_name="bskyDesktop-${latest_tag:1}-linux-x64.AppImage" + sha256sum=$(echo "$latest_sha256" | grep "x64" | cut -d' ' -f1) ;; aarch64) appimage_name="bskyDesktop-${latest_tag:1}-linux-arm64.AppImage" + sha256sum=$(echo "$latest_sha256" | grep "arm64" | cut -d' ' -f1) ;; *) echo "Unsupported architecture: $CARCH" @@ -36,7 +39,7 @@ prepare() { "$icon_url" ) echo "AppImage source: ${source[0]}" - sha256sums=('SKIP' 'SKIP') + sha256sums=("$sha256sum" 'SKIP') curl -L "${source[0]}" -o "$srcdir/bskyDesktop.appimage" curl -L "${source[1]}" -o "$srcdir/$icon_name" } -- 2.39.5 From dcbbfde4a5f7426435354d57c1b5d30c19c02015 Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:28:49 -0800 Subject: [PATCH 57/67] Reformat build dir --- .github/workflows/build-and-release.yml | 2 +- build/{ => arch-pkg}/.SRCINFO | 0 build/{ => arch-pkg}/PKGBUILD | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename build/{ => arch-pkg}/.SRCINFO (100%) rename build/{ => arch-pkg}/PKGBUILD (100%) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 7c2b685..906914b 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -230,7 +230,7 @@ jobs: uses: KSXGitHub/github-actions-deploy-aur@v3.0.1 with: pkgname: bskydesktop - pkgbuild: ./build/PKGBUILD + pkgbuild: ./build/arch-pkg/PKGBUILD commit_username: ${{ secrets.AUR_USERNAME }} commit_email: ${{ secrets.AUR_EMAIL }} ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} diff --git a/build/.SRCINFO b/build/arch-pkg/.SRCINFO similarity index 100% rename from build/.SRCINFO rename to build/arch-pkg/.SRCINFO diff --git a/build/PKGBUILD b/build/arch-pkg/PKGBUILD similarity index 100% rename from build/PKGBUILD rename to build/arch-pkg/PKGBUILD -- 2.39.5 From 77dcea14cc468b481486076a8984cb72f7add4a1 Mon Sep 17 00:00:00 2001 From: oxmc <67136658+oxmc@users.noreply.github.com> Date: Fri, 27 Dec 2024 14:01:09 -0800 Subject: [PATCH 58/67] Add userStyles support (wip) --- .github/workflows/build-and-release.yml | 4 +- README.md | 43 +++- package-lock.json | 295 ++++++++++++++++++++++- package.json | 30 ++- src/app/main.js | 105 +++++--- src/app/utils/userStyles.js | 210 ++++++++++++++++ src/ui/lib/confetti-1.9.3-browser.min.js | 1 + src/ui/lib/css/stylelint-bundle.min.js | 11 + src/ui/lib/css/stylus-renderer.min.js | 63 +++++ src/ui/preload.js | 6 +- src/ui/rend/register-splash.js | 2 +- src/ui/rend/specialAnimations.js | 109 +++++++++ 12 files changed, 832 insertions(+), 47 deletions(-) create mode 100644 src/app/utils/userStyles.js create mode 100644 src/ui/lib/confetti-1.9.3-browser.min.js create mode 100644 src/ui/lib/css/stylelint-bundle.min.js create mode 100644 src/ui/lib/css/stylus-renderer.min.js create mode 100644 src/ui/rend/specialAnimations.js diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 906914b..d79c399 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -223,8 +223,8 @@ jobs: - name: Extract checksum from sha256sum.txt and change build version run: | new_checksum=$(awk 'NR==1 { print $1 }' ./dist/linux/sha256sum.txt) - sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/PKGBUILD - sed -i "s/^pkgver=.*$/pkgver=${{ steps.version.outputs.version }}/" ./build/PKGBUILD + sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/arch-pkg/PKGBUILD + sed -i "s/^pkgver=.*$/pkgver=${{ steps.version.outputs.version }}/" ./build/arch-pkg/PKGBUILD - name: Publish AUR package uses: KSXGitHub/github-actions-deploy-aur@v3.0.1 diff --git a/README.md b/README.md index 2b898bb..3d2e189 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,44 @@ # Bsky Desktop -Bsky Desktop is an application for Bsky built using Electron. It allows users to manage their Bsky account and feeds from the app instead of the web. \ No newline at end of file +Bsky Desktop is an Electron-based application for Bsky that allows users to manage their accounts and feeds directly from the app, rather than through the web interface. + +### Features: +- Support for user styles (work in progress; currently only LESS preprocessor is supported) +- Compatibility with both Manifest V2 and V3 Chrome extensions, though only a limited set of Chrome extension APIs are supported. For more information, visit: [Electron Extensions API Documentation](https://www.electronjs.org/docs/latest/api/extensions#supported-extensions-apis) + +### Working on: +- Auto updates (for all platforms) + +### Build and release status: +[![Build and Release bsky-desktop](https://github.com/oxmc/bsky-desktop/actions/workflows/build-and-release.yml/badge.svg)](https://github.com/oxmc/bsky-desktop/actions/workflows/build-and-release.yml) + +[![Packaging status](https://repology.org/badge/vertical-allrepos/bskydesktop.svg?columns=4&exclude_unsupported=1)](https://repology.org/project/bskydesktop/versions) + +### Build Instructions for Bsky Desktop + +To build and run Bsky Desktop locally, follow these steps: + +1. **Clone the repository:** + ```sh + git clone https://github.com/oxmc/bsky-desktop.git + cd bsky-desktop + ``` + +2. **Install dependencies:** + ```sh + npm install + ``` + + **(Optional) Run the application locally:** + If you want to test the application locally before building it, use the following command: + ```sh + npm run start + ``` + This step is **not required for building** but is useful if you want to see the app in action during development. + +3. **Build the application:** + To compile the application, run: + ```sh + npm run build + ``` + This will generate the necessary files for the app. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c07489f..e7352bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bsky-desktop", - "version": "1.0.6", + "version": "1.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bsky-desktop", - "version": "1.0.6", + "version": "1.1.0", "license": "AGPL-3.0-only", "dependencies": { "@electron/asar": "^3.2.17", @@ -14,9 +14,11 @@ "adm-zip": "^0.5.12", "axios": "^1.6.8", "electron-window-state": "^5.0.3", + "less": "^4.2.1", "log4js": "^6.9.1", "node-notifier": "^10.0.0", "semver": "^7.6.3", + "usercss-meta": "^0.12.0", "v8-compile-cache": "^2.3.0" }, "devDependencies": { @@ -1324,6 +1326,18 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/copy-anything": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz", + "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", + "license": "MIT", + "dependencies": { + "is-what": "^3.14.1" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -1711,6 +1725,19 @@ "dev": true, "license": "MIT" }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "license": "MIT", + "optional": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", @@ -2265,7 +2292,7 @@ }, "node_modules/iconv-lite": { "version": "0.6.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -2295,6 +2322,19 @@ ], "license": "BSD-3-Clause" }, + "node_modules/image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==", + "license": "MIT", + "optional": true, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/inflight": { "version": "1.0.6", "license": "ISC", @@ -2343,6 +2383,12 @@ "node": ">=8" } }, + "node_modules/is-what": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz", + "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==", + "license": "MIT" + }, "node_modules/is-wsl": { "version": "2.2.0", "license": "MIT", @@ -2522,6 +2568,45 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/less": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/less/-/less-4.2.1.tgz", + "integrity": "sha512-CasaJidTIhWmjcqv0Uj5vccMI7pJgfD9lMkKtlnTHAdJdYK/7l8pM9tumLyJ0zhbD4KJLo/YvTj+xznQd5NBhg==", + "license": "Apache-2.0", + "dependencies": { + "copy-anything": "^2.0.1", + "parse-node-version": "^1.0.1", + "tslib": "^2.3.0" + }, + "bin": { + "lessc": "bin/lessc" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "needle": "^3.1.0", + "source-map": "~0.6.0" + } + }, + "node_modules/less/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "optional": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -2604,6 +2689,30 @@ "node": ">=10" } }, + "node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "license": "MIT", + "optional": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/matcher": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", @@ -2723,6 +2832,23 @@ "version": "2.1.2", "license": "MIT" }, + "node_modules/needle": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-3.3.1.tgz", + "integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.3", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, "node_modules/node-addon-api": { "version": "1.7.2", "dev": true, @@ -2797,6 +2923,15 @@ "dev": true, "license": "BlueOak-1.0.0" }, + "node_modules/parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "license": "MIT", @@ -2842,6 +2977,16 @@ "version": "1.2.0", "license": "MIT" }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/plist": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz", @@ -2894,6 +3039,13 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "license": "MIT" }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "license": "MIT", + "optional": true + }, "node_modules/pump": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", @@ -3063,7 +3215,7 @@ }, "node_modules/safer-buffer": { "version": "2.1.2", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/sanitize-filename": { @@ -3080,7 +3232,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/semver": { @@ -3189,7 +3341,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, + "devOptional": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -3466,6 +3618,12 @@ "utf8-byte-length": "^1.0.1" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, "node_modules/type-fest": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", @@ -3517,6 +3675,15 @@ "punycode": "^2.1.0" } }, + "node_modules/usercss-meta": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/usercss-meta/-/usercss-meta-0.12.0.tgz", + "integrity": "sha512-zKrXCKdpeIwtVe87omxGo9URf+7mbozduMZEg79dmT4KB3XJwfIkEi/Uk0PcTwR/nZLtAK1+k7isgbGB/g6E7Q==", + "license": "MIT", + "engines": { + "node": ">=8.3" + } + }, "node_modules/utf8-byte-length": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", @@ -4647,6 +4814,14 @@ } } }, + "copy-anything": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz", + "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", + "requires": { + "is-what": "^3.14.1" + } + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -4914,6 +5089,15 @@ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", "dev": true }, + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "optional": true, + "requires": { + "prr": "~1.0.1" + } + }, "es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", @@ -5289,7 +5473,7 @@ }, "iconv-lite": { "version": "0.6.3", - "dev": true, + "devOptional": true, "requires": { "safer-buffer": ">= 2.1.2 < 3.0.0" } @@ -5300,6 +5484,12 @@ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true }, + "image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==", + "optional": true + }, "inflight": { "version": "1.0.6", "requires": { @@ -5328,6 +5518,11 @@ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, + "is-what": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz", + "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==" + }, "is-wsl": { "version": "2.2.0", "requires": { @@ -5462,6 +5657,31 @@ } } }, + "less": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/less/-/less-4.2.1.tgz", + "integrity": "sha512-CasaJidTIhWmjcqv0Uj5vccMI7pJgfD9lMkKtlnTHAdJdYK/7l8pM9tumLyJ0zhbD4KJLo/YvTj+xznQd5NBhg==", + "requires": { + "copy-anything": "^2.0.1", + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "needle": "^3.1.0", + "parse-node-version": "^1.0.1", + "source-map": "~0.6.0", + "tslib": "^2.3.0" + }, + "dependencies": { + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "optional": true + } + } + }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -5527,6 +5747,24 @@ "yallist": "^4.0.0" } }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "optional": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "optional": true + } + } + }, "matcher": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", @@ -5605,6 +5843,16 @@ "ms": { "version": "2.1.2" }, + "needle": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-3.3.1.tgz", + "integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==", + "optional": true, + "requires": { + "iconv-lite": "^0.6.3", + "sax": "^1.2.4" + } + }, "node-addon-api": { "version": "1.7.2", "dev": true, @@ -5656,6 +5904,11 @@ "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "dev": true }, + "parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==" + }, "path-is-absolute": { "version": "1.0.1" }, @@ -5686,6 +5939,12 @@ "pend": { "version": "1.2.0" }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "optional": true + }, "plist": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz", @@ -5724,6 +5983,12 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "optional": true + }, "pump": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", @@ -5851,7 +6116,7 @@ }, "safer-buffer": { "version": "2.1.2", - "dev": true + "devOptional": true }, "sanitize-filename": { "version": "1.6.3", @@ -5866,7 +6131,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", - "dev": true + "devOptional": true }, "semver": { "version": "7.6.3", @@ -5938,7 +6203,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "devOptional": true }, "source-map-support": { "version": "0.5.21", @@ -6135,6 +6400,11 @@ "utf8-byte-length": "^1.0.1" } }, + "tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + }, "type-fest": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", @@ -6167,6 +6437,11 @@ "punycode": "^2.1.0" } }, + "usercss-meta": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/usercss-meta/-/usercss-meta-0.12.0.tgz", + "integrity": "sha512-zKrXCKdpeIwtVe87omxGo9URf+7mbozduMZEg79dmT4KB3XJwfIkEi/Uk0PcTwR/nZLtAK1+k7isgbGB/g6E7Q==" + }, "utf8-byte-length": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", diff --git a/package.json b/package.json index 59737f7..a7fc33a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bsky-desktop", - "version": "1.0.9", + "version": "1.1.0", "description": "A desktop app of bsky.app", "main": "src/app/main.js", "scripts": { @@ -14,6 +14,20 @@ "name": "oxmc", "email": "oxmc7769.mail@gmail.com" }, + "contributors": [ + { + "name": "oxmc", + "email": "contact@oxmc.is-a.dev" + }, + { + "name": "PlOszukiwaczDEV", + "email": "ploszukiwacz1@duck.com" + }, + { + "name": "GizzyUwU", + "email": "me@gizzy.pro" + } + ], "license": "AGPL-3.0-only", "devDependencies": { "electron": "^29.4.6", @@ -25,9 +39,11 @@ "adm-zip": "^0.5.12", "axios": "^1.6.8", "electron-window-state": "^5.0.3", + "less": "^4.2.1", "log4js": "^6.9.1", "node-notifier": "^10.0.0", "semver": "^7.6.3", + "usercss-meta": "^0.12.0", "v8-compile-cache": "^2.3.0" }, "build": { @@ -42,9 +58,19 @@ "dmg", "pkg" ], - "icon": "src/ui/images/logo.icns", + "icon": "build/icons/mac-icon.icns", "category": "Network" }, + "pkg": { + "scripts": "build/mac-pkg/scripts", + "installLocation": "/Applications", + "allowAnywhere": true, + "allowCurrentUserHome": true, + "allowRootDirectory": true, + "isVersionChecked": true, + "isRelocatable": false, + "overwriteAction": "upgrade" + }, "linux": { "target": [ "appimage" diff --git a/src/app/main.js b/src/app/main.js index 4657989..6c78c05 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -8,6 +8,7 @@ const badge = require('./badge'); const contextMenu = require('./context-menu'); const autoUpdater = require('./utils/auto-update'); const loadCRX = require('./utils/loadCRX'); +const userStyles = require('./utils/userStyles'); const log4js = require("log4js"); const path = require("path"); const fs = require("fs"); @@ -37,6 +38,7 @@ global.paths = { }; global.paths.updateDir = path.join(global.paths.data, 'update'); global.paths.extensions = path.join(global.paths.data, 'extensions'); +global.paths.userstyles = path.join(global.paths.data, 'userstyles'); // URLs: global.urls = { @@ -126,6 +128,12 @@ if (!fs.existsSync(global.paths.extensions)) { fs.mkdirSync(global.paths.extensions, { recursive: true }); }; +// Create userstyles directory if it does not exist: +if (!fs.existsSync(global.paths.userstyles)) { + logger.info("Creating Userstyles Directory"); + fs.mkdirSync(global.paths.userstyles, { recursive: true }); +}; + // improve performance on linux? if (process.platform !== "win32" && process.platform !== "darwin") { logger.log("Disabling Hardware Acceleration and Transparent Visuals"); @@ -247,34 +255,6 @@ function createWindow() { // Badge count: (use mainWindow as that shows the badge on the taskbar) new badge(mainWindow, badgeOptions); - // Load extensions (.crx files): - logger.log("Checking for extensions"); - const extensions = fs.readdirSync(global.paths.extensions).filter((file) => file.endsWith('.crx')); - if (extensions.length > 0) { - logger.log(`Unpacking ${extensions.length} extensions and loading them`); - extensions.forEach((extension) => { - loadCRX(path.join(global.paths.extensions, extension)); - }); - } else { - // Check for unpacked extensions: - const unpackedExtensions = fs.readdirSync(global.paths.extensions).filter((file) => fs.lstatSync(path.join(global.paths.extensions, file)).isDirectory()); - - // Check if the directory contains a manifest.json file - unpackedExtensions.forEach((extension) => { - const manifestPath = path.join(global.paths.extensions, extension, 'manifest.json'); - if (fs.existsSync(manifestPath)) { - logger.log(`Loading unpacked extension: ${extension}`); - session.defaultSession.loadExtension(path.join(global.paths.extensions, extension)).then(({ id }) => { - logger.log(`Extension loaded with ID: ${id}`); - }).catch((error) => { - logger.error(`Failed to load extension: ${error}`); - }); - } else { - logger.warn(`Skipping directory ${extension} as it does not contain a manifest.json file`); - }; - }); - }; - logger.log("Main Window Created, Showing splashscreen"); splash.show(); //mainWindow.show(); @@ -302,7 +282,7 @@ function createWindow() { }; }); PageView.webContents.setWindowOpenHandler(({ url }) => { - new BrowserWindow({ show: true, autoHideMenuBar: true }).loadURL(url); + new BrowserWindow({ show: true, autoHideMenuBar: true, icon: path.join(global.paths.app, 'ui', 'images', 'logo.png') }).loadURL(url); return { action: 'deny' }; }); // Log PageView navigations: @@ -322,6 +302,7 @@ function showAboutWindow() { //open_devtools: process.env.NODE_ENV !== 'production', use_version_info: [ ['Application Version', `${global.appInfo.version}`], + ['Contributors', packageJson.contributors.map((contributor) => contributor.name).join(', ')], ], license: `MIT, GPL-2.0, GPL-3.0, ${global.appInfo.license}`, }); @@ -405,7 +386,7 @@ function handleDeeplink(commandLine) { break; case "notiftest": - global.PageView.webContents.send('ui:notif', { title: 'Updater', message: 'Update downloaded', options: { position: 'topRight', timeout: 5000, layout: 2, color: 'blue' } }); + global.PageView.webContents.send('ui:notif', { title: 'Updater', message: 'Update downloaded', options: { izitoast: { position: 'topRight', timeout: 5000, layout: 2, color: 'blue' } } }); break; default: @@ -527,6 +508,70 @@ app.whenReady().then(() => { createWindow(); createTray(); + + // Load extensions (.crx files): + logger.log("Checking for extensions"); + const extensions = fs.readdirSync(global.paths.extensions).filter((file) => file.endsWith('.crx')); + if (extensions.length > 0) { + logger.log(`Unpacking ${extensions.length} extensions and loading them`); + extensions.forEach((extension) => { + loadCRX(path.join(global.paths.extensions, extension)); + }); + } else { + // Check for unpacked extensions: + const unpackedExtensions = fs.readdirSync(global.paths.extensions).filter((file) => fs.lstatSync(path.join(global.paths.extensions, file)).isDirectory()); + + // Check if the directory contains a manifest.json file + unpackedExtensions.forEach((extension) => { + const manifestPath = path.join(global.paths.extensions, extension, 'manifest.json'); + if (fs.existsSync(manifestPath)) { + logger.log(`Loading unpacked extension: ${extension}`); + session.defaultSession.loadExtension(path.join(global.paths.extensions, extension)).then(({ id }) => { + logger.log(`Extension loaded with ID: ${id}`); + }).catch((error) => { + logger.error(`Failed to load extension: ${error}`); + }); + } else { + logger.warn(`Skipping directory ${extension} as it does not contain a manifest.json file`); + }; + }); + }; + + // Load userstyles + logger.log("Checking for userstyles"); + const userStylesDir = path.join(global.paths.userstyles); + if (fs.existsSync(userStylesDir)) { + const files = fs.readdirSync(userStylesDir); + if (files.length > 0) { + const userStylePromises = files.map(async file => { + const cssFile = path.join(userStylesDir, file); + // Parse the CSS file + try { + const cssContent = fs.readFileSync(cssFile, 'utf-8'); + const result = await userStyles.parseCSS(cssContent); + + logger.info(`Loaded userstyle: ${result.metadata.name}`); + + // Compile the userstyle + const compiled = await userStyles.compileStyle(result.css, result.metadata); + + // Check if the site 'bsky.app' is defined + if (compiled.sites && compiled.sites['bsky.app']) { + // Apply the userstyle to the PageView + await PageView.webContents.insertCSS(compiled.sites['bsky.app']); + + logger.info(`Applied userstyle: ${result.metadata.name}`); + } else { + logger.warn(`Userstyle ${result.metadata.name} does not target 'bsky.app'`); + } + } catch (error) { + logger.error(`Error loading userstyle: ${file}`, error); + } + }); + + Promise.all(userStylePromises); + } + } } else { logger.log("Failed to get singleInstanceLock, Quitting"); app.quit(); diff --git a/src/app/utils/userStyles.js b/src/app/utils/userStyles.js new file mode 100644 index 0000000..b99ae1e --- /dev/null +++ b/src/app/utils/userStyles.js @@ -0,0 +1,210 @@ +const usercssMeta = require('usercss-meta'); +const less = require('less'); + +/** + * Extracts all global variable and mixin definitions from CSS. + * @param {string} css - The CSS string. + * @returns {string} The extracted global definitions. + */ +function extractGlobalDefinitions(css) { + const globalDefinitionRegex = /(@[\w-]+\s*(?:{[^}]*}|;))/g; + return (css.match(globalDefinitionRegex) || []).join('\n'); +} + +/** + * Extracts variable definitions from metadata. + * @param {object} metadata - Metadata containing variable definitions. + * @returns {object} A map of variable names to their default values. + */ +function extractMetadataVars(metadata) { + if (!metadata?.vars) return {}; + return Object.fromEntries( + Object.entries(metadata.vars).map(([key, value]) => [key, value.default || value.value || null]) + ); +} + +/** + * Extracts content enclosed within matching braces starting from a given position. + * @param {string} css - The CSS string. + * @param {number} startPos - The starting position to search for braces. + * @returns {object|null} The content and ending position of the matched braces. + */ +function extractBracedContent(css, startPos) { + const braceMatch = matchBraces(css, startPos); + if (!braceMatch) return null; + + return { + content: css.substring(braceMatch.start + 1, braceMatch.end - 1).trim(), + end: braceMatch.end, + }; +} + +/** + * Matches a pair of braces in a string starting from a given position. + * @param {string} content - The string content. + * @param {number} start - The starting position to search for braces. + * @returns {object|null} The start and end positions of the matched braces. + */ +function matchBraces(content, start) { + const openBrace = content.indexOf('{', start); + if (openBrace === -1) return null; + + let braceCount = 1, pos = openBrace + 1; + while (braceCount > 0 && pos < content.length) { + if (content[pos] === '{') braceCount++; + if (content[pos] === '}') braceCount--; + pos++; + } + + return braceCount === 0 ? { start: openBrace, end: pos } : null; +} + +/** + * Parses domain rules from the provided CSS string. + * @param {string} css - The CSS string. + * @param {number} startPos - The starting position to search for domain rules. + * @returns {object|null} The domains and the rule start position. + */ +function parseDomainRule(css, startPos) { + const domainRuleRegex = /@-moz-document\s+domain\(\s*'([^']+)'(?:\s*,\s*'([^']+)')*\s*\)/g; + domainRuleRegex.lastIndex = startPos; + const match = domainRuleRegex.exec(css); + if (!match) return null; + + const domains = match[0] + .match(/'[^']+'/g) // Extract all single-quoted domain values + .map(domain => domain.replace(/'/g, '').trim()); + + return { + domains, + ruleStart: match.index + match[0].length - 1, + }; +} + +/** + * Parses @-moz-document rules and extracts domain-specific CSS. + * @param {string} css - The CSS string. + * @returns {object} A map of domains to their associated CSS. + */ +function parseMozRules(css) { + const rules = {}; + let currentPos = 0; + + const globalCode = extractGlobalDefinitions(css); + + while (true) { + const domainRule = parseDomainRule(css, currentPos); + if (!domainRule) break; + + const bracedContent = extractBracedContent(css, domainRule.ruleStart); + if (!bracedContent) break; + + // Add the CSS to all matched domains + for (const domain of domainRule.domains) { + rules[domain] = `${globalCode}\n${bracedContent.content}`; + } + + currentPos = bracedContent.end; + } + + return rules; +} + +/** + * Parses metadata from the provided CSS string. + * @param {string} css - The CSS string. + * @returns {object} Parsed metadata. + */ +function parseCSS(css) { + try { + const normalizedCss = css.replace(/\r\n?/g, '\n'); + const nocommentsCss = normalizedCss.replace(/\/\*[\s\S]*?\*\//g, ''); // Remove comments + return { + ...usercssMeta.parse(normalizedCss), + css: nocommentsCss, + }; + } catch (error) { + throw new Error(`Failed to parse CSS metadata: ${error.message}`); + } +} + +/** + * Compiles CSS code with a preprocessor if specified in the metadata. + * @param {string} code - The CSS code. + * @param {object} metadata - Metadata containing preprocessor information. + * @param {object} [userVars={}] - User-defined variables to override defaults. + * @returns {Promise<{compiledCss: string, sites: object}>} The compiled CSS code and domain-specific mapping. + */ +async function compileStyle(code, metadata, userVars = {}) { + try { + // Extract and merge variables + const vars = { + ...extractMetadataVars(metadata), + ...userVars + }; + + // Generate full code with user variables + const fullCode = [ + '// User variables', + Object.entries(vars).map(([key, value]) => `@${key}: ${value};`).join('\n'), + '// Main code', + code + ].join('\n\n'); + + let compiledCode; + + switch (metadata?.preprocessor?.toLowerCase()) { + case 'less': + compiledCode = await compileLess(fullCode); + break; + default: + compiledCode = code; // Return unmodified for unknown preprocessors + } + + // Parse domain rules + const domainRules = parseMozRules(compiledCode); + + // Compile each domain's CSS if needed + const compiledRules = {}; + for (const [domain, css] of Object.entries(domainRules)) { + if (metadata.preprocessor === 'less') { + compiledRules[domain] = await compileLess(css, vars); + } else { + compiledRules[domain] = css; + } + } + + // Combine all CSS + const combinedCss = Object.entries(compiledRules) + .map(([domain, compiledCss]) => `/* ${domain} */\n${compiledCss}`) + .join('\n\n'); + + return { + compiledCss: combinedCss, + sites: compiledRules // Map of domains to their CSS + }; + + } catch (error) { + console.error('Style compilation error:', error); + throw error; + } +} + +/** + * Compiles LESS code to CSS. + * @param {string} code - The LESS code. + * @returns {Promise} The compiled CSS. + */ +async function compileLess(code) { + const { css } = await less.render(code, { + math: 'parens-division', + javascriptEnabled: true, + compress: false + }); + return css; +} + +module.exports = { + parseCSS, + compileStyle +}; \ No newline at end of file diff --git a/src/ui/lib/confetti-1.9.3-browser.min.js b/src/ui/lib/confetti-1.9.3-browser.min.js new file mode 100644 index 0000000..4a87c5c --- /dev/null +++ b/src/ui/lib/confetti-1.9.3-browser.min.js @@ -0,0 +1 @@ +!function(t,e){!function t(e,a,n,r){var o=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),i="function"==typeof Path2D&&"function"==typeof DOMMatrix,l=function(){if(!e.OffscreenCanvas)return!1;var t=new OffscreenCanvas(1,1),a=t.getContext("2d");a.fillRect(0,0,1,1);var n=t.transferToImageBitmap();try{a.createPattern(n,"no-repeat")}catch(t){return!1}return!0}();function s(){}function c(t){var n=a.exports.Promise,r=void 0!==n?n:e.Promise;return"function"==typeof r?new r(t):(t(s,s),null)}var h,f,u,d,m,g,p,b,M,v,y,w=(h=l,f=new Map,{transform:function(t){if(h)return t;if(f.has(t))return f.get(t);var e=new OffscreenCanvas(t.width,t.height);return e.getContext("2d").drawImage(t,0,0),f.set(t,e),e},clear:function(){f.clear()}}),x=(m=Math.floor(1e3/60),g={},p=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(u=function(t){var e=Math.random();return g[e]=requestAnimationFrame((function a(n){p===n||p+m-1"warning"===e.type))}get content(){return this.css}}t.default=t;var n="(".charCodeAt(0),r=")".charCodeAt(0),o="'".charCodeAt(0),i='"'.charCodeAt(0),s="\\".charCodeAt(0),a="/".charCodeAt(0),l=",".charCodeAt(0),c=":".charCodeAt(0),u="*".charCodeAt(0),d="u".charCodeAt(0),p="U".charCodeAt(0),h="+".charCodeAt(0),f=/^[a-f0-9?-]+$/i;var m=function e(t,n,r){var o,i,s,a;for(o=0,i=t.length;o + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ +function C(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e){var t,n;return!1!==C(e)&&(void 0===(t=e.constructor)||!1!==C(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}function A(e){return"boolean"==typeof e||e instanceof Boolean}function z(e){return"number"==typeof e||e instanceof Number}function E(e){return null!==e&&"object"==typeof e}function N(e){return e instanceof RegExp}function P(e){return"string"==typeof e||e instanceof String}function T(e){return O(e)}function I(e,t){t?console.assert(e,t):console.assert(e)}function j(e){console.assert(z(e),'"'.concat(e,'" must be a number'))}function L(e){console.assert(P(e),'"'.concat(e,'" must be a string'))}function M(e){const t=e.raws,n=t.prop;return[E(n)&&"prefix"in n&&n.prefix,E(n)&&"raw"in n&&n.raw||e.prop,E(n)&&"suffix"in n&&n.suffix,t.between||":",t.value&&"prefix"in t.value&&t.value.prefix].reduce(((e,t)=>P(t)?e+t.length:e),0)}function _(e){const t=e.raws;return t.value&&t.value.raw||e.value}S.prototype.toString=function(){return Array.isArray(this.nodes)?b(this.nodes):""},S.prototype.walk=function(e,t){return m(this.nodes,e,t),this},S.unit=function(e){var t,n,r,o=0,i=e.length;if(0===i||!function(e){var t,n=e.charCodeAt(0);if(n===y||n===w){if((t=e.charCodeAt(1))>=48&&t<=57)return!0;var r=e.charCodeAt(2);return t===v&&r>=48&&r<=57}return n===v?(t=e.charCodeAt(1))>=48&&t<=57:n>=48&&n<=57}(e))return!1;for((t=e.charCodeAt(o))!==y&&t!==w||o++;o57);)o+=1;if(t=e.charCodeAt(o),n=e.charCodeAt(o+1),t===v&&n>=48&&n<=57)for(o+=2;o57);)o+=1;if(t=e.charCodeAt(o),n=e.charCodeAt(o+1),r=e.charCodeAt(o+2),(t===k||t===x)&&(n>=48&&n<=57||(n===y||n===w)&&r>=48&&r<=57))for(o+=n===y||n===w?3:2;o57);)o+=1;return{number:e.slice(0,o),unit:e.slice(o)}},S.walk=m,S.stringify=b;const R=/@\{.+?\}/;function F(e){return R.test(e)}const D=/\$\(.+?\)/;function U(e){return D.test(e)}const q=/#\{[\s\S]+?\}/;function W(e){return q.test(e)}const B=/\{[\s\S]+?\}/;function $(e){return B.test(e)}function Q(e){return!!(F(e)||W(e)||$(e)||U(e))}function V(e){let t=e;return/^[-+*/]/.test(e.charAt(0))&&(t=t.slice(1)),!t.startsWith("$")&&(!/^.+\.\$/.test(e)&&(!/^.+\.[-\w]+\(/.test(e)&&(!t.startsWith("@")&&(!Q(t)&&!/__MSG_\S+__/.test(e)))))}function G(e,t){if(!Array.isArray(e))return Y(e,t);for(const n of e){const e=Y(n,t);if(e)return e}return!1}function Y(e,t){if(!Array.isArray(t))return K(e,t);for(const n of t){const t=K(e,n);if(t)return t}return!1}function J(e,t){var n;const r=e.match(t);return!!r&&{match:e,pattern:t,substring:null!==(n=r[0])&&void 0!==n?n:""}}function K(e,t){if(t instanceof RegExp)return J(e,t);if(t.startsWith("/")&&(t.endsWith("/")||t.endsWith("/".concat("i")))){const n=J(e,t.endsWith("i")?new RegExp(t.slice(1,-2),"i"):new RegExp(t.slice(1,-1)));return n&&(n.pattern=t),n}return e===t&&{match:e,pattern:t,substring:e}}function H(e,t,n){return Boolean(e&&e[t]&&"string"==typeof n&&G(n,e[t]))}function X(e){var t,n;const{ruleName:r,result:o,message:i,messageArgs:s,line:a,node:l,index:c,endIndex:u,word:d,severity:p}=e;o.stylelint=o.stylelint||{ruleSeverities:{},customMessages:{},ruleMetadata:{}};const h=p||(null===(t=o.stylelint.ruleSeverities)||void 0===t?void 0:t[r]),f=(null===(n=o.stylelint.config)||void 0===n?void 0:n.defaultSeverity)||"error",m="function"==typeof h?h(...s||[])||f:h;if(o.stylelint.quiet&&"error"!==m)return;const{start:g}=l&&l.rangeBy({index:c,endIndex:u})||{},b=a||g&&g.line;if(!b)throw new Error('The "'.concat(r,'" rule failed to pass either a node or a line number to the `report()` function.'));const{ignoreDisables:w}=o.stylelint.config||{};if(o.stylelint.disabledRanges){const e=o.stylelint.disabledRanges[r]||o.stylelint.disabledRanges.all||[];for(const t of e)if(t.start<=b&&(void 0===t.end||t.end>=b)&&(!t.rules||t.rules.includes(r))){if((o.stylelint.disabledWarnings||(o.stylelint.disabledWarnings=[])).push({rule:r,line:b}),!w)return;break}}o.stylelint.stylelintError||"error"!==m||(o.stylelint.stylelintError=!0),o.stylelint.stylelintWarning||"warning"!==m||(o.stylelint.stylelintWarning=!0);const y={severity:m,rule:r};l&&(y.node=l),e.start?y.start=e.start:"number"==typeof c&&(y.index=c),e.end?y.end=e.end:"number"==typeof u&&(y.endIndex=u),d&&(y.word=d);const{customMessages:v}=o.stylelint,k=function(e,t){const n=t||[];if("string"==typeof e)return function(e,...t){return t.reduce(((e,t)=>e.replace(/%[ds]/,String(t))),e)}(e,...n);return e(...n)}(v&&v[r]||i,s);o.warn(k,y)}function Z(e,t){const n={};for(const[r,o]of Object.entries(t))n[r]="string"==typeof o?"".concat(o," (").concat(e,")"):(...t)=>"".concat(o(...t)," (").concat(e,")");return n}function ee(e,t){const n=e.raws;return n.value?n.value.raw=t:e.value=t,e}function te(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every(((e,n)=>e===t[n])))}const ne=new Set(["severity","message","reportDisables","disableFix"]);function re(e,t,...n){let r=!0;for(const e of n)oe(e,t,o);function o(t){r=!1,e.warn(t,{stylelintType:"invalidOption"}),e.stylelint=e.stylelint||{disabledRanges:{},ruleSeverities:{},customMessages:{},ruleMetadata:{}},e.stylelint.stylelintError=!0}return r}function oe({possible:e,actual:t,optional:n},r,o){if(!1===t&&!r.startsWith("report"))return o('Invalid option value "false" for rule "'.concat(r,'". Are you trying to disable this rule? If so use "null" instead'));if(null===t||te(t,[null]))return;const i=null==e||Array.isArray(e)&&0===e.length||T(e)&&0===Object.keys(e).length;if(!i||!0!==t)if(void 0!==t){if(i)return n?void o('Incorrect configuration for rule "'.concat(r,'". Rule should have "possible" values for options validation')):void o("Unexpected option value ".concat(se(t),' for rule "').concat(r,'"'));if("function"!=typeof e)if(Array.isArray(e))for(const n of[t].flat())ie(e,n)||o("Invalid option value ".concat(se(n),' for rule "').concat(r,'"'));else if(T(t)&&"object"==typeof t&&null!==t)for(const[n,i]of Object.entries(t)){if(ne.has(n))continue;const t=e&&e[n];if(t)for(const e of[i].flat())ie(t,e)||o("Invalid value ".concat(se(e),' for option "').concat(n,'" of rule "').concat(r,'"'));else o('Invalid option name "'.concat(n,'" for rule "').concat(r,'"'))}else o("Invalid option value ".concat(se(t),' for rule "').concat(r,'": should be an object'));else e(t)||o("Invalid option ".concat(se(t),' for rule "').concat(r,'"'))}else{if(i||n)return;o('Expected option value for rule "'.concat(r,'"'))}}function ie(e,t){for(const n of[e].flat()){if("function"==typeof n&&n(t))return!0;if(t===n)return!0}return!1}function se(e){return'"'.concat("string"==typeof e?e:JSON.stringify(e),'"')}const ae="alpha-value-notation",le=Z(ae,{expected:(e,t)=>'Expected "'.concat(e,'" to be "').concat(t,'"')}),ce=/^(?:opacity|shape-image-threshold|fill-opacity|flood-opacity|stop-opacity|stroke-opacity)$/i,ue=/(?:color|hsla?|rgba?|hwb|lab|lch|oklab|oklch)\(/i,de=/^(?:color|hsla?|rgba?|hwb|lab|lch|oklab|oklch)$/i,pe=/\d/,he=(e,t,n)=>(r,o)=>{if(!re(o,ae,{actual:e,possible:["number","percentage"]},{actual:t,possible:{exceptProperties:[P,N]},optional:!0}))return;const i=Object.freeze({number:{expFunc:be,fixFunc:me},percentage:{expFunc:ge,fixFunc:fe}});r.walkDecls((r=>{const s=_(r),a=ce.test(r.prop);if(!a&&!ue.test(s)||!pe.test(s))return;let l=!1;const c=S(s);c.walk((s=>{let c;if(a&&pe.test(s.value)?c=function(e){return"word"===e.type||"function"===e.type?e:void 0}(s):"function"===s.type&&de.test(s.value)&&(c=function(e){const t=e.nodes.some((({type:e,value:t})=>"div"===e&&","===t));if(t){const t=e.nodes.filter((({type:e})=>"word"===e||"function"===e));return 4===t.length?t[3]:void 0}const n=e.nodes.findIndex((({type:e,value:t})=>"div"===e&&"/"===t));if(-1!==n){return e.nodes.slice(n+1,e.nodes.length).find((({type:e})=>"word"===e))}return}(s)),!c)return;const{value:u}=c;if(!V(u))return;if(!be(u)&&!ge(u))return;let d=e;if(H(t,"exceptProperties",r.prop)&&("number"===d?d="percentage":"percentage"===d&&(d="number")),i[d].expFunc(u))return;const p=i[d].fixFunc(u),h=u;if(n.fix)return c.value=String(p),void(l=!0);const f=M(r)+c.sourceIndex,m=f+c.value.length;X({message:le.expected,messageArgs:[h,p],node:r,index:f,endIndex:m,result:o,ruleName:ae})})),l&&ee(r,c.toString())}))};function fe(e){const t=Number(e);return"".concat(Number((100*t).toPrecision(3)),"%")}function me(e){const t=S.unit(e);I(t);const n=Number(t.number);return Number((n/100).toPrecision(3)).toString()}function ge(e){const t=S.unit(e);return t&&"%"===t.unit}function be(e){const t=S.unit(e);return t&&""===t.unit}he.ruleName=ae,he.messages=le,he.meta={url:"https://stylelint.io/user-guide/rules/alpha-value-notation",fixable:!0};const we="annotation-no-unknown",ye=Z(we,{rejected:e=>'Unexpected unknown annotation "'.concat(e,'"')}),ve=(e,t)=>(n,r)=>{re(r,we,{actual:e},{actual:t,possible:{ignoreAnnotations:[P,N]},optional:!0})&&n.walkDecls((function(e){if(!V(e.value))return;if(e.important)return;if(!e.value.includes("!"))return;S(_(e)).walk((n=>{if(!function(e){return"word"===e.type&&e.value.startsWith("!")}(n))return;const o=n.value,i=o.slice(1);H(t,"ignoreAnnotations",i)||X({message:ye.rejected,messageArgs:[o],node:e,result:r,ruleName:we,word:o})}))}))};function ke(e){return!(!e.nodes&&""===e.params)&&((!("mixin"in e)||!e.mixin)&&!("variable"in e&&e.variable||!e.nodes&&""===e.raws.afterName&&"("===e.params[0]))}ve.ruleName=we,ve.messages=ye,ve.meta={url:"https://stylelint.io/user-guide/rules/annotation-no-unknown"};var xe={prefix(e){const t=e.match(/^(-\w+-)/);return t&&t[0]||""},unprefixed:e=>e.replace(/^-\w+-/,"")};const Se="at-rule-allowed-list",Ce=Z(Se,{rejected:e=>'Unexpected at-rule "'.concat(e,'"')}),Oe=e=>(t,n)=>{if(!re(n,Se,{actual:e,possible:[P]}))return;const r=[e].flat();t.walkAtRules((e=>{const t=e.name;ke(e)&&(r.includes(xe.unprefixed(t).toLowerCase())||X({message:Ce.rejected,messageArgs:[t],node:e,result:n,ruleName:Se,word:"@".concat(t)}))}))};Oe.primaryOptionArray=!0,Oe.ruleName=Se,Oe.messages=Ce,Oe.meta={url:"https://stylelint.io/user-guide/rules/at-rule-allowed-list"};const Ae="at-rule-disallowed-list",ze=Z(Ae,{rejected:e=>'Unexpected at-rule "'.concat(e,'"')}),Ee=e=>(t,n)=>{if(!re(n,Ae,{actual:e,possible:[P]}))return;const r=[e].flat();t.walkAtRules((e=>{const t=e.name;ke(e)&&r.includes(xe.unprefixed(t).toLowerCase())&&X({message:ze.rejected,messageArgs:[t],node:e,result:n,ruleName:Ae,word:"@".concat(e.name)})}))};function Ne(e,t){const{raws:n}=e;return"string"!=typeof n.before||(n.before=/\r?\n/.test(n.before)?n.before.replace(/(\r?\n)/,"".concat(t,"$1")):t.repeat(2)+n.before),e}function Pe(e){return e.source&&e.source.start&&e.source.start.line}function Te(e){if(void 0===e)return;const t=e.prev();if(!t||"comment"!==t.type)return t;if(Pe(e)===Pe(t))return Te(t);const n=t.prev();return n&&Pe(t)===Pe(n)?Te(t):t}Ee.primaryOptionArray=!0,Ee.ruleName=Ae,Ee.messages=ze,Ee.meta={url:"https://stylelint.io/user-guide/rules/at-rule-disallowed-list"};const Ie=/\n[\r\t ]*\n/;function je(e){return""!==e&&void 0!==e&&Ie.test(e)}function Le(e){return"root"===e.type}function Me(e){return"rule"===e.type}function _e(e){return"atrule"===e.type}function Re(e){return"comment"===e.type}function Fe(e){return"decl"===e.type}function De(e){return"function"===e.type}function Ue(e){return"space"===e.type}function qe({type:e}){return"word"===e}function We(e){return Boolean(e.source)}function Be(e){return e&&e.source&&e.source.start&&e.source.start.line}function $e(e){if(void 0===e)return;const t=e.next();return t&&"comment"===t.type&&(Be(e)===Be(t)||Be(t)===Be(t.next()))?$e(t):t}function Qe(e,t){return(e&&e.source&&e.source.end&&e.source.end.line)===(t&&t.source&&t.source.start&&t.source.start.line)}function Ve(e){if(!Re(e))return!1;if(Qe(Te(e),e))return!0;const t=$e(e);if(t&&Qe(e,t))return!0;const n=e.parent;return void 0!==n&&!Le(n)&&0===n.index(e)&&void 0!==e.raws.before&&!e.raws.before.includes("\n")}function Ge(e){const t=e.prev();return!(!t||"comment"!==t.type)&&!Ve(t)}function Ye(e){return void 0!==e.nodes}function Je(e){if("atrule"!==e.type)return!1;const t=Te(e);return void 0!==t&&(_e(t)&&!Ye(t)&&!Ye(e))}function Ke(e){if(!Je(e))return!1;const t=Te(e);return!(!t||!_e(t))&&t.name===e.name}function He(e){const t=e.parent;if(void 0===t)return!1;if(Le(t)&&!function({parent:e}){return Boolean(e&&(t=e,"document"===t.type));var t}(t))return!1;if(e===t.first)return!0;const n=t.nodes;if(!n)return!1;const r=n[0];if(!r)return!1;if(!Re(r)||"string"==typeof r.raws.before&&r.raws.before.includes("\n"))return!1;if(!We(r)||!r.source.start)return!1;const o=r.source.start.line;if(!r.source.end||o!==r.source.end.line)return!1;for(const[t,r]of n.entries())if(0!==t){if(r===e)return!0;if(!Re(r)||We(r)&&r.source.end&&r.source.end.line!==o)return!1}return!1}function Xe(e){if(Le(e))return!1;const t=e.parent;return!!t&&(Le(t)&&e===t.first)}function Ze(e,t){return e.raws.before=e.raws.before?e.raws.before.replace(/(\r?\n\s*\n)+/g,t):"",e}const et="at-rule-empty-line-before",tt=Z(et,{expected:"Expected empty line before at-rule",rejected:"Unexpected empty line before at-rule"}),nt=(e,t,n)=>(r,o)=>{if(!re(o,et,{actual:e,possible:["always","never"]},{actual:t,possible:{except:["after-same-name","inside-block","blockless-after-same-name-blockless","blockless-after-blockless","first-nested"],ignore:["after-comment","first-nested","inside-block","blockless-after-same-name-blockless","blockless-after-blockless"],ignoreAtRules:[P]},optional:!0}))return;const i=e;r.walkAtRules((e=>{const r=e.parent&&"root"!==e.parent.type;if(Xe(e))return;if(!ke(e))return;if(H(t,"ignoreAtRules",e.name))return;if(H(t,"ignore","blockless-after-blockless")&&Je(e))return;if(H(t,"ignore","first-nested")&&He(e))return;if(H(t,"ignore","blockless-after-same-name-blockless")&&Ke(e))return;if(H(t,"ignore","inside-block")&&r)return;if(H(t,"ignore","after-comment")&&Ge(e))return;const s=je(e.raws.before);let a="always"===i;if((H(t,"except","after-same-name")&&function(e){const t=Te(e);return t&&_e(t)&&t.name===e.name}(e)||H(t,"except","inside-block")&&r||H(t,"except","first-nested")&&He(e)||H(t,"except","blockless-after-blockless")&&Je(e)||H(t,"except","blockless-after-same-name-blockless")&&Ke(e))&&(a=!a),a===s)return;if(n.fix&&n.newline)return void(a?Ne(e,n.newline):Ze(e,n.newline));X({message:a?tt.expected:tt.rejected,node:e,result:o,ruleName:et})}))};function rt(...e){return new Set([...e].reduce(((e,t)=>[...e,...t]),[]))}nt.ruleName=et,nt.messages=tt,nt.meta={url:"https://stylelint.io/user-guide/rules/at-rule-empty-line-before",fixable:!0};const ot=new Set(["container","layer","media","scope","starting-style","supports"]),it=new Set(["top-left-corner","top-left","top-center","top-right","top-right-corner","bottom-left-corner","bottom-left","bottom-center","bottom-right","bottom-right-corner","left-top","left-middle","left-bottom","right-top","right-middle","right-bottom"]),st=rt(ot,it,["annotation","apply","character-variant","charset","counter-style","custom-media","custom-selector","document","font-face","font-feature-values","import","keyframes","namespace","nest","ornaments","page","property","scroll-timeline","styleset","stylistic","swash","viewport"]),at="at-rule-no-unknown",lt=Z(at,{rejected:e=>'Unexpected unknown at-rule "'.concat(e,'"')}),ct=(e,t)=>(n,r)=>{re(r,at,{actual:e},{actual:t,possible:{ignoreAtRules:[P,N]},optional:!0})&&n.walkAtRules((e=>{if(!ke(e))return;const n=e.name;if(H(t,"ignoreAtRules",e.name))return;if(xe.prefix(n)||st.has(n.toLowerCase()))return;const o="@".concat(n);X({message:lt.rejected,messageArgs:[o],node:e,ruleName:at,result:r,word:o})}))};ct.ruleName=at,ct.messages=lt,ct.meta={url:"https://stylelint.io/user-guide/rules/at-rule-no-unknown"};const ut=new Set(["@-khtml-keyframes","@-moz-keyframes","@-ms-keyframes","@-ms-viewport","@-o-keyframes","@-o-viewport","@-webkit-keyframes","@resolution"]),dt=new Set([":-moz-any-link",":-moz-full-screen",":-moz-placeholder",":-moz-placeholder-shown",":-moz-read-only",":-moz-read-write",":-ms-fullscreen",":-ms-input-placeholder",":-webkit-any-link",":-webkit-full-screen","::-moz-placeholder","::-moz-selection","::-ms-input-placeholder","::-webkit-backdrop","::-webkit-input-placeholder"]),pt=new Set(["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","backdrop-filter","backface-visibility","background-clip","background-origin","background-size","border-block-end","border-block-start","border-bottom-left-radius","border-bottom-right-radius","border-image","border-inline-end","border-inline-start","border-radius","border-top-left-radius","border-top-right-radius","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","clip-path","color-adjust","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","flow-from","flow-into","font-feature-settings","font-kerning","font-language-override","font-variant-ligatures","grid-area","grid-column","grid-column-align","grid-column-end","grid-column-start","grid-row","grid-row-align","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hyphens","image-rendering","justify-content","margin-block-end","margin-block-start","margin-inline-end","margin-inline-start","mask","mask-border","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-origin","mask-position","mask-repeat","mask-size","object-fit","object-position","order","overscroll-behavior","padding-block-end","padding-block-start","padding-inline-end","padding-inline-start","perspective","perspective-origin","place-self","region-fragment","scroll-snap-coordinate","scroll-snap-destination","scroll-snap-points-x","scroll-snap-points-y","scroll-snap-type","shape-image-threshold","shape-margin","shape-outside","tab-size","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-orientation","text-overflow","text-size-adjust","text-spacing","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","user-select","writing-mode"]),ht=new Set(["-moz-all","-moz-calc","-moz-crisp-edges","-moz-element","-moz-fit-content","-moz-grab","-moz-grabbing","-moz-initial","-moz-isolate","-moz-isolate-override","-moz-linear-gradient","-moz-max-content","-moz-min-content","-moz-pre-wrap","-moz-plaintext","-moz-radial-gradient","-moz-repeating-linear-gradient","-moz-repeating-radial-gradient","-moz-zoom-in","-moz-zoom-out","-ms-flexbox","-ms-grid","-ms-inline-grid","-ms-linear-gradient","-ms-radial-gradient","-ms-repeating-linear-gradient","-ms-repeating-radial-gradient","-o-crisp-edges","-o-linear-gradient","-o-pre-wrap","-o-radial-gradient","-o-repeating-linear-gradient","-o-repeating-radial-gradient","-webkit-calc","-webkit-cross-fade","-webkit-filter","-webkit-fit-content","-webkit-flex","-webkit-grab","-webkit-grabbing","-webkit-image-set","-webkit-inline-flex","-webkit-isolate","-webkit-linear-gradient","-webkit-max-content","-webkit-min-content","-webkit-plaintext","-webkit-radial-gradient","-webkit-repeating-linear-gradient","-webkit-repeating-radial-gradient","-webkit-sticky","-webkit-zoom-in","-webkit-zoom-out","-xv-digits","-xv-literal-punctuation","-xv-no-punctuation","-moz-arabic-indic","-moz-bengali","-moz-cjk-earthly-branch","-moz-cjk-heavenly-stem","-moz-devanagari","-moz-ethiopic-numeric","-moz-gujarati","-moz-gurmukhi","-moz-hangul","-moz-hangul-consonant","-moz-japanese-formal","-moz-japanese-informal","-moz-kannada","-moz-khmer","-moz-lao","-moz-malayalam","-moz-myanmar","-moz-oriya","-moz-persian","-moz-simp-chinese-formal","-moz-simp-chinese-informal","-moz-tamil","-moz-telugu","-moz-thai","-moz-trad-chinese-formal","-moz-trad-chinese-informal"]);var ft={atRuleName:e=>ut.has("@".concat(e.toLowerCase())),selector:e=>dt.has(e.toLowerCase()),mediaFeatureName:e=>e.toLowerCase().includes("device-pixel-ratio"),property(e){const t=e.toLowerCase();return"-ms-interpolation-mode"===t||0!==xe.prefix(t).length&&pt.has(xe.unprefixed(t))},propertyValue:e=>ht.has(e.toLowerCase()),unprefix:e=>e.replace(/-\w+-/,"")};const mt="at-rule-no-vendor-prefix",gt=Z(mt,{rejected:e=>'Unexpected vendor-prefixed at-rule "@'.concat(e,'"')}),bt=(e,t,n)=>(t,r)=>{re(r,mt,{actual:e})&&t.walkAtRules((e=>{if(!ke(e))return;const t=e.name;t.startsWith("-")&&ft.atRuleName(t)&&(n.fix?e.name=ft.unprefix(e.name):X({message:gt.rejected,messageArgs:[t],node:e,word:"@".concat(t),result:r,ruleName:mt}))}))};function wt(...e){return t=>!!T(t)&&Object.values(t).flat().every((t=>e.some((e=>e(t)))))}bt.ruleName=mt,bt.messages=gt,bt.meta={url:"https://stylelint.io/user-guide/rules/at-rule-no-vendor-prefix",fixable:!0};const yt="at-rule-property-required-list",vt=Z(yt,{expected:(e,t)=>'Expected property "'.concat(t,'" for at-rule "').concat(e,'"')}),kt=e=>(t,n)=>{if(!re(n,yt,{actual:e,possible:[wt(P)]}))return;const r=function(e){const t=new Map;for(const[n,r]of Object.entries(e)){const e=Array.isArray(r)?r:[r];t.set(n,new Set(e))}return t}(e),o=new Set;t.walkAtRules((e=>{if(!ke(e))return;const{name:t,nodes:i}=e;if(!i)return;const s=t.toLowerCase(),a=r.get(s);if(a){o.clear();for(const e of i){if(!e||"decl"!==e.type)continue;const t=e.prop.toLowerCase();a.has(t)&&o.add(t)}if(o.size!==a.size)for(const t of a)o.has(t)||X({message:vt.expected,messageArgs:[s,t],node:e,word:"@".concat(e.name),result:n,ruleName:yt})}}))};function xt(e,{noRawBefore:t}={noRawBefore:!1}){let n="";const r=e.raws.before||"";if(t||(n+=r),Me(e))n+=e.selector;else{if(!_e(e))return"";n+="@".concat(e.name).concat(e.raws.afterName||"").concat(e.params)}return n+=e.raws.between||"",n}kt.ruleName=yt,kt.messages=vt,kt.meta={url:"https://stylelint.io/user-guide/rules/at-rule-property-required-list"};const St="-disable",Ct="-disable-line",Ot="-disable-next-line",At="-enable",zt=new Set([St,Ct,Ot,At]),Et="stylelint";function Nt(e,t="stylelint"){const[n]=e.text.split(/\s/,1);return L(n),n.replace(t,"")}function Pt(e,t="stylelint"){const n=Nt(e,t);return void 0!==n&&zt.has(n)}const Tt="block-no-empty",It=Z(Tt,{rejected:"Unexpected empty block"}),jt=(e,t,n)=>(r,o)=>{if(!re(o,Tt,{actual:e,possible:A},{actual:t,possible:{ignore:["comments"]},optional:!0}))return;const i=H(t,"ignore","comments");function s(e){if(!Ye(e))return;if(function(e){var t;return(null!==(t=e.nodes)&&void 0!==t?t:[]).some((e=>{if(Re(e)){if(i)return!1;if(Pt(e,n.configurationComment))return!1}return!0}))}(e))return;if(function(e){const{after:t}=e.raws;return"string"==typeof t&&/\S/.test(t)}(e))return;let t=xt(e,{noRawBefore:!0}).length;void 0===e.raws.between&&t--,X({message:It.rejected,node:e,start:e.positionBy({index:t}),result:o,ruleName:Tt})}r.walkRules(s),r.walkAtRules(s)};function Lt(e){return!!e.value&&(!e.value.startsWith("#{")&&(!e.value.startsWith("${")&&!e.value.startsWith("`")))}function Mt(e){if(!Lt(e))return!1;for(const t of e.nodes){if("function"===t.type)return Mt(t);if("word"===t.type&&(t.value.startsWith("#")||t.value.startsWith("$")||t.value.includes(".$")))return!1}return!0}jt.ruleName=Tt,jt.messages=It,jt.meta={url:"https://stylelint.io/user-guide/rules/block-no-empty"};const _t="color-function-notation",Rt=Z(_t,{expected:e=>"Expected ".concat(e," color-function notation")}),Ft=/^(?:rgba|hsla)$/i,Dt=/\b(?:rgba?|hsla?)\(/i,Ut=/^(?:rgba?|hsla?)$/i,qt=(e,t,n)=>(r,o)=>{if(!re(o,_t,{actual:e,possible:["modern","legacy"]},{actual:t,possible:{ignore:["with-var-inside"]},optional:!0}))return;const i=H(t,"ignore","with-var-inside");r.walkDecls((t=>{if(!Dt.test(t.value))return;if("modern"===e&&!t.value.includes(","))return;let r=!1;const s=S(_(t));s.walk((s=>{if(!De(s))return;if(!Mt(s))return;const{value:a,sourceIndex:l,sourceEndIndex:c,nodes:u}=s;if(i&&function(e){return e.some((({type:e,value:t})=>"function"===e&&"var"===t.toLowerCase()))}(u))return;if(!Ut.test(a))return;if("modern"===e&&!$t(s))return;if("legacy"===e&&$t(s))return;if(n.fix&&"modern"===e){let e=0;return s.nodes=u.map((t=>(Bt(t)&&(e<2?(t.type="space",t.value=Wt(t.after),e++):(t.value="/",t.before=Wt(t.before),t.after=Wt(t.after))),t))),Ft.test(a)&&(s.value=a.slice(0,-1)),void(r=!0)}const d=M(t)+l,p=d+(c-l);X({message:Rt.expected,messageArgs:[e],node:t,index:d,endIndex:p,result:o,ruleName:_t})})),r&&ee(t,s.toString())}))};function Wt(e){return""!==e?e:" "}function Bt(e){return"div"===e.type&&","===e.value}function $t(e){return e.nodes&&e.nodes.some((e=>Bt(e)))}qt.ruleName=_t,qt.messages=Rt,qt.meta={url:"https://stylelint.io/user-guide/rules/color-function-notation",fixable:!0};const Qt=/#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})(?:$|[^\da-f])/i;function Vt(e){return Qt.test(e)}const Gt=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function Yt(e){return Gt.test(e)}function Jt({type:e,value:t}){return"word"===e&&Yt(t)}const Kt="color-hex-alpha",Ht=Z(Kt,{expected:e=>'Expected alpha channel in "'.concat(e,'"'),unexpected:e=>'Unexpected alpha channel in "'.concat(e,'"')}),Xt=e=>(t,n)=>{re(n,Kt,{actual:e,possible:["always","never"]})&&t.walkDecls((t=>{if(!Vt(t.value))return;S(t.value).walk((r=>{if(function({type:e,value:t}){return"function"===e&&"url"===t}(r))return!1;if(!Jt(r))return;const{value:o}=r;if("always"===e&&Zt(o))return;if("never"===e&&!Zt(o))return;const i=M(t)+r.sourceIndex,s=i+o.length;X({message:"never"===e?Ht.unexpected:Ht.expected,messageArgs:[o],node:t,index:i,endIndex:s,result:n,ruleName:Kt})}))}))};function Zt(e){return 5===e.length||9===e.length}Xt.ruleName=Kt,Xt.messages=Ht,Xt.meta={url:"https://stylelint.io/user-guide/rules/color-hex-alpha"};const en=new Set(["url"]);function tn({type:e,value:t}){return"function"===e&&en.has(t.toLowerCase())}const nn="color-hex-length",rn=Z(nn,{expected:(e,t)=>'Expected "'.concat(e,'" to be "').concat(t,'"')}),on=/#[\da-z]+/i,sn=(e,t,n)=>(t,r)=>{re(r,nn,{actual:e,possible:["short","long"]})&&t.walkDecls((t=>{if(!on.test(t.value))return;const o=S(_(t));let i=!1;o.walk((o=>{const{value:s}=o;if(tn(o))return!1;if(!Jt(o))return;if("long"===e&&4!==s.length&&5!==s.length)return;if("short"===e&&(s.length<6||!function(e){return(e=e.toLowerCase())[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]&&(7===e.length||9===e.length&&e[7]===e[8])}(s)))return;const a=("long"===e?ln:an)(s);if(n.fix)return o.value=a,void(i=!0);const l=M(t)+o.sourceIndex,c=l+o.value.length;X({message:rn.expected,messageArgs:[s,a],node:t,index:l,endIndex:c,result:r,ruleName:nn})})),i&&ee(t,o.toString())}))};function an(e){let t="#";for(let n=1;n=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var yn={grad:.9,turn:360,rad:360/(2*Math.PI)},vn=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},kn=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},xn=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Sn=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Cn=function(e){return{r:xn(e.r,0,255),g:xn(e.g,0,255),b:xn(e.b,0,255),a:xn(e.a)}},On=function(e){return{r:kn(e.r),g:kn(e.g),b:kn(e.b),a:kn(e.a,3)}},An=/^#([0-9a-f]{3,8})$/i,zn=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},En=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:i?s/i*100:0,v:i/255*100,a:o}},Nn=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:o}},Pn=function(e){return{h:Sn(e.h),s:xn(e.s,0,100),l:xn(e.l,0,100),a:xn(e.a)}},Tn=function(e){return{h:kn(e.h),s:kn(e.s),l:kn(e.l),a:kn(e.a,3)}},In=function(e){return Nn((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},jn=function(e){return{h:(t=En(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},Ln=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Mn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_n=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Rn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Fn={string:[[function(e){var t=An.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?kn(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?kn(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=_n.exec(e)||Rn.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Cn({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Ln.exec(e)||Mn.exec(e);if(!t)return null;var n,r,o=Pn({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(yn[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return In(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=void 0===o?1:o;return vn(t)&&vn(n)&&vn(r)?Cn({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=void 0===o?1:o;if(!vn(t)||!vn(n)||!vn(r))return null;var s=Pn({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return In(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=void 0===o?1:o;if(!vn(t)||!vn(n)||!vn(r))return null;var s=function(e){return{h:Sn(e.h),s:xn(e.s,0,100),v:xn(e.v,0,100),a:xn(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return Nn(s)},"hsv"]]},Dn=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=On(this.rgba)).r,n=e.g,r=e.b,i=(o=e.a)<1?zn(kn(255*o)):"","#"+zn(t)+zn(n)+zn(r)+i;var e,t,n,r,o,i},e.prototype.toRgb=function(){return On(this.rgba)},e.prototype.toRgbString=function(){return t=(e=On(this.rgba)).r,n=e.g,r=e.b,(o=e.a)<1?"rgba("+t+", "+n+", "+r+", "+o+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,o},e.prototype.toHsl=function(){return Tn(jn(this.rgba))},e.prototype.toHslString=function(){return t=(e=Tn(jn(this.rgba))).h,n=e.s,r=e.l,(o=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+o+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,o},e.prototype.toHsv=function(){return e=En(this.rgba),{h:kn(e.h),s:kn(e.s),v:kn(e.v),a:kn(e.a,3)};var e},e.prototype.invert=function(){return $n({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),$n(Un(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),$n(Un(this.rgba,-e))},e.prototype.grayscale=function(){return $n(Un(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),$n(Wn(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),$n(Wn(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?$n({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):kn(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=jn(this.rgba);return"number"==typeof e?$n({h:e,s:t.s,l:t.l,a:t.a}):kn(t.h)},e.prototype.isEqual=function(e){return this.toHex()===$n(e).toHex()},e}(),$n=function(e){return e instanceof Bn?e:new Bn(e)},Qn=[];var Vn={grad:.9,turn:360,rad:360/(2*Math.PI)},Gn=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Yn=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Jn=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Kn=function(e){return{h:(t=e.h,(t=isFinite(t)?t%360:0)>0?t:t+360),w:Jn(e.w,0,100),b:Jn(e.b,0,100),a:Jn(e.a)};var t},Hn=function(e){return{h:Yn(e.h),w:Yn(e.w),b:Yn(e.b),a:Yn(e.a,3)}},Xn=function(e){return{h:function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:i?s/i*100:0,v:i/255*100,a:o}}(e).h,w:Math.min(e.r,e.g,e.b)/255*100,b:100-Math.max(e.r,e.g,e.b)/255*100,a:e.a}},Zn=function(e){return function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:o}}({h:e.h,s:100===e.b?0:100-e.w/(100-e.b)*100,v:100-e.b,a:e.a})},er=function(e){var t=e.h,n=e.w,r=e.b,o=e.a,i=void 0===o?1:o;if(!Gn(t)||!Gn(n)||!Gn(r))return null;var s=Kn({h:Number(t),w:Number(n),b:Number(r),a:Number(i)});return Zn(s)},tr=/^hwb\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,nr=function(e){var t=tr.exec(e);if(!t)return null;var n,r,o=Kn({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(Vn[r]||1)),w:Number(t[3]),b:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Zn(o)};var rr=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},or=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},ir=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},sr=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},ar=function(e){return 255*(e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e)},lr=96.422,cr=82.521,ur=216/24389,dr=24389/27,pr=function(e){var t=e.l,n=e.a,r=e.b,o=e.alpha,i=void 0===o?1:o;if(!rr(t)||!rr(n)||!rr(r))return null;var s=function(e){return{l:ir(e.l,0,400),a:e.a,b:e.b,alpha:ir(e.alpha)}}({l:Number(t),a:Number(n),b:Number(r),alpha:Number(i)});return hr(s)},hr=function(e){var t=(e.l+16)/116,n=e.a/500+t,r=t-e.b/200;return function(e){var t,n,r=.9555766*(t=e).x+-.0230393*t.y+.0631636*t.z,o=-.0282895*t.x+1.0099416*t.y+.0210077*t.z,i=.0122982*t.x+-.020483*t.y+1.3299098*t.z;return n={r:ar(.032404542*r-.015371385*o-.004985314*i),g:ar(-.00969266*r+.018760108*o+41556e-8*i),b:ar(556434e-9*r-.002040259*o+.010572252*i),a:e.a},{r:ir(n.r,0,255),g:ir(n.g,0,255),b:ir(n.b,0,255),a:ir(n.a)}}({x:(Math.pow(n,3)>ur?Math.pow(n,3):(116*n-16)/dr)*lr,y:100*(e.l>8?Math.pow((e.l+16)/116,3):e.l/dr),z:(Math.pow(r,3)>ur?Math.pow(r,3):(116*r-16)/dr)*cr,a:e.alpha})};var fr={grad:.9,turn:360,rad:360/(2*Math.PI)},mr=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},gr=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},br=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},wr=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},yr=function(e){return 255*(e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e)},vr=96.422,kr=82.521,xr=216/24389,Sr=24389/27,Cr=function(e){return{l:br(e.l,0,100),c:e.c,h:(t=e.h,(t=isFinite(t)?t%360:0)>0?t:t+360),a:e.a};var t},Or=function(e){return{l:gr(e.l,2),c:gr(e.c,2),h:gr(e.h,2),a:gr(e.a,3)}},Ar=function(e){var t=e.l,n=e.c,r=e.h,o=e.a,i=void 0===o?1:o;if(!mr(t)||!mr(n)||!mr(r))return null;var s=Cr({l:Number(t),c:Number(n),h:Number(r),a:Number(i)});return Er(s)},zr=function(e){var t=function(e){var t=function(e){var t=wr(e.r),n=wr(e.g),r=wr(e.b);return function(e){return{x:br(e.x,0,vr),y:br(e.y,0,100),z:br(e.z,0,kr),a:br(e.a)}}(function(e){return{x:1.0478112*e.x+.0228866*e.y+-.050127*e.z,y:.0295424*e.x+.9904844*e.y+-.0170491*e.z,z:-.0092345*e.x+.0150436*e.y+.7521316*e.z,a:e.a}}({x:100*(.4124564*t+.3575761*n+.1804375*r),y:100*(.2126729*t+.7151522*n+.072175*r),z:100*(.0193339*t+.119192*n+.9503041*r),a:e.a}))}(e),n=t.x/vr,r=t.y/100,o=t.z/kr;return n=n>xr?Math.cbrt(n):(Sr*n+16)/116,{l:116*(r=r>xr?Math.cbrt(r):(Sr*r+16)/116)-16,a:500*(n-r),b:200*(r-(o=o>xr?Math.cbrt(o):(Sr*o+16)/116)),alpha:t.a}}(e),n=gr(t.a,3),r=gr(t.b,3),o=Math.atan2(r,n)/Math.PI*180;return{l:t.l,c:Math.sqrt(n*n+r*r),h:o<0?o+360:o,a:t.alpha}},Er=function(e){return r=(t={l:e.l,a:e.c*Math.cos(e.h*Math.PI/180),b:e.c*Math.sin(e.h*Math.PI/180),alpha:e.a}).a/500+(n=(t.l+16)/116),o=n-t.b/200,function(e){var t,n,r=.9555766*(t=e).x+-.0230393*t.y+.0631636*t.z,o=-.0282895*t.x+1.0099416*t.y+.0210077*t.z,i=.0122982*t.x+-.020483*t.y+1.3299098*t.z;return n={r:yr(.032404542*r-.015371385*o-.004985314*i),g:yr(-.00969266*r+.018760108*o+41556e-8*i),b:yr(556434e-9*r-.002040259*o+.010572252*i),a:e.a},{r:br(n.r,0,255),g:br(n.g,0,255),b:br(n.b,0,255),a:br(n.a)}}({x:(Math.pow(r,3)>xr?Math.pow(r,3):(116*r-16)/Sr)*vr,y:100*(t.l>8?Math.pow((t.l+16)/116,3):t.l/Sr),z:(Math.pow(o,3)>xr?Math.pow(o,3):(116*o-16)/Sr)*kr,a:t.alpha});var t,n,r,o},Nr=/^lch\(\s*([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Pr=function(e){var t=Nr.exec(e);if(!t)return null;var n,r,o=Cr({l:Number(t[1]),c:Number(t[2]),h:(n=t[3],r=t[4],void 0===r&&(r="deg"),Number(n)*(fr[r]||1)),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Er(o)};!function(e){e.forEach((function(e){Qn.indexOf(e)<0&&(e(Bn,Fn),Qn.push(e))}))}([function(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,s,a=r[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!i.length)for(var d in n)i[d]=new e(n[d]).toRgb();for(var p in n){var h=(o=l,s=i[p],Math.pow(o.r-s.r,2)+Math.pow(o.g-s.g,2)+Math.pow(o.b-s.b,2));hur?Math.cbrt(n):(dr*n+16)/116,e={l:116*(r=r>ur?Math.cbrt(r):(dr*r+16)/116)-16,a:500*(n-r),b:200*(r-(o=o>ur?Math.cbrt(o):(dr*o+16)/116)),alpha:t.a},{l:or(e.l,2),a:or(e.a,2),b:or(e.b,2),alpha:or(e.alpha,3)};var e,t,n,r,o},e.prototype.delta=function(t){void 0===t&&(t="#FFF");var n=t instanceof e?t:new e(t),r=function(e,t){var n=e.l,r=e.a,o=e.b,i=t.l,s=t.a,a=t.b,l=180/Math.PI,c=Math.PI/180,u=Math.pow(Math.pow(r,2)+Math.pow(o,2),.5),d=Math.pow(Math.pow(s,2)+Math.pow(a,2),.5),p=(n+i)/2,h=Math.pow((u+d)/2,7),f=.5*(1-Math.pow(h/(h+Math.pow(25,7)),.5)),m=r*(1+f),g=s*(1+f),b=Math.pow(Math.pow(m,2)+Math.pow(o,2),.5),w=Math.pow(Math.pow(g,2)+Math.pow(a,2),.5),y=(b+w)/2,v=0===m&&0===o?0:Math.atan2(o,m)*l,k=0===g&&0===a?0:Math.atan2(a,g)*l;v<0&&(v+=360),k<0&&(k+=360);var x=k-v,S=Math.abs(k-v);S>180&&k<=v?x+=360:S>180&&k>v&&(x-=360);var C=v+k;S<=180?C/=2:C=(v+k<360?C+360:C-360)/2;var O=1-.17*Math.cos(c*(C-30))+.24*Math.cos(2*c*C)+.32*Math.cos(c*(3*C+6))-.2*Math.cos(c*(4*C-63)),A=i-n,z=w-b,E=2*Math.sin(c*x/2)*Math.pow(b*w,.5),N=1+.015*Math.pow(p-50,2)/Math.pow(20+Math.pow(p-50,2),.5),P=1+.045*y,T=1+.015*y*O,I=30*Math.exp(-1*Math.pow((C-275)/25,2)),j=-2*Math.pow(h/(h+Math.pow(25,7)),.5)*Math.sin(2*c*I);return Math.pow(Math.pow(A/1/N,2)+Math.pow(z/1/P,2)+Math.pow(E/1/T,2)+j*z*E/(1*P*1*T),.5)}(this.toLab(),n.toLab())/100;return ir(or(r,3))},t.object.push([pr,"lab"])},function(e,t){e.prototype.toLch=function(){return Or(zr(this.rgba))},e.prototype.toLchString=function(){return t=(e=Or(zr(this.rgba))).l,n=e.c,r=e.h,(o=e.a)<1?"lch("+t+"% "+n+" "+r+" / "+o+")":"lch("+t+"% "+n+" "+r+")";var e,t,n,r,o},t.string.push([Pr,"lch"]),t.object.push([Ar,"lch"])},(e,t)=>{t.string.push([Ir,"hwb-with-comma"])},(e,t)=>{t.string.push([jr,"gray"])}]);const Tr=$n;function Ir(e){if(!(e=e.toLowerCase()).startsWith("hwb(")||!e.endsWith(")")||e.includes("/"))return null;const[t,n="",r="",o,...i]=e.slice(4,-1).split(",");if(!t||!t.trim()||!n.trim()||!r.trim()||i.length>0)return null;const s=Tr("hwb(".concat(t," ").concat(n," ").concat(r).concat(o?" / ".concat(o):"",")"));return s.isValid()?s.rgba:null}function jr(e){if(!(e=e.toLowerCase()).startsWith("gray(")||!e.endsWith(")"))return null;const[t,n,...r]=e.slice(5,-1).split(",");if(!t||r.length>0)return null;const o=S.unit(t.trim());if(!o||!["","%"].includes(o.unit))return null;let i={l:Number(o.number),a:0,b:0};if(n){const e=S.unit(n.trim());if(!e||!["","%"].includes(e.unit))return null;i=mn(mn({},i),{},{alpha:Number(e.number)/(e.unit?100:1)})}return Tr(i).rgba}const Lr=new Set(["translateX","translateY","translateZ","scaleX","scaleY","scaleZ","rotateX","rotateY","rotateZ","skewX","skewY"]),Mr=new Set(["color","color-mix","hsl","hsla","hwb","lab","lch","oklab","oklch","rgb","rgba"]),_r=new Set(["abs","acos","asin","atan","calc","cos","exp","sign","sin","sqrt","tan"]),Rr=new Set([..._r,"atan2","clamp","hypot","log","max","min","mod","pow","rem","round"]),Fr=new RegExp("\\b(?:".concat([...Mr.values()].join("|"),")\\("),"i");const Dr=new Set(["initial","inherit","revert","revert-layer","unset"]),Ur=rt(Dr,["caption","icon","menu","message-box","small-caption","status-bar"]),qr=rt(Dr,["serif","sans-serif","cursive","fantasy","monospace","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Wr=new Set(["bolder","lighter"]),Br=new Set(["normal","bold"]),$r=rt(Wr,Br),Qr=new Set(["100","200","300","400","500","600","700","800","900"]),Vr=rt(Dr,$r,Qr),Gr=rt(Dr,["normal","italic","oblique"]),Yr=rt(Dr,["normal","none","historical-forms","none","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual","small-caps","small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"]),Jr=rt(Dr,["semi-condensed","condensed","extra-condensed","ultra-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"]),Kr=rt(Dr,["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]),Hr=rt(Dr,["normal"]),Xr=rt(Dr,Gr,Yr,Vr,Jr,Kr,Hr,qr),Zr=rt(Dr,["none"]),eo=rt(Dr,["linear","ease","ease-in","ease-in-out","ease-out","step-start","step-end","steps","cubic-bezier"]),to=new Set(["infinite"]),no=rt(Dr,["normal","reverse","alternate","alternate-reverse"]),ro=new Set(["none","forwards","backwards","both"]),oo=rt(Dr,["running","paused"]),io=rt(Dr,Zr,eo,to,no,ro,oo),so=rt(Dr,["auto","span"]),ao=rt(Dr,["auto","span"]),lo=rt(Dr,["auto","span"]),co=rt(Dr,["none"]),uo=rt(Dr,["none"]),po=rt(Dr,["none","disc","circle","square","decimal","cjk-decimal","decimal-leading-zero","lower-roman","upper-roman","lower-greek","lower-alpha","lower-latin","upper-alpha","upper-latin","arabic-indic","armenian","bengali","cambodian","cjk-earthly-branch","cjk-ideographic","devanagari","ethiopic-numeric","georgian","gujarati","gurmukhi","hebrew","hiragana","hiragana-iroha","japanese-formal","japanese-informal","kannada","katakana","katakana-iroha","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","lao","lower-armenian","malayalam","mongolian","myanmar","oriya","persian","simp-chinese-formal","simp-chinese-informal","tamil","telugu","thai","tibetan","trad-chinese-formal","trad-chinese-informal","upper-armenian","disclosure-open","disclosure-closed","ethiopic-halehame","ethiopic-halehame-am","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","hangul","hangul-consonant","urdu"]),ho=rt(Dr,["inside","outside"]),fo=rt(Dr,["none"]),mo=rt(Dr,po,ho,fo),go=new Set(["optimizeSpeed","optimizeQuality","optimizeLegibility","geometricPrecision","currentColor","crispEdges","visiblePainted","visibleFill","visibleStroke","sRGB","linearRGB"]),bo=new Set(["from","to"]),wo=new Set(["activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","accentcolor","accentcolortext","activetext","buttonborder","buttonface","buttontext","canvas","canvastext","field","fieldtext","graytext","highlight","highlighttext","linktext","mark","marktext","selecteditem","selecteditemtext","visitedtext"]),yo=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),vo=new RegExp("\\b(?:".concat([...yo.values()].join("|"),")\\b"),"i");const ko="color-named",xo=Z(ko,{expected:(e,t)=>'Expected "'.concat(t,'" to be "').concat(e,'"'),rejected:e=>'Unexpected named color "'.concat(e,'"')}),So=new Set(["word","function"]),Co=/\bgray\(/i,Oo=(e,t)=>(n,r)=>{function o(e,t,n,o){X({result:r,ruleName:ko,message:e,node:t,index:n,endIndex:n+o})}re(r,ko,{actual:e,possible:["never","always-where-possible"]},{actual:t,possible:{ignoreProperties:[P,N],ignore:["inside-function"]},optional:!0})&&n.walkDecls((n=>{if(cn.has(n.prop))return;if(H(t,"ignoreProperties",n.prop))return;const{value:r}=n;var i;("never"!==e||(i=r,vo.test(i)))&&(("always-where-possible"!==e||Vt(r)||function(e){return Fr.test(e)}(r)||Co.test(r))&&S(r).walk((r=>{const i=r.value,s=r.type,a=r.sourceIndex;if(H(t,"ignore","inside-function")&&"function"===s)return!1;if(!Lt(r))return!1;if(!V(i))return;if(!So.has(s))return;if("never"===e&&"word"===s&&yo.has(i.toLowerCase()))return void o(xo.rejected(i),n,M(n)+a,i.length);if("always-where-possible"!==e)return;let l=null,c=null;if("function"===s)l=S.stringify(r),c=l.replace(/\s*([,/()])\s*/g,"$1").replace(/\s{2,}/g," ");else{if("word"!==s||!i.startsWith("#"))return;l=c=i}const u=Tr(c);if(!u.isValid())return;const d=u.toName();d&&"transparent"!==d.toLowerCase()&&o(xo.expected(d,c),n,M(n)+a,l.length)})))}))};Oo.ruleName=ko,Oo.messages=xo,Oo.meta={url:"https://stylelint.io/user-guide/rules/color-named"};const Ao="color-no-hex",zo=Z(Ao,{rejected:e=>'Unexpected hex color "'.concat(e,'"')}),Eo=/^#[\da-z]+$/i,No=/#[\da-z]+/i,Po=e=>(t,n)=>{re(n,Ao,{actual:e})&&t.walkDecls((e=>{if(!No.test(e.value))return;S(_(e)).walk((t=>{if(tn(t))return!1;if(!function({type:e,value:t}){return"word"===e&&Eo.test(t)}(t))return;const r=M(e)+t.sourceIndex,o=r+t.value.length;X({message:zo.rejected,messageArgs:[t.value],node:e,index:r,endIndex:o,result:n,ruleName:Ao})}))}))};Po.ruleName=Ao,Po.messages=zo,Po.meta={url:"https://stylelint.io/user-guide/rules/color-no-hex"};const To="color-no-invalid-hex",Io=Z(To,{rejected:e=>'Unexpected invalid hex color "'.concat(e,'"')}),jo=/#[\da-z]+/i,Lo=e=>(t,n)=>{re(n,To,{actual:e})&&t.walkDecls((e=>{(function(e){return!e.includes("[")})(e.value)&&jo.test(e.value)&&S(e.value).walk((({value:t,type:r,sourceIndex:o})=>{if("function"===r&&t.endsWith("url"))return!1;if("word"!==r)return;const i=/^#[\da-z]+/i.exec(t);if(!i)return;const s=i[0];if(!s||Yt(s))return;const a=M(e)+o,l=a+s.length;X({message:Io.rejected,messageArgs:[s],node:e,index:a,endIndex:l,result:n,ruleName:To})}))}))};function Mo(e){return!("inline"in e)&&!("inline"in e.raws)}Lo.ruleName=To,Lo.messages=Io,Lo.meta={url:"https://stylelint.io/user-guide/rules/color-no-invalid-hex"};const _o="comment-empty-line-before",Ro=Z(_o,{expected:"Expected empty line before comment",rejected:"Unexpected empty line before comment"}),Fo=(e,t,n)=>(r,o)=>{re(o,_o,{actual:e,possible:["always","never"]},{actual:t,possible:{except:["first-nested"],ignore:["stylelint-commands","after-comment"],ignoreComments:[P,N]},optional:!0})&&r.walkComments((r=>{if(Xe(r))return;if(Pt(r,n.configurationComment)&&H(t,"ignore","stylelint-commands"))return;if(H(t,"ignore","after-comment")&&Ge(r))return;if(H(t,"ignoreComments",r.text))return;if(Ve(r))return;if(!Mo(r))return;const i=!(H(t,"except","first-nested")&&He(r)||"always"!==e);if(i===je(r.raws.before||""))return;if(n.fix){if("string"!=typeof n.newline)return;return void(i?Ne(r,n.newline):Ze(r,n.newline))}X({message:i?Ro.expected:Ro.rejected,node:r,result:o,ruleName:_o})}))};Fo.ruleName=_o,Fo.messages=Ro,Fo.meta={url:"https://stylelint.io/user-guide/rules/comment-empty-line-before",fixable:!0};const Do="comment-no-empty",Uo=Z(Do,{rejected:"Unexpected empty comment"}),qo=e=>(t,n)=>{re(n,Do,{actual:e})&&t.walkComments((e=>{Mo(e)&&(e.text&&0!==e.text.length||X({message:Uo.rejected,node:e,result:n,ruleName:Do}))}))};qo.ruleName=Do,qo.messages=Uo,qo.meta={url:"https://stylelint.io/user-guide/rules/comment-no-empty"};const Wo="comment-pattern",Bo=Z(Wo,{expected:e=>'Expected comment to match pattern "'.concat(e,'"')}),$o=e=>(t,n)=>{if(!re(n,Wo,{actual:e,possible:[N,P]}))return;const r=P(e)?new RegExp(e):e;t.walkComments((t=>{const o=t.text;r.test(o)||X({message:Bo.expected,messageArgs:[e],node:t,result:n,ruleName:Wo})}))};function Qo(e){return[" ","\n","\t","\r","\f"].includes(e)}$o.ruleName=Wo,$o.messages=Bo,$o.meta={url:"https://stylelint.io/user-guide/rules/comment-pattern"};const Vo="comment-whitespace-inside",Go=Z(Vo,{expectedOpening:'Expected whitespace after "/*"',rejectedOpening:'Unexpected whitespace after "/*"',expectedClosing:'Expected whitespace before "*/"',rejectedClosing:'Unexpected whitespace before "*/"'});const Yo=(e,t,n)=>(t,r)=>{re(r,Vo,{actual:e,possible:["always","never"]})&&t.walkComments((t=>{if(!Mo(t))return;const o=t.toString(),i=o.slice(0,4);if(/^\/\*[#!]\s/.test(i))return;const s=o.match(/(^\/\*+)(\s)?/);if(null==s||null==s[1])throw new Error('Invalid comment: "'.concat(o,'"'));const a=o.match(/(\s)?(\*+\/)$/);if(null==a||null==a[2])throw new Error('Invalid comment: "'.concat(o,'"'));const l=s[1],c=s[2]||"",u=a[1]||"",d=a[2];function p(o,i){n.fix?"never"===e?(t.raws.left="",t.raws.right="",t.text=t.text.replace(/^(\*+)(\s+)?/,"$1").replace(/(\s+)?(\*+)$/,"$2")):(c||function(e){e.text.startsWith("*")?e.text=e.text.replace(/^(\*+)/,"$1 "):e.raws.left=" "}(t),u||function(e){"*"===e.text[e.text.length-1]?e.text=e.text.replace(/(\*+)$/," $1"):e.raws.right=" "}(t)):X({message:o,index:i,result:r,ruleName:Vo,node:t})}"never"===e&&""!==c&&p(Go.rejectedOpening,l.length),"always"!==e||Qo(c)||p(Go.expectedOpening,l.length),"never"===e&&""!==u&&p(Go.rejectedClosing,t.toString().length-d.length-1),"always"!==e||Qo(u)||p(Go.expectedClosing,t.toString().length-d.length-1)}))};function Jo(e,t){return!!t&&(!!P(t)&&((!t.startsWith("/")||!t.endsWith("/"))&&(!!e.includes(t)&&{match:e,pattern:t,substring:t})))}Yo.ruleName=Vo,Yo.messages=Go,Yo.meta={url:"https://stylelint.io/user-guide/rules/comment-whitespace-inside",fixable:!0};const Ko="comment-word-disallowed-list",Ho=Z(Ko,{rejected:e=>'Unexpected word matching pattern "'.concat(e,'"')}),Xo=e=>(t,n)=>{re(n,Ko,{actual:e,possible:[P,N]})&&t.walkComments((t=>{const r=t.text;if("/*# "===t.toString().slice(0,4))return;const o=G(r,e)||function(e,t){if(!Array.isArray(t))return Jo(e,t);for(const n of t){const t=Jo(e,n);if(t)return t}return!1}(r,e);o&&X({message:Ho.rejected,messageArgs:[o.pattern],node:t,word:o.substring,result:n,ruleName:Ko})}))};function Zo(e){let t=1+e.name.length;return e.raws.afterName&&(t+=e.raws.afterName.length),t}Xo.primaryOptionArray=!0,Xo.ruleName=Ko,Xo.messages=Ho,Xo.meta={url:"https://stylelint.io/user-guide/rules/comment-word-disallowed-list"};const ei="custom-media-pattern",ti=Z(ei,{expected:(e,t)=>'Expected "'.concat(e,'" to match pattern "').concat(t,'"')}),ni=e=>(t,n)=>{if(!re(n,ei,{actual:e,possible:[N,P]}))return;const r=P(e)?new RegExp(e):e;t.walkAtRules((t=>{if("custom-media"!==t.name.toLowerCase())return;const[o,i]=t.params.match(/^--(\S+)\b/)||[];if(void 0===o||void 0===i)throw new Error('Unexpected at-rule params: "'.concat(t.params,'"'));if(r.test(i))return;const s=Zo(t);X({message:ti.expected,messageArgs:[o,e],node:t,index:s,endIndex:s+o.length,result:n,ruleName:ei})}))};function ri(e){return Ye(e)?function(e){let t="";return e.raws.before&&(t+=e.raws.before),t+=e.toString(),t}(e).slice(xt(e).length):""}function oi(e){return e.startsWith("--")}function ii(e){return!/[\n\r]/.test(e)}function si(e){return!!e.startsWith("$")||!!e.includes(".$")}function ai(e){const t=e.prop,n=e.parent;return!si(t)&&(("@"!==t[0]||"{"===t[1])&&((!n||"atrule"!==n.type||":"!==n.raws.afterName)&&(!(n&&Me(n)&&n.selector&&n.selector.startsWith("#")&&n.selector.endsWith("()"))&&(!(n&&Me(n)&&n.selector&&":"===n.selector[n.selector.length-1]&&"--"!==n.selector.substring(0,2))&&(!("extend"in e)||!e.extend)))))}ni.ruleName=ei,ni.messages=ti,ni.meta={url:"https://stylelint.io/user-guide/rules/custom-media-pattern"};const li="custom-property-empty-line-before",ci=Z(li,{expected:"Expected empty line before custom property",rejected:"Unexpected empty line before custom property"}),ui=(e,t,n)=>(r,o)=>{re(o,li,{actual:e,possible:["always","never"]},{actual:t,possible:{except:["first-nested","after-comment","after-custom-property"],ignore:["after-comment","first-nested","inside-single-line-block"]},optional:!0})&&r.walkDecls((r=>{const i=r.prop,s=r.parent;if(!ai(r))return;if(!oi(i))return;if(H(t,"ignore","after-comment")&&Ge(r))return;if(H(t,"ignore","first-nested")&&He(r))return;if(H(t,"ignore","inside-single-line-block")&&null!=s&&(_e(s)||Me(s))&&ii(ri(s)))return;let a="always"===e;(H(t,"except","first-nested")&&He(r)||H(t,"except","after-comment")&&Ge(r)||H(t,"except","after-custom-property")&&function(e){const t=Te(e);return null!=t&&Fe(t)&&oi(t.prop)}(r))&&(a=!a);if(a===je(r.raws.before))return;if(n.fix){if(null==n.newline)return;return void(a?Ne(r,n.newline):Ze(r,n.newline))}X({message:a?ci.expected:ci.rejected,node:r,result:o,ruleName:li})}))};ui.ruleName=li,ui.messages=ci,ui.meta={url:"https://stylelint.io/user-guide/rules/custom-property-empty-line-before",fixable:!0};const di="custom-property-no-missing-var-function",pi=Z(di,{rejected:e=>'Unexpected missing var function for "'.concat(e,'"')}),hi=new Set(["animation","animation-name","counter-increment","counter-reset","counter-set","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","list-style","list-style-type","transition","transition-property","will-change"]),fi=e=>(t,n)=>{if(!re(n,di,{actual:e}))return;const r=new Set;t.walkAtRules(/^property$/i,(({params:e})=>{r.add(e)})),t.walkDecls(/^--/,(({prop:e})=>{r.add(e)})),t.walkDecls((e=>{const{prop:t,value:o}=e;o.includes("--")&&(hi.has(t.toLowerCase())||S(o).walk((t=>{if(function({type:e,value:t}){return"function"===e&&"var"===t}(t))return!1;if(!function({type:e,value:t}){return"word"===e&&t.startsWith("--")}(t))return;if(!r.has(t.value))return;const o=M(e)+t.sourceIndex,i=o+t.value.length;return X({message:pi.rejected,messageArgs:[t.value],node:e,index:o,endIndex:i,result:n,ruleName:di}),!1})))}))};function mi(e){return!si(e)&&(!e.startsWith("@")&&(!e.endsWith("+")&&!e.endsWith("+_")&&!Q(e)))}fi.ruleName=di,fi.messages=pi,fi.meta={url:"https://stylelint.io/user-guide/rules/custom-property-no-missing-var-function"};const gi="custom-property-pattern",bi=Z(gi,{expected:(e,t)=>'Expected "'.concat(e,'" to match pattern "').concat(t,'"')}),wi=/var\(/i,yi=e=>(t,n)=>{if(!re(n,gi,{actual:e,possible:[N,P]}))return;const r=P(e)?new RegExp(e):e;function o(e){return!oi(e)||!mi(e)||r.test(e.slice(2))}function i(t,r,o){X({result:n,ruleName:gi,message:bi.expected,messageArgs:[r,e],node:o,index:t,endIndex:t+r.length})}t.walkDecls((e=>{const{prop:t,value:n}=e;if(wi.test(n)){S(n).walk((t=>{if(!De(t))return;if("var"!==t.value.toLowerCase())return;const{nodes:n}=t,r=n[0];r&&!o(r.value)&&i(M(e)+r.sourceIndex,r.value,e)}))}o(t)||i(0,t,e)}))};function vi(e,t){!function e(n){var r;if((Me(r=n)||_e(r)||Le(r))&&n.nodes&&n.nodes.length){const r=[];for(const t of n.nodes)"decl"===t.type&&r.push(t),e(t);r.length&&t(r.forEach.bind(r))}}(e)}yi.ruleName=gi,yi.messages=bi,yi.meta={url:"https://stylelint.io/user-guide/rules/custom-property-pattern"};const ki="declaration-block-no-duplicate-custom-properties",xi=Z(ki,{rejected:e=>'Unexpected duplicate "'.concat(e,'"')}),Si=(e,t)=>(n,r)=>{re(r,ki,{actual:e},{actual:t,possible:{ignoreProperties:[P,N]},optional:!0})&&vi(n,(e=>{const n=new Set;e((e=>{const o=e.prop;if(!mi(o))return;if(!oi(o))return;if(H(t,"ignoreProperties",o))return;n.has(o)?X({message:xi.rejected,messageArgs:[o],node:e,result:r,ruleName:ki,word:o}):n.add(o)}))}))};Si.ruleName=ki,Si.messages=xi,Si.meta={url:"https://stylelint.io/user-guide/rules/declaration-block-no-duplicate-custom-properties"};var Ci=Object.create,Oi=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,zi=Object.getOwnPropertyNames,Ei=Object.getPrototypeOf,Ni=Object.prototype.hasOwnProperty,Pi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ti=(e,t)=>{for(var n in t)Oi(e,n,{get:t[n],enumerable:!0})},Ii=Pi((e=>{var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(e){if(0<=e&&e{var t=Ii();e.encode=function(e){var n,r="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{n=31&o,(o>>>=5)>0&&(n|=32),r+=t.encode(n)}while(o>0);return r},e.decode=function(e,n,r){var o,i,s=e.length,a=0,l=0;do{if(n>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=t.decode(e.charCodeAt(n++))))throw new Error("Invalid base64 digit: "+e.charAt(n-1));o=!!(32&i),a+=(i&=31)<>1;return 1==(1&e)?-t:t}(a),r.rest=n}})),Li=Pi((e=>{e.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function r(e){var n=e.match(t);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function o(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}e.urlParse=r,e.urlGenerate=o;var i=function(e){var t=[];return function(n){for(var r=0;r32&&t.pop(),i}}((function(t){var n=t,i=r(t);if(i){if(!i.path)return t;n=i.path}for(var s=e.isAbsolute(n),a=[],l=0,c=0;;){if(l=c,-1===(c=n.indexOf("/",l))){a.push(n.slice(l));break}for(a.push(n.slice(l,c));c=0;c--)"."===(u=a[c])?a.splice(c,1):".."===u?d++:d>0&&(""===u?(a.splice(c+1,d),d=0):(a.splice(c,2),d--));return""===(n=a.join("/"))&&(n=s?"/":"."),i?(i.path=n,o(i)):n}));function s(e,t){""===e&&(e="."),""===t&&(t=".");var s=r(t),a=r(e);if(a&&(e=a.path||"/"),s&&!s.scheme)return a&&(s.scheme=a.scheme),o(s);if(s||t.match(n))return t;if(a&&!a.host&&!a.path)return a.host=t,o(a);var l="/"===t.charAt(0)?t:i(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=l,o(a)):l}e.normalize=i,e.join=s,e.isAbsolute=function(e){return"/"===e.charAt(0)||t.test(e)},e.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0||(e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var a=!("__proto__"in Object.create(null));function l(e){return e}function c(e){if(!e)return!1;var t=e.length;if(t<9||95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function u(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}e.toSetString=a?l:function(e){return c(e)?"$"+e:e},e.fromSetString=a?l:function(e){return c(e)?e.slice(1):e},e.compareByOriginalPositions=function(e,t,n){var r=u(e.source,t.source);return 0!==r||0!==(r=e.originalLine-t.originalLine)||(0!==(r=e.originalColumn-t.originalColumn)||n)||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:u(e.name,t.name)},e.compareByOriginalPositionsNoSource=function(e,t,n){var r;return 0!==(r=e.originalLine-t.originalLine)||(0!==(r=e.originalColumn-t.originalColumn)||n)||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:u(e.name,t.name)},e.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||(0!==(r=e.generatedColumn-t.generatedColumn)||n)||0!==(r=u(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:u(e.name,t.name)},e.compareByGeneratedPositionsDeflatedNoLine=function(e,t,n){var r=e.generatedColumn-t.generatedColumn;return 0!==r||n||0!==(r=u(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:u(e.name,t.name)},e.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=u(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:u(e.name,t.name)},e.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},e.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var a=r(n);if(!a)throw new Error("sourceMapURL could not be parsed");if(a.path){var l=a.path.lastIndexOf("/");l>=0&&(a.path=a.path.substring(0,l+1))}t=s(o(a),t)}return i(t)}})),Mi=Pi((e=>{var t=Li(),n=Object.prototype.hasOwnProperty,r=typeof Map<"u";function o(){this._array=[],this._set=r?new Map:Object.create(null)}o.fromArray=function(e,t){for(var n=new o,r=0,i=e.length;r=0)return o}else{var i=t.toSetString(e);if(n.call(this._set,i))return this._set[i]}throw new Error('"'+e+'" is not in the set.')},o.prototype.at=function(e){if(e>=0&&e{var t=Li();function n(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}n.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},n.prototype.add=function(e){!function(e,n){var r=e.generatedLine,o=n.generatedLine,i=e.generatedColumn,s=n.generatedColumn;return o>r||o==r&&s>=i||t.compareByGeneratedPositionsInflated(e,n)<=0}(this._last,e)?(this._sorted=!1,this._array.push(e)):(this._last=e,this._array.push(e))},n.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.MappingList=n})),Ri=Pi((e=>{var t=ji(),n=Li(),r=Mi().ArraySet,o=_i().MappingList;function i(e){e||(e={}),this._file=n.getArg(e,"file",null),this._sourceRoot=n.getArg(e,"sourceRoot",null),this._skipValidation=n.getArg(e,"skipValidation",!1),this._sources=new r,this._names=new r,this._mappings=new o,this._sourcesContents=null}i.prototype._version=3,i.fromSourceMap=function(e){var t=e.sourceRoot,r=new i({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var o={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(o.source=e.source,null!=t&&(o.source=n.relative(t,o.source)),o.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(o.name=e.name)),r.addMapping(o)})),e.sources.forEach((function(o){var i=o;null!==t&&(i=n.relative(t,o)),r._sources.has(i)||r._sources.add(i);var s=e.sourceContentFor(o);null!=s&&r.setSourceContent(o,s)})),r},i.prototype.addMapping=function(e){var t=n.getArg(e,"generated"),r=n.getArg(e,"original",null),o=n.getArg(e,"source",null),i=n.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,o,i),null!=o&&(o=String(o),this._sources.has(o)||this._sources.add(o)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:o,name:i})},i.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=n.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[n.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[n.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},i.prototype.applySourceMap=function(e,t,o){var i=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');i=e.file}var s=this._sourceRoot;null!=s&&(i=n.relative(s,i));var a=new r,l=new r;this._mappings.unsortedForEach((function(t){if(t.source===i&&null!=t.originalLine){var r=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=r.source&&(t.source=r.source,null!=o&&(t.source=n.join(o,t.source)),null!=s&&(t.source=n.relative(s,t.source)),t.originalLine=r.line,t.originalColumn=r.column,null!=r.name&&(t.name=r.name))}var c=t.source;null!=c&&!a.has(c)&&a.add(c);var u=t.name;null!=u&&!l.has(u)&&l.add(u)}),this),this._sources=a,this._names=l,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=o&&(t=n.join(o,t)),null!=s&&(t=n.relative(s,t)),this.setSourceContent(t,r))}),this)},i.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))}},i.prototype._serializeMappings=function(){for(var e,r,o,i,s=0,a=1,l=0,c=0,u=0,d=0,p="",h=this._mappings.toArray(),f=0,m=h.length;f0){if(!n.compareByGeneratedPositionsInflated(r,h[f-1]))continue;e+=","}e+=t.encode(r.generatedColumn-s),s=r.generatedColumn,null!=r.source&&(i=this._sources.indexOf(r.source),e+=t.encode(i-d),d=i,e+=t.encode(r.originalLine-1-c),c=r.originalLine-1,e+=t.encode(r.originalColumn-l),l=r.originalColumn,null!=r.name&&(o=this._names.indexOf(r.name),e+=t.encode(o-u),u=o)),p+=e}return p},i.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=n.relative(t,e));var r=n.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},i.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},i.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=i}));Ti({},{AtKeyword:()=>qi,BadString:()=>$i,BadUrl:()=>Vi,CDC:()=>Zi,CDO:()=>Xi,Colon:()=>es,Comma:()=>ns,Comment:()=>cs,Delim:()=>Gi,Dimension:()=>Ki,EOF:()=>Fi,Function:()=>Ui,Hash:()=>Wi,Ident:()=>Di,LeftCurlyBracket:()=>as,LeftParenthesis:()=>is,LeftSquareBracket:()=>rs,Number:()=>Yi,Percentage:()=>Ji,RightCurlyBracket:()=>ls,RightParenthesis:()=>ss,RightSquareBracket:()=>os,Semicolon:()=>ts,String:()=>Bi,Url:()=>Qi,WhiteSpace:()=>Hi});var Fi=0,Di=1,Ui=2,qi=3,Wi=4,Bi=5,$i=6,Qi=7,Vi=8,Gi=9,Yi=10,Ji=11,Ki=12,Hi=13,Xi=14,Zi=15,es=16,ts=17,ns=18,rs=19,os=20,is=21,ss=22,as=23,ls=24,cs=25;function us(e){return e>=48&&e<=57}function ds(e){return us(e)||e>=65&&e<=70||e>=97&&e<=102}function ps(e){return e>=65&&e<=90}function hs(e){return function(e){return ps(e)||function(e){return e>=97&&e<=122}(e)}(e)||function(e){return e>=128}(e)||95===e}function fs(e){return hs(e)||us(e)||45===e}function ms(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function gs(e){return 10===e||13===e||12===e}function bs(e){return gs(e)||32===e||9===e}function ws(e,t){return!(92!==e||gs(t)||0===t)}function ys(e,t,n){return 45===e?hs(t)||45===t||ws(t,n):!!hs(e)||92===e&&ws(e,t)}function vs(e,t,n){return 43===e||45===e?us(t)?2:46===t&&us(n)?3:0:46===e?us(t)?2:0:us(e)?1:0}function ks(e){return 65279===e||65534===e?1:0}var xs=new Array(128),Ss=130;for(let e=0;ee.length)return!1;for(let o=t;o=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var _s=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token"];function Rs(e=null,t){return null===e||e.length0?ks(t.charCodeAt(0)):0,o=Rs(e.lines,n),i=Rs(e.columns,n),s=e.startLine,a=e.startColumn;for(let e=r;e=e.length?void(cString(e+n+1).padStart(l)+" |"+t)).join("\n")}let i=e.split(/\r\n?|\n|\f/),s=Math.max(1,t-r)-1,a=Math.min(t+r,i.length+1),l=Math.max(4,String(a).length)+1,c=0;(n+=(Vs.length-1)*(i[t-1].substr(0,n-1).match(/\t/g)||[]).length)>100&&(c=n-60+3,n=58);for(let e=s;e<=a;e++)e>=0&&e0&&i[e].length>c?"…":"")+i[e].substr(c,98)+(i[e].length>c+100-1?"…":""));return[o(s,t),new Array(n+l+2).join("-")+"^",o(t,a)].filter(Boolean).join("\n")}function Ys(e,t,n,r,o){return Object.assign(Qs("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment:e=>Gs({source:t,line:r,column:o},isNaN(e)?0:e),get formattedMessage(){return"Parse error: ".concat(e,"\n")+Gs({source:t,line:r,column:o},2)}})}function Js(e){let t=this.createList(),n=!1,r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:n=!0,this.next();continue}let o=e.getNode.call(this,r);if(void 0===o)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,r),n=!1),t.push(o)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,r),t}var Ks=()=>{};function Hs(e){return function(){return this[e]()}}function Xs(e){let t=Object.create(null);for(let n in e){let r=e[n],o=r.parse||r;o&&(t[n]=o)}return t}function Zs(e){let t="",n="",r=!1,o=Ks,i=!1,s=new class{constructor(){this.lines=null,this.columns=null,this.computed=!1}setSource(e,t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||Fs(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||Fs(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}},a=Object.assign(new class{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",t=(()=>{})){let n=(e=String(e||"")).length,r=Rs(this.offsetAndType,e.length+1),o=Rs(this.balance,e.length+1),i=0,s=0,a=0,l=-1;for(this.offsetAndType=null,this.balance=null,t(e,((e,t,c)=>{switch(e){default:o[i]=n;break;case s:{let e=a&Ds;for(a=o[e],s=a>>Us,o[i]=e,o[e++]=i;e>Us:0}lookupOffset(e){return(e+=this.tokenIndex)0?e>Us,this.tokenEnd=t&Ds):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e>Us,this.tokenEnd=e&Ds):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;13===this.tokenType||25===this.tokenType;)this.next()}skipUntilBalanced(e,t){let n,r,o=e;e:for(;o0?this.offsetAndType[o-1]&Ds:this.firstCharOffset,t(this.source.charCodeAt(r))){case 1:break e;case 2:o++;break e;default:this.balance[n]===o&&(o=n)}this.skip(o-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t>Us,r,i,t)}}dump(){let e=new Array(this.tokenCount);return this.forEachToken(((t,n,r,o)=>{e[o]={idx:o,type:_s[t],chunk:this.source.substring(n,r),balance:this.balance[o]}})),e}},function(e){let t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:Xs(e.atrule),pseudo:Xs(e.pseudo),node:Xs(e.node)};for(let n in e.parseContext)switch(typeof e.parseContext[n]){case"function":t.context[n]=e.parseContext[n];break;case"string":t.context[n]=Hs(e.parseContext[n])}return mn(mn({config:t},t),t.node)}(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Js,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket:e=>123===e?1:0,consumeUntilLeftCurlyBracketOrSemicolon:e=>123===e||59===e?1:0,consumeUntilExclamationMarkOrSemicolon:e=>33===e||59===e?1:0,consumeUntilSemicolonIncluded:e=>59===e?2:0,createList:()=>new $s,createSingleNodeList:e=>(new $s).appendData(e),getFirstListNode:e=>e&&e.first,getLastListNode:e=>e&&e.last,parseWithFallback(e,t){let n=this.tokenIndex;try{return e.call(this)}catch(e){if(i)throw e;let r=t.call(this,n);return i=!0,o(e,r),i=!1,r}},lookupNonWSType(e){let t;do{if(t=this.lookupType(e++),13!==t)return t}while(0!==t);return 0},charCodeAt:e=>e>=0&&et.substring(e,n),substrToCursor(e){return this.source.substring(e,this.tokenStart)},cmpChar:(e,n)=>zs(t,e,n),cmpStr:(e,n,r)=>Es(t,e,n,r),consume(e){let t=this.tokenStart;return this.eat(e),this.substrToCursor(t)},consumeFunctionName(){let e=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),e},consumeNumber(e){let n=t.substring(this.tokenStart,js(t,this.tokenStart));return this.eat(e),n},eat(e){if(this.tokenType!==e){let t=_s[e].slice(0,-6).replace(/-/g," ").replace(/^./,(e=>e.toUpperCase())),n="".concat(/[[\](){}]/.test(t)?'"'.concat(t,'"'):t," is expected"),r=this.tokenStart;switch(e){case 1:2===this.tokenType||7===this.tokenType?(r=this.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case 4:this.isDelim(35)&&(this.next(),r++,n="Name is expected");break;case 11:10===this.tokenType&&(r=this.tokenEnd,n="Percent sign is expected")}this.error(n,r)}this.next()},eatIdent(e){(1!==this.tokenType||!1===this.lookupValue(0,e))&&this.error('Identifier "'.concat(e,'" is expected')),this.next()},eatDelim(e){this.isDelim(e)||this.error('Delim "'.concat(String.fromCharCode(e),'" is expected')),this.next()},getLocation:(e,t)=>r?s.getLocationRange(e,t,n):null,getLocationFromList(e){if(r){let t=this.getFirstListNode(e),r=this.getLastListNode(e);return s.getLocationRange(null!==t?t.loc.start.offset-s.startOffset:this.tokenStart,null!==r?r.loc.end.offset-s.startOffset:this.tokenStart,n)}return null},error(e,n){let r=typeof n<"u"&&n=0&&bs(e.charCodeAt(t));t--);return t+1}(t,t.length-1)):s.getLocation(this.tokenStart);throw new Ys(e||"Unexpected input",t,r.offset,r.line,r.column)}});return Object.assign((function(e,l){t=e,l=l||{},a.setSource(t,Ws),s.setSource(t,l.offset,l.line,l.column),n=l.filename||"",r=Boolean(l.positions),o="function"==typeof l.onParseError?l.onParseError:Ks,i=!1,a.parseAtrulePrelude=!("parseAtrulePrelude"in l)||Boolean(l.parseAtrulePrelude),a.parseRulePrelude=!("parseRulePrelude"in l)||Boolean(l.parseRulePrelude),a.parseValue=!("parseValue"in l)||Boolean(l.parseValue),a.parseCustomProperty="parseCustomProperty"in l&&Boolean(l.parseCustomProperty);let{context:c="default",onComment:u}=l;if(!(c in a.context))throw new Error("Unknown context `"+c+"`");"function"==typeof u&&a.forEachToken(((e,n,r)=>{if(25===e){let e=a.getLocation(n,r),o=Es(t,r-2,r,"*/")?t.slice(n+2,r-2):t.slice(n+2,r);u(o,e)}}));let d=a.context[c].call(a,l);return a.eof||a.error(),d}),{SyntaxError:Ys,config:a.config})}var ea=((e,t,n)=>(n=null!=e?Ci(Ei(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of zi(t))!Ni.call(e,o)&&o!==n&&Oi(e,o,{get:()=>t[o],enumerable:!(r=Ai(t,o))||r.enumerable});return e})(Oi(n,"default",{value:e,enumerable:!0}),e)))(Ri()),ta=new Set(["Atrule","Selector","Declaration"]);var na={};Ti(na,{safe:()=>la,spec:()=>aa});var ra=(e,t)=>{if(9===e&&(e=t),"string"==typeof e){let t=e.charCodeAt(0);return t>127?32768:t<<8}return e},oa=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],ia=oa.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function sa(e){let t=new Set(e.map((([e,t])=>ra(e)<<16|ra(t))));return function(e,n,r){let o=ra(n,r),i=r.charCodeAt(0);return(45===i&&1!==n&&2!==n&&15!==n||43===i?t.has(e<<16|i<<8):t.has(e<<16|o))&&this.emit(" ",13,!0),o}}var aa=sa(oa),la=sa(ia);function ca(e,t){if("function"!=typeof t)e.children.forEach(this.node,this);else{let n=null;e.children.forEach((e=>{null!==n&&t.call(this,n),this.node(e),n=e}))}}function ua(e){Ws(e,((t,n,r)=>{this.token(t,e.slice(n,r))}))}function da(e){let t=new Map;for(let n in e.node){let r=e.node[n];"function"==typeof(r.generate||r)&&t.set(n,r.generate||r)}return function(e,n){let r="",o=0,i={node(e){if(!t.has(e.type))throw new Error("Unknown node type: "+e.type);t.get(e.type).call(s,e)},tokenBefore:la,token(e,t){o=this.tokenBefore(o,e,t),this.emit(t,e,!1),9===e&&92===t.charCodeAt(0)&&this.emit("\n",13,!0)},emit(e){r+=e},result:()=>r};n&&("function"==typeof n.decorator&&(i=n.decorator(i)),n.sourceMap&&(i=function(e){let t=new ea.SourceMapGenerator,n={line:1,column:0},r={line:0,column:0},o={line:1,column:0},i={generated:o},s=1,a=0,l=!1,c=e.node;e.node=function(e){if(e.loc&&e.loc.start&&ta.has(e.type)){let c=e.loc.start.line,u=e.loc.start.column-1;(r.line!==c||r.column!==u)&&(r.line=c,r.column=u,n.line=s,n.column=a,l&&(l=!1,(n.line!==o.line||n.column!==o.column)&&t.addMapping(i)),l=!0,t.addMapping({source:e.loc.source,original:r,generated:n}))}c.call(this,e),l&&ta.has(e.type)&&(o.line=s,o.column=a)};let u=e.emit;e.emit=function(e,t,n){for(let t=0;ti.node(e),children:ca,token:(e,t)=>i.token(e,t),tokenize:ua};return i.node(e),i.result()}}var{hasOwnProperty:pa}=Object.prototype,ha=function(){};function fa(e){return"function"==typeof e?e:ha}function ma(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function ga(e,t){let n=t.structure,r=[];for(let e in n){if(!1===pa.call(n,e))continue;let t=n[e],o={name:e,type:!1,nullable:!1};Array.isArray(t)||(t=[t]);for(let e of t)null===e?o.nullable=!0:"string"==typeof e?o.type="node":Array.isArray(e)&&(o.type="list");o.type&&r.push(o)}return r.length?{context:t.walkContext,fields:r}:null}function ba(e,t){let n=e.fields.slice(),r=e.context,o="string"==typeof r;return t&&n.reverse(),function(e,i,s,a){let l;o&&(l=i[r],i[r]=e);for(let r of n){let n=e[r.name];if(!r.nullable||n)if("list"===r.type){if(t?n.reduceRight(a,!1):n.reduce(a,!1))return!0}else if(s(n))return!0}o&&(i[r]=l)}}function wa({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}}}function ya(e){let t=function(e){let t={};for(let n in e.node)if(pa.call(e.node,n)){let r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=ga(0,r)}return t}(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(let e in t)pa.call(t,e)&&null!==t[e]&&(n[e]=ba(t[e],!1),r[e]=ba(t[e],!0));let s=wa(n),a=wa(r),l=function(e,l){function c(e,t,n){let r=u.call(f,e,t,n);return r===o||r!==i&&!!(p.hasOwnProperty(e.type)&&p[e.type](e,f,c,h)||d.call(f,e,t,n)===o)}let u=ha,d=ha,p=n,h=(e,t,n,r)=>e||c(t,n,r),f={break:o,skip:i,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof l)u=l;else if(l&&(u=fa(l.enter),d=fa(l.leave),l.reverse&&(p=r),l.visit)){if(s.hasOwnProperty(l.visit))p=l.reverse?a[l.visit]:s[l.visit];else if(!t.hasOwnProperty(l.visit))throw new Error("Bad value `"+l.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");u=ma(u,l.visit),d=ma(d,l.visit)}if(u===ha&&d===ha)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");c(e)};return l.break=o,l.skip=i,l.find=function(e,t){let n=null;return l(e,(function(e,r,i){if(t.call(this,e,r,i))return n=e,o})),n},l.findLast=function(e,t){let n=null;return l(e,{reverse:!0,enter(e,r,i){if(t.call(this,e,r,i))return n=e,o}}),n},l.findAll=function(e,t){let n=[];return l(e,(function(e,r,o){t.call(this,e,r,o)&&n.push(e)})),n},l}function va(e){return e}function ka(e,t,n,r){let o;switch(e.type){case"Group":o=function(e,t,n,r){let o=" "===e.combinator||r?e.combinator:" "+e.combinator+" ",i=e.terms.map((e=>ka(e,t,n,r))).join(o);return e.explicit||n?(r||","===i[0]?"[":"[ ")+i+(r?"]":" ]"):i}(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return ka(e.term,t,n,r)+t(function(e){let{min:t,max:n,comma:r}=e;return 0===t&&0===n?r?"#?":"*":0===t&&1===n?"?":1===t&&0===n?r?"#":"+":1===t&&1===n?"":(r?"#":"")+(t===n?"{"+t+"}":"{"+t+","+(0!==n?n:"")+"}")}(e),e);case"Type":o="<"+e.name+(e.opts?t(function(e){if("Range"===e.type)return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}(e.opts),e.opts):"")+">";break;case"Property":o="<'"+e.name+"'>";break;case"Keyword":o=e.name;break;case"AtKeyword":o="@"+e.name;break;case"Function":o=e.name+"(";break;case"String":case"Token":o=e.value;break;case"Comma":o=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(o,e)}function xa(e,t){let n=va,r=!1,o=!1;return"function"==typeof t?n=t:t&&(r=Boolean(t.forceBraces),o=Boolean(t.compact),"function"==typeof t.decorate&&(n=t.decorate)),ka(e,n,r,o)}var Sa={offset:0,line:1,column:1};function Ca(e,t){let n=e&&e.loc&&e.loc[t];return n?"line"in n?Oa(n):n:null}function Oa({offset:e,line:t,column:n},r){let o={offset:e,line:t,column:n};if(r){let e=r.split(/\n|\r\n?|\f/);o.offset+=r.length,o.line+=e.length-1,o.column=1===e.length?o.column+r.length:e.pop().length+1}return o}var Aa=function(e,t){let n=Qs("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},za=function(e,t,n,r){let o=Qs("SyntaxMatchError",e),{css:i,mismatchOffset:s,mismatchLength:a,start:l,end:c}=function(e,t){let n,r,o=e.tokens,i=e.longestMatch,s=i1?(n=Ca(a||t,"end")||Oa(Sa,d),r=Oa(n)):(n=Ca(a,"start")||Oa(Ca(t,"start")||Sa,d.slice(0,l)),r=Ca(a,"end")||Oa(n,d.substr(l,c))),{css:d,mismatchOffset:l,mismatchLength:c,start:n,end:r}}(r,n);return o.rawMessage=e,o.syntax=t?xa(t):"",o.css=i,o.mismatchOffset=s,o.mismatchLength=a,o.message=e+"\n syntax: "+o.syntax+"\n value: "+(i||"")+"\n --------"+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,l),o.loc={source:n&&n.loc&&n.loc.source||"",start:l,end:c},o},Ea=new Map,Na=new Map,Pa=function(e){if(Ea.has(e))return Ea.get(e);let t=e.toLowerCase(),n=Ea.get(t);if(void 0===n){let e=Ia(t,0),r=e?"":ja(t,0);n=Object.freeze({basename:t.substr(r.length),name:t,prefix:r,vendor:r,custom:e})}return Ea.set(e,n),n},Ta=function(e){if(Na.has(e))return Na.get(e);let t=e,n=e[0];"/"===n?n="/"===e[1]?"//":"/":"_"!==n&&"*"!==n&&"$"!==n&&"#"!==n&&"+"!==n&&"&"!==n&&(n="");let r=Ia(t,n.length);if(!r&&(t=t.toLowerCase(),Na.has(t))){let n=Na.get(t);return Na.set(e,n),n}let o=r?"":ja(t,n.length),i=t.substr(0,n.length+o.length),s=Object.freeze({basename:t.substr(i.length),name:t.substr(n.length),hack:n,vendor:o,prefix:i,custom:r});return Na.set(e,s),s};function Ia(e,t){return t=t||0,e.length-t>=2&&45===e.charCodeAt(t)&&45===e.charCodeAt(t+1)}function ja(e,t){if(t=t||0,e.length-t>=3&&45===e.charCodeAt(t)&&45!==e.charCodeAt(t+1)){let n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}var La=["initial","inherit","unset","revert","revert-layer"],Ma=45,_a=!0;function Ra(e,t){return null!==e&&9===e.type&&e.value.charCodeAt(0)===t}function Fa(e,t,n){for(;null!==e&&(13===e.type||25===e.type);)e=n(++t);return t}function Da(e,t,n,r){if(!e)return 0;let o=e.value.charCodeAt(t);if(43===o||o===Ma){if(n)return 0;t++}for(;t6)return 0}return r}function Ba(e,t,n){if(!e)return 0;for(;qa(n(t),63);){if(++e>6)return 0;t++}return t}var $a=["calc(","-moz-calc(","-webkit-calc("],Qa=new Map([[2,22],[21,22],[19,20],[23,24]]);function Va(e,t){return te.max&&"string"!=typeof e.max)return!0}return!1}function Ha(e){return function(t,n,r){return null===t?0:2===t.type&&Ya(t.value,$a)?function(e,t){let n=0,r=[],o=0;e:do{switch(e.type){case 24:case 22:case 20:if(e.type!==n)break e;if(n=r.pop(),0===r.length){o++;break e}break;case 2:case 21:case 19:case 23:r.push(n),n=Qa.get(e.type)}o++}while(e=t(o));return o}(t,n):e(t,n,r)}}function Xa(e){return function(t){return null===t||t.type!==e?0:1}}function Za(e){return e&&(e=new Set(e)),function(t,n,r){if(null===t||12!==t.type)return 0;let o=js(t.value,0);if(null!==e){let n=t.value.indexOf("\\",o),r=-1!==n&&Ja(t.value,n)?t.value.substring(o,n):t.value.substr(o);if(!1===e.has(r.toLowerCase()))return 0}return Ka(r,t.value,o)?0:1}}function el(e){return"function"!=typeof e&&(e=function(){return 0}),function(t,n,r){return null!==t&&10===t.type&&0===Number(t.value)?1:e(t,n,r)}}var tl={"ident-token":Xa(1),"function-token":Xa(2),"at-keyword-token":Xa(3),"hash-token":Xa(4),"string-token":Xa(5),"bad-string-token":Xa(6),"url-token":Xa(7),"bad-url-token":Xa(8),"delim-token":Xa(9),"number-token":Xa(10),"percentage-token":Xa(11),"dimension-token":Xa(12),"whitespace-token":Xa(13),"CDO-token":Xa(14),"CDC-token":Xa(15),"colon-token":Xa(16),"semicolon-token":Xa(17),"comma-token":Xa(18),"[-token":Xa(19),"]-token":Xa(20),"(-token":Xa(21),")-token":Xa(22),"{-token":Xa(23),"}-token":Xa(24)},nl={string:Xa(5),ident:Xa(1),percentage:Ha((function(e,t,n){return null===e||11!==e.type||Ka(n,e.value,e.value.length-1)?0:1})),zero:el(),number:Ha((function(e,t,n){if(null===e)return 0;let r=js(e.value,0);return r!==e.value.length&&!Ja(e.value,r)||Ka(n,e.value,r)?0:1})),integer:Ha((function(e,t,n){if(null===e||10!==e.type)return 0;let r=43===Va(e.value,0)||45===Va(e.value,0)?1:0;for(;rsl,decibel:()=>dl,flex:()=>ul,frequency:()=>ll,length:()=>il,resolution:()=>cl,semitones:()=>pl,time:()=>al});var il=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],sl=["deg","grad","rad","turn"],al=["s","ms"],ll=["hz","khz"],cl=["dpi","dpcm","dppx","x"],ul=["fr"],dl=["db"],pl=["st"];function hl(e,t,n){return Object.assign(Qs("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+"\n "+t+"\n--"+new Array((n||t.length)+1).join("-")+"^"})}Ti({},{SyntaxError:()=>hl,generate:()=>xa,parse:()=>El,walk:()=>Tl});var fl=123,ml=new Uint8Array(128).map(((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0)),gl={" ":1,"&&":2,"||":3,"|":4};function bl(e){return e.substringToPos(e.findWsEnd(e.pos))}function wl(e){let t=e.pos;for(;t=128||0===ml[n])break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function yl(e){let t=e.pos;for(;t57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function vl(e){let t=e.str.indexOf("'",e.pos+1);return-1===t&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function kl(e){let t=null,n=null;return e.eat(fl),t=yl(e),44===e.charCode()?(e.pos++,125!==e.charCode()&&(n=yl(e))):n=t,e.eat(125),{min:Number(t),max:n?Number(n):0}}function xl(e,t){let n=function(e){let t=null,n=!1;switch(e.charCode()){case 42:e.pos++,t={min:0,max:0};break;case 43:e.pos++,t={min:1,max:0};break;case 63:e.pos++,t={min:0,max:1};break;case 35:e.pos++,n=!0,e.charCode()===fl?t=kl(e):63===e.charCode()?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case fl:t=kl(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,35===e.charCode()&&43===e.charCodeAt(e.pos-1)?xl(e,n):n):t}function Sl(e){let t=e.peek();return""===t?null:{type:"Token",value:t}}function Cl(e){let t,n=null;return e.eat(60),t=wl(e),40===e.charCode()&&41===e.nextCharCode()&&(e.pos+=2,t+="()"),91===e.charCodeAt(e.findWsEnd(e.pos))&&(bl(e),n=function(e){let t=null,n=null,r=1;return e.eat(91),45===e.charCode()&&(e.peek(),r=-1),-1==r&&8734===e.charCode()?e.peek():(t=r*Number(yl(e)),0!==ml[e.charCode()]&&(t+=wl(e))),bl(e),e.eat(44),bl(e),8734===e.charCode()?e.peek():(r=1,45===e.charCode()&&(e.peek(),r=-1),n=r*Number(yl(e)),0!==ml[e.charCode()]&&(n+=wl(e))),e.eat(93),{type:"Range",min:t,max:n}}(e)),e.eat(62),xl(e,{type:"Type",name:t,opts:n})}function Ol(e,t){function n(e,t){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}let r;for(t=Object.keys(t).sort(((e,t)=>gl[e]-gl[t]));t.length>0;){r=t.shift();let o=0,i=0;for(;o1&&(e.splice(i,o-i,n(e.slice(i,o),r)),o=i+1),i=-1))}-1!==i&&t.length&&e.splice(i,o-i,n(e.slice(i,o),r))}return r}function Al(e){let t,n=[],r={},o=null,i=e.pos;for(;t=zl(e);)"Spaces"!==t.type&&("Combinator"===t.type?((null===o||"Combinator"===o.type)&&(e.pos=i,e.error("Unexpected combinator")),r[t.value]=!0):null!==o&&"Combinator"!==o.type&&(r[" "]=!0,n.push({type:"Combinator",value:" "})),n.push(t),o=t,i=e.pos);return null!==o&&"Combinator"===o.type&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:n,combinator:Ol(n,r)||" ",disallowEmpty:!1,explicit:!1}}function zl(e){let t=e.charCode();if(t<128&&1===ml[t])return function(e){let t=wl(e);return 40===e.charCode()?(e.pos++,{type:"Function",name:t}):xl(e,{type:"Keyword",name:t})}(e);switch(t){case 93:break;case 91:return xl(e,function(e){let t;return e.eat(91),t=Al(e),e.eat(93),t.explicit=!0,33===e.charCode()&&(e.pos++,t.disallowEmpty=!0),t}(e));case 60:return 39===e.nextCharCode()?function(e){let t;return e.eat(60),e.eat(39),t=wl(e),e.eat(39),e.eat(62),xl(e,{type:"Property",name:t})}(e):Cl(e);case 124:return{type:"Combinator",value:e.substringToPos(e.pos+(124===e.nextCharCode()?2:1))};case 38:return e.pos++,e.eat(38),{type:"Combinator",value:"&&"};case 44:return e.pos++,{type:"Comma"};case 39:return xl(e,{type:"String",value:vl(e)});case 32:case 9:case 10:case 13:case 12:return{type:"Spaces",value:bl(e)};case 64:return t=e.nextCharCode(),t<128&&1===ml[t]?(e.pos++,{type:"AtKeyword",name:wl(e)}):Sl(e);case 42:case 43:case 63:case 35:case 33:break;case fl:if(t=e.nextCharCode(),t<48||t>57)return Sl(e);break;default:return Sl(e)}}function El(e){let t=new class{constructor(e){this.str=e,this.pos=0}charCodeAt(e){return et})}};function jl(e,t){return"string"==typeof e?function(e){let t=[];return Ws(e,((n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null}))),t}(e):t.generate(e,Il)}var Ll={type:"Match"},Ml={type:"Mismatch"},_l={type:"DisallowEmpty"};function Rl(e,t,n){return t===Ll&&n===Ml||e===Ll&&t===Ll&&n===Ll?e:("If"===e.type&&e.else===Ml&&t===Ll&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function Fl(e){return e.length>2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function Dl(e){return"Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&Fl(e.name)}function Ul(e,t,n){switch(e){case" ":{let e=Ll;for(let n=t.length-1;n>=0;n--){e=Rl(t[n],e,Ml)}return e}case"|":{let e=Ml,n=null;for(let r=t.length-1;r>=0;r--){let o=t[r];if(Dl(o)&&(null===n&&r>0&&Dl(t[r-1])&&(n=Object.create(null),e=Rl({type:"Enum",map:n},Ll,e)),null!==n)){let e=(Fl(o.name)?o.name.slice(0,-1):o.name).toLowerCase();if(!(e in n)){n[e]=o;continue}}n=null,e=Rl(o,Ll,e)}return e}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let n=Ml;for(let r=t.length-1;r>=0;r--){let o,i=t[r];o=t.length>1?Ul(e,t.filter((function(e){return e!==i})),!1):Ll,n=Rl(i,o,n)}return n}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?Ll:Ml;for(let n=t.length-1;n>=0;n--){let o,i=t[n];o=t.length>1?Ul(e,t.filter((function(e){return e!==i})),!0):Ll,r=Rl(i,o,r)}return r}}}function ql(e){if("function"==typeof e)return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Ul(e.combinator,e.terms.map(ql),!1);return e.disallowEmpty&&(t=Rl(t,_l,Ml)),t}case"Multiplier":return function(e){let t=Ll,n=ql(e.term);if(0===e.max)n=Rl(n,_l,Ml),t=Rl(n,null,Ml),t.then=Rl(Ll,Ll,t),e.comma&&(t.then.else=Rl({type:"Comma",syntax:e},t,Ml));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==Ll&&(t=Rl({type:"Comma",syntax:e},t,Ml)),t=Rl(n,Rl(Ll,Ll,t),Ml);if(0===e.min)t=Rl(Ll,Ll,t);else for(let r=0;r=65&&o<=90&&(o|=32),o!==r)return!1}return!0}function Vl(e){return null===e||(18===e.type||2===e.type||21===e.type||19===e.type||23===e.type||function(e){return 9===e.type&&"?"!==e.value}(e))}function Gl(e){return null===e||(22===e.type||20===e.type||24===e.type||9===e.type&&"/"===e.value)}function Yl(e,t,n){let r=function(e,t,n){function r(){do{b++,g=bw&&(w=b)}function c(){y=2===y.type?y.prev:{type:3,syntax:u.syntax,token:y.token,prev:y},u=u.prev}let u=null,d=null,p=null,h=null,f=0,m=null,g=null,b=-1,w=0,y={type:0,syntax:null,token:null,prev:null};for(r();null===m&&++f<15e3;)switch(t.type){case"Match":if(null===d){if(null!==g&&(b!==e.length-1||"\\0"!==g.value&&"\\9"!==g.value)){t=Ml;break}m=$l;break}if((t=d.nextState)===_l){if(d.matchStack===y){t=Ml;break}t=Ll}for(;d.syntaxStack!==u;)c();d=d.prev;break;case"Mismatch":if(null!==h&&!1!==h)(null===p||b>p.tokenIndex)&&(p=h,h=!1);else if(null===p){m="Mismatch";break}t=p.nextState,d=p.thenStack,u=p.syntaxStack,y=p.matchStack,b=p.tokenIndex,g=bb){for(;b":"<'"+t.name+"'>"));if(!1!==h&&null!==g&&"Type"===t.type&&("custom-ident"===t.name&&1===g.type||"length"===t.name&&"0"===g.value)){null===h&&(h=i(t,p)),t=Ml;break}u={syntax:t.syntax,opts:t.syntax.opts||null!==u&&u.opts||null,prev:u},y={type:2,syntax:t.syntax,token:y.token,prev:y},t=r.match;break}case"Keyword":{let e=t.name;if(null!==g){let n=g.value;if(-1!==n.indexOf("\\")&&(n=n.replace(/\\[09].*$/,"")),Ql(n,e)){l(),t=Ll;break}}t=Ml;break}case"AtKeyword":case"Function":if(null!==g&&Ql(g.value,t.name)){l(),t=Ll;break}t=Ml;break;case"Token":if(null!==g&&g.value===t.value){l(),t=Ll;break}t=Ml;break;case"Comma":null!==g&&18===g.type?Vl(y.token)?t=Ml:(l(),t=Gl(g)?Ml:Ll):t=Vl(y.token)||Gl(g)?Ll:Ml;break;case"String":let r="",f=b;for(;f"Type"===e.type&&e.name===t))}function Xl(e,t){return ec(this,e,(e=>"Property"===e.type&&e.name===t))}function Zl(e){return ec(this,e,(e=>"Keyword"===e.type))}function ec(e,t,n){let r=Kl.call(e,t);return null!==r&&r.some(n)}function tc(e){return"node"in e?e.node:tc(e.match[0])}function nc(e){return"node"in e?e.node:nc(e.match[e.match.length-1])}function rc(e,t,n,r,o){let i=[];return null!==n.matched&&function n(s){if(null!==s.syntax&&s.syntax.type===r&&s.syntax.name===o){let n=tc(s),r=nc(s);e.syntax.walk(t,(function(e,t,o){if(e===n){let e=new $s;do{if(e.appendData(t.data),t.data===r)break;t=t.next}while(null!==t);i.push({parent:o,nodes:e})}}))}Array.isArray(s.match)&&s.match.forEach(n)}(n.matched),i}Ti(Jl,{getTrace:()=>Kl,isKeyword:()=>Zl,isProperty:()=>Xl,isType:()=>Hl});var{hasOwnProperty:oc}=Object.prototype;function ic(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&e>=0}function sc(e){return Boolean(e)&&ic(e.offset)&&ic(e.line)&&ic(e.column)}function ac(e,t){return function(n,r){if(!n||n.constructor!==Object)return r(n,"Type of node should be an Object");for(let o in n){let i=!0;if(!1!==oc.call(n,o)){if("type"===o)n.type!==e&&r(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if("loc"===o){if(null===n.loc)continue;if(n.loc&&n.loc.constructor===Object)if("string"!=typeof n.loc.source)o+=".source";else if(sc(n.loc.start)){if(sc(n.loc.end))continue;o+=".end"}else o+=".start";i=!1}else if(t.hasOwnProperty(o)){i=!1;for(let e=0;!i&&e");else{if(!Array.isArray(r))throw new Error("Wrong value `"+r+"` in `"+e+"."+t+"` structure definition");i.push("List")}}o[t]=i.join(" | ")}return{docs:o,check:ac(e,r)}}var cc=Wl(La.join(" | "));function uc(e,t,n){let r={};for(let o in e)e[o].syntax&&(r[o]=n?e[o].syntax:xa(e[o].syntax,{compact:t}));return r}function dc(e,t,n){let r={};for(let[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:xa(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&uc(i.descriptors,t,n)};return r}function pc(e,t,n){return mn({matched:e,iterations:n,error:t},Jl)}function hc(e,t,n,r){let o,i=jl(n,e.syntax);return function(e){for(let t=0;t(Object.defineProperty(i,"syntax",{value:El(e)}),i.syntax)}):i.syntax=e,Object.defineProperty(i,"match",{get:()=>(Object.defineProperty(i,"match",{value:Wl(i.syntax,o)}),i.match)})),i}addAtrule_(e,t){!t||(this.atrules[e]={type:"Atrule",name:e,prelude:t.prelude?this.createDescriptor(t.prelude,"AtrulePrelude",e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce(((n,r)=>(n[r]=this.createDescriptor(t.descriptors[r],"AtruleDescriptor",r,e),n)),Object.create(null)):null})}addProperty_(e,t){!t||(this.properties[e]=this.createDescriptor(t,"Property",e))}addType_(e,t){!t||(this.types[e]=this.createDescriptor(t,"Type",e))}checkAtruleName(e){if(!this.getAtrule(e))return new Aa("Unknown at-rule","@"+e)}checkAtrulePrelude(e,t){let n=this.checkAtruleName(e);if(n)return n;let r=this.getAtrule(e);return!r.prelude&&t?new SyntaxError("At-rule `@"+e+"` should not contain a prelude"):!r.prelude||t||hc(this,r.prelude,"",!1).matched?void 0:new SyntaxError("At-rule `@"+e+"` should contain a prelude")}checkAtruleDescriptorName(e,t){let n=this.checkAtruleName(e);if(n)return n;let r=this.getAtrule(e),o=Pa(t);return r.descriptors?r.descriptors[o.name]||r.descriptors[o.basename]?void 0:new Aa("Unknown at-rule descriptor",t):new SyntaxError("At-rule `@"+e+"` has no known descriptors")}checkPropertyName(e){if(!this.getProperty(e))return new Aa("Unknown property",e)}matchAtrulePrelude(e,t){let n=this.checkAtrulePrelude(e,t);if(n)return pc(null,n);let r=this.getAtrule(e);return r.prelude?hc(this,r.prelude,t||"",!1):pc(null,null)}matchAtruleDescriptor(e,t,n){let r=this.checkAtruleDescriptorName(e,t);if(r)return pc(null,r);let o=this.getAtrule(e),i=Pa(t);return hc(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return"Declaration"!==e.type?pc(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(Ta(e).custom)return pc(null,new Error("Lexer matching doesn't applicable for custom properties"));let n=this.checkPropertyName(e);return n?pc(null,n):hc(this,this.getProperty(e),t,!0)}matchType(e,t){let n=this.getType(e);return n?hc(this,n,t,!1):pc(null,new Aa("Unknown type",e))}match(e,t){return"string"==typeof e||e&&e.type?(("string"==typeof e||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),hc(this,e,t,!1)):pc(null,new Aa("Bad syntax"))}findValueFragments(e,t,n,r){return rc(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return rc(this,e.value,this.matchDeclaration(e),t,n)}findAllFragments(e,t,n){let r=[];return this.syntax.walk(e,{visit:"Declaration",enter:e=>{r.push.apply(r,this.findDeclarationValueFragments(e,t,n))}}),r}getAtrule(e,t=!0){let n=Pa(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(e,t=!0){let n=this.getAtrule(e,t);return n&&n.prelude||null}getAtruleDescriptor(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null}getProperty(e,t=!0){let n=Ta(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(e){return hasOwnProperty.call(this.types,e)?this.types[e]:null}validate(){function e(r,o,i,s){if(i.has(o))return i.get(o);i.set(o,!1),null!==s.syntax&&Tl(s.syntax,(function(s){if("Type"!==s.type&&"Property"!==s.type)return;let a="Type"===s.type?r.types:r.properties,l="Type"===s.type?t:n;(!hasOwnProperty.call(a,s.name)||e(r,s.name,l,a[s.name]))&&i.set(o,!0)}),this)}let t=new Map,n=new Map;for(let n in this.types)e(this,n,t,this.types[n]);for(let t in this.properties)e(this,t,n,this.properties[t]);return t=[...t.keys()].filter((e=>t.get(e))),n=[...n.keys()].filter((e=>n.get(e))),t.length||n.length?{types:t,properties:n}:null}dump(e,t){return{generic:this.generic,units:this.units,types:uc(this.types,!t,e),properties:uc(this.properties,!t,e),atrules:dc(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}};function mc(e,t){return"string"==typeof t&&/^\s*\|/.test(t)?"string"==typeof e?e+t:t.replace(/^\s*\|\s*/,""):t||null}function gc(e,t){let n=Object.create(null);for(let[r,o]of Object.entries(e))if(o){n[r]={};for(let e of Object.keys(o))t.includes(e)&&(n[r][e]=o[e])}return n}function bc(e,t){let n=mn({},e);for(let[r,o]of Object.entries(t))switch(r){case"generic":n[r]=Boolean(o);break;case"units":n[r]=mn({},e[r]);for(let[e,t]of Object.entries(o))n[r][e]=Array.isArray(t)?t:[];break;case"atrules":n[r]=mn({},e[r]);for(let[e,t]of Object.entries(o)){let o=n[r][e]||{},i=n[r][e]={prelude:o.prelude||null,descriptors:mn({},o.descriptors)};if(t){i.prelude=t.prelude?mc(i.prelude,t.prelude):i.prelude||null;for(let[e,n]of Object.entries(t.descriptors||{}))i.descriptors[e]=n?mc(i.descriptors[e],n):null;Object.keys(i.descriptors).length||(i.descriptors=null)}}break;case"types":case"properties":n[r]=mn({},e[r]);for(let[e,t]of Object.entries(o))n[r][e]=mc(n[r][e],t);break;case"scope":n[r]=mn({},e[r]);for(let[e,t]of Object.entries(o))n[r][e]=mn(mn({},n[r][e]),t);break;case"parseContext":n[r]=mn(mn({},e[r]),o);break;case"atrule":case"pseudo":n[r]=mn(mn({},e[r]),gc(o,["parse"]));break;case"node":n[r]=mn(mn({},e[r]),gc(o,["name","structure","parse","generate","walkContext"]))}return n}function wc(e){let t=Zs(e),n=ya(e),r=da(e),{fromPlainObject:o,toPlainObject:i}=function(e){return{fromPlainObject:t=>(e(t,{enter(e){e.children&&!(e.children instanceof $s)&&(e.children=(new $s).fromArray(e.children))}}),t),toPlainObject:t=>(e(t,{leave(e){e.children&&e.children instanceof $s&&(e.children=e.children.toArray())}}),t)}}(n),s={lexer:null,createLexer:e=>new fc(e,s,s.lexer.structure),tokenize:Ws,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(t){let n=bc({},e);return wc("function"==typeof t?t(n,Object.assign):bc(n,t))}};return s.lexer=new fc({generic:!0,units:e.units,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var yc={};Ti(yc,{AnPlusB:()=>vc,Atrule:()=>jc,AtrulePrelude:()=>qc,AttributeSelector:()=>Gc,Block:()=>eu,Brackets:()=>uu,CDC:()=>mu,CDO:()=>vu,ClassSelector:()=>Ou,Combinator:()=>Pu,Comment:()=>Mu,Declaration:()=>Uu,DeclarationList:()=>Hu,Dimension:()=>rd,Function:()=>ld,Hash:()=>fd,IdSelector:()=>Od,Identifier:()=>vd,MediaFeature:()=>Pd,MediaQuery:()=>Md,MediaQueryList:()=>Ud,NestingSelector:()=>Qd,Nth:()=>Kd,Number:()=>tp,Operator:()=>sp,Parentheses:()=>dp,Percentage:()=>gp,PseudoClassSelector:()=>kp,PseudoElementSelector:()=>zp,Ratio:()=>jp,Raw:()=>Dp,Rule:()=>Qp,Selector:()=>Zp,SelectorList:()=>oh,String:()=>uh,StyleSheet:()=>wh,TypeSelector:()=>Oh,UnicodeRange:()=>Th,Url:()=>Uh,Value:()=>Gh,WhiteSpace:()=>Xh});var vc={};Ti(vc,{generate:()=>Ic,name:()=>Nc,parse:()=>Tc,structure:()=>Pc});var kc=43,xc=45,Sc=110,Cc=!0;function Oc(e,t){let n=this.tokenStart+e,r=this.charCodeAt(n);for((r===kc||r===xc)&&(t&&this.error("Number sign is not allowed"),n++);n0&&this.skip(e),0===t&&(n=this.charCodeAt(this.tokenStart),n!==kc&&n!==xc&&this.error("Number sign is expected")),Ac.call(this,0!==t),t===xc?"-"+this.consume(10):this.consume(10)}var Nc="AnPlusB",Pc={a:[String,null],b:[String,null]};function Tc(){let e=this.tokenStart,t=null,n=null;if(10===this.tokenType)Ac.call(this,false),n=this.consume(10);else if(1===this.tokenType&&this.cmpChar(this.tokenStart,xc))switch(t="-1",zc.call(this,1,Sc),this.tokenEnd-this.tokenStart){case 2:this.next(),n=Ec.call(this);break;case 3:zc.call(this,2,xc),this.next(),this.skipSC(),Ac.call(this,Cc),n="-"+this.consume(10);break;default:zc.call(this,2,xc),Oc.call(this,3,Cc),this.next(),n=this.substrToCursor(e+2)}else if(1===this.tokenType||this.isDelim(kc)&&1===this.lookupType(1)){let r=0;switch(t="1",this.isDelim(kc)&&(r=1,this.next()),zc.call(this,0,Sc),this.tokenEnd-this.tokenStart){case 1:this.next(),n=Ec.call(this);break;case 2:zc.call(this,1,xc),this.next(),this.skipSC(),Ac.call(this,Cc),n="-"+this.consume(10);break;default:zc.call(this,1,xc),Oc.call(this,2,Cc),this.next(),n=this.substrToCursor(e+r+1)}}else if(12===this.tokenType){let r=this.charCodeAt(this.tokenStart),o=r===kc||r===xc,i=this.tokenStart+o;for(;iUc,name:()=>_c,parse:()=>Dc,structure:()=>Fc,walkContext:()=>Rc});var _c="Atrule",Rc="atrule",Fc={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function Dc(e=!1){let t,n,r=this.tokenStart,o=null,i=null;switch(this.eat(3),t=this.substrToCursor(r+1),n=t.toLowerCase(),this.skipSC(),!1===this.eof&&23!==this.tokenType&&17!==this.tokenType&&(o=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,t,e),Lc):Lc.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:i=hasOwnProperty.call(this.atrule,n)&&"function"==typeof this.atrule[n].block?this.atrule[n].block.call(this,e):this.Block(Mc.call(this))}return{type:"Atrule",loc:this.getLocation(r,this.tokenStart),name:t,prelude:o,block:i}}function Uc(e){this.token(3,"@"+e.name),null!==e.prelude&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var qc={};Ti(qc,{generate:()=>Vc,name:()=>Wc,parse:()=>Qc,structure:()=>$c,walkContext:()=>Bc});var Wc="AtrulePrelude",Bc="atrulePrelude",$c={children:[[]]};function Qc(e){let t=null;return null!==e&&(e=e.toLowerCase()),this.skipSC(),t=hasOwnProperty.call(this.atrule,e)&&"function"==typeof this.atrule[e].prelude?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.skipSC(),!0!==this.eof&&23!==this.tokenType&&17!==this.tokenType&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function Vc(e){this.children(e)}var Gc={};Ti(Gc,{generate:()=>Zc,name:()=>Kc,parse:()=>Xc,structure:()=>Hc});function Yc(){this.eof&&this.error("Unexpected end of input");let e=this.tokenStart,t=!1;return this.isDelim(42)?(t=!0,this.next()):this.isDelim(124)||this.eat(1),this.isDelim(124)?61!==this.charCodeAt(this.tokenStart+1)?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Jc(){let e=this.tokenStart,t=this.charCodeAt(e);return 61!==t&&126!==t&&94!==t&&36!==t&&42!==t&&124!==t&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),61!==t&&(this.isDelim(61)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var Kc="AttributeSelector",Hc={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Xc(){let e,t=this.tokenStart,n=null,r=null,o=null;return this.eat(19),this.skipSC(),e=Yc.call(this),this.skipSC(),20!==this.tokenType&&(1!==this.tokenType&&(n=Jc.call(this),this.skipSC(),r=5===this.tokenType?this.String():this.Identifier(),this.skipSC()),1===this.tokenType&&(o=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(t,this.tokenStart),name:e,matcher:n,value:r,flags:o}}function Zc(e){this.token(9,"["),this.node(e.name),null!==e.matcher&&(this.tokenize(e.matcher),this.node(e.value)),null!==e.flags&&this.token(1,e.flags),this.token(9,"]")}var eu={};Ti(eu,{generate:()=>cu,name:()=>iu,parse:()=>lu,structure:()=>au,walkContext:()=>su});function tu(e){return this.Raw(e,null,!0)}function nu(){return this.parseWithFallback(this.Rule,tu)}function ru(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function ou(){if(17===this.tokenType)return ru.call(this,this.tokenIndex);let e=this.parseWithFallback(this.Declaration,ru);return 17===this.tokenType&&this.next(),e}var iu="Block",su="block",au={children:[["Atrule","Rule","Declaration"]]};function lu(e){let t=e?ou:nu,n=this.tokenStart,r=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule.bind(this,e),tu));break;default:e&&this.isDelim(38)?r.push(nu.call(this)):r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function cu(e){this.token(23,"{"),this.children(e,(e=>{"Declaration"===e.type&&this.token(17,";")})),this.token(24,"}")}var uu={};Ti(uu,{generate:()=>fu,name:()=>du,parse:()=>hu,structure:()=>pu});var du="Brackets",pu={children:[[]]};function hu(e,t){let n=this.tokenStart,r=null;return this.eat(19),r=e.call(this,t),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:r}}function fu(e){this.token(9,"["),this.children(e),this.token(9,"]")}var mu={};Ti(mu,{generate:()=>yu,name:()=>gu,parse:()=>wu,structure:()=>bu});var gu="CDC",bu=[];function wu(){let e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function yu(){this.token(15,"--\x3e")}var vu={};Ti(vu,{generate:()=>Cu,name:()=>ku,parse:()=>Su,structure:()=>xu});var ku="CDO",xu=[];function Su(){let e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function Cu(){this.token(14,"\x3c!--")}var Ou={};Ti(Ou,{generate:()=>Nu,name:()=>Au,parse:()=>Eu,structure:()=>zu});var Au="ClassSelector",zu={name:String};function Eu(){return this.eatDelim(46),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function Nu(e){this.token(9,"."),this.token(1,e.name)}var Pu={};Ti(Pu,{generate:()=>Lu,name:()=>Tu,parse:()=>ju,structure:()=>Iu});var Tu="Combinator",Iu={name:String};function ju(){let e,t=this.tokenStart;switch(this.tokenType){case 13:e=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case 62:case 43:case 126:this.next();break;case 47:this.next(),this.eatIdent("deep"),this.eatDelim(47);break;default:this.error("Combinator is expected")}e=this.substrToCursor(t)}return{type:"Combinator",loc:this.getLocation(t,this.tokenStart),name:e}}function Lu(e){this.tokenize(e.name)}var Mu={};Ti(Mu,{generate:()=>Du,name:()=>_u,parse:()=>Fu,structure:()=>Ru});var _u="Comment",Ru={value:String};function Fu(){let e=this.tokenStart,t=this.tokenEnd;return this.eat(25),t-e+2>=2&&42===this.charCodeAt(t-2)&&47===this.charCodeAt(t-1)&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function Du(e){this.token(25,"/*"+e.value+"*/")}var Uu={};Ti(Uu,{generate:()=>Yu,name:()=>$u,parse:()=>Gu,structure:()=>Vu,walkContext:()=>Qu});function qu(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function Wu(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function Bu(){let e=this.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.eof&&17!==this.tokenType&&!1===this.isDelim(33)&&!1===this.isBalanceEdge(e)&&this.error(),t}var $u="Declaration",Qu="declaration",Vu={important:[Boolean,String],property:String,value:["Value","Raw"]};function Gu(){let e,t=this.tokenStart,n=this.tokenIndex,r=Ju.call(this),o=Ia(r),i=o?this.parseCustomProperty:this.parseValue,s=o?Wu:qu,a=!1;this.skipSC(),this.eat(16);let l=this.tokenIndex;if(o||this.skipSC(),e=i?this.parseWithFallback(Bu,s):s.call(this,this.tokenIndex),o&&"Value"===e.type&&e.children.isEmpty)for(let t=l-this.tokenIndex;t<=0;t++)if(13===this.lookupType(t)){e.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.isDelim(33)&&(a=Ku.call(this),this.skipSC()),!1===this.eof&&17!==this.tokenType&&!1===this.isBalanceEdge(n)&&this.error(),{type:"Declaration",loc:this.getLocation(t,this.tokenStart),important:a,property:r,value:e}}function Yu(e){this.token(1,e.property),this.token(16,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,!0===e.important?"important":e.important))}function Ju(){let e=this.tokenStart;if(9===this.tokenType)switch(this.charCodeAt(this.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.next();break;case 47:this.next(),this.isDelim(47)&&this.next()}return 4===this.tokenType?this.eat(4):this.eat(1),this.substrToCursor(e)}function Ku(){this.eat(9),this.skipSC();let e=this.consume(1);return"important"===e||e}var Hu={};Ti(Hu,{generate:()=>nd,name:()=>Zu,parse:()=>td,structure:()=>ed});function Xu(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var Zu="DeclarationList",ed={children:[["Declaration","Atrule","Rule"]]};function td(){let e=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;case 3:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),Xu));break;default:this.isDelim(38)?e.push(this.parseWithFallback(this.Rule,Xu)):e.push(this.parseWithFallback(this.Declaration,Xu))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function nd(e){this.children(e,(e=>{"Declaration"===e.type&&this.token(17,";")}))}var rd={};Ti(rd,{generate:()=>ad,name:()=>od,parse:()=>sd,structure:()=>id});var od="Dimension",id={value:String,unit:String};function sd(){let e=this.tokenStart,t=this.consumeNumber(12);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function ad(e){this.token(12,e.value+e.unit)}var ld={};Ti(ld,{generate:()=>hd,name:()=>cd,parse:()=>pd,structure:()=>dd,walkContext:()=>ud});var cd="Function",ud="function",dd={name:String,children:[[]]};function pd(e,t){let n,r=this.tokenStart,o=this.consumeFunctionName(),i=o.toLowerCase();return n=t.hasOwnProperty(i)?t[i].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(r,this.tokenStart),name:o,children:n}}function hd(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var fd={};Ti(fd,{generate:()=>yd,name:()=>gd,parse:()=>wd,structure:()=>bd,xxx:()=>md});var md="XXX",gd="Hash",bd={value:String};function wd(){let e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function yd(e){this.token(4,"#"+e.value)}var vd={};Ti(vd,{generate:()=>Cd,name:()=>kd,parse:()=>Sd,structure:()=>xd});var kd="Identifier",xd={name:String};function Sd(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function Cd(e){this.token(1,e.name)}var Od={};Ti(Od,{generate:()=>Nd,name:()=>Ad,parse:()=>Ed,structure:()=>zd});var Ad="IdSelector",zd={name:String};function Ed(){let e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function Nd(e){this.token(9,"#"+e.name)}var Pd={};Ti(Pd,{generate:()=>Ld,name:()=>Td,parse:()=>jd,structure:()=>Id});var Td="MediaFeature",Id={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function jd(){let e,t=this.tokenStart,n=null;if(this.eat(21),this.skipSC(),e=this.consume(1),this.skipSC(),22!==this.tokenType){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:n=9===this.lookupNonWSType(1)?this.Ratio():this.Number();break;case 12:n=this.Dimension();break;case 1:n=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eat(22),{type:"MediaFeature",loc:this.getLocation(t,this.tokenStart),name:e,value:n}}function Ld(e){this.token(21,"("),this.token(1,e.name),null!==e.value&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var Md={};Ti(Md,{generate:()=>Dd,name:()=>_d,parse:()=>Fd,structure:()=>Rd});var _d="MediaQuery",Rd={children:[["Identifier","MediaFeature","WhiteSpace"]]};function Fd(){let e=this.createList(),t=null;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 1:t=this.Identifier();break;case 21:t=this.MediaFeature();break;default:break e}e.push(t)}return null===t&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(e),children:e}}function Dd(e){this.children(e)}var Ud={};Ti(Ud,{generate:()=>$d,name:()=>qd,parse:()=>Bd,structure:()=>Wd});var qd="MediaQueryList",Wd={children:[["MediaQuery"]]};function Bd(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),18===this.tokenType);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function $d(e){this.children(e,(()=>this.token(18,",")))}var Qd={};Ti(Qd,{generate:()=>Jd,name:()=>Vd,parse:()=>Yd,structure:()=>Gd});var Vd="NestingSelector",Gd={};function Yd(){let e=this.tokenStart;return this.eatDelim(38),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Jd(){this.token(9,"&")}var Kd={};Ti(Kd,{generate:()=>ep,name:()=>Hd,parse:()=>Zd,structure:()=>Xd});var Hd="Nth",Xd={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function Zd(){this.skipSC();let e,t=this.tokenStart,n=t,r=null;return e=this.lookupValue(0,"odd")||this.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),n=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),n=this.tokenStart),{type:"Nth",loc:this.getLocation(t,n),nth:e,selector:r}}function ep(e){this.node(e.nth),null!==e.selector&&(this.token(1,"of"),this.node(e.selector))}var tp={};Ti(tp,{generate:()=>ip,name:()=>np,parse:()=>op,structure:()=>rp});var np="Number",rp={value:String};function op(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function ip(e){this.token(10,e.value)}var sp={};Ti(sp,{generate:()=>up,name:()=>ap,parse:()=>cp,structure:()=>lp});var ap="Operator",lp={value:String};function cp(){let e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function up(e){this.tokenize(e.value)}var dp={};Ti(dp,{generate:()=>mp,name:()=>pp,parse:()=>fp,structure:()=>hp});var pp="Parentheses",hp={children:[[]]};function fp(e,t){let n=this.tokenStart,r=null;return this.eat(21),r=e.call(this,t),this.eof||this.eat(22),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:r}}function mp(e){this.token(21,"("),this.children(e),this.token(22,")")}var gp={};Ti(gp,{generate:()=>vp,name:()=>bp,parse:()=>yp,structure:()=>wp});var bp="Percentage",wp={value:String};function yp(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function vp(e){this.token(11,e.value+"%")}var kp={};Ti(kp,{generate:()=>Ap,name:()=>xp,parse:()=>Op,structure:()=>Cp,walkContext:()=>Sp});var xp="PseudoClassSelector",Sp="function",Cp={name:String,children:[["Raw"],null]};function Op(){let e,t,n=this.tokenStart,r=null;return this.eat(16),2===this.tokenType?(e=this.consumeFunctionName(),t=e.toLowerCase(),hasOwnProperty.call(this.pseudo,t)?(this.skipSC(),r=this.pseudo[t].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(this.tokenIndex,null,!1))),this.eat(22)):e=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(n,this.tokenStart),name:e,children:r}}function Ap(e){this.token(16,":"),null===e.children?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var zp={};Ti(zp,{generate:()=>Ip,name:()=>Ep,parse:()=>Tp,structure:()=>Pp,walkContext:()=>Np});var Ep="PseudoElementSelector",Np="function",Pp={name:String,children:[["Raw"],null]};function Tp(){let e,t,n=this.tokenStart,r=null;return this.eat(16),this.eat(16),2===this.tokenType?(e=this.consumeFunctionName(),t=e.toLowerCase(),hasOwnProperty.call(this.pseudo,t)?(this.skipSC(),r=this.pseudo[t].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(this.tokenIndex,null,!1))),this.eat(22)):e=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(n,this.tokenStart),name:e,children:r}}function Ip(e){this.token(16,":"),this.token(16,":"),null===e.children?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var jp={};Ti(jp,{generate:()=>Fp,name:()=>Mp,parse:()=>Rp,structure:()=>_p});function Lp(){this.skipSC();let e=this.consume(10);for(let t=0;t0&&13===this.lookupType(-1)?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}Ti(Dp,{generate:()=>$p,name:()=>qp,parse:()=>Bp,structure:()=>Wp});var qp="Raw",Wp={value:String};function Bp(e,t,n){let r,o=this.getTokenStart(e);return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),r=n&&this.tokenStart>o?Up.call(this):this.tokenStart,{type:"Raw",loc:this.getLocation(o,r),value:this.substring(o,r)}}function $p(e){this.tokenize(e.value)}var Qp={};function Vp(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function Gp(){let e=this.SelectorList();return"Raw"!==e.type&&!1===this.eof&&23!==this.tokenType&&this.error(),e}Ti(Qp,{generate:()=>Xp,name:()=>Yp,parse:()=>Hp,structure:()=>Kp,walkContext:()=>Jp});var Yp="Rule",Jp="rule",Kp={prelude:["SelectorList","Raw"],block:["Block"]};function Hp(){let e,t,n=this.tokenIndex,r=this.tokenStart;return e=this.parseRulePrelude?this.parseWithFallback(Gp,Vp):Vp.call(this,n),t=this.Block(!0),{type:"Rule",loc:this.getLocation(r,this.tokenStart),prelude:e,block:t}}function Xp(e){this.node(e.prelude),this.node(e.block)}var Zp={};Ti(Zp,{generate:()=>rh,name:()=>eh,parse:()=>nh,structure:()=>th});var eh="Selector",th={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function nh(){let e=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(e)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function rh(e){this.children(e)}var oh={};Ti(oh,{generate:()=>ch,name:()=>ih,parse:()=>lh,structure:()=>ah,walkContext:()=>sh});var ih="SelectorList",sh="selector",ah={children:[["Selector","Raw"]]};function lh(){let e=this.createList();for(;!this.eof&&(e.push(this.Selector()),18===this.tokenType);)this.next();return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function ch(e){this.children(e,(()=>this.token(18,",")))}var uh={};Ti(uh,{generate:()=>bh,name:()=>fh,parse:()=>gh,structure:()=>mh});var dh={};Ti(dh,{decode:()=>ph,encode:()=>hh});function ph(e){let t=e.length,n=e.charCodeAt(0),r=34===n||39===n?1:0,o=1===r&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1,i="";for(let n=r;n<=o;n++){let r=e.charCodeAt(n);if(92===r){if(n===o){n!==t-1&&(i=e.substr(n+1));break}if(r=e.charCodeAt(++n),ws(92,r)){let t=n-1,r=Ts(e,t);n=r-1,i+=Ms(e.substring(t+1,r))}else 13===r&&10===e.charCodeAt(n+1)&&n++}else i+=e[n]}return i}function hh(e,t){let n=t?"'":'"',r=t?39:34,o="",i=!1;for(let t=0;tCh,name:()=>vh,parse:()=>Sh,structure:()=>xh,walkContext:()=>kh});function yh(e){return this.Raw(e,null,!1)}var vh="StyleSheet",kh="stylesheet",xh={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function Sh(){let e,t=this.tokenStart,n=this.createList();for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(33!==this.charCodeAt(this.tokenStart+2)){this.next();continue}e=this.Comment();break;case 14:e=this.CDO();break;case 15:e=this.CDC();break;case 3:e=this.parseWithFallback(this.Atrule,yh);break;default:e=this.parseWithFallback(this.Rule,yh)}n.push(e)}return{type:"StyleSheet",loc:this.getLocation(t,this.tokenStart),children:n}}function Ch(e){this.children(e)}var Oh={};Ti(Oh,{generate:()=>Ph,name:()=>zh,parse:()=>Nh,structure:()=>Eh});function Ah(){1!==this.tokenType&&!1===this.isDelim(42)&&this.error("Identifier or asterisk is expected"),this.next()}var zh="TypeSelector",Eh={name:String};function Nh(){let e=this.tokenStart;return this.isDelim(124)?(this.next(),Ah.call(this)):(Ah.call(this),this.isDelim(124)&&(this.next(),Ah.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Ph(e){this.tokenize(e.name)}var Th={};Ti(Th,{generate:()=>Dh,name:()=>_h,parse:()=>Fh,structure:()=>Rh});function Ih(e,t){let n=0;for(let r=this.tokenStart+e;r6&&this.error("Too many hex digits",r)}return this.next(),n}function jh(e){let t=0;for(;this.isDelim(63);)++t>e&&this.error("Too many question marks"),this.next()}function Lh(e){this.charCodeAt(this.tokenStart)!==e&&this.error((43===e?"Plus sign":"Hyphen minus")+" is expected")}function Mh(){let e=0;switch(this.tokenType){case 10:if(e=Ih.call(this,1,!0),this.isDelim(63)){jh.call(this,6-e);break}if(12===this.tokenType||10===this.tokenType){Lh.call(this,45),Ih.call(this,1,!1);break}break;case 12:e=Ih.call(this,1,!0),e>0&&jh.call(this,6-e);break;default:if(this.eatDelim(43),1===this.tokenType){e=Ih.call(this,0,!0),e>0&&jh.call(this,6-e);break}if(this.isDelim(63)){this.next(),jh.call(this,5);break}this.error("Hex digit or question mark is expected")}}var _h="UnicodeRange",Rh={value:String};function Fh(){let e=this.tokenStart;return this.eatIdent("u"),Mh.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Dh(e){this.tokenize(e.value)}var Uh={};Ti(Uh,{generate:()=>Vh,name:()=>Bh,parse:()=>Qh,structure:()=>$h});Ti({},{decode:()=>qh,encode:()=>Wh});function qh(e){let t=e.length,n=4,r=41===e.charCodeAt(t-1)?t-2:t-1,o="";for(;nHh,name:()=>Yh,parse:()=>Kh,structure:()=>Jh});var Yh="Value",Jh={children:[[]]};function Kh(){let e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function Hh(e){this.children(e)}var Xh={};Ti(Xh,{generate:()=>rf,name:()=>ef,parse:()=>nf,structure:()=>tf});var Zh=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),ef="WhiteSpace",tf={value:String};function nf(){return this.eat(13),Zh}function rf(e){this.token(13,e.value)}var of=mn(mn({generic:!0},{generic:!0,units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( )","alpha-value":"|","angle-percentage":"|","angular-color-hint":"","angular-color-stop":"&&?","angular-color-stop-list":"[ [, ]?]# , ","animateable-feature":"scroll-position|contents|","asin()":"asin( )","atan()":"atan( )","atan2()":"atan2( , )",attachment:"scroll|fixed|local","attr()":"attr( ? [, ]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' ']'|'[' [|] ? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [? ]+ ? )","auto-track-list":"[? [|]]* ? [? [|]]* ?",axis:"block|inline|vertical|horizontal","baseline-position":"[first|last]? baseline","basic-shape":"||||","bg-image":"none|","bg-layer":"|| [/ ]?||||||||","bg-position":"[[left|center|right|top|bottom|]|[left|center|right|] [top|center|bottom|]|[center|[left|right] ?]&&[center|[top|bottom] ?]]","bg-size":"[|auto]{1,2}|cover|contain","blur()":"blur( )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( )","calc()":"calc( )","calc-sum":" [['+'|'-'] ]*","calc-product":" ['*' |'/' ]*","calc-value":"||||( )","calc-constant":"e|pi|infinity|-infinity|NaN","cf-final-image":"|","cf-mixing-image":"?&&","circle()":"circle( []? [at ]? )","clamp()":"clamp( #{3} )","class-selector":"'.' ","clip-source":"",color:"|||||||||currentcolor|","color-stop":"|","color-stop-angle":"{1,2}","color-stop-length":"{1,2}","color-stop-list":"[ [, ]?]# , ",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[? * [ *]*]!","compound-selector-list":"#","complex-selector":" [? ]*","complex-selector-list":"#","conic-gradient()":"conic-gradient( [from ]? [at ]? , )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[|contents||||||]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"","contrast()":"contrast( [] )","cos()":"cos( )",counter:"|","counter()":"counter( , ? )","counter-name":"","counter-style":"|symbols( )","counter-style-name":"","counters()":"counters( , , ? )","cross-fade()":"cross-fade( , ? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( , , , )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( {2,3} ? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( , [first|start|last|first-except]? )|element( )","ellipse()":"ellipse( [{2}]? [at ]? )","ending-shape":"circle|ellipse","env()":"env( , ? )","exp()":"exp( )","explicit-track-list":"[? ]+ ?","family-name":"|+","feature-tag-value":" [|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":" '{' '}'","feature-value-block-list":"+","feature-value-declaration":" : + ;","feature-value-declaration-list":"","feature-value-name":"","fill-rule":"nonzero|evenodd","filter-function":"|||||||||","filter-function-list":"[|]+","final-bg-layer":"<'background-color'>|||| [/ ]?||||||||","fixed-breadth":"","fixed-repeat":"repeat( [] , [? ]+ ? )","fixed-size":"|minmax( , )|minmax( , )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|","frequency-percentage":"|","general-enclosed":"[ )]|( )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"|fill-box|stroke-box|view-box",gradient:"||||||<-legacy-gradient>","grayscale()":"grayscale( )","grid-line":"auto||[&&?]|[span&&[||]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( [/ ]? )|hsl( , , , ? )","hsla()":"hsla( [/ ]? )|hsla( , , , ? )",hue:"|","hue-rotate()":"hue-rotate( )","hwb()":"hwb( [|none] [|none] [|none] [/ [|none]]? )","hypot()":"hypot( # )",image:"||||||","image()":"image( ? [? , ?]! )","image-set()":"image-set( # )","image-set-option":"[|] [||type( )]","image-src":"|","image-tags":"ltr|rtl","inflexible-breadth":"|min-content|max-content|auto","inset()":"inset( {1,4} [round <'border-radius'>]? )","invert()":"invert( )","keyframes-name":"|","keyframe-block":"# { }","keyframe-block-list":"+","keyframe-selector":"from|to|","lab()":"lab( [||none] [||none] [||none] [/ [|none]]? )","layer()":"layer( )","layer-name":" ['.' ]*","lch()":"lch( [||none] [||none] [|none] [/ [|none]]? )","leader()":"leader( )","leader-type":"dotted|solid|space|","length-percentage":"|","line-names":"'[' * ']'","line-name-list":"[|]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"|thin|medium|thick","linear-color-hint":"","linear-color-stop":" ?","linear-gradient()":"linear-gradient( [|to ]? , )","log()":"log( , ? )","mask-layer":"|| [/ ]?||||||[|no-clip]||||","mask-position":"[|left|center|right] [|top|center|bottom]?","mask-reference":"none||","mask-source":"","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( #{6} )","matrix3d()":"matrix3d( #{16} )","max()":"max( # )","media-and":" [and ]+","media-condition":"|||","media-condition-without-or":"||","media-feature":"( [||] )","media-in-parens":"( )||","media-not":"not ","media-or":" [or ]+","media-query":"|[not|only]? [and ]?","media-query-list":"#","media-type":"","mf-boolean":"","mf-name":"","mf-plain":" : ","mf-range":" ['<'|'>']? '='? | ['<'|'>']? '='? | '<' '='? '<' '='? | '>' '='? '>' '='? ","mf-value":"|||","min()":"min( # )","minmax()":"minmax( [|min-content|max-content|auto] , [||min-content|max-content|auto] )","mod()":"mod( , )","name-repeat":"repeat( [|auto-fill] , + )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"","ns-prefix":"[|'*']? '|'","number-percentage":"|","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"|even|odd","opacity()":"opacity( [] )","overflow-position":"unsafe|safe","outline-radius":"|","page-body":"? [; ]?| ","page-margin-box":" '{' '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[#]?","page-selector":"+| *","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [ ,]? )","paint()":"paint( , ? )","perspective()":"perspective( [|none] )","polygon()":"polygon( ? , [ ]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|] [top|center|bottom|]?|[[left|right] ]&&[[top|bottom] ]]","pow()":"pow( , )","pseudo-class-selector":"':' |':' ')'","pseudo-element-selector":"':' ","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [||]? [at ]? , )",ratio:" [/ ]?","relative-selector":"? ","relative-selector-list":"#","relative-size":"larger|smaller","rem()":"rem( , )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from ]? [at ]? , )","repeating-linear-gradient()":"repeating-linear-gradient( [|to ]? , )","repeating-radial-gradient()":"repeating-radial-gradient( [||]? [at ]? , )","reversed-counter-name":"reversed( )","rgb()":"rgb( {3} [/ ]? )|rgb( {3} [/ ]? )|rgb( #{3} , ? )|rgb( #{3} , ? )","rgba()":"rgba( {3} [/ ]? )|rgba( {3} [/ ]? )|rgba( #{3} , ? )|rgba( #{3} , ? )","rotate()":"rotate( [|] )","rotate3d()":"rotate3d( , , , [|] )","rotateX()":"rotateX( [|] )","rotateY()":"rotateY( [|] )","rotateZ()":"rotateZ( [|] )","round()":"round( ? , , )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( )","scale()":"scale( [|]#{1,2} )","scale3d()":"scale3d( [|]#{3} )","scaleX()":"scaleX( [|] )","scaleY()":"scaleY( [|] )","scaleZ()":"scaleZ( [|] )",scroller:"root|nearest","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"|closest-side|farthest-side","sign()":"sign( )","skew()":"skew( [|] , [|]? )","skewX()":"skewX( [|] )","skewY()":"skewY( [|] )","sepia()":"sepia( )",shadow:"inset?&&{2,4}&&?","shadow-t":"[{2,3}&&?]",shape:"rect( , , , )|rect( )","shape-box":"|margin-box","side-or-corner":"[left|right]||[top|bottom]","sin()":"sin( )","single-animation":"