[
  {
    "path": ".browserslistrc",
    "content": "[chrome]\nChrome >= 123\nEdge >= 123\nOpera >= 109\n\n[edge]\nEdge >= 123\n\n[firefox]\nFirefox >= 115\n\n[opera]\nOpera >= 109\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: dessant\npatreon: dessant\ncustom:\n  - https://armin.dev/go/paypal\n  - https://armin.dev/go/bitcoin\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report if something isn't working as expected\n\n---\n\n<!--\nYou may experience a temporary block when trying to solve a reCAPTCHA audio challenge.\nThis error is outside the control of the extension, and should not be reported as a bug.\nVisit the wiki to learn more about the issue.\n\nhttps://github.com/dessant/buster/wiki/Inaccessible-reCAPTCHA-audio-challenge\n\nFull automation and scripting are not within the scope of this project due to the potential for misuse.\nThe solver must always be manually started from the extension button.\n -->\n\n**System**\n<!-- Fill out the template below with the requested information. -->\n\n* OS name: [e.g. Windows, Ubuntu]\n* OS version: [e.g. 10]\n* Browser name: [e.g. Chrome, Firefox]\n* Browser version: [e.g. 60]\n\n**Extension**\n<!-- Fill out the template below with the requested information. -->\n\n* Extension version: [e.g. 1.0.0]\n<!-- Check if the feature is enabled on the options page. -->\n* User input simulation: [e.g. yes, no]\n<!-- Fill out only if you have downloaded the client app. -->\n* Client app version: [e.g. 1.0.0]\n* Client app installed successfully: [e.g. yes, no]\n\n**Bug description**\n<!--\nDescribe what the bug is and how to reproduce it. List each step\nthat is required to reproduce the issue. Mention any browser features\nor installed extensions that may trigger the bug. If applicable,\nattach screenshots.\n-->\n\n**Logs**\n\n<!--\nIf there was an error, open the browser console (Ctrl+Shift+J)\nand share its recent output.\n-->\nBrowser:\n```\n// REPLACE WITH LOGS\n```\n\n<!--\nIf you are using the client app, find the `buster-client-log.txt` file\nin the temp folder (e.g. `C:\\Users\\<user>\\AppData\\Local\\Temp`)\nand share its contents.\n-->\nClient app:\n```\n// REPLACE WITH LOGS\n```\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\n\n---\n\n<!--\nFull automation and scripting are not within the scope of this project due to the potential for misuse.\nThe solver must always be manually started from the extension button.\n -->\n\n**Is your feature request related to a problem? Please describe.**\n<!-- A clear and concise description of what the problem is. -->\n\n**Describe the solution you'd like**\n<!-- A clear and concise description of what you want to happen. -->\n\n**Describe alternatives you've considered**\n<!-- Description of any alternative solutions or features you've considered. -->\n\n**Additional context**\n<!-- Add any other context or screenshots about the feature request here. -->\n"
  },
  {
    "path": ".github/label-actions.yml",
    "content": "# Configuration for Label Actions - https://github.com/dessant/label-actions\n\nincomplete:\n  issues:\n    comment: >\n      @{issue-author}, the issue does not contain enough information\n      to reproduce the bug. Please open a new bug report and fill out\n      the issue template with the requested data.\n    close: true\nwontfix-automation:\n  issues:\n    comment: >\n      @{issue-author}, full automation and scripting are not within the scope\n      of this project due to the potential for misuse.\n      The solver must always be manually started from the extension button.\n    close: true\nrecaptcha-error:\n  issues:\n    comment: |\n      You may experience a temporary block when trying to solve a reCAPTCHA audio challenge. Visit the wiki to learn more about the issue and the steps you can take to minimize the risk of a temporary block.\n\n      https://github.com/dessant/buster/wiki/Inaccessible-reCAPTCHA-audio-challenge\n    close: true\n"
  },
  {
    "path": ".github/pull_request_template.md",
    "content": "This project does not accept pull requests. Please use issues to report bugs or suggest new features.\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: CI\n\non: push\n\njobs:\n  build:\n    name: Build\n    runs-on: ubuntu-22.04\n    permissions:\n      contents: read\n    steps:\n      - name: Clone repository\n        uses: actions/checkout@v4\n        with:\n          persist-credentials: 'false'\n      - name: Setup Node.js\n        uses: actions/setup-node@v4\n        with:\n          node-version-file: '.nvmrc'\n          cache: 'npm'\n      - name: Install dependencies\n        run: npm install --legacy-peer-deps\n      - name: Build artifacts\n        run: |\n          npm run build:prod:zip:chrome\n          npm run build:prod:zip:edge\n          npm run build:prod:zip:firefox\n          npm run build:prod:zip:opera\n        env:\n          BUSTER_SECRETS: ${{ secrets.BUSTER_SECRETS }}\n      - name: Hash artifacts\n        run: sha256sum artifacts/*/*\n        if: startsWith(github.ref, 'refs/tags/v')\n      - name: Upload artifacts\n        uses: actions/upload-artifact@v4\n        if: startsWith(github.ref, 'refs/tags/v')\n        with:\n          name: artifacts\n          path: artifacts/\n          retention-days: 1\n  release:\n    name: Release on GitHub\n    runs-on: ubuntu-22.04\n    needs: [build]\n    if: startsWith(github.ref, 'refs/tags/v')\n    permissions:\n      contents: write\n    steps:\n      - name: Download artifacts\n        uses: actions/download-artifact@v4\n        with:\n          name: artifacts\n          path: artifacts/\n      - name: Hash artifacts\n        run: sha256sum artifacts/*/*\n      - name: Create GitHub release\n        uses: softprops/action-gh-release@v2\n        with:\n          tag_name: ${{ github.ref_name }}\n          name: ${{ github.ref_name }}\n          body: |\n            Download and install the extension from the [extension store](https://github.com/dessant/buster#readme) of your browser.\n\n            Learn more about this release from the [changelog](https://github.com/dessant/buster/blob/main/CHANGELOG.md#changelog).\n          files: artifacts/*/*\n          fail_on_unmatched_files: true\n          draft: true\n"
  },
  {
    "path": ".github/workflows/label-actions.yml",
    "content": "name: 'Label Actions'\n\non:\n  issues:\n    types: [labeled, unlabeled]\n  pull_request:\n    types: [labeled, unlabeled]\n\npermissions:\n  contents: read\n  issues: write\n  pull-requests: write\n\njobs:\n  action:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: dessant/label-actions@v4\n"
  },
  {
    "path": ".github/workflows/lockdown.yml",
    "content": "name: 'Repo Lockdown'\n\non:\n  pull_request_target:\n    types: opened\n\npermissions:\n  pull-requests: write\n\njobs:\n  action:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: dessant/repo-lockdown@v4\n        with:\n          exclude-pr-created-before: '2021-11-02T00:00:00Z'\n          pr-comment: 'This project does not accept pull requests. Please use issues to report bugs or suggest new features.'\n          process-only: 'prs'\n"
  },
  {
    "path": ".gitignore",
    "content": "/.assets/\n/app/\n/artifacts/\n/dist/\n\n/secrets.json\n\n/report.json\n/report.html\n\n/web-ext-config.js\n\nnode_modules/\n/npm-debug.log\n\n/.vscode\n\nxcuserdata/\n\n.DS_Store\n"
  },
  {
    "path": ".nvmrc",
    "content": "20.14.0\n"
  },
  {
    "path": ".prettierignore",
    "content": "package.json\n*.md\n"
  },
  {
    "path": ".prettierrc.yml",
    "content": "singleQuote: true\nbracketSpacing: false\narrowParens: 'avoid'\ntrailingComma: 'none'\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.\n\n## [3.1.0](https://github.com/dessant/buster/compare/v3.0.0...v3.1.0) (2024-06-04)\n\n\n### Features\n\n* reload options page when client app is installed ([290dfba](https://github.com/dessant/buster/commit/290dfbac14c973e8efe007012419d7c583510d14))\n* upgrade to Manifest V3 in Edge and Opera ([f3e09bf](https://github.com/dessant/buster/commit/f3e09bfb82404bc90afeea4c79d09f976156da76))\n\n\n### Bug Fixes\n\n* omit cookies from API requests ([cb4811e](https://github.com/dessant/buster/commit/cb4811e84121b306a640ccdcb96a2dff1448d24b))\n* workaround for IBM Watson error ([cd1312e](https://github.com/dessant/buster/commit/cd1312ecb31fe89e493550fcdbd3fe78df104bef)), closes [#405](https://github.com/dessant/buster/issues/405)\n\n## [3.0.0](https://github.com/dessant/buster/compare/v2.0.1...v3.0.0) (2024-05-28)\n\n\n### ⚠ BREAKING CHANGES\n\n* browser versions older than Chrome 123, Edge 123,\nFirefox 115 and Opera 109 are no longer supported\n\n### Features\n\n* upgrade to Manifest V3 in Chrome ([42149b3](https://github.com/dessant/buster/commit/42149b35b70b93483165b210a2fdc7c6f643bde0))\n\n### [2.0.1](https://github.com/dessant/buster/compare/v2.0.0...v2.0.1) (2022-12-16)\n\n\n### Bug Fixes\n\n* set color scheme ([57c941a](https://github.com/dessant/buster/commit/57c941ae685b367504da03f94bf5d74ddd645ddf))\n\n## [2.0.0](https://github.com/dessant/buster/compare/v1.3.2...v2.0.0) (2022-12-15)\n\n\n### ⚠ BREAKING CHANGES\n\n* the options for speech recognition services have changed,\nthe configuration of certain services may be needed\n* browser versions older than Chrome 92, Edge 92,\nFirefox 91, and Opera 78 are no longer supported\n\n### Features\n\n* migrate to Vuetify ([c921f65](https://github.com/dessant/buster/commit/c921f6509e515158491b4878ab5a4bb075b1a048))\n\n\n### Bug Fixes\n\n* update speech recognition services ([cd84690](https://github.com/dessant/buster/commit/cd84690f362773d4123e838299e07825a67812b4))\n\n### [1.3.2](https://github.com/dessant/buster/compare/v1.3.1...v1.3.2) (2022-09-01)\n\n\n### Bug Fixes\n\n* set correct tabindex for extension button ([d68ce72](https://github.com/dessant/buster/commit/d68ce72e8d3664939cac5ce677c2dfd988ea732a))\n* update client app navigation ([3fae62e](https://github.com/dessant/buster/commit/3fae62ee4adde746ab46299732df7535c81592bd)), closes [#360](https://github.com/dessant/buster/issues/360)\n\n### [1.3.1](https://github.com/dessant/buster/compare/v1.3.0...v1.3.1) (2021-11-02)\n\n\n### Bug Fixes\n\n* update challenge reset ([3d0fb37](https://github.com/dessant/buster/commit/3d0fb3768b05138fc0b6766b5ed107bffac4a380))\n\n## [1.3.0](https://github.com/dessant/buster/compare/v1.2.2...v1.3.0) (2021-09-25)\n\n\n### Features\n\n* link to guide for configuring Google Cloud Speech to Text ([8930b1c](https://github.com/dessant/buster/commit/8930b1cf51447bc656d528f83a209075fa07e121))\n* link to guide for configuring IBM Watson Speech to Text ([ead4292](https://github.com/dessant/buster/commit/ead4292c7c208f9730e6a54e85dec6701fa9b7ed))\n* link to guide for configuring Microsoft Azure Speech to Text ([36afd65](https://github.com/dessant/buster/commit/36afd655feed3f62760c257adf9a4a72f711bec5))\n\n\n### Bug Fixes\n\n* add new API location for IBM Watson ([da8266b](https://github.com/dessant/buster/commit/da8266bf739905de9d2522625cca625852e8952c))\n* add new API locations for Microsoft Azure ([bce1cbb](https://github.com/dessant/buster/commit/bce1cbb36c25763b1c01e263a67f5079c510b654))\n* update speech service names ([10cf778](https://github.com/dessant/buster/commit/10cf778ce69bff0a184d8a28d0d06aff752d0354))\n\n### [1.2.2](https://github.com/dessant/buster/compare/v1.2.1...v1.2.2) (2021-07-23)\n\n### [1.2.1](https://github.com/dessant/buster/compare/v1.2.0...v1.2.1) (2021-05-14)\n\n\n### Bug Fixes\n\n* do not bundle source maps with Opera package ([187622b](https://github.com/dessant/buster/commit/187622b83a0edaeb1318feb68249bd342fd0951d))\n\n## [1.2.0](https://github.com/dessant/buster/compare/v1.1.1...v1.2.0) (2021-04-29)\n\n\n### Features\n\n* automatically clear non-critical error notifications ([ab03085](https://github.com/dessant/buster/commit/ab03085b0e156aa0bfccf6448222a003f2690386)), closes [#253](https://github.com/dessant/buster/issues/253)\n\n\n### Bug Fixes\n\n* handle new reCAPTCHA host ([9d092c2](https://github.com/dessant/buster/commit/9d092c2c39f2d018455a4333fad417f6d500c360)), closes [#290](https://github.com/dessant/buster/issues/290)\n* serve AMD64 client app installer for ARM macOS devices ([17c0a38](https://github.com/dessant/buster/commit/17c0a383afbb0e54ef9434abc6bd3e9f2d7efd68)), closes [#261](https://github.com/dessant/buster/issues/261)\n\n### [1.1.1](https://github.com/dessant/buster/compare/v1.1.0...v1.1.1) (2020-10-12)\n\n\n### Bug Fixes\n\n* Opera add-ons does not accept the .enc file extension ([317eb95](https://github.com/dessant/buster/commit/317eb95f6c248013e1f296f49f71ca940b0b63e8))\n\n## [1.1.0](https://github.com/dessant/buster/compare/v1.0.1...v1.1.0) (2020-10-12)\n\n\n### Features\n\n* add support for reCAPTCHA Enterprise ([092f3b9](https://github.com/dessant/buster/commit/092f3b9492abf48b92539b4bb5670273bfced88e)), closes [#236](https://github.com/dessant/buster/issues/236)\n* create new section for client app options ([15ae99e](https://github.com/dessant/buster/commit/15ae99ea1395855c8d2db3707661328f1452a0eb))\n* link to guide for configuring Wit.ai ([31f915f](https://github.com/dessant/buster/commit/31f915f517be8e8c70541b059fed2ee5c32af279))\n* navigate with client app using keyboard ([d34f5fa](https://github.com/dessant/buster/commit/d34f5fa8b715e95ae921e0490223817f9accb111)), closes [#168](https://github.com/dessant/buster/issues/168)\n* support Chrome Incognito ([39cf3c0](https://github.com/dessant/buster/commit/39cf3c02efb40bec69e2de4124563120c0b1074d))\n\n\n### Bug Fixes\n\n* increase favicon size ([2df4816](https://github.com/dessant/buster/commit/2df48169e1fca5241595eaa513d27fe68561b5ed))\n* inject assets in challenge frames loaded from alternative URLs ([ce2d942](https://github.com/dessant/buster/commit/ce2d9424f55210c1fe000ef48490317816f27532))\n* move mouse to the correct position when only text is zoomed in Firefox ([692340c](https://github.com/dessant/buster/commit/692340c5aa16425e0d6f762a2f33119257c33ea9)), closes [#133](https://github.com/dessant/buster/issues/133)\n* show actionable error message when API quota is exceeded ([d01968d](https://github.com/dessant/buster/commit/d01968d5b46694ea84ba643a95ba29ce46e52c31))\n\n### [1.0.1](https://github.com/dessant/buster/compare/v1.0.0...v1.0.1) (2020-06-14)\n\n\n### Bug Fixes\n\n* set challenge locale when widget is loaded from recaptcha.net ([edb7402](https://github.com/dessant/buster/commit/edb74021ef14cefc5d407cabedb0fe8e813b8711))\n\n## [1.0.0](https://github.com/dessant/buster/compare/v0.7.3...v1.0.0) (2020-06-14)\n\n\n### ⚠ BREAKING CHANGES\n\n* browser versions before Chrome 76, Firefox 68 and Opera 63\nare no longer supported\n\n### Bug Fixes\n\n* add extension button when challenge assets are loaded from recaptcha.net ([afbde57](https://github.com/dessant/buster/commit/afbde578cfb21f388f8415adbe99997e8a037c3b)), closes [#194](https://github.com/dessant/buster/issues/194)\n\n\n*  fix: remove support for outdated browsers ([ef7514e](https://github.com/dessant/buster/commit/ef7514e9ee0ab059a271b3d7be6142f0ccd58ce6))\n\n### [0.7.3](https://github.com/dessant/buster/compare/v0.7.2...v0.7.3) (2020-05-28)\n\n\n### Bug Fixes\n\n* add button to existing challenge widgets after installation in Chrome ([1b9af9e](https://github.com/dessant/buster/commit/1b9af9e93cfe899a962c3c137ff66be7e020552d))\n* remove unused permissions ([dcacc48](https://github.com/dessant/buster/commit/dcacc489e6f2f858949fb4988c74d9d78704f2bd))\n* trim Wit Speech API result only when it exists ([8a54f1f](https://github.com/dessant/buster/commit/8a54f1fdcec03b2860a60e4f4bb521e80f441b10))\n\n### [0.7.2](https://github.com/dessant/buster/compare/v0.7.1...v0.7.2) (2020-05-14)\n\n\n### Bug Fixes\n\n* update Wit Speech API ([d244f62](https://github.com/dessant/buster/commit/d244f625501f377bc7f26112b674f464d45ee399))\n\n### [0.7.1](https://github.com/dessant/buster/compare/v0.7.0...v0.7.1) (2020-02-11)\n\n\n### Bug Fixes\n\n* include source maps for production builds ([6fb0b04](https://github.com/dessant/buster/commit/6fb0b042be5d853084474ef3f6fd5f6695f451ed))\n\n## [0.7.0](https://github.com/dessant/buster/compare/v0.6.1...v0.7.0) (2020-02-09)\n\n\n### Features\n\n* enable client app installation on Windows 32-bit ([9995f46](https://github.com/dessant/buster/commit/9995f46ed4cb2ac006b335405209a22fe54a1f23))\n\n\n### Bug Fixes\n\n* send browser name to client app installer ([aab8384](https://github.com/dessant/buster/commit/aab8384d35c6d6354d3b9ae6fa5a227fc693105f))\n\n### [0.6.1](https://github.com/dessant/buster/compare/v0.6.0...v0.6.1) (2020-02-02)\n\n\n### Bug Fixes\n\n* discard noise from audio challenge ([a57cdb8](https://github.com/dessant/buster/commit/a57cdb839db59909079a44c42af0488648ba5fa0))\n* link client app installation guide from options page ([57611ac](https://github.com/dessant/buster/commit/57611ac664fa436ffbe47525825f5b75591eab5a))\n* remove origin header from background requests ([999ccf9](https://github.com/dessant/buster/commit/999ccf94c7acff1e31fbfaee769e3e84968774c4))\n* rotate Wit.ai API keys for English challenges ([e985b7d](https://github.com/dessant/buster/commit/e985b7d6662c1f168bf504d799cd773ba5e5d8b3)), closes [#130](https://github.com/dessant/buster/issues/130)\n* update available languages and API endpoints ([182a0aa](https://github.com/dessant/buster/commit/182a0aa5cf3d6dab7cbe1cbc9f4220692259ed51))\n* update speech service name ([bb2bff9](https://github.com/dessant/buster/commit/bb2bff913cd11056a0315b0ce0bd6acb5733f5c0))\n* update UI layout ([72aeceb](https://github.com/dessant/buster/commit/72aeceb8e4db927624267062acc343ec6b0cf4e8))\n\n## [0.6.0](https://github.com/dessant/buster/compare/v0.5.3...v0.6.0) (2019-05-28)\n\n\n### Features\n\n* build with travis ([43f9ce5](https://github.com/dessant/buster/commit/43f9ce5))\n* transcribe audio in background script ([2c89926](https://github.com/dessant/buster/commit/2c89926)), closes [#81](https://github.com/dessant/buster/issues/81)\n\n\n\n<a name=\"0.5.3\"></a>\n## [0.5.3](https://github.com/dessant/buster/compare/v0.5.2...v0.5.3) (2019-05-14)\n\n\n### Bug Fixes\n\n* correct the target element width / height for higher density screens ([22edae2](https://github.com/dessant/buster/commit/22edae2)), closes [#71](https://github.com/dessant/buster/issues/71)\n\n\n\n<a name=\"0.5.2\"></a>\n## [0.5.2](https://github.com/dessant/buster/compare/v0.5.1...v0.5.2) (2019-04-07)\n\n\n### Bug Fixes\n\n* get audio URL from audio element ([4a823f9](https://github.com/dessant/buster/commit/4a823f9))\n* remove demo speech service ([f7b9554](https://github.com/dessant/buster/commit/f7b9554))\n\n\n\n<a name=\"0.5.1\"></a>\n## [0.5.1](https://github.com/dessant/buster/compare/v0.5.0...v0.5.1) (2019-03-08)\n\n\n### Bug Fixes\n\n* divide click coordinates by display scale on Windows ([0db060d](https://github.com/dessant/buster/commit/0db060d)), closes [#40](https://github.com/dessant/buster/issues/40)\n\n\n\n<a name=\"0.5.0\"></a>\n# [0.5.0](https://github.com/dessant/buster/compare/v0.4.1...v0.5.0) (2019-03-04)\n\n\n### Bug Fixes\n\n* allow installation on windows if manifest location is not set ([aebd114](https://github.com/dessant/buster/commit/aebd114))\n* clean up after client app update ([4b4d645](https://github.com/dessant/buster/commit/4b4d645))\n* close client app before checking ping response ([715aab7](https://github.com/dessant/buster/commit/715aab7))\n* wait for client app to close before launching new version ([d9aef00](https://github.com/dessant/buster/commit/d9aef00))\n\n\n### Features\n\n* add option for automatically updating client app ([e17107f](https://github.com/dessant/buster/commit/e17107f))\n* require new client app version ([0879515](https://github.com/dessant/buster/commit/0879515))\n\n\n\n<a name=\"0.4.1\"></a>\n## [0.4.1](https://github.com/dessant/buster/compare/v0.4.0...v0.4.1) (2019-02-22)\n\n\n### Bug Fixes\n\n* account for OS scaling during mouse movement ([e055850](https://github.com/dessant/buster/commit/e055850)), closes [#27](https://github.com/dessant/buster/issues/27)\n* break early during challenge reset ([baa6581](https://github.com/dessant/buster/commit/baa6581))\n\n\n\n<a name=\"0.4.0\"></a>\n# [0.4.0](https://github.com/dessant/buster/compare/v0.3.0...v0.4.0) (2019-02-18)\n\n\n### Features\n\n* show reset button when the challenge is blocked ([3398166](https://github.com/dessant/buster/commit/3398166))\n* simulate user input ([779f466](https://github.com/dessant/buster/commit/779f466))\n\n\n\n<a name=\"0.3.0\"></a>\n# [0.3.0](https://github.com/dessant/buster/compare/v0.2.0...v0.3.0) (2018-12-18)\n\n\n### Bug Fixes\n\n* use English as alternative language for Google Cloud Speech API ([f13d1ea](https://github.com/dessant/buster/commit/f13d1ea))\n\n\n### Features\n\n* add Wit Speech API and tryEnglishSpeechModel option ([c32a654](https://github.com/dessant/buster/commit/c32a654))\n* load challenge in English by default ([3f581bd](https://github.com/dessant/buster/commit/3f581bd))\n\n\n\n<a name=\"0.2.0\"></a>\n# [0.2.0](https://github.com/dessant/buster/compare/v0.1.1...v0.2.0) (2018-12-08)\n\n\n### Bug Fixes\n\n* set IBM API location instead of URL ([0c9a824](https://github.com/dessant/buster/commit/0c9a824))\n\n\n### Features\n\n* add IBM Speech to Text ([58f9106](https://github.com/dessant/buster/commit/58f9106))\n* add Microsoft Azure Speech to Text API ([f8c1dde](https://github.com/dessant/buster/commit/f8c1dde))\n* indicate that work is in progress ([fdb4cca](https://github.com/dessant/buster/commit/fdb4cca))\n\n\n\n<a name=\"0.1.1\"></a>\n## [0.1.1](https://github.com/dessant/buster/compare/v0.1.0...v0.1.1) (2018-12-06)\n\n\n### Bug Fixes\n\n* solve compatibility issues with older browser versions ([8be3007](https://github.com/dessant/buster/commit/8be3007)), closes [#3](https://github.com/dessant/buster/issues/3)\n\n\n\n<a name=\"0.1.0\"></a>\n# 0.1.0 (2018-12-04)\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\"><img width=\"128\" height=\"128\" src=\"https://i.imgur.com/uVpmR8l.png\"></p>\n<h1 align=\"center\">Buster: Captcha Solver for Humans</h1>\n\n<p align=\"center\">\n  </br></br>\n  <a href=\"https://chrome.google.com/webstore/detail/buster-captcha-solver-for/mpbjkejclgfgadiemmefgebjfooflfhl\">\n    <picture>\n      <source srcset=\"https://i.imgur.com/XBIE9pk.png\" media=\"(prefers-color-scheme: dark)\">\n      <img height=\"58\" src=\"https://i.imgur.com/oGxig2F.png\" alt=\"Chrome Web Store\"></picture></a>\n  <a href=\"https://addons.mozilla.org/firefox/addon/buster-captcha-solver/\">\n    <picture>\n      <source srcset=\"https://i.imgur.com/ZluoP7T.png\" media=\"(prefers-color-scheme: dark)\">\n      <img height=\"58\" src=\"https://i.imgur.com/4PobQqE.png\" alt=\"Firefox add-ons\"></picture></a>\n  <a href=\"https://microsoftedge.microsoft.com/addons/detail/buster-captcha-solver-fo/admkpobhocmdideidcndkfaeffadipkc\">\n    <picture>\n      <source srcset=\"https://i.imgur.com/Jog9cQP.png\" media=\"(prefers-color-scheme: dark)\">\n      <img height=\"58\" src=\"https://i.imgur.com/aiprUt8.png\" alt=\"Microsoft Store\"></picture></a>\n  <a href=\"https://addons.opera.com/extensions/details/buster-captcha-solver-for-humans/\">\n    <picture>\n      <source srcset=\"https://i.imgur.com/ziehy0f.png\" media=\"(prefers-color-scheme: dark)\">\n      <img height=\"58\" src=\"https://i.imgur.com/ytVATu0.png\" alt=\"Opera add-ons\"></picture></a>\n  </br></br>\n</p>\n\n## Supporting the Project\n\nThe continued development of Buster is made possible\nthanks to the support of awesome backers. If you'd like to join them,\nplease consider contributing with\n[Patreon](https://armin.dev/go/patreon?pr=buster&src=repo),\n[PayPal](https://armin.dev/go/paypal?pr=buster&src=repo) or\n[Bitcoin](https://armin.dev/go/bitcoin?pr=buster&src=repo).\n\n## Description\n\nBuster is a browser extension which helps you to solve difficult CAPTCHAs\nby completing reCAPTCHA audio challenges using speech recognition.\nChallenges are solved by clicking on the extension button at the bottom\nof the reCAPTCHA widget.\n\n> Obviously, this blue part here is the land.\n>\n> — <cite>Byron \"Buster\" Bluth, reading a map</cite>\n\n## Motivation\n\nreCAPTCHA challenges remain a considerable burden on the web,\ndelaying and often blocking our access to services and information\ndepending on our physical and cognitive abilities, our social\nand cultural background, and the devices or networks we connect from.\n\nThe difficulty of CAPTCHA challenges can be so out of balance,\nthat sometimes they seem friendlier to bots than they are to humans.\n\nThe goal of this project is to improve our user experience on the web,\nby giving us easy access to solutions utilized by automated systems.\n\n## Client App\n\nThe client app enables you to simulate user interactions and improves\nthe success rate of the extension. Follow the instructions\nfrom the extension's options to download and install the client app\non Windows, Linux and macOS, or get the app\nfrom [this](https://github.com/dessant/buster-client#readme) repository.\n\n## Screenshots\n\n<p>\n  <img width=\"380\" src=\"https://i.imgur.com/hTqeN4z.png\">\n  <img width=\"380\" src=\"https://i.imgur.com/o0qqDd5.png\">\n</p>\n\n## License\n\nCopyright (c) 2018-2024 Armin Sebastian\n\nThis software is released under the terms of the GNU General Public License v3.0.\nSee the [LICENSE](LICENSE) file for further information.\n"
  },
  {
    "path": "babel.config.js",
    "content": "const path = require('node:path');\n\nconst corejsVersion = require(\n  path.join(path.dirname(require.resolve('core-js')), 'package.json')\n).version;\n\nmodule.exports = function (api) {\n  api.cache(true);\n\n  const presets = [\n    [\n      '@babel/env',\n      {\n        modules: false,\n        bugfixes: true,\n        useBuiltIns: 'usage',\n        corejs: {version: corejsVersion}\n      }\n    ]\n  ];\n\n  const plugins = [];\n\n  const ignore = [\n    new RegExp(`node_modules\\\\${path.sep}(?!(vueton|wesa)\\\\${path.sep}).*`)\n  ];\n\n  const parserOpts = {plugins: ['importAttributes']};\n\n  return {presets, plugins, ignore, parserOpts};\n};\n"
  },
  {
    "path": "gulpfile.js",
    "content": "const path = require('node:path');\nconst {exec} = require('node:child_process');\nconst {\n  lstatSync,\n  readdirSync,\n  readFileSync,\n  writeFileSync,\n  rmSync\n} = require('node:fs');\n\nconst {series, parallel, src, dest} = require('gulp');\nconst postcss = require('gulp-postcss');\nconst gulpif = require('gulp-if');\nconst jsonMerge = require('gulp-merge-json');\nconst jsonmin = require('gulp-jsonmin');\nconst htmlmin = require('gulp-htmlmin');\nconst imagemin = require('gulp-imagemin');\nconst {ensureDirSync, readJsonSync} = require('fs-extra');\nconst sharp = require('sharp');\nconst CryptoJS = require('crypto-js');\n\nconst appVersion = require('./package.json').version;\n\nconst targetEnv = process.env.TARGET_ENV || 'chrome';\nconst isProduction = process.env.NODE_ENV === 'production';\nconst enableContributions =\n  (process.env.ENABLE_CONTRIBUTIONS || 'true') === 'true';\n\nconst mv3 = ['chrome', 'edge', 'opera'].includes(targetEnv);\n\nconst distDir = path.join(__dirname, 'dist', targetEnv);\n\nfunction initEnv() {\n  process.env.BROWSERSLIST_ENV = targetEnv;\n}\n\nfunction init(done) {\n  initEnv();\n\n  rmSync(distDir, {recursive: true, force: true});\n  ensureDirSync(distDir);\n  done();\n}\n\nfunction js(done) {\n  exec('webpack-cli build --color', function (err, stdout, stderr) {\n    console.log(stdout);\n    console.log(stderr);\n    done(err);\n  });\n}\n\nfunction html() {\n  const htmlSrc = ['src/**/*.html'];\n\n  if (mv3) {\n    htmlSrc.push('!src/background/*.html');\n  }\n\n  if (!enableContributions) {\n    htmlSrc.push('!src/contribute/*.html');\n  }\n\n  if (!(mv3 && !['firefox', 'safari'].includes(targetEnv))) {\n    htmlSrc.push('!src/offscreen/*.html');\n  }\n\n  return src(htmlSrc, {base: '.'})\n    .pipe(gulpif(isProduction, htmlmin({collapseWhitespace: true})))\n    .pipe(dest(distDir));\n}\n\nfunction css() {\n  return src('src/base/*.css', {base: '.'}).pipe(postcss()).pipe(dest(distDir));\n}\n\nasync function images(done) {\n  ensureDirSync(path.join(distDir, 'src/assets/icons/app'));\n  const appIconSvg = readFileSync('src/assets/icons/app/icon.svg');\n  const appIconSizes = [16, 19, 24, 32, 38, 48, 64, 96, 128];\n  if (targetEnv === 'safari') {\n    appIconSizes.push(256, 512, 1024);\n  }\n  for (const size of appIconSizes) {\n    await sharp(appIconSvg, {density: (72 * size) / 24})\n      .resize(size)\n      .toFile(path.join(distDir, `src/assets/icons/app/icon-${size}.png`));\n  }\n\n  // Chrome Web Store does not correctly display optimized icons\n  if (isProduction && targetEnv !== 'chrome') {\n    await new Promise(resolve => {\n      src(path.join(distDir, 'src/assets/icons/app/*.png'), {\n        base: '.',\n        encoding: false\n      })\n        .pipe(imagemin())\n        .pipe(dest('.'))\n        .on('error', done)\n        .on('finish', resolve);\n    });\n  }\n\n  await new Promise(resolve => {\n    src('src/assets/icons/@(app|misc)/*.@(png|svg)', {\n      base: '.',\n      encoding: false\n    })\n      .pipe(gulpif(isProduction, imagemin()))\n      .pipe(dest(distDir))\n      .on('error', done)\n      .on('finish', resolve);\n  });\n\n  if (enableContributions) {\n    await new Promise(resolve => {\n      src(\n        'node_modules/vueton/components/contribute/assets/*.@(png|webp|svg)',\n        {encoding: false}\n      )\n        .pipe(gulpif(isProduction, imagemin()))\n        .pipe(dest(path.join(distDir, 'src/contribute/assets')))\n        .on('error', done)\n        .on('finish', resolve);\n    });\n  }\n}\n\nasync function fonts(done) {\n  await new Promise(resolve => {\n    src('src/assets/fonts/roboto.css', {base: '.'})\n      .pipe(postcss())\n      .pipe(dest(distDir))\n      .on('error', done)\n      .on('finish', resolve);\n  });\n\n  await new Promise(resolve => {\n    src(\n      'node_modules/@fontsource/roboto/files/roboto-latin-@(400|500|700)-normal.woff2',\n      {encoding: false}\n    )\n      .pipe(dest(path.join(distDir, 'src/assets/fonts/files')))\n      .on('error', done)\n      .on('finish', resolve);\n  });\n}\n\nasync function locale(done) {\n  const localesRootDir = path.join(__dirname, 'src/assets/locales');\n  const localeDirs = readdirSync(localesRootDir).filter(function (file) {\n    return lstatSync(path.join(localesRootDir, file)).isDirectory();\n  });\n  for (const localeDir of localeDirs) {\n    const localePath = path.join(localesRootDir, localeDir);\n    await new Promise(resolve => {\n      src(\n        [\n          path.join(localePath, 'messages.json'),\n          path.join(localePath, `messages-${targetEnv}.json`)\n        ],\n        {allowEmpty: true}\n      )\n        .pipe(\n          jsonMerge({\n            fileName: 'messages.json',\n            edit: (parsedJson, file) => {\n              if (isProduction) {\n                for (let [key, value] of Object.entries(parsedJson)) {\n                  if (value.hasOwnProperty('description')) {\n                    delete parsedJson[key].description;\n                  }\n                }\n              }\n              return parsedJson;\n            }\n          })\n        )\n        .pipe(gulpif(isProduction, jsonmin()))\n        .pipe(dest(path.join(distDir, '_locales', localeDir)))\n        .on('error', done)\n        .on('finish', resolve);\n    });\n  }\n}\n\nfunction manifest() {\n  return src(`src/assets/manifest/${targetEnv}.json`)\n    .pipe(\n      jsonMerge({\n        fileName: 'manifest.json',\n        edit: (parsedJson, file) => {\n          parsedJson.version = appVersion;\n          return parsedJson;\n        }\n      })\n    )\n    .pipe(gulpif(isProduction, jsonmin()))\n    .pipe(dest(distDir));\n}\n\nfunction license(done) {\n  let year = '2018';\n  const currentYear = new Date().getFullYear().toString();\n  if (year !== currentYear) {\n    year = `${year}-${currentYear}`;\n  }\n\n  let notice = `Buster: Captcha Solver for Humans\nCopyright (c) ${year} Armin Sebastian\n`;\n\n  if (['safari', 'samsung'].includes(targetEnv)) {\n    writeFileSync(path.join(distDir, 'NOTICE'), notice);\n    done();\n  } else {\n    notice = `${notice}\nThis software is released under the terms of the GNU General Public License v3.0.\nSee the LICENSE file for further information.\n`;\n    writeFileSync(path.join(distDir, 'NOTICE'), notice);\n    return src('LICENSE').pipe(dest(distDir));\n  }\n}\n\nfunction secrets(done) {\n  try {\n    let data = process.env.BUSTER_SECRETS;\n    if (data) {\n      data = JSON.parse(data);\n    } else {\n      data = readJsonSync('secrets.json');\n    }\n    data = JSON.stringify(data);\n\n    const key = CryptoJS.SHA256(\n      readFileSync(path.join(distDir, 'src/background/script.js')).toString() +\n        readFileSync(path.join(distDir, 'src/base/script.js')).toString()\n    ).toString();\n\n    const ciphertext = CryptoJS.AES.encrypt(data, key).toString();\n\n    writeFileSync(path.join(distDir, 'secrets.txt'), ciphertext);\n  } catch (err) {\n    console.log(\n      'Secrets are missing, secrets.txt will not be included in the extension package.'\n    );\n  }\n\n  done();\n}\n\nfunction zip(done) {\n  exec(\n    `web-ext build -s dist/${targetEnv} -a artifacts/${targetEnv} -n \"{name}-{version}-${targetEnv}.zip\" --overwrite-dest`,\n    function (err, stdout, stderr) {\n      console.log(stdout);\n      console.log(stderr);\n      done(err);\n    }\n  );\n}\n\nfunction inspect(done) {\n  initEnv();\n\n  exec(\n    `npm run build:prod:chrome && \\\n    webpack --profile --json > report.json && \\\n    webpack-bundle-analyzer --mode static report.json dist/chrome/src && \\\n    sleep 3 && rm report.{json,html}`,\n    function (err, stdout, stderr) {\n      console.log(stdout);\n      console.log(stderr);\n      done(err);\n    }\n  );\n}\n\nexports.build = series(\n  init,\n  parallel(js, html, css, images, fonts, locale, manifest, license),\n  secrets\n);\nexports.zip = zip;\nexports.inspect = inspect;\nexports.secrets = secrets;\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"buster\",\n  \"version\": \"3.1.0\",\n  \"author\": \"Armin Sebastian\",\n  \"license\": \"GPL-3.0-only\",\n  \"homepage\": \"https://github.com/dessant/buster\",\n  \"repository\": {\n    \"url\": \"https://github.com/dessant/buster.git\",\n    \"type\": \"git\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/dessant/buster/issues\"\n  },\n  \"scripts\": {\n    \"_build\": \"cross-env NODE_ENV=development gulp build\",\n    \"build:chrome\": \"cross-env TARGET_ENV=chrome npm run _build\",\n    \"build:edge\": \"cross-env TARGET_ENV=edge npm run _build\",\n    \"build:firefox\": \"cross-env TARGET_ENV=firefox npm run _build\",\n    \"build:opera\": \"cross-env TARGET_ENV=opera npm run _build\",\n    \"_build:prod\": \"cross-env NODE_ENV=production gulp build\",\n    \"build:prod:chrome\": \"cross-env TARGET_ENV=chrome npm run _build:prod\",\n    \"build:prod:edge\": \"cross-env TARGET_ENV=edge npm run _build:prod\",\n    \"build:prod:firefox\": \"cross-env TARGET_ENV=firefox npm run _build:prod\",\n    \"build:prod:opera\": \"cross-env TARGET_ENV=opera npm run _build:prod\",\n    \"_build:prod:zip\": \"npm run _build:prod && gulp zip\",\n    \"build:prod:zip:chrome\": \"cross-env TARGET_ENV=chrome npm run _build:prod:zip\",\n    \"build:prod:zip:edge\": \"cross-env TARGET_ENV=edge npm run _build:prod:zip\",\n    \"build:prod:zip:firefox\": \"cross-env TARGET_ENV=firefox npm run _build:prod:zip\",\n    \"build:prod:zip:opera\": \"cross-env TARGET_ENV=opera npm run _build:prod:zip\",\n    \"start:chrome\": \"web-ext run -s dist/chrome -t chromium\",\n    \"start:firefox\": \"web-ext run -s dist/firefox -t firefox-desktop\",\n    \"inspect\": \"cross-env NODE_ENV=production gulp inspect\",\n    \"update\": \"ncu --dep prod,dev,peer --filterVersion '^*' --upgrade\",\n    \"release\": \"commit-and-tag-version\",\n    \"push\": \"git push --follow-tags origin main\"\n  },\n  \"dependencies\": {\n    \"@fontsource/roboto\": \"^5.0.13\",\n    \"audiobuffer-to-wav\": \"^1.0.0\",\n    \"bowser\": \"^2.11.0\",\n    \"core-js\": \"^3.37.1\",\n    \"crypto-js\": \"^4.2.0\",\n    \"p-queue\": \"^8.0.1\",\n    \"uuid\": \"^9.0.1\",\n    \"vue\": \"3.4.23\",\n    \"vuetify\": \"3.3.0\",\n    \"vueton\": \"^0.4.2\",\n    \"webextension-polyfill\": \"^0.12.0\",\n    \"wesa\": \"^0.6.0\"\n  },\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.24.6\",\n    \"@babel/preset-env\": \"^7.24.6\",\n    \"babel-loader\": \"^9.1.3\",\n    \"commit-and-tag-version\": \"^12.4.1\",\n    \"cross-env\": \"^7.0.3\",\n    \"css-loader\": \"^7.1.2\",\n    \"cssnano\": \"^7.0.1\",\n    \"fs-extra\": \"^11.2.0\",\n    \"gulp\": \"^5.0.0\",\n    \"gulp-htmlmin\": \"^5.0.1\",\n    \"gulp-if\": \"^3.0.0\",\n    \"gulp-imagemin\": \"7.1.0\",\n    \"gulp-jsonmin\": \"^1.2.0\",\n    \"gulp-merge-json\": \"^2.2.1\",\n    \"gulp-postcss\": \"^10.0.0\",\n    \"mini-css-extract-plugin\": \"^2.9.0\",\n    \"npm-check-updates\": \"^16.14.20\",\n    \"postcss\": \"^8.4.38\",\n    \"postcss-loader\": \"^8.1.1\",\n    \"postcss-preset-env\": \"^9.5.14\",\n    \"prettier\": \"^3.3.0\",\n    \"sass\": \"^1.77.4\",\n    \"sass-loader\": \"^14.2.1\",\n    \"sharp\": \"^0.33.4\",\n    \"vue-loader\": \"^17.4.2\",\n    \"web-ext\": \"^8.0.0\",\n    \"webpack\": \"^5.91.0\",\n    \"webpack-bundle-analyzer\": \"^4.10.2\",\n    \"webpack-cli\": \"^5.1.4\",\n    \"webpack-plugin-vuetify\": \"^3.0.3\"\n  },\n  \"private\": true\n}\n"
  },
  {
    "path": "postcss.config.js",
    "content": "const postcssPresetEnv = require('postcss-preset-env');\nconst cssnano = require('cssnano');\n\nmodule.exports = function (api) {\n  const plugins = [postcssPresetEnv()];\n\n  if (api.env === 'production') {\n    plugins.push(cssnano({zindex: false, discardUnused: false}));\n  }\n\n  return {plugins};\n};\n"
  },
  {
    "path": "secrets.json.example",
    "content": "{\n  \"witApiKeys\": {\n    \"arabic\": \"\",\n    \"bengali\": \"\",\n    \"chinese\": \"\",\n    \"dutch\": \"\",\n    \"english\": \"\",\n    \"finnish\": \"\",\n    \"french\": \"\",\n    \"german\": \"\",\n    \"hindi\": \"\",\n    \"indonesian\": \"\",\n    \"italian\": \"\",\n    \"japanese\": \"\",\n    \"kannada\": \"\",\n    \"korean\": \"\",\n    \"malay\": \"\",\n    \"malayalam\": \"\",\n    \"marathi\": \"\",\n    \"polish\": \"\",\n    \"portuguese\": \"\",\n    \"russian\": \"\",\n    \"sinhala\": \"\",\n    \"spanish\": \"\",\n    \"swedish\": \"\",\n    \"tamil\": \"\",\n    \"thai\": \"\",\n    \"turkish\": \"\",\n    \"urdu\": \"\",\n    \"vietnamese\": \"\"\n  }\n}\n"
  },
  {
    "path": "src/assets/fonts/roboto.css",
    "content": "@font-face {\n  font-family: 'Roboto';\n  font-style: normal;\n  font-weight: 400;\n  src: url('./files/roboto-latin-400-normal.woff2') format('woff2'),\n    local('Roboto'), local('Roboto-Regular');\n}\n\n@font-face {\n  font-family: 'Roboto';\n  font-style: normal;\n  font-weight: 500;\n  src: url('./files/roboto-latin-500-normal.woff2') format('woff2'),\n    local('Roboto Medium'), local('Roboto-Medium');\n}\n\n@font-face {\n  font-family: 'Roboto';\n  font-style: normal;\n  font-weight: 700;\n  src: url('./files/roboto-latin-700-normal.woff2') format('woff2'),\n    local('Roboto Bold'), local('Roboto-Bold');\n}\n"
  },
  {
    "path": "src/assets/locales/en/messages-firefox.json",
    "content": "{\n  \"optionSectionTitle_client\": {\n    \"message\": \"Client App\",\n    \"description\": \"Title of the options section.\"\n  }\n}\n"
  },
  {
    "path": "src/assets/locales/en/messages.json",
    "content": "{\n  \"extensionName\": {\n    \"message\": \"Buster: Captcha Solver for Humans\",\n    \"description\": \"Name of the extension.\"\n  },\n\n  \"extensionDescription\": {\n    \"message\": \"Save time by asking Buster to solve CAPTCHAs for you.\",\n    \"description\": \"Description of the extension.\"\n  },\n\n  \"optionSectionTitle_services\": {\n    \"message\": \"Services\",\n    \"description\": \"Title of the options section.\"\n  },\n\n  \"optionTitle_speechService\": {\n    \"message\": \"Speech recognition\",\n    \"description\": \"Title of the option.\"\n  },\n\n  \"optionValue_speechService_googleSpeechApi\": {\n    \"message\": \"Google Cloud Speech-to-Text\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_speechService_ibmSpeechApi\": {\n    \"message\": \"IBM Watson Speech to Text\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_speechService_microsoftSpeechApi\": {\n    \"message\": \"Microsoft Azure Speech to Text\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_speechService_witSpeechApiDemo\": {\n    \"message\": \"Wit.ai (managed)\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_speechService_witSpeechApi\": {\n    \"message\": \"Wit.ai\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionTitle_microsoftSpeechApiLoc\": {\n    \"message\": \"API location\",\n    \"description\": \"Title of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_southafricanorth\": {\n    \"message\": \"South Africa North\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_eastasia\": {\n    \"message\": \"East Asia\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_southeastasia\": {\n    \"message\": \"Southeast Asia\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_australiaeast\": {\n    \"message\": \"Australia East\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_centralindia\": {\n    \"message\": \"Central India\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_japaneast\": {\n    \"message\": \"Japan East\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_japanwest\": {\n    \"message\": \"Japan West\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_koreacentral\": {\n    \"message\": \"Korea Central\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_canadacentral\": {\n    \"message\": \"Canada Central\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_northeurope\": {\n    \"message\": \"North Europe\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_westeurope\": {\n    \"message\": \"West Europe\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_francecentral\": {\n    \"message\": \"France Central\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_germanywestcentral\": {\n    \"message\": \"Germany West Central\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_norwayeast\": {\n    \"message\": \"Norway East\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_swedencentral\": {\n    \"message\": \"Sweden Central\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_switzerlandnorth\": {\n    \"message\": \"Switzerland North\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_switzerlandwest\": {\n    \"message\": \"Switzerland West\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_uksouth\": {\n    \"message\": \"UK South\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_uaenorth\": {\n    \"message\": \"UAE North\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_brazilsouth\": {\n    \"message\": \"Brazil South\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_qatarcentral\": {\n    \"message\": \"Qatar Central\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_centralus\": {\n    \"message\": \"Central US\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_eastus\": {\n    \"message\": \"East US\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_eastus2\": {\n    \"message\": \"East US 2\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_northcentralus\": {\n    \"message\": \"North Central US\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_southcentralus\": {\n    \"message\": \"South Central US\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_westcentralus\": {\n    \"message\": \"West Central US\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_westus\": {\n    \"message\": \"West US\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_westus2\": {\n    \"message\": \"West US 2\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_microsoftSpeechApiLoc_westus3\": {\n    \"message\": \"West US 3\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionSectionTitle_client\": {\n    \"message\": \"Client app\",\n    \"description\": \"Title of the options section.\"\n  },\n\n  \"optionSectionDescription_client\": {\n    \"message\": \"The client app enables you to simulate user interactions and improves the success rate of the extension.\",\n    \"description\": \"Description of the options section.\"\n  },\n\n  \"optionTitle_simulateUserInput\": {\n    \"message\": \"Simulate user interactions\",\n    \"description\": \"Title of the option.\"\n  },\n\n  \"optionTitle_navigateWithKeyboard\": {\n    \"message\": \"Navigate with keyboard\",\n    \"description\": \"Title of the option.\"\n  },\n\n  \"optionTitle_autoUpdateClientApp\": {\n    \"message\": \"Auto-update client app\",\n    \"description\": \"Title of the option.\"\n  },\n\n  \"optionSectionTitle_misc\": {\n    \"message\": \"Miscellaneous\",\n    \"description\": \"Title of the options section.\"\n  },\n\n  \"optionTitle_loadEnglishChallenge\": {\n    \"message\": \"Load challenge in English\",\n    \"description\": \"Title of the option.\"\n  },\n\n  \"optionTitle_tryEnglishSpeechModel\": {\n    \"message\": \"Retry speech recognition with English model\",\n    \"description\": \"Title of the option.\"\n  },\n\n  \"optionTitle_appTheme\": {\n    \"message\": \"Theme\",\n    \"description\": \"Title of the option.\"\n  },\n\n  \"optionValue_appTheme_auto\": {\n    \"message\": \"System default\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_appTheme_light\": {\n    \"message\": \"Light\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_appTheme_dark\": {\n    \"message\": \"Dark\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionTitle_showContribPage\": {\n    \"message\": \"Show contribution page\",\n    \"description\": \"Title of the option.\"\n  },\n\n  \"optionTitle_witSpeechApiLang\": {\n    \"message\": \"API language\",\n    \"description\": \"Title of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_arabic\": {\n    \"message\": \"Arabic\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_bengali\": {\n    \"message\": \"Bengali\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_chinese\": {\n    \"message\": \"Chinese\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_dutch\": {\n    \"message\": \"Dutch\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_english\": {\n    \"message\": \"English\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_finnish\": {\n    \"message\": \"Finnish\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_french\": {\n    \"message\": \"French\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_german\": {\n    \"message\": \"German\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_hindi\": {\n    \"message\": \"Hindi\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_indonesian\": {\n    \"message\": \"Indonesian\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_italian\": {\n    \"message\": \"Italian\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_japanese\": {\n    \"message\": \"Japanese\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_kannada\": {\n    \"message\": \"Kannada\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_korean\": {\n    \"message\": \"Korean\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_malay\": {\n    \"message\": \"Malay\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_malayalam\": {\n    \"message\": \"Malayalam\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_marathi\": {\n    \"message\": \"Marathi\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_polish\": {\n    \"message\": \"Polish\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_portuguese\": {\n    \"message\": \"Portuguese\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_russian\": {\n    \"message\": \"Russian\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_sinhala\": {\n    \"message\": \"Sinhala\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_spanish\": {\n    \"message\": \"Spanish\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_swedish\": {\n    \"message\": \"Swedish\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_tamil\": {\n    \"message\": \"Tamil\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_thai\": {\n    \"message\": \"Thai\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_turkish\": {\n    \"message\": \"Turkish\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_urdu\": {\n    \"message\": \"Urdu\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"optionValue_witSpeechApiLang_vietnamese\": {\n    \"message\": \"Vietnamese\",\n    \"description\": \"Value of the option.\"\n  },\n\n  \"inputLabel_apiUrl\": {\n    \"message\": \"API endpoint\",\n    \"description\": \"Label of the input.\"\n  },\n\n  \"inputLabel_apiKey\": {\n    \"message\": \"API key\",\n    \"description\": \"Label of the input.\"\n  },\n\n  \"inputLabel_apiKeyType\": {\n    \"message\": \"API key: $TYPE$\",\n    \"description\": \"Label of the input.\",\n    \"placeholders\": {\n      \"type\": {\n        \"content\": \"$1\",\n        \"example\": \"English\"\n      }\n    }\n  },\n\n  \"inputLabel_appLocation\": {\n    \"message\": \"App location\",\n    \"description\": \"Label of the input.\"\n  },\n\n  \"inputLabel_manifestLocation\": {\n    \"message\": \"Manifest location\",\n    \"description\": \"Label of the input.\"\n  },\n\n  \"buttonLabel_addApi\": {\n    \"message\": \"Add API\",\n    \"description\": \"Text of the button.\"\n  },\n\n  \"buttonLabel_solve\": {\n    \"message\": \"Solve the challenge\",\n    \"description\": \"Text of the button.\"\n  },\n\n  \"buttonLabel_reset\": {\n    \"message\": \"Reset the challenge\",\n    \"description\": \"Text of the button.\"\n  },\n\n  \"buttonLabel_downloadApp\": {\n    \"message\": \"Download app\",\n    \"description\": \"Text of the button.\"\n  },\n\n  \"buttonLabel_installApp\": {\n    \"message\": \"Install app\",\n    \"description\": \"Text of the button.\"\n  },\n\n  \"buttonLabel_goBack\": {\n    \"message\": \"Go back\",\n    \"description\": \"Text of the button.\"\n  },\n\n  \"buttonLabel_contribute\": {\n    \"message\": \"Contribute\",\n    \"description\": \"Label of the button.\"\n  },\n\n  \"linkText_installGuide\": {\n    \"message\": \"Installation guide\",\n    \"description\": \"Text of the link.\"\n  },\n\n  \"linkText_apiGuide\": {\n    \"message\": \"How to get an API key?\",\n    \"description\": \"Text of the link.\"\n  },\n\n  \"pageContent_optionClientAppDownloadDesc\": {\n    \"message\": \"Download and install the client app to get started. $INSTALLGUIDE$\",\n    \"description\": \"Page content.\",\n    \"placeholders\": {\n      \"installGuide\": {\n        \"content\": \"$1\",\n        \"example\": \"Installation guide\"\n      }\n    }\n  },\n\n  \"pageContent_optionClientAppOSError\": {\n    \"message\": \"Your operating system is not supported.\",\n    \"description\": \"Page content.\"\n  },\n\n  \"pageContent_installTitle\": {\n    \"message\": \"Install Buster Client\",\n    \"description\": \"Page content.\"\n  },\n\n  \"pageContent_installDesc\": {\n    \"message\": \"The client app enables you to simulate user interactions and improves the success rate of the extension.\",\n    \"description\": \"Page content.\"\n  },\n\n  \"pageContent_installSuccessTitle\": {\n    \"message\": \"Installation finished\",\n    \"description\": \"Page content.\"\n  },\n\n  \"pageContent_installSuccessDesc\": {\n    \"message\": \"The client app has been installed for the current browser.\",\n    \"description\": \"Page content.\"\n  },\n\n  \"pageContent_installErrorTitle\": {\n    \"message\": \"Something went wrong\",\n    \"description\": \"Page content.\"\n  },\n\n  \"pageContent_installErrorDesc\": {\n    \"message\": \"The installation has failed. Check the browser console for more details, and open an issue on GitHub if this error persists.\",\n    \"description\": \"Page content.\"\n  },\n\n  \"pageContent_manifestLocationDesc\": {\n    \"message\": \"The manifest location is browser-dependent, edit the path only if the installation does not succeed.\",\n    \"description\": \"Page content.\"\n  },\n\n  \"pageTitle\": {\n    \"message\": \"$PAGETITLE$ - $EXTENSIONNAME$\",\n    \"description\": \"Title of the page.\",\n    \"placeholders\": {\n      \"pageTitle\": {\n        \"content\": \"$1\",\n        \"example\": \"Options\"\n      },\n      \"extensionName\": {\n        \"content\": \"$2\",\n        \"example\": \"Extension Name\"\n      }\n    }\n  },\n\n  \"pageTitle_options\": {\n    \"message\": \"Options\",\n    \"description\": \"Title of the page.\"\n  },\n\n  \"pageTitle_contribute\": {\n    \"message\": \"Contribute\",\n    \"description\": \"Title of the page.\"\n  },\n\n  \"info_updatingClientApp\": {\n    \"message\": \"Updating client app. Solving will continue in a moment, do not switch away from the current tab.\",\n    \"description\": \"Info message.\"\n  },\n\n  \"error_captchaNotSolved\": {\n    \"message\": \"CAPTCHA could not be solved. Try again after requesting a new challenge.\",\n    \"description\": \"Error message.\"\n  },\n\n  \"error_captchaNotSolvedWitai\": {\n    \"message\": \"Wit.ai could not detect any speech. Try a new challenge, or switch to a more reliable service from the extension's options, such as IBM Watson.\",\n    \"description\": \"Error message.\"\n  },\n\n  \"error_missingApiUrl\": {\n    \"message\": \"API endpoint missing. Visit the extension's options to configure the service.\",\n    \"description\": \"Error message.\"\n  },\n\n  \"error_missingApiKey\": {\n    \"message\": \"API key missing. Visit the extension's options to configure the service.\",\n    \"description\": \"Error message.\"\n  },\n\n  \"error_apiQuotaExceeded\": {\n    \"message\": \"API quota exceeded. Try again later, or visit the extension's options and switch to a different service.\",\n    \"description\": \"Error message.\"\n  },\n\n  \"error_scriptsNotAllowed\": {\n    \"message\": \"Content scripts are not allowed on this page.\",\n    \"description\": \"Error message.\"\n  },\n\n  \"error_missingClientApp\": {\n    \"message\": \"Cannot connect to client app. Finish setting up the app or turn off the simulation of user interactions from the extension's options.\",\n    \"description\": \"Error message.\"\n  },\n\n  \"error_outdatedClientApp\": {\n    \"message\": \"The client app is outdated. Download and install the latest version from the extension's options.\",\n    \"description\": \"Error message.\"\n  },\n\n  \"error_clientAppUpdateFailed\": {\n    \"message\": \"The client app cannot be updated. Download and install the latest version from the extension's options.\",\n    \"description\": \"Error message.\"\n  },\n\n  \"error_internalError\": {\n    \"message\": \"Something went wrong. Open the browser console for more details.\",\n    \"description\": \"Error message.\"\n  }\n}\n"
  },
  {
    "path": "src/assets/manifest/chrome.json",
    "content": "{\n  \"manifest_version\": 3,\n  \"name\": \"__MSG_extensionName__\",\n  \"description\": \"__MSG_extensionDescription__\",\n  \"version\": \"0.1.0\",\n  \"author\": \"Armin Sebastian\",\n  \"homepage_url\": \"https://github.com/dessant/buster\",\n  \"default_locale\": \"en\",\n\n  \"minimum_chrome_version\": \"123.0\",\n\n  \"permissions\": [\n    \"storage\",\n    \"notifications\",\n    \"webRequest\",\n    \"declarativeNetRequest\",\n    \"webNavigation\",\n    \"nativeMessaging\",\n    \"offscreen\",\n    \"scripting\"\n  ],\n\n  \"host_permissions\": [\"<all_urls>\"],\n\n  \"content_security_policy\": {\n    \"extension_pages\": \"default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data:; connect-src *; object-src 'none'; frame-ancestors http://127.0.0.1:*;\"\n  },\n\n  \"icons\": {\n    \"16\": \"src/assets/icons/app/icon-16.png\",\n    \"19\": \"src/assets/icons/app/icon-19.png\",\n    \"24\": \"src/assets/icons/app/icon-24.png\",\n    \"32\": \"src/assets/icons/app/icon-32.png\",\n    \"38\": \"src/assets/icons/app/icon-38.png\",\n    \"48\": \"src/assets/icons/app/icon-48.png\",\n    \"64\": \"src/assets/icons/app/icon-64.png\",\n    \"96\": \"src/assets/icons/app/icon-96.png\",\n    \"128\": \"src/assets/icons/app/icon-128.png\"\n  },\n\n  \"action\": {\n    \"default_icon\": {\n      \"16\": \"src/assets/icons/app/icon-16.png\",\n      \"19\": \"src/assets/icons/app/icon-19.png\",\n      \"24\": \"src/assets/icons/app/icon-24.png\",\n      \"32\": \"src/assets/icons/app/icon-32.png\",\n      \"38\": \"src/assets/icons/app/icon-38.png\",\n      \"48\": \"src/assets/icons/app/icon-48.png\",\n      \"64\": \"src/assets/icons/app/icon-64.png\",\n      \"96\": \"src/assets/icons/app/icon-96.png\",\n      \"128\": \"src/assets/icons/app/icon-128.png\"\n    }\n  },\n\n  \"options_ui\": {\n    \"page\": \"src/options/index.html\",\n    \"open_in_tab\": true\n  },\n\n  \"background\": {\n    \"service_worker\": \"src/background/script.js\"\n  },\n\n  \"content_scripts\": [\n    {\n      \"matches\": [\n        \"https://google.com/recaptcha/api2/bframe*\",\n        \"https://www.google.com/recaptcha/api2/bframe*\",\n        \"https://google.com/recaptcha/enterprise/bframe*\",\n        \"https://www.google.com/recaptcha/enterprise/bframe*\",\n        \"https://recaptcha.net/recaptcha/api2/bframe*\",\n        \"https://www.recaptcha.net/recaptcha/api2/bframe*\",\n        \"https://recaptcha.net/recaptcha/enterprise/bframe*\",\n        \"https://www.recaptcha.net/recaptcha/enterprise/bframe*\"\n      ],\n      \"all_frames\": true,\n      \"run_at\": \"document_idle\",\n      \"css\": [\"src/base/style.css\"],\n      \"js\": [\"src/base/script.js\"]\n    },\n    {\n      \"matches\": [\"http://127.0.0.1/buster/setup?session=*\"],\n      \"run_at\": \"document_idle\",\n      \"js\": [\"src/scripts/init-setup.js\"]\n    }\n  ],\n\n  \"web_accessible_resources\": [\n    {\n      \"resources\": [\n        \"src/setup/index.html\",\n        \"src/scripts/reset.js\",\n        \"src/base/solver-button.css\"\n      ],\n      \"matches\": [\"http://*/*\", \"https://*/*\"],\n      \"use_dynamic_url\": true\n    }\n  ],\n\n  \"incognito\": \"split\"\n}\n"
  },
  {
    "path": "src/assets/manifest/edge.json",
    "content": "{\n  \"manifest_version\": 3,\n  \"name\": \"__MSG_extensionName__\",\n  \"description\": \"__MSG_extensionDescription__\",\n  \"version\": \"0.1.0\",\n  \"author\": \"Armin Sebastian\",\n  \"homepage_url\": \"https://github.com/dessant/buster\",\n  \"default_locale\": \"en\",\n\n  \"minimum_chrome_version\": \"123.0\",\n\n  \"permissions\": [\n    \"storage\",\n    \"notifications\",\n    \"webRequest\",\n    \"declarativeNetRequest\",\n    \"webNavigation\",\n    \"nativeMessaging\",\n    \"offscreen\",\n    \"scripting\"\n  ],\n\n  \"host_permissions\": [\"<all_urls>\"],\n\n  \"content_security_policy\": {\n    \"extension_pages\": \"default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data:; connect-src *; object-src 'none'; frame-ancestors http://127.0.0.1:*;\"\n  },\n\n  \"icons\": {\n    \"16\": \"src/assets/icons/app/icon-16.png\",\n    \"19\": \"src/assets/icons/app/icon-19.png\",\n    \"24\": \"src/assets/icons/app/icon-24.png\",\n    \"32\": \"src/assets/icons/app/icon-32.png\",\n    \"38\": \"src/assets/icons/app/icon-38.png\",\n    \"48\": \"src/assets/icons/app/icon-48.png\",\n    \"64\": \"src/assets/icons/app/icon-64.png\",\n    \"96\": \"src/assets/icons/app/icon-96.png\",\n    \"128\": \"src/assets/icons/app/icon-128.png\"\n  },\n\n  \"action\": {\n    \"default_icon\": {\n      \"16\": \"src/assets/icons/app/icon-16.png\",\n      \"19\": \"src/assets/icons/app/icon-19.png\",\n      \"24\": \"src/assets/icons/app/icon-24.png\",\n      \"32\": \"src/assets/icons/app/icon-32.png\",\n      \"38\": \"src/assets/icons/app/icon-38.png\",\n      \"48\": \"src/assets/icons/app/icon-48.png\",\n      \"64\": \"src/assets/icons/app/icon-64.png\",\n      \"96\": \"src/assets/icons/app/icon-96.png\",\n      \"128\": \"src/assets/icons/app/icon-128.png\"\n    }\n  },\n\n  \"options_ui\": {\n    \"page\": \"src/options/index.html\",\n    \"open_in_tab\": true\n  },\n\n  \"background\": {\n    \"service_worker\": \"src/background/script.js\"\n  },\n\n  \"content_scripts\": [\n    {\n      \"matches\": [\n        \"https://google.com/recaptcha/api2/bframe*\",\n        \"https://www.google.com/recaptcha/api2/bframe*\",\n        \"https://google.com/recaptcha/enterprise/bframe*\",\n        \"https://www.google.com/recaptcha/enterprise/bframe*\",\n        \"https://recaptcha.net/recaptcha/api2/bframe*\",\n        \"https://www.recaptcha.net/recaptcha/api2/bframe*\",\n        \"https://recaptcha.net/recaptcha/enterprise/bframe*\",\n        \"https://www.recaptcha.net/recaptcha/enterprise/bframe*\"\n      ],\n      \"all_frames\": true,\n      \"run_at\": \"document_idle\",\n      \"css\": [\"src/base/style.css\"],\n      \"js\": [\"src/base/script.js\"]\n    },\n    {\n      \"matches\": [\"http://127.0.0.1/buster/setup?session=*\"],\n      \"run_at\": \"document_idle\",\n      \"js\": [\"src/scripts/init-setup.js\"]\n    }\n  ],\n\n  \"web_accessible_resources\": [\n    {\n      \"resources\": [\n        \"src/setup/index.html\",\n        \"src/scripts/reset.js\",\n        \"src/base/solver-button.css\"\n      ],\n      \"matches\": [\"http://*/*\", \"https://*/*\"],\n      \"use_dynamic_url\": true\n    }\n  ],\n\n  \"incognito\": \"split\"\n}\n"
  },
  {
    "path": "src/assets/manifest/firefox.json",
    "content": "{\n  \"manifest_version\": 2,\n  \"name\": \"__MSG_extensionName__\",\n  \"description\": \"__MSG_extensionDescription__\",\n  \"version\": \"0.1.0\",\n  \"author\": \"Armin Sebastian\",\n  \"homepage_url\": \"https://github.com/dessant/buster\",\n  \"default_locale\": \"en\",\n\n  \"browser_specific_settings\": {\n    \"gecko\": {\n      \"id\": \"{e58d3966-3d76-4cd9-8552-1582fbc800c1}\",\n      \"strict_min_version\": \"115.0\"\n    }\n  },\n\n  \"permissions\": [\n    \"storage\",\n    \"notifications\",\n    \"webRequest\",\n    \"webRequestBlocking\",\n    \"webNavigation\",\n    \"nativeMessaging\",\n    \"<all_urls>\"\n  ],\n\n  \"content_security_policy\": \"default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data:; connect-src *; object-src 'none'; frame-ancestors http://127.0.0.1:*;\",\n\n  \"icons\": {\n    \"16\": \"src/assets/icons/app/icon-16.png\",\n    \"19\": \"src/assets/icons/app/icon-19.png\",\n    \"24\": \"src/assets/icons/app/icon-24.png\",\n    \"32\": \"src/assets/icons/app/icon-32.png\",\n    \"38\": \"src/assets/icons/app/icon-38.png\",\n    \"48\": \"src/assets/icons/app/icon-48.png\",\n    \"64\": \"src/assets/icons/app/icon-64.png\",\n    \"96\": \"src/assets/icons/app/icon-96.png\",\n    \"128\": \"src/assets/icons/app/icon-128.png\"\n  },\n\n  \"browser_action\": {\n    \"default_icon\": {\n      \"16\": \"src/assets/icons/app/icon-16.png\",\n      \"19\": \"src/assets/icons/app/icon-19.png\",\n      \"24\": \"src/assets/icons/app/icon-24.png\",\n      \"32\": \"src/assets/icons/app/icon-32.png\",\n      \"38\": \"src/assets/icons/app/icon-38.png\",\n      \"48\": \"src/assets/icons/app/icon-48.png\",\n      \"64\": \"src/assets/icons/app/icon-64.png\",\n      \"96\": \"src/assets/icons/app/icon-96.png\",\n      \"128\": \"src/assets/icons/app/icon-128.png\"\n    }\n  },\n\n  \"content_scripts\": [\n    {\n      \"matches\": [\n        \"https://google.com/recaptcha/api2/bframe*\",\n        \"https://www.google.com/recaptcha/api2/bframe*\",\n        \"https://google.com/recaptcha/enterprise/bframe*\",\n        \"https://www.google.com/recaptcha/enterprise/bframe*\",\n        \"https://recaptcha.net/recaptcha/api2/bframe*\",\n        \"https://www.recaptcha.net/recaptcha/api2/bframe*\",\n        \"https://recaptcha.net/recaptcha/enterprise/bframe*\",\n        \"https://www.recaptcha.net/recaptcha/enterprise/bframe*\"\n      ],\n      \"all_frames\": true,\n      \"run_at\": \"document_idle\",\n      \"css\": [\"src/base/style.css\"],\n      \"js\": [\"src/base/script.js\"]\n    },\n    {\n      \"matches\": [\"http://127.0.0.1/buster/setup?session=*\"],\n      \"run_at\": \"document_idle\",\n      \"js\": [\"src/scripts/init-setup.js\"]\n    }\n  ],\n\n  \"options_ui\": {\n    \"page\": \"src/options/index.html\",\n    \"browser_style\": false,\n    \"open_in_tab\": true\n  },\n\n  \"background\": {\n    \"page\": \"src/background/index.html\"\n  },\n\n  \"web_accessible_resources\": [\n    \"src/setup/index.html\",\n    \"src/scripts/reset.js\",\n    \"src/base/solver-button.css\"\n  ]\n}\n"
  },
  {
    "path": "src/assets/manifest/opera.json",
    "content": "{\n  \"manifest_version\": 3,\n  \"name\": \"__MSG_extensionName__\",\n  \"description\": \"__MSG_extensionDescription__\",\n  \"version\": \"0.1.0\",\n  \"author\": \"Armin Sebastian\",\n  \"homepage_url\": \"https://github.com/dessant/buster\",\n  \"default_locale\": \"en\",\n\n  \"minimum_opera_version\": \"109.0\",\n\n  \"permissions\": [\n    \"storage\",\n    \"notifications\",\n    \"webRequest\",\n    \"declarativeNetRequest\",\n    \"webNavigation\",\n    \"nativeMessaging\",\n    \"offscreen\",\n    \"scripting\"\n  ],\n\n  \"host_permissions\": [\"<all_urls>\"],\n\n  \"content_security_policy\": {\n    \"extension_pages\": \"default-src 'self'; style-src 'self' 'unsafe-inline'; img-src * data:; connect-src *; object-src 'none'; frame-ancestors http://127.0.0.1:*;\"\n  },\n\n  \"icons\": {\n    \"16\": \"src/assets/icons/app/icon-16.png\",\n    \"19\": \"src/assets/icons/app/icon-19.png\",\n    \"24\": \"src/assets/icons/app/icon-24.png\",\n    \"32\": \"src/assets/icons/app/icon-32.png\",\n    \"38\": \"src/assets/icons/app/icon-38.png\",\n    \"48\": \"src/assets/icons/app/icon-48.png\",\n    \"64\": \"src/assets/icons/app/icon-64.png\",\n    \"96\": \"src/assets/icons/app/icon-96.png\",\n    \"128\": \"src/assets/icons/app/icon-128.png\"\n  },\n\n  \"action\": {\n    \"default_icon\": {\n      \"16\": \"src/assets/icons/app/icon-16.png\",\n      \"19\": \"src/assets/icons/app/icon-19.png\",\n      \"24\": \"src/assets/icons/app/icon-24.png\",\n      \"32\": \"src/assets/icons/app/icon-32.png\",\n      \"38\": \"src/assets/icons/app/icon-38.png\",\n      \"48\": \"src/assets/icons/app/icon-48.png\",\n      \"64\": \"src/assets/icons/app/icon-64.png\",\n      \"96\": \"src/assets/icons/app/icon-96.png\",\n      \"128\": \"src/assets/icons/app/icon-128.png\"\n    }\n  },\n\n  \"options_ui\": {\n    \"page\": \"src/options/index.html\",\n    \"open_in_tab\": true\n  },\n\n  \"background\": {\n    \"service_worker\": \"src/background/script.js\"\n  },\n\n  \"content_scripts\": [\n    {\n      \"matches\": [\n        \"https://google.com/recaptcha/api2/bframe*\",\n        \"https://www.google.com/recaptcha/api2/bframe*\",\n        \"https://google.com/recaptcha/enterprise/bframe*\",\n        \"https://www.google.com/recaptcha/enterprise/bframe*\",\n        \"https://recaptcha.net/recaptcha/api2/bframe*\",\n        \"https://www.recaptcha.net/recaptcha/api2/bframe*\",\n        \"https://recaptcha.net/recaptcha/enterprise/bframe*\",\n        \"https://www.recaptcha.net/recaptcha/enterprise/bframe*\"\n      ],\n      \"all_frames\": true,\n      \"run_at\": \"document_idle\",\n      \"css\": [\"src/base/style.css\"],\n      \"js\": [\"src/base/script.js\"]\n    },\n    {\n      \"matches\": [\"http://127.0.0.1/buster/setup?session=*\"],\n      \"run_at\": \"document_idle\",\n      \"js\": [\"src/scripts/init-setup.js\"]\n    }\n  ],\n\n  \"web_accessible_resources\": [\n    {\n      \"resources\": [\n        \"src/setup/index.html\",\n        \"src/scripts/reset.js\",\n        \"src/base/solver-button.css\"\n      ],\n      \"matches\": [\"http://*/*\", \"https://*/*\"],\n      \"use_dynamic_url\": true\n    }\n  ],\n\n  \"incognito\": \"split\"\n}\n"
  },
  {
    "path": "src/background/index.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"referrer\" content=\"no-referrer\" />\n  </head>\n  <body>\n    <script src=\"script.js\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "src/background/main.js",
    "content": "import aes from 'crypto-js/aes';\nimport sha256 from 'crypto-js/sha256';\nimport utf8 from 'crypto-js/enc-utf8';\n\nimport {initStorage} from 'storage/init';\nimport {isStorageReady} from 'storage/storage';\nimport storage from 'storage/storage';\nimport {\n  showNotification,\n  sendNativeMessage,\n  processMessageResponse,\n  processAppUse,\n  showOptionsPage,\n  setAppVersion,\n  getStartupState,\n  insertBaseModule\n} from 'utils/app';\nimport {\n  executeScript,\n  scriptsAllowed,\n  isValidTab,\n  getBrowser,\n  getPlatform,\n  getExtensionDomain,\n  getRandomInt,\n  arrayBufferToBase64,\n  base64ToArrayBuffer,\n  prepareAudio,\n  setupOffscreenDocument,\n  sendOffscreenMessage,\n  runOnce\n} from 'utils/common';\nimport {\n  recaptchaUrlRxString,\n  captchaGoogleSpeechApiLangCodes,\n  captchaIbmSpeechApiLangCodes,\n  captchaMicrosoftSpeechApiLangCodes,\n  captchaWitSpeechApiLangCodes\n} from 'utils/data';\nimport {targetEnv, clientAppVersion, mv3} from 'utils/config';\n\nlet nativePort;\n\nfunction getFrameClientPos(index) {\n  let currentIndex = -1;\n  if (window !== window.top) {\n    const siblingWindows = window.parent.frames;\n    for (let i = 0; i < siblingWindows.length; i++) {\n      if (siblingWindows[i] === window) {\n        currentIndex = i;\n        break;\n      }\n    }\n  }\n\n  const targetWindow = window.frames[index];\n  for (const frame of document.querySelectorAll('iframe')) {\n    if (frame.contentWindow === targetWindow) {\n      let {left: x, top: y} = frame.getBoundingClientRect();\n      const scale = window.devicePixelRatio;\n\n      return {x: x * scale, y: y * scale, currentIndex};\n    }\n  }\n}\n\nasync function getFramePos(tabId, frameId, frameIndex) {\n  let x = 0;\n  let y = 0;\n\n  while (true) {\n    frameId = (\n      await browser.webNavigation.getFrame({\n        tabId,\n        frameId\n      })\n    ).parentFrameId;\n    if (frameId === -1) {\n      break;\n    }\n\n    const [data] = await executeScript({\n      func: getFrameClientPos,\n      args: [frameIndex],\n      code: `(${getFrameClientPos.toString()})(${frameIndex})`,\n      tabId,\n      frameIds: [frameId]\n    });\n\n    frameIndex = data.currentIndex;\n    x += data.x;\n    y += data.y;\n  }\n\n  return {x, y};\n}\n\nfunction initResetCaptcha() {\n  const initReset = function (challengeUrl) {\n    const script = document.createElement('script');\n    script.onload = function (ev) {\n      ev.target.remove();\n      document.dispatchEvent(\n        new CustomEvent('___resetCaptcha', {detail: challengeUrl})\n      );\n    };\n    script.src = chrome.runtime.getURL('/src/scripts/reset.js');\n    document.documentElement.appendChild(script);\n  };\n\n  const onMessage = function (request) {\n    if (request.id === 'resetCaptcha') {\n      removeCallbacks();\n      initReset(request.challengeUrl);\n    }\n  };\n\n  const removeCallbacks = function () {\n    window.clearTimeout(timeoutId);\n    chrome.runtime.onMessage.removeListener(onMessage);\n  };\n\n  const timeoutId = window.setTimeout(removeCallbacks, 10000); // 10 seconds\n\n  chrome.runtime.onMessage.addListener(onMessage);\n}\n\nasync function resetCaptcha(tabId, frameId, challengeUrl) {\n  frameId = (await browser.webNavigation.getFrame({tabId, frameId}))\n    .parentFrameId;\n\n  if (!(await scriptsAllowed({tabId, frameId}))) {\n    await showNotification({messageId: 'error_scriptsNotAllowed'});\n    return;\n  }\n\n  await executeScript({\n    func: initResetCaptcha,\n    code: `(${initResetCaptcha.toString()})()`,\n    tabId,\n    frameIds: [frameId]\n  });\n\n  await browser.tabs.sendMessage(\n    tabId,\n    {\n      id: 'resetCaptcha',\n      challengeUrl\n    },\n    {frameId}\n  );\n}\n\nfunction challengeRequestCallback(details) {\n  const url = new URL(details.url);\n  if (url.searchParams.get('hl') !== 'en') {\n    url.searchParams.set('hl', 'en');\n    return {redirectUrl: url.toString()};\n  }\n}\n\nasync function setChallengeLocale() {\n  const {loadEnglishChallenge, simulateUserInput} = await storage.get([\n    'loadEnglishChallenge',\n    'simulateUserInput'\n  ]);\n\n  if (mv3) {\n    if (loadEnglishChallenge || simulateUserInput) {\n      await browser.declarativeNetRequest.updateSessionRules({\n        removeRuleIds: [1],\n        addRules: [\n          {\n            id: 1,\n            action: {\n              type: 'redirect',\n              redirect: {\n                transform: {\n                  queryTransform: {\n                    addOrReplaceParams: [{key: 'hl', value: 'en'}]\n                  }\n                }\n              }\n            },\n            condition: {\n              regexFilter: recaptchaUrlRxString,\n              resourceTypes: ['sub_frame']\n            }\n          }\n        ]\n      });\n    } else {\n      await browser.declarativeNetRequest.updateSessionRules({\n        removeRuleIds: [1]\n      });\n    }\n  } else {\n    if (loadEnglishChallenge || simulateUserInput) {\n      if (\n        !browser.webRequest.onBeforeRequest.hasListener(\n          challengeRequestCallback\n        )\n      ) {\n        browser.webRequest.onBeforeRequest.addListener(\n          challengeRequestCallback,\n          {\n            urls: [\n              'https://google.com/recaptcha/api2/anchor*',\n              'https://google.com/recaptcha/api2/bframe*',\n              'https://www.google.com/recaptcha/api2/anchor*',\n              'https://www.google.com/recaptcha/api2/bframe*',\n              'https://google.com/recaptcha/enterprise/anchor*',\n              'https://google.com/recaptcha/enterprise/bframe*',\n              'https://www.google.com/recaptcha/enterprise/anchor*',\n              'https://www.google.com/recaptcha/enterprise/bframe*',\n              'https://recaptcha.net/recaptcha/api2/anchor*',\n              'https://recaptcha.net/recaptcha/api2/bframe*',\n              'https://www.recaptcha.net/recaptcha/api2/anchor*',\n              'https://www.recaptcha.net/recaptcha/api2/bframe*',\n              'https://recaptcha.net/recaptcha/enterprise/anchor*',\n              'https://recaptcha.net/recaptcha/enterprise/bframe*',\n              'https://www.recaptcha.net/recaptcha/enterprise/anchor*',\n              'https://www.recaptcha.net/recaptcha/enterprise/bframe*'\n            ],\n            types: ['sub_frame']\n          },\n          ['blocking']\n        );\n      }\n    } else if (\n      browser.webRequest.onBeforeRequest.hasListener(challengeRequestCallback)\n    ) {\n      browser.webRequest.onBeforeRequest.removeListener(\n        challengeRequestCallback\n      );\n    }\n  }\n}\n\nfunction removeRequestHeaders(details) {\n  const headers = details.requestHeaders;\n\n  const isBackgroundRequest = headers.some(\n    header =>\n      header.name.toLowerCase() === 'origin' &&\n      header.value === self.location.origin\n  );\n\n  if (isBackgroundRequest) {\n    for (const header of headers) {\n      const name = header.name.toLowerCase();\n\n      if (name === 'origin' || name === 'referer') {\n        headers.splice(headers.indexOf(header), 1);\n      }\n    }\n  }\n\n  return {requestHeaders: headers};\n}\n\nasync function addBackgroundRequestListener() {\n  const ruleIds = [2];\n\n  if (mv3) {\n    await browser.declarativeNetRequest.updateSessionRules({\n      removeRuleIds: ruleIds,\n      addRules: [\n        {\n          id: ruleIds[0],\n          action: {\n            type: 'modifyHeaders',\n            requestHeaders: [\n              {operation: 'remove', header: 'Origin'},\n              {operation: 'remove', header: 'Referer'}\n            ]\n          },\n          condition: {\n            // https://google.com/*\n            // https://www.google.com/*\n            // https://recaptcha.net/*\n            // https://www.recaptcha.net/*\n            // https://api.wit.ai/*\n            // https://speech.googleapis.com/*\n            // https://iam.cloud.ibm.com/*\n            // https://*.speech-to-text.watson.cloud.ibm.com/*\n            // wss://*.speech-to-text.watson.cloud.ibm.com/*\n            // https://*.stt.speech.microsoft.com/*\n            requestDomains: [\n              'google.com',\n              'recaptcha.net',\n              'api.wit.ai',\n              'speech.googleapis.com',\n              'iam.cloud.ibm.com',\n              'speech-to-text.watson.cloud.ibm.com',\n              'stt.speech.microsoft.com'\n            ],\n            initiatorDomains: [getExtensionDomain()],\n            resourceTypes: ['websocket', 'xmlhttprequest']\n          }\n        }\n      ]\n    });\n\n    return ruleIds;\n  } else {\n    if (\n      !browser.webRequest.onBeforeSendHeaders.hasListener(removeRequestHeaders)\n    ) {\n      const urls = [\n        'https://google.com/*',\n        'https://www.google.com/*',\n        'https://recaptcha.net/*',\n        'https://www.recaptcha.net/*',\n        'https://api.wit.ai/*',\n        'https://speech.googleapis.com/*',\n        '*://*.speech-to-text.watson.cloud.ibm.com/*',\n        'https://iam.cloud.ibm.com/*',\n        'https://*.stt.speech.microsoft.com/*'\n      ];\n\n      const extraInfo = ['blocking', 'requestHeaders'];\n      if (\n        targetEnv !== 'firefox' &&\n        Object.values(browser.webRequest.OnBeforeSendHeadersOptions).includes(\n          'extraHeaders'\n        )\n      ) {\n        extraInfo.push('extraHeaders');\n      }\n\n      browser.webRequest.onBeforeSendHeaders.addListener(\n        removeRequestHeaders,\n        {\n          urls,\n          types: ['websocket', 'xmlhttprequest']\n        },\n        extraInfo\n      );\n    }\n  }\n}\n\nasync function removeBackgroundRequestListener({ruleIds = null} = {}) {\n  if (mv3) {\n    await browser.declarativeNetRequest.updateSessionRules({\n      removeRuleIds: ruleIds\n    });\n  } else {\n    if (\n      browser.webRequest.onBeforeSendHeaders.hasListener(removeRequestHeaders)\n    ) {\n      browser.webRequest.onBeforeSendHeaders.removeListener(\n        removeRequestHeaders\n      );\n    }\n  }\n}\n\nlet secrets;\nasync function loadSecrets() {\n  if (mv3) {\n    const {secrets: data} = await storage.get('secrets', {area: 'session'});\n    if (data) {\n      return data;\n    }\n  } else {\n    if (secrets) {\n      return secrets;\n    }\n  }\n\n  let data;\n\n  try {\n    const ciphertext = await (await fetch('/secrets.txt')).text();\n\n    const key = sha256(\n      (await (await fetch('/src/background/script.js')).text()) +\n        (await (await fetch('/src/base/script.js')).text())\n    ).toString();\n\n    data = JSON.parse(aes.decrypt(ciphertext, key).toString(utf8));\n  } catch (err) {\n    const {speechService} = await storage.get('speechService');\n    if (speechService === 'witSpeechApiDemo') {\n      await storage.set({speechService: 'witSpeechApi'});\n    }\n\n    data = {};\n  } finally {\n    if (mv3) {\n      await storage.set({secrets: data}, {area: 'session'});\n    } else {\n      secrets = data;\n    }\n  }\n\n  return data;\n}\n\nasync function getWitSpeechApiKey(speechService, language) {\n  if (speechService === 'witSpeechApiDemo') {\n    const secrets = await loadSecrets();\n\n    const apiKeys = secrets.witApiKeys;\n    if (apiKeys) {\n      const apiKey = apiKeys[language];\n      if (Array.isArray(apiKey)) {\n        return apiKey[getRandomInt(1, apiKey.length) - 1];\n      }\n      return apiKey;\n    }\n  } else {\n    const {witSpeechApiKeys: apiKeys} = await storage.get('witSpeechApiKeys');\n    return apiKeys[language];\n  }\n}\n\nasync function getWitSpeechApiResult(apiKey, audioContent) {\n  const result = {};\n\n  const rsp = await fetch('https://api.wit.ai/speech?v=20240304', {\n    method: 'POST',\n    headers: {\n      Authorization: 'Bearer ' + apiKey\n    },\n    body: new Blob([audioContent], {type: 'audio/wav'}),\n    credentials: 'omit'\n  });\n\n  if (rsp.status !== 200) {\n    if (rsp.status === 429) {\n      result.errorId = 'error_apiQuotaExceeded';\n      result.errorTimeout = 6000;\n    } else {\n      throw new Error(`API response: ${rsp.status}, ${await rsp.text()}`);\n    }\n  } else {\n    const data = JSON.parse((await rsp.text()).split('\\r\\n').at(-1)).text;\n    if (data) {\n      result.text = data.trim();\n    }\n  }\n\n  return result;\n}\n\nasync function getGoogleSpeechApiResult(\n  apiKey,\n  audioContent,\n  language,\n  detectAltLanguages\n) {\n  const data = {\n    audio: {\n      content: arrayBufferToBase64(audioContent)\n    },\n    config: {\n      encoding: 'LINEAR16',\n      languageCode: language,\n      model: 'video',\n      sampleRateHertz: 16000\n    }\n  };\n\n  if (!['en-US', 'en-GB'].includes(language) && detectAltLanguages) {\n    data.config.model = 'default';\n    data.config.alternativeLanguageCodes = ['en-US'];\n  }\n\n  const rsp = await fetch(\n    `https://speech.googleapis.com/v1p1beta1/speech:recognize?key=${apiKey}`,\n    {\n      method: 'POST',\n      body: JSON.stringify(data),\n      credentials: 'omit'\n    }\n  );\n\n  if (rsp.status !== 200) {\n    throw new Error(`API response: ${rsp.status}, ${await rsp.text()}`);\n  }\n\n  const results = (await rsp.json()).results;\n  if (results) {\n    return results[0].alternatives[0].transcript.trim();\n  }\n}\n\nasync function getIbmSpeechApiResult(apiUrl, apiKey, audioContent, model) {\n  // Issue:\n\n  // IBM HTTP API: response status 400 when Priority header is sent\n  // Error: could not convert string to float: 'u=4'\n\n  // Chrome 124 and Firefox 126 sets the Priority header for HTTP/2 requests,\n  // but it cannot be removed by the extension, declarativeNetRequest\n  // and webRequest do not see the header because it is set by the browser\n  // after request filtering occurs.\n\n  // Chrome accepts a custom Priority header value, but Firefox ignores it.\n\n  // IBM has a WebSocket API, but in Chrome declarativeNetRequest rules\n  // do not match WebSocket requests from background scripts,\n  // so the Origin header we remove for API calls would be exposed.\n\n  // Solution:\n\n  // The HTTP API is used in Chrome with an invalid Priority header value\n  // that can be converted to float, and the WebSocket API is used in Firefox.\n\n  if (targetEnv === 'firefox') {\n    const rsp = await fetch('https://iam.cloud.ibm.com/identity/token', {\n      method: 'POST',\n      body: new URLSearchParams({\n        grant_type: 'urn:ibm:params:oauth:grant-type:apikey',\n        apikey: apiKey\n      }),\n      credentials: 'omit'\n    });\n\n    if (rsp.status !== 200) {\n      throw new Error(`API response: ${rsp.status}, ${await rsp.text()}`);\n    }\n\n    const {access_token: accessToken} = await rsp.json();\n    const wsUrl = apiUrl.replace(/^https(.*)/, 'wss$1');\n\n    const ws = new WebSocket(\n      `${wsUrl}/v1/recognize?access_token=${accessToken}&model=${model}&x-watson-learning-opt-out=true`\n    );\n\n    return await new Promise((resolve, reject) => {\n      const timeoutId = self.setTimeout(function () {\n        ws.close();\n        reject(new Error('API timeout'));\n      }, 30000); // 30 seconds\n\n      function response({result, error} = {}) {\n        self.clearTimeout(timeoutId);\n\n        if (error) {\n          reject(error);\n        } else {\n          resolve(result);\n        }\n      }\n\n      ws.onopen = function (ev) {\n        ws.send(\n          JSON.stringify({\n            action: 'start',\n            'content-type': 'audio/wav',\n            profanity_filter: false\n          })\n        );\n\n        ws.send(new Blob([audioContent]));\n\n        ws.send(JSON.stringify({action: 'stop'}));\n      };\n\n      ws.onmessage = function (ev) {\n        const results = JSON.parse(ev.data).results;\n\n        if (results) {\n          ws.close();\n\n          response({result: results[0]?.alternatives[0].transcript.trim()});\n        }\n      };\n\n      ws.onclose = function (ev) {\n        if (ev.code !== 1000) {\n          response({error: new Error(`API response: ${ev.code}`)});\n        }\n      };\n\n      ws.onerror = function (ev) {\n        response({error: new Error(`API response: ${ev.code}`)});\n      };\n    });\n  } else {\n    const rsp = await fetch(\n      `${apiUrl}/v1/recognize?model=${model}&profanity_filter=false`,\n      {\n        method: 'POST',\n        headers: {\n          Authorization: 'Basic ' + self.btoa('apikey:' + apiKey),\n          'X-Watson-Learning-Opt-Out': 'true',\n          // Invalid value, see description above\n          Priority: '1'\n        },\n        body: new Blob([audioContent], {type: 'audio/wav'}),\n        credentials: 'omit'\n      }\n    );\n\n    if (rsp.status !== 200) {\n      throw new Error(`API response: ${rsp.status}, ${await rsp.text()}`);\n    }\n\n    const results = (await rsp.json()).results;\n    if (results && results.length) {\n      return results[0].alternatives[0].transcript.trim();\n    }\n  }\n}\n\nasync function getMicrosoftSpeechApiResult(\n  apiLocation,\n  apiKey,\n  audioContent,\n  language\n) {\n  const rsp = await fetch(\n    `https://${apiLocation}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=${language}&format=detailed&profanity=raw`,\n    {\n      method: 'POST',\n      headers: {\n        'Ocp-Apim-Subscription-Key': apiKey,\n        'Content-type': 'audio/wav; codec=audio/pcm; samplerate=16000'\n      },\n      body: new Blob([audioContent], {type: 'audio/wav'}),\n      credentials: 'omit'\n    }\n  );\n\n  if (rsp.status !== 200) {\n    throw new Error(`API response: ${rsp.status}, ${await rsp.text()}`);\n  }\n\n  const results = (await rsp.json()).NBest;\n  if (results) {\n    return results[0].Lexical.trim();\n  }\n}\n\nasync function transcribeAudio(audioUrl, lang) {\n  const audioBuffer = await (\n    await fetch(audioUrl, {credentials: 'omit'})\n  ).arrayBuffer();\n\n  const audioOptions = {trimStart: 1.5, trimEnd: 1.5};\n\n  let audioContent;\n  if (mv3 && !['firefox', 'safari'].includes(targetEnv)) {\n    await setupOffscreenDocument({\n      url: '/src/offscreen/index.html',\n      reasons: ['USER_MEDIA'],\n      justification: 'process audio'\n    });\n\n    const {audioString} = await sendOffscreenMessage({\n      id: 'processAudio',\n      audioString: arrayBufferToBase64(audioBuffer),\n      audioOptions\n    });\n\n    await browser.offscreen.closeDocument();\n\n    audioContent = base64ToArrayBuffer(audioString);\n  } else {\n    audioContent = await prepareAudio(audioBuffer, audioOptions);\n  }\n\n  let solution;\n\n  const {speechService, tryEnglishSpeechModel} = await storage.get([\n    'speechService',\n    'tryEnglishSpeechModel'\n  ]);\n\n  if (['witSpeechApiDemo', 'witSpeechApi'].includes(speechService)) {\n    const language = captchaWitSpeechApiLangCodes[lang] || 'english';\n\n    const apiKey = await getWitSpeechApiKey(speechService, language);\n\n    if (!apiKey) {\n      showNotification({messageId: 'error_missingApiKey'});\n      return;\n    }\n\n    const result = await getWitSpeechApiResult(apiKey, audioContent);\n    if (result.errorId) {\n      showNotification({\n        messageId: result.errorId,\n        timeout: result.errorTimeout\n      });\n      return;\n    }\n    solution = result.text;\n\n    if (!solution && language !== 'english' && tryEnglishSpeechModel) {\n      const apiKey = await getWitSpeechApiKey(speechService, 'english');\n\n      if (!apiKey) {\n        showNotification({messageId: 'error_missingApiKey'});\n        return;\n      }\n\n      const result = await getWitSpeechApiResult(apiKey, audioContent);\n      if (result.errorId) {\n        showNotification({\n          messageId: result.errorId,\n          timeout: result.errorTimeout\n        });\n        return;\n      }\n      solution = result.text;\n    }\n  } else if (speechService === 'googleSpeechApi') {\n    const {googleSpeechApiKey: apiKey} =\n      await storage.get('googleSpeechApiKey');\n\n    if (!apiKey) {\n      showNotification({messageId: 'error_missingApiKey'});\n      return;\n    }\n\n    const language = captchaGoogleSpeechApiLangCodes[lang] || 'en-US';\n\n    solution = await getGoogleSpeechApiResult(\n      apiKey,\n      audioContent,\n      language,\n      tryEnglishSpeechModel\n    );\n  } else if (speechService === 'ibmSpeechApi') {\n    const {ibmSpeechApiUrl: apiUrl, ibmSpeechApiKey: apiKey} =\n      await storage.get(['ibmSpeechApiUrl', 'ibmSpeechApiKey']);\n\n    if (!apiUrl) {\n      showNotification({messageId: 'error_missingApiUrl'});\n      return;\n    }\n    if (!apiKey) {\n      showNotification({messageId: 'error_missingApiKey'});\n      return;\n    }\n\n    const model = captchaIbmSpeechApiLangCodes[lang] || 'en-US_Multimedia';\n\n    solution = await getIbmSpeechApiResult(apiUrl, apiKey, audioContent, model);\n\n    if (\n      !solution &&\n      !['en-US_Multimedia', 'en-GB_Multimedia'].includes(model) &&\n      tryEnglishSpeechModel\n    ) {\n      solution = await getIbmSpeechApiResult(\n        apiUrl,\n        apiKey,\n        audioContent,\n        'en-US_Multimedia'\n      );\n    }\n  } else if (speechService === 'microsoftSpeechApi') {\n    const {microsoftSpeechApiLoc: apiLocaction, microsoftSpeechApiKey: apiKey} =\n      await storage.get(['microsoftSpeechApiLoc', 'microsoftSpeechApiKey']);\n\n    if (!apiKey) {\n      showNotification({messageId: 'error_missingApiKey'});\n      return;\n    }\n\n    const language = captchaMicrosoftSpeechApiLangCodes[lang] || 'en-US';\n\n    solution = await getMicrosoftSpeechApiResult(\n      apiLocaction,\n      apiKey,\n      audioContent,\n      language\n    );\n    if (\n      !solution &&\n      !['en-US', 'en-GB'].includes(language) &&\n      tryEnglishSpeechModel\n    ) {\n      solution = await getMicrosoftSpeechApiResult(\n        apiLocaction,\n        apiKey,\n        audioContent,\n        'en-US'\n      );\n    }\n  }\n\n  if (!solution) {\n    if (['witSpeechApiDemo', 'witSpeechApi'].includes(speechService)) {\n      showNotification({\n        messageId: 'error_captchaNotSolvedWitai',\n        timeout: 20000\n      });\n    } else {\n      showNotification({messageId: 'error_captchaNotSolved', timeout: 6000});\n    }\n  } else {\n    return solution;\n  }\n}\n\nasync function processMessage(request, sender) {\n  // Samsung Internet 13: extension messages are sometimes also dispatched\n  // to the sender frame.\n  if (sender.url === self.location.href) {\n    return;\n  }\n\n  if (targetEnv === 'samsung') {\n    if (await isValidTab({tab: sender.tab})) {\n      // Samsung Internet 13: runtime.onMessage provides wrong tab index.\n      sender.tab = await browser.tabs.get(sender.tab.id);\n    }\n  }\n\n  if (request.id === 'notification') {\n    showNotification({\n      message: request.message,\n      messageId: request.messageId,\n      title: request.title,\n      type: request.type,\n      timeout: request.timeout\n    });\n  } else if (request.id === 'captchaSolved') {\n    await processAppUse();\n  } else if (request.id === 'transcribeAudio') {\n    const ruleIds = await addBackgroundRequestListener();\n    try {\n      return await transcribeAudio(request.audioUrl, request.lang);\n    } finally {\n      await removeBackgroundRequestListener({ruleIds});\n    }\n  } else if (request.id === 'resetCaptcha') {\n    await resetCaptcha(sender.tab.id, sender.frameId, request.challengeUrl);\n  } else if (request.id === 'getFramePos') {\n    return getFramePos(sender.tab.id, sender.frameId, request.frameIndex);\n  } else if (request.id === 'getOsScale') {\n    let zoom = await browser.tabs.getZoom(sender.tab.id);\n\n    const [[scale, windowWidth]] = await executeScript({\n      func: () => [window.devicePixelRatio, window.innerWidth],\n      code: `[window.devicePixelRatio, window.innerWidth];`,\n      tabId: sender.tab.id\n    });\n\n    if (targetEnv === 'firefox') {\n      // https://bugzilla.mozilla.org/show_bug.cgi?id=1787649\n\n      function getImageElement(url) {\n        return new Promise(resolve => {\n          const img = new Image();\n          img.onload = () => {\n            resolve(img);\n          };\n          img.onerror = () => {\n            resolve();\n          };\n          img.onabort = () => {\n            resolve();\n          };\n          img.src = url;\n        });\n      }\n\n      const screenshotWidth = (\n        await getImageElement(\n          await browser.tabs.captureVisibleTab({\n            format: 'jpeg',\n            quality: 10\n          })\n        )\n      ).naturalWidth;\n\n      if (Math.abs(screenshotWidth / windowWidth - scale * zoom) < 0.005) {\n        zoom = 1;\n      }\n    }\n\n    return scale / zoom;\n  } else if (request.id === 'startClientApp') {\n    nativePort = browser.runtime.connectNative('org.buster.client');\n  } else if (request.id === 'stopClientApp') {\n    if (nativePort) {\n      nativePort.disconnect();\n    }\n  } else if (request.id === 'messageClientApp') {\n    const message = {\n      apiVersion: clientAppVersion,\n      ...request.message\n    };\n    return sendNativeMessage(nativePort, message);\n  } else if (request.id === 'openOptions') {\n    await showOptionsPage();\n  } else if (request.id === 'getPlatform') {\n    return getPlatform();\n  } else if (request.id === 'getBrowser') {\n    return getBrowser();\n  } else if (request.id === 'optionChange') {\n    await onOptionChange();\n  } else if (request.id === 'clientAppInstall') {\n    await onClientAppInstall();\n  }\n}\n\nfunction onMessage(request, sender, sendResponse) {\n  const response = processMessage(request, sender);\n\n  return processMessageResponse(response, sendResponse);\n}\n\nasync function onClientAppInstall() {\n  await storage.set({simulateUserInput: true});\n\n  await browser.runtime\n    .sendMessage({id: 'reloadOptionsPage'})\n    .catch(() => null);\n}\n\nasync function onOptionChange() {\n  await setChallengeLocale();\n}\n\nasync function onActionButtonClick(tab) {\n  await showOptionsPage();\n}\n\nasync function onInstall(details) {\n  if (['install', 'update'].includes(details.reason)) {\n    await setup({event: 'install'});\n  }\n}\n\nasync function onStartup() {\n  await setup({event: 'startup'});\n}\n\nfunction addActionListener() {\n  if (mv3) {\n    browser.action.onClicked.addListener(onActionButtonClick);\n  } else {\n    browser.browserAction.onClicked.addListener(onActionButtonClick);\n  }\n}\n\nfunction addMessageListener() {\n  browser.runtime.onMessage.addListener(onMessage);\n}\n\nfunction addInstallListener() {\n  browser.runtime.onInstalled.addListener(onInstall);\n}\n\nfunction addStartupListener() {\n  browser.runtime.onStartup.addListener(onStartup);\n}\n\nasync function setup({event = ''} = {}) {\n  const startup = await getStartupState({event});\n\n  if (startup.setupInstance) {\n    await runOnce('setupInstance', async () => {\n      if (!(await isStorageReady())) {\n        await initStorage();\n      }\n\n      if (['chrome', 'edge', 'opera', 'samsung'].includes(targetEnv)) {\n        await insertBaseModule();\n      }\n\n      if (startup.install) {\n        const setupTabs = await browser.tabs.query({\n          url: 'http://127.0.0.1/buster/setup?session=*',\n          windowType: 'normal'\n        });\n\n        for (const tab of setupTabs) {\n          await browser.tabs.reload(tab.id);\n        }\n      }\n\n      if (startup.update) {\n        await setAppVersion();\n      }\n    });\n  }\n\n  if (startup.setupSession) {\n    await runOnce('setupSession', async () => {\n      if (mv3 && !(await isStorageReady({area: 'session'}))) {\n        await initStorage({area: 'session', silent: true});\n      }\n\n      await setChallengeLocale();\n    });\n  }\n}\n\nfunction init() {\n  addActionListener();\n  addMessageListener();\n  addInstallListener();\n  addStartupListener();\n\n  setup();\n}\n\ninit();\n"
  },
  {
    "path": "src/base/main.js",
    "content": "import storage from 'storage/storage';\nimport {meanSleep, pingClientApp} from 'utils/app';\nimport {\n  getText,\n  findNode,\n  getRandomFloat,\n  sleep,\n  getBrowser\n} from 'utils/common';\nimport {targetEnv, clientAppVersion} from 'utils/config';\n\nfunction main() {\n  // Script may be injected multiple times.\n  if (self.baseModule) {\n    return;\n  } else {\n    self.baseModule = true;\n  }\n\n  let solverWorking = false;\n  let solverButton = null;\n\n  function setSolverState({working = true} = {}) {\n    solverWorking = working;\n    if (solverButton) {\n      if (working) {\n        solverButton.classList.add('working');\n      } else {\n        solverButton.classList.remove('working');\n      }\n    }\n  }\n\n  function resetCaptcha() {\n    return browser.runtime.sendMessage({\n      id: 'resetCaptcha',\n      challengeUrl: window.location.href\n    });\n  }\n\n  function syncUI() {\n    if (isBlocked()) {\n      if (!document.querySelector('.solver-controls')) {\n        const div = document.createElement('div');\n        div.classList.add('solver-controls');\n\n        const button = document.createElement('button');\n        button.classList.add('rc-button');\n        button.setAttribute('tabindex', '0');\n        button.setAttribute('title', getText('buttonLabel_reset'));\n        button.id = 'reset-button';\n\n        button.addEventListener('click', resetCaptcha);\n\n        div.appendChild(button);\n        document.querySelector('.rc-footer').appendChild(div);\n      }\n      return;\n    }\n\n    const helpButton = document.querySelector('#recaptcha-help-button');\n    if (helpButton) {\n      helpButton.remove();\n\n      const helpButtonHolder = document.querySelector('.help-button-holder');\n      helpButtonHolder.tabIndex = document.querySelector('audio#audio-source')\n        ? 0\n        : 2;\n\n      const shadow = helpButtonHolder.attachShadow({\n        mode: 'closed',\n        delegatesFocus: true\n      });\n\n      const link = document.createElement('link');\n      link.setAttribute('rel', 'stylesheet');\n      link.setAttribute(\n        'href',\n        browser.runtime.getURL('/src/base/solver-button.css')\n      );\n      shadow.appendChild(link);\n\n      solverButton = document.createElement('button');\n      solverButton.setAttribute('tabindex', '0');\n      solverButton.setAttribute('title', getText('buttonLabel_solve'));\n      solverButton.id = 'solver-button';\n      if (solverWorking) {\n        solverButton.classList.add('working');\n      }\n\n      solverButton.addEventListener('click', solveChallenge);\n\n      shadow.appendChild(solverButton);\n    }\n  }\n\n  function isBlocked({timeout = 0} = {}) {\n    const selector = '.rc-doscaptcha-body';\n    if (timeout) {\n      return new Promise(resolve => {\n        findNode(selector, {timeout, throwError: false}).then(result =>\n          resolve(Boolean(result))\n        );\n      });\n    }\n\n    return Boolean(document.querySelector(selector));\n  }\n\n  function dispatchEnter(node) {\n    const keyEvent = {\n      code: 'Enter',\n      key: 'Enter',\n      keyCode: 13,\n      which: 13,\n      view: window,\n      bubbles: true,\n      composed: true,\n      cancelable: true\n    };\n\n    node.focus();\n    node.dispatchEvent(new KeyboardEvent('keydown', keyEvent));\n    node.dispatchEvent(new KeyboardEvent('keypress', keyEvent));\n    node.click();\n  }\n\n  async function navigateToElement(node, {forward = true} = {}) {\n    if (document.activeElement === node) {\n      return;\n    }\n\n    if (!forward) {\n      await messageClientApp({command: 'pressKey', data: 'shift'});\n      await meanSleep(300);\n    }\n\n    while (document.activeElement !== node) {\n      await messageClientApp({command: 'tapKey', data: 'tab'});\n      await meanSleep(300);\n    }\n\n    if (!forward) {\n      await messageClientApp({command: 'releaseKey', data: 'shift'});\n      await meanSleep(300);\n    }\n  }\n\n  async function tapEnter(node, {navigateForward = true} = {}) {\n    await navigateToElement(node, {forward: navigateForward});\n    await meanSleep(200);\n    await messageClientApp({command: 'tapKey', data: 'enter'});\n  }\n\n  async function clickElement(node, browserBorder, osScale) {\n    const targetPos = await getClickPos(node, browserBorder, osScale);\n    await messageClientApp({command: 'moveMouse', ...targetPos});\n    await meanSleep(100);\n    await messageClientApp({command: 'clickMouse'});\n  }\n\n  async function messageClientApp(message) {\n    const rsp = await browser.runtime.sendMessage({\n      id: 'messageClientApp',\n      message\n    });\n\n    if (!rsp.success) {\n      throw new Error(`Client app response: ${rsp.text}`);\n    }\n\n    return rsp;\n  }\n\n  async function getOsScale() {\n    return browser.runtime.sendMessage({id: 'getOsScale'});\n  }\n\n  async function getBrowserBorder(clickEvent, osScale) {\n    const framePos = await getFrameClientPos();\n    const scale = window.devicePixelRatio;\n\n    let evScreenPropScale = osScale;\n    if (\n      targetEnv === 'firefox' &&\n      parseInt((await getBrowser()).version.split('.')[0], 10) >= 99\n    ) {\n      // https://bugzilla.mozilla.org/show_bug.cgi?id=1753836\n\n      evScreenPropScale = scale;\n    }\n\n    return {\n      left:\n        clickEvent.screenX * evScreenPropScale -\n        clickEvent.clientX * scale -\n        framePos.x -\n        window.screenX * scale,\n      top:\n        clickEvent.screenY * evScreenPropScale -\n        clickEvent.clientY * scale -\n        framePos.y -\n        window.screenY * scale\n    };\n  }\n\n  async function getFrameClientPos() {\n    if (window !== window.top) {\n      let frameIndex;\n      const siblingWindows = window.parent.frames;\n      for (let i = 0; i < siblingWindows.length; i++) {\n        if (siblingWindows[i] === window) {\n          frameIndex = i;\n          break;\n        }\n      }\n\n      return await browser.runtime.sendMessage({id: 'getFramePos', frameIndex});\n    }\n\n    return {x: 0, y: 0};\n  }\n\n  async function getElementScreenRect(node, browserBorder, osScale) {\n    let {left: x, top: y, width, height} = node.getBoundingClientRect();\n\n    const data = await getFrameClientPos();\n    const scale = window.devicePixelRatio;\n\n    x *= scale;\n    y *= scale;\n    width *= scale;\n    height *= scale;\n\n    x += data.x + browserBorder.left + window.screenX * scale;\n    y += data.y + browserBorder.top + window.screenY * scale;\n\n    const {os} = await browser.runtime.sendMessage({id: 'getPlatform'});\n    if (['windows', 'macos'].includes(os)) {\n      x /= osScale;\n      y /= osScale;\n      width /= osScale;\n      height /= osScale;\n    }\n\n    return {x, y, width, height};\n  }\n\n  async function getClickPos(node, browserBorder, osScale) {\n    let {x, y, width, height} = await getElementScreenRect(\n      node,\n      browserBorder,\n      osScale\n    );\n\n    return {\n      x: Math.round(x + width * getRandomFloat(0.4, 0.6)),\n      y: Math.round(y + height * getRandomFloat(0.4, 0.6))\n    };\n  }\n\n  async function solve(simulateUserInput, clickEvent) {\n    if (isBlocked()) {\n      return;\n    }\n\n    const {navigateWithKeyboard} = await storage.get('navigateWithKeyboard');\n\n    let browserBorder;\n    let osScale;\n    let useMouse = true;\n    if (simulateUserInput) {\n      if (!navigateWithKeyboard && (clickEvent.clientX || clickEvent.clientY)) {\n        osScale = await getOsScale();\n        browserBorder = await getBrowserBorder(clickEvent, osScale);\n      } else {\n        useMouse = false;\n      }\n    }\n\n    const audioElSelector = 'audio#audio-source';\n    let audioEl = document.querySelector(audioElSelector);\n    if (!audioEl) {\n      const audioButton = document.querySelector('#recaptcha-audio-button');\n      if (simulateUserInput) {\n        if (useMouse) {\n          await clickElement(audioButton, browserBorder, osScale);\n        } else {\n          audioButton.focus();\n          await tapEnter(audioButton);\n        }\n      } else {\n        dispatchEnter(audioButton);\n      }\n\n      const result = await Promise.race([\n        new Promise(resolve => {\n          findNode(audioElSelector, {timeout: 10000, throwError: false}).then(\n            el => {\n              meanSleep(500).then(() => resolve({audioEl: el}));\n            }\n          );\n        }),\n        new Promise(resolve => {\n          isBlocked({timeout: 10000}).then(blocked => resolve({blocked}));\n        })\n      ]);\n\n      if (result.blocked) {\n        return;\n      }\n\n      audioEl = result.audioEl;\n    }\n\n    if (simulateUserInput) {\n      const muteAudio = function () {\n        audioEl.muted = true;\n      };\n      const unmuteAudio = function () {\n        removeCallbacks();\n        audioEl.muted = false;\n      };\n\n      audioEl.addEventListener('playing', muteAudio, {\n        capture: true,\n        once: true\n      });\n      audioEl.addEventListener('ended', unmuteAudio, {\n        capture: true,\n        once: true\n      });\n\n      const removeCallbacks = function () {\n        window.clearTimeout(timeoutId);\n        audioEl.removeEventListener('playing', muteAudio, {\n          capture: true,\n          once: true\n        });\n        audioEl.removeEventListener('ended', unmuteAudio, {\n          capture: true,\n          once: true\n        });\n      };\n\n      const timeoutId = window.setTimeout(unmuteAudio, 10000); // 10 seconds\n\n      const playButton = document.querySelector(\n        '.rc-audiochallenge-play-button > button'\n      );\n      if (useMouse) {\n        await clickElement(playButton, browserBorder, osScale);\n      } else {\n        await tapEnter(playButton);\n      }\n    }\n\n    const audioUrl = audioEl.src;\n    const lang = document.documentElement.lang;\n\n    const solution = await browser.runtime.sendMessage({\n      id: 'transcribeAudio',\n      audioUrl,\n      lang\n    });\n\n    if (!solution) {\n      return;\n    }\n\n    const input = document.querySelector('#audio-response');\n    if (simulateUserInput) {\n      if (useMouse) {\n        await clickElement(input, browserBorder, osScale);\n      } else {\n        await navigateToElement(input);\n      }\n      await meanSleep(200);\n\n      await messageClientApp({command: 'typeText', data: solution});\n    } else {\n      input.value = solution;\n    }\n\n    const submitButton = document.querySelector('#recaptcha-verify-button');\n    if (simulateUserInput) {\n      if (useMouse) {\n        await clickElement(submitButton, browserBorder, osScale);\n      } else {\n        await tapEnter(submitButton);\n      }\n    } else {\n      dispatchEnter(submitButton);\n    }\n\n    browser.runtime.sendMessage({id: 'captchaSolved'});\n  }\n\n  function solveChallenge(ev) {\n    ev.preventDefault();\n    ev.stopImmediatePropagation();\n\n    if (!ev.isTrusted || solverWorking) {\n      return;\n    }\n    setSolverState({working: true});\n\n    runSolver(ev)\n      .catch(err => {\n        browser.runtime.sendMessage({\n          id: 'notification',\n          messageId: 'error_internalError'\n        });\n        console.log(err.toString());\n        throw err;\n      })\n      .finally(() => {\n        setSolverState({working: false});\n      });\n  }\n\n  async function runSolver(ev) {\n    const {simulateUserInput, autoUpdateClientApp} = await storage.get([\n      'simulateUserInput',\n      'autoUpdateClientApp'\n    ]);\n\n    if (simulateUserInput) {\n      try {\n        let pingRsp;\n\n        try {\n          pingRsp = await pingClientApp({stop: false, checkResponse: false});\n        } catch (err) {\n          browser.runtime.sendMessage({\n            id: 'notification',\n            messageId: 'error_missingClientApp'\n          });\n          browser.runtime.sendMessage({id: 'openOptions'});\n          throw err;\n        }\n\n        if (!pingRsp.success) {\n          if (!pingRsp.apiVersion !== clientAppVersion) {\n            if (!autoUpdateClientApp || pingRsp.apiVersion === '1') {\n              browser.runtime.sendMessage({\n                id: 'notification',\n                messageId: 'error_outdatedClientApp'\n              });\n              browser.runtime.sendMessage({id: 'openOptions'});\n              throw new Error('Client app outdated');\n            } else {\n              try {\n                browser.runtime.sendMessage({\n                  id: 'notification',\n                  messageId: 'info_updatingClientApp'\n                });\n                const rsp = await browser.runtime.sendMessage({\n                  id: 'messageClientApp',\n                  message: {command: 'installClient', data: clientAppVersion}\n                });\n\n                if (rsp.success) {\n                  await browser.runtime.sendMessage({id: 'stopClientApp'});\n                  await sleep(10000);\n\n                  await pingClientApp({stop: false});\n\n                  await browser.runtime.sendMessage({\n                    id: 'messageClientApp',\n                    message: {command: 'installCleanup'}\n                  });\n                } else {\n                  throw new Error(`Client app update failed: ${rsp.data}`);\n                }\n              } catch (err) {\n                browser.runtime.sendMessage({\n                  id: 'notification',\n                  messageId: 'error_clientAppUpdateFailed'\n                });\n                browser.runtime.sendMessage({id: 'openOptions'});\n                throw err;\n              }\n            }\n          }\n        }\n      } catch (err) {\n        console.log(err.toString());\n        await browser.runtime.sendMessage({id: 'stopClientApp'});\n        return;\n      }\n    }\n\n    try {\n      await solve(simulateUserInput, ev);\n    } finally {\n      if (simulateUserInput) {\n        await browser.runtime.sendMessage({id: 'stopClientApp'});\n      }\n    }\n  }\n\n  function init() {\n    const observer = new MutationObserver(syncUI);\n    observer.observe(document, {\n      childList: true,\n      subtree: true\n    });\n\n    syncUI();\n  }\n\n  init();\n}\n\nmain();\n"
  },
  {
    "path": "src/base/solver-button.css",
    "content": "#solver-button {\n  background-image: url('data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%20192%20192%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M71.182%20138.872l27.077%2027.077H8.002v-18.051c0-19.947%2032.312-36.103%2072.205-36.103l17.058.993-26.083%2026.084m9.025-117.333c19.939%200%2036.103%2016.164%2036.103%2036.103s-16.164%2036.103-36.103%2036.103S44.105%2077.58%2044.105%2057.641s16.163-36.102%2036.102-36.102z%22%20fill%3D%22%23ff9f43%22%2F%3E%3Cpath%20fill%3D%22%2327ae60%22%20d%3D%22M171.362%2098.256l12.636%2012.726-58.938%2059.479-31.319-31.589%2012.636-12.727%2018.683%2018.774%2046.302-46.663%22%2F%3E%3C%2Fsvg%3E');\n  background-color: transparent;\n  background-position: center;\n  background-repeat: no-repeat;\n  background-size: 32px 32px;\n  width: 48px;\n  height: 48px;\n  padding: 0;\n  border: 0;\n  opacity: 0.8;\n  cursor: pointer;\n}\n\n#solver-button:focus,\n#solver-button:hover {\n  opacity: 1;\n}\n\n#solver-button:focus {\n  outline: none;\n}\n\n#solver-button:focus-visible {\n  background-color: rgba(216, 216, 216, 0.8);\n}\n\n#solver-button.working {\n  background-image: url('data:image/svg+xml,%3Csvg%20width%3D%2244%22%20height%3D%2244%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20stroke%3D%22%23727272%22%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-width%3D%225%22%3E%3Ccircle%20cx%3D%2222%22%20cy%3D%2222%22%20r%3D%221%22%3E%3Canimate%20attributeName%3D%22r%22%20begin%3D%220s%22%20dur%3D%221.8s%22%20values%3D%221%3B%2020%22%20calcMode%3D%22spline%22%20keyTimes%3D%220%3B%201%22%20keySplines%3D%220.165%2C%200.84%2C%200.44%2C%201%22%20repeatCount%3D%22indefinite%22%2F%3E%3Canimate%20attributeName%3D%22stroke-opacity%22%20begin%3D%220s%22%20dur%3D%221.8s%22%20values%3D%221%3B%200%22%20calcMode%3D%22spline%22%20keyTimes%3D%220%3B%201%22%20keySplines%3D%220.3%2C%200.61%2C%200.355%2C%201%22%20repeatCount%3D%22indefinite%22%2F%3E%3C%2Fcircle%3E%3Ccircle%20cx%3D%2222%22%20cy%3D%2222%22%20r%3D%221%22%3E%3Canimate%20attributeName%3D%22r%22%20begin%3D%22-0.9s%22%20dur%3D%221.8s%22%20values%3D%221%3B%2020%22%20calcMode%3D%22spline%22%20keyTimes%3D%220%3B%201%22%20keySplines%3D%220.165%2C%200.84%2C%200.44%2C%201%22%20repeatCount%3D%22indefinite%22%2F%3E%3Canimate%20attributeName%3D%22stroke-opacity%22%20begin%3D%22-0.9s%22%20dur%3D%221.8s%22%20values%3D%221%3B%200%22%20calcMode%3D%22spline%22%20keyTimes%3D%220%3B%201%22%20keySplines%3D%220.3%2C%200.61%2C%200.355%2C%201%22%20repeatCount%3D%22indefinite%22%2F%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E') !important;\n  opacity: 1;\n}\n"
  },
  {
    "path": "src/base/style.css",
    "content": "#reset-button {\n  background-image: url('data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M17.65%206.35C16.2%204.9%2014.21%204%2012%204c-4.42%200-7.99%203.58-7.99%208s3.57%208%207.99%208c3.73%200%206.84-2.55%207.73-6h-2.08c-.82%202.33-3.04%204-5.65%204-3.31%200-6-2.69-6-6s2.69-6%206-6c1.66%200%203.14.69%204.22%201.78L13%2011h7V4l-2.35%202.35z%22%2F%3E%3C%2Fsvg%3E') !important;\n  background-color: transparent !important;\n}\n\n.solver-controls {\n  display: flex !important;\n  align-items: center !important;\n  justify-content: center !important;\n  height: 58px !important;\n}\n\n.rc-doscaptcha-header {\n  display: flex !important;\n  align-items: center !important;\n  justify-content: center !important;\n  height: 30px !important;\n}\n\n.rc-doscaptcha-body {\n  height: 120px !important;\n}\n\n.rc-doscaptcha-footer {\n  height: 60px !important;\n  pointer-events: auto !important;\n}\n\n.rc-doscaptcha-footer .rc-controls {\n  display: none !important;\n}\n"
  },
  {
    "path": "src/contribute/App.vue",
    "content": "<template>\n  <vn-app>\n    <vn-contribute\n      :extName=\"extName\"\n      :extSlug=\"extSlug\"\n      :notice=\"notice\"\n      @open=\"contribute\"\n    >\n    </vn-contribute>\n  </vn-app>\n</template>\n\n<script>\nimport {App} from 'vueton';\nimport {Contribute} from 'vueton/components/contribute';\n\nimport {showPage} from 'utils/app';\nimport {getText} from 'utils/common';\n\nexport default {\n  components: {\n    [App.name]: App,\n    [Contribute.name]: Contribute\n  },\n\n  data: function () {\n    return {\n      extName: getText('extensionName'),\n      extSlug: 'buster',\n      notice: ''\n    };\n  },\n\n  methods: {\n    setup: function () {\n      const query = new URL(window.location.href).searchParams;\n      if (query.get('action') === 'auto') {\n        this.notice = `This page is shown once a year while using the extension.`;\n      }\n    },\n\n    contribute: async function ({url} = {}) {\n      await showPage({url});\n    }\n  },\n\n  created: function () {\n    document.title = getText('pageTitle', [\n      getText('pageTitle_contribute'),\n      this.extName\n    ]);\n\n    this.setup();\n  }\n};\n</script>\n\n<style lang=\"scss\">\n@use 'vueton/styles' as vueton;\n\n@include vueton.theme-base;\n\n.v-application__wrap {\n  display: flex;\n  align-items: center;\n}\n</style>\n"
  },
  {
    "path": "src/contribute/index.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"color-scheme\" content=\"light dark\" />\n    <meta name=\"referrer\" content=\"no-referrer\" />\n    <link\n      rel=\"icon\"\n      href=\"/src/assets/icons/app/icon-64.png\"\n      type=\"image/png\"\n    />\n\n    <link href=\"/src/assets/fonts/roboto.css\" rel=\"stylesheet\" />\n    <link href=\"/src/commons-ui/style.css\" rel=\"stylesheet\" />\n    <link href=\"style.css\" rel=\"stylesheet\" />\n\n    <script src=\"/src/commons-ui/script.js\"></script>\n    <script src=\"script.js\" defer></script>\n  </head>\n  <body></body>\n</html>\n"
  },
  {
    "path": "src/contribute/main.js",
    "content": "import {createApp} from 'vue';\n\nimport {configApp, loadFonts} from 'utils/app';\nimport {configVuetify} from 'utils/vuetify';\nimport App from './App';\n\nasync function init() {\n  await loadFonts(['400 14px Roboto', '500 14px Roboto', '700 14px Roboto']);\n\n  const app = createApp(App);\n\n  await configApp(app);\n  await configVuetify(app);\n\n  app.mount('body');\n}\n\ninit();\n"
  },
  {
    "path": "src/offscreen/index.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"referrer\" content=\"no-referrer\" />\n  </head>\n  <body>\n    <script src=\"script.js\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "src/offscreen/main.js",
    "content": "import {\n  arrayBufferToBase64,\n  base64ToArrayBuffer,\n  prepareAudio\n} from 'utils/common';\n\nasync function processAudio(audioString, audioOptions) {\n  const audioBuffer = base64ToArrayBuffer(audioString);\n  const audioContent = await prepareAudio(audioBuffer, audioOptions);\n\n  messagePort.postMessage({\n    audioString: arrayBufferToBase64(audioContent)\n  });\n}\n\nfunction onMessage(request) {\n  if (request.id === 'processAudio') {\n    processAudio(request.audioString, request.audioOptions);\n  }\n}\n\nlet messagePort;\nfunction onConnect(port) {\n  if (port.name === 'offscreen') {\n    messagePort = port;\n    messagePort.onMessage.addListener(onMessage);\n  }\n}\n\nbrowser.runtime.onConnect.addListener(onConnect);\n"
  },
  {
    "path": "src/options/App.vue",
    "content": "<template>\n  <vn-app v-if=\"dataLoaded\">\n    <div class=\"section\">\n      <div class=\"section-title\" v-once>\n        {{ getText('optionSectionTitle_services') }}\n      </div>\n      <div class=\"option-wrap\">\n        <div class=\"option select\">\n          <vn-select\n            :label=\"getText('optionTitle_speechService')\"\n            :items=\"listItems.speechService\"\n            v-model=\"options.speechService\"\n            transition=\"scale-transition\"\n          >\n          </vn-select>\n        </div>\n\n        <div\n          class=\"option text-field\"\n          v-if=\"options.speechService === 'googleSpeechApi'\"\n        >\n          <vn-text-field\n            :label=\"getText('inputLabel_apiKey')\"\n            v-model.trim=\"options.googleSpeechApiKey\"\n          >\n          </vn-text-field>\n        </div>\n\n        <a\n          class=\"service-guide\"\n          v-if=\"options.speechService === 'googleSpeechApi'\"\n          target=\"_blank\"\n          rel=\"noreferrer\"\n          href=\"https://github.com/dessant/buster/wiki/Configuring-Google-Cloud-Speech-to-Text\"\n        >\n          {{ getText('linkText_apiGuide') }}\n        </a>\n\n        <div\n          class=\"option text-field\"\n          v-if=\"options.speechService === 'ibmSpeechApi'\"\n        >\n          <vn-text-field\n            v-model.trim=\"options.ibmSpeechApiUrl\"\n            :label=\"getText('inputLabel_apiUrl')\"\n          >\n          </vn-text-field>\n        </div>\n        <div\n          class=\"option text-field\"\n          v-if=\"options.speechService === 'ibmSpeechApi'\"\n        >\n          <vn-text-field\n            v-model.trim=\"options.ibmSpeechApiKey\"\n            :label=\"getText('inputLabel_apiKey')\"\n          >\n          </vn-text-field>\n        </div>\n\n        <a\n          class=\"service-guide\"\n          v-if=\"options.speechService === 'ibmSpeechApi'\"\n          target=\"_blank\"\n          rel=\"noreferrer\"\n          href=\"https://github.com/dessant/buster/wiki/Configuring-IBM-Watson-Speech-to-Text\"\n        >\n          {{ getText('linkText_apiGuide') }}\n        </a>\n\n        <div\n          class=\"option select\"\n          v-if=\"options.speechService === 'microsoftSpeechApi'\"\n        >\n          <vn-select\n            :label=\"getText('optionTitle_microsoftSpeechApiLoc')\"\n            :items=\"listItems.microsoftSpeechApiLoc\"\n            v-model=\"options.microsoftSpeechApiLoc\"\n            transition=\"scale-transition\"\n          >\n          </vn-select>\n        </div>\n        <div\n          class=\"option text-field\"\n          v-if=\"options.speechService === 'microsoftSpeechApi'\"\n        >\n          <vn-text-field\n            v-model.trim=\"options.microsoftSpeechApiKey\"\n            :label=\"getText('inputLabel_apiKey')\"\n          >\n          </vn-text-field>\n        </div>\n\n        <a\n          class=\"service-guide\"\n          v-if=\"options.speechService === 'microsoftSpeechApi'\"\n          target=\"_blank\"\n          rel=\"noreferrer\"\n          href=\"https://github.com/dessant/buster/wiki/Configuring-Microsoft-Azure-Speech-to-Text\"\n        >\n          {{ getText('linkText_apiGuide') }}\n        </a>\n\n        <vn-text-field\n          class=\"text-field\"\n          v-if=\"options.speechService === 'witSpeechApi'\"\n          v-for=\"item in witSpeechApis\"\n          :key=\"item.id\"\n          :model-value=\"options.witSpeechApiKeys[item] || ''\"\n          :label=\"\n            getText('inputLabel_apiKeyType', [\n              getText(`optionValue_witSpeechApiLang_${item}`)\n            ])\n          \"\n          @update:modelValue=\"saveWitSpeechApiKey($event.trim(), item)\"\n        >\n        </vn-text-field>\n        <div\n          class=\"wit-add-api\"\n          v-if=\"options.speechService === 'witSpeechApi'\"\n        >\n          <vn-select\n            :label=\"getText('optionTitle_witSpeechApiLang')\"\n            :items=\"listItems.witSpeechApiLang\"\n            v-model=\"witSpeechApiLang\"\n            transition=\"scale-transition\"\n          >\n          </vn-select>\n\n          <vn-button :disabled=\"!witSpeechApiLang\" @click=\"addWitSpeechApi\">\n            {{ getText('buttonLabel_addApi') }}\n          </vn-button>\n        </div>\n\n        <a\n          class=\"service-guide\"\n          v-if=\"options.speechService === 'witSpeechApi'\"\n          target=\"_blank\"\n          rel=\"noreferrer\"\n          href=\"https://github.com/dessant/buster/wiki/Configuring-Wit.ai\"\n        >\n          {{ getText('linkText_apiGuide') }}\n        </a>\n      </div>\n    </div>\n\n    <div class=\"section section-client\">\n      <div class=\"section-title\" v-once>\n        {{ getText('optionSectionTitle_client') }}\n      </div>\n      <div class=\"section-desc\" v-once>\n        {{ getText('optionSectionDescription_client') }}\n      </div>\n      <div class=\"option-wrap\">\n        <div\n          class=\"option\"\n          v-if=\"\n            clientAppInstalled ||\n            (clientAppVerified && options.simulateUserInput)\n          \"\n        >\n          <vn-switch\n            :label=\"getText('optionTitle_simulateUserInput')\"\n            v-model=\"options.simulateUserInput\"\n          ></vn-switch>\n        </div>\n\n        <div\n          class=\"option\"\n          v-if=\"clientAppVerified && options.simulateUserInput\"\n        >\n          <vn-switch\n            :label=\"getText('optionTitle_navigateWithKeyboard')\"\n            v-model=\"options.navigateWithKeyboard\"\n          ></vn-switch>\n        </div>\n\n        <div class=\"option\" v-if=\"clientAppInstalled\">\n          <vn-switch\n            :label=\"getText('optionTitle_autoUpdateClientApp')\"\n            v-model=\"options.autoUpdateClientApp\"\n          ></vn-switch>\n        </div>\n\n        <div\n          class=\"client-download\"\n          v-if=\"clientAppVerified && !clientAppInstalled\"\n        >\n          <div\n            class=\"download-desc\"\n            v-html=\"\n              getText('pageContent_optionClientAppDownloadDesc', [\n                `<a target='_blank' rel='noreferrer' href='${installGuideUrl}'>${getText(\n                  'linkText_installGuide'\n                )}</a>`\n              ])\n            \"\n          ></div>\n          <div class=\"download-error\" v-if=\"!clientAppDownloadUrl\">\n            {{ getText('pageContent_optionClientAppOSError') }}\n          </div>\n\n          <vn-button\n            class=\"download-button\"\n            :disabled=\"!clientAppDownloadUrl\"\n            @click=\"$refs.dlLink.click()\"\n            variant=\"elevated\"\n          >\n            {{ getText('buttonLabel_downloadApp') }}\n          </vn-button>\n          <a\n            ref=\"dlLink\"\n            class=\"download-link\"\n            target=\"_blank\"\n            rel=\"noreferrer\"\n            :href=\"clientAppDownloadUrl\"\n          ></a>\n        </div>\n      </div>\n    </div>\n\n    <div class=\"section\">\n      <div class=\"section-title\" v-once>\n        {{ getText('optionSectionTitle_misc') }}\n      </div>\n      <div class=\"option-wrap\">\n        <div class=\"option select\">\n          <vn-select\n            :label=\"getText('optionTitle_appTheme')\"\n            :items=\"listItems.appTheme\"\n            v-model=\"options.appTheme\"\n            transition=\"scale-transition\"\n          >\n          </vn-select>\n        </div>\n        <div class=\"option\">\n          <vn-switch\n            :label=\"getText('optionTitle_loadEnglishChallenge')\"\n            v-model=\"options.loadEnglishChallenge\"\n          ></vn-switch>\n        </div>\n        <div class=\"option\" v-if=\"!options.loadEnglishChallenge\">\n          <vn-switch\n            :label=\"getText('optionTitle_tryEnglishSpeechModel')\"\n            v-model=\"options.tryEnglishSpeechModel\"\n          ></vn-switch>\n        </div>\n        <div class=\"option\" v-if=\"enableContributions\">\n          <vn-switch\n            :label=\"getText('optionTitle_showContribPage')\"\n            v-model=\"options.showContribPage\"\n          ></vn-switch>\n        </div>\n        <div class=\"option button\" v-if=\"enableContributions\">\n          <vn-button\n            class=\"contribute-button vn-icon--start\"\n            @click=\"showContribute\"\n            ><vn-icon\n              src=\"/src/assets/icons/misc/favorite-filled.svg\"\n            ></vn-icon>\n            {{ getText('buttonLabel_contribute') }}\n          </vn-button>\n        </div>\n      </div>\n    </div>\n  </vn-app>\n</template>\n\n<script>\nimport {toRaw} from 'vue';\nimport {App, Button, Icon, Select, Switch, TextField} from 'vueton';\n\nimport storage from 'storage/storage';\nimport {getListItems, showContributePage, pingClientApp} from 'utils/app';\nimport {getText} from 'utils/common';\nimport {enableContributions, clientAppVersion} from 'utils/config';\nimport {\n  optionKeys,\n  clientAppPlatforms,\n  captchaWitSpeechApiLangCodes,\n  microsoftSpeechApiRegions\n} from 'utils/data';\n\nexport default {\n  components: {\n    [App.name]: App,\n    [Button.name]: Button,\n    [Icon.name]: Icon,\n    [Select.name]: Select,\n    [Switch.name]: Switch,\n    [TextField.name]: TextField\n  },\n\n  data: function () {\n    return {\n      dataLoaded: false,\n\n      listItems: {\n        ...getListItems(\n          {\n            speechService: [\n              'witSpeechApiDemo',\n              'googleSpeechApi',\n              'witSpeechApi',\n              'ibmSpeechApi',\n              'microsoftSpeechApi'\n            ]\n          },\n          {scope: 'optionValue_speechService'}\n        ),\n        ...getListItems(\n          {microsoftSpeechApiLoc: microsoftSpeechApiRegions},\n          {scope: 'optionValue_microsoftSpeechApiLoc'}\n        ),\n        ...getListItems(\n          {\n            witSpeechApiLang: [\n              ...new Set(\n                Object.values(captchaWitSpeechApiLangCodes).filter(Boolean)\n              )\n            ].sort()\n          },\n          {scope: 'optionValue_witSpeechApiLang'}\n        ),\n        ...getListItems(\n          {appTheme: ['auto', 'light', 'dark']},\n          {scope: 'optionValue_appTheme'}\n        )\n      },\n\n      enableContributions,\n\n      witSpeechApiLang: null,\n      witSpeechApis: [],\n\n      clientAppVerified: false,\n      clientAppInstalled: false,\n      clientAppDownloadUrl: '',\n      installGuideUrl: '',\n\n      options: {\n        speechService: '',\n        googleSpeechApiKey: '',\n        ibmSpeechApiUrl: '',\n        ibmSpeechApiKey: '',\n        microsoftSpeechApiLoc: '',\n        microsoftSpeechApiKey: '',\n        witSpeechApiKeys: {},\n        loadEnglishChallenge: false,\n        tryEnglishSpeechModel: false,\n        simulateUserInput: false,\n        autoUpdateClientApp: false,\n        navigateWithKeyboard: false,\n        appTheme: '',\n        showContribPage: false\n      }\n    };\n  },\n\n  methods: {\n    getText,\n\n    setup: async function () {\n      browser.runtime.onMessage.addListener(this.onMessage);\n\n      const options = await storage.get(optionKeys);\n\n      for (const option of Object.keys(this.options)) {\n        this.options[option] = options[option];\n\n        this.$watch(\n          `options.${option}`,\n          async function (value) {\n            await storage.set({[option]: toRaw(value)});\n            await browser.runtime.sendMessage({id: 'optionChange'});\n          },\n          {deep: true}\n        );\n      }\n\n      this.witSpeechApis = Object.keys(options.witSpeechApiKeys);\n      this.setWitSpeechApiLangOptions();\n\n      document.title = getText('pageTitle', [\n        getText('pageTitle_options'),\n        getText('extensionName')\n      ]);\n\n      this.verifyClientApp();\n\n      this.dataLoaded = true;\n    },\n\n    onMessage: function (request, sender) {\n      if (request.id === 'reloadOptionsPage') {\n        self.location.reload();\n      }\n    },\n\n    verifyClientApp: async function () {\n      try {\n        await pingClientApp();\n        this.clientAppInstalled = true;\n      } catch (err) {\n        if (!this.installGuideUrl) {\n          this.installGuideUrl =\n            'https://github.com/dessant/buster/wiki/Installing-the-client-app';\n          const {os, arch} = this.$env;\n          if (clientAppPlatforms.includes(`${os}/${arch}`)) {\n            this.installGuideUrl += `#${os}`;\n            this.clientAppDownloadUrl = `https://github.com/dessant/buster-client/releases/download/v${clientAppVersion}/buster-client-setup-v${clientAppVersion}-${os}-${arch}`;\n            if (os === 'windows') {\n              this.clientAppDownloadUrl += '.exe';\n            }\n          }\n        }\n\n        this.clientAppInstalled = false;\n      }\n\n      this.clientAppVerified = true;\n    },\n\n    setWitSpeechApiLangOptions: function () {\n      this.listItems.witSpeechApiLang = this.listItems.witSpeechApiLang.filter(\n        item => !this.witSpeechApis.includes(item.value)\n      );\n    },\n\n    addWitSpeechApi: function () {\n      this.witSpeechApis.push(this.witSpeechApiLang);\n      this.witSpeechApiLang = null;\n      this.setWitSpeechApiLangOptions();\n    },\n\n    saveWitSpeechApiKey: function (value, lang) {\n      const apiKeys = this.options.witSpeechApiKeys;\n      if (value) {\n        this.options.witSpeechApiKeys = Object.assign({}, apiKeys, {\n          [lang]: value\n        });\n      } else if (apiKeys[lang]) {\n        delete apiKeys[lang];\n        this.options.witSpeechApiKeys = Object.assign({}, apiKeys);\n      }\n    },\n\n    showContribute: async function () {\n      await showContributePage();\n    }\n  },\n\n  created: function () {\n    document.title = getText('pageTitle', [\n      getText('pageTitle_options'),\n      getText('extensionName')\n    ]);\n\n    this.setup();\n  }\n};\n</script>\n\n<style lang=\"scss\">\n@use 'vueton/styles' as vueton;\n\n@include vueton.theme-base;\n@include vueton.transitions;\n\n.v-application__wrap {\n  display: grid;\n  grid-row-gap: 32px;\n  grid-column-gap: 48px;\n  padding: 24px;\n  grid-auto-rows: min-content;\n  grid-auto-columns: min-content;\n}\n\n.section-title {\n  font-size: 20px;\n  font-weight: 500;\n  letter-spacing: 0.25px;\n  line-height: 32px;\n}\n\n.section-desc {\n  font-size: 14px;\n  font-weight: 400;\n  letter-spacing: 0.25px;\n  line-height: 20px;\n\n  padding-top: 8px;\n  max-width: 380px;\n}\n\n.option-wrap {\n  display: grid;\n  grid-row-gap: 24px;\n  padding-top: 24px;\n}\n\n.option {\n  display: flex;\n  align-items: center;\n  height: 20px;\n\n  &.button {\n    height: 40px;\n  }\n\n  &.select,\n  &.text-field {\n    height: 56px;\n  }\n\n  & .contribute-button {\n    @include vueton.theme-prop(color, primary);\n\n    & .vn-icon {\n      @include vueton.theme-prop(background-color, cta);\n    }\n  }\n}\n\n.text-field .v-input__control {\n  width: 326px;\n}\n\n.section-client .section-desc {\n  width: 272px;\n}\n\n.wit-add-api {\n  display: flex;\n  align-items: center;\n\n  & .vn-select {\n    & .v-input__control,\n    & .v-input__details {\n      max-width: calc(100vw - 48px - 124px) !important;\n    }\n  }\n\n  & .vn-button {\n    margin-left: 24px;\n    @include vueton.theme-prop(color, primary);\n  }\n}\n\n.service-guide {\n  font-size: 16px;\n  font-weight: 400;\n  letter-spacing: 0.5px;\n  line-height: 24px;\n}\n\n.client-download {\n  width: 272px;\n}\n\n.download-desc,\n.download-error {\n  font-size: 14px;\n  font-weight: 400;\n  letter-spacing: 0.25px;\n  line-height: 20px;\n}\n\n.download-desc a {\n  font-size: 14px;\n  font-weight: 400;\n  letter-spacing: 0.25px;\n  line-height: 20px;\n}\n\n.download-desc {\n  max-width: 240px;\n}\n\n.download-error {\n  margin-top: 12px;\n  @include vueton.theme-prop(color, error);\n}\n\n.download-link {\n  visibility: hidden;\n}\n\n.download-button {\n  margin-top: 24px;\n  @include vueton.theme-prop(background-color, primary);\n\n  & .v-btn__content {\n    @include vueton.theme-prop(color, on-primary);\n  }\n}\n</style>\n"
  },
  {
    "path": "src/options/index.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"color-scheme\" content=\"light dark\" />\n    <meta name=\"referrer\" content=\"no-referrer\" />\n    <link\n      rel=\"icon\"\n      href=\"/src/assets/icons/app/icon-64.png\"\n      type=\"image/png\"\n    />\n\n    <link href=\"/src/assets/fonts/roboto.css\" rel=\"stylesheet\" />\n    <link href=\"/src/commons-ui/style.css\" rel=\"stylesheet\" />\n    <link href=\"style.css\" rel=\"stylesheet\" />\n\n    <script src=\"/src/commons-ui/script.js\"></script>\n    <script src=\"script.js\" defer></script>\n  </head>\n  <body></body>\n</html>\n"
  },
  {
    "path": "src/options/main.js",
    "content": "import {createApp} from 'vue';\n\nimport {configApp, loadFonts} from 'utils/app';\nimport {configVuetify} from 'utils/vuetify';\nimport App from './App';\n\nasync function init() {\n  await loadFonts(['400 14px Roboto', '500 14px Roboto']);\n\n  const app = createApp(App);\n\n  await configApp(app);\n  await configVuetify(app);\n\n  app.mount('body');\n}\n\ninit();\n"
  },
  {
    "path": "src/scripts/init-setup.js",
    "content": "function setup() {\n  const url = new URL(browser.runtime.getURL('/src/setup/index.html'));\n  url.searchParams.set(\n    'session',\n    new URL(window.location.href).searchParams.get('session')\n  );\n  url.searchParams.set('port', window.location.port);\n\n  const frame = document.createElement('iframe');\n  frame.src = url.href;\n  document.body.appendChild(frame);\n}\n\nsetup();\n"
  },
  {
    "path": "src/scripts/reset.js",
    "content": "(function () {\n  const reset = function (challengeUrl) {\n    for (const [id, client] of Object.entries(___grecaptcha_cfg.clients)) {\n      for (const [_, items] of Object.entries(client)) {\n        if (items instanceof Object) {\n          for (const [_, v] of Object.entries(items)) {\n            if (v instanceof Element && v.src === challengeUrl) {\n              (grecaptcha.reset || grecaptcha.enterprise.reset)(id);\n              return;\n            }\n          }\n        }\n      }\n    }\n  };\n\n  const onMessage = function (ev) {\n    ev.stopImmediatePropagation();\n    removeCallbacks();\n\n    reset(ev.detail);\n  };\n\n  const removeCallbacks = function () {\n    window.clearTimeout(timeoutId);\n    document.removeEventListener('___resetCaptcha', onMessage, {\n      capture: true,\n      once: true\n    });\n  };\n  const timeoutId = window.setTimeout(removeCallbacks, 10000); // 10 seconds\n\n  document.addEventListener('___resetCaptcha', onMessage, {\n    capture: true,\n    once: true\n  });\n})();\n"
  },
  {
    "path": "src/setup/App.vue",
    "content": "<template>\n  <vn-app v-if=\"dataLoaded\">\n    <div class=\"wrap\" v-if=\"!isInstallSuccess && !isInstallError\">\n      <div class=\"title\">\n        {{ getText('pageContent_installTitle') }}\n      </div>\n      <div class=\"desc\">\n        {{ getText('pageContent_installDesc') }}\n      </div>\n\n      <vn-text-field\n        :label=\"getText('inputLabel_appLocation')\"\n        v-model.trim=\"appDir\"\n      >\n      </vn-text-field>\n\n      <vn-text-field\n        class=\"manifest-location\"\n        v-if=\"manifestDirEditable\"\n        :label=\"getText('inputLabel_manifestLocation')\"\n        v-model.trim=\"manifestDir\"\n      >\n      </vn-text-field>\n\n      <div class=\"manifest-desc\" v-if=\"manifestDirEditable\">\n        {{ getText('pageContent_manifestLocationDesc') }}\n      </div>\n\n      <vn-button\n        class=\"button install-button\"\n        :disabled=\"\n          isInstalling || !appDir || (manifestDirEditable && !manifestDir)\n        \"\n        @click=\"runInstall\"\n        variant=\"elevated\"\n      >\n        {{ getText('buttonLabel_installApp') }}\n      </vn-button>\n    </div>\n\n    <div class=\"wrap\" v-if=\"isInstallSuccess\">\n      <div class=\"title\">{{ getText('pageContent_installSuccessTitle') }}</div>\n      <div class=\"desc\">{{ getText('pageContent_installSuccessDesc') }}</div>\n\n      <div class=\"success-icon\">🎉</div>\n    </div>\n\n    <div class=\"wrap\" v-if=\"isInstallError\">\n      <div class=\"title error-title\">\n        {{ getText('pageContent_installErrorTitle') }}\n      </div>\n      <div class=\"desc\">{{ getText('pageContent_installErrorDesc') }}</div>\n\n      <vn-button\n        class=\"button error-button\"\n        @click=\"isInstallError = false\"\n        variant=\"elevated\"\n      >\n        {{ getText('buttonLabel_goBack') }}\n      </vn-button>\n    </div>\n  </vn-app>\n</template>\n\n<script>\nimport {App, Button, TextField} from 'vueton';\n\nimport {pingClientApp} from 'utils/app';\nimport {getText} from 'utils/common';\n\nexport default {\n  components: {\n    [App.name]: App,\n    [Button.name]: Button,\n    [TextField.name]: TextField\n  },\n\n  data: function () {\n    const urlParams = new URL(window.location.href).searchParams;\n    const apiURL = new URL('http://127.0.0.1/api/v1');\n    apiURL.port = urlParams.get('port');\n\n    return {\n      dataLoaded: false,\n\n      apiUrl: apiURL.href,\n      session: urlParams.get('session'),\n      browser: '',\n      appDir: '',\n      manifestDir: '',\n      manifestDirEditable: false,\n\n      isInstalling: false,\n      isInstallSuccess: false,\n      isInstallError: false\n    };\n  },\n\n  methods: {\n    getText,\n\n    getExtensionId: function () {\n      let id = browser.runtime.id;\n      if (!this.$env.isFirefox) {\n        const scheme = window.location.protocol;\n        id = `${scheme}//${id}/`;\n      }\n\n      return id;\n    },\n\n    setLocation: async function () {\n      try {\n        await this.location();\n      } catch (err) {\n        this.isInstallError = true;\n        console.log(err.toString());\n      }\n    },\n\n    runInstall: async function () {\n      this.isInstalling = true;\n\n      try {\n        await this.install();\n      } catch (err) {\n        this.isInstallError = true;\n        console.log(err.toString());\n      } finally {\n        this.isInstalling = false;\n      }\n\n      if (this.isInstallSuccess) {\n        const data = new FormData();\n        data.append('session', this.session);\n\n        await fetch(`${this.apiUrl}/setup/close`, {\n          method: 'POST',\n          body: data\n        });\n\n        await browser.runtime.sendMessage({id: 'clientAppInstall'});\n      }\n    },\n\n    location: async function () {\n      const data = new FormData();\n      data.append('session', this.session);\n      data.append('browser', this.browser);\n      data.append('targetEnv', this.$env.targetEnv);\n\n      const rsp = await fetch(`${this.apiUrl}/setup/location`, {\n        method: 'POST',\n        body: data\n      });\n\n      const results = await rsp.json();\n\n      if (rsp.status === 200) {\n        this.appDir = results.appDir;\n        this.manifestDir = results.manifestDir;\n      } else {\n        throw new Error(results.error);\n      }\n    },\n\n    install: async function () {\n      const data = new FormData();\n      data.append('session', this.session);\n      data.append('appDir', this.appDir);\n      data.append('manifestDir', this.manifestDir);\n      data.append('browser', this.browser);\n      data.append('targetEnv', this.$env.targetEnv);\n      data.append('extension', this.getExtensionId());\n\n      const rsp = await fetch(`${this.apiUrl}/setup/install`, {\n        method: 'POST',\n        body: data\n      });\n\n      if (rsp.status === 200) {\n        await pingClientApp();\n\n        this.isInstallSuccess = true;\n      } else {\n        throw new Error((await rsp.json()).error);\n      }\n    }\n  },\n\n  created: async function () {\n    this.browser = (await browser.runtime.sendMessage({id: 'getBrowser'})).name;\n\n    await this.setLocation();\n\n    if (!this.$env.isWindows) {\n      this.manifestDirEditable = true;\n    }\n\n    this.dataLoaded = true;\n  }\n};\n</script>\n\n<style lang=\"scss\">\n@use 'vueton/styles' as vueton;\n\n@include vueton.theme-base;\n\n.v-application__wrap {\n  display: flex;\n  align-items: center;\n  padding: 24px;\n}\n\n.wrap {\n  display: flex;\n  flex-direction: column;\n  max-width: 400px;\n}\n\n.title {\n  font-size: 20px;\n  font-weight: 500;\n  letter-spacing: 0.25px;\n  line-height: 32px;\n\n  margin-top: 48px;\n  align-self: center;\n}\n\n.error-title {\n  @include vueton.theme-prop(color, error);\n}\n\n.desc {\n  font-size: 14px;\n  font-weight: 400;\n  letter-spacing: 0.25px;\n  line-height: 20px;\n\n  margin-top: 32px;\n  margin-bottom: 24px;\n}\n\n.manifest-location {\n  margin-top: 24px;\n}\n\n.manifest-desc {\n  font-size: 12px;\n  font-weight: 400;\n  letter-spacing: 0.4px;\n  line-height: 20px;\n\n  margin-top: 12px;\n}\n\n.button {\n  @include vueton.theme-prop(background-color, primary);\n\n  & .v-btn__content {\n    @include vueton.theme-prop(color, on-primary);\n  }\n}\n\n.install-button {\n  margin-top: 32px;\n  align-self: center;\n}\n\n.error-button {\n  margin-top: 8px;\n  align-self: center;\n}\n\n.success-icon {\n  font-size: 72px;\n  margin-top: 48px;\n  align-self: center;\n}\n</style>\n"
  },
  {
    "path": "src/setup/index.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"referrer\" content=\"no-referrer\" />\n    <link\n      rel=\"icon\"\n      href=\"/src/assets/icons/app/icon-64.png\"\n      type=\"image/png\"\n    />\n\n    <link href=\"/src/assets/fonts/roboto.css\" rel=\"stylesheet\" />\n    <link href=\"/src/commons-ui/style.css\" rel=\"stylesheet\" />\n    <link href=\"style.css\" rel=\"stylesheet\" />\n\n    <script src=\"/src/commons-ui/script.js\"></script>\n    <script src=\"script.js\" defer></script>\n  </head>\n  <body></body>\n</html>\n"
  },
  {
    "path": "src/setup/main.js",
    "content": "import {createApp} from 'vue';\n\nimport {configApp, loadFonts} from 'utils/app';\nimport {configVuetify} from 'utils/vuetify';\nimport App from './App';\n\nasync function init() {\n  await loadFonts(['400 14px Roboto', '500 14px Roboto']);\n\n  const app = createApp(App);\n\n  await configApp(app);\n  await configVuetify(app);\n\n  app.mount('body');\n}\n\n// only run in a frame\nif (window.top !== window) {\n  init();\n}\n"
  },
  {
    "path": "src/storage/config.json",
    "content": "{\n  \"revisions\": {\n    \"local\": [\n      \"UoT3kGyBH\",\n      \"ONiJBs00o\",\n      \"UidMDYaYA\",\n      \"nOedd0Txqd\",\n      \"ZtLMLoh1ag\",\n      \"t335iRDhZ8\",\n      \"X3djS8vZC\",\n      \"DlgF14Chrh\",\n      \"Lj3MYlSr4L\",\n      \"20221211221603_add_theme_support\",\n      \"20221214080901_update_services\",\n      \"20240514170322_add_appversion\"\n    ],\n    \"session\": [\"20240514122825_initial_version\"]\n  }\n}\n"
  },
  {
    "path": "src/storage/init.js",
    "content": "import {migrate} from 'wesa';\n\nimport {isStorageArea} from './storage';\n\nasync function initStorage({area = 'local', data = null, silent = false} = {}) {\n  const context = {\n    getAvailableRevisions: async ({area} = {}) =>\n      (\n        await import(/* webpackMode: \"eager\" */ 'storage/config.json', {\n          with: {type: 'json'}\n        })\n      ).revisions[area],\n    getCurrentRevision: async ({area} = {}) =>\n      (await browser.storage[area].get('storageVersion')).storageVersion,\n    getRevision: async ({area, revision} = {}) =>\n      import(\n        /* webpackMode: \"eager\" */ `storage/revisions/${area}/${revision}.js`\n      )\n  };\n\n  if (area === 'local') {\n    await migrateLegacyStorage();\n  }\n\n  return migrate(context, {area, data, silent});\n}\n\nasync function migrateLegacyStorage() {\n  if (await isStorageArea({area: 'sync'})) {\n    const {storageVersion: syncVersion} =\n      await browser.storage.sync.get('storageVersion');\n    if (syncVersion && syncVersion.length < 14) {\n      const {storageVersion: localVersion} =\n        await browser.storage.local.get('storageVersion');\n\n      if (!localVersion || localVersion.length < 14) {\n        const syncData = await browser.storage.sync.get(null);\n        await browser.storage.local.clear();\n        await browser.storage.local.set(syncData);\n        await browser.storage.sync.clear();\n      }\n    }\n  }\n}\n\nexport {initStorage};\n"
  },
  {
    "path": "src/storage/revisions/local/20221211221603_add_theme_support.js",
    "content": "import {getDayPrecisionEpoch} from 'utils/common';\n\nconst message = 'Add theme support';\n\nconst revision = '20221211221603_add_theme_support';\n\nasync function upgrade() {\n  const changes = {\n    appTheme: 'auto', // auto, light, dark\n    showContribPage: true,\n    contribPageLastOpen: 0,\n    contribPageLastAutoOpen: 0\n  };\n\n  const {installTime} = await browser.storage.local.get('installTime');\n  changes.installTime = getDayPrecisionEpoch(installTime);\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/20221214080901_update_services.js",
    "content": "const message = 'Update services';\n\nconst revision = '20221214080901_update_services';\n\nasync function upgrade() {\n  const changes = {};\n\n  const {witSpeechApiKeys} = await browser.storage.local.get(\n    'witSpeechApiKeys'\n  );\n  delete witSpeechApiKeys['catalan'];\n  delete witSpeechApiKeys['telugu'];\n  changes.witSpeechApiKeys = witSpeechApiKeys;\n\n  await browser.storage.local.remove('ibmSpeechApiLoc');\n  changes.ibmSpeechApiUrl = '';\n\n  changes.microsoftSpeechApiLoc = 'eastus';\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/20240514170322_add_appversion.js",
    "content": "const message = 'Add appVersion';\n\nconst revision = '20240514170322_add_appversion';\n\nasync function upgrade() {\n  const changes = {\n    appVersion: ''\n  };\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/DlgF14Chrh.js",
    "content": "const message = 'Revision description';\n\nconst revision = 'DlgF14Chrh';\n\nasync function upgrade() {\n  const changes = {};\n  const {speechService} = await browser.storage.local.get('speechService');\n  if (speechService === 'googleSpeechApiDemo') {\n    changes.speechService = 'witSpeechApiDemo';\n  }\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/Lj3MYlSr4L.js",
    "content": "const message = 'Add navigateWithKeyboard';\n\nconst revision = 'Lj3MYlSr4L';\n\nasync function upgrade() {\n  const changes = {\n    navigateWithKeyboard: false\n  };\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/ONiJBs00o.js",
    "content": "const message = 'Add IBM Watson Speech to Text API';\n\nconst revision = 'ONiJBs00o';\n\nasync function upgrade() {\n  const changes = {\n    ibmSpeechApiLoc: 'frankfurt', // 'frankfurt', 'dallas', 'washington', 'sydney', 'tokyo'\n    ibmSpeechApiKey: ''\n  };\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/UidMDYaYA.js",
    "content": "const message = 'Add Microsoft Azure Speech to Text API';\n\nconst revision = 'UidMDYaYA';\n\nasync function upgrade() {\n  const changes = {\n    microsoftSpeechApiLoc: 'eastUs', // 'eastUs', 'eastUs2', 'westUs', 'westUs2', 'eastAsia', 'southeastAsia', 'westEu', 'northEu'\n    microsoftSpeechApiKey: ''\n  };\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/UoT3kGyBH.js",
    "content": "const message = 'Initial version';\n\nconst revision = 'UoT3kGyBH';\n\nasync function upgrade() {\n  const changes = {\n    speechService: 'googleSpeechApiDemo', // 'googleSpeechApiDemo', 'witSpeechApiDemo', 'googleSpeechApi', 'witSpeechApi', 'ibmSpeechApi', 'microsoftSpeechApi'\n    googleSpeechApiKey: '',\n    installTime: new Date().getTime(),\n    useCount: 0\n  };\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/X3djS8vZC.js",
    "content": "const message = 'Add autoUpdateClientApp option';\n\nconst revision = 'X3djS8vZC';\n\nasync function upgrade() {\n  const changes = {\n    autoUpdateClientApp: true\n  };\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/ZtLMLoh1ag.js",
    "content": "const message = 'Add loadEnglishChallenge option';\n\nconst revision = 'ZtLMLoh1ag';\n\nasync function upgrade() {\n  const changes = {\n    loadEnglishChallenge: true\n  };\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/nOedd0Txqd.js",
    "content": "const message = 'Add Wit Speech API and tryEnglishSpeechModel option';\n\nconst revision = 'nOedd0Txqd';\n\nasync function upgrade() {\n  const changes = {\n    witSpeechApiKeys: {},\n    tryEnglishSpeechModel: true\n  };\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/local/t335iRDhZ8.js",
    "content": "const message = 'Add simulateUserInput option';\n\nconst revision = 't335iRDhZ8';\n\nasync function upgrade() {\n  const changes = {\n    simulateUserInput: false\n  };\n\n  changes.storageVersion = revision;\n  return browser.storage.local.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/revisions/session/20240514122825_initial_version.js",
    "content": "const message = 'Initial version';\n\nconst revision = '20240514122825_initial_version';\n\nasync function upgrade() {\n  const changes = {\n    platformInfo: null\n  };\n\n  changes.storageVersion = revision;\n  return browser.storage.session.set(changes);\n}\n\nexport {message, revision, upgrade};\n"
  },
  {
    "path": "src/storage/storage.js",
    "content": "import {storageRevisions} from 'utils/config';\n\nasync function isStorageArea({area = 'local'} = {}) {\n  try {\n    await browser.storage[area].get('');\n    return true;\n  } catch (err) {\n    return false;\n  }\n}\n\nconst storageReady = {local: false, session: false, sync: false};\nasync function isStorageReady({area = 'local'} = {}) {\n  if (storageReady[area]) {\n    return true;\n  } else {\n    const {storageVersion} = await browser.storage[area].get('storageVersion');\n    if (storageVersion && storageVersion === storageRevisions[area]) {\n      storageReady[area] = true;\n      return true;\n    }\n  }\n\n  return false;\n}\n\nasync function ensureStorageReady({area = 'local'} = {}) {\n  if (!storageReady[area]) {\n    return new Promise((resolve, reject) => {\n      let stop;\n\n      const checkStorage = async function () {\n        if (await isStorageReady({area})) {\n          self.clearTimeout(timeoutId);\n          resolve();\n        } else if (stop) {\n          reject(new Error(`Storage (${area}) is not ready`));\n        } else {\n          self.setTimeout(checkStorage, 30);\n        }\n      };\n\n      const timeoutId = self.setTimeout(function () {\n        stop = true;\n      }, 60000); // 1 minute\n\n      checkStorage();\n    });\n  }\n}\n\nasync function get(keys = null, {area = 'local'} = {}) {\n  await ensureStorageReady({area});\n  return browser.storage[area].get(keys);\n}\n\nasync function set(obj, {area = 'local'} = {}) {\n  await ensureStorageReady({area});\n  return browser.storage[area].set(obj);\n}\n\nasync function remove(keys, {area = 'local'} = {}) {\n  await ensureStorageReady({area});\n  return browser.storage[area].remove(keys);\n}\n\nasync function clear({area = 'local'} = {}) {\n  await ensureStorageReady({area});\n  return browser.storage[area].clear();\n}\n\nexport default {get, set, remove, clear};\nexport {isStorageArea, isStorageReady, ensureStorageReady};\n"
  },
  {
    "path": "src/utils/app.js",
    "content": "import {v4 as uuidv4} from 'uuid';\n\nimport storage from 'storage/storage';\nimport {\n  getText,\n  insertCSS,\n  executeScript,\n  createTab,\n  getActiveTab,\n  isValidTab,\n  getPlatform,\n  getDayPrecisionEpoch,\n  getDarkColorSchemeQuery,\n  getRandomInt,\n  sleep\n} from 'utils/common';\nimport {recaptchaChallengeUrlRx} from 'utils/data';\nimport {\n  targetEnv,\n  enableContributions,\n  storageRevisions,\n  appVersion,\n  mv3\n} from 'utils/config';\n\nasync function showNotification({\n  message,\n  messageId,\n  title,\n  type = 'info',\n  timeout = 0\n} = {}) {\n  if (!title) {\n    title = getText('extensionName');\n  }\n  if (messageId) {\n    message = getText(messageId);\n  }\n\n  if (targetEnv === 'safari') {\n    return browser.runtime.sendNativeMessage('application.id', {\n      id: 'notification',\n      message\n    });\n  } else {\n    const notification = await browser.notifications.create(\n      `bc-notification-${type}`,\n      {\n        type: 'basic',\n        title,\n        message,\n        iconUrl: '/src/assets/icons/app/icon-64.png'\n      }\n    );\n\n    if (timeout) {\n      self.setTimeout(() => {\n        browser.notifications.clear(notification);\n      }, timeout);\n    }\n\n    return notification;\n  }\n}\n\nfunction getListItems(data, {scope = '', shortScope = ''} = {}) {\n  const results = {};\n\n  for (const [group, items] of Object.entries(data)) {\n    results[group] = [];\n\n    items.forEach(function (item) {\n      if (item.value === undefined) {\n        item = {value: item};\n      }\n\n      item.title = getText(`${scope ? scope + '_' : ''}${item.value}`);\n\n      if (shortScope) {\n        item.shortTitle = getText(`${shortScope}_${item.value}`);\n      }\n\n      results[group].push(item);\n    });\n  }\n\n  return results;\n}\n\nasync function insertBaseModule({activeTab = false} = {}) {\n  const tabs = [];\n  if (activeTab) {\n    const tab = await getActiveTab();\n    if (tab) {\n      tabs.push(tab);\n    }\n  } else {\n    tabs.push(\n      ...(await browser.tabs.query({\n        url: ['http://*/*', 'https://*/*'],\n        windowType: 'normal'\n      }))\n    );\n  }\n\n  for (const tab of tabs) {\n    const tabId = tab.id;\n\n    const frames = await browser.webNavigation.getAllFrames({tabId});\n    for (const frame of frames) {\n      const frameId = frame.frameId;\n\n      if (frameId && recaptchaChallengeUrlRx.test(frame.url)) {\n        insertCSS({\n          files: ['/src/base/style.css'],\n          tabId,\n          frameIds: [frameId]\n        });\n\n        executeScript({\n          files: ['/src/base/script.js'],\n          tabId,\n          frameIds: [frameId],\n          injectImmediately: false\n        });\n      }\n    }\n  }\n}\n\nasync function loadFonts(fonts) {\n  await Promise.allSettled(fonts.map(font => document.fonts.load(font)));\n}\n\nfunction processMessageResponse(response, sendResponse) {\n  if (targetEnv === 'safari') {\n    response.then(function (result) {\n      // Safari 15: undefined response will cause sendMessage to never resolve.\n      if (result === undefined) {\n        result = null;\n      }\n      sendResponse(result);\n    });\n\n    return true;\n  } else {\n    return response;\n  }\n}\n\nasync function configApp(app) {\n  const platform = await getPlatform();\n\n  const classes = [platform.targetEnv, platform.os];\n  document.documentElement.classList.add(...classes);\n\n  if (app) {\n    app.config.globalProperties.$env = platform;\n  }\n}\n\nasync function getAppTheme(theme) {\n  if (!theme) {\n    ({appTheme: theme} = await storage.get('appTheme'));\n  }\n\n  if (theme === 'auto') {\n    theme = getDarkColorSchemeQuery().matches ? 'dark' : 'light';\n  }\n\n  return theme;\n}\n\nfunction addSystemThemeListener(callback) {\n  getDarkColorSchemeQuery().addEventListener('change', function () {\n    callback();\n  });\n}\n\nfunction addAppThemeListener(callback) {\n  browser.storage.onChanged.addListener(function (changes, area) {\n    if (area === 'local' && changes.appTheme) {\n      callback();\n    }\n  });\n}\n\nfunction addThemeListener(callback) {\n  addSystemThemeListener(callback);\n  addAppThemeListener(callback);\n}\n\nasync function getOpenerTabId({tab, tabId = null} = {}) {\n  if (!tab && tabId !== null) {\n    tab = await browser.tabs.get(tabId).catch(err => null);\n  }\n\n  if ((await isValidTab({tab})) && !(await getPlatform()).isMobile) {\n    return tab.id;\n  }\n\n  return null;\n}\n\nasync function showPage({\n  url = '',\n  setOpenerTab = true,\n  getTab = false,\n  activeTab = null\n} = {}) {\n  if (!activeTab) {\n    activeTab = await getActiveTab();\n  }\n\n  const props = {url, index: activeTab.index + 1, active: true, getTab};\n\n  if (setOpenerTab) {\n    props.openerTabId = await getOpenerTabId({tab: activeTab});\n  }\n\n  return createTab(props);\n}\n\nasync function autoShowContributePage({\n  minUseCount = 0, // 0-1000\n  minInstallDays = 0,\n  minLastOpenDays = 0,\n  minLastAutoOpenDays = 0,\n  action = 'auto',\n  activeTab = null\n} = {}) {\n  if (enableContributions) {\n    const options = await storage.get([\n      'showContribPage',\n      'useCount',\n      'installTime',\n      'contribPageLastOpen',\n      'contribPageLastAutoOpen'\n    ]);\n\n    const epoch = getDayPrecisionEpoch();\n\n    if (\n      options.showContribPage &&\n      options.useCount >= minUseCount &&\n      epoch - options.installTime >= minInstallDays * 86400000 &&\n      epoch - options.contribPageLastOpen >= minLastOpenDays * 86400000 &&\n      epoch - options.contribPageLastAutoOpen >= minLastAutoOpenDays * 86400000\n    ) {\n      await storage.set({\n        contribPageLastOpen: epoch,\n        contribPageLastAutoOpen: epoch\n      });\n\n      return showContributePage({\n        action,\n        updateStats: false,\n        activeTab,\n        getTab: true\n      });\n    }\n  }\n}\n\nlet useCountLastUpdate = 0;\nasync function updateUseCount({\n  valueChange = 1,\n  maxUseCount = Infinity,\n  minInterval = 0\n} = {}) {\n  if (Date.now() - useCountLastUpdate >= minInterval) {\n    useCountLastUpdate = Date.now();\n\n    const {useCount} = await storage.get('useCount');\n\n    if (useCount < maxUseCount) {\n      await storage.set({useCount: useCount + valueChange});\n    } else if (useCount > maxUseCount) {\n      await storage.set({useCount: maxUseCount});\n    }\n  }\n}\n\nasync function processAppUse({\n  action = 'auto',\n  activeTab = null,\n  showContribPage = true\n} = {}) {\n  await updateUseCount({\n    valueChange: 1,\n    maxUseCount: 1000\n  });\n\n  if (showContribPage) {\n    return autoShowContributePage({\n      minUseCount: 10,\n      minInstallDays: 14,\n      minLastOpenDays: 14,\n      minLastAutoOpenDays: 365,\n      activeTab,\n      action\n    });\n  }\n}\n\nasync function showContributePage({\n  action = '',\n  updateStats = true,\n  getTab = false,\n  activeTab = null\n} = {}) {\n  if (updateStats) {\n    await storage.set({contribPageLastOpen: getDayPrecisionEpoch()});\n  }\n\n  let url = browser.runtime.getURL('/src/contribute/index.html');\n  if (action) {\n    url = `${url}?action=${action}`;\n  }\n\n  return showPage({url, getTab, activeTab});\n}\n\nasync function showOptionsPage({getTab = false, activeTab = null} = {}) {\n  // Samsung Internet 13: runtime.openOptionsPage fails.\n  // runtime.openOptionsPage adds new tab at the end of the tab list.\n  return showPage({\n    url: browser.runtime.getURL('/src/options/index.html'),\n    getTab,\n    activeTab\n  });\n}\n\nasync function setAppVersion() {\n  await storage.set({appVersion});\n}\n\nasync function isSessionStartup() {\n  const privateContext = browser.extension.inIncognitoContext;\n\n  const sessionKey = privateContext ? 'privateSession' : 'session';\n  const session = (await browser.storage.session.get(sessionKey))[sessionKey];\n\n  if (!session) {\n    await browser.storage.session.set({[sessionKey]: true});\n  }\n\n  if (privateContext) {\n    try {\n      if (!(await self.caches.has(sessionKey))) {\n        await self.caches.open(sessionKey);\n\n        return true;\n      }\n    } catch (err) {\n      return true;\n    }\n  }\n\n  if (!session) {\n    return true;\n  }\n}\n\nasync function isStartup() {\n  const startup = {\n    install: false,\n    update: false,\n    session: false,\n    setupInstance: false,\n    setupSession: false\n  };\n\n  const {storageVersion, appVersion: savedAppVersion} =\n    await browser.storage.local.get(['storageVersion', 'appVersion']);\n\n  if (!storageVersion) {\n    startup.install = true;\n  }\n\n  if (\n    storageVersion !== storageRevisions.local ||\n    savedAppVersion !== appVersion\n  ) {\n    startup.update = true;\n  }\n\n  if (mv3 && (await isSessionStartup())) {\n    startup.session = true;\n  }\n\n  if (startup.install || startup.update) {\n    startup.setupInstance = true;\n  }\n\n  if (startup.session || !mv3) {\n    startup.setupSession = true;\n  }\n\n  return startup;\n}\n\nlet startupState;\nasync function getStartupState({event = ''} = {}) {\n  if (!startupState) {\n    startupState = isStartup();\n    startupState.events = [];\n  }\n\n  if (event) {\n    startupState.events.push(event);\n  }\n\n  const startup = await startupState;\n\n  if (startupState.events.includes('install')) {\n    startup.setupInstance = true;\n  }\n  if (startupState.events.includes('startup')) {\n    startup.setupSession = true;\n  }\n\n  return startup;\n}\n\nfunction sendNativeMessage(port, message, {timeout = 10000} = {}) {\n  return new Promise((resolve, reject) => {\n    const id = uuidv4();\n    message.id = id;\n\n    const messageCallback = function (msg) {\n      if (msg.id !== id) {\n        return;\n      }\n      removeListeners();\n      resolve(msg);\n    };\n    const errorCallback = function () {\n      removeListeners();\n      reject('No response from native app');\n    };\n    const removeListeners = function () {\n      self.clearTimeout(timeoutId);\n      port.onMessage.removeListener(messageCallback);\n      port.onDisconnect.removeListener(errorCallback);\n    };\n\n    const timeoutId = self.setTimeout(function () {\n      errorCallback();\n    }, timeout);\n\n    port.onMessage.addListener(messageCallback);\n    port.onDisconnect.addListener(errorCallback);\n\n    port.postMessage(message);\n  });\n}\n\nasync function pingClientApp({\n  start = true,\n  stop = true,\n  checkResponse = true\n} = {}) {\n  if (start) {\n    await browser.runtime.sendMessage({id: 'startClientApp'});\n  }\n\n  const rsp = await browser.runtime.sendMessage({\n    id: 'messageClientApp',\n    message: {command: 'ping'}\n  });\n\n  if (stop) {\n    await browser.runtime.sendMessage({id: 'stopClientApp'});\n  }\n\n  if (checkResponse && (!rsp.success || rsp.data !== 'pong')) {\n    throw new Error(`Client app response: ${rsp.data}`);\n  }\n\n  return rsp;\n}\n\nfunction meanSleep(ms) {\n  const maxDeviation = 0.1 * ms;\n  return sleep(getRandomInt(ms - maxDeviation, ms + maxDeviation));\n}\n\nexport {\n  showNotification,\n  getListItems,\n  insertBaseModule,\n  loadFonts,\n  processMessageResponse,\n  configApp,\n  getAppTheme,\n  addSystemThemeListener,\n  addAppThemeListener,\n  addThemeListener,\n  getOpenerTabId,\n  showPage,\n  autoShowContributePage,\n  updateUseCount,\n  processAppUse,\n  showContributePage,\n  showOptionsPage,\n  setAppVersion,\n  isSessionStartup,\n  isStartup,\n  getStartupState,\n  sendNativeMessage,\n  pingClientApp,\n  meanSleep\n};\n"
  },
  {
    "path": "src/utils/common.js",
    "content": "import Bowser from 'bowser';\nimport audioBufferToWav from 'audiobuffer-to-wav';\n\nimport storage from 'storage/storage';\nimport {targetEnv, mv3} from 'utils/config';\n\nfunction getText(messageName, substitutions) {\n  return browser.i18n.getMessage(messageName, substitutions);\n}\n\nfunction insertCSS({\n  files = null,\n  css = null,\n  tabId = null,\n  frameIds = [0],\n  allFrames = false,\n  origin = 'USER'\n}) {\n  if (mv3) {\n    const params = {target: {tabId, allFrames}};\n\n    if (!allFrames) {\n      params.target.frameIds = frameIds;\n    }\n\n    if (files) {\n      params.files = files;\n    } else {\n      params.css = css;\n    }\n\n    if (targetEnv !== 'safari') {\n      params.origin = origin;\n    }\n\n    return browser.scripting.insertCSS(params);\n  } else {\n    const params = {frameId: frameIds[0]};\n\n    if (files) {\n      params.file = files[0];\n    } else {\n      params.code = code;\n    }\n\n    return browser.tabs.insertCSS(tabId, params);\n  }\n}\n\nasync function executeScript({\n  files = null,\n  func = null,\n  args = null,\n  tabId = null,\n  frameIds = [0],\n  allFrames = false,\n  world = 'ISOLATED',\n  injectImmediately = true,\n  unwrapResults = true,\n\n  code = ''\n}) {\n  if (mv3) {\n    const params = {target: {tabId, allFrames}, world};\n\n    if (!allFrames) {\n      params.target.frameIds = frameIds;\n    }\n\n    if (files) {\n      params.files = files;\n    } else {\n      params.func = func;\n\n      if (args) {\n        params.args = args;\n      }\n    }\n\n    if (targetEnv !== 'safari') {\n      params.injectImmediately = injectImmediately;\n    }\n\n    const results = await browser.scripting.executeScript(params);\n\n    if (unwrapResults) {\n      return results.map(item => item.result);\n    } else {\n      return results;\n    }\n  } else {\n    const params = {frameId: frameIds[0]};\n\n    if (files) {\n      params.file = files[0];\n    } else {\n      params.code = code;\n    }\n\n    if (injectImmediately) {\n      params.runAt = 'document_start';\n    }\n\n    return browser.tabs.executeScript(tabId, params);\n  }\n}\n\nasync function scriptsAllowed({tabId, frameId = 0} = {}) {\n  try {\n    await executeScript({\n      func: () => true,\n      code: 'true;',\n      tabId,\n      frameIds: [frameId]\n    });\n\n    return true;\n  } catch (err) {}\n}\n\nasync function createTab({\n  url = '',\n  index = null,\n  active = true,\n  openerTabId = null,\n  getTab = false\n} = {}) {\n  const props = {url, active};\n\n  if (index !== null) {\n    props.index = index;\n  }\n  if (openerTabId !== null) {\n    props.openerTabId = openerTabId;\n  }\n\n  let tab = await browser.tabs.create(props);\n\n  if (getTab) {\n    if (targetEnv === 'samsung') {\n      // Samsung Internet 13: tabs.create returns previously active tab.\n      // Samsung Internet 13: tabs.query may not immediately return newly created tabs.\n      let count = 1;\n      while (count <= 500 && (!tab || tab.url !== url)) {\n        [tab] = await browser.tabs.query({lastFocusedWindow: true, url});\n\n        await sleep(20);\n        count += 1;\n      }\n    }\n\n    return tab;\n  }\n}\n\nasync function getActiveTab() {\n  const [tab] = await browser.tabs.query({\n    lastFocusedWindow: true,\n    active: true\n  });\n  return tab;\n}\n\nasync function isValidTab({tab, tabId = null} = {}) {\n  if (!tab && tabId !== null) {\n    tab = await browser.tabs.get(tabId).catch(err => null);\n  }\n\n  if (tab && tab.id !== browser.tabs.TAB_ID_NONE) {\n    return true;\n  }\n}\n\nlet platformInfo;\nasync function getPlatformInfo() {\n  if (platformInfo) {\n    return platformInfo;\n  }\n\n  if (mv3) {\n    ({platformInfo} = await storage.get('platformInfo', {area: 'session'}));\n  } else {\n    try {\n      platformInfo = JSON.parse(window.sessionStorage.getItem('platformInfo'));\n    } catch (err) {}\n  }\n\n  if (!platformInfo) {\n    let os, arch;\n\n    if (targetEnv === 'samsung') {\n      // Samsung Internet 13: runtime.getPlatformInfo fails.\n      os = 'android';\n      arch = '';\n    } else if (targetEnv === 'safari') {\n      // Safari: runtime.getPlatformInfo returns 'ios' on iPadOS.\n      ({os, arch} = await browser.runtime.sendNativeMessage('application.id', {\n        id: 'getPlatformInfo'\n      }));\n    } else {\n      ({os, arch} = await browser.runtime.getPlatformInfo());\n    }\n\n    platformInfo = {os, arch};\n\n    if (mv3) {\n      await storage.set({platformInfo}, {area: 'session'});\n    } else {\n      try {\n        window.sessionStorage.setItem(\n          'platformInfo',\n          JSON.stringify(platformInfo)\n        );\n      } catch (err) {}\n    }\n  }\n\n  return platformInfo;\n}\n\nasync function getPlatform() {\n  if (!isBackgroundPageContext()) {\n    return browser.runtime.sendMessage({id: 'getPlatform'});\n  }\n\n  let {os, arch} = await getPlatformInfo();\n\n  if (os === 'win') {\n    os = 'windows';\n  } else if (os === 'mac') {\n    os = 'macos';\n  }\n\n  if (['x86-32', 'i386'].includes(arch)) {\n    arch = '386';\n  } else if (['x86-64', 'x86_64'].includes(arch)) {\n    arch = 'amd64';\n  } else if (arch.startsWith('arm')) {\n    arch = 'arm';\n  }\n\n  const isWindows = os === 'windows';\n  const isMacos = os === 'macos';\n  const isLinux = os === 'linux';\n  const isAndroid = os === 'android';\n  const isIos = os === 'ios';\n  const isIpados = os === 'ipados';\n\n  const isMobile = ['android', 'ios', 'ipados'].includes(os);\n\n  const isChrome = targetEnv === 'chrome';\n  const isEdge =\n    ['chrome', 'edge'].includes(targetEnv) &&\n    /\\sedg(?:e|a|ios)?\\//i.test(navigator.userAgent);\n  const isFirefox = targetEnv === 'firefox';\n  const isOpera =\n    ['chrome', 'opera'].includes(targetEnv) &&\n    /\\sopr\\//i.test(navigator.userAgent);\n  const isSafari = targetEnv === 'safari';\n  const isSamsung = targetEnv === 'samsung';\n\n  return {\n    os,\n    arch,\n    targetEnv,\n    isWindows,\n    isMacos,\n    isLinux,\n    isAndroid,\n    isIos,\n    isIpados,\n    isMobile,\n    isChrome,\n    isEdge,\n    isFirefox,\n    isOpera,\n    isSafari,\n    isSamsung\n  };\n}\n\nasync function isAndroid() {\n  const {os} = await getPlatform();\n  return os === 'android';\n}\n\nfunction getDarkColorSchemeQuery() {\n  return window.matchMedia('(prefers-color-scheme: dark)');\n}\n\nfunction getDayPrecisionEpoch(epoch) {\n  if (!epoch) {\n    epoch = Date.now();\n  }\n\n  return epoch - (epoch % 86400000);\n}\n\nfunction isBackgroundPageContext() {\n  const backgroundUrl = mv3\n    ? browser.runtime.getURL('/src/background/script.js')\n    : browser.runtime.getURL('/src/background/index.html');\n\n  return self.location.href === backgroundUrl;\n}\n\nfunction getExtensionDomain() {\n  try {\n    const {hostname} = new URL(\n      browser.runtime.getURL('/src/background/script.js')\n    );\n\n    return hostname;\n  } catch (err) {}\n\n  return null;\n}\n\nfunction getRandomInt(min, max) {\n  return Math.floor(Math.random() * (max - min + 1)) + min;\n}\n\nfunction getRandomFloat(min, max) {\n  return Math.random() * (max - min) + min;\n}\n\nfunction arrayBufferToBase64(buffer) {\n  let binary = '';\n  const bytes = new Uint8Array(buffer);\n  const length = bytes.byteLength;\n  for (var i = 0; i < length; i++) {\n    binary += String.fromCharCode(bytes[i]);\n  }\n\n  return self.btoa(binary);\n}\n\nfunction base64ToArrayBuffer(string) {\n  const byteString = self.atob(string);\n  const length = byteString.length;\n\n  const array = new Uint8Array(new ArrayBuffer(length));\n  for (let i = 0; i < length; i++) {\n    array[i] = byteString.charCodeAt(i);\n  }\n\n  return array.buffer;\n}\n\nfunction querySelectorXpath(selector, {rootNode = null} = {}) {\n  rootNode = rootNode || document;\n\n  return document.evaluate(\n    selector,\n    rootNode,\n    null,\n    XPathResult.FIRST_ORDERED_NODE_TYPE,\n    null\n  ).singleNodeValue;\n}\n\nfunction nodeQuerySelector(\n  selector,\n  {rootNode = null, selectorType = 'css'} = {}\n) {\n  rootNode = rootNode || document;\n\n  return selectorType === 'css'\n    ? rootNode.querySelector(selector)\n    : querySelectorXpath(selector, {rootNode});\n}\n\nfunction findNode(\n  selector,\n  {\n    timeout = 60000,\n    throwError = true,\n    observerOptions = null,\n    rootNode = null,\n    selectorType = 'css'\n  } = {}\n) {\n  return new Promise((resolve, reject) => {\n    rootNode = rootNode || document;\n\n    const el = nodeQuerySelector(selector, {rootNode, selectorType});\n    if (el) {\n      resolve(el);\n      return;\n    }\n\n    const observer = new MutationObserver(function (mutations, obs) {\n      const el = nodeQuerySelector(selector, {rootNode, selectorType});\n      if (el) {\n        obs.disconnect();\n        window.clearTimeout(timeoutId);\n        resolve(el);\n      }\n    });\n\n    const options = {\n      childList: true,\n      subtree: true\n    };\n    if (observerOptions) {\n      Object.assign(options, observerOptions);\n    }\n\n    observer.observe(rootNode, options);\n\n    const timeoutId = window.setTimeout(function () {\n      observer.disconnect();\n\n      if (throwError) {\n        reject(new Error(`DOM node not found: ${selector}`));\n      } else {\n        resolve();\n      }\n    }, timeout);\n  });\n}\n\nasync function getBrowser() {\n  let name, version;\n  try {\n    ({name, version} = await browser.runtime.getBrowserInfo());\n  } catch (err) {}\n\n  if (!name) {\n    ({name, version} = Bowser.getParser(self.navigator.userAgent).getBrowser());\n  }\n\n  name = name.toLowerCase();\n\n  return {name, version};\n}\n\nasync function normalizeAudio(buffer) {\n  const ctx = new AudioContext();\n  const audioBuffer = await ctx.decodeAudioData(buffer);\n  ctx.close();\n\n  const offlineCtx = new OfflineAudioContext(\n    1,\n    audioBuffer.duration * 16000,\n    16000\n  );\n  const source = offlineCtx.createBufferSource();\n  source.connect(offlineCtx.destination);\n  source.buffer = audioBuffer;\n  source.start();\n\n  return offlineCtx.startRendering();\n}\n\nasync function sliceAudio({audioBuffer, start, end}) {\n  const sampleRate = audioBuffer.sampleRate;\n  const channels = audioBuffer.numberOfChannels;\n\n  const startOffset = sampleRate * start;\n  const endOffset = sampleRate * end;\n  const frameCount = endOffset - startOffset;\n\n  const ctx = new AudioContext();\n  const audioSlice = ctx.createBuffer(channels, frameCount, sampleRate);\n  ctx.close();\n\n  const tempArray = new Float32Array(frameCount);\n  for (var channel = 0; channel < channels; channel++) {\n    audioBuffer.copyFromChannel(tempArray, channel, startOffset);\n    audioSlice.copyToChannel(tempArray, channel, 0);\n  }\n\n  return audioSlice;\n}\n\nasync function prepareAudio(audio, {trimStart = 0, trimEnd = 0} = {}) {\n  const audioBuffer = await normalizeAudio(audio);\n\n  const audioSlice = await sliceAudio({\n    audioBuffer,\n    start: trimStart,\n    end: audioBuffer.duration - trimEnd\n  });\n\n  return audioBufferToWav(audioSlice);\n}\n\nlet creatingOffscreenDoc;\nasync function setupOffscreenDocument({url, reasons, justification} = {}) {\n  const offscreenUrl = browser.runtime.getURL(url);\n  const existingContexts = await browser.runtime.getContexts({\n    contextTypes: ['OFFSCREEN_DOCUMENT'],\n    documentUrls: [offscreenUrl]\n  });\n\n  if (existingContexts.length) {\n    return;\n  }\n\n  if (creatingOffscreenDoc) {\n    await creatingOffscreenDoc;\n  } else {\n    creatingOffscreenDoc = browser.offscreen.createDocument({\n      url,\n      reasons,\n      justification\n    });\n    await creatingOffscreenDoc;\n    creatingOffscreenDoc = null;\n  }\n}\n\nfunction sendOffscreenMessage(message) {\n  return new Promise((resolve, reject) => {\n    function removeCallbacks() {\n      port.disconnect();\n      self.clearTimeout(timeoutId);\n    }\n\n    const timeoutId = self.setTimeout(function () {\n      removeCallbacks();\n      reject();\n    }, 20000); // 20 seconds\n\n    const port = browser.runtime.connect({name: 'offscreen'});\n    port.postMessage(message);\n\n    port.onMessage.addListener(function (response) {\n      port.disconnect();\n\n      resolve(response);\n    });\n  });\n}\n\nfunction runOnce(name, func) {\n  name = `${name}Run`;\n\n  if (!self[name]) {\n    self[name] = true;\n\n    if (!func) {\n      return true;\n    }\n\n    return func();\n  }\n}\n\nfunction sleep(ms) {\n  return new Promise(resolve => self.setTimeout(resolve, ms));\n}\n\nexport {\n  getText,\n  insertCSS,\n  executeScript,\n  scriptsAllowed,\n  createTab,\n  getActiveTab,\n  isValidTab,\n  getPlatformInfo,\n  getPlatform,\n  isAndroid,\n  getDarkColorSchemeQuery,\n  getDayPrecisionEpoch,\n  isBackgroundPageContext,\n  getExtensionDomain,\n  getRandomInt,\n  getRandomFloat,\n  arrayBufferToBase64,\n  base64ToArrayBuffer,\n  querySelectorXpath,\n  nodeQuerySelector,\n  findNode,\n  getBrowser,\n  normalizeAudio,\n  sliceAudio,\n  prepareAudio,\n  setupOffscreenDocument,\n  sendOffscreenMessage,\n  runOnce,\n  sleep\n};\n"
  },
  {
    "path": "src/utils/config.js",
    "content": "const targetEnv = process.env.TARGET_ENV;\n\nconst enableContributions = process.env.ENABLE_CONTRIBUTIONS === 'true';\n\nconst storageRevisions = {\n  local: process.env.STORAGE_REVISION_LOCAL,\n  session: process.env.STORAGE_REVISION_SESSION\n};\n\nconst appVersion = process.env.APP_VERSION;\n\nconst clientAppVersion = '0.3.0';\n\nconst mv3 = process.env.MV3 === 'true';\n\nexport {\n  targetEnv,\n  enableContributions,\n  storageRevisions,\n  appVersion,\n  clientAppVersion,\n  mv3\n};\n"
  },
  {
    "path": "src/utils/data.js",
    "content": "const optionKeys = [\n  'speechService',\n  'googleSpeechApiKey',\n  'ibmSpeechApiUrl',\n  'ibmSpeechApiKey',\n  'microsoftSpeechApiLoc',\n  'microsoftSpeechApiKey',\n  'witSpeechApiKeys',\n  'loadEnglishChallenge',\n  'tryEnglishSpeechModel',\n  'simulateUserInput',\n  'autoUpdateClientApp',\n  'navigateWithKeyboard',\n  'appTheme',\n  'showContribPage'\n];\n\nconst clientAppPlatforms = [\n  'windows/amd64',\n  'windows/386',\n  'linux/amd64',\n  'macos/amd64'\n];\n\n// https://google.com/recaptcha/api2/anchor*\n// https://google.com/recaptcha/api2/bframe*\n// https://www.google.com/recaptcha/api2/anchor*\n// https://www.google.com/recaptcha/api2/bframe*\n// https://google.com/recaptcha/enterprise/anchor*\n// https://google.com/recaptcha/enterprise/bframe*\n// https://www.google.com/recaptcha/enterprise/anchor*\n// https://www.google.com/recaptcha/enterprise/bframe*\n// https://recaptcha.net/recaptcha/api2/anchor*\n// https://recaptcha.net/recaptcha/api2/bframe*\n// https://www.recaptcha.net/recaptcha/api2/anchor*\n// https://www.recaptcha.net/recaptcha/api2/bframe*\n// https://recaptcha.net/recaptcha/enterprise/anchor*\n// https://recaptcha.net/recaptcha/enterprise/bframe*\n// https://www.recaptcha.net/recaptcha/enterprise/anchor*\n// https://www.recaptcha.net/recaptcha/enterprise/bframe*\nconst recaptchaUrlRxString = `^https:\\/\\/(?:www\\.)?(?:google\\.com|recaptcha\\.net)\\/recaptcha\\/(?:api2|enterprise)\\/(?:anchor|bframe).*`;\n\n// https://google.com/recaptcha/api2/bframe*\n// https://www.google.com/recaptcha/api2/bframe*\n// https://google.com/recaptcha/enterprise/bframe*\n// https://www.google.com/recaptcha/enterprise/bframe*\n// https://recaptcha.net/recaptcha/api2/bframe*\n// https://www.recaptcha.net/recaptcha/api2/bframe*\n// https://recaptcha.net/recaptcha/enterprise/bframe*\n// https://www.recaptcha.net/recaptcha/enterprise/bframe*\nconst recaptchaChallengeUrlRx =\n  /^https:\\/\\/(?:www\\.)?(?:google\\.com|recaptcha\\.net)\\/recaptcha\\/(?:api2|enterprise)\\/bframe.*/;\n\n// https://developers.google.com/recaptcha/docs/language\n// https://cloud.google.com/speech-to-text/docs/speech-to-text-supported-languages\nconst captchaGoogleSpeechApiLangCodes = {\n  ar: 'ar-SA', // Arabic\n  af: 'af-ZA', // Afrikaans\n  am: 'am-ET', // Amharic\n  hy: 'hy-AM', // Armenian\n  az: 'az-AZ', // Azerbaijani\n  eu: 'eu-ES', // Basque\n  bn: 'bn-BD', // Bengali\n  bg: 'bg-BG', // Bulgarian\n  ca: 'ca-ES', // Catalan\n  'zh-HK': 'cmn-Hans-HK', // Chinese (Hong Kong)\n  'zh-CN': 'cmn-Hans-CN', // Chinese (Simplified)\n  'zh-TW': 'cmn-Hant-TW', // Chinese (Traditional)\n  hr: 'hr-HR', // Croatian\n  cs: 'cs-CZ', // Czech\n  da: 'da-DK', // Danish\n  nl: 'nl-NL', // Dutch\n  'en-GB': 'en-GB', // English (UK)\n  en: 'en-US', // English (US)\n  et: 'et-EE', // Estonian\n  fil: 'fil-PH', // Filipino\n  fi: 'fi-FI', // Finnish\n  fr: 'fr-FR', // French\n  'fr-CA': 'fr-CA', // French (Canadian)\n  gl: 'gl-ES', // Galician\n  ka: 'ka-GE', // Georgian\n  de: 'de-DE', // German\n  'de-AT': 'de-DE', // German (Austria)\n  'de-CH': 'de-DE', // German (Switzerland)\n  el: 'el-GR', // Greek\n  gu: 'gu-IN', // Gujarati\n  iw: 'he-IL', // Hebrew\n  hi: 'hi-IN', // Hindi\n  hu: 'hu-HU', // Hungarian\n  is: 'is-IS', // Icelandic\n  id: 'id-ID', // Indonesian\n  it: 'it-IT', // Italian\n  ja: 'ja-JP', // Japanese\n  kn: 'kn-IN', // Kannada\n  ko: 'ko-KR', // Korean\n  lo: 'lo-LA', // Laothian\n  lv: 'lv-LV', // Latvian\n  lt: 'lt-LT', // Lithuanian\n  ms: 'ms-MY', // Malay\n  ml: 'ml-IN', // Malayalam\n  mr: 'mr-IN', // Marathi\n  mn: 'mn-MN', // Mongolian\n  no: 'nb-NO', // Norwegian\n  fa: 'fa-IR', // Persian\n  pl: 'pl-PL', // Polish\n  pt: 'pt-PT', // Portuguese\n  'pt-BR': 'pt-BR', // Portuguese (Brazil)\n  'pt-PT': 'pt-PT', // Portuguese (Portugal)\n  ro: 'ro-RO', // Romanian\n  ru: 'ru-RU', // Russian\n  sr: 'sr-RS', // Serbian\n  si: 'si-LK', // Sinhalese\n  sk: 'sk-SK', // Slovak\n  sl: 'sl-SI', // Slovenian\n  es: 'es-ES', // Spanish\n  'es-419': 'es-MX', // Spanish (Latin America)\n  sw: 'sw-TZ', // Swahili\n  sv: 'sv-SE', // Swedish\n  ta: 'ta-IN', // Tamil\n  te: 'te-IN', // Telugu\n  th: 'th-TH', // Thai\n  tr: 'tr-TR', // Turkish\n  uk: 'uk-UA', // Ukrainian\n  ur: 'ur-IN', // Urdu\n  vi: 'vi-VN', // Vietnamese\n  zu: 'zu-ZA' // Zulu\n};\n\n// https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng#models-ng-supported\nconst captchaIbmSpeechApiLangCodes = {\n  ar: 'ar-MS_Telephony', // Arabic\n  af: '', // Afrikaans\n  am: '', // Amharic\n  hy: '', // Armenian\n  az: '', // Azerbaijani\n  eu: '', // Basque\n  bn: '', // Bengali\n  bg: '', // Bulgarian\n  ca: '', // Catalan\n  'zh-HK': '', // Chinese (Hong Kong)\n  'zh-CN': 'zh-CN_Telephony', // Chinese (Simplified)\n  'zh-TW': 'zh-CN_Telephony', // Chinese (Traditional)\n  hr: '', // Croatian\n  cs: 'cs-CZ_Telephony', // Czech\n  da: '', // Danish\n  nl: 'nl-NL_Multimedia', // Dutch\n  'en-GB': 'en-GB_Multimedia', // English (UK)\n  en: 'en-US_Multimedia', // English (US)\n  et: '', // Estonian\n  fil: '', // Filipino\n  fi: '', // Finnish\n  fr: 'fr-FR_Multimedia', // French\n  'fr-CA': 'fr-CA_Multimedia', // French (Canadian)\n  gl: '', // Galician\n  ka: '', // Georgian\n  de: 'de-DE_Multimedia', // German\n  'de-AT': 'de-DE_Multimedia', // German (Austria)\n  'de-CH': 'de-DE_Multimedia', // German (Switzerland)\n  el: '', // Greek\n  gu: '', // Gujarati\n  iw: '', // Hebrew\n  hi: 'hi-IN_Telephony', // Hindi\n  hu: '', // Hungarian\n  is: '', // Icelandic\n  id: '', // Indonesian\n  it: 'it-IT_Multimedia', // Italian\n  ja: 'ja-JP_Multimedia', // Japanese\n  kn: '', // Kannada\n  ko: 'ko-KR_Multimedia', // Korean\n  lo: '', // Laothian\n  lv: '', // Latvian\n  lt: '', // Lithuanian\n  ms: '', // Malay\n  ml: '', // Malayalam\n  mr: '', // Marathi\n  mn: '', // Mongolian\n  no: '', // Norwegian\n  fa: '', // Persian\n  pl: '', // Polish\n  pt: 'pt-BR_Multimedia', // Portuguese\n  'pt-BR': 'pt-BR_Multimedia', // Portuguese (Brazil)\n  'pt-PT': 'pt-BR_Multimedia', // Portuguese (Portugal)\n  ro: '', // Romanian\n  ru: '', // Russian\n  sr: '', // Serbian\n  si: '', // Sinhalese\n  sk: '', // Slovak\n  sl: '', // Slovenian\n  es: 'es-ES_Multimedia', // Spanish\n  'es-419': 'es-LA_Telephony', // Spanish (Latin America)\n  sw: '', // Swahili\n  sv: 'sv-SE_Telephony', // Swedish\n  ta: '', // Tamil\n  te: '', // Telugu\n  th: '', // Thai\n  tr: '', // Turkish\n  uk: '', // Ukrainian\n  ur: '', // Urdu\n  vi: '', // Vietnamese\n  zu: '' // Zulu\n};\n\n// https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=stt#supported-languages\nconst captchaMicrosoftSpeechApiLangCodes = {\n  ar: 'ar-EG', // Arabic\n  af: 'af-ZA', // Afrikaans\n  am: 'am-ET', // Amharic\n  hy: 'hy-AM', // Armenian\n  az: 'az-AZ', // Azerbaijani\n  eu: 'eu-ES', // Basque\n  bn: 'bn-IN', // Bengali\n  bg: 'bg-BG', // Bulgarian\n  ca: 'ca-ES', // Catalan\n  'zh-HK': 'zh-HK', // Chinese (Hong Kong)\n  'zh-CN': 'zh-CN', // Chinese (Simplified)\n  'zh-TW': 'zh-TW', // Chinese (Traditional)\n  hr: 'hr-HR', // Croatian\n  cs: 'cs-CZ', // Czech\n  da: 'da-DK', // Danish\n  nl: 'nl-NL', // Dutch\n  'en-GB': 'en-GB', // English (UK)\n  en: 'en-US', // English (US)\n  et: 'et-EE', // Estonian\n  fil: 'fil-PH', // Filipino\n  fi: 'fi-FI', // Finnish\n  fr: 'fr-FR', // French\n  'fr-CA': 'fr-CA', // French (Canadian)\n  gl: 'gl-ES', // Galician\n  ka: 'ka-GE', // Georgian\n  de: 'de-DE', // German\n  'de-AT': 'de-AT', // German (Austria)\n  'de-CH': 'de-CH', // German (Switzerland)\n  el: 'el-GR', // Greek\n  gu: 'gu-IN', // Gujarati\n  iw: 'he-IL', // Hebrew\n  hi: 'hi-IN', // Hindi\n  hu: 'hu-HU', // Hungarian\n  is: 'is-IS', // Icelandic\n  id: 'id-ID', // Indonesian\n  it: 'it-IT', // Italian\n  ja: 'ja-JP', // Japanese\n  kn: 'kn-IN', // Kannada\n  ko: 'ko-KR', // Korean\n  lo: 'lo-LA', // Laothian\n  lv: 'lv-LV', // Latvian\n  lt: 'lt-LT', // Lithuanian\n  ms: 'ms-MY', // Malay\n  ml: 'ml-IN', // Malayalam\n  mr: 'mr-IN', // Marathi\n  mn: 'mn-MN', // Mongolian\n  no: 'nb-NO', // Norwegian\n  fa: 'fa-IR', // Persian\n  pl: 'pl-PL', // Polish\n  pt: 'pt-PT', // Portuguese\n  'pt-BR': 'pt-BR', // Portuguese (Brazil)\n  'pt-PT': 'pt-PT', // Portuguese (Portugal)\n  ro: 'ro-RO', // Romanian\n  ru: 'ru-RU', // Russian\n  sr: 'sr-RS', // Serbian\n  si: 'si-LK', // Sinhalese\n  sk: 'sk-SK', // Slovak\n  sl: 'sl-SI', // Slovenian\n  es: 'es-ES', // Spanish\n  'es-419': 'es-MX', // Spanish (Latin America)\n  sw: 'sw-TZ', // Swahili\n  sv: 'sv-SE', // Swedish\n  ta: 'ta-IN', // Tamil\n  te: 'te-IN', // Telugu\n  th: 'th-TH', // Thai\n  tr: 'tr-TR', // Turkish\n  uk: 'uk-UA', // Ukrainian\n  ur: 'ur-IN', // Urdu\n  vi: 'vi-VN', // Vietnamese\n  zu: 'zu-ZA' // Zulu\n};\n\n// https://wit.ai/faq\nconst captchaWitSpeechApiLangCodes = {\n  ar: 'arabic', // Arabic\n  af: '', // Afrikaans\n  am: '', // Amharic\n  hy: '', // Armenian\n  az: '', // Azerbaijani\n  eu: '', // Basque\n  bn: 'bengali', // Bengali\n  bg: '', // Bulgarian\n  ca: '', // Catalan\n  'zh-HK': '', // Chinese (Hong Kong)\n  'zh-CN': 'chinese', // Chinese (Simplified)\n  'zh-TW': 'chinese', // Chinese (Traditional)\n  hr: '', // Croatian\n  cs: '', // Czech\n  da: '', // Danish\n  nl: 'dutch', // Dutch\n  'en-GB': 'english', // English (UK)\n  en: 'english', // English (US)\n  et: '', // Estonian\n  fil: '', // Filipino\n  fi: 'finnish', // Finnish\n  fr: 'french', // French\n  'fr-CA': 'french', // French (Canadian)\n  gl: '', // Galician\n  ka: '', // Georgian\n  de: 'german', // German\n  'de-AT': 'german', // German (Austria)\n  'de-CH': 'german', // German (Switzerland)\n  el: '', // Greek\n  gu: '', // Gujarati\n  iw: '', // Hebrew\n  hi: 'hindi', // Hindi\n  hu: '', // Hungarian\n  is: '', // Icelandic\n  id: 'indonesian', // Indonesian\n  it: 'italian', // Italian\n  ja: 'japanese', // Japanese\n  kn: 'kannada', // Kannada\n  ko: 'korean', // Korean\n  lo: '', // Laothian\n  lv: '', // Latvian\n  lt: '', // Lithuanian\n  ms: 'malay', // Malay\n  ml: 'malayalam', // Malayalam\n  mr: 'marathi', // Marathi\n  mn: '', // Mongolian\n  no: '', // Norwegian\n  fa: '', // Persian\n  pl: 'polish', // Polish\n  pt: 'portuguese', // Portuguese\n  'pt-BR': 'portuguese', // Portuguese (Brazil)\n  'pt-PT': 'portuguese', // Portuguese (Portugal)\n  ro: '', // Romanian\n  ru: 'russian', // Russian\n  sr: '', // Serbian\n  si: 'sinhala', // Sinhalese\n  sk: '', // Slovak\n  sl: '', // Slovenian\n  es: 'spanish', // Spanish\n  'es-419': 'spanish', // Spanish (Latin America)\n  sw: '', // Swahili\n  sv: 'swedish', // Swedish\n  ta: 'tamil', // Tamil\n  te: '', // Telugu\n  th: 'thai', // Thai\n  tr: 'turkish', // Turkish\n  uk: '', // Ukrainian\n  ur: 'urdu', // Urdu\n  vi: 'vietnamese', // Vietnamese\n  zu: '' // Zulu\n};\n\n// https://learn.microsoft.com/en-us/azure/ai-services/speech-service/regions#speech-service\nconst microsoftSpeechApiRegions = [\n  'southafricanorth',\n  'eastasia',\n  'southeastasia',\n  'australiaeast',\n  'centralindia',\n  'japaneast',\n  'japanwest',\n  'koreacentral',\n  'canadacentral',\n  'northeurope',\n  'westeurope',\n  'francecentral',\n  'germanywestcentral',\n  'norwayeast',\n  'swedencentral',\n  'switzerlandnorth',\n  'switzerlandwest',\n  'uksouth',\n  'uaenorth',\n  'brazilsouth',\n  'qatarcentral',\n  'centralus',\n  'eastus',\n  'eastus2',\n  'northcentralus',\n  'southcentralus',\n  'westcentralus',\n  'westus',\n  'westus2',\n  'westus3'\n];\n\nexport {\n  optionKeys,\n  clientAppPlatforms,\n  recaptchaUrlRxString,\n  recaptchaChallengeUrlRx,\n  captchaGoogleSpeechApiLangCodes,\n  captchaIbmSpeechApiLangCodes,\n  captchaMicrosoftSpeechApiLangCodes,\n  captchaWitSpeechApiLangCodes,\n  microsoftSpeechApiRegions\n};\n"
  },
  {
    "path": "src/utils/vuetify.js",
    "content": "import {createVuetify} from 'vuetify';\n\nimport {getAppTheme, addThemeListener} from 'utils/app';\n\nconst LightTheme = {\n  dark: false,\n  colors: {\n    background: '#FFFFFF',\n    surface: '#FFFFFF',\n    primary: '#6750A4',\n    secondary: '#625B71'\n  }\n};\n\nconst DarkTheme = {\n  dark: true,\n  colors: {\n    background: '#1C1B1F',\n    surface: '#1C1B1F',\n    primary: '#D0BCFF',\n    secondary: '#CCC2DC'\n  }\n};\n\nasync function configTheme(vuetify, {theme = ''} = {}) {\n  async function setTheme({theme = '', dispatchChange = true} = {}) {\n    if (!theme) {\n      theme = await getAppTheme();\n    }\n\n    document.documentElement.style.setProperty('color-scheme', theme);\n    vuetify.theme.global.name.value = theme;\n\n    if (dispatchChange) {\n      document.dispatchEvent(new CustomEvent('themeChange', {detail: theme}));\n    }\n  }\n\n  addThemeListener(setTheme);\n\n  await setTheme({theme, dispatchChange: false});\n}\n\nasync function configVuetify(app) {\n  const theme = await getAppTheme();\n\n  const vuetify = createVuetify({\n    theme: {\n      themes: {light: LightTheme, dark: DarkTheme},\n      defaultTheme: theme\n    },\n    defaults: {\n      VDialog: {\n        eager: true\n      },\n      VSelect: {\n        eager: true\n      },\n      VSnackbar: {\n        eager: true\n      },\n      VMenu: {\n        eager: true\n      }\n    }\n  });\n\n  await configTheme(vuetify, {theme});\n\n  app.use(vuetify);\n}\n\nexport {configTheme, configVuetify};\n"
  },
  {
    "path": "webpack.config.js",
    "content": "const path = require('node:path');\nconst {lstatSync, readdirSync} = require('node:fs');\n\nconst webpack = require('webpack');\nconst {VueLoaderPlugin} = require('vue-loader');\nconst {VuetifyPlugin} = require('webpack-plugin-vuetify');\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\n\nconst appVersion = require('./package.json').version;\nconst storageRevisions = require('./src/storage/config.json').revisions;\n\nconst targetEnv = process.env.TARGET_ENV || 'chrome';\nconst isProduction = process.env.NODE_ENV === 'production';\nconst enableContributions =\n  (process.env.ENABLE_CONTRIBUTIONS || 'true') === 'true';\n\nconst mv3 = ['chrome', 'edge', 'opera'].includes(targetEnv);\n\nconst provideExtApi = !['firefox', 'safari'].includes(targetEnv);\n\nconst provideModules = {};\nif (provideExtApi) {\n  provideModules.browser = 'webextension-polyfill';\n}\n\nconst plugins = [\n  new webpack.DefinePlugin({\n    'process.env': {\n      TARGET_ENV: JSON.stringify(targetEnv),\n      STORAGE_REVISION_LOCAL: JSON.stringify(storageRevisions.local.at(-1)),\n      STORAGE_REVISION_SESSION: JSON.stringify(storageRevisions.session.at(-1)),\n      ENABLE_CONTRIBUTIONS: JSON.stringify(enableContributions.toString()),\n      APP_VERSION: JSON.stringify(appVersion),\n      MV3: JSON.stringify(mv3.toString())\n    },\n    __VUE_OPTIONS_API__: true,\n    __VUE_PROD_DEVTOOLS__: false,\n    __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false\n  }),\n  new webpack.ProvidePlugin(provideModules),\n  new VueLoaderPlugin(),\n  new VuetifyPlugin(),\n  new MiniCssExtractPlugin({\n    filename: '[name]/style.css',\n    ignoreOrder: true\n  })\n];\n\nconst scriptsRootDir = path.join(__dirname, 'src/scripts');\nconst scripts = readdirSync(scriptsRootDir)\n  .filter(file => lstatSync(path.join(scriptsRootDir, file)).isFile())\n  .map(file => file.split('.')[0]);\n\nconst entries = Object.fromEntries(\n  scripts.map(script => [script, `./src/scripts/${script}.js`])\n);\n\nif (mv3 && !['firefox', 'safari'].includes(targetEnv)) {\n  entries.offscreen = './src/offscreen/main.js';\n}\n\nif (enableContributions) {\n  entries.contribute = './src/contribute/main.js';\n}\n\nmodule.exports = {\n  mode: isProduction ? 'production' : 'development',\n  entry: {\n    background: './src/background/main.js',\n    options: './src/options/main.js',\n    contribute: './src/contribute/main.js',\n    base: './src/base/main.js',\n    setup: './src/setup/main.js',\n    ...entries\n  },\n  output: {\n    path: path.resolve(__dirname, 'dist', targetEnv, 'src'),\n    filename: pathData => {\n      return scripts.includes(pathData.chunk.name)\n        ? 'scripts/[name].js'\n        : '[name]/script.js';\n    },\n    chunkFilename: '[name]/script.js',\n    asyncChunks: false\n  },\n  optimization: {\n    splitChunks: {\n      cacheGroups: {\n        default: false,\n        commonsUi: {\n          name: 'commons-ui',\n          chunks: chunk => {\n            return ['options', 'contribute', 'setup'].includes(chunk.name);\n          },\n          minChunks: 2\n        }\n      }\n    }\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        use: 'babel-loader',\n        resolve: {\n          fullySpecified: false\n        }\n      },\n      {\n        test: /\\.vue$/,\n        use: [\n          {\n            loader: 'vue-loader',\n            options: {\n              transformAssetUrls: {img: ''},\n              compilerOptions: {whitespace: 'preserve'}\n            }\n          }\n        ]\n      },\n      {\n        test: /\\.(c|sc|sa)ss$/,\n        use: [\n          MiniCssExtractPlugin.loader,\n          'css-loader',\n          'postcss-loader',\n          {\n            loader: 'sass-loader',\n            options: {\n              sassOptions: {\n                includePaths: ['node_modules'],\n                quietDeps: true\n              },\n              additionalData: (content, loaderContext) => {\n                return `\n                  $target-env: \"${targetEnv}\";\n                  ${content}\n                `;\n              }\n            }\n          }\n        ]\n      }\n    ]\n  },\n  resolve: {\n    modules: [path.resolve(__dirname, 'src'), 'node_modules'],\n    extensions: ['.js', '.json', '.css', '.scss', '.vue'],\n    fallback: {fs: false}\n  },\n  devtool: false,\n  plugins\n};\n"
  }
]