mediawiki/extensions/DonationInterface: main (log #1904879)

sourcepatches

This run took 54 seconds.

From 80e7a2325c3d666e021fe9c2f0be82d257e17eb5 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Sun, 25 May 2025 05:58:27 +0000
Subject: [PATCH] build: Updating eslint-config-wikimedia to 0.30.0

Change-Id: I1b5241186e3ca1c7356ece882adcfeef22cc2505
---
 package-lock.json | 14 +++++++-------
 package.json      |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 46b1174..5215f24 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -6,7 +6,7 @@
 		"": {
 			"name": "DonationInterface",
 			"devDependencies": {
-				"eslint-config-wikimedia": "0.29.1",
+				"eslint-config-wikimedia": "0.30.0",
 				"grunt": "1.6.1",
 				"grunt-banana-checker": "0.13.0",
 				"grunt-contrib-watch": "1.1.0",
@@ -1485,9 +1485,9 @@
 			}
 		},
 		"node_modules/eslint-config-wikimedia": {
-			"version": "0.29.1",
-			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.29.1.tgz",
-			"integrity": "sha512-4dbL5o3hKGSvreyrGZWLPoTDLFubZ575IQOPhUaTcpbTsi0u05TBEMsOyYkthTaK21vsFQqhSYtxp/xU93BSdA==",
+			"version": "0.30.0",
+			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.30.0.tgz",
+			"integrity": "sha512-i8ESzSoo0x3Jur/0JhAgCVPxbV51zfdI3MN3MVQPnjiFdmo21CNKmiBBmw8JnJ3fx/d5zHDrBa+yDjxSLpnDlA==",
 			"dev": true,
 			"dependencies": {
 				"browserslist-config-wikimedia": "^0.7.0",
@@ -6445,9 +6445,9 @@
 			}
 		},
 		"eslint-config-wikimedia": {
-			"version": "0.29.1",
-			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.29.1.tgz",
-			"integrity": "sha512-4dbL5o3hKGSvreyrGZWLPoTDLFubZ575IQOPhUaTcpbTsi0u05TBEMsOyYkthTaK21vsFQqhSYtxp/xU93BSdA==",
+			"version": "0.30.0",
+			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.30.0.tgz",
+			"integrity": "sha512-i8ESzSoo0x3Jur/0JhAgCVPxbV51zfdI3MN3MVQPnjiFdmo21CNKmiBBmw8JnJ3fx/d5zHDrBa+yDjxSLpnDlA==",
 			"dev": true,
 			"requires": {
 				"browserslist-config-wikimedia": "^0.7.0",
diff --git a/package.json b/package.json
index 6697279..5e239ad 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
 		"url": "https://gerrit.wikimedia.org/r/p/mediawiki/extensions/DonationInterface.git"
 	},
 	"devDependencies": {
-		"eslint-config-wikimedia": "0.29.1",
+		"eslint-config-wikimedia": "0.30.0",
 		"grunt": "1.6.1",
 		"grunt-banana-checker": "0.13.0",
 		"grunt-contrib-watch": "1.1.0",
-- 
2.39.5

$ date
--- stdout ---
Sun May 25 05:57:46 UTC 2025

--- end ---
$ git clone file:///srv/git/mediawiki-extensions-DonationInterface.git repo --depth=1 -b master
--- stderr ---
Cloning into 'repo'...
--- stdout ---

--- end ---
$ git config user.name libraryupgrader
--- stdout ---

--- end ---
$ git config user.email tools.libraryupgrader@tools.wmflabs.org
--- stdout ---

--- end ---
$ git submodule update --init
--- stdout ---

--- end ---
$ grr init
--- stdout ---
Installed commit-msg hook.

--- end ---
$ git show-ref refs/heads/master
--- stdout ---
b3a0148728b6d3d8885c2fc4e33cd068e6a27030 refs/heads/master

--- end ---
$ /usr/bin/npm audit --json
--- stdout ---
{
  "auditReportVersion": 2,
  "vulnerabilities": {},
  "metadata": {
    "vulnerabilities": {
      "info": 0,
      "low": 0,
      "moderate": 0,
      "high": 0,
      "critical": 0,
      "total": 0
    },
    "dependencies": {
      "prod": 1,
      "dev": 445,
      "optional": 0,
      "peer": 1,
      "peerOptional": 0,
      "total": 445
    }
  }
}

--- end ---
$ /usr/bin/composer install
--- stderr ---
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
                                                      Updating dependencies
Lock file operations: 74 installs, 0 updates, 0 removals
  - Locking addshore/psr-6-mediawiki-bagostuff-adapter (0.1)
  - Locking amzn/login-and-pay-with-amazon-sdk-php (2.5.0)
  - Locking clio/clio (0.1.8)
  - Locking coderkungfu/php-queue (1.0.1)
  - Locking composer/ca-bundle (1.5.6)
  - Locking composer/pcre (3.3.2)
  - Locking composer/semver (3.4.3)
  - Locking composer/spdx-licenses (1.5.9)
  - Locking composer/xdebug-handler (3.0.5)
  - Locking corneltek/getoptionkit (2.7.3)
  - Locking dealerdirect/phpcodesniffer-composer-installer (v1.0.0)
  - Locking doctrine/deprecations (1.1.5)
  - Locking felixfbecker/advanced-json-rpc (v3.2.1)
  - Locking geoip2/geoip2 (v2.13.0)
  - Locking gr4vy/gr4vy-php (v0.26.0)
  - Locking guzzlehttp/guzzle (7.9.3)
  - Locking guzzlehttp/promises (2.2.0)
  - Locking guzzlehttp/psr7 (2.7.1)
  - Locking lcobucci/clock (3.3.1)
  - Locking lcobucci/jwt (4.3.0)
  - Locking maxmind-db/reader (v1.12.1)
  - Locking maxmind/minfraud (v1.23.0)
  - Locking maxmind/web-service-common (v0.9.0)
  - Locking mediawiki/mediawiki-codesniffer (v47.0.0)
  - Locking mediawiki/mediawiki-phan-config (0.15.1)
  - Locking mediawiki/minus-x (1.1.3)
  - Locking mediawiki/phan-taint-check-plugin (6.1.0)
  - Locking microsoft/tolerant-php-parser (v0.1.2)
  - Locking monolog/monolog (2.10.0)
  - Locking netresearch/jsonmapper (v4.5.0)
  - Locking phan/phan (5.4.5)
  - Locking php-parallel-lint/php-console-color (v1.0.1)
  - Locking php-parallel-lint/php-console-highlighter (v1.0.0)
  - Locking php-parallel-lint/php-parallel-lint (v1.4.0)
  - Locking phpcsstandards/phpcsextra (1.2.1)
  - Locking phpcsstandards/phpcsutils (1.0.12)
  - Locking phpdocumentor/reflection-common (2.2.0)
  - Locking phpdocumentor/reflection-docblock (5.6.2)
  - Locking phpdocumentor/type-resolver (1.10.0)
  - Locking phpmailer/phpmailer (v6.10.0)
  - Locking phpstan/phpdoc-parser (2.1.0)
  - Locking predis/predis (v1.1.10)
  - Locking psr/cache (1.0.1)
  - Locking psr/clock (1.0.0)
  - Locking psr/container (2.0.2)
  - Locking psr/http-client (1.0.3)
  - Locking psr/http-factory (1.1.0)
  - Locking psr/http-message (2.0)
  - Locking psr/log (1.1.4)
  - Locking ralouphie/getallheaders (3.0.3)
  - Locking relisten/forceutf8 (1.1.0)
  - Locking respect/stringifier (0.2.0)
  - Locking respect/validation (2.4.3)
  - Locking sabre/event (5.1.7)
  - Locking squizlabs/php_codesniffer (3.12.2)
  - Locking symfony/console (v7.2.6)
  - Locking symfony/deprecation-contracts (v3.5.1)
  - Locking symfony/http-foundation (v6.4.21)
  - Locking symfony/polyfill-ctype (v1.32.0)
  - Locking symfony/polyfill-intl-grapheme (v1.32.0)
  - Locking symfony/polyfill-intl-normalizer (v1.32.0)
  - Locking symfony/polyfill-mbstring (v1.32.0)
  - Locking symfony/polyfill-php80 (v1.32.0)
  - Locking symfony/polyfill-php83 (v1.32.0)
  - Locking symfony/service-contracts (v3.5.1)
  - Locking symfony/string (v7.2.6)
  - Locking symfony/yaml (v5.4.45)
  - Locking tysonandre/var_representation_polyfill (0.1.3)
  - Locking webmozart/assert (1.11.0)
  - Locking whichbrowser/parser (v2.1.8)
  - Locking wikimedia/remex-html (4.1.2)
  - Locking wikimedia/smash-pig (v0.9.6.5)
  - Locking wikimedia/testing-access-wrapper (3.0.0)
  - Locking wikimedia/utfnormal (4.0.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 74 installs, 0 updates, 0 removals
  - Syncing amzn/login-and-pay-with-amazon-sdk-php (2.5.0) into cache
  - Downloading wikimedia/smash-pig (v0.9.6.5)
 0/1 [>---------------------------]   0%
 1/1 [============================] 100%
  - Installing squizlabs/php_codesniffer (3.12.2): Extracting archive
  - Installing dealerdirect/phpcodesniffer-composer-installer (v1.0.0): Extracting archive
  - Installing psr/cache (1.0.1): Extracting archive
  - Installing addshore/psr-6-mediawiki-bagostuff-adapter (0.1): Extracting archive
  - Installing clio/clio (0.1.8): Extracting archive
  - Installing composer/pcre (3.3.2): Extracting archive
  - Installing symfony/deprecation-contracts (v3.5.1): Extracting archive
  - Installing psr/http-message (2.0): Extracting archive
  - Installing psr/http-client (1.0.3): Extracting archive
  - Installing ralouphie/getallheaders (3.0.3): Extracting archive
  - Installing psr/http-factory (1.1.0): Extracting archive
  - Installing guzzlehttp/psr7 (2.7.1): Extracting archive
  - Installing guzzlehttp/promises (2.2.0): Extracting archive
  - Installing guzzlehttp/guzzle (7.9.3): Extracting archive
  - Installing psr/clock (1.0.0): Extracting archive
  - Installing lcobucci/clock (3.3.1): Extracting archive
  - Installing symfony/polyfill-mbstring (v1.32.0): Extracting archive
  - Installing lcobucci/jwt (4.3.0): Extracting archive
  - Installing maxmind-db/reader (v1.12.1): Extracting archive
  - Installing respect/stringifier (0.2.0): Extracting archive
  - Installing respect/validation (2.4.3): Extracting archive
  - Installing composer/ca-bundle (1.5.6): Extracting archive
  - Installing maxmind/web-service-common (v0.9.0): Extracting archive
  - Installing geoip2/geoip2 (v2.13.0): Extracting archive
  - Installing maxmind/minfraud (v1.23.0): Extracting archive
  - Installing symfony/polyfill-php80 (v1.32.0): Extracting archive
  - Installing phpcsstandards/phpcsutils (1.0.12): Extracting archive
  - Installing phpcsstandards/phpcsextra (1.2.1): Extracting archive
  - Installing composer/spdx-licenses (1.5.9): Extracting archive
  - Installing composer/semver (3.4.3): Extracting archive
  - Installing mediawiki/mediawiki-codesniffer (v47.0.0): Extracting archive
  - Installing tysonandre/var_representation_polyfill (0.1.3): Extracting archive
  - Installing symfony/polyfill-intl-normalizer (v1.32.0): Extracting archive
  - Installing symfony/polyfill-intl-grapheme (v1.32.0): Extracting archive
  - Installing symfony/polyfill-ctype (v1.32.0): Extracting archive
  - Installing symfony/string (v7.2.6): Extracting archive
  - Installing psr/container (2.0.2): Extracting archive
  - Installing symfony/service-contracts (v3.5.1): Extracting archive
  - Installing symfony/console (v7.2.6): Extracting archive
  - Installing sabre/event (5.1.7): Extracting archive
  - Installing netresearch/jsonmapper (v4.5.0): Extracting archive
  - Installing microsoft/tolerant-php-parser (v0.1.2): Extracting archive
  - Installing webmozart/assert (1.11.0): Extracting archive
  - Installing phpstan/phpdoc-parser (2.1.0): Extracting archive
  - Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
  - Installing doctrine/deprecations (1.1.5): Extracting archive
  - Installing phpdocumentor/type-resolver (1.10.0): Extracting archive
  - Installing phpdocumentor/reflection-docblock (5.6.2): Extracting archive
  - Installing felixfbecker/advanced-json-rpc (v3.2.1): Extracting archive
  - Installing psr/log (1.1.4): Extracting archive
  - Installing composer/xdebug-handler (3.0.5): Extracting archive
  - Installing phan/phan (5.4.5): Extracting archive
  - Installing mediawiki/phan-taint-check-plugin (6.1.0): Extracting archive
  - Installing mediawiki/mediawiki-phan-config (0.15.1): Extracting archive
  - Installing mediawiki/minus-x (1.1.3): Extracting archive
  - Installing monolog/monolog (2.10.0): Extracting archive
  - Installing php-parallel-lint/php-console-color (v1.0.1): Extracting archive
  - Installing php-parallel-lint/php-console-highlighter (v1.0.0): Extracting archive
  - Installing php-parallel-lint/php-parallel-lint (v1.4.0): Extracting archive
  - Installing relisten/forceutf8 (1.1.0): Extracting archive
  - Installing symfony/polyfill-php83 (v1.32.0): Extracting archive
  - Installing whichbrowser/parser (v2.1.8): Extracting archive
  - Installing wikimedia/utfnormal (4.0.0): Extracting archive
  - Installing wikimedia/remex-html (4.1.2): Extracting archive
  - Installing symfony/yaml (v5.4.45): Extracting archive
  - Installing symfony/http-foundation (v6.4.21): Extracting archive
  - Installing predis/predis (v1.1.10): Extracting archive
  - Installing phpmailer/phpmailer (v6.10.0): Extracting archive
  - Installing gr4vy/gr4vy-php (v0.26.0): Extracting archive
  - Installing corneltek/getoptionkit (2.7.3): Extracting archive
  - Installing coderkungfu/php-queue (1.0.1): Extracting archive
  - Installing amzn/login-and-pay-with-amazon-sdk-php (2.5.0): Cloning 0c923fe992 from cache
  - Installing wikimedia/smash-pig (v0.9.6.5): Extracting archive
  - Installing wikimedia/testing-access-wrapper (3.0.0): Extracting archive
  0/71 [>---------------------------]   0%
 19/71 [=======>--------------------]  26%
 29/71 [===========>----------------]  40%
 40/71 [===============>------------]  56%
 52/71 [====================>-------]  73%
 61/71 [========================>---]  85%
 70/71 [===========================>]  98%
 71/71 [============================] 100%
30 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating optimized autoload files
Class SmashPig\PaymentProviders\Fundraiseup\Tests\AuditTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Fundraiseup/Tests/phpunit/AuditTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Ingenico\Tests\Manual\TestCreatePayment located in ./vendor/wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/manual/TestCreatePayment.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Ingenico\Tests\IdealStatusProviderTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Ingenico\Tests\HostedCheckoutProviderTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/phpunit/HostedCheckoutProviderTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Ingenico\Tests\ApiTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Ingenico\Tests\AuditTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/phpunit/AuditTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Ingenico\Tests\AuthenticatorTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/phpunit/AuthenticatorTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Ingenico\Tests\BankPaymentProviderTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Ingenico\Tests\PaymentProviderTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/phpunit/PaymentProviderTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Ingenico\Tests\TokenizeRecurringJobTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/phpunit/TokenizeRecurringJobTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Amazon\Tests\RecordPaymentsJobTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Amazon/Tests/phpunit/RecordPaymentsJobTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Amazon\Tests\NormalizeTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Amazon\Tests\ActionsTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Amazon/Tests/phpunit/ActionsTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Amazon\Tests\ApiTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Amazon\Tests\AuditTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Amazon/Tests/phpunit/AuditTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\CaptureJobTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\RestResponseValidatorTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/RestResponseValidatorTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\CancelRecurringActionTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/CancelRecurringActionTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\RequeueMessageTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/RequeueMessageTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Tests\PaymentCaptureActionTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/PaymentCaptureActionTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\RecurringContractActionTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/RecurringContractActionTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Tests\RefundInitiatedActionTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/RefundInitiatedActionTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\RecurringContractJobTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/RecurringContractJobTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\RecurringPaymentTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/RecurringPaymentTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Tests\ReferenceDataTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/ReferenceDataTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\ApiTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/ApiTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\AutoRescueActionTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/AutoRescueActionTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Tests\ChargebackInitiatedActionTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/ChargebackInitiatedActionTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Tests\ReportAvailableTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/ReportAvailableTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\AuditTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/AuditTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Test\RecordCaptureJobTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/RecordCaptureJobTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Tests\TokenizeRecurringJobTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/TokenizeRecurringJobTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Adyen\Tests\CaptureResponseActionTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/phpunit/CaptureResponseActionTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\dlocal\Tests\PaidMessageJobTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/dlocal/Tests/phpunit/PaidMessageJobTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\dlocal\Tests\RestResponseValidatorTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/dlocal/Tests/phpunit/RestResponseValidatorTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\dlocal\Tests\RejectedMessageJobTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/dlocal/Tests/phpunit/RejectedMessageJobTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\dlocal\Tests\SignatureCalculatorTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/dlocal/Tests/phpunit/SignatureCalculatorTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\dlocal\Tests\AuthorizedMessageJobTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/dlocal/Tests/phpunit/AuthorizedMessageJobTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\dlocal\Tests\ApiTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/dlocal/Tests/phpunit/ApiTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\dlocal\Test\AuditTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/dlocal/Tests/phpunit/AuditTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\dlocal\Tests\CardPaymentProviderTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/dlocal/Tests/phpunit/CardPaymentProviderTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\PayPal\Tests\CaptureIncomingMessageTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\PayPal\Tests\PaymentProviderTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/PayPal/Tests/phpunit/PaymentProviderTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Braintree\Tests\SignatureValidatorTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Braintree/Tests/phpunit/SignatureValidatorTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Braintree\Tests\PayPalPaymentProviderTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Braintree/Tests/phpunit/PayPalPaymentProviderTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Braintree\Tests\VenmoPaymentProviderTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Braintree/Tests/phpunit/VenmoPaymentProviderTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Braintree\Tests\ApiTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Braintree/Tests/phpunit/ApiTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Braintree\Test\AuditTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Braintree/Tests/phpunit/AuditTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SmashPig\PaymentProviders\Braintree\Tests\PaymentProviderTest located in ./vendor/wikimedia/smash-pig/PaymentProviders/Braintree/Tests/phpunit/PaymentProviderTest.php does not comply with psr-4 autoloading standard. Skipping.
28 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
--- stdout ---
PHP CodeSniffer Config installed_paths set to ../../mediawiki/mediawiki-codesniffer,../../phpcsstandards/phpcsextra,../../phpcsstandards/phpcsutils

--- end ---
Upgrading n:eslint-config-wikimedia from 0.29.1 -> 0.30.0
$ /usr/bin/npm install
--- stdout ---

added 445 packages, and audited 446 packages in 4s

92 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

--- end ---
$ package-lock-lint package-lock.json
--- stdout ---
Checking package-lock.json

--- end ---
$ /usr/bin/npm install grunt-eslint@24.3.0 --save-exact
--- stdout ---

up to date, audited 446 packages in 1s

92 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

--- end ---
$ package-lock-lint package-lock.json
--- stdout ---
Checking package-lock.json

--- end ---
$ ./node_modules/.bin/eslint modules/js/ext.donationInterface.monthlyConvert.js modules/js/ext.donationInterface.monthlyConvert_015.js modules/js/ext.donationInterface.errorLog.js modules/js/ext.donationInterface.requestNewChecksumLink.js braintree_gateway/forms/braintree.js modules/js/ext.donationInterface.employerExplain.js modules/js/ext.donationInterface.monthlyConvert_003.js modules/validate_input.js modules/js/ext.donationInterface.monthlyConvertAnnual.js ./extension.json modules/js/ext.donationInterface.monthlyConvertButtonFlip.js modules/iframe.liberator.js modules/js/ext.donationInterface.alwaysRedirect.js amazon_gateway/amazon.js modules/js/ext.donationInterface.applePayHelper.js modules/js/ext.donationInterface.forms.js modules/js/ext.donationInterface.monthlyConvertMultiplier.js modules/js/ext.donationInterface.employerExplainAlt.js dlocal_gateway/forms/dlocal.js ./package.json modules/js/ext.donationInterface.monthlyConvert_010.js adyen_gateway/forms/adyen.js modules/js/ext.donationInterface.validation.js modules/js/ext.donationInterface.emailPreferences.js modules/js/ext.donationInterface.recurUpgrade.js ./composer.json modules/js/skinOverride.js gravy_gateway/forms/gravy.js modules/js/ext.donationInterface.monthlyConvert_011.js ./package-lock.json modules/js/ext.donationInterface.jaVariant02.js modules/js/ext.donationInterface.employerAutoComplete.js ingenico_gateway/forms/js/ingenico.js ./Gruntfile.js paypal_ec_gateway/forms/js/paypal.js --fix
--- stdout ---

/src/repo/Gruntfile.js
  35:11  warning  ES2015 'Object.assign' method is forbidden  es-x/no-object-assign

/src/repo/adyen_gateway/forms/adyen.js
    1:26  warning  'Promise' is already defined as a built-in global variable           no-redeclare
    5:3   warning  'configFromServer' is never reassigned. Use 'const' instead          prefer-const
    6:3   warning  'payment_method' is never reassigned. Use 'const' instead            prefer-const
    8:3   warning  'country' is never reassigned. Use 'const' instead                   prefer-const
    9:3   warning  'language' is never reassigned. Use 'const' instead                  prefer-const
   17:3   warning  'GOOGLEPAY_COMPONENT_TYPE' is never reassigned. Use 'const' instead  prefer-const
   18:3   warning  'ACH_GET_DONOR_ADDRESS' is never reassigned. Use 'const' instead     prefer-const
   25:1   warning  Missing JSDoc @return type                                           jsdoc/require-returns-type
   65:5   warning  Unexpected var, use let or const instead                             no-var
   81:23  warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
   83:11  warning  'bContact' is never reassigned. Use 'const' instead                  prefer-const
   84:8   warning  'sContact' is never reassigned. Use 'const' instead                  prefer-const
  132:5   warning  Unexpected var, use let or const instead                             no-var
  163:23  warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
  223:34  warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
  227:14  warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
  311:2   warning  'submitPromise' is never reassigned. Use 'const' instead             prefer-const
  311:22  warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
  399:6   warning  ES2015 'Object.assign' method is forbidden                           es-x/no-object-assign
  538:4   warning  ES2015 'Object.assign' method is forbidden                           es-x/no-object-assign
  548:4   warning  'containerName' is never reassigned. Use 'const' instead             prefer-const
  552:3   warning  'component_type' is never reassigned. Use 'const' instead            prefer-const
  571:3   warning  'oldShowErrors' is never reassigned. Use 'const' instead             prefer-const
  593:3   warning  'config' is never reassigned. Use 'const' instead                    prefer-const
  601:3   warning  'checkoutPromise' is never reassigned. Use 'const' instead           prefer-const
  625:4   warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
  652:4   warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise

/src/repo/amazon_gateway/amazon.js
    3:6   warning  'clientId' is never reassigned. Use 'const' instead                   prefer-const
    4:3   warning  'sellerId' is never reassigned. Use 'const' instead                   prefer-const
    5:3   warning  'sandbox' is never reassigned. Use 'const' instead                    prefer-const
    6:3   warning  'returnUrl' is never reassigned. Use 'const' instead                  prefer-const
    7:3   warning  'widgetScript' is never reassigned. Use 'const' instead               prefer-const
    8:3   warning  'loginScript' is never reassigned. Use 'const' instead                prefer-const
    9:3   warning  'failPage' is never reassigned. Use 'const' instead                   prefer-const
   10:3   warning  'isRecurring' is never reassigned. Use 'const' instead                prefer-const
   14:3   warning  'validTokenPattern' is never reassigned. Use 'const' instead          prefer-const
   14:23  warning  Use a regular expression literal instead of the 'RegExp' constructor  prefer-regex-literals
   22:3   warning  'CARD_SELECT_DELAY' is never reassigned. Use 'const' instead          prefer-const
   98:2   warning  'accessToken' is never reassigned. Use 'const' instead                prefer-const
   99:2   warning  'loginError' is never reassigned. Use 'const' instead                 prefer-const
  268:8   warning  Selector extensions are not allowed                                   no-jquery/no-sizzle

/src/repo/braintree_gateway/forms/braintree.js
  10:6  warning  'di' is never reassigned. Use 'const' instead              prefer-const
  12:3  warning  'payment_method' is never reassigned. Use 'const' instead  prefer-const

/src/repo/dlocal_gateway/forms/dlocal.js
  27:7  warning  'dlocalInstance' is never reassigned. Use 'const' instead   prefer-const
  28:4  warning  'fields' is never reassigned. Use 'const' instead           prefer-const
  33:4  warning  'commonStyle' is never reassigned. Use 'const' instead      prefer-const
  49:3  warning  'cardField' is never reassigned. Use 'const' instead        prefer-const
  55:3  warning  'expirationField' is never reassigned. Use 'const' instead  prefer-const
  61:3  warning  'cvvField' is never reassigned. Use 'const' instead         prefer-const

/src/repo/gravy_gateway/forms/gravy.js
   11:2   warning  'extraData' is never reassigned. Use 'const' instead                                 prefer-const
   12:2   warning  'configFromServer' is never reassigned. Use 'const' instead                          prefer-const
   13:2   warning  'sessionId' is never reassigned. Use 'const' instead                                 prefer-const
   14:2   warning  'environment' is never reassigned. Use 'const' instead                               prefer-const
   15:2   warning  'gravyId' is never reassigned. Use 'const' instead                                   prefer-const
   16:2   warning  'redirectPaypal' is never reassigned. Use 'const' instead                            prefer-const
   17:2   warning  'googlePaymentClient' is never reassigned. Use 'const' instead                       prefer-const
   19:2   warning  'language' is never reassigned. Use 'const' instead                                  prefer-const
   20:2   warning  'applePayPaySessionVersionNumber' is never reassigned. Use 'const' instead           prefer-const
  119:25  warning  All possible message keys should be documented. See https://w.wiki/4r9a for details  mediawiki/msg-doc
  119:49  warning  All possible message keys should be documented. See https://w.wiki/4r9a for details  mediawiki/msg-doc
  243:8   warning  'extraData' is already declared in the upper scope on line 11 column 2               no-shadow
  393:43  warning  'appleSession' is already declared in the upper scope on line 18 column 2            no-shadow
  439:8   warning  'extraData' is already declared in the upper scope on line 11 column 2               no-shadow

/src/repo/modules/iframe.liberator.js
  1:10  warning  'self' is already defined as a built-in global variable  no-redeclare

/src/repo/modules/js/ext.donationInterface.applePayHelper.js
   4:1  warning  Missing JSDoc @param "$" type                jsdoc/require-param-type
   5:1  warning  Missing JSDoc @param "mw" type               jsdoc/require-param-type
  15:1  warning  Missing JSDoc @param "extraData" type        jsdoc/require-param-type
  16:1  warning  Missing JSDoc @param "billingContact" type   jsdoc/require-param-type
  17:1  warning  Missing JSDoc @param "shippingContact" type  jsdoc/require-param-type

/src/repo/modules/js/ext.donationInterface.employerAutoComplete.js
  28:21  warning  Prefer .then to .done  no-jquery/no-done-fail

/src/repo/modules/js/ext.donationInterface.errorLog.js
  16:3  warning  'postdata' is never reassigned. Use 'const' instead  prefer-const

/src/repo/modules/js/ext.donationInterface.forms.js
    4:1   warning  Missing JSDoc @param "$" type                        jsdoc/require-param-type
    5:1   warning  Missing JSDoc @param "mw" type                       jsdoc/require-param-type
   74:27  warning  Selector extensions are not allowed                  no-jquery/no-sizzle
   90:12  warning  '$element' is never reassigned. Use 'const' instead  prefer-const
  105:1   warning  The type 'result' is undefined                       jsdoc/no-undefined-types
  127:3   warning  'sendData' is never reassigned. Use 'const' instead  prefer-const
  163:4   warning  ES2015 'Object.assign' method is forbidden           es-x/no-object-assign
  263:8   warning  Selector extensions are not allowed                  no-jquery/no-sizzle

/src/repo/modules/js/ext.donationInterface.jaVariant02.js
  8:1  warning  Missing JSDoc @param "mw" type  jsdoc/require-param-type
  9:1  warning  Missing JSDoc @param "$" type   jsdoc/require-param-type

/src/repo/modules/js/ext.donationInterface.monthlyConvert.js
    2:6   warning  'mc' is never reassigned. Use 'const' instead                         prefer-const
    6:3   warning  'tyUrl' is never reassigned. Use 'const' instead                      prefer-const
    9:3   warning  'convertAmounts' is never reassigned. Use 'const' instead             prefer-const
   17:3   warning  'numAmounts' is never reassigned. Use 'const' instead                 prefer-const
   26:49  warning  'currency' is already declared in the upper scope on line 3 column 3  no-shadow
   34:39  warning  'currency' is already declared in the upper scope on line 3 column 3  no-shadow
  103:51  warning  'currency' is already declared in the upper scope on line 3 column 3  no-shadow
  104:7   warning  'rates' is never reassigned. Use 'const' instead                      prefer-const
  105:4   warning  'amountRules' is never reassigned. Use 'const' instead                prefer-const
  107:4   warning  '$smallAmountMessage' is never reassigned. Use 'const' instead        prefer-const
  117:3   warning  'formattedMin' is never reassigned. Use 'const' instead               prefer-const
  133:4   warning  'locale' is never reassigned. Use 'const' instead                     prefer-const
  136:3   warning  'presetAmount' is never reassigned. Use 'const' instead               prefer-const

/src/repo/modules/js/ext.donationInterface.monthlyConvertAnnual.js
   3:7   warning  'mc' is never reassigned. Use 'const' instead                        prefer-const
   3:31  warning  'originalGetSendData' is never reassigned. Use 'const' instead       prefer-const
   4:4   warning  'originalAmount' is never reassigned. Use 'const' instead            prefer-const
   5:4   warning  '$otherAmountMonthlyInput' is never reassigned. Use 'const' instead  prefer-const
   5:62  warning  '$otherAmountAnnualInput' is never reassigned. Use 'const' instead   prefer-const
   6:4   warning  '$otherMonthlySubmit' is never reassigned. Use 'const' instead       prefer-const
   6:60  warning  '$otherAnnualSubmit' is never reassigned. Use 'const' instead        prefer-const
   7:4   warning  '$smallAmountMessage' is never reassigned. Use 'const' instead       prefer-const
  15:3   warning  'originalAmountFormatted' is never reassigned. Use 'const' instead   prefer-const

/src/repo/modules/js/ext.donationInterface.monthlyConvertMultiplier.js
  3:7  warning  'mc' is never reassigned. Use 'const' instead              prefer-const
  4:3  warning  'originalAmount' is never reassigned. Use 'const' instead  prefer-const

/src/repo/modules/js/ext.donationInterface.monthlyConvert_011.js
  3:7  warning  'mc' is never reassigned. Use 'const' instead              prefer-const
  4:4  warning  'locale' is never reassigned. Use 'const' instead          prefer-const
  5:3  warning  'originalAmount' is never reassigned. Use 'const' instead  prefer-const
  6:3  warning  'currency' is never reassigned. Use 'const' instead        prefer-const
  7:3  warning  'presetAmount' is never reassigned. Use 'const' instead    prefer-const
  8:3  warning  'formattedAsk' is never reassigned. Use 'const' instead    prefer-const

/src/repo/modules/js/ext.donationInterface.recurUpgrade.js
   3:7  warning  '$submitButton' is never reassigned. Use 'const' instead      prefer-const
   4:4  warning  '$amountField' is never reassigned. Use 'const' instead       prefer-const
   5:4  warning  '$otherAmountField' is never reassigned. Use 'const' instead  prefer-const
   6:4  warning  '$totalMessage' is never reassigned. Use 'const' instead      prefer-const
   7:4  warning  '$newTotalAmount' is never reassigned. Use 'const' instead    prefer-const
   8:4  warning  '$form' is never reassigned. Use 'const' instead              prefer-const
   9:4  warning  'originalAmount' is never reassigned. Use 'const' instead     prefer-const
  10:4  warning  'currency' is never reassigned. Use 'const' instead           prefer-const
  11:4  warning  'maximum' is never reassigned. Use 'const' instead            prefer-const
  12:4  warning  'nextDateFormatted' is never reassigned. Use 'const' instead  prefer-const
  14:4  warning  'preSelectAmount' is never reassigned. Use 'const' instead    prefer-const
  38:4  warning  'valueIsValid' is never reassigned. Use 'const' instead       prefer-const

/src/repo/modules/js/ext.donationInterface.validation.js
   7:1   warning  Missing JSDoc @param "$" type                                      jsdoc/require-param-type
   8:1   warning  Missing JSDoc @param "mw" type                                     jsdoc/require-param-type
  11:6   warning  'di' is never reassigned. Use 'const' instead                      prefer-const
  13:3   warning  'mcDomains' is never reassigned. Use 'const' instead               prefer-const
  33:3   warning  'multiCountrySubdomains' is never reassigned. Use 'const' instead  prefer-const
  34:3   warning  'countryTlds' is never reassigned. Use 'const' instead             prefer-const
  40:26  warning  'i' is already declared in the upper scope on line 39 column 36    no-shadow

/src/repo/modules/validate_input.js
    1:1   warning  Missing JSDoc @return declaration                                                    jsdoc/require-returns
    9:3   warning  'rates' is never reassigned. Use 'const' instead                                     prefer-const
   10:3   warning  'amountRules' is never reassigned. Use 'const' instead                               prefer-const
   14:3   warning  '$amountMsg' is never reassigned. Use 'const' instead                                prefer-const
   15:3   warning  'threeDecimalCurrencies' is never reassigned. Use 'const' instead                    prefer-const
   87:3   warning  'invalids' is never reassigned. Use 'const' instead                                  prefer-const
   88:3   warning  'rules' is never reassigned. Use 'const' instead                                     prefer-const
  106:27  warning  'value' is already declared in the upper scope on line 83 column 6                   no-shadow
  108:14  warning  All possible message keys should be documented. See https://w.wiki/4r9a for details  mediawiki/msg-doc
  114:23  warning  'i' is already declared in the upper scope on line 86 column 3                       no-shadow
  146:2   warning  'countryField' is never reassigned. Use 'const' instead                              prefer-const
  169:2   warning  'emailAdd' is never reassigned. Use 'const' instead                                  prefer-const

/src/repo/paypal_ec_gateway/forms/js/paypal.js
  2:6  warning  'di' is never reassigned. Use 'const' instead     prefer-const
  3:3  warning  'rules' is never reassigned. Use 'const' instead  prefer-const

✖ 145 problems (0 errors, 145 warnings)


--- end ---
$ ./node_modules/.bin/eslint modules/js/ext.donationInterface.monthlyConvert.js modules/js/ext.donationInterface.monthlyConvert_015.js modules/js/ext.donationInterface.errorLog.js modules/js/ext.donationInterface.requestNewChecksumLink.js braintree_gateway/forms/braintree.js modules/js/ext.donationInterface.employerExplain.js modules/js/ext.donationInterface.monthlyConvert_003.js modules/validate_input.js modules/js/ext.donationInterface.monthlyConvertAnnual.js ./extension.json modules/js/ext.donationInterface.monthlyConvertButtonFlip.js modules/iframe.liberator.js modules/js/ext.donationInterface.alwaysRedirect.js amazon_gateway/amazon.js modules/js/ext.donationInterface.applePayHelper.js modules/js/ext.donationInterface.forms.js modules/js/ext.donationInterface.monthlyConvertMultiplier.js modules/js/ext.donationInterface.employerExplainAlt.js dlocal_gateway/forms/dlocal.js ./package.json modules/js/ext.donationInterface.monthlyConvert_010.js adyen_gateway/forms/adyen.js modules/js/ext.donationInterface.validation.js modules/js/ext.donationInterface.emailPreferences.js modules/js/ext.donationInterface.recurUpgrade.js ./composer.json modules/js/skinOverride.js gravy_gateway/forms/gravy.js modules/js/ext.donationInterface.monthlyConvert_011.js ./package-lock.json modules/js/ext.donationInterface.jaVariant02.js modules/js/ext.donationInterface.employerAutoComplete.js ingenico_gateway/forms/js/ingenico.js ./Gruntfile.js paypal_ec_gateway/forms/js/paypal.js -f json
--- stdout ---
[{"filePath":"/src/repo/Gruntfile.js","messages":[{"ruleId":"es-x/no-object-assign","severity":1,"message":"ES2015 'Object.assign' method is forbidden.","line":35,"column":11,"nodeType":"MemberExpression","messageId":"forbidden","endLine":35,"endColumn":24}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/*!\n * Grunt file\n *\n * @package DonationInterface\n */\n\n/* eslint-env node */\nmodule.exports = function ( grunt ) {\n\tconst conf = grunt.file.readJSON( 'extension.json' );\n\tgrunt.loadNpmTasks( 'grunt-banana-checker' );\n\tgrunt.loadNpmTasks( 'grunt-eslint' );\n\tgrunt.loadNpmTasks( 'grunt-stylelint' );\n\n\tgrunt.initConfig( {\n\t\teslint: {\n\t\t\toptions: {\n\t\t\t\tcache: true,\n\t\t\t\tfix: grunt.option( 'fix' )\n\t\t\t},\n\t\t\tall: [\n\t\t\t\t'{.,modules/**}/*.js{,on}',\n\t\t\t\t'!modules/js/{mailcheck,lg-hash,lightgallery}.js',\n\t\t\t\t'{adyen,amazon,braintree,dlocal,ingenico,paypal_ec,gravy}_gateway/**/*.js'\n\t\t\t]\n\t\t},\n\t\tstylelint: {\n\t\t\toptions: {\n\t\t\t\tcache: true\n\t\t\t},\n\t\t\tall: [\n\t\t\t\t'{modules,gateway_forms}/{**/,}*.{css,less}',\n\t\t\t\t'{amazon,ingenico}_gateway/{**/,}*.{css,less}'\n\t\t\t]\n\t\t},\n\t\tbanana: Object.assign(\n\t\t\t{\n\t\t\t\toptions: {\n\t\t\t\t\trequireLowerCase: false\n\t\t\t\t}\n\t\t\t},\n\t\t\tconf.MessagesDirs\n\t\t)\n\t} );\n\n\tgrunt.registerTask( 'test', [ 'eslint', 'stylelint', 'banana' ] );\n\tgrunt.registerTask( 'default', 'test' );\n};\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/adyen_gateway/forms/adyen.js","messages":[{"ruleId":"no-redeclare","severity":1,"message":"'Promise' is already defined as a built-in global variable.","line":1,"column":26,"nodeType":"Block","messageId":"redeclaredAsBuiltin","endLine":1,"endColumn":33},{"ruleId":"prefer-const","severity":1,"message":"'configFromServer' is never reassigned. Use 'const' instead.","line":5,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":5,"endColumn":19},{"ruleId":"prefer-const","severity":1,"message":"'payment_method' is never reassigned. Use 'const' instead.","line":6,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":6,"endColumn":17},{"ruleId":"prefer-const","severity":1,"message":"'country' is never reassigned. Use 'const' instead.","line":8,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":8,"endColumn":10},{"ruleId":"prefer-const","severity":1,"message":"'language' is never reassigned. Use 'const' instead.","line":9,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":9,"endColumn":11},{"ruleId":"prefer-const","severity":1,"message":"'GOOGLEPAY_COMPONENT_TYPE' is never reassigned. Use 'const' instead.","line":17,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":17,"endColumn":27},{"ruleId":"prefer-const","severity":1,"message":"'ACH_GET_DONOR_ADDRESS' is never reassigned. Use 'const' instead.","line":18,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":18,"endColumn":24},{"ruleId":"jsdoc/require-returns-type","severity":1,"message":"Missing JSDoc @return type.","line":25,"column":1,"nodeType":"Block","endLine":25,"endColumn":1},{"ruleId":"no-var","severity":1,"message":"Unexpected var, use let or const instead.","line":65,"column":5,"nodeType":"VariableDeclaration","messageId":"unexpectedVar","endLine":67,"endColumn":42},{"ruleId":"es-x/no-promise","severity":1,"message":"ES2015 'Promise' class is forbidden.","line":81,"column":23,"nodeType":"Identifier","messageId":"forbidden","endLine":81,"endColumn":30},{"ruleId":"prefer-const","severity":1,"message":"'bContact' is never reassigned. Use 'const' instead.","line":83,"column":11,"nodeType":"Identifier","messageId":"useConst","endLine":83,"endColumn":19},{"ruleId":"prefer-const","severity":1,"message":"'sContact' is never reassigned. Use 'const' instead.","line":84,"column":8,"nodeType":"Identifier","messageId":"useConst","endLine":84,"endColumn":16},{"ruleId":"no-var","severity":1,"message":"Unexpected var, use let or const instead.","line":132,"column":5,"nodeType":"VariableDeclaration","messageId":"unexpectedVar","endLine":138,"endColumn":64},{"ruleId":"es-x/no-promise","severity":1,"message":"ES2015 'Promise' class is forbidden.","line":163,"column":23,"nodeType":"Identifier","messageId":"forbidden","endLine":163,"endColumn":30},{"ruleId":"es-x/no-promise","severity":1,"message":"ES2015 'Promise' class is forbidden.","line":223,"column":34,"nodeType":"Identifier","messageId":"forbidden","endLine":223,"endColumn":41},{"ruleId":"es-x/no-promise","severity":1,"message":"ES2015 'Promise' class is forbidden.","line":227,"column":14,"nodeType":"Identifier","messageId":"forbidden","endLine":227,"endColumn":21},{"ruleId":"prefer-const","severity":1,"message":"'submitPromise' is never reassigned. Use 'const' instead.","line":311,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":311,"endColumn":15},{"ruleId":"es-x/no-promise","severity":1,"message":"ES2015 'Promise' class is forbidden.","line":311,"column":22,"nodeType":"Identifier","messageId":"forbidden","endLine":311,"endColumn":29},{"ruleId":"es-x/no-object-assign","severity":1,"message":"ES2015 'Object.assign' method is forbidden.","line":399,"column":6,"nodeType":"MemberExpression","messageId":"forbidden","endLine":399,"endColumn":19},{"ruleId":"es-x/no-object-assign","severity":1,"message":"ES2015 'Object.assign' method is forbidden.","line":538,"column":4,"nodeType":"MemberExpression","messageId":"forbidden","endLine":538,"endColumn":17},{"ruleId":"prefer-const","severity":1,"message":"'containerName' is never reassigned. Use 'const' instead.","line":548,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":548,"endColumn":17},{"ruleId":"prefer-const","severity":1,"message":"'component_type' is never reassigned. Use 'const' instead.","line":552,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":552,"endColumn":17},{"ruleId":"prefer-const","severity":1,"message":"'oldShowErrors' is never reassigned. Use 'const' instead.","line":571,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":571,"endColumn":16},{"ruleId":"prefer-const","severity":1,"message":"'config' is never reassigned. Use 'const' instead.","line":593,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":593,"endColumn":9},{"ruleId":"prefer-const","severity":1,"message":"'checkoutPromise' is never reassigned. Use 'const' instead.","line":601,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":601,"endColumn":18},{"ruleId":"es-x/no-promise","severity":1,"message":"ES2015 'Promise' class is forbidden.","line":625,"column":4,"nodeType":"Identifier","messageId":"forbidden","endLine":625,"endColumn":11},{"ruleId":"es-x/no-promise","severity":1,"message":"ES2015 'Promise' class is forbidden.","line":652,"column":4,"nodeType":"Identifier","messageId":"forbidden","endLine":652,"endColumn":11}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":27,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/* global AdyenCheckout, Promise */\n( function ( $, mw ) {\n\t// promise objects are for Apple Pay - see comments below\n\tlet checkout, onSubmit, authPromise, submitPromise,\n\t\tconfigFromServer = mw.config.get( 'adyenConfiguration' ),\n\t\tpayment_method = $( '#payment_method' ).val(),\n\t\tonBrandSubmethod = '',\n\t\tcountry = $( '#country' ).val(),\n\t\tlanguage = $( '#language' ).val(),\n\t\t// This is the old-style Google Pay integration type currently active on\n\t\t// our account. Older versions of the Adyen JS SDK treated the 'googlepay'\n\t\t// component type as the old GPay integration, but for newer versions of\n\t\t// the GPay SDK we need to explicitly specify 'paywithgoogle' to get tokens\n\t\t// that work with the old-style integration. At some point we should upgrade\n\t\t// to the new interaction, but that will require coordinating an update to\n\t\t// this constant with an update to our account.\n\t\tGOOGLEPAY_COMPONENT_TYPE = 'paywithgoogle',\n\t\tACH_GET_DONOR_ADDRESS = true; // set false to remove address from form\n\n\t/**\n\t * Get extra configuration values for specific payment types\n\t *\n\t * @param {string} type Adyen-side name of component type\n\t * @param {Object} checkoutConfig The config object used to instantiate the Adyen Checkout object\n\t * @return Object\n\t */\n\tfunction getComponentConfig( type, checkoutConfig ) {\n\t\tconst config = {};\n\t\tswitch ( type ) {\n\t\t\tcase 'card':\n\t\t\t\t// Note: Debug messages are only sent and logged server-side if\n\t\t\t\t// $wgDonationInterfaceLogDebug (or $wgAdyenCheckoutGatewayLogDebug) is true\n\n\t\t\t\tconfig.onBrand = function ( brandInfo ) {\n\t\t\t\t\tconst message = brandInfo.brand ?\n\t\t\t\t\t\t'onBrand returned brand: ' + brandInfo.brand :\n\t\t\t\t\t\t'onBrand returned: ' + JSON.stringify( brandInfo );\n\t\t\t\t\tif ( brandInfo.brand ) {\n\t\t\t\t\t\tonBrandSubmethod = brandInfo.brand;\n\t\t\t\t\t}\n\t\t\t\t\tmw.donationInterface.forms.addDebugMessage( message );\n\t\t\t\t};\n\n\t\t\t\tconfig.onBinLookup = function ( binLookupInfo ) {\n\t\t\t\t\tconst message = binLookupInfo.detectedBrands && binLookupInfo.detectedBrands.length > 0 ?\n\t\t\t\t\t\t'onBinLookup returned detected brands: ' + JSON.stringify( binLookupInfo.detectedBrands ) :\n\t\t\t\t\t\t'onBinLookup returned: ' + JSON.stringify( binLookupInfo );\n\t\t\t\t\tmw.donationInterface.forms.addDebugMessage( message );\n\t\t\t\t};\n\n\t\t\t\tconfig.showBrandsUnderCardNumber = false;\n\t\t\t\treturn config;\n\n\t\t\tcase 'ach':\n\t\t\t\tconfig.billingAddressRequired = ACH_GET_DONOR_ADDRESS;\n\t\t\t\treturn config;\n\t\t\tcase 'ideal':\n\t\t\tcase 'onlineBanking_CZ':\n\t\t\tcase 'sepadirectdebit':\n\t\t\t\t// for ach, ideal, CZ bank transfers, and sepa additional config is optional\n\t\t\t\treturn config;\n\n\t\t\tcase 'applepay':\n\t\t\t\t// for applepay, additional config is required\n\t\t\t\tvar amount = {},\n\t\t\t\t\tcurrency = $( '#currency' ).val(),\n\t\t\t\t\tamount_value = $( '#amount' ).val();\n\t\t\t\tamount.currency = currency;\n\t\t\t\tamount.value = amountInMinorUnits( amount_value, currency );\n\t\t\t\tconfig.amount = amount;\n\t\t\t\tconfig.countryCode = country;\n\t\t\t\tconfig.requiredBillingContactFields = [\n\t\t\t\t\t'name',\n\t\t\t\t\t'postalAddress'\n\t\t\t\t];\n\t\t\t\tconfig.requiredShippingContactFields = [\n\t\t\t\t\t'name',\n\t\t\t\t\t'email'\n\t\t\t\t];\n\n\t\t\t\tauthPromise = new Promise( ( authResolve, authReject ) => {\n\t\t\t\t\tconfig.onAuthorized = function ( resolve, reject, event ) {\n\t\t\t\t\t\tlet bContact = event.payment.billingContact,\n\t\t\t\t\t\t\tsContact = event.payment.shippingContact,\n\t\t\t\t\t\t\textraData = {};\n\t\t\t\t\t\textraData = mw.donationInterface.forms.apple.getBestApplePayContactName( extraData, bContact, sContact );\n\t\t\t\t\t\textraData.postal_code = bContact.postalCode;\n\t\t\t\t\t\textraData.state_province = bContact.administrativeArea;\n\t\t\t\t\t\textraData.city = bContact.locality;\n\t\t\t\t\t\tif ( bContact.addressLines.length > 0 ) {\n\t\t\t\t\t\t\textraData.street_address = bContact.addressLines[ 0 ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\textraData.email = sContact.emailAddress;\n\t\t\t\t\t\textraData.payment_submethod = mapAppleNetworkToSubmethod( event.payment.token.paymentMethod.network );\n\t\t\t\t\t\t// We will combine this contact data with a token from the\n\t\t\t\t\t\t// onSubmit event after both events have fired.\n\t\t\t\t\t\tauthResolve( extraData );\n\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t};\n\t\t\t\t} );\n\t\t\t\t// For Apple Pay show the branded button with 'Donate with 🍎Pay'\n\t\t\t\t// text as opposed to our standard blue Donate button\n\t\t\t\tconfig.showPayButton = true;\n\t\t\t\tconfig.buttonType = 'donate';\n\t\t\t\t// When the donor clicks the donate button, this event is fired with\n\t\t\t\t// a validationUrl provided by Apple. We have to make a server-side\n\t\t\t\t// request to get a big blob of Apple Pay session data, then send it\n\t\t\t\t// via the resolve function back to the component, which apparently\n\t\t\t\t// sends it back to the native widget via completeMerchantValidation.\n\t\t\t\t// https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/providing_merchant_validation\n\t\t\t\tconfig.onValidateMerchant = function ( resolve, reject, validationUrl ) {\n\t\t\t\t\tconst api = new mw.Api();\n\t\t\t\t\tapi.post( {\n\t\t\t\t\t\taction: 'di_applesession_adyen',\n\t\t\t\t\t\tvalidation_url: validationUrl,\n\t\t\t\t\t\twmf_token: $( '#wmf_token' ).val()\n\t\t\t\t\t} ).then( ( data ) => {\n\t\t\t\t\t\tif ( data.result && data.result.errors ) {\n\t\t\t\t\t\t\tmw.donationInterface.validation.showErrors( data.result.errors );\n\t\t\t\t\t\t\treject();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolve( data.session );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t};\n\n\t\t\t\treturn config;\n\n\t\t\tcase GOOGLEPAY_COMPONENT_TYPE:\n\t\t\t\t// for googlepay, additional config is required\n\t\t\t\tvar g_amount = {},\n\t\t\t\t\tg_currency = $( '#currency' ).val(),\n\t\t\t\t\tg_amount_value = $( '#amount' ).val(),\n\t\t\t\t\tlanguagesSupportedByGPayButton = [\n\t\t\t\t\t\t'ar', 'bg', 'ca', 'cs', 'da', 'de', 'en', 'el', 'es', 'et', 'fi', 'fr', 'hr', 'id', 'it', 'ja',\n\t\t\t\t\t\t'ko', 'ms', 'nl', 'no', 'pl', 'pt', 'ru', 'sk', 'sl', 'sr', 'sv', 'th', 'tr', 'uk', 'zh'\n\t\t\t\t\t], baseLanguageCode = checkoutConfig.locale.slice( 0, 2 );\n\t\t\t\tg_amount.currency = g_currency;\n\t\t\t\tg_amount.value = amountInMinorUnits( g_amount_value, g_currency );\n\t\t\t\tconfig.amount = g_amount;\n\t\t\t\tconfig.countryCode = country;\n\t\t\t\tconfig.environment = configFromServer.environment.toUpperCase();\n\t\t\t\tconfig.showPayButton = true;\n\t\t\t\t// When we are showing the form in a language for which Google Pay has no\n\t\t\t\t// translations of their button text, use the plain 'GPay' button rather\n\t\t\t\t// than the 'Donate with GPay' button.\n\t\t\t\tif ( !languagesSupportedByGPayButton.includes( baseLanguageCode ) ) {\n\t\t\t\t\tconfig.buttonType = 'plain';\n\t\t\t\t} else {\n\t\t\t\t\tconfig.buttonType = 'donate';\n\t\t\t\t}\n\t\t\t\tconfig.emailRequired = true;\n\t\t\t\tconfig.billingAddressRequired = true;\n\t\t\t\tconfig.allowedCardNetworks = configFromServer.googleAllowedNetworks;\n\t\t\t\tconfig.billingAddressParameters = {\n\t\t\t\t\tformat: 'FULL'\n\t\t\t\t};\n\t\t\t\t// called gatewayMerchantId but actually our account name with Adyen\n\t\t\t\tconfig.gatewayMerchantId = configFromServer.merchantAccountName;\n\t\t\t\tconfig.merchantId = configFromServer.googleMerchantId;\n\n\t\t\t\tauthPromise = new Promise( ( authResolve ) => {\n\t\t\t\t\tconfig.onAuthorized = function ( response ) {\n\t\t\t\t\t\tconst bContact = response.paymentMethodData.info.billingAddress,\n\t\t\t\t\t\t\textraData = {};\n\t\t\t\t\t\textraData.postal_code = bContact.postalCode;\n\t\t\t\t\t\textraData.state_province = bContact.administrativeArea;\n\t\t\t\t\t\textraData.city = bContact.locality;\n\t\t\t\t\t\textraData.street_address = bContact.address1;\n\t\t\t\t\t\textraData.email = response.email;\n\t\t\t\t\t\textraData.full_name = bContact.name;\n\t\t\t\t\t\textraData.payment_submethod = mapAdyenSubmethod(\n\t\t\t\t\t\t\tresponse.paymentMethodData.info.cardNetwork.toLowerCase()\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// We will combine this contact data with a token from the\n\t\t\t\t\t\t// onSubmit event after both events have fired.\n\t\t\t\t\t\tauthResolve( extraData );\n\t\t\t\t\t};\n\t\t\t\t} );\n\t\t\t\treturn config;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'Component type not found' );\n\t\t}\n\t}\n\n\t/**\n\t * Given an amount in major currency units, e.g. dollars, returns the\n\t * amount in minor units for the currency, e.g. cents. For non-fractional\n\t * currencies just rounds the amount to the nearest whole number.\n\t *\n\t * @param {number} amount\n\t * @param {string} currency\n\t * @return {number} amount in minor units for specified currency\n\t */\n\tfunction amountInMinorUnits( amount, currency ) {\n\t\tconst threeDecimals = mw.config.get( 'DonationInterfaceThreeDecimalCurrencies' ),\n\t\t\tnoDecimals = mw.config.get( 'DonationInterfaceNoDecimalCurrencies' );\n\n\t\tif ( noDecimals.includes( currency ) ) {\n\t\t\treturn Math.round( amount );\n\t\t}\n\t\tif ( threeDecimals.includes( currency ) ) {\n\t\t\treturn Math.round( amount * 1000 );\n\t\t}\n\t\treturn Math.round( amount * 100 );\n\t}\n\n\t/**\n\t * Set up Adyen Checkout object\n\t *\n\t * @param {Object} config requires clientKey, environment, locale,\n\t *  and paymentMethodsResponse\n\t * @return {AdyenCheckout}\n\t */\n\tfunction getCheckout( config ) {\n\t\tconfig.onSubmit = onSubmit;\n\t\tconfig.onAdditionalDetails = onAdditionalDetails;\n\t\tconfig.onError = onError;\n\t\tconfig.showPayButton = false;\n\t\tconst checkoutObject = new AdyenCheckout( config );\n\t\tif ( checkoutObject instanceof Promise ) {\n\t\t\treturn checkoutObject;\n\t\t}\n\n\t\treturn new Promise( ( resolve, reject ) => {\n\t\t\tresolve( checkoutObject );\n\t\t} );\n\t}\n\n\tfunction mapAppleNetworkToSubmethod( network ) {\n\t\tnetwork = network.toLowerCase();\n\t\tswitch ( network ) {\n\t\t\tcase 'amex':\n\t\t\tcase 'discover':\n\t\t\tcase 'jcb':\n\t\t\tcase 'visa':\n\t\t\t\treturn network;\n\t\t\tcase 'cartesbancaires':\n\t\t\t\treturn 'cb';\n\t\t\tcase 'electron':\n\t\t\t\treturn 'visa-electron';\n\t\t\tcase 'mastercard':\n\t\t\t\treturn 'mc';\n\t\t\tdefault:\n\t\t\t\treturn '';\n\t\t}\n\t}\n\n\t/**\n\t * Get the name of the Adyen Checkout component to instantiate\n\t *\n\t * @param {string} paymentMethod our top-level payment method code\n\t * @return {string} name of Adyen Checkout component to instantiate\n\t */\n\tfunction mapPaymentMethodToComponentType( paymentMethod ) {\n\t\tswitch ( paymentMethod ) {\n\t\t\tcase 'dd':\n\t\t\t\treturn 'ach';\n\t\t\tcase 'cc':\n\t\t\t\treturn 'card';\n\t\t\tcase 'rtbt':\n\t\t\t\tif ( mw.config.get( 'payment_submethod' ) === 'sepadirectdebit' ) {\n\t\t\t\t\treturn 'sepadirectdebit';\n\t\t\t\t} else {\n\t\t\t\t\treturn 'ideal';\n\t\t\t\t}\n\t\t\tcase 'bt':\n\t\t\t\treturn 'onlineBanking_CZ';\n\t\t\tcase 'apple':\n\t\t\t\treturn 'applepay';\n\t\t\tcase 'google':\n\t\t\t\treturn GOOGLEPAY_COMPONENT_TYPE;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'paymentMethod not found' );\n\t\t}\n\t}\n\n\t/**\n\t * TODO: should we do this mapping server-side\n\t * using SmashPig's ReferenceData?\n\t *\n\t * @param {string} adyenBrandCode Adyen-side identifier for the payment submethod\n\t * @return {string} Our identifier for the payment submethod\n\t */\n\tfunction mapAdyenSubmethod( adyenBrandCode ) {\n\t\tswitch ( adyenBrandCode ) {\n\t\t\tcase 'bijcard':\n\t\t\t\treturn 'bij';\n\t\t\tcase 'cartebancaire':\n\t\t\t\treturn 'cb';\n\t\t\tcase 'mc-debit':\n\t\t\t\treturn 'mc';\n\t\t\tcase 'visadankort':\n\t\t\t\treturn 'visa';\n\t\t\tcase 'visadebit':\n\t\t\tcase 'vpay':\n\t\t\t\treturn 'visa-debit';\n\t\t\tcase 'visabeneficial':\n\t\t\t\treturn 'visa-beneficial';\n\t\t\tcase 'visaelectron':\n\t\t\t\treturn 'visa-electron';\n\t\t\tcase 'mastercard':\n\t\t\t\treturn 'mc';\n\t\t\tdefault:\n\t\t\t\treturn adyenBrandCode;\n\t\t}\n\t}\n\n\tsubmitPromise = new Promise( ( submitResolve, submitReject ) => {\n\t\tonSubmit = function ( state, component ) {\n\t\t\tlet extraData = {};\n\t\t\t// Submit to our server, unless it's Apple Pay, which submits in\n\t\t\t// the onAuthorized handler.\n\t\t\tif ( mw.donationInterface.validation.validate() && state.isValid ) {\n\t\t\t\tswitch ( payment_method ) {\n\t\t\t\t\tcase 'dd':\n\t\t\t\t\t\textraData = {\n\t\t\t\t\t\t\tencrypted_bank_account_number: state.data.paymentMethod.encryptedBankAccountNumber,\n\t\t\t\t\t\t\tencrypted_bank_location_id: state.data.paymentMethod.encryptedBankLocationId,\n\t\t\t\t\t\t\tfull_name: state.data.paymentMethod.ownerName,\n\t\t\t\t\t\t\tbank_account_type: $( '#bank_account_type' ).val()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif ( ACH_GET_DONOR_ADDRESS ) {\n\t\t\t\t\t\t\textraData.supplemental_address_1 = state.data.billingAddress.houseNumberOrName !== 'N/A' ? state.data.billingAddress.houseNumberOrName : '';\n\t\t\t\t\t\t\textraData.country = state.data.billingAddress.country;\n\t\t\t\t\t\t\textraData.street_address = state.data.billingAddress.street;\n\t\t\t\t\t\t\textraData.postal_code = state.data.billingAddress.postalCode;\n\t\t\t\t\t\t\textraData.city = state.data.billingAddress.city;\n\t\t\t\t\t\t\textraData.state_province = state.data.billingAddress.stateOrProvince;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rtbt':\n\t\t\t\t\t\tswitch ( state.data.paymentMethod.type ) {\n\t\t\t\t\t\t\tcase 'ideal':\n\t\t\t\t\t\t\t\textraData = {\n\t\t\t\t\t\t\t\t\t// issuer is bank chosen from dropdown\n\t\t\t\t\t\t\t\t\tissuer_id: state.data.paymentMethod.issuer,\n\t\t\t\t\t\t\t\t\tpayment_submethod: 'rtbt_ideal'\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'sepadirectdebit':\n\t\t\t\t\t\t\t\textraData = {\n\t\t\t\t\t\t\t\t\tfull_name: state.data.paymentMethod.ownerName,\n\t\t\t\t\t\t\t\t\t// The International Bank Account Number\n\t\t\t\t\t\t\t\t\tiban: state.data.paymentMethod.iban,\n\t\t\t\t\t\t\t\t\tpayment_submethod: 'sepadirectdebit'\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bt':\n\t\t\t\t\t\textraData = {\n\t\t\t\t\t\t\t// issuer is bank chosen from dropdown\n\t\t\t\t\t\t\tissuer_id: state.data.paymentMethod.issuer\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'cc':\n\t\t\t\t\t\textraData = {\n\t\t\t\t\t\t\tencrypted_card_number: state.data.paymentMethod.encryptedCardNumber,\n\t\t\t\t\t\t\tencrypted_expiry_month: state.data.paymentMethod.encryptedExpiryMonth,\n\t\t\t\t\t\t\tencrypted_expiry_year: state.data.paymentMethod.encryptedExpiryYear,\n\t\t\t\t\t\t\tencrypted_security_code: state.data.paymentMethod.encryptedSecurityCode,\n\t\t\t\t\t\t\t// The code should be available in state.data.paymentMethod.brand, but\n\t\t\t\t\t\t\t// sometimes it's not there. We can usually still find it via component.\n\t\t\t\t\t\t\tpayment_submethod: mapAdyenSubmethod(\n\t\t\t\t\t\t\t\tstate.data.paymentMethod.brand || component.state.brand || onBrandSubmethod\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif ( state.data.browserInfo ) {\n\t\t\t\t\t\t\textraData.color_depth = state.data.browserInfo.colorDepth;\n\t\t\t\t\t\t\textraData.java_enabled = state.data.browserInfo.javaEnabled;\n\t\t\t\t\t\t\textraData.screen_height = state.data.browserInfo.screenHeight;\n\t\t\t\t\t\t\textraData.screen_width = state.data.browserInfo.screenWidth;\n\n\t\t\t\t\t\t\t// Ensure timeZoneOffset is always an integer, rounding down if it's a decimal or float.\n\t\t\t\t\t\t\t// See T380741\n\t\t\t\t\t\t\tif ( typeof state.data.browserInfo.timeZoneOffset !== 'undefined' &&\n\t\t\t\t\t\t\t\t!isNaN( Math.floor( state.data.browserInfo.timeZoneOffset ) ) ) {\n\t\t\t\t\t\t\t\textraData.time_zone_offset = Math.floor( state.data.browserInfo.timeZoneOffset );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\textraData.time_zone_offset = state.data.browserInfo.timeZoneOffset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'google':\n\t\t\t\t\t\tsubmitResolve( state.data.paymentMethod.googlePayToken );\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'apple':\n\t\t\t\t\t\t// Resolve the submit promise with the Apple Pay token and bail out - we\n\t\t\t\t\t\t// also need to wait for the onAuthorized event with contact data.\n\t\t\t\t\t\tsubmitResolve( state.data.paymentMethod.applePayToken );\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Allow other scripts (e.g. variants) to provide more data to submit\n\t\t\t\tif ( typeof mw.donationInterface.getExtraData === 'function' ) {\n\t\t\t\t\tObject.assign( extraData, mw.donationInterface.getExtraData() );\n\t\t\t\t}\n\n\t\t\t\tmw.donationInterface.forms.callDonateApi(\n\t\t\t\t\thandleApiResult, extraData, 'di_donate_adyen'\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t} );\n\n\tfunction handleApiResult( result ) {\n\t\tif ( result.isFailed ) {\n\t\t\tlocation.assign( mw.config.get( 'DonationInterfaceFailUrl' ) );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( result.formData && Object.keys( result.formData ).length > 0 ) {\n\t\t\t// FIXME: reconstructing the raw result from the API\n\t\t\t// which has been normalized down to just these two\n\t\t\t// fields. Should we just pass the raw Adyen API result\n\t\t\t// back to the front end? Seems like we would only want\n\t\t\t// a rawResult property on the front-end donation API\n\t\t\t// response when we are damn sure it's sanitized.\n\t\t\tcheckout.createFromAction( {\n\t\t\t\tpaymentMethodType: 'scheme',\n\t\t\t\turl: result.redirect,\n\t\t\t\tdata: result.formData,\n\t\t\t\tmethod: 'POST',\n\t\t\t\ttype: 'redirect'\n\t\t\t} ).mount( '#action-container' );\n\n\t\t// canShowModal() is just a sanity check to see if the required DOM elements\n\t\t// are there.\n\t\t} else if ( mw.monthlyConvert && mw.monthlyConvert.canShowModal() ) {\n\t\t\tmw.monthlyConvert.init();\n\t\t} else if ( result.redirect ) {\n\t\t\tdocument.location.replace( result.redirect );\n\t\t} else {\n\t\t\tdocument.location.replace( mw.config.get( 'DonationInterfaceThankYouPage' ) );\n\t\t}\n\t}\n\n\tfunction onAdditionalDetails( state, dropin ) {\n\t\t// Handle 3D secure\n\t}\n\n\t// T292571 try catch the adyen error, see if any connection been blocked, e.g. iframe\n\tfunction onError( error ) {\n\t\t// Ignore blank string - that means a previous error was cleared up\n\t\tif ( typeof error.error === 'string' && error.error === '' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof error.error === 'string' && error.error.slice( 0, 8 ) === 'error.va' ) {\n\t\t\t// T349600 Log validation error codes only if sf-cc-num.02 donate_interface-error-msg-card-number-do-not-match-card-brand)\n\t\t\t// with date time and time zone for adyen to investigate their card validation js issue\n\t\t\tif ( error.error === 'error.va.sf-cc-num.02' ) {\n\t\t\t\terror.error = 'Adyen error: ' + error.error + ' on ' + new Date().toString();\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\t// handle component error\n\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t} );\n\t\t}\n\t\tthrow error;\n\t}\n\n\tfunction setLocaleAndTranslations( config, localeFromServer ) {\n\t\t// Adyen supports the locales listed below, according to\n\t\t// https://docs.adyen.com/online-payments/classic-integrations/checkout-sdks/web-sdk/customization/localization/\n\t\tconst adyenSupportedLocale = [\n\t\t\t'zh-CN', 'zh-TW', 'hr-HR', 'cs-CZ',\n\t\t\t'da-DK', 'nl-NL', 'en-US', 'fi-FI',\n\t\t\t'fr-FR', 'de-DE', 'el-GR', 'hu-HU',\n\t\t\t'it-IT', 'ja-JP', 'ko-KR', 'no-NO',\n\t\t\t'pl-PL', 'pt-BR', 'ro-RO', 'ru-RU',\n\t\t\t'sk-SK', 'sl-SL', 'es-ES', 'sv-SE'\n\t\t], baseLocaleFromServer = localeFromServer.slice( 0, 2 );\n\n\t\t// We support Norwegian Bokmal (nb) but Adyen's components just support the generic 'no' Norwegian code\n\t\tif ( baseLocaleFromServer === 'nb' ) {\n\t\t\tconfig.locale = 'no-NO';\n\t\t} else {\n\t\t\tconfig.locale = localeFromServer;\n\t\t}\n\n\t\tconfig.translations = {};\n\t\t// Check if donor's language is unsupported by Adyen and we need to provide our own customized translation\n\t\t// Adyen supports ar as Arabic - International and doesn't check the country part\n\t\tif ( baseLocaleFromServer !== 'ar' && !adyenSupportedLocale.includes( config.locale ) ) {\n\t\t\tconfig.translations[ config.locale ] = {\n\t\t\t\t//title\n\t\t\t\t'creditCard.numberField.title': mw.msg( 'donate_interface-credit-card-number' ),\n\t\t\t\t'creditCard.expiryDateField.title': mw.msg( 'donate_interface-credit-card-expiration' ),\n\t\t\t\t'creditCard.cvcField.title': mw.msg( 'donate_interface-cvv' ),\n\t\t\t\t//placeholder\n\t\t\t\t'creditCard.expiryDateField.placeholder': mw.msg( 'donate_interface-expiry-date-field-placeholder' ),\n\t\t\t\t'creditCard.cvcField.placeholder.3digits': mw.msg( 'donate_interface-cvv-placeholder-3-digits' ),\n\t\t\t\t'creditCard.cvcField.placeholder.4digits': mw.msg( 'donate_interface-cvv-placeholder-4-digits' ),\n\t\t\t\t//error\n\t\t\t\t'creditCard.numberField.invalid': mw.msg( 'donate_interface-error-msg-invalid-card-number' ),\n\t\t\t\t'creditCard.expiryDateField.invalid': mw.msg( 'donate_interface-error-msg-expiry-date-field-invalid' ),\n\t\t\t\t'error.va.gen.01': mw.msg( 'donate_interface-error-msg-incomplete-field' ),\n\t\t\t\t'error.va.gen.02': mw.msg( 'donate_interface-error-msg-field-not-valid' ),\n\t\t\t\t'error.va.sf-cc-num.01': mw.msg( 'donate_interface-error-msg-invalid-card-number' ),\n\t\t\t\t'error.va.sf-cc-num.02': mw.msg( 'donate_interface-error-msg-card-number-do-not-match-card-brand' ),\n\t\t\t\t'error.va.sf-cc-num.03': mw.msg( 'donate_interface-error-msg-unsupported-card-entered' ),\n\t\t\t\t'error.va.sf-cc-dat.01': mw.msg( 'donate_interface-error-msg-card-too-old' ),\n\t\t\t\t'error.va.sf-cc-dat.02': mw.msg( 'donate_interface-error-msg-date-too-far-in-the-future' )\n\t\t\t};\n\t\t} else if ( config.locale === 'nl-NL' ) {\n\t\t\tconfig.translations[ config.locale ] = {\n\t\t\t\t'idealIssuer.selectField.placeholder': mw.msg( 'donate_interface-rtbt-issuer_id' )\n\t\t\t};\n\t\t} else if ( language === 'ja' ) {\n\t\t\tconfig.translations[ config.locale ] = {\n\t\t\t\t'creditCard.expiryDateField.placeholder': mw.msg( 'donate_interface-expiry-date-field-placeholder' ),\n\t\t\t\t'creditCard.cvcField.placeholder.3digits': '',\n\t\t\t\t'creditCard.cvcField.placeholder.4digits': ''\n\t\t\t};\n\t\t} else {\n\t\t\tconfig.translations[ config.locale ] = {};\n\t\t}\n\t\tif ( mw.config.get( 'payment_submethod' ) === 'ach' ) {\n\t\t\tconfig.translations[ config.locale ] = {\n\t\t\t\t'error.va.sf-ach-loc.02': mw.msg( 'donate_interface-ach-invalid-routing-number-count' ),\n\t\t\t\t'error.va.sf-ach-num.02': mw.msg( 'donate_interface-ach-invalid-account-number-count' )\n\t\t\t};\n\t\t}\n\n\t\t// if sepa, update holder name to account holder name\n\t\tif ( mw.config.get( 'payment_submethod' ) === 'sepadirectdebit' ) {\n\t\t\tconfig.translations[ config.locale ][ 'sepa.ownerName' ] = mw.msg( 'donate_interface-bt-account_holder' );\n\t\t}\n\t\t// Allow other scripts (e.g. variants) to provide more translations to the Adyen components\n\t\tif ( mw.donationInterface.extraTranslations ) {\n\t\t\tObject.assign( config.translations[ config.locale ], mw.donationInterface.extraTranslations );\n\t\t}\n\t}\n\n\t/**\n\t * Runs as soon as the external Adyen checkout script is loaded\n\t */\n\tfunction setup() {\n\t\tlet component_type,\n\t\t\tconfig,\n\t\t\tcontainerName = 'component-container',\n\t\t\toldShowErrors,\n\t\t\tcheckoutPromise;\n\n\t\tcomponent_type = mapPaymentMethodToComponentType( payment_method );\n\n\t\t// Drop in the adyen components placeholder container\n\t\t$( '.submethods' ).before(\n\t\t\t'<div id=\"' + containerName + '\" />'\n\t\t).before(\n\t\t\t'<div id=\"action-container\" />'\n\t\t);\n\n\t\t// add name placeholder for ja JP\n\t\tif ( language === 'ja' ) {\n\t\t\t$( '#last_name' ).attr( 'placeholder', '鈴木' );\n\t\t\t$( '#first_name' ).attr( 'placeholder', '太郎' );\n\t\t}\n\n\t\t// Override validation's showErrors function to add error\n\t\t// highlights to the outer div around the secure field iframe.\n\t\t// FIXME: cleaner object-oriented JS with inheritance would\n\t\t// make this prettier. See https://phabricator.wikimedia.org/T293287\n\t\toldShowErrors = mw.donationInterface.validation.showErrors;\n\t\tmw.donationInterface.validation.showErrors = function ( errors ) {\n\t\t\tlet adyenFieldName;\n\t\t\t$.each( errors, ( field ) => {\n\t\t\t\tadyenFieldName = false;\n\t\t\t\tif ( field === 'card_num' || field === 'encrypted_card_number' ) {\n\t\t\t\t\tadyenFieldName = 'encryptedCardNumber';\n\t\t\t\t} else if ( field === 'encrypted_expiry_month' || field === 'encrypted_expiry_year' ) {\n\t\t\t\t\tadyenFieldName = 'encryptedExpiryDate';\n\t\t\t\t} else if ( field === 'cvv' ) {\n\t\t\t\t\tadyenFieldName = 'encryptedSecurityCode';\n\t\t\t\t}\n\t\t\t\tif ( adyenFieldName ) {\n\t\t\t\t\t$( 'span[data-cse=' + adyenFieldName + ']' )\n\t\t\t\t\t\t.closest( '.adyen-checkout__input-wrapper' )\n\t\t\t\t\t\t.addClass( 'errorHighlight' );\n\t\t\t\t}\n\t\t\t} );\n\t\t\toldShowErrors( errors );\n\t\t};\n\n\t\t// Copy values to leave the mw.config setting untouched\n\t\tconfig = {\n\t\t\tclientKey: configFromServer.clientKey,\n\t\t\tenvironment: configFromServer.environment,\n\t\t\tpaymentMethodsResponse: configFromServer.paymentMethodsResponse\n\t\t};\n\n\t\tsetLocaleAndTranslations( config, configFromServer.locale );\n\n\t\tcheckoutPromise = getCheckout( config );\n\t\tcheckoutPromise.then( ( checkoutObject ) => {\n\t\t\tcheckout = checkoutObject;\n\t\t\tcreateAndMountComponent( config, component_type, containerName );\n\t\t} );\n\t}\n\n\tfunction createAndMountComponent( config, component_type, containerName ) {\n\t\tconst component_config = getComponentConfig( component_type, config ),\n\t\t\tcomponent = checkout.create( component_type, component_config );\n\n\t\tif ( component_type === GOOGLEPAY_COMPONENT_TYPE ) {\n\t\t\tcomponent.isAvailable().then( () => {\n\t\t\t\tcomponent.mount( '#' + containerName );\n\t\t\t} ).catch( () => {\n\t\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\t\tgeneral: mw.message(\n\t\t\t\t\t\t'donate_interface-error-msg-google_pay_unsupported',\n\t\t\t\t\t\tmw.config.get( 'DonationInterfaceOtherWaysURL' )\n\t\t\t\t\t).plain()\n\t\t\t\t} );\n\t\t\t} );\n\t\t\t// For Google Pay, we need contact data from the onAuthorized event and token\n\t\t\t// data from the onSubmit event before we can make our MediaWiki API call.\n\t\t\tPromise.all( [ submitPromise, authPromise ] ).then( ( values ) => {\n\t\t\t\tconst extraData = values[ 1 ];\n\t\t\t\textraData.payment_token = values[ 0 ];\n\t\t\t\tmw.donationInterface.forms.callDonateApi(\n\t\t\t\t\thandleApiResult, extraData, 'di_donate_adyen'\n\t\t\t\t);\n\t\t\t} ).catch( ( err ) => {\n\t\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t\t} );\n\t\t\t\t// Let error bubble up to window.onerror handler so the errorLog\n\t\t\t\t// module sends it to our client-side logging endpoint.\n\t\t\t\tthrow err;\n\t\t\t} );\n\t\t} else if ( component_type === 'applepay' ) {\n\t\t\tcomponent.isAvailable().then( () => {\n\t\t\t\tcomponent.mount( '#' + containerName );\n\t\t\t} ).catch( () => {\n\t\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\t\tgeneral: mw.message(\n\t\t\t\t\t\t'donate_interface-error-msg-apple_pay_unsupported',\n\t\t\t\t\t\tmw.config.get( 'DonationInterfaceOtherWaysURL' )\n\t\t\t\t\t).plain()\n\t\t\t\t} );\n\t\t\t} );\n\t\t\t// For Apple Pay, we need contact data from the onAuthorized event and token\n\t\t\t// data from the onSubmit event before we can make our MediaWiki API call.\n\t\t\tPromise.all( [ submitPromise, authPromise ] ).then( ( values ) => {\n\t\t\t\tconst extraData = values[ 1 ];\n\t\t\t\textraData.payment_token = values[ 0 ];\n\t\t\t\tmw.donationInterface.forms.callDonateApi(\n\t\t\t\t\thandleApiResult, extraData, 'di_donate_adyen'\n\t\t\t\t);\n\t\t\t} ).catch( ( err ) => {\n\t\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t\t} );\n\t\t\t\t// Let error bubble up to window.onerror handler so the errorLog\n\t\t\t\t// module sends it to our client-side logging endpoint.\n\t\t\t\tthrow err;\n\t\t\t} );\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tcomponent.mount( '#' + containerName );\n\t\t\t} catch ( err ) {\n\t\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t\t} );\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\t// For everything except Apple and google\n\t\t\t// Pay, show our standard 'Donate' button\n\t\t\t$( '#paymentSubmit' ).show();\n\t\t\t$( '#paymentSubmitBtn' ).click( mw.util.debounce( ( evt ) => {\n\t\t\t\tcomponent.submit( evt );\n\t\t\t}, 100 ) );\n\t\t}\n\t}\n\n\t/**\n\t * On documentready we create a script tag and wire it up to run setup as soon as it\n\t * is loaded, or to show an error message if the external script can't be loaded.\n\t * The script should already be mostly or completely preloaded at this point, thanks\n\t * to a <link rel=preload> we add in AdyenCheckoutGateway::addGatewaySpecificResources\n\t */\n\n\tfunction loadScript( type ) {\n\t\tconst scriptNode = document.createElement( 'script' );\n\t\tscriptNode.onerror = function () {\n\t\t\tmw.donationInterface.validation.showErrors(\n\t\t\t\t{ general: 'Could not load payment provider Javascript. Please reload or try again later.' }\n\t\t\t);\n\t\t};\n\t\tif ( type === 'adyen' ) {\n\t\t\tscriptNode.onload = setup;\n\t\t\tscriptNode.crossOrigin = 'anonymous';\n\t\t\tscriptNode.integrity = configFromServer.script.integrity;\n\t\t\tscriptNode.src = configFromServer.script.src;\n\t\t} else {\n\t\t\tscriptNode.src = configFromServer.googleScript;\n\t\t}\n\n\t\tdocument.body.append( scriptNode );\n\t}\n\n\t$( () => {\n\t\tif ( !configFromServer ) {\n\t\t\t// If the configuration has not been passed from the server, we are likely on the\n\t\t\t// ResultSwitcher page and have just been loaded incidentally to make a form for\n\t\t\t// a backdrop of the monthly convert popup. As the rest of this function is only\n\t\t\t// needed to set up payment widgets which will not be needed here, just quit.\n\t\t\t// It might be better to stop loading adyen.js in that situation, but that's a\n\t\t\t// bigger refactor than we want to do right now.\n\t\t\treturn;\n\t\t}\n\t\tif ( payment_method === 'google' ) {\n\t\t\tloadScript( 'google' );\n\t\t}\n\t\tloadScript( 'adyen' );\n\t} );\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/amazon_gateway/amazon.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'clientId' is never reassigned. Use 'const' instead.","line":3,"column":6,"nodeType":"Identifier","messageId":"useConst","endLine":3,"endColumn":14},{"ruleId":"prefer-const","severity":1,"message":"'sellerId' is never reassigned. Use 'const' instead.","line":4,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":4,"endColumn":11},{"ruleId":"prefer-const","severity":1,"message":"'sandbox' is never reassigned. Use 'const' instead.","line":5,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":5,"endColumn":10},{"ruleId":"prefer-const","severity":1,"message":"'returnUrl' is never reassigned. Use 'const' instead.","line":6,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":6,"endColumn":12},{"ruleId":"prefer-const","severity":1,"message":"'widgetScript' is never reassigned. Use 'const' instead.","line":7,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":7,"endColumn":15},{"ruleId":"prefer-const","severity":1,"message":"'loginScript' is never reassigned. Use 'const' instead.","line":8,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":8,"endColumn":14},{"ruleId":"prefer-const","severity":1,"message":"'failPage' is never reassigned. Use 'const' instead.","line":9,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":9,"endColumn":11},{"ruleId":"prefer-const","severity":1,"message":"'isRecurring' is never reassigned. Use 'const' instead.","line":10,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":10,"endColumn":14},{"ruleId":"prefer-const","severity":1,"message":"'validTokenPattern' is never reassigned. Use 'const' instead.","line":14,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":14,"endColumn":20},{"ruleId":"prefer-regex-literals","severity":1,"message":"Use a regular expression literal instead of the 'RegExp' constructor.","line":14,"column":23,"nodeType":"NewExpression","messageId":"unexpectedRegExp","endLine":14,"endColumn":44,"suggestions":[{"messageId":"replaceWithLiteral","fix":{"range":[598,619],"text":"/^Atza/"},"desc":"Replace with an equivalent regular expression literal."}]},{"ruleId":"prefer-const","severity":1,"message":"'CARD_SELECT_DELAY' is never reassigned. Use 'const' instead.","line":22,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":22,"endColumn":20},{"ruleId":"prefer-const","severity":1,"message":"'accessToken' is never reassigned. Use 'const' instead.","line":98,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":98,"endColumn":13},{"ruleId":"prefer-const","severity":1,"message":"'loginError' is never reassigned. Use 'const' instead.","line":99,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":99,"endColumn":12},{"ruleId":"no-jquery/no-sizzle","severity":1,"message":"Selector extensions are not allowed","line":268,"column":8,"nodeType":"CallExpression","endLine":268,"endColumn":45}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":14,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/*global amazon:true, OffAmazonPayments:true*/\n( function ( $, mw ) {\n\tlet clientId = mw.config.get( 'wgAmazonGatewayClientID' ),\n\t\tsellerId = mw.config.get( 'wgAmazonGatewaySellerID' ),\n\t\tsandbox = mw.config.get( 'wgAmazonGatewaySandbox' ),\n\t\treturnUrl = mw.config.get( 'wgAmazonGatewayReturnURL' ),\n\t\twidgetScript = mw.config.get( 'wgAmazonGatewayWidgetScript' ),\n\t\tloginScript = mw.config.get( 'wgAmazonGatewayLoginScript' ),\n\t\tfailPage = mw.config.get( 'wgAmazonGatewayFailPage' ),\n\t\tisRecurring = $( '#recurring' ).val(),\n\t\tloggedIn = false,\n\t\tloginError,\n\t\taccessToken,\n\t\tvalidTokenPattern = new RegExp( '^Atza' ),\n\t\tbillingAgreementId,\n\t\torderReferenceId,\n\t\trecurConsentGranted = false,\n\t\tcardSelected = false,\n\t\tcardSelectTimeout,\n\t\t// If no card selected after this long, show link to other ways to give\n\t\t// in case the donor has no cards registered with Amazon\n\t\tCARD_SELECT_DELAY = 5000;\n\n\t$( () => {\n\t\t// Add a couple divs to hold the widgets\n\t\t$( '.submethods' ).before(\n\t\t\t'<div id=\"consentWidget\" />' +\n\t\t\t'<div id=\"walletWidget\" />' +\n\t\t\t'<div id=\"amazonLogin\" />'\n\t\t);\n\t\t// Set the click handler\n\t\t$( '#paymentSubmitBtn' ).click( submitPayment );\n\t} );\n\n\t// Adapted from Amazon documentation, will get parameters from fragment as\n\t// well as querystring and accepts Amazon's custom delimiters\n\tfunction getURLParameter( name, source ) {\n\t\tconst pattern = '[?&#]' + name + '=([^&;#]*)',\n\t\t\tmatches = new RegExp( pattern ).exec( source ) || [ '', '' ],\n\t\t\tvalue = matches[ 1 ].replace( /\\+/g, '%20' );\n\n\t\treturn decodeURIComponent( value ) || null;\n\t}\n\n\tfunction loadScript( url ) {\n\t\tconst a = document.createElement( 'script' );\n\t\ta.type = 'text/javascript';\n\t\ta.async = true;\n\t\ta.src = url;\n\t\tdocument.head.appendChild( a );\n\t}\n\n\tfunction redirectToLogin() {\n\t\t$( '#overlay' ).show();\n\t\tconst loginOptions = {\n\t\t\tscope: 'payments:widget',\n\t\t\tpopup: false\n\t\t};\n\t\tamazon.Login.authorize( loginOptions, returnUrl );\n\t}\n\n\tfunction addErrorMessage( message ) {\n\t\t$( '#topError' ).append(\n\t\t\t$( '<p class=\"error\">' + message + '</p>' )\n\t\t);\n\t\t$( '#errorReference' )\n\t\t\t.removeClass( 'errorMsgHide' )\n\t\t\t.addClass( 'errorMsg' );\n\t}\n\n\tfunction reloadPage() {\n\t\tconst qsParams = $( '#payment-form' ).serializeArray();\n\t\tdocument.location.replace( mw.util.getUrl( 'Special:AmazonGateway', qsParams ) );\n\t}\n\n\tfunction showErrorAndLoginButton( message ) {\n\t\tif ( message ) {\n\t\t\taddErrorMessage( message );\n\t\t}\n\t\tOffAmazonPayments.Button(\n\t\t\t'amazonLogin',\n\t\t\tsellerId,\n\t\t\t{\n\t\t\t\ttype: 'PwA',\n\t\t\t\tcolor: 'Gold',\n\t\t\t\tsize: 'large',\n\t\t\t\tauthorization: reloadPage\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction tokenExpired() {\n\t\t// Re-create widget so it displays timeout error message\n\t\tcreateWalletWidget();\n\t\tshowErrorAndLoginButton();\n\t}\n\n\taccessToken = getURLParameter( 'access_token', location.hash );\n\tloginError = getURLParameter( 'error', location.search );\n\n\t// This will be called as soon as the login script is loaded\n\twindow.onAmazonLoginReady = function () {\n\n\t\tamazon.Login.setClientId( clientId );\n\t\tamazon.Login.setUseCookie( true );\n\t\tamazon.Login.setSandboxMode( sandbox );\n\t\tif ( !loggedIn ) {\n\t\t\tif ( loginError ) {\n\t\t\t\tshowErrorAndLoginButton(\n\t\t\t\t\tgetURLParameter( 'error_description', location.search )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tredirectToLogin();\n\t\t\t}\n\t\t}\n\t};\n\n\twindow.onAmazonPaymentsReady = function () {\n\t\tlet tokenLifetime;\n\t\tif ( loggedIn ) {\n\t\t\ttokenLifetime = parseInt( getURLParameter( 'expires_in', location.hash ), 10 );\n\t\t\tcreateWalletWidget();\n\t\t\tsetTimeout( tokenExpired, tokenLifetime * 1000 );\n\t\t}\n\t};\n\n\tif ( typeof accessToken === 'string' && accessToken.match( validTokenPattern ) ) {\n\t\t// Payment widgets need this cookie\n\t\tdocument.cookie = 'amazon_Login_accessToken=' + accessToken + ';secure';\n\t\tloggedIn = true;\n\t\tloadScript( widgetScript ); // This will load the login script for you\n\t} else {\n\t\tif ( loginError ) {\n\t\t\t// Load the full widget script to display a button\n\t\t\tloadScript( widgetScript );\n\t\t} else {\n\t\t\t// The first time around, only load the login script.\n\t\t\tloadScript( loginScript );\n\t\t}\n\t}\n\n\tfunction showOtherWaysLink() {\n\t\tconst url = mw.config.get( 'wgAmazonGatewayOtherWaysURL' ),\n\t\t\ttext = mw.message( 'donate_interface-otherways-short' );\n\t\taddErrorMessage( '<a href=\"' + url + '\">' + text + '</a>' );\n\t}\n\n\tfunction setSubmitVisibility() {\n\t\tlet show = true;\n\t\tif ( !cardSelected ) {\n\t\t\tshow = false;\n\t\t}\n\t\tif ( isRecurring && !recurConsentGranted ) {\n\t\t\tshow = false;\n\t\t}\n\t\tif ( show ) {\n\t\t\t$( '#paymentSubmit' ).show();\n\t\t} else {\n\t\t\t$( '#paymentSubmit' ).hide();\n\t\t}\n\t}\n\n\tfunction createWalletWidget() {\n\t\tconst params = {\n\t\t\tsellerId: sellerId,\n\t\t\tonReady: function ( billingAgreement ) {\n\t\t\t\tif ( !cardSelected ) {\n\t\t\t\t\tcardSelectTimeout = setTimeout( showOtherWaysLink, CARD_SELECT_DELAY );\n\t\t\t\t}\n\t\t\t\tif ( !billingAgreementId ) {\n\t\t\t\t\tbillingAgreementId = billingAgreement.getAmazonBillingAgreementId();\n\t\t\t\t\tif ( isRecurring ) {\n\t\t\t\t\t\tcreateConsentWidget();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tagreementType: isRecurring ? 'BillingAgreement' : 'OrderReference',\n\t\t\tonOrderReferenceCreate: function ( orderReference ) {\n\t\t\t\tif ( orderReferenceId ) {\n\t\t\t\t\t// Redisplaying for an existing order, no need to continue\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\torderReferenceId = orderReference.getAmazonOrderReferenceId();\n\t\t\t},\n\t\t\tonPaymentSelect: function () {\n\t\t\t\tif ( !cardSelected ) {\n\t\t\t\t\tcardSelected = true;\n\t\t\t\t\tsetSubmitVisibility();\n\t\t\t\t}\n\t\t\t\tif ( cardSelectTimeout ) {\n\t\t\t\t\tclearTimeout( cardSelectTimeout );\n\t\t\t\t\tcardSelectTimeout = false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdesign: {\n\t\t\t\tdesignMode: 'responsive'\n\t\t\t},\n\t\t\tonError: function ( error ) {\n\t\t\t\t// Error message appears directly in widget\n\t\t\t\tshowErrorAndLoginButton();\n\t\t\t}\n\t\t};\n\t\t// If we are refreshing the widget to display a correctable error,\n\t\t// we need to set the Amazon order reference ID for continuity\n\t\tif ( orderReferenceId ) {\n\t\t\tparams.amazonOrderReferenceId = orderReferenceId;\n\t\t}\n\t\tif ( billingAgreementId ) {\n\t\t\tparams.amazonBillingAgreementId = billingAgreementId;\n\t\t}\n\t\tnew OffAmazonPayments.Widgets.Wallet( params ).bind( 'walletWidget' );\n\t}\n\n\tfunction handleConsentStatus( billingAgreementConsentStatus ) {\n\t\t// getConsentStatus returns a string for some reason\n\t\trecurConsentGranted =\n\t\t\t( billingAgreementConsentStatus.getConsentStatus() === 'true' );\n\t\tsetSubmitVisibility();\n\t}\n\n\tfunction createConsentWidget() {\n\t\tconst params = {\n\t\t\tsellerId: sellerId,\n\t\t\tamazonBillingAgreementId: billingAgreementId,\n\t\t\tdesign: {\n\t\t\t\tdesignMode: 'responsive'\n\t\t\t},\n\t\t\tonReady: handleConsentStatus,\n\t\t\tonConsent: handleConsentStatus,\n\t\t\tonError: function ( error ) {\n\t\t\t\tshowErrorAndLoginButton();\n\t\t\t}\n\t\t};\n\t\t$( '#consentWidget' ).show();\n\t\tnew OffAmazonPayments.Widgets.Consent( params ).bind( 'consentWidget' );\n\t}\n\n\tfunction handleErrors( errors ) {\n\t\tlet code,\n\t\t\trefreshWallet = false;\n\n\t\tfor ( code in errors ) {\n\t\t\tif ( !Object.prototype.hasOwnProperty.call( errors, code ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( code === 'token-mismatch' ) {\n\t\t\t\t// Session has expired, we need to reload the whole page.\n\t\t\t\t// FIXME: something nicer than an alert box\n\t\t\t\talert( errors[ code ] );\n\t\t\t\treloadPage();\n\t\t\t}\n\t\t\taddErrorMessage( errors[ code ] );\n\t\t\tif ( code === 'InvalidPaymentMethod' ) {\n\t\t\t\t// Card declined, but they can try another\n\t\t\t\trefreshWallet = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( refreshWallet ) {\n\t\t\t// Redisplay the widget to show an error and let the donor pick a different card\n\t\t\tcardSelected = false;\n\t\t\tsetSubmitVisibility();\n\t\t\tcreateWalletWidget();\n\t\t}\n\t}\n\n\tfunction lockDonationAmount() {\n\t\tif ( $( '#amount_input' ).is( ':visible' ) ) {\n\t\t\t$( '#amount_input' ).hide();\n\t\t\t$( '#selected-amount' )\n\t\t\t\t.text( $( '#amount' ).val() + ' ' + $( '#currency' ).val() )\n\t\t\t\t.show();\n\t\t}\n\t}\n\n\tfunction submitPayment() {\n\t\tif ( !mw.donationInterface.validation.validateAmount() ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( !cardSelected ) {\n\t\t\tshowOtherWaysLink();\n\t\t\treturn;\n\t\t}\n\t\tif ( isRecurring && !recurConsentGranted ) {\n\t\t\t//TODO: error message\n\t\t\treturn;\n\t\t}\n\t\t$( '#topError' ).html( '' );\n\t\t$( '#errorReference' )\n\t\t\t.removeClass( 'errorMsg' )\n\t\t\t.addClass( 'errorMsgHide' );\n\t\t$( '#overlay' ).show();\n\t\tlockDonationAmount();\n\t\tconst postdata = {\n\t\t\taction: 'di_amazon_bill',\n\t\t\tformat: 'json',\n\t\t\trecurring: isRecurring,\n\t\t\tamount: $( '#amount' ).val(),\n\t\t\tcurrency: $( '#currency' ).val(),\n\t\t\twmf_token: $( '#wmf_token' ).val()\n\t\t};\n\n\t\tif ( isRecurring ) {\n\t\t\tpostdata.billingAgreementId = billingAgreementId;\n\t\t} else {\n\t\t\tpostdata.orderReferenceId = orderReferenceId;\n\t\t}\n\n\t\t$.ajax( {\n\t\t\turl: mw.util.wikiScript( 'api' ),\n\t\t\tdata: postdata,\n\t\t\tdataType: 'json',\n\t\t\ttype: 'POST',\n\t\t\tsuccess: function ( data ) {\n\t\t\t\tif ( data.errors ) {\n\t\t\t\t\t$( '#overlay' ).hide();\n\t\t\t\t\thandleErrors( data.errors );\n\t\t\t\t} else if ( data.redirect ) {\n\t\t\t\t\tlocation.href = data.redirect;\n\t\t\t\t} else {\n\t\t\t\t\tlocation.href = failPage;\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function () {\n\t\t\t\tlocation.href = failPage;\n\t\t\t}\n\t\t} );\n\t}\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/braintree_gateway/forms/braintree.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'di' is never reassigned. Use 'const' instead.","line":10,"column":6,"nodeType":"Identifier","messageId":"useConst","endLine":10,"endColumn":8},{"ruleId":"prefer-const","severity":1,"message":"'payment_method' is never reassigned. Use 'const' instead.","line":12,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":12,"endColumn":17}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/*global braintree:true, paypal:true*/\n( function ( $, mw ) {\n\t/* Paypal iFrame comes with a zIndex of 100. Inorder to stack the autocomplete\n\tmenu above the Paypal button, we need to set the zIndex to be at least a step higher.\n\tThe mediawiki library for the menu item sets the autocomplete menu zIndex to 1 step higher\n\tthan the parents zIndex here: resources/lib/jquery.ui/jquery.ui.autocomplete.js::484\n\t */\n\t$( '#employer' ).css( { position: 'relative', zIndex: 100 } );\n\n\tlet di = mw.donationInterface,\n\t\tmyDeviceData,\n\t\tpayment_method = $( '#payment_method' ).val();\n\n\t$( '.submethods' ).before( '<div id=\"' + payment_method + '-button\"></div>' );\n\n\tfunction handleApiResult( result ) {\n\t\tif ( result.isFailed ) {\n\t\t\tdocument.location.replace( mw.config.get( 'DonationInterfaceFailUrl' ) );\n\t\t} else if ( mw.monthlyConvert && mw.monthlyConvert.canShowModal() ) {\n\t\t\tmw.monthlyConvert.init();\n\t\t} else {\n\t\t\tdocument.location.replace( mw.config.get( 'DonationInterfaceThankYouPage' ) );\n\t\t}\n\t}\n\n\t// render error Message to client\n\tfunction showClientSideErrorMessage( msg ) {\n\t\t$( '.errorMsg' ).remove();\n\t\t$( '#errorReference' ).html( '' );\n\t\t$( '#topError' ).html( msg );\n\t}\n\n\t// myDeviceData will supply device data for non-recurring vault trxns\n\t// see https://developer.paypal.com/braintree/docs/guides/paypal/vault#collecting-device-data\n\t// https://developer.paypal.com/braintree/docs/guides/premium-fraud-management-tools/device-data-collection/javascript/v3/#collecting-device-data\n\tfunction getDeviceData( clientInstance ) {\n\t\tbraintree.dataCollector.create( {\n\t\t\tclient: clientInstance\n\t\t} ).then( ( dataCollectorInstance ) => {\n\t\t\t// At this point, you should access the dataCollectorInstance.deviceData value and provide it\n\t\t\t// to your server, e.g. by injecting it into your form as a hidden input\n\t\t\tmyDeviceData = dataCollectorInstance.deviceData;\n\t\t} ).catch( ( err ) => {\n\t\t\tshowClientSideErrorMessage( 'Device data error' + err );\n\t\t} );\n\t}\n\n\t// Create a client.\n\tif ( payment_method === 'paypal' ) {\n\t\tbraintree.client.create( {\n\t\t\tauthorization: mw.config.get( 'clientToken' )\n\t\t} ).then( ( clientInstance ) => {\n\t\t\tgetDeviceData( clientInstance );\n\t\t\t// Create a PayPal Checkout component.\n\t\t\treturn braintree.paypalCheckout.create( {\n\t\t\t\tclient: clientInstance\n\t\t\t} );\n\t\t} ).then( ( paypalCheckoutInstance ) => paypalCheckoutInstance.loadPayPalSDK( {\n\t\t\t\tvault: true\n\t\t\t} ) ).then( ( paypalCheckoutInstance ) => paypal.Buttons( {\n\t\t\t\tfundingSource: paypal.FUNDING.PAYPAL,\n\n\t\t\t\tcreateBillingAgreement: function () {\n\t\t\t\t\treturn paypalCheckoutInstance.createPayment( {\n\t\t\t\t\t\tflow: 'vault' // Required\n\t\t\t\t\t} );\n\t\t\t\t},\n\n\t\t\t\tonApprove: function ( data, actions ) {\n\t\t\t\t\treturn paypalCheckoutInstance.tokenizePayment( data ).then( ( payload ) => {\n\t\t\t\t\t\tconst sendData = {\n\t\t\t\t\t\t\tpayment_token: payload.nonce,\n\t\t\t\t\t\t\tdevice_data: myDeviceData,\n\t\t\t\t\t\t\tfirst_name: payload.details.firstName,\n\t\t\t\t\t\t\tlast_name: payload.details.lastName,\n\t\t\t\t\t\t\temail: payload.details.email,\n\t\t\t\t\t\t\tstreet_address: payload.details.shippingAddress\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tdi.forms.callDonateApi(\n\t\t\t\t\t\t\thandleApiResult, sendData, 'di_donate_braintree'\n\t\t\t\t\t\t);\n\t\t\t\t\t} );\n\t\t\t\t},\n\n\t\t\t\tonCancel: function ( data ) {\n\t\t\t\t\tshowClientSideErrorMessage( 'PayPal payment canceled' + JSON.stringify( data, 0, 2 ) );\n\t\t\t\t},\n\n\t\t\t\tonError: function ( err ) {\n\t\t\t\t\tshowClientSideErrorMessage( 'PayPal error' + err );\n\t\t\t\t}\n\t\t\t} ).render( '#paypal-button' ) ).then( () => {\n\t\t\t// The PayPal button will be rendered in an html element with the ID\n\t\t\t// `paypal-button`. This function will be called when the PayPal button\n\t\t\t// is set up and ready to be used\n\t\t} ).catch( ( err ) => {\n\t\t\t// Handle component creation error\n\t\t\tshowClientSideErrorMessage( 'component creation error: ' + err );\n\t\t} );\n\t} else if ( payment_method === 'venmo' ) {\n\t\tconst venmoButton = document.getElementById( 'venmo-button' );\n\t\tbraintree.client.create( {\n\t\t\tauthorization: mw.config.get( 'clientToken' )\n\t\t} ).then( ( clientInstance ) => {\n\t\t\tgetDeviceData( clientInstance );\n\t\t\t// Create a Venmo component.\n\t\t\treturn braintree.venmo.create( {\n\t\t\t\tclient: clientInstance,\n\t\t\t\tallowDesktop: true,\n\t\t\t\tmobileWebFallBack: true,\n\t\t\t\tallowNewBrowserTab: false,\n\t\t\t\tallowDesktopWebLogin: true, // force web login, QR code depreciate\n\t\t\t\tpaymentMethodUsage: $( '#recurring' ).val() === '1' ? 'multi_use' : 'single_use'\n\t\t\t} );\n\t\t} ).then( ( venmoInstance ) => {\n\t\t\t// Verify browser support before proceeding.\n\t\t\tif ( !venmoInstance.isBrowserSupported() ) {\n\t\t\t\tshowClientSideErrorMessage( 'Browser does not support Venmo' );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfunction handleVenmoError( err ) {\n\t\t\t\tif ( err.code === 'VENMO_CANCELED' ) {\n\t\t\t\t\tshowClientSideErrorMessage( 'App is not available or user aborted payment flow' );\n\t\t\t\t} else if ( err.code === 'VENMO_APP_CANCELED' ) {\n\t\t\t\t\tshowClientSideErrorMessage( 'User canceled payment flow' );\n\t\t\t\t} else {\n\t\t\t\t\tshowClientSideErrorMessage( err.message );\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction handleVenmoSuccess( payload ) {\n\t\t\t\tconst sendData = {\n\t\t\t\t\tpayment_token: payload.nonce,\n\t\t\t\t\tdevice_data: myDeviceData,\n\t\t\t\t\tuser_name: payload.details.username,\n\t\t\t\t\tgateway_session_id: payload.details.paymentContextId\n\t\t\t\t};\n\t\t\t\t// payload.details.payerInfo is undefined for non-us sandbox account\n\t\t\t\tif ( payload.details.payerInfo ) {\n\t\t\t\t\tsendData.first_name = payload.details.payerInfo.firstName;\n\t\t\t\t\tsendData.last_name = payload.details.payerInfo.lastName;\n\t\t\t\t\tsendData.phone = payload.details.payerInfo.phoneNumber;\n\t\t\t\t\tsendData.email = payload.details.payerInfo.email;\n\t\t\t\t\tsendData.street_address = payload.details.payerInfo.shippingAddress;\n\t\t\t\t\tsendData.customer_id = payload.details.payerInfo.externalId;\n\t\t\t\t} else {\n\t\t\t\t\t// todo:: either retokenize it or insert a email field for user to fill in, but let's wait for venmo's response\n\t\t\t\t}\n\t\t\t\tdi.forms.callDonateApi(\n\t\t\t\t\thandleApiResult, sendData, 'di_donate_braintree'\n\t\t\t\t);\n\t\t\t}\n\t\t\tfunction displayVenmoButton() {\n\t\t\t\tvenmoButton.style.display = 'block';\n\t\t\t\tvenmoButton.addEventListener( 'click', () => {\n\t\t\t\t\tvenmoButton.disabled = true;\n\t\t\t\t\tvenmoInstance.tokenize().then( handleVenmoSuccess ).catch( handleVenmoError ).then( () => {\n\t\t\t\t\t\tvenmoButton.removeAttribute( 'disabled' );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\t\t\tdisplayVenmoButton();\n\t\t} ).catch( ( err ) => {\n\t\t\tshowClientSideErrorMessage( 'Error creating Venmo:' + err );\n\t\t} );\n\t}\n\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/composer.json","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"no-extra-parens","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/dlocal_gateway/forms/dlocal.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'dlocalInstance' is never reassigned. Use 'const' instead.","line":27,"column":7,"nodeType":"Identifier","messageId":"useConst","endLine":27,"endColumn":21},{"ruleId":"prefer-const","severity":1,"message":"'fields' is never reassigned. Use 'const' instead.","line":28,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":28,"endColumn":10},{"ruleId":"prefer-const","severity":1,"message":"'commonStyle' is never reassigned. Use 'const' instead.","line":33,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":33,"endColumn":15},{"ruleId":"prefer-const","severity":1,"message":"'cardField' is never reassigned. Use 'const' instead.","line":49,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":49,"endColumn":12},{"ruleId":"prefer-const","severity":1,"message":"'expirationField' is never reassigned. Use 'const' instead.","line":55,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":55,"endColumn":18},{"ruleId":"prefer-const","severity":1,"message":"'cvvField' is never reassigned. Use 'const' instead.","line":61,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":61,"endColumn":11}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/*global dlocal:true*/\n( function ( $, mw ) {\n\tconst country = $( '#country' ).val(),\n\t\textraData = {},\n\t\tisRecurring = !!$( '#recurring' ).val(),\n\t\tisIndia = ( country === 'IN' );\n\n\tfunction handleApiResult( result ) {\n\t\tif ( result.isFailed ) {\n\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t} );\n\t\t} else if ( mw.monthlyConvert && mw.monthlyConvert.canShowModal() ) {\n\t\t\tmw.monthlyConvert.init();\n\t\t} else if ( result.redirect ) {\n\t\t\tdocument.location.replace( result.redirect );\n\t\t} else {\n\t\t\tdocument.location.replace( mw.config.get( 'DonationInterfaceThankYouPage' ) );\n\t\t}\n\t}\n\n\tfunction showPaymentSubmit() {\n\t\t$( '#paymentSubmit' ).show();\n\t}\n\n\tfunction setupCardForm() {\n\t\tlet dlocalInstance = dlocal( mw.config.get( 'wgDlocalSmartFieldApiKey' ) ),\n\t\t\tfields = dlocalInstance.fields( {\n\t\t\t\tlocale: mapLang( $( '#language' ).val() ),\n\t\t\t\tcountry: country\n\t\t\t} ),\n\t\t\t// Custom styling can be passed to options when creating a Smart Field.\n\t\t\tcommonStyle = getCardCommonStyle(),\n\t\t\tcardField,\n\t\t\tcardFieldError = false,\n\t\t\tcardFieldSupportError = false,\n\t\t\tcardFieldEmpty = true,\n\t\t\texpirationField,\n\t\t\texpirationFieldError = false,\n\t\t\texpirationFieldEmpty = true,\n\t\t\tcvvField,\n\t\t\tcvvFieldError = false,\n\t\t\tcvvFieldEmpty = true;\n\n\t\tinsertBrazilRecurringAdvice();\n\t\taddCardFieldsToErrorDisplay();\n\n\t\t// create card fields and add events\n\t\tcardField = fields.create( 'pan', {\n\t\t\tstyle: commonStyle,\n\t\t\tplaceholder: '4111 1111 1111 1111'\n\t\t} );\n\t\taddCardFieldEvents();\n\n\t\texpirationField = fields.create( 'expiration', {\n\t\t\tstyle: commonStyle,\n\t\t\tplaceholder: mw.msg( 'donate_interface-expiry-date-field-placeholder' )\n\t\t} );\n\t\taddExpirationFieldEvents();\n\n\t\tcvvField = fields.create( 'cvv', {\n\t\t\tstyle: commonStyle,\n\t\t\tplaceholder: '123',\n\t\t\tmaskInput: true\n\t\t} );\n\t\taddCvvFieldEvents();\n\n\t\t// Show our standard 'Donate' button\n\t\tshowPaymentSubmit();\n\t\t// Set the click handler\n\t\t// Using debounce to prevent the programmatic trigger of multiple instances of the submit function\n\t\t$( '#paymentSubmitBtn' ).click( mw.util.debounce( handleCardSubmitClick, 100 ) );\n\n\t\t// Drop in the dlocal card components placeholder\n\t\tinsertCardComponentContainers();\n\n\t\tcardField.mount( document.getElementById( 'cardNumber' ) );\n\t\texpirationField.mount( document.getElementById( 'expiration' ) );\n\t\tcvvField.mount( document.getElementById( 'cvv' ) );\n\n\t\tfunction addCardFieldEvents() {\n\t\t\tcardField.addEventListener( 'change', ( event ) => {\n\t\t\t\tcardFieldError = !!event.error;\n\t\t\t\tif ( event.error ) {\n\t\t\t\t\t$( '#cardNumberErrorMsg' ).text( mw.msg( 'donate_interface-error-msg-unsupported-card-entered' ) );\n\t\t\t\t} else {\n\t\t\t\t\t$( '#cardNumberErrorMsg' ).text( '' );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tcardField.on( 'blur', ( event ) => {\n\t\t\t\tcardFieldEmpty = event.empty;\n\t\t\t} );\n\n\t\t\tcardField.on( 'brand', ( event ) => {\n\t\t\t\t// after input 6 number, ready to check bin\n\t\t\t\tif ( event.brand ) {\n\t\t\t\t\tdlocalInstance.getBinInformation( cardField ).then( ( res ) => {\n\t\t\t\t\t\tconst binInfoCardBrand = res.brand;\n\t\t\t\t\t\tconst cardBrand = mw.config.get( 'codeMap' )[ binInfoCardBrand ];\n\t\t\t\t\t\tif ( cardBrand !== undefined ) {\n\t\t\t\t\t\t\tcardFieldSupportError = false;\n\t\t\t\t\t\t\textraData.payment_submethod = cardBrand;\n\t\t\t\t\t\t\t$( '#cardNumberErrorMsg' ).text( '' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcardFieldSupportError = true;\n\t\t\t\t\t\t\t$( '#credit-card-wrapper' ).addClass( 'DlocalField--invalid' );\n\t\t\t\t\t\t\t$( '#cardNumberErrorMsg' ).text( mw.msg( 'donate_interface-error-msg-unsupported-card-entered' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ).catch( ( error ) => {\n\t\t\t\t\t\t// Suppress bin lookup error.\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tfunction addExpirationFieldEvents() {\n\t\t\texpirationField.addEventListener( 'change', ( event ) => {\n\t\t\t\texpirationFieldError = !!event.error;\n\t\t\t\tif ( event.error ) {\n\t\t\t\t\t$( '#expirationErrorMsg' ).text( mw.msg( 'donate_interface-error-msg-card-too-old' ) );\n\t\t\t\t} else {\n\t\t\t\t\t$( '#expirationErrorMsg' ).text( '' );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\texpirationField.on( 'blur', ( event ) => {\n\t\t\t\texpirationFieldEmpty = event.empty;\n\t\t\t} );\n\t\t}\n\n\t\tfunction addCvvFieldEvents() {\n\t\t\tcvvField.addEventListener( 'change', ( event ) => {\n\t\t\t\tcvvFieldError = !!event.error;\n\t\t\t\tif ( event.error ) {\n\t\t\t\t\t$( '#cvvErrorMsg' ).text( mw.msg( 'donate_interface-error-msg-invalid-cvv-format' ) );\n\t\t\t\t} else {\n\t\t\t\t\t$( '#cvvErrorMsg' ).text( '' );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tcvvField.on( 'blur', ( event ) => {\n\t\t\t\tcvvFieldEmpty = event.empty;\n\t\t\t} );\n\t\t}\n\n\t\tfunction validateInputs() {\n\t\t\tconst formValid = mw.donationInterface.validation.validate(),\n\t\t\t\tcvvFieldHasErrors = cvvFieldError || cvvFieldEmpty,\n\t\t\t\tcardFieldHasErrors = cardFieldError || cardFieldEmpty || cardFieldSupportError,\n\t\t\t\texpFieldHasErrors = expirationFieldError || expirationFieldEmpty,\n\t\t\t\terrors = {};\n\n\t\t\tif ( !formValid || cvvFieldHasErrors || cardFieldHasErrors || expFieldHasErrors ) {\n\t\t\t\tif ( cardFieldHasErrors ) {\n\t\t\t\t\tif ( cardFieldEmpty ) {\n\t\t\t\t\t\terrors.cardNumber = mw.msg( 'donate_interface-error-msg-card-num' );\n\t\t\t\t\t} else if ( cardFieldSupportError ) {\n\t\t\t\t\t\terrors.cardNumber = mw.msg( 'donate_interface-error-msg-unsupported-card-entered' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.cardNumber = mw.msg( 'donate_interface-error-msg-invalid-card-number' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( cvvFieldHasErrors ) {\n\t\t\t\t\tif ( cvvFieldEmpty ) {\n\t\t\t\t\t\terrors.cvv = mw.msg( 'donate_interface-error-msg-cvv' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.cvv = mw.msg( 'donate_interface-error-msg-invalid-cvv-format' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( expFieldHasErrors ) {\n\t\t\t\t\tif ( expirationFieldEmpty ) {\n\t\t\t\t\t\terrors.expiration = mw.msg( 'donate_interface-error-msg-expiration' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.expiration = mw.msg( 'donate_interface-error-msg-card-too-old' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmw.donationInterface.validation.showErrors( errors );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tfunction handleCardSubmitClick( event ) {\n\t\t\tif ( $( this ).is( ':disabled' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tmw.donationInterface.forms.disable();\n\n\t\t\tif ( validateInputs() ) {\n\t\t\t\tdlocalInstance.createToken( cardField, {\n\t\t\t\t\tname: $( '#first_name' ).val() + ' ' + $( '#last_name' ).val()\n\t\t\t\t} ).then( ( result ) => {\n\t\t\t\t\t// Send the token to your server.\n\t\t\t\t\textraData.fiscal_number = $( '#fiscal_number' ).val();\n\t\t\t\t\textraData.payment_token = result.token;\n\t\t\t\t\tmw.donationInterface.forms.callDonateApi(\n\t\t\t\t\t\thandleApiResult,\n\t\t\t\t\t\textraData,\n\t\t\t\t\t\t'di_donate_dlocal'\n\t\t\t\t\t);\n\t\t\t\t} ).catch( ( result ) => {\n\t\t\t\t\tif ( result.error ) {\n\t\t\t\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Helper functions for card form setup that do not need to be inside the setup function's scope\n\tfunction insertBrazilRecurringAdvice() {\n\t\tif ( country === 'BR' && isRecurring ) {\n\t\t\t$( '.submethods' ).before( $( '<p>' +\n\t\t\t\tmw.msg( 'donate_interface-monthly-only-credit' ) +\n\t\t\t\t'</p>' ) );\n\t\t}\n\t}\n\n\t// https://docs.dlocal.com/reference/the-dlocal-object#dlocalfieldsoptions\n\t// Supported values are: es, en, pt, zh, cv, tr.\n\tfunction mapLang( wikiLang ) {\n\t\tif ( wikiLang === 'es-419' ) {\n\t\t\treturn 'es';\n\t\t} else if ( [ 'es', 'en', 'pt', 'zh', 'cv', 'tr' ].includes( wikiLang ) ) {\n\t\t\treturn wikiLang;\n\t\t} else {\n\t\t\t// todo: maybe display an error, or just default en?\n\t\t\treturn 'en';\n\t\t}\n\t}\n\n\tfunction addCardFieldsToErrorDisplay() {\n\t\tconst oldShowErrors = mw.donationInterface.validation.showErrors;\n\t\tmw.donationInterface.validation.showErrors = function ( errors ) {\n\t\t\tmw.donationInterface.forms.enable();\n\t\t\tconst dLocalFields = [ 'cardNumber', 'expiration', 'cvv' ];\n\t\t\t$.each( errors, ( field ) => {\n\t\t\t\tif ( dLocalFields.includes( field ) ) {\n\t\t\t\t\t$( '#' + field ).find( '.DlocalField' ).addClass( 'DlocalField--invalid' );\n\t\t\t\t\t$( '#' + field + 'ErrorMsg' ).text( errors[ field ] );\n\t\t\t\t\tdelete errors[ field ];\n\t\t\t\t}\n\t\t\t} );\n\t\t\toldShowErrors( errors );\n\t\t};\n\t}\n\n\tfunction insertCardComponentContainers() {\n\t\t$( '.submethods' ).before(\n\t\t\t'<div>' +\n\t\t\t'<label for=\"cardNumber\">' + mw.message( 'donate_interface-donor-card-num' ) + '</label>' +\n\t\t\t'<div id=\"cardNumber\" ></div>' +\n\t\t\t'<span class=\"DlocalField--invalid-text\" id=\"cardNumberErrorMsg\" />' +\n\t\t\t'</div>' +\n\t\t\t'<div>' +\n\t\t\t'<div class=\"halfwidth\">' +\n\t\t\t'<label for=\"expiration\">' + mw.message( 'donate_interface-donor-expiration' ) + '</label>' +\n\t\t\t'<div id=\"expiration\" ></div>' +\n\t\t\t'<span class=\"DlocalField--invalid-text\" id=\"expirationErrorMsg\"></span>' +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"halfwidth\">' +\n\t\t\t'<label for=\"cvv\">' + mw.message( 'donate_interface-cvv' ) + '</label>' +\n\t\t\t'<div id=\"cvv\"></div>' +\n\t\t\t'<span class=\"DlocalField--invalid-text\" id=\"cvvErrorMsg\"></span>' +\n\t\t\t'</div>' +\n\t\t\t'</div>'\n\t\t);\n\t}\n\n\tfunction getCardCommonStyle() {\n\t\treturn {\n\t\t\tbase: {\n\t\t\t\tfontSize: '14px',\n\t\t\t\t\tfontFamily: 'sans-serif',\n\t\t\t\t\tlineHeight: '40px',\n\t\t\t\t\tfontSmoothing: 'antialiased',\n\t\t\t\t\tfontWeight: '500',\n\t\t\t\t\tcolor: 'rgb(0, 17, 44)',\n\t\t\t\t\t'::placeholder': {\n\t\t\t\t\tcolor: 'rgb(185, 196, 201)'\n\t\t\t\t}\n\t\t\t},\n\t\t\tfocus: {\n\t\t\t\ticonColor: '#adbfd3',\n\t\t\t\t\t'::placeholder': {\n\t\t\t\t\tcolor: '#adbfd3'\n\t\t\t\t}\n\t\t\t},\n\t\t\tautofilled: {\n\t\t\t\tcolor: '#000000'\n\t\t\t},\n\t\t\tinvalid: {\n\t\t\t\tcolor: '#f00'\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction setupNonCardForm() {\n\t\tconst upiRecurringIsOnDemand = mw.config.get( 'isOnDemand' ),\n\t\t\tisDirectPaymentFlow = mw.config.get( 'isDirectPaymentFlow' ),\n\t\t\t// 'paytmwallet' submethod should be treated as the same for upi\n\t\t\tisUpi = new RegExp( '\\\\b' + $( 'input[name=payment_submethod]:checked' ).val() + '\\\\b', 'i' ).test( 'upi paytmwallet' ); // i is case insensitive\n\n\t\tif ( isUpi && isRecurring && upiRecurringIsOnDemand ) {\n\t\t\t// If we are using the ONDEMAND charge frequency, add a note to reassure donors\n\t\t\t// that we will only charge them once a month\n\t\t\t$( '.submethods' ).after( $( '<p>' +\n\t\t\t\tmw.msg( 'donate_interface-charge-monthly-only' ) +\n\t\t\t\t'</p>' ) );\n\t\t}\n\n\t\tif ( isDirectPaymentFlow ) {\n\t\t\t// Show our standard 'Donate' button\n\t\t\tshowPaymentSubmit();\n\t\t\t// only non-recurring upi is direct, and it must IN and bt, so no needs to check those two val\n\t\t\tif ( isUpi && !isRecurring ) {\n\t\t\t\taddUpiDirectFlowInputField();\n\t\t\t\t// Set the click handler\n\t\t\t\t$( '#paymentSubmitBtn' ).click( mw.util.debounce( handleUpiDirectSubmitClick, 100 ) );\n\t\t\t}\n\t\t} else {\n\t\t\t// Redirect flow\n\t\t\t$( '.submethods' ).after(\n\t\t\t\t$( '<p id=\"redirect-explanation\">' + mw.message( 'donate_interface-redirect-explanation' ) + '</p>' )\n\t\t\t);\n\t\t}\n\t}\n\n\t// Support functions for non-card form setup\n\tfunction addUpiDirectFlowInputField() {\n\t\t$( '.submethods' ).before(\n\t\t\t$( '<label for=\"upi_id\">' +\n\t\t\t\tmw.msg( 'donate_interface-bt-upi_id' ) +\n\t\t\t\t'</label>' +\n\t\t\t\t'<input value=\"\" name=\"upi_id\" id=\"upi_id\" />' ) );\n\t}\n\n\tfunction handleUpiDirectSubmitClick( event ) {\n\t\tif ( $( this ).is( ':disabled' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tevent.preventDefault();\n\t\t// Disable submit btn when submitting\n\t\tmw.donationInterface.forms.disable();\n\t\t// get verify\n\t\textraData.fiscal_number = $( '#fiscal_number' ).val();\n\t\textraData.upi_id = $( '#upi_id' ).val();\n\t\tmw.donationInterface.forms.callDonateApi(\n\t\t\thandleApiResult,\n\t\t\textraData,\n\t\t\t'di_donate_dlocal'\n\t\t);\n\t}\n\n\t/**\n\t *  On document ready we create a script tag and wire it up to run setup as soon as it\n\t *  is loaded, or to show an error message if the external script can't be loaded.\n\t *  The script should already be mostly or completely preloaded at this point, thanks\n\t *  to a <link rel=preload> we add in DlocalGateway::execute\n\t */\n\t$( () => {\n\t\tif ( isIndia ) {\n\t\t\t$( '#fiscal_number' ).after(\n\t\t\t\t$( '<p style=\"font-size: 10px\">' + mw.msg( 'donate_interface-donor-fiscal_number-explain-option-in' ) +\n\t\t\t\t\t'</p>' )\n\t\t\t);\n\t\t}\n\t\t// only cc load smart field script and submit button, others show redirect with continue button\n\t\tif ( $( '#payment_method' ).val() === 'cc' ) {\n\t\t\tconst scriptNode = document.createElement( 'script' );\n\t\t\tscriptNode.onload = setupCardForm;\n\t\t\tscriptNode.onerror = function () {\n\t\t\t\tmw.donationInterface.validation.showErrors(\n\t\t\t\t\t{ general: 'Could not load payment provider Javascript. Please reload or try again later.' }\n\t\t\t\t);\n\t\t\t};\n\t\t\tscriptNode.src = mw.config.get( 'dlocalScript' );\n\t\t\tdocument.body.append( scriptNode );\n\t\t} else {\n\t\t\tsetupNonCardForm();\n\t\t}\n\t} );\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/extension.json","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"no-extra-parens","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/gravy_gateway/forms/gravy.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'extraData' is never reassigned. Use 'const' instead.","line":11,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":11,"endColumn":11},{"ruleId":"prefer-const","severity":1,"message":"'configFromServer' is never reassigned. Use 'const' instead.","line":12,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":12,"endColumn":18},{"ruleId":"prefer-const","severity":1,"message":"'sessionId' is never reassigned. Use 'const' instead.","line":13,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":13,"endColumn":11},{"ruleId":"prefer-const","severity":1,"message":"'environment' is never reassigned. Use 'const' instead.","line":14,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":14,"endColumn":13},{"ruleId":"prefer-const","severity":1,"message":"'gravyId' is never reassigned. Use 'const' instead.","line":15,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":15,"endColumn":9},{"ruleId":"prefer-const","severity":1,"message":"'redirectPaypal' is never reassigned. Use 'const' instead.","line":16,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":16,"endColumn":16},{"ruleId":"prefer-const","severity":1,"message":"'googlePaymentClient' is never reassigned. Use 'const' instead.","line":17,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":17,"endColumn":21},{"ruleId":"prefer-const","severity":1,"message":"'language' is never reassigned. Use 'const' instead.","line":19,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":19,"endColumn":10},{"ruleId":"prefer-const","severity":1,"message":"'applePayPaySessionVersionNumber' is never reassigned. Use 'const' instead.","line":20,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":20,"endColumn":33},{"ruleId":"mediawiki/msg-doc","severity":1,"message":"All possible message keys should be documented. See https://w.wiki/4r9a for details.","line":119,"column":25,"nodeType":"CallExpression","endLine":119,"endColumn":46},{"ruleId":"mediawiki/msg-doc","severity":1,"message":"All possible message keys should be documented. See https://w.wiki/4r9a for details.","line":119,"column":49,"nodeType":"CallExpression","endLine":119,"endColumn":70},{"ruleId":"no-shadow","severity":1,"message":"'extraData' is already declared in the upper scope on line 11 column 2.","line":243,"column":8,"nodeType":"Identifier","messageId":"noShadow","endLine":243,"endColumn":17},{"ruleId":"no-shadow","severity":1,"message":"'appleSession' is already declared in the upper scope on line 18 column 2.","line":393,"column":43,"nodeType":"Identifier","messageId":"noShadow","endLine":393,"endColumn":55},{"ruleId":"no-shadow","severity":1,"message":"'extraData' is already declared in the upper scope on line 11 column 2.","line":439,"column":8,"nodeType":"Identifier","messageId":"noShadow","endLine":439,"endColumn":17}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":14,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/* global SecureFields google ApplePaySession */\n( function ( $, mw ) {\n\tlet secureFieldValid = false,\n\tcardNumberFieldValid = false,\n\tsecurityCodeValid = false,\n\texpiryDateValid = false,\n\tcardNumberFieldEmpty = true,\n\tsecurityCodeFieldEmpty = true,\n\texpiryDateFieldEmpty = true,\n\tsecureFields = null,\n\textraData = {},\n\tconfigFromServer = mw.config.get( 'gravyConfiguration' ),\n\tsessionId = mw.config.get( 'gravy_session_id' ),\n\tenvironment = mw.config.get( 'wgGravyEnvironment' ),\n\tgravyId = mw.config.get( 'wgGravyId' ),\n\tredirectPaypal = mw.config.get( 'wgGravyRedirectPaypal' ),\n\tgooglePaymentClient = null,\n\tappleSession = null,\n\tlanguage = $( '#language' ).val(),\n\tapplePayPaySessionVersionNumber = 3; // https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_on_the_web_version_history\n\n\tfunction insertCardComponentContainers() {\n\t\t$( '.submethods' ).before(\n\t\t\t'<div>' +\n\t\t\t'<label for=\"cc-number\">' + mw.message( 'donate_interface-donor-card-num' ) + '</label>' +\n\t\t\t'<input id=\"cc-number\" />' +\n\t\t\t'<span class=\"GravyField--invalid-text\" id=\"cardNumberErrorMsg\" />' +\n\t\t\t'</div>' +\n\t\t\t'<div>' +\n\t\t\t'<div class=\"halfwidth\">' +\n\t\t\t'<label for=\"cc-expiry-date\">' + mw.message( 'donate_interface-donor-expiration' ) + '</label>' +\n\t\t\t'<input id=\"cc-expiry-date\" />' +\n\t\t\t'<span class=\"GravyField--invalid-text\" id=\"expirationErrorMsg\"></span>' +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"halfwidth\">' +\n\t\t\t'<label for=\"cc-security-code\">' + mw.message( 'donate_interface-donor-security' ) + '</label>' +\n\t\t\t'<input id=\"cc-security-code\" />' +\n\t\t\t'<span class=\"GravyField--invalid-text\" id=\"cvvErrorMsg\"></span>' +\n\t\t\t'</div>' +\n\t\t\t'</div>'\n\t\t);\n\t}\n\n\tfunction ccInputEmptyStyle( id, evt ) {\n\t\tif ( !evt.empty ) {\n\t\t\tsetFieldError( id ,evt.valid, false );\n\t\t} else {\n\t\t\t$( id ).removeAttr( 'data-secure-fields-invalid' );\n\t\t}\n\t}\n\n\tfunction setupCardFields() {\n\t\tconst inputStyle = {\n\t\t\tfontSize: '16px',\n\t\t\tpadding: '5px 8px',\n\t\t\tinvalidColor: 'unset'\n\t\t};\n\t\tconst cardNumberField = secureFields.addCardNumberField( '#cc-number', {\n\t\t\t\tplaceholder: '1234 5678 9012 3456',\n\t\t\t\tstyles: inputStyle\n\t\t\t} );\n\n\t\tconst securityCodeField = secureFields.addSecurityCodeField( '#cc-security-code', {\n\t\t\t\tplaceholder: mw.msg( 'donate_interface-cvv-placeholder-3-digits' ),\n\t\t\t\tstyles: inputStyle\n\t\t\t} );\n\n\t\tconst expiryDateField = secureFields.addExpiryDateField( '#cc-expiry-date', {\n\t\t\t\tplaceholder: mw.msg( 'donate_interface-expiry-date-field-placeholder' ),\n\t\t\t\tstyles: inputStyle\n\t\t\t} );\n\t\t// based on card type show logo and update cvv placeholder when amex\n\t\tcardNumberField.addEventListener( 'input', ( evt ) => {\n\t\t\tif ( evt.schema ) {\n\t\t\t\t//change logo where appropriate\n\t\t\t\tconst iconUrl = 'https://api.' + gravyId + '.gr4vy.app/assets/icons/card-schemes/' + evt.schema + '.svg';\n\t\t\t\t$( '#cc-number' ).css( 'background-image', 'url(' + iconUrl + ')' );\n\t\t\t\tif ( evt.schema === 'amex' ) {\n\t\t\t\t\tsecurityCodeField.setPlaceholder( mw.msg( 'donate_interface-cvv-placeholder-4-digits' ) );\n\t\t\t\t} else {\n\t\t\t\t\tsecurityCodeField.setPlaceholder( mw.msg( 'donate_interface-cvv-placeholder-3-digits' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\tccInputEmptyStyle( '#cc-number', evt );\n\t\t} );\n\t\texpiryDateField.addEventListener( 'input', ( evt ) => {\n\t\t\t// for error icon\n\t\t\t$( '#cc-expiry-date' ).toggleClass( 'valid-input', !evt.empty && evt.valid );\n\t\t\tccInputEmptyStyle( '#cc-expiry-date', evt );\n\t\t} );\n\t\tsecurityCodeField.addEventListener( 'input', ( evt ) => {\n\t\t\t// for error icon\n\t\t\t$( '#cc-security-code' ).toggleClass( 'valid-input', !evt.empty && evt.valid );\n\t\t\tccInputEmptyStyle( '#cc-security-code', evt );\n\t\t} );\n\t}\n\n\tfunction setFieldError( fieldId, isValid, isEmpty ) {\n\t\tlet errorMsg = '', errorMsgId, errorMsgKey, emptyMsgKey;\n\t\tswitch ( fieldId ) {\n\t\t\tcase '#cc-number':\n\t\t\t\terrorMsgId = '#cardNumberErrorMsg';\n\t\t\t\terrorMsgKey = 'donate_interface-error-msg-invalid-card-number';\n\t\t\t\temptyMsgKey = 'donate_interface-error-msg-card-num';\n\t\t\t\tbreak;\n\t\t\tcase '#cc-expiry-date':\n\t\t\t\terrorMsgId = '#expirationErrorMsg';\n\t\t\t\terrorMsgKey = 'donate_interface-error-msg-expiry-date-field-invalid';\n\t\t\t\temptyMsgKey = 'donate_interface-error-msg-expiration';\n\t\t\t\tbreak;\n\t\t\tcase '#cc-security-code':\n\t\t\t\terrorMsgId = '#cvvErrorMsg';\n\t\t\t\terrorMsgKey = 'donate_interface-error-msg-invalid-cvv-format';\n\t\t\t\temptyMsgKey = 'donate_interface-error-msg-cvv';\n\t\t\t\tbreak;\n\t\t}\n\t\t$( fieldId ).toggleClass( 'GravyField--invalid invalid-input', !isValid || isEmpty );\n\t\tif ( !isValid || isEmpty ) {\n\t\t\terrorMsg = isEmpty ? mw.msg( emptyMsgKey ) : mw.msg( errorMsgKey );\n\t\t}\n\t\t$( errorMsgId ).text( errorMsg );\n\t}\n\n\tfunction setupCardForm() {\n\t\tsecureFields = new SecureFields( {\n\t\t\tgr4vyId: gravyId,\n\t\t\tenvironment: environment,\n\t\t\tsessionId: sessionId,\n\t\t\tstyles: {\n\t\t\t\tfontSize: '16px',\n\t\t\t\tpadding: '0.8em',\n\t\t\t\tbackgroundColor: '#fff',\n\t\t\t\tborderRadius: '2px',\n\t\t\t\tborder: '1px solid #a2a9b1',\n\t\t\t\tcolor: '#000',\n\t\t\t\tfontFamily: 'inherit',\n\t\t\t\tlineHeight: '17px',\n\t\t\t\tmarginBottom: '0.2em'\n\t\t\t},\n\t\t\ttheme: {\n\t\t\t\tcolors: {\n\t\t\t\t\tinputBorder: '#a2a9b1'\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\tsecureFields.addEventListener( SecureFields.Events.CARD_VAULT_SUCCESS, () => {\n\t\t\textraData.fiscal_number = $( '#fiscal_number' ).val();\n\t\t\textraData.gateway_session_id = sessionId;\n\t\t\tmw.donationInterface.forms.callDonateApi(\n\t\t\t\thandleApiResult,\n\t\t\t\textraData,\n\t\t\t\t'di_donate_gravy'\n\t\t\t);\n\t\t} );\n\n\t\tsecureFields.addEventListener(\n\t\t\tSecureFields.Events.CARD_VAULT_FAILURE,\n\t\t\t() => {\n\t\t\t\tmw.donationInterface.forms.addDebugMessage( 'Card vault failure on gravy checkout session id: ' + sessionId );\n\t\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t\t} );\n\t\t\t\tmw.donationInterface.forms.enable();\n\t\t\t}\n\t\t);\n\n\t\tsecureFields.addEventListener(\n\t\t\tSecureFields.Events.FORM_CHANGE,\n\t\t\t( data ) => {\n\t\t\t\tif ( data ) {\n\t\t\t\t\tsecureFieldValid = data.complete;\n\t\t\t\t\tif ( data.fields ) {\n\t\t\t\t\t\tcardNumberFieldEmpty = data.fields.number.empty;\n\t\t\t\t\t\tcardNumberFieldValid = data.fields.number.valid;\n\t\t\t\t\t\texpiryDateFieldEmpty = data.fields.expiryDate.empty;\n\t\t\t\t\t\texpiryDateValid = data.fields.expiryDate.valid;\n\t\t\t\t\t\tsecurityCodeFieldEmpty = data.fields.securityCode.empty;\n\t\t\t\t\t\tsecurityCodeValid = data.fields.securityCode.valid;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tinsertCardComponentContainers();\n\t\tsetupCardFields();\n\n\t\t$( '#paymentSubmit' ).show();\n\t\t$( '#paymentSubmitBtn' ).click( mw.util.debounce( handleCardSubmitClick, 100 ) );\n\t}\n\n\tfunction validateInputs() {\n\t\tif ( !mw.donationInterface.validation.validate() || !secureFieldValid ) {\n\t\t\tsetFieldError( '#cc-number',  cardNumberFieldValid, cardNumberFieldEmpty );\n\t\t\tsetFieldError( '#cc-security-code',  securityCodeValid, securityCodeFieldEmpty );\n\t\t\tsetFieldError( '#cc-expiry-date',  expiryDateValid, expiryDateFieldEmpty );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tfunction handleCardSubmitClick( event ) {\n\t\tif ( $( this ).is( ':disabled' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tevent.preventDefault();\n\t\tmw.donationInterface.forms.disable();\n\n\t\tif ( validateInputs() ) {\n\t\t\tsecureFields.submit();\n\t\t} else {\n\t\t\tmw.donationInterface.forms.enable();\n\t\t}\n\t}\n\n\tfunction handleApiResult( result ) {\n\t\tif ( result.isFailed ) {\n\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t} );\n\t\t} else if ( result.redirect ) {\n\t\t\tdocument.location.replace( result.redirect );\n\t\t} else if ( mw.monthlyConvert && mw.monthlyConvert.canShowModal() ) {\n\t\t\tmw.monthlyConvert.init();\n\t\t} else {\n\t\t\tdocument.location.replace( mw.config.get( 'DonationInterfaceThankYouPage' ) );\n\t\t}\n\t}\n\n\tfunction insertGooglePayComponentContainer() {\n\t\t$( '.submethods' ).before(\n\t\t\t'<div id=\"container\">' +\n\t\t\t'</div>'\n\t\t);\n\t}\n\n\tfunction handleGooglePayButtonClick() {\n\t\tconst paymentRequest = getGooglepayRequest();\n\t\tconst googlePayClient = getGooglePayClient();\n\t\tgooglePayClient.loadPaymentData( paymentRequest ).then( ( paymentData ) => {\n\t\t\tconst paymentToken = paymentData.paymentMethodData.tokenizationData.token;\n\t\t\tconst donorInfo = paymentData.paymentMethodData.info.billingAddress,\n\t\t\t\t\t\t\textraData = {};\n\t\t\textraData.postal_code = donorInfo.postalCode;\n\t\t\textraData.state_province = donorInfo.administrativeArea;\n\t\t\textraData.city = donorInfo.locality;\n\t\t\textraData.street_address = donorInfo.address1;\n\t\t\textraData.email = paymentData.email;\n\t\t\textraData.full_name = donorInfo.name;\n\t\t\textraData.payment_token = paymentToken;\n\t\t\textraData.card_suffix = paymentData.paymentMethodData.info.cardDetails;\n\t\t\textraData.card_scheme = paymentData.paymentMethodData.info.cardNetwork;\n\t\t\tmw.donationInterface.forms.callDonateApi(\n\t\t\t\thandleApiResult,\n\t\t\t\textraData,\n\t\t\t\t'di_donate_gravy'\n\t\t\t);\n\t\t} ).catch( ( err ) => {\n\t\t\tmw.donationInterface.forms.addDebugMessage( 'Google Pay failure: ' + err );\n\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t} );\n\t\t} );\n\t}\n\n\tfunction getGoogleBaseRequest() {\n\t\treturn {\n\t\t\tapiVersion: 2,\n\t\t\tapiVersionMinor: 0\n\t\t};\n\t}\n\n\tfunction getGoogleBaseCardPaymentMethod() {\n\t\tconst allowedCardNetworks = configFromServer.googleAllowedNetworks;\n\t\tconst allowedCardAuthMethods = [ 'PAN_ONLY', 'CRYPTOGRAM_3DS' ];\n\t\tconst baseCardPaymentMethod = {\n\t\t\ttype: 'CARD',\n\t\t\tparameters: {\n\t\t\t\tallowedCardNetworks: allowedCardNetworks,\n\t\t\t\tallowedAuthMethods: allowedCardAuthMethods,\n\t\t\t\tbillingAddressRequired: true,\n\t\t\t\tbillingAddressParameters: {\n\t\t\t\t\tformat: 'FULL'\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn baseCardPaymentMethod;\n\t}\n\n\tfunction getGoogleTransactionInfo() {\n\t\treturn {\n\t\t\ttotalPriceStatus: 'FINAL',\n\t\t\ttotalPrice: $( '#amount' ).val(),\n\t\t\tcurrencyCode: $( '#currency' ).val(),\n\t\t\tcountryCode: $( '#country' ).val()\n\t\t};\n\t}\n\n\tfunction getGoogleMerchantInfo() {\n\t\treturn {\n\t\t\tmerchantName: 'WikimediaFoundation',\n\t\t\tmerchantId: configFromServer.googleMerchantId\n\t\t};\n\t}\n\n\tfunction getGooglepayRequest() {\n\t\tconst paymentRequest = getGoogleBaseRequest();\n\t\tconst cardPaymentMethod = getGoogleBaseCardPaymentMethod();\n\t\tconst gravyGooglePayMerchantId = configFromServer.gravyGooglePayMerchantId;\n\t\tconst tokenizationSpecification = {\n\t\t\ttype: 'PAYMENT_GATEWAY',\n\t\t\tparameters: {\n\t\t\t\tgateway: 'gr4vy',\n\t\t\t\tgatewayMerchantId: gravyGooglePayMerchantId\n\t\t\t}\n\t\t};\n\t\tcardPaymentMethod.tokenizationSpecification = tokenizationSpecification;\n\t\tpaymentRequest.allowedPaymentMethods = [ cardPaymentMethod ];\n\t\tpaymentRequest.transactionInfo = getGoogleTransactionInfo();\n\t\tpaymentRequest.merchantInfo = getGoogleMerchantInfo();\n\n\t\tpaymentRequest.emailRequired = true;\n\n\t\treturn paymentRequest;\n\t}\n\n\tfunction getGoogleIsReadyToPayRequest() {\n\t\tconst request = getGoogleBaseRequest();\n\t\tconst baseCardPaymentMethod = getGoogleBaseCardPaymentMethod();\n\t\trequest.allowedPaymentMethods = [ baseCardPaymentMethod ];\n\t\treturn request;\n\t}\n\n\tfunction getGooglePayClient() {\n\t\tif ( googlePaymentClient === null ) {\n\t\t\treturn new google.payments.api.PaymentsClient( { environment: configFromServer.googleEnvironment } );\n\t\t}\n\t\treturn googlePaymentClient;\n\t}\n\n\tfunction setupGooglePayForm() {\n\t\tinsertGooglePayComponentContainer();\n\t\tconst googlePayClient = getGooglePayClient();\n\t\tconst isReadyToPayRequest = getGoogleIsReadyToPayRequest();\n\t\tgooglePayClient\n\t\t\t.isReadyToPay( isReadyToPayRequest )\n\t\t\t.then( ( response ) => {\n\t\t\t\tif ( response.result ) {\n\t\t\t\t\tconst button = googlePayClient.createButton( {\n\t\t\t\t\t\tonClick: handleGooglePayButtonClick,\n\t\t\t\t\t\tallowedPaymentMethods: [ 'CARD','TOKENIZED_CARD' ],\n\t\t\t\t\t\tbuttonType: 'donate'\n\t\t\t\t\t} );\n\t\t\t\t\tdocument.getElementById( 'container' ).appendChild( button );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( err ) => {\n\t\t\t\tmw.donationInterface.forms.addDebugMessage( 'Google Pay failure: ' + err );\n\t\t\t} );\n\t}\n\n\tfunction setupApplePayForm() {\n\t\t// Check apple pay availability before showing button\n\t\tif ( window.ApplePaySession ) {\n\t\t\tinsertApplePayComponentContainer();\n\t\t\tconst button = document.getElementById( 'applepay-btn' );\n\t\t\tbutton.addEventListener( 'click', handleApplePaySubmitClick );\n\t\t} else {\n\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\tgeneral: mw.message(\n\t\t\t\t\t'donate_interface-error-msg-apple_pay_unsupported',\n\t\t\t\t\tmw.config.get( 'DonationInterfaceOtherWaysURL' )\n\t\t\t\t).plain()\n\t\t\t} );\n\t\t\tmw.donationInterface.forms.addDebugMessage( 'Apple Pay failure: Unable to find ApplePaySession in browser' );\n\t\t}\n\t}\n\n\tfunction handleApplePayApiResult( result ) {\n\t\tappleSession.completePayment( {\n\t\t\tstatus: ApplePaySession.STATUS_SUCCESS\n\t\t} );\n\n\t\thandleApiResult( result );\n\t}\n\n\tfunction handleApplePaySubmitClick( e ) {\n\t\te.preventDefault();\n\t\tsetupApplePaySession();\n\t\tappleSession.begin();\n\t}\n\n\tfunction validateApplePayPaymentSession( appleSession ) {\n\t\treturn function ( event ) {\n\t\t\tconst api = new mw.Api();\n\t\t\tapi.post( {\n\t\t\t\taction: 'di_applesession_gravy',\n\t\t\t\tvalidation_url: event.validationURL,\n\t\t\t\twmf_token: $( '#wmf_token' ).val()\n\t\t\t} ).then( ( data ) => {\n\t\t\t\tif ( data.result && data.result.errors ) {\n\t\t\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t\t\t} );\n\t\t\t\t\tmw.donationInterface.forms.addDebugMessage( 'Apple Pay failure: ' + data.result.errors );\n\t\t\t\t} else {\n\t\t\t\t\tappleSession.completeMerchantValidation( data.session );\n\t\t\t\t}\n\t\t\t} ).catch( ( e ) => {\n\t\t\t\tmw.donationInterface.forms.addDebugMessage( 'Apple Pay failure: ' + e );\n\t\t\t\tmw.donationInterface.validation.showErrors( {\n\t\t\t\t\tgeneral: mw.msg( 'donate_interface-error-msg-general' )\n\t\t\t\t} );\n\t\t\t} );\n\t\t};\n\t}\n\n\tfunction setupApplePaySession() {\n\t\tconst paymentRequestObject = {\n\t\t\tcountryCode: $( '#country' ).val(),\n\t\t\tcurrencyCode: $( '#currency' ).val(),\n\t\t\tmerchantCapabilities: [ 'supportsCredit', 'supportsDebit', 'supports3DS' ],\n\t\t\tsupportedNetworks: [ 'visa', 'masterCard', 'amex', 'discover' ],\n\t\t\trequiredBillingContactFields: [ 'email', 'name', 'phone', 'postalAddress' ],\n\t\t\trequiredShippingContactFields: [ 'email', 'name' ],\n\t\t\ttotal: {\n\t\t\t\tlabel: 'Wikimedia Foundation',\n\t\t\t\ttype: 'final',\n\t\t\t\tamount: $( '#amount' ).val()\n\t\t\t}\n\t\t};\n\t\tappleSession = new ApplePaySession( applePayPaySessionVersionNumber, paymentRequestObject );\n\n\t\tappleSession.onvalidatemerchant = validateApplePayPaymentSession( appleSession );\n\n\t\tappleSession.onpaymentauthorized = function ( event ) {\n\t\t\tconst bContact = event.payment.billingContact,\n\t\t\t\tsContact = event.payment.shippingContact;\n\t\t\tlet extraData = {};\n\t\t\tlet paymentSubmethod = event.payment.token.paymentMethod.network;\n\t\t\tif ( !paymentSubmethod ) {\n\t\t\t\tpaymentSubmethod = '';\n\t\t\t}\n\t\t\textraData = mw.donationInterface.forms.apple.getBestApplePayContactName( extraData, bContact, sContact );\n\t\t\textraData.postal_code = bContact.postalCode;\n\t\t\textraData.state_province = bContact.administrativeArea;\n\t\t\textraData.city = bContact.locality;\n\t\t\tif ( bContact.addressLines.length > 0 ) {\n\t\t\t\textraData.street_address = bContact.addressLines[ 0 ];\n\t\t\t}\n\t\t\textraData.email = sContact.emailAddress;\n\t\t\textraData.payment_submethod = paymentSubmethod.toLowerCase();\n\t\t\textraData.payment_token = JSON.stringify( event.payment.token );\n\t\t\tmw.donationInterface.forms.callDonateApi(\n\t\t\t\thandleApplePayApiResult,\n\t\t\t\textraData,\n\t\t\t\t'di_donate_gravy'\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction insertApplePayComponentContainer() {\n\t\t$( '.submethods' ).before(\n\t\t\t'<div id=\"container\">' +\n\t\t\t'<apple-pay-button class=\"button\" id=\"applepay-btn\" buttonstyle=\"black\" type=\"donate\" locale=\"' + language + '\"></apple-pay-button>' +\n\t\t\t'</div>'\n\t\t);\n\t}\n\n\tfunction submitPaypal() {\n\t\tconst di = mw.donationInterface;\n\n\t\tfunction redirect( result ) {\n\t\t\t// We don't actually want to enable the form on redirect or in the\n\t\t\t// complete phase of callDonateApi, so we override enable here.\n\t\t\tdi.forms.enable = function () {};\n\t\t\tlocation.assign( result.redirect );\n\t\t}\n\n\t\tdi.forms.submit = function () {\n\t\t\t// MediaWiki uses the \"uselang\" parameter to set the language for localization\n\t\t\t// Checkout /payments/includes/api/ApiMain.php\n\t\t\tdi.forms.callDonateApi( redirect, { uselang: $( '#language' ).val() } );\n\t\t};\n\n\t\tdi.forms.submit();\n\t}\n\n\t/**\n\t *  On document ready we create a script tag and wire it up to run setup as soon as it\n\t *  is loaded, or to show an error message if the external script can't be loaded.\n\t *  The script should already be mostly or completely preloaded at this point, thanks\n\t *  to a <link rel=preload> we add in GravyGateway::execute.\n\t *  Don't try to load the script if the configured src is empty (as happens on the\n\t *  resultSwitcher where we may show the monthly convert modal).\n\t */\n\t$( () => {\n\t\tswitch ( $( '#payment_method' ).val() ) {\n\t\t\tcase 'cc':\n\t\t\t\tmw.donationInterface.forms.loadScript( configFromServer.secureFieldsJsScript, setupCardForm );\n\t\t\t\tbreak;\n\t\t\tcase 'google':\n\t\t\t\tmw.donationInterface.forms.loadScript( configFromServer.googleScript, setupGooglePayForm );\n\t\t\t\tbreak;\n\t\t\tcase 'apple':\n\t\t\t\tmw.donationInterface.forms.loadScript( configFromServer.appleScript, setupApplePayForm );\n\t\t\t\tbreak;\n\t\t\tcase 'paypal':\n\t\t\t\tif ( redirectPaypal ) {\n\t\t\t\t\tsubmitPaypal();\n\t\t\t\t}\n\t\t}\n\t} );\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/ingenico_gateway/forms/js/ingenico.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/iframe.liberator.js","messages":[{"ruleId":"no-redeclare","severity":1,"message":"'self' is already defined as a built-in global variable.","line":1,"column":10,"nodeType":"Block","messageId":"redeclaredAsBuiltin","endLine":1,"endColumn":14}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/*global self:false */\n$( () => {\n\t// we're going to immediately redirect.\n\t// Hide the page contents (skin, mostly) so it doesn't appear in the iframe while we're waiting for the reload.\n\tjQuery( 'body' ).children().attr( 'style', 'display:none' );\n} );\ntop.location = self.document.location + '&liberated=1';\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.alwaysRedirect.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.applePayHelper.js","messages":[{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"$\" type.","line":4,"column":1,"nodeType":"Block","endLine":4,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"mw\" type.","line":5,"column":1,"nodeType":"Block","endLine":5,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"extraData\" type.","line":15,"column":1,"nodeType":"Block","endLine":15,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"billingContact\" type.","line":16,"column":1,"nodeType":"Block","endLine":16,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"shippingContact\" type.","line":17,"column":1,"nodeType":"Block","endLine":17,"endColumn":1}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/**\n * Core functionality for DonationInterface forms\n *\n * @param $\n * @param mw\n */\n( function ( $, mw ) {\n\tconst di = mw.donationInterface; // Defined in ext.donationInterface.validation.js\n\n\t/**\n\t * Try to obtain the \"best\" name from the available contact info sent back by Apple pay\n\t *\n\t * @see https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/2216120-requiredbillingcontactfields\n\t * @see https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentcontact\n\t * @param extraData\n\t * @param billingContact\n\t * @param shippingContact\n\t * @return {*}\n\t */\n\tfunction getBestApplePayContactName(\n\t\textraData,\n\t\tbillingContact,\n\t\tshippingContact\n\t) {\n\t\tlet first_name, last_name;\n\n\t\tif (\n\t\tbillingContact &&\n\t\tbillingContact.givenName &&\n\t\tbillingContact.givenName.length > 1\n\t\t) {\n\t\tfirst_name = billingContact.givenName;\n\t\tif ( billingContact.familyName && billingContact.familyName.length > 1 ) {\n\t\t\tlast_name = billingContact.familyName;\n\t\t}\n\t\t}\n\n\t\tif ( first_name && !last_name ) {\n\t\t// suspected 'dad' scenario so use shipping contact\n\t\tif (\n\t\t\tshippingContact &&\n\t\t\tshippingContact.givenName &&\n\t\t\tshippingContact.givenName.length > 1\n\t\t) {\n\t\t\tfirst_name = shippingContact.givenName;\n\t\t\tif (\n\t\t\tshippingContact.familyName &&\n\t\t\tshippingContact.familyName.length > 1\n\t\t\t) {\n\t\t\tlast_name = shippingContact.familyName;\n\t\t\t}\n\t\t}\n\t\t}\n\n\t\textraData.first_name = first_name;\n\t\textraData.last_name = last_name;\n\t\treturn extraData;\n\t}\n\t// FIXME: move function declarations into object\n\tdi.forms.apple = {\n\t\tgetBestApplePayContactName: getBestApplePayContactName\n\t};\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.emailPreferences.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.employerAutoComplete.js","messages":[{"ruleId":"no-jquery/no-done-fail","severity":1,"message":"Prefer .then to .done","line":28,"column":21,"nodeType":"CallExpression","endLine":49,"endColumn":24}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( $ ) {\n    $( () => {\n        const autocompleteCache = {},\n            // This triggers both on 'select' and 'focus' events to set the displayed\n            // value to the employer/subsidiary name and the hidden field value to the\n            // employer ID. The focus event is triggered on arrow key navigation.\n            selectFocusFunction = function ( event, ui ) {\n                event.preventDefault();\n                $( '#employer' ).val( ui.item.label );\n                $( '#employer_id' ).val( ui.item.value );\n            };\n\n        $( '#employer' ).autocomplete( {\n            delay: 300, //throttle in milliseconds\n            source: function ( request, response ) {\n                //reset employer_id each time a new search starts\n                $( '#employer_id' ).val( '' );\n\n                const apiParameters = {\n                    action: 'employerSearch',\n                    employer: request.term,\n                    format: 'json'\n                }, cached = autocompleteCache[ request.term ];\n\n                if ( cached ) {\n                    response( cached );\n                } else {\n                    $.post( mw.util.wikiScript( 'api' ), apiParameters ).done( ( data ) => {\n                        // check if the api sent back any errors and if so jump out here\n                        if ( data.error ) {\n                            response(); // this has to be called in all scenarios for preserve the widget state\n                        } else {\n                            // transform result to suit autocomplete format\n                            const result = data.result.map( ( item ) => ( {\n                                        label: item.name,\n                                        value: item.id\n                                    } ) ),\n                            //trim results\n                            output = result.slice( 0, 10 );\n\n                            // Note: jquery autocomplete handles escaping by injecting\n                            // values and labels into the DOM using jquery text() and\n                            // val() methods. So, additional escaping is not needed.\n\n                            //cache result\n                            autocompleteCache[ request.term ] = output;\n                            response( output );\n                        }\n                    } );\n                }\n            },\n            select: selectFocusFunction,\n            focus: selectFocusFunction\n        } );\n    } );\n} )( jQuery );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.employerExplain.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.employerExplainAlt.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.errorLog.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'postdata' is never reassigned. Use 'const' instead.","line":16,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":16,"endColumn":11}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( $, mw ) {\n\tconst apiAction = mw.config.get( 'ClientErrorLogAction', 'logPaymentsFormError' ),\n\t\tignorePatterns = mw.config.get( 'wgDonationInterfaceClientErrorLogIgnorePatterns' ),\n\t\tignoreRegexes = [];\n\twindow.onerror = function ( message, file, line, col, error ) {\n\t\tlet i, postdata;\n\t\tfor ( i = 0; i < ignorePatterns.length; i++ ) {\n\t\t\tif ( ignoreRegexes.length <= i ) {\n\t\t\t\t// turn patterns into regexes the first time through\n\t\t\t\tignoreRegexes[ i ] = new RegExp( ignorePatterns[ i ] );\n\t\t\t}\n\t\t\tif ( message.match( ignoreRegexes[ i ] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tpostdata = {\n\t\t\taction: apiAction,\n\t\t\tmessage: message,\n\t\t\tfile: file,\n\t\t\tline: line,\n\t\t\tcol: col,\n\t\t\tuserAgent: navigator.userAgent\n\t\t};\n\t\tif ( error && error.stack ) {\n\t\t\tpostdata.stack = error.stack;\n\t\t}\n\t\t$.ajax( {\n\t\t\turl: mw.util.wikiScript( 'api' ),\n\t\t\tdata: postdata,\n\t\t\tdataType: 'json',\n\t\t\ttype: 'POST'\n\t\t} );\n\t};\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.forms.js","messages":[{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"$\" type.","line":4,"column":1,"nodeType":"Block","endLine":4,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"mw\" type.","line":5,"column":1,"nodeType":"Block","endLine":5,"endColumn":1},{"ruleId":"no-jquery/no-sizzle","severity":1,"message":"Selector extensions are not allowed","line":74,"column":27,"nodeType":"CallExpression","endLine":74,"endColumn":69},{"ruleId":"prefer-const","severity":1,"message":"'$element' is never reassigned. Use 'const' instead.","line":90,"column":12,"nodeType":"Identifier","messageId":"useConst","endLine":90,"endColumn":20},{"ruleId":"jsdoc/no-undefined-types","severity":1,"message":"The type 'result' is undefined.","line":105,"column":1,"nodeType":"Block","endLine":105,"endColumn":1},{"ruleId":"prefer-const","severity":1,"message":"'sendData' is never reassigned. Use 'const' instead.","line":127,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":127,"endColumn":11},{"ruleId":"es-x/no-object-assign","severity":1,"message":"ES2015 'Object.assign' method is forbidden.","line":163,"column":4,"nodeType":"MemberExpression","messageId":"forbidden","endLine":163,"endColumn":17},{"ruleId":"no-jquery/no-sizzle","severity":1,"message":"Selector extensions are not allowed","line":263,"column":8,"nodeType":"CallExpression","endLine":263,"endColumn":62}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":8,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/**\n * Core functionality for DonationInterface forms\n *\n * @param $\n * @param mw\n */\n( function ( $, mw ) {\n\tconst di = mw.donationInterface; // Defined in ext.donationInterface.validation.js\n\n\t// Common helper functions\n\tfunction disablePaymentSubmitButton() {\n\t\t$( '#paymentSubmitBtn' ).prop( 'disabled', true );\n\t\t$( '#paymentSubmitBtn' ).removeClass( 'enabled' ).addClass( 'disabled' );\n\t}\n\n\tfunction enablePaymentSubmitButton() {\n\t\t$( '#paymentSubmitBtn' ).prop( 'disabled', false );\n\t\t$( '#paymentSubmitBtn' ).removeClass( 'disabled' ).addClass( 'enabled' );\n\t}\n\n\t/**\n\t * Disable all interaction with the form, including buttons.\n\t * Usually done by drawing a semi-opaque overlay.\n\t */\n\tfunction disableForm() {\n\t\t$( '#overlay' ).show();\n\t\tdisablePaymentSubmitButton();\n\t}\n\n\t/**\n\t * Mark all form input fields disabled. This can be used to indicate that\n\t * no revision to donor info is possible after a card iframe is opened.\n\t */\n\tfunction disableInput() {\n\t\t$( '[type=text], [type=number], [type=email], select' ).each( function () {\n\t\t\t$( this ).attr( 'disabled', true );\n\t\t} );\n\t}\n\n\t/**\n\t * Makes a form disabled with disableForm usable again.\n\t */\n\tfunction enableForm() {\n\t\t$( '#overlay' ).hide();\n\t\tenablePaymentSubmitButton();\n\t}\n\n\t/**\n\t * Re-enable input fields disabled with disableInput.\n\t */\n\tfunction enableInput() {\n\t\t$( '[type=text], [type=number], [type=email] select' ).each( function () {\n\t\t\t$( this ).removeAttr( 'disabled' );\n\t\t} );\n\t}\n\n\t/**\n\t * Submit a basic form.\n\t */\n\tfunction submitForm() {\n\t\tdi.forms.disable();\n\t\tdi.forms.clean();\n\t\t$( '#payment-form' )[ 0 ].submit();\n\t}\n\n\tfunction cleanInput() {\n\t\t// Trim all the trimmable inputs\n\t\t$( '[type=text], [type=number], [type=email]' ).each( function () {\n\t\t\t$( this ).val( $.trim( this.value ) );\n\t\t} );\n\t}\n\n\tfunction resetSubmethod() {\n\t\tconst $submethodInput = $( 'input:radio[name=payment_submethod]' );\n\t\tif ( $submethodInput.length > 1 ) {\n\t\t\t$submethodInput.prop( 'checked', false );\n\t\t}\n\t}\n\n\t/**\n\t * Get a trinary value from a checkbox that may exist, falling back\n\t *  to a querystring value.\n\t *  '0' = checkbox shown and not checked, or 0 on querystring\n\t *  '1' = checkbox shown and checked, or 1 on querystring\n\t *  '' = checkbox not shown, querystring value missing\n\t *\n\t * @return {string}\n\t */\n\tfunction getOptIn() {\n\t\tlet val, $element = $( 'input[name=opt_in]:checked' );\n\t\tif ( $element.length === 1 ) {\n\t\t\tval = $element.val();\n\t\t} else {\n\t\t\tval = mw.util.getParamValue( 'opt_in' );\n\t\t\tif ( val === null ) {\n\t\t\t\tval = '';\n\t\t\t}\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t * Call the generic donation API and handle errors or execute a callback\n\t *\n\t * @param {function(result)} successCallback will be called with response's 'result' property\n\t * @param {Array} extraData will be merged into the data collected from the form\n\t * @param {string} action action param to pass to MW API, defaults to 'donate'\n\t */\n\tfunction callDonateApi( successCallback, extraData, action ) {\n\t\tdi.forms.disable();\n\t\tdi.forms.clean();\n\t\t$( '#topError' ).html( '' );\n\t\t$( '#errorReference' )\n\t\t\t.removeClass( 'errorMsg' )\n\t\t\t.addClass( 'errorMsgHide' );\n\t\t$( '#paymentContinueBtn' ).removeClass( 'enabled' );\n\n\t\tlet sendData,\n\t\t\tpaymentSubmethod;\n\n\t\tif ( typeof $( 'input[name=\"payment_submethod\"]:checked' ).val() === 'undefined' ) {\n\t\t\tpaymentSubmethod = '';\n\t\t} else {\n\t\t\tpaymentSubmethod = $( 'input[name=\"payment_submethod\"]:checked' ).val().toLowerCase();\n\t\t}\n\n\t\tsendData = {\n\t\t\taction: action || 'donate',\n\t\t\tgateway: $( '#gateway' ).val(),\n\t\t\tcontact_id: $( '#contact_id' ).val(),\n\t\t\tcontact_hash: $( '#contact_hash' ).val(),\n\t\t\tcurrency: $( '#currency' ).val(),\n\t\t\tamount: $( '#amount' ).val(),\n\t\t\tfirst_name: $( '#first_name' ).val(),\n\t\t\tlast_name: $( '#last_name' ).val(),\n\t\t\tstreet_address: $( '#street_address' ).val(),\n\t\t\tcity: $( '#city' ).val(),\n\t\t\tstate_province: $( '#state_province' ).val(),\n\t\t\tpostal_code: $( '#postal_code' ).val(),\n\t\t\tphone: $( '#phone' ).val(),\n\t\t\temail: $( '#email' ).val(),\n\t\t\tcountry: $( '#country' ).val(),\n\t\t\tpayment_method: $( '#payment_method' ).val(),\n\t\t\tlanguage: $( '#language' ).val(),\n\t\t\tpayment_submethod: paymentSubmethod,\n\t\t\tprocessor_form: $( '#processor_form' ).val(),\n\t\t\tissuer_id: $( '#issuer_id' ).val(),\n\t\t\tutm_source: $( '#utm_source' ).val(),\n\t\t\tutm_campaign: $( '#utm_campaign' ).val(),\n\t\t\tutm_medium: $( '#utm_medium' ).val(),\n\t\t\treferrer: $( '#referrer' ).val(),\n\t\t\trecurring: $( '#recurring' ).val(),\n\t\t\tvariant: $( '#variant' ).val(),\n\t\t\twmf_token: $( '#wmf_token' ).val(),\n\t\t\topt_in: getOptIn(),\n\t\t\temployer: $( '#employer' ).val(),\n\t\t\temployer_id: $( '#employer_id' ).val(),\n\t\t\tstreet_number: $( '#street_number' ).val(),\n\t\t\tformat: 'json'\n\t\t};\n\n\t\tif ( extraData ) {\n\t\t\tObject.assign( sendData, extraData );\n\t\t}\n\n\t\t// If debug logging is enabled and there are debug messages, send them.\n\t\tif ( mw.config.get( 'wgDonationInterfaceLogDebug' ) &&\n\t\t\tdi.forms.debugMessages.length > 0 ) {\n\t\t\tsendData.debug_messages = di.forms.debugMessages.join( '\\n' );\n\t\t}\n\n\t\t$.ajax( {\n\t\t\turl: mw.util.wikiScript( 'api' ),\n\t\t\tdata: sendData,\n\t\t\tdataType: 'json',\n\t\t\ttype: 'POST',\n\t\t\tsuccess: function ( data ) {\n\t\t\t\tif ( typeof data.error !== 'undefined' ) {\n\t\t\t\t\t// FIXME alert sux\n\t\t\t\t\talert( mw.msg( 'donate_interface-error-msg-general' ) );\n\t\t\t\t\t// Show continue button in 2nd section if it exists\n\t\t\t\t\t$( '#paymentContinue' ).show();\n\t\t\t\t} else if ( typeof data.result !== 'undefined' ) {\n\t\t\t\t\tif ( data.result.errors ) {\n\t\t\t\t\t\tmw.donationInterface.validation.showErrors( data.result.errors );\n\t\t\t\t\t\t// Show continue button in 2nd section if it exists\n\t\t\t\t\t\t$( '#paymentContinue' ).show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuccessCallback( data.result );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function ( xhr ) {\n\t\t\t\t// FIXME too\n\t\t\t\talert( mw.msg( 'donate_interface-error-msg-general' ) );\n\t\t\t},\n\t\t\tcomplete: function () {\n\t\t\t\tdi.forms.enable();\n\t\t\t}\n\t\t} );\n\t}\n\n\tfunction isIframe() {\n\t\tconst payment_method = $( '#payment_method' ).val();\n\n\t\tswitch ( payment_method ) {\n\t\tcase 'cc':\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfunction loadScript( script_link, setup_callback ) {\n\t\tconst scriptNode = document.createElement( 'script' );\n\t\tscriptNode.src = script_link;\n\t\tscriptNode.onload = setup_callback;\n\t\tscriptNode.onerror = function () {\n\t\t\tmw.donationInterface.validation.showErrors(\n\t\t\t\t{ general: 'Could not load payment provider Javascript. Please reload or try again later.' }\n\t\t\t);\n\t\t};\n\t\tdocument.body.append( scriptNode );\n\t}\n\n\t// FIXME: move function declarations into object\n\tdi.forms = {\n\t\tdisable: disableForm,\n\t\tdisableInput: disableInput,\n\t\tenable: enableForm,\n\t\tenableInput: enableInput,\n\t\tclean: cleanInput,\n\t\t// Gateways with more complex form submission can overwrite this\n\t\t// property with their own submission function.\n\t\tsubmit: submitForm,\n\t\tcallDonateApi: callDonateApi,\n\t\tisIframe: isIframe,\n\t\tresetSubmethod: resetSubmethod,\n\t\tgetOptIn: getOptIn,\n\t\tloadScript: loadScript,\n\t\tdebugMessages: [],\n\t\taddDebugMessage: function ( message ) {\n\t\t\tdi.forms.debugMessages.push( message );\n\t\t}\n\t};\n\n\t$( () => {\n\n\t\tconst $emailDiv = $( '#email' ).closest( 'div' ),\n\t\t\temailExplainMessage = mw.msg( 'donate_interface-email-explain' ),\n\t\t\toptInValue = mw.donationInterface.forms.getOptIn(),\n\t\t\thasSetClientVariablesError = mw.config.get( 'DonationInterfaceSetClientVariablesError' );\n\n\t\tif ( hasSetClientVariablesError ) {\n\t\t\tlocation.assign( mw.config.get( 'DonationInterfaceFailUrl' ) );\n\t\t\treturn;\n\t\t}\n\n\t\t$( '#first_name' ).focus();\n\n\t\t// If submethods are visible, and a submethod is already selected on\n\t\t// page load, clear it.\n\t\tif ( $( 'input[name=\"payment_submethod\"]:checked:visible' ).length > 0 ) {\n\t\t\tdi.forms.resetSubmethod();\n\t\t}\n\n\t\t// Submit on submethod click if valid, otherwise clear submethod selection.\n\t\t$( 'input[name=\"payment_submethod\"]' ).on( 'click', () => {\n\t\t\tif ( di.validation.validate() ) {\n\t\t\t\tdi.forms.submit();\n\t\t\t} else {\n\t\t\t\tdi.forms.resetSubmethod();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} );\n\n\t\t// Some forms show a 'continue' button when validation errors are found\n\t\t// server-side on the initial submit. When shown, it should validate\n\t\t// and submit the form.\n\t\t$( '#paymentContinueBtn' ).on( 'click', () => {\n\t\t\tif ( di.validation.validate() ) {\n\t\t\t\tdi.forms.submit();\n\t\t\t}\n\t\t} );\n\n\t\t// Only load employer autocomplete js when the employer field is visible\n\t\tif ( $( '#employer' ).length ) {\n\t\t\tmw.loader.load( 'ext.donationInterface.employerAutoComplete' );\n\t\t}\n\n\t\t// Magic to hopefully disable the spinner in case we are returned to this\n\t\t// page via the Back button.\n\t\t$( window ).on(\n\t\t\t'unload', () => {\n\t\t\t\t// wrapped in case it is overwritten\n\t\t\t\tdi.forms.enable();\n\t\t\t\tdi.forms.enableInput();\n\t\t\t}\n\t\t);\n\n\t\tfunction showEmailExplain() {\n\t\t\t$emailDiv.after( '<div id=\"email_explain\">' + emailExplainMessage + '</div>' );\n\t\t}\n\n\t\tif ( optInValue === '0' ) {\n\t\t\tshowEmailExplain();\n\t\t}\n\t} );\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.jaVariant02.js","messages":[{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"mw\" type.","line":8,"column":1,"nodeType":"Block","endLine":8,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"$\" type.","line":9,"column":1,"nodeType":"Block","endLine":9,"endColumn":1}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/**\n * Experiment to determine whether different placeholder text and extra name\n * fields improve donation rates in Japan. Once tests are concluded and optimal\n * text is decided, please make the optimal text standard and delete this and\n * the extension.json module configuration for ext.donationInterface.jaVariant02\n * and ext.donationInterface.adyenCheckoutWithJaVariant02.\n *\n * @param mw\n * @param $\n */\n\n( function ( mw, $ ) {\n\tmw.donationInterface = mw.donationInterface || {};\n\tmw.donationInterface.getExtraData = function () {\n\t\treturn {\n\t\t\tfirst_name_phonetic: $( '#first_name_phonetic' ).val(),\n\t\t\tlast_name_phonetic: $( '#last_name_phonetic' ).val()\n\t\t};\n\t};\n} )( mediaWiki, jQuery );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.monthlyConvert.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'mc' is never reassigned. Use 'const' instead.","line":2,"column":6,"nodeType":"Identifier","messageId":"useConst","endLine":2,"endColumn":8},{"ruleId":"prefer-const","severity":1,"message":"'tyUrl' is never reassigned. Use 'const' instead.","line":6,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":6,"endColumn":8},{"ruleId":"prefer-const","severity":1,"message":"'convertAmounts' is never reassigned. Use 'const' instead.","line":9,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":9,"endColumn":17},{"ruleId":"prefer-const","severity":1,"message":"'numAmounts' is never reassigned. Use 'const' instead.","line":17,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":17,"endColumn":13},{"ruleId":"no-shadow","severity":1,"message":"'currency' is already declared in the upper scope on line 3 column 3.","line":26,"column":49,"nodeType":"Identifier","messageId":"noShadow","endLine":26,"endColumn":57},{"ruleId":"no-shadow","severity":1,"message":"'currency' is already declared in the upper scope on line 3 column 3.","line":34,"column":39,"nodeType":"Identifier","messageId":"noShadow","endLine":34,"endColumn":47},{"ruleId":"no-shadow","severity":1,"message":"'currency' is already declared in the upper scope on line 3 column 3.","line":103,"column":51,"nodeType":"Identifier","messageId":"noShadow","endLine":103,"endColumn":59},{"ruleId":"prefer-const","severity":1,"message":"'rates' is never reassigned. Use 'const' instead.","line":104,"column":7,"nodeType":"Identifier","messageId":"useConst","endLine":104,"endColumn":12},{"ruleId":"prefer-const","severity":1,"message":"'amountRules' is never reassigned. Use 'const' instead.","line":105,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":105,"endColumn":15},{"ruleId":"prefer-const","severity":1,"message":"'$smallAmountMessage' is never reassigned. Use 'const' instead.","line":107,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":107,"endColumn":23},{"ruleId":"prefer-const","severity":1,"message":"'formattedMin' is never reassigned. Use 'const' instead.","line":117,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":117,"endColumn":15},{"ruleId":"prefer-const","severity":1,"message":"'locale' is never reassigned. Use 'const' instead.","line":133,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":133,"endColumn":10},{"ruleId":"prefer-const","severity":1,"message":"'presetAmount' is never reassigned. Use 'const' instead.","line":136,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":136,"endColumn":15}],"suppressedMessages":[{"ruleId":"no-jquery/no-fade","severity":2,"message":"Prefer CSS transitions to .fadeOut","line":179,"column":6,"nodeType":"CallExpression","endLine":183,"endColumn":9,"suppressions":[{"kind":"directive","justification":""}]},{"ruleId":"no-jquery/no-fade","severity":2,"message":"Prefer CSS transitions to .fadeIn","line":180,"column":7,"nodeType":"CallExpression","endLine":180,"endColumn":38,"suppressions":[{"kind":"directive","justification":""}]},{"ruleId":"no-jquery/no-fade","severity":2,"message":"Prefer CSS transitions to .fadeIn","line":181,"column":7,"nodeType":"CallExpression","endLine":181,"endColumn":31,"suppressions":[{"kind":"directive","justification":""}]},{"ruleId":"no-jquery/no-fade","severity":2,"message":"Prefer CSS transitions to .fadeOut","line":188,"column":6,"nodeType":"CallExpression","endLine":188,"endColumn":31,"suppressions":[{"kind":"directive","justification":""}]},{"ruleId":"no-jquery/no-fade","severity":2,"message":"Prefer CSS transitions to .fadeOut","line":189,"column":6,"nodeType":"CallExpression","endLine":191,"endColumn":9,"suppressions":[{"kind":"directive","justification":""}]},{"ruleId":"no-jquery/no-fade","severity":2,"message":"Prefer CSS transitions to .fadeIn","line":190,"column":7,"nodeType":"CallExpression","endLine":190,"endColumn":33,"suppressions":[{"kind":"directive","justification":""}]}],"errorCount":0,"fatalErrorCount":0,"warningCount":13,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( $, mw ) {\n\tlet mc = {},\n\t\tcurrency,\n\t\toriginalAmount,\n\t\t// These config vars are set in GatewayPage::setClientVariables\n\t\ttyUrl = mw.config.get( 'wgDonationInterfaceThankYouUrl' ),\n\t\t// This is set to the ask amounts for the selected currency, or null\n\t\t// if there are no amounts set for it.\n\t\tconvertAmounts = mw.config.get( 'wgDonationInterfaceMonthlyConvertAmounts' );\n\n\tmc.getConvertAsk = function ( amount ) {\n\t\tlet i,\n\t\t\tnumAmounts;\n\t\tif ( !convertAmounts ) {\n\t\t\treturn 0;\n\t\t}\n\t\tnumAmounts = convertAmounts.length;\n\t\tfor ( i = 0; i < numAmounts; i++ ) {\n\t\t\tif ( amount <= convertAmounts[ i ][ 0 ] ) {\n\t\t\t\treturn convertAmounts[ i ][ 1 ];\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t};\n\n\tmc.setConvertAsk = function ( suggestedAmount, currency, locale ) {\n\t\tconst convertAmountFormatted = mc.formatAmount(\n\t\t\tsuggestedAmount, currency, locale\n\t\t);\n\t\t$( '.mc-convert-ask' ).text( convertAmountFormatted );\n\t\t$( '.mc-modal-screen' ).show();\n\t};\n\n\tmc.formatAmount = function ( amount, currency, locale ) {\n\t\tlet formattedAmount;\n\n\t\ttry {\n\t\t\tformattedAmount = amount.toLocaleString(\n\t\t\t\tlocale,\n\t\t\t\t{\n\t\t\t\t\tcurrency: currency,\n\t\t\t\t\tstyle: 'currency'\n\t\t\t\t}\n\t\t\t);\n\t\t} catch ( e ) {\n\t\t\t// Assume a two decimal place currency for fallback\n\t\t\tformattedAmount = currency + ' ' + amount.toFixed( 2 );\n\t\t}\n\t\treturn formattedAmount;\n\t};\n\n\tmc.getSendData = function ( amount ) {\n\t\treturn {\n\t\t\taction: 'di_recurring_convert',\n\t\t\tformat: 'json',\n\t\t\tgateway: $( '#gateway' ).val(),\n\t\t\twmf_token: $( '#wmf_token' ).val(),\n\t\t\tamount: amount\n\t\t};\n\t};\n\n\tmc.postMonthlyConvertDonate = function ( amount, declineMonthlyConvert ) {\n\t\tconst sendData = mc.getSendData( amount );\n\t\tif ( declineMonthlyConvert ) {\n\t\t\tsendData.declineMonthlyConvert = declineMonthlyConvert;\n\t\t}\n\t\t$.ajax( {\n\t\t\turl: mw.util.wikiScript( 'api' ),\n\t\t\tdata: sendData,\n\t\t\tdataType: 'json',\n\t\t\ttype: 'POST',\n\t\t\tsuccess: function ( data ) {\n\t\t\t\tif ( data && !data.error && data.result && !data.result.errors ) {\n\t\t\t\t\tconst url = new URL( tyUrl, location.href );\n\t\t\t\t\tif ( !declineMonthlyConvert ) {\n\t\t\t\t\t\turl.searchParams.set( 'recurringConversion', 1 );\n\t\t\t\t\t}\n\t\t\t\t\tif ( sendData.frequency_unit ) {\n\t\t\t\t\t\turl.searchParams.set( 'frequency_unit', sendData.frequency_unit );\n\t\t\t\t\t}\n\t\t\t\t\tdocument.location.assign( url.toString() );\n\t\t\t\t} else {\n\t\t\t\t\t// FIXME - alert sux. Not much donor can do at this point.\n\t\t\t\t\t// We should let 'em know the recurring conversion failed\n\t\t\t\t\t// but the initial donation worked, then show them the thank\n\t\t\t\t\t// you page.\n\t\t\t\t\tif ( !declineMonthlyConvert ) {\n\t\t\t\t\t\talert( mw.msg( 'donate_interface-monthly-convert-error' ) );\n\t\t\t\t\t}\n\t\t\t\t\tdocument.location.assign( tyUrl );\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function () {\n\t\t\t\t// FIXME too\n\t\t\t\tif ( !declineMonthlyConvert ) {\n\t\t\t\t\talert( mw.msg( 'donate_interface-monthly-convert-error' ) );\n\t\t\t\t}\n\t\t\t\tdocument.location.assign( tyUrl );\n\t\t\t}\n\t\t} );\n\t};\n\n\tmc.setSmallAmountMessageAndMinLocal = function ( currency, locale ) {\n\t\tlet rates = mw.config.get( 'wgDonationInterfaceCurrencyRates' ),\n\t\t\tamountRules = mw.config.get( 'wgDonationInterfaceAmountRules' ),\n\t\t\tformattedMin,\n\t\t\t$smallAmountMessage = $( '#mc-error-smallamount' );\n\n\t\tif ( currency === amountRules.currency || ( typeof rates[ currency ] ) === 'undefined' ) {\n\t\t\tmc.minLocal = amountRules.min;\n\t\t} else {\n\t\t\t// Rates are all relative to USD, so we divide the configured minimum by its corresponding\n\t\t\t// rate to get the minimum in USD, then multiply by the rate of the donation currency to get\n\t\t\t// the minimum in the donation currency.\n\t\t\tmc.minLocal = amountRules.min / rates[ amountRules.currency ] * rates[ currency ];\n\t\t}\n\t\tformattedMin = mc.formatAmount(\n\t\t\tmc.minLocal, currency, locale\n\t\t);\n\t\t$smallAmountMessage.text(\n\t\t\t$smallAmountMessage.text().replace( '$1', formattedMin )\n\t\t);\n\t};\n\n\t// TODO Unify logic for determining whether or not to show monthly convert. This\n\t// is just a sanity check to see if the required DOM elements are there.\n\tmc.canShowModal = function () {\n\t\treturn $( '.mc-modal-screen' ).length > 0;\n\t};\n\n\tmc.init = function () {\n\t\tlet presetAmount,\n\t\t\tlocale = $( '#language' ).val() + '-' + $( '#country' ).val();\n\t\toriginalAmount = +$( '#amount' ).val();\n\t\tcurrency = $( '#currency' ).val();\n\t\tpresetAmount = mc.presetAmount || mc.getConvertAsk( originalAmount );\n\t\tif ( presetAmount === 0 && tyUrl !== null ) {\n\t\t\t// They're donating in an unsupported currency, or are\n\t\t\t// outside of the range where it makes sense to ask for\n\t\t\t// a monthly donation. Just send them to the TY page.\n\t\t\tdocument.location.assign( tyUrl );\n\t\t} else {\n\t\t\tmc.presetAmount = presetAmount;\n\t\t\tmc.setConvertAsk(\n\t\t\t\tpresetAmount,\n\t\t\t\tcurrency,\n\t\t\t\tlocale\n\t\t\t);\n\t\t\tmc.setSmallAmountMessageAndMinLocal( currency, locale );\n\t\t\t$( '.mc-no-button, .mc-close' ).on( 'click keypress', ( e ) => {\n\t\t\t\tif ( e.which === 13 || e.type === 'click' ) {\n\t\t\t\t\tmc.postMonthlyConvertDonate( presetAmount, true );\n\t\t\t\t}\n\t\t\t} );\n\t\t\t$( '.mc-yes-button' ).on( 'click keypress', ( e ) => {\n\t\t\t\tif ( e.which === 13 || e.type === 'click' ) {\n\t\t\t\t\tmc.postMonthlyConvertDonate( presetAmount );\n\t\t\t\t}\n\t\t\t} );\n\t\t\t$( '.mc-donate-monthly-button' ).on( 'click keypress', ( e ) => {\n\t\t\t\tif ( e.which === 13 || e.type === 'click' ) {\n\t\t\t\t\tconst $otherAmountField = $( '#mc-other-amount-input' ),\n\t\t\t\t\t\totherAmount = +$otherAmountField.val(),\n\t\t\t\t\t\t$smallAmountMessage = $( '#mc-error-smallamount' );\n\n\t\t\t\t\tif ( otherAmount < mc.minLocal ) {\n\t\t\t\t\t\t$otherAmountField.addClass( 'errorHighlight' );\n\t\t\t\t\t\t$smallAmountMessage.show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$smallAmountMessage.hide();\n\t\t\t\t\t\t$otherAmountField.removeClass( 'errorHighlight' );\n\t\t\t\t\t\tmc.postMonthlyConvertDonate( otherAmount );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t\t/* eslint-disable no-jquery/no-fade */\n\t\t\t$( '.mc-diff-amount-link' ).on( 'click keypress', ( e ) => {\n\t\t\t\tif ( e.which === 13 || e.type === 'click' ) {\n\t\t\t\t\t$( '.mc-choice' ).fadeOut( () => {\n\t\t\t\t\t\t$( '.mc-edit-amount' ).fadeIn();\n\t\t\t\t\t\t$( '.mc-back' ).fadeIn();\n\t\t\t\t\t\t$( '.mc-other-amount-input' ).focus();\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t\t$( '.mc-back' ).on( 'click keypress', ( e ) => {\n\t\t\t\tif ( e.which === 13 || e.type === 'click' ) {\n\t\t\t\t\t$( '.mc-back' ).fadeOut();\n\t\t\t\t\t$( '.mc-edit-amount' ).fadeOut( () => {\n\t\t\t\t\t\t$( '.mc-choice' ).fadeIn();\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t\t/* eslint-enable no-jquery/no-fade */\n\t\t}\n\n\t};\n\t$( () => {\n\t\tif ( mw.config.get( 'showMConStartup' ) ) {\n\t\t\tmc.init();\n\t\t}\n\t} );\n\tmw.monthlyConvert = mc;\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.monthlyConvertAnnual.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'mc' is never reassigned. Use 'const' instead.","line":3,"column":7,"nodeType":"Identifier","messageId":"useConst","endLine":3,"endColumn":9},{"ruleId":"prefer-const","severity":1,"message":"'originalGetSendData' is never reassigned. Use 'const' instead.","line":3,"column":31,"nodeType":"Identifier","messageId":"useConst","endLine":3,"endColumn":50},{"ruleId":"prefer-const","severity":1,"message":"'originalAmount' is never reassigned. Use 'const' instead.","line":4,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":4,"endColumn":18},{"ruleId":"prefer-const","severity":1,"message":"'$otherAmountMonthlyInput' is never reassigned. Use 'const' instead.","line":5,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":5,"endColumn":28},{"ruleId":"prefer-const","severity":1,"message":"'$otherAmountAnnualInput' is never reassigned. Use 'const' instead.","line":5,"column":62,"nodeType":"Identifier","messageId":"useConst","endLine":5,"endColumn":85},{"ruleId":"prefer-const","severity":1,"message":"'$otherMonthlySubmit' is never reassigned. Use 'const' instead.","line":6,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":6,"endColumn":23},{"ruleId":"prefer-const","severity":1,"message":"'$otherAnnualSubmit' is never reassigned. Use 'const' instead.","line":6,"column":60,"nodeType":"Identifier","messageId":"useConst","endLine":6,"endColumn":78},{"ruleId":"prefer-const","severity":1,"message":"'$smallAmountMessage' is never reassigned. Use 'const' instead.","line":7,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":7,"endColumn":23},{"ruleId":"prefer-const","severity":1,"message":"'originalAmountFormatted' is never reassigned. Use 'const' instead.","line":15,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":15,"endColumn":26}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":9,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( $, mw ) {\n\t$( () => {\n\t\tlet mc = mw.monthlyConvert, originalGetSendData = mc.getSendData, frequencyUnit = 'month',\n\t\t\toriginalAmount = Number( $( '#amount' ).val() ), originalAmountFormatted,\n\t\t\t$otherAmountMonthlyInput = $( '#mc-other-amount-input' ), $otherAmountAnnualInput = $( '#mc-other-amount-input-annual' ),\n\t\t\t$otherMonthlySubmit = $( '.mc-donate-monthly-button' ), $otherAnnualSubmit = $( '.mc-donate-annual-button' ),\n\t\t\t$smallAmountMessage = $( '#mc-error-smallamount' );\n\n\t\tmc.getSendData = function ( amount ) {\n\t\t\tconst data = originalGetSendData( amount );\n\t\t\tdata.frequency_unit = frequencyUnit;\n\t\t\treturn data;\n\t\t};\n\n\t\toriginalAmountFormatted = mc.formatAmount(\n\t\t\toriginalAmount,\n\t\t\t$( '#currency' ).val(),\n\t\t\t$( '#language' ).val() + '-' + $( '#country' ).val()\n\t\t);\n\n\t\t$( '.mc-convert-ask-annual' ).text( originalAmountFormatted );\n\t\t$( '#mc-yes-button-monthly' ).on( 'click keypress', ( e ) => {\n\t\t\tif ( e.which === 13 || e.type === 'click' ) {\n\t\t\t\tfrequencyUnit = 'month';\n\t\t\t\tmc.postMonthlyConvertDonate( mc.presetAmount );\n\t\t\t}\n\t\t} );\n\t\t$( '#mc-yes-button-annual' ).on( 'click keypress', ( e ) => {\n\t\t\tif ( e.which === 13 || e.type === 'click' ) {\n\t\t\t\tfrequencyUnit = 'year';\n\t\t\t\tmc.postMonthlyConvertDonate( originalAmount );\n\t\t\t}\n\t\t} );\n\t\t$otherAmountMonthlyInput.on( 'keyup', () => {\n\t\t\tconst otherAmount = Number( $otherAmountMonthlyInput.val() );\n\t\t\tif ( otherAmount > 0 ) {\n\t\t\t\tfrequencyUnit = 'month';\n\t\t\t\t$otherAmountAnnualInput.val( '' ).removeClass( 'errorHighlight' );\n\t\t\t\t$otherMonthlySubmit.show();\n\t\t\t\t$otherAnnualSubmit.hide();\n\t\t\t\t$smallAmountMessage.hide();\n\t\t\t}\n\t\t} );\n\t\t$otherAmountAnnualInput.on( 'keyup', () => {\n\t\t\tconst otherAmount = Number( $otherAmountAnnualInput.val() );\n\t\t\tif ( otherAmount > 0 ) {\n\t\t\t\tfrequencyUnit = 'year';\n\t\t\t\t$otherAmountMonthlyInput.val( '' ).removeClass( 'errorHighlight' );\n\t\t\t\t$otherAnnualSubmit.show();\n\t\t\t\t$otherMonthlySubmit.hide();\n\t\t\t\t$smallAmountMessage.hide();\n\t\t\t}\n\t\t} );\n\t\t$otherAnnualSubmit.on( 'click keypress', ( e ) => {\n\t\t\tif ( e.which === 13 || e.type === 'click' ) {\n\t\t\t\tconst otherAmount = Number( $otherAmountAnnualInput.val() );\n\n\t\t\t\tif ( otherAmount < mc.minLocal ) {\n\t\t\t\t\t$otherAmountAnnualInput.addClass( 'errorHighlight' );\n\t\t\t\t\t$smallAmountMessage.show();\n\t\t\t\t} else {\n\t\t\t\t\t$smallAmountMessage.hide();\n\t\t\t\t\t$otherAmountAnnualInput.removeClass( 'errorHighlight' );\n\t\t\t\t\tmc.postMonthlyConvertDonate( otherAmount );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.monthlyConvertButtonFlip.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.monthlyConvertMultiplier.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'mc' is never reassigned. Use 'const' instead.","line":3,"column":7,"nodeType":"Identifier","messageId":"useConst","endLine":3,"endColumn":9},{"ruleId":"prefer-const","severity":1,"message":"'originalAmount' is never reassigned. Use 'const' instead.","line":4,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":4,"endColumn":17}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( $ ) {\n\t$( () => {\n\t\tlet mc = mw.monthlyConvert, originalAmount, presetAmount;\n\t\toriginalAmount = parseFloat( $( '#amount' ).val() );\n\t\tpresetAmount = mc.getConvertAsk( originalAmount );\n\t\tpresetAmount = ( presetAmount * 1.1 ).toFixed( 2 ); // Rounds to 2 decimal places\n\t\tpresetAmount = parseFloat( presetAmount ); // Converts back to a number\n\t\tmc.presetAmount = presetAmount;\n\t} );\n} )( jQuery );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.monthlyConvert_003.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.monthlyConvert_010.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.monthlyConvert_011.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'mc' is never reassigned. Use 'const' instead.","line":3,"column":7,"nodeType":"Identifier","messageId":"useConst","endLine":3,"endColumn":9},{"ruleId":"prefer-const","severity":1,"message":"'locale' is never reassigned. Use 'const' instead.","line":4,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":4,"endColumn":10},{"ruleId":"prefer-const","severity":1,"message":"'originalAmount' is never reassigned. Use 'const' instead.","line":5,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":5,"endColumn":17},{"ruleId":"prefer-const","severity":1,"message":"'currency' is never reassigned. Use 'const' instead.","line":6,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":6,"endColumn":11},{"ruleId":"prefer-const","severity":1,"message":"'presetAmount' is never reassigned. Use 'const' instead.","line":7,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":7,"endColumn":15},{"ruleId":"prefer-const","severity":1,"message":"'formattedAsk' is never reassigned. Use 'const' instead.","line":8,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":8,"endColumn":15}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( $, mw ) {\n\t$( () => {\n\t\tlet mc = mw.monthlyConvert, originalAmount, currency, formattedAsk, presetAmount,\n\t\t\tlocale = $( '#language' ).val() + '-' + $( '#country' ).val();\n\t\toriginalAmount = +$( '#amount' ).val();\n\t\tcurrency = $( '#currency' ).val();\n\t\tpresetAmount = mc.getConvertAsk( originalAmount );\n\t\tformattedAsk = mc.formatAmount(\n\t\t\tpresetAmount, currency, locale\n\t\t);\n\t\t$( '.mc-no-button' ).text(\n\t\t\tmw.msg( 'donate_interface-monthly-convert-no-button-variant-011' )\n\t\t);\n\t\t$( '.mc-yes-button' ).text(\n\t\t\tmw.msg( 'donate_interface-monthly-convert-yes-button-variant-011' ).replace(\n\t\t\t\t'<span class=\\\"mc-convert-ask\\\"></span>', formattedAsk\n\t\t\t)\n\t\t);\n\t} );\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.monthlyConvert_015.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.recurUpgrade.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'$submitButton' is never reassigned. Use 'const' instead.","line":3,"column":7,"nodeType":"Identifier","messageId":"useConst","endLine":3,"endColumn":20},{"ruleId":"prefer-const","severity":1,"message":"'$amountField' is never reassigned. Use 'const' instead.","line":4,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":4,"endColumn":16},{"ruleId":"prefer-const","severity":1,"message":"'$otherAmountField' is never reassigned. Use 'const' instead.","line":5,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":5,"endColumn":21},{"ruleId":"prefer-const","severity":1,"message":"'$totalMessage' is never reassigned. Use 'const' instead.","line":6,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":6,"endColumn":17},{"ruleId":"prefer-const","severity":1,"message":"'$newTotalAmount' is never reassigned. Use 'const' instead.","line":7,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":7,"endColumn":19},{"ruleId":"prefer-const","severity":1,"message":"'$form' is never reassigned. Use 'const' instead.","line":8,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":8,"endColumn":9},{"ruleId":"prefer-const","severity":1,"message":"'originalAmount' is never reassigned. Use 'const' instead.","line":9,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":9,"endColumn":18},{"ruleId":"prefer-const","severity":1,"message":"'currency' is never reassigned. Use 'const' instead.","line":10,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":10,"endColumn":12},{"ruleId":"prefer-const","severity":1,"message":"'maximum' is never reassigned. Use 'const' instead.","line":11,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":11,"endColumn":11},{"ruleId":"prefer-const","severity":1,"message":"'nextDateFormatted' is never reassigned. Use 'const' instead.","line":12,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":12,"endColumn":21},{"ruleId":"prefer-const","severity":1,"message":"'preSelectAmount' is never reassigned. Use 'const' instead.","line":14,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":14,"endColumn":19},{"ruleId":"prefer-const","severity":1,"message":"'valueIsValid' is never reassigned. Use 'const' instead.","line":38,"column":4,"nodeType":"Identifier","messageId":"useConst","endLine":38,"endColumn":16}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":12,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( $ ) {\n\t$( () => {\n\t\tlet $submitButton = $( '#save' ),\n\t\t\t$amountField = $( 'input[name=upgrade_amount]' ),\n\t\t\t$otherAmountField = $( 'input[name=upgrade_amount_other]' ),\n\t\t\t$totalMessage = $( '.recurUpgradeMessageToggle' ),\n\t\t\t$newTotalAmount = $( '.recurUpgradeMessageToggle strong' ),\n\t\t\t$form = $( 'form' ),\n\t\t\toriginalAmount = +( $form.attr( 'data-original-amount' ) ),\n\t\t\tcurrency = $form.attr( 'data-currency' ),\n\t\t\tmaximum = +( $form.attr( 'data-maximum' ) ),\n\t\t\tnextDateFormatted = $form.attr( 'data-next-date-formatted' ),\n\t\t\tformatter,\n\t\t\tpreSelectAmount = ( new URLSearchParams( document.location.search ) ).get( 'preSelect' );\n\n\t\t// Avoid console errors in case currency is not supplied\n\t\tif ( currency && currency.length === 3 ) {\n\t\t\tformatter = new Intl.NumberFormat(\n\t\t\t\t$form.attr( 'data-locale' ), {\n\t\t\t\t\tstyle: 'currency',\n\t\t\t\t\tcurrency: $form.attr( 'data-currency' )\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tfunction setTotalAndSubmitState() {\n\t\t\tlet valueIsValid,\n\t\t\t\tvalue = $amountField.filter( ':checked' ).val(),\n\t\t\t\tformattedValue;\n\n\t\t\tif ( value === 'other' ) {\n\t\t\t\tvalue = $otherAmountField.val();\n\t\t\t} else {\n\t\t\t\t$otherAmountField.val( '' );\n\t\t\t}\n\t\t\t// Use unary + operator to tell JS to treat it as a number, not a string\n\t\t\tvalue = +value;\n\t\t\tvalueIsValid = ( value > 0 && value <= maximum );\n\n\t\t\tif ( valueIsValid ) {\n\t\t\t\tformattedValue = formatter.format( originalAmount + value );\n\t\t\t\t$submitButton.removeClass( 'disabled' );\n\t\t\t\t$submitButton.prop( 'disabled', false );\n\t\t\t\tif ( $newTotalAmount.length > 0 ) {\n\t\t\t\t\t$newTotalAmount.text( formattedValue );\n\t\t\t\t} else {\n\t\t\t\t\t$totalMessage.text( mw.message( 'recurupgrade-upgrading-new-amount-and-date',\n\t\t\t\t\t\tformattedValue,\n\t\t\t\t\t\tnextDateFormatted\n\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t\t$totalMessage.show();\n\t\t\t} else {\n\t\t\t\t$submitButton.addClass( 'disabled' );\n\t\t\t\t$submitButton.prop( 'disabled', true );\n\t\t\t\t$totalMessage.hide();\n\t\t\t}\n\t\t}\n\n\t\t$amountField.change( setTotalAndSubmitState );\n\t\t$otherAmountField.on( 'change keypress', ( e ) => {\n\t\t\t// numbers only to get Firefox and Safari to behave\n\t\t\t// this code is also used in donate wiki's other amount field\n\t\t\t// T389066\n\t\t\tconst chr = String.fromCharCode( e.which );\n\t\t\tif ( !'0123456789., '.includes( chr ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} );\n\t\t// We need to use setInterval because the new value of the other amount\n\t\t// field is not immediately available in the keyup handler\n\t\t$otherAmountField.on( 'change keyup', () => {\n\t\t\tsetInterval( setTotalAndSubmitState, 0 );\n\t\t} );\n\t\tif ( preSelectAmount ) {\n\t\t\t$amountField.filter( '[value=' + preSelectAmount + ']' ).prop( 'checked', true );\n\t\t\t$amountField.filter( '[value!=' + preSelectAmount + ']' ).prop( 'checked', false );\n\t\t}\n\t\t$otherAmountField.focus( () => {\n\t\t\t$amountField.filter( '[value=other]' ).prop( 'checked', true );\n\t\t\tsetTotalAndSubmitState();\n\t\t} );\n\t\tsetTotalAndSubmitState();\n\t} );\n} )( jQuery );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.requestNewChecksumLink.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/ext.donationInterface.validation.js","messages":[{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"$\" type.","line":7,"column":1,"nodeType":"Block","endLine":7,"endColumn":1},{"ruleId":"jsdoc/require-param-type","severity":1,"message":"Missing JSDoc @param \"mw\" type.","line":8,"column":1,"nodeType":"Block","endLine":8,"endColumn":1},{"ruleId":"prefer-const","severity":1,"message":"'di' is never reassigned. Use 'const' instead.","line":11,"column":6,"nodeType":"Identifier","messageId":"useConst","endLine":11,"endColumn":8},{"ruleId":"prefer-const","severity":1,"message":"'mcDomains' is never reassigned. Use 'const' instead.","line":13,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":13,"endColumn":12},{"ruleId":"prefer-const","severity":1,"message":"'multiCountrySubdomains' is never reassigned. Use 'const' instead.","line":33,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":33,"endColumn":25},{"ruleId":"prefer-const","severity":1,"message":"'countryTlds' is never reassigned. Use 'const' instead.","line":34,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":34,"endColumn":14},{"ruleId":"no-shadow","severity":1,"message":"'i' is already declared in the upper scope on line 39 column 36.","line":40,"column":26,"nodeType":"Identifier","messageId":"noShadow","endLine":40,"endColumn":27}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":7,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/* globals Mailcheck */\n/**\n * Client-side validation logic for DonationInterface\n * For starters, we just redirect to the existing global functions.\n * They should be rewritten here when we modernize the remaining forms.\n *\n * @param $\n * @param mw\n */\n( function ( $, mw ) {\n\tlet di = mw.donationInterface = mw.donationInterface || {},\n\t\tcheckMail = true,\n\t\tmcDomains = Mailcheck.defaultDomains.concat( [\n\t\t\t'aim.com', 'alice.it', 'aon.at', 'bellsouth.net', 'bigpond.com',\n\t\t\t'bigpond.net.au', 'blueyonder.co.uk', 'btinternet.com',\n\t\t\t'btopenworld.com', 'charter.net', 'cox.net', 'docomo.ne.jp',\n\t\t\t'earthlink.net', 'email.it', 'embarqmail.com', 'ezweb.ne.jp',\n\t\t\t'fastwebnet.it', 'free.fr', 'frontier.com', 'gmx.at', 'gmx.de',\n\t\t\t'gmx.net', 'hetnet.nl', 'home.nl', 'i.softbank.jp', 'iinet.net.au',\n\t\t\t'inwind.it', 'juno.com', 'laposte.net', 'libero.it',\n\t\t\t'mindspring.com', 'netscape.net', 'neuf.fr', 'nifty.com',\n\t\t\t'ntlworld.com', 'o2.pl', 'online.no', 'optonline.net',\n\t\t\t'optusnet.com.au', 'orange.fr', 'pacbell.net', 'planet.nl',\n\t\t\t'q.com', 'qq.com','roadrunner.com', 'rocketmail.com',\n\t\t\t'rogers.com', 'seznam.cz', 'sfr.fr', 'shaw.ca', 'sky.com',\n\t\t\t'skynet.be', 'sympatico.ca', 'talktalk.net', 'telefonica.net',\n\t\t\t'telenet.be', 'telia.com', 'telus.net', 'tin.it',\n\t\t\t'tiscali.co.uk', 'tiscali.it', 'tpg.com.au', 'umich.edu',\n\t\t\t'uol.com.br', 'videotron.ca', 'virgilio.it', 'wanadoo.fr',\n\t\t\t'web.de', 'windstream.net', 'wp.pl', 'xs4all.nl', 'xtra.co.nz',\n\t\t\t'ybb.ne.jp', 'ymail.com', 'ziggo.nl'\n\t\t] ),\n\t\tmultiCountrySubdomains = [ 'yahoo', 'hotmail', 'outlook', 'live' ],\n\t\tcountryTlds = [\n\t\t\t'ca', 'cl', 'co.id', 'co.il', 'co.in', 'co.jp', 'co.uk', 'com.ar',\n\t\t\t'com.au', 'com.br', 'com.mx', 'com.pe', 'com.sg', 'cz', 'de', 'es',\n\t\t\t'fr', 'it', 'jp', 'kr', 'nl', 'pt', 'se'\n\t\t];\n\t$.each( multiCountrySubdomains, ( i, subdomain ) => {\n\t\t$.each( countryTlds, ( i, countryTld ) => {\n\t\t\tmcDomains.push( subdomain + '.' + countryTld );\n\t\t} );\n\t} );\n\n\tfunction showErrors( errors ) {\n\t\tconst generalErrors = [];\n\n\t\t$.each( errors, ( field, message ) => {\n\t\t\tconst $messageField = $( '#' + field + 'Msg' );\n\n\t\t\tif ( $messageField.length > 0 ) {\n\t\t\t\t$( '#' + field ).addClass( 'errorHighlight' );\n\t\t\t\t$messageField\n\t\t\t\t\t.removeClass( 'errorMsgHide' )\n\t\t\t\t\t.addClass( 'errorMsg' )\n\t\t\t\t\t.text( message );\n\t\t\t} else {\n\t\t\t\tgeneralErrors.push( message );\n\t\t\t}\n\t\t} );\n\t\tif ( generalErrors.length > 0 ) {\n\t\t\t$( '#topError' ).html(\n\t\t\t\tgeneralErrors.join( '<br/>' )\n\t\t\t);\n\t\t\t$( '#errorReference' )\n\t\t\t\t.removeClass( 'errorMsgHide' )\n\t\t\t\t.addClass( 'errorMsg' );\n\t\t}\n\t}\n\n\t/**\n\t * Are any errors currently showing, from either server-side or\n\t * client-side validation?\n\t *\n\t * @return {boolean}\n\t */\n\tfunction hasErrors() {\n\t\treturn $( '.errorMsg' ).length > 0;\n\t}\n\n\tdi.validation = {\n\t\tvalidate: function () {\n\t\t\t// This funkiness is to make sure we run all the validations and\n\t\t\t// highlight bad values, rather than short-circuiting the second\n\t\t\t// group of tests if \"&&\" detects that the first tests failed.\n\t\t\tconst results = [\n\t\t\t\t\tthis.validateAmount(),\n\t\t\t\t\tthis.validatePersonal()\n\t\t\t\t],\n\t\t\t\t// Fail if one or more tests failed.\n\t\t\t\tsuccess = ( !results.includes( false ) );\n\n\t\t\treturn success;\n\t\t},\n\t\t// FIXME: Move global scope functions here\n\t\tvalidateAmount: window.validateAmount,\n\t\tvalidatePersonal: window.validate_personal,\n\t\tshowErrors: showErrors,\n\t\thasErrors: hasErrors\n\t};\n\n\t// Set up email error detection and correction\n\t$( document ).on( 'blur', '#email', function () {\n\t\tif ( !checkMail ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Be really conservative - only catch two letter errors\n\t\tMailcheck.domainThreshold = 2; // No way to set from opts!\n\t\t$( this ).mailcheck( {\n\t\t\ttopLevelDomains: [],\n\t\t\tdomains: mcDomains,\n\t\t\tsuggested: function ( element, suggestion ) {\n\t\t\t\tconst message = mw.msg(\n\t\t\t\t\t'donate_interface-did-you-mean',\n\t\t\t\t\tsuggestion.full\n\t\t\t\t);\n\t\t\t\t$( '#emailSuggestion' ).show();\n\t\t\t\t$( '#emailSuggestion span' ).html( message );\n\t\t\t},\n\t\t\tempty: function ( element ) {\n\t\t\t\t$( '#emailSuggestion' ).hide();\n\t\t\t}\n\t\t} );\n\t} );\n\t$( document ).on( 'click', '#emailSuggestion .correction', function () {\n\t\t$( '#email' ).val( $( this ).text() );\n\t\t$( '#emailSuggestion' ).hide();\n\t} );\n\t$( document ).on( 'click', '#emailSuggestion .close-button', () => {\n\t\tcheckMail = false; // Don't bother them again\n\t\t$( '#emailSuggestion' ).hide();\n\t} );\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/js/skinOverride.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/modules/validate_input.js","messages":[{"ruleId":"jsdoc/require-returns","severity":1,"message":"Missing JSDoc @return declaration.","line":1,"column":1,"nodeType":"Block","endLine":4,"endColumn":4},{"ruleId":"prefer-const","severity":1,"message":"'rates' is never reassigned. Use 'const' instead.","line":9,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":9,"endColumn":8},{"ruleId":"prefer-const","severity":1,"message":"'amountRules' is never reassigned. Use 'const' instead.","line":10,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":10,"endColumn":14},{"ruleId":"prefer-const","severity":1,"message":"'$amountMsg' is never reassigned. Use 'const' instead.","line":14,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":14,"endColumn":13},{"ruleId":"prefer-const","severity":1,"message":"'threeDecimalCurrencies' is never reassigned. Use 'const' instead.","line":15,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":15,"endColumn":25},{"ruleId":"prefer-const","severity":1,"message":"'invalids' is never reassigned. Use 'const' instead.","line":87,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":87,"endColumn":11},{"ruleId":"prefer-const","severity":1,"message":"'rules' is never reassigned. Use 'const' instead.","line":88,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":88,"endColumn":8},{"ruleId":"no-shadow","severity":1,"message":"'value' is already declared in the upper scope on line 83 column 6.","line":106,"column":27,"nodeType":"Identifier","messageId":"noShadow","endLine":106,"endColumn":32},{"ruleId":"mediawiki/msg-doc","severity":1,"message":"All possible message keys should be documented. See https://w.wiki/4r9a for details.","line":108,"column":14,"nodeType":"CallExpression","endLine":108,"endColumn":64},{"ruleId":"no-shadow","severity":1,"message":"'i' is already declared in the upper scope on line 86 column 3.","line":114,"column":23,"nodeType":"Identifier","messageId":"noShadow","endLine":114,"endColumn":24},{"ruleId":"prefer-const","severity":1,"message":"'countryField' is never reassigned. Use 'const' instead.","line":146,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":146,"endColumn":14},{"ruleId":"prefer-const","severity":1,"message":"'emailAdd' is never reassigned. Use 'const' instead.","line":169,"column":2,"nodeType":"Identifier","messageId":"useConst","endLine":169,"endColumn":10}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":12,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/**\n * Validate the donation amount to make sure it is formatted correctly and at least a minimum amount.\n * TODO: also validate ceiling\n */\nwindow.validateAmount = function () {\n\tlet error = true,\n\t\tamount = $( 'input[name=\"amount\"]' ).val(), // get the amount\n\t\tcurrency = '',\n\t\trates = mw.config.get( 'wgDonationInterfaceCurrencyRates' ),\n\t\tamountRules = mw.config.get( 'wgDonationInterfaceAmountRules' ),\n\t\tminimumInDonationCurrency,\n\t\tminDisplay,\n\t\tmessage = mediaWiki.msg( 'donate_interface-smallamount-error' ),\n\t\t$amountMsg = $( '#amountMsg' ),\n\t\tthreeDecimalCurrencies = [ 'BHD', 'CLF', 'IQD', 'KWD', 'LYD',\n\t\t\t'MGA', 'MRO', 'OMR', 'TND' ];\n\n\t// Check amount is at least the minimum\n\tif ( $( 'input[name=\"currency\"]' ).length ) {\n\t\tcurrency = $( 'input[name=\"currency\"]' ).val();\n\t}\n\tif ( $( 'select[name=\"currency\"]' ).length ) {\n\t\tcurrency = $( 'select[name=\"currency\"]' ).val();\n\t}\n\n\t// Normalize weird amount formats.\n\t// Don't mess with these unless you know what you're doing.\n\t/*jshint ignore:start*/\n\tamount = amount.replace( /[,.](\\d)$/, '\\:$10' );\n\tamount = amount.replace( /[,.](\\d)(\\d)$/, '\\:$1$2' );\n\tif ( threeDecimalCurrencies.includes( currency ) ) {\n\t\tamount = amount.replace( /[,.](\\d)(\\d)(\\d)$/, '\\:$1$2$3' );\n\t}\n\tamount = amount.replace( /[,.]/g, '' );\n\tamount = amount.replace( /:/, '.' );\n\t$( 'input[name=\"amount\"]' ).val( amount ); // set the new amount back into the form\n\t/*jshint ignore:end*/\n\n\t// Check amount is a real number, sets error as true (good) if no issues\n\terror = ( amount === null || isNaN( amount ) || amount.value <= 0 );\n\n\tif ( currency === amountRules.currency || ( typeof rates[ currency ] ) === 'undefined' ) {\n\t\tminimumInDonationCurrency = amountRules.min;\n\t} else {\n\t\t// Rates are all relative to USD, so we divide the configured minimum by its corresponding\n\t\t// rate to get the minimum in USD, then multiply by the rate of the donation currency to get\n\t\t// the minimum in the donation currency.\n\t\tminimumInDonationCurrency = amountRules.min / rates[ amountRules.currency ] * rates[ currency ];\n\t}\n\t// if we're on a new form, clear existing amount error\n\t$amountMsg.removeClass( 'errorMsg' ).addClass( 'errorMsgHide' ).text( '' );\n\tif ( ( amount < minimumInDonationCurrency ) || error ) {\n\t\t// Round to two decimal places (TODO: no decimals for some currencies)\n\t\tminDisplay = Math.round( minimumInDonationCurrency * 100 ) / 100;\n\t\tmessage = message.replace( '$1', minDisplay + ' ' + currency );\n\t\t$amountMsg.removeClass( 'errorMsgHide' ).addClass( 'errorMsg' ).text( message );\n\n\t\terror = true;\n\t\t// See if we're on a webitects accordion form\n\t\tif ( $( '#step1wrapper' ).length ) {\n\t\t\t$( '#step1wrapper' ).slideDown();\n\t\t\t$( '#paymentContinue' ).show();\n\t\t\t// If we're on an Ingenico iframe form, slide up the 3rd step to force the user to\n\t\t\t// generate a new iframe after they change the form.\n\t\t\tif ( $( '#payment iframe' ).length ) {\n\t\t\t\t$( '#step3wrapper' ).slideUp();\n\t\t\t}\n\t\t}\n\t\t$( '#other-amount' ).val( '' );\n\t\t$( '#other-amount' ).focus();\n\t}\n\treturn !error;\n};\n\n/**\n * Validates the personal information fields\n * FIXME: Bad name, this validates more than just personal info.\n * Move the good parts to ext.donationInterface.validation.js\n *\n * @return {boolean} true if no errors, false otherwise (also uses in-page error messages to notify the user)\n */\nwindow.validate_personal = function () {\n\tlet value, countryField, emailAdd, invalid, apos, dotpos, domain,\n\t\terrorsPresent = false,\n\t\t$formField,\n\t\ti,\n\t\tinvalids = [ '..', '/', '\\\\', ',', '<', '>' ],\n\t\trules = mediaWiki.config.get( 'wgDonationInterfaceValidationRules' ) || [];\n\n\tfunction clearError( field ) {\n\t\t$( '#' + field ).removeClass( 'errorHighlight' );\n\t\t$( '#' + field + 'Msg' )\n\t\t\t.removeClass( 'errorMsg' )\n\t\t\t.addClass( 'errorMsgHide' );\n\t}\n\n\tfunction setError( field, message ) {\n\t\terrorsPresent = true;\n\t\t$( '#' + field ).addClass( 'errorHighlight' );\n\t\t$( '#' + field + 'Msg' )\n\t\t\t.removeClass( 'errorMsgHide' )\n\t\t\t.addClass( 'errorMsg' )\n\t\t\t.text( message );\n\t}\n\n\tfunction isEmpty( field, value ) {\n\t\treturn !$.trim( value ) ||\n\t\t\tvalue === mediaWiki.msg( 'donate_interface-donor-' + field );\n\t}\n\n\t// Generically defined rules set by GatewayAdapter->getClientSideValidationRules\n\t$.each( rules, ( fieldKey, ruleList ) => {\n\t\tclearError( fieldKey );\n\t\t$.each( ruleList, ( i, rule ) => {\n\t\t\tlet failed = false;\n\t\t\t$formField = $( '#' + fieldKey );\n\t\t\tif ( $formField.length === 0 ) {\n\t\t\t\t// Radio button special case. First see if the group exists ...\n\t\t\t\t$formField = $( 'input[name=' + fieldKey + ']' );\n\t\t\t\tif ( $formField.length > 0 ) {\n\t\t\t\t\t// ... then filter to just the selected button\n\t\t\t\t\t$formField = $formField.filter( ':checked' );\n\t\t\t\t} else {\n\t\t\t\t\t// Field doesn't exist by id or by name\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = $formField.val();\n\t\t\tif ( rule.required ) {\n\t\t\t\tif ( isEmpty( fieldKey, value ) ) {\n\t\t\t\t\tfailed = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( rule.pattern && !isEmpty( fieldKey, value ) ) {\n\t\t\t\tif ( !value.match( new RegExp( rule.pattern ) ) ) {\n\t\t\t\t\tfailed = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( failed ) {\n\t\t\t\tsetError( fieldKey, rule.message );\n\t\t\t}\n\t\t} );\n\t} );\n\n\t// FIXME: wouldn't $( '#country' ).val() work for both types?\n\tcountryField = document.getElementById( 'country' );\n\tif ( countryField && countryField.type === 'select-one' ) { // country is a dropdown select\n\t\tif ( !$.trim( countryField.options[ countryField.selectedIndex ].value ) ) {\n\t\t\tsetError(\n\t\t\t\t'country',\n\t\t\t\tmediaWiki.msg( 'donate_interface-error-msg-country' )\n\t\t\t);\n\t\t} else {\n\t\t\tclearError( 'country' );\n\t\t}\n\t} else { // country is a hidden or text input\n\t\tif ( !$.trim( countryField.value ) ) {\n\t\t\tsetError(\n\t\t\t\t'country',\n\t\t\t\tmediaWiki.msg( 'donate_interface-error-msg-country' )\n\t\t\t);\n\t\t} else {\n\t\t\tclearError( 'country' );\n\t\t}\n\t}\n\n\t// validate email address\n\t// FIXME: replace with regex in wgDonationInterfaceValidationRules\n\temailAdd = document.getElementById( 'email' );\n\tif (\n\t\temailAdd &&\n\t\t$.trim( emailAdd.value ) &&\n\t\temailAdd.value !== mediaWiki.msg( 'donate_interface-donor-email' )\n\t) {\n\t\tinvalid = false;\n\n        const specialCharacterRegex = [ '(^[\\\\-])|',\n        '([`!@#$%^&*()_+\\\\-=\\\\[\\\\]{};\\':\"\\\\\\\\|,.<>\\\\/?~]+$)' ];\n\n        if ( new RegExp( specialCharacterRegex.join( '' ) ).test( emailAdd.value ) ) {\n            setError(\n                'email',\n                mediaWiki.msg( 'donate_interface-error-msg-invalid-email' )\n            );\n            invalid = true;\n        }\n\t\tapos = emailAdd.value.indexOf( '@' );\n\t\tdotpos = emailAdd.value.lastIndexOf( '.' );\n\n\t\tif ( apos < 1 || dotpos - apos < 2 ) {\n\t\t\tsetError(\n\t\t\t\t'email',\n\t\t\t\tmediaWiki.msg( 'donate_interface-error-msg-invalid-email' )\n\t\t\t);\n\t\t\tinvalid = true;\n\t\t}\n\n\t\tdomain = emailAdd.value.slice( Math.max( 0, apos + 1 ) );\n\n\t\tfor ( i = 0; i < invalids.length && !invalid; i++ ) {\n\t\t\tif ( domain.includes( invalids[ i ] ) ) {\n\t\t\t\tsetError(\n\t\t\t\t\t'email',\n\t\t\t\t\tmediaWiki.msg( 'donate_interface-error-msg-invalid-email' )\n\t\t\t\t);\n\t\t\t\tinvalid = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( /[0-9]$/.test( domain ) ) {\n\t\t\tsetError(\n\t\t\t\t'email',\n\t\t\t\tmediaWiki.msg( 'donate_interface-error-msg-invalid-email' )\n\t\t\t);\n\t\t}\n\t}\n\n\t// Make sure cookies are enabled\n\tdocument.cookie = 'wmf_test=1;';\n\tif ( document.cookie.includes( 'wmf_test=1' ) ) {\n\t\tdocument.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; // unset the cookie\n\t\tclearError( 'cookie' );\n\t} else {\n\t\terrorsPresent = true; // display error\n\t\tsetError( 'cookie', mediaWiki.msg( 'donate_interface-error-msg-cookies' ) );\n\t}\n\n\treturn !errorsPresent;\n};\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/package-lock.json","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"no-extra-parens","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/package.json","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"no-extra-parens","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]},{"filePath":"/src/repo/paypal_ec_gateway/forms/js/paypal.js","messages":[{"ruleId":"prefer-const","severity":1,"message":"'di' is never reassigned. Use 'const' instead.","line":2,"column":6,"nodeType":"Identifier","messageId":"useConst","endLine":2,"endColumn":8},{"ruleId":"prefer-const","severity":1,"message":"'rules' is never reassigned. Use 'const' instead.","line":3,"column":3,"nodeType":"Identifier","messageId":"useConst","endLine":3,"endColumn":8}],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"( function ( $, mw ) {\n\tlet di = mw.donationInterface,\n\t\trules = mediaWiki.config.get( 'wgDonationInterfaceValidationRules' ) || [],\n\t\trulesSatisfied = false;\n\n\tfunction redirect( result ) {\n\t\t// We don't actually want to enable the form on redirect or in the\n\t\t// complete phase of callDonateApi, so we override enable here.\n\t\tdi.forms.enable = function () {};\n\t\tlocation.assign( result.redirect );\n\t}\n\n\tdi.forms.submit = function () {\n\t\t// MediaWiki uses the \"uselang\" parameter to set the language for localization\n\t\t// Checkout /payments/includes/api/ApiMain.php\n\t\tdi.forms.callDonateApi( redirect, { uselang: $( '#language' ).val() } );\n\t};\n\tif ( rules.length === 0 ) {\n\t\trulesSatisfied = true;\n\t} else {\n\t\t// TODO: refactor validation to separate out showing errors, and\n\t\t// check that all the rules are satisfied on page load without\n\t\t// showing errors.\n\t\tif ( di.forms.getOptIn() !== '' ) {\n\t\t\trulesSatisfied = true;\n\t\t}\n\t}\n\tif ( rulesSatisfied && !di.validation.hasErrors() ) {\n\t\tdi.forms.submit();\n\t}\n} )( jQuery, mediaWiki );\n","usedDeprecatedRules":[{"ruleId":"arrow-parens","replacedBy":[]},{"ruleId":"arrow-spacing","replacedBy":[]},{"ruleId":"lines-between-class-members","replacedBy":[]},{"ruleId":"no-new-require","replacedBy":[]},{"ruleId":"template-curly-spacing","replacedBy":[]},{"ruleId":"implicit-arrow-linebreak","replacedBy":[]},{"ruleId":"array-bracket-spacing","replacedBy":[]},{"ruleId":"block-spacing","replacedBy":[]},{"ruleId":"brace-style","replacedBy":[]},{"ruleId":"comma-dangle","replacedBy":[]},{"ruleId":"comma-style","replacedBy":[]},{"ruleId":"computed-property-spacing","replacedBy":[]},{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"eol-last","replacedBy":[]},{"ruleId":"func-call-spacing","replacedBy":[]},{"ruleId":"key-spacing","replacedBy":[]},{"ruleId":"keyword-spacing","replacedBy":[]},{"ruleId":"linebreak-style","replacedBy":[]},{"ruleId":"max-statements-per-line","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-floating-decimal","replacedBy":[]},{"ruleId":"no-multiple-empty-lines","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-tabs","replacedBy":[]},{"ruleId":"no-trailing-spaces","replacedBy":[]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"object-curly-spacing","replacedBy":[]},{"ruleId":"operator-linebreak","replacedBy":[]},{"ruleId":"quote-props","replacedBy":[]},{"ruleId":"quotes","replacedBy":[]},{"ruleId":"semi","replacedBy":[]},{"ruleId":"semi-spacing","replacedBy":[]},{"ruleId":"semi-style","replacedBy":[]},{"ruleId":"space-before-blocks","replacedBy":[]},{"ruleId":"space-before-function-paren","replacedBy":[]},{"ruleId":"space-in-parens","replacedBy":[]},{"ruleId":"space-infix-ops","replacedBy":[]},{"ruleId":"space-unary-ops","replacedBy":[]},{"ruleId":"switch-colon-spacing","replacedBy":[]},{"ruleId":"no-extra-semi","replacedBy":[]},{"ruleId":"no-mixed-spaces-and-tabs","replacedBy":[]}]}]

--- end ---
$ /usr/bin/npm ci
--- stdout ---

added 445 packages, and audited 446 packages in 7s

92 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

--- end ---
$ /usr/bin/npm test
--- stdout ---

> test
> grunt test

Running "eslint:all" (eslint) task

/src/repo/Gruntfile.js
  35:11  warning  ES2015 'Object.assign' method is forbidden  es-x/no-object-assign

/src/repo/adyen_gateway/forms/adyen.js
    1:26  warning  'Promise' is already defined as a built-in global variable           no-redeclare
    5:3   warning  'configFromServer' is never reassigned. Use 'const' instead          prefer-const
    6:3   warning  'payment_method' is never reassigned. Use 'const' instead            prefer-const
    8:3   warning  'country' is never reassigned. Use 'const' instead                   prefer-const
    9:3   warning  'language' is never reassigned. Use 'const' instead                  prefer-const
   17:3   warning  'GOOGLEPAY_COMPONENT_TYPE' is never reassigned. Use 'const' instead  prefer-const
   18:3   warning  'ACH_GET_DONOR_ADDRESS' is never reassigned. Use 'const' instead     prefer-const
   25:1   warning  Missing JSDoc @return type                                           jsdoc/require-returns-type
   65:5   warning  Unexpected var, use let or const instead                             no-var
   81:23  warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
   83:11  warning  'bContact' is never reassigned. Use 'const' instead                  prefer-const
   84:8   warning  'sContact' is never reassigned. Use 'const' instead                  prefer-const
  132:5   warning  Unexpected var, use let or const instead                             no-var
  163:23  warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
  223:34  warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
  227:14  warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
  311:2   warning  'submitPromise' is never reassigned. Use 'const' instead             prefer-const
  311:22  warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
  399:6   warning  ES2015 'Object.assign' method is forbidden                           es-x/no-object-assign
  538:4   warning  ES2015 'Object.assign' method is forbidden                           es-x/no-object-assign
  548:4   warning  'containerName' is never reassigned. Use 'const' instead             prefer-const
  552:3   warning  'component_type' is never reassigned. Use 'const' instead            prefer-const
  571:3   warning  'oldShowErrors' is never reassigned. Use 'const' instead             prefer-const
  593:3   warning  'config' is never reassigned. Use 'const' instead                    prefer-const
  601:3   warning  'checkoutPromise' is never reassigned. Use 'const' instead           prefer-const
  625:4   warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise
  652:4   warning  ES2015 'Promise' class is forbidden                                  es-x/no-promise

/src/repo/amazon_gateway/amazon.js
    3:6   warning  'clientId' is never reassigned. Use 'const' instead                   prefer-const
    4:3   warning  'sellerId' is never reassigned. Use 'const' instead                   prefer-const
    5:3   warning  'sandbox' is never reassigned. Use 'const' instead                    prefer-const
    6:3   warning  'returnUrl' is never reassigned. Use 'const' instead                  prefer-const
    7:3   warning  'widgetScript' is never reassigned. Use 'const' instead               prefer-const
    8:3   warning  'loginScript' is never reassigned. Use 'const' instead                prefer-const
    9:3   warning  'failPage' is never reassigned. Use 'const' instead                   prefer-const
   10:3   warning  'isRecurring' is never reassigned. Use 'const' instead                prefer-const
   14:3   warning  'validTokenPattern' is never reassigned. Use 'const' instead          prefer-const
   14:23  warning  Use a regular expression literal instead of the 'RegExp' constructor  prefer-regex-literals
   22:3   warning  'CARD_SELECT_DELAY' is never reassigned. Use 'const' instead          prefer-const
   98:2   warning  'accessToken' is never reassigned. Use 'const' instead                prefer-const
   99:2   warning  'loginError' is never reassigned. Use 'const' instead                 prefer-const
  268:8   warning  Selector extensions are not allowed                                   no-jquery/no-sizzle

/src/repo/braintree_gateway/forms/braintree.js
  10:6  warning  'di' is never reassigned. Use 'const' instead              prefer-const
  12:3  warning  'payment_method' is never reassigned. Use 'const' instead  prefer-const

/src/repo/dlocal_gateway/forms/dlocal.js
  27:7  warning  'dlocalInstance' is never reassigned. Use 'const' instead   prefer-const
  28:4  warning  'fields' is never reassigned. Use 'const' instead           prefer-const
  33:4  warning  'commonStyle' is never reassigned. Use 'const' instead      prefer-const
  49:3  warning  'cardField' is never reassigned. Use 'const' instead        prefer-const
  55:3  warning  'expirationField' is never reassigned. Use 'const' instead  prefer-const
  61:3  warning  'cvvField' is never reassigned. Use 'const' instead         prefer-const

/src/repo/gravy_gateway/forms/gravy.js
   11:2   warning  'extraData' is never reassigned. Use 'const' instead                                 prefer-const
   12:2   warning  'configFromServer' is never reassigned. Use 'const' instead                          prefer-const
   13:2   warning  'sessionId' is never reassigned. Use 'const' instead                                 prefer-const
   14:2   warning  'environment' is never reassigned. Use 'const' instead                               prefer-const
   15:2   warning  'gravyId' is never reassigned. Use 'const' instead                                   prefer-const
   16:2   warning  'redirectPaypal' is never reassigned. Use 'const' instead                            prefer-const
   17:2   warning  'googlePaymentClient' is never reassigned. Use 'const' instead                       prefer-const
   19:2   warning  'language' is never reassigned. Use 'const' instead                                  prefer-const
   20:2   warning  'applePayPaySessionVersionNumber' is never reassigned. Use 'const' instead           prefer-const
  119:25  warning  All possible message keys should be documented. See https://w.wiki/4r9a for details  mediawiki/msg-doc
  119:49  warning  All possible message keys should be documented. See https://w.wiki/4r9a for details  mediawiki/msg-doc
  243:8   warning  'extraData' is already declared in the upper scope on line 11 column 2               no-shadow
  393:43  warning  'appleSession' is already declared in the upper scope on line 18 column 2            no-shadow
  439:8   warning  'extraData' is already declared in the upper scope on line 11 column 2               no-shadow

/src/repo/modules/iframe.liberator.js
  1:10  warning  'self' is already defined as a built-in global variable  no-redeclare

/src/repo/modules/js/ext.donationInterface.applePayHelper.js
   4:1  warning  Missing JSDoc @param "$" type                jsdoc/require-param-type
   5:1  warning  Missing JSDoc @param "mw" type               jsdoc/require-param-type
  15:1  warning  Missing JSDoc @param "extraData" type        jsdoc/require-param-type
  16:1  warning  Missing JSDoc @param "billingContact" type   jsdoc/require-param-type
  17:1  warning  Missing JSDoc @param "shippingContact" type  jsdoc/require-param-type

/src/repo/modules/js/ext.donationInterface.employerAutoComplete.js
  28:21  warning  Prefer .then to .done  no-jquery/no-done-fail

/src/repo/modules/js/ext.donationInterface.errorLog.js
  16:3  warning  'postdata' is never reassigned. Use 'const' instead  prefer-const

/src/repo/modules/js/ext.donationInterface.forms.js
    4:1   warning  Missing JSDoc @param "$" type                        jsdoc/require-param-type
    5:1   warning  Missing JSDoc @param "mw" type                       jsdoc/require-param-type
   74:27  warning  Selector extensions are not allowed                  no-jquery/no-sizzle
   90:12  warning  '$element' is never reassigned. Use 'const' instead  prefer-const
  105:1   warning  The type 'result' is undefined                       jsdoc/no-undefined-types
  127:3   warning  'sendData' is never reassigned. Use 'const' instead  prefer-const
  163:4   warning  ES2015 'Object.assign' method is forbidden           es-x/no-object-assign
  263:8   warning  Selector extensions are not allowed                  no-jquery/no-sizzle

/src/repo/modules/js/ext.donationInterface.jaVariant02.js
  8:1  warning  Missing JSDoc @param "mw" type  jsdoc/require-param-type
  9:1  warning  Missing JSDoc @param "$" type   jsdoc/require-param-type

/src/repo/modules/js/ext.donationInterface.monthlyConvert.js
    2:6   warning  'mc' is never reassigned. Use 'const' instead                         prefer-const
    6:3   warning  'tyUrl' is never reassigned. Use 'const' instead                      prefer-const
    9:3   warning  'convertAmounts' is never reassigned. Use 'const' instead             prefer-const
   17:3   warning  'numAmounts' is never reassigned. Use 'const' instead                 prefer-const
   26:49  warning  'currency' is already declared in the upper scope on line 3 column 3  no-shadow
   34:39  warning  'currency' is already declared in the upper scope on line 3 column 3  no-shadow
  103:51  warning  'currency' is already declared in the upper scope on line 3 column 3  no-shadow
  104:7   warning  'rates' is never reassigned. Use 'const' instead                      prefer-const
  105:4   warning  'amountRules' is never reassigned. Use 'const' instead                prefer-const
  107:4   warning  '$smallAmountMessage' is never reassigned. Use 'const' instead        prefer-const
  117:3   warning  'formattedMin' is never reassigned. Use 'const' instead               prefer-const
  133:4   warning  'locale' is never reassigned. Use 'const' instead                     prefer-const
  136:3   warning  'presetAmount' is never reassigned. Use 'const' instead               prefer-const

/src/repo/modules/js/ext.donationInterface.monthlyConvertAnnual.js
   3:7   warning  'mc' is never reassigned. Use 'const' instead                        prefer-const
   3:31  warning  'originalGetSendData' is never reassigned. Use 'const' instead       prefer-const
   4:4   warning  'originalAmount' is never reassigned. Use 'const' instead            prefer-const
   5:4   warning  '$otherAmountMonthlyInput' is never reassigned. Use 'const' instead  prefer-const
   5:62  warning  '$otherAmountAnnualInput' is never reassigned. Use 'const' instead   prefer-const
   6:4   warning  '$otherMonthlySubmit' is never reassigned. Use 'const' instead       prefer-const
   6:60  warning  '$otherAnnualSubmit' is never reassigned. Use 'const' instead        prefer-const
   7:4   warning  '$smallAmountMessage' is never reassigned. Use 'const' instead       prefer-const
  15:3   warning  'originalAmountFormatted' is never reassigned. Use 'const' instead   prefer-const

/src/repo/modules/js/ext.donationInterface.monthlyConvertMultiplier.js
  3:7  warning  'mc' is never reassigned. Use 'const' instead              prefer-const
  4:3  warning  'originalAmount' is never reassigned. Use 'const' instead  prefer-const

/src/repo/modules/js/ext.donationInterface.monthlyConvert_011.js
  3:7  warning  'mc' is never reassigned. Use 'const' instead              prefer-const
  4:4  warning  'locale' is never reassigned. Use 'const' instead          prefer-const
  5:3  warning  'originalAmount' is never reassigned. Use 'const' instead  prefer-const
  6:3  warning  'currency' is never reassigned. Use 'const' instead        prefer-const
  7:3  warning  'presetAmount' is never reassigned. Use 'const' instead    prefer-const
  8:3  warning  'formattedAsk' is never reassigned. Use 'const' instead    prefer-const

/src/repo/modules/js/ext.donationInterface.recurUpgrade.js
   3:7  warning  '$submitButton' is never reassigned. Use 'const' instead      prefer-const
   4:4  warning  '$amountField' is never reassigned. Use 'const' instead       prefer-const
   5:4  warning  '$otherAmountField' is never reassigned. Use 'const' instead  prefer-const
   6:4  warning  '$totalMessage' is never reassigned. Use 'const' instead      prefer-const
   7:4  warning  '$newTotalAmount' is never reassigned. Use 'const' instead    prefer-const
   8:4  warning  '$form' is never reassigned. Use 'const' instead              prefer-const
   9:4  warning  'originalAmount' is never reassigned. Use 'const' instead     prefer-const
  10:4  warning  'currency' is never reassigned. Use 'const' instead           prefer-const
  11:4  warning  'maximum' is never reassigned. Use 'const' instead            prefer-const
  12:4  warning  'nextDateFormatted' is never reassigned. Use 'const' instead  prefer-const
  14:4  warning  'preSelectAmount' is never reassigned. Use 'const' instead    prefer-const
  38:4  warning  'valueIsValid' is never reassigned. Use 'const' instead       prefer-const

/src/repo/modules/js/ext.donationInterface.validation.js
   7:1   warning  Missing JSDoc @param "$" type                                      jsdoc/require-param-type
   8:1   warning  Missing JSDoc @param "mw" type                                     jsdoc/require-param-type
  11:6   warning  'di' is never reassigned. Use 'const' instead                      prefer-const
  13:3   warning  'mcDomains' is never reassigned. Use 'const' instead               prefer-const
  33:3   warning  'multiCountrySubdomains' is never reassigned. Use 'const' instead  prefer-const
  34:3   warning  'countryTlds' is never reassigned. Use 'const' instead             prefer-const
  40:26  warning  'i' is already declared in the upper scope on line 39 column 36    no-shadow

/src/repo/modules/validate_input.js
    1:1   warning  Missing JSDoc @return declaration                                                    jsdoc/require-returns
    9:3   warning  'rates' is never reassigned. Use 'const' instead                                     prefer-const
   10:3   warning  'amountRules' is never reassigned. Use 'const' instead                               prefer-const
   14:3   warning  '$amountMsg' is never reassigned. Use 'const' instead                                prefer-const
   15:3   warning  'threeDecimalCurrencies' is never reassigned. Use 'const' instead                    prefer-const
   87:3   warning  'invalids' is never reassigned. Use 'const' instead                                  prefer-const
   88:3   warning  'rules' is never reassigned. Use 'const' instead                                     prefer-const
  106:27  warning  'value' is already declared in the upper scope on line 83 column 6                   no-shadow
  108:14  warning  All possible message keys should be documented. See https://w.wiki/4r9a for details  mediawiki/msg-doc
  114:23  warning  'i' is already declared in the upper scope on line 86 column 3                       no-shadow
  146:2   warning  'countryField' is never reassigned. Use 'const' instead                              prefer-const
  169:2   warning  'emailAdd' is never reassigned. Use 'const' instead                                  prefer-const

/src/repo/paypal_ec_gateway/forms/js/paypal.js
  2:6  warning  'di' is never reassigned. Use 'const' instead     prefer-const
  3:3  warning  'rules' is never reassigned. Use 'const' instead  prefer-const

✖ 145 problems (0 errors, 145 warnings)


Running "stylelint:all" (stylelint) task
>> Linted 16 files without errors

Running "banana:DonationInterface" (banana) task
>> 10 message directories checked.

Done.

--- end ---
$ /usr/bin/npm audit --json
--- stdout ---
{
  "auditReportVersion": 2,
  "vulnerabilities": {},
  "metadata": {
    "vulnerabilities": {
      "info": 0,
      "low": 0,
      "moderate": 0,
      "high": 0,
      "critical": 0,
      "total": 0
    },
    "dependencies": {
      "prod": 1,
      "dev": 445,
      "optional": 0,
      "peer": 1,
      "peerOptional": 0,
      "total": 445
    }
  }
}

--- end ---
$ package-lock-lint package-lock.json
--- stdout ---
Checking package-lock.json

--- end ---
build: Updating eslint-config-wikimedia to 0.30.0

$ git add .
--- stdout ---

--- end ---
$ git commit -F /tmp/tmpqhug9rea
--- stdout ---
[master 80e7a23] build: Updating eslint-config-wikimedia to 0.30.0
 2 files changed, 8 insertions(+), 8 deletions(-)

--- end ---
$ git format-patch HEAD~1 --stdout
--- stdout ---
From 80e7a2325c3d666e021fe9c2f0be82d257e17eb5 Mon Sep 17 00:00:00 2001
From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org>
Date: Sun, 25 May 2025 05:58:27 +0000
Subject: [PATCH] build: Updating eslint-config-wikimedia to 0.30.0

Change-Id: I1b5241186e3ca1c7356ece882adcfeef22cc2505
---
 package-lock.json | 14 +++++++-------
 package.json      |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 46b1174..5215f24 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -6,7 +6,7 @@
 		"": {
 			"name": "DonationInterface",
 			"devDependencies": {
-				"eslint-config-wikimedia": "0.29.1",
+				"eslint-config-wikimedia": "0.30.0",
 				"grunt": "1.6.1",
 				"grunt-banana-checker": "0.13.0",
 				"grunt-contrib-watch": "1.1.0",
@@ -1485,9 +1485,9 @@
 			}
 		},
 		"node_modules/eslint-config-wikimedia": {
-			"version": "0.29.1",
-			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.29.1.tgz",
-			"integrity": "sha512-4dbL5o3hKGSvreyrGZWLPoTDLFubZ575IQOPhUaTcpbTsi0u05TBEMsOyYkthTaK21vsFQqhSYtxp/xU93BSdA==",
+			"version": "0.30.0",
+			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.30.0.tgz",
+			"integrity": "sha512-i8ESzSoo0x3Jur/0JhAgCVPxbV51zfdI3MN3MVQPnjiFdmo21CNKmiBBmw8JnJ3fx/d5zHDrBa+yDjxSLpnDlA==",
 			"dev": true,
 			"dependencies": {
 				"browserslist-config-wikimedia": "^0.7.0",
@@ -6445,9 +6445,9 @@
 			}
 		},
 		"eslint-config-wikimedia": {
-			"version": "0.29.1",
-			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.29.1.tgz",
-			"integrity": "sha512-4dbL5o3hKGSvreyrGZWLPoTDLFubZ575IQOPhUaTcpbTsi0u05TBEMsOyYkthTaK21vsFQqhSYtxp/xU93BSdA==",
+			"version": "0.30.0",
+			"resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.30.0.tgz",
+			"integrity": "sha512-i8ESzSoo0x3Jur/0JhAgCVPxbV51zfdI3MN3MVQPnjiFdmo21CNKmiBBmw8JnJ3fx/d5zHDrBa+yDjxSLpnDlA==",
 			"dev": true,
 			"requires": {
 				"browserslist-config-wikimedia": "^0.7.0",
diff --git a/package.json b/package.json
index 6697279..5e239ad 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
 		"url": "https://gerrit.wikimedia.org/r/p/mediawiki/extensions/DonationInterface.git"
 	},
 	"devDependencies": {
-		"eslint-config-wikimedia": "0.29.1",
+		"eslint-config-wikimedia": "0.30.0",
 		"grunt": "1.6.1",
 		"grunt-banana-checker": "0.13.0",
 		"grunt-contrib-watch": "1.1.0",
-- 
2.39.5


--- end ---
Source code is licensed under the AGPL.